bedrock_sass 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/_vendor/tinymce/plugins/advlist/index.js +7 -0
  4. data/assets/_vendor/tinymce/plugins/advlist/plugin.js +428 -0
  5. data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -0
  6. data/assets/_vendor/tinymce/plugins/anchor/index.js +7 -0
  7. data/assets/_vendor/tinymce/plugins/anchor/plugin.js +338 -0
  8. data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -0
  9. data/assets/_vendor/tinymce/plugins/autolink/index.js +7 -0
  10. data/assets/_vendor/tinymce/plugins/autolink/plugin.js +404 -0
  11. data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -0
  12. data/assets/_vendor/tinymce/plugins/autoresize/index.js +7 -0
  13. data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +451 -0
  14. data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -0
  15. data/assets/_vendor/tinymce/plugins/autosave/index.js +7 -0
  16. data/assets/_vendor/tinymce/plugins/autosave/plugin.js +608 -0
  17. data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -0
  18. data/assets/_vendor/tinymce/plugins/bbcode/index.js +7 -0
  19. data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +264 -0
  20. data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -0
  21. data/assets/_vendor/tinymce/plugins/charmap/index.js +7 -0
  22. data/assets/_vendor/tinymce/plugins/charmap/plugin.js +850 -0
  23. data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -0
  24. data/assets/_vendor/tinymce/plugins/code/index.js +7 -0
  25. data/assets/_vendor/tinymce/plugins/code/plugin.js +338 -0
  26. data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -0
  27. data/assets/_vendor/tinymce/plugins/codesample/css/prism.css +138 -0
  28. data/assets/_vendor/tinymce/plugins/codesample/index.js +7 -0
  29. data/assets/_vendor/tinymce/plugins/codesample/plugin.js +1582 -0
  30. data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -0
  31. data/assets/_vendor/tinymce/plugins/colorpicker/index.js +7 -0
  32. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +272 -0
  33. data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  34. data/assets/_vendor/tinymce/plugins/contextmenu/index.js +7 -0
  35. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +496 -0
  36. data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -0
  37. data/assets/_vendor/tinymce/plugins/directionality/index.js +7 -0
  38. data/assets/_vendor/tinymce/plugins/directionality/plugin.js +270 -0
  39. data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -0
  40. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
  41. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
  42. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  43. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  44. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
  45. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
  46. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
  47. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
  48. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  49. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
  50. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
  51. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
  52. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  53. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
  54. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
  55. data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
  56. data/assets/_vendor/tinymce/plugins/emoticons/index.js +7 -0
  57. data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +256 -0
  58. data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -0
  59. data/assets/_vendor/tinymce/plugins/fullpage/index.js +7 -0
  60. data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +962 -0
  61. data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -0
  62. data/assets/_vendor/tinymce/plugins/fullscreen/index.js +7 -0
  63. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +455 -0
  64. data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  65. data/assets/_vendor/tinymce/plugins/help/img/logo.png +0 -0
  66. data/assets/_vendor/tinymce/plugins/help/index.js +7 -0
  67. data/assets/_vendor/tinymce/plugins/help/plugin.js +1527 -0
  68. data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -0
  69. data/assets/_vendor/tinymce/plugins/hr/index.js +7 -0
  70. data/assets/_vendor/tinymce/plugins/hr/plugin.js +195 -0
  71. data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -0
  72. data/assets/_vendor/tinymce/plugins/image/index.js +7 -0
  73. data/assets/_vendor/tinymce/plugins/image/plugin.js +1572 -0
  74. data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -0
  75. data/assets/_vendor/tinymce/plugins/imagetools/index.js +7 -0
  76. data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +4444 -0
  77. data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +2 -0
  78. data/assets/_vendor/tinymce/plugins/importcss/index.js +7 -0
  79. data/assets/_vendor/tinymce/plugins/importcss/plugin.js +577 -0
  80. data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -0
  81. data/assets/_vendor/tinymce/plugins/insertdatetime/index.js +7 -0
  82. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +482 -0
  83. data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
  84. data/assets/_vendor/tinymce/plugins/legacyoutput/index.js +7 -0
  85. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +395 -0
  86. data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
  87. data/assets/_vendor/tinymce/plugins/link/index.js +7 -0
  88. data/assets/_vendor/tinymce/plugins/link/plugin.js +1231 -0
  89. data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -0
  90. data/assets/_vendor/tinymce/plugins/lists/index.js +7 -0
  91. data/assets/_vendor/tinymce/plugins/lists/plugin.js +1985 -0
  92. data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -0
  93. data/assets/_vendor/tinymce/plugins/media/index.js +7 -0
  94. data/assets/_vendor/tinymce/plugins/media/plugin.js +2026 -0
  95. data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -0
  96. data/assets/_vendor/tinymce/plugins/nonbreaking/index.js +7 -0
  97. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +313 -0
  98. data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
  99. data/assets/_vendor/tinymce/plugins/noneditable/index.js +7 -0
  100. data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +316 -0
  101. data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -0
  102. data/assets/_vendor/tinymce/plugins/pagebreak/index.js +7 -0
  103. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +354 -0
  104. data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -0
  105. data/assets/_vendor/tinymce/plugins/paste/index.js +7 -0
  106. data/assets/_vendor/tinymce/plugins/paste/plugin.js +2935 -0
  107. data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -0
  108. data/assets/_vendor/tinymce/plugins/preview/index.js +7 -0
  109. data/assets/_vendor/tinymce/plugins/preview/plugin.js +410 -0
  110. data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -0
  111. data/assets/_vendor/tinymce/plugins/print/index.js +7 -0
  112. data/assets/_vendor/tinymce/plugins/print/plugin.js +194 -0
  113. data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -0
  114. data/assets/_vendor/tinymce/plugins/save/index.js +7 -0
  115. data/assets/_vendor/tinymce/plugins/save/plugin.js +370 -0
  116. data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -0
  117. data/assets/_vendor/tinymce/plugins/searchreplace/index.js +7 -0
  118. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +977 -0
  119. data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -0
  120. data/assets/_vendor/tinymce/plugins/spellchecker/index.js +7 -0
  121. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +1419 -0
  122. data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -0
  123. data/assets/_vendor/tinymce/plugins/tabfocus/index.js +7 -0
  124. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +419 -0
  125. data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  126. data/assets/_vendor/tinymce/plugins/table/index.js +7 -0
  127. data/assets/_vendor/tinymce/plugins/table/plugin.js +15527 -0
  128. data/assets/_vendor/tinymce/plugins/table/plugin.min.js +5 -0
  129. data/assets/_vendor/tinymce/plugins/template/index.js +7 -0
  130. data/assets/_vendor/tinymce/plugins/template/plugin.js +807 -0
  131. data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -0
  132. data/assets/_vendor/tinymce/plugins/textcolor/index.js +7 -0
  133. data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +619 -0
  134. data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -0
  135. data/assets/_vendor/tinymce/plugins/textpattern/index.js +7 -0
  136. data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +718 -0
  137. data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -0
  138. data/assets/_vendor/tinymce/plugins/toc/index.js +7 -0
  139. data/assets/_vendor/tinymce/plugins/toc/plugin.js +559 -0
  140. data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -0
  141. data/assets/_vendor/tinymce/plugins/visualblocks/css/visualblocks.css +154 -0
  142. data/assets/_vendor/tinymce/plugins/visualblocks/index.js +7 -0
  143. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +459 -0
  144. data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -0
  145. data/assets/_vendor/tinymce/plugins/visualchars/index.js +7 -0
  146. data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +1325 -0
  147. data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -0
  148. data/assets/_vendor/tinymce/plugins/wordcount/index.js +7 -0
  149. data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +735 -0
  150. data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -0
  151. data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -0
  152. data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -0
  153. data/assets/_vendor/tinymce/skins/lightgray/content.mobile.min.css +1 -0
  154. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-mobile.woff +0 -0
  155. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  156. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
  157. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  158. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  159. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  160. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +131 -0
  161. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  162. data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  163. data/assets/_vendor/tinymce/skins/lightgray/img/anchor.gif +0 -0
  164. data/assets/_vendor/tinymce/skins/lightgray/img/loader.gif +0 -0
  165. data/assets/_vendor/tinymce/skins/lightgray/img/object.gif +0 -0
  166. data/assets/_vendor/tinymce/skins/lightgray/img/trans.gif +0 -0
  167. data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -0
  168. data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +2 -0
  169. data/assets/_vendor/tinymce/themes/inlite/index.js +7 -0
  170. data/assets/_vendor/tinymce/themes/inlite/theme.js +18787 -0
  171. data/assets/_vendor/tinymce/themes/inlite/theme.min.js +5 -0
  172. data/assets/_vendor/tinymce/themes/mobile/index.js +7 -0
  173. data/assets/_vendor/tinymce/themes/mobile/theme.js +23384 -0
  174. data/assets/_vendor/tinymce/themes/mobile/theme.min.js +8 -0
  175. data/assets/_vendor/tinymce/themes/modern/index.js +7 -0
  176. data/assets/_vendor/tinymce/themes/modern/theme.js +18311 -0
  177. data/assets/_vendor/tinymce/themes/modern/theme.min.js +5 -0
  178. data/assets/_vendor/tinymce/tinymce.js +44399 -0
  179. data/assets/bedrock/js/bedrock.js +16587 -6193
  180. data/assets/bedrock/scss/_bedrock-components.scss +16 -0
  181. data/assets/bedrock/scss/_bedrock-settings.scss +15 -0
  182. data/assets/bedrock/scss/components/attachments-grid.scss +138 -0
  183. data/assets/bedrock/scss/components/dropzone-upload.scss +158 -0
  184. data/assets/bedrock/scss/components/global.scss +16 -8
  185. data/assets/bedrock/scss/components/helper-classes.scss +59 -0
  186. data/assets/bedrock/scss/components/inline-edit-box.scss +80 -0
  187. data/assets/bedrock/scss/components/login-box.scss +48 -0
  188. data/assets/bedrock/scss/components/no-content.scss +31 -0
  189. data/assets/bedrock/scss/components/off-canvas-menu.scss +1 -1
  190. data/assets/bedrock/scss/components/page-content.scss +51 -0
  191. data/assets/bedrock/scss/components/reveal-panel.scss +89 -0
  192. data/assets/bedrock/scss/components/select-box.scss +332 -0
  193. data/assets/bedrock/scss/components/tiny-mce-editor.scss +14 -7
  194. data/lib/bedrock_sass.rb +6 -0
  195. data/lib/bedrock_sass/engine.rb +8 -0
  196. data/lib/bedrock_sass/version.rb +1 -1
  197. data/lib/tasks/before_assets_precompile.rake +11 -0
  198. metadata +188 -2
@@ -0,0 +1 @@
1
+ !function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e[f]=d(a[f]);b.apply(null,e)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};g("1",[],function(){var a=function(b){var c=b,d=function(){return c},e=function(a){c=a},f=function(){return a(d())};return{get:d,set:e,clone:f}};return a}),h("5",tinymce.util.Tools.resolve),g("2",["5"],function(a){return a("tinymce.PluginManager")}),g("6",["5"],function(a){return a("tinymce.Env")}),g("7",["5"],function(a){return a("tinymce.util.Delay")}),g("8",[],function(){var a=function(a){return parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10)},b=function(a){return parseInt(a.getParam("autoresize_max_height",0),10)},c=function(a){return a.getParam("autoresize_overflow_padding",1)},d=function(a){return a.getParam("autoresize_bottom_margin",50)},e=function(a){return a.getParam("autoresize_on_init",!0)};return{getAutoResizeMinHeight:a,getAutoResizeMaxHeight:b,getAutoResizeOverflowPadding:c,getAutoResizeBottomMargin:d,shouldAutoResizeOnInit:e}}),g("4",["6","7","8"],function(a,b,c){var d=function(a){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()},e=function(a,c,d,f,h){b.setEditorTimeout(a,function(){g(a,c),d--?e(a,c,d,f,h):h&&h()},f)},f=function(a,b){var c=a.getBody();c&&(c.style.overflowY=b?"":"hidden",b||(c.scrollTop=0))},g=function(b,e){var h,i,j,k,l,m,n,o,p,q,r,s=b.dom;if(i=b.getDoc()){if(d(b))return void f(b,!0);j=i.body,k=c.getAutoResizeMinHeight(b),m=s.getStyle(j,"margin-top",!0),n=s.getStyle(j,"margin-bottom",!0),o=s.getStyle(j,"padding-top",!0),p=s.getStyle(j,"padding-bottom",!0),q=s.getStyle(j,"border-top-width",!0),r=s.getStyle(j,"border-bottom-width",!0),l=j.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||l<=0)&&(l=a.ie?j.scrollHeight:a.webkit&&0===j.clientHeight?0:j.offsetHeight),l>c.getAutoResizeMinHeight(b)&&(k=l);var t=c.getAutoResizeMaxHeight(b);t&&l>t?(k=t,f(b,!0)):f(b,!1),k!==e.get()&&(h=k-e.get(),s.setStyle(b.iframeElement,"height",k+"px"),e.set(k),a.webKit&&h<0&&g(b))}},h=function(a,b){a.on("init",function(){var b,d,e=a.dom;b=c.getAutoResizeOverflowPadding(a),d=c.getAutoResizeBottomMargin(a),b!==!1&&e.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),d!==!1&&e.setStyles(a.getBody(),{paddingBottom:d})}),a.on("nodechange setcontent keyup FullscreenStateChanged",function(c){g(a,b)}),c.shouldAutoResizeOnInit(a)&&a.on("init",function(){e(a,b,20,100,function(){e(a,b,5,1e3)})})};return{setup:h,resize:g}}),g("3",["4"],function(a){var b=function(b,c){b.addCommand("mceAutoResize",function(){a.resize(b,c)})};return{register:b}}),g("0",["1","2","3","4"],function(a,b,c,d){return b.add("autoresize",function(b){if(!b.inline){var e=a(0);c.register(b,e),d.setup(b,e)}}),function(){}}),d("0")()}();
@@ -0,0 +1,7 @@
1
+ // Exports the "autosave" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/autosave')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/autosave'
7
+ require('./plugin.js');
@@ -0,0 +1,608 @@
1
+ (function () {
2
+
3
+ var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
4
+
5
+ // Used when there is no 'main' module.
6
+ // The name is probably (hopefully) unique so minification removes for releases.
7
+ var register_3795 = function (id) {
8
+ var module = dem(id);
9
+ var fragments = id.split('.');
10
+ var target = Function('return this;')();
11
+ for (var i = 0; i < fragments.length - 1; ++i) {
12
+ if (target[fragments[i]] === undefined)
13
+ target[fragments[i]] = {};
14
+ target = target[fragments[i]];
15
+ }
16
+ target[fragments[fragments.length - 1]] = module;
17
+ };
18
+
19
+ var instantiate = function (id) {
20
+ var actual = defs[id];
21
+ var dependencies = actual.deps;
22
+ var definition = actual.defn;
23
+ var len = dependencies.length;
24
+ var instances = new Array(len);
25
+ for (var i = 0; i < len; ++i)
26
+ instances[i] = dem(dependencies[i]);
27
+ var defResult = definition.apply(null, instances);
28
+ if (defResult === undefined)
29
+ throw 'module [' + id + '] returned undefined';
30
+ actual.instance = defResult;
31
+ };
32
+
33
+ var def = function (id, dependencies, definition) {
34
+ if (typeof id !== 'string')
35
+ throw 'module id must be a string';
36
+ else if (dependencies === undefined)
37
+ throw 'no dependencies for ' + id;
38
+ else if (definition === undefined)
39
+ throw 'no definition function for ' + id;
40
+ defs[id] = {
41
+ deps: dependencies,
42
+ defn: definition,
43
+ instance: undefined
44
+ };
45
+ };
46
+
47
+ var dem = function (id) {
48
+ var actual = defs[id];
49
+ if (actual === undefined)
50
+ throw 'module [' + id + '] was undefined';
51
+ else if (actual.instance === undefined)
52
+ instantiate(id);
53
+ return actual.instance;
54
+ };
55
+
56
+ var req = function (ids, callback) {
57
+ var len = ids.length;
58
+ var instances = new Array(len);
59
+ for (var i = 0; i < len; ++i)
60
+ instances[i] = dem(ids[i]);
61
+ callback.apply(null, instances);
62
+ };
63
+
64
+ var ephox = {};
65
+
66
+ ephox.bolt = {
67
+ module: {
68
+ api: {
69
+ define: def,
70
+ require: req,
71
+ demand: dem
72
+ }
73
+ }
74
+ };
75
+
76
+ var define = def;
77
+ var require = req;
78
+ var demand = dem;
79
+ // this helps with minification when using a lot of global references
80
+ var defineGlobal = function (id, ref) {
81
+ define(id, [], function () { return ref; });
82
+ };
83
+ /*jsc
84
+ ["tinymce.plugins.autosave.Plugin","ephox.katamari.api.Cell","tinymce.core.PluginManager","tinymce.plugins.autosave.api.Api","tinymce.plugins.autosave.core.BeforeUnload","tinymce.plugins.autosave.ui.Buttons","global!tinymce.util.Tools.resolve","tinymce.plugins.autosave.core.Storage","global!window","tinymce.core.EditorManager","tinymce.core.util.Tools","tinymce.plugins.autosave.api.Settings","global!setInterval","tinymce.core.util.LocalStorage","tinymce.plugins.autosave.api.Events","global!document","tinymce.plugins.autosave.core.Time"]
85
+ jsc*/
86
+ define(
87
+ 'ephox.katamari.api.Cell',
88
+
89
+ [
90
+ ],
91
+
92
+ function () {
93
+ var Cell = function (initial) {
94
+ var value = initial;
95
+
96
+ var get = function () {
97
+ return value;
98
+ };
99
+
100
+ var set = function (v) {
101
+ value = v;
102
+ };
103
+
104
+ var clone = function () {
105
+ return Cell(get());
106
+ };
107
+
108
+ return {
109
+ get: get,
110
+ set: set,
111
+ clone: clone
112
+ };
113
+ };
114
+
115
+ return Cell;
116
+ }
117
+ );
118
+
119
+ defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
120
+ /**
121
+ * ResolveGlobal.js
122
+ *
123
+ * Released under LGPL License.
124
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
125
+ *
126
+ * License: http://www.tinymce.com/license
127
+ * Contributing: http://www.tinymce.com/contributing
128
+ */
129
+
130
+ define(
131
+ 'tinymce.core.PluginManager',
132
+ [
133
+ 'global!tinymce.util.Tools.resolve'
134
+ ],
135
+ function (resolve) {
136
+ return resolve('tinymce.PluginManager');
137
+ }
138
+ );
139
+
140
+ defineGlobal("global!setInterval", setInterval);
141
+ /**
142
+ * ResolveGlobal.js
143
+ *
144
+ * Released under LGPL License.
145
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
146
+ *
147
+ * License: http://www.tinymce.com/license
148
+ * Contributing: http://www.tinymce.com/contributing
149
+ */
150
+
151
+ define(
152
+ 'tinymce.core.util.LocalStorage',
153
+ [
154
+ 'global!tinymce.util.Tools.resolve'
155
+ ],
156
+ function (resolve) {
157
+ return resolve('tinymce.util.LocalStorage');
158
+ }
159
+ );
160
+
161
+ /**
162
+ * ResolveGlobal.js
163
+ *
164
+ * Released under LGPL License.
165
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
166
+ *
167
+ * License: http://www.tinymce.com/license
168
+ * Contributing: http://www.tinymce.com/contributing
169
+ */
170
+
171
+ define(
172
+ 'tinymce.core.util.Tools',
173
+ [
174
+ 'global!tinymce.util.Tools.resolve'
175
+ ],
176
+ function (resolve) {
177
+ return resolve('tinymce.util.Tools');
178
+ }
179
+ );
180
+
181
+ /**
182
+ * Events.js
183
+ *
184
+ * Released under LGPL License.
185
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
186
+ *
187
+ * License: http://www.tinymce.com/license
188
+ * Contributing: http://www.tinymce.com/contributing
189
+ */
190
+
191
+ define(
192
+ 'tinymce.plugins.autosave.api.Events',
193
+ [
194
+ ],
195
+ function () {
196
+ var fireRestoreDraft = function (editor) {
197
+ return editor.fire('RestoreDraft');
198
+ };
199
+
200
+ var fireStoreDraft = function (editor) {
201
+ return editor.fire('StoreDraft');
202
+ };
203
+
204
+ var fireRemoveDraft = function (editor) {
205
+ return editor.fire('RemoveDraft');
206
+ };
207
+
208
+ return {
209
+ fireRestoreDraft: fireRestoreDraft,
210
+ fireStoreDraft: fireStoreDraft,
211
+ fireRemoveDraft: fireRemoveDraft
212
+ };
213
+ }
214
+ );
215
+
216
+ defineGlobal("global!document", document);
217
+ /**
218
+ * Time.js
219
+ *
220
+ * Released under LGPL License.
221
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
222
+ *
223
+ * License: http://www.tinymce.com/license
224
+ * Contributing: http://www.tinymce.com/contributing
225
+ */
226
+
227
+ define(
228
+ 'tinymce.plugins.autosave.core.Time',
229
+ [
230
+ ],
231
+ function () {
232
+ var parse = function (time, defaultTime) {
233
+ var multiples = {
234
+ s: 1000,
235
+ m: 60000
236
+ };
237
+
238
+ time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime));
239
+
240
+ return (time[2] ? multiples[time[2]] : 1) * parseInt(time, 10);
241
+ };
242
+
243
+ return {
244
+ parse: parse
245
+ };
246
+ }
247
+ );
248
+ /**
249
+ * Settings.js
250
+ *
251
+ * Released under LGPL License.
252
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
253
+ *
254
+ * License: http://www.tinymce.com/license
255
+ * Contributing: http://www.tinymce.com/contributing
256
+ */
257
+
258
+ define(
259
+ 'tinymce.plugins.autosave.api.Settings',
260
+ [
261
+ 'global!document',
262
+ 'tinymce.plugins.autosave.core.Time'
263
+ ],
264
+ function (document, Time) {
265
+ var shouldAskBeforeUnload = function (editor) {
266
+ return editor.getParam("autosave_ask_before_unload", true);
267
+ };
268
+
269
+ var getAutoSavePrefix = function (editor) {
270
+ var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-');
271
+
272
+ prefix = prefix.replace(/\{path\}/g, document.location.pathname);
273
+ prefix = prefix.replace(/\{query\}/g, document.location.search);
274
+ prefix = prefix.replace(/\{hash\}/g, document.location.hash);
275
+ prefix = prefix.replace(/\{id\}/g, editor.id);
276
+
277
+ return prefix;
278
+ };
279
+
280
+ var shouldRestoreWhenEmpty = function (editor) {
281
+ return editor.getParam('autosave_restore_when_empty', false);
282
+ };
283
+
284
+ var getAutoSaveInterval = function (editor) {
285
+ return Time.parse(editor.settings.autosave_interval, '30s');
286
+ };
287
+
288
+ var getAutoSaveRetention = function (editor) {
289
+ return Time.parse(editor.settings.autosave_retention, '20m');
290
+ };
291
+
292
+ return {
293
+ shouldAskBeforeUnload: shouldAskBeforeUnload,
294
+ getAutoSavePrefix: getAutoSavePrefix,
295
+ shouldRestoreWhenEmpty: shouldRestoreWhenEmpty,
296
+ getAutoSaveInterval: getAutoSaveInterval,
297
+ getAutoSaveRetention: getAutoSaveRetention
298
+ };
299
+ }
300
+ );
301
+ /**
302
+ * Storage.js
303
+ *
304
+ * Released under LGPL License.
305
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
306
+ *
307
+ * License: http://www.tinymce.com/license
308
+ * Contributing: http://www.tinymce.com/contributing
309
+ */
310
+
311
+ define(
312
+ 'tinymce.plugins.autosave.core.Storage',
313
+ [
314
+ 'global!setInterval',
315
+ 'tinymce.core.util.LocalStorage',
316
+ 'tinymce.core.util.Tools',
317
+ 'tinymce.plugins.autosave.api.Events',
318
+ 'tinymce.plugins.autosave.api.Settings'
319
+ ],
320
+ function (setInterval, LocalStorage, Tools, Events, Settings) {
321
+ var isEmpty = function (editor, html) {
322
+ var forcedRootBlockName = editor.settings.forced_root_block;
323
+
324
+ html = Tools.trim(typeof html === "undefined" ? editor.getBody().innerHTML : html);
325
+
326
+ return html === '' || new RegExp(
327
+ '^<' + forcedRootBlockName + '[^>]*>((\u00a0|&nbsp;|[ \t]|<br[^>]*>)+?|)<\/' + forcedRootBlockName + '>|<br>$', 'i'
328
+ ).test(html);
329
+ };
330
+
331
+ var hasDraft = function (editor) {
332
+ var time = parseInt(LocalStorage.getItem(Settings.getAutoSavePrefix(editor) + "time"), 10) || 0;
333
+
334
+ if (new Date().getTime() - time > Settings.getAutoSaveRetention(editor)) {
335
+ removeDraft(editor, false);
336
+ return false;
337
+ }
338
+
339
+ return true;
340
+ };
341
+
342
+ var removeDraft = function (editor, fire) {
343
+ var prefix = Settings.getAutoSavePrefix(editor);
344
+
345
+ LocalStorage.removeItem(prefix + "draft");
346
+ LocalStorage.removeItem(prefix + "time");
347
+
348
+ if (fire !== false) {
349
+ Events.fireRemoveDraft(editor);
350
+ }
351
+ };
352
+
353
+ var storeDraft = function (editor) {
354
+ var prefix = Settings.getAutoSavePrefix(editor);
355
+
356
+ if (!isEmpty(editor) && editor.isDirty()) {
357
+ LocalStorage.setItem(prefix + "draft", editor.getContent({ format: 'raw', no_events: true }));
358
+ LocalStorage.setItem(prefix + "time", new Date().getTime());
359
+ Events.fireStoreDraft(editor);
360
+ }
361
+ };
362
+
363
+ var restoreDraft = function (editor) {
364
+ var prefix = Settings.getAutoSavePrefix(editor);
365
+
366
+ if (hasDraft(editor)) {
367
+ editor.setContent(LocalStorage.getItem(prefix + "draft"), { format: 'raw' });
368
+ Events.fireRestoreDraft(editor);
369
+ }
370
+ };
371
+
372
+ var startStoreDraft = function (editor, started) {
373
+ var interval = Settings.getAutoSaveInterval(editor);
374
+
375
+ if (!started.get()) {
376
+ setInterval(function () {
377
+ if (!editor.removed) {
378
+ storeDraft(editor);
379
+ }
380
+ }, interval);
381
+
382
+ started.set(true);
383
+ }
384
+ };
385
+
386
+ var restoreLastDraft = function (editor) {
387
+ editor.undoManager.transact(function () {
388
+ restoreDraft(editor);
389
+ removeDraft(editor);
390
+ });
391
+
392
+ editor.focus();
393
+ };
394
+
395
+ return {
396
+ isEmpty: isEmpty,
397
+ hasDraft: hasDraft,
398
+ removeDraft: removeDraft,
399
+ storeDraft: storeDraft,
400
+ restoreDraft: restoreDraft,
401
+ startStoreDraft: startStoreDraft,
402
+ restoreLastDraft: restoreLastDraft
403
+ };
404
+ }
405
+ );
406
+ /**
407
+ * Api.js
408
+ *
409
+ * Released under LGPL License.
410
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
411
+ *
412
+ * License: http://www.tinymce.com/license
413
+ * Contributing: http://www.tinymce.com/contributing
414
+ */
415
+
416
+ define(
417
+ 'tinymce.plugins.autosave.api.Api',
418
+ [
419
+ 'tinymce.plugins.autosave.core.Storage'
420
+ ],
421
+ function (Storage) {
422
+ // Inlined the curry function since adding Fun without tree shaking to every plugin would produce a lot of bloat
423
+ var curry = function (f, editor) {
424
+ return function () {
425
+ var args = Array.prototype.slice.call(arguments);
426
+ return f.apply(null, [editor].concat(args));
427
+ };
428
+ };
429
+
430
+ var get = function (editor) {
431
+ return {
432
+ hasDraft: curry(Storage.hasDraft, editor),
433
+ storeDraft: curry(Storage.storeDraft, editor),
434
+ restoreDraft: curry(Storage.restoreDraft, editor),
435
+ removeDraft: curry(Storage.removeDraft, editor),
436
+ isEmpty: curry(Storage.isEmpty, editor)
437
+ };
438
+ };
439
+
440
+ return {
441
+ get: get
442
+ };
443
+ }
444
+ );
445
+ defineGlobal("global!window", window);
446
+ /**
447
+ * ResolveGlobal.js
448
+ *
449
+ * Released under LGPL License.
450
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
451
+ *
452
+ * License: http://www.tinymce.com/license
453
+ * Contributing: http://www.tinymce.com/contributing
454
+ */
455
+
456
+ define(
457
+ 'tinymce.core.EditorManager',
458
+ [
459
+ 'global!tinymce.util.Tools.resolve'
460
+ ],
461
+ function (resolve) {
462
+ return resolve('tinymce.EditorManager');
463
+ }
464
+ );
465
+
466
+ /**
467
+ * BeforeUnload.js
468
+ *
469
+ * Released under LGPL License.
470
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
471
+ *
472
+ * License: http://www.tinymce.com/license
473
+ * Contributing: http://www.tinymce.com/contributing
474
+ */
475
+
476
+ define(
477
+ 'tinymce.plugins.autosave.core.BeforeUnload',
478
+ [
479
+ 'global!window',
480
+ 'tinymce.core.EditorManager',
481
+ 'tinymce.core.util.Tools',
482
+ 'tinymce.plugins.autosave.api.Settings'
483
+ ],
484
+ function (window, EditorManager, Tools, Settings) {
485
+ EditorManager._beforeUnloadHandler = function () {
486
+ var msg;
487
+
488
+ Tools.each(EditorManager.get(), function (editor) {
489
+ // Store a draft for each editor instance
490
+ if (editor.plugins.autosave) {
491
+ editor.plugins.autosave.storeDraft();
492
+ }
493
+
494
+ // Setup a return message if the editor is dirty
495
+ if (!msg && editor.isDirty() && Settings.shouldAskBeforeUnload(editor)) {
496
+ msg = editor.translate("You have unsaved changes are you sure you want to navigate away?");
497
+ }
498
+ });
499
+
500
+ return msg;
501
+ };
502
+
503
+ var setup = function (editor) {
504
+ window.onbeforeunload = EditorManager._beforeUnloadHandler;
505
+ };
506
+
507
+ return {
508
+ setup: setup
509
+ };
510
+ }
511
+ );
512
+ /**
513
+ * Buttons.js
514
+ *
515
+ * Released under LGPL License.
516
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
517
+ *
518
+ * License: http://www.tinymce.com/license
519
+ * Contributing: http://www.tinymce.com/contributing
520
+ */
521
+
522
+ define(
523
+ 'tinymce.plugins.autosave.ui.Buttons',
524
+ [
525
+ 'tinymce.plugins.autosave.core.Storage'
526
+ ],
527
+ function (Storage) {
528
+ var postRender = function (editor, started) {
529
+ return function (e) {
530
+ var ctrl = e.control;
531
+
532
+ ctrl.disabled(!Storage.hasDraft(editor));
533
+
534
+ editor.on('StoreDraft RestoreDraft RemoveDraft', function () {
535
+ ctrl.disabled(!Storage.hasDraft(editor));
536
+ });
537
+
538
+ // TODO: Investigate why this is only done on postrender that would
539
+ // make the feature broken if only the menu item was rendered since
540
+ // it is rendered when the menu appears
541
+ Storage.startStoreDraft(editor, started);
542
+ };
543
+ };
544
+
545
+ var register = function (editor, started) {
546
+ editor.addButton('restoredraft', {
547
+ title: 'Restore last draft',
548
+ onclick: function () {
549
+ Storage.restoreLastDraft(editor);
550
+ },
551
+ onPostRender: postRender(editor, started)
552
+ });
553
+
554
+ editor.addMenuItem('restoredraft', {
555
+ text: 'Restore last draft',
556
+ onclick: function () {
557
+ Storage.restoreLastDraft(editor);
558
+ },
559
+ onPostRender: postRender(editor, started),
560
+ context: 'file'
561
+ });
562
+ };
563
+
564
+ return {
565
+ register: register
566
+ };
567
+ }
568
+ );
569
+ /**
570
+ * Plugin.js
571
+ *
572
+ * Released under LGPL License.
573
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
574
+ *
575
+ * License: http://www.tinymce.com/license
576
+ * Contributing: http://www.tinymce.com/contributing
577
+ */
578
+
579
+ /**
580
+ * This class contains all core logic for the autosave plugin.
581
+ *
582
+ * @class tinymce.autosave.Plugin
583
+ * @private
584
+ */
585
+ define(
586
+ 'tinymce.plugins.autosave.Plugin',
587
+ [
588
+ 'ephox.katamari.api.Cell',
589
+ 'tinymce.core.PluginManager',
590
+ 'tinymce.plugins.autosave.api.Api',
591
+ 'tinymce.plugins.autosave.core.BeforeUnload',
592
+ 'tinymce.plugins.autosave.ui.Buttons'
593
+ ],
594
+ function (Cell, PluginManager, Api, BeforeUnload, Buttons) {
595
+ PluginManager.add('autosave', function (editor) {
596
+ var started = Cell(false);
597
+
598
+ BeforeUnload.setup(editor);
599
+ Buttons.register(editor, started);
600
+
601
+ return Api.get(editor);
602
+ });
603
+
604
+ return function () { };
605
+ }
606
+ );
607
+ dem('tinymce.plugins.autosave.Plugin')();
608
+ })();