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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/assets/_vendor/tinymce/plugins/advlist/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/advlist/plugin.js +428 -0
- data/assets/_vendor/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/anchor/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/anchor/plugin.js +338 -0
- data/assets/_vendor/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autolink/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autolink/plugin.js +404 -0
- data/assets/_vendor/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autoresize/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.js +451 -0
- data/assets/_vendor/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/autosave/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/autosave/plugin.js +608 -0
- data/assets/_vendor/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/bbcode/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.js +264 -0
- data/assets/_vendor/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/charmap/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/charmap/plugin.js +850 -0
- data/assets/_vendor/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/code/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/code/plugin.js +338 -0
- data/assets/_vendor/tinymce/plugins/code/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/codesample/css/prism.css +138 -0
- data/assets/_vendor/tinymce/plugins/codesample/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/codesample/plugin.js +1582 -0
- data/assets/_vendor/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.js +272 -0
- data/assets/_vendor/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.js +496 -0
- data/assets/_vendor/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/directionality/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/directionality/plugin.js +270 -0
- data/assets/_vendor/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/assets/_vendor/tinymce/plugins/emoticons/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.js +256 -0
- data/assets/_vendor/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/fullpage/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.js +962 -0
- data/assets/_vendor/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.js +455 -0
- data/assets/_vendor/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/help/img/logo.png +0 -0
- data/assets/_vendor/tinymce/plugins/help/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/help/plugin.js +1527 -0
- data/assets/_vendor/tinymce/plugins/help/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/hr/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/hr/plugin.js +195 -0
- data/assets/_vendor/tinymce/plugins/hr/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/image/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/image/plugin.js +1572 -0
- data/assets/_vendor/tinymce/plugins/image/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/imagetools/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.js +4444 -0
- data/assets/_vendor/tinymce/plugins/imagetools/plugin.min.js +2 -0
- data/assets/_vendor/tinymce/plugins/importcss/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/importcss/plugin.js +577 -0
- data/assets/_vendor/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.js +482 -0
- data/assets/_vendor/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.js +395 -0
- data/assets/_vendor/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/link/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/link/plugin.js +1231 -0
- data/assets/_vendor/tinymce/plugins/link/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/lists/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/lists/plugin.js +1985 -0
- data/assets/_vendor/tinymce/plugins/lists/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/media/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/media/plugin.js +2026 -0
- data/assets/_vendor/tinymce/plugins/media/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.js +313 -0
- data/assets/_vendor/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/noneditable/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.js +316 -0
- data/assets/_vendor/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.js +354 -0
- data/assets/_vendor/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/paste/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/paste/plugin.js +2935 -0
- data/assets/_vendor/tinymce/plugins/paste/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/preview/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/preview/plugin.js +410 -0
- data/assets/_vendor/tinymce/plugins/preview/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/print/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/print/plugin.js +194 -0
- data/assets/_vendor/tinymce/plugins/print/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/save/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/save/plugin.js +370 -0
- data/assets/_vendor/tinymce/plugins/save/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.js +977 -0
- data/assets/_vendor/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.js +1419 -0
- data/assets/_vendor/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.js +419 -0
- data/assets/_vendor/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/table/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/table/plugin.js +15527 -0
- data/assets/_vendor/tinymce/plugins/table/plugin.min.js +5 -0
- data/assets/_vendor/tinymce/plugins/template/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/template/plugin.js +807 -0
- data/assets/_vendor/tinymce/plugins/template/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/textcolor/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.js +619 -0
- data/assets/_vendor/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/textpattern/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.js +718 -0
- data/assets/_vendor/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/toc/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/toc/plugin.js +559 -0
- data/assets/_vendor/tinymce/plugins/toc/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/css/visualblocks.css +154 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.js +459 -0
- data/assets/_vendor/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/visualchars/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.js +1325 -0
- data/assets/_vendor/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/plugins/wordcount/index.js +7 -0
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.js +735 -0
- data/assets/_vendor/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/content.mobile.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-mobile.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.svg +131 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/object.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/assets/_vendor/tinymce/skins/lightgray/skin.min.css +1 -0
- data/assets/_vendor/tinymce/skins/lightgray/skin.mobile.min.css +2 -0
- data/assets/_vendor/tinymce/themes/inlite/index.js +7 -0
- data/assets/_vendor/tinymce/themes/inlite/theme.js +18787 -0
- data/assets/_vendor/tinymce/themes/inlite/theme.min.js +5 -0
- data/assets/_vendor/tinymce/themes/mobile/index.js +7 -0
- data/assets/_vendor/tinymce/themes/mobile/theme.js +23384 -0
- data/assets/_vendor/tinymce/themes/mobile/theme.min.js +8 -0
- data/assets/_vendor/tinymce/themes/modern/index.js +7 -0
- data/assets/_vendor/tinymce/themes/modern/theme.js +18311 -0
- data/assets/_vendor/tinymce/themes/modern/theme.min.js +5 -0
- data/assets/_vendor/tinymce/tinymce.js +44399 -0
- data/assets/bedrock/js/bedrock.js +16587 -6193
- data/assets/bedrock/scss/_bedrock-components.scss +16 -0
- data/assets/bedrock/scss/_bedrock-settings.scss +15 -0
- data/assets/bedrock/scss/components/attachments-grid.scss +138 -0
- data/assets/bedrock/scss/components/dropzone-upload.scss +158 -0
- data/assets/bedrock/scss/components/global.scss +16 -8
- data/assets/bedrock/scss/components/helper-classes.scss +59 -0
- data/assets/bedrock/scss/components/inline-edit-box.scss +80 -0
- data/assets/bedrock/scss/components/login-box.scss +48 -0
- data/assets/bedrock/scss/components/no-content.scss +31 -0
- data/assets/bedrock/scss/components/off-canvas-menu.scss +1 -1
- data/assets/bedrock/scss/components/page-content.scss +51 -0
- data/assets/bedrock/scss/components/reveal-panel.scss +89 -0
- data/assets/bedrock/scss/components/select-box.scss +332 -0
- data/assets/bedrock/scss/components/tiny-mce-editor.scss +14 -7
- data/lib/bedrock_sass.rb +6 -0
- data/lib/bedrock_sass/engine.rb +8 -0
- data/lib/bedrock_sass/version.rb +1 -1
- data/lib/tasks/before_assets_precompile.rake +11 -0
- 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("6",tinymce.util.Tools.resolve),g("2",["6"],function(a){return a("tinymce.PluginManager")}),g("3",[],function(){var a=function(a){var b=function(b){a.set(b)},c=function(){return a.get()};return{setPatterns:b,getPatterns:c}};return{get:a}}),g("4",[],function(){var a=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"***",end:"***",format:["bold","italic"]},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],b=function(b){return void 0!==b.textpattern_patterns?b.textpattern_patterns:a};return{getPatterns:b}}),g("7",["6"],function(a){return a("tinymce.util.Delay")}),g("8",["6"],function(a){return a("tinymce.util.VK")}),h("b",document),g("c",["6"],function(a){return a("tinymce.dom.TreeWalker")}),g("d",["6"],function(a){return a("tinymce.util.Tools")}),g("e",[],function(){var a=function(a){return a.sort(function(a,b){return a.start.length>b.start.length?-1:a.start.length<b.start.length?1:0})},b=function(a,b){for(var c=0;c<a.length;c++)if(0===b.indexOf(a[c].start)&&(!a[c].end||b.lastIndexOf(a[c].end)===b.length-a[c].end.length))return a[c]},c=function(a,b,c,d){var e=b.substr(c-a.end.length-d,a.end.length);return e===a.end},d=function(a,b,c){return a-b-c.end.length-c.start.length>0},e=function(b,e,f,g){var h,i,j=a(b);for(i=0;i<j.length;i++)if(h=j[i],void 0!==h.end&&c(h,e,f,g)&&d(f,g,h))return h};return{findPattern:b,findEndPattern:e}}),g("a",["b","c","d","e"],function(a,b,c,d){var e=function(a,b,c,d,e){return a=d>0?a.splitText(d):a,a.splitText(c-d+b.end.length),a.deleteData(0,b.start.length),a.deleteData(a.data.length-b.end.length,b.end.length),a},f=function(b,c,e){if(c.collapsed!==!1){var f=c.startContainer,g=f.data,h=e===!0?1:0;if(3===f.nodeType){var i=d.findEndPattern(b,g,c.startOffset,h);if(void 0!==i){var j=g.lastIndexOf(i.end,c.startOffset-h),k=g.lastIndexOf(i.start,j-i.end.length);if(j=g.indexOf(i.end,k+i.start.length),k!==-1){var l=a.createRange();l.setStart(f,k),l.setEnd(f,j+i.end.length);var m=d.findPattern(b,l.toString());if(!(void 0===i||m!==i||f.data.length<=i.start.length+i.end.length))return{pattern:i,startOffset:k,endOffset:j}}}}}},g=function(a,b,d,f){var g=c.isArray(d.pattern.format)?d.pattern.format:[d.pattern.format],h=c.grep(g,function(b){var c=a.formatter.get(b);return c&&c[0].inline});if(0!==h.length)return a.undoManager.transact(function(){b=e(b,d.pattern,d.endOffset,d.startOffset,f),g.forEach(function(c){a.formatter.apply(c,{},b)})}),b},h=function(a,b,c){var d=a.selection.getRng(!0),e=f(b,d,c);if(e)return g(a,d.startContainer,e,c)},i=function(a,b){return h(a,b,!0)},j=function(a,b){return h(a,b,!1)},k=function(a,e){var f,g,h,i,j,k,l,m,n,o,p;if(f=a.selection,g=a.dom,f.isCollapsed()&&(l=g.getParent(f.getStart(),"p"))){for(n=new b(l,l);j=n.next();)if(3===j.nodeType){i=j;break}if(i){if(m=d.findPattern(e,i.data),!m)return;if(o=f.getRng(!0),h=o.startContainer,p=o.startOffset,i===h&&(p=Math.max(0,p-m.start.length)),c.trim(i.data).length===m.start.length)return;m.format&&(k=a.formatter.get(m.format),k&&k[0].block&&(i.deleteData(0,m.start.length),a.formatter.apply(m.format,{},i),o.setStart(h,p),o.collapse(!0),f.setRng(o))),m.cmd&&a.undoManager.transact(function(){i.deleteData(0,m.start.length),a.execCommand(m.cmd)})}}};return{patternFromRng:f,applyInlineFormatSpace:i,applyInlineFormatEnter:j,applyBlockFormat:k}}),g("9",["8","a"],function(a,b){function c(a,c){var d,e;d=b.applyInlineFormatEnter(a,c),d&&(e=a.dom.createRng(),e.setStart(d,d.data.length),e.setEnd(d,d.data.length),a.selection.setRng(e)),b.applyBlockFormat(a,c)}function d(a,c){var d,e,f,g,h;d=b.applyInlineFormatSpace(a,c),d&&(h=a.dom,e=d.data.slice(-1),/[\u00a0 ]/.test(e)&&(d.deleteData(d.data.length-1,1),f=h.doc.createTextNode(e),h.insertAfter(f,d.parentNode),g=h.createRng(),g.setStart(f,1),g.setEnd(f,1),a.selection.setRng(g)))}var e=function(a,b,c){for(var d=0;d<a.length;d++)if(c(a[d],b))return!0},f=function(b,c){return e(b,c,function(b,c){return b===c.keyCode&&a.modifierPressed(c)===!1})},g=function(a,b){return e(a,b,function(a,b){return a.charCodeAt(0)===b.charCode})};return{handleEnter:c,handleInlineKey:d,checkCharCode:g,checkKeyCode:f}}),g("5",["7","8","9"],function(a,b,c){var d=function(d,e){var f=[",",".",";",":","!","?"],g=[32];d.on("keydown",function(a){13!==a.keyCode||b.modifierPressed(a)||c.handleEnter(d,e.get())},!0),d.on("keyup",function(a){c.checkKeyCode(g,a)&&c.handleInlineKey(d,e.get())}),d.on("keypress",function(b){c.checkCharCode(f,b)&&a.setEditorTimeout(d,function(){c.handleInlineKey(d,e.get())})})};return{setup:d}}),g("0",["1","2","3","4","5"],function(a,b,c,d,e){return b.add("textpattern",function(b){var f=a(d.getPatterns(b.settings));return e.setup(b,f),c.get(f)}),function(){}}),d("0")()}();
|
@@ -0,0 +1,559 @@
|
|
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.toc.Plugin","tinymce.core.PluginManager","tinymce.plugins.toc.api.Commands","tinymce.plugins.toc.api.Settings","tinymce.plugins.toc.core.FilterContent","tinymce.plugins.toc.ui.Buttons","global!tinymce.util.Tools.resolve","tinymce.plugins.toc.core.Toc","tinymce.core.dom.DOMUtils","tinymce.core.util.I18n","tinymce.core.util.Tools","tinymce.plugins.toc.core.Guid"]
|
85
|
+
jsc*/
|
86
|
+
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
|
87
|
+
/**
|
88
|
+
* ResolveGlobal.js
|
89
|
+
*
|
90
|
+
* Released under LGPL License.
|
91
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
92
|
+
*
|
93
|
+
* License: http://www.tinymce.com/license
|
94
|
+
* Contributing: http://www.tinymce.com/contributing
|
95
|
+
*/
|
96
|
+
|
97
|
+
define(
|
98
|
+
'tinymce.core.PluginManager',
|
99
|
+
[
|
100
|
+
'global!tinymce.util.Tools.resolve'
|
101
|
+
],
|
102
|
+
function (resolve) {
|
103
|
+
return resolve('tinymce.PluginManager');
|
104
|
+
}
|
105
|
+
);
|
106
|
+
|
107
|
+
/**
|
108
|
+
* ResolveGlobal.js
|
109
|
+
*
|
110
|
+
* Released under LGPL License.
|
111
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
112
|
+
*
|
113
|
+
* License: http://www.tinymce.com/license
|
114
|
+
* Contributing: http://www.tinymce.com/contributing
|
115
|
+
*/
|
116
|
+
|
117
|
+
define(
|
118
|
+
'tinymce.core.dom.DOMUtils',
|
119
|
+
[
|
120
|
+
'global!tinymce.util.Tools.resolve'
|
121
|
+
],
|
122
|
+
function (resolve) {
|
123
|
+
return resolve('tinymce.dom.DOMUtils');
|
124
|
+
}
|
125
|
+
);
|
126
|
+
|
127
|
+
/**
|
128
|
+
* ResolveGlobal.js
|
129
|
+
*
|
130
|
+
* Released under LGPL License.
|
131
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
132
|
+
*
|
133
|
+
* License: http://www.tinymce.com/license
|
134
|
+
* Contributing: http://www.tinymce.com/contributing
|
135
|
+
*/
|
136
|
+
|
137
|
+
define(
|
138
|
+
'tinymce.core.util.I18n',
|
139
|
+
[
|
140
|
+
'global!tinymce.util.Tools.resolve'
|
141
|
+
],
|
142
|
+
function (resolve) {
|
143
|
+
return resolve('tinymce.util.I18n');
|
144
|
+
}
|
145
|
+
);
|
146
|
+
|
147
|
+
/**
|
148
|
+
* ResolveGlobal.js
|
149
|
+
*
|
150
|
+
* Released under LGPL License.
|
151
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
152
|
+
*
|
153
|
+
* License: http://www.tinymce.com/license
|
154
|
+
* Contributing: http://www.tinymce.com/contributing
|
155
|
+
*/
|
156
|
+
|
157
|
+
define(
|
158
|
+
'tinymce.core.util.Tools',
|
159
|
+
[
|
160
|
+
'global!tinymce.util.Tools.resolve'
|
161
|
+
],
|
162
|
+
function (resolve) {
|
163
|
+
return resolve('tinymce.util.Tools');
|
164
|
+
}
|
165
|
+
);
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Settings.js
|
169
|
+
*
|
170
|
+
* Released under LGPL License.
|
171
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
172
|
+
*
|
173
|
+
* License: http://www.tinymce.com/license
|
174
|
+
* Contributing: http://www.tinymce.com/contributing
|
175
|
+
*/
|
176
|
+
|
177
|
+
define(
|
178
|
+
'tinymce.plugins.toc.api.Settings',
|
179
|
+
[
|
180
|
+
],
|
181
|
+
function () {
|
182
|
+
var getTocClass = function (editor) {
|
183
|
+
return editor.getParam('toc_class', 'mce-toc');
|
184
|
+
};
|
185
|
+
|
186
|
+
var getTocHeader = function (editor) {
|
187
|
+
var tagName = editor.getParam('toc_header', 'h2');
|
188
|
+
return /^h[1-6]$/.test(tagName) ? tagName : 'h2';
|
189
|
+
};
|
190
|
+
|
191
|
+
var getTocDepth = function (editor) {
|
192
|
+
var depth = parseInt(editor.getParam('toc_depth', '3'), 10);
|
193
|
+
return depth >= 1 && depth <= 9 ? depth : 3;
|
194
|
+
};
|
195
|
+
|
196
|
+
return {
|
197
|
+
getTocClass: getTocClass,
|
198
|
+
getTocHeader: getTocHeader,
|
199
|
+
getTocDepth: getTocDepth
|
200
|
+
};
|
201
|
+
}
|
202
|
+
);
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Guid.js
|
206
|
+
*
|
207
|
+
* Released under LGPL License.
|
208
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
209
|
+
*
|
210
|
+
* License: http://www.tinymce.com/license
|
211
|
+
* Contributing: http://www.tinymce.com/contributing
|
212
|
+
*/
|
213
|
+
|
214
|
+
define(
|
215
|
+
'tinymce.plugins.toc.core.Guid',
|
216
|
+
[
|
217
|
+
],
|
218
|
+
function () {
|
219
|
+
var create = function (prefix) {
|
220
|
+
var counter = 0;
|
221
|
+
|
222
|
+
return function () {
|
223
|
+
var guid = new Date().getTime().toString(32);
|
224
|
+
return prefix + guid + (counter++).toString(32);
|
225
|
+
};
|
226
|
+
};
|
227
|
+
|
228
|
+
return {
|
229
|
+
create: create
|
230
|
+
};
|
231
|
+
}
|
232
|
+
);
|
233
|
+
/**
|
234
|
+
* Toc.js
|
235
|
+
*
|
236
|
+
* Released under LGPL License.
|
237
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
238
|
+
*
|
239
|
+
* License: http://www.tinymce.com/license
|
240
|
+
* Contributing: http://www.tinymce.com/contributing
|
241
|
+
*/
|
242
|
+
|
243
|
+
define(
|
244
|
+
'tinymce.plugins.toc.core.Toc',
|
245
|
+
[
|
246
|
+
'tinymce.core.dom.DOMUtils',
|
247
|
+
'tinymce.core.util.I18n',
|
248
|
+
'tinymce.core.util.Tools',
|
249
|
+
'tinymce.plugins.toc.api.Settings',
|
250
|
+
'tinymce.plugins.toc.core.Guid'
|
251
|
+
],
|
252
|
+
function (DOMUtils, I18n, Tools, Settings, Guid) {
|
253
|
+
var tocId = Guid.create('mcetoc_');
|
254
|
+
|
255
|
+
var generateSelector = function generateSelector(depth) {
|
256
|
+
var i, selector = [];
|
257
|
+
for (i = 1; i <= depth; i++) {
|
258
|
+
selector.push('h' + i);
|
259
|
+
}
|
260
|
+
return selector.join(',');
|
261
|
+
};
|
262
|
+
|
263
|
+
var hasHeaders = function (editor) {
|
264
|
+
return readHeaders(editor).length > 0;
|
265
|
+
};
|
266
|
+
|
267
|
+
var readHeaders = function (editor) {
|
268
|
+
var tocClass = Settings.getTocClass(editor);
|
269
|
+
var headerTag = Settings.getTocHeader(editor);
|
270
|
+
var selector = generateSelector(Settings.getTocDepth(editor));
|
271
|
+
var headers = editor.$(selector);
|
272
|
+
|
273
|
+
// if headerTag is one of h1-9, we need to filter it out from the set
|
274
|
+
if (headers.length && /^h[1-9]$/i.test(headerTag)) {
|
275
|
+
headers = headers.filter(function (i, el) {
|
276
|
+
return !editor.dom.hasClass(el.parentNode, tocClass);
|
277
|
+
});
|
278
|
+
}
|
279
|
+
|
280
|
+
return Tools.map(headers, function (h) {
|
281
|
+
return {
|
282
|
+
id: h.id ? h.id : tocId(),
|
283
|
+
level: parseInt(h.nodeName.replace(/^H/i, ''), 10),
|
284
|
+
title: editor.$.text(h),
|
285
|
+
element: h
|
286
|
+
};
|
287
|
+
});
|
288
|
+
};
|
289
|
+
|
290
|
+
var getMinLevel = function (headers) {
|
291
|
+
var i, minLevel = 9;
|
292
|
+
|
293
|
+
for (i = 0; i < headers.length; i++) {
|
294
|
+
if (headers[i].level < minLevel) {
|
295
|
+
minLevel = headers[i].level;
|
296
|
+
}
|
297
|
+
|
298
|
+
// do not proceed if we have reached absolute minimum
|
299
|
+
if (minLevel === 1) {
|
300
|
+
return minLevel;
|
301
|
+
}
|
302
|
+
}
|
303
|
+
return minLevel;
|
304
|
+
};
|
305
|
+
|
306
|
+
var generateTitle = function (tag, title) {
|
307
|
+
var openTag = '<' + tag + ' contenteditable="true">';
|
308
|
+
var closeTag = '</' + tag + '>';
|
309
|
+
return openTag + DOMUtils.DOM.encode(title) + closeTag;
|
310
|
+
};
|
311
|
+
|
312
|
+
var generateTocHtml = function (editor) {
|
313
|
+
var html = generateTocContentHtml(editor);
|
314
|
+
return '<div class="' + editor.dom.encode(Settings.getTocClass(editor)) + '" contenteditable="false">' + html + '</div>';
|
315
|
+
};
|
316
|
+
|
317
|
+
var generateTocContentHtml = function (editor) {
|
318
|
+
var html = '';
|
319
|
+
var headers = readHeaders(editor);
|
320
|
+
var prevLevel = getMinLevel(headers) - 1;
|
321
|
+
var i, ii, h, nextLevel;
|
322
|
+
|
323
|
+
if (!headers.length) {
|
324
|
+
return '';
|
325
|
+
}
|
326
|
+
|
327
|
+
html += generateTitle(Settings.getTocHeader(editor), I18n.translate('Table of Contents'));
|
328
|
+
|
329
|
+
for (i = 0; i < headers.length; i++) {
|
330
|
+
h = headers[i];
|
331
|
+
h.element.id = h.id;
|
332
|
+
nextLevel = headers[i + 1] && headers[i + 1].level;
|
333
|
+
|
334
|
+
if (prevLevel === h.level) {
|
335
|
+
html += '<li>';
|
336
|
+
} else {
|
337
|
+
for (ii = prevLevel; ii < h.level; ii++) {
|
338
|
+
html += '<ul><li>';
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
html += '<a href="#' + h.id + '">' + h.title + '</a>';
|
343
|
+
|
344
|
+
if (nextLevel === h.level || !nextLevel) {
|
345
|
+
html += '</li>';
|
346
|
+
|
347
|
+
if (!nextLevel) {
|
348
|
+
html += '</ul>';
|
349
|
+
}
|
350
|
+
} else {
|
351
|
+
for (ii = h.level; ii > nextLevel; ii--) {
|
352
|
+
html += '</li></ul><li>';
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
prevLevel = h.level;
|
357
|
+
}
|
358
|
+
|
359
|
+
return html;
|
360
|
+
};
|
361
|
+
|
362
|
+
var isEmptyOrOffscren = function (editor, nodes) {
|
363
|
+
return !nodes.length || editor.dom.getParents(nodes[0], '.mce-offscreen-selection').length > 0;
|
364
|
+
};
|
365
|
+
|
366
|
+
var insertToc = function (editor) {
|
367
|
+
var tocClass = Settings.getTocClass(editor);
|
368
|
+
var $tocElm = editor.$('.' + tocClass);
|
369
|
+
|
370
|
+
if (isEmptyOrOffscren(editor, $tocElm)) {
|
371
|
+
editor.insertContent(generateTocHtml(editor));
|
372
|
+
} else {
|
373
|
+
updateToc(editor);
|
374
|
+
}
|
375
|
+
};
|
376
|
+
|
377
|
+
var updateToc = function (editor) {
|
378
|
+
var tocClass = Settings.getTocClass(editor);
|
379
|
+
var $tocElm = editor.$('.' + tocClass);
|
380
|
+
|
381
|
+
if ($tocElm.length) {
|
382
|
+
editor.undoManager.transact(function () {
|
383
|
+
$tocElm.html(generateTocContentHtml(editor));
|
384
|
+
});
|
385
|
+
}
|
386
|
+
};
|
387
|
+
|
388
|
+
return {
|
389
|
+
hasHeaders: hasHeaders,
|
390
|
+
insertToc: insertToc,
|
391
|
+
updateToc: updateToc
|
392
|
+
};
|
393
|
+
}
|
394
|
+
);
|
395
|
+
/**
|
396
|
+
* Commands.js
|
397
|
+
*
|
398
|
+
* Released under LGPL License.
|
399
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
400
|
+
*
|
401
|
+
* License: http://www.tinymce.com/license
|
402
|
+
* Contributing: http://www.tinymce.com/contributing
|
403
|
+
*/
|
404
|
+
|
405
|
+
define(
|
406
|
+
'tinymce.plugins.toc.api.Commands',
|
407
|
+
[
|
408
|
+
'tinymce.plugins.toc.core.Toc'
|
409
|
+
],
|
410
|
+
function (Toc) {
|
411
|
+
var register = function (editor) {
|
412
|
+
editor.addCommand('mceInsertToc', function () {
|
413
|
+
Toc.insertToc(editor);
|
414
|
+
});
|
415
|
+
|
416
|
+
editor.addCommand('mceUpdateToc', function () {
|
417
|
+
Toc.updateToc(editor);
|
418
|
+
});
|
419
|
+
};
|
420
|
+
|
421
|
+
return {
|
422
|
+
register: register
|
423
|
+
};
|
424
|
+
}
|
425
|
+
);
|
426
|
+
/**
|
427
|
+
* FilterContent.js
|
428
|
+
*
|
429
|
+
* Released under LGPL License.
|
430
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
431
|
+
*
|
432
|
+
* License: http://www.tinymce.com/license
|
433
|
+
* Contributing: http://www.tinymce.com/contributing
|
434
|
+
*/
|
435
|
+
|
436
|
+
define(
|
437
|
+
'tinymce.plugins.toc.core.FilterContent',
|
438
|
+
[
|
439
|
+
'tinymce.plugins.toc.api.Settings'
|
440
|
+
],
|
441
|
+
function (Settings) {
|
442
|
+
var setup = function (editor) {
|
443
|
+
var $ = editor.$, tocClass = Settings.getTocClass(editor);
|
444
|
+
|
445
|
+
editor.on('PreProcess', function (e) {
|
446
|
+
var $tocElm = $('.' + tocClass, e.node);
|
447
|
+
if ($tocElm.length) {
|
448
|
+
$tocElm.removeAttr('contentEditable');
|
449
|
+
$tocElm.find('[contenteditable]').removeAttr('contentEditable');
|
450
|
+
}
|
451
|
+
});
|
452
|
+
|
453
|
+
editor.on('SetContent', function () {
|
454
|
+
var $tocElm = $('.' + tocClass);
|
455
|
+
if ($tocElm.length) {
|
456
|
+
$tocElm.attr('contentEditable', false);
|
457
|
+
$tocElm.children(':first-child').attr('contentEditable', true);
|
458
|
+
}
|
459
|
+
});
|
460
|
+
};
|
461
|
+
|
462
|
+
return {
|
463
|
+
setup: setup
|
464
|
+
};
|
465
|
+
}
|
466
|
+
);
|
467
|
+
/**
|
468
|
+
* Buttons.js
|
469
|
+
*
|
470
|
+
* Released under LGPL License.
|
471
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
472
|
+
*
|
473
|
+
* License: http://www.tinymce.com/license
|
474
|
+
* Contributing: http://www.tinymce.com/contributing
|
475
|
+
*/
|
476
|
+
|
477
|
+
define(
|
478
|
+
'tinymce.plugins.toc.ui.Buttons',
|
479
|
+
[
|
480
|
+
'tinymce.plugins.toc.api.Settings',
|
481
|
+
'tinymce.plugins.toc.core.Toc'
|
482
|
+
],
|
483
|
+
function (Settings, Toc) {
|
484
|
+
var toggleState = function (editor) {
|
485
|
+
return function (e) {
|
486
|
+
var ctrl = e.control;
|
487
|
+
|
488
|
+
editor.on('LoadContent SetContent change', function () {
|
489
|
+
ctrl.disabled(editor.readonly || !Toc.hasHeaders(editor));
|
490
|
+
});
|
491
|
+
};
|
492
|
+
};
|
493
|
+
|
494
|
+
var isToc = function (editor) {
|
495
|
+
return function (elm) {
|
496
|
+
return elm && editor.dom.is(elm, '.' + Settings.getTocClass(editor)) && editor.getBody().contains(elm);
|
497
|
+
};
|
498
|
+
};
|
499
|
+
|
500
|
+
var register = function (editor) {
|
501
|
+
editor.addButton('toc', {
|
502
|
+
tooltip: 'Table of Contents',
|
503
|
+
cmd: 'mceInsertToc',
|
504
|
+
icon: 'toc',
|
505
|
+
onPostRender: toggleState(editor)
|
506
|
+
});
|
507
|
+
|
508
|
+
editor.addButton('tocupdate', {
|
509
|
+
tooltip: 'Update',
|
510
|
+
cmd: 'mceUpdateToc',
|
511
|
+
icon: 'reload'
|
512
|
+
});
|
513
|
+
|
514
|
+
editor.addMenuItem('toc', {
|
515
|
+
text: "Table of Contents",
|
516
|
+
context: 'insert',
|
517
|
+
cmd: 'mceInsertToc',
|
518
|
+
onPostRender: toggleState(editor)
|
519
|
+
});
|
520
|
+
|
521
|
+
editor.addContextToolbar(isToc(editor), 'tocupdate');
|
522
|
+
};
|
523
|
+
|
524
|
+
return {
|
525
|
+
register: register
|
526
|
+
};
|
527
|
+
}
|
528
|
+
);
|
529
|
+
/**
|
530
|
+
* Plugin.js
|
531
|
+
*
|
532
|
+
* Released under LGPL License.
|
533
|
+
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
534
|
+
*
|
535
|
+
* License: http://www.tinymce.com/license
|
536
|
+
* Contributing: http://www.tinymce.com/contributing
|
537
|
+
*/
|
538
|
+
|
539
|
+
define(
|
540
|
+
'tinymce.plugins.toc.Plugin',
|
541
|
+
[
|
542
|
+
'tinymce.core.PluginManager',
|
543
|
+
'tinymce.plugins.toc.api.Commands',
|
544
|
+
'tinymce.plugins.toc.api.Settings',
|
545
|
+
'tinymce.plugins.toc.core.FilterContent',
|
546
|
+
'tinymce.plugins.toc.ui.Buttons'
|
547
|
+
],
|
548
|
+
function (PluginManager, Commands, Settings, FilterContent, Buttons) {
|
549
|
+
PluginManager.add('toc', function (editor) {
|
550
|
+
Commands.register(editor);
|
551
|
+
Buttons.register(editor);
|
552
|
+
FilterContent.setup(editor);
|
553
|
+
});
|
554
|
+
|
555
|
+
return function () { };
|
556
|
+
}
|
557
|
+
);
|
558
|
+
dem('tinymce.plugins.toc.Plugin')();
|
559
|
+
})();
|