Skip to content

Commit

Permalink
Update TinyMCE
Browse files Browse the repository at this point in the history
  • Loading branch information
dpobel committed Jan 17, 2014
1 parent 6f06898 commit 07f85e8
Show file tree
Hide file tree
Showing 129 changed files with 27,796 additions and 18,638 deletions.
14 changes: 7 additions & 7 deletions design/standard/javascript/classes/AddOnManager.js
@@ -1,11 +1,11 @@
/**
* AddOnManager.js
*
* Copyright 2009, Moxiecode Systems AB
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/

(function(tinymce) {
Expand Down Expand Up @@ -110,12 +110,12 @@
},

/**
* Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
* Add a set of components that will make up the add-on. Using the url of the add-on name as the base url.
* This should be used in development mode. A new compressor/javascript munger process will ensure that the
* components are put together into the editor_plugin.js file and compressed correctly.
* @param pluginName {String} name of the plugin to load scripts from (will be used to get the base url for the plugins).
* @param scripts {Array} Array containing the names of the scripts to load.
*/
*/
addComponents: function(pluginName, scripts) {
var pluginUrl = this.urls[pluginName];
tinymce.each(scripts, function(script){
Expand Down Expand Up @@ -164,7 +164,7 @@
if (typeof u === "object")
url = u.prefix + u.resource + u.suffix;

if (url.indexOf('/') != 0 && url.indexOf('://') == -1)
if (url.indexOf('/') !== 0 && url.indexOf('://') == -1)
url = tinymce.baseURL + '/' + url;

t.urls[n] = url.substring(0, url.lastIndexOf('/'));
Expand Down Expand Up @@ -296,7 +296,7 @@
* return {
* longname : 'Example plugin',
* author : 'Some author',
* authorurl : 'http://tinymce.moxiecode.com',
* authorurl : 'http://www.tinymce.com',
* infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
* version : "1.0"
* };
Expand Down
52 changes: 33 additions & 19 deletions design/standard/javascript/classes/ControlManager.js
@@ -1,11 +1,11 @@
/**
* ControlManager.js
*
* Copyright 2009, Moxiecode Systems AB
* Copyright, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/

(function(tinymce) {
Expand Down Expand Up @@ -113,31 +113,43 @@
* will be used.
*
* @method createControl
* @param {String} n Control name to create for example "separator".
* @param {String} name Control name to create for example "separator".
* @return {tinymce.ui.Control} Control instance that got created and added.
*/
createControl : function(n) {
var c, t = this, ed = t.editor;
createControl : function(name) {
var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName;

// Build control factory cache
if (!self.controlFactories) {
self.controlFactories = [];
each(editor.plugins, function(plugin) {
if (plugin.createControl) {
self.controlFactories.push(plugin);
}
});
}

each(ed.plugins, function(p) {
if (p.createControl) {
c = p.createControl(n, t);
// Create controls by asking cached factories
factories = self.controlFactories;
for (i = 0, l = factories.length; i < l; i++) {
ctrl = factories[i].createControl(name, self);

if (c)
return false;
if (ctrl) {
return self.add(ctrl);
}
});
}

switch (n) {
case "|":
case "separator":
return t.createSeparator();
// Create sepearator
if (name === "|" || name === "separator") {
return self.createSeparator();
}

if (!c && ed.buttons && (c = ed.buttons[n]))
return t.createButton(n, c);
// Create control from button collection
if (editor.buttons && (ctrl = editor.buttons[name])) {
return self.createButton(name, ctrl);
}

return t.add(c);
return self.add(ctrl);
},

/**
Expand All @@ -161,6 +173,8 @@
if (v = ed.getParam('skin_variant'))
s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1);

s['class'] += ed.settings.directionality == "rtl" ? ' mceRtl' : '';

id = t.prefix + id;
cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu;
c = t.controls[id] = new cls(id, s);
Expand Down

0 comments on commit 07f85e8

Please sign in to comment.