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})};h("3",tinymce.util.Tools.resolve),g("1",["3"],function(a){return a("tinymce.PluginManager")}),g("5",["3"],function(a){return a("tinymce.util.Tools")}),g("4",["5"],function(a){var b=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]],c=function(c){var d;return d='<table role="list" class="mce-grid">',a.each(b,function(b){d+="<tr>",a.each(b,function(a){var b=c+"/img/smiley-"+a+".gif";d+='<td><a href="#" data-mce-url="'+b+'" data-mce-alt="'+a+'" tabindex="-1" role="option" aria-label="'+a+'"><img src="'+b+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),d+="</tr>"}),d+="</table>"};return{getHtml:c}}),g("2",["4"],function(a){var b=function(a,b,c){a.insertContent(a.dom.createHTML("img",{src:b,alt:c}))},c=function(c,d){var e=a.getHtml(d);c.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:e,onclick:function(a){var d=c.dom.getParent(a.target,"a");d&&(b(c,d.getAttribute("data-mce-url"),d.getAttribute("data-mce-alt")),this.hide())}},tooltip:"Emoticons"})};return{register:c}}),g("0",["1","2"],function(a,b){return a.add("emoticons",function(a,c){b.register(a,c)}),function(){}}),d("0")()}();
@@ -0,0 +1,7 @@
1
+ // Exports the "fullpage" plugin for usage with module loaders
2
+ // Usage:
3
+ // CommonJS:
4
+ // require('tinymce/plugins/fullpage')
5
+ // ES2015:
6
+ // import 'tinymce/plugins/fullpage'
7
+ require('./plugin.js');
@@ -0,0 +1,962 @@
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.fullpage.Plugin","ephox.katamari.api.Cell","tinymce.core.PluginManager","tinymce.plugins.fullpage.api.Commands","tinymce.plugins.fullpage.core.FilterContent","tinymce.plugins.fullpage.ui.Buttons","global!tinymce.util.Tools.resolve","tinymce.plugins.fullpage.ui.Dialog","tinymce.core.util.Tools","tinymce.plugins.fullpage.api.Settings","tinymce.plugins.fullpage.core.Parser","tinymce.plugins.fullpage.core.Protect","tinymce.core.html.DomParser","tinymce.core.html.Node","tinymce.core.html.Serializer"]
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
+ /**
141
+ * ResolveGlobal.js
142
+ *
143
+ * Released under LGPL License.
144
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
145
+ *
146
+ * License: http://www.tinymce.com/license
147
+ * Contributing: http://www.tinymce.com/contributing
148
+ */
149
+
150
+ define(
151
+ 'tinymce.core.util.Tools',
152
+ [
153
+ 'global!tinymce.util.Tools.resolve'
154
+ ],
155
+ function (resolve) {
156
+ return resolve('tinymce.util.Tools');
157
+ }
158
+ );
159
+
160
+ /**
161
+ * ResolveGlobal.js
162
+ *
163
+ * Released under LGPL License.
164
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
165
+ *
166
+ * License: http://www.tinymce.com/license
167
+ * Contributing: http://www.tinymce.com/contributing
168
+ */
169
+
170
+ define(
171
+ 'tinymce.core.html.DomParser',
172
+ [
173
+ 'global!tinymce.util.Tools.resolve'
174
+ ],
175
+ function (resolve) {
176
+ return resolve('tinymce.html.DomParser');
177
+ }
178
+ );
179
+
180
+ /**
181
+ * ResolveGlobal.js
182
+ *
183
+ * Released under LGPL License.
184
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
185
+ *
186
+ * License: http://www.tinymce.com/license
187
+ * Contributing: http://www.tinymce.com/contributing
188
+ */
189
+
190
+ define(
191
+ 'tinymce.core.html.Node',
192
+ [
193
+ 'global!tinymce.util.Tools.resolve'
194
+ ],
195
+ function (resolve) {
196
+ return resolve('tinymce.html.Node');
197
+ }
198
+ );
199
+
200
+ /**
201
+ * ResolveGlobal.js
202
+ *
203
+ * Released under LGPL License.
204
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
205
+ *
206
+ * License: http://www.tinymce.com/license
207
+ * Contributing: http://www.tinymce.com/contributing
208
+ */
209
+
210
+ define(
211
+ 'tinymce.core.html.Serializer',
212
+ [
213
+ 'global!tinymce.util.Tools.resolve'
214
+ ],
215
+ function (resolve) {
216
+ return resolve('tinymce.html.Serializer');
217
+ }
218
+ );
219
+
220
+ /**
221
+ * Settings.js
222
+ *
223
+ * Released under LGPL License.
224
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
225
+ *
226
+ * License: http://www.tinymce.com/license
227
+ * Contributing: http://www.tinymce.com/contributing
228
+ */
229
+
230
+ define(
231
+ 'tinymce.plugins.fullpage.api.Settings',
232
+ [
233
+ ],
234
+ function () {
235
+ var shouldHideInSourceView = function (editor) {
236
+ return editor.getParam('fullpage_hide_in_source_view');
237
+ };
238
+
239
+ var getDefaultXmlPi = function (editor) {
240
+ return editor.getParam('fullpage_default_xml_pi');
241
+ };
242
+
243
+ var getDefaultEncoding = function (editor) {
244
+ return editor.getParam('fullpage_default_encoding');
245
+ };
246
+
247
+ var getDefaultFontFamily = function (editor) {
248
+ return editor.getParam('fullpage_default_font_family');
249
+ };
250
+
251
+ var getDefaultFontSize = function (editor) {
252
+ return editor.getParam('fullpage_default_font_size');
253
+ };
254
+
255
+ var getDefaultTextColor = function (editor) {
256
+ return editor.getParam('fullpage_default_text_color');
257
+ };
258
+
259
+ var getDefaultTitle = function (editor) {
260
+ return editor.getParam('fullpage_default_title');
261
+ };
262
+
263
+ var getDefaultDocType = function (editor) {
264
+ return editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
265
+ };
266
+
267
+ return {
268
+ shouldHideInSourceView: shouldHideInSourceView,
269
+ getDefaultXmlPi: getDefaultXmlPi,
270
+ getDefaultEncoding: getDefaultEncoding,
271
+ getDefaultFontFamily: getDefaultFontFamily,
272
+ getDefaultFontSize: getDefaultFontSize,
273
+ getDefaultTextColor: getDefaultTextColor,
274
+ getDefaultTitle: getDefaultTitle,
275
+ getDefaultDocType: getDefaultDocType
276
+ };
277
+ }
278
+ );
279
+ /**
280
+ * Protect.js
281
+ *
282
+ * Released under LGPL License.
283
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
284
+ *
285
+ * License: http://www.tinymce.com/license
286
+ * Contributing: http://www.tinymce.com/contributing
287
+ */
288
+
289
+ define(
290
+ 'tinymce.plugins.fullpage.core.Parser',
291
+ [
292
+ 'tinymce.core.html.DomParser',
293
+ 'tinymce.core.html.Node',
294
+ 'tinymce.core.html.Serializer',
295
+ 'tinymce.core.util.Tools',
296
+ 'tinymce.plugins.fullpage.api.Settings'
297
+ ],
298
+ function (DomParser, Node, Serializer, Tools, Settings) {
299
+ var parseHeader = function (head) {
300
+ // Parse the contents with a DOM parser
301
+ return new DomParser({
302
+ validate: false,
303
+ root_name: '#document'
304
+ }).parse(head);
305
+ };
306
+
307
+ var htmlToData = function (editor, head) {
308
+ var headerFragment = parseHeader(head), data = {}, elm, matches;
309
+
310
+ function getAttr(elm, name) {
311
+ var value = elm.attr(name);
312
+
313
+ return value || '';
314
+ }
315
+
316
+ // Default some values
317
+ // TODO: Not sure these are used anymore
318
+ data.fontface = Settings.getDefaultFontFamily(editor);
319
+ data.fontsize = Settings.getDefaultFontSize(editor);
320
+
321
+ // Parse XML PI
322
+ elm = headerFragment.firstChild;
323
+ if (elm.type === 7) {
324
+ data.xml_pi = true;
325
+ matches = /encoding="([^"]+)"/.exec(elm.value);
326
+ if (matches) {
327
+ data.docencoding = matches[1];
328
+ }
329
+ }
330
+
331
+ // Parse doctype
332
+ elm = headerFragment.getAll('#doctype')[0];
333
+ if (elm) {
334
+ data.doctype = '<!DOCTYPE' + elm.value + ">";
335
+ }
336
+
337
+ // Parse title element
338
+ elm = headerFragment.getAll('title')[0];
339
+ if (elm && elm.firstChild) {
340
+ data.title = elm.firstChild.value;
341
+ }
342
+
343
+ // Parse meta elements
344
+ Tools.each(headerFragment.getAll('meta'), function (meta) {
345
+ var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
346
+
347
+ if (name) {
348
+ data[name.toLowerCase()] = meta.attr('content');
349
+ } else if (httpEquiv === "Content-Type") {
350
+ matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
351
+
352
+ if (matches) {
353
+ data.docencoding = matches[1];
354
+ }
355
+ }
356
+ });
357
+
358
+ // Parse html attribs
359
+ elm = headerFragment.getAll('html')[0];
360
+ if (elm) {
361
+ data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
362
+ }
363
+
364
+ // Parse stylesheets
365
+ data.stylesheets = [];
366
+ Tools.each(headerFragment.getAll('link'), function (link) {
367
+ if (link.attr('rel') === 'stylesheet') {
368
+ data.stylesheets.push(link.attr('href'));
369
+ }
370
+ });
371
+
372
+ // Parse body parts
373
+ elm = headerFragment.getAll('body')[0];
374
+ if (elm) {
375
+ data.langdir = getAttr(elm, 'dir');
376
+ data.style = getAttr(elm, 'style');
377
+ data.visited_color = getAttr(elm, 'vlink');
378
+ data.link_color = getAttr(elm, 'link');
379
+ data.active_color = getAttr(elm, 'alink');
380
+ }
381
+
382
+ return data;
383
+ };
384
+
385
+ var dataToHtml = function (editor, data, head) {
386
+ var headerFragment, headElement, html, elm, value, dom = editor.dom;
387
+
388
+ function setAttr(elm, name, value) {
389
+ elm.attr(name, value ? value : undefined);
390
+ }
391
+
392
+ function addHeadNode(node) {
393
+ if (headElement.firstChild) {
394
+ headElement.insert(node, headElement.firstChild);
395
+ } else {
396
+ headElement.append(node);
397
+ }
398
+ }
399
+
400
+ headerFragment = parseHeader(head);
401
+ headElement = headerFragment.getAll('head')[0];
402
+ if (!headElement) {
403
+ elm = headerFragment.getAll('html')[0];
404
+ headElement = new Node('head', 1);
405
+
406
+ if (elm.firstChild) {
407
+ elm.insert(headElement, elm.firstChild, true);
408
+ } else {
409
+ elm.append(headElement);
410
+ }
411
+ }
412
+
413
+ // Add/update/remove XML-PI
414
+ elm = headerFragment.firstChild;
415
+ if (data.xml_pi) {
416
+ value = 'version="1.0"';
417
+
418
+ if (data.docencoding) {
419
+ value += ' encoding="' + data.docencoding + '"';
420
+ }
421
+
422
+ if (elm.type !== 7) {
423
+ elm = new Node('xml', 7);
424
+ headerFragment.insert(elm, headerFragment.firstChild, true);
425
+ }
426
+
427
+ elm.value = value;
428
+ } else if (elm && elm.type === 7) {
429
+ elm.remove();
430
+ }
431
+
432
+ // Add/update/remove doctype
433
+ elm = headerFragment.getAll('#doctype')[0];
434
+ if (data.doctype) {
435
+ if (!elm) {
436
+ elm = new Node('#doctype', 10);
437
+
438
+ if (data.xml_pi) {
439
+ headerFragment.insert(elm, headerFragment.firstChild);
440
+ } else {
441
+ addHeadNode(elm);
442
+ }
443
+ }
444
+
445
+ elm.value = data.doctype.substring(9, data.doctype.length - 1);
446
+ } else if (elm) {
447
+ elm.remove();
448
+ }
449
+
450
+ // Add meta encoding
451
+ elm = null;
452
+ Tools.each(headerFragment.getAll('meta'), function (meta) {
453
+ if (meta.attr('http-equiv') === 'Content-Type') {
454
+ elm = meta;
455
+ }
456
+ });
457
+
458
+ if (data.docencoding) {
459
+ if (!elm) {
460
+ elm = new Node('meta', 1);
461
+ elm.attr('http-equiv', 'Content-Type');
462
+ elm.shortEnded = true;
463
+ addHeadNode(elm);
464
+ }
465
+
466
+ elm.attr('content', 'text/html; charset=' + data.docencoding);
467
+ } else if (elm) {
468
+ elm.remove();
469
+ }
470
+
471
+ // Add/update/remove title
472
+ elm = headerFragment.getAll('title')[0];
473
+ if (data.title) {
474
+ if (!elm) {
475
+ elm = new Node('title', 1);
476
+ addHeadNode(elm);
477
+ } else {
478
+ elm.empty();
479
+ }
480
+
481
+ elm.append(new Node('#text', 3)).value = data.title;
482
+ } else if (elm) {
483
+ elm.remove();
484
+ }
485
+
486
+ // Add/update/remove meta
487
+ Tools.each('keywords,description,author,copyright,robots'.split(','), function (name) {
488
+ var nodes = headerFragment.getAll('meta'), i, meta, value = data[name];
489
+
490
+ for (i = 0; i < nodes.length; i++) {
491
+ meta = nodes[i];
492
+
493
+ if (meta.attr('name') === name) {
494
+ if (value) {
495
+ meta.attr('content', value);
496
+ } else {
497
+ meta.remove();
498
+ }
499
+
500
+ return;
501
+ }
502
+ }
503
+
504
+ if (value) {
505
+ elm = new Node('meta', 1);
506
+ elm.attr('name', name);
507
+ elm.attr('content', value);
508
+ elm.shortEnded = true;
509
+
510
+ addHeadNode(elm);
511
+ }
512
+ });
513
+
514
+ var currentStyleSheetsMap = {};
515
+ Tools.each(headerFragment.getAll('link'), function (stylesheet) {
516
+ if (stylesheet.attr('rel') === 'stylesheet') {
517
+ currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
518
+ }
519
+ });
520
+
521
+ // Add new
522
+ Tools.each(data.stylesheets, function (stylesheet) {
523
+ if (!currentStyleSheetsMap[stylesheet]) {
524
+ elm = new Node('link', 1);
525
+ elm.attr({
526
+ rel: 'stylesheet',
527
+ text: 'text/css',
528
+ href: stylesheet
529
+ });
530
+ elm.shortEnded = true;
531
+ addHeadNode(elm);
532
+ }
533
+
534
+ delete currentStyleSheetsMap[stylesheet];
535
+ });
536
+
537
+ // Delete old
538
+ Tools.each(currentStyleSheetsMap, function (stylesheet) {
539
+ stylesheet.remove();
540
+ });
541
+
542
+ // Update body attributes
543
+ elm = headerFragment.getAll('body')[0];
544
+ if (elm) {
545
+ setAttr(elm, 'dir', data.langdir);
546
+ setAttr(elm, 'style', data.style);
547
+ setAttr(elm, 'vlink', data.visited_color);
548
+ setAttr(elm, 'link', data.link_color);
549
+ setAttr(elm, 'alink', data.active_color);
550
+
551
+ // Update iframe body as well
552
+ dom.setAttribs(editor.getBody(), {
553
+ style: data.style,
554
+ dir: data.dir,
555
+ vLink: data.visited_color,
556
+ link: data.link_color,
557
+ aLink: data.active_color
558
+ });
559
+ }
560
+
561
+ // Set html attributes
562
+ elm = headerFragment.getAll('html')[0];
563
+ if (elm) {
564
+ setAttr(elm, 'lang', data.langcode);
565
+ setAttr(elm, 'xml:lang', data.langcode);
566
+ }
567
+
568
+ // No need for a head element
569
+ if (!headElement.firstChild) {
570
+ headElement.remove();
571
+ }
572
+
573
+ // Serialize header fragment and crop away body part
574
+ html = new Serializer({
575
+ validate: false,
576
+ indent: true,
577
+ apply_source_formatting: true,
578
+ indent_before: 'head,html,body,meta,title,script,link,style',
579
+ indent_after: 'head,html,body,meta,title,script,link,style'
580
+ }).serialize(headerFragment);
581
+
582
+ return html.substring(0, html.indexOf('</body>'));
583
+ };
584
+
585
+ return {
586
+ parseHeader: parseHeader,
587
+ htmlToData: htmlToData,
588
+ dataToHtml: dataToHtml
589
+ };
590
+ }
591
+ );
592
+
593
+ /**
594
+ * Dialog.js
595
+ *
596
+ * Released under LGPL License.
597
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
598
+ *
599
+ * License: http://www.tinymce.com/license
600
+ * Contributing: http://www.tinymce.com/contributing
601
+ */
602
+
603
+ define(
604
+ 'tinymce.plugins.fullpage.ui.Dialog',
605
+ [
606
+ 'tinymce.core.util.Tools',
607
+ 'tinymce.plugins.fullpage.core.Parser'
608
+ ],
609
+ function (Tools, Parser) {
610
+ var open = function (editor, headState) {
611
+ var data = Parser.htmlToData(editor, headState.get());
612
+
613
+ editor.windowManager.open({
614
+ title: 'Document properties',
615
+ data: data,
616
+ defaults: { type: 'textbox', size: 40 },
617
+ body: [
618
+ { name: 'title', label: 'Title' },
619
+ { name: 'keywords', label: 'Keywords' },
620
+ { name: 'description', label: 'Description' },
621
+ { name: 'robots', label: 'Robots' },
622
+ { name: 'author', label: 'Author' },
623
+ { name: 'docencoding', label: 'Encoding' }
624
+ ],
625
+ onSubmit: function (e) {
626
+ var headHtml = Parser.dataToHtml(editor, Tools.extend(data, e.data), headState.get());
627
+ headState.set(headHtml);
628
+ }
629
+ });
630
+ };
631
+
632
+ return {
633
+ open: open
634
+ };
635
+ }
636
+ );
637
+
638
+ /**
639
+ * Commands.js
640
+ *
641
+ * Released under LGPL License.
642
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
643
+ *
644
+ * License: http://www.tinymce.com/license
645
+ * Contributing: http://www.tinymce.com/contributing
646
+ */
647
+
648
+ define(
649
+ 'tinymce.plugins.fullpage.api.Commands',
650
+ [
651
+ 'tinymce.plugins.fullpage.ui.Dialog'
652
+ ],
653
+ function (Dialog) {
654
+ var register = function (editor, headState) {
655
+ editor.addCommand('mceFullPageProperties', function () {
656
+ Dialog.open(editor, headState);
657
+ });
658
+ };
659
+
660
+ return {
661
+ register: register
662
+ };
663
+ }
664
+ );
665
+ /**
666
+ * Protect.js
667
+ *
668
+ * Released under LGPL License.
669
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
670
+ *
671
+ * License: http://www.tinymce.com/license
672
+ * Contributing: http://www.tinymce.com/contributing
673
+ */
674
+
675
+ define(
676
+ 'tinymce.plugins.fullpage.core.Protect',
677
+ [
678
+ 'tinymce.core.util.Tools'
679
+ ],
680
+ function (Tools) {
681
+ var protectHtml = function (protect, html) {
682
+ Tools.each(protect, function (pattern) {
683
+ html = html.replace(pattern, function (str) {
684
+ return '<!--mce:protected ' + escape(str) + '-->';
685
+ });
686
+ });
687
+
688
+ return html;
689
+ };
690
+
691
+ var unprotectHtml = function (html) {
692
+ return html.replace(/<!--mce:protected ([\s\S]*?)-->/g, function (a, m) {
693
+ return unescape(m);
694
+ });
695
+ };
696
+
697
+ return {
698
+ protectHtml: protectHtml,
699
+ unprotectHtml: unprotectHtml
700
+ };
701
+ }
702
+ );
703
+
704
+ /**
705
+ * FilterContent.js
706
+ *
707
+ * Released under LGPL License.
708
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
709
+ *
710
+ * License: http://www.tinymce.com/license
711
+ * Contributing: http://www.tinymce.com/contributing
712
+ */
713
+
714
+ define(
715
+ 'tinymce.plugins.fullpage.core.FilterContent',
716
+ [
717
+ 'tinymce.core.util.Tools',
718
+ 'tinymce.plugins.fullpage.api.Settings',
719
+ 'tinymce.plugins.fullpage.core.Parser',
720
+ 'tinymce.plugins.fullpage.core.Protect'
721
+ ],
722
+ function (Tools, Settings, Parser, Protect) {
723
+ var each = Tools.each;
724
+
725
+ var low = function (s) {
726
+ return s.replace(/<\/?[A-Z]+/g, function (a) {
727
+ return a.toLowerCase();
728
+ });
729
+ };
730
+
731
+ var handleSetContent = function (editor, headState, footState, evt) {
732
+ var startPos, endPos, content, headerFragment, styles = '', dom = editor.dom, elm;
733
+
734
+ if (evt.selection) {
735
+ return;
736
+ }
737
+
738
+ content = Protect.protectHtml(editor.settings.protect, evt.content);
739
+
740
+ // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
741
+ if (evt.format === 'raw' && headState.get()) {
742
+ return;
743
+ }
744
+
745
+ if (evt.source_view && Settings.shouldHideInSourceView(editor)) {
746
+ return;
747
+ }
748
+
749
+ // Fixed so new document/setContent('') doesn't remove existing header/footer except when it's in source code view
750
+ if (content.length === 0 && !evt.source_view) {
751
+ content = Tools.trim(headState.get()) + '\n' + Tools.trim(content) + '\n' + Tools.trim(footState.get());
752
+ }
753
+
754
+ // Parse out head, body and footer
755
+ content = content.replace(/<(\/?)BODY/gi, '<$1body');
756
+ startPos = content.indexOf('<body');
757
+
758
+ if (startPos !== -1) {
759
+ startPos = content.indexOf('>', startPos);
760
+ headState.set(low(content.substring(0, startPos + 1)));
761
+
762
+ endPos = content.indexOf('</body', startPos);
763
+ if (endPos === -1) {
764
+ endPos = content.length;
765
+ }
766
+
767
+ evt.content = Tools.trim(content.substring(startPos + 1, endPos));
768
+ footState.set(low(content.substring(endPos)));
769
+ } else {
770
+ headState.set(getDefaultHeader(editor));
771
+ footState.set('\n</body>\n</html>');
772
+ }
773
+
774
+ // Parse header and update iframe
775
+ headerFragment = Parser.parseHeader(headState.get());
776
+ each(headerFragment.getAll('style'), function (node) {
777
+ if (node.firstChild) {
778
+ styles += node.firstChild.value;
779
+ }
780
+ });
781
+
782
+ elm = headerFragment.getAll('body')[0];
783
+ if (elm) {
784
+ dom.setAttribs(editor.getBody(), {
785
+ style: elm.attr('style') || '',
786
+ dir: elm.attr('dir') || '',
787
+ vLink: elm.attr('vlink') || '',
788
+ link: elm.attr('link') || '',
789
+ aLink: elm.attr('alink') || ''
790
+ });
791
+ }
792
+
793
+ dom.remove('fullpage_styles');
794
+
795
+ var headElm = editor.getDoc().getElementsByTagName('head')[0];
796
+
797
+ if (styles) {
798
+ dom.add(headElm, 'style', {
799
+ id: 'fullpage_styles'
800
+ }, styles);
801
+
802
+ // Needed for IE 6/7
803
+ elm = dom.get('fullpage_styles');
804
+ if (elm.styleSheet) {
805
+ elm.styleSheet.cssText = styles;
806
+ }
807
+ }
808
+
809
+ var currentStyleSheetsMap = {};
810
+ Tools.each(headElm.getElementsByTagName('link'), function (stylesheet) {
811
+ if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
812
+ currentStyleSheetsMap[stylesheet.href] = stylesheet;
813
+ }
814
+ });
815
+
816
+ // Add new
817
+ Tools.each(headerFragment.getAll('link'), function (stylesheet) {
818
+ var href = stylesheet.attr('href');
819
+ if (!href) {
820
+ return true;
821
+ }
822
+
823
+ if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') {
824
+ dom.add(headElm, 'link', {
825
+ rel: 'stylesheet',
826
+ text: 'text/css',
827
+ href: href,
828
+ 'data-mce-fullpage': '1'
829
+ });
830
+ }
831
+
832
+ delete currentStyleSheetsMap[href];
833
+ });
834
+
835
+ // Delete old
836
+ Tools.each(currentStyleSheetsMap, function (stylesheet) {
837
+ stylesheet.parentNode.removeChild(stylesheet);
838
+ });
839
+ };
840
+
841
+ var getDefaultHeader = function (editor) {
842
+ var header = '', value, styles = '';
843
+
844
+ if (Settings.getDefaultXmlPi(editor)) {
845
+ var piEncoding = Settings.getDefaultEncoding(editor);
846
+ header += '<?xml version="1.0" encoding="' + (piEncoding ? piEncoding : 'ISO-8859-1') + '" ?>\n';
847
+ }
848
+
849
+ header += Settings.getDefaultDocType(editor);
850
+ header += '\n<html>\n<head>\n';
851
+
852
+ if ((value = Settings.getDefaultTitle(editor))) {
853
+ header += '<title>' + value + '</title>\n';
854
+ }
855
+
856
+ if ((value = Settings.getDefaultEncoding(editor))) {
857
+ header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
858
+ }
859
+
860
+ if ((value = Settings.getDefaultFontFamily(editor))) {
861
+ styles += 'font-family: ' + value + ';';
862
+ }
863
+
864
+ if ((value = Settings.getDefaultFontSize(editor))) {
865
+ styles += 'font-size: ' + value + ';';
866
+ }
867
+
868
+ if ((value = Settings.getDefaultTextColor(editor))) {
869
+ styles += 'color: ' + value + ';';
870
+ }
871
+
872
+ header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
873
+
874
+ return header;
875
+ };
876
+
877
+ var handleGetContent = function (editor, head, foot, evt) {
878
+ if (!evt.selection && (!evt.source_view || !Settings.shouldHideInSourceView(editor))) {
879
+ evt.content = Protect.unprotectHtml(Tools.trim(head) + '\n' + Tools.trim(evt.content) + '\n' + Tools.trim(foot));
880
+ }
881
+ };
882
+
883
+ var setup = function (editor, headState, footState) {
884
+ editor.on('BeforeSetContent', function (evt) {
885
+ handleSetContent(editor, headState, footState, evt);
886
+ });
887
+ editor.on('GetContent', function (evt) {
888
+ handleGetContent(editor, headState.get(), footState.get(), evt);
889
+ });
890
+ };
891
+
892
+ return {
893
+ setup: setup
894
+ };
895
+ }
896
+ );
897
+ /**
898
+ * Buttons.js
899
+ *
900
+ * Released under LGPL License.
901
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
902
+ *
903
+ * License: http://www.tinymce.com/license
904
+ * Contributing: http://www.tinymce.com/contributing
905
+ */
906
+
907
+ define(
908
+ 'tinymce.plugins.fullpage.ui.Buttons',
909
+ [
910
+ ],
911
+ function () {
912
+ var register = function (editor) {
913
+ editor.addButton('fullpage', {
914
+ title: 'Document properties',
915
+ cmd: 'mceFullPageProperties'
916
+ });
917
+
918
+ editor.addMenuItem('fullpage', {
919
+ text: 'Document properties',
920
+ cmd: 'mceFullPageProperties',
921
+ context: 'file'
922
+ });
923
+ };
924
+
925
+ return {
926
+ register: register
927
+ };
928
+ }
929
+ );
930
+ /**
931
+ * Plugin.js
932
+ *
933
+ * Released under LGPL License.
934
+ * Copyright (c) 1999-2017 Ephox Corp. All rights reserved
935
+ *
936
+ * License: http://www.tinymce.com/license
937
+ * Contributing: http://www.tinymce.com/contributing
938
+ */
939
+
940
+ define(
941
+ 'tinymce.plugins.fullpage.Plugin',
942
+ [
943
+ 'ephox.katamari.api.Cell',
944
+ 'tinymce.core.PluginManager',
945
+ 'tinymce.plugins.fullpage.api.Commands',
946
+ 'tinymce.plugins.fullpage.core.FilterContent',
947
+ 'tinymce.plugins.fullpage.ui.Buttons'
948
+ ],
949
+ function (Cell, PluginManager, Commands, FilterContent, Buttons) {
950
+ PluginManager.add('fullpage', function (editor) {
951
+ var headState = Cell(''), footState = Cell('');
952
+
953
+ Commands.register(editor, headState);
954
+ Buttons.register(editor);
955
+ FilterContent.setup(editor, headState, footState);
956
+ });
957
+
958
+ return function () { };
959
+ }
960
+ );
961
+ dem('tinymce.plugins.fullpage.Plugin')();
962
+ })();