From 132569c30126968a3e2185323d93420cf64bc0db Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 16 Jan 2007 17:52:13 +0000 Subject: [PATCH] Set eol-style to native. git-svn-id: http://svn.automattic.com/wordpress/trunk@4747 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/default/functions.php | 794 +++++----- wp-includes/js/tinymce/langs/en.js | 82 +- .../tinymce/plugins/autosave/editor_plugin.js | 92 +- .../plugins/autosave/editor_plugin_src.js | 60 +- .../js/tinymce/plugins/autosave/langs/en.js | 10 +- .../plugins/directionality/editor_plugin.js | 180 +-- .../plugins/directionality/langs/en.js | 12 +- .../plugins/inlinepopups/editor_plugin.js | 1330 ++++++++--------- .../inlinepopups/jscripts/mcwindows.js | 906 +++++------ .../js/tinymce/plugins/paste/editor_plugin.js | 770 +++++----- .../plugins/paste/jscripts/pastetext.js | 76 +- .../plugins/paste/jscripts/pasteword.js | 104 +- .../js/tinymce/plugins/paste/langs/en.js | 20 +- .../classes/TinyGoogleSpell.class.php | 146 +- .../spellchecker/classes/TinyPspell.class.php | 126 +- .../classes/TinyPspellShell.class.php | 204 +-- .../tinymce/plugins/spellchecker/config.php | 58 +- .../plugins/spellchecker/editor_plugin.js | 1146 +++++++------- .../tinymce/plugins/spellchecker/langs/en.js | 28 +- .../plugins/spellchecker/tinyspell.php | 266 ++-- .../js/tinymce/plugins/wordpress/langs/en.js | 66 +- .../tinymce/plugins/wphelp/editor_plugin.js | 114 +- .../js/tinymce/plugins/wphelp/langs/en.js | 10 +- .../js/tinymce/themes/advanced/langs/en.js | 164 +- wp-includes/js/tinymce/utils/form_utils.js | 420 +++--- wp-includes/js/tinymce/utils/mclayer.js | 420 +++--- wp-includes/js/tinymce/utils/mctabs.js | 148 +- wp-includes/js/tinymce/utils/validate.js | 438 +++--- 28 files changed, 4095 insertions(+), 4095 deletions(-) diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php index 5a6400e4b1..cad93e5682 100644 --- a/wp-content/themes/default/functions.php +++ b/wp-content/themes/default/functions.php @@ -1,397 +1,397 @@ -\n\n"; - if ( '' != $output ) - echo $head . $output . $foot; -} - -add_action('wp_head', 'kubrick_head'); - -function kubrick_header_image() { - return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); -} - -function kubrick_upper_color() { - if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['upper']; - } else - return '69aee7'; -} - -function kubrick_lower_color() { - if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['lower']; - } else - return '4180b6'; -} - -function kubrick_header_image_url() { - if ( $image = kubrick_header_image() ) - $url = get_template_directory_uri() . '/images/' . $image; - else - $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; - - return $url; -} - -function kubrick_header_color() { - return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); -} - -function kubrick_header_color_string() { - $color = kubrick_header_color(); - if ( false === $color ) - return 'white'; - - return $color; -} - -function kubrick_header_display() { - return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); -} - -function kubrick_header_display_string() { - $display = kubrick_header_display(); - return $display ? $display : 'inline'; -} - -add_action('admin_menu', 'kubrick_add_theme_page'); - -function kubrick_add_theme_page() { - if ( $_GET['page'] == basename(__FILE__) ) { - if ( 'save' == $_REQUEST['action'] ) { - if ( isset($_REQUEST['njform']) ) { - if ( isset($_REQUEST['defaults']) ) { - delete_option('kubrick_header_image'); - delete_option('kubrick_header_color'); - delete_option('kubrick_header_display'); - } else { - if ( '' == $_REQUEST['njfontcolor'] ) - delete_option('kubrick_header_color'); - else - update_option('kubrick_header_color', $_REQUEST['njfontcolor']); - - if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { - $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; - $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; - update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); - } - - if ( isset($_REQUEST['toggledisplay']) ) { - if ( false === get_option('kubrick_header_display') ) - update_option('kubrick_header_display', 'none'); - else - delete_option('kubrick_header_display'); - } - } - } else { - - if ( isset($_REQUEST['headerimage']) ) { - if ( '' == $_REQUEST['headerimage'] ) - delete_option('kubrick_header_image'); - else - update_option('kubrick_header_image', $_REQUEST['headerimage']); - } - - if ( isset($_REQUEST['fontcolor']) ) { - if ( '' == $_REQUEST['fontcolor'] ) - delete_option('kubrick_header_color'); - else - update_option('kubrick_header_color', $_REQUEST['fontcolor']); - } - - if ( isset($_REQUEST['fontdisplay']) ) { - if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) - delete_option('kubrick_header_display'); - else - update_option('kubrick_header_display', 'none'); - } - } - //print_r($_REQUEST); - wp_redirect("themes.php?page=functions.php&saved=true"); - die; - } - add_action('admin_head', 'kubrick_theme_page_head'); - } - add_theme_page('Customize Header', 'Header Image and Color', 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); -} - -function kubrick_theme_page_head() { -?> - - - -

Options saved.

'; -?> -
-
-

Header Image and Color

-
- -
-
-
-
-
- Any CSS color (red or #FF0000 or rgb(255, 0, 0))
- HEX only (#FF0000 or #F00)
- HEX only (#FF0000 or #F00)
- - - - - - -
-
-
-
- - - - - - - - - - - -

-
- -
- -
-
-
-
- +\n\n"; + if ( '' != $output ) + echo $head . $output . $foot; +} + +add_action('wp_head', 'kubrick_head'); + +function kubrick_header_image() { + return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); +} + +function kubrick_upper_color() { + if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { + parse_str(substr($url, strpos($url, '?') + 1), $q); + return $q['upper']; + } else + return '69aee7'; +} + +function kubrick_lower_color() { + if ( strstr( $url = kubrick_header_image_url(), 'header-img.php?' ) ) { + parse_str(substr($url, strpos($url, '?') + 1), $q); + return $q['lower']; + } else + return '4180b6'; +} + +function kubrick_header_image_url() { + if ( $image = kubrick_header_image() ) + $url = get_template_directory_uri() . '/images/' . $image; + else + $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; + + return $url; +} + +function kubrick_header_color() { + return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); +} + +function kubrick_header_color_string() { + $color = kubrick_header_color(); + if ( false === $color ) + return 'white'; + + return $color; +} + +function kubrick_header_display() { + return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); +} + +function kubrick_header_display_string() { + $display = kubrick_header_display(); + return $display ? $display : 'inline'; +} + +add_action('admin_menu', 'kubrick_add_theme_page'); + +function kubrick_add_theme_page() { + if ( $_GET['page'] == basename(__FILE__) ) { + if ( 'save' == $_REQUEST['action'] ) { + if ( isset($_REQUEST['njform']) ) { + if ( isset($_REQUEST['defaults']) ) { + delete_option('kubrick_header_image'); + delete_option('kubrick_header_color'); + delete_option('kubrick_header_display'); + } else { + if ( '' == $_REQUEST['njfontcolor'] ) + delete_option('kubrick_header_color'); + else + update_option('kubrick_header_color', $_REQUEST['njfontcolor']); + + if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { + $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; + $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; + update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); + } + + if ( isset($_REQUEST['toggledisplay']) ) { + if ( false === get_option('kubrick_header_display') ) + update_option('kubrick_header_display', 'none'); + else + delete_option('kubrick_header_display'); + } + } + } else { + + if ( isset($_REQUEST['headerimage']) ) { + if ( '' == $_REQUEST['headerimage'] ) + delete_option('kubrick_header_image'); + else + update_option('kubrick_header_image', $_REQUEST['headerimage']); + } + + if ( isset($_REQUEST['fontcolor']) ) { + if ( '' == $_REQUEST['fontcolor'] ) + delete_option('kubrick_header_color'); + else + update_option('kubrick_header_color', $_REQUEST['fontcolor']); + } + + if ( isset($_REQUEST['fontdisplay']) ) { + if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) + delete_option('kubrick_header_display'); + else + update_option('kubrick_header_display', 'none'); + } + } + //print_r($_REQUEST); + wp_redirect("themes.php?page=functions.php&saved=true"); + die; + } + add_action('admin_head', 'kubrick_theme_page_head'); + } + add_theme_page('Customize Header', 'Header Image and Color', 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); +} + +function kubrick_theme_page_head() { +?> + + + +

Options saved.

'; +?> +
+
+

Header Image and Color

+
+ +
+
+
+
+
+ Any CSS color (red or #FF0000 or rgb(255, 0, 0))
+ HEX only (#FF0000 or #F00)
+ HEX only (#FF0000 or #F00)
+ + + + + + +
+
+
+
+ + + + + + + + + + + +

+
+ +
+ +
+
+
+
+ diff --git a/wp-includes/js/tinymce/langs/en.js b/wp-includes/js/tinymce/langs/en.js index c093eafa04..c7faa24323 100644 --- a/wp-includes/js/tinymce/langs/en.js +++ b/wp-includes/js/tinymce/langs/en.js @@ -1,41 +1,41 @@ -// UK lang variables - -tinyMCE.addToLang('',{ -bold_desc : 'Bold (Ctrl+B)', -italic_desc : 'Italic (Ctrl+I)', -underline_desc : 'Underline (Ctrl+U)', -striketrough_desc : 'Strikethrough', -justifyleft_desc : 'Align left', -justifycenter_desc : 'Align center', -justifyright_desc : 'Align right', -justifyfull_desc : 'Align full', -bullist_desc : 'Unordered list', -numlist_desc : 'Ordered list', -outdent_desc : 'Outdent', -indent_desc : 'Indent', -undo_desc : 'Undo (Ctrl+Z)', -redo_desc : 'Redo (Ctrl+Y)', -link_desc : 'Insert/edit link', -unlink_desc : 'Unlink', -image_desc : 'Insert/edit image', -cleanup_desc : 'Cleanup messy code', -focus_alert : 'A editor instance must be focused before using this command.', -edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?', -insert_link_title : 'Insert/edit link', -insert : 'Insert', -update : 'Update', -cancel : 'Cancel', -insert_link_url : 'Link URL', -insert_link_target : 'Target', -insert_link_target_same : 'Open link in the same window', -insert_link_target_blank : 'Open link in a new window', -insert_image_title : 'Insert/edit image', -insert_image_src : 'Image URL', -insert_image_alt : 'Image description', -help_desc : 'Help', -bold_img : "bold.gif", -italic_img : "italic.gif", -underline_img : "underline.gif", -clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', -popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.' -}); +// UK lang variables + +tinyMCE.addToLang('',{ +bold_desc : 'Bold (Ctrl+B)', +italic_desc : 'Italic (Ctrl+I)', +underline_desc : 'Underline (Ctrl+U)', +striketrough_desc : 'Strikethrough', +justifyleft_desc : 'Align left', +justifycenter_desc : 'Align center', +justifyright_desc : 'Align right', +justifyfull_desc : 'Align full', +bullist_desc : 'Unordered list', +numlist_desc : 'Ordered list', +outdent_desc : 'Outdent', +indent_desc : 'Indent', +undo_desc : 'Undo (Ctrl+Z)', +redo_desc : 'Redo (Ctrl+Y)', +link_desc : 'Insert/edit link', +unlink_desc : 'Unlink', +image_desc : 'Insert/edit image', +cleanup_desc : 'Cleanup messy code', +focus_alert : 'A editor instance must be focused before using this command.', +edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?', +insert_link_title : 'Insert/edit link', +insert : 'Insert', +update : 'Update', +cancel : 'Cancel', +insert_link_url : 'Link URL', +insert_link_target : 'Target', +insert_link_target_same : 'Open link in the same window', +insert_link_target_blank : 'Open link in a new window', +insert_image_title : 'Insert/edit image', +insert_image_src : 'Image URL', +insert_image_alt : 'Image description', +help_desc : 'Help', +bold_img : "bold.gif", +italic_img : "italic.gif", +underline_img : "underline.gif", +clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', +popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.' +}); diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js index 68563f96e5..ab0e3ad4df 100644 --- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js @@ -1,46 +1,46 @@ -/** - * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('autosave'); - -var TinyMCE_AutoSavePlugin = { - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - // Private plugin internal methods - - _beforeUnloadHandler : function() { - var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg"); - - if (tinyMCE.getParam("fullscreen_is_enabled")) - return; - - for (n in tinyMCE.instances) { - inst = tinyMCE.instances[n]; - - if (!tinyMCE.isInstance(inst)) - continue; - - if (inst.isDirty()) - return msg; - } - - return; - } -}; - -window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler; - -tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin); +/** + * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('autosave'); + +var TinyMCE_AutoSavePlugin = { + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + // Private plugin internal methods + + _beforeUnloadHandler : function() { + var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg"); + + if (tinyMCE.getParam("fullscreen_is_enabled")) + return; + + for (n in tinyMCE.instances) { + inst = tinyMCE.instances[n]; + + if (!tinyMCE.isInstance(inst)) + continue; + + if (inst.isDirty()) + return msg; + } + + return; + } +}; + +window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler; + +tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin); diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js index 102d69b467..7c2ddb008b 100644 --- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js +++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js @@ -1,30 +1,30 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('autosave', 'en,sv,cs,he,no,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,fi,cy,es,is,pl'); - -function TinyMCE_autosave_getInfo() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - -function TinyMCE_autosave_beforeUnloadHandler() { - var msg = tinyMCE.getLang("lang_autosave_unload_msg"); - - var anyDirty = false; - for (var n in tinyMCE.instances) { - var inst = tinyMCE.instances[n]; - if (!tinyMCE.isInstance(inst)) - continue; - - if (inst.isDirty()) - return msg; - } - - return; -} - -window.onbeforeunload = TinyMCE_autosave_beforeUnloadHandler; +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('autosave', 'en,sv,cs,he,no,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,fi,cy,es,is,pl'); + +function TinyMCE_autosave_getInfo() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; +}; + +function TinyMCE_autosave_beforeUnloadHandler() { + var msg = tinyMCE.getLang("lang_autosave_unload_msg"); + + var anyDirty = false; + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; + + if (inst.isDirty()) + return msg; + } + + return; +} + +window.onbeforeunload = TinyMCE_autosave_beforeUnloadHandler; diff --git a/wp-includes/js/tinymce/plugins/autosave/langs/en.js b/wp-includes/js/tinymce/plugins/autosave/langs/en.js index 01951332d9..a1849339ca 100644 --- a/wp-includes/js/tinymce/plugins/autosave/langs/en.js +++ b/wp-includes/js/tinymce/plugins/autosave/langs/en.js @@ -1,5 +1,5 @@ -// EN lang variables - -tinyMCE.addToLang('',{ -autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.' -}); +// EN lang variables + +tinyMCE.addToLang('',{ +autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.' +}); diff --git a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js index c8a6295949..51eea48d93 100644 --- a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js @@ -1,90 +1,90 @@ -/** - * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('directionality'); - -var TinyMCE_DirectionalityPlugin = { - getInfo : function() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - getControlHTML : function(cn) { - switch (cn) { - case "ltr": - return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR'); - - case "rtl": - return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL'); - } - - return ""; - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceDirectionLTR": - var inst = tinyMCE.getInstanceById(editor_id); - var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - - if (elm) - elm.setAttribute("dir", "ltr"); - - tinyMCE.triggerNodeChange(false); - return true; - - case "mceDirectionRTL": - var inst = tinyMCE.getInstanceById(editor_id); - var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - - if (elm) - elm.setAttribute("dir", "rtl"); - - tinyMCE.triggerNodeChange(false); - return true; - } - - // Pass to next handler in chain - return false; - }, - - handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - function getAttrib(elm, name) { - return elm.getAttribute(name) ? elm.getAttribute(name) : ""; - } - - if (node == null) - return; - - var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - if (!elm) { - tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled'); - tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled'); - return true; - } - - tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal'); - tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal'); - - var dir = getAttrib(elm, "dir"); - if (dir == "ltr" || dir == "") - tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected'); - else - tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected'); - - return true; - } -}; - -tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin); +/** + * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('directionality'); + +var TinyMCE_DirectionalityPlugin = { + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + getControlHTML : function(cn) { + switch (cn) { + case "ltr": + return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR'); + + case "rtl": + return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL'); + } + + return ""; + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceDirectionLTR": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "ltr"); + + tinyMCE.triggerNodeChange(false); + return true; + + case "mceDirectionRTL": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "rtl"); + + tinyMCE.triggerNodeChange(false); + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } + + if (node == null) + return; + + var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + if (!elm) { + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled'); + return true; + } + + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal'); + + var dir = getAttrib(elm, "dir"); + if (dir == "ltr" || dir == "") + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected'); + else + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected'); + + return true; + } +}; + +tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin); diff --git a/wp-includes/js/tinymce/plugins/directionality/langs/en.js b/wp-includes/js/tinymce/plugins/directionality/langs/en.js index 5b392fe189..94c3c040af 100644 --- a/wp-includes/js/tinymce/plugins/directionality/langs/en.js +++ b/wp-includes/js/tinymce/plugins/directionality/langs/en.js @@ -1,6 +1,6 @@ -// UK lang variables - -tinyMCE.addToLang('',{ -directionality_ltr_desc : 'Direction left to right (Alt-.)', -directionality_rtl_desc : 'Direction right to left (Alt-,)' -}); +// UK lang variables + +tinyMCE.addToLang('',{ +directionality_ltr_desc : 'Direction left to right (Alt-.)', +directionality_rtl_desc : 'Direction right to left (Alt-,)' +}); diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js index 304e478689..782d0c7d18 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js @@ -1,665 +1,665 @@ -/** - * $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $ - * - * Moxiecode DHTML Windows script. - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -// Patch openWindow, closeWindow TinyMCE functions - -var TinyMCE_InlinePopupsPlugin = { - getInfo : function() { - return { - longname : 'Inline Popups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_inlinepopups.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - } -}; - -tinyMCE.addPlugin("inlinepopups", TinyMCE_InlinePopupsPlugin); - -// Patch openWindow, closeWindow TinyMCE functions - -TinyMCE_Engine.prototype.orgOpenWindow = TinyMCE_Engine.prototype.openWindow; - -TinyMCE_Engine.prototype.openWindow = function(template, args) { - // Does the caller support inline - if (args['inline'] != "yes" || tinyMCE.isOpera || tinyMCE.getParam("plugins").indexOf('inlinepopups') == -1) { - mcWindows.selectedWindow = null; - args['mce_inside_iframe'] = false; - this.orgOpenWindow(template, args); - return; - } - - var url, resizable, scrollbars; - - args['mce_inside_iframe'] = true; - tinyMCE.windowArgs = args; - - if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1) - url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file']; - else - url = template['file']; - - if (!(width = parseInt(template['width']))) - width = 320; - - if (!(height = parseInt(template['height']))) - height = 200; - - resizable = (args && args['resizable']) ? args['resizable'] : "no"; - scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no"; - - height += 18; - - // Replace all args as variables in URL - for (var name in args) { - if (typeof(args[name]) == 'function') - continue; - - url = tinyMCE.replaceVar(url, name, escape(args[name])); - } - - var elm = document.getElementById(this.selectedInstance.editorId + '_parent'); - var pos = tinyMCE.getAbsPosition(elm); - - // Center div in editor area - pos.absLeft += Math.round((elm.firstChild.clientWidth / 2) - (width / 2)); - pos.absTop += Math.round((elm.firstChild.clientHeight / 2) - (height / 2)); - - url += tinyMCE.settings['imp_version'] ? (url.indexOf('?')==-1?'?':'&') + 'ver=' + tinyMCE.settings['imp_version'] : ''; - - mcWindows.open(url, mcWindows.idCounter++, "modal=yes,width=" + width+ ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",statusbar=" + resizable + ",left=" + pos.absLeft + ",top=" + pos.absTop); -}; - -TinyMCE_Engine.prototype.orgCloseWindow = TinyMCE_Engine.prototype.closeWindow; - -TinyMCE_Engine.prototype.closeWindow = function(win) { - if (mcWindows.selectedWindow != null) - mcWindows.selectedWindow.close(); - else - this.orgCloseWindow(win); -}; - -TinyMCE_Engine.prototype.setWindowTitle = function(win_ref, title) { - for (var n in mcWindows.windows) { - var win = mcWindows.windows[n]; - if (typeof(win) == 'function') - continue; - - if (win_ref.name == win.id + "_iframe") - window.frames[win.id + "_iframe"].document.getElementById(win.id + '_title').innerHTML = title; - } -}; - -// * * * * * TinyMCE_Windows classes below - -// Windows handler -function TinyMCE_Windows() { - this.settings = new Array(); - this.windows = new Array(); - this.isMSIE = (navigator.appName == "Microsoft Internet Explorer"); - this.isGecko = navigator.userAgent.indexOf('Gecko') != -1; - this.isSafari = navigator.userAgent.indexOf('Safari') != -1; - this.isMac = navigator.userAgent.indexOf('Mac') != -1; - this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1); - this.action = "none"; - this.selectedWindow = null; - this.lastSelectedWindow = null; - this.zindex = 100; - this.mouseDownScreenX = 0; - this.mouseDownScreenY = 0; - this.mouseDownLayerX = 0; - this.mouseDownLayerY = 0; - this.mouseDownWidth = 0; - this.mouseDownHeight = 0; - this.idCounter = 0; -}; - -TinyMCE_Windows.prototype.init = function(settings) { - this.settings = settings; - - if (this.isMSIE) - this.addEvent(document, "mousemove", mcWindows.eventDispatcher); - else - this.addEvent(window, "mousemove", mcWindows.eventDispatcher); - - this.addEvent(document, "mouseup", mcWindows.eventDispatcher); - - this.doc = document; -}; - -TinyMCE_Windows.prototype.getParam = function(name, default_value) { - var value = null; - - value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; - - // Fix bool values - if (value == "true" || value == "false") - return (value == "true"); - - return value; -}; - -TinyMCE_Windows.prototype.eventDispatcher = function(e) { - e = typeof(e) == "undefined" ? window.event : e; - - if (mcWindows.selectedWindow == null) - return; - - // Switch focus - if (mcWindows.isGecko && e.type == "mousedown") { - var elm = e.currentTarget; - - for (var n in mcWindows.windows) { - var win = mcWindows.windows[n]; - - if (win.headElement == elm || win.resizeElement == elm) { - win.focus(); - break; - } - } - } - - switch (e.type) { - case "mousemove": - mcWindows.selectedWindow.onMouseMove(e); - break; - - case "mouseup": - mcWindows.selectedWindow.onMouseUp(e); - break; - - case "mousedown": - mcWindows.selectedWindow.onMouseDown(e); - break; - - case "focus": - mcWindows.selectedWindow.onFocus(e); - break; - } -}; - -TinyMCE_Windows.prototype.addEvent = function(obj, name, handler) { - if (this.isMSIE) - obj.attachEvent("on" + name, handler); - else - obj.addEventListener(name, handler, true); -}; - -TinyMCE_Windows.prototype.cancelEvent = function(e) { - if (this.isMSIE) { - e.returnValue = false; - e.cancelBubble = true; - } else - e.preventDefault(); -}; - -TinyMCE_Windows.prototype.parseFeatures = function(opts) { - // Cleanup the options - opts = opts.toLowerCase(); - opts = opts.replace(/;/g, ","); - opts = opts.replace(/[^0-9a-z=,]/g, ""); - - var optionChunks = opts.split(','); - var options = new Array(); - - options['left'] = "10"; - options['top'] = "10"; - options['width'] = "300"; - options['height'] = "300"; - options['resizable'] = "yes"; - options['minimizable'] = "yes"; - options['maximizable'] = "yes"; - options['close'] = "yes"; - options['movable'] = "yes"; - options['statusbar'] = "yes"; - options['scrollbars'] = "auto"; - options['modal'] = "no"; - - if (opts == "") - return options; - - for (var i=0; i'; - if ( this.isMac ) html += ''; - html += ''; - html += ''; - - html += '
'; - html += '
'; - html += '
'; -// html += ' '; -// html += ' '; - html += '
'; - html += '
'; - html += '
'; - - if (features['statusbar'] == "yes") { - html += '
'; - - if (features['resizable'] == "yes") { - if (this.isGecko) - html += '
'; - else - html += '
'; - } - - html += '
'; - } - - html += '
'; - - html += ''; - html += ''; - - // Create iframe - this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html); -}; - -// Blocks the document events by placing a image over the whole document -TinyMCE_Windows.prototype.setDocumentLock = function(state) { - if (state) { - var elm = document.getElementById('mcWindowEventBlocker'); - if (elm == null) { - elm = document.createElement("div"); - - elm.id = "mcWindowEventBlocker"; - elm.style.position = "absolute"; - elm.style.left = "0"; - elm.style.top = "0"; - - document.body.appendChild(elm); - } - - elm.style.display = "none"; - - var imgPath = this.getParam("images_path"); - var width = document.body.clientWidth; - var height = document.body.clientHeight; - - elm.style.width = width; - elm.style.height = height; - elm.innerHTML = ''; - - elm.style.zIndex = mcWindows.zindex-1; - elm.style.display = "block"; - } else { - var elm = document.getElementById('mcWindowEventBlocker'); - - if (mcWindows.windows.length == 0) - elm.parentNode.removeChild(elm); - else - elm.style.zIndex = mcWindows.zindex-1; - } -}; - -// Gets called when wrapper iframe is initialized -TinyMCE_Windows.prototype.onLoad = function(name) { - var win = mcWindows.windows[name]; - var id = "mcWindow_" + name; - var wrapperIframe = window.frames[id + "_iframe"].frames[0]; - var wrapperDoc = window.frames[id + "_iframe"].document; - var doc = window.frames[id + "_iframe"].document; - var winDiv = document.getElementById("mcWindow_" + name + "_div"); - var realIframe = window.frames[id + "_iframe"].frames[0]; - - // Set window data - win.id = "mcWindow_" + name; - win.winElement = winDiv; - win.bodyElement = doc.getElementById(id + '_body'); - win.iframeElement = doc.getElementById(id + '_iframe'); - win.headElement = doc.getElementById(id + '_head'); - win.titleElement = doc.getElementById(id + '_title'); - win.resizeElement = doc.getElementById(id + '_resize'); - win.containerElement = doc.getElementById(id + '_container'); - win.left = win.features['left']; - win.top = win.features['top']; - win.frame = window.frames[id + '_iframe'].frames[0]; - win.wrapperFrame = window.frames[id + '_iframe']; - win.wrapperIFrameElement = document.getElementById(id + "_iframe"); - - // Add event handlers - mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher); - - if (win.resizeElement != null) - mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher); - - if (mcWindows.isMSIE) { - mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher); - } else { - mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher); - } - - for (var i=0; i'; + if ( this.isMac ) html += ''; + html += ''; + html += ''; + + html += '
'; + html += '
'; + html += '
'; +// html += ' '; +// html += ' '; + html += '
'; + html += '
'; + html += '
'; + + if (features['statusbar'] == "yes") { + html += '
'; + + if (features['resizable'] == "yes") { + if (this.isGecko) + html += '
'; + else + html += '
'; + } + + html += '
'; + } + + html += '
'; + + html += ''; + html += ''; + + // Create iframe + this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html); +}; + +// Blocks the document events by placing a image over the whole document +TinyMCE_Windows.prototype.setDocumentLock = function(state) { + if (state) { + var elm = document.getElementById('mcWindowEventBlocker'); + if (elm == null) { + elm = document.createElement("div"); + + elm.id = "mcWindowEventBlocker"; + elm.style.position = "absolute"; + elm.style.left = "0"; + elm.style.top = "0"; + + document.body.appendChild(elm); + } + + elm.style.display = "none"; + + var imgPath = this.getParam("images_path"); + var width = document.body.clientWidth; + var height = document.body.clientHeight; + + elm.style.width = width; + elm.style.height = height; + elm.innerHTML = ''; + + elm.style.zIndex = mcWindows.zindex-1; + elm.style.display = "block"; + } else { + var elm = document.getElementById('mcWindowEventBlocker'); + + if (mcWindows.windows.length == 0) + elm.parentNode.removeChild(elm); + else + elm.style.zIndex = mcWindows.zindex-1; + } +}; + +// Gets called when wrapper iframe is initialized +TinyMCE_Windows.prototype.onLoad = function(name) { + var win = mcWindows.windows[name]; + var id = "mcWindow_" + name; + var wrapperIframe = window.frames[id + "_iframe"].frames[0]; + var wrapperDoc = window.frames[id + "_iframe"].document; + var doc = window.frames[id + "_iframe"].document; + var winDiv = document.getElementById("mcWindow_" + name + "_div"); + var realIframe = window.frames[id + "_iframe"].frames[0]; + + // Set window data + win.id = "mcWindow_" + name; + win.winElement = winDiv; + win.bodyElement = doc.getElementById(id + '_body'); + win.iframeElement = doc.getElementById(id + '_iframe'); + win.headElement = doc.getElementById(id + '_head'); + win.titleElement = doc.getElementById(id + '_title'); + win.resizeElement = doc.getElementById(id + '_resize'); + win.containerElement = doc.getElementById(id + '_container'); + win.left = win.features['left']; + win.top = win.features['top']; + win.frame = window.frames[id + '_iframe'].frames[0]; + win.wrapperFrame = window.frames[id + '_iframe']; + win.wrapperIFrameElement = document.getElementById(id + "_iframe"); + + // Add event handlers + mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher); + + if (win.resizeElement != null) + mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher); + + if (mcWindows.isMSIE) { + mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher); + } else { + mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher); + } + + for (var i=0; i'; - - html += '
'; - html += '
'; - html += '
'; -// html += ' '; -// html += ' '; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - html += '
'; - - html += ''; - html += ''; - - // Create iframe - this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html); -}; - -// Gets called when wrapper iframe is initialized -MCWindows.prototype.onLoad = function(name) { - var win = mcWindows.windows[name]; - var id = "mcWindow_" + name; - var wrapperIframe = window.frames[id + "_iframe"].frames[0]; - var wrapperDoc = window.frames[id + "_iframe"].document; - var doc = window.frames[id + "_iframe"].document; - var winDiv = document.getElementById("mcWindow_" + name + "_div"); - var realIframe = window.frames[id + "_iframe"].frames[0]; - - // Set window data - win.id = "mcWindow_" + name + "_iframe"; - win.winElement = winDiv; - win.bodyElement = doc.getElementById(id + '_body'); - win.iframeElement = doc.getElementById(id + '_iframe'); - win.headElement = doc.getElementById(id + '_head'); - win.titleElement = doc.getElementById(id + '_title'); - win.resizeElement = doc.getElementById(id + '_resize'); - win.containerElement = doc.getElementById(id + '_container'); - win.left = win.features['left']; - win.top = win.features['top']; - win.frame = window.frames[id + '_iframe'].frames[0]; - win.wrapperFrame = window.frames[id + '_iframe']; - win.wrapperIFrameElement = document.getElementById(id + "_iframe"); - - // Add event handlers - mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher); - mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher); - - if (mcWindows.isMSIE) { - mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher); - } else { - mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher); - mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher); - } - - for (var i=0; i'; + + html += '
'; + html += '
'; + html += '
'; +// html += ' '; +// html += ' '; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + html += '
'; + + html += ''; + html += ''; + + // Create iframe + this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html); +}; + +// Gets called when wrapper iframe is initialized +MCWindows.prototype.onLoad = function(name) { + var win = mcWindows.windows[name]; + var id = "mcWindow_" + name; + var wrapperIframe = window.frames[id + "_iframe"].frames[0]; + var wrapperDoc = window.frames[id + "_iframe"].document; + var doc = window.frames[id + "_iframe"].document; + var winDiv = document.getElementById("mcWindow_" + name + "_div"); + var realIframe = window.frames[id + "_iframe"].frames[0]; + + // Set window data + win.id = "mcWindow_" + name + "_iframe"; + win.winElement = winDiv; + win.bodyElement = doc.getElementById(id + '_body'); + win.iframeElement = doc.getElementById(id + '_iframe'); + win.headElement = doc.getElementById(id + '_head'); + win.titleElement = doc.getElementById(id + '_title'); + win.resizeElement = doc.getElementById(id + '_resize'); + win.containerElement = doc.getElementById(id + '_container'); + win.left = win.features['left']; + win.top = win.features['top']; + win.frame = window.frames[id + '_iframe'].frames[0]; + win.wrapperFrame = window.frames[id + '_iframe']; + win.wrapperIFrameElement = document.getElementById(id + "_iframe"); + + // Add event handlers + mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher); + mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher); + + if (mcWindows.isMSIE) { + mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher); + } else { + mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher); + mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher); + } + + for (var i=0; i 0) - tinyMCE.execCommand('delete'); - - if (html && html.length > 0) - tinyMCE.execCommand('mcePasteWord', false, html); - - tinyMCE.cancelEvent(e); - return false; - } - - return true; - }, - - _insertText : function(content, bLinebreaks) { - if (content && content.length > 0) { - if (bLinebreaks) { - // Special paragraph treatment - if (tinyMCE.getParam("paste_create_paragraphs", true)) { - var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i

", "gi"); - content = tinyMCE.regexpReplace(content, "\r\r", "

", "gi"); - content = tinyMCE.regexpReplace(content, "\n\n", "

", "gi"); - - // Has paragraphs - if ((pos = content.indexOf('

')) != -1) { - tinyMCE.execCommand("Delete"); - - var node = tinyMCE.selectedInstance.getFocusElement(); - - // Get list of elements to break - var breakElms = new Array(); - - do { - if (node.nodeType == 1) { - // Don't break tables and break at body - if (node.nodeName == "TD" || node.nodeName == "BODY") - break; - - breakElms[breakElms.length] = node; - } - } while(node = node.parentNode); - - var before = "", after = "

"; - before += content.substring(0, pos); - - for (var i=0; i"; - after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; - } - - before += "

"; - content = before + content.substring(pos+7) + after; - } - } - - if (tinyMCE.getParam("paste_create_linebreaks", true)) { - content = tinyMCE.regexpReplace(content, "\r\n", "
", "gi"); - content = tinyMCE.regexpReplace(content, "\r", "
", "gi"); - content = tinyMCE.regexpReplace(content, "\n", "
", "gi"); - } - } - - tinyMCE.execCommand("mceInsertRawHTML", false, content); - } - }, - - _insertWordContent : function(content) { - if (content && content.length > 0) { - // Cleanup Word content - var bull = String.fromCharCode(8226); - var middot = String.fromCharCode(183); - var cb; - - if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") - content = eval(cb + "('before', content)"); - - var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i(.*?)<\/p>', 'gi'), '

$1

'); - } - - content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); - content = content.replace(new RegExp(bull + "(.*?)
", "gi"), "

" + middot + "$1

"); - content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list - content = content.replace(/<\/o:p>/gi, ""); - content = content.replace(new RegExp('
]*>/gi, ""); - - if (tinyMCE.getParam("paste_remove_styles", true)) - content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); - - content = content.replace(/<\/?font[^>]*>/gi, ""); - - // Strips class attributes. - switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) { - case "all": - content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); - break; - - case "mso": - content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); - break; - } - - content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']); - content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - content = content.replace(/<\\?\?xml[^>]*>/gi, ""); - content = content.replace(/<\/?\w+:[^>]*>/gi, ""); - content = content.replace(/-- page break --\s*

 <\/p>/gi, ""); // Remove pagebreaks - content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks - - // content = content.replace(/\/? */gi, "");   - // content = content.replace(/

 <\/p>/gi, ''); - - if (!tinyMCE.settings['force_p_newlines']) { - content = content.replace('', '' ,'gi'); - content = content.replace('

', '

' ,'gi'); - } - - if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) { - content = content.replace(/<\/?p[^>]*>/gi, ""); - } - - content = content.replace(/<\/?div[^>]*>/gi, ""); - - // Convert all middlot lists to UL lists - if (tinyMCE.getParam("paste_convert_middot_lists", true)) { - var div = document.createElement("div"); - div.innerHTML = content; - - // Convert all middot paragraphs to li elements - var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList"); - - while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull - while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot - while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull - - content = div.innerHTML; - } - - // Replace all headers with strong and fix some other issues - if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { - content = content.replace(/ <\/h[1-6]>/gi, '

  

'); - content = content.replace(//gi, '

'); - content = content.replace(/<\/h[1-6]>/gi, '

'); - content = content.replace(/ <\/b>/gi, '  '); - content = content.replace(/^( )*/gi, ''); - } - - content = content.replace(/--list--/gi, ""); // Remove --list-- - - if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") - content = eval(cb + "('after', content)"); - - // Insert cleaned content - tinyMCE.execCommand("mceInsertContent", false, content); - - if (tinyMCE.getParam('paste_force_cleanup_wordpaste', true)) - window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread - } - }, - - _reEscape : function(s) { - var l = "?.\\*[](){}+^$:"; - var o = ""; - - for (var i=0; i 0) + tinyMCE.execCommand('delete'); + + if (html && html.length > 0) + tinyMCE.execCommand('mcePasteWord', false, html); + + tinyMCE.cancelEvent(e); + return false; + } + + return true; + }, + + _insertText : function(content, bLinebreaks) { + if (content && content.length > 0) { + if (bLinebreaks) { + // Special paragraph treatment + if (tinyMCE.getParam("paste_create_paragraphs", true)) { + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i

", "gi"); + content = tinyMCE.regexpReplace(content, "\r\r", "

", "gi"); + content = tinyMCE.regexpReplace(content, "\n\n", "

", "gi"); + + // Has paragraphs + if ((pos = content.indexOf('

')) != -1) { + tinyMCE.execCommand("Delete"); + + var node = tinyMCE.selectedInstance.getFocusElement(); + + // Get list of elements to break + var breakElms = new Array(); + + do { + if (node.nodeType == 1) { + // Don't break tables and break at body + if (node.nodeName == "TD" || node.nodeName == "BODY") + break; + + breakElms[breakElms.length] = node; + } + } while(node = node.parentNode); + + var before = "", after = "

"; + before += content.substring(0, pos); + + for (var i=0; i"; + after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; + } + + before += "

"; + content = before + content.substring(pos+7) + after; + } + } + + if (tinyMCE.getParam("paste_create_linebreaks", true)) { + content = tinyMCE.regexpReplace(content, "\r\n", "
", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
", "gi"); + } + } + + tinyMCE.execCommand("mceInsertRawHTML", false, content); + } + }, + + _insertWordContent : function(content) { + if (content && content.length > 0) { + // Cleanup Word content + var bull = String.fromCharCode(8226); + var middot = String.fromCharCode(183); + var cb; + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('before', content)"); + + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i(.*?)<\/p>', 'gi'), '

$1

'); + } + + content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); + content = content.replace(new RegExp(bull + "(.*?)
", "gi"), "

" + middot + "$1

"); + content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list + content = content.replace(/<\/o:p>/gi, ""); + content = content.replace(new RegExp('
]*>/gi, ""); + + if (tinyMCE.getParam("paste_remove_styles", true)) + content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); + + content = content.replace(/<\/?font[^>]*>/gi, ""); + + // Strips class attributes. + switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) { + case "all": + content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); + break; + + case "mso": + content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); + break; + } + + content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']); + content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); + content = content.replace(/<\\?\?xml[^>]*>/gi, ""); + content = content.replace(/<\/?\w+:[^>]*>/gi, ""); + content = content.replace(/-- page break --\s*

 <\/p>/gi, ""); // Remove pagebreaks + content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks + + // content = content.replace(/\/? */gi, "");   + // content = content.replace(/

 <\/p>/gi, ''); + + if (!tinyMCE.settings['force_p_newlines']) { + content = content.replace('', '' ,'gi'); + content = content.replace('

', '

' ,'gi'); + } + + if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) { + content = content.replace(/<\/?p[^>]*>/gi, ""); + } + + content = content.replace(/<\/?div[^>]*>/gi, ""); + + // Convert all middlot lists to UL lists + if (tinyMCE.getParam("paste_convert_middot_lists", true)) { + var div = document.createElement("div"); + div.innerHTML = content; + + // Convert all middot paragraphs to li elements + var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList"); + + while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull + while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot + while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull + + content = div.innerHTML; + } + + // Replace all headers with strong and fix some other issues + if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { + content = content.replace(/ <\/h[1-6]>/gi, '

  

'); + content = content.replace(//gi, '

'); + content = content.replace(/<\/h[1-6]>/gi, '

'); + content = content.replace(/ <\/b>/gi, '  '); + content = content.replace(/^( )*/gi, ''); + } + + content = content.replace(/--list--/gi, ""); // Remove --list-- + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('after', content)"); + + // Insert cleaned content + tinyMCE.execCommand("mceInsertContent", false, content); + + if (tinyMCE.getParam('paste_force_cleanup_wordpaste', true)) + window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread + } + }, + + _reEscape : function(s) { + var l = "?.\\*[](){}+^$:"; + var o = ""; + + for (var i=0; ilang = $lang; - } - - // Returns array with bad words or false if failed. - function checkWords($word_array) { - $words = array(); - $wordstr = implode(' ', $word_array); - - $matches = $this->_getMatches($wordstr); - - for ($i=0; $i_getMatches($word); - - if (count($matches) > 0) - $sug = explode("\t", $matches[0][4]); - - return $sug; - } - - function _getMatches($word_list) { - $xml = ""; - - // Setup HTTP Client - $client = new HttpClient('www.google.com'); - $client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR'); - $client->setHandleRedirects(false); - $client->setDebug(false); - - // Setup XML request - $xml .= ''; - $xml .= ''; - $xml .= '' . htmlentities($word_list) . ''; - - // Execute HTTP Post to Google - if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) { - $this->errorMsg[] = 'An error occurred: ' . $client->getError(); - return array(); - } - - // Grab and parse content - $xml = $client->getContent(); - preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); - - return $matches; - } -} - -// Setup classname, should be the same as the name of the spellchecker class -$spellCheckerConfig['class'] = "TinyGoogleSpell"; - -?> +lang = $lang; + } + + // Returns array with bad words or false if failed. + function checkWords($word_array) { + $words = array(); + $wordstr = implode(' ', $word_array); + + $matches = $this->_getMatches($wordstr); + + for ($i=0; $i_getMatches($word); + + if (count($matches) > 0) + $sug = explode("\t", $matches[0][4]); + + return $sug; + } + + function _getMatches($word_list) { + $xml = ""; + + // Setup HTTP Client + $client = new HttpClient('www.google.com'); + $client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR'); + $client->setHandleRedirects(false); + $client->setDebug(false); + + // Setup XML request + $xml .= ''; + $xml .= ''; + $xml .= '' . htmlentities($word_list) . ''; + + // Execute HTTP Post to Google + if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) { + $this->errorMsg[] = 'An error occurred: ' . $client->getError(); + return array(); + } + + // Grab and parse content + $xml = $client->getContent(); + preg_match_all('/([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER); + + return $matches; + } +} + +// Setup classname, should be the same as the name of the spellchecker class +$spellCheckerConfig['class'] = "TinyGoogleSpell"; + +?> diff --git a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php index 21fb19448e..dfea14cbb8 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php @@ -1,64 +1,64 @@ -lang = $lang; - $this->mode = $mode; - $this->plink = false; - $this->errorMsg = array(); - - if (!function_exists("pspell_new")) { - $this->errorMsg[] = "PSpell not found."; - return; - } - - $this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode); - } - - // Returns array with bad words or false if failed. - function checkWords($wordArray) { - if (!$this->plink) { - $this->errorMsg[] = "No PSpell link found for checkWords."; - return array(); - } - - $wordError = array(); - foreach($wordArray as $word) { - if(!pspell_check($this->plink, trim($word))) - $wordError[] = $word; - } - - return $wordError; - } - - // Returns array with suggestions or false if failed. - function getSuggestion($word) { - if (!$this->plink) { - $this->errorMsg[] = "No PSpell link found for getSuggestion."; - return array(); - } - - return pspell_suggest($this->plink, $word); - } -} - -// Setup classname, should be the same as the name of the spellchecker class -$spellCheckerConfig['class'] = "TinyPspell"; - +lang = $lang; + $this->mode = $mode; + $this->plink = false; + $this->errorMsg = array(); + + if (!function_exists("pspell_new")) { + $this->errorMsg[] = "PSpell not found."; + return; + } + + $this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode); + } + + // Returns array with bad words or false if failed. + function checkWords($wordArray) { + if (!$this->plink) { + $this->errorMsg[] = "No PSpell link found for checkWords."; + return array(); + } + + $wordError = array(); + foreach($wordArray as $word) { + if(!pspell_check($this->plink, trim($word))) + $wordError[] = $word; + } + + return $wordError; + } + + // Returns array with suggestions or false if failed. + function getSuggestion($word) { + if (!$this->plink) { + $this->errorMsg[] = "No PSpell link found for getSuggestion."; + return array(); + } + + return pspell_suggest($this->plink, $word); + } +} + +// Setup classname, should be the same as the name of the spellchecker class +$spellCheckerConfig['class'] = "TinyPspell"; + ?> \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php index 81e3f152e0..cfafa92081 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php @@ -1,102 +1,102 @@ -lang = $lang; - $this->mode = $mode; - $this->error = false; - $this->errorMsg = array(); - - $this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell"); - $this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang; - } - - // Returns array with bad words or false if failed. - function checkWords($wordArray) { - if ($fh = fopen($this->tmpfile, "w")) { - fwrite($fh, "!\n"); - foreach($wordArray as $key => $value) - fwrite($fh, "^" . $value . "\n"); - - fclose($fh); - } else { - $this->errorMsg[] = "PSpell not found."; - return array(); - } - - $data = shell_exec($this->cmd); - @unlink($this->tmpfile); - $returnData = array(); - $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); - - foreach($dataArr as $dstr) { - $matches = array(); - - // Skip this line. - if (strpos($dstr, "@") === 0) - continue; - - preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches); - - if (!empty($matches[1])) - $returnData[] = $matches[1]; - } - - return $returnData; - } - - // Returns array with suggestions or false if failed. - function getSuggestion($word) { - if ($fh = fopen($this->tmpfile, "w")) { - fwrite($fh, "!\n"); - fwrite($fh, "^$word\n"); - fclose($fh); - } else - wp_die("Error opening tmp file."); - - $data = shell_exec($this->cmd); - @unlink($this->tmpfile); - $returnData = array(); - $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); - - foreach($dataArr as $dstr) { - $matches = array(); - - // Skip this line. - if (strpos($dstr, "@") === 0) - continue; - - preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches); - - if (!empty($matches[1])) { - // For some reason, the exec version seems to add commas? - $returnData[] = str_replace(",", "", $matches[1]); - } - } - return $returnData; - } -} - -// Setup classname, should be the same as the name of the spellchecker class -$spellCheckerConfig['class'] = "TinyPspellShell"; - -?> +lang = $lang; + $this->mode = $mode; + $this->error = false; + $this->errorMsg = array(); + + $this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell"); + $this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang; + } + + // Returns array with bad words or false if failed. + function checkWords($wordArray) { + if ($fh = fopen($this->tmpfile, "w")) { + fwrite($fh, "!\n"); + foreach($wordArray as $key => $value) + fwrite($fh, "^" . $value . "\n"); + + fclose($fh); + } else { + $this->errorMsg[] = "PSpell not found."; + return array(); + } + + $data = shell_exec($this->cmd); + @unlink($this->tmpfile); + $returnData = array(); + $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); + + foreach($dataArr as $dstr) { + $matches = array(); + + // Skip this line. + if (strpos($dstr, "@") === 0) + continue; + + preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches); + + if (!empty($matches[1])) + $returnData[] = $matches[1]; + } + + return $returnData; + } + + // Returns array with suggestions or false if failed. + function getSuggestion($word) { + if ($fh = fopen($this->tmpfile, "w")) { + fwrite($fh, "!\n"); + fwrite($fh, "^$word\n"); + fclose($fh); + } else + wp_die("Error opening tmp file."); + + $data = shell_exec($this->cmd); + @unlink($this->tmpfile); + $returnData = array(); + $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY); + + foreach($dataArr as $dstr) { + $matches = array(); + + // Skip this line. + if (strpos($dstr, "@") === 0) + continue; + + preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches); + + if (!empty($matches[1])) { + // For some reason, the exec version seems to add commas? + $returnData[] = str_replace(",", "", $matches[1]); + } + } + return $returnData; + } +} + +// Setup classname, should be the same as the name of the spellchecker class +$spellCheckerConfig['class'] = "TinyPspellShell"; + +?> diff --git a/wp-includes/js/tinymce/plugins/spellchecker/config.php b/wp-includes/js/tinymce/plugins/spellchecker/config.php index 2bfc9ec4f5..a622fe93de 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/config.php +++ b/wp-includes/js/tinymce/plugins/spellchecker/config.php @@ -1,29 +1,29 @@ - + diff --git a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js index ab3fc6bda5..98f057ee36 100755 --- a/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js @@ -1,573 +1,573 @@ -/** - * $RCSfile: editor_plugin_src.js,v $ - * $Revision: 1.4 $ - * $Date: 2006/03/24 17:24:50 $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -tinyMCE.importPluginLanguagePack('spellchecker', 'en,sv,nn,nb'); - -// Plucin static class -var TinyMCE_SpellCheckerPlugin = { - _contextMenu : new TinyMCE_Menu(), - _menu : new TinyMCE_Menu(), - _counter : 0, - - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_spellchecker.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, - - handleEvent : function(e) { - var elm = tinyMCE.isMSIE ? e.srcElement : e.target; - var inst = tinyMCE.selectedInstance, args = ''; - var self = TinyMCE_SpellCheckerPlugin; - var cm = self._contextMenu; - var p, p2, x, y, sx, sy, h, elm; - - // Handle click on word - if ((e.type == "click" || e.type == "contextmenu") && elm) { - do { - if (tinyMCE.getAttrib(elm, 'class') == "mceItemHiddenSpellWord") { - inst.spellCheckerElm = elm; - - // Setup arguments - args += 'id=' + inst.editorId + "|" + (++self._counter); - args += '&cmd=suggest&check=' + escape(elm.innerHTML); - args += '&lang=' + escape(inst.spellCheckerLang); - - elm = inst.spellCheckerElm; - p = tinyMCE.getAbsPosition(inst.iframeElement); - p2 = tinyMCE.getAbsPosition(elm); - h = parseInt(elm.offsetHeight); - sx = inst.getBody().scrollLeft; - sy = inst.getBody().scrollTop; - x = p.absLeft + p2.absLeft - sx; - y = p.absTop + p2.absTop - sy + h; - - cm.clear(); - cm.addTitle(tinyMCE.getLang('lang_spellchecker_wait', '', true)); - cm.show(); - cm.moveTo(x, y); - - inst.selection.selectNode(elm, false, false); - - self._sendAjax(self.baseURL + "/tinyspell.php", self._ajaxResponse, 'post', args); - - tinyMCE.cancelEvent(e); - return false; - } - } while ((elm = elm.parentNode)); - } - - return true; - }, - - initInstance : function(inst) { - var self = TinyMCE_SpellCheckerPlugin, m = self._menu, cm = self._contextMenu, e; - - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/spellchecker/css/content.css"); - - if (!tinyMCE.hasMenu('spellcheckercontextmenu')) { - tinyMCE.importCSS(document, tinyMCE.baseURL + "/plugins/spellchecker/css/spellchecker.css"); - - cm.init({drop_menu : false}); - tinyMCE.addMenu('spellcheckercontextmenu', cm); - } - - if (!tinyMCE.hasMenu('spellcheckermenu')) { - m.init({}); - tinyMCE.addMenu('spellcheckermenu', m); - } - - inst.spellCheckerLang = 'en'; - self._buildSettingsMenu(inst, null); - - e = self._getBlockBoxLayer(inst).create('div', 'mceBlockBox', document.getElementById(inst.editorId + '_parent')); - self._getMsgBoxLayer(inst).create('div', 'mceMsgBox', document.getElementById(inst.editorId + '_parent')); - }, - - _getMsgBoxLayer : function(inst) { - if (!inst.spellCheckerMsgBoxL) - inst.spellCheckerMsgBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerMsgBox', false); - - return inst.spellCheckerMsgBoxL; - }, - - _getBlockBoxLayer : function(inst) { - if (!inst.spellCheckerBoxL) - inst.spellCheckerBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerBlockBox', false); - - return inst.spellCheckerBoxL; - }, - - _buildSettingsMenu : function(inst, lang) { - var i, ar = tinyMCE.getParam('spellchecker_languages', '+English=en').split(','), p; - var self = TinyMCE_SpellCheckerPlugin, m = self._menu, c; - - m.clear(); - m.addTitle(tinyMCE.getLang('lang_spellchecker_langs', '', true)); - - for (i=0; i'; - h += ''; - h += ''; - h += ''; - } else { - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - h += ''; - else - h += ''; - - h += ''; - h += ''; - h += ''; - h += ''; - } - - return h; - }, - - _menuButtonEvent : function(e, o) { - if (o.className == 'mceMenuButtonFocus') - return; - - if (e == 'over') - o.className = o.className + ' mceMenuHover'; - else - o.className = o.className.replace(/\s.*$/, ''); - }, - - _toggleMenu : function(editor_id, id) { - var self = TinyMCE_SpellCheckerPlugin; - var e = document.getElementById(editor_id + '_spellchecker'); - var inst = tinyMCE.getInstanceById(editor_id); - - if (self._menu.isVisible()) { - tinyMCE.hideMenus(); - return; - } - - tinyMCE.lastMenuBtnClass = e.className.replace(/\s.*$/, ''); - tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonFocus'); - - self._menu.moveRelativeTo(e, 'bl'); - self._menu.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? 0 : 1, -1); - - if (tinyMCE.isOpera) - self._menu.moveBy(0, -2); - - self._onMenuEvent(inst, self._menu, 'show'); - - self._menu.show(); - - tinyMCE.lastSelectedMenuBtn = editor_id + '_spellchecker'; - }, - - _onMenuEvent : function(inst, m, n) { - TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst, inst.spellCheckerLang); - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_SpellCheckerPlugin, args = '', co, bb, mb, nl, i, e; - - // Handle commands - switch (command) { - case "mceSpellCheck": - if (!inst.spellcheckerOn) { - inst.spellCheckerBookmark = inst.selection.getBookmark(); - - // Setup arguments - args += 'id=' + inst.editorId + "|" + (++self._counter); - args += '&cmd=spell&check=' + escape(self._getWordList(inst.getBody())).replace(/%20/g, '+'); - args += '&lang=' + escape(inst.spellCheckerLang); - - co = document.getElementById(inst.editorId + '_parent').firstChild; - bb = self._getBlockBoxLayer(inst); - bb.moveRelativeTo(co, 'tl'); - bb.resizeTo(co.offsetWidth, co.offsetHeight); - bb.show(); - - // Setup message box - mb = self._getMsgBoxLayer(inst); - e = mb.getElement(); - e.innerHTML = '' + tinyMCE.getLang('lang_spellchecker_swait', '', true) + ''; - mb.show(); - mb.moveRelativeTo(co, 'cc'); - - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { - nl = co.getElementsByTagName('select'); - for (i=0; i?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); - - for (i=0; i=0; i--) { - c = tinyMCE.getAttrib(nl[i], 'class'); - - if ((c == 'mceItemHiddenSpellWord' || c == 'mceItemHidden') && (word == null || nl[i].innerHTML == word)) - self._removeWord(nl[i]); - } - - if (b) - inst.selection.moveToBookmark(b); - }, - - _checkDone : function(inst) { - var i, w = 0, nl = inst.getDoc().getElementsByTagName("span") - var self = TinyMCE_SpellCheckerPlugin; - - for (i=nl.length-1; i>=0; i--) { - c = tinyMCE.getAttrib(nl[i], 'class'); - - if (c == 'mceItemHiddenSpellWord') - w++; - } - - if (w == 0) { - self._removeWords(inst.getDoc()); - inst.spellcheckerOn = false; - tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton'); - } - }, - - _removeWord : function(e) { - tinyMCE.setOuterHTML(e, e.innerHTML); - }, - - _markWords : function(doc, n, wl) { - var i, nv, nn, nl = tinyMCE.getNodeTree(n, new Array(), 3); - var r1, r2, r3, r4, r5, w = ''; - var re = TinyMCE_SpellCheckerPlugin._getWordSeparators(); - - for (i=0; i$1$2'); - nv = nv.replace(r3, '$1$2'); - - nn = doc.createElement('span'); - nn.className = "mceItemHidden"; - nn.innerHTML = nv; - - // Remove old text node - nl[i].parentNode.replaceChild(nn, nl[i]); - } - } - }, - - _buildMenu : function(sg, max) { - var i, self = TinyMCE_SpellCheckerPlugin, cm = self._contextMenu; - - cm.clear(); - - if (sg != null) { - cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug', '', true)); - - for (i=0; i'; + h += ''; + h += ''; + h += ''; + } else { + if (tinyMCE.isMSIE && !tinyMCE.isOpera) + h += ''; + else + h += ''; + + h += ''; + h += ''; + h += ''; + h += ''; + } + + return h; + }, + + _menuButtonEvent : function(e, o) { + if (o.className == 'mceMenuButtonFocus') + return; + + if (e == 'over') + o.className = o.className + ' mceMenuHover'; + else + o.className = o.className.replace(/\s.*$/, ''); + }, + + _toggleMenu : function(editor_id, id) { + var self = TinyMCE_SpellCheckerPlugin; + var e = document.getElementById(editor_id + '_spellchecker'); + var inst = tinyMCE.getInstanceById(editor_id); + + if (self._menu.isVisible()) { + tinyMCE.hideMenus(); + return; + } + + tinyMCE.lastMenuBtnClass = e.className.replace(/\s.*$/, ''); + tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonFocus'); + + self._menu.moveRelativeTo(e, 'bl'); + self._menu.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? 0 : 1, -1); + + if (tinyMCE.isOpera) + self._menu.moveBy(0, -2); + + self._onMenuEvent(inst, self._menu, 'show'); + + self._menu.show(); + + tinyMCE.lastSelectedMenuBtn = editor_id + '_spellchecker'; + }, + + _onMenuEvent : function(inst, m, n) { + TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst, inst.spellCheckerLang); + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_SpellCheckerPlugin, args = '', co, bb, mb, nl, i, e; + + // Handle commands + switch (command) { + case "mceSpellCheck": + if (!inst.spellcheckerOn) { + inst.spellCheckerBookmark = inst.selection.getBookmark(); + + // Setup arguments + args += 'id=' + inst.editorId + "|" + (++self._counter); + args += '&cmd=spell&check=' + escape(self._getWordList(inst.getBody())).replace(/%20/g, '+'); + args += '&lang=' + escape(inst.spellCheckerLang); + + co = document.getElementById(inst.editorId + '_parent').firstChild; + bb = self._getBlockBoxLayer(inst); + bb.moveRelativeTo(co, 'tl'); + bb.resizeTo(co.offsetWidth, co.offsetHeight); + bb.show(); + + // Setup message box + mb = self._getMsgBoxLayer(inst); + e = mb.getElement(); + e.innerHTML = '' + tinyMCE.getLang('lang_spellchecker_swait', '', true) + ''; + mb.show(); + mb.moveRelativeTo(co, 'cc'); + + if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + nl = co.getElementsByTagName('select'); + for (i=0; i?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); + + for (i=0; i=0; i--) { + c = tinyMCE.getAttrib(nl[i], 'class'); + + if ((c == 'mceItemHiddenSpellWord' || c == 'mceItemHidden') && (word == null || nl[i].innerHTML == word)) + self._removeWord(nl[i]); + } + + if (b) + inst.selection.moveToBookmark(b); + }, + + _checkDone : function(inst) { + var i, w = 0, nl = inst.getDoc().getElementsByTagName("span") + var self = TinyMCE_SpellCheckerPlugin; + + for (i=nl.length-1; i>=0; i--) { + c = tinyMCE.getAttrib(nl[i], 'class'); + + if (c == 'mceItemHiddenSpellWord') + w++; + } + + if (w == 0) { + self._removeWords(inst.getDoc()); + inst.spellcheckerOn = false; + tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton'); + } + }, + + _removeWord : function(e) { + tinyMCE.setOuterHTML(e, e.innerHTML); + }, + + _markWords : function(doc, n, wl) { + var i, nv, nn, nl = tinyMCE.getNodeTree(n, new Array(), 3); + var r1, r2, r3, r4, r5, w = ''; + var re = TinyMCE_SpellCheckerPlugin._getWordSeparators(); + + for (i=0; i$1$2'); + nv = nv.replace(r3, '$1$2'); + + nn = doc.createElement('span'); + nn.className = "mceItemHidden"; + nn.innerHTML = nv; + + // Remove old text node + nl[i].parentNode.replaceChild(nn, nl[i]); + } + } + }, + + _buildMenu : function(sg, max) { + var i, self = TinyMCE_SpellCheckerPlugin, cm = self._contextMenu; + + cm.clear(); + + if (sg != null) { + cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug', '', true)); + + for (i=0; i'; - die; - } - - // Basic config - $defaultLanguage = $spellCheckerConfig['default.language']; - $defaultMode = $spellCheckerConfig['default.mode']; - - // Normaly not required to configure - $defaultSpelling = $spellCheckerConfig['default.spelling']; - $defaultJargon = $spellCheckerConfig['default.jargon']; - $defaultEncoding = $spellCheckerConfig['default.encoding']; - $outputType = "xml"; // Do not change - - // Get input parameters. - - $check = $_POST['check']; - $cmd = sanitize($_POST['cmd']); - $lang = sanitize($_POST['lang'], "strict"); - $mode = sanitize($_POST['mode'], "strict"); - $spelling = sanitize($_POST['spelling'], "strict"); - $jargon = sanitize($_POST['jargon'], "strict"); - $encoding = sanitize($_POST['encoding'], "strict"); - $sg = sanitize($_POST['sg'], "bool"); - $words = array(); - - $validRequest = true; - - if (empty($check)) - $validRequest = false; - - if (empty($lang)) - $lang = $defaultLanguage; - - if (empty($mode)) - $mode = $defaultMode; - - if (empty($spelling)) - $spelling = $defaultSpelling; - - if (empty($jargon)) - $jargon = $defaultJargon; - - if (empty($encoding)) - $encoding = $defaultEncoding; - - function sanitize($str, $type="strict") { - switch ($type) { - case "strict": - $str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str); - break; - case "loose": - $str = preg_replace("//i", "<", $str); - break; - case "bool": - if ($str == "true" || $str == true) - $str = true; - else - $str = false; - break; - } - - return $str; - } - - $result = array(); - $tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding); - - if (count($tinyspell->errorMsg) == 0) { - switch($cmd) { - case "spell": - // Space for non-exec version and \n for the exec version. - $words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY); - $result = $tinyspell->checkWords($words); - break; - case "suggest": - $result = $tinyspell->getSuggestion($check); - break; - default: - // Just use this for now. - $tinyspell->errorMsg[] = "No command."; - $outputType = $outputType . "error"; - break; - } - } else - $outputType = $outputType . "error"; - - if (!$result) - $result = array(); - - // Output data - switch($outputType) { - case "xml": - header('Content-type: text/xml; charset=utf-8'); - echo ''; - echo "\n"; - if (count($result) == 0) - echo ''; - else - echo ''. utf8_encode(implode(" ", $result)) .''; - - break; - case "xmlerror"; - header('Content-type: text/xml; charset=utf-8'); - echo ''; - echo "\n"; - echo 'errorMsg) .'" />'; - break; - case "html": - var_dump($result); - break; - case "htmlerror": - echo "Error"; - break; - } -?> +'; + die; + } + + // Basic config + $defaultLanguage = $spellCheckerConfig['default.language']; + $defaultMode = $spellCheckerConfig['default.mode']; + + // Normaly not required to configure + $defaultSpelling = $spellCheckerConfig['default.spelling']; + $defaultJargon = $spellCheckerConfig['default.jargon']; + $defaultEncoding = $spellCheckerConfig['default.encoding']; + $outputType = "xml"; // Do not change + + // Get input parameters. + + $check = $_POST['check']; + $cmd = sanitize($_POST['cmd']); + $lang = sanitize($_POST['lang'], "strict"); + $mode = sanitize($_POST['mode'], "strict"); + $spelling = sanitize($_POST['spelling'], "strict"); + $jargon = sanitize($_POST['jargon'], "strict"); + $encoding = sanitize($_POST['encoding'], "strict"); + $sg = sanitize($_POST['sg'], "bool"); + $words = array(); + + $validRequest = true; + + if (empty($check)) + $validRequest = false; + + if (empty($lang)) + $lang = $defaultLanguage; + + if (empty($mode)) + $mode = $defaultMode; + + if (empty($spelling)) + $spelling = $defaultSpelling; + + if (empty($jargon)) + $jargon = $defaultJargon; + + if (empty($encoding)) + $encoding = $defaultEncoding; + + function sanitize($str, $type="strict") { + switch ($type) { + case "strict": + $str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str); + break; + case "loose": + $str = preg_replace("//i", "<", $str); + break; + case "bool": + if ($str == "true" || $str == true) + $str = true; + else + $str = false; + break; + } + + return $str; + } + + $result = array(); + $tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding); + + if (count($tinyspell->errorMsg) == 0) { + switch($cmd) { + case "spell": + // Space for non-exec version and \n for the exec version. + $words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY); + $result = $tinyspell->checkWords($words); + break; + case "suggest": + $result = $tinyspell->getSuggestion($check); + break; + default: + // Just use this for now. + $tinyspell->errorMsg[] = "No command."; + $outputType = $outputType . "error"; + break; + } + } else + $outputType = $outputType . "error"; + + if (!$result) + $result = array(); + + // Output data + switch($outputType) { + case "xml": + header('Content-type: text/xml; charset=utf-8'); + echo ''; + echo "\n"; + if (count($result) == 0) + echo ''; + else + echo ''. utf8_encode(implode(" ", $result)) .''; + + break; + case "xmlerror"; + header('Content-type: text/xml; charset=utf-8'); + echo ''; + echo "\n"; + echo 'errorMsg) .'" />'; + break; + case "html": + var_dump($result); + break; + case "htmlerror": + echo "Error"; + break; + } +?> diff --git a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js index f38e89d1db..0b12a92d4a 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js +++ b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js @@ -1,33 +1,33 @@ -// EN lang variables - -if (navigator.userAgent.indexOf('Mac OS') != -1) { -// Mac OS browsers use Ctrl to hit accesskeys - var metaKey = 'Ctrl'; -} -else { - var metaKey = 'Alt'; -} - -tinyMCE.addToLang('',{ -wordpress_more_button : 'Split post with More tag (' + metaKey + '+t)', -wordpress_page_button : 'Split post with Page tag', -wordpress_adv_button : 'Show/Hide Advanced Toolbar (' + metaKey + '+b)', -wordpress_more_alt : 'More...', -wordpress_page_alt : '...page...', -help_button_title : 'Help (' + metaKey + '+h)', -bold_desc : 'Bold (Ctrl+B)', -italic_desc : 'Italic (Ctrl+I)', -underline_desc : 'Underline (Ctrl+U)', -link_desc : 'Insert/edit link (' + metaKey + '+a)', -unlink_desc : 'Unlink (' + metaKey + '+s)', -image_desc : 'Insert/edit image (' + metaKey + '+m)', -striketrough_desc : 'Strikethrough (' + metaKey + '+k)', -justifyleft_desc : 'Align left (' + metaKey + '+f)', -justifycenter_desc : 'Align center (' + metaKey + '+c)', -justifyright_desc : 'Align right (' + metaKey + '+r)', -justifyfull_desc : 'Align full (' + metaKey + '+j)', -bullist_desc : 'Unordered list (' + metaKey + '+l)', -numlist_desc : 'Ordered list (' + metaKey + '+o)', -outdent_desc : 'Outdent (' + metaKey + '+w)', -indent_desc : 'Indent List/Blockquote (' + metaKey + '+q)' -}); +// EN lang variables + +if (navigator.userAgent.indexOf('Mac OS') != -1) { +// Mac OS browsers use Ctrl to hit accesskeys + var metaKey = 'Ctrl'; +} +else { + var metaKey = 'Alt'; +} + +tinyMCE.addToLang('',{ +wordpress_more_button : 'Split post with More tag (' + metaKey + '+t)', +wordpress_page_button : 'Split post with Page tag', +wordpress_adv_button : 'Show/Hide Advanced Toolbar (' + metaKey + '+b)', +wordpress_more_alt : 'More...', +wordpress_page_alt : '...page...', +help_button_title : 'Help (' + metaKey + '+h)', +bold_desc : 'Bold (Ctrl+B)', +italic_desc : 'Italic (Ctrl+I)', +underline_desc : 'Underline (Ctrl+U)', +link_desc : 'Insert/edit link (' + metaKey + '+a)', +unlink_desc : 'Unlink (' + metaKey + '+s)', +image_desc : 'Insert/edit image (' + metaKey + '+m)', +striketrough_desc : 'Strikethrough (' + metaKey + '+k)', +justifyleft_desc : 'Align left (' + metaKey + '+f)', +justifycenter_desc : 'Align center (' + metaKey + '+c)', +justifyright_desc : 'Align right (' + metaKey + '+r)', +justifyfull_desc : 'Align full (' + metaKey + '+j)', +bullist_desc : 'Unordered list (' + metaKey + '+l)', +numlist_desc : 'Ordered list (' + metaKey + '+o)', +outdent_desc : 'Outdent (' + metaKey + '+w)', +indent_desc : 'Indent List/Blockquote (' + metaKey + '+q)' +}); diff --git a/wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js b/wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js index 204e4471a8..da29521ccb 100644 --- a/wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js @@ -1,57 +1,57 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('wphelp', ''); - -function TinyMCE_wphelp_getControlHTML(control_name) { - switch (control_name) { - case "wphelp": - var titleHelp = tinyMCE.getLang('lang_help_button_title'); - var buttons = ''; - var hiddenControls = '
' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '
'; - return buttons+hiddenControls; - } - - return ""; -} - -function TinyMCE_wphelp_execCommand(editor_id, element, command, user_interface, value) { - - // Handle commands - switch (command) { - case "mceWordPressHelp": - var template = new Array(); - - template['file'] = tinyMCE.baseURL + '/wp-mce-help.php'; - template['width'] = 480; - template['height'] = 380; - - args = { - resizable : 'yes', - scrollbars : 'yes' - }; - - tinyMCE.openWindow(template, args); - return true; - } - - // Pass to next handler in chain - return false; -} +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('wphelp', ''); + +function TinyMCE_wphelp_getControlHTML(control_name) { + switch (control_name) { + case "wphelp": + var titleHelp = tinyMCE.getLang('lang_help_button_title'); + var buttons = ''; + var hiddenControls = '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
'; + return buttons+hiddenControls; + } + + return ""; +} + +function TinyMCE_wphelp_execCommand(editor_id, element, command, user_interface, value) { + + // Handle commands + switch (command) { + case "mceWordPressHelp": + var template = new Array(); + + template['file'] = tinyMCE.baseURL + '/wp-mce-help.php'; + template['width'] = 480; + template['height'] = 380; + + args = { + resizable : 'yes', + scrollbars : 'yes' + }; + + tinyMCE.openWindow(template, args); + return true; + } + + // Pass to next handler in chain + return false; +} diff --git a/wp-includes/js/tinymce/plugins/wphelp/langs/en.js b/wp-includes/js/tinymce/plugins/wphelp/langs/en.js index b7b2aba7ad..8c5b35ad86 100644 --- a/wp-includes/js/tinymce/plugins/wphelp/langs/en.js +++ b/wp-includes/js/tinymce/plugins/wphelp/langs/en.js @@ -1,5 +1,5 @@ -// EN lang variables - -tinyMCE.addToLang('',{ -help_button_title : 'Help (Alt+h)' -}); +// EN lang variables + +tinyMCE.addToLang('',{ +help_button_title : 'Help (Alt+h)' +}); diff --git a/wp-includes/js/tinymce/themes/advanced/langs/en.js b/wp-includes/js/tinymce/themes/advanced/langs/en.js index fd915ea415..602f1d29ef 100644 --- a/wp-includes/js/tinymce/themes/advanced/langs/en.js +++ b/wp-includes/js/tinymce/themes/advanced/langs/en.js @@ -1,82 +1,82 @@ -// UK lang variables - -tinyMCE.addToLang('',{ -theme_style_select : '-- Styles --', -theme_code_desc : 'Edit HTML Source', -theme_code_title : 'HTML Source Editor', -theme_code_wordwrap : 'Word wrap', -theme_sub_desc : 'Subscript', -theme_sup_desc : 'Superscript', -theme_hr_desc : 'Insert horizontal ruler', -theme_removeformat_desc : 'Remove formatting', -theme_custom1_desc : 'Your custom description here', -insert_image_border : 'Border', -insert_image_dimensions : 'Dimensions', -insert_image_vspace : 'Vertical space', -insert_image_hspace : 'Horizontal space', -insert_image_align : 'Alignment', -insert_image_align_default : '-- Not set --', -insert_image_align_baseline : 'Baseline', -insert_image_align_top : 'Top', -insert_image_align_middle : 'Middle', -insert_image_align_bottom : 'Bottom', -insert_image_align_texttop : 'TextTop', -insert_image_align_absmiddle : 'Absolute Middle', -insert_image_align_absbottom : 'Absolute Bottom', -insert_image_align_left : 'Left', -insert_image_align_right : 'Right', -theme_font_size : '-- Font size --', -theme_fontdefault : '-- Font family --', -theme_block : '-- Format --', -theme_paragraph : 'Paragraph', -theme_div : 'Div', -theme_address : 'Address', -theme_pre : 'Preformatted', -theme_h1 : 'Heading 1', -theme_h2 : 'Heading 2', -theme_h3 : 'Heading 3', -theme_h4 : 'Heading 4', -theme_h5 : 'Heading 5', -theme_h6 : 'Heading 6', -theme_blockquote : 'Blockquote', -theme_code : 'Code', -theme_samp : 'Code sample', -theme_dt : 'Definition term ', -theme_dd : 'Definition description', -theme_colorpicker_title : 'Select a color', -theme_colorpicker_apply : 'Apply', -theme_forecolor_desc : 'Select text color', -theme_backcolor_desc : 'Select background color', -theme_charmap_title : 'Select custom character', -theme_charmap_desc : 'Insert custom character', -theme_visualaid_desc : 'Toggle guidelines/invisible elements', -insert_anchor_title : 'Insert/edit anchor', -insert_anchor_name : 'Anchor name', -theme_anchor_desc : 'Insert/edit anchor', -theme_insert_link_titlefield : 'Title', -theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', -theme_path : 'Path', -cut_desc : 'Cut', -copy_desc : 'Copy', -paste_desc : 'Paste', -link_list : 'Link list', -image_list : 'Image list', -browse : 'Browse', -image_props_desc : 'Image properties', -newdocument_desc : 'New document', -class_name : 'Class', -newdocument : 'Are you sure you want clear all contents?', -about_title : 'About TinyMCE', -about : 'About', -license : 'License', -plugins : 'Plugins', -plugin : 'Plugin', -author : 'Author', -version : 'Version', -loaded_plugins : 'Loaded plugins', -help : 'Help', -not_set : '-- Not set --', -close : 'Close', -toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X', -invalid_data : 'Error: Invalid values entered, these are marked in red.' -}); +// UK lang variables + +tinyMCE.addToLang('',{ +theme_style_select : '-- Styles --', +theme_code_desc : 'Edit HTML Source', +theme_code_title : 'HTML Source Editor', +theme_code_wordwrap : 'Word wrap', +theme_sub_desc : 'Subscript', +theme_sup_desc : 'Superscript', +theme_hr_desc : 'Insert horizontal ruler', +theme_removeformat_desc : 'Remove formatting', +theme_custom1_desc : 'Your custom description here', +insert_image_border : 'Border', +insert_image_dimensions : 'Dimensions', +insert_image_vspace : 'Vertical space', +insert_image_hspace : 'Horizontal space', +insert_image_align : 'Alignment', +insert_image_align_default : '-- Not set --', +insert_image_align_baseline : 'Baseline', +insert_image_align_top : 'Top', +insert_image_align_middle : 'Middle', +insert_image_align_bottom : 'Bottom', +insert_image_align_texttop : 'TextTop', +insert_image_align_absmiddle : 'Absolute Middle', +insert_image_align_absbottom : 'Absolute Bottom', +insert_image_align_left : 'Left', +insert_image_align_right : 'Right', +theme_font_size : '-- Font size --', +theme_fontdefault : '-- Font family --', +theme_block : '-- Format --', +theme_paragraph : 'Paragraph', +theme_div : 'Div', +theme_address : 'Address', +theme_pre : 'Preformatted', +theme_h1 : 'Heading 1', +theme_h2 : 'Heading 2', +theme_h3 : 'Heading 3', +theme_h4 : 'Heading 4', +theme_h5 : 'Heading 5', +theme_h6 : 'Heading 6', +theme_blockquote : 'Blockquote', +theme_code : 'Code', +theme_samp : 'Code sample', +theme_dt : 'Definition term ', +theme_dd : 'Definition description', +theme_colorpicker_title : 'Select a color', +theme_colorpicker_apply : 'Apply', +theme_forecolor_desc : 'Select text color', +theme_backcolor_desc : 'Select background color', +theme_charmap_title : 'Select custom character', +theme_charmap_desc : 'Insert custom character', +theme_visualaid_desc : 'Toggle guidelines/invisible elements', +insert_anchor_title : 'Insert/edit anchor', +insert_anchor_name : 'Anchor name', +theme_anchor_desc : 'Insert/edit anchor', +theme_insert_link_titlefield : 'Title', +theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?', +theme_path : 'Path', +cut_desc : 'Cut', +copy_desc : 'Copy', +paste_desc : 'Paste', +link_list : 'Link list', +image_list : 'Image list', +browse : 'Browse', +image_props_desc : 'Image properties', +newdocument_desc : 'New document', +class_name : 'Class', +newdocument : 'Are you sure you want clear all contents?', +about_title : 'About TinyMCE', +about : 'About', +license : 'License', +plugins : 'Plugins', +plugin : 'Plugin', +author : 'Author', +version : 'Version', +loaded_plugins : 'Loaded plugins', +help : 'Help', +not_set : '-- Not set --', +close : 'Close', +toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X', +invalid_data : 'Error: Invalid values entered, these are marked in red.' +}); diff --git a/wp-includes/js/tinymce/utils/form_utils.js b/wp-includes/js/tinymce/utils/form_utils.js index c502943d20..66a3ce046d 100644 --- a/wp-includes/js/tinymce/utils/form_utils.js +++ b/wp-includes/js/tinymce/utils/form_utils.js @@ -1,210 +1,210 @@ -/** - * $Id: form_utils.js 43 2006-08-08 16:10:07Z spocke $ - * - * Various form utilitiy functions. - * - * @author Moxiecode - * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. - */ - -var themeBaseURL = tinyMCE.baseURL + '/themes/' + tinyMCE.getParam("theme"); - -function getColorPickerHTML(id, target_form_element) { - var h = ""; - - h += ''; - h += ''; - - return h; -} - -function pickColor(e, target_form_element) { - if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown") - tinyMCEPopup.pickColor(e, target_form_element); -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCE.switchClass(img, 'mceButtonDisabled', true); - } else { - lnk.setAttribute("href", lnk.getAttribute("realhref")); - tinyMCE.switchClass(img, 'mceButtonNormal', false); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback"; - var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback")); - if (cb == null) - return ""; - - var html = ""; - - html += ''; - html += ''; - - return html; -} - -function openBrower(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i'; + h += ''; + + return h; +} + +function pickColor(e, target_form_element) { + if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown") + tinyMCEPopup.pickColor(e, target_form_element); +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCE.switchClass(img, 'mceButtonDisabled', true); + } else { + lnk.setAttribute("href", lnk.getAttribute("realhref")); + tinyMCE.switchClass(img, 'mceButtonNormal', false); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback"; + var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback")); + if (cb == null) + return ""; + + var html = ""; + + html += ''; + html += ''; + + return html; +} + +function openBrower(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i x && mx < x + w && my > y && my < y + h)) { - MCLayer.visibleLayer = null; - - if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my)) - return true; - - l.hide(); - } - } - }, - - addCSSClass : function(e, c) { - this.removeCSSClass(e, c); - var a = this.explode(' ', e.className); - a[a.length] = c; - e.className = a.join(' '); - }, - - removeCSSClass : function(e, c) { - var a = this.explode(' ', e.className), i; - - for (i=0; i x && mx < x + w && my > y && my < y + h)) { + MCLayer.visibleLayer = null; + + if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my)) + return true; + + l.hide(); + } + } + }, + + addCSSClass : function(e, c) { + this.removeCSSClass(e, c); + var a = this.explode(' ', e.className); + a[a.length] = c; + e.className = a.join(' '); + }, + + removeCSSClass : function(e, c) { + var a = this.explode(' ', e.className), i; + + for (i=0; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i