├── .eslintrc ├── .gitignore ├── .npmignore ├── README.md ├── devassets └── tinymce │ ├── plugins │ ├── advlist │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── anchor │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autolink │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autoresize │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── autosave │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── bbcode │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── charmap │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── code │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── colorpicker │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── contextmenu │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── directionality │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── emoticons │ │ ├── img │ │ │ ├── smiley-cool.gif │ │ │ ├── smiley-cry.gif │ │ │ ├── smiley-embarassed.gif │ │ │ ├── smiley-foot-in-mouth.gif │ │ │ ├── smiley-frown.gif │ │ │ ├── smiley-innocent.gif │ │ │ ├── smiley-kiss.gif │ │ │ ├── smiley-laughing.gif │ │ │ ├── smiley-money-mouth.gif │ │ │ ├── smiley-sealed.gif │ │ │ ├── smiley-smile.gif │ │ │ ├── smiley-surprised.gif │ │ │ ├── smiley-tongue-out.gif │ │ │ ├── smiley-undecided.gif │ │ │ ├── smiley-wink.gif │ │ │ └── smiley-yell.gif │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── fullpage │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── fullscreen │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── hr │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── image │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── imagetools │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── importcss │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── insertdatetime │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── layer │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── legacyoutput │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── link │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── lists │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── media │ │ ├── moxieplayer.swf │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── nonbreaking │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── noneditable │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── pagebreak │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── paste │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── preview │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── print │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── save │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── searchreplace │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── spellchecker │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── tabfocus │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── table │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── template │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── textcolor │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── textpattern │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── visualblocks │ │ ├── css │ │ │ └── visualblocks.css │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── visualchars │ │ ├── plugin.js │ │ └── plugin.min.js │ └── wordcount │ │ ├── plugin.js │ │ └── plugin.min.js │ ├── skins │ └── lightgray │ │ ├── content.inline.min.css │ │ ├── content.min.css │ │ ├── fonts │ │ ├── tinymce-small.eot │ │ ├── tinymce-small.svg │ │ ├── tinymce-small.ttf │ │ ├── tinymce-small.woff │ │ ├── tinymce.eot │ │ ├── tinymce.svg │ │ ├── tinymce.ttf │ │ └── tinymce.woff │ │ ├── img │ │ ├── anchor.gif │ │ ├── loader.gif │ │ ├── object.gif │ │ └── trans.gif │ │ ├── skin.ie7.min.css │ │ └── skin.min.css │ ├── themes │ └── modern │ │ ├── theme.js │ │ └── theme.min.js │ └── tinymce.min.js ├── examples └── Tiny.js ├── index.html ├── package.json ├── scripts └── build ├── server.js ├── src └── TinyMCEInput.js └── webpack.config.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "node": true, 6 | "mocha": true 7 | }, 8 | "plugins": [ 9 | "react" 10 | ], 11 | "ecmaFeatures": { 12 | "jsx": true 13 | }, 14 | "rules": { 15 | "strict": [0], 16 | "quotes": [2, "single"], 17 | "eol-last": [0], 18 | "no-mixed-requires": [0], 19 | "no-underscore-dangle": [0], 20 | "no-alert": [0], 21 | "key-spacing": [0], 22 | "camelcase": [0], 23 | "no-multi-spaces": [0], 24 | "react/display-name": 1, 25 | "react/jsx-boolean-value": 1, 26 | "react/jsx-quotes": 1, 27 | "react/jsx-no-undef": 1, 28 | "react/jsx-uses-react": 1, 29 | "react/jsx-uses-vars": 1, 30 | "react/no-did-mount-set-state": 1, 31 | "react/no-did-update-set-state": 1, 32 | "react/no-unknown-property": 1, 33 | "react/prop-types": 1, 34 | "react/react-in-jsx-scope": 1, 35 | "react/self-closing-comp": 1, 36 | "react/wrap-multilines": 1 37 | } 38 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | # distribution 30 | dist 31 | 32 | # IDE 33 | .idea 34 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | devassets 3 | examples 4 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React TinyMCE Input 2 | 3 | [![npm package](https://img.shields.io/npm/v/react-tinymce-input.svg?style=flat)](https://www.npmjs.org/package/react-tinymce-input) 4 | 5 | React-TinyMCE-Input was written to use a TinyMCE input from within React. It is not the first, and is unlikely to be the last. If you are looking for a bare metal implementation, there is another great component, [react-tinymce](https://github.com/mzabriskie/react-tinymce) ([demo](http://mzabriskie.github.io/react-tinymce/basic/)). React-Tinymce is awesome, but was too low level to work for me. I wanted something that was a bit more React like. 6 | 7 | React-TinyMCE-Input handles a lot of the boilerplate. It tried to bind to the editor events that cause changes to the content and tell React when content changes. It also tried to keep TinyMCE in sync with changes coming from React. 8 | 9 | ## Using React-TinyMCE-Input. 10 | 11 | var TinyMCEInput = require('react-tinymce-input'); 12 | 13 | 14 | There are a few other props, and it is possible to listen for most events. 15 | 16 | >Note: the onChange event handler take a single param, a string with the updated content. The other event handlers all receive TinyMCE events. At some point, I may upgrade this to use React's synthetic event system, but currently it is unneeded. 17 | 18 | ## Examples 19 | 20 | git clone https://github.com/HurricaneJames/react-tinymce-input.git 21 | cd react-tinymce-input 22 | npm install 23 | npm run dev 24 | open localhost:8090 25 | 26 | ## ChangeLog 27 | 28 | - 2.1.0 29 | 30 | - revert to textarea as the default component 31 | 32 | - 2.0.0 33 | 34 | - added support for React 15+ 35 | - allow inline mode 36 | - fix even handlers 37 | - remove react 15.5+ warnings 38 | 39 | - 1.2.0 passthroughs 40 | 41 | - added `onClick` prop that will bind to the 'click' event on the tinymce editor 42 | - added `textareaProps` prop that will pass through to the textarea 43 | - added `otherEventHandlers` prop that takes an `Object`. Each key in otherEventHandlers will be bound to the TinyMCE editor. This is direct access to the TinyMCE event binding for any future enhancements that might be required before they can be added as a direct prop on the TinyMCEInput component. 44 | 45 | - 1.0.5 mitigate textarea blink 46 | 47 | - Update to initialize tinymce immediately if already defined (no more 100ms delay). 48 | - Pseudo-hide the textarea. The TinyMCE editor will appear to "pop-in", but the textarea will not be visible before 49 | 50 | - 1.0.1 Add onSetupEditor prop to allow editor configuration 51 | 52 | - 1.0.0 Initial Release -------------------------------------------------------------------------------- /devassets/tinymce/plugins/advlist/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('advlist', function(editor) { 14 | var olMenuItems, ulMenuItems, lastStyles = {}; 15 | 16 | function buildMenuItems(listName, styleValues) { 17 | var items = []; 18 | 19 | tinymce.each(styleValues.split(/[ ,]/), function(styleValue) { 20 | items.push({ 21 | text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) { 22 | return chr.toUpperCase(); 23 | }), 24 | data: styleValue == 'default' ? '' : styleValue 25 | }); 26 | }); 27 | 28 | return items; 29 | } 30 | 31 | olMenuItems = buildMenuItems('OL', editor.getParam( 32 | "advlist_number_styles", 33 | "default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman" 34 | )); 35 | 36 | ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square")); 37 | 38 | function applyListFormat(listName, styleValue) { 39 | editor.undoManager.transact(function() { 40 | var list, dom = editor.dom, sel = editor.selection; 41 | 42 | // Check for existing list element 43 | list = dom.getParent(sel.getNode(), 'ol,ul'); 44 | 45 | // Switch/add list type if needed 46 | if (!list || list.nodeName != listName || styleValue === false) { 47 | editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'); 48 | } 49 | 50 | // Set style 51 | styleValue = styleValue === false ? lastStyles[listName] : styleValue; 52 | lastStyles[listName] = styleValue; 53 | 54 | list = dom.getParent(sel.getNode(), 'ol,ul'); 55 | if (list) { 56 | dom.setStyle(list, 'listStyleType', styleValue ? styleValue : null); 57 | list.removeAttribute('data-mce-style'); 58 | } 59 | 60 | editor.focus(); 61 | }); 62 | } 63 | 64 | function updateSelection(e) { 65 | var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || ''; 66 | 67 | e.control.items().each(function(ctrl) { 68 | ctrl.active(ctrl.settings.data === listStyleType); 69 | }); 70 | } 71 | 72 | editor.addButton('numlist', { 73 | type: 'splitbutton', 74 | tooltip: 'Numbered list', 75 | menu: olMenuItems, 76 | onshow: updateSelection, 77 | onselect: function(e) { 78 | applyListFormat('OL', e.control.settings.data); 79 | }, 80 | onclick: function() { 81 | applyListFormat('OL', false); 82 | } 83 | }); 84 | 85 | editor.addButton('bullist', { 86 | type: 'splitbutton', 87 | tooltip: 'Bullet list', 88 | menu: ulMenuItems, 89 | onshow: updateSelection, 90 | onselect: function(e) { 91 | applyListFormat('UL', e.control.settings.data); 92 | }, 93 | onclick: function() { 94 | applyListFormat('UL', false); 95 | } 96 | }); 97 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/advlist/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("advlist",function(a){function b(a,b){var c=[];return tinymce.each(b.split(/[ ,]/),function(a){c.push({text:a.replace(/\-/g," ").replace(/\b\w/g,function(a){return a.toUpperCase()}),data:"default"==a?"":a})}),c}function c(b,c){a.undoManager.transact(function(){var d,e=a.dom,f=a.selection;d=e.getParent(f.getNode(),"ol,ul"),d&&d.nodeName==b&&c!==!1||a.execCommand("UL"==b?"InsertUnorderedList":"InsertOrderedList"),c=c===!1?g[b]:c,g[b]=c,d=e.getParent(f.getNode(),"ol,ul"),d&&(e.setStyle(d,"listStyleType",c?c:null),d.removeAttribute("data-mce-style")),a.focus()})}function d(b){var c=a.dom.getStyle(a.dom.getParent(a.selection.getNode(),"ol,ul"),"listStyleType")||"";b.control.items().each(function(a){a.active(a.settings.data===c)})}var e,f,g={};e=b("OL",a.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),f=b("UL",a.getParam("advlist_bullet_styles","default,circle,disc,square")),a.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:e,onshow:d,onselect:function(a){c("OL",a.control.settings.data)},onclick:function(){c("OL",!1)}}),a.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:f,onshow:d,onselect:function(a){c("UL",a.control.settings.data)},onclick:function(){c("UL",!1)}})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/anchor/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('anchor', function(editor) { 14 | function showDialog() { 15 | var selectedNode = editor.selection.getNode(), name = ''; 16 | var isAnchor = selectedNode.tagName == 'A' && editor.dom.getAttrib(selectedNode, 'href') === ''; 17 | 18 | if (isAnchor) { 19 | name = selectedNode.name || selectedNode.id || ''; 20 | } 21 | 22 | editor.windowManager.open({ 23 | title: 'Anchor', 24 | body: {type: 'textbox', name: 'name', size: 40, label: 'Name', value: name}, 25 | onsubmit: function(e) { 26 | var id = e.data.name; 27 | 28 | if (isAnchor) { 29 | selectedNode.id = id; 30 | } else { 31 | editor.selection.collapse(true); 32 | editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { 33 | id: id 34 | })); 35 | } 36 | } 37 | }); 38 | } 39 | 40 | editor.addCommand('mceAnchor', showDialog); 41 | 42 | editor.addButton('anchor', { 43 | icon: 'anchor', 44 | tooltip: 'Anchor', 45 | onclick: showDialog, 46 | stateSelector: 'a:not([href])' 47 | }); 48 | 49 | editor.addMenuItem('anchor', { 50 | icon: 'anchor', 51 | text: 'Anchor', 52 | context: 'insert', 53 | onclick: showDialog 54 | }); 55 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/anchor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("anchor",function(a){function b(){var b=a.selection.getNode(),c="",d="A"==b.tagName&&""===a.dom.getAttrib(b,"href");d&&(c=b.name||b.id||""),a.windowManager.open({title:"Anchor",body:{type:"textbox",name:"name",size:40,label:"Name",value:c},onsubmit:function(c){var e=c.data.name;d?b.id=e:(a.selection.collapse(!0),a.execCommand("mceInsertContent",!1,a.dom.createHTML("a",{id:e})))}})}a.addCommand("mceAnchor",b),a.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:b,stateSelector:"a:not([href])"}),a.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:b})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autolink/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('autolink', function(editor) { 14 | var AutoUrlDetectState; 15 | 16 | editor.on("keydown", function(e) { 17 | if (e.keyCode == 13) { 18 | return handleEnter(editor); 19 | } 20 | }); 21 | 22 | // Internet Explorer has built-in automatic linking for most cases 23 | if (tinymce.Env.ie) { 24 | editor.on("focus", function() { 25 | if (!AutoUrlDetectState) { 26 | AutoUrlDetectState = true; 27 | 28 | try { 29 | editor.execCommand('AutoUrlDetect', false, true); 30 | } catch (ex) { 31 | // Ignore 32 | } 33 | } 34 | }); 35 | 36 | return; 37 | } 38 | 39 | editor.on("keypress", function(e) { 40 | if (e.keyCode == 41) { 41 | return handleEclipse(editor); 42 | } 43 | }); 44 | 45 | editor.on("keyup", function(e) { 46 | if (e.keyCode == 32) { 47 | return handleSpacebar(editor); 48 | } 49 | }); 50 | 51 | function handleEclipse(editor) { 52 | parseCurrentLine(editor, -1, '(', true); 53 | } 54 | 55 | function handleSpacebar(editor) { 56 | parseCurrentLine(editor, 0, '', true); 57 | } 58 | 59 | function handleEnter(editor) { 60 | parseCurrentLine(editor, -1, '', false); 61 | } 62 | 63 | function parseCurrentLine(editor, end_offset, delimiter) { 64 | var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText; 65 | 66 | function scopeIndex(container, index) { 67 | if (index < 0) { 68 | index = 0; 69 | } 70 | 71 | if (container.nodeType == 3) { 72 | var len = container.data.length; 73 | 74 | if (index > len) { 75 | index = len; 76 | } 77 | } 78 | 79 | return index; 80 | } 81 | 82 | function setStart(container, offset) { 83 | if (container.nodeType != 1 || container.hasChildNodes()) { 84 | rng.setStart(container, scopeIndex(container, offset)); 85 | } else { 86 | rng.setStartBefore(container); 87 | } 88 | } 89 | 90 | function setEnd(container, offset) { 91 | if (container.nodeType != 1 || container.hasChildNodes()) { 92 | rng.setEnd(container, scopeIndex(container, offset)); 93 | } else { 94 | rng.setEndAfter(container); 95 | } 96 | } 97 | 98 | // Never create a link when we are inside a link 99 | if (editor.selection.getNode().tagName == 'A') { 100 | return; 101 | } 102 | 103 | // We need at least five characters to form a URL, 104 | // hence, at minimum, five characters from the beginning of the line. 105 | rng = editor.selection.getRng(true).cloneRange(); 106 | if (rng.startOffset < 5) { 107 | // During testing, the caret is placed inbetween two text nodes. 108 | // The previous text node contains the URL. 109 | prev = rng.endContainer.previousSibling; 110 | if (!prev) { 111 | if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { 112 | return; 113 | } 114 | 115 | prev = rng.endContainer.firstChild.nextSibling; 116 | } 117 | 118 | len = prev.length; 119 | setStart(prev, len); 120 | setEnd(prev, len); 121 | 122 | if (rng.endOffset < 5) { 123 | return; 124 | } 125 | 126 | end = rng.endOffset; 127 | endContainer = prev; 128 | } else { 129 | endContainer = rng.endContainer; 130 | 131 | // Get a text node 132 | if (endContainer.nodeType != 3 && endContainer.firstChild) { 133 | while (endContainer.nodeType != 3 && endContainer.firstChild) { 134 | endContainer = endContainer.firstChild; 135 | } 136 | 137 | // Move range to text node 138 | if (endContainer.nodeType == 3) { 139 | setStart(endContainer, 0); 140 | setEnd(endContainer, endContainer.nodeValue.length); 141 | } 142 | } 143 | 144 | if (rng.endOffset == 1) { 145 | end = 2; 146 | } else { 147 | end = rng.endOffset - 1 - end_offset; 148 | } 149 | } 150 | 151 | start = end; 152 | 153 | do { 154 | // Move the selection one character backwards. 155 | setStart(endContainer, end >= 2 ? end - 2 : 0); 156 | setEnd(endContainer, end >= 1 ? end - 1 : 0); 157 | end -= 1; 158 | rngText = rng.toString(); 159 | 160 | // Loop until one of the following is found: a blank space,  , delimiter, (end-2) >= 0 161 | } while (rngText != ' ' && rngText !== '' && rngText.charCodeAt(0) != 160 && (end - 2) >= 0 && rngText != delimiter); 162 | 163 | if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) { 164 | setStart(endContainer, end); 165 | setEnd(endContainer, start); 166 | end += 1; 167 | } else if (rng.startOffset === 0) { 168 | setStart(endContainer, 0); 169 | setEnd(endContainer, start); 170 | } else { 171 | setStart(endContainer, end); 172 | setEnd(endContainer, start); 173 | } 174 | 175 | // Exclude last . from word like "www.site.com." 176 | text = rng.toString(); 177 | if (text.charAt(text.length - 1) == '.') { 178 | setEnd(endContainer, start - 1); 179 | } 180 | 181 | text = rng.toString(); 182 | matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i); 183 | 184 | if (matches) { 185 | if (matches[1] == 'www.') { 186 | matches[1] = 'http://www.'; 187 | } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { 188 | matches[1] = 'mailto:' + matches[1]; 189 | } 190 | 191 | bookmark = editor.selection.getBookmark(); 192 | 193 | editor.selection.setRng(rng); 194 | editor.execCommand('createlink', false, matches[1] + matches[2]); 195 | editor.selection.moveToBookmark(bookmark); 196 | editor.nodeChanged(); 197 | } 198 | } 199 | }); 200 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autolink/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autolink",function(a){function b(a){e(a,-1,"(",!0)}function c(a){e(a,0,"",!0)}function d(a){e(a,-1,"",!1)}function e(a,b,c){function d(a,b){if(0>b&&(b=0),3==a.nodeType){var c=a.data.length;b>c&&(b=c)}return b}function e(a,b){1!=a.nodeType||a.hasChildNodes()?g.setStart(a,d(a,b)):g.setStartBefore(a)}function f(a,b){1!=a.nodeType||a.hasChildNodes()?g.setEnd(a,d(a,b)):g.setEndAfter(a)}var g,h,i,j,k,l,m,n,o,p;if("A"!=a.selection.getNode().tagName){if(g=a.selection.getRng(!0).cloneRange(),g.startOffset<5){if(n=g.endContainer.previousSibling,!n){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;n=g.endContainer.firstChild.nextSibling}if(o=n.length,e(n,o),f(n,o),g.endOffset<5)return;h=g.endOffset,j=n}else{if(j=g.endContainer,3!=j.nodeType&&j.firstChild){for(;3!=j.nodeType&&j.firstChild;)j=j.firstChild;3==j.nodeType&&(e(j,0),f(j,j.nodeValue.length))}h=1==g.endOffset?2:g.endOffset-1-b}i=h;do e(j,h>=2?h-2:0),f(j,h>=1?h-1:0),h-=1,p=g.toString();while(" "!=p&&""!==p&&160!=p.charCodeAt(0)&&h-2>=0&&p!=c);g.toString()==c||160==g.toString().charCodeAt(0)?(e(j,h),f(j,i),h+=1):0===g.startOffset?(e(j,0),f(j,i)):(e(j,h),f(j,i)),l=g.toString(),"."==l.charAt(l.length-1)&&f(j,i-1),l=g.toString(),m=l.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),m&&("www."==m[1]?m[1]="http://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),k=a.selection.getBookmark(),a.selection.setRng(g),a.execCommand("createlink",!1,m[1]+m[2]),a.selection.moveToBookmark(k),a.nodeChanged())}}var f;return a.on("keydown",function(b){return 13==b.keyCode?d(a):void 0}),tinymce.Env.ie?void a.on("focus",function(){if(!f){f=!0;try{a.execCommand("AutoUrlDetect",!1,!0)}catch(b){}}}):(a.on("keypress",function(c){return 41==c.keyCode?b(a):void 0}),void a.on("keyup",function(b){return 32==b.keyCode?c(a):void 0}))}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autoresize/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | /*eslint no-nested-ternary:0 */ 13 | 14 | /** 15 | * Auto Resize 16 | * 17 | * This plugin automatically resizes the content area to fit its content height. 18 | * It will retain a minimum height, which is the height of the content area when 19 | * it's initialized. 20 | */ 21 | tinymce.PluginManager.add('autoresize', function(editor) { 22 | var settings = editor.settings, oldSize = 0; 23 | 24 | function isFullscreen() { 25 | return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); 26 | } 27 | 28 | if (editor.settings.inline) { 29 | return; 30 | } 31 | 32 | /** 33 | * This method gets executed each time the editor needs to resize. 34 | */ 35 | function resize(e) { 36 | var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight, 37 | marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom; 38 | 39 | doc = editor.getDoc(); 40 | if (!doc) { 41 | return; 42 | } 43 | 44 | body = doc.body; 45 | docElm = doc.documentElement; 46 | resizeHeight = settings.autoresize_min_height; 47 | 48 | if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) { 49 | if (body && docElm) { 50 | body.style.overflowY = "auto"; 51 | docElm.style.overflowY = "auto"; // Old IE 52 | } 53 | 54 | return; 55 | } 56 | 57 | // Calculate outer height of the body element using CSS styles 58 | marginTop = editor.dom.getStyle(body, 'margin-top', true); 59 | marginBottom = editor.dom.getStyle(body, 'margin-bottom', true); 60 | paddingTop = editor.dom.getStyle(body, 'padding-top', true); 61 | paddingBottom = editor.dom.getStyle(body, 'padding-bottom', true); 62 | borderTop = editor.dom.getStyle(body, 'border-top-width', true); 63 | borderBottom = editor.dom.getStyle(body, 'border-bottom-width', true); 64 | myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) + 65 | parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) + 66 | parseInt(borderTop, 10) + parseInt(borderBottom, 10); 67 | 68 | // Make sure we have a valid height 69 | if (isNaN(myHeight) || myHeight <= 0) { 70 | // Get height differently depending on the browser used 71 | myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight); 72 | } 73 | 74 | // Don't make it smaller than the minimum height 75 | if (myHeight > settings.autoresize_min_height) { 76 | resizeHeight = myHeight; 77 | } 78 | 79 | // If a maximum height has been defined don't exceed this height 80 | if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) { 81 | resizeHeight = settings.autoresize_max_height; 82 | body.style.overflowY = "auto"; 83 | docElm.style.overflowY = "auto"; // Old IE 84 | } else { 85 | body.style.overflowY = "hidden"; 86 | docElm.style.overflowY = "hidden"; // Old IE 87 | body.scrollTop = 0; 88 | } 89 | 90 | // Resize content element 91 | if (resizeHeight !== oldSize) { 92 | deltaSize = resizeHeight - oldSize; 93 | DOM.setStyle(editor.iframeElement, 'height', resizeHeight + 'px'); 94 | oldSize = resizeHeight; 95 | 96 | // WebKit doesn't decrease the size of the body element until the iframe gets resized 97 | // So we need to continue to resize the iframe down until the size gets fixed 98 | if (tinymce.isWebKit && deltaSize < 0) { 99 | resize(e); 100 | } 101 | } 102 | } 103 | 104 | /** 105 | * Calls the resize x times in 100ms intervals. We can't wait for load events since 106 | * the CSS files might load async. 107 | */ 108 | function wait(times, interval, callback) { 109 | setTimeout(function() { 110 | resize({}); 111 | 112 | if (times--) { 113 | wait(times, interval, callback); 114 | } else if (callback) { 115 | callback(); 116 | } 117 | }, interval); 118 | } 119 | 120 | // Define minimum height 121 | settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10); 122 | 123 | // Define maximum height 124 | settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10); 125 | 126 | // Add padding at the bottom for better UX 127 | editor.on("init", function() { 128 | var overflowPadding, bottomMargin; 129 | 130 | overflowPadding = editor.getParam('autoresize_overflow_padding', 1); 131 | bottomMargin = editor.getParam('autoresize_bottom_margin', 50); 132 | 133 | if (overflowPadding !== false) { 134 | editor.dom.setStyles(editor.getBody(), { 135 | paddingLeft: overflowPadding, 136 | paddingRight: overflowPadding 137 | }); 138 | } 139 | 140 | if (bottomMargin !== false) { 141 | editor.dom.setStyles(editor.getBody(), { 142 | paddingBottom: bottomMargin 143 | }); 144 | } 145 | }); 146 | 147 | // Add appropriate listeners for resizing content area 148 | editor.on("nodechange setcontent keyup FullscreenStateChanged", resize); 149 | 150 | if (editor.getParam('autoresize_on_init', true)) { 151 | editor.on('init', function() { 152 | // Hit it 20 times in 100 ms intervals 153 | wait(20, 100, function() { 154 | // Hit it 5 times in 1 sec intervals 155 | wait(5, 1000); 156 | }); 157 | }); 158 | } 159 | 160 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); 161 | editor.addCommand('mceAutoResize', resize); 162 | }); 163 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autoresize/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("autoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(d){var g,h,i,j,k,l,m,n,o,p,q,r,s=tinymce.DOM;if(h=a.getDoc()){if(i=h.body,j=h.documentElement,k=e.autoresize_min_height,!i||d&&"setcontent"===d.type&&d.initial||b())return void(i&&j&&(i.style.overflowY="auto",j.style.overflowY="auto"));m=a.dom.getStyle(i,"margin-top",!0),n=a.dom.getStyle(i,"margin-bottom",!0),o=a.dom.getStyle(i,"padding-top",!0),p=a.dom.getStyle(i,"padding-bottom",!0),q=a.dom.getStyle(i,"border-top-width",!0),r=a.dom.getStyle(i,"border-bottom-width",!0),l=i.offsetHeight+parseInt(m,10)+parseInt(n,10)+parseInt(o,10)+parseInt(p,10)+parseInt(q,10)+parseInt(r,10),(isNaN(l)||0>=l)&&(l=tinymce.Env.ie?i.scrollHeight:tinymce.Env.webkit&&0===i.clientHeight?0:i.offsetHeight),l>e.autoresize_min_height&&(k=l),e.autoresize_max_height&&l>e.autoresize_max_height?(k=e.autoresize_max_height,i.style.overflowY="auto",j.style.overflowY="auto"):(i.style.overflowY="hidden",j.style.overflowY="hidden",i.scrollTop=0),k!==f&&(g=k-f,s.setStyle(a.iframeElement,"height",k+"px"),f=k,tinymce.isWebKit&&0>g&&c(d))}}function d(a,b,e){setTimeout(function(){c({}),a--?d(a,b,e):e&&e()},b)}var e=a.settings,f=0;a.settings.inline||(e.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),e.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),a.on("init",function(){var b,c;b=a.getParam("autoresize_overflow_padding",1),c=a.getParam("autoresize_bottom_margin",50),b!==!1&&a.dom.setStyles(a.getBody(),{paddingLeft:b,paddingRight:b}),c!==!1&&a.dom.setStyles(a.getBody(),{paddingBottom:c})}),a.on("nodechange setcontent keyup FullscreenStateChanged",c),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){d(20,100,function(){d(5,1e3)})}),a.addCommand("mceAutoResize",c))}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autosave/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | // Internal unload handler will be called before the page is unloaded 14 | // Needs to be outside the plugin since it would otherwise keep 15 | // a reference to editor in closue scope 16 | /*eslint no-func-assign:0 */ 17 | tinymce._beforeUnloadHandler = function() { 18 | var msg; 19 | 20 | tinymce.each(tinymce.editors, function(editor) { 21 | // Store a draft for each editor instance 22 | if (editor.plugins.autosave) { 23 | editor.plugins.autosave.storeDraft(); 24 | } 25 | 26 | // Setup a return message if the editor is dirty 27 | if (!msg && editor.isDirty() && editor.getParam("autosave_ask_before_unload", true)) { 28 | msg = editor.translate("You have unsaved changes are you sure you want to navigate away?"); 29 | } 30 | }); 31 | 32 | return msg; 33 | }; 34 | 35 | tinymce.PluginManager.add('autosave', function(editor) { 36 | var settings = editor.settings, LocalStorage = tinymce.util.LocalStorage, prefix, started; 37 | 38 | prefix = settings.autosave_prefix || 'tinymce-autosave-{path}{query}-{id}-'; 39 | prefix = prefix.replace(/\{path\}/g, document.location.pathname); 40 | prefix = prefix.replace(/\{query\}/g, document.location.search); 41 | prefix = prefix.replace(/\{id\}/g, editor.id); 42 | 43 | function parseTime(time, defaultTime) { 44 | var multipels = { 45 | s: 1000, 46 | m: 60000 47 | }; 48 | 49 | time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime)); 50 | 51 | return (time[2] ? multipels[time[2]] : 1) * parseInt(time, 10); 52 | } 53 | 54 | function hasDraft() { 55 | var time = parseInt(LocalStorage.getItem(prefix + "time"), 10) || 0; 56 | 57 | if (new Date().getTime() - time > settings.autosave_retention) { 58 | removeDraft(false); 59 | return false; 60 | } 61 | 62 | return true; 63 | } 64 | 65 | function removeDraft(fire) { 66 | LocalStorage.removeItem(prefix + "draft"); 67 | LocalStorage.removeItem(prefix + "time"); 68 | 69 | if (fire !== false) { 70 | editor.fire('RemoveDraft'); 71 | } 72 | } 73 | 74 | function storeDraft() { 75 | if (!isEmpty() && editor.isDirty()) { 76 | LocalStorage.setItem(prefix + "draft", editor.getContent({format: 'raw', no_events: true})); 77 | LocalStorage.setItem(prefix + "time", new Date().getTime()); 78 | editor.fire('StoreDraft'); 79 | } 80 | } 81 | 82 | function restoreDraft() { 83 | if (hasDraft()) { 84 | editor.setContent(LocalStorage.getItem(prefix + "draft"), {format: 'raw'}); 85 | editor.fire('RestoreDraft'); 86 | } 87 | } 88 | 89 | function startStoreDraft() { 90 | if (!started) { 91 | setInterval(function() { 92 | if (!editor.removed) { 93 | storeDraft(); 94 | } 95 | }, settings.autosave_interval); 96 | 97 | started = true; 98 | } 99 | } 100 | 101 | settings.autosave_interval = parseTime(settings.autosave_interval, '30s'); 102 | settings.autosave_retention = parseTime(settings.autosave_retention, '20m'); 103 | 104 | function postRender() { 105 | var self = this; 106 | 107 | self.disabled(!hasDraft()); 108 | 109 | editor.on('StoreDraft RestoreDraft RemoveDraft', function() { 110 | self.disabled(!hasDraft()); 111 | }); 112 | 113 | startStoreDraft(); 114 | } 115 | 116 | function restoreLastDraft() { 117 | editor.undoManager.beforeChange(); 118 | restoreDraft(); 119 | removeDraft(); 120 | editor.undoManager.add(); 121 | } 122 | 123 | editor.addButton('restoredraft', { 124 | title: 'Restore last draft', 125 | onclick: restoreLastDraft, 126 | onPostRender: postRender 127 | }); 128 | 129 | editor.addMenuItem('restoredraft', { 130 | text: 'Restore last draft', 131 | onclick: restoreLastDraft, 132 | onPostRender: postRender, 133 | context: 'file' 134 | }); 135 | 136 | function isEmpty(html) { 137 | var forcedRootBlockName = editor.settings.forced_root_block; 138 | 139 | html = tinymce.trim(typeof html == "undefined" ? editor.getBody().innerHTML : html); 140 | 141 | return html === '' || new RegExp( 142 | '^<' + forcedRootBlockName + '[^>]*>((\u00a0| |[ \t]|]*>)+?|)<\/' + forcedRootBlockName + '>|
$', 'i' 143 | ).test(html); 144 | } 145 | 146 | if (editor.settings.autosave_restore_when_empty !== false) { 147 | editor.on('init', function() { 148 | if (hasDraft() && isEmpty()) { 149 | restoreDraft(); 150 | } 151 | }); 152 | 153 | editor.on('saveContent', function() { 154 | removeDraft(); 155 | }); 156 | } 157 | 158 | window.onbeforeunload = tinymce._beforeUnloadHandler; 159 | 160 | this.hasDraft = hasDraft; 161 | this.storeDraft = storeDraft; 162 | this.restoreDraft = restoreDraft; 163 | this.removeDraft = removeDraft; 164 | this.isEmpty = isEmpty; 165 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/autosave/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce._beforeUnloadHandler=function(){var a;return tinymce.each(tinymce.editors,function(b){b.plugins.autosave&&b.plugins.autosave.storeDraft(),!a&&b.isDirty()&&b.getParam("autosave_ask_before_unload",!0)&&(a=b.translate("You have unsaved changes are you sure you want to navigate away?"))}),a},tinymce.PluginManager.add("autosave",function(a){function b(a,b){var c={s:1e3,m:6e4};return a=/^(\d+)([ms]?)$/.exec(""+(a||b)),(a[2]?c[a[2]]:1)*parseInt(a,10)}function c(){var a=parseInt(n.getItem(k+"time"),10)||0;return(new Date).getTime()-a>m.autosave_retention?(d(!1),!1):!0}function d(b){n.removeItem(k+"draft"),n.removeItem(k+"time"),b!==!1&&a.fire("RemoveDraft")}function e(){!j()&&a.isDirty()&&(n.setItem(k+"draft",a.getContent({format:"raw",no_events:!0})),n.setItem(k+"time",(new Date).getTime()),a.fire("StoreDraft"))}function f(){c()&&(a.setContent(n.getItem(k+"draft"),{format:"raw"}),a.fire("RestoreDraft"))}function g(){l||(setInterval(function(){a.removed||e()},m.autosave_interval),l=!0)}function h(){var b=this;b.disabled(!c()),a.on("StoreDraft RestoreDraft RemoveDraft",function(){b.disabled(!c())}),g()}function i(){a.undoManager.beforeChange(),f(),d(),a.undoManager.add()}function j(b){var c=a.settings.forced_root_block;return b=tinymce.trim("undefined"==typeof b?a.getBody().innerHTML:b),""===b||new RegExp("^<"+c+"[^>]*>((\xa0| |[ ]|]*>)+?|)|
$","i").test(b)}var k,l,m=a.settings,n=tinymce.util.LocalStorage;k=m.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",k=k.replace(/\{path\}/g,document.location.pathname),k=k.replace(/\{query\}/g,document.location.search),k=k.replace(/\{id\}/g,a.id),m.autosave_interval=b(m.autosave_interval,"30s"),m.autosave_retention=b(m.autosave_retention,"20m"),a.addButton("restoredraft",{title:"Restore last draft",onclick:i,onPostRender:h}),a.addMenuItem("restoredraft",{text:"Restore last draft",onclick:i,onPostRender:h,context:"file"}),a.settings.autosave_restore_when_empty!==!1&&(a.on("init",function(){c()&&j()&&f()}),a.on("saveContent",function(){d()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=c,this.storeDraft=e,this.restoreDraft=f,this.removeDraft=d,this.isEmpty=j}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/bbcode/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | (function() { 14 | tinymce.create('tinymce.plugins.BBCodePlugin', { 15 | init: function(ed) { 16 | var self = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); 17 | 18 | ed.on('beforeSetContent', function(e) { 19 | e.content = self['_' + dialect + '_bbcode2html'](e.content); 20 | }); 21 | 22 | ed.on('postProcess', function(e) { 23 | if (e.set) { 24 | e.content = self['_' + dialect + '_bbcode2html'](e.content); 25 | } 26 | 27 | if (e.get) { 28 | e.content = self['_' + dialect + '_html2bbcode'](e.content); 29 | } 30 | }); 31 | }, 32 | 33 | getInfo: function() { 34 | return { 35 | longname: 'BBCode Plugin', 36 | author: 'Ephox Corp', 37 | authorurl: 'http://www.tinymce.com', 38 | infourl: 'http://www.tinymce.com/wiki.php/Plugin:bbcode' 39 | }; 40 | }, 41 | 42 | // Private methods 43 | 44 | // HTML -> BBCode in PunBB dialect 45 | _punbb_html2bbcode: function(s) { 46 | s = tinymce.trim(s); 47 | 48 | function rep(re, str) { 49 | s = s.replace(re, str); 50 | } 51 | 52 | // example: to [b] 53 | rep(/(.*?)<\/a>/gi, "[url=$1]$2[/url]"); 54 | rep(/(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]"); 55 | rep(/(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]"); 56 | rep(/(.*?)<\/font>/gi, "[code][color=$1]$2[/color][/code]"); 57 | rep(/(.*?)<\/font>/gi, "[quote][color=$1]$2[/color][/quote]"); 58 | rep(/(.*?)<\/span>/gi, "[color=$1]$2[/color]"); 59 | rep(/(.*?)<\/font>/gi, "[color=$1]$2[/color]"); 60 | rep(/(.*?)<\/span>/gi, "[size=$1]$2[/size]"); 61 | rep(/(.*?)<\/font>/gi, "$1"); 62 | rep(//gi, "[img]$1[/img]"); 63 | rep(/(.*?)<\/span>/gi, "[code]$1[/code]"); 64 | rep(/(.*?)<\/span>/gi, "[quote]$1[/quote]"); 65 | rep(/(.*?)<\/strong>/gi, "[code][b]$1[/b][/code]"); 66 | rep(/(.*?)<\/strong>/gi, "[quote][b]$1[/b][/quote]"); 67 | rep(/(.*?)<\/em>/gi, "[code][i]$1[/i][/code]"); 68 | rep(/(.*?)<\/em>/gi, "[quote][i]$1[/i][/quote]"); 69 | rep(/(.*?)<\/u>/gi, "[code][u]$1[/u][/code]"); 70 | rep(/(.*?)<\/u>/gi, "[quote][u]$1[/u][/quote]"); 71 | rep(/<\/(strong|b)>/gi, "[/b]"); 72 | rep(/<(strong|b)>/gi, "[b]"); 73 | rep(/<\/(em|i)>/gi, "[/i]"); 74 | rep(/<(em|i)>/gi, "[i]"); 75 | rep(/<\/u>/gi, "[/u]"); 76 | rep(/(.*?)<\/span>/gi, "[u]$1[/u]"); 77 | rep(//gi, "[u]"); 78 | rep(/]*>/gi, "[quote]"); 79 | rep(/<\/blockquote>/gi, "[/quote]"); 80 | rep(/
/gi, "\n"); 81 | rep(//gi, "\n"); 82 | rep(/
/gi, "\n"); 83 | rep(/

/gi, ""); 84 | rep(/<\/p>/gi, "\n"); 85 | rep(/ |\u00a0/gi, " "); 86 | rep(/"/gi, "\""); 87 | rep(/</gi, "<"); 88 | rep(/>/gi, ">"); 89 | rep(/&/gi, "&"); 90 | 91 | return s; 92 | }, 93 | 94 | // BBCode -> HTML from PunBB dialect 95 | _punbb_bbcode2html: function(s) { 96 | s = tinymce.trim(s); 97 | 98 | function rep(re, str) { 99 | s = s.replace(re, str); 100 | } 101 | 102 | // example: [b] to 103 | rep(/\n/gi, "
"); 104 | rep(/\[b\]/gi, ""); 105 | rep(/\[\/b\]/gi, ""); 106 | rep(/\[i\]/gi, ""); 107 | rep(/\[\/i\]/gi, ""); 108 | rep(/\[u\]/gi, ""); 109 | rep(/\[\/u\]/gi, ""); 110 | rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, "$2"); 111 | rep(/\[url\](.*?)\[\/url\]/gi, "$1"); 112 | rep(/\[img\](.*?)\[\/img\]/gi, ""); 113 | rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, "$2"); 114 | rep(/\[code\](.*?)\[\/code\]/gi, "$1 "); 115 | rep(/\[quote.*?\](.*?)\[\/quote\]/gi, "$1 "); 116 | 117 | return s; 118 | } 119 | }); 120 | 121 | // Register plugin 122 | tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); 123 | })(); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/bbcode/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a){var b=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.on("beforeSetContent",function(a){a.content=b["_"+c+"_bbcode2html"](a.content)}),a.on("postProcess",function(a){a.set&&(a.content=b["_"+c+"_bbcode2html"](a.content)),a.get&&(a.content=b["_"+c+"_html2bbcode"](a.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Ephox Corp",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),b(/(.*?)<\/font>/gi,"$1"),b(//gi,"[img]$1[/img]"),b(/(.*?)<\/span>/gi,"[code]$1[/code]"),b(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),b(/<\/(strong|b)>/gi,"[/b]"),b(/<(strong|b)>/gi,"[b]"),b(/<\/(em|i)>/gi,"[/i]"),b(/<(em|i)>/gi,"[i]"),b(/<\/u>/gi,"[/u]"),b(/(.*?)<\/span>/gi,"[u]$1[/u]"),b(//gi,"[u]"),b(/]*>/gi,"[quote]"),b(/<\/blockquote>/gi,"[/quote]"),b(/
/gi,"\n"),b(//gi,"\n"),b(/
/gi,"\n"),b(/

/gi,""),b(/<\/p>/gi,"\n"),b(/ |\u00a0/gi," "),b(/"/gi,'"'),b(/</gi,"<"),b(/>/gi,">"),b(/&/gi,"&"),a},_punbb_bbcode2html:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/\n/gi,"
"),b(/\[b\]/gi,""),b(/\[\/b\]/gi,""),b(/\[i\]/gi,""),b(/\[\/i\]/gi,""),b(/\[u\]/gi,""),b(/\[\/u\]/gi,""),b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),b(/\[url\](.*?)\[\/url\]/gi,'$1'),b(/\[img\](.*?)\[\/img\]/gi,''),b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),b(/\[code\](.*?)\[\/code\]/gi,'$1 '),b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),a}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}(); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/charmap/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("charmap",function(a){function b(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var d,e,f,g;d='';var h=25,i=Math.ceil(c.length/h);for(f=0;i>f;f++){for(d+="",e=0;h>e;e++){var j=f*h+e;if(j
'+(k?String.fromCharCode(parseInt(k[0],10)):" ")+"
"}else d+="
"}d+="";var l={type:"container",html:d,onclick:function(c){var d=c.target;/^(TD|DIV)$/.test(d.nodeName)&&b(d).firstChild&&(a.execCommand("mceInsertContent",!1,tinymce.trim(d.innerText||d.textContent)),c.ctrlKey||g.close())},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(g.find("#preview").text(c.firstChild.firstChild.data),g.find("#previewTitle").text(c.title)):(g.find("#preview").text(" "),g.find("#previewTitle").text(" "))}};g=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[l,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"label",name:"previewTitle",text:" ",style:"text-align: center",border:1,minWidth:140,minHeight:80}]}],buttons:[{text:"Close",onclick:function(){g.close()}}]})}var c=[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]];a.addCommand("mceShowCharmap",b),a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/code/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('code', function(editor) { 14 | function showDialog() { 15 | var win = editor.windowManager.open({ 16 | title: "Source code", 17 | body: { 18 | type: 'textbox', 19 | name: 'code', 20 | multiline: true, 21 | minWidth: editor.getParam("code_dialog_width", 600), 22 | minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)), 23 | spellcheck: false, 24 | style: 'direction: ltr; text-align: left' 25 | }, 26 | onSubmit: function(e) { 27 | // We get a lovely "Wrong document" error in IE 11 if we 28 | // don't move the focus to the editor before creating an undo 29 | // transation since it tries to make a bookmark for the current selection 30 | editor.focus(); 31 | 32 | editor.undoManager.transact(function() { 33 | editor.setContent(e.data.code); 34 | }); 35 | 36 | editor.selection.setCursorLocation(); 37 | editor.nodeChanged(); 38 | } 39 | }); 40 | 41 | // Gecko has a major performance issue with textarea 42 | // contents so we need to set it when all reflows are done 43 | win.find('#code').value(editor.getContent({source_view: true})); 44 | } 45 | 46 | editor.addCommand("mceCodeEditor", showDialog); 47 | 48 | editor.addButton('code', { 49 | icon: 'code', 50 | tooltip: 'Source code', 51 | onclick: showDialog 52 | }); 53 | 54 | editor.addMenuItem('code', { 55 | icon: 'code', 56 | text: 'Source code', 57 | context: 'tools', 58 | onclick: showDialog 59 | }); 60 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/code/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/colorpicker/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('colorpicker', function(editor) { 14 | function colorPickerCallback(callback, value) { 15 | function setColor(value) { 16 | var color = new tinymce.util.Color(value), rgb = color.toRgb(); 17 | 18 | win.fromJSON({ 19 | r: rgb.r, 20 | g: rgb.g, 21 | b: rgb.b, 22 | hex: color.toHex().substr(1) 23 | }); 24 | 25 | showPreview(color.toHex()); 26 | } 27 | 28 | function showPreview(hexColor) { 29 | win.find('#preview')[0].getEl().style.background = hexColor; 30 | } 31 | 32 | var win = editor.windowManager.open({ 33 | title: 'Color', 34 | items: { 35 | type: 'container', 36 | layout: 'flex', 37 | direction: 'row', 38 | align: 'stretch', 39 | padding: 5, 40 | spacing: 10, 41 | items: [ 42 | { 43 | type: 'colorpicker', 44 | value: value, 45 | onchange: function() { 46 | var rgb = this.rgb(); 47 | 48 | if (win) { 49 | win.find('#r').value(rgb.r); 50 | win.find('#g').value(rgb.g); 51 | win.find('#b').value(rgb.b); 52 | win.find('#hex').value(this.value().substr(1)); 53 | showPreview(this.value()); 54 | } 55 | } 56 | }, 57 | { 58 | type: 'form', 59 | padding: 0, 60 | labelGap: 5, 61 | defaults: { 62 | type: 'textbox', 63 | size: 7, 64 | value: '0', 65 | flex: 1, 66 | spellcheck: false, 67 | onchange: function() { 68 | var colorPickerCtrl = win.find('colorpicker')[0]; 69 | var name, value; 70 | 71 | name = this.name(); 72 | value = this.value(); 73 | 74 | if (name == "hex") { 75 | value = '#' + value; 76 | setColor(value); 77 | colorPickerCtrl.value(value); 78 | return; 79 | } 80 | 81 | value = { 82 | r: win.find('#r').value(), 83 | g: win.find('#g').value(), 84 | b: win.find('#b').value() 85 | }; 86 | 87 | colorPickerCtrl.value(value); 88 | setColor(value); 89 | } 90 | }, 91 | items: [ 92 | {name: 'r', label: 'R', autofocus: 1}, 93 | {name: 'g', label: 'G'}, 94 | {name: 'b', label: 'B'}, 95 | {name: 'hex', label: '#', value: '000000'}, 96 | {name: 'preview', type: 'container', border: 1} 97 | ] 98 | } 99 | ] 100 | }, 101 | onSubmit: function() { 102 | callback('#' + this.toJSON().hex); 103 | } 104 | }); 105 | 106 | setColor(value); 107 | } 108 | 109 | if (!editor.settings.color_picker_callback) { 110 | editor.settings.color_picker_callback = colorPickerCallback; 111 | } 112 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/colorpicker/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("colorpicker",function(a){function b(b,c){function d(a){var b=new tinymce.util.Color(a),c=b.toRgb();f.fromJSON({r:c.r,g:c.g,b:c.b,hex:b.toHex().substr(1)}),e(b.toHex())}function e(a){f.find("#preview")[0].getEl().style.background=a}var f=a.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:c,onchange:function(){var a=this.rgb();f&&(f.find("#r").value(a.r),f.find("#g").value(a.g),f.find("#b").value(a.b),f.find("#hex").value(this.value().substr(1)),e(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var a,b,c=f.find("colorpicker")[0];return a=this.name(),b=this.value(),"hex"==a?(b="#"+b,d(b),void c.value(b)):(b={r:f.find("#r").value(),g:f.find("#g").value(),b:f.find("#b").value()},c.value(b),void d(b))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){b("#"+this.toJSON().hex)}});d(c)}a.settings.color_picker_callback||(a.settings.color_picker_callback=b)}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/contextmenu/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('contextmenu', function(editor) { 14 | var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native; 15 | 16 | editor.on('contextmenu', function(e) { 17 | var contextmenu, doc = editor.getDoc(); 18 | 19 | // Block TinyMCE menu on ctrlKey 20 | if (e.ctrlKey && !contextmenuNeverUseNative) { 21 | return; 22 | } 23 | 24 | e.preventDefault(); 25 | 26 | /** 27 | * WebKit/Blink on Mac has the odd behavior of selecting the target word or line this causes 28 | * issues when for example inserting images see: #7022 29 | */ 30 | if (tinymce.Env.mac && tinymce.Env.webkit) { 31 | if (e.button == 2 && doc.caretRangeFromPoint) { 32 | editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y)); 33 | } 34 | } 35 | 36 | contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable'; 37 | 38 | // Render menu 39 | if (!menu) { 40 | var items = []; 41 | 42 | tinymce.each(contextmenu.split(/[ ,]/), function(name) { 43 | var item = editor.menuItems[name]; 44 | 45 | if (name == '|') { 46 | item = {text: name}; 47 | } 48 | 49 | if (item) { 50 | item.shortcut = ''; // Hide shortcuts 51 | items.push(item); 52 | } 53 | }); 54 | 55 | for (var i = 0; i < items.length; i++) { 56 | if (items[i].text == '|') { 57 | if (i === 0 || i == items.length - 1) { 58 | items.splice(i, 1); 59 | } 60 | } 61 | } 62 | 63 | menu = new tinymce.ui.Menu({ 64 | items: items, 65 | context: 'contextmenu', 66 | classes: 'contextmenu' 67 | }).renderTo(); 68 | 69 | editor.on('remove', function() { 70 | menu.remove(); 71 | menu = null; 72 | }); 73 | } else { 74 | menu.show(); 75 | } 76 | 77 | // Position menu 78 | var pos = {x: e.pageX, y: e.pageY}; 79 | 80 | if (!editor.inline) { 81 | pos = tinymce.DOM.getPos(editor.getContentAreaContainer()); 82 | pos.x += e.clientX; 83 | pos.y += e.clientY; 84 | } 85 | 86 | menu.moveTo(pos.x, pos.y); 87 | }); 88 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/contextmenu/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("contextmenu",function(a){var b,c=a.settings.contextmenu_never_use_native;a.on("contextmenu",function(d){var e,f=a.getDoc();if(!d.ctrlKey||c){if(d.preventDefault(),tinymce.Env.mac&&tinymce.Env.webkit&&2==d.button&&f.caretRangeFromPoint&&a.selection.setRng(f.caretRangeFromPoint(d.x,d.y)),e=a.settings.contextmenu||"link image inserttable | cell row column deletetable",b)b.show();else{var g=[];tinymce.each(e.split(/[ ,]/),function(b){var c=a.menuItems[b];"|"==b&&(c={text:b}),c&&(c.shortcut="",g.push(c))});for(var h=0;h'; 35 | }); 36 | 37 | emoticonsHtml += ''; 38 | }); 39 | 40 | emoticonsHtml += ''; 41 | 42 | return emoticonsHtml; 43 | } 44 | 45 | editor.addButton('emoticons', { 46 | type: 'panelbutton', 47 | panel: { 48 | role: 'application', 49 | autohide: true, 50 | html: getHtml, 51 | onclick: function(e) { 52 | var linkElm = editor.dom.getParent(e.target, 'a'); 53 | 54 | if (linkElm) { 55 | editor.insertContent( 56 | '' + linkElm.getAttribute('data-mce-alt') + '' 57 | ); 58 | 59 | this.hide(); 60 | } 61 | } 62 | }, 63 | tooltip: 'Emoticons' 64 | }); 65 | }); 66 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/emoticons/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("emoticons",function(a,b){function c(){var a;return a='',tinymce.each(d,function(c){a+="",tinymce.each(c,function(c){var d=b+"/img/smiley-"+c+".gif";a+=''}),a+=""}),a+="
"}var d=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];a.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:c,onclick:function(b){var c=a.dom.getParent(b.target,"a");c&&(a.insertContent(''+c.getAttribute('),this.hide())}},tooltip:"Emoticons"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/fullpage/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("fullpage",function(a){function b(){var b=c();a.windowManager.open({title:"Document properties",data:b,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(a){d(tinymce.extend(b,a.data))}})}function c(){function b(a,b){var c=a.attr(b);return c||""}var c,d,f=e(),g={};return g.fontface=a.getParam("fullpage_default_fontface",""),g.fontsize=a.getParam("fullpage_default_fontsize",""),c=f.firstChild,7==c.type&&(g.xml_pi=!0,d=/encoding="([^"]+)"/.exec(c.value),d&&(g.docencoding=d[1])),c=f.getAll("#doctype")[0],c&&(g.doctype=""),c=f.getAll("title")[0],c&&c.firstChild&&(g.title=c.firstChild.value),k(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),c=f.getAll("html")[0],c&&(g.langcode=b(c,"lang")||b(c,"xml:lang")),g.stylesheets=[],tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),c=f.getAll("body")[0],c&&(g.langdir=b(c,"dir"),g.style=b(c,"style"),g.visited_color=b(c,"vlink"),g.link_color=b(c,"link"),g.active_color=b(c,"alink")),g}function d(b){function c(a,b,c){a.attr(b,c?c:void 0)}function d(a){g.firstChild?g.insert(a,g.firstChild):g.append(a)}var f,g,h,j,m,n=a.dom;f=e(),g=f.getAll("head")[0],g||(j=f.getAll("html")[0],g=new l("head",1),j.firstChild?j.insert(g,j.firstChild,!0):j.append(g)),j=f.firstChild,b.xml_pi?(m='version="1.0"',b.docencoding&&(m+=' encoding="'+b.docencoding+'"'),7!=j.type&&(j=new l("xml",7),f.insert(j,f.firstChild,!0)),j.value=m):j&&7==j.type&&j.remove(),j=f.getAll("#doctype")[0],b.doctype?(j||(j=new l("#doctype",10),b.xml_pi?f.insert(j,f.firstChild):d(j)),j.value=b.doctype.substring(9,b.doctype.length-1)):j&&j.remove(),j=null,k(f.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(j=a)}),b.docencoding?(j||(j=new l("meta",1),j.attr("http-equiv","Content-Type"),j.shortEnded=!0,d(j)),j.attr("content","text/html; charset="+b.docencoding)):j&&j.remove(),j=f.getAll("title")[0],b.title?(j?j.empty():(j=new l("title",1),d(j)),j.append(new l("#text",3)).value=b.title):j&&j.remove(),k("keywords,description,author,copyright,robots".split(","),function(a){var c,e,g=f.getAll("meta"),h=b[a];for(c=0;c"))}function e(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(i)}function f(b){function c(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var d,f,h,l,m=b.content,n="",o=a.dom;if(!b.selection&&!("raw"==b.format&&i||b.source_view&&a.getParam("fullpage_hide_in_source_view"))){0!==m.length||b.source_view||(m=tinymce.trim(i)+"\n"+tinymce.trim(m)+"\n"+tinymce.trim(j)),m=m.replace(/<(\/?)BODY/gi,"<$1body"),d=m.indexOf("",d),i=c(m.substring(0,d+1)),f=m.indexOf("\n"),h=e(),k(h.getAll("style"),function(a){a.firstChild&&(n+=a.firstChild.value)}),l=h.getAll("body")[0],l&&o.setAttribs(a.getBody(),{style:l.attr("style")||"",dir:l.attr("dir")||"",vLink:l.attr("vlink")||"",link:l.attr("link")||"",aLink:l.attr("alink")||""}),o.remove("fullpage_styles");var p=a.getDoc().getElementsByTagName("head")[0];n&&(o.add(p,"style",{id:"fullpage_styles"},n),l=o.get("fullpage_styles"),l.styleSheet&&(l.styleSheet.cssText=n));var q={};tinymce.each(p.getElementsByTagName("link"),function(a){"stylesheet"==a.rel&&a.getAttribute("data-mce-fullpage")&&(q[a.href]=a)}),tinymce.each(h.getAll("link"),function(a){var b=a.attr("href");q[b]||"stylesheet"!=a.attr("rel")||o.add(p,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),delete q[b]}),tinymce.each(q,function(a){a.parentNode.removeChild(a)})}}function g(){var b,c="",d="";return a.getParam("fullpage_default_xml_pi")&&(c+='\n'),c+=a.getParam("fullpage_default_doctype",""),c+="\n\n\n",(b=a.getParam("fullpage_default_title"))&&(c+=""+b+"\n"),(b=a.getParam("fullpage_default_encoding"))&&(c+='\n'),(b=a.getParam("fullpage_default_font_family"))&&(d+="font-family: "+b+";"),(b=a.getParam("fullpage_default_font_size"))&&(d+="font-size: "+b+";"),(b=a.getParam("fullpage_default_text_color"))&&(d+="color: "+b+";"),c+="\n\n"}function h(b){b.selection||b.source_view&&a.getParam("fullpage_hide_in_source_view")||(b.content=tinymce.trim(i)+"\n"+tinymce.trim(b.content)+"\n"+tinymce.trim(j))}var i,j,k=tinymce.each,l=tinymce.html.Node;a.addCommand("mceFullPageProperties",b),a.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),a.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),a.on("BeforeSetContent",f),a.on("GetContent",h)}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/fullscreen/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('fullscreen', function(editor) { 14 | var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler; 15 | var containerWidth, containerHeight; 16 | 17 | if (editor.settings.inline) { 18 | return; 19 | } 20 | 21 | function getWindowSize() { 22 | var w, h, win = window, doc = document; 23 | var body = doc.body; 24 | 25 | // Old IE 26 | if (body.offsetWidth) { 27 | w = body.offsetWidth; 28 | h = body.offsetHeight; 29 | } 30 | 31 | // Modern browsers 32 | if (win.innerWidth && win.innerHeight) { 33 | w = win.innerWidth; 34 | h = win.innerHeight; 35 | } 36 | 37 | return {w: w, h: h}; 38 | } 39 | 40 | function toggleFullscreen() { 41 | var body = document.body, documentElement = document.documentElement, editorContainerStyle; 42 | var editorContainer, iframe, iframeStyle; 43 | 44 | function resize() { 45 | DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); 46 | } 47 | 48 | fullscreenState = !fullscreenState; 49 | 50 | editorContainer = editor.getContainer(); 51 | editorContainerStyle = editorContainer.style; 52 | iframe = editor.getContentAreaContainer().firstChild; 53 | iframeStyle = iframe.style; 54 | 55 | if (fullscreenState) { 56 | iframeWidth = iframeStyle.width; 57 | iframeHeight = iframeStyle.height; 58 | iframeStyle.width = iframeStyle.height = '100%'; 59 | containerWidth = editorContainerStyle.width; 60 | containerHeight = editorContainerStyle.height; 61 | editorContainerStyle.width = editorContainerStyle.height = ''; 62 | 63 | DOM.addClass(body, 'mce-fullscreen'); 64 | DOM.addClass(documentElement, 'mce-fullscreen'); 65 | DOM.addClass(editorContainer, 'mce-fullscreen'); 66 | 67 | DOM.bind(window, 'resize', resize); 68 | resize(); 69 | resizeHandler = resize; 70 | } else { 71 | iframeStyle.width = iframeWidth; 72 | iframeStyle.height = iframeHeight; 73 | 74 | if (containerWidth) { 75 | editorContainerStyle.width = containerWidth; 76 | } 77 | 78 | if (containerHeight) { 79 | editorContainerStyle.height = containerHeight; 80 | } 81 | 82 | DOM.removeClass(body, 'mce-fullscreen'); 83 | DOM.removeClass(documentElement, 'mce-fullscreen'); 84 | DOM.removeClass(editorContainer, 'mce-fullscreen'); 85 | DOM.unbind(window, 'resize', resizeHandler); 86 | } 87 | 88 | editor.fire('FullscreenStateChanged', {state: fullscreenState}); 89 | } 90 | 91 | editor.on('init', function() { 92 | editor.addShortcut('Meta+Alt+F', '', toggleFullscreen); 93 | }); 94 | 95 | editor.on('remove', function() { 96 | if (resizeHandler) { 97 | DOM.unbind(window, 'resize', resizeHandler); 98 | } 99 | }); 100 | 101 | editor.addCommand('mceFullScreen', toggleFullscreen); 102 | 103 | editor.addMenuItem('fullscreen', { 104 | text: 'Fullscreen', 105 | shortcut: 'Meta+Alt+F', 106 | selectable: true, 107 | onClick: toggleFullscreen, 108 | onPostRender: function() { 109 | var self = this; 110 | 111 | editor.on('FullscreenStateChanged', function(e) { 112 | self.active(e.state); 113 | }); 114 | }, 115 | context: 'view' 116 | }); 117 | 118 | editor.addButton('fullscreen', { 119 | tooltip: 'Fullscreen', 120 | shortcut: 'Meta+Alt+F', 121 | onClick: toggleFullscreen, 122 | onPostRender: function() { 123 | var self = this; 124 | 125 | editor.on('FullscreenStateChanged', function(e) { 126 | self.active(e.state); 127 | }); 128 | } 129 | }); 130 | 131 | return { 132 | isFullscreen: function() { 133 | return fullscreenState; 134 | } 135 | }; 136 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/fullscreen/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){function c(){j.setStyle(m,"height",b().h-(l.clientHeight-m.clientHeight))}var k,l,m,n,o=document.body,p=document.documentElement;i=!i,l=a.getContainer(),k=l.style,m=a.getContentAreaContainer().firstChild,n=m.style,i?(d=n.width,e=n.height,n.width=n.height="100%",g=k.width,h=k.height,k.width=k.height="",j.addClass(o,"mce-fullscreen"),j.addClass(p,"mce-fullscreen"),j.addClass(l,"mce-fullscreen"),j.bind(window,"resize",c),c(),f=c):(n.width=d,n.height=e,g&&(k.width=g),h&&(k.height=h),j.removeClass(o,"mce-fullscreen"),j.removeClass(p,"mce-fullscreen"),j.removeClass(l,"mce-fullscreen"),j.unbind(window,"resize",f)),a.fire("FullscreenStateChanged",{state:i})}var d,e,f,g,h,i=!1,j=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Meta+Alt+F","",c)}),a.on("remove",function(){f&&j.unbind(window,"resize",f)}),a.addCommand("mceFullScreen",c),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Meta+Alt+F",selectable:!0,onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Meta+Alt+F",onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return i}})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/hr/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('hr', function(editor) { 14 | editor.addCommand('InsertHorizontalRule', function() { 15 | editor.execCommand('mceInsertContent', false, '


'); 16 | }); 17 | 18 | editor.addButton('hr', { 19 | icon: 'hr', 20 | tooltip: 'Horizontal line', 21 | cmd: 'InsertHorizontalRule' 22 | }); 23 | 24 | editor.addMenuItem('hr', { 25 | icon: 'hr', 26 | text: 'Horizontal line', 27 | cmd: 'InsertHorizontalRule', 28 | context: 'insert' 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/hr/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"
")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/image/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("image",function(a){function b(a,b){function c(a,c){d.parentNode&&d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(Math.max(d.width,d.clientWidth),Math.max(d.height,d.clientHeight))},d.onerror=function(){c()};var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d),d.src=a}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){return function(){var c=a.settings.image_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function e(d){function e(){var a,b,c,d;a=l.find("#width")[0],b=l.find("#height")[0],a&&b&&(c=a.value(),d=b.value(),l.find("#constrain")[0].checked()&&m&&n&&c&&d&&(m!=c?(d=Math.round(c/m*d),isNaN(d)||b.value(d)):(c=Math.round(d/n*c),isNaN(c)||a.value(c))),m=c,n=d)}function f(){function b(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){q.width||q.height||!t||r.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}j(),e(),q=tinymce.extend(q,l.toJSON()),q.alt||(q.alt=""),q.title||(q.title=""),""===q.width&&(q.width=null),""===q.height&&(q.height=null),q.style||(q.style=null),q={src:q.src,alt:q.alt,title:q.title,width:q.width,height:q.height,style:q.style,"class":q["class"]},a.undoManager.transact(function(){return q.src?(""===q.title&&(q.title=null),s?(r.setAttribs(s,q),a.editorUpload.uploadImagesAuto()):(q.id="__mcenew",a.focus(),a.selection.setContent(r.createHTML("img",q)),s=r.get("__mcenew"),r.setAttrib(s,"id",null)),void b(s)):void(s&&(r.remove(s),a.focus(),a.nodeChanged()))})}function g(a){return a&&(a=a.replace(/px$/,"")),a}function h(c){var d,e,f,g=c.meta||{};o&&o.value(a.convertURL(this.value(),"src")),tinymce.each(g,function(a,b){l.find("#"+b).value(a)}),g.width||g.height||(d=a.convertURL(this.value(),"src"),e=a.settings.image_prepend_url,f=new RegExp("^(?:[a-z]+:)?//","i"),e&&!f.test(d)&&d.substring(0,e.length)!==e&&(d=e+d),this.value(d),b(a.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&t&&(m=a.width,n=a.height,l.find("#width").value(m),l.find("#height").value(n))}))}function i(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a}function j(){function b(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a}if(a.settings.image_advtab){var c=l.toJSON(),d=r.parseStyle(c.style);d=i(d),c.vspace&&(d["margin-top"]=d["margin-bottom"]=b(c.vspace)),c.hspace&&(d["margin-left"]=d["margin-right"]=b(c.hspace)),c.border&&(d["border-width"]=b(c.border)),l.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(d))))}}function k(){if(a.settings.image_advtab){var b=l.toJSON(),c=r.parseStyle(b.style);l.find("#vspace").value(""),l.find("#hspace").value(""),c=i(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(c["margin-top"]===c["margin-bottom"]?l.find("#vspace").value(g(c["margin-top"])):l.find("#vspace").value(""),c["margin-right"]===c["margin-left"]?l.find("#hspace").value(g(c["margin-right"])):l.find("#hspace").value("")),c["border-width"]&&l.find("#border").value(g(c["border-width"])),l.find("#style").value(r.serializeStyle(r.parseStyle(r.serializeStyle(c))))}}var l,m,n,o,p,q={},r=a.dom,s=a.selection.getNode(),t=a.settings.image_dimensions!==!1;m=r.getAttrib(s,"width"),n=r.getAttrib(s,"height"),"IMG"!=s.nodeName||s.getAttribute("data-mce-object")||s.getAttribute("data-mce-placeholder")?s=null:q={src:r.getAttrib(s,"src"),alt:r.getAttrib(s,"alt"),title:r.getAttrib(s,"title"),"class":r.getAttrib(s,"class"),width:m,height:n},d&&(o={type:"listbox",label:"Image list",values:c(d,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:q.src&&a.convertURL(q.src,"src"),onselect:function(a){var b=l.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){o=this}}),a.settings.image_class_list&&(p={name:"class",type:"listbox",label:"Class",values:c(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var u=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:h},o];a.settings.image_description!==!1&&u.push({name:"alt",type:"textbox",label:"Image description"}),a.settings.image_title&&u.push({name:"title",type:"textbox",label:"Image Title"}),t&&u.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),u.push(p),a.settings.image_advtab?(s&&(s.style.marginLeft&&s.style.marginRight&&s.style.marginLeft===s.style.marginRight&&(q.hspace=g(s.style.marginLeft)),s.style.marginTop&&s.style.marginBottom&&s.style.marginTop===s.style.marginBottom&&(q.vspace=g(s.style.marginTop)),s.style.borderWidth&&(q.border=g(s.style.borderWidth)),q.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(s,"style")))),l=a.windowManager.open({title:"Insert/edit image",data:q,bodyType:"tabpanel",body:[{title:"General",type:"form",items:u},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:k},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:j},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:f})):l=a.windowManager.open({title:"Insert/edit image",data:q,body:u,onSubmit:f})}a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:d(e),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),a.addMenuItem("image",{icon:"image",text:"Insert/edit image",onclick:d(e),context:"insert",prependToContext:!0}),a.addCommand("mceImage",d(e))}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/importcss/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('importcss', function(editor) { 14 | var self = this, each = tinymce.each; 15 | 16 | function compileFilter(filter) { 17 | if (typeof filter == "string") { 18 | return function(value) { 19 | return value.indexOf(filter) !== -1; 20 | }; 21 | } else if (filter instanceof RegExp) { 22 | return function(value) { 23 | return filter.test(value); 24 | }; 25 | } 26 | 27 | return filter; 28 | } 29 | 30 | function getSelectors(doc, fileFilter) { 31 | var selectors = [], contentCSSUrls = {}; 32 | 33 | function append(styleSheet, imported) { 34 | var href = styleSheet.href, rules; 35 | 36 | if (!href || !fileFilter(href, imported)) { 37 | return; 38 | } 39 | 40 | each(styleSheet.imports, function(styleSheet) { 41 | append(styleSheet, true); 42 | }); 43 | 44 | try { 45 | rules = styleSheet.cssRules || styleSheet.rules; 46 | } catch (e) { 47 | // Firefox fails on rules to remote domain for example: 48 | // @import url(//fonts.googleapis.com/css?family=Pathway+Gothic+One); 49 | } 50 | 51 | each(rules, function(cssRule) { 52 | if (cssRule.styleSheet) { 53 | append(cssRule.styleSheet, true); 54 | } else if (cssRule.selectorText) { 55 | each(cssRule.selectorText.split(','), function(selector) { 56 | selectors.push(tinymce.trim(selector)); 57 | }); 58 | } 59 | }); 60 | } 61 | 62 | each(editor.contentCSS, function(url) { 63 | contentCSSUrls[url] = true; 64 | }); 65 | 66 | if (!fileFilter) { 67 | fileFilter = function(href, imported) { 68 | return imported || contentCSSUrls[href]; 69 | }; 70 | } 71 | 72 | try { 73 | each(doc.styleSheets, function(styleSheet) { 74 | append(styleSheet); 75 | }); 76 | } catch (e) { 77 | // Ignore 78 | } 79 | 80 | return selectors; 81 | } 82 | 83 | function convertSelectorToFormat(selectorText) { 84 | var format; 85 | 86 | // Parse simple element.class1, .class1 87 | var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText); 88 | if (!selector) { 89 | return; 90 | } 91 | 92 | var elementName = selector[1]; 93 | var classes = selector[2].substr(1).split('.').join(' '); 94 | var inlineSelectorElements = tinymce.makeMap('a,img'); 95 | 96 | // element.class - Produce block formats 97 | if (selector[1]) { 98 | format = { 99 | title: selectorText 100 | }; 101 | 102 | if (editor.schema.getTextBlockElements()[elementName]) { 103 | // Text block format ex: h1.class1 104 | format.block = elementName; 105 | } else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) { 106 | // Block elements such as table.class and special inline elements such as a.class or img.class 107 | format.selector = elementName; 108 | } else { 109 | // Inline format strong.class1 110 | format.inline = elementName; 111 | } 112 | } else if (selector[2]) { 113 | // .class - Produce inline span with classes 114 | format = { 115 | inline: 'span', 116 | title: selectorText.substr(1), 117 | classes: classes 118 | }; 119 | } 120 | 121 | // Append to or override class attribute 122 | if (editor.settings.importcss_merge_classes !== false) { 123 | format.classes = classes; 124 | } else { 125 | format.attributes = {"class": classes}; 126 | } 127 | 128 | return format; 129 | } 130 | 131 | editor.on('renderFormatsMenu', function(e) { 132 | var settings = editor.settings, selectors = {}; 133 | var selectorConverter = settings.importcss_selector_converter || convertSelectorToFormat; 134 | var selectorFilter = compileFilter(settings.importcss_selector_filter), ctrl = e.control; 135 | 136 | if (!editor.settings.importcss_append) { 137 | ctrl.items().remove(); 138 | } 139 | 140 | // Setup new groups collection by cloning the configured one 141 | var groups = []; 142 | tinymce.each(settings.importcss_groups, function(group) { 143 | group = tinymce.extend({}, group); 144 | group.filter = compileFilter(group.filter); 145 | groups.push(group); 146 | }); 147 | 148 | each(getSelectors(e.doc || editor.getDoc(), compileFilter(settings.importcss_file_filter)), function(selector) { 149 | if (selector.indexOf('.mce-') === -1) { 150 | if (!selectors[selector] && (!selectorFilter || selectorFilter(selector))) { 151 | var format = selectorConverter.call(self, selector), menu; 152 | 153 | if (format) { 154 | var formatName = format.name || tinymce.DOM.uniqueId(); 155 | 156 | if (groups) { 157 | for (var i = 0; i < groups.length; i++) { 158 | if (!groups[i].filter || groups[i].filter(selector)) { 159 | if (!groups[i].item) { 160 | groups[i].item = {text: groups[i].title, menu: []}; 161 | } 162 | 163 | menu = groups[i].item.menu; 164 | break; 165 | } 166 | } 167 | } 168 | 169 | editor.formatter.register(formatName, format); 170 | 171 | var menuItem = tinymce.extend({}, ctrl.settings.itemDefaults, { 172 | text: format.title, 173 | format: formatName 174 | }); 175 | 176 | if (menu) { 177 | menu.push(menuItem); 178 | } else { 179 | ctrl.add(menuItem); 180 | } 181 | } 182 | 183 | selectors[selector] = true; 184 | } 185 | } 186 | }); 187 | 188 | each(groups, function(group) { 189 | ctrl.add(group.item); 190 | }); 191 | 192 | e.control.renderNew(); 193 | }); 194 | 195 | // Expose default convertSelectorToFormat implementation 196 | self.convertSelectorToFormat = convertSelectorToFormat; 197 | }); 198 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/importcss/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("importcss",function(a){function b(a){return"string"==typeof a?function(b){return-1!==b.indexOf(a)}:a instanceof RegExp?function(b){return a.test(b)}:a}function c(b,c){function d(a,b){var g,h=a.href;if(h&&c(h,b)){f(a.imports,function(a){d(a,!0)});try{g=a.cssRules||a.rules}catch(i){}f(g,function(a){a.styleSheet?d(a.styleSheet,!0):a.selectorText&&f(a.selectorText.split(","),function(a){e.push(tinymce.trim(a))})})}}var e=[],g={};f(a.contentCSS,function(a){g[a]=!0}),c||(c=function(a,b){return b||g[a]});try{f(b.styleSheets,function(a){d(a)})}catch(h){}return e}function d(b){var c,d=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(b);if(d){var e=d[1],f=d[2].substr(1).split(".").join(" "),g=tinymce.makeMap("a,img");return d[1]?(c={title:b},a.schema.getTextBlockElements()[e]?c.block=e:a.schema.getBlockElements()[e]||g[e.toLowerCase()]?c.selector=e:c.inline=e):d[2]&&(c={inline:"span",title:b.substr(1),classes:f}),a.settings.importcss_merge_classes!==!1?c.classes=f:c.attributes={"class":f},c}}var e=this,f=tinymce.each;a.on("renderFormatsMenu",function(g){var h=a.settings,i={},j=h.importcss_selector_converter||d,k=b(h.importcss_selector_filter),l=g.control;a.settings.importcss_append||l.items().remove();var m=[];tinymce.each(h.importcss_groups,function(a){a=tinymce.extend({},a),a.filter=b(a.filter),m.push(a)}),f(c(g.doc||a.getDoc(),b(h.importcss_file_filter)),function(b){if(-1===b.indexOf(".mce-")&&!i[b]&&(!k||k(b))){var c,d=j.call(e,b);if(d){var f=d.name||tinymce.DOM.uniqueId();if(m)for(var g=0;g' + html + ''; 68 | 69 | var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); 70 | if (timeElm) { 71 | editor.dom.setOuterHTML(timeElm, html); 72 | return; 73 | } 74 | } 75 | 76 | editor.insertContent(html); 77 | } 78 | 79 | editor.addCommand('mceInsertDate', function() { 80 | insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d"))); 81 | }); 82 | 83 | editor.addCommand('mceInsertTime', function() { 84 | insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S'))); 85 | }); 86 | 87 | editor.addButton('insertdatetime', { 88 | type: 'splitbutton', 89 | title: 'Insert date/time', 90 | onclick: function() { 91 | insertDateTime(lastFormat || defaultButtonTimeFormat); 92 | }, 93 | menu: menuItems 94 | }); 95 | 96 | tinymce.each(editor.settings.insertdatetime_formats || [ 97 | "%H:%M:%S", 98 | "%Y-%m-%d", 99 | "%I:%M:%S %p", 100 | "%D" 101 | ], function(fmt) { 102 | if (!defaultButtonTimeFormat) { 103 | defaultButtonTimeFormat = fmt; 104 | } 105 | 106 | menuItems.push({ 107 | text: getDateTime(fmt), 108 | onclick: function() { 109 | lastFormat = fmt; 110 | insertDateTime(fmt); 111 | } 112 | }); 113 | }); 114 | 115 | editor.addMenuItem('insertdatetime', { 116 | icon: 'date', 117 | text: 'Insert date/time', 118 | menu: menuItems, 119 | context: 'insert' 120 | }); 121 | }); 122 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/insertdatetime/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("insertdatetime",function(a){function b(b,c){function d(a,b){if(a=""+a,a.length'+d+"";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:j,context:"insert"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/layer/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('layer', function(editor) { 14 | function getParentLayer(node) { 15 | do { 16 | if (node.className && node.className.indexOf('mceItemLayer') != -1) { 17 | return node; 18 | } 19 | } while ((node = node.parentNode)); 20 | } 21 | 22 | function visualAid(e) { 23 | var dom = editor.dom; 24 | 25 | tinymce.each(dom.select('div,p', e), function(e) { 26 | if (/^(absolute|relative|fixed)$/i.test(e.style.position)) { 27 | if (e.hasVisual) { 28 | dom.addClass(e, 'mceItemVisualAid'); 29 | } else { 30 | dom.removeClass(e, 'mceItemVisualAid'); 31 | } 32 | 33 | dom.addClass(e, 'mceItemLayer'); 34 | } 35 | }); 36 | } 37 | 38 | function move(d) { 39 | var i, z = [], le = getParentLayer(editor.selection.getNode()), ci = -1, fi = -1, nl; 40 | 41 | nl = []; 42 | tinymce.walk(editor.getBody(), function(n) { 43 | if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) { 44 | nl.push(n); 45 | } 46 | }, 'childNodes'); 47 | 48 | // Find z-indexes 49 | for (i = 0; i < nl.length; i++) { 50 | z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex, 10) : 0; 51 | 52 | if (ci < 0 && nl[i] == le) { 53 | ci = i; 54 | } 55 | } 56 | 57 | if (d < 0) { 58 | // Move back 59 | 60 | // Try find a lower one 61 | for (i = 0; i < z.length; i++) { 62 | if (z[i] < z[ci]) { 63 | fi = i; 64 | break; 65 | } 66 | } 67 | 68 | if (fi > -1) { 69 | nl[ci].style.zIndex = z[fi]; 70 | nl[fi].style.zIndex = z[ci]; 71 | } else { 72 | if (z[ci] > 0) { 73 | nl[ci].style.zIndex = z[ci] - 1; 74 | } 75 | } 76 | } else { 77 | // Move forward 78 | 79 | // Try find a higher one 80 | for (i = 0; i < z.length; i++) { 81 | if (z[i] > z[ci]) { 82 | fi = i; 83 | break; 84 | } 85 | } 86 | 87 | if (fi > -1) { 88 | nl[ci].style.zIndex = z[fi]; 89 | nl[fi].style.zIndex = z[ci]; 90 | } else { 91 | nl[ci].style.zIndex = z[ci] + 1; 92 | } 93 | } 94 | 95 | editor.execCommand('mceRepaint'); 96 | } 97 | 98 | function insertLayer() { 99 | var dom = editor.dom, p = dom.getPos(dom.getParent(editor.selection.getNode(), '*')); 100 | var body = editor.getBody(); 101 | 102 | editor.dom.add(body, 'div', { 103 | style: { 104 | position: 'absolute', 105 | left: p.x, 106 | top: (p.y > 20 ? p.y : 20), 107 | width: 100, 108 | height: 100 109 | }, 110 | 'class': 'mceItemVisualAid mceItemLayer' 111 | }, editor.selection.getContent() || editor.getLang('layer.content')); 112 | 113 | // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 114 | if (tinymce.Env.ie) { 115 | dom.setHTML(body, body.innerHTML); 116 | } 117 | } 118 | 119 | function toggleAbsolute() { 120 | var le = getParentLayer(editor.selection.getNode()); 121 | 122 | if (!le) { 123 | le = editor.dom.getParent(editor.selection.getNode(), 'DIV,P,IMG'); 124 | } 125 | 126 | if (le) { 127 | if (le.style.position.toLowerCase() == "absolute") { 128 | editor.dom.setStyles(le, { 129 | position: '', 130 | left: '', 131 | top: '', 132 | width: '', 133 | height: '' 134 | }); 135 | 136 | editor.dom.removeClass(le, 'mceItemVisualAid'); 137 | editor.dom.removeClass(le, 'mceItemLayer'); 138 | } else { 139 | if (!le.style.left) { 140 | le.style.left = 20 + 'px'; 141 | } 142 | 143 | if (!le.style.top) { 144 | le.style.top = 20 + 'px'; 145 | } 146 | 147 | if (!le.style.width) { 148 | le.style.width = le.width ? (le.width + 'px') : '100px'; 149 | } 150 | 151 | if (!le.style.height) { 152 | le.style.height = le.height ? (le.height + 'px') : '100px'; 153 | } 154 | 155 | le.style.position = "absolute"; 156 | 157 | editor.dom.setAttrib(le, 'data-mce-style', ''); 158 | editor.addVisual(editor.getBody()); 159 | } 160 | 161 | editor.execCommand('mceRepaint'); 162 | editor.nodeChanged(); 163 | } 164 | } 165 | 166 | // Register commands 167 | editor.addCommand('mceInsertLayer', insertLayer); 168 | 169 | editor.addCommand('mceMoveForward', function() { 170 | move(1); 171 | }); 172 | 173 | editor.addCommand('mceMoveBackward', function() { 174 | move(-1); 175 | }); 176 | 177 | editor.addCommand('mceMakeAbsolute', function() { 178 | toggleAbsolute(); 179 | }); 180 | 181 | // Register buttons 182 | editor.addButton('moveforward', {title: 'layer.forward_desc', cmd: 'mceMoveForward'}); 183 | editor.addButton('movebackward', {title: 'layer.backward_desc', cmd: 'mceMoveBackward'}); 184 | editor.addButton('absolute', {title: 'layer.absolute_desc', cmd: 'mceMakeAbsolute'}); 185 | editor.addButton('insertlayer', {title: 'layer.insertlayer_desc', cmd: 'mceInsertLayer'}); 186 | 187 | editor.on('init', function() { 188 | if (tinymce.Env.ie) { 189 | editor.getDoc().execCommand('2D-Position', false, true); 190 | } 191 | }); 192 | 193 | // Remove serialized styles when selecting a layer since it might be changed by a drag operation 194 | editor.on('mouseup', function(e) { 195 | var layer = getParentLayer(e.target); 196 | 197 | if (layer) { 198 | editor.dom.setAttrib(layer, 'data-mce-style', ''); 199 | } 200 | }); 201 | 202 | // Fixes edit focus issues with layers on Gecko 203 | // This will enable designMode while inside a layer and disable it when outside 204 | editor.on('mousedown', function(e) { 205 | var node = e.target, doc = editor.getDoc(), parent; 206 | 207 | if (tinymce.Env.gecko) { 208 | if (getParentLayer(node)) { 209 | if (doc.designMode !== 'on') { 210 | doc.designMode = 'on'; 211 | 212 | // Repaint caret 213 | node = doc.body; 214 | parent = node.parentNode; 215 | parent.removeChild(node); 216 | parent.appendChild(node); 217 | } 218 | } else if (doc.designMode == 'on') { 219 | doc.designMode = 'off'; 220 | } 221 | } 222 | }); 223 | 224 | editor.on('NodeChange', visualAid); 225 | }); 226 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/layer/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("layer",function(a){function b(a){do if(a.className&&-1!=a.className.indexOf("mceItemLayer"))return a;while(a=a.parentNode)}function c(b){var c=a.dom;tinymce.each(c.select("div,p",b),function(a){/^(absolute|relative|fixed)$/i.test(a.style.position)&&(a.hasVisual?c.addClass(a,"mceItemVisualAid"):c.removeClass(a,"mceItemVisualAid"),c.addClass(a,"mceItemLayer"))})}function d(c){var d,e,f=[],g=b(a.selection.getNode()),h=-1,i=-1;for(e=[],tinymce.walk(a.getBody(),function(a){1==a.nodeType&&/^(absolute|relative|static)$/i.test(a.style.position)&&e.push(a)},"childNodes"),d=0;dh&&e[d]==g&&(h=d);if(0>c){for(d=0;d-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):f[h]>0&&(e[h].style.zIndex=f[h]-1)}else{for(d=0;df[h]){i=d;break}i>-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):e[h].style.zIndex=f[h]+1}a.execCommand("mceRepaint")}function e(){var b=a.dom,c=b.getPos(b.getParent(a.selection.getNode(),"*")),d=a.getBody();a.dom.add(d,"div",{style:{position:"absolute",left:c.x,top:c.y>20?c.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},a.selection.getContent()||a.getLang("layer.content")),tinymce.Env.ie&&b.setHTML(d,d.innerHTML)}function f(){var c=b(a.selection.getNode());c||(c=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")),c&&("absolute"==c.style.position.toLowerCase()?(a.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""}),a.dom.removeClass(c,"mceItemVisualAid"),a.dom.removeClass(c,"mceItemLayer")):(c.style.left||(c.style.left="20px"),c.style.top||(c.style.top="20px"),c.style.width||(c.style.width=c.width?c.width+"px":"100px"),c.style.height||(c.style.height=c.height?c.height+"px":"100px"),c.style.position="absolute",a.dom.setAttrib(c,"data-mce-style",""),a.addVisual(a.getBody())),a.execCommand("mceRepaint"),a.nodeChanged())}a.addCommand("mceInsertLayer",e),a.addCommand("mceMoveForward",function(){d(1)}),a.addCommand("mceMoveBackward",function(){d(-1)}),a.addCommand("mceMakeAbsolute",function(){f()}),a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),a.on("init",function(){tinymce.Env.ie&&a.getDoc().execCommand("2D-Position",!1,!0)}),a.on("mouseup",function(c){var d=b(c.target);d&&a.dom.setAttrib(d,"data-mce-style","")}),a.on("mousedown",function(c){var d,e=c.target,f=a.getDoc();tinymce.Env.gecko&&(b(e)?"on"!==f.designMode&&(f.designMode="on",e=f.body,d=e.parentNode,d.removeChild(e),d.appendChild(e)):"on"==f.designMode&&(f.designMode="off"))}),a.on("NodeChange",c)}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/legacyoutput/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | * 10 | * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align 11 | * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash 12 | * 13 | * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are 14 | * not apart of the newer specifications for HTML and XHTML. 15 | */ 16 | 17 | /*global tinymce:true */ 18 | 19 | (function(tinymce) { 20 | // Override inline_styles setting to force TinyMCE to produce deprecated contents 21 | tinymce.on('AddEditor', function(e) { 22 | e.editor.settings.inline_styles = false; 23 | }); 24 | 25 | tinymce.PluginManager.add('legacyoutput', function(editor, url, $) { 26 | editor.on('init', function() { 27 | var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', 28 | fontSizes = tinymce.explode(editor.settings.font_size_style_values), 29 | schema = editor.schema; 30 | 31 | // Override some internal formats to produce legacy elements and attributes 32 | editor.formatter.register({ 33 | // Change alignment formats to use the deprecated align attribute 34 | alignleft: {selector: alignElements, attributes: {align: 'left'}}, 35 | aligncenter: {selector: alignElements, attributes: {align: 'center'}}, 36 | alignright: {selector: alignElements, attributes: {align: 'right'}}, 37 | alignjustify: {selector: alignElements, attributes: {align: 'justify'}}, 38 | 39 | // Change the basic formatting elements to use deprecated element types 40 | bold: [ 41 | {inline: 'b', remove: 'all'}, 42 | {inline: 'strong', remove: 'all'}, 43 | {inline: 'span', styles: {fontWeight: 'bold'}} 44 | ], 45 | italic: [ 46 | {inline: 'i', remove: 'all'}, 47 | {inline: 'em', remove: 'all'}, 48 | {inline: 'span', styles: {fontStyle: 'italic'}} 49 | ], 50 | underline: [ 51 | {inline: 'u', remove: 'all'}, 52 | {inline: 'span', styles: {textDecoration: 'underline'}, exact: true} 53 | ], 54 | strikethrough: [ 55 | {inline: 'strike', remove: 'all'}, 56 | {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true} 57 | ], 58 | 59 | // Change font size and font family to use the deprecated font element 60 | fontname: {inline: 'font', attributes: {face: '%value'}}, 61 | fontsize: { 62 | inline: 'font', 63 | attributes: { 64 | size: function(vars) { 65 | return tinymce.inArray(fontSizes, vars.value) + 1; 66 | } 67 | } 68 | }, 69 | 70 | // Setup font elements for colors as well 71 | forecolor: {inline: 'font', attributes: {color: '%value'}}, 72 | hilitecolor: {inline: 'font', styles: {backgroundColor: '%value'}} 73 | }); 74 | 75 | // Check that deprecated elements are allowed if not add them 76 | tinymce.each('b,i,u,strike'.split(','), function(name) { 77 | schema.addValidElements(name + '[*]'); 78 | }); 79 | 80 | // Add font element if it's missing 81 | if (!schema.getElementRule("font")) { 82 | schema.addValidElements("font[face|size|color|style]"); 83 | } 84 | 85 | // Add the missing and depreacted align attribute for the serialization engine 86 | tinymce.each(alignElements.split(','), function(name) { 87 | var rule = schema.getElementRule(name); 88 | 89 | if (rule) { 90 | if (!rule.attributes.align) { 91 | rule.attributes.align = {}; 92 | rule.attributesOrder.push('align'); 93 | } 94 | } 95 | }); 96 | }); 97 | 98 | editor.addButton('fontsizeselect', function() { 99 | var items = [], defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; 100 | var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats; 101 | 102 | editor.$.each(fontsize_formats.split(' '), function(i, item) { 103 | var text = item, value = item; 104 | var values = item.split('='); 105 | 106 | if (values.length > 1) { 107 | text = values[0]; 108 | value = values[1]; 109 | } 110 | 111 | items.push({text: text, value: value}); 112 | }); 113 | 114 | return { 115 | type: 'listbox', 116 | text: 'Font Sizes', 117 | tooltip: 'Font Sizes', 118 | values: items, 119 | fixedWidth: true, 120 | onPostRender: function() { 121 | var self = this; 122 | 123 | editor.on('NodeChange', function() { 124 | var fontElm; 125 | 126 | fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); 127 | if (fontElm) { 128 | self.value(fontElm.size); 129 | } else { 130 | self.value(''); 131 | } 132 | }); 133 | }, 134 | onclick: function(e) { 135 | if (e.control.settings.value) { 136 | editor.execCommand('FontSize', false, e.control.settings.value); 137 | } 138 | } 139 | }; 140 | }); 141 | 142 | editor.addButton('fontselect', function() { 143 | function createFormats(formats) { 144 | formats = formats.replace(/;$/, '').split(';'); 145 | 146 | var i = formats.length; 147 | while (i--) { 148 | formats[i] = formats[i].split('='); 149 | } 150 | 151 | return formats; 152 | } 153 | 154 | var defaultFontsFormats = 155 | 'Andale Mono=andale mono,monospace;' + 156 | 'Arial=arial,helvetica,sans-serif;' + 157 | 'Arial Black=arial black,sans-serif;' + 158 | 'Book Antiqua=book antiqua,palatino,serif;' + 159 | 'Comic Sans MS=comic sans ms,sans-serif;' + 160 | 'Courier New=courier new,courier,monospace;' + 161 | 'Georgia=georgia,palatino,serif;' + 162 | 'Helvetica=helvetica,arial,sans-serif;' + 163 | 'Impact=impact,sans-serif;' + 164 | 'Symbol=symbol;' + 165 | 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 166 | 'Terminal=terminal,monaco,monospace;' + 167 | 'Times New Roman=times new roman,times,serif;' + 168 | 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 169 | 'Verdana=verdana,geneva,sans-serif;' + 170 | 'Webdings=webdings;' + 171 | 'Wingdings=wingdings,zapf dingbats'; 172 | 173 | var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats); 174 | 175 | $.each(fonts, function(i, font) { 176 | items.push({ 177 | text: {raw: font[0]}, 178 | value: font[1], 179 | textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : '' 180 | }); 181 | }); 182 | 183 | return { 184 | type: 'listbox', 185 | text: 'Font Family', 186 | tooltip: 'Font Family', 187 | values: items, 188 | fixedWidth: true, 189 | onPostRender: function() { 190 | var self = this; 191 | 192 | editor.on('NodeChange', function() { 193 | var fontElm; 194 | 195 | fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); 196 | if (fontElm) { 197 | self.value(fontElm.face); 198 | } else { 199 | self.value(''); 200 | } 201 | }); 202 | }, 203 | onselect: function(e) { 204 | if (e.control.settings.value) { 205 | editor.execCommand('FontName', false, e.control.settings.value); 206 | } 207 | } 208 | }; 209 | }); 210 | }); 211 | })(tinymce); 212 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/legacyoutput/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.size):a.value("")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),c?a.value(c.face):a.value("")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/link/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("link",function(a){function b(b){return function(){var c=a.settings.link_list;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):"function"==typeof c?c(b):b(c)}}function c(a,b,c){function d(a,c){return c=c||[],tinymce.each(a,function(a){var e={text:a.text||a.title};a.menu?e.menu=d(a.menu):(e.value=a.value,b&&b(e)),c.push(e)}),c}return d(a,c||[])}function d(b){function d(a){var b=l.find("#text");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),l.find("#href").value(a.control.value())}function e(b){var c=[];return tinymce.each(a.dom.select("a:not([href])"),function(a){var d=a.name||a.id;d&&c.push({text:d,value:"#"+d,selected:-1!=b.indexOf("#"+d)})}),c.length?(c.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:c,onselect:d}):void 0}function f(){!k&&0===u.text.length&&m&&this.parent().parent().find("#text")[0].value(this.value())}function g(b){var c=b.meta||{};o&&o.value(a.convertURL(this.value(),"href")),tinymce.each(b.meta,function(a,b){l.find("#"+b).value(a)}),c.text||f.call(this)}function h(a){var b=v.getContent();if(/]+>[^<]+<\/a>$/.test(b)||-1==b.indexOf("href=")))return!1;if(a){var c,d=a.childNodes;if(0===d.length)return!1;for(c=d.length-1;c>=0;c--)if(3!=d[c].nodeType)return!1}return!0}var i,j,k,l,m,n,o,p,q,r,s,t,u={},v=a.selection,w=a.dom;i=v.getNode(),j=w.getParent(i,"a[href]"),m=h(),u.text=k=j?j.innerText||j.textContent:v.getContent({format:"text"}),u.href=j?w.getAttrib(j,"href"):"",j?u.target=w.getAttrib(j,"target"):a.settings.default_link_target&&(u.target=a.settings.default_link_target),(t=w.getAttrib(j,"rel"))&&(u.rel=t),(t=w.getAttrib(j,"class"))&&(u["class"]=t),(t=w.getAttrib(j,"title"))&&(u.title=t),m&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){u.text=this.value()}}),b&&(o={type:"listbox",label:"Link list",values:c(b,function(b){b.value=a.convertURL(b.value||b.url,"href")},[{text:"None",value:""}]),onselect:d,value:a.convertURL(u.href,"href"),onPostRender:function(){o=this}}),a.settings.target_list!==!1&&(a.settings.target_list||(a.settings.target_list=[{text:"None",value:""},{text:"New window",value:"_blank"}]),q={name:"target",type:"listbox",label:"Target",values:c(a.settings.target_list)}),a.settings.rel_list&&(p={name:"rel",type:"listbox",label:"Rel",values:c(a.settings.rel_list)}),a.settings.link_class_list&&(r={name:"class",type:"listbox",label:"Class",values:c(a.settings.link_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[b.value]})})})}),a.settings.link_title!==!1&&(s={name:"title",type:"textbox",label:"Title",value:u.title}),l=a.windowManager.open({title:"Insert link",data:u,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:g,onkeyup:f},n,s,e(u.href),o,p,q,r],onSubmit:function(b){function c(b,c){var d=a.selection.getRng();window.setTimeout(function(){a.windowManager.confirm(b,function(b){a.selection.setRng(d),c(b)})},0)}function d(){var b={href:e,target:u.target?u.target:null,rel:u.rel?u.rel:null,"class":u["class"]?u["class"]:null,title:u.title?u.title:null};j?(a.focus(),m&&u.text!=k&&("innerText"in j?j.innerText=u.text:j.textContent=u.text),w.setAttribs(j,b),v.select(j),a.undoManager.add()):m?a.insertContent(w.createHTML("a",b,w.encode(u.text))):a.execCommand("mceInsertLink",!1,b)}var e;return u=tinymce.extend(u,b.data),(e=u.href)?e.indexOf("@")>0&&-1==e.indexOf("//")&&-1==e.indexOf("mailto:")?void c("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(a){a&&(e="mailto:"+e),d()}):a.settings.link_assume_external_targets&&!/^\w+:/i.test(e)||!a.settings.link_assume_external_targets&&/^\s*www[\.|\d\.]/i.test(e)?void c("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){a&&(e="http://"+e),d()}):void d():void a.execCommand("unlink")}})}a.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]"}),a.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),a.addShortcut("Meta+K","",b(d)),a.addCommand("mceLink",b(d)),this.showDialog=d,a.addMenuItem("link",{icon:"link",text:"Insert/edit link",shortcut:"Meta+K",onclick:b(d),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/lists/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("lists",function(a){function b(a){return a&&/^(OL|UL|DL)$/.test(a.nodeName)}function c(a){return a.parentNode.firstChild==a}function d(a){return a.parentNode.lastChild==a}function e(b){return b&&!!a.schema.getTextBlockElements()[b.nodeName]}function f(b){return b===a.getBody()}var g=this;a.on("init",function(){function h(a,b){var c=x.isEmpty(a);return b&&x.select("span[data-mce-type=bookmark]").length>0?!1:c}function i(a){function b(b){var d,e,f;e=a[b?"startContainer":"endContainer"],f=a[b?"startOffset":"endOffset"],1==e.nodeType&&(d=x.create("span",{"data-mce-type":"bookmark"}),e.hasChildNodes()?(f=Math.min(f,e.childNodes.length-1),b?e.insertBefore(d,e.childNodes[f]):x.insertAfter(d,e.childNodes[f])):e.appendChild(d),e=d,f=0),c[b?"startContainer":"endContainer"]=e,c[b?"startOffset":"endOffset"]=f}var c={};return b(!0),a.collapsed||b(),c}function j(a){function b(b){function c(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b==a)return c;(1!=b.nodeType||"bookmark"!=b.getAttribute("data-mce-type"))&&c++,b=b.nextSibling}return-1}var d,e,f;d=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],d&&(1==d.nodeType&&(e=c(d),d=d.parentNode,x.remove(f)),a[b?"startContainer":"endContainer"]=d,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var c=x.createRng();c.setStart(a.startContainer,a.startOffset),a.endContainer&&c.setEnd(a.endContainer,a.endOffset),y.setRng(c)}function k(b,c){var d,e,f,g=x.createFragment(),h=a.schema.getBlockElements();if(a.settings.forced_root_block&&(c=c||a.settings.forced_root_block),c&&(e=x.create(c),e.tagName===a.settings.forced_root_block&&x.setAttribs(e,a.settings.forced_root_block_attrs),g.appendChild(e)),b)for(;d=b.firstChild;){var i=d.nodeName;f||"SPAN"==i&&"bookmark"==d.getAttribute("data-mce-type")||(f=!0),h[i]?(g.appendChild(d),e=null):c?(e||(e=x.create(c),g.appendChild(e)),e.appendChild(d)):g.appendChild(d)}return a.settings.forced_root_block?f||tinymce.Env.ie&&!(tinymce.Env.ie>10)||e.appendChild(x.create("br",{"data-mce-bogus":"1"})):g.appendChild(x.create("br")),g}function l(){return tinymce.grep(y.getSelectedBlocks(),function(a){return/^(LI|DT|DD)$/.test(a.nodeName)})}function m(a,b,c){function d(a){tinymce.each(g,function(c){a.parentNode.insertBefore(c,b.parentNode)}),x.remove(a)}var e,f,g,i;for(g=x.select('span[data-mce-type="bookmark"]',a),c=c||k(b),e=x.createRng(),e.setStartAfter(b),e.setEndAfter(a),f=e.extractContents(),i=f.firstChild;i;i=i.firstChild)if("LI"==i.nodeName&&x.isEmpty(i)){x.remove(i);break}x.isEmpty(f)||x.insertAfter(f,a),x.insertAfter(c,a),h(b.parentNode)&&d(b.parentNode),x.remove(b),h(a)&&x.remove(a)}function n(a){var c,d;if(c=a.nextSibling,c&&b(c)&&c.nodeName==a.nodeName){for(;d=c.firstChild;)a.appendChild(d);x.remove(c)}if(c=a.previousSibling,c&&b(c)&&c.nodeName==a.nodeName){for(;d=c.firstChild;)a.insertBefore(d,a.firstChild);x.remove(c)}}function o(a){tinymce.each(tinymce.grep(x.select("ol,ul",a)),function(a){var c,d=a.parentNode;"LI"==d.nodeName&&d.firstChild==a&&(c=d.previousSibling,c&&"LI"==c.nodeName&&(c.appendChild(a),h(d)&&x.remove(d))),b(d)&&(c=d.previousSibling,c&&"LI"==c.nodeName&&c.appendChild(a))})}function p(a){function e(a){h(a)&&x.remove(a)}var g,i=a.parentNode,j=i.parentNode;return f(i)?!0:"DD"==a.nodeName?(x.rename(a,"DT"),!0):c(a)&&d(a)?("LI"==j.nodeName?(x.insertAfter(a,j),e(j),x.remove(i)):b(j)?x.remove(i,!0):(j.insertBefore(k(a),i),x.remove(i)),!0):c(a)?("LI"==j.nodeName?(x.insertAfter(a,j),a.appendChild(i),e(j)):b(j)?j.insertBefore(a,i):(j.insertBefore(k(a),i),x.remove(a)),!0):d(a)?("LI"==j.nodeName?x.insertAfter(a,j):b(j)?x.insertAfter(a,i):(x.insertAfter(k(a),i),x.remove(a)),!0):("LI"==j.nodeName?(i=j,g=k(a,"LI")):g=b(j)?k(a,"LI"):k(a),m(i,a,g),o(i.parentNode),!0)}function q(a){function c(c,d){var e;if(b(c)){for(;e=a.lastChild.firstChild;)d.appendChild(e);x.remove(c)}}var d,e;return"DT"==a.nodeName?(x.rename(a,"DD"),!0):(d=a.previousSibling,d&&b(d)?(d.appendChild(a),!0):d&&"LI"==d.nodeName&&b(d.lastChild)?(d.lastChild.appendChild(a),c(a.lastChild,d.lastChild),!0):(d=a.nextSibling,d&&b(d)?(d.insertBefore(a,d.firstChild),!0):d&&"LI"==d.nodeName&&b(a.lastChild)?!1:(d=a.previousSibling,d&&"LI"==d.nodeName?(e=x.create(a.parentNode.nodeName),d.appendChild(e),e.appendChild(a),c(a.lastChild,e),!0):!1)))}function r(){var b=l();if(b.length){for(var c=i(y.getRng(!0)),d=0;d0))return f;for(d=a.schema.getNonEmptyElements(),e=new tinymce.dom.TreeWalker(b.startContainer);f=e[c?"next":"prev"]();){if("LI"==f.nodeName&&!f.hasChildNodes())return f;if(d[f.nodeName])return f;if(3==f.nodeType&&f.data.length>0)return f}}function e(a,c){var d,e,g=a.parentNode;if(b(c.lastChild)&&(e=c.lastChild),d=c.lastChild,d&&"BR"==d.nodeName&&a.hasChildNodes()&&x.remove(d),h(c,!0)&&x.$(c).empty(),!h(a,!0))for(;d=a.firstChild;)c.appendChild(d);e&&c.appendChild(e),x.remove(a),h(g)&&!f(g)&&x.remove(g)}if(y.isCollapsed()){var g,k,l,m=x.getParent(y.getStart(),"LI");if(m){if(g=m.parentNode,f(g)&&x.isEmpty(g))return!0;if(k=y.getRng(!0),l=x.getParent(d(k,c),"LI"),l&&l!=m){var n=i(k);return c?e(l,m):e(m,l),j(n),!0}if(!l&&!c&&u(g.nodeName))return!0}}},a.on("BeforeExecCommand",function(b){var c,d=b.command.toLowerCase();return"indent"==d?r()&&(c=!0):"outdent"==d&&s()&&(c=!0),c?(a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0):void 0}),a.addCommand("InsertUnorderedList",function(){v("UL")}),a.addCommand("InsertOrderedList",function(){v("OL")}),a.addCommand("InsertDefinitionList",function(){v("DL")}),a.addQueryStateHandler("InsertUnorderedList",w("UL")),a.addQueryStateHandler("InsertOrderedList",w("OL")),a.addQueryStateHandler("InsertDefinitionList",w("DL")),a.on("keydown",function(b){9!=b.keyCode||tinymce.util.VK.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?s():r())})}),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var b=this;a.on("nodechange",function(){for(var d=a.selection.getSelectedBlocks(),e=!1,f=0,g=d.length;!e&&g>f;f++){var h=d[f].nodeName;e="LI"==h&&c(d[f])||"UL"==h||"OL"==h||"DD"==h}b.disabled(e)})}}),a.on("keydown",function(a){a.keyCode==tinymce.util.VK.BACKSPACE?g.backspaceDelete()&&a.preventDefault():a.keyCode==tinymce.util.VK.DELETE&&g.backspaceDelete(!0)&&a.preventDefault()})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/media/moxieplayer.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/plugins/media/moxieplayer.swf -------------------------------------------------------------------------------- /devassets/tinymce/plugins/nonbreaking/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('nonbreaking', function(editor) { 14 | var setting = editor.getParam('nonbreaking_force_tab'); 15 | 16 | editor.addCommand('mceNonBreaking', function() { 17 | editor.insertContent( 18 | (editor.plugins.visualchars && editor.plugins.visualchars.state) ? 19 | ' ' : ' ' 20 | ); 21 | 22 | editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1'); 23 | }); 24 | 25 | editor.addButton('nonbreaking', { 26 | title: 'Nonbreaking space', 27 | cmd: 'mceNonBreaking' 28 | }); 29 | 30 | editor.addMenuItem('nonbreaking', { 31 | text: 'Nonbreaking space', 32 | cmd: 'mceNonBreaking', 33 | context: 'insert' 34 | }); 35 | 36 | if (setting) { 37 | var spaces = +setting > 1 ? +setting : 3; // defaults to 3 spaces if setting is true (or 1) 38 | 39 | editor.on('keydown', function(e) { 40 | if (e.keyCode == 9) { 41 | 42 | if (e.shiftKey) { 43 | return; 44 | } 45 | 46 | e.preventDefault(); 47 | for (var i = 0; i < spaces; i++) { 48 | editor.execCommand('mceNonBreaking'); 49 | } 50 | } 51 | }); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/nonbreaking/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("nonbreaking",function(a){var b=a.getParam("nonbreaking_force_tab");if(a.addCommand("mceNonBreaking",function(){a.insertContent(a.plugins.visualchars&&a.plugins.visualchars.state?' ':" "),a.dom.setAttrib(a.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),a.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),a.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),b){var c=+b>1?+b:3;a.on("keydown",function(b){if(9==b.keyCode){if(b.shiftKey)return;b.preventDefault();for(var d=0;c>d;d++)a.execCommand("mceNonBreaking")}})}}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/noneditable/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("noneditable",function(a){function b(a){var b;if(1===a.nodeType){if(b=a.getAttribute(k),b&&"inherit"!==b)return b;if(b=a.contentEditable,"inherit"!==b)return b}return null}function c(a){for(var c;a;){if(c=b(a))return"false"===c?a:null;a=a.parentNode}}function d(){function d(a){for(;a;){if(a.id===n)return a;a=a.parentNode}}function e(a){var b;if(a)for(b=new i(a,a),a=b.current();a;a=b.next())if(3===a.nodeType)return a}function f(c,d){var e,f;return"false"===b(c)&&k.isBlock(c)?void m.select(c):(f=k.createRng(),"true"===b(c)&&(c.firstChild||c.appendChild(a.getDoc().createTextNode("\xa0")),c=c.firstChild,d=!0),e=k.create("span",{id:n,"data-mce-bogus":!0},o),d?c.parentNode.insertBefore(e,c):k.insertAfter(e,c),f.setStart(e.firstChild,1),f.collapse(!0),m.setRng(f),e)}function g(a){var b,c,d;if(a)b=m.getRng(!0),b.setStartBefore(a),b.setEndBefore(a),c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),m.setRng(b);else for(;(a=k.get(n))&&a!==d;)c=e(a),c&&c.nodeValue.charAt(0)==o&&(c=c.deleteData(0,1)),k.remove(a,!0),d=a}function h(){function a(a,c){var d,e,f,g,h;if(d=j.startContainer,e=j.startOffset,3==d.nodeType){if(h=d.nodeValue.length,e>0&&h>e||(c?e==h:0===e))return}else{if(!(e0?e-1:e;d=d.childNodes[k],d.hasChildNodes()&&(d=d.firstChild)}for(f=new i(d,a);g=f[c?"prev":"next"]();){if(3===g.nodeType&&g.nodeValue.length>0)return;if("true"===b(g))return g}return a}var d,e,h,j,k;g(),h=m.isCollapsed(),d=c(m.getStart()),e=c(m.getEnd()),(d||e)&&(j=m.getRng(!0),h?(d=d||e,(k=a(d,!0))?f(k,!0):(k=a(d,!1))?f(k,!1):m.select(d)):(j=m.getRng(!0),d&&j.setStartBefore(d),e&&j.setEndAfter(e),m.setRng(j)))}function j(e){function f(a,b){for(;a=a[b?"previousSibling":"nextSibling"];)if(3!==a.nodeType||a.nodeValue.length>0)return a}function j(a,b){m.select(a),m.collapse(b)}function n(e){function f(a){for(var b=j;b;){if(b===a)return;b=b.parentNode}k.remove(a),h()}function g(){var d,g,h=a.schema.getNonEmptyElements();for(g=new tinymce.dom.TreeWalker(j,a.getBody());(d=e?g.prev():g.next())&&!h[d.nodeName.toLowerCase()]&&!(3===d.nodeType&&tinymce.trim(d.nodeValue).length>0);)if("false"===b(d))return f(d),!0;return c(d)?!0:!1}var i,j,l,n;if(m.isCollapsed()){if(i=m.getRng(!0),j=i.startContainer,l=i.startOffset,j=d(j)||j,n=c(j))return f(n),!1;if(3==j.nodeType&&(e?l>0:ls||s>124)&&s!=l.DELETE&&s!=l.BACKSPACE){if((tinymce.isMac?e.metaKey:e.ctrlKey)&&(67==s||88==s||86==s))return;if(e.preventDefault(),u)if(a.dom.isBlock(o)){var w=v?o.previousSibling:o.nextSibling;if(!w||w&&"false"===b(w)){var x=k.create("p",null," ");x.className="mceTmpParagraph";var y=v?o:w;y&&y.parentNode?y.parentNode.insertBefore(x,y):w||v||o.parentNode.appendChild(x),w=x}var z=new i(w,w),A=v?z.prev():z.next();j(A,!v)}else j(o,v)}else if(u||s==l.BACKSPACE||s==l.DELETE){if(p=d(q)){if(s==l.LEFT||s==l.BACKSPACE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.LEFT)return void k.remove(o);j(o,!0)}else g(p);if(s==l.RIGHT||s==l.DELETE)if(o=f(p,!0),o&&"false"===b(o)){if(e.preventDefault(),s!=l.RIGHT)return void k.remove(o);j(o,!1)}else g(p)}else{if(u&&t&&-1!==t.className.indexOf("mceTmpParagraph")&&t[v?"previousSibling":"nextSibling"]){var B=t[v?"previousSibling":"nextSibling"];" "===t.innerHTML||""===t.innerHTML||" "===t.innerHTML?k.remove(t):t.className=t.className.replace("mceTmpParagraph",""),j(B,!v)}var C=m.getRng(!0),D=C.endContainer;if(k.isBlock(D)&&k.isBlock(D.nextSibling)&&1==C.endOffset&&s==l.DELETE&&(o=c(D.nextSibling)),o&&(s==l.DELETE||s==l.BACKSPACE)&&k.isBlock(o))return e.preventDefault(),void k.remove(o)}if((s==l.BACKSPACE||s==l.DELETE)&&!n(s==l.BACKSPACE))return e.preventDefault(),!1}}var k=a.dom,m=a.selection,n="mce_noneditablecaret",o="\ufeff";a.on("mousedown",function(c){var d=a.selection.getNode();d&&-1!==d.className.indexOf("mceTmpParagraph")&&d!==c.target&&(" "===d.innerHTML||""===d.innerHTML||" "===d.innerHTML?k.remove(d):d.className=d.className.replace("mceTmpParagraph","")),"false"===b(d)&&d==c.target&&h()}),a.on("mouseup",h),a.on("keydown",j)}function e(b){var c=h.length,d=b.content,e=tinymce.trim(g);if("raw"!=b.format){for(;c--;)d=d.replace(h[c],function(b){var c=arguments,f=c[c.length-2];return f>0&&'"'==d.charAt(f-1)?b:''+a.dom.encode("string"==typeof c[1]?c[1]:c[0])+""});b.content=d}}var f,g,h,i=tinymce.dom.TreeWalker,j="contenteditable",k="data-mce-"+j,l=tinymce.util.VK;f=" "+tinymce.trim(a.getParam("noneditable_editable_class","mceEditable"))+" ",g=" "+tinymce.trim(a.getParam("noneditable_noneditable_class","mceNonEditable"))+" ",h=a.getParam("noneditable_regexp"),h&&!h.length&&(h=[h]),a.on("PreInit",function(){d(),h&&a.on("BeforeSetContent",e),a.parser.addAttributeFilter("class",function(a){for(var b,c,d=a.length;d--;)c=a[d],b=" "+c.attr("class")+" ",-1!==b.indexOf(f)?c.attr(k,"true"):-1!==b.indexOf(g)&&c.attr(k,"false")}),a.serializer.addAttributeFilter(k,function(a){for(var b,c=a.length;c--;)b=a[c],h&&b.attr("data-mce-content")?(b.name="#text",b.type=3,b.raw=!0,b.value=b.attr("data-mce-content")):(b.attr(j,null),b.attr(k,null))}),a.parser.addAttributeFilter(j,function(a){for(var b,c=a.length;c--;)b=a[c],b.attr(k,b.attr(j)),b.attr(j,null)})}),a.on("drop",function(a){c(a.target)&&a.preventDefault()})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/pagebreak/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('pagebreak', function(editor) { 14 | var pageBreakClass = 'mce-pagebreak', separatorHtml = editor.getParam('pagebreak_separator', ''); 15 | 16 | var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) { 17 | return '\\' + a; 18 | }), 'gi'); 19 | 20 | var pageBreakPlaceHolderHtml = ''; 22 | 23 | // Register commands 24 | editor.addCommand('mcePageBreak', function() { 25 | if (editor.settings.pagebreak_split_block) { 26 | editor.insertContent('

' + pageBreakPlaceHolderHtml + '

'); 27 | } else { 28 | editor.insertContent(pageBreakPlaceHolderHtml); 29 | } 30 | }); 31 | 32 | // Register buttons 33 | editor.addButton('pagebreak', { 34 | title: 'Page break', 35 | cmd: 'mcePageBreak' 36 | }); 37 | 38 | editor.addMenuItem('pagebreak', { 39 | text: 'Page break', 40 | icon: 'pagebreak', 41 | cmd: 'mcePageBreak', 42 | context: 'insert' 43 | }); 44 | 45 | editor.on('ResolveName', function(e) { 46 | if (e.target.nodeName == 'IMG' && editor.dom.hasClass(e.target, pageBreakClass)) { 47 | e.name = 'pagebreak'; 48 | } 49 | }); 50 | 51 | editor.on('click', function(e) { 52 | e = e.target; 53 | 54 | if (e.nodeName === 'IMG' && editor.dom.hasClass(e, pageBreakClass)) { 55 | editor.selection.select(e); 56 | } 57 | }); 58 | 59 | editor.on('BeforeSetContent', function(e) { 60 | e.content = e.content.replace(pageBreakSeparatorRegExp, pageBreakPlaceHolderHtml); 61 | }); 62 | 63 | editor.on('PreInit', function() { 64 | editor.serializer.addNodeFilter('img', function(nodes) { 65 | var i = nodes.length, node, className; 66 | 67 | while (i--) { 68 | node = nodes[i]; 69 | className = node.attr('class'); 70 | if (className && className.indexOf('mce-pagebreak') !== -1) { 71 | // Replace parent block node if pagebreak_split_block is enabled 72 | var parentNode = node.parent; 73 | if (editor.schema.getBlockElements()[parentNode.name] && editor.settings.pagebreak_split_block) { 74 | parentNode.type = 3; 75 | parentNode.value = separatorHtml; 76 | parentNode.raw = true; 77 | node.remove(); 78 | continue; 79 | } 80 | 81 | node.type = 3; 82 | node.value = separatorHtml; 83 | node.raw = true; 84 | } 85 | } 86 | }); 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/pagebreak/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("pagebreak",function(a){var b="mce-pagebreak",c=a.getParam("pagebreak_separator",""),d=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(a){return"\\"+a}),"gi"),e='';a.addCommand("mcePageBreak",function(){a.settings.pagebreak_split_block?a.insertContent("

"+e+"

"):a.insertContent(e)}),a.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),a.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),a.on("ResolveName",function(c){"IMG"==c.target.nodeName&&a.dom.hasClass(c.target,b)&&(c.name="pagebreak")}),a.on("click",function(c){c=c.target,"IMG"===c.nodeName&&a.dom.hasClass(c,b)&&a.selection.select(c)}),a.on("BeforeSetContent",function(a){a.content=a.content.replace(d,e)}),a.on("PreInit",function(){a.serializer.addNodeFilter("img",function(b){for(var d,e,f=b.length;f--;)if(d=b[f],e=d.attr("class"),e&&-1!==e.indexOf("mce-pagebreak")){var g=d.parent;if(a.schema.getBlockElements()[g.name]&&a.settings.pagebreak_split_block){g.type=3,g.value=c,g.raw=!0,d.remove();continue}d.type=3,d.value=c,d.raw=!0}})})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/preview/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('preview', function(editor) { 14 | var settings = editor.settings, sandbox = !tinymce.Env.ie; 15 | 16 | editor.addCommand('mcePreview', function() { 17 | editor.windowManager.open({ 18 | title: 'Preview', 19 | width: parseInt(editor.getParam("plugin_preview_width", "650"), 10), 20 | height: parseInt(editor.getParam("plugin_preview_height", "500"), 10), 21 | html: '', 22 | buttons: { 23 | text: 'Close', 24 | onclick: function() { 25 | this.parent().parent().close(); 26 | } 27 | }, 28 | onPostRender: function() { 29 | var previewHtml, headHtml = ''; 30 | 31 | headHtml += ''; 32 | 33 | tinymce.each(editor.contentCSS, function(url) { 34 | headHtml += ''; 35 | }); 36 | 37 | var bodyId = settings.body_id || 'tinymce'; 38 | if (bodyId.indexOf('=') != -1) { 39 | bodyId = editor.getParam('body_id', '', 'hash'); 40 | bodyId = bodyId[editor.id] || bodyId; 41 | } 42 | 43 | var bodyClass = settings.body_class || ''; 44 | if (bodyClass.indexOf('=') != -1) { 45 | bodyClass = editor.getParam('body_class', '', 'hash'); 46 | bodyClass = bodyClass[editor.id] || ''; 47 | } 48 | 49 | var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : ''; 50 | 51 | previewHtml = ( 52 | '' + 53 | '' + 54 | '' + 55 | headHtml + 56 | '' + 57 | '' + 58 | editor.getContent() + 59 | '' + 60 | '' 61 | ); 62 | 63 | if (!sandbox) { 64 | // IE 6-11 doesn't support data uris on iframes 65 | // so I guess they will have to be less secure since we can't sandbox on those 66 | // TODO: Use sandbox if future versions of IE supports iframes with data: uris. 67 | var doc = this.getEl('body').firstChild.contentWindow.document; 68 | doc.open(); 69 | doc.write(previewHtml); 70 | doc.close(); 71 | } else { 72 | this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml); 73 | } 74 | } 75 | }); 76 | }); 77 | 78 | editor.addButton('preview', { 79 | title: 'Preview', 80 | cmd: 'mcePreview' 81 | }); 82 | 83 | editor.addMenuItem('preview', { 84 | text: 'Preview', 85 | cmd: 'mcePreview', 86 | context: 'view' 87 | }); 88 | }); 89 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/preview/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='',tinymce.each(a.contentCSS,function(b){e+=''});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d=""+e+'"+a.getContent()+"",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var i=this.getEl("body").firstChild.contentWindow.document;i.open(),i.write(d),i.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/print/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('print', function(editor) { 14 | editor.addCommand('mcePrint', function() { 15 | editor.getWin().print(); 16 | }); 17 | 18 | editor.addButton('print', { 19 | title: 'Print', 20 | cmd: 'mcePrint' 21 | }); 22 | 23 | editor.addShortcut('Meta+P', '', 'mcePrint'); 24 | 25 | editor.addMenuItem('print', { 26 | text: 'Print', 27 | cmd: 'mcePrint', 28 | icon: 'print', 29 | shortcut: 'Meta+P', 30 | context: 'file' 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/print/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("print",function(a){a.addCommand("mcePrint",function(){a.getWin().print()}),a.addButton("print",{title:"Print",cmd:"mcePrint"}),a.addShortcut("Meta+P","","mcePrint"),a.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/save/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('save', function(editor) { 14 | function save() { 15 | var formObj; 16 | 17 | formObj = tinymce.DOM.getParent(editor.id, 'form'); 18 | 19 | if (editor.getParam("save_enablewhendirty", true) && !editor.isDirty()) { 20 | return; 21 | } 22 | 23 | tinymce.triggerSave(); 24 | 25 | // Use callback instead 26 | if (editor.getParam("save_onsavecallback")) { 27 | if (editor.execCallback('save_onsavecallback', editor)) { 28 | editor.startContent = tinymce.trim(editor.getContent({format: 'raw'})); 29 | editor.nodeChanged(); 30 | } 31 | 32 | return; 33 | } 34 | 35 | if (formObj) { 36 | editor.isNotDirty = true; 37 | 38 | if (!formObj.onsubmit || formObj.onsubmit()) { 39 | if (typeof formObj.submit == "function") { 40 | formObj.submit(); 41 | } else { 42 | editor.windowManager.alert("Error: Form submit field collision."); 43 | } 44 | } 45 | 46 | editor.nodeChanged(); 47 | } else { 48 | editor.windowManager.alert("Error: No form element found."); 49 | } 50 | } 51 | 52 | function cancel() { 53 | var h = tinymce.trim(editor.startContent); 54 | 55 | // Use callback instead 56 | if (editor.getParam("save_oncancelcallback")) { 57 | editor.execCallback('save_oncancelcallback', editor); 58 | return; 59 | } 60 | 61 | editor.setContent(h); 62 | editor.undoManager.clear(); 63 | editor.nodeChanged(); 64 | } 65 | 66 | function stateToggle() { 67 | var self = this; 68 | 69 | editor.on('nodeChange', function() { 70 | self.disabled(editor.getParam("save_enablewhendirty", true) && !editor.isDirty()); 71 | }); 72 | } 73 | 74 | editor.addCommand('mceSave', save); 75 | editor.addCommand('mceCancel', cancel); 76 | 77 | editor.addButton('save', { 78 | icon: 'save', 79 | text: 'Save', 80 | cmd: 'mceSave', 81 | disabled: true, 82 | onPostRender: stateToggle 83 | }); 84 | 85 | editor.addButton('cancel', { 86 | text: 'Cancel', 87 | icon: false, 88 | cmd: 'mceCancel', 89 | disabled: true, 90 | onPostRender: stateToggle 91 | }); 92 | 93 | editor.addShortcut('Meta+S', '', 'mceSave'); 94 | }); 95 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/save/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("save",function(a){function b(){var b;return b=tinymce.DOM.getParent(a.id,"form"),!a.getParam("save_enablewhendirty",!0)||a.isDirty()?(tinymce.triggerSave(),a.getParam("save_onsavecallback")?void(a.execCallback("save_onsavecallback",a)&&(a.startContent=tinymce.trim(a.getContent({format:"raw"})),a.nodeChanged())):void(b?(a.isNotDirty=!0,(!b.onsubmit||b.onsubmit())&&("function"==typeof b.submit?b.submit():a.windowManager.alert("Error: Form submit field collision.")),a.nodeChanged()):a.windowManager.alert("Error: No form element found."))):void 0}function c(){var b=tinymce.trim(a.startContent);return a.getParam("save_oncancelcallback")?void a.execCallback("save_oncancelcallback",a):(a.setContent(b),a.undoManager.clear(),void a.nodeChanged())}function d(){var b=this;a.on("nodeChange",function(){b.disabled(a.getParam("save_enablewhendirty",!0)&&!a.isDirty())})}a.addCommand("mceSave",b),a.addCommand("mceCancel",c),a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:d}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:d}),a.addShortcut("Meta+S","","mceSave")}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/searchreplace/plugin.min.js: -------------------------------------------------------------------------------- 1 | !function(){function a(a,b,c,d,e){function f(a,b){if(b=b||0,!a[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var c=a.index;if(b>0){var d=a[b];if(!d)throw"Invalid capture group";c+=a[0].indexOf(d),a[0]=d}return[c,c+a[0].length,[a[0]]]}function g(a){var b;if(3===a.nodeType)return a.data;if(n[a.nodeName]&&!m[a.nodeName])return"";if(b="",(m[a.nodeName]||o[a.nodeName])&&(b+="\n"),a=a.firstChild)do b+=g(a);while(a=a.nextSibling);return b}function h(a,b,c){var d,e,f,g,h=[],i=0,j=a,k=b.shift(),l=0;a:for(;;){if((m[j.nodeName]||o[j.nodeName])&&i++,3===j.nodeType&&(!e&&j.length+i>=k[1]?(e=j,g=k[1]-i):d&&h.push(j),!d&&j.length+i>k[0]&&(d=j,f=k[0]-i),i+=j.length),d&&e){if(j=c({startNode:d,startNodeIndex:f,endNode:e,endNodeIndex:g,innerNodes:h,match:k[2],matchIndex:l}),i-=e.length-g,d=null,e=null,h=[],k=b.shift(),l++,!k)break}else{if((!n[j.nodeName]||m[j.nodeName])&&j.firstChild){j=j.firstChild;continue}if(j.nextSibling){j=j.nextSibling;continue}}for(;;){if(j.nextSibling){j=j.nextSibling;break}if(j.parentNode===a)break a;j=j.parentNode}}}function i(a){var b;if("function"!=typeof a){var c=a.nodeType?a:l.createElement(a);b=function(a,b){var d=c.cloneNode(!1);return d.setAttribute("data-mce-index",b),a&&d.appendChild(l.createTextNode(a)),d}}else b=a;return function(a){var c,d,e,f=a.startNode,g=a.endNode,h=a.matchIndex;if(f===g){var i=f;e=i.parentNode,a.startNodeIndex>0&&(c=l.createTextNode(i.data.substring(0,a.startNodeIndex)),e.insertBefore(c,i));var j=b(a.match[0],h);return e.insertBefore(j,i),a.endNodeIndexn;++n){var p=a.innerNodes[n],q=b(p.data,h);p.parentNode.replaceChild(q,p),m.push(q)}var r=b(g.data.substring(0,a.endNodeIndex),h);return e=f.parentNode,e.insertBefore(c,f),e.insertBefore(k,f),e.removeChild(f),e=g.parentNode,e.insertBefore(r,g),e.insertBefore(d,g),e.removeChild(g),r}}var j,k,l,m,n,o,p=[],q=0;if(l=b.ownerDocument,m=e.getBlockElements(),n=e.getWhiteSpaceElements(),o=e.getShortEndedElements(),k=g(b)){if(a.global)for(;j=a.exec(k);)p.push(f(j,d));else j=k.match(a),p.push(f(j,d));return p.length&&(q=p.length,h(b,p,i(c))),q}}function b(b){function c(){function a(){f.statusbar.find("#next").disabled(!g(l+1).length),f.statusbar.find("#prev").disabled(!g(l-1).length)}function c(){tinymce.ui.MessageBox.alert("Could not find the specified string.",function(){f.find("#find")[0].focus()})}var d,e={};d=tinymce.trim(b.selection.getContent({format:"text"}));var f=tinymce.ui.Factory.create({type:"window",layout:"flex",pack:"center",align:"center",onClose:function(){b.focus(),k.done()},onSubmit:function(b){var d,h,i,j;return b.preventDefault(),h=f.find("#case").checked(),j=f.find("#words").checked(),i=f.find("#find").value(),i.length?e.text==i&&e.caseState==h&&e.wholeWord==j?0===g(l+1).length?void c():(k.next(),void a()):(d=k.find(i,h,j),d||c(),f.statusbar.items().slice(1).disabled(0===d),a(),void(e={text:i,caseState:h,wholeWord:j})):(k.done(!1),void f.statusbar.items().slice(1).disabled(!0))},buttons:[{text:"Find",subtype:"primary",onclick:function(){f.submit()}},{text:"Replace",disabled:!0,onclick:function(){k.replace(f.find("#replace").value())||(f.statusbar.items().slice(1).disabled(!0),l=-1,e={})}},{text:"Replace all",disabled:!0,onclick:function(){k.replace(f.find("#replace").value(),!0,!0),f.statusbar.items().slice(1).disabled(!0),e={}}},{type:"spacer",flex:1},{text:"Prev",name:"prev",disabled:!0,onclick:function(){k.prev(),a()}},{text:"Next",name:"next",disabled:!0,onclick:function(){k.next(),a()}}],title:"Find and replace",items:{type:"form",padding:20,labelGap:30,spacing:10,items:[{type:"textbox",name:"find",size:40,label:"Find",value:d},{type:"textbox",name:"replace",size:40,label:"Replace with"},{type:"checkbox",name:"case",text:"Match case",label:" "},{type:"checkbox",name:"words",text:"Whole words",label:" "}]}}).renderTo().reflow()}function d(a){var b=a.getAttribute("data-mce-index");return"number"==typeof b?""+b:b}function e(c){var d,e;return e=b.dom.create("span",{"data-mce-bogus":1}),e.className="mce-match-marker",d=b.getBody(),k.done(!1),a(c,d,e,!1,b.schema)}function f(a){var b=a.parentNode;a.firstChild&&b.insertBefore(a.firstChild,a),a.parentNode.removeChild(a)}function g(a){var c,e=[];if(c=tinymce.toArray(b.getBody().getElementsByTagName("span")),c.length)for(var f=0;f0}var k=this,l=-1;k.init=function(a){a.addMenuItem("searchreplace",{text:"Find and replace",shortcut:"Meta+F",onclick:c,separator:"before",context:"edit"}),a.addButton("searchreplace",{tooltip:"Find and replace",shortcut:"Meta+F",onclick:c}),a.addCommand("SearchReplace",c),a.shortcuts.add("Meta+F","",c)},k.find=function(a,b,c){a=a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),a=c?"\\b"+a+"\\b":a;var d=e(new RegExp(a,b?"g":"gi"));return d&&(l=-1,l=h(!0)),d},k.next=function(){var a=h(!0);-1!==a&&(l=a)},k.prev=function(){var a=h(!1);-1!==a&&(l=a)},k.replace=function(a,c,e){var h,m,n,o,p,q,r=l;for(c=c!==!1,n=b.getBody(),m=tinymce.grep(tinymce.toArray(n.getElementsByTagName("span")),j),h=0;hl&&m[h].setAttribute("data-mce-index",p-1)}return b.undoManager.add(),l=r,c?(q=g(r+1).length>0,k.next()):(q=g(r-1).length>0,k.prev()),!e&&q},k.done=function(a){var c,e,g,h;for(e=tinymce.toArray(b.getBody().getElementsByTagName("span")),c=0;c 0) { 49 | for (i = x + 1; i < el.length; i++) { 50 | if (canSelect(el[i])) { 51 | return el[i]; 52 | } 53 | } 54 | } else { 55 | for (i = x - 1; i >= 0; i--) { 56 | if (canSelect(el[i])) { 57 | return el[i]; 58 | } 59 | } 60 | } 61 | 62 | return null; 63 | } 64 | 65 | v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); 66 | 67 | if (v.length == 1) { 68 | v[1] = v[0]; 69 | v[0] = ':prev'; 70 | } 71 | 72 | // Find element to focus 73 | if (e.shiftKey) { 74 | if (v[0] == ':prev') { 75 | el = find(-1); 76 | } else { 77 | el = DOM.get(v[0]); 78 | } 79 | } else { 80 | if (v[1] == ':next') { 81 | el = find(1); 82 | } else { 83 | el = DOM.get(v[1]); 84 | } 85 | } 86 | 87 | if (el) { 88 | var focusEditor = tinymce.get(el.id || el.name); 89 | 90 | if (el.id && focusEditor) { 91 | focusEditor.focus(); 92 | } else { 93 | window.setTimeout(function() { 94 | if (!tinymce.Env.webkit) { 95 | window.focus(); 96 | } 97 | 98 | el.focus(); 99 | }, 10); 100 | } 101 | 102 | e.preventDefault(); 103 | } 104 | } 105 | 106 | editor.on('init', function() { 107 | if (editor.inline) { 108 | // Remove default tabIndex in inline mode 109 | tinymce.DOM.setAttrib(editor.getBody(), 'tabIndex', null); 110 | } 111 | 112 | editor.on('keyup', tabCancel); 113 | 114 | if (tinymce.Env.gecko) { 115 | editor.on('keypress keydown', tabHandler); 116 | } else { 117 | editor.on('keydown', tabHandler); 118 | } 119 | }); 120 | }); 121 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/tabfocus/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(c){function f(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&f(a.parentNode)}function i(a){return/INPUT|TEXTAREA|BUTTON/.test(a.tagName)&&tinymce.get(b.id)&&-1!=a.tabIndex&&f(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),c>0){for(j=g+1;j=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey||b.isDefaultPrevented())&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/template/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("template",function(a){function b(b){return function(){var c=a.settings.templates;"string"==typeof c?tinymce.util.XHR.send({url:c,success:function(a){b(tinymce.util.JSON.parse(a))}}):b(c)}}function c(b){function c(b){function c(b){if(-1==b.indexOf("")){var c="";tinymce.each(a.contentCSS,function(b){c+=''}),b=""+c+""+b+""}b=f(b,"template_preview_replace_values");var e=d.find("iframe")[0].getEl().contentWindow.document;e.open(),e.write(b),e.close()}var g=b.control.value();g.url?tinymce.util.XHR.send({url:g.url,success:function(a){e=a,c(e)}}):(e=g.content,c(e)),d.find("#description")[0].text(b.control.value().description)}var d,e,h=[];return b&&0!==b.length?(tinymce.each(b,function(a){h.push({selected:!h.length,text:a.title,value:{url:a.url,content:a.content,description:a.description}})}),d=a.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:h,onselect:c}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){g(!1,e)},width:a.getParam("template_popup_width",600),height:a.getParam("template_popup_height",500)}),void d.find("listbox")[0].fire("select")):void a.windowManager.alert("No templates defined")}function d(b,c){function d(a,b){if(a=""+a,a.length0&&(i=k.create("div",null),i.appendChild(j[0].cloneNode(!0))),h(k.select("*",i),function(b){g(b,a.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_cdate_format",a.getLang("template.cdate_format")))),g(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format")))),g(b,a.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(b.innerHTML=l)}),e(i),a.execCommand("mceInsertContent",!1,i.innerHTML),a.addVisual()}var h=tinymce.each;a.addCommand("mceInsertTemplate",g),a.addButton("template",{title:"Insert template",onclick:b(c)}),a.addMenuItem("template",{text:"Insert template",onclick:b(c),context:"insert"}),a.on("PreProcess",function(b){var c=a.dom;h(c.select("div",b.node),function(b){c.hasClass(b,"mceTmpl")&&(h(c.select("*",b),function(b){c.hasClass(b,a.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(b.innerHTML=d(a.getParam("template_mdate_format",a.getLang("template.mdate_format"))))}),e(b))})})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/textcolor/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | /*eslint consistent-this:0 */ 13 | 14 | tinymce.PluginManager.add('textcolor', function(editor) { 15 | var cols, rows; 16 | 17 | rows = editor.settings.textcolor_rows || 5; 18 | cols = editor.settings.textcolor_cols || 8; 19 | 20 | function getCurrentColor(format) { 21 | var color; 22 | 23 | editor.dom.getParents(editor.selection.getStart(), function(elm) { 24 | var value; 25 | 26 | if ((value = elm.style[format == 'forecolor' ? 'color' : 'background-color'])) { 27 | color = value; 28 | } 29 | }); 30 | 31 | return color; 32 | } 33 | 34 | function mapColors() { 35 | var i, colors = [], colorMap; 36 | 37 | colorMap = editor.settings.textcolor_map || [ 38 | "000000", "Black", 39 | "993300", "Burnt orange", 40 | "333300", "Dark olive", 41 | "003300", "Dark green", 42 | "003366", "Dark azure", 43 | "000080", "Navy Blue", 44 | "333399", "Indigo", 45 | "333333", "Very dark gray", 46 | "800000", "Maroon", 47 | "FF6600", "Orange", 48 | "808000", "Olive", 49 | "008000", "Green", 50 | "008080", "Teal", 51 | "0000FF", "Blue", 52 | "666699", "Grayish blue", 53 | "808080", "Gray", 54 | "FF0000", "Red", 55 | "FF9900", "Amber", 56 | "99CC00", "Yellow green", 57 | "339966", "Sea green", 58 | "33CCCC", "Turquoise", 59 | "3366FF", "Royal blue", 60 | "800080", "Purple", 61 | "999999", "Medium gray", 62 | "FF00FF", "Magenta", 63 | "FFCC00", "Gold", 64 | "FFFF00", "Yellow", 65 | "00FF00", "Lime", 66 | "00FFFF", "Aqua", 67 | "00CCFF", "Sky blue", 68 | "993366", "Red violet", 69 | "FFFFFF", "White", 70 | "FF99CC", "Pink", 71 | "FFCC99", "Peach", 72 | "FFFF99", "Light yellow", 73 | "CCFFCC", "Pale green", 74 | "CCFFFF", "Pale cyan", 75 | "99CCFF", "Light sky blue", 76 | "CC99FF", "Plum" 77 | ]; 78 | 79 | for (i = 0; i < colorMap.length; i += 2) { 80 | colors.push({ 81 | text: colorMap[i + 1], 82 | color: '#' + colorMap[i] 83 | }); 84 | } 85 | 86 | return colors; 87 | } 88 | 89 | function renderColorPicker() { 90 | var ctrl = this, colors, color, html, last, x, y, i, id = ctrl._id, count = 0; 91 | 92 | function getColorCellHtml(color, title) { 93 | var isNoColor = color == 'transparent'; 94 | 95 | return ( 96 | '' + 97 | '
' + 103 | (isNoColor ? '×' : '') + 104 | '
' + 105 | '' 106 | ); 107 | } 108 | 109 | colors = mapColors(); 110 | colors.push({ 111 | text: tinymce.translate("No color"), 112 | color: "transparent" 113 | }); 114 | 115 | html = ''; 116 | last = colors.length - 1; 117 | 118 | for (y = 0; y < rows; y++) { 119 | html += ''; 120 | 121 | for (x = 0; x < cols; x++) { 122 | i = y * cols + x; 123 | 124 | if (i > last) { 125 | html += ''; 126 | } else { 127 | color = colors[i]; 128 | html += getColorCellHtml(color.color, color.text); 129 | } 130 | } 131 | 132 | html += ''; 133 | } 134 | 135 | if (editor.settings.color_picker_callback) { 136 | html += ( 137 | '' + 138 | '' + 144 | '' 145 | ); 146 | 147 | html += ''; 148 | 149 | for (x = 0; x < cols; x++) { 150 | html += getColorCellHtml('', 'Custom color'); 151 | } 152 | 153 | html += ''; 154 | } 155 | 156 | html += '
' + 139 | '
' + 141 | '' + 142 | '
' + 143 | '
'; 157 | 158 | return html; 159 | } 160 | 161 | function applyFormat(format, value) { 162 | editor.undoManager.transact(function() { 163 | editor.focus(); 164 | editor.formatter.apply(format, {value: value}); 165 | editor.nodeChanged(); 166 | }); 167 | } 168 | 169 | function removeFormat(format) { 170 | editor.undoManager.transact(function() { 171 | editor.focus(); 172 | editor.formatter.remove(format, {value: null}, null, true); 173 | editor.nodeChanged(); 174 | }); 175 | } 176 | 177 | function onPanelClick(e) { 178 | var buttonCtrl = this.parent(), value; 179 | 180 | function selectColor(value) { 181 | buttonCtrl.hidePanel(); 182 | buttonCtrl.color(value); 183 | applyFormat(buttonCtrl.settings.format, value); 184 | } 185 | 186 | function resetColor() { 187 | buttonCtrl.hidePanel(); 188 | buttonCtrl.resetColor(); 189 | removeFormat(buttonCtrl.settings.format); 190 | } 191 | 192 | function setDivColor(div, value) { 193 | div.style.background = value; 194 | div.setAttribute('data-mce-color', value); 195 | } 196 | 197 | if (tinymce.DOM.getParent(e.target, '.mce-custom-color-btn')) { 198 | buttonCtrl.hidePanel(); 199 | 200 | editor.settings.color_picker_callback.call(editor, function(value) { 201 | var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0]; 202 | var customColorCells, div, i; 203 | 204 | customColorCells = tinymce.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function(elm) { 205 | return elm.firstChild; 206 | }); 207 | 208 | for (i = 0; i < customColorCells.length; i++) { 209 | div = customColorCells[i]; 210 | if (!div.getAttribute('data-mce-color')) { 211 | break; 212 | } 213 | } 214 | 215 | // Shift colors to the right 216 | // TODO: Might need to be the left on RTL 217 | if (i == cols) { 218 | for (i = 0; i < cols - 1; i++) { 219 | setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color')); 220 | } 221 | } 222 | 223 | setDivColor(div, value); 224 | selectColor(value); 225 | }, getCurrentColor(buttonCtrl.settings.format)); 226 | } 227 | 228 | value = e.target.getAttribute('data-mce-color'); 229 | if (value) { 230 | if (this.lastId) { 231 | document.getElementById(this.lastId).setAttribute('aria-selected', false); 232 | } 233 | 234 | e.target.setAttribute('aria-selected', true); 235 | this.lastId = e.target.id; 236 | 237 | if (value == 'transparent') { 238 | resetColor(); 239 | } else { 240 | selectColor(value); 241 | } 242 | } else if (value !== null) { 243 | buttonCtrl.hidePanel(); 244 | } 245 | } 246 | 247 | function onButtonClick() { 248 | var self = this; 249 | 250 | if (self._color) { 251 | applyFormat(self.settings.format, self._color); 252 | } else { 253 | removeFormat(self.settings.format); 254 | } 255 | } 256 | 257 | editor.addButton('forecolor', { 258 | type: 'colorbutton', 259 | tooltip: 'Text color', 260 | format: 'forecolor', 261 | panel: { 262 | role: 'application', 263 | ariaRemember: true, 264 | html: renderColorPicker, 265 | onclick: onPanelClick 266 | }, 267 | onclick: onButtonClick 268 | }); 269 | 270 | editor.addButton('backcolor', { 271 | type: 'colorbutton', 272 | tooltip: 'Background color', 273 | format: 'hilitecolor', 274 | panel: { 275 | role: 'application', 276 | ariaRemember: true, 277 | html: renderColorPicker, 278 | onclick: onPanelClick 279 | }, 280 | onclick: onButtonClick 281 | }); 282 | }); 283 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/textcolor/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("textcolor",function(a){function b(b){var c;return a.dom.getParents(a.selection.getStart(),function(a){var d;(d=a.style["forecolor"==b?"color":"background-color"])&&(c=d)}),c}function c(){var b,c,d=[];for(c=a.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],b=0;b
'+(c?"×":"")+"
"}var d,e,f,g,h,k,l,m=this,n=m._id,o=0;for(d=c(),d.push({text:tinymce.translate("No color"),color:"transparent"}),f='',g=d.length-1,k=0;j>k;k++){for(f+="",h=0;i>h;h++)l=k*i+h,l>g?f+="":(e=d[l],f+=b(e.color,e.text));f+=""}if(a.settings.color_picker_callback){for(f+='",f+="",h=0;i>h;h++)f+=b("","Custom color");f+=""}return f+="
"}function e(b,c){a.undoManager.transact(function(){a.focus(),a.formatter.apply(b,{value:c}),a.nodeChanged()})}function f(b){a.undoManager.transact(function(){a.focus(),a.formatter.remove(b,{value:null},null,!0),a.nodeChanged()})}function g(c){function d(a){k.hidePanel(),k.color(a),e(k.settings.format,a)}function g(){k.hidePanel(),k.resetColor(),f(k.settings.format)}function h(a,b){a.style.background=b,a.setAttribute("data-mce-color",b)}var j,k=this.parent();tinymce.DOM.getParent(c.target,".mce-custom-color-btn")&&(k.hidePanel(),a.settings.color_picker_callback.call(a,function(a){var b,c,e,f=k.panel.getEl().getElementsByTagName("table")[0];for(b=tinymce.map(f.rows[f.rows.length-1].childNodes,function(a){return a.firstChild}),e=0;ee;e++)h(b[e],b[e+1].getAttribute("data-mce-color"));h(c,a),d(a)},b(k.settings.format))),j=c.target.getAttribute("data-mce-color"),j?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),c.target.setAttribute("aria-selected",!0),this.lastId=c.target.id,"transparent"==j?g():d(j)):null!==j&&k.hidePanel()}function h(){var a=this;a._color?e(a.settings.format,a._color):f(a.settings.format)}var i,j;j=a.settings.textcolor_rows||5,i=a.settings.textcolor_cols||8,a.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h}),a.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:d,onclick:g},onclick:h})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/textpattern/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('textpattern', function(editor) { 14 | var isPatternsDirty = true, patterns; 15 | 16 | patterns = editor.settings.textpattern_patterns || [ 17 | {start: '*', end: '*', format: 'italic'}, 18 | {start: '**', end: '**', format: 'bold'}, 19 | {start: '#', format: 'h1'}, 20 | {start: '##', format: 'h2'}, 21 | {start: '###', format: 'h3'}, 22 | {start: '####', format: 'h4'}, 23 | {start: '#####', format: 'h5'}, 24 | {start: '######', format: 'h6'}, 25 | {start: '1. ', cmd: 'InsertOrderedList'}, 26 | {start: '* ', cmd: 'InsertUnorderedList'}, 27 | {start: '- ', cmd: 'InsertUnorderedList'} 28 | ]; 29 | 30 | // Returns a sorted patterns list, ordered descending by start length 31 | function getPatterns() { 32 | if (isPatternsDirty) { 33 | patterns.sort(function(a, b) { 34 | if (a.start.length > b.start.length) { 35 | return -1; 36 | } 37 | 38 | if (a.start.length < b.start.length) { 39 | return 1; 40 | } 41 | 42 | return 0; 43 | }); 44 | 45 | isPatternsDirty = false; 46 | } 47 | 48 | return patterns; 49 | } 50 | 51 | // Finds a matching pattern to the specified text 52 | function findPattern(text) { 53 | var patterns = getPatterns(); 54 | 55 | for (var i = 0; i < patterns.length; i++) { 56 | if (text.indexOf(patterns[i].start) !== 0) { 57 | continue; 58 | } 59 | 60 | if (patterns[i].end && text.lastIndexOf(patterns[i].end) != text.length - patterns[i].end.length) { 61 | continue; 62 | } 63 | 64 | return patterns[i]; 65 | } 66 | } 67 | 68 | // Finds the best matching end pattern 69 | function findEndPattern(text, offset, delta) { 70 | var patterns, pattern, i; 71 | 72 | // Find best matching end 73 | patterns = getPatterns(); 74 | for (i = 0; i < patterns.length; i++) { 75 | pattern = patterns[i]; 76 | if (pattern.end && text.substr(offset - pattern.end.length - delta, pattern.end.length) == pattern.end) { 77 | return pattern; 78 | } 79 | } 80 | } 81 | 82 | // Handles inline formats like *abc* and **abc** 83 | function applyInlineFormat(space) { 84 | var selection, dom, rng, container, offset, startOffset, text, patternRng, pattern, delta, format; 85 | 86 | function splitContainer() { 87 | // Split text node and remove start/end from text node 88 | container = container.splitText(startOffset); 89 | container.splitText(offset - startOffset - delta); 90 | container.deleteData(0, pattern.start.length); 91 | container.deleteData(container.data.length - pattern.end.length, pattern.end.length); 92 | } 93 | 94 | selection = editor.selection; 95 | dom = editor.dom; 96 | 97 | if (!selection.isCollapsed()) { 98 | return; 99 | } 100 | 101 | rng = selection.getRng(true); 102 | container = rng.startContainer; 103 | offset = rng.startOffset; 104 | text = container.data; 105 | delta = space ? 1 : 0; 106 | 107 | if (container.nodeType != 3) { 108 | return; 109 | } 110 | 111 | // Find best matching end 112 | pattern = findEndPattern(text, offset, delta); 113 | if (!pattern) { 114 | return; 115 | } 116 | 117 | // Find start of matched pattern 118 | // TODO: Might need to improve this if there is nested formats 119 | startOffset = Math.max(0, offset - delta); 120 | startOffset = text.lastIndexOf(pattern.start, startOffset - pattern.end.length - 1); 121 | 122 | if (startOffset === -1) { 123 | return; 124 | } 125 | 126 | // Setup a range for the matching word 127 | patternRng = dom.createRng(); 128 | patternRng.setStart(container, startOffset); 129 | patternRng.setEnd(container, offset - delta); 130 | pattern = findPattern(patternRng.toString()); 131 | 132 | if (!pattern || !pattern.end) { 133 | return; 134 | } 135 | 136 | // If container match doesn't have anything between start/end then do nothing 137 | if (container.data.length <= pattern.start.length + pattern.end.length) { 138 | return; 139 | } 140 | 141 | format = editor.formatter.get(pattern.format); 142 | if (format && format[0].inline) { 143 | splitContainer(); 144 | editor.formatter.apply(pattern.format, {}, container); 145 | return container; 146 | } 147 | } 148 | 149 | // Handles block formats like ##abc or 1. abc 150 | function applyBlockFormat() { 151 | var selection, dom, container, firstTextNode, node, format, textBlockElm, pattern, walker, rng, offset; 152 | 153 | selection = editor.selection; 154 | dom = editor.dom; 155 | 156 | if (!selection.isCollapsed()) { 157 | return; 158 | } 159 | 160 | textBlockElm = dom.getParent(selection.getStart(), 'p'); 161 | if (textBlockElm) { 162 | walker = new tinymce.dom.TreeWalker(textBlockElm, textBlockElm); 163 | while ((node = walker.next())) { 164 | if (node.nodeType == 3) { 165 | firstTextNode = node; 166 | break; 167 | } 168 | } 169 | 170 | if (firstTextNode) { 171 | pattern = findPattern(firstTextNode.data); 172 | if (!pattern) { 173 | return; 174 | } 175 | 176 | rng = selection.getRng(true); 177 | container = rng.startContainer; 178 | offset = rng.startOffset; 179 | 180 | if (firstTextNode == container) { 181 | offset = Math.max(0, offset - pattern.start.length); 182 | } 183 | 184 | if (tinymce.trim(firstTextNode.data).length == pattern.start.length) { 185 | return; 186 | } 187 | 188 | if (pattern.format) { 189 | format = editor.formatter.get(pattern.format); 190 | if (format && format[0].block) { 191 | firstTextNode.deleteData(0, pattern.start.length); 192 | editor.formatter.apply(pattern.format, {}, firstTextNode); 193 | 194 | rng.setStart(container, offset); 195 | rng.collapse(true); 196 | selection.setRng(rng); 197 | } 198 | } 199 | 200 | if (pattern.cmd) { 201 | editor.undoManager.transact(function() { 202 | firstTextNode.deleteData(0, pattern.start.length); 203 | editor.execCommand(pattern.cmd); 204 | }); 205 | } 206 | } 207 | } 208 | } 209 | 210 | function handleEnter() { 211 | var rng, wrappedTextNode; 212 | 213 | wrappedTextNode = applyInlineFormat(); 214 | if (wrappedTextNode) { 215 | rng = editor.dom.createRng(); 216 | rng.setStart(wrappedTextNode, wrappedTextNode.data.length); 217 | rng.setEnd(wrappedTextNode, wrappedTextNode.data.length); 218 | editor.selection.setRng(rng); 219 | } 220 | 221 | applyBlockFormat(); 222 | } 223 | 224 | function handleSpace() { 225 | var wrappedTextNode, lastChar, lastCharNode, rng, dom; 226 | 227 | wrappedTextNode = applyInlineFormat(true); 228 | if (wrappedTextNode) { 229 | dom = editor.dom; 230 | lastChar = wrappedTextNode.data.slice(-1); 231 | 232 | // Move space after the newly formatted node 233 | if (/[\u00a0 ]/.test(lastChar)) { 234 | wrappedTextNode.deleteData(wrappedTextNode.data.length - 1, 1); 235 | lastCharNode = dom.doc.createTextNode(lastChar); 236 | 237 | if (wrappedTextNode.nextSibling) { 238 | dom.insertAfter(lastCharNode, wrappedTextNode.nextSibling); 239 | } else { 240 | wrappedTextNode.parentNode.appendChild(lastCharNode); 241 | } 242 | 243 | rng = dom.createRng(); 244 | rng.setStart(lastCharNode, 1); 245 | rng.setEnd(lastCharNode, 1); 246 | editor.selection.setRng(rng); 247 | } 248 | } 249 | } 250 | 251 | editor.on('keydown', function(e) { 252 | if (e.keyCode == 13 && !tinymce.util.VK.modifierPressed(e)) { 253 | handleEnter(); 254 | } 255 | }, true); 256 | 257 | editor.on('keyup', function(e) { 258 | if (e.keyCode == 32 && !tinymce.util.VK.modifierPressed(e)) { 259 | handleSpace(); 260 | } 261 | }); 262 | 263 | this.getPatterns = getPatterns; 264 | this.setPatterns = function(newPatterns) { 265 | patterns = newPatterns; 266 | isPatternsDirty = true; 267 | }; 268 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/textpattern/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("textpattern",function(a){function b(){return j&&(i.sort(function(a,b){return a.start.length>b.start.length?-1:a.start.length' + value + '
'; 27 | } 28 | 29 | function compileCharMapToRegExp() { 30 | var key, regExp = ''; 31 | 32 | for (key in charMap) { 33 | regExp += key; 34 | } 35 | 36 | return new RegExp('[' + regExp + ']', 'g'); 37 | } 38 | 39 | function compileCharMapToCssSelector() { 40 | var key, selector = ''; 41 | 42 | for (key in charMap) { 43 | if (selector) { 44 | selector += ','; 45 | } 46 | 47 | selector += 'span.mce-' + charMap[key]; 48 | } 49 | 50 | return selector; 51 | } 52 | 53 | state = !state; 54 | self.state = state; 55 | editor.fire('VisualChars', {state: state}); 56 | visualCharsRegExp = compileCharMapToRegExp(); 57 | 58 | if (addBookmark) { 59 | bookmark = selection.getBookmark(); 60 | } 61 | 62 | if (state) { 63 | nodeList = []; 64 | tinymce.walk(body, function(n) { 65 | if (n.nodeType == 3 && n.nodeValue && visualCharsRegExp.test(n.nodeValue)) { 66 | nodeList.push(n); 67 | } 68 | }, 'childNodes'); 69 | 70 | for (i = 0; i < nodeList.length; i++) { 71 | nodeValue = nodeList[i].nodeValue; 72 | nodeValue = nodeValue.replace(visualCharsRegExp, wrapCharWithSpan); 73 | 74 | div = editor.dom.create('div', null, nodeValue); 75 | while ((node = div.lastChild)) { 76 | editor.dom.insertAfter(node, nodeList[i]); 77 | } 78 | 79 | editor.dom.remove(nodeList[i]); 80 | } 81 | } else { 82 | nodeList = editor.dom.select(compileCharMapToCssSelector(), body); 83 | 84 | for (i = nodeList.length - 1; i >= 0; i--) { 85 | editor.dom.remove(nodeList[i], 1); 86 | } 87 | } 88 | 89 | selection.moveToBookmark(bookmark); 90 | } 91 | 92 | function toggleActiveState() { 93 | var self = this; 94 | 95 | editor.on('VisualChars', function(e) { 96 | self.active(e.state); 97 | }); 98 | } 99 | 100 | editor.addCommand('mceVisualChars', toggleVisualChars); 101 | 102 | editor.addButton('visualchars', { 103 | title: 'Show invisible characters', 104 | cmd: 'mceVisualChars', 105 | onPostRender: toggleActiveState 106 | }); 107 | 108 | editor.addMenuItem('visualchars', { 109 | text: 'Show invisible characters', 110 | cmd: 'mceVisualChars', 111 | onPostRender: toggleActiveState, 112 | selectable: true, 113 | context: 'view', 114 | prependToContext: true 115 | }); 116 | 117 | editor.on('beforegetcontent', function(e) { 118 | if (state && e.format != 'raw' && !e.draft) { 119 | state = true; 120 | toggleVisualChars(false); 121 | } 122 | }); 123 | }); 124 | -------------------------------------------------------------------------------- /devassets/tinymce/plugins/visualchars/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("visualchars",function(a){function b(b){function c(a){return''+a+""}function f(){var a,b="";for(a in n)b+=a;return new RegExp("["+b+"]","g")}function g(){var a,b="";for(a in n)b&&(b+=","),b+="span.mce-"+n[a];return b}var h,i,j,k,l,m,n,o,p=a.getBody(),q=a.selection;if(n={"\xa0":"nbsp","\xad":"shy"},d=!d,e.state=d,a.fire("VisualChars",{state:d}),o=f(),b&&(m=q.getBookmark()),d)for(i=[],tinymce.walk(p,function(a){3==a.nodeType&&a.nodeValue&&o.test(a.nodeValue)&&i.push(a)},"childNodes"),j=0;j=0;j--)a.dom.remove(i[j],1);q.moveToBookmark(m)}function c(){var b=this;a.on("VisualChars",function(a){b.active(a.state)})}var d,e=this;a.addCommand("mceVisualChars",b),a.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c}),a.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:c,selectable:!0,context:"view",prependToContext:!0}),a.on("beforegetcontent",function(a){d&&"raw"!=a.format&&!a.draft&&(d=!0,b(!1))})}); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/wordcount/plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * plugin.js 3 | * 4 | * Released under LGPL License. 5 | * Copyright (c) 1999-2015 Ephox Corp. All rights reserved 6 | * 7 | * License: http://www.tinymce.com/license 8 | * Contributing: http://www.tinymce.com/contributing 9 | */ 10 | 11 | /*global tinymce:true */ 12 | 13 | tinymce.PluginManager.add('wordcount', function(editor) { 14 | var self = this, countre, cleanre; 15 | 16 | // Included most unicode blocks see: http://en.wikipedia.org/wiki/Unicode_block 17 | // Latin-1_Supplement letters, a-z, u2019 == ’ 18 | countre = editor.getParam('wordcount_countregex', /[\w\u2019\x27\-\u00C0-\u1FFF]+/g); 19 | cleanre = editor.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g); 20 | 21 | function update() { 22 | editor.theme.panel.find('#wordcount').text(['Words: {0}', self.getCount()]); 23 | } 24 | 25 | editor.on('init', function() { 26 | var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0]; 27 | 28 | if (statusbar) { 29 | window.setTimeout(function() { 30 | statusbar.insert({ 31 | type: 'label', 32 | name: 'wordcount', 33 | text: ['Words: {0}', self.getCount()], 34 | classes: 'wordcount', 35 | disabled: editor.settings.readonly 36 | }, 0); 37 | 38 | editor.on('setcontent beforeaddundo', update); 39 | 40 | editor.on('keyup', function(e) { 41 | if (e.keyCode == 32) { 42 | update(); 43 | } 44 | }); 45 | }, 0); 46 | } 47 | }); 48 | 49 | self.getCount = function() { 50 | var tx = editor.getContent({format: 'raw'}); 51 | var tc = 0; 52 | 53 | if (tx) { 54 | tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces 55 | tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars 56 | 57 | // deal with html entities 58 | tx = tx.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i, "$1$3").replace(/&.+?;/g, ' '); 59 | tx = tx.replace(cleanre, ''); // remove numbers and punctuation 60 | 61 | var wordArray = tx.match(countre); 62 | if (wordArray) { 63 | tc = wordArray.length; 64 | } 65 | } 66 | 67 | return tc; 68 | }; 69 | }); -------------------------------------------------------------------------------- /devassets/tinymce/plugins/wordcount/plugin.min.js: -------------------------------------------------------------------------------- 1 | tinymce.PluginManager.add("wordcount",function(a){function b(){a.theme.panel.find("#wordcount").text(["Words: {0}",e.getCount()])}var c,d,e=this;c=a.getParam("wordcount_countregex",/[\w\u2019\x27\-\u00C0-\u1FFF]+/g),d=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),a.on("init",function(){var c=a.theme.panel&&a.theme.panel.find("#statusbar")[0];c&&window.setTimeout(function(){c.insert({type:"label",name:"wordcount",text:["Words: {0}",e.getCount()],classes:"wordcount",disabled:a.settings.readonly},0),a.on("setcontent beforeaddundo",b),a.on("keyup",function(a){32==a.keyCode&&b()})},0)}),e.getCount=function(){var b=a.getContent({format:"raw"}),e=0;if(b){b=b.replace(/\.\.\./g," "),b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),b=b.replace(/(\w+)(&#?[a-z0-9]+;)+(\w+)/i,"$1$3").replace(/&.+?;/g," "),b=b.replace(d,"");var f=b.match(c);f&&(e=f.length)}return e}}); -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/content.inline.min.css: -------------------------------------------------------------------------------- 1 | .mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/content.min.css: -------------------------------------------------------------------------------- 1 | body{background-color:#FFF;color:#000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:0 0;text-decoration:none;color:#000;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:400;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3A3A3A;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{border-bottom:2px solid red;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid green;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce-small.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce-small.eot -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce-small.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce-small.ttf -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce-small.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce-small.woff -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce.eot -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce.ttf -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/fonts/tinymce.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/fonts/tinymce.woff -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/img/anchor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/img/anchor.gif -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/img/loader.gif -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/img/object.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/img/object.gif -------------------------------------------------------------------------------- /devassets/tinymce/skins/lightgray/img/trans.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HurricaneJames/react-tinymce-input/26fe8d98313ce62ac46ed5370347d77062ddb26b/devassets/tinymce/skins/lightgray/img/trans.gif -------------------------------------------------------------------------------- /examples/Tiny.js: -------------------------------------------------------------------------------- 1 | var React = require('react') 2 | , ReactDOM = require('react-dom') 3 | , createReactClass = require('create-react-class') 4 | , TinyMCEInput = require('../src/TinyMCEInput'); 5 | 6 | const TINYMCE_CONFIG = { 7 | 'language' : 'en', 8 | 'theme' : 'modern', 9 | 'toolbar' : 'bold italic underline strikethrough hr | bullist numlist | link unlink | undo redo | spellchecker code', 10 | 'menubar' : false, 11 | 'statusbar' : true, 12 | 'resize' : true, 13 | 'plugins' : 'link,spellchecker,paste', 14 | 'theme_modern_toolbar_location' : 'top', 15 | 'theme_modern_toolbar_align': 'left' 16 | }; 17 | 18 | const INLINE_TINYMCE_CONFIG = { 19 | inline: true, 20 | }; 21 | 22 | var Tiny = createReactClass({ 23 | displayName: 'TinyMCEExample', 24 | getInitialState: function() { 25 | return { 26 | value: '', 27 | editMode: false 28 | }; 29 | }, 30 | onClick: function() { 31 | this.setState({ editMode: !this.state.editMode }); 32 | }, 33 | onChange: function(newValue) { 34 | this.setState({ value: newValue }); 35 | }, 36 | onTextAreaChange: function(e) { 37 | this.setState({ value: e.target.value }); 38 | }, 39 | render: function() { 40 | return ( 41 |
42 |

Main

43 | 44 |

Inline

45 | 47 |
48 |

Raw

49 |
{this.state.value}
50 |
51 |

Raw Edit

52 |