Commit aaa154ad authored by Vivek's avatar Vivek

added tinymce editor files

parent 4f85ad69
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tinymce</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>tinymce</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268248.54</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>.eslintrc</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>{\n
\t"env": {\n
\t\t"browser": true,\n
\t\t"amd": true\n
\t},\n
\n
\t"globals": {\n
\t\t"escape": true,\n
\t\t"unescape": true\n
\t},\n
\n
\t"rules": {\n
\t\t"quotes": 0,\n
\t\t"camelcase": 0,\n
\t\t"strict": 0,\n
\t\t"eqeqeq": 0,\n
\t\t"no-underscore-dangle": 0,\n
\t\t"consistent-return": 0,\n
\t\t"no-shadow": 0,\n
\t\t"no-use-before-define": 0,\n
\t\t"brace-style": [2, "1tbs"],\n
\t\t"func-style": [2, "declaration"],\n
\t\t"guard-for-in": 0,\n
\t\t"no-floating-decimal": 2,\n
\t\t"no-nested-ternary": 2,\n
\t\t"radix": 2,\n
\t\t"wrap-iife": [2, "inside"],\n
\t\t"consistent-this": [2, "self"],\n
\t\t"no-bitwise": 2,\n
\t\t"max-params": [2, 50],\n
\t\t"max-depth": [1, 8],\n
\t\t"max-statements": [2, 150],\n
\t\t"max-len": [1, 140, 4],\n
\t\t"eol-last": 0,\n
\t\t"quotes": 0,\n
\t\t"no-trailing-spaces": 2,\n
\t\t"comma-spacing": [2, {"before": false, "after": true}],\n
\t\t"space-in-parens": [2, "never"],\n
\t\t"space-infix-ops": [2, {"int32Hint": false}],\n
\t\t"space-after-keywords": 2,\n
\t\t"space-unary-ops": [1, { "words": true, "nonwords": false }],\n
\t\t"space-return-throw-case": 2,\n
\t\t"space-before-blocks": [2, "always"],\n
\t\t"space-before-function-paren": [2, {"anonymous": "never", "named": "never"}],\n
\t\t"no-multiple-empty-lines": [1, {max: 2}],\n
\t\t"object-curly-spacing": [2, "never"],\n
\t\t"operator-linebreak": [2, "after"],\n
\t\t"semi": [2, "always"],\n
\t\t"indent": 0,\n
\t\t"curly": [2, "all"],\n
\t\t"dot-notation": [2, {"allowKeywords": false}],\n
\t\t"no-else-return": 2,\n
\t\t"no-eval": 2,\n
\t\t"no-implied-eval": 2,\n
\t\t"no-loop-func": 2,\n
\t\t"no-multi-str": 2,\n
\t\t"no-multi-spaces": 2,\n
\t\t"no-sequences": 2,\n
\t\t"radix": 2,\n
\t\t"no-new": 2,\n
\t\t"no-caller": 2\n
\t},\n
\n
\t"extends": "eslint:recommended"\n
}\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1540</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>.eslintrc</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268114.81</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>.jscsrc</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>{\n
\t"preset": "google",\n
\n
\t"requireParenthesesAroundIIFE": true,\n
\t"validateIndentation": "\\t",\n
\t"disallowKeywords": ["with"],\n
\t"validateQuoteMarks": null,\n
\t"requireLineFeedAtFileEnd": null,\n
\t"disallowImplicitTypeConversion": null,\n
\t"jsDoc": null,\n
\t"requireCamelCaseOrUpperCaseIdentifiers": null,\n
\t"disallowMultipleVarDecl": null,\n
\t"maximumLineLength": 255,\n
\t"requireDotNotation": null,\n
\t"requireCapitalizedConstructors": null,\n
\n
\t"excludeFiles": [\n
\t\t"Jakefile.js",\n
\t\t"node_modules/**",\n
\t\t"tests/**",\n
\t\t"tools/**",\n
\t\t"**/*.min.js",\n
\t\t"**/*.dev.js",\n
\t\t"js/tinymce/*.js",\n
\t\t"js/tinymce/langs/**",\n
\t\t"js/tinymce/plugins/compat3x/**",\n
\t\t"js/tinymce/plugins/table/plugin.js",\n
\t\t"js/tinymce/plugins/spellchecker/plugin.js",\n
\t\t"js/tinymce/plugins/paste/plugin.js",\n
\t\t"js/tinymce/classes/dom/Sizzle.js",\n
\t\t"js/tinymce/classes/util/Promise.js"\n
\t]\n
}\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>836</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>.jscsrc</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268708.1</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>.jshintrc</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>{\n
\t"predef": {\n
\t\t"define": true,\n
\t\t"require": true,\n
\t\t"module": true\n
\t},\n
\t"passfail": false,\n
\t"maxerr": 50,\n
\t"maxparams": 50,\n
\t"maxdepth": 8,\n
\t"maxstatements": 150,\n
\t"maxlen": 140,\n
\t//"maxcomplexity": 10,\n
\t"camelcase":false,\n
\t"browser": true,\n
\t"node": false,\n
\t"rhino": false,\n
\t"couch": false,\n
\t"wsh": false,\n
\t"jquery": false,\n
\t"prototypejs": false,\n
\t"mootools": false,\n
\t"dojo": false,\n
\t"debug": false,\n
\t"devel": false,\n
\t"es5": false,\n
\t"strict": false,\n
\t"globalstrict": true,\n
\t"asi": false,\n
\t"laxbreak": false,\n
\t"bitwise": true,\n
\t"quotmark": false,\n
\t"boss": false,\n
\t"curly": true,\n
\t"eqeqeq": false,\n
\t"eqnull": false,\n
\t"evil": true,\n
\t"expr": false,\n
\t"forin": false,\n
\t"immed": true,\n
\t"latedef": true,\n
\t"loopfunc": false,\n
\t"noarg": true,\n
\t"regexp": false,\n
\t"regexdash": false,\n
\t"scripturl": false,\n
\t"shadow": false,\n
\t"supernew": false,\n
\t"undef": true,\n
\t"unused": true,\n
\t"validthis": false,\n
\t"smarttabs": false,\n
\t"proto": false,\n
\t"onecase": true,\n
\t"nonstandard": true,\n
\t"multistr": false,\n
\t"laxcomma": false,\n
\t"lastsemic": false,\n
\t"iterator": false,\n
\t"funcscope": false,\n
\t"esnext": false,\n
\t"newcap": false,\n
\t"noempty": true,\n
\t"nonew": true,\n
\t"nomen": false,\n
\t"onevar": false,\n
\t"plusplus": false,\n
\t"sub": false,\n
\t"trailing": true,\n
\t"white": false\n
}\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1243</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>.jshintrc</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>js</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>tinymce</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>tinymce</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>classes</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>classes</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268288.89</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>AddOnManager.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/**\n
* AddOnManager.js\n
*\n
* Released under LGPL License.\n
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved\n
*\n
* License: http://www.tinymce.com/license\n
* Contributing: http://www.tinymce.com/contributing\n
*/\n
\n
/**\n
* This class handles the loading of themes/plugins or other add-ons and their language packs.\n
*\n
* @class tinymce.AddOnManager\n
*/\n
define("tinymce/AddOnManager", [\n
\t"tinymce/dom/ScriptLoader",\n
\t"tinymce/util/Tools"\n
], function(ScriptLoader, Tools) {\n
\tvar each = Tools.each;\n
\n
\tfunction AddOnManager() {\n
\t\tvar self = this;\n
\n
\t\tself.items = [];\n
\t\tself.urls = {};\n
\t\tself.lookup = {};\n
\t}\n
\n
\tAddOnManager.prototype = {\n
\t\t/**\n
\t\t * Returns the specified add on by the short name.\n
\t\t *\n
\t\t * @method get\n
\t\t * @param {String} name Add-on to look for.\n
\t\t * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined.\n
\t\t */\n
\t\tget: function(name) {\n
\t\t\tif (this.lookup[name]) {\n
\t\t\t\treturn this.lookup[name].instance;\n
\t\t\t}\n
\n
\t\t\treturn undefined;\n
\t\t},\n
\n
\t\tdependencies: function(name) {\n
\t\t\tvar result;\n
\n
\t\t\tif (this.lookup[name]) {\n
\t\t\t\tresult = this.lookup[name].dependencies;\n
\t\t\t}\n
\n
\t\t\treturn result || [];\n
\t\t},\n
\n
\t\t/**\n
\t\t * Loads a language pack for the specified add-on.\n
\t\t *\n
\t\t * @method requireLangPack\n
\t\t * @param {String} name Short name of the add-on.\n
\t\t * @param {String} languages Optional comma or space separated list of languages to check if it matches the name.\n
\t\t */\n
\t\trequireLangPack: function(name, languages) {\n
\t\t\tvar language = AddOnManager.language;\n
\n
\t\t\tif (language && AddOnManager.languageLoad !== false) {\n
\t\t\t\tif (languages) {\n
\t\t\t\t\tlanguages = \',\' + languages + \',\';\n
\n
\t\t\t\t\t// Load short form sv.js or long form sv_SE.js\n
\t\t\t\t\tif (languages.indexOf(\',\' + language.substr(0, 2) + \',\') != -1) {\n
\t\t\t\t\t\tlanguage = language.substr(0, 2);\n
\t\t\t\t\t} else if (languages.indexOf(\',\' + language + \',\') == -1) {\n
\t\t\t\t\t\treturn;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\n
\t\t\t\tScriptLoader.ScriptLoader.add(this.urls[name] + \'/langs/\' + language + \'.js\');\n
\t\t\t}\n
\t\t},\n
\n
\t\t/**\n
\t\t * Adds a instance of the add-on by it\'s short name.\n
\t\t *\n
\t\t * @method add\n
\t\t * @param {String} id Short name/id for the add-on.\n
\t\t * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.\n
\t\t * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.\n
\t\t * @example\n
\t\t * // Create a simple plugin\n
\t\t * tinymce.create(\'tinymce.plugins.TestPlugin\', {\n
\t\t * TestPlugin: function(ed, url) {\n
\t\t * ed.on(\'click\', function(e) {\n
\t\t * ed.windowManager.alert(\'Hello World!\');\n
\t\t * });\n
\t\t * }\n
\t\t * });\n
\t\t *\n
\t\t * // Register plugin using the add method\n
\t\t * tinymce.PluginManager.add(\'test\', tinymce.plugins.TestPlugin);\n
\t\t *\n
\t\t * // Initialize TinyMCE\n
\t\t * tinymce.init({\n
\t\t * ...\n
\t\t * plugins: \'-test\' // Init the plugin but don\'t try to load it\n
\t\t * });\n
\t\t */\n
\t\tadd: function(id, addOn, dependencies) {\n
\t\t\tthis.items.push(addOn);\n
\t\t\tthis.lookup[id] = {instance: addOn, dependencies: dependencies};\n
\n
\t\t\treturn addOn;\n
\t\t},\n
\n
\t\tcreateUrl: function(baseUrl, dep) {\n
\t\t\tif (typeof dep === "object") {\n
\t\t\t\treturn dep;\n
\t\t\t}\n
\n
\t\t\treturn {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix};\n
\t\t},\n
\n
\t\t/**\n
\t\t * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.\n
\t\t * This should be used in development mode. A new compressor/javascript munger process will ensure that the\n
\t\t * components are put together into the plugin.js file and compressed correctly.\n
\t\t *\n
\t\t * @method addComponents\n
\t\t * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins).\n
\t\t * @param {Array} scripts Array containing the names of the scripts to load.\n
\t\t */\n
\t\taddComponents: function(pluginName, scripts) {\n
\t\t\tvar pluginUrl = this.urls[pluginName];\n
\n
\t\t\teach(scripts, function(script) {\n
\t\t\t\tScriptLoader.ScriptLoader.add(pluginUrl + "/" + script);\n
\t\t\t});\n
\t\t},\n
\n
\t\t/**\n
\t\t * Loads an add-on from a specific url.\n
\t\t *\n
\t\t * @method load\n
\t\t * @param {String} name Short name of the add-on that gets loaded.\n
\t\t * @param {String} addOnUrl URL to the add-on that will get loaded.\n
\t\t * @param {function} callback Optional callback to execute ones the add-on is loaded.\n
\t\t * @param {Object} scope Optional scope to execute the callback in.\n
\t\t * @example\n
\t\t * // Loads a plugin from an external URL\n
\t\t * tinymce.PluginManager.load(\'myplugin\', \'/some/dir/someplugin/plugin.js\');\n
\t\t *\n
\t\t * // Initialize TinyMCE\n
\t\t * tinymce.init({\n
\t\t * ...\n
\t\t * plugins: \'-myplugin\' // Don\'t try to load it again\n
\t\t * });\n
\t\t */\n
\t\tload: function(name, addOnUrl, callback, scope) {\n
\t\t\tvar self = this, url = addOnUrl;\n
\n
\t\t\tfunction loadDependencies() {\n
\t\t\t\tvar dependencies = self.dependencies(name);\n
\n
\t\t\t\teach(dependencies, function(dep) {\n
\t\t\t\t\tvar newUrl = self.createUrl(addOnUrl, dep);\n
\n
\t\t\t\t\tself.load(newUrl.resource, newUrl, undefined, undefined);\n
\t\t\t\t});\n
\n
\t\t\t\tif (callback) {\n
\t\t\t\t\tif (scope) {\n
\t\t\t\t\t\tcallback.call(scope);\n
\t\t\t\t\t} else {\n
\t\t\t\t\t\tcallback.call(ScriptLoader);\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\tif (self.urls[name]) {\n
\t\t\t\treturn;\n
\t\t\t}\n
\n
\t\t\tif (typeof addOnUrl === "object") {\n
\t\t\t\turl = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;\n
\t\t\t}\n
\n
\t\t\tif (url.indexOf(\'/\') !== 0 && url.indexOf(\'://\') == -1) {\n
\t\t\t\turl = AddOnManager.baseURL + \'/\' + url;\n
\t\t\t}\n
\n
\t\t\tself.urls[name] = url.substring(0, url.lastIndexOf(\'/\'));\n
\n
\t\t\tif (self.lookup[name]) {\n
\t\t\t\tloadDependencies();\n
\t\t\t} else {\n
\t\t\t\tScriptLoader.ScriptLoader.add(url, loadDependencies, scope);\n
\t\t\t}\n
\t\t}\n
\t};\n
\n
\tAddOnManager.PluginManager = new AddOnManager();\n
\tAddOnManager.ThemeManager = new AddOnManager();\n
\n
\treturn AddOnManager;\n
});\n
\n
/**\n
* TinyMCE theme class.\n
*\n
* @class tinymce.Theme\n
*/\n
\n
/**\n
* This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc.\n
*\n
* @method renderUI\n
* @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance.\n
* @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight.\n
*/\n
\n
/**\n
* Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional.\n
*\n
* @class tinymce.Plugin\n
* @example\n
* tinymce.PluginManager.add(\'example\', function(editor, url) {\n
* // Add a button that opens a window\n
* editor.addButton(\'example\', {\n
* text: \'My button\',\n
* icon: false,\n
* onclick: function() {\n
* // Open window\n
* editor.windowManager.open({\n
* title: \'Example plugin\',\n
* body: [\n
* {type: \'textbox\', name: \'title\', label: \'Title\'}\n
* ],\n
* onsubmit: function(e) {\n
* // Insert content when the window form is submitted\n
* editor.insertContent(\'Title: \' + e.data.title);\n
* }\n
* });\n
* }\n
* });\n
*\n
* // Adds a menu item to the tools menu\n
* editor.addMenuItem(\'example\', {\n
* text: \'Example plugin\',\n
* context: \'tools\',\n
* onclick: function() {\n
* // Open window with a specific url\n
* editor.windowManager.open({\n
* title: \'TinyMCE site\',\n
* url: \'http://www.tinymce.com\',\n
* width: 800,\n
* height: 600,\n
* buttons: [{\n
* text: \'Close\',\n
* onclick: \'close\'\n
* }]\n
* });\n
* }\n
* });\n
* });\n
*/\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>7575</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>AddOnManager.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268290.2</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Compat.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/**\n
* Compat.js\n
*\n
* Released under LGPL License.\n
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved\n
*\n
* License: http://www.tinymce.com/license\n
* Contributing: http://www.tinymce.com/contributing\n
*/\n
\n
/**\n
* TinyMCE core class.\n
*\n
* @static\n
* @class tinymce\n
* @borrow-members tinymce.EditorManager\n
* @borrow-members tinymce.util.Tools\n
*/\n
define("tinymce/Compat", [\n
\t"tinymce/dom/DOMUtils",\n
\t"tinymce/dom/EventUtils",\n
\t"tinymce/dom/ScriptLoader",\n
\t"tinymce/AddOnManager",\n
\t"tinymce/util/Tools",\n
\t"tinymce/Env"\n
], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) {\n
\tvar tinymce = window.tinymce;\n
\n
\t/**\n
\t * @property {tinymce.dom.DOMUtils} DOM Global DOM instance.\n
\t * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance.\n
\t * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance.\n
\t * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance.\n
\t */\n
\ttinymce.DOM = DOMUtils.DOM;\n
\ttinymce.ScriptLoader = ScriptLoader.ScriptLoader;\n
\ttinymce.PluginManager = AddOnManager.PluginManager;\n
\ttinymce.ThemeManager = AddOnManager.ThemeManager;\n
\n
\ttinymce.dom = tinymce.dom || {};\n
\ttinymce.dom.Event = EventUtils.Event;\n
\n
\tTools.each(Tools, function(func, key) {\n
\t\ttinymce[key] = func;\n
\t});\n
\n
\tTools.each(\'isOpera isWebKit isIE isGecko isMac\'.split(\' \'), function(name) {\n
\t\ttinymce[name] = Env[name.substr(2).toLowerCase()];\n
\t});\n
\n
\treturn {};\n
});\n
\n
// Describe the different namespaces\n
\n
/**\n
* Root level namespace this contains classes directly releated to the TinyMCE editor.\n
*\n
* @namespace tinymce\n
*/\n
\n
/**\n
* Contains classes for handling the browsers DOM.\n
*\n
* @namespace tinymce.dom\n
*/\n
\n
/**\n
* Contains html parser and serializer logic.\n
*\n
* @namespace tinymce.html\n
*/\n
\n
/**\n
* Contains the different UI types such as buttons, listboxes etc.\n
*\n
* @namespace tinymce.ui\n
*/\n
\n
/**\n
* Contains various utility classes such as json parser, cookies etc.\n
*\n
* @namespace tinymce.util\n
*/\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1983</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Compat.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41268289.79</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>EditorUpload.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/**\n
* EditorUpload.js\n
*\n
* Released under LGPL License.\n
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved\n
*\n
* License: http://www.tinymce.com/license\n
* Contributing: http://www.tinymce.com/contributing\n
*/\n
\n
/**\n
* Handles image uploads, updates undo stack and patches over various internal functions.\n
*\n
* @private\n
* @class tinymce.EditorUpload\n
*/\n
define("tinymce/EditorUpload", [\n
\t"tinymce/util/Tools",\n
\t"tinymce/file/Uploader",\n
\t"tinymce/file/ImageScanner",\n
\t"tinymce/file/BlobCache"\n
], function(Tools, Uploader, ImageScanner, BlobCache) {\n
\treturn function(editor) {\n
\t\tvar blobCache = new BlobCache();\n
\n
\t\t// Replaces strings without regexps to avoid FF regexp to big issue\n
\t\tfunction replaceString(content, search, replace) {\n
\t\t\tvar index = 0;\n
\n
\t\t\tdo {\n
\t\t\t\tindex = content.indexOf(search, index);\n
\n
\t\t\t\tif (index !== -1) {\n
\t\t\t\t\tcontent = content.substring(0, index) + replace + content.substr(index + search.length);\n
\t\t\t\t\tindex += replace.length - search.length + 1;\n
\t\t\t\t}\n
\t\t\t} while (index !== -1);\n
\n
\t\t\treturn content;\n
\t\t}\n
\n
\t\tfunction replaceImageUrl(content, targetUrl, replacementUrl) {\n
\t\t\tcontent = replaceString(content, \'src="\' + targetUrl + \'"\', \'src="\' + replacementUrl + \'"\');\n
\t\t\tcontent = replaceString(content, \'data-mce-src="\' + targetUrl + \'"\', \'data-mce-src="\' + replacementUrl + \'"\');\n
\n
\t\t\treturn content;\n
\t\t}\n
\n
\t\tfunction replaceUrlInUndoStack(targetUrl, replacementUrl) {\n
\t\t\tTools.each(editor.undoManager.data, function(level) {\n
\t\t\t\tlevel.content = replaceImageUrl(level.content, targetUrl, replacementUrl);\n
\t\t\t});\n
\t\t}\n
\n
\t\tfunction uploadImages(callback) {\n
\t\t\tvar uploader = new Uploader({\n
\t\t\t\turl: editor.settings.images_upload_url,\n
\t\t\t\tbasePath: editor.settings.images_upload_base_path,\n
\t\t\t\tcredentials: editor.settings.images_upload_credentials,\n
\t\t\t\thandler: editor.settings.images_upload_handler\n
\t\t\t});\n
\n
\t\t\tfunction imageInfosToBlobInfos(imageInfos) {\n
\t\t\t\treturn Tools.map(imageInfos, function(imageInfo) {\n
\t\t\t\t\treturn imageInfo.blobInfo;\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\treturn scanForImages().then(imageInfosToBlobInfos).then(uploader.upload).then(function(result) {\n
\t\t\t\tresult = Tools.map(result, function(uploadInfo) {\n
\t\t\t\t\tvar image;\n
\n
\t\t\t\t\timage = editor.dom.select(\'img[src="\' + uploadInfo.blobInfo.blobUri() + \'"]\')[0];\n
\n
\t\t\t\t\tif (image) {\n
\t\t\t\t\t\treplaceUrlInUndoStack(image.src, uploadInfo.url);\n
\n
\t\t\t\t\t\teditor.$(image).attr({\n
\t\t\t\t\t\t\tsrc: uploadInfo.url,\n
\t\t\t\t\t\t\t\'data-mce-src\': editor.convertURL(uploadInfo.url, \'src\')\n
\t\t\t\t\t\t});\n
\t\t\t\t\t}\n
\n
\t\t\t\t\treturn {\n
\t\t\t\t\t\telement: image,\n
\t\t\t\t\t\tstatus: uploadInfo.status\n
\t\t\t\t\t};\n
\t\t\t\t});\n
\n
\t\t\t\tif (callback) {\n
\t\t\t\t\tcallback(result);\n
\t\t\t\t}\n
\n
\t\t\t\treturn result;\n
\t\t\t}, function() {\n
\t\t\t\t// Silent\n
\t\t\t\t// TODO: Maybe execute some failure callback here?\n
\t\t\t});\n
\t\t}\n
\n
\t\tfunction scanForImages() {\n
\t\t\treturn ImageScanner.findAll(editor.getBody(), blobCache).then(function(result) {\n
\t\t\t\tTools.each(result, function(resultItem) {\n
\t\t\t\t\treplaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());\n
\t\t\t\t\tresultItem.image.src = resultItem.blobInfo.blobUri();\n
\t\t\t\t});\n
\n
\t\t\t\treturn result;\n
\t\t\t});\n
\t\t}\n
\n
\t\tfunction destroy() {\n
\t\t\tblobCache.destroy();\n
\t\t}\n
\n
\t\tfunction replaceBlobWithBase64(content) {\n
\t\t\treturn content.replace(/src="(blob:[^"]+)"/g, function(match, blobUri) {\n
\t\t\t\tvar blobInfo = blobCache.getByUri(blobUri);\n
\n
\t\t\t\tif (!blobInfo) {\n
\t\t\t\t\tblobInfo = Tools.reduce(editor.editorManager.editors, function(result, editor) {\n
\t\t\t\t\t\treturn result || editor.editorUpload.blobCache.getByUri(blobUri);\n
\t\t\t\t\t}, null);\n
\t\t\t\t}\n
\n
\t\t\t\tif (blobInfo) {\n
\t\t\t\t\treturn \'src="data:\' + blobInfo.blob().type + \';base64,\' + blobInfo.base64() + \'"\';\n
\t\t\t\t}\n
\n
\t\t\t\treturn match[0];\n
\t\t\t});\n
\t\t}\n
\n
\t\teditor.on(\'setContent paste\', scanForImages);\n
\n
\t\teditor.on(\'RawSaveContent\', function(e) {\n
\t\t\te.content = replaceBlobWithBase64(e.content);\n
\t\t});\n
\n
\t\teditor.on(\'getContent\', function(e) {\n
\t\t\tif (e.source_view || e.format == \'raw\') {\n
\t\t\t\treturn;\n
\t\t\t}\n
\n
\t\t\te.content = replaceBlobWithBase64(e.content);\n
\t\t});\n
\n
\t\treturn {\n
\t\t\tblobCache: blobCache,\n
\t\t\tuploadImages: uploadImages,\n
\t\t\tscanForImages: scanForImages,\n
\t\t\tdestroy: destroy\n
\t\t};\n
\t};\n
});</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4065</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>EditorUpload.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment