/**
- * Popup.js
+ * tinymce_mce_popup.js
*
- * Copyright, Moxiecode Systems AB
* Released under LGPL License.
+ * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
* tinyMCEPopup.onInit.add(function(ed) {
* alert(ed.selection.getContent());
* });
- *
+ *
* // Executes the init method on page load in some object using the SomeObject scope
* tinyMCEPopup.onInit.add(SomeObject.init, SomeObject);
*/
* Returns a window argument/parameter by name.
*
* @method getWindowArg
- * @param {String} name Name of the window argument to retrive.
+ * @param {String} name Name of the window argument to retrieve.
* @param {String} defaultValue Optional default value to return.
* @return {String} Argument value or default value if it wasn't found.
*/
* Returns a editor parameter/config option value.
*
* @method getParam
- * @param {String} name Name of the editor config option to retrive.
+ * @param {String} name Name of the editor config option to retrieve.
* @param {String} defaultValue Optional default value to return.
* @return {String} Parameter value or default value if it wasn't found.
*/
* @param {string} element_id Element id to be filled with the color value from the picker.
*/
pickColor : function(e, element_id) {
- this.execCommand('mceColorPicker', true, {
- color : document.getElementById(element_id).value,
- func : function(c) {
- document.getElementById(element_id).value = c;
-
- try {
- document.getElementById(element_id).onchange();
- } catch (ex) {
- // Try fire event, ignore errors
- }
- }
- });
+ var el = document.getElementById(element_id), colorPickerCallback = this.editor.settings.color_picker_callback;
+ if (colorPickerCallback) {
+ colorPickerCallback.call(
+ this.editor,
+ function (value) {
+ el.value = value;
+ try {
+ el.onchange();
+ } catch (ex) {
+ // Try fire event, ignore errors
+ }
+ },
+ el.value
+ );
+ }
},
/**
}
},
- // Internal functions
+ // Internal functions
_restoreSelection : function() {
var e = window.event.srcElement;
"browse": "Browse"
};
- var langCode = tinymce.settings.language || 'en';
+ var langCode = (tinymce.settings ? tinymce.settings : t.editor.settings).language || 'en';
for (var key in map) {
tinymce.i18n.data[langCode + "." + key] = tinymce.i18n.translate(map[key]);
}
var self = this, returnValue, args = arguments, i, listeners = self.listeners, listener;
self.inDispatch = true;
-
+
// Needs to be a real loop since the listener count might change while looping
// And this is also more efficient
for (i = 0; i < listeners.length; i++) {