0 results found

tinyMCEPopup

Contribute to this page
ClasstinyMCEPopup
TypeSingleton

TinyMCE popup/dialog helper class. This gives you easy access to the parent editor instance and a bunch of other things. It's higly recommended that you load this script into your dialogs.

Public Methods

MethodDefined By
alert(t:String, cb:function, s:Object):void : [static] Creates a alert dialog.tinyMCEPopup
close():void : [static] Closes the current window.tinyMCEPopup
confirm(t:String, cb:function, s:Object):void : [static] Creates a confirm dialog.tinyMCEPopup
execCommand(cmd:String, ui:Boolean, val:Object, a:Object):void : [static] Executed a command on editor that opened the dialog/popup.tinyMCEPopup
executeOnLoad(s:String):void : [static] Will executed the specified string when the page has been loaded.tinyMCEPopup
getLang(n:String, dv:String):String : [static] Returns a language item by key.tinyMCEPopup
getParam(n:String, dv:String):String : [static] Returns a editor parameter/config option value.tinyMCEPopup
getWin():Window : [static] Returns the reference to the parent window that opened the dialog.tinyMCEPopup
getWindowArg(n:String, dv:String):String : [static] Returns a window argument/parameter by name.tinyMCEPopup
init():void : [static] Initializes the popup this will be called automatically.tinyMCEPopup
openBrowser(element_id:string, type:string, option:string):void : [static] Opens a filebrowser/imagebrowser this will set the output value from the browser as a value on the specified element.tinyMCEPopup
pickColor(e:DOMEvent, element_id:string):void : [static] Executes a color picker on the specified element id.tinyMCEPopup
requireLangPack():void : [static] Loads a specific dialog language pack.tinyMCEPopup
resizeToInnerSize():void : [static] Resizes the dialog to the inner size of the window.tinyMCEPopup
restoreSelection():void : [static] Restores any stored selection.tinyMCEPopup
storeSelection():void : [static] Stores the current editor selection for later restoration.tinyMCEPopup

Public Events

EventDefined By
onInit(editor:Editor) : [static] Fires when the popup is initialized.tinyMCEPopup

Method details

alert

public static function alert(t:String, cb:function, s:Object):void
Creates a alert dialog. Please don't use the blocking behavior of this native version use the callback method instead then it can be extended.

Parameters

ParamDetail
t:StringTitle for the new alert dialog.
cb:functionCallback function to be executed after the user has selected ok.
s:ObjectOptional scope to execute the callback in.

close

public static function close():void
Closes the current window.

confirm

public static function confirm(t:String, cb:function, s:Object):void
Creates a confirm dialog. Please don't use the blocking behavior of this native version use the callback method instead then it can be extended.

Parameters

ParamDetail
t:StringTitle for the new confirm dialog.
cb:functionCallback function to be executed after the user has selected ok or cancel.
s:ObjectOptional scope to execute the callback in.

execCommand

public static function execCommand(cmd:String, ui:Boolean, val:Object, a:Object):void
Executed a command on editor that opened the dialog/popup.

Parameters

ParamDetail
cmd:StringCommand to execute.
ui:BooleanOptional boolean value if the UI for the command should be presented or not.
val:ObjectOptional value to pass with the comman like an URL.
a:ObjectOptional arguments object.

executeOnLoad

public static function executeOnLoad(s:String):void
Will executed the specified string when the page has been loaded. This function was added for compatibility with the 2.x branch.

Parameters

ParamDetail
s:StringString to evalutate on init.

getLang

public static function getLang(n:String, dv:String):String
Returns a language item by key.

Parameters

ParamDetail
n:StringLanguage item like mydialog.something.
dv:StringOptional default value to return.

Returns
String - Language value for the item like "my string" or the default value if it wasn't found.

getParam

public static function getParam(n:String, dv:String):String
Returns a editor parameter/config option value.

Parameters

ParamDetail
n:StringName of the editor config option to retrive.
dv:StringOptional default value to return.

Returns
String - Parameter value or default value if it wasn't found.

getWin

public static function getWin():Window
Returns the reference to the parent window that opened the dialog.

Returns
Window - Reference to the parent window that opened the dialog.

getWindowArg

public static function getWindowArg(n:String, dv:String):String
Returns a window argument/parameter by name.

Parameters

ParamDetail
n:StringName of the window argument to retrive.
dv:StringOptional default value to return.

Returns
String - Argument value or default value if it wasn't found.

init

public static function init():void
Initializes the popup this will be called automatically.

openBrowser

public static function openBrowser(element_id:string, type:string, option:string):void
Opens a filebrowser/imagebrowser this will set the output value from the browser as a value on the specified element.

Parameters

ParamDetail
element_id:stringId of the element to set value in.
type:stringType of browser to open image/file/flash.
option:stringOption name to get the file_broswer_callback function name from.

pickColor

public static function pickColor(e:DOMEvent, element_id:string):void
Executes a color picker on the specified element id. When the user then selects a color it will be set as the value of the specified element.

Parameters

ParamDetail
e:DOMEventDOM event object.
element_id:stringElement id to be filled with the color value from the picker.

requireLangPack

public static function requireLangPack():void
Loads a specific dialog language pack. If you pass in plugin_url as a arugment when you open the window it will load the /langs/_dlg.js lang pack file.

resizeToInnerSize

public static function resizeToInnerSize():void
Resizes the dialog to the inner size of the window. This is needed since various browsers have different border sizes on windows.

restoreSelection

public static function restoreSelection():void
Restores any stored selection. This can be useful since some browsers looses it's selection if a control element is selected/focused inside the dialogs.

storeSelection

public static function storeSelection():void
Stores the current editor selection for later restoration. This can be useful since some browsers looses it's selection if a control element is selected/focused inside the dialogs.

Event details

onInit

public static event onInit(editor:Editor)
Fires when the popup is initialized.

Parameters

ParamDetail
editor:EditorEditor instance.

Example

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.