Version Description
Download this release
Release Info
Developer | azaozz |
Plugin | TinyMCE Advanced |
Version | 1.0 |
Comparing to | |
See all releases |
Version 1.0
- readme.txt +73 -0
- tinymce-advanced/tinymce-advanced.php +74 -0
- tinymce-advanced/tinymce.css +23 -0
- upload_to_tinymce_directory/plugins/advhr/css/advhr.css +23 -0
- upload_to_tinymce_directory/plugins/advhr/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/advhr/editor_plugin_src.js +90 -0
- upload_to_tinymce_directory/plugins/advhr/images/advhr.gif +0 -0
- upload_to_tinymce_directory/plugins/advhr/jscripts/rule.js +43 -0
- upload_to_tinymce_directory/plugins/advhr/langs/en.js +8 -0
- upload_to_tinymce_directory/plugins/advhr/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/advhr/rule.htm +61 -0
- upload_to_tinymce_directory/plugins/advimage/css/advimage.css +66 -0
- upload_to_tinymce_directory/plugins/advimage/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/advimage/editor_plugin_src.js +148 -0
- upload_to_tinymce_directory/plugins/advimage/image.htm +241 -0
- upload_to_tinymce_directory/plugins/advimage/images/sample.gif +0 -0
- upload_to_tinymce_directory/plugins/advimage/jscripts/functions.js +538 -0
- upload_to_tinymce_directory/plugins/advimage/langs/en.js +27 -0
- upload_to_tinymce_directory/plugins/advimage/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/advlink/css/advlink.css +35 -0
- upload_to_tinymce_directory/plugins/advlink/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/advlink/editor_plugin_src.js +83 -0
- upload_to_tinymce_directory/plugins/advlink/jscripts/functions.js +587 -0
- upload_to_tinymce_directory/plugins/advlink/langs/en.js +46 -0
- upload_to_tinymce_directory/plugins/advlink/link.htm +338 -0
- upload_to_tinymce_directory/plugins/advlink/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/contextmenu/css/contextmenu.css +74 -0
- upload_to_tinymce_directory/plugins/contextmenu/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/contextmenu/editor_plugin_src.js +360 -0
- upload_to_tinymce_directory/plugins/contextmenu/images/spacer.gif +0 -0
- upload_to_tinymce_directory/plugins/contextmenu/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/fullscreen/css/page.css +21 -0
- upload_to_tinymce_directory/plugins/fullscreen/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/fullscreen/editor_plugin_src.js +230 -0
- upload_to_tinymce_directory/plugins/fullscreen/fullscreen.htm +91 -0
- upload_to_tinymce_directory/plugins/fullscreen/images/fullscreen.gif +0 -0
- upload_to_tinymce_directory/plugins/fullscreen/langs/en.js +5 -0
- upload_to_tinymce_directory/plugins/fullscreen/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/inlinepopups/css/inlinepopup.css +69 -0
- upload_to_tinymce_directory/plugins/inlinepopups/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/inlinepopups/editor_plugin_src.js +819 -0
- upload_to_tinymce_directory/plugins/inlinepopups/images/spacer.gif +0 -0
- upload_to_tinymce_directory/plugins/inlinepopups/images/window_close.gif +0 -0
- upload_to_tinymce_directory/plugins/inlinepopups/images/window_maximize.gif +0 -0
- upload_to_tinymce_directory/plugins/inlinepopups/images/window_minimize.gif +0 -0
- upload_to_tinymce_directory/plugins/inlinepopups/images/window_resize.gif +0 -0
- upload_to_tinymce_directory/plugins/inlinepopups/jscripts/mcwindows.js +453 -0
- upload_to_tinymce_directory/plugins/layer/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/layer/editor_plugin_src.js +248 -0
- upload_to_tinymce_directory/plugins/layer/images/absolute.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/backward.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/forward.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/insert_layer.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/insertlayer.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/movebackward.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/images/moveforward.gif +0 -0
- upload_to_tinymce_directory/plugins/layer/langs/en.js +9 -0
- upload_to_tinymce_directory/plugins/layer/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/media/css/content.css +26 -0
- upload_to_tinymce_directory/plugins/media/css/media.css +68 -0
- upload_to_tinymce_directory/plugins/media/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/media/editor_plugin_src.js +435 -0
- upload_to_tinymce_directory/plugins/media/images/flash.gif +0 -0
- upload_to_tinymce_directory/plugins/media/images/media.gif +0 -0
- upload_to_tinymce_directory/plugins/media/images/quicktime.gif +0 -0
- upload_to_tinymce_directory/plugins/media/images/realmedia.gif +0 -0
- upload_to_tinymce_directory/plugins/media/images/shockwave.gif +0 -0
- upload_to_tinymce_directory/plugins/media/images/windowsmedia.gif +0 -0
- upload_to_tinymce_directory/plugins/media/jscripts/embed.js +73 -0
- upload_to_tinymce_directory/plugins/media/jscripts/media.js +590 -0
- upload_to_tinymce_directory/plugins/media/langs/en.js +94 -0
- upload_to_tinymce_directory/plugins/media/media.htm +723 -0
- upload_to_tinymce_directory/plugins/print/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/print/editor_plugin_src.js +47 -0
- upload_to_tinymce_directory/plugins/print/images/print.gif +0 -0
- upload_to_tinymce_directory/plugins/print/langs/en.js +5 -0
- upload_to_tinymce_directory/plugins/print/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/searchreplace/css/searchreplace.css +20 -0
- upload_to_tinymce_directory/plugins/searchreplace/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/searchreplace/editor_plugin_src.js +164 -0
- upload_to_tinymce_directory/plugins/searchreplace/images/replace.gif +0 -0
- upload_to_tinymce_directory/plugins/searchreplace/images/replace_all_button_bg.gif +0 -0
- upload_to_tinymce_directory/plugins/searchreplace/images/replace_button_bg.gif +0 -0
- upload_to_tinymce_directory/plugins/searchreplace/images/search.gif +0 -0
- upload_to_tinymce_directory/plugins/searchreplace/jscripts/searchreplace.js +85 -0
- upload_to_tinymce_directory/plugins/searchreplace/langs/en.js +21 -0
- upload_to_tinymce_directory/plugins/searchreplace/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/searchreplace/searchreplace.htm +104 -0
- upload_to_tinymce_directory/plugins/table/cell.htm +182 -0
- upload_to_tinymce_directory/plugins/table/css/cell.css +17 -0
- upload_to_tinymce_directory/plugins/table/css/row.css +25 -0
- upload_to_tinymce_directory/plugins/table/css/table.css +13 -0
- upload_to_tinymce_directory/plugins/table/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/table/editor_plugin_src.js +1073 -0
- upload_to_tinymce_directory/plugins/table/images/buttons.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_cell_props.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_delete.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_delete_col.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_delete_row.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_insert_col_after.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_insert_col_before.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_insert_row_after.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_insert_row_before.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_merge_cells.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_row_props.gif +0 -0
- upload_to_tinymce_directory/plugins/table/images/table_split_cells.gif +0 -0
- upload_to_tinymce_directory/plugins/table/jscripts/cell.js +249 -0
- upload_to_tinymce_directory/plugins/table/jscripts/merge_cells.js +24 -0
- upload_to_tinymce_directory/plugins/table/jscripts/row.js +200 -0
- upload_to_tinymce_directory/plugins/table/jscripts/table.js +364 -0
- upload_to_tinymce_directory/plugins/table/langs/en.js +79 -0
- upload_to_tinymce_directory/plugins/table/merge_cells.htm +38 -0
- upload_to_tinymce_directory/plugins/table/readme.txt +1 -0
- upload_to_tinymce_directory/plugins/table/row.htm +159 -0
- upload_to_tinymce_directory/plugins/table/table.htm +160 -0
- upload_to_tinymce_directory/plugins/visualchars/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/visualchars/editor_plugin_src.js +89 -0
- upload_to_tinymce_directory/plugins/visualchars/images/visualchars.gif +0 -0
- upload_to_tinymce_directory/plugins/visualchars/langs/en.js +5 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/abbr.htm +148 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/acronym.htm +148 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/attributes.htm +153 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/cite.htm +148 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/css/attributes.css +11 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/css/popup.css +46 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/css/xhtmlxtras.css +24 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/del.htm +169 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/editor_plugin.js +1 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/editor_plugin_src.js +199 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/abbr.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/acronym.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/attribs.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/cite.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/date_time.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/del.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/ins.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/images/remove_button_bg.gif +0 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/ins.htm +169 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/abbr.js +29 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/acronym.js +29 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/attributes.js +130 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/cite.js +29 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/del.js +54 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/element_common.js +241 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/ins.js +53 -0
- upload_to_tinymce_directory/plugins/xhtmlxtras/langs/en.js +42 -0
- upload_to_tinymce_directory/readme.txt +1 -0
- upload_to_tinymce_directory/themes/advanced/color_picker.htm +74 -0
- upload_to_tinymce_directory/themes/advanced/css/colorpicker.css +53 -0
- upload_to_tinymce_directory/themes/advanced/images/colors.jpg +0 -0
readme.txt
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== TinyMCE Advanced ===
|
2 |
+
Contributors: Andrew Ozz
|
3 |
+
Donate link:
|
4 |
+
Tags: wysiwyg, formatting, tinymce, write, edit, post
|
5 |
+
Requires at least: 2.2
|
6 |
+
Tested up to: 2.2
|
7 |
+
Stable tag: trunk
|
8 |
+
|
9 |
+
Enables most of the advanced features of TinyMCE, the WordPress WYSIWYG editor.
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
This plugin adds 12 plugins to TinyMCE: Advanced hr, Advanced Image, Advanced Link, Context Menu, Full Screen, Layer, Media, Print, Search and Replace, Table, Visual Characters and XHTML Extras. Together these plugins add over 30 new buttons to the toolbar, which is now two rows plus one hidden row.
|
14 |
+
|
15 |
+
= Some of the new features added by this plugin =
|
16 |
+
|
17 |
+
* Imports all CSS classes from the main theme�s stylesheet and add them to a drop-down list.
|
18 |
+
|
19 |
+
* Fullscreen mode.
|
20 |
+
|
21 |
+
* Support for making and editing tables.
|
22 |
+
|
23 |
+
* Much better (advanced) link and image dialogs that offer a lot of options.
|
24 |
+
|
25 |
+
* Search and Replace while editing.
|
26 |
+
|
27 |
+
* Some support for XHTML specific tags and for layers.
|
28 |
+
|
29 |
+
|
30 |
+
== Installation ==
|
31 |
+
|
32 |
+
1. Download.
|
33 |
+
|
34 |
+
2. Unzip.
|
35 |
+
|
36 |
+
3. Upload the *tinymce-advanced* folder to the plugins directory and *themes* and *plugins* folders to the TinyMCE�s directory at wp-includes/js/tinymce/.
|
37 |
+
|
38 |
+
4. Activate the plugin.
|
39 |
+
|
40 |
+
5. Try your new and improved wysiwyg editor (after clearing your browser cache).
|
41 |
+
|
42 |
+
|
43 |
+
== Frequently Asked Questions ==
|
44 |
+
|
45 |
+
= No styles are imported in the Styles drop-down menu. =
|
46 |
+
|
47 |
+
These styles (just the classes) are imported from your current themes style.css file. However some themes use @import to load the actual css file(s). Tiny does not follow these links for now. To make the classes appear, add their names to tinymce.css file in the plugin�s folder. You don�t need to copy the whole classes, just add the names, like that:
|
48 |
+
|
49 |
+
.something{}
|
50 |
+
|
51 |
+
.something_else{}
|
52 |
+
|
53 |
+
.my_class{}
|
54 |
+
|
55 |
+
.my_other_class{}
|
56 |
+
|
57 |
+
= I�ve just installed this plugin, but it doesn�t do anything. =
|
58 |
+
|
59 |
+
Log out of WordPress, clear your browser cache, quit and restart the browser and try again. If that does not work, check to see if you uploaded the tinymce plugins to the right directory - wp-includes/js/tinymce/plugins. You should see 19 subdirectories there named after the plugins.
|
60 |
+
|
61 |
+
= The Media plugin does not work. =
|
62 |
+
|
63 |
+
The Media plugin does not work right in IE6. It seems that it�s conflicting with some of the other js loaded when editing posts in WordPress. However it works nicely in both Firefox and Opera.
|
64 |
+
|
65 |
+
= I can see the menus in full screen mode in Firefox =
|
66 |
+
|
67 |
+
Just click "Save and continue editing" to refresh the window.
|
68 |
+
|
69 |
+
= Other questions? Screenshots? =
|
70 |
+
|
71 |
+
Please visit the homepage for [TinyMCE Advanced](http://www.laptoptips.ca/projects/tinymce-advanced/).
|
72 |
+
|
73 |
+
|
tinymce-advanced/tinymce-advanced.php
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: TinyMCE Advanced
|
4 |
+
Plugin URI: http://www.laptoptips.ca/
|
5 |
+
Description: Enables advanced features and plugins in TinyMCE.
|
6 |
+
Version: 1.0
|
7 |
+
Author: Andrew Ozz
|
8 |
+
Author URI: http://www.laptoptips.ca/
|
9 |
+
|
10 |
+
Released under the GPL, http://www.gnu.org/copyleft/gpl.html
|
11 |
+
|
12 |
+
This program is distributed in the hope that it will be useful,
|
13 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
+
GNU General Public License for more details.
|
16 |
+
*/
|
17 |
+
|
18 |
+
function tadv_mce_opt() {
|
19 |
+
?>
|
20 |
+
inline_styles : true,
|
21 |
+
paste_create_paragraphs : false,
|
22 |
+
paste_create_linebreaks: true,
|
23 |
+
paste_auto_cleanup_on_paste : true,
|
24 |
+
<?php
|
25 |
+
}
|
26 |
+
|
27 |
+
function tdav_css($de) {
|
28 |
+
$de = get_bloginfo( 'stylesheet_url' ) . ', ' . get_bloginfo( 'wpurl' ) . '/wp-content/plugins/tinymce-advanced/tinymce.css, ' . $de;
|
29 |
+
return $de;
|
30 |
+
}
|
31 |
+
|
32 |
+
function tadv_mce_plugins($plug) {
|
33 |
+
global $is_IE6;
|
34 |
+
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false )
|
35 |
+
$is_IE6 = true;
|
36 |
+
|
37 |
+
$tadv_plugins = array( 'advhr', 'contextmenu', 'print', 'visualchars', 'advimage', 'advlink', 'table', 'xhtmlxtras', 'nonbreaking', 'layer', 'searchreplace', 'fullscreen' );
|
38 |
+
|
39 |
+
if( ! $is_IE6 ) $tadv_plugins[] = 'media';
|
40 |
+
return array_merge($plug, $tadv_plugins);
|
41 |
+
}
|
42 |
+
|
43 |
+
function tadv_mce_btns($orig) {
|
44 |
+
global $extra_btns;
|
45 |
+
|
46 |
+
$tadv_btns1 = array( 'bold', 'italic', 'strikethrough', 'underline', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'separator', 'link', 'unlink', 'separator', 'image', 'wp_more', 'separator', 'spellchecker', 'separator', 'search', 'wp_help', 'print', 'separator', 'fullscreen' );
|
47 |
+
|
48 |
+
if( is_array($orig) && ! empty($orig) ) {
|
49 |
+
$extra_btns = array_diff( $orig, $tadv_btns1 );
|
50 |
+
}
|
51 |
+
return $tadv_btns1;
|
52 |
+
}
|
53 |
+
|
54 |
+
function tadv_mce_btns2() {
|
55 |
+
global $extra_btns, $is_IE6;
|
56 |
+
|
57 |
+
$tadv_btns2 = array('styleselect', 'formatselect', 'forecolor', 'separator', 'pastetext', 'pasteword', 'separator', 'removeformat', 'cleanup', 'separator', 'charmap', 'separator', 'separator', 'undo', 'redo', 'separator', 'wp_adv', 'wp_adv_start', 'tablecontrols', 'separator', 'cite', 'ins', 'del', 'abbr', 'acronym', 'attribs', 'separator', 'insertlayer', 'moveforward', 'movebackward', 'absolute', 'separator', 'advhr', 'wp_adv_end');
|
58 |
+
|
59 |
+
if( is_array($extra_btns) && ! empty($extra_btns) ) {
|
60 |
+
$extra_btns = array_diff( $extra_btns, $tadv_btns2 );
|
61 |
+
if( ! empty($extra_btns) )
|
62 |
+
$tadv_btns2 = $extra_btns + $tadv_btns2;
|
63 |
+
}
|
64 |
+
|
65 |
+
if( ! $is_IE6 ) array_unshift($tadv_btns2, 'media');
|
66 |
+
return $tadv_btns2;
|
67 |
+
}
|
68 |
+
|
69 |
+
add_filter('mce_css', 'tdav_css');
|
70 |
+
add_action('mce_options', 'tadv_mce_opt');
|
71 |
+
add_filter('mce_plugins', 'tadv_mce_plugins');
|
72 |
+
add_filter('mce_buttons', 'tadv_mce_btns');
|
73 |
+
add_filter('mce_buttons_2', 'tadv_mce_btns2');
|
74 |
+
?>
|
tinymce-advanced/tinymce.css
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
body {
|
3 |
+
color: #000000;
|
4 |
+
}
|
5 |
+
p {
|
6 |
+
text-align: left;
|
7 |
+
}
|
8 |
+
a {
|
9 |
+
color: blue;
|
10 |
+
}
|
11 |
+
ul, ol {
|
12 |
+
margin : 10px 0 10px 20px;
|
13 |
+
}
|
14 |
+
ul li {
|
15 |
+
list-style : disc;
|
16 |
+
}
|
17 |
+
ol li {
|
18 |
+
list-style : decimal;
|
19 |
+
}
|
20 |
+
ul li, ol li {
|
21 |
+
margin : 0.5em 0;
|
22 |
+
}
|
23 |
+
.shutter {}
|
upload_to_tinymce_directory/plugins/advhr/css/advhr.css
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
input.radio {
|
2 |
+
border: 1px none #000000;
|
3 |
+
background-color: transparent;
|
4 |
+
vertical-align: middle;
|
5 |
+
}
|
6 |
+
|
7 |
+
.panel_wrapper div.current {
|
8 |
+
height: 80px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#width {
|
12 |
+
width: 50px;
|
13 |
+
vertical-align: middle;
|
14 |
+
}
|
15 |
+
|
16 |
+
#width2 {
|
17 |
+
width: 50px;
|
18 |
+
vertical-align: middle;
|
19 |
+
}
|
20 |
+
|
21 |
+
#size {
|
22 |
+
width: 100px;
|
23 |
+
}
|
upload_to_tinymce_directory/plugins/advhr/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('advhr');var TinyMCE_AdvancedHRPlugin={getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"advhr":return tinyMCE.getButtonHTML(cn,'lang_insert_advhr_desc','{$pluginurl}/images/advhr.gif','mceAdvancedHr')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):""}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'})}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'<hr />')}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'})}}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="HR"){tinyMCE.switchClass(editor_id+'_advhr','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advhr','mceButtonNormal');return true}};tinyMCE.addPlugin("advhr",TinyMCE_AdvancedHRPlugin);
|
upload_to_tinymce_directory/plugins/advhr/editor_plugin_src.js
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('advhr');
|
10 |
+
|
11 |
+
var TinyMCE_AdvancedHRPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Advanced HR',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
}
|
20 |
+
},
|
21 |
+
|
22 |
+
getControlHTML : function(cn) {
|
23 |
+
switch (cn) {
|
24 |
+
case "advhr":
|
25 |
+
return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
|
26 |
+
}
|
27 |
+
|
28 |
+
return "";
|
29 |
+
},
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Executes the mceAdvanceHr command.
|
33 |
+
*/
|
34 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
35 |
+
// Handle commands
|
36 |
+
switch (command) {
|
37 |
+
case "mceAdvancedHr":
|
38 |
+
var template = new Array();
|
39 |
+
|
40 |
+
template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme
|
41 |
+
template['width'] = 250;
|
42 |
+
template['height'] = 160;
|
43 |
+
|
44 |
+
template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0);
|
45 |
+
template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
|
46 |
+
|
47 |
+
var size = "", width = "", noshade = "";
|
48 |
+
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
|
49 |
+
tinyMCE.hrElement = tinyMCE.selectedElement;
|
50 |
+
|
51 |
+
if (tinyMCE.hrElement) {
|
52 |
+
size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
|
53 |
+
width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
|
54 |
+
noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
|
55 |
+
}
|
56 |
+
|
57 |
+
tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
|
58 |
+
} else {
|
59 |
+
if (tinyMCE.isMSIE) {
|
60 |
+
tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
|
61 |
+
} else {
|
62 |
+
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
return true;
|
67 |
+
}
|
68 |
+
|
69 |
+
// Pass to next handler in chain
|
70 |
+
return false;
|
71 |
+
},
|
72 |
+
|
73 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
74 |
+
if (node == null)
|
75 |
+
return;
|
76 |
+
|
77 |
+
do {
|
78 |
+
if (node.nodeName == "HR") {
|
79 |
+
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
|
80 |
+
return true;
|
81 |
+
}
|
82 |
+
} while ((node = node.parentNode));
|
83 |
+
|
84 |
+
tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
|
85 |
+
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
};
|
89 |
+
|
90 |
+
tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);
|
upload_to_tinymce_directory/plugins/advhr/images/advhr.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/advhr/jscripts/rule.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function init() {
|
2 |
+
tinyMCEPopup.resizeToInnerSize();
|
3 |
+
|
4 |
+
var formObj = document.forms[0];
|
5 |
+
formObj.width.value = tinyMCE.getWindowArg('width');
|
6 |
+
formObj.size.value = tinyMCE.getWindowArg('size');
|
7 |
+
formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
|
8 |
+
if (tinyMCE.getWindowArg('noshade')) {
|
9 |
+
formObj.noshade.checked = true;
|
10 |
+
}
|
11 |
+
if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
|
12 |
+
formObj.width2.value = "%";
|
13 |
+
formObj.width.value = formObj.width.value.substring(0,formObj.width.value.length-1);
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
function insertHR() {
|
18 |
+
var formObj = document.forms[0];
|
19 |
+
var width = formObj.width.value;
|
20 |
+
var size = formObj.size.value;
|
21 |
+
var html = '<hr';
|
22 |
+
if (size!='' && size!=0) {
|
23 |
+
html += ' size="' + size + '"';
|
24 |
+
}
|
25 |
+
if (width!='' && width!=0) {
|
26 |
+
html += ' width="' + width;
|
27 |
+
if (formObj.width2.value=='%') {
|
28 |
+
html += '%';
|
29 |
+
}
|
30 |
+
html += '"';
|
31 |
+
}
|
32 |
+
if (formObj.noshade.checked==true) {
|
33 |
+
html += ' noshade="noshade"';
|
34 |
+
}
|
35 |
+
html += ' />';
|
36 |
+
|
37 |
+
tinyMCEPopup.execCommand("mceInsertContent", true, html);
|
38 |
+
tinyMCEPopup.close();
|
39 |
+
}
|
40 |
+
|
41 |
+
function cancelAction() {
|
42 |
+
tinyMCEPopup.close();
|
43 |
+
}
|
upload_to_tinymce_directory/plugins/advhr/langs/en.js
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('',{
|
4 |
+
insert_advhr_desc : 'Horizontale rule',
|
5 |
+
insert_advhr_width : 'Width',
|
6 |
+
insert_advhr_size : 'Height',
|
7 |
+
insert_advhr_noshade : 'No shadow'
|
8 |
+
});
|
upload_to_tinymce_directory/plugins/advhr/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/advhr/rule.htm
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_insert_advhr_desc}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="jscripts/rule.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
7 |
+
<link href="css/advhr.css" rel="stylesheet" type="text/css" />
|
8 |
+
<base target="_self" />
|
9 |
+
</head>
|
10 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');">
|
11 |
+
<form onsubmit="insertHR();return false;" action="#">
|
12 |
+
<div class="tabs">
|
13 |
+
<ul>
|
14 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_advhr_desc}</a></span></li>
|
15 |
+
</ul>
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<div class="panel_wrapper">
|
19 |
+
<div id="general_panel" class="panel current">
|
20 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
21 |
+
<tr>
|
22 |
+
<td><label for="width">{$lang_insert_advhr_width}</label></td>
|
23 |
+
<td nowrap="nowrap">
|
24 |
+
<input id="width" name="width" type="text" value="" />
|
25 |
+
<select name="width2" id="width2">
|
26 |
+
<option value="">px</option>
|
27 |
+
<option value="%">%</option>
|
28 |
+
</select>
|
29 |
+
</td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td><label for="size">{$lang_insert_advhr_size}</label></td>
|
33 |
+
<td><select id="size" name="size">
|
34 |
+
<option value="">Normal</option>
|
35 |
+
<option value="1">1</option>
|
36 |
+
<option value="2">2</option>
|
37 |
+
<option value="3">3</option>
|
38 |
+
<option value="4">4</option>
|
39 |
+
<option value="5">5</option>
|
40 |
+
</select></td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td><label for="noshade">{$lang_insert_advhr_noshade}</label></td>
|
44 |
+
<td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
|
45 |
+
</tr>
|
46 |
+
</table>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<div class="mceActionPanel">
|
51 |
+
<div style="float: left">
|
52 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertHR();" />
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<div style="float: right">
|
56 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</form>
|
60 |
+
</body>
|
61 |
+
</html>
|
upload_to_tinymce_directory/plugins/advimage/css/advimage.css
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for advimage plugin popup */
|
2 |
+
|
3 |
+
.mceImageList {
|
4 |
+
width: 280px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.mceActionPanel {
|
8 |
+
margin-top: 7px;
|
9 |
+
}
|
10 |
+
|
11 |
+
.alignPreview {
|
12 |
+
border: 1px solid black;
|
13 |
+
width: 140px;
|
14 |
+
height: 140px;
|
15 |
+
overflow: hidden;
|
16 |
+
padding: 5px;
|
17 |
+
}
|
18 |
+
|
19 |
+
.checkbox {
|
20 |
+
border: 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
.panel_wrapper div.current {
|
24 |
+
height: 305px;
|
25 |
+
}
|
26 |
+
|
27 |
+
#prev {
|
28 |
+
margin: 0;
|
29 |
+
border: 1px
|
30 |
+
solid black;
|
31 |
+
width: 99%;
|
32 |
+
height: 150px;
|
33 |
+
overflow: auto;
|
34 |
+
}
|
35 |
+
|
36 |
+
#align, #classlist {
|
37 |
+
width: 150px;
|
38 |
+
}
|
39 |
+
|
40 |
+
#width, #height {
|
41 |
+
vertical-align: middle;
|
42 |
+
width: 50px;
|
43 |
+
text-align: center;
|
44 |
+
}
|
45 |
+
|
46 |
+
#vspace, #hspace, #border {
|
47 |
+
vertical-align: middle;
|
48 |
+
width: 30px;
|
49 |
+
text-align: center;
|
50 |
+
}
|
51 |
+
|
52 |
+
#classlist {
|
53 |
+
width: 180px;
|
54 |
+
}
|
55 |
+
|
56 |
+
input {
|
57 |
+
width: 280px;
|
58 |
+
}
|
59 |
+
|
60 |
+
#constrain, #onmousemovecheck {
|
61 |
+
width: auto;
|
62 |
+
}
|
63 |
+
|
64 |
+
#id, #dir, #lang, #usemap, #longdesc {
|
65 |
+
width: 200px;
|
66 |
+
}
|
upload_to_tinymce_directory/plugins/advimage/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('advimage');var TinyMCE_AdvancedImagePlugin={getInfo:function(){return{longname:'Advanced image',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"image":return tinyMCE.getButtonHTML(cn,'lang_image_desc','{$themeurl}/images/image.gif','mceAdvImage')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvImage":var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_advimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_advimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1)return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":var imgs=content.getElementsByTagName("img"),src,i;for(i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){var onmouseover=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseover'));var onmouseout=tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i],'onmouseout'));if((src=this._getImageSrc(onmouseover))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseover',"this.src='"+src+"';")}if((src=this._getImageSrc(onmouseout))!=""){if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('onmouseout',"this.src='"+src+"';")}}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItem')==-1){tinyMCE.switchClass(editor_id+'_advimage','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advimage','mceButtonNormal');return true},_getImageSrc:function(s){var sr,p=-1;if(!s)return"";if((p=s.indexOf('this.src='))!=-1){sr=s.substring(p+10);sr=sr.substring(0,sr.indexOf('\''));return sr}return""}};tinyMCE.addPlugin("advimage",TinyMCE_AdvancedImagePlugin);
|
upload_to_tinymce_directory/plugins/advimage/editor_plugin_src.js
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('advimage');
|
10 |
+
|
11 |
+
var TinyMCE_AdvancedImagePlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Advanced image',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
getControlHTML : function(cn) {
|
23 |
+
switch (cn) {
|
24 |
+
case "image":
|
25 |
+
return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceAdvImage');
|
26 |
+
}
|
27 |
+
|
28 |
+
return "";
|
29 |
+
},
|
30 |
+
|
31 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
32 |
+
switch (command) {
|
33 |
+
case "mceAdvImage":
|
34 |
+
var template = new Array();
|
35 |
+
|
36 |
+
template['file'] = '../../plugins/advimage/image.htm';
|
37 |
+
template['width'] = 480;
|
38 |
+
template['height'] = 380;
|
39 |
+
|
40 |
+
// Language specific width and height addons
|
41 |
+
template['width'] += tinyMCE.getLang('lang_advimage_delta_width', 0);
|
42 |
+
template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);
|
43 |
+
|
44 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
45 |
+
var elm = inst.getFocusElement();
|
46 |
+
|
47 |
+
if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
|
48 |
+
return true;
|
49 |
+
|
50 |
+
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
51 |
+
|
52 |
+
return true;
|
53 |
+
}
|
54 |
+
|
55 |
+
return false;
|
56 |
+
},
|
57 |
+
|
58 |
+
cleanup : function(type, content) {
|
59 |
+
switch (type) {
|
60 |
+
case "insert_to_editor_dom":
|
61 |
+
var imgs = content.getElementsByTagName("img"), src, i;
|
62 |
+
for (i=0; i<imgs.length; i++) {
|
63 |
+
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
|
64 |
+
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
|
65 |
+
|
66 |
+
if ((src = this._getImageSrc(onmouseover)) != "") {
|
67 |
+
if (tinyMCE.getParam('convert_urls'))
|
68 |
+
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
69 |
+
|
70 |
+
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
|
71 |
+
}
|
72 |
+
|
73 |
+
if ((src = this._getImageSrc(onmouseout)) != "") {
|
74 |
+
if (tinyMCE.getParam('convert_urls'))
|
75 |
+
src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
76 |
+
|
77 |
+
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
|
78 |
+
}
|
79 |
+
}
|
80 |
+
break;
|
81 |
+
|
82 |
+
case "get_from_editor_dom":
|
83 |
+
var imgs = content.getElementsByTagName("img");
|
84 |
+
for (var i=0; i<imgs.length; i++) {
|
85 |
+
var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
|
86 |
+
var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
|
87 |
+
|
88 |
+
if ((src = this._getImageSrc(onmouseover)) != "") {
|
89 |
+
if (tinyMCE.getParam('convert_urls'))
|
90 |
+
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
91 |
+
|
92 |
+
imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
|
93 |
+
}
|
94 |
+
|
95 |
+
if ((src = this._getImageSrc(onmouseout)) != "") {
|
96 |
+
if (tinyMCE.getParam('convert_urls'))
|
97 |
+
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
|
98 |
+
|
99 |
+
imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
|
100 |
+
}
|
101 |
+
}
|
102 |
+
break;
|
103 |
+
}
|
104 |
+
|
105 |
+
return content;
|
106 |
+
},
|
107 |
+
|
108 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
109 |
+
if (node == null)
|
110 |
+
return;
|
111 |
+
|
112 |
+
do {
|
113 |
+
if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
114 |
+
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonSelected');
|
115 |
+
return true;
|
116 |
+
}
|
117 |
+
} while ((node = node.parentNode));
|
118 |
+
|
119 |
+
tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonNormal');
|
120 |
+
|
121 |
+
return true;
|
122 |
+
},
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Returns the image src from a scripted mouse over image str.
|
126 |
+
*
|
127 |
+
* @param {string} s String to get real src from.
|
128 |
+
* @return Image src from a scripted mouse over image str.
|
129 |
+
* @type string
|
130 |
+
*/
|
131 |
+
_getImageSrc : function(s) {
|
132 |
+
var sr, p = -1;
|
133 |
+
|
134 |
+
if (!s)
|
135 |
+
return "";
|
136 |
+
|
137 |
+
if ((p = s.indexOf('this.src=')) != -1) {
|
138 |
+
sr = s.substring(p + 10);
|
139 |
+
sr = sr.substring(0, sr.indexOf('\''));
|
140 |
+
|
141 |
+
return sr;
|
142 |
+
}
|
143 |
+
|
144 |
+
return "";
|
145 |
+
}
|
146 |
+
};
|
147 |
+
|
148 |
+
tinyMCE.addPlugin("advimage", TinyMCE_AdvancedImagePlugin);
|
upload_to_tinymce_directory/plugins/advimage/image.htm
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_insert_image_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
9 |
+
<link href="css/advimage.css" rel="stylesheet" type="text/css" />
|
10 |
+
<base target="_self" />
|
11 |
+
</head>
|
12 |
+
<body id="advimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
13 |
+
<form onsubmit="insertAction();return false;" action="#">
|
14 |
+
<div class="tabs">
|
15 |
+
<ul>
|
16 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advimage_tab_general}</a></span></li>
|
17 |
+
<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_advimage_tab_appearance}</a></span></li>
|
18 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advimage_tab_advanced}</a></span></li>
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_advimage_general}</legend>
|
26 |
+
|
27 |
+
<table class="properties">
|
28 |
+
<tr>
|
29 |
+
<td class="column1"><label id="srclabel" for="src">{$lang_insert_image_src}</label></td>
|
30 |
+
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
|
31 |
+
<tr>
|
32 |
+
<td><input name="src" type="text" id="src" value="" onchange="showPreviewImage(this.value);" /></td>
|
33 |
+
<td id="srcbrowsercontainer"> </td>
|
34 |
+
</tr>
|
35 |
+
</table></td>
|
36 |
+
</tr>
|
37 |
+
<tr id="imagelistsrcrow">
|
38 |
+
<td class="column1"><label for="imagelistsrc">{$lang_image_list}</label></td>
|
39 |
+
<td colspan="2" id="imagelistsrccontainer"> </td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<td class="column1"><label id="altlabel" for="alt">{$lang_insert_image_alt}</label></td>
|
43 |
+
<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td>
|
44 |
+
</tr>
|
45 |
+
<tr>
|
46 |
+
<td class="column1"><label id="titlelabel" for="title">{$lang_advimage_title}</label></td>
|
47 |
+
<td colspan="2"><input id="title" name="title" type="text" value="" /></td>
|
48 |
+
</tr>
|
49 |
+
</table>
|
50 |
+
</fieldset>
|
51 |
+
|
52 |
+
<fieldset>
|
53 |
+
<legend>{$lang_advimage_preview}</legend>
|
54 |
+
<div id="prev"></div>
|
55 |
+
</fieldset>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div id="appearance_panel" class="panel">
|
59 |
+
<fieldset>
|
60 |
+
<legend>{$lang_advimage_tab_appearance}</legend>
|
61 |
+
|
62 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
63 |
+
<tr>
|
64 |
+
<td class="column1"><label id="alignlabel" for="align">{$lang_insert_image_align}</label></td>
|
65 |
+
<td><select id="align" name="align" onchange="changeAppearance();">
|
66 |
+
<option value="">{$lang_insert_image_align_default}</option>
|
67 |
+
<option value="baseline">{$lang_insert_image_align_baseline}</option>
|
68 |
+
<option value="top">{$lang_insert_image_align_top}</option>
|
69 |
+
<option value="middle">{$lang_insert_image_align_middle}</option>
|
70 |
+
<option value="bottom">{$lang_insert_image_align_bottom}</option>
|
71 |
+
<option value="texttop">{$lang_insert_image_align_texttop}</option>
|
72 |
+
<option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
|
73 |
+
<option value="absbottom">{$lang_insert_image_align_absbottom}</option>
|
74 |
+
<option value="left">{$lang_insert_image_align_left}</option>
|
75 |
+
<option value="right">{$lang_insert_image_align_right}</option>
|
76 |
+
</select>
|
77 |
+
</td>
|
78 |
+
<td rowspan="6" valign="top">
|
79 |
+
<div class="alignPreview">
|
80 |
+
<img id="alignSampleImg" src="images/sample.gif" alt="{$lang_advimage_example_img}" />
|
81 |
+
Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
|
82 |
+
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
|
83 |
+
edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
|
84 |
+
erat volutpat.
|
85 |
+
</div>
|
86 |
+
</td>
|
87 |
+
</tr>
|
88 |
+
|
89 |
+
<tr>
|
90 |
+
<td class="column1"><label id="widthlabel" for="width">{$lang_insert_image_dimensions}</label></td>
|
91 |
+
<td nowrap="nowrap">
|
92 |
+
<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="changeHeight();" /> x
|
93 |
+
<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="changeWidth();" /> px
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
|
97 |
+
<tr>
|
98 |
+
<td> </td>
|
99 |
+
<td><table border="0" cellpadding="0" cellspacing="0">
|
100 |
+
<tr>
|
101 |
+
<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
102 |
+
<td><label id="constrainlabel" for="constrain">{$lang_advimage_constrain_proportions}</label></td>
|
103 |
+
</tr>
|
104 |
+
</table></td>
|
105 |
+
</tr>
|
106 |
+
|
107 |
+
<tr>
|
108 |
+
<td class="column1"><label id="vspacelabel" for="vspace">{$lang_insert_image_vspace}</label></td>
|
109 |
+
<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" />
|
110 |
+
</td>
|
111 |
+
</tr>
|
112 |
+
|
113 |
+
<tr>
|
114 |
+
<td class="column1"><label id="hspacelabel" for="hspace">{$lang_insert_image_hspace}</label></td>
|
115 |
+
<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td>
|
116 |
+
</tr>
|
117 |
+
|
118 |
+
<tr>
|
119 |
+
<td class="column1"><label id="borderlabel" for="border">{$lang_insert_image_border}</label></td>
|
120 |
+
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td>
|
121 |
+
</tr>
|
122 |
+
|
123 |
+
<tr>
|
124 |
+
<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
|
125 |
+
<td colspan="2">
|
126 |
+
<select id="classlist" name="classlist">
|
127 |
+
<option value="" selected>{$lang_not_set}</option>
|
128 |
+
</select>
|
129 |
+
</td>
|
130 |
+
</tr>
|
131 |
+
|
132 |
+
<tr>
|
133 |
+
<td class="column1"><label id="stylelabel" for="style">{$lang_advimage_style}</label></td>
|
134 |
+
<td colspan="2"><input id="style" name="style" type="text" value="" onchange="styleUpdated();" /></td>
|
135 |
+
</tr>
|
136 |
+
|
137 |
+
<!-- <tr>
|
138 |
+
<td class="column1"><label id="classeslabel" for="classes">{$lang_advimage_classes}</label></td>
|
139 |
+
<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
140 |
+
</tr> -->
|
141 |
+
</table>
|
142 |
+
</fieldset>
|
143 |
+
</div>
|
144 |
+
|
145 |
+
<div id="advanced_panel" class="panel">
|
146 |
+
<fieldset>
|
147 |
+
<legend>{$lang_advimage_swap_image}</legend>
|
148 |
+
|
149 |
+
<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="changeMouseMove();" />
|
150 |
+
<label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_advimage_alt_image}</label>
|
151 |
+
|
152 |
+
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
153 |
+
<tr>
|
154 |
+
<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_advimage_mouseover}</label></td>
|
155 |
+
<td><table border="0" cellspacing="0" cellpadding="0">
|
156 |
+
<tr>
|
157 |
+
<td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td>
|
158 |
+
<td id="onmouseoversrccontainer"> </td>
|
159 |
+
</tr>
|
160 |
+
</table></td>
|
161 |
+
</tr>
|
162 |
+
<tr id="imagelistoverrow">
|
163 |
+
<td class="column1"><label for="imagelistover">{$lang_image_list}</label></td>
|
164 |
+
<td id="imagelistovercontainer"> </td>
|
165 |
+
</tr>
|
166 |
+
<tr>
|
167 |
+
<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_advimage_mouseout}</label></td>
|
168 |
+
<td class="column2"><table border="0" cellspacing="0" cellpadding="0">
|
169 |
+
<tr>
|
170 |
+
<td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td>
|
171 |
+
<td id="onmouseoutsrccontainer"> </td>
|
172 |
+
</tr>
|
173 |
+
</table></td>
|
174 |
+
</tr>
|
175 |
+
<tr id="imagelistoutrow">
|
176 |
+
<td class="column1"><label for="imagelistout">{$lang_image_list}</label></td>
|
177 |
+
<td id="imagelistoutcontainer"> </td>
|
178 |
+
</tr>
|
179 |
+
</table>
|
180 |
+
</fieldset>
|
181 |
+
|
182 |
+
<fieldset>
|
183 |
+
<legend>{$lang_advimage_misc}</legend>
|
184 |
+
|
185 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
186 |
+
<tr>
|
187 |
+
<td class="column1"><label id="idlabel" for="id">{$lang_advimage_id}</label></td>
|
188 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
189 |
+
</tr>
|
190 |
+
|
191 |
+
<tr>
|
192 |
+
<td class="column1"><label id="dirlabel" for="dir">{$lang_advimage_langdir}</label></td>
|
193 |
+
<td>
|
194 |
+
<select id="dir" name="dir" onchange="changeAppearance();">
|
195 |
+
<option value="">{$lang_not_set}</option>
|
196 |
+
<option value="ltr">{$lang_advimage_ltr}</option>
|
197 |
+
<option value="rtl">{$lang_advimage_rtl}</option>
|
198 |
+
</select>
|
199 |
+
</td>
|
200 |
+
</tr>
|
201 |
+
|
202 |
+
<tr>
|
203 |
+
<td class="column1"><label id="langlabel" for="lang">{$lang_advimage_langcode}</label></td>
|
204 |
+
<td>
|
205 |
+
<input id="lang" name="lang" type="text" value="" />
|
206 |
+
</td>
|
207 |
+
</tr>
|
208 |
+
|
209 |
+
<tr>
|
210 |
+
<td class="column1"><label id="usemaplabel" for="usemap">{$lang_advimage_image_map}</label></td>
|
211 |
+
<td>
|
212 |
+
<input id="usemap" name="usemap" type="text" value="" />
|
213 |
+
</td>
|
214 |
+
</tr>
|
215 |
+
|
216 |
+
<tr>
|
217 |
+
<td class="column1"><label id="longdesclabel" for="longdesc">{$lang_advimage_long_desc}</label></td>
|
218 |
+
<td><table border="0" cellspacing="0" cellpadding="0">
|
219 |
+
<tr>
|
220 |
+
<td><input id="longdesc" name="longdesc" type="text" value="" /></td>
|
221 |
+
<td id="longdesccontainer"> </td>
|
222 |
+
</tr>
|
223 |
+
</table></td>
|
224 |
+
</tr>
|
225 |
+
</table>
|
226 |
+
</fieldset>
|
227 |
+
</div>
|
228 |
+
</div>
|
229 |
+
|
230 |
+
<div class="mceActionPanel">
|
231 |
+
<div style="float: left">
|
232 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
|
233 |
+
</div>
|
234 |
+
|
235 |
+
<div style="float: right">
|
236 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" />
|
237 |
+
</div>
|
238 |
+
</div>
|
239 |
+
</form>
|
240 |
+
</body>
|
241 |
+
</html>
|
upload_to_tinymce_directory/plugins/advimage/images/sample.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/advimage/jscripts/functions.js
ADDED
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Functions for the advimage plugin popup */
|
2 |
+
|
3 |
+
var preloadImg = null;
|
4 |
+
var orgImageWidth, orgImageHeight;
|
5 |
+
|
6 |
+
function preinit() {
|
7 |
+
// Initialize
|
8 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
9 |
+
|
10 |
+
// Import external list url javascript
|
11 |
+
var url = tinyMCE.getParam("external_image_list_url");
|
12 |
+
if (url != null) {
|
13 |
+
// Fix relative
|
14 |
+
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
15 |
+
url = tinyMCE.documentBasePath + "/" + url;
|
16 |
+
|
17 |
+
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function convertURL(url, node, on_save) {
|
22 |
+
return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
|
23 |
+
}
|
24 |
+
|
25 |
+
function getImageSrc(str) {
|
26 |
+
var pos = -1;
|
27 |
+
|
28 |
+
if (!str)
|
29 |
+
return "";
|
30 |
+
|
31 |
+
if ((pos = str.indexOf('this.src=')) != -1) {
|
32 |
+
var src = str.substring(pos + 10);
|
33 |
+
|
34 |
+
src = src.substring(0, src.indexOf('\''));
|
35 |
+
|
36 |
+
if (tinyMCE.getParam('convert_urls'))
|
37 |
+
src = convertURL(src, null, true);
|
38 |
+
|
39 |
+
return src;
|
40 |
+
}
|
41 |
+
|
42 |
+
return "";
|
43 |
+
}
|
44 |
+
|
45 |
+
function init() {
|
46 |
+
tinyMCEPopup.resizeToInnerSize();
|
47 |
+
|
48 |
+
var formObj = document.forms[0];
|
49 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
50 |
+
var elm = inst.getFocusElement();
|
51 |
+
var action = "insert";
|
52 |
+
var html = "";
|
53 |
+
|
54 |
+
// Image list src
|
55 |
+
html = getImageListHTML('imagelistsrc','src','onSelectMainImage');
|
56 |
+
if (html == "")
|
57 |
+
document.getElementById("imagelistsrcrow").style.display = 'none';
|
58 |
+
else
|
59 |
+
document.getElementById("imagelistsrccontainer").innerHTML = html;
|
60 |
+
|
61 |
+
// Image list oversrc
|
62 |
+
html = getImageListHTML('imagelistover','onmouseoversrc');
|
63 |
+
if (html == "")
|
64 |
+
document.getElementById("imagelistoverrow").style.display = 'none';
|
65 |
+
else
|
66 |
+
document.getElementById("imagelistovercontainer").innerHTML = html;
|
67 |
+
|
68 |
+
// Image list outsrc
|
69 |
+
html = getImageListHTML('imagelistout','onmouseoutsrc');
|
70 |
+
if (html == "")
|
71 |
+
document.getElementById("imagelistoutrow").style.display = 'none';
|
72 |
+
else
|
73 |
+
document.getElementById("imagelistoutcontainer").innerHTML = html;
|
74 |
+
|
75 |
+
// Src browser
|
76 |
+
html = getBrowserHTML('srcbrowser','src','image','advimage');
|
77 |
+
document.getElementById("srcbrowsercontainer").innerHTML = html;
|
78 |
+
|
79 |
+
// Over browser
|
80 |
+
html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage');
|
81 |
+
document.getElementById("onmouseoversrccontainer").innerHTML = html;
|
82 |
+
|
83 |
+
// Out browser
|
84 |
+
html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage');
|
85 |
+
document.getElementById("onmouseoutsrccontainer").innerHTML = html;
|
86 |
+
|
87 |
+
// Longdesc browser
|
88 |
+
html = getBrowserHTML('longdescbrowser','longdesc','file','advimage');
|
89 |
+
document.getElementById("longdesccontainer").innerHTML = html;
|
90 |
+
|
91 |
+
// Resize some elements
|
92 |
+
if (isVisible('srcbrowser'))
|
93 |
+
document.getElementById('src').style.width = '260px';
|
94 |
+
|
95 |
+
if (isVisible('oversrcbrowser'))
|
96 |
+
document.getElementById('onmouseoversrc').style.width = '260px';
|
97 |
+
|
98 |
+
if (isVisible('outsrcbrowser'))
|
99 |
+
document.getElementById('onmouseoutsrc').style.width = '260px';
|
100 |
+
|
101 |
+
if (isVisible('longdescbrowser'))
|
102 |
+
document.getElementById('longdesc').style.width = '180px';
|
103 |
+
|
104 |
+
// Check action
|
105 |
+
if (elm != null && elm.nodeName == "IMG")
|
106 |
+
action = "update";
|
107 |
+
|
108 |
+
formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
|
109 |
+
|
110 |
+
if (action == "update") {
|
111 |
+
var src = tinyMCE.getAttrib(elm, 'src');
|
112 |
+
var onmouseoversrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
|
113 |
+
var onmouseoutsrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
|
114 |
+
|
115 |
+
src = convertURL(src, elm, true);
|
116 |
+
|
117 |
+
// Use mce_src if found
|
118 |
+
var mceRealSrc = tinyMCE.getAttrib(elm, 'mce_src');
|
119 |
+
if (mceRealSrc != "") {
|
120 |
+
src = mceRealSrc;
|
121 |
+
|
122 |
+
if (tinyMCE.getParam('convert_urls'))
|
123 |
+
src = convertURL(src, elm, true);
|
124 |
+
}
|
125 |
+
|
126 |
+
if (onmouseoversrc != "" && tinyMCE.getParam('convert_urls'))
|
127 |
+
onmouseoversrc = convertURL(onmouseoversrc, elm, true);
|
128 |
+
|
129 |
+
if (onmouseoutsrc != "" && tinyMCE.getParam('convert_urls'))
|
130 |
+
onmouseoutsrc = convertURL(onmouseoutsrc, elm, true);
|
131 |
+
|
132 |
+
// Setup form data
|
133 |
+
var style = tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"));
|
134 |
+
|
135 |
+
// Store away old size
|
136 |
+
orgImageWidth = trimSize(getStyle(elm, 'width'))
|
137 |
+
orgImageHeight = trimSize(getStyle(elm, 'height'));
|
138 |
+
|
139 |
+
formObj.src.value = src;
|
140 |
+
formObj.alt.value = tinyMCE.getAttrib(elm, 'alt');
|
141 |
+
formObj.title.value = tinyMCE.getAttrib(elm, 'title');
|
142 |
+
formObj.border.value = trimSize(getStyle(elm, 'border', 'borderWidth'));
|
143 |
+
formObj.vspace.value = tinyMCE.getAttrib(elm, 'vspace');
|
144 |
+
formObj.hspace.value = tinyMCE.getAttrib(elm, 'hspace');
|
145 |
+
formObj.width.value = orgImageWidth;
|
146 |
+
formObj.height.value = orgImageHeight;
|
147 |
+
formObj.onmouseoversrc.value = onmouseoversrc;
|
148 |
+
formObj.onmouseoutsrc.value = onmouseoutsrc;
|
149 |
+
formObj.id.value = tinyMCE.getAttrib(elm, 'id');
|
150 |
+
formObj.dir.value = tinyMCE.getAttrib(elm, 'dir');
|
151 |
+
formObj.lang.value = tinyMCE.getAttrib(elm, 'lang');
|
152 |
+
formObj.longdesc.value = tinyMCE.getAttrib(elm, 'longdesc');
|
153 |
+
formObj.usemap.value = tinyMCE.getAttrib(elm, 'usemap');
|
154 |
+
formObj.style.value = tinyMCE.serializeStyle(style);
|
155 |
+
|
156 |
+
// Select by the values
|
157 |
+
if (tinyMCE.isMSIE)
|
158 |
+
selectByValue(formObj, 'align', getStyle(elm, 'align', 'styleFloat'));
|
159 |
+
else
|
160 |
+
selectByValue(formObj, 'align', getStyle(elm, 'align', 'cssFloat'));
|
161 |
+
|
162 |
+
addClassesToList('classlist', 'advimage_styles');
|
163 |
+
|
164 |
+
selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'));
|
165 |
+
selectByValue(formObj, 'imagelistsrc', src);
|
166 |
+
selectByValue(formObj, 'imagelistover', onmouseoversrc);
|
167 |
+
selectByValue(formObj, 'imagelistout', onmouseoutsrc);
|
168 |
+
|
169 |
+
updateStyle();
|
170 |
+
showPreviewImage(src, true);
|
171 |
+
changeAppearance();
|
172 |
+
|
173 |
+
window.focus();
|
174 |
+
} else
|
175 |
+
addClassesToList('classlist', 'advimage_styles');
|
176 |
+
|
177 |
+
// If option enabled default contrain proportions to checked
|
178 |
+
if (tinyMCE.getParam("advimage_constrain_proportions", true))
|
179 |
+
formObj.constrain.checked = true;
|
180 |
+
|
181 |
+
// Check swap image if valid data
|
182 |
+
if (formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "")
|
183 |
+
setSwapImageDisabled(false);
|
184 |
+
else
|
185 |
+
setSwapImageDisabled(true);
|
186 |
+
}
|
187 |
+
|
188 |
+
function setSwapImageDisabled(state) {
|
189 |
+
var formObj = document.forms[0];
|
190 |
+
|
191 |
+
formObj.onmousemovecheck.checked = !state;
|
192 |
+
|
193 |
+
setBrowserDisabled('overbrowser', state);
|
194 |
+
setBrowserDisabled('outbrowser', state);
|
195 |
+
|
196 |
+
if (formObj.imagelistover)
|
197 |
+
formObj.imagelistover.disabled = state;
|
198 |
+
|
199 |
+
if (formObj.imagelistout)
|
200 |
+
formObj.imagelistout.disabled = state;
|
201 |
+
|
202 |
+
formObj.onmouseoversrc.disabled = state;
|
203 |
+
formObj.onmouseoutsrc.disabled = state;
|
204 |
+
}
|
205 |
+
|
206 |
+
function setAttrib(elm, attrib, value) {
|
207 |
+
var formObj = document.forms[0];
|
208 |
+
var valueElm = formObj.elements[attrib];
|
209 |
+
|
210 |
+
if (typeof(value) == "undefined" || value == null) {
|
211 |
+
value = "";
|
212 |
+
|
213 |
+
if (valueElm)
|
214 |
+
value = valueElm.value;
|
215 |
+
}
|
216 |
+
|
217 |
+
if (value != "") {
|
218 |
+
elm.setAttribute(attrib, value);
|
219 |
+
|
220 |
+
if (attrib == "style")
|
221 |
+
attrib = "style.cssText";
|
222 |
+
|
223 |
+
if (attrib == "longdesc")
|
224 |
+
attrib = "longDesc";
|
225 |
+
|
226 |
+
if (attrib == "width") {
|
227 |
+
attrib = "style.width";
|
228 |
+
value = value + "px";
|
229 |
+
value = value.replace(/%px/g, 'px');
|
230 |
+
}
|
231 |
+
|
232 |
+
if (attrib == "height") {
|
233 |
+
attrib = "style.height";
|
234 |
+
value = value + "px";
|
235 |
+
value = value.replace(/%px/g, 'px');
|
236 |
+
}
|
237 |
+
|
238 |
+
if (attrib == "class")
|
239 |
+
attrib = "className";
|
240 |
+
|
241 |
+
eval('elm.' + attrib + "=value;");
|
242 |
+
} else {
|
243 |
+
if (attrib == 'class')
|
244 |
+
elm.className = '';
|
245 |
+
|
246 |
+
elm.removeAttribute(attrib);
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
function makeAttrib(attrib, value) {
|
251 |
+
var formObj = document.forms[0];
|
252 |
+
var valueElm = formObj.elements[attrib];
|
253 |
+
|
254 |
+
if (typeof(value) == "undefined" || value == null) {
|
255 |
+
value = "";
|
256 |
+
|
257 |
+
if (valueElm)
|
258 |
+
value = valueElm.value;
|
259 |
+
}
|
260 |
+
|
261 |
+
if (value == "")
|
262 |
+
return "";
|
263 |
+
|
264 |
+
// XML encode it
|
265 |
+
value = value.replace(/&/g, '&');
|
266 |
+
value = value.replace(/\"/g, '"');
|
267 |
+
value = value.replace(/</g, '<');
|
268 |
+
value = value.replace(/>/g, '>');
|
269 |
+
|
270 |
+
return ' ' + attrib + '="' + value + '"';
|
271 |
+
}
|
272 |
+
|
273 |
+
function insertAction() {
|
274 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
275 |
+
var elm = inst.getFocusElement();
|
276 |
+
var formObj = document.forms[0];
|
277 |
+
var src = formObj.src.value;
|
278 |
+
var onmouseoversrc = formObj.onmouseoversrc.value;
|
279 |
+
var onmouseoutsrc = formObj.onmouseoutsrc.value;
|
280 |
+
|
281 |
+
if (!AutoValidator.validate(formObj)) {
|
282 |
+
alert(tinyMCE.getLang('lang_invalid_data'));
|
283 |
+
return false;
|
284 |
+
}
|
285 |
+
|
286 |
+
if (tinyMCE.getParam("accessibility_warnings")) {
|
287 |
+
if (formObj.alt.value == "" && !confirm(tinyMCE.getLang('lang_advimage_missing_alt', '', true)))
|
288 |
+
return;
|
289 |
+
}
|
290 |
+
|
291 |
+
if (onmouseoversrc && onmouseoversrc != "")
|
292 |
+
onmouseoversrc = "this.src='" + convertURL(onmouseoversrc, tinyMCE.imgElement) + "';";
|
293 |
+
|
294 |
+
if (onmouseoutsrc && onmouseoutsrc != "")
|
295 |
+
onmouseoutsrc = "this.src='" + convertURL(onmouseoutsrc, tinyMCE.imgElement) + "';";
|
296 |
+
|
297 |
+
if (elm != null && elm.nodeName == "IMG") {
|
298 |
+
setAttrib(elm, 'src', convertURL(src, tinyMCE.imgElement));
|
299 |
+
setAttrib(elm, 'mce_src', src);
|
300 |
+
setAttrib(elm, 'alt');
|
301 |
+
setAttrib(elm, 'title');
|
302 |
+
setAttrib(elm, 'border');
|
303 |
+
setAttrib(elm, 'vspace');
|
304 |
+
setAttrib(elm, 'hspace');
|
305 |
+
setAttrib(elm, 'width');
|
306 |
+
setAttrib(elm, 'height');
|
307 |
+
setAttrib(elm, 'onmouseover', onmouseoversrc);
|
308 |
+
setAttrib(elm, 'onmouseout', onmouseoutsrc);
|
309 |
+
setAttrib(elm, 'id');
|
310 |
+
setAttrib(elm, 'dir');
|
311 |
+
setAttrib(elm, 'lang');
|
312 |
+
setAttrib(elm, 'longdesc');
|
313 |
+
setAttrib(elm, 'usemap');
|
314 |
+
setAttrib(elm, 'style');
|
315 |
+
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
316 |
+
setAttrib(elm, 'align', getSelectValue(formObj, 'align'));
|
317 |
+
|
318 |
+
//tinyMCEPopup.execCommand("mceRepaint");
|
319 |
+
|
320 |
+
// Repaint if dimensions changed
|
321 |
+
if (formObj.width.value != orgImageWidth || formObj.height.value != orgImageHeight)
|
322 |
+
inst.repaint();
|
323 |
+
|
324 |
+
// Refresh in old MSIE
|
325 |
+
if (tinyMCE.isMSIE5)
|
326 |
+
elm.outerHTML = elm.outerHTML;
|
327 |
+
} else {
|
328 |
+
var html = "<img";
|
329 |
+
|
330 |
+
html += makeAttrib('src', convertURL(src, tinyMCE.imgElement));
|
331 |
+
html += makeAttrib('mce_src', src);
|
332 |
+
html += makeAttrib('alt');
|
333 |
+
html += makeAttrib('title');
|
334 |
+
html += makeAttrib('border');
|
335 |
+
html += makeAttrib('vspace');
|
336 |
+
html += makeAttrib('hspace');
|
337 |
+
html += makeAttrib('width');
|
338 |
+
html += makeAttrib('height');
|
339 |
+
html += makeAttrib('onmouseover', onmouseoversrc);
|
340 |
+
html += makeAttrib('onmouseout', onmouseoutsrc);
|
341 |
+
html += makeAttrib('id');
|
342 |
+
html += makeAttrib('dir');
|
343 |
+
html += makeAttrib('lang');
|
344 |
+
html += makeAttrib('longdesc');
|
345 |
+
html += makeAttrib('usemap');
|
346 |
+
html += makeAttrib('style');
|
347 |
+
html += makeAttrib('class', getSelectValue(formObj, 'classlist'));
|
348 |
+
html += makeAttrib('align', getSelectValue(formObj, 'align'));
|
349 |
+
html += " />";
|
350 |
+
|
351 |
+
tinyMCEPopup.execCommand("mceInsertContent", false, html);
|
352 |
+
}
|
353 |
+
|
354 |
+
tinyMCE._setEventsEnabled(inst.getBody(), false);
|
355 |
+
tinyMCEPopup.close();
|
356 |
+
}
|
357 |
+
|
358 |
+
function cancelAction() {
|
359 |
+
tinyMCEPopup.close();
|
360 |
+
}
|
361 |
+
|
362 |
+
function changeAppearance() {
|
363 |
+
var formObj = document.forms[0];
|
364 |
+
var img = document.getElementById('alignSampleImg');
|
365 |
+
|
366 |
+
if (img) {
|
367 |
+
img.align = formObj.align.value;
|
368 |
+
img.border = formObj.border.value;
|
369 |
+
img.hspace = formObj.hspace.value;
|
370 |
+
img.vspace = formObj.vspace.value;
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
function changeMouseMove() {
|
375 |
+
var formObj = document.forms[0];
|
376 |
+
|
377 |
+
setSwapImageDisabled(!formObj.onmousemovecheck.checked);
|
378 |
+
}
|
379 |
+
|
380 |
+
function updateStyle() {
|
381 |
+
var formObj = document.forms[0];
|
382 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
383 |
+
|
384 |
+
if (tinyMCE.getParam('inline_styles', false)) {
|
385 |
+
st['width'] = formObj.width.value == '' ? '' : formObj.width.value + "px";
|
386 |
+
st['height'] = formObj.height.value == '' ? '' : formObj.height.value + "px";
|
387 |
+
st['border-width'] = formObj.border.value == '' ? '' : formObj.border.value + "px";
|
388 |
+
st['margin-top'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
|
389 |
+
st['margin-bottom'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
|
390 |
+
st['margin-left'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
|
391 |
+
st['margin-right'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
|
392 |
+
} else {
|
393 |
+
st['width'] = st['height'] = st['border-width'] = null;
|
394 |
+
|
395 |
+
if (st['margin-top'] == st['margin-bottom'])
|
396 |
+
st['margin-top'] = st['margin-bottom'] = null;
|
397 |
+
|
398 |
+
if (st['margin-left'] == st['margin-right'])
|
399 |
+
st['margin-left'] = st['margin-right'] = null;
|
400 |
+
}
|
401 |
+
|
402 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
403 |
+
}
|
404 |
+
|
405 |
+
function styleUpdated() {
|
406 |
+
var formObj = document.forms[0];
|
407 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
408 |
+
|
409 |
+
if (st['width'])
|
410 |
+
formObj.width.value = st['width'].replace('px', '');
|
411 |
+
|
412 |
+
if (st['height'])
|
413 |
+
formObj.height.value = st['height'].replace('px', '');
|
414 |
+
|
415 |
+
if (st['margin-top'] && st['margin-top'] == st['margin-bottom'])
|
416 |
+
formObj.vspace.value = st['margin-top'].replace('px', '');
|
417 |
+
|
418 |
+
if (st['margin-left'] && st['margin-left'] == st['margin-right'])
|
419 |
+
formObj.hspace.value = st['margin-left'].replace('px', '');
|
420 |
+
|
421 |
+
if (st['border-width'])
|
422 |
+
formObj.border.value = st['border-width'].replace('px', '');
|
423 |
+
}
|
424 |
+
|
425 |
+
function changeHeight() {
|
426 |
+
var formObj = document.forms[0];
|
427 |
+
|
428 |
+
if (!formObj.constrain.checked || !preloadImg) {
|
429 |
+
updateStyle();
|
430 |
+
return;
|
431 |
+
}
|
432 |
+
|
433 |
+
if (formObj.width.value == "" || formObj.height.value == "")
|
434 |
+
return;
|
435 |
+
|
436 |
+
var temp = (parseInt(formObj.width.value) / parseInt(preloadImg.width)) * preloadImg.height;
|
437 |
+
formObj.height.value = temp.toFixed(0);
|
438 |
+
updateStyle();
|
439 |
+
}
|
440 |
+
|
441 |
+
function changeWidth() {
|
442 |
+
var formObj = document.forms[0];
|
443 |
+
|
444 |
+
if (!formObj.constrain.checked || !preloadImg) {
|
445 |
+
updateStyle();
|
446 |
+
return;
|
447 |
+
}
|
448 |
+
|
449 |
+
if (formObj.width.value == "" || formObj.height.value == "")
|
450 |
+
return;
|
451 |
+
|
452 |
+
var temp = (parseInt(formObj.height.value) / parseInt(preloadImg.height)) * preloadImg.width;
|
453 |
+
formObj.width.value = temp.toFixed(0);
|
454 |
+
updateStyle();
|
455 |
+
}
|
456 |
+
|
457 |
+
function onSelectMainImage(target_form_element, name, value) {
|
458 |
+
var formObj = document.forms[0];
|
459 |
+
|
460 |
+
formObj.alt.value = name;
|
461 |
+
formObj.title.value = name;
|
462 |
+
|
463 |
+
resetImageData();
|
464 |
+
showPreviewImage(formObj.elements[target_form_element].value, false);
|
465 |
+
}
|
466 |
+
|
467 |
+
function showPreviewImage(src, start) {
|
468 |
+
var formObj = document.forms[0];
|
469 |
+
|
470 |
+
selectByValue(document.forms[0], 'imagelistsrc', src);
|
471 |
+
|
472 |
+
var elm = document.getElementById('prev');
|
473 |
+
var src = src == "" ? src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
|
474 |
+
|
475 |
+
if (!start && tinyMCE.getParam("advimage_update_dimensions_onchange", true))
|
476 |
+
resetImageData();
|
477 |
+
|
478 |
+
if (src == "")
|
479 |
+
elm.innerHTML = "";
|
480 |
+
else
|
481 |
+
elm.innerHTML = '<img id="previewImg" src="' + src + '" border="0" onload="updateImageData(' + start + ');" onerror="resetImageData();" />'
|
482 |
+
}
|
483 |
+
|
484 |
+
function updateImageData(start) {
|
485 |
+
var formObj = document.forms[0];
|
486 |
+
|
487 |
+
preloadImg = document.getElementById('previewImg');
|
488 |
+
|
489 |
+
if (!start && formObj.width.value == "")
|
490 |
+
formObj.width.value = preloadImg.width;
|
491 |
+
|
492 |
+
if (!start && formObj.height.value == "")
|
493 |
+
formObj.height.value = preloadImg.height;
|
494 |
+
|
495 |
+
updateStyle();
|
496 |
+
}
|
497 |
+
|
498 |
+
function resetImageData() {
|
499 |
+
var formObj = document.forms[0];
|
500 |
+
formObj.width.value = formObj.height.value = "";
|
501 |
+
}
|
502 |
+
|
503 |
+
function getSelectValue(form_obj, field_name) {
|
504 |
+
var elm = form_obj.elements[field_name];
|
505 |
+
|
506 |
+
if (elm == null || elm.options == null)
|
507 |
+
return "";
|
508 |
+
|
509 |
+
return elm.options[elm.selectedIndex].value;
|
510 |
+
}
|
511 |
+
|
512 |
+
function getImageListHTML(elm_id, target_form_element, onchange_func) {
|
513 |
+
if (typeof(tinyMCEImageList) == "undefined" || tinyMCEImageList.length == 0)
|
514 |
+
return "";
|
515 |
+
|
516 |
+
var html = "";
|
517 |
+
|
518 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
519 |
+
html += ' class="mceImageList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
520 |
+
html += 'this.options[this.selectedIndex].value;';
|
521 |
+
|
522 |
+
if (typeof(onchange_func) != "undefined")
|
523 |
+
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
524 |
+
|
525 |
+
html += '"><option value="">---</option>';
|
526 |
+
|
527 |
+
for (var i=0; i<tinyMCEImageList.length; i++)
|
528 |
+
html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
|
529 |
+
|
530 |
+
html += '</select>';
|
531 |
+
|
532 |
+
return html;
|
533 |
+
|
534 |
+
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
535 |
+
}
|
536 |
+
|
537 |
+
// While loading
|
538 |
+
preinit();
|
upload_to_tinymce_directory/plugins/advimage/langs/en.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('advimage',{
|
4 |
+
tab_general : 'General',
|
5 |
+
tab_appearance : 'Appearance',
|
6 |
+
tab_advanced : 'Advanced',
|
7 |
+
general : 'General',
|
8 |
+
title : 'Title',
|
9 |
+
preview : 'Preview',
|
10 |
+
constrain_proportions : 'Constrain proportions',
|
11 |
+
langdir : 'Language direction',
|
12 |
+
langcode : 'Language code',
|
13 |
+
long_desc : 'Long description link',
|
14 |
+
style : 'Style',
|
15 |
+
classes : 'Classes',
|
16 |
+
ltr : 'Left to right',
|
17 |
+
rtl : 'Right to left',
|
18 |
+
id : 'Id',
|
19 |
+
image_map : 'Image map',
|
20 |
+
swap_image : 'Swap image',
|
21 |
+
alt_image : 'Alternative image',
|
22 |
+
mouseover : 'for mouse over',
|
23 |
+
mouseout : 'for mouse out',
|
24 |
+
misc : 'Miscellaneous',
|
25 |
+
example_img : 'Appearance preview image',
|
26 |
+
missing_alt : 'Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.'
|
27 |
+
});
|
upload_to_tinymce_directory/plugins/advimage/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/advlink/css/advlink.css
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for advimage plugin popup */
|
2 |
+
|
3 |
+
.mceLinkList, .mceAnchorList, #targetlist {
|
4 |
+
width: 280px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.mceActionPanel {
|
8 |
+
margin-top: 7px;
|
9 |
+
}
|
10 |
+
|
11 |
+
.panel_wrapper div.current {
|
12 |
+
height: 320px;
|
13 |
+
}
|
14 |
+
|
15 |
+
#classlist, #title, #href {
|
16 |
+
width: 280px;
|
17 |
+
}
|
18 |
+
|
19 |
+
#popupurl, #popupname {
|
20 |
+
width: 200px;
|
21 |
+
}
|
22 |
+
|
23 |
+
#popupwidth, #popupheight, #popupleft, #popuptop {
|
24 |
+
width: 30px;
|
25 |
+
vertical-align: middle;
|
26 |
+
text-align: center;
|
27 |
+
}
|
28 |
+
|
29 |
+
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {
|
30 |
+
width: 200px;
|
31 |
+
}
|
32 |
+
|
33 |
+
#events_panel input {
|
34 |
+
width: 200px;
|
35 |
+
}
|
upload_to_tinymce_directory/plugins/advlink/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('advlink');var TinyMCE_AdvancedLinkPlugin={getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink')},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var inst=tinyMCE.getInstanceById(editor_id),anySelection=false;var focusElm=inst.getFocusElement(),selectedText=inst.selection.getSelectedText();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){tinyMCE.openWindow({file:'../../plugins/advlink/link.htm',width:480+tinyMCE.getLang('lang_advlink_delta_width',0),height:400+tinyMCE.getLang('lang_advlink_delta_height',0)},{editor_id:editor_id,inline:"yes"})}return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin);
|
upload_to_tinymce_directory/plugins/advlink/editor_plugin_src.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 268 2007-04-28 15:52:59Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('advlink');
|
10 |
+
|
11 |
+
var TinyMCE_AdvancedLinkPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Advanced link',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
inst.addShortcut('ctrl', 'k', 'lang_advlink_desc', 'mceAdvLink');
|
24 |
+
},
|
25 |
+
|
26 |
+
getControlHTML : function(cn) {
|
27 |
+
switch (cn) {
|
28 |
+
case "link":
|
29 |
+
return tinyMCE.getButtonHTML(cn, 'lang_link_desc', '{$themeurl}/images/link.gif', 'mceAdvLink');
|
30 |
+
}
|
31 |
+
|
32 |
+
return "";
|
33 |
+
},
|
34 |
+
|
35 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
36 |
+
switch (command) {
|
37 |
+
case "mceAdvLink":
|
38 |
+
var inst = tinyMCE.getInstanceById(editor_id), anySelection = false;
|
39 |
+
var focusElm = inst.getFocusElement(), selectedText = inst.selection.getSelectedText();
|
40 |
+
|
41 |
+
if (tinyMCE.selectedElement)
|
42 |
+
anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
|
43 |
+
|
44 |
+
if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
|
45 |
+
tinyMCE.openWindow({
|
46 |
+
file : '../../plugins/advlink/link.htm',
|
47 |
+
width : 480 + tinyMCE.getLang('lang_advlink_delta_width', 0),
|
48 |
+
height : 400 + tinyMCE.getLang('lang_advlink_delta_height', 0)
|
49 |
+
}, {
|
50 |
+
editor_id : editor_id,
|
51 |
+
inline : "yes"
|
52 |
+
});
|
53 |
+
}
|
54 |
+
|
55 |
+
return true;
|
56 |
+
}
|
57 |
+
|
58 |
+
return false;
|
59 |
+
},
|
60 |
+
|
61 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
62 |
+
if (node == null)
|
63 |
+
return;
|
64 |
+
|
65 |
+
do {
|
66 |
+
if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") {
|
67 |
+
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonSelected');
|
68 |
+
return true;
|
69 |
+
}
|
70 |
+
} while ((node = node.parentNode));
|
71 |
+
|
72 |
+
if (any_selection) {
|
73 |
+
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonNormal');
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
|
77 |
+
tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonDisabled');
|
78 |
+
|
79 |
+
return true;
|
80 |
+
}
|
81 |
+
};
|
82 |
+
|
83 |
+
tinyMCE.addPlugin("advlink", TinyMCE_AdvancedLinkPlugin);
|
upload_to_tinymce_directory/plugins/advlink/jscripts/functions.js
ADDED
@@ -0,0 +1,587 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Functions for the advlink plugin popup */
|
2 |
+
|
3 |
+
var templates = {
|
4 |
+
"window.open" : "window.open('${url}','${target}','${options}')"
|
5 |
+
};
|
6 |
+
|
7 |
+
function preinit() {
|
8 |
+
// Initialize
|
9 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
10 |
+
|
11 |
+
// Import external list url javascript
|
12 |
+
var url = tinyMCE.getParam("external_link_list_url");
|
13 |
+
if (url != null) {
|
14 |
+
// Fix relative
|
15 |
+
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
16 |
+
url = tinyMCE.documentBasePath + "/" + url;
|
17 |
+
|
18 |
+
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
function changeClass() {
|
23 |
+
var formObj = document.forms[0];
|
24 |
+
formObj.classes.value = getSelectValue(formObj, 'classlist');
|
25 |
+
}
|
26 |
+
|
27 |
+
function init() {
|
28 |
+
tinyMCEPopup.resizeToInnerSize();
|
29 |
+
|
30 |
+
var formObj = document.forms[0];
|
31 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
32 |
+
var elm = inst.getFocusElement();
|
33 |
+
var action = "insert";
|
34 |
+
var html;
|
35 |
+
|
36 |
+
document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
|
37 |
+
document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
|
38 |
+
document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
|
39 |
+
document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
|
40 |
+
document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
|
41 |
+
|
42 |
+
// Link list
|
43 |
+
html = getLinkListHTML('linklisthref','href');
|
44 |
+
if (html == "")
|
45 |
+
document.getElementById("linklisthrefrow").style.display = 'none';
|
46 |
+
else
|
47 |
+
document.getElementById("linklisthrefcontainer").innerHTML = html;
|
48 |
+
|
49 |
+
// Resize some elements
|
50 |
+
if (isVisible('hrefbrowser'))
|
51 |
+
document.getElementById('href').style.width = '260px';
|
52 |
+
|
53 |
+
if (isVisible('popupurlbrowser'))
|
54 |
+
document.getElementById('popupurl').style.width = '180px';
|
55 |
+
|
56 |
+
elm = tinyMCE.getParentElement(elm, "a");
|
57 |
+
if (elm != null && elm.nodeName == "A")
|
58 |
+
action = "update";
|
59 |
+
|
60 |
+
formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
|
61 |
+
|
62 |
+
setPopupControlsDisabled(true);
|
63 |
+
|
64 |
+
if (action == "update") {
|
65 |
+
var href = tinyMCE.getAttrib(elm, 'href');
|
66 |
+
|
67 |
+
href = convertURL(href, elm, true);
|
68 |
+
|
69 |
+
// Use mce_href if found
|
70 |
+
var mceRealHref = tinyMCE.getAttrib(elm, 'mce_href');
|
71 |
+
if (mceRealHref != "") {
|
72 |
+
href = mceRealHref;
|
73 |
+
|
74 |
+
if (tinyMCE.getParam('convert_urls'))
|
75 |
+
href = convertURL(href, elm, true);
|
76 |
+
}
|
77 |
+
|
78 |
+
var onclick = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onclick'));
|
79 |
+
|
80 |
+
// Setup form data
|
81 |
+
setFormValue('href', href);
|
82 |
+
setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
|
83 |
+
setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
|
84 |
+
setFormValue('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"))));
|
85 |
+
setFormValue('rel', tinyMCE.getAttrib(elm, 'rel'));
|
86 |
+
setFormValue('rev', tinyMCE.getAttrib(elm, 'rev'));
|
87 |
+
setFormValue('charset', tinyMCE.getAttrib(elm, 'charset'));
|
88 |
+
setFormValue('hreflang', tinyMCE.getAttrib(elm, 'hreflang'));
|
89 |
+
setFormValue('dir', tinyMCE.getAttrib(elm, 'dir'));
|
90 |
+
setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
|
91 |
+
setFormValue('tabindex', tinyMCE.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
92 |
+
setFormValue('accesskey', tinyMCE.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
93 |
+
setFormValue('type', tinyMCE.getAttrib(elm, 'type'));
|
94 |
+
setFormValue('onfocus', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onfocus')));
|
95 |
+
setFormValue('onblur', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onblur')));
|
96 |
+
setFormValue('onclick', onclick);
|
97 |
+
setFormValue('ondblclick', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'ondblclick')));
|
98 |
+
setFormValue('onmousedown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousedown')));
|
99 |
+
setFormValue('onmouseup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseup')));
|
100 |
+
setFormValue('onmouseover', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
|
101 |
+
setFormValue('onmousemove', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousemove')));
|
102 |
+
setFormValue('onmouseout', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
|
103 |
+
setFormValue('onkeypress', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeypress')));
|
104 |
+
setFormValue('onkeydown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeydown')));
|
105 |
+
setFormValue('onkeyup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeyup')));
|
106 |
+
setFormValue('target', tinyMCE.getAttrib(elm, 'target'));
|
107 |
+
setFormValue('classes', tinyMCE.getAttrib(elm, 'class'));
|
108 |
+
|
109 |
+
// Parse onclick data
|
110 |
+
if (onclick != null && onclick.indexOf('window.open') != -1)
|
111 |
+
parseWindowOpen(onclick);
|
112 |
+
else
|
113 |
+
parseFunction(onclick);
|
114 |
+
|
115 |
+
// Select by the values
|
116 |
+
selectByValue(formObj, 'dir', tinyMCE.getAttrib(elm, 'dir'));
|
117 |
+
selectByValue(formObj, 'rel', tinyMCE.getAttrib(elm, 'rel'));
|
118 |
+
selectByValue(formObj, 'rev', tinyMCE.getAttrib(elm, 'rev'));
|
119 |
+
selectByValue(formObj, 'linklisthref', href);
|
120 |
+
|
121 |
+
if (href.charAt(0) == '#')
|
122 |
+
selectByValue(formObj, 'anchorlist', href);
|
123 |
+
|
124 |
+
addClassesToList('classlist', 'advlink_styles');
|
125 |
+
|
126 |
+
selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'), true);
|
127 |
+
selectByValue(formObj, 'targetlist', tinyMCE.getAttrib(elm, 'target'), true);
|
128 |
+
} else
|
129 |
+
addClassesToList('classlist', 'advlink_styles');
|
130 |
+
|
131 |
+
window.focus();
|
132 |
+
}
|
133 |
+
|
134 |
+
function checkPrefix(n) {
|
135 |
+
if (Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCE.getLang('lang_is_email')))
|
136 |
+
n.value = 'mailto:' + n.value;
|
137 |
+
|
138 |
+
if (/^\s*www./i.test(n.value) && confirm(tinyMCE.getLang('lang_is_external')))
|
139 |
+
n.value = 'http://' + n.value;
|
140 |
+
}
|
141 |
+
|
142 |
+
function setFormValue(name, value) {
|
143 |
+
document.forms[0].elements[name].value = value;
|
144 |
+
}
|
145 |
+
|
146 |
+
function convertURL(url, node, on_save) {
|
147 |
+
return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
|
148 |
+
}
|
149 |
+
|
150 |
+
function parseWindowOpen(onclick) {
|
151 |
+
var formObj = document.forms[0];
|
152 |
+
|
153 |
+
// Preprocess center code
|
154 |
+
if (onclick.indexOf('return false;') != -1) {
|
155 |
+
formObj.popupreturn.checked = true;
|
156 |
+
onclick = onclick.replace('return false;', '');
|
157 |
+
} else
|
158 |
+
formObj.popupreturn.checked = false;
|
159 |
+
|
160 |
+
var onClickData = parseLink(onclick);
|
161 |
+
|
162 |
+
if (onClickData != null) {
|
163 |
+
formObj.ispopup.checked = true;
|
164 |
+
setPopupControlsDisabled(false);
|
165 |
+
|
166 |
+
var onClickWindowOptions = parseOptions(onClickData['options']);
|
167 |
+
var url = onClickData['url'];
|
168 |
+
|
169 |
+
if (tinyMCE.getParam('convert_urls'))
|
170 |
+
url = convertURL(url, null, true);
|
171 |
+
|
172 |
+
formObj.popupname.value = onClickData['target'];
|
173 |
+
formObj.popupurl.value = url;
|
174 |
+
formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
|
175 |
+
formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
|
176 |
+
|
177 |
+
formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
|
178 |
+
formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
|
179 |
+
|
180 |
+
if (formObj.popupleft.value.indexOf('screen') != -1)
|
181 |
+
formObj.popupleft.value = "c";
|
182 |
+
|
183 |
+
if (formObj.popuptop.value.indexOf('screen') != -1)
|
184 |
+
formObj.popuptop.value = "c";
|
185 |
+
|
186 |
+
formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
|
187 |
+
formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
|
188 |
+
formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
|
189 |
+
formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
|
190 |
+
formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
|
191 |
+
formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
|
192 |
+
formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
|
193 |
+
|
194 |
+
buildOnClick();
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
function parseFunction(onclick) {
|
199 |
+
var formObj = document.forms[0];
|
200 |
+
var onClickData = parseLink(onclick);
|
201 |
+
|
202 |
+
// TODO: Add stuff here
|
203 |
+
}
|
204 |
+
|
205 |
+
function getOption(opts, name) {
|
206 |
+
return typeof(opts[name]) == "undefined" ? "" : opts[name];
|
207 |
+
}
|
208 |
+
|
209 |
+
function setPopupControlsDisabled(state) {
|
210 |
+
var formObj = document.forms[0];
|
211 |
+
|
212 |
+
formObj.popupname.disabled = state;
|
213 |
+
formObj.popupurl.disabled = state;
|
214 |
+
formObj.popupwidth.disabled = state;
|
215 |
+
formObj.popupheight.disabled = state;
|
216 |
+
formObj.popupleft.disabled = state;
|
217 |
+
formObj.popuptop.disabled = state;
|
218 |
+
formObj.popuplocation.disabled = state;
|
219 |
+
formObj.popupscrollbars.disabled = state;
|
220 |
+
formObj.popupmenubar.disabled = state;
|
221 |
+
formObj.popupresizable.disabled = state;
|
222 |
+
formObj.popuptoolbar.disabled = state;
|
223 |
+
formObj.popupstatus.disabled = state;
|
224 |
+
formObj.popupreturn.disabled = state;
|
225 |
+
formObj.popupdependent.disabled = state;
|
226 |
+
|
227 |
+
setBrowserDisabled('popupurlbrowser', state);
|
228 |
+
}
|
229 |
+
|
230 |
+
function parseLink(link) {
|
231 |
+
link = link.replace(new RegExp(''', 'g'), "'");
|
232 |
+
|
233 |
+
var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
|
234 |
+
|
235 |
+
// Is function name a template function
|
236 |
+
var template = templates[fnName];
|
237 |
+
if (template) {
|
238 |
+
// Build regexp
|
239 |
+
var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
|
240 |
+
var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
|
241 |
+
var replaceStr = "";
|
242 |
+
for (var i=0; i<variableNames.length; i++) {
|
243 |
+
// Is string value
|
244 |
+
if (variableNames[i].indexOf("'${") != -1)
|
245 |
+
regExp += "'(.*)'";
|
246 |
+
else // Number value
|
247 |
+
regExp += "([0-9]*)";
|
248 |
+
|
249 |
+
replaceStr += "$" + (i+1);
|
250 |
+
|
251 |
+
// Cleanup variable name
|
252 |
+
variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
|
253 |
+
|
254 |
+
if (i != variableNames.length-1) {
|
255 |
+
regExp += "\\s*,\\s*";
|
256 |
+
replaceStr += "<delim>";
|
257 |
+
} else
|
258 |
+
regExp += ".*";
|
259 |
+
}
|
260 |
+
|
261 |
+
regExp += "\\);?";
|
262 |
+
|
263 |
+
// Build variable array
|
264 |
+
var variables = new Array();
|
265 |
+
variables["_function"] = fnName;
|
266 |
+
var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
|
267 |
+
for (var i=0; i<variableNames.length; i++)
|
268 |
+
variables[variableNames[i]] = variableValues[i];
|
269 |
+
|
270 |
+
return variables;
|
271 |
+
}
|
272 |
+
|
273 |
+
return null;
|
274 |
+
}
|
275 |
+
|
276 |
+
function parseOptions(opts) {
|
277 |
+
if (opts == null || opts == "")
|
278 |
+
return new Array();
|
279 |
+
|
280 |
+
// Cleanup the options
|
281 |
+
opts = opts.toLowerCase();
|
282 |
+
opts = opts.replace(/;/g, ",");
|
283 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
284 |
+
|
285 |
+
var optionChunks = opts.split(',');
|
286 |
+
var options = new Array();
|
287 |
+
|
288 |
+
for (var i=0; i<optionChunks.length; i++) {
|
289 |
+
var parts = optionChunks[i].split('=');
|
290 |
+
|
291 |
+
if (parts.length == 2)
|
292 |
+
options[parts[0]] = parts[1];
|
293 |
+
}
|
294 |
+
|
295 |
+
return options;
|
296 |
+
}
|
297 |
+
|
298 |
+
function buildOnClick() {
|
299 |
+
var formObj = document.forms[0];
|
300 |
+
|
301 |
+
if (!formObj.ispopup.checked) {
|
302 |
+
formObj.onclick.value = "";
|
303 |
+
return;
|
304 |
+
}
|
305 |
+
|
306 |
+
var onclick = "window.open('";
|
307 |
+
var url = formObj.popupurl.value;
|
308 |
+
|
309 |
+
if (tinyMCE.getParam('convert_urls'))
|
310 |
+
url = convertURL(url, null, true);
|
311 |
+
|
312 |
+
onclick += url + "','";
|
313 |
+
onclick += formObj.popupname.value + "','";
|
314 |
+
|
315 |
+
if (formObj.popuplocation.checked)
|
316 |
+
onclick += "location=yes,";
|
317 |
+
|
318 |
+
if (formObj.popupscrollbars.checked)
|
319 |
+
onclick += "scrollbars=yes,";
|
320 |
+
|
321 |
+
if (formObj.popupmenubar.checked)
|
322 |
+
onclick += "menubar=yes,";
|
323 |
+
|
324 |
+
if (formObj.popupresizable.checked)
|
325 |
+
onclick += "resizable=yes,";
|
326 |
+
|
327 |
+
if (formObj.popuptoolbar.checked)
|
328 |
+
onclick += "toolbar=yes,";
|
329 |
+
|
330 |
+
if (formObj.popupstatus.checked)
|
331 |
+
onclick += "status=yes,";
|
332 |
+
|
333 |
+
if (formObj.popupdependent.checked)
|
334 |
+
onclick += "dependent=yes,";
|
335 |
+
|
336 |
+
if (formObj.popupwidth.value != "")
|
337 |
+
onclick += "width=" + formObj.popupwidth.value + ",";
|
338 |
+
|
339 |
+
if (formObj.popupheight.value != "")
|
340 |
+
onclick += "height=" + formObj.popupheight.value + ",";
|
341 |
+
|
342 |
+
if (formObj.popupleft.value != "") {
|
343 |
+
if (formObj.popupleft.value != "c")
|
344 |
+
onclick += "left=" + formObj.popupleft.value + ",";
|
345 |
+
else
|
346 |
+
onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
|
347 |
+
}
|
348 |
+
|
349 |
+
if (formObj.popuptop.value != "") {
|
350 |
+
if (formObj.popuptop.value != "c")
|
351 |
+
onclick += "top=" + formObj.popuptop.value + ",";
|
352 |
+
else
|
353 |
+
onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
|
354 |
+
}
|
355 |
+
|
356 |
+
if (onclick.charAt(onclick.length-1) == ',')
|
357 |
+
onclick = onclick.substring(0, onclick.length-1);
|
358 |
+
|
359 |
+
onclick += "');";
|
360 |
+
|
361 |
+
if (formObj.popupreturn.checked)
|
362 |
+
onclick += "return false;";
|
363 |
+
|
364 |
+
// tinyMCE.debug(onclick);
|
365 |
+
|
366 |
+
formObj.onclick.value = onclick;
|
367 |
+
|
368 |
+
if (formObj.href.value == "")
|
369 |
+
formObj.href.value = url;
|
370 |
+
}
|
371 |
+
|
372 |
+
function setAttrib(elm, attrib, value) {
|
373 |
+
var formObj = document.forms[0];
|
374 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
375 |
+
|
376 |
+
if (typeof(value) == "undefined" || value == null) {
|
377 |
+
value = "";
|
378 |
+
|
379 |
+
if (valueElm)
|
380 |
+
value = valueElm.value;
|
381 |
+
}
|
382 |
+
|
383 |
+
if (value != "") {
|
384 |
+
elm.setAttribute(attrib.toLowerCase(), value);
|
385 |
+
|
386 |
+
if (attrib == "style")
|
387 |
+
attrib = "style.cssText";
|
388 |
+
|
389 |
+
if (attrib.substring(0, 2) == 'on')
|
390 |
+
value = 'return true;' + value;
|
391 |
+
|
392 |
+
if (attrib == "class")
|
393 |
+
attrib = "className";
|
394 |
+
|
395 |
+
eval('elm.' + attrib + "=value;");
|
396 |
+
} else
|
397 |
+
elm.removeAttribute(attrib);
|
398 |
+
}
|
399 |
+
|
400 |
+
function getAnchorListHTML(id, target) {
|
401 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
402 |
+
var nodes = inst.getBody().getElementsByTagName("a"), name, i;
|
403 |
+
var html = "";
|
404 |
+
|
405 |
+
html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
|
406 |
+
html += 'this.options[this.selectedIndex].value;">';
|
407 |
+
html += '<option value="">---</option>';
|
408 |
+
|
409 |
+
for (i=0; i<nodes.length; i++) {
|
410 |
+
if ((name = tinyMCE.getAttrib(nodes[i], "name")) != "")
|
411 |
+
html += '<option value="#' + name + '">' + name + '</option>';
|
412 |
+
}
|
413 |
+
|
414 |
+
html += '</select>';
|
415 |
+
|
416 |
+
return html;
|
417 |
+
}
|
418 |
+
|
419 |
+
function insertAction() {
|
420 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
421 |
+
var elm = inst.getFocusElement();
|
422 |
+
|
423 |
+
checkPrefix(document.forms[0].href);
|
424 |
+
|
425 |
+
elm = tinyMCE.getParentElement(elm, "a");
|
426 |
+
|
427 |
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
428 |
+
|
429 |
+
// Create new anchor elements
|
430 |
+
if (elm == null) {
|
431 |
+
if (tinyMCE.isSafari)
|
432 |
+
tinyMCEPopup.execCommand("mceInsertContent", false, '<a href="#mce_temp_url#">' + inst.selection.getSelectedHTML() + '</a>');
|
433 |
+
else
|
434 |
+
tinyMCEPopup.execCommand("createlink", false, "#mce_temp_url#");
|
435 |
+
|
436 |
+
var elementArray = tinyMCE.getElementsByAttributeValue(inst.getBody(), "a", "href", "#mce_temp_url#");
|
437 |
+
for (var i=0; i<elementArray.length; i++) {
|
438 |
+
var elm = elementArray[i];
|
439 |
+
|
440 |
+
// Move cursor to end
|
441 |
+
try {
|
442 |
+
tinyMCE.selectedInstance.selection.collapse(false);
|
443 |
+
} catch (ex) {
|
444 |
+
// Ignore
|
445 |
+
}
|
446 |
+
|
447 |
+
// Move cursor behind the new anchor
|
448 |
+
// Don't remember why this was needed so it's now removed
|
449 |
+
/*
|
450 |
+
if (tinyMCE.isGecko) {
|
451 |
+
var sp = inst.getDoc().createTextNode(" ");
|
452 |
+
|
453 |
+
if (elm.nextSibling)
|
454 |
+
elm.parentNode.insertBefore(sp, elm.nextSibling);
|
455 |
+
else
|
456 |
+
elm.parentNode.appendChild(sp);
|
457 |
+
|
458 |
+
// Set range after link
|
459 |
+
var rng = inst.getDoc().createRange();
|
460 |
+
rng.setStartAfter(elm);
|
461 |
+
rng.setEndAfter(elm);
|
462 |
+
|
463 |
+
// Update selection
|
464 |
+
var sel = inst.getSel();
|
465 |
+
sel.removeAllRanges();
|
466 |
+
sel.addRange(rng);
|
467 |
+
}
|
468 |
+
*/
|
469 |
+
|
470 |
+
setAllAttribs(elm);
|
471 |
+
}
|
472 |
+
} else
|
473 |
+
setAllAttribs(elm);
|
474 |
+
|
475 |
+
tinyMCE._setEventsEnabled(inst.getBody(), false);
|
476 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
477 |
+
tinyMCEPopup.close();
|
478 |
+
}
|
479 |
+
|
480 |
+
function setAllAttribs(elm) {
|
481 |
+
var formObj = document.forms[0];
|
482 |
+
var href = formObj.href.value;
|
483 |
+
var target = getSelectValue(formObj, 'targetlist');
|
484 |
+
|
485 |
+
// Make anchors absolute
|
486 |
+
if (href.charAt(0) != '#')
|
487 |
+
href = convertURL(href, elm);
|
488 |
+
|
489 |
+
setAttrib(elm, 'href', href);
|
490 |
+
setAttrib(elm, 'mce_href', href);
|
491 |
+
setAttrib(elm, 'title');
|
492 |
+
setAttrib(elm, 'target', target == '_self' ? '' : target);
|
493 |
+
setAttrib(elm, 'id');
|
494 |
+
setAttrib(elm, 'style');
|
495 |
+
setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
|
496 |
+
setAttrib(elm, 'rel');
|
497 |
+
setAttrib(elm, 'rev');
|
498 |
+
setAttrib(elm, 'charset');
|
499 |
+
setAttrib(elm, 'hreflang');
|
500 |
+
setAttrib(elm, 'dir');
|
501 |
+
setAttrib(elm, 'lang');
|
502 |
+
setAttrib(elm, 'tabindex');
|
503 |
+
setAttrib(elm, 'accesskey');
|
504 |
+
setAttrib(elm, 'type');
|
505 |
+
setAttrib(elm, 'onfocus');
|
506 |
+
setAttrib(elm, 'onblur');
|
507 |
+
setAttrib(elm, 'onclick');
|
508 |
+
setAttrib(elm, 'ondblclick');
|
509 |
+
setAttrib(elm, 'onmousedown');
|
510 |
+
setAttrib(elm, 'onmouseup');
|
511 |
+
setAttrib(elm, 'onmouseover');
|
512 |
+
setAttrib(elm, 'onmousemove');
|
513 |
+
setAttrib(elm, 'onmouseout');
|
514 |
+
setAttrib(elm, 'onkeypress');
|
515 |
+
setAttrib(elm, 'onkeydown');
|
516 |
+
setAttrib(elm, 'onkeyup');
|
517 |
+
|
518 |
+
// Refresh in old MSIE
|
519 |
+
if (tinyMCE.isMSIE5)
|
520 |
+
elm.outerHTML = elm.outerHTML;
|
521 |
+
}
|
522 |
+
|
523 |
+
function getSelectValue(form_obj, field_name) {
|
524 |
+
var elm = form_obj.elements[field_name];
|
525 |
+
|
526 |
+
if (elm == null || elm.options == null)
|
527 |
+
return "";
|
528 |
+
|
529 |
+
return elm.options[elm.selectedIndex].value;
|
530 |
+
}
|
531 |
+
|
532 |
+
function getLinkListHTML(elm_id, target_form_element, onchange_func) {
|
533 |
+
if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
|
534 |
+
return "";
|
535 |
+
|
536 |
+
var html = "";
|
537 |
+
|
538 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '"';
|
539 |
+
html += ' class="mceLinkList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
540 |
+
html += 'this.options[this.selectedIndex].value;';
|
541 |
+
|
542 |
+
if (typeof(onchange_func) != "undefined")
|
543 |
+
html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
|
544 |
+
|
545 |
+
html += '"><option value="">---</option>';
|
546 |
+
|
547 |
+
for (var i=0; i<tinyMCELinkList.length; i++)
|
548 |
+
html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
|
549 |
+
|
550 |
+
html += '</select>';
|
551 |
+
|
552 |
+
return html;
|
553 |
+
|
554 |
+
// tinyMCE.debug('-- image list start --', html, '-- image list end --');
|
555 |
+
}
|
556 |
+
|
557 |
+
function getTargetListHTML(elm_id, target_form_element) {
|
558 |
+
var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
|
559 |
+
var html = '';
|
560 |
+
|
561 |
+
html += '<select id="' + elm_id + '" name="' + elm_id + '" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
|
562 |
+
html += 'this.options[this.selectedIndex].value;">';
|
563 |
+
|
564 |
+
html += '<option value="_self">' + tinyMCE.getLang('lang_advlink_target_same') + '</option>';
|
565 |
+
html += '<option value="_blank">' + tinyMCE.getLang('lang_advlink_target_blank') + ' (_blank)</option>';
|
566 |
+
html += '<option value="_parent">' + tinyMCE.getLang('lang_advlink_target_parent') + ' (_parent)</option>';
|
567 |
+
html += '<option value="_top">' + tinyMCE.getLang('lang_advlink_target_top') + ' (_top)</option>';
|
568 |
+
|
569 |
+
for (var i=0; i<targets.length; i++) {
|
570 |
+
var key, value;
|
571 |
+
|
572 |
+
if (targets[i] == "")
|
573 |
+
continue;
|
574 |
+
|
575 |
+
key = targets[i].split('=')[0];
|
576 |
+
value = targets[i].split('=')[1];
|
577 |
+
|
578 |
+
html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
|
579 |
+
}
|
580 |
+
|
581 |
+
html += '</select>';
|
582 |
+
|
583 |
+
return html;
|
584 |
+
}
|
585 |
+
|
586 |
+
// While loading
|
587 |
+
preinit();
|
upload_to_tinymce_directory/plugins/advlink/langs/en.js
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('advlink',{
|
4 |
+
general_tab : 'General',
|
5 |
+
popup_tab : 'Popup',
|
6 |
+
events_tab : 'Events',
|
7 |
+
advanced_tab : 'Advanced',
|
8 |
+
general_props : 'General properties',
|
9 |
+
popup_props : 'Popup properties',
|
10 |
+
event_props : 'Events',
|
11 |
+
advanced_props : 'Advanced properties',
|
12 |
+
popup_opts : 'Options',
|
13 |
+
anchor_names : 'Anchors',
|
14 |
+
target_same : 'Open in this window / frame',
|
15 |
+
target_parent : 'Open in parent window / frame',
|
16 |
+
target_top : 'Open in top frame (replaces all frames)',
|
17 |
+
target_blank : 'Open in new window',
|
18 |
+
popup : 'Javascript popup',
|
19 |
+
popup_url : 'Popup URL',
|
20 |
+
popup_name : 'Window name',
|
21 |
+
popup_return : 'Insert \'return false\'',
|
22 |
+
popup_scrollbars : 'Show scrollbars',
|
23 |
+
popup_statusbar : 'Show status bar',
|
24 |
+
popup_toolbar : 'Show toolbars',
|
25 |
+
popup_menubar : 'Show menu bar',
|
26 |
+
popup_location : 'Show location bar',
|
27 |
+
popup_resizable : 'Make window resizable',
|
28 |
+
popup_dependent : 'Dependent (Mozilla/Firefox only)',
|
29 |
+
popup_size : 'Size',
|
30 |
+
popup_position : 'Position (X/Y)',
|
31 |
+
id : 'Id',
|
32 |
+
style: 'Style',
|
33 |
+
classes : 'Classes',
|
34 |
+
target_name : 'Target name',
|
35 |
+
langdir : 'Language direction',
|
36 |
+
target_langcode : 'Target language',
|
37 |
+
langcode : 'Language code',
|
38 |
+
encoding : 'Target character encoding',
|
39 |
+
mime : 'Target MIME type',
|
40 |
+
rel : 'Relationship page to target',
|
41 |
+
rev : 'Relationship target to page',
|
42 |
+
tabindex : 'Tabindex',
|
43 |
+
accesskey : 'Accesskey',
|
44 |
+
ltr : 'Left to right',
|
45 |
+
rtl : 'Right to left'
|
46 |
+
});
|
upload_to_tinymce_directory/plugins/advlink/link.htm
ADDED
@@ -0,0 +1,338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_insert_link_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
|
9 |
+
<link href="css/advlink.css" rel="stylesheet" type="text/css" />
|
10 |
+
<base target="_self" />
|
11 |
+
</head>
|
12 |
+
<body id="advlink" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
13 |
+
<form onsubmit="insertAction();return false;" action="#">
|
14 |
+
<div class="tabs">
|
15 |
+
<ul>
|
16 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advlink_general_tab}</a></span></li>
|
17 |
+
<li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{$lang_advlink_popup_tab}</a></span></li>
|
18 |
+
<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_advlink_events_tab}</a></span></li>
|
19 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advlink_advanced_tab}</a></span></li>
|
20 |
+
</ul>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<div class="panel_wrapper">
|
24 |
+
<div id="general_panel" class="panel current">
|
25 |
+
<fieldset>
|
26 |
+
<legend>{$lang_advlink_general_props}</legend>
|
27 |
+
|
28 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
29 |
+
<tr>
|
30 |
+
<td nowrap="nowrap"><label id="hreflabel" for="href">{$lang_insert_link_url}</label></td>
|
31 |
+
<td><table border="0" cellspacing="0" cellpadding="0">
|
32 |
+
<tr>
|
33 |
+
<td><input id="href" name="href" type="text" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
|
34 |
+
<td id="hrefbrowsercontainer"> </td>
|
35 |
+
</tr>
|
36 |
+
</table></td>
|
37 |
+
</tr>
|
38 |
+
<tr id="linklisthrefrow">
|
39 |
+
<td class="column1"><label for="linklisthref">{$lang_link_list}</label></td>
|
40 |
+
<td colspan="2" id="linklisthrefcontainer"> </td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td class="column1"><label for="anchorlist">{$lang_advlink_anchor_names}</label></td>
|
44 |
+
<td colspan="2" id="anchorlistcontainer"> </td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<td><label id="targetlistlabel" for="targetlist">{$lang_insert_link_target}</label></td>
|
48 |
+
<td id="targetlistcontainer"> </td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<td nowrap="nowrap"><label id="titlelabel" for="title">{$lang_theme_insert_link_titlefield}</label></td>
|
52 |
+
<td><input id="title" name="title" type="text" value="" /></td>
|
53 |
+
</tr>
|
54 |
+
<tr>
|
55 |
+
<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
|
56 |
+
<td>
|
57 |
+
<select id="classlist" name="classlist" onchange="changeClass();">
|
58 |
+
<option value="" selected>{$lang_not_set}</option>
|
59 |
+
</select>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
</table>
|
63 |
+
</fieldset>
|
64 |
+
</div>
|
65 |
+
|
66 |
+
<div id="popup_panel" class="panel">
|
67 |
+
<fieldset>
|
68 |
+
<legend>{$lang_advlink_popup_props}</legend>
|
69 |
+
|
70 |
+
<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
|
71 |
+
<label id="ispopuplabel" for="ispopup">{$lang_advlink_popup}</label>
|
72 |
+
|
73 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
74 |
+
<tr>
|
75 |
+
<td nowrap="nowrap"><label for="popupurl">{$lang_advlink_popup_url}</label> </td>
|
76 |
+
<td>
|
77 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
78 |
+
<tr>
|
79 |
+
<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
|
80 |
+
<td id="popupurlbrowsercontainer"> </td>
|
81 |
+
</tr>
|
82 |
+
</table>
|
83 |
+
</td>
|
84 |
+
</tr>
|
85 |
+
<tr>
|
86 |
+
<td nowrap="nowrap"><label for="popupname">{$lang_advlink_popup_name}</label> </td>
|
87 |
+
<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
|
88 |
+
</tr>
|
89 |
+
<tr>
|
90 |
+
<td nowrap="nowrap"><label>{$lang_advlink_popup_size}</label> </td>
|
91 |
+
<td nowrap="nowrap">
|
92 |
+
<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
|
93 |
+
<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
<tr>
|
97 |
+
<td nowrap="nowrap" id="labelleft"><label>{$lang_advlink_popup_position}</label> </td>
|
98 |
+
<td nowrap="nowrap">
|
99 |
+
<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /
|
100 |
+
<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
|
101 |
+
</td>
|
102 |
+
</tr>
|
103 |
+
</table>
|
104 |
+
|
105 |
+
<fieldset>
|
106 |
+
<legend>{$lang_advlink_popup_opts}</legend>
|
107 |
+
|
108 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
109 |
+
<tr>
|
110 |
+
<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
|
111 |
+
<td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{$lang_advlink_popup_location}</label></td>
|
112 |
+
<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
|
113 |
+
<td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{$lang_advlink_popup_scrollbars}</label></td>
|
114 |
+
</tr>
|
115 |
+
<tr>
|
116 |
+
<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
|
117 |
+
<td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{$lang_advlink_popup_menubar}</label></td>
|
118 |
+
<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
|
119 |
+
<td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{$lang_advlink_popup_resizable}</label></td>
|
120 |
+
</tr>
|
121 |
+
<tr>
|
122 |
+
<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
|
123 |
+
<td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{$lang_advlink_popup_toolbar}</label></td>
|
124 |
+
<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
|
125 |
+
<td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{$lang_advlink_popup_dependent}</label></td>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
|
129 |
+
<td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{$lang_advlink_popup_statusbar}</label></td>
|
130 |
+
<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
|
131 |
+
<td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{$lang_advlink_popup_return}</label></td>
|
132 |
+
</tr>
|
133 |
+
</table>
|
134 |
+
</fieldset>
|
135 |
+
</fieldset>
|
136 |
+
</div>
|
137 |
+
|
138 |
+
<div id="advanced_panel" class="panel">
|
139 |
+
<fieldset>
|
140 |
+
<legend>{$lang_advlink_advanced_props}</legend>
|
141 |
+
|
142 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
143 |
+
<tr>
|
144 |
+
<td class="column1"><label id="idlabel" for="id">{$lang_advlink_id}</label></td>
|
145 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
146 |
+
</tr>
|
147 |
+
|
148 |
+
<tr>
|
149 |
+
<td><label id="stylelabel" for="style">{$lang_advlink_style}</label></td>
|
150 |
+
<td><input type="text" id="style" name="style" value="" /></td>
|
151 |
+
</tr>
|
152 |
+
|
153 |
+
<tr>
|
154 |
+
<td><label id="classeslabel" for="classes">{$lang_advlink_classes}</label></td>
|
155 |
+
<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
|
156 |
+
</tr>
|
157 |
+
|
158 |
+
<tr>
|
159 |
+
<td><label id="targetlabel" for="target">{$lang_advlink_target_name}</label></td>
|
160 |
+
<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
|
161 |
+
</tr>
|
162 |
+
|
163 |
+
<tr>
|
164 |
+
<td class="column1"><label id="dirlabel" for="dir">{$lang_advlink_langdir}</label></td>
|
165 |
+
<td>
|
166 |
+
<select id="dir" name="dir">
|
167 |
+
<option value="">{$lang_not_set}</option>
|
168 |
+
<option value="ltr">{$lang_advlink_ltr}</option>
|
169 |
+
<option value="rtl">{$lang_advlink_rtl}</option>
|
170 |
+
</select>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
+
|
174 |
+
<tr>
|
175 |
+
<td><label id="hreflanglabel" for="hreflang">{$lang_advlink_target_langcode}</label></td>
|
176 |
+
<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
|
177 |
+
</tr>
|
178 |
+
|
179 |
+
<tr>
|
180 |
+
<td class="column1"><label id="langlabel" for="lang">{$lang_advlink_langcode}</label></td>
|
181 |
+
<td>
|
182 |
+
<input id="lang" name="lang" type="text" value="" />
|
183 |
+
</td>
|
184 |
+
</tr>
|
185 |
+
|
186 |
+
<tr>
|
187 |
+
<td><label id="charsetlabel" for="charset">{$lang_advlink_encoding}</label></td>
|
188 |
+
<td><input type="text" id="charset" name="charset" value="" /></td>
|
189 |
+
</tr>
|
190 |
+
|
191 |
+
<tr>
|
192 |
+
<td><label id="typelabel" for="type">{$lang_advlink_mime}</label></td>
|
193 |
+
<td><input type="text" id="type" name="type" value="" /></td>
|
194 |
+
</tr>
|
195 |
+
|
196 |
+
<tr>
|
197 |
+
<td><label id="rellabel" for="rel">{$lang_advlink_rel}</label></td>
|
198 |
+
<td><select id="rel" name="rel">
|
199 |
+
<option value="">{$lang_not_set}</option>
|
200 |
+
<option value="lightbox">Lightbox</option>
|
201 |
+
<option value="alternate">Alternate</option>
|
202 |
+
<option value="designates">Designates</option>
|
203 |
+
<option value="stylesheet">Stylesheet</option>
|
204 |
+
<option value="start">Start</option>
|
205 |
+
<option value="next">Next</option>
|
206 |
+
<option value="prev">Prev</option>
|
207 |
+
<option value="contents">Contents</option>
|
208 |
+
<option value="index">Index</option>
|
209 |
+
<option value="glossary">Glossary</option>
|
210 |
+
<option value="copyright">Copyright</option>
|
211 |
+
<option value="chapter">Chapter</option>
|
212 |
+
<option value="subsection">Subsection</option>
|
213 |
+
<option value="appendix">Appendix</option>
|
214 |
+
<option value="help">Help</option>
|
215 |
+
<option value="bookmark">Bookmark</option>
|
216 |
+
<option value="nofollow">No Follow</option>
|
217 |
+
<option value="tag">Tag</option>
|
218 |
+
</select>
|
219 |
+
</td>
|
220 |
+
</tr>
|
221 |
+
|
222 |
+
<tr>
|
223 |
+
<td><label id="revlabel" for="rev">{$lang_advlink_rev}</label></td>
|
224 |
+
<td><select id="rev" name="rev">
|
225 |
+
<option value="">{$lang_not_set}</option>
|
226 |
+
<option value="alternate">Alternate</option>
|
227 |
+
<option value="designates">Designates</option>
|
228 |
+
<option value="stylesheet">Stylesheet</option>
|
229 |
+
<option value="start">Start</option>
|
230 |
+
<option value="next">Next</option>
|
231 |
+
<option value="prev">Prev</option>
|
232 |
+
<option value="contents">Contents</option>
|
233 |
+
<option value="index">Index</option>
|
234 |
+
<option value="glossary">Glossary</option>
|
235 |
+
<option value="copyright">Copyright</option>
|
236 |
+
<option value="chapter">Chapter</option>
|
237 |
+
<option value="subsection">Subsection</option>
|
238 |
+
<option value="appendix">Appendix</option>
|
239 |
+
<option value="help">Help</option>
|
240 |
+
<option value="bookmark">Bookmark</option>
|
241 |
+
</select>
|
242 |
+
</td>
|
243 |
+
</tr>
|
244 |
+
|
245 |
+
<tr>
|
246 |
+
<td><label id="tabindexlabel" for="tabindex">{$lang_advlink_tabindex}</label></td>
|
247 |
+
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
248 |
+
</tr>
|
249 |
+
|
250 |
+
<tr>
|
251 |
+
<td><label id="accesskeylabel" for="accesskey">{$lang_advlink_accesskey}</label></td>
|
252 |
+
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
253 |
+
</tr>
|
254 |
+
</table>
|
255 |
+
</fieldset>
|
256 |
+
</div>
|
257 |
+
|
258 |
+
<div id="events_panel" class="panel">
|
259 |
+
<fieldset>
|
260 |
+
<legend>{$lang_advlink_event_props}</legend>
|
261 |
+
|
262 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
263 |
+
<tr>
|
264 |
+
<td class="column1"><label for="onfocus">onfocus</label></td>
|
265 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
266 |
+
</tr>
|
267 |
+
|
268 |
+
<tr>
|
269 |
+
<td class="column1"><label for="onblur">onblur</label></td>
|
270 |
+
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
271 |
+
</tr>
|
272 |
+
|
273 |
+
<tr>
|
274 |
+
<td class="column1"><label for="onclick">onclick</label></td>
|
275 |
+
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
276 |
+
</tr>
|
277 |
+
|
278 |
+
<tr>
|
279 |
+
<td class="column1"><label for="ondblclick">ondblclick</label></td>
|
280 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
281 |
+
</tr>
|
282 |
+
|
283 |
+
<tr>
|
284 |
+
<td class="column1"><label for="onmousedown">onmousedown</label></td>
|
285 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
286 |
+
</tr>
|
287 |
+
|
288 |
+
<tr>
|
289 |
+
<td class="column1"><label for="onmouseup">onmouseup</label></td>
|
290 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
291 |
+
</tr>
|
292 |
+
|
293 |
+
<tr>
|
294 |
+
<td class="column1"><label for="onmouseover">onmouseover</label></td>
|
295 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
296 |
+
</tr>
|
297 |
+
|
298 |
+
<tr>
|
299 |
+
<td class="column1"><label for="onmousemove">onmousemove</label></td>
|
300 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
301 |
+
</tr>
|
302 |
+
|
303 |
+
<tr>
|
304 |
+
<td class="column1"><label for="onmouseout">onmouseout</label></td>
|
305 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
306 |
+
</tr>
|
307 |
+
|
308 |
+
<tr>
|
309 |
+
<td class="column1"><label for="onkeypress">onkeypress</label></td>
|
310 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
311 |
+
</tr>
|
312 |
+
|
313 |
+
<tr>
|
314 |
+
<td class="column1"><label for="onkeydown">onkeydown</label></td>
|
315 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
316 |
+
</tr>
|
317 |
+
|
318 |
+
<tr>
|
319 |
+
<td class="column1"><label for="onkeyup">onkeyup</label></td>
|
320 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
321 |
+
</tr>
|
322 |
+
</table>
|
323 |
+
</fieldset>
|
324 |
+
</div>
|
325 |
+
</div>
|
326 |
+
|
327 |
+
<div class="mceActionPanel">
|
328 |
+
<div style="float: left">
|
329 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
|
330 |
+
</div>
|
331 |
+
|
332 |
+
<div style="float: right">
|
333 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
334 |
+
</div>
|
335 |
+
</div>
|
336 |
+
</form>
|
337 |
+
</body>
|
338 |
+
</html>
|
upload_to_tinymce_directory/plugins/advlink/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/contextmenu/css/contextmenu.css
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.contextMenuIEPopup {
|
2 |
+
padding: 0;
|
3 |
+
margin: 0;
|
4 |
+
border: 0;
|
5 |
+
overflow: hidden;
|
6 |
+
}
|
7 |
+
|
8 |
+
.contextMenu {
|
9 |
+
position: absolute;
|
10 |
+
cursor: default;
|
11 |
+
z-index: 1000;
|
12 |
+
border: 1px solid #D4D0C8;
|
13 |
+
background-color: #FFFFFF;
|
14 |
+
}
|
15 |
+
|
16 |
+
.contextMenuItem, .contextMenuItemOver {
|
17 |
+
}
|
18 |
+
|
19 |
+
.contextMenuSeparator {
|
20 |
+
width: 100%;
|
21 |
+
background-color: #D4D0C8;
|
22 |
+
border: 0;
|
23 |
+
}
|
24 |
+
|
25 |
+
.contextMenuImage, .contextMenuItemDisabled {
|
26 |
+
border: 0;
|
27 |
+
}
|
28 |
+
|
29 |
+
.contextMenuIcon {
|
30 |
+
background-color: #F0F0EE;
|
31 |
+
}
|
32 |
+
|
33 |
+
.contextMenuItemOver .contextMenuIcon {
|
34 |
+
background-color: #B6BDD2;
|
35 |
+
}
|
36 |
+
|
37 |
+
.contextMenuIcon {
|
38 |
+
background-color: #F0F0EE;
|
39 |
+
}
|
40 |
+
|
41 |
+
.contextMenuItemDisabled img {
|
42 |
+
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
|
43 |
+
-moz-opacity:0.3;
|
44 |
+
opacity: 0.3;
|
45 |
+
}
|
46 |
+
|
47 |
+
.contextMenuText {
|
48 |
+
font-family: Tahoma, Verdana, Arial, Helvetica;
|
49 |
+
font-size: 11px;
|
50 |
+
line-height: 20px;
|
51 |
+
}
|
52 |
+
|
53 |
+
.contextMenuItemDisabled {
|
54 |
+
color: #AAAAAA;
|
55 |
+
}
|
56 |
+
|
57 |
+
.contextMenuText a {
|
58 |
+
display: block;
|
59 |
+
line-height: 20px;
|
60 |
+
width: 100%;
|
61 |
+
text-decoration: none;
|
62 |
+
color: black;
|
63 |
+
font-weight: normal;
|
64 |
+
margin: 0;
|
65 |
+
padding: 0;
|
66 |
+
}
|
67 |
+
|
68 |
+
.contextMenuText a:hover {
|
69 |
+
background-color: #B6BDD2;
|
70 |
+
text-decoration: none !important;
|
71 |
+
font-weight: normal;
|
72 |
+
margin: 0;
|
73 |
+
padding: 0;
|
74 |
+
}
|
upload_to_tinymce_directory/plugins/contextmenu/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css")}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst)})}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu)},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst)}},_showContextMenu:function(e,inst){if(e.ctrlKey)return true;function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):""}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A'&&tinyMCE.getAttrib(elm,'name')=='')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true))}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.hasPlugin('flash')&&tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else if(tinyMCE.hasPlugin('media')&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm,'class')))contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_media_title","mceMedia");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false)}break}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert")}}contextMenu.show(x,y)},10);tinyMCE.cancelEvent(e);return false},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide()},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value)},100)}else cm.inst.execCommand(command,ui,value)}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){var doc,self=this;function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val}this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('<html><head><link href="'+tinyMCE.baseURL+'/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');doc.close()}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML=""},addSeparator:function(){this.html+='<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="'+this.settings['spacer_image']+'" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="'+this.settings['spacer_image']+'" /></td></tr>'},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='<tr class="contextMenuItem">';else html+='<tr class="contextMenuItemDisabled">';html+='<td class="contextMenuIcon"><img src="'+icon+'" width="20" height="20" class="contextMenuImage" /></td>';html+='<td><div class="contextMenuText">';html+='<a href="javascript:void(0);" onclick="'+onMouseDown+'" onmousedown="return false;"> ';html+=title;html+=' </a>';html+='</div></td>';html+='</tr>';this.html+=html},show:function(x,y){var vp,width,height,yo;if(this.html=="")return;var html='';html+='<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';html+=this.html;html+='</table>';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='<div class="contextMenu">'+html+"</div>";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height)}else{vp=this.getViewPort();yo=tinyMCE.isMSIE5_0?document.body.scrollTop:self.pageYOffset;this.contextMenuDiv.style.left=(x>vp.left+vp.width-width?vp.left+vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.top+vp.height-height?vp.top+vp.height-height:y)+'px';this.contextMenuDiv.style.display="block"}},getViewPort:function(){return{left:self.pageXOffset||self.document.documentElement.scrollLeft||self.document.body.scrollLeft,top:self.pageYOffset||self.document.documentElement.scrollTop||self.document.body.scrollTop,width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none"},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);")}};
|
upload_to_tinymce_directory/plugins/contextmenu/editor_plugin_src.js
ADDED
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
|
10 |
+
tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
|
11 |
+
}
|
12 |
+
|
13 |
+
var TinyMCE_ContextMenuPlugin = {
|
14 |
+
// Private fields
|
15 |
+
_contextMenu : null,
|
16 |
+
|
17 |
+
getInfo : function() {
|
18 |
+
return {
|
19 |
+
longname : 'Context menus',
|
20 |
+
author : 'Moxiecode Systems AB',
|
21 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
22 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
|
23 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
24 |
+
};
|
25 |
+
},
|
26 |
+
|
27 |
+
initInstance : function(inst) {
|
28 |
+
// Is not working on MSIE 5.0 or Opera no contextmenu event
|
29 |
+
if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
|
30 |
+
return;
|
31 |
+
|
32 |
+
TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
|
33 |
+
commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
|
34 |
+
spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
|
35 |
+
});
|
36 |
+
|
37 |
+
// Add hide event handles
|
38 |
+
tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
39 |
+
tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
40 |
+
tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
41 |
+
tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
42 |
+
tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
43 |
+
tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
|
44 |
+
|
45 |
+
// Attach contextmenu event
|
46 |
+
if (tinyMCE.isGecko) {
|
47 |
+
tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
|
48 |
+
} else
|
49 |
+
tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
|
50 |
+
},
|
51 |
+
|
52 |
+
// Private plugin internal methods
|
53 |
+
|
54 |
+
_onContextMenu : function(e) {
|
55 |
+
var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
|
56 |
+
var targetInst, body;
|
57 |
+
|
58 |
+
// Find instance
|
59 |
+
if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
|
60 |
+
for (var n in tinyMCE.instances) {
|
61 |
+
var inst = tinyMCE.instances[n];
|
62 |
+
if (!tinyMCE.isInstance(inst))
|
63 |
+
continue;
|
64 |
+
|
65 |
+
if (body == inst.getBody()) {
|
66 |
+
targetInst = inst;
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
|
72 |
+
}
|
73 |
+
},
|
74 |
+
|
75 |
+
_showContextMenu : function(e, inst) {
|
76 |
+
if (e.ctrlKey)
|
77 |
+
return true;
|
78 |
+
|
79 |
+
function getAttrib(elm, name) {
|
80 |
+
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
|
81 |
+
}
|
82 |
+
|
83 |
+
var x, y, elm, contextMenu;
|
84 |
+
var pos = tinyMCE.getAbsPosition(inst.iframeElement);
|
85 |
+
|
86 |
+
x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
|
87 |
+
y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
|
88 |
+
elm = tinyMCE.isMSIE ? e.srcElement : e.target;
|
89 |
+
|
90 |
+
contextMenu = this._contextMenu;
|
91 |
+
contextMenu.inst = inst;
|
92 |
+
|
93 |
+
// Mozilla needs some time
|
94 |
+
window.setTimeout(function () {
|
95 |
+
var theme = tinyMCE.getParam("theme");
|
96 |
+
|
97 |
+
contextMenu.clearAll();
|
98 |
+
var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
|
99 |
+
|
100 |
+
// Default items
|
101 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
|
102 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
|
103 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
|
104 |
+
|
105 |
+
if (sel || (elm ? (elm.nodeName == 'A' && tinyMCE.getAttrib(elm, 'name') == '') || (elm.nodeName == 'IMG') : false)) {
|
106 |
+
contextMenu.addSeparator();
|
107 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
|
108 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
|
109 |
+
}
|
110 |
+
|
111 |
+
// Get element
|
112 |
+
elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
|
113 |
+
if (elm) {
|
114 |
+
switch (elm.nodeName) {
|
115 |
+
case "IMG":
|
116 |
+
contextMenu.addSeparator();
|
117 |
+
|
118 |
+
// If flash
|
119 |
+
if (tinyMCE.hasPlugin('flash') && tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
|
120 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
|
121 |
+
else if (tinyMCE.hasPlugin('media') && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm, 'class')))
|
122 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_media_title", "mceMedia");
|
123 |
+
else
|
124 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
|
125 |
+
break;
|
126 |
+
|
127 |
+
case "HR":
|
128 |
+
contextMenu.addSeparator();
|
129 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
|
130 |
+
break;
|
131 |
+
|
132 |
+
case "TABLE":
|
133 |
+
case "TD":
|
134 |
+
// Is table plugin loaded
|
135 |
+
if (inst.hasPlugin("table")) {
|
136 |
+
var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
|
137 |
+
var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
|
138 |
+
|
139 |
+
colspan = colspan == "" ? "1" : colspan;
|
140 |
+
rowspan = rowspan == "" ? "1" : rowspan;
|
141 |
+
|
142 |
+
contextMenu.addSeparator();
|
143 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
|
144 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
|
145 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
|
146 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
|
147 |
+
|
148 |
+
/* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
|
149 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
|
150 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
|
151 |
+
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
|
152 |
+
contextMenu.addSeparator();
|
153 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
|
154 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
|
155 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
|
156 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
|
157 |
+
contextMenu.addSeparator();
|
158 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
|
159 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
|
160 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
|
161 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
|
162 |
+
contextMenu.addSeparator();
|
163 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
|
164 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
|
165 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
|
166 |
+
contextMenu.addSeparator();
|
167 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
|
168 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
|
169 |
+
}
|
170 |
+
break;
|
171 |
+
}
|
172 |
+
} else {
|
173 |
+
// Add table specific
|
174 |
+
if (inst.hasPlugin("table")) {
|
175 |
+
contextMenu.addSeparator();
|
176 |
+
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
contextMenu.show(x, y);
|
181 |
+
}, 10);
|
182 |
+
|
183 |
+
// Cancel default handeling
|
184 |
+
tinyMCE.cancelEvent(e);
|
185 |
+
return false;
|
186 |
+
},
|
187 |
+
|
188 |
+
_hideContextMenu : function() {
|
189 |
+
if (TinyMCE_ContextMenuPlugin._contextMenu)
|
190 |
+
TinyMCE_ContextMenuPlugin._contextMenu.hide();
|
191 |
+
},
|
192 |
+
|
193 |
+
_commandHandler : function(command, value) {
|
194 |
+
var cm = TinyMCE_ContextMenuPlugin._contextMenu;
|
195 |
+
|
196 |
+
cm.hide();
|
197 |
+
|
198 |
+
// UI must be true on these
|
199 |
+
var ui = false;
|
200 |
+
if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
|
201 |
+
ui = true;
|
202 |
+
|
203 |
+
if (command == "Paste")
|
204 |
+
value = null;
|
205 |
+
|
206 |
+
if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
|
207 |
+
// Cell properties will generate access denied error is this isn't done?!
|
208 |
+
window.setTimeout(function() {
|
209 |
+
cm.inst.execCommand(command, ui, value);
|
210 |
+
}, 100);
|
211 |
+
} else
|
212 |
+
cm.inst.execCommand(command, ui, value);
|
213 |
+
}
|
214 |
+
};
|
215 |
+
|
216 |
+
tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
|
217 |
+
|
218 |
+
// Context menu class
|
219 |
+
|
220 |
+
function TinyMCE_ContextMenu(settings) {
|
221 |
+
var doc, self = this;
|
222 |
+
|
223 |
+
// Default value function
|
224 |
+
function defParam(key, def_val) {
|
225 |
+
settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
|
226 |
+
}
|
227 |
+
|
228 |
+
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
|
229 |
+
|
230 |
+
// Setup contextmenu div
|
231 |
+
this.contextMenuDiv = document.createElement("div");
|
232 |
+
this.contextMenuDiv.className = "contextMenu";
|
233 |
+
this.contextMenuDiv.setAttribute("class", "contextMenu");
|
234 |
+
this.contextMenuDiv.style.display = "none";
|
235 |
+
this.contextMenuDiv.style.position = 'absolute';
|
236 |
+
this.contextMenuDiv.style.zindex = 1000;
|
237 |
+
this.contextMenuDiv.style.left = '0';
|
238 |
+
this.contextMenuDiv.style.top = '0';
|
239 |
+
this.contextMenuDiv.unselectable = "on";
|
240 |
+
|
241 |
+
document.body.appendChild(this.contextMenuDiv);
|
242 |
+
|
243 |
+
// Setup default values
|
244 |
+
defParam("commandhandler", "");
|
245 |
+
defParam("spacer_image", "images/spacer.gif");
|
246 |
+
|
247 |
+
this.items = new Array();
|
248 |
+
this.settings = settings;
|
249 |
+
this.html = "";
|
250 |
+
|
251 |
+
// IE Popup
|
252 |
+
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
|
253 |
+
this.pop = window.createPopup();
|
254 |
+
doc = this.pop.document;
|
255 |
+
doc.open();
|
256 |
+
doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
|
257 |
+
doc.close();
|
258 |
+
}
|
259 |
+
};
|
260 |
+
|
261 |
+
TinyMCE_ContextMenu.prototype = {
|
262 |
+
clearAll : function() {
|
263 |
+
this.html = "";
|
264 |
+
this.contextMenuDiv.innerHTML = "";
|
265 |
+
},
|
266 |
+
|
267 |
+
addSeparator : function() {
|
268 |
+
this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
|
269 |
+
},
|
270 |
+
|
271 |
+
addItem : function(icon, title, command, value, disabled) {
|
272 |
+
if (title.charAt(0) == '$')
|
273 |
+
title = tinyMCE.getLang(title.substring(1));
|
274 |
+
|
275 |
+
var onMouseDown = '';
|
276 |
+
var html = '';
|
277 |
+
|
278 |
+
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
|
279 |
+
onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
|
280 |
+
else
|
281 |
+
onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
|
282 |
+
|
283 |
+
if (icon == "")
|
284 |
+
icon = this.settings['spacer_image'];
|
285 |
+
|
286 |
+
if (!disabled)
|
287 |
+
html += '<tr class="contextMenuItem">';
|
288 |
+
else
|
289 |
+
html += '<tr class="contextMenuItemDisabled">';
|
290 |
+
|
291 |
+
html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
|
292 |
+
html += '<td><div class="contextMenuText">';
|
293 |
+
html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;"> ';
|
294 |
+
|
295 |
+
// Add text
|
296 |
+
html += title;
|
297 |
+
|
298 |
+
html += ' </a>';
|
299 |
+
html += '</div></td>';
|
300 |
+
html += '</tr>';
|
301 |
+
|
302 |
+
// Add to main
|
303 |
+
this.html += html;
|
304 |
+
},
|
305 |
+
|
306 |
+
show : function(x, y) {
|
307 |
+
var vp, width, height, yo;
|
308 |
+
|
309 |
+
if (this.html == "")
|
310 |
+
return;
|
311 |
+
|
312 |
+
var html = '';
|
313 |
+
|
314 |
+
html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
|
315 |
+
html += this.html;
|
316 |
+
html += '</table>';
|
317 |
+
|
318 |
+
this.contextMenuDiv.innerHTML = html;
|
319 |
+
|
320 |
+
// Get dimensions
|
321 |
+
this.contextMenuDiv.style.display = "block";
|
322 |
+
width = this.contextMenuDiv.offsetWidth;
|
323 |
+
height = this.contextMenuDiv.offsetHeight;
|
324 |
+
this.contextMenuDiv.style.display = "none";
|
325 |
+
|
326 |
+
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
|
327 |
+
// Setup popup and show
|
328 |
+
this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
|
329 |
+
this.pop.document.tinyMCE = tinyMCE;
|
330 |
+
this.pop.document.contextMenu = this;
|
331 |
+
this.pop.show(x, y, width, height);
|
332 |
+
} else {
|
333 |
+
vp = this.getViewPort();
|
334 |
+
yo = tinyMCE.isMSIE5_0 ? document.body.scrollTop : self.pageYOffset;
|
335 |
+
this.contextMenuDiv.style.left = (x > vp.left + vp.width - width ? vp.left + vp.width - width : x) + 'px';
|
336 |
+
this.contextMenuDiv.style.top = (y > vp.top + vp.height - height ? vp.top + vp.height - height : y) + 'px';
|
337 |
+
this.contextMenuDiv.style.display = "block";
|
338 |
+
}
|
339 |
+
},
|
340 |
+
|
341 |
+
getViewPort : function() {
|
342 |
+
return {
|
343 |
+
left : self.pageXOffset || self.document.documentElement.scrollLeft || self.document.body.scrollLeft,
|
344 |
+
top: self.pageYOffset || self.document.documentElement.scrollTop || self.document.body.scrollTop,
|
345 |
+
width : document.documentElement.offsetWidth || document.body.offsetWidth,
|
346 |
+
height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
|
347 |
+
};
|
348 |
+
},
|
349 |
+
|
350 |
+
hide : function() {
|
351 |
+
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
|
352 |
+
this.pop.hide();
|
353 |
+
else
|
354 |
+
this.contextMenuDiv.style.display = "none";
|
355 |
+
},
|
356 |
+
|
357 |
+
execCommand : function(command, value) {
|
358 |
+
eval(this.settings['commandhandler'] + "(command, value);");
|
359 |
+
}
|
360 |
+
};
|
upload_to_tinymce_directory/plugins/contextmenu/images/spacer.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/contextmenu/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/fullscreen/css/page.css
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* This class restores all CSS properties to that absolute positioning of fullscreen mode is correct */
|
2 |
+
.mceFullscreenPos {
|
3 |
+
display: block !important;
|
4 |
+
position: static !important;
|
5 |
+
left: 0 !important;
|
6 |
+
top: 0 !important;
|
7 |
+
bottom: auto !important;
|
8 |
+
right: auto !important;
|
9 |
+
width: auto !important;
|
10 |
+
height: auto !important;
|
11 |
+
margin: 0 !important;
|
12 |
+
padding: 0 !important;
|
13 |
+
border: 0 !important;
|
14 |
+
overflow: visible;
|
15 |
+
z-index: 1 !important;
|
16 |
+
clear: both;
|
17 |
+
}
|
18 |
+
|
19 |
+
body.mceFullscreen {
|
20 |
+
overflow: hidden !important;
|
21 |
+
}
|
upload_to_tinymce_directory/plugins/fullscreen/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('fullscreen');var TinyMCE_FullScreenPlugin={getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(!tinyMCE.settings['fullscreen_skip_plugin_css'])tinyMCE.importCSS(inst.getContainerWin().document,tinyMCE.baseURL+"/plugins/fullscreen/css/page.css")},getControlHTML:function(cn){switch(cn){case"fullscreen":return tinyMCE.getButtonHTML(cn,'lang_fullscreen_desc','{$pluginurl}/images/fullscreen.gif','mceFullScreen')}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst;switch(command){case"mceFullScreen":inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.getParam('fullscreen_new_window'))this._toggleFullscreenWin(inst);else this._toggleFullscreen(inst);return true}return false},_toggleFullscreenWin:function(inst){if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(inst.editorId));top.close()}else{tinyMCE.setWindowArg('editor_id',inst.editorId);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight)}catch(e){}}},_toggleFullscreen:function(inst){var ds=inst.getData('fullscreen'),editorContainer,tableElm,iframe,vp,cw,cd,re,w,h,si,blo,delta=0,cell,row,fcml,bcml;cw=inst.getContainerWin();cd=cw.document;editorContainer=cd.getElementById(inst.editorId+'_parent');tableElm=editorContainer.firstChild;iframe=inst.iframeElement;re=cd.getElementById(inst.editorId+'_resize');blo=document.getElementById('mce_fullscreen_blocker');fcm=new TinyMCE_Layer(inst.editorId+'_fcMenu');fcml=new TinyMCE_Layer(inst.editorId+'_fcMenu');bcml=new TinyMCE_Layer(inst.editorId+'_bcMenu');if(fcml.exists()&&fcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_forecolor','mceMenuButton');fcml.hide()}if(bcml.exists()&&bcml.isVisible()){tinyMCE.switchClass(inst.editorId+'_backcolor','mceMenuButton');bcml.hide()}if(!ds.enabled){if(inst.toolbarElement){delta+=inst.toolbarElement.offsetHeight;cell=tableElm.tBodies[0].insertRow(0).insertCell(-1);cell.className='mceToolbarTop';cell.nowrap=true;ds.oldToolbarParent=inst.toolbarElement.parentNode;ds.toolbarHolder=document.createTextNode('...');cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder,inst.toolbarElement))}ds.parents=[];vp=tinyMCE.getViewPort(cw);ds.scrollX=vp.left;ds.scrollY=vp.top;if(!tinyMCE.isOpera)tinyMCE.addCSSClass(cd.body,'mceFullscreen');tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.addCSSClass(n,'mceFullscreenPos');return false});if(re)re.style.display='none';vp=tinyMCE.getViewPort(cw);ds.oldWidth=iframe.style.width?iframe.style.width:iframe.offsetWidth;ds.oldHeight=iframe.style.height?iframe.style.height:iframe.offsetHeight;ds.oldTWidth=tableElm.style.width?tableElm.style.width:tableElm.offsetWidth;ds.oldTHeight=tableElm.style.height?tableElm.style.height:tableElm.offsetHeight;if(ds.oldWidth&&ds.oldWidth.indexOf)ds.oldTWidth=ds.oldWidth.indexOf('%')!=-1?ds.oldWidth:ds.oldTWidth;if(!blo&&tinyMCE.isRealIE){blo=tinyMCE.createTag(document,'iframe',{id:'mce_fullscreen_blocker',src:'about:blank',frameBorder:0,width:vp.width,height:vp.height,style:'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});document.body.appendChild(blo)}tableElm.style.position='absolute';tableElm.style.zIndex=1000;tableElm.style.left=tableElm.style.top='0';tableElm.style.width=vp.width+'px';tableElm.style.height=vp.height+'px';if(tinyMCE.isRealIE){iframe.style.width=vp.width+'px';iframe.style.height=vp.height+'px';w=iframe.parentNode.clientWidth-(tableElm.offsetWidth-vp.width);h=iframe.parentNode.clientHeight-(tableElm.offsetHeight-vp.height)}else{w=iframe.parentNode.clientWidth;h=iframe.parentNode.clientHeight}iframe.style.width=w+"px";iframe.style.height=(h+delta)+"px";tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonSelected');ds.enabled=true;inst.useCSS=false}else{if(inst.toolbarElement){row=inst.toolbarElement.parentNode.parentNode;row.parentNode.removeChild(row);ds.oldToolbarParent.replaceChild(inst.toolbarElement,ds.toolbarHolder);ds.oldToolbarParent=null;ds.toolbarHolder=null}if(blo)blo.parentNode.removeChild(blo);si=0;tinyMCE.getParentNode(tableElm.parentNode,function(n){if(n.nodeName=='BODY')return true;if(n.nodeType==1)tinyMCE.removeCSSClass(n,'mceFullscreenPos')});if(re&&tinyMCE.getParam("theme_advanced_resizing",false))re.style.display='block';tableElm.style.position='static';tableElm.style.zIndex='';tableElm.style.width='';tableElm.style.height='';tableElm.style.width=ds.oldTWidth?ds.oldTWidth:'';tableElm.style.height=ds.oldTHeight?ds.oldTHeight:'';iframe.style.width=ds.oldWidth?ds.oldWidth:'';iframe.style.height=ds.oldHeight?ds.oldHeight:'';tinyMCE.switchClass(inst.editorId+'_fullscreen','mceButtonNormal');ds.enabled=false;tinyMCE.removeCSSClass(cd.body,'mceFullscreen');cw.scrollTo(ds.scrollX,ds.scrollY);inst.useCSS=false}},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam('fullscreen_is_enabled'))tinyMCE.switchClass(editor_id+'_fullscreen','mceButtonSelected');return true}};tinyMCE.addPlugin("fullscreen",TinyMCE_FullScreenPlugin);
|
upload_to_tinymce_directory/plugins/fullscreen/editor_plugin_src.js
ADDED
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('fullscreen');
|
10 |
+
|
11 |
+
var TinyMCE_FullScreenPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Fullscreen',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
if (!tinyMCE.settings['fullscreen_skip_plugin_css'])
|
24 |
+
tinyMCE.importCSS(inst.getContainerWin().document, tinyMCE.baseURL + "/plugins/fullscreen/css/page.css");
|
25 |
+
},
|
26 |
+
|
27 |
+
getControlHTML : function(cn) {
|
28 |
+
switch (cn) {
|
29 |
+
case "fullscreen":
|
30 |
+
return tinyMCE.getButtonHTML(cn, 'lang_fullscreen_desc', '{$pluginurl}/images/fullscreen.gif', 'mceFullScreen');
|
31 |
+
}
|
32 |
+
|
33 |
+
return "";
|
34 |
+
},
|
35 |
+
|
36 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
37 |
+
var inst;
|
38 |
+
|
39 |
+
// Handle commands
|
40 |
+
switch (command) {
|
41 |
+
case "mceFullScreen":
|
42 |
+
inst = tinyMCE.getInstanceById(editor_id);
|
43 |
+
|
44 |
+
if (tinyMCE.getParam('fullscreen_new_window'))
|
45 |
+
this._toggleFullscreenWin(inst);
|
46 |
+
else
|
47 |
+
this._toggleFullscreen(inst);
|
48 |
+
|
49 |
+
return true;
|
50 |
+
}
|
51 |
+
|
52 |
+
// Pass to next handler in chain
|
53 |
+
return false;
|
54 |
+
},
|
55 |
+
|
56 |
+
_toggleFullscreenWin : function(inst) {
|
57 |
+
if (tinyMCE.getParam('fullscreen_is_enabled')) {
|
58 |
+
// In fullscreen mode
|
59 |
+
window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(inst.editorId));
|
60 |
+
top.close();
|
61 |
+
} else {
|
62 |
+
tinyMCE.setWindowArg('editor_id', inst.editorId);
|
63 |
+
|
64 |
+
var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
|
65 |
+
try { win.resizeTo(screen.availWidth, screen.availHeight); } catch (e) {}
|
66 |
+
}
|
67 |
+
},
|
68 |
+
|
69 |
+
_toggleFullscreen : function(inst) {
|
70 |
+
var ds = inst.getData('fullscreen'), editorContainer, tableElm, iframe, vp, cw, cd, re, w, h, si, blo, delta = 0, cell, row, fcml, bcml;
|
71 |
+
|
72 |
+
cw = inst.getContainerWin();
|
73 |
+
cd = cw.document;
|
74 |
+
editorContainer = cd.getElementById(inst.editorId + '_parent');
|
75 |
+
tableElm = editorContainer.firstChild;
|
76 |
+
iframe = inst.iframeElement;
|
77 |
+
re = cd.getElementById(inst.editorId + '_resize');
|
78 |
+
blo = document.getElementById('mce_fullscreen_blocker');
|
79 |
+
fcm = new TinyMCE_Layer(inst.editorId + '_fcMenu');
|
80 |
+
fcml = new TinyMCE_Layer(inst.editorId + '_fcMenu');
|
81 |
+
bcml = new TinyMCE_Layer(inst.editorId + '_bcMenu');
|
82 |
+
|
83 |
+
if (fcml.exists() && fcml.isVisible()) {
|
84 |
+
tinyMCE.switchClass(inst.editorId + '_forecolor', 'mceMenuButton');
|
85 |
+
fcml.hide();
|
86 |
+
}
|
87 |
+
|
88 |
+
if (bcml.exists() && bcml.isVisible()) {
|
89 |
+
tinyMCE.switchClass(inst.editorId + '_backcolor', 'mceMenuButton');
|
90 |
+
bcml.hide();
|
91 |
+
}
|
92 |
+
|
93 |
+
if (!ds.enabled) {
|
94 |
+
// Handle External Toolbar
|
95 |
+
if (inst.toolbarElement) {
|
96 |
+
delta += inst.toolbarElement.offsetHeight;
|
97 |
+
|
98 |
+
cell = tableElm.tBodies[0].insertRow(0).insertCell(-1);
|
99 |
+
cell.className = 'mceToolbarTop';
|
100 |
+
cell.nowrap = true;
|
101 |
+
|
102 |
+
ds.oldToolbarParent = inst.toolbarElement.parentNode;
|
103 |
+
ds.toolbarHolder = document.createTextNode('...');
|
104 |
+
|
105 |
+
cell.appendChild(ds.oldToolbarParent.replaceChild(ds.toolbarHolder, inst.toolbarElement));
|
106 |
+
}
|
107 |
+
|
108 |
+
ds.parents = [];
|
109 |
+
|
110 |
+
vp = tinyMCE.getViewPort(cw);
|
111 |
+
ds.scrollX = vp.left;
|
112 |
+
ds.scrollY = vp.top;
|
113 |
+
|
114 |
+
// Opera has a bug restoring scrollbars
|
115 |
+
if (!tinyMCE.isOpera)
|
116 |
+
tinyMCE.addCSSClass(cd.body, 'mceFullscreen');
|
117 |
+
|
118 |
+
tinyMCE.getParentNode(tableElm.parentNode, function (n) {
|
119 |
+
if (n.nodeName == 'BODY')
|
120 |
+
return true;
|
121 |
+
|
122 |
+
if (n.nodeType == 1)
|
123 |
+
tinyMCE.addCSSClass(n, 'mceFullscreenPos');
|
124 |
+
|
125 |
+
return false;
|
126 |
+
});
|
127 |
+
|
128 |
+
if (re)
|
129 |
+
re.style.display = 'none';
|
130 |
+
|
131 |
+
vp = tinyMCE.getViewPort(cw);
|
132 |
+
|
133 |
+
ds.oldWidth = iframe.style.width ? iframe.style.width : iframe.offsetWidth;
|
134 |
+
ds.oldHeight = iframe.style.height ? iframe.style.height : iframe.offsetHeight;
|
135 |
+
ds.oldTWidth = tableElm.style.width ? tableElm.style.width : tableElm.offsetWidth;
|
136 |
+
ds.oldTHeight = tableElm.style.height ? tableElm.style.height : tableElm.offsetHeight;
|
137 |
+
|
138 |
+
// Handle % width
|
139 |
+
if (ds.oldWidth && ds.oldWidth.indexOf)
|
140 |
+
ds.oldTWidth = ds.oldWidth.indexOf('%') != -1 ? ds.oldWidth : ds.oldTWidth;
|
141 |
+
|
142 |
+
if (!blo && tinyMCE.isRealIE) {
|
143 |
+
blo = tinyMCE.createTag(document, 'iframe', {id : 'mce_fullscreen_blocker', src : 'about:blank', frameBorder : 0, width : vp.width, height : vp.height, style : 'display: block; position: absolute; left: 0; top: 0; z-index: 999; margin: 0; padding: 0;'});
|
144 |
+
document.body.appendChild(blo);
|
145 |
+
}
|
146 |
+
|
147 |
+
tableElm.style.position = 'absolute';
|
148 |
+
tableElm.style.zIndex = 1000;
|
149 |
+
tableElm.style.left = tableElm.style.top = '0';
|
150 |
+
|
151 |
+
tableElm.style.width = vp.width + 'px';
|
152 |
+
tableElm.style.height = vp.height + 'px';
|
153 |
+
|
154 |
+
if (tinyMCE.isRealIE) {
|
155 |
+
iframe.style.width = vp.width + 'px';
|
156 |
+
iframe.style.height = vp.height + 'px';
|
157 |
+
|
158 |
+
// Calc new width/height based on overflow
|
159 |
+
w = iframe.parentNode.clientWidth - (tableElm.offsetWidth - vp.width);
|
160 |
+
h = iframe.parentNode.clientHeight - (tableElm.offsetHeight - vp.height);
|
161 |
+
} else {
|
162 |
+
w = iframe.parentNode.clientWidth;
|
163 |
+
h = iframe.parentNode.clientHeight;
|
164 |
+
}
|
165 |
+
|
166 |
+
iframe.style.width = w + "px";
|
167 |
+
iframe.style.height = (h+delta) + "px";
|
168 |
+
|
169 |
+
tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonSelected');
|
170 |
+
ds.enabled = true;
|
171 |
+
|
172 |
+
inst.useCSS = false;
|
173 |
+
} else {
|
174 |
+
// Handle External Toolbar
|
175 |
+
if (inst.toolbarElement) {
|
176 |
+
row = inst.toolbarElement.parentNode.parentNode;
|
177 |
+
|
178 |
+
row.parentNode.removeChild(row);
|
179 |
+
|
180 |
+
ds.oldToolbarParent.replaceChild(inst.toolbarElement, ds.toolbarHolder);
|
181 |
+
|
182 |
+
ds.oldToolbarParent = null;
|
183 |
+
ds.toolbarHolder = null;
|
184 |
+
}
|
185 |
+
|
186 |
+
if (blo)
|
187 |
+
blo.parentNode.removeChild(blo);
|
188 |
+
|
189 |
+
si = 0;
|
190 |
+
tinyMCE.getParentNode(tableElm.parentNode, function (n) {
|
191 |
+
if (n.nodeName == 'BODY')
|
192 |
+
return true;
|
193 |
+
|
194 |
+
if (n.nodeType == 1)
|
195 |
+
tinyMCE.removeCSSClass(n, 'mceFullscreenPos');
|
196 |
+
});
|
197 |
+
|
198 |
+
if (re && tinyMCE.getParam("theme_advanced_resizing", false))
|
199 |
+
re.style.display = 'block';
|
200 |
+
|
201 |
+
tableElm.style.position = 'static';
|
202 |
+
tableElm.style.zIndex = '';
|
203 |
+
tableElm.style.width = '';
|
204 |
+
tableElm.style.height = '';
|
205 |
+
|
206 |
+
tableElm.style.width = ds.oldTWidth ? ds.oldTWidth : '';
|
207 |
+
tableElm.style.height = ds.oldTHeight ? ds.oldTHeight : '';
|
208 |
+
|
209 |
+
iframe.style.width = ds.oldWidth ? ds.oldWidth : '';
|
210 |
+
iframe.style.height = ds.oldHeight ? ds.oldHeight : '';
|
211 |
+
|
212 |
+
tinyMCE.switchClass(inst.editorId + '_fullscreen', 'mceButtonNormal');
|
213 |
+
ds.enabled = false;
|
214 |
+
|
215 |
+
tinyMCE.removeCSSClass(cd.body, 'mceFullscreen');
|
216 |
+
cw.scrollTo(ds.scrollX, ds.scrollY);
|
217 |
+
|
218 |
+
inst.useCSS = false;
|
219 |
+
}
|
220 |
+
},
|
221 |
+
|
222 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
223 |
+
if (tinyMCE.getParam('fullscreen_is_enabled'))
|
224 |
+
tinyMCE.switchClass(editor_id + '_fullscreen', 'mceButtonSelected');
|
225 |
+
|
226 |
+
return true;
|
227 |
+
}
|
228 |
+
};
|
229 |
+
|
230 |
+
tinyMCE.addPlugin("fullscreen", TinyMCE_FullScreenPlugin);
|
upload_to_tinymce_directory/plugins/fullscreen/fullscreen.htm
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_fullscreen_title}</title>
|
4 |
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
5 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript">
|
7 |
+
function patchCallback(settings, key) {
|
8 |
+
if (settings[key])
|
9 |
+
settings[key] = "window.opener." + settings[key];
|
10 |
+
}
|
11 |
+
|
12 |
+
var settings = new Array();
|
13 |
+
|
14 |
+
// Clone array
|
15 |
+
for (var name in window.opener.tinyMCE.settings)
|
16 |
+
settings[name] = window.opener.tinyMCE.settings[name];
|
17 |
+
|
18 |
+
// Override options for fullscreen
|
19 |
+
for (var name in window.opener.tinyMCE.settings.fullscreen_settings)
|
20 |
+
settings[name] = window.opener.tinyMCE.settings.fullscreen_settings[name];
|
21 |
+
|
22 |
+
// Patch callbacks, make them point to window.opener
|
23 |
+
patchCallback(settings, 'urlconverter_callback');
|
24 |
+
patchCallback(settings, 'insertlink_callback');
|
25 |
+
patchCallback(settings, 'insertimage_callback');
|
26 |
+
patchCallback(settings, 'setupcontent_callback');
|
27 |
+
patchCallback(settings, 'save_callback');
|
28 |
+
patchCallback(settings, 'onchange_callback');
|
29 |
+
patchCallback(settings, 'init_instance_callback');
|
30 |
+
patchCallback(settings, 'file_browser_callback');
|
31 |
+
patchCallback(settings, 'cleanup_callback');
|
32 |
+
patchCallback(settings, 'execcommand_callback');
|
33 |
+
patchCallback(settings, 'oninit');
|
34 |
+
|
35 |
+
// Set options
|
36 |
+
settings['mode'] = 'exact';
|
37 |
+
settings['elements'] = 'fullscreenarea';
|
38 |
+
settings['ask'] = false;
|
39 |
+
settings['setupcontent_callback'] = 'setupContent';
|
40 |
+
settings['fullscreen_is_enabled'] = true;
|
41 |
+
settings['fullscreen_editor_id'] = window.opener.tinyMCE.getWindowArg("editor_id");
|
42 |
+
settings['theme_advanced_resizing'] = false;
|
43 |
+
|
44 |
+
// Init
|
45 |
+
tinyMCE.init(settings);
|
46 |
+
tinyMCE.documentBasePath = window.opener.tinyMCE.documentBasePath;
|
47 |
+
|
48 |
+
function setupContent(editor_id, body, doc) {
|
49 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
50 |
+
var content = window.opener.tinyMCE.getContent(tinyMCE.getParam('fullscreen_editor_id'));
|
51 |
+
|
52 |
+
// Setup title
|
53 |
+
var divElm = document.createElement("div");
|
54 |
+
divElm.innerHTML = tinyMCELang['lang_fullscreen_title'];
|
55 |
+
document.title = divElm.innerHTML;
|
56 |
+
|
57 |
+
// Get content
|
58 |
+
inst.execCommand('mceSetContent', false, content);
|
59 |
+
}
|
60 |
+
|
61 |
+
function unloadHandler(e) {
|
62 |
+
moveContent();
|
63 |
+
}
|
64 |
+
|
65 |
+
function moveContent() {
|
66 |
+
var doc = tinyMCE.isMSIE ? window.frames['mce_editor_0'].window.document : document.getElementById('mce_editor_0').contentDocument;
|
67 |
+
window.opener.tinyMCE.setInnerHTML(window.opener.tinyMCE.selectedInstance.getBody(), doc.body.innerHTML);
|
68 |
+
}
|
69 |
+
|
70 |
+
// Add onunload
|
71 |
+
tinyMCE.addEvent(window, "beforeunload", unloadHandler);
|
72 |
+
|
73 |
+
function doParentSubmit() {
|
74 |
+
moveContent();
|
75 |
+
|
76 |
+
if (window.opener.tinyMCE.selectedInstance.formElement.form)
|
77 |
+
window.opener.tinyMCE.selectedInstance.formElement.form.submit();
|
78 |
+
|
79 |
+
window.close();
|
80 |
+
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
</script>
|
84 |
+
<base target="_self" />
|
85 |
+
</head>
|
86 |
+
<body style="margin: 0; overflow: hidden; height: 100%" scrolling="no" scroll="no">
|
87 |
+
<form onsubmit="doParentSubmit();" style="height: 100%">
|
88 |
+
<textarea id="fullscreenarea" style="width: 100%; height: 100%"></textarea>
|
89 |
+
</form>
|
90 |
+
</body>
|
91 |
+
</html>
|
upload_to_tinymce_directory/plugins/fullscreen/images/fullscreen.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/fullscreen/langs/en.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('',{
|
4 |
+
fullscreen_desc : 'Toggle fullscreen mode'
|
5 |
+
});
|
upload_to_tinymce_directory/plugins/fullscreen/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/inlinepopups/css/inlinepopup.css
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Window classes */
|
2 |
+
|
3 |
+
.mceWindow {
|
4 |
+
position: absolute;
|
5 |
+
left: 0;
|
6 |
+
top: 0;
|
7 |
+
border: 1px solid black;
|
8 |
+
background-color: #D4D0C8;
|
9 |
+
}
|
10 |
+
|
11 |
+
.mceWindowHead {
|
12 |
+
background-color: #334F8D;
|
13 |
+
width: 100%;
|
14 |
+
height: 18px;
|
15 |
+
cursor: move;
|
16 |
+
overflow: hidden;
|
17 |
+
}
|
18 |
+
|
19 |
+
.mceWindowBody {
|
20 |
+
clear: both;
|
21 |
+
background-color: white;
|
22 |
+
}
|
23 |
+
|
24 |
+
.mceWindowStatusbar {
|
25 |
+
background-color: #D4D0C8;
|
26 |
+
height: 12px;
|
27 |
+
border-top: 1px solid black;
|
28 |
+
}
|
29 |
+
|
30 |
+
.mceWindowTitle {
|
31 |
+
float: left;
|
32 |
+
font-family: "MS Sans Serif";
|
33 |
+
font-size: 9pt;
|
34 |
+
font-weight: bold;
|
35 |
+
line-height: 18px;
|
36 |
+
color: white;
|
37 |
+
margin-left: 2px;
|
38 |
+
overflow: hidden;
|
39 |
+
}
|
40 |
+
|
41 |
+
.mceWindowHeadTools {
|
42 |
+
margin-right: 2px;
|
43 |
+
}
|
44 |
+
|
45 |
+
.mceWindowClose, .mceWindowMinimize, .mceWindowMaximize {
|
46 |
+
display: block;
|
47 |
+
float: right;
|
48 |
+
overflow: hidden;
|
49 |
+
margin-top: 2px;
|
50 |
+
}
|
51 |
+
|
52 |
+
.mceWindowClose {
|
53 |
+
margin-left: 2px;
|
54 |
+
}
|
55 |
+
|
56 |
+
.mceWindowMinimize {
|
57 |
+
}
|
58 |
+
|
59 |
+
.mceWindowMaximize {
|
60 |
+
}
|
61 |
+
|
62 |
+
.mceWindowResize {
|
63 |
+
display: block;
|
64 |
+
float: right;
|
65 |
+
overflow: hidden;
|
66 |
+
cursor: se-resize;
|
67 |
+
width: 12px;
|
68 |
+
height: 12px;
|
69 |
+
}
|
upload_to_tinymce_directory/plugins/inlinepopups/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var TinyMCE_InlinePopupsPlugin={getInfo:function(){return{longname:'Inline Popups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}}};tinyMCE.addPlugin("inlinepopups",TinyMCE_InlinePopupsPlugin);TinyMCE_Engine.prototype.orgOpenWindow=TinyMCE_Engine.prototype.openWindow;TinyMCE_Engine.prototype.orgCloseWindow=TinyMCE_Engine.prototype.closeWindow;TinyMCE_Engine.prototype.openWindow=function(template,args){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;if(!(minWidth=parseInt(template['minWidth'])))minWidth=100;if(!(minHeight=parseInt(template['minHeight'])))minHeight=100;resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";height+=18;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');if(tinyMCE.hasPlugin('fullscreen')&&this.selectedInstance.getData('fullscreen').enabled)pos={absLeft:0,absTop:0};else pos=tinyMCE.getAbsPosition(elm);pos.absLeft+=Math.round((elm.firstChild.clientWidth/ 2) - (width /2));pos.absTop+=Math.round((elm.firstChild.clientHeight/ 2) - (height /2));mcWindows.open(url,mcWindows.idCounter++,"modal=yes,width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",statusbar="+resizable+",left="+pos.absLeft+",top="+pos.absTop+",minWidth="+minWidth+",minHeight="+minHeight)};TinyMCE_Engine.prototype.closeWindow=function(win){var gotit=false,n,w;for(n in mcWindows.windows){w=mcWindows.windows[n];if(typeof(w)=='function')continue;if(win.name==w.id+'_iframe'){w.close();gotit=true}}if(!gotit)this.orgCloseWindow(win);tinyMCE.selectedInstance.getWin().focus()};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}};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=1001;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.addEvent(window,"resize",mcWindows.eventDispatcher);this.addEvent(document,"scroll",mcWindows.eventDispatcher);this.doc=document};TinyMCE_Windows.prototype.getBounds=function(){if(!this.bounds){var vp=tinyMCE.getViewPort(window);var top,left,bottom,right,docEl=this.doc.documentElement;top=vp.top;left=vp.left;bottom=vp.height+top-2;right=vp.width+left-22;this.bounds=[left,top,right,bottom]}return this.bounds};TinyMCE_Windows.prototype.clampBoxPosition=function(x,y,w,h,minW,minH){var bounds=this.getBounds();x=Math.max(bounds[0],Math.min(bounds[2],x+w)-w);y=Math.max(bounds[1],Math.min(bounds[3],y+h)-h);return this.clampBoxSize(x,y,w,h,minW,minH)};TinyMCE_Windows.prototype.clampBoxSize=function(x,y,w,h,minW,minH){var bounds=this.getBounds();return[x,y,Math.max(minW,Math.min(bounds[2],x+w)-x),Math.max(minH,Math.min(bounds[3],y+h)-y)]};TinyMCE_Windows.prototype.getParam=function(name,default_value){var value=null;value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];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;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;case"scroll":case"resize":if(mcWindows.clampUpdateTimeout)clearTimeout(mcWindows.clampUpdateTimeout);mcWindows.clampEventType=e.type;mcWindows.clampUpdateTimeout=setTimeout(function(){mcWindows.updateClamping()},100);break}};TinyMCE_Windows.prototype.updateClamping=function(){var clamp,oversize,etype=mcWindows.clampEventType;this.bounds=null;this.clampUpdateTimeout=null;for(var n in this.windows){win=this.windows[n];if(typeof(win)=='function'||!win.winElement)continue;clamp=mcWindows.clampBoxPosition(win.left,win.top,win.winElement.scrollWidth,win.winElement.scrollHeight,win.features.minWidth,win.features.minHeight);oversize=(clamp[2]!=win.winElement.scrollWidth||clamp[3]!=win.winElement.scrollHeight)?true:false;if(!oversize||win.features.resizable=="yes"||etype!="scroll")win.moveTo(clamp[0],clamp[1]);if(oversize&&win.features.resizable=="yes")win.resizeTo(clamp[2],clamp[3])}};TinyMCE_Windows.prototype.addEvent=function(obj,name,handler){if(this.isMSIE)obj.attachEvent("on"+name,handler);else obj.addEventListener(name,handler,false)};TinyMCE_Windows.prototype.cancelEvent=function(e){if(this.isMSIE){e.returnValue=false;e.cancelBubble=true}else e.preventDefault()};TinyMCE_Windows.prototype.parseFeatures=function(opts){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['minwidth']="100";options['minheight']="100";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<optionChunks.length;i++){var parts=optionChunks[i].split('=');if(parts.length==2)options[parts[0]]=parts[1]}options['left']=parseInt(options['left']);options['top']=parseInt(options['top']);options['width']=parseInt(options['width']);options['height']=parseInt(options['height']);options['minWidth']=parseInt(options['minwidth']);options['minHeight']=parseInt(options['minheight']);return options};TinyMCE_Windows.prototype.open=function(url,name,features){this.lastSelectedWindow=this.selectedWindow;var win=new TinyMCE_Window();var winDiv,html="",id;var imgPath=this.getParam("images_path");features=this.parseFeatures(features);var clamp=mcWindows.clampBoxPosition(features['left'],features['top'],features['width'],features['height'],features['minWidth'],features['minHeight']);features['left']=clamp[0];features['top']=clamp[1];if(features['resizable']=="yes"){features['width']=clamp[2];features['height']=clamp[3]}id="mcWindow_"+name;win.deltaHeight=18;if(features['statusbar']=="yes"){win.deltaHeight+=13;if(this.isMSIE)win.deltaHeight+=1}width=parseInt(features['width']);height=parseInt(features['height'])-win.deltaHeight;if(this.isMSIE)width-=2;win.id=id;win.url=url;win.name=name;win.features=features;this.windows[name]=win;iframeWidth=width;iframeHeight=height;html+='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';html+='<html>';html+='<head>';html+='<title>Wrapper iframe</title>';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';html+='<link href="'+this.getParam("css_file")+'" rel="stylesheet" type="text/css" />';html+='</head>';html+='<body onload="parent.mcWindows.onLoad(\''+name+'\');">';html+='<div id="'+id+'_container" class="mceWindow">';html+='<div id="'+id+'_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';html+=' <div id="'+id+'_title" class="mceWindowTitle"';html+=' onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';html+=' <div class="mceWindowHeadTools">';html+=' <a href="javascript:parent.mcWindows.windows[\''+name+'\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="'+imgPath+'/window_close.gif" /></a>';if(features['resizable']=="yes"&&features['maximizable']=="yes")html+=' <a href="javascript:parent.mcWindows.windows[\''+name+'\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="'+imgPath+'/window_maximize.gif" /></a>';html+=' </div>';html+='</div><div id="'+id+'_body" class="mceWindowBody" style="width: '+width+'px; height: '+height+'px;">';html+='<iframe id="'+id+'_iframe" name="'+id+'_iframe" frameborder="0" width="'+iframeWidth+'" height="'+iframeHeight+'" src="'+url+'" class="mceWindowBodyIframe" scrolling="'+features['scrollbars']+'"></iframe></div>';if(features['statusbar']=="yes"){html+='<div id="'+id+'_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();">';if(features['resizable']=="yes"){if(this.isGecko)html+='<div id="'+id+'_resize" class="mceWindowResize"><div style="background-image: url(\''+imgPath+'/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';else html+='<div id="'+id+'_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\''+name+'\'].focus();" border="0" src="'+imgPath+'/window_resize.gif" /></div>'}html+='</div>'}html+='</div>';html+='</body>';html+='</html>';this.createFloatingIFrame(id,features['left'],features['top'],features['width'],features['height'],html)};TinyMCE_Windows.prototype.setDocumentLock=function(state){var elm=document.getElementById('mcWindowEventBlocker');if(state){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='<img src="'+imgPath+'/spacer.gif" width="'+width+'" height="'+height+'" />';elm.style.zIndex=mcWindows.zindex-1;elm.style.display="block"}else if(elm!=null){if(mcWindows.windows.length==0)elm.parentNode.removeChild(elm);else elm.style.zIndex=mcWindows.zindex-1}};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];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");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<window.frames.length;i++){if(!window.frames[i]._hasMouseHandlers){if(mcWindows.isMSIE){mcWindows.addEvent(window.frames[i].document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i].document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(window.frames[i],"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(window.frames[i],"mouseup",mcWindows.eventDispatcher)}window.frames[i]._hasMouseHandlers=true}}if(mcWindows.isMSIE){mcWindows.addEvent(win.frame.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame.document,"mouseup",mcWindows.eventDispatcher)}else{mcWindows.addEvent(win.frame,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(win.frame,"focus",mcWindows.eventDispatcher)}var func=this.getParam("on_open_window","");if(func!="")eval(func+"(win);");win.focus();if(win.features['modal']=="yes")mcWindows.setDocumentLock(true)};TinyMCE_Windows.prototype.createFloatingIFrame=function(id_prefix,left,top,width,height,html){var iframe=document.createElement("iframe");var div=document.createElement("div"),doc;width=parseInt(width);height=parseInt(height)+1;div.setAttribute("id",id_prefix+"_div");div.setAttribute("width",width);div.setAttribute("height",(height));div.style.position="absolute";div.style.left=left+"px";div.style.top=top+"px";div.style.width=width+"px";div.style.height=(height)+"px";div.style.backgroundColor="white";div.style.display="none";if(this.isGecko){iframeWidth=width+2;iframeHeight=height+2}else{iframeWidth=width;iframeHeight=height+1}iframe.setAttribute("id",id_prefix+"_iframe");iframe.setAttribute("name",id_prefix+"_iframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",iframeWidth);iframe.setAttribute("height",iframeHeight);iframe.setAttribute("scrolling","no");iframe.style.width=iframeWidth+"px";iframe.style.height=iframeHeight+"px";iframe.style.backgroundColor="white";div.appendChild(iframe);document.body.appendChild(div);div.innerHTML=div.innerHTML;if(this.isSafari){window.setTimeout(function(){var doc=window.frames[id_prefix+'_iframe'].document;doc.open();doc.write(html);doc.close()},10)}else{doc=window.frames[id_prefix+'_iframe'].window.document;doc.open();doc.write(html);doc.close()}div.style.display="block";return div};function TinyMCE_Window(){};TinyMCE_Window.prototype.focus=function(){if(this!=mcWindows.selectedWindow){this.winElement.style.zIndex=++mcWindows.zindex;mcWindows.lastSelectedWindow=mcWindows.selectedWindow;mcWindows.selectedWindow=this}};TinyMCE_Window.prototype.minimize=function(){};TinyMCE_Window.prototype.maximize=function(){if(this.restoreSize){this.moveTo(this.restoreSize[0],this.restoreSize[1]);this.resizeTo(this.restoreSize[2],this.restoreSize[3]);this.updateClamping();this.restoreSize=null}else{var bounds=mcWindows.getBounds();this.restoreSize=[this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight];this.moveTo(bounds[0],bounds[1]);this.resizeTo(bounds[2]-bounds[0],bounds[3]-bounds[1])}};TinyMCE_Window.prototype.startResize=function(){mcWindows.action="resize"};TinyMCE_Window.prototype.startMove=function(e){mcWindows.action="move"};TinyMCE_Window.prototype.close=function(){if(this.frame&&this.frame['tinyMCEPopup'])this.frame['tinyMCEPopup'].restoreSelection();if(mcWindows.lastSelectedWindow!=null)mcWindows.lastSelectedWindow.focus();var mcWindowsNew=new Array();for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win.name!=this.name)mcWindowsNew[n]=win}mcWindows.windows=mcWindowsNew;var e=mcWindows.doc.getElementById(this.id+"_iframe");e.parentNode.removeChild(e);var e=mcWindows.doc.getElementById(this.id+"_div");e.parentNode.removeChild(e);mcWindows.setDocumentLock(false)};TinyMCE_Window.prototype.onMouseMove=function(e){var clamp;var dx=e.screenX-mcWindows.mouseDownScreenX;var dy=e.screenY-mcWindows.mouseDownScreenY;switch(mcWindows.action){case"resize":clamp=mcWindows.clampBoxSize(this.left,this.top,mcWindows.mouseDownWidth+(e.screenX-mcWindows.mouseDownScreenX),mcWindows.mouseDownHeight+(e.screenY-mcWindows.mouseDownScreenY),this.features.minWidth,this.features.minHeight);this.resizeTo(clamp[2],clamp[3]);mcWindows.cancelEvent(e);break;case"move":this.left=mcWindows.mouseDownLayerX+(e.screenX-mcWindows.mouseDownScreenX);this.top=mcWindows.mouseDownLayerY+(e.screenY-mcWindows.mouseDownScreenY);this.updateClamping();mcWindows.cancelEvent(e);break}};TinyMCE_Window.prototype.moveTo=function(x,y){this.left=x;this.top=y;this.winElement.style.left=this.left+"px";this.winElement.style.top=this.top+"px"};TinyMCE_Window.prototype.resizeTo=function(width,height){this.wrapperIFrameElement.style.width=(width+2)+'px';this.wrapperIFrameElement.style.height=(height+2)+'px';this.wrapperIFrameElement.width=width+2;this.wrapperIFrameElement.height=height+2;this.winElement.style.width=width+'px';this.winElement.style.height=height+'px';height=height-this.deltaHeight;this.containerElement.style.width=width+'px';this.iframeElement.style.width=width+'px';this.iframeElement.style.height=height+'px';this.bodyElement.style.width=width+'px';this.bodyElement.style.height=height+'px';this.headElement.style.width=width+'px';};TinyMCE_Window.prototype.updateClamping=function(){var clamp,oversize;clamp=mcWindows.clampBoxPosition(this.left,this.top,this.winElement.scrollWidth,this.winElement.scrollHeight,this.features.minWidth,this.features.minHeight);oversize=(clamp[2]!=this.winElement.scrollWidth||clamp[3]!=this.winElement.scrollHeight)?true:false;this.moveTo(clamp[0],clamp[1]);if(this.features.resizable=="yes"&&oversize)this.resizeTo(clamp[2],clamp[3])};function debug(msg){document.getElementById('debug').value+=msg+"\n"}TinyMCE_Window.prototype.onMouseUp=function(e){mcWindows.action="none"};TinyMCE_Window.prototype.onFocus=function(e){var winRef=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(winRef.name==win.id+"_iframe"){win.focus();return}}};TinyMCE_Window.prototype.onMouseDown=function(e){var elm=mcWindows.isMSIE?this.wrapperFrame.event.srcElement:e.target;mcWindows.mouseDownScreenX=e.screenX;mcWindows.mouseDownScreenY=e.screenY;mcWindows.mouseDownLayerX=this.left;mcWindows.mouseDownLayerY=this.top;mcWindows.mouseDownWidth=parseInt(this.winElement.style.width);mcWindows.mouseDownHeight=parseInt(this.winElement.style.height);if(this.resizeElement!=null&&elm==this.resizeElement.firstChild)this.startResize(e);else this.startMove(e);mcWindows.cancelEvent(e)};var mcWindows=new TinyMCE_Windows();mcWindows.init({images_path:tinyMCE.baseURL+"/plugins/inlinepopups/images",css_file:tinyMCE.baseURL+"/plugins/inlinepopups/css/inlinepopup.css"});
|
upload_to_tinymce_directory/plugins/inlinepopups/editor_plugin_src.js
ADDED
@@ -0,0 +1,819 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 268 2007-04-28 15:52:59Z spocke $
|
3 |
+
*
|
4 |
+
* Moxiecode DHTML Windows script.
|
5 |
+
*
|
6 |
+
* @author Moxiecode
|
7 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Patch openWindow, closeWindow TinyMCE functions
|
11 |
+
|
12 |
+
var TinyMCE_InlinePopupsPlugin = {
|
13 |
+
getInfo : function() {
|
14 |
+
return {
|
15 |
+
longname : 'Inline Popups',
|
16 |
+
author : 'Moxiecode Systems AB',
|
17 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
18 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
|
19 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
20 |
+
};
|
21 |
+
}
|
22 |
+
};
|
23 |
+
|
24 |
+
tinyMCE.addPlugin("inlinepopups", TinyMCE_InlinePopupsPlugin);
|
25 |
+
|
26 |
+
// Patch openWindow, closeWindow TinyMCE functions
|
27 |
+
|
28 |
+
TinyMCE_Engine.prototype.orgOpenWindow = TinyMCE_Engine.prototype.openWindow;
|
29 |
+
TinyMCE_Engine.prototype.orgCloseWindow = TinyMCE_Engine.prototype.closeWindow;
|
30 |
+
|
31 |
+
TinyMCE_Engine.prototype.openWindow = function(template, args) {
|
32 |
+
// Does the caller support inline
|
33 |
+
if (args['inline'] != "yes" || tinyMCE.isOpera || tinyMCE.getParam("plugins").indexOf('inlinepopups') == -1) {
|
34 |
+
mcWindows.selectedWindow = null;
|
35 |
+
args['mce_inside_iframe'] = false;
|
36 |
+
this.orgOpenWindow(template, args);
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
var url, resizable, scrollbars;
|
41 |
+
|
42 |
+
args['mce_inside_iframe'] = true;
|
43 |
+
tinyMCE.windowArgs = args;
|
44 |
+
|
45 |
+
if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
|
46 |
+
url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
|
47 |
+
else
|
48 |
+
url = template['file'];
|
49 |
+
|
50 |
+
if (!(width = parseInt(template['width'])))
|
51 |
+
width = 320;
|
52 |
+
|
53 |
+
if (!(height = parseInt(template['height'])))
|
54 |
+
height = 200;
|
55 |
+
|
56 |
+
if (!(minWidth = parseInt(template['minWidth'])))
|
57 |
+
minWidth = 100;
|
58 |
+
|
59 |
+
if (!(minHeight = parseInt(template['minHeight'])))
|
60 |
+
minHeight = 100;
|
61 |
+
|
62 |
+
resizable = (args && args['resizable']) ? args['resizable'] : "no";
|
63 |
+
scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
|
64 |
+
|
65 |
+
height += 18;
|
66 |
+
|
67 |
+
// Replace all args as variables in URL
|
68 |
+
for (var name in args) {
|
69 |
+
if (typeof(args[name]) == 'function')
|
70 |
+
continue;
|
71 |
+
|
72 |
+
url = tinyMCE.replaceVar(url, name, escape(args[name]));
|
73 |
+
}
|
74 |
+
|
75 |
+
var elm = document.getElementById(this.selectedInstance.editorId + '_parent');
|
76 |
+
|
77 |
+
if (tinyMCE.hasPlugin('fullscreen') && this.selectedInstance.getData('fullscreen').enabled)
|
78 |
+
pos = { absLeft: 0, absTop: 0 };
|
79 |
+
else
|
80 |
+
pos = tinyMCE.getAbsPosition(elm);
|
81 |
+
|
82 |
+
// Center div in editor area
|
83 |
+
pos.absLeft += Math.round((elm.firstChild.clientWidth / 2) - (width / 2));
|
84 |
+
pos.absTop += Math.round((elm.firstChild.clientHeight / 2) - (height / 2));
|
85 |
+
|
86 |
+
mcWindows.open(url, mcWindows.idCounter++, "modal=yes,width=" + width+ ",height=" + height + ",resizable=" + resizable + ",scrollbars=" + scrollbars + ",statusbar=" + resizable + ",left=" + pos.absLeft + ",top=" + pos.absTop + ",minWidth=" + minWidth + ",minHeight=" + minHeight );
|
87 |
+
};
|
88 |
+
|
89 |
+
TinyMCE_Engine.prototype.closeWindow = function(win) {
|
90 |
+
var gotit = false, n, w;
|
91 |
+
|
92 |
+
for (n in mcWindows.windows) {
|
93 |
+
w = mcWindows.windows[n];
|
94 |
+
|
95 |
+
if (typeof(w) == 'function')
|
96 |
+
continue;
|
97 |
+
|
98 |
+
if (win.name == w.id + '_iframe') {
|
99 |
+
w.close();
|
100 |
+
gotit = true;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
if (!gotit)
|
105 |
+
this.orgCloseWindow(win);
|
106 |
+
|
107 |
+
tinyMCE.selectedInstance.getWin().focus();
|
108 |
+
};
|
109 |
+
|
110 |
+
TinyMCE_Engine.prototype.setWindowTitle = function(win_ref, title) {
|
111 |
+
for (var n in mcWindows.windows) {
|
112 |
+
var win = mcWindows.windows[n];
|
113 |
+
if (typeof(win) == 'function')
|
114 |
+
continue;
|
115 |
+
|
116 |
+
if (win_ref.name == win.id + "_iframe")
|
117 |
+
window.frames[win.id + "_iframe"].document.getElementById(win.id + '_title').innerHTML = title;
|
118 |
+
}
|
119 |
+
};
|
120 |
+
|
121 |
+
// * * * * * TinyMCE_Windows classes below
|
122 |
+
|
123 |
+
// Windows handler
|
124 |
+
function TinyMCE_Windows() {
|
125 |
+
this.settings = new Array();
|
126 |
+
this.windows = new Array();
|
127 |
+
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
|
128 |
+
this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
|
129 |
+
this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
|
130 |
+
this.isMac = navigator.userAgent.indexOf('Mac') != -1;
|
131 |
+
this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
|
132 |
+
this.action = "none";
|
133 |
+
this.selectedWindow = null;
|
134 |
+
this.lastSelectedWindow = null;
|
135 |
+
this.zindex = 1001;
|
136 |
+
this.mouseDownScreenX = 0;
|
137 |
+
this.mouseDownScreenY = 0;
|
138 |
+
this.mouseDownLayerX = 0;
|
139 |
+
this.mouseDownLayerY = 0;
|
140 |
+
this.mouseDownWidth = 0;
|
141 |
+
this.mouseDownHeight = 0;
|
142 |
+
this.idCounter = 0;
|
143 |
+
};
|
144 |
+
|
145 |
+
TinyMCE_Windows.prototype.init = function(settings) {
|
146 |
+
this.settings = settings;
|
147 |
+
|
148 |
+
if (this.isMSIE)
|
149 |
+
this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
|
150 |
+
else
|
151 |
+
this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
|
152 |
+
|
153 |
+
this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
|
154 |
+
|
155 |
+
this.addEvent(window, "resize", mcWindows.eventDispatcher);
|
156 |
+
this.addEvent(document, "scroll", mcWindows.eventDispatcher);
|
157 |
+
|
158 |
+
this.doc = document;
|
159 |
+
};
|
160 |
+
|
161 |
+
TinyMCE_Windows.prototype.getBounds = function() {
|
162 |
+
if (!this.bounds) {
|
163 |
+
var vp = tinyMCE.getViewPort(window);
|
164 |
+
var top, left, bottom, right, docEl = this.doc.documentElement;
|
165 |
+
|
166 |
+
top = vp.top;
|
167 |
+
left = vp.left;
|
168 |
+
bottom = vp.height + top - 2;
|
169 |
+
right = vp.width + left - 22; // TODO this number is platform dependant
|
170 |
+
// x1, y1, x2, y2
|
171 |
+
this.bounds = [left, top, right, bottom];
|
172 |
+
}
|
173 |
+
return this.bounds;
|
174 |
+
};
|
175 |
+
|
176 |
+
TinyMCE_Windows.prototype.clampBoxPosition = function(x, y, w, h, minW, minH) {
|
177 |
+
var bounds = this.getBounds();
|
178 |
+
|
179 |
+
x = Math.max(bounds[0], Math.min(bounds[2], x + w) - w);
|
180 |
+
y = Math.max(bounds[1], Math.min(bounds[3], y + h) - h);
|
181 |
+
|
182 |
+
return this.clampBoxSize(x, y, w, h, minW, minH);
|
183 |
+
};
|
184 |
+
|
185 |
+
TinyMCE_Windows.prototype.clampBoxSize = function(x, y, w, h, minW, minH) {
|
186 |
+
var bounds = this.getBounds();
|
187 |
+
|
188 |
+
return [
|
189 |
+
x, y,
|
190 |
+
Math.max(minW, Math.min(bounds[2], x + w) - x),
|
191 |
+
Math.max(minH, Math.min(bounds[3], y + h) - y)
|
192 |
+
];
|
193 |
+
};
|
194 |
+
|
195 |
+
TinyMCE_Windows.prototype.getParam = function(name, default_value) {
|
196 |
+
var value = null;
|
197 |
+
|
198 |
+
value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
|
199 |
+
|
200 |
+
// Fix bool values
|
201 |
+
if (value == "true" || value == "false")
|
202 |
+
return (value == "true");
|
203 |
+
|
204 |
+
return value;
|
205 |
+
};
|
206 |
+
|
207 |
+
TinyMCE_Windows.prototype.eventDispatcher = function(e) {
|
208 |
+
e = typeof(e) == "undefined" ? window.event : e;
|
209 |
+
|
210 |
+
if (mcWindows.selectedWindow == null)
|
211 |
+
return;
|
212 |
+
|
213 |
+
// Switch focus
|
214 |
+
if (mcWindows.isGecko && e.type == "mousedown") {
|
215 |
+
var elm = e.currentTarget;
|
216 |
+
|
217 |
+
for (var n in mcWindows.windows) {
|
218 |
+
var win = mcWindows.windows[n];
|
219 |
+
|
220 |
+
if (win.headElement == elm || win.resizeElement == elm) {
|
221 |
+
win.focus();
|
222 |
+
break;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
switch (e.type) {
|
228 |
+
case "mousemove":
|
229 |
+
mcWindows.selectedWindow.onMouseMove(e);
|
230 |
+
break;
|
231 |
+
|
232 |
+
case "mouseup":
|
233 |
+
mcWindows.selectedWindow.onMouseUp(e);
|
234 |
+
break;
|
235 |
+
|
236 |
+
case "mousedown":
|
237 |
+
mcWindows.selectedWindow.onMouseDown(e);
|
238 |
+
break;
|
239 |
+
|
240 |
+
case "focus":
|
241 |
+
mcWindows.selectedWindow.onFocus(e);
|
242 |
+
break;
|
243 |
+
case "scroll":
|
244 |
+
case "resize":
|
245 |
+
if (mcWindows.clampUpdateTimeout)
|
246 |
+
clearTimeout(mcWindows.clampUpdateTimeout);
|
247 |
+
mcWindows.clampEventType = e.type;
|
248 |
+
mcWindows.clampUpdateTimeout =
|
249 |
+
setTimeout(function () {mcWindows.updateClamping()}, 100);
|
250 |
+
break;
|
251 |
+
}
|
252 |
+
};
|
253 |
+
|
254 |
+
TinyMCE_Windows.prototype.updateClamping = function () {
|
255 |
+
var clamp, oversize, etype = mcWindows.clampEventType;
|
256 |
+
|
257 |
+
this.bounds = null; // Recalc window bounds on resize/scroll
|
258 |
+
this.clampUpdateTimeout = null;
|
259 |
+
|
260 |
+
for (var n in this.windows) {
|
261 |
+
win = this.windows[n];
|
262 |
+
if (typeof(win) == 'function' || ! win.winElement) continue;
|
263 |
+
|
264 |
+
clamp = mcWindows.clampBoxPosition(
|
265 |
+
win.left, win.top,
|
266 |
+
win.winElement.scrollWidth,
|
267 |
+
win.winElement.scrollHeight,
|
268 |
+
win.features.minWidth,
|
269 |
+
win.features.minHeight
|
270 |
+
);
|
271 |
+
oversize = (
|
272 |
+
clamp[2] != win.winElement.scrollWidth ||
|
273 |
+
clamp[3] != win.winElement.scrollHeight
|
274 |
+
) ? true : false;
|
275 |
+
|
276 |
+
if (!oversize || win.features.resizable == "yes" || etype != "scroll")
|
277 |
+
win.moveTo(clamp[0], clamp[1]);
|
278 |
+
if (oversize && win.features.resizable == "yes")
|
279 |
+
win.resizeTo(clamp[2], clamp[3]);
|
280 |
+
}
|
281 |
+
};
|
282 |
+
|
283 |
+
TinyMCE_Windows.prototype.addEvent = function(obj, name, handler) {
|
284 |
+
if (this.isMSIE)
|
285 |
+
obj.attachEvent("on" + name, handler);
|
286 |
+
else
|
287 |
+
obj.addEventListener(name, handler, false);
|
288 |
+
};
|
289 |
+
|
290 |
+
TinyMCE_Windows.prototype.cancelEvent = function(e) {
|
291 |
+
if (this.isMSIE) {
|
292 |
+
e.returnValue = false;
|
293 |
+
e.cancelBubble = true;
|
294 |
+
} else
|
295 |
+
e.preventDefault();
|
296 |
+
};
|
297 |
+
|
298 |
+
TinyMCE_Windows.prototype.parseFeatures = function(opts) {
|
299 |
+
// Cleanup the options
|
300 |
+
opts = opts.toLowerCase();
|
301 |
+
opts = opts.replace(/;/g, ",");
|
302 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
303 |
+
|
304 |
+
var optionChunks = opts.split(',');
|
305 |
+
var options = new Array();
|
306 |
+
|
307 |
+
options['left'] = "10";
|
308 |
+
options['top'] = "10";
|
309 |
+
options['width'] = "300";
|
310 |
+
options['height'] = "300";
|
311 |
+
options['minwidth'] = "100";
|
312 |
+
options['minheight'] = "100";
|
313 |
+
options['resizable'] = "yes";
|
314 |
+
options['minimizable'] = "yes";
|
315 |
+
options['maximizable'] = "yes";
|
316 |
+
options['close'] = "yes";
|
317 |
+
options['movable'] = "yes";
|
318 |
+
options['statusbar'] = "yes";
|
319 |
+
options['scrollbars'] = "auto";
|
320 |
+
options['modal'] = "no";
|
321 |
+
|
322 |
+
if (opts == "")
|
323 |
+
return options;
|
324 |
+
|
325 |
+
for (var i=0; i<optionChunks.length; i++) {
|
326 |
+
var parts = optionChunks[i].split('=');
|
327 |
+
|
328 |
+
if (parts.length == 2)
|
329 |
+
options[parts[0]] = parts[1];
|
330 |
+
}
|
331 |
+
|
332 |
+
options['left'] = parseInt(options['left']);
|
333 |
+
options['top'] = parseInt(options['top']);
|
334 |
+
options['width'] = parseInt(options['width']);
|
335 |
+
options['height'] = parseInt(options['height']);
|
336 |
+
options['minWidth'] = parseInt(options['minwidth']);
|
337 |
+
options['minHeight'] = parseInt(options['minheight']);
|
338 |
+
|
339 |
+
return options;
|
340 |
+
};
|
341 |
+
|
342 |
+
TinyMCE_Windows.prototype.open = function(url, name, features) {
|
343 |
+
this.lastSelectedWindow = this.selectedWindow;
|
344 |
+
|
345 |
+
var win = new TinyMCE_Window();
|
346 |
+
var winDiv, html = "", id;
|
347 |
+
var imgPath = this.getParam("images_path");
|
348 |
+
|
349 |
+
features = this.parseFeatures(features);
|
350 |
+
|
351 |
+
// Clamp specified dimensions
|
352 |
+
var clamp = mcWindows.clampBoxPosition(
|
353 |
+
features['left'], features['top'],
|
354 |
+
features['width'], features['height'],
|
355 |
+
features['minWidth'], features['minHeight']
|
356 |
+
);
|
357 |
+
|
358 |
+
features['left'] = clamp[0];
|
359 |
+
features['top'] = clamp[1];
|
360 |
+
|
361 |
+
if (features['resizable'] == "yes") {
|
362 |
+
features['width'] = clamp[2];
|
363 |
+
features['height'] = clamp[3];
|
364 |
+
}
|
365 |
+
|
366 |
+
// Create div
|
367 |
+
id = "mcWindow_" + name;
|
368 |
+
win.deltaHeight = 18;
|
369 |
+
|
370 |
+
if (features['statusbar'] == "yes") {
|
371 |
+
win.deltaHeight += 13;
|
372 |
+
|
373 |
+
if (this.isMSIE)
|
374 |
+
win.deltaHeight += 1;
|
375 |
+
}
|
376 |
+
|
377 |
+
width = parseInt(features['width']);
|
378 |
+
height = parseInt(features['height'])-win.deltaHeight;
|
379 |
+
|
380 |
+
if (this.isMSIE)
|
381 |
+
width -= 2;
|
382 |
+
|
383 |
+
// Setup first part of window
|
384 |
+
win.id = id;
|
385 |
+
win.url = url;
|
386 |
+
win.name = name;
|
387 |
+
win.features = features;
|
388 |
+
this.windows[name] = win;
|
389 |
+
|
390 |
+
iframeWidth = width;
|
391 |
+
iframeHeight = height;
|
392 |
+
|
393 |
+
// Create inner content
|
394 |
+
html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
|
395 |
+
html += '<html>';
|
396 |
+
html += '<head>';
|
397 |
+
html += '<title>Wrapper iframe</title>';
|
398 |
+
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
|
399 |
+
html += '<link href="' + this.getParam("css_file") + '" rel="stylesheet" type="text/css" />';
|
400 |
+
html += '</head>';
|
401 |
+
html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
|
402 |
+
|
403 |
+
html += '<div id="' + id + '_container" class="mceWindow">';
|
404 |
+
html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
|
405 |
+
html += ' <div id="' + id + '_title" class="mceWindowTitle"';
|
406 |
+
html += ' onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;"></div>';
|
407 |
+
html += ' <div class="mceWindowHeadTools">';
|
408 |
+
html += ' <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" target="_self" onmousedown="return false;" class="mceWindowClose"><img border="0" src="' + imgPath + '/window_close.gif" /></a>';
|
409 |
+
if (features['resizable'] == "yes" && features['maximizable'] == "yes")
|
410 |
+
html += ' <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].maximize();" target="_self" onmousedown="return false;" class="mceWindowMaximize"><img border="0" src="' + imgPath + '/window_maximize.gif" /></a>';
|
411 |
+
// html += ' <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" target="_self" onmousedown="return false;" class="mceWindowMinimize"></a>';
|
412 |
+
html += ' </div>';
|
413 |
+
html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
|
414 |
+
html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe" scrolling="' + features['scrollbars'] + '"></iframe></div>';
|
415 |
+
|
416 |
+
if (features['statusbar'] == "yes") {
|
417 |
+
html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
|
418 |
+
|
419 |
+
if (features['resizable'] == "yes") {
|
420 |
+
if (this.isGecko)
|
421 |
+
html += '<div id="' + id + '_resize" class="mceWindowResize"><div style="background-image: url(\'' + imgPath + '/window_resize.gif\'); width: 12px; height: 12px;"></div></div>';
|
422 |
+
else
|
423 |
+
html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="' + imgPath + '/window_resize.gif" /></div>';
|
424 |
+
}
|
425 |
+
|
426 |
+
html += '</div>';
|
427 |
+
}
|
428 |
+
|
429 |
+
html += '</div>';
|
430 |
+
|
431 |
+
html += '</body>';
|
432 |
+
html += '</html>';
|
433 |
+
|
434 |
+
// Create iframe
|
435 |
+
this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
|
436 |
+
};
|
437 |
+
|
438 |
+
// Blocks the document events by placing a image over the whole document
|
439 |
+
TinyMCE_Windows.prototype.setDocumentLock = function(state) {
|
440 |
+
var elm = document.getElementById('mcWindowEventBlocker');
|
441 |
+
|
442 |
+
if (state) {
|
443 |
+
if (elm == null) {
|
444 |
+
elm = document.createElement("div");
|
445 |
+
|
446 |
+
elm.id = "mcWindowEventBlocker";
|
447 |
+
elm.style.position = "absolute";
|
448 |
+
elm.style.left = "0";
|
449 |
+
elm.style.top = "0";
|
450 |
+
|
451 |
+
document.body.appendChild(elm);
|
452 |
+
}
|
453 |
+
|
454 |
+
elm.style.display = "none";
|
455 |
+
|
456 |
+
var imgPath = this.getParam("images_path");
|
457 |
+
var width = document.body.clientWidth;
|
458 |
+
var height = document.body.clientHeight;
|
459 |
+
|
460 |
+
elm.style.width = width;
|
461 |
+
elm.style.height = height;
|
462 |
+
elm.innerHTML = '<img src="' + imgPath + '/spacer.gif" width="' + width + '" height="' + height + '" />';
|
463 |
+
|
464 |
+
elm.style.zIndex = mcWindows.zindex-1;
|
465 |
+
elm.style.display = "block";
|
466 |
+
} else if (elm != null) {
|
467 |
+
if (mcWindows.windows.length == 0)
|
468 |
+
elm.parentNode.removeChild(elm);
|
469 |
+
else
|
470 |
+
elm.style.zIndex = mcWindows.zindex-1;
|
471 |
+
}
|
472 |
+
};
|
473 |
+
|
474 |
+
// Gets called when wrapper iframe is initialized
|
475 |
+
TinyMCE_Windows.prototype.onLoad = function(name) {
|
476 |
+
var win = mcWindows.windows[name];
|
477 |
+
var id = "mcWindow_" + name;
|
478 |
+
var wrapperIframe = window.frames[id + "_iframe"].frames[0];
|
479 |
+
var wrapperDoc = window.frames[id + "_iframe"].document;
|
480 |
+
var doc = window.frames[id + "_iframe"].document;
|
481 |
+
var winDiv = document.getElementById("mcWindow_" + name + "_div");
|
482 |
+
var realIframe = window.frames[id + "_iframe"].frames[0];
|
483 |
+
|
484 |
+
// Set window data
|
485 |
+
win.id = "mcWindow_" + name;
|
486 |
+
win.winElement = winDiv;
|
487 |
+
win.bodyElement = doc.getElementById(id + '_body');
|
488 |
+
win.iframeElement = doc.getElementById(id + '_iframe');
|
489 |
+
win.headElement = doc.getElementById(id + '_head');
|
490 |
+
win.titleElement = doc.getElementById(id + '_title');
|
491 |
+
win.resizeElement = doc.getElementById(id + '_resize');
|
492 |
+
win.containerElement = doc.getElementById(id + '_container');
|
493 |
+
win.left = win.features['left'];
|
494 |
+
win.top = win.features['top'];
|
495 |
+
win.frame = window.frames[id + '_iframe'].frames[0];
|
496 |
+
win.wrapperFrame = window.frames[id + '_iframe'];
|
497 |
+
win.wrapperIFrameElement = document.getElementById(id + "_iframe");
|
498 |
+
|
499 |
+
// Add event handlers
|
500 |
+
mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
|
501 |
+
|
502 |
+
if (win.resizeElement != null)
|
503 |
+
mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
|
504 |
+
|
505 |
+
if (mcWindows.isMSIE) {
|
506 |
+
mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
|
507 |
+
mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
|
508 |
+
} else {
|
509 |
+
mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
|
510 |
+
mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
|
511 |
+
mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
|
512 |
+
}
|
513 |
+
|
514 |
+
for (var i=0; i<window.frames.length; i++) {
|
515 |
+
if (!window.frames[i]._hasMouseHandlers) {
|
516 |
+
if (mcWindows.isMSIE) {
|
517 |
+
mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
|
518 |
+
mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
|
519 |
+
} else {
|
520 |
+
mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
|
521 |
+
mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
|
522 |
+
}
|
523 |
+
|
524 |
+
window.frames[i]._hasMouseHandlers = true;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
if (mcWindows.isMSIE) {
|
529 |
+
mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
|
530 |
+
mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
|
531 |
+
} else {
|
532 |
+
mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
|
533 |
+
mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
|
534 |
+
mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
|
535 |
+
}
|
536 |
+
|
537 |
+
// Dispatch open window event
|
538 |
+
var func = this.getParam("on_open_window", "");
|
539 |
+
if (func != "")
|
540 |
+
eval(func + "(win);");
|
541 |
+
|
542 |
+
win.focus();
|
543 |
+
|
544 |
+
if (win.features['modal'] == "yes")
|
545 |
+
mcWindows.setDocumentLock(true);
|
546 |
+
};
|
547 |
+
|
548 |
+
TinyMCE_Windows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
|
549 |
+
var iframe = document.createElement("iframe");
|
550 |
+
var div = document.createElement("div"), doc;
|
551 |
+
|
552 |
+
width = parseInt(width);
|
553 |
+
height = parseInt(height)+1;
|
554 |
+
|
555 |
+
// Create wrapper div
|
556 |
+
div.setAttribute("id", id_prefix + "_div");
|
557 |
+
div.setAttribute("width", width);
|
558 |
+
div.setAttribute("height", (height));
|
559 |
+
div.style.position = "absolute";
|
560 |
+
|
561 |
+
div.style.left = left + "px";
|
562 |
+
div.style.top = top + "px";
|
563 |
+
div.style.width = width + "px";
|
564 |
+
div.style.height = (height) + "px";
|
565 |
+
div.style.backgroundColor = "white";
|
566 |
+
div.style.display = "none";
|
567 |
+
|
568 |
+
if (this.isGecko) {
|
569 |
+
iframeWidth = width + 2;
|
570 |
+
iframeHeight = height + 2;
|
571 |
+
} else {
|
572 |
+
iframeWidth = width;
|
573 |
+
iframeHeight = height + 1;
|
574 |
+
}
|
575 |
+
|
576 |
+
// Create iframe
|
577 |
+
iframe.setAttribute("id", id_prefix + "_iframe");
|
578 |
+
iframe.setAttribute("name", id_prefix + "_iframe");
|
579 |
+
iframe.setAttribute("border", "0");
|
580 |
+
iframe.setAttribute("frameBorder", "0");
|
581 |
+
iframe.setAttribute("marginWidth", "0");
|
582 |
+
iframe.setAttribute("marginHeight", "0");
|
583 |
+
iframe.setAttribute("leftMargin", "0");
|
584 |
+
iframe.setAttribute("topMargin", "0");
|
585 |
+
iframe.setAttribute("width", iframeWidth);
|
586 |
+
iframe.setAttribute("height", iframeHeight);
|
587 |
+
// iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
|
588 |
+
// iframe.setAttribute("allowtransparency", "false");
|
589 |
+
iframe.setAttribute("scrolling", "no");
|
590 |
+
iframe.style.width = iframeWidth + "px";
|
591 |
+
iframe.style.height = iframeHeight + "px";
|
592 |
+
iframe.style.backgroundColor = "white";
|
593 |
+
div.appendChild(iframe);
|
594 |
+
|
595 |
+
document.body.appendChild(div);
|
596 |
+
|
597 |
+
// Fixed MSIE 5.0 issue
|
598 |
+
div.innerHTML = div.innerHTML;
|
599 |
+
|
600 |
+
if (this.isSafari) {
|
601 |
+
// Give Safari some time to setup
|
602 |
+
window.setTimeout(function() {
|
603 |
+
var doc = window.frames[id_prefix + '_iframe'].document;
|
604 |
+
doc.open();
|
605 |
+
doc.write(html);
|
606 |
+
doc.close();
|
607 |
+
}, 10);
|
608 |
+
} else {
|
609 |
+
doc = window.frames[id_prefix + '_iframe'].window.document;
|
610 |
+
doc.open();
|
611 |
+
doc.write(html);
|
612 |
+
doc.close();
|
613 |
+
}
|
614 |
+
|
615 |
+
div.style.display = "block";
|
616 |
+
|
617 |
+
return div;
|
618 |
+
};
|
619 |
+
|
620 |
+
// Window instance
|
621 |
+
function TinyMCE_Window() {
|
622 |
+
};
|
623 |
+
|
624 |
+
TinyMCE_Window.prototype.focus = function() {
|
625 |
+
if (this != mcWindows.selectedWindow) {
|
626 |
+
this.winElement.style.zIndex = ++mcWindows.zindex;
|
627 |
+
mcWindows.lastSelectedWindow = mcWindows.selectedWindow;
|
628 |
+
mcWindows.selectedWindow = this;
|
629 |
+
}
|
630 |
+
};
|
631 |
+
|
632 |
+
TinyMCE_Window.prototype.minimize = function() {
|
633 |
+
};
|
634 |
+
|
635 |
+
TinyMCE_Window.prototype.maximize = function() {
|
636 |
+
if (this.restoreSize) {
|
637 |
+
this.moveTo(this.restoreSize[0], this.restoreSize[1]);
|
638 |
+
this.resizeTo(this.restoreSize[2], this.restoreSize[3]);
|
639 |
+
this.updateClamping();
|
640 |
+
this.restoreSize = null;
|
641 |
+
} else {
|
642 |
+
var bounds = mcWindows.getBounds();
|
643 |
+
this.restoreSize = [
|
644 |
+
this.left, this.top,
|
645 |
+
this.winElement.scrollWidth,
|
646 |
+
this.winElement.scrollHeight
|
647 |
+
];
|
648 |
+
this.moveTo(bounds[0], bounds[1]);
|
649 |
+
this.resizeTo(
|
650 |
+
bounds[2] - bounds[0],
|
651 |
+
bounds[3] - bounds[1]
|
652 |
+
);
|
653 |
+
}
|
654 |
+
};
|
655 |
+
|
656 |
+
TinyMCE_Window.prototype.startResize = function() {
|
657 |
+
mcWindows.action = "resize";
|
658 |
+
};
|
659 |
+
|
660 |
+
TinyMCE_Window.prototype.startMove = function(e) {
|
661 |
+
mcWindows.action = "move";
|
662 |
+
};
|
663 |
+
|
664 |
+
TinyMCE_Window.prototype.close = function() {
|
665 |
+
if (this.frame && this.frame['tinyMCEPopup'])
|
666 |
+
this.frame['tinyMCEPopup'].restoreSelection();
|
667 |
+
|
668 |
+
if (mcWindows.lastSelectedWindow != null)
|
669 |
+
mcWindows.lastSelectedWindow.focus();
|
670 |
+
|
671 |
+
var mcWindowsNew = new Array();
|
672 |
+
for (var n in mcWindows.windows) {
|
673 |
+
var win = mcWindows.windows[n];
|
674 |
+
if (typeof(win) == 'function')
|
675 |
+
continue;
|
676 |
+
|
677 |
+
if (win.name != this.name)
|
678 |
+
mcWindowsNew[n] = win;
|
679 |
+
}
|
680 |
+
|
681 |
+
mcWindows.windows = mcWindowsNew;
|
682 |
+
|
683 |
+
// alert(mcWindows.doc.getElementById(this.id + "_iframe"));
|
684 |
+
|
685 |
+
var e = mcWindows.doc.getElementById(this.id + "_iframe");
|
686 |
+
e.parentNode.removeChild(e);
|
687 |
+
|
688 |
+
var e = mcWindows.doc.getElementById(this.id + "_div");
|
689 |
+
e.parentNode.removeChild(e);
|
690 |
+
|
691 |
+
mcWindows.setDocumentLock(false);
|
692 |
+
};
|
693 |
+
|
694 |
+
TinyMCE_Window.prototype.onMouseMove = function(e) {
|
695 |
+
var clamp;
|
696 |
+
// Calculate real X, Y
|
697 |
+
var dx = e.screenX - mcWindows.mouseDownScreenX;
|
698 |
+
var dy = e.screenY - mcWindows.mouseDownScreenY;
|
699 |
+
|
700 |
+
switch (mcWindows.action) {
|
701 |
+
case "resize":
|
702 |
+
clamp = mcWindows.clampBoxSize(
|
703 |
+
this.left, this.top,
|
704 |
+
mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX),
|
705 |
+
mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY),
|
706 |
+
this.features.minWidth, this.features.minHeight
|
707 |
+
);
|
708 |
+
|
709 |
+
this.resizeTo(clamp[2], clamp[3]);
|
710 |
+
|
711 |
+
mcWindows.cancelEvent(e);
|
712 |
+
break;
|
713 |
+
|
714 |
+
case "move":
|
715 |
+
this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
|
716 |
+
this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
|
717 |
+
this.updateClamping();
|
718 |
+
|
719 |
+
mcWindows.cancelEvent(e);
|
720 |
+
break;
|
721 |
+
}
|
722 |
+
};
|
723 |
+
|
724 |
+
TinyMCE_Window.prototype.moveTo = function (x, y) {
|
725 |
+
this.left = x;
|
726 |
+
this.top = y;
|
727 |
+
|
728 |
+
this.winElement.style.left = this.left + "px";
|
729 |
+
this.winElement.style.top = this.top + "px";
|
730 |
+
};
|
731 |
+
|
732 |
+
TinyMCE_Window.prototype.resizeTo = function (width, height) {
|
733 |
+
this.wrapperIFrameElement.style.width = (width+2) + 'px';
|
734 |
+
this.wrapperIFrameElement.style.height = (height+2) + 'px';
|
735 |
+
this.wrapperIFrameElement.width = width+2;
|
736 |
+
this.wrapperIFrameElement.height = height+2;
|
737 |
+
this.winElement.style.width = width + 'px';
|
738 |
+
this.winElement.style.height = height + 'px';
|
739 |
+
|
740 |
+
height = height - this.deltaHeight;
|
741 |
+
|
742 |
+
this.containerElement.style.width = width + 'px';
|
743 |
+
this.iframeElement.style.width = width + 'px';
|
744 |
+
this.iframeElement.style.height = height + 'px';
|
745 |
+
this.bodyElement.style.width = width + 'px';
|
746 |
+
this.bodyElement.style.height = height + 'px';
|
747 |
+
this.headElement.style.width = width + 'px';
|
748 |
+
//this.statusElement.style.width = width + 'px';
|
749 |
+
};
|
750 |
+
|
751 |
+
TinyMCE_Window.prototype.updateClamping = function () {
|
752 |
+
var clamp, oversize;
|
753 |
+
|
754 |
+
clamp = mcWindows.clampBoxPosition(
|
755 |
+
this.left, this.top,
|
756 |
+
this.winElement.scrollWidth,
|
757 |
+
this.winElement.scrollHeight,
|
758 |
+
this.features.minWidth, this.features.minHeight
|
759 |
+
);
|
760 |
+
oversize = (
|
761 |
+
clamp[2] != this.winElement.scrollWidth ||
|
762 |
+
clamp[3] != this.winElement.scrollHeight
|
763 |
+
) ? true : false;
|
764 |
+
|
765 |
+
this.moveTo(clamp[0], clamp[1]);
|
766 |
+
if (this.features.resizable == "yes" && oversize)
|
767 |
+
this.resizeTo(clamp[2], clamp[3]);
|
768 |
+
};
|
769 |
+
|
770 |
+
function debug(msg) {
|
771 |
+
document.getElementById('debug').value += msg + "\n";
|
772 |
+
}
|
773 |
+
|
774 |
+
TinyMCE_Window.prototype.onMouseUp = function(e) {
|
775 |
+
mcWindows.action = "none";
|
776 |
+
};
|
777 |
+
|
778 |
+
TinyMCE_Window.prototype.onFocus = function(e) {
|
779 |
+
// Gecko only handler
|
780 |
+
var winRef = e.currentTarget;
|
781 |
+
|
782 |
+
for (var n in mcWindows.windows) {
|
783 |
+
var win = mcWindows.windows[n];
|
784 |
+
if (typeof(win) == 'function')
|
785 |
+
continue;
|
786 |
+
|
787 |
+
if (winRef.name == win.id + "_iframe") {
|
788 |
+
win.focus();
|
789 |
+
return;
|
790 |
+
}
|
791 |
+
}
|
792 |
+
};
|
793 |
+
|
794 |
+
TinyMCE_Window.prototype.onMouseDown = function(e) {
|
795 |
+
var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
|
796 |
+
|
797 |
+
mcWindows.mouseDownScreenX = e.screenX;
|
798 |
+
mcWindows.mouseDownScreenY = e.screenY;
|
799 |
+
mcWindows.mouseDownLayerX = this.left;
|
800 |
+
mcWindows.mouseDownLayerY = this.top;
|
801 |
+
mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
|
802 |
+
mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
|
803 |
+
|
804 |
+
if (this.resizeElement != null && elm == this.resizeElement.firstChild)
|
805 |
+
this.startResize(e);
|
806 |
+
else
|
807 |
+
this.startMove(e);
|
808 |
+
|
809 |
+
mcWindows.cancelEvent(e);
|
810 |
+
};
|
811 |
+
|
812 |
+
// Global instance
|
813 |
+
var mcWindows = new TinyMCE_Windows();
|
814 |
+
|
815 |
+
// Initialize windows
|
816 |
+
mcWindows.init({
|
817 |
+
images_path : tinyMCE.baseURL + "/plugins/inlinepopups/images",
|
818 |
+
css_file : tinyMCE.baseURL + "/plugins/inlinepopups/css/inlinepopup.css"
|
819 |
+
});
|
upload_to_tinymce_directory/plugins/inlinepopups/images/spacer.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/inlinepopups/images/window_close.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/inlinepopups/images/window_maximize.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/inlinepopups/images/window_minimize.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/inlinepopups/images/window_resize.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/inlinepopups/jscripts/mcwindows.js
ADDED
@@ -0,0 +1,453 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: mcwindows.js 18 2006-06-29 14:11:23Z spocke $
|
3 |
+
*
|
4 |
+
* Moxiecode DHTML Windows script.
|
5 |
+
*
|
6 |
+
* @author Moxiecode
|
7 |
+
* @copyright Copyright � 2004, Moxiecode Systems AB, All rights reserved.
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Windows handler
|
11 |
+
function MCWindows() {
|
12 |
+
this.settings = new Array();
|
13 |
+
this.windows = new Array();
|
14 |
+
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
|
15 |
+
this.isGecko = navigator.userAgent.indexOf('Gecko') != -1;
|
16 |
+
this.isSafari = navigator.userAgent.indexOf('Safari') != -1;
|
17 |
+
this.isMac = navigator.userAgent.indexOf('Mac') != -1;
|
18 |
+
this.isMSIE5_0 = this.isMSIE && (navigator.userAgent.indexOf('MSIE 5.0') != -1);
|
19 |
+
this.action = "none";
|
20 |
+
this.selectedWindow = null;
|
21 |
+
this.zindex = 100;
|
22 |
+
this.mouseDownScreenX = 0;
|
23 |
+
this.mouseDownScreenY = 0;
|
24 |
+
this.mouseDownLayerX = 0;
|
25 |
+
this.mouseDownLayerY = 0;
|
26 |
+
this.mouseDownWidth = 0;
|
27 |
+
this.mouseDownHeight = 0;
|
28 |
+
};
|
29 |
+
|
30 |
+
MCWindows.prototype.init = function(settings) {
|
31 |
+
this.settings = settings;
|
32 |
+
|
33 |
+
if (this.isMSIE)
|
34 |
+
this.addEvent(document, "mousemove", mcWindows.eventDispatcher);
|
35 |
+
else
|
36 |
+
this.addEvent(window, "mousemove", mcWindows.eventDispatcher);
|
37 |
+
|
38 |
+
this.addEvent(document, "mouseup", mcWindows.eventDispatcher);
|
39 |
+
};
|
40 |
+
|
41 |
+
MCWindows.prototype.getParam = function(name, default_value) {
|
42 |
+
var value = null;
|
43 |
+
|
44 |
+
value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
|
45 |
+
|
46 |
+
// Fix bool values
|
47 |
+
if (value == "true" || value == "false")
|
48 |
+
return (value == "true");
|
49 |
+
|
50 |
+
return value;
|
51 |
+
};
|
52 |
+
|
53 |
+
MCWindows.prototype.eventDispatcher = function(e) {
|
54 |
+
e = typeof(e) == "undefined" ? window.event : e;
|
55 |
+
|
56 |
+
if (mcWindows.selectedWindow == null)
|
57 |
+
return;
|
58 |
+
|
59 |
+
// Switch focus
|
60 |
+
if (mcWindows.isGecko && e.type == "mousedown") {
|
61 |
+
var elm = e.currentTarget;
|
62 |
+
|
63 |
+
for (var n in mcWindows.windows) {
|
64 |
+
var win = mcWindows.windows[n];
|
65 |
+
if (typeof(win) == 'function')
|
66 |
+
continue;
|
67 |
+
|
68 |
+
if (win.headElement == elm || win.resizeElement == elm) {
|
69 |
+
win.focus();
|
70 |
+
break;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
switch (e.type) {
|
76 |
+
case "mousemove":
|
77 |
+
mcWindows.selectedWindow.onMouseMove(e);
|
78 |
+
break;
|
79 |
+
|
80 |
+
case "mouseup":
|
81 |
+
mcWindows.selectedWindow.onMouseUp(e);
|
82 |
+
break;
|
83 |
+
|
84 |
+
case "mousedown":
|
85 |
+
mcWindows.selectedWindow.onMouseDown(e);
|
86 |
+
break;
|
87 |
+
|
88 |
+
case "focus":
|
89 |
+
mcWindows.selectedWindow.onFocus(e);
|
90 |
+
break;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
MCWindows.prototype.addEvent = function(obj, name, handler) {
|
95 |
+
if (this.isMSIE)
|
96 |
+
obj.attachEvent("on" + name, handler);
|
97 |
+
else
|
98 |
+
obj.addEventListener(name, handler, true);
|
99 |
+
};
|
100 |
+
|
101 |
+
MCWindows.prototype.cancelEvent = function(e) {
|
102 |
+
if (this.isMSIE) {
|
103 |
+
e.returnValue = false;
|
104 |
+
e.cancelBubble = true;
|
105 |
+
} else
|
106 |
+
e.preventDefault();
|
107 |
+
};
|
108 |
+
|
109 |
+
MCWindows.prototype.parseFeatures = function(opts) {
|
110 |
+
// Cleanup the options
|
111 |
+
opts = opts.toLowerCase();
|
112 |
+
opts = opts.replace(/;/g, ",");
|
113 |
+
opts = opts.replace(/[^0-9a-z=,]/g, "");
|
114 |
+
|
115 |
+
var optionChunks = opts.split(',');
|
116 |
+
var options = new Array();
|
117 |
+
|
118 |
+
options['left'] = 10;
|
119 |
+
options['top'] = 10;
|
120 |
+
options['width'] = 300;
|
121 |
+
options['height'] = 300;
|
122 |
+
options['resizable'] = true;
|
123 |
+
options['minimizable'] = true;
|
124 |
+
options['maximizable'] = true;
|
125 |
+
options['close'] = true;
|
126 |
+
options['movable'] = true;
|
127 |
+
|
128 |
+
if (opts == "")
|
129 |
+
return options;
|
130 |
+
|
131 |
+
for (var i=0; i<optionChunks.length; i++) {
|
132 |
+
var parts = optionChunks[i].split('=');
|
133 |
+
|
134 |
+
if (parts.length == 2)
|
135 |
+
options[parts[0]] = parts[1];
|
136 |
+
}
|
137 |
+
|
138 |
+
return options;
|
139 |
+
};
|
140 |
+
|
141 |
+
MCWindows.prototype.open = function(url, name, features) {
|
142 |
+
var win = new MCWindow();
|
143 |
+
var winDiv, html = "", id;
|
144 |
+
|
145 |
+
features = this.parseFeatures(features);
|
146 |
+
|
147 |
+
// Create div
|
148 |
+
id = "mcWindow_" + name;
|
149 |
+
|
150 |
+
width = parseInt(features['width']);
|
151 |
+
height = parseInt(features['height'])-12-19;
|
152 |
+
|
153 |
+
if (this.isMSIE)
|
154 |
+
width -= 2;
|
155 |
+
|
156 |
+
// Setup first part of window
|
157 |
+
win.id = id;
|
158 |
+
win.url = url;
|
159 |
+
win.name = name;
|
160 |
+
win.features = features;
|
161 |
+
this.windows[name] = win;
|
162 |
+
|
163 |
+
iframeWidth = width;
|
164 |
+
iframeHeight = height;
|
165 |
+
|
166 |
+
// Create inner content
|
167 |
+
html += '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
|
168 |
+
html += '<html>';
|
169 |
+
html += '<head>';
|
170 |
+
html += '<title>Wrapper iframe</title>';
|
171 |
+
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
|
172 |
+
html += '<link href="../jscripts/tiny_mce/themes/advanced/css/editor_ui.css" rel="stylesheet" type="text/css" />';
|
173 |
+
html += '</head>';
|
174 |
+
html += '<body onload="parent.mcWindows.onLoad(\'' + name + '\');">';
|
175 |
+
|
176 |
+
html += '<div id="' + id + '_container" class="mceWindow">';
|
177 |
+
html += '<div id="' + id + '_head" class="mceWindowHead" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
|
178 |
+
html += ' <div id="' + id + '_title" class="mceWindowTitle"';
|
179 |
+
html += ' onselectstart="return false;" unselectable="on" style="-moz-user-select: none !important;">No name window</div>';
|
180 |
+
html += ' <div class="mceWindowHeadTools">';
|
181 |
+
html += ' <a href="javascript:parent.mcWindows.windows[\'' + name + '\'].close();" onmousedown="return false;" class="mceWindowClose"><img border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_close.gif" /></a>';
|
182 |
+
// html += ' <a href="javascript:mcWindows.windows[\'' + name + '\'].maximize();" onmousedown="return false;" class="mceWindowMaximize"></a>';
|
183 |
+
// html += ' <a href="javascript:mcWindows.windows[\'' + name + '\'].minimize();" onmousedown="return false;" class="mceWindowMinimize"></a>';
|
184 |
+
html += ' </div>';
|
185 |
+
html += '</div><div id="' + id + '_body" class="mceWindowBody" style="width: ' + width + 'px; height: ' + height + 'px;">';
|
186 |
+
html += '<iframe id="' + id + '_iframe" name="' + id + '_iframe" onfocus="parent.mcWindows.windows[\'' + name + '\'].focus();" frameborder="0" width="' + iframeWidth + '" height="' + iframeHeight + '" src="' + url + '" class="mceWindowBodyIframe"></iframe></div>';
|
187 |
+
html += '<div id="' + id + '_statusbar" class="mceWindowStatusbar" onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();">';
|
188 |
+
html += '<div id="' + id + '_resize" class="mceWindowResize"><img onmousedown="parent.mcWindows.windows[\'' + name + '\'].focus();" border="0" src="../jscripts/tiny_mce/themes/advanced/images/window_resize.gif" /></div>';
|
189 |
+
html += '</div>';
|
190 |
+
html += '</div>';
|
191 |
+
|
192 |
+
html += '</body>';
|
193 |
+
html += '</html>';
|
194 |
+
|
195 |
+
// Create iframe
|
196 |
+
this.createFloatingIFrame(id, features['left'], features['top'], features['width'], features['height'], html);
|
197 |
+
};
|
198 |
+
|
199 |
+
// Gets called when wrapper iframe is initialized
|
200 |
+
MCWindows.prototype.onLoad = function(name) {
|
201 |
+
var win = mcWindows.windows[name];
|
202 |
+
var id = "mcWindow_" + name;
|
203 |
+
var wrapperIframe = window.frames[id + "_iframe"].frames[0];
|
204 |
+
var wrapperDoc = window.frames[id + "_iframe"].document;
|
205 |
+
var doc = window.frames[id + "_iframe"].document;
|
206 |
+
var winDiv = document.getElementById("mcWindow_" + name + "_div");
|
207 |
+
var realIframe = window.frames[id + "_iframe"].frames[0];
|
208 |
+
|
209 |
+
// Set window data
|
210 |
+
win.id = "mcWindow_" + name + "_iframe";
|
211 |
+
win.winElement = winDiv;
|
212 |
+
win.bodyElement = doc.getElementById(id + '_body');
|
213 |
+
win.iframeElement = doc.getElementById(id + '_iframe');
|
214 |
+
win.headElement = doc.getElementById(id + '_head');
|
215 |
+
win.titleElement = doc.getElementById(id + '_title');
|
216 |
+
win.resizeElement = doc.getElementById(id + '_resize');
|
217 |
+
win.containerElement = doc.getElementById(id + '_container');
|
218 |
+
win.left = win.features['left'];
|
219 |
+
win.top = win.features['top'];
|
220 |
+
win.frame = window.frames[id + '_iframe'].frames[0];
|
221 |
+
win.wrapperFrame = window.frames[id + '_iframe'];
|
222 |
+
win.wrapperIFrameElement = document.getElementById(id + "_iframe");
|
223 |
+
|
224 |
+
// Add event handlers
|
225 |
+
mcWindows.addEvent(win.headElement, "mousedown", mcWindows.eventDispatcher);
|
226 |
+
mcWindows.addEvent(win.resizeElement, "mousedown", mcWindows.eventDispatcher);
|
227 |
+
|
228 |
+
if (mcWindows.isMSIE) {
|
229 |
+
mcWindows.addEvent(realIframe.document, "mousemove", mcWindows.eventDispatcher);
|
230 |
+
mcWindows.addEvent(realIframe.document, "mouseup", mcWindows.eventDispatcher);
|
231 |
+
} else {
|
232 |
+
mcWindows.addEvent(realIframe, "mousemove", mcWindows.eventDispatcher);
|
233 |
+
mcWindows.addEvent(realIframe, "mouseup", mcWindows.eventDispatcher);
|
234 |
+
mcWindows.addEvent(realIframe, "focus", mcWindows.eventDispatcher);
|
235 |
+
}
|
236 |
+
|
237 |
+
for (var i=0; i<window.frames.length; i++) {
|
238 |
+
if (!window.frames[i]._hasMouseHandlers) {
|
239 |
+
if (mcWindows.isMSIE) {
|
240 |
+
mcWindows.addEvent(window.frames[i].document, "mousemove", mcWindows.eventDispatcher);
|
241 |
+
mcWindows.addEvent(window.frames[i].document, "mouseup", mcWindows.eventDispatcher);
|
242 |
+
} else {
|
243 |
+
mcWindows.addEvent(window.frames[i], "mousemove", mcWindows.eventDispatcher);
|
244 |
+
mcWindows.addEvent(window.frames[i], "mouseup", mcWindows.eventDispatcher);
|
245 |
+
}
|
246 |
+
|
247 |
+
window.frames[i]._hasMouseHandlers = true;
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
if (mcWindows.isMSIE) {
|
252 |
+
mcWindows.addEvent(win.frame.document, "mousemove", mcWindows.eventDispatcher);
|
253 |
+
mcWindows.addEvent(win.frame.document, "mouseup", mcWindows.eventDispatcher);
|
254 |
+
} else {
|
255 |
+
mcWindows.addEvent(win.frame, "mousemove", mcWindows.eventDispatcher);
|
256 |
+
mcWindows.addEvent(win.frame, "mouseup", mcWindows.eventDispatcher);
|
257 |
+
mcWindows.addEvent(win.frame, "focus", mcWindows.eventDispatcher);
|
258 |
+
}
|
259 |
+
|
260 |
+
this.selectedWindow = win;
|
261 |
+
};
|
262 |
+
|
263 |
+
MCWindows.prototype.createFloatingIFrame = function(id_prefix, left, top, width, height, html) {
|
264 |
+
var iframe = document.createElement("iframe");
|
265 |
+
var div = document.createElement("div");
|
266 |
+
|
267 |
+
width = parseInt(width);
|
268 |
+
height = parseInt(height)+1;
|
269 |
+
|
270 |
+
// Create wrapper div
|
271 |
+
div.setAttribute("id", id_prefix + "_div");
|
272 |
+
div.setAttribute("width", width);
|
273 |
+
div.setAttribute("height", (height));
|
274 |
+
div.style.position = "absolute";
|
275 |
+
div.style.left = left + "px";
|
276 |
+
div.style.top = top + "px";
|
277 |
+
div.style.width = width + "px";
|
278 |
+
div.style.height = (height) + "px";
|
279 |
+
div.style.backgroundColor = "white";
|
280 |
+
div.style.display = "none";
|
281 |
+
|
282 |
+
if (this.isGecko) {
|
283 |
+
iframeWidth = width + 2;
|
284 |
+
iframeHeight = height + 2;
|
285 |
+
} else {
|
286 |
+
iframeWidth = width;
|
287 |
+
iframeHeight = height + 1;
|
288 |
+
}
|
289 |
+
|
290 |
+
// Create iframe
|
291 |
+
iframe.setAttribute("id", id_prefix + "_iframe");
|
292 |
+
iframe.setAttribute("name", id_prefix + "_iframe");
|
293 |
+
iframe.setAttribute("border", "0");
|
294 |
+
iframe.setAttribute("frameBorder", "0");
|
295 |
+
iframe.setAttribute("marginWidth", "0");
|
296 |
+
iframe.setAttribute("marginHeight", "0");
|
297 |
+
iframe.setAttribute("leftMargin", "0");
|
298 |
+
iframe.setAttribute("topMargin", "0");
|
299 |
+
iframe.setAttribute("width", iframeWidth);
|
300 |
+
iframe.setAttribute("height", iframeHeight);
|
301 |
+
// iframe.setAttribute("src", "../jscripts/tiny_mce/blank.htm");
|
302 |
+
// iframe.setAttribute("allowtransparency", "false");
|
303 |
+
iframe.setAttribute("scrolling", "no");
|
304 |
+
iframe.style.width = iframeWidth + "px";
|
305 |
+
iframe.style.height = iframeHeight + "px";
|
306 |
+
iframe.style.backgroundColor = "white";
|
307 |
+
div.appendChild(iframe);
|
308 |
+
|
309 |
+
document.body.appendChild(div);
|
310 |
+
|
311 |
+
// Fixed MSIE 5.0 issue
|
312 |
+
div.innerHTML = div.innerHTML;
|
313 |
+
|
314 |
+
if (this.isSafari) {
|
315 |
+
// Give Safari some time to setup
|
316 |
+
window.setTimeout(function() {
|
317 |
+
doc = window.frames[id_prefix + '_iframe'].document;
|
318 |
+
doc.open();
|
319 |
+
doc.write(html);
|
320 |
+
doc.close();
|
321 |
+
}, 10);
|
322 |
+
} else {
|
323 |
+
doc = window.frames[id_prefix + '_iframe'].window.document
|
324 |
+
doc.open();
|
325 |
+
doc.write(html);
|
326 |
+
doc.close();
|
327 |
+
}
|
328 |
+
|
329 |
+
div.style.display = "block";
|
330 |
+
|
331 |
+
return div;
|
332 |
+
};
|
333 |
+
|
334 |
+
// Window instance
|
335 |
+
function MCWindow() {
|
336 |
+
};
|
337 |
+
|
338 |
+
MCWindow.prototype.focus = function() {
|
339 |
+
this.winElement.style.zIndex = mcWindows.zindex++;
|
340 |
+
mcWindows.selectedWindow = this;
|
341 |
+
};
|
342 |
+
|
343 |
+
MCWindow.prototype.minimize = function() {
|
344 |
+
};
|
345 |
+
|
346 |
+
MCWindow.prototype.maximize = function() {
|
347 |
+
|
348 |
+
};
|
349 |
+
|
350 |
+
MCWindow.prototype.startResize = function() {
|
351 |
+
mcWindows.action = "resize";
|
352 |
+
};
|
353 |
+
|
354 |
+
MCWindow.prototype.startMove = function(e) {
|
355 |
+
mcWindows.action = "move";
|
356 |
+
};
|
357 |
+
|
358 |
+
MCWindow.prototype.close = function() {
|
359 |
+
document.body.removeChild(this.winElement);
|
360 |
+
mcWindows.windows[this.name] = null;
|
361 |
+
};
|
362 |
+
|
363 |
+
MCWindow.prototype.onMouseMove = function(e) {
|
364 |
+
var scrollX = 0;//this.doc.body.scrollLeft;
|
365 |
+
var scrollY = 0;//this.doc.body.scrollTop;
|
366 |
+
|
367 |
+
// Calculate real X, Y
|
368 |
+
var dx = e.screenX - mcWindows.mouseDownScreenX;
|
369 |
+
var dy = e.screenY - mcWindows.mouseDownScreenY;
|
370 |
+
|
371 |
+
switch (mcWindows.action) {
|
372 |
+
case "resize":
|
373 |
+
width = mcWindows.mouseDownWidth + (e.screenX - mcWindows.mouseDownScreenX);
|
374 |
+
height = mcWindows.mouseDownHeight + (e.screenY - mcWindows.mouseDownScreenY);
|
375 |
+
|
376 |
+
width = width < 100 ? 100 : width;
|
377 |
+
height = height < 100 ? 100 : height;
|
378 |
+
|
379 |
+
this.wrapperIFrameElement.style.width = width+2;
|
380 |
+
this.wrapperIFrameElement.style.height = height+2;
|
381 |
+
this.wrapperIFrameElement.width = width+2;
|
382 |
+
this.wrapperIFrameElement.height = height+2;
|
383 |
+
this.winElement.style.width = width;
|
384 |
+
this.winElement.style.height = height;
|
385 |
+
|
386 |
+
height = height-12-19;
|
387 |
+
|
388 |
+
this.containerElement.style.width = width;
|
389 |
+
|
390 |
+
this.iframeElement.style.width = width;
|
391 |
+
this.iframeElement.style.height = height;
|
392 |
+
this.bodyElement.style.width = width;
|
393 |
+
this.bodyElement.style.height = height;
|
394 |
+
this.headElement.style.width = width;
|
395 |
+
//this.statusElement.style.width = width;
|
396 |
+
|
397 |
+
mcWindows.cancelEvent(e);
|
398 |
+
break;
|
399 |
+
|
400 |
+
case "move":
|
401 |
+
this.left = mcWindows.mouseDownLayerX + (e.screenX - mcWindows.mouseDownScreenX);
|
402 |
+
this.top = mcWindows.mouseDownLayerY + (e.screenY - mcWindows.mouseDownScreenY);
|
403 |
+
this.winElement.style.left = this.left + "px";
|
404 |
+
this.winElement.style.top = this.top + "px";
|
405 |
+
|
406 |
+
mcWindows.cancelEvent(e);
|
407 |
+
break;
|
408 |
+
}
|
409 |
+
};
|
410 |
+
|
411 |
+
MCWindow.prototype.onMouseUp = function(e) {
|
412 |
+
mcWindows.action = "none";
|
413 |
+
};
|
414 |
+
|
415 |
+
MCWindow.prototype.onFocus = function(e) {
|
416 |
+
// Gecko only handler
|
417 |
+
var winRef = e.currentTarget;
|
418 |
+
|
419 |
+
for (var n in mcWindows.windows) {
|
420 |
+
var win = mcWindows.windows[n];
|
421 |
+
if (typeof(win) == 'function')
|
422 |
+
continue;
|
423 |
+
|
424 |
+
if (winRef.name == win.id) {
|
425 |
+
win.focus();
|
426 |
+
return;
|
427 |
+
}
|
428 |
+
}
|
429 |
+
};
|
430 |
+
|
431 |
+
MCWindow.prototype.onMouseDown = function(e) {
|
432 |
+
var elm = mcWindows.isMSIE ? this.wrapperFrame.event.srcElement : e.target;
|
433 |
+
|
434 |
+
var scrollX = 0;//this.doc.body.scrollLeft;
|
435 |
+
var scrollY = 0;//this.doc.body.scrollTop;
|
436 |
+
|
437 |
+
mcWindows.mouseDownScreenX = e.screenX;
|
438 |
+
mcWindows.mouseDownScreenY = e.screenY;
|
439 |
+
mcWindows.mouseDownLayerX = this.left;
|
440 |
+
mcWindows.mouseDownLayerY = this.top;
|
441 |
+
mcWindows.mouseDownWidth = parseInt(this.winElement.style.width);
|
442 |
+
mcWindows.mouseDownHeight = parseInt(this.winElement.style.height);
|
443 |
+
|
444 |
+
if (elm == this.resizeElement.firstChild)
|
445 |
+
this.startResize(e);
|
446 |
+
else
|
447 |
+
this.startMove(e);
|
448 |
+
|
449 |
+
mcWindows.cancelEvent(e);
|
450 |
+
};
|
451 |
+
|
452 |
+
// Global instance
|
453 |
+
var mcWindows = new MCWindows();
|
upload_to_tinymce_directory/plugins/layer/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('layer');var TinyMCE_LayerPlugin={getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)inst.getDoc().execCommand('2D-Position')},handleEvent:function(e){var inst=tinyMCE.selectedInstance;var w=inst.getWin(),le=inst._lastStyleElm,e;if(tinyMCE.isGecko){e=this._getParentLayer(inst.getFocusElement());if(e){if(!inst._lastStyleElm){e.style.overflow='auto';inst._lastStyleElm=e}}else if(le){le=inst._lastStyleElm;le.style.width=le.scrollWidth+'px';le.style.height=le.scrollHeight+'px';le.style.overflow='';inst._lastStyleElm=null}}return true},handleVisualAid:function(el,deep,state,inst){var nl=inst.getDoc().getElementsByTagName("div"),i;for(i=0;i<nl.length;i++){if(new RegExp('absolute|relative|static','gi').test(nl[i].style.position)){if(state)tinyMCE.addCSSClass(nl[i],'mceVisualAid');else tinyMCE.removeCSSClass(nl[i],'mceVisualAid')}}},getControlHTML:function(cn){switch(cn){case"moveforward":return tinyMCE.getButtonHTML(cn,'lang_layer_forward_desc','{$pluginurl}/images/moveforward.gif','mceMoveForward',true);case"movebackward":return tinyMCE.getButtonHTML(cn,'lang_layer_backward_desc','{$pluginurl}/images/movebackward.gif','mceMoveBackward',true);case"absolute":return tinyMCE.getButtonHTML(cn,'lang_layer_absolute_desc','{$pluginurl}/images/absolute.gif','mceMakeAbsolute',true);case"insertlayer":return tinyMCE.getButtonHTML(cn,'lang_layer_insertlayer_desc','{$pluginurl}/images/insertlayer.gif','mceInsertLayer',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertLayer":this._insertLayer();return true;case"mceMoveForward":this._move(1);return true;case"mceMoveBackward":this._move(-1);return true;case"mceMakeAbsolute":this._toggleAbsolute();return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var inst=tinyMCE.getInstanceById(editor_id);var le=this._getParentLayer(inst.getFocusElement());var p=tinyMCE.getParentElement(inst.getFocusElement(),'div,p,img');tinyMCE.switchClass(editor_id+'_absolute','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_moveforward','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_movebackward','mceButtonDisabled');if(p)tinyMCE.switchClass(editor_id+'_absolute','mceButtonNormal');if(le&&le.style.position.toLowerCase()=="absolute"){tinyMCE.switchClass(editor_id+'_absolute','mceButtonSelected');tinyMCE.switchClass(editor_id+'_moveforward','mceButtonNormal');tinyMCE.switchClass(editor_id+'_movebackward','mceButtonNormal')}},_move:function(d){var inst=tinyMCE.selectedInstance,i,z=new Array();var le=this._getParentLayer(inst.getFocusElement()),ci=-1,fi=-1;var nl=tinyMCE.selectNodes(inst.getBody(),function(n){return n.nodeType==1&&new RegExp('absolute|relative|static','gi').test(n.style.position)});for(i=0;i<nl.length;i++){z[i]=nl[i].style.zIndex?parseInt(nl[i].style.zIndex):0;if(ci<0&&nl[i]==le)ci=i}if(d<0){for(i=0;i<z.length;i++){if(z[i]<z[ci]){fi=i;break}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci]}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1}}else{for(i=0;i<z.length;i++){if(z[i]>z[ci]){fi=i;break}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci]}else nl[ci].style.zIndex=z[ci]+1}inst.repaint()},_getParentLayer:function(n){return tinyMCE.getParentNode(n,function(n){return n.nodeType==1&&new RegExp('absolute|relative|static','gi').test(n.style.position)})},_insertLayer:function(){var inst=tinyMCE.selectedInstance;var e=tinyMCE.getParentElement(inst.getFocusElement());var p=tinyMCE.getAbsPosition(e);var d=inst.getDoc();var ne=d.createElement('div');var h=inst.selection.getSelectedHTML();ne.style.position='absolute';ne.style.left=p.absLeft+'px';ne.style.top=(p.absTop>20?p.absTop:20)+'px';ne.style.width='100px';ne.style.height='100px';ne.className='mceVisualAid';if(!h)h=tinyMCE.getLang('lang_layer_content');ne.innerHTML=h;d.body.appendChild(ne)},_toggleAbsolute:function(){var inst=tinyMCE.selectedInstance;var le=this._getParentLayer(inst.getFocusElement());if(le==null)le=tinyMCE.getParentElement(inst.getFocusElement(),'div,p,img');if(le){if(le.style.position.toLowerCase()=="absolute"){le.style.position="";le.style.left="";le.style.top=""}else{le.style.position="absolute";if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';tinyMCE.handleVisualAid(inst.getBody(),true,inst.visualAid,inst)}inst.repaint();tinyMCE.triggerNodeChange()}}};tinyMCE.addPlugin("layer",TinyMCE_LayerPlugin);
|
upload_to_tinymce_directory/plugins/layer/editor_plugin_src.js
ADDED
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('layer');
|
10 |
+
|
11 |
+
var TinyMCE_LayerPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Layer',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
if (tinyMCE.isMSIE && !tinyMCE.isOpera)
|
24 |
+
inst.getDoc().execCommand('2D-Position');
|
25 |
+
},
|
26 |
+
|
27 |
+
handleEvent : function(e) {
|
28 |
+
var inst = tinyMCE.selectedInstance;
|
29 |
+
var w = inst.getWin(), le = inst._lastStyleElm, e;
|
30 |
+
|
31 |
+
if (tinyMCE.isGecko) {
|
32 |
+
e = this._getParentLayer(inst.getFocusElement());
|
33 |
+
|
34 |
+
if (e) {
|
35 |
+
if (!inst._lastStyleElm) {
|
36 |
+
e.style.overflow = 'auto';
|
37 |
+
inst._lastStyleElm = e;
|
38 |
+
}
|
39 |
+
} else if (le) {
|
40 |
+
le = inst._lastStyleElm;
|
41 |
+
le.style.width = le.scrollWidth + 'px';
|
42 |
+
le.style.height = le.scrollHeight + 'px';
|
43 |
+
le.style.overflow = '';
|
44 |
+
inst._lastStyleElm = null;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
return true;
|
49 |
+
},
|
50 |
+
|
51 |
+
handleVisualAid : function(el, deep, state, inst) {
|
52 |
+
var nl = inst.getDoc().getElementsByTagName("div"), i;
|
53 |
+
|
54 |
+
for (i=0; i<nl.length; i++) {
|
55 |
+
if (new RegExp('absolute|relative|static', 'gi').test(nl[i].style.position)) {
|
56 |
+
if (state)
|
57 |
+
tinyMCE.addCSSClass(nl[i], 'mceVisualAid');
|
58 |
+
else
|
59 |
+
tinyMCE.removeCSSClass(nl[i], 'mceVisualAid');
|
60 |
+
}
|
61 |
+
}
|
62 |
+
},
|
63 |
+
|
64 |
+
getControlHTML : function(cn) {
|
65 |
+
switch (cn) {
|
66 |
+
case "moveforward":
|
67 |
+
return tinyMCE.getButtonHTML(cn, 'lang_layer_forward_desc', '{$pluginurl}/images/moveforward.gif', 'mceMoveForward', true);
|
68 |
+
|
69 |
+
case "movebackward":
|
70 |
+
return tinyMCE.getButtonHTML(cn, 'lang_layer_backward_desc', '{$pluginurl}/images/movebackward.gif', 'mceMoveBackward', true);
|
71 |
+
|
72 |
+
case "absolute":
|
73 |
+
return tinyMCE.getButtonHTML(cn, 'lang_layer_absolute_desc', '{$pluginurl}/images/absolute.gif', 'mceMakeAbsolute', true);
|
74 |
+
|
75 |
+
case "insertlayer":
|
76 |
+
return tinyMCE.getButtonHTML(cn, 'lang_layer_insertlayer_desc', '{$pluginurl}/images/insertlayer.gif', 'mceInsertLayer', true);
|
77 |
+
}
|
78 |
+
|
79 |
+
return "";
|
80 |
+
},
|
81 |
+
|
82 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
83 |
+
// Handle commands
|
84 |
+
switch (command) {
|
85 |
+
case "mceInsertLayer":
|
86 |
+
this._insertLayer();
|
87 |
+
return true;
|
88 |
+
|
89 |
+
case "mceMoveForward":
|
90 |
+
this._move(1);
|
91 |
+
return true;
|
92 |
+
|
93 |
+
case "mceMoveBackward":
|
94 |
+
this._move(-1);
|
95 |
+
return true;
|
96 |
+
|
97 |
+
case "mceMakeAbsolute":
|
98 |
+
this._toggleAbsolute();
|
99 |
+
return true;
|
100 |
+
}
|
101 |
+
|
102 |
+
// Pass to next handler in chain
|
103 |
+
return false;
|
104 |
+
},
|
105 |
+
|
106 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
107 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
108 |
+
var le = this._getParentLayer(inst.getFocusElement());
|
109 |
+
var p = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img');
|
110 |
+
|
111 |
+
tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonDisabled');
|
112 |
+
tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonDisabled');
|
113 |
+
tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonDisabled');
|
114 |
+
|
115 |
+
if (p)
|
116 |
+
tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonNormal');
|
117 |
+
|
118 |
+
if (le && le.style.position.toLowerCase() == "absolute") {
|
119 |
+
tinyMCE.switchClass(editor_id + '_absolute', 'mceButtonSelected');
|
120 |
+
tinyMCE.switchClass(editor_id + '_moveforward', 'mceButtonNormal');
|
121 |
+
tinyMCE.switchClass(editor_id + '_movebackward', 'mceButtonNormal');
|
122 |
+
}
|
123 |
+
},
|
124 |
+
|
125 |
+
// Private plugin specific methods
|
126 |
+
|
127 |
+
_move : function(d) {
|
128 |
+
var inst = tinyMCE.selectedInstance, i, z = new Array();
|
129 |
+
var le = this._getParentLayer(inst.getFocusElement()), ci = -1, fi = -1;
|
130 |
+
var nl = tinyMCE.selectNodes(inst.getBody(), function(n) {
|
131 |
+
return n.nodeType == 1 && new RegExp('absolute|relative|static', 'gi').test(n.style.position);
|
132 |
+
});
|
133 |
+
|
134 |
+
// Find z-indexes
|
135 |
+
for (i=0; i<nl.length; i++) {
|
136 |
+
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
|
137 |
+
|
138 |
+
if (ci < 0 && nl[i] == le)
|
139 |
+
ci = i;
|
140 |
+
}
|
141 |
+
|
142 |
+
if (d < 0) {
|
143 |
+
// Move back
|
144 |
+
|
145 |
+
// Try find a lower one
|
146 |
+
for (i=0; i<z.length; i++) {
|
147 |
+
if (z[i] < z[ci]) {
|
148 |
+
fi = i;
|
149 |
+
break;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
if (fi > -1) {
|
154 |
+
nl[ci].style.zIndex = z[fi];
|
155 |
+
nl[fi].style.zIndex = z[ci];
|
156 |
+
} else {
|
157 |
+
if (z[ci] > 0)
|
158 |
+
nl[ci].style.zIndex = z[ci] - 1;
|
159 |
+
}
|
160 |
+
} else {
|
161 |
+
// Move forward
|
162 |
+
|
163 |
+
// Try find a higher one
|
164 |
+
for (i=0; i<z.length; i++) {
|
165 |
+
if (z[i] > z[ci]) {
|
166 |
+
fi = i;
|
167 |
+
break;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
if (fi > -1) {
|
172 |
+
nl[ci].style.zIndex = z[fi];
|
173 |
+
nl[fi].style.zIndex = z[ci];
|
174 |
+
} else
|
175 |
+
nl[ci].style.zIndex = z[ci] + 1;
|
176 |
+
}
|
177 |
+
|
178 |
+
inst.repaint();
|
179 |
+
},
|
180 |
+
|
181 |
+
_getParentLayer : function(n) {
|
182 |
+
return tinyMCE.getParentNode(n, function(n) {
|
183 |
+
return n.nodeType == 1 && new RegExp('absolute|relative|static', 'gi').test(n.style.position);
|
184 |
+
});
|
185 |
+
},
|
186 |
+
|
187 |
+
_insertLayer : function() {
|
188 |
+
var inst = tinyMCE.selectedInstance;
|
189 |
+
var e = tinyMCE.getParentElement(inst.getFocusElement());
|
190 |
+
var p = tinyMCE.getAbsPosition(e);
|
191 |
+
var d = inst.getDoc();
|
192 |
+
var ne = d.createElement('div');
|
193 |
+
var h = inst.selection.getSelectedHTML();
|
194 |
+
|
195 |
+
// Move div
|
196 |
+
ne.style.position = 'absolute';
|
197 |
+
ne.style.left = p.absLeft + 'px';
|
198 |
+
ne.style.top = (p.absTop > 20 ? p.absTop : 20) + 'px';
|
199 |
+
ne.style.width = '100px';
|
200 |
+
ne.style.height = '100px';
|
201 |
+
ne.className = 'mceVisualAid';
|
202 |
+
|
203 |
+
if (!h)
|
204 |
+
h = tinyMCE.getLang('lang_layer_content');
|
205 |
+
|
206 |
+
ne.innerHTML = h;
|
207 |
+
|
208 |
+
// Add it
|
209 |
+
d.body.appendChild(ne);
|
210 |
+
},
|
211 |
+
|
212 |
+
_toggleAbsolute : function() {
|
213 |
+
var inst = tinyMCE.selectedInstance;
|
214 |
+
var le = this._getParentLayer(inst.getFocusElement());
|
215 |
+
|
216 |
+
if (le == null)
|
217 |
+
le = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img');
|
218 |
+
|
219 |
+
if (le) {
|
220 |
+
if (le.style.position.toLowerCase() == "absolute") {
|
221 |
+
le.style.position = "";
|
222 |
+
le.style.left = "";
|
223 |
+
le.style.top = "";
|
224 |
+
} else {
|
225 |
+
le.style.position = "absolute";
|
226 |
+
|
227 |
+
if (le.style.left == "")
|
228 |
+
le.style.left = 20 + 'px';
|
229 |
+
|
230 |
+
if (le.style.top == "")
|
231 |
+
le.style.top = 20 + 'px';
|
232 |
+
|
233 |
+
if (le.style.width == "")
|
234 |
+
le.style.width = le.width ? (le.width + 'px') : '100px';
|
235 |
+
|
236 |
+
if (le.style.height == "")
|
237 |
+
le.style.height = le.height ? (le.height + 'px') : '100px';
|
238 |
+
|
239 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
|
240 |
+
}
|
241 |
+
|
242 |
+
inst.repaint();
|
243 |
+
tinyMCE.triggerNodeChange();
|
244 |
+
}
|
245 |
+
}
|
246 |
+
};
|
247 |
+
|
248 |
+
tinyMCE.addPlugin("layer", TinyMCE_LayerPlugin);
|
upload_to_tinymce_directory/plugins/layer/images/absolute.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/backward.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/forward.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/insert_layer.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/insertlayer.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/movebackward.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/images/moveforward.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/layer/langs/en.js
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('layer',{
|
4 |
+
insertlayer_desc : 'Insert new layer',
|
5 |
+
forward_desc : 'Move forward',
|
6 |
+
backward_desc : 'Move backward',
|
7 |
+
absolute_desc : 'Toggle absolute positioning',
|
8 |
+
content : 'New layer...'
|
9 |
+
});
|
upload_to_tinymce_directory/plugins/layer/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/media/css/content.css
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {
|
2 |
+
border: 1px dotted #cc0000;
|
3 |
+
background-position: center;
|
4 |
+
background-repeat: no-repeat;
|
5 |
+
background-color: #ffffcc;
|
6 |
+
}
|
7 |
+
|
8 |
+
.mceItemShockWave {
|
9 |
+
background-image: url('../images/shockwave.gif');
|
10 |
+
}
|
11 |
+
|
12 |
+
.mceItemFlash {
|
13 |
+
background-image: url('../images/flash.gif');
|
14 |
+
}
|
15 |
+
|
16 |
+
.mceItemQuickTime {
|
17 |
+
background-image: url('../images/quicktime.gif');
|
18 |
+
}
|
19 |
+
|
20 |
+
.mceItemWindowsMedia {
|
21 |
+
background-image: url('../images/windowsmedia.gif');
|
22 |
+
}
|
23 |
+
|
24 |
+
.mceItemRealMedia {
|
25 |
+
background-image: url('../images/realmedia.gif');
|
26 |
+
}
|
upload_to_tinymce_directory/plugins/media/css/media.css
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#id, #name, #hspace, #vspace, #class_name, #align {
|
2 |
+
width: 100px;
|
3 |
+
}
|
4 |
+
|
5 |
+
#hspace, #vspace {
|
6 |
+
width: 50px;
|
7 |
+
}
|
8 |
+
|
9 |
+
#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
|
10 |
+
width: 100px;
|
11 |
+
}
|
12 |
+
|
13 |
+
#flash_base, #flash_flashvars {
|
14 |
+
width: 240px;
|
15 |
+
}
|
16 |
+
|
17 |
+
#width, #height {
|
18 |
+
width: 40px;
|
19 |
+
}
|
20 |
+
|
21 |
+
#src, #media_type {
|
22 |
+
width: 250px;
|
23 |
+
}
|
24 |
+
|
25 |
+
#class {
|
26 |
+
width: 120px;
|
27 |
+
}
|
28 |
+
|
29 |
+
#prev {
|
30 |
+
margin: 0;
|
31 |
+
border: 1px solid black;
|
32 |
+
width: 99%;
|
33 |
+
height: 230px;
|
34 |
+
overflow: auto;
|
35 |
+
}
|
36 |
+
|
37 |
+
.panel_wrapper div.current {
|
38 |
+
height: 390px;
|
39 |
+
overflow: auto;
|
40 |
+
}
|
41 |
+
|
42 |
+
#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
|
43 |
+
display: none;
|
44 |
+
}
|
45 |
+
|
46 |
+
.mceAddSelectValue {
|
47 |
+
background-color: #DDDDDD;
|
48 |
+
}
|
49 |
+
|
50 |
+
#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
|
51 |
+
width: 70px;
|
52 |
+
}
|
53 |
+
|
54 |
+
#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
|
55 |
+
width: 70px;
|
56 |
+
}
|
57 |
+
|
58 |
+
#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
|
59 |
+
width: 70px;
|
60 |
+
}
|
61 |
+
|
62 |
+
#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
|
63 |
+
width: 90px;
|
64 |
+
}
|
65 |
+
|
66 |
+
#qt_qtsrc {
|
67 |
+
width: 200px;
|
68 |
+
}
|
upload_to_tinymce_directory/plugins/media/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('media');var TinyMCE_MediaPlugin={getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(inst.hasPlugin('flash')&&!tinyMCE.flashWarn){alert('Flash plugin is deprecated and should not be used together with the media plugin.');tinyMCE.flashWarn=true}if(!tinyMCE.settings['media_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/media/css/content.css")},getControlHTML:function(cn){switch(cn){case"media":return tinyMCE.getButtonHTML(cn,'lang_media_desc','{$pluginurl}/images/media.gif','mceMedia')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceMedia":tinyMCE.openWindow({file:'../../plugins/media/media.htm',width:430+tinyMCE.getLang('lang_media_delta_width',0),height:470+tinyMCE.getLang('lang_media_delta_height',0)},{editor_id:editor_id,inline:"yes"});return true}return false},cleanup:function(type,content,inst){var nl,img,i,ne,d,s,ci;switch(type){case"insert_to_editor":img=tinyMCE.getParam("theme_href")+'/images/spacer.gif';content=content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,'<img class="mceItem$1" title="$2" src="'+img+'" />');content=content.replace(/<object([^>]*)>/gi,'<div class="mceItemObject" $1>');content=content.replace(/<embed([^>]*)>/gi,'<div class="mceItemObjectEmbed" $1>');content=content.replace(/<\/(object|embed)([^>]*)>/gi,'</div>');content=content.replace(/<param([^>]*)>/gi,'<div $1 class="mceItemParam"></div>');content=content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>','gi'),'class="mceItemParam"></div>');break;case"insert_to_editor_dom":d=inst.getDoc();nl=content.getElementsByTagName("img");for(i=0;i<nl.length;i++){if(/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)){nl[i].width=nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g,'$1');nl[i].height=nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g,'$1');}}nl=tinyMCE.selectElements(content,'DIV',function(n){return tinyMCE.hasCSSClass(n,'mceItemObject')});for(i=0;i<nl.length;i++){ci=tinyMCE.getAttrib(nl[i],"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash',d,nl[i]),nl[i]);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave',d,nl[i]),nl[i]);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia',d,nl[i]),nl[i]);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime',d,nl[i]),nl[i]);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia',d,nl[i]),nl[i]);break}}nl=tinyMCE.selectNodes(content,function(n){return n.className=='mceItemObjectEmbed'});for(i=0;i<nl.length;i++){switch(tinyMCE.getAttrib(nl[i],'type')){case'application/x-shockwave-flash':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemFlash');break;case'application/x-director':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemShockWave');break;case'application/x-mplayer2':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemWindowsMedia');break;case'video/quicktime':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemQuickTime');break;case'audio/x-pn-realaudio-plugin':TinyMCE_MediaPlugin._createImgFromEmbed(nl[i],d,'mceItemRealMedia');break}}break;case"get_from_editor":var startPos=-1,endPos,attribs,chunkBefore,chunkAfter,embedHTML,at,pl,cb,mt,ex;while((startPos=content.indexOf('<img',startPos+1))!=-1){endPos=content.indexOf('/>',startPos);attribs=TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos+4,endPos));if(!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))continue;endPos+=2;at=attribs['title'];if(at){at=at.replace(/&(#39|apos);/g,"'");at=at.replace(/&#quot;/g,'"');try{pl=eval('x={'+at+'};')}catch(ex){pl={}}}if(!tinyMCE.getParam('media_use_script',false)){switch(attribs['class']){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166B1BCA-3F9C-11CF-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=tinyMCE.getParam('media_wmp6_compatible')?'05589FA1-C356-11CE-BF01-00AA0055595A':'6BF52A52-394A-11D3-B153-00C04F79FAA6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break}if(!tinyMCE.getParam("relative_urls"))pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);embedHTML=TinyMCE_MediaPlugin._getEmbed(ci,cb,mt,pl,attribs)}else{switch(attribs['class']){case'mceItemFlash':s='writeFlash';break;case'mceItemShockWave':s='writeShockWave';break;case'mceItemWindowsMedia':s='writeWindowsMedia';break;case'mceItemQuickTime':s='writeQuickTime';break;case'mceItemRealMedia':s='writeRealMedia';break}if(attribs.width)at=at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g,"width:'"+attribs.width+"'");if(attribs.height)at=at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g,"height:'"+attribs.height+"'");if(!tinyMCE.getParam("relative_urls")){pl.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],pl.src);at=at.replace(new RegExp("src:'[^']*'","g"),"src:'"+pl.src+"'")}embedHTML='<script type="text/javascript">'+s+'({'+at+'});</script>'}chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter}break}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node,'class'))){tinyMCE.switchClass(editor_id+'_media','mceButtonSelected');return true}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_media','mceButtonNormal');return true},_createImgFromEmbed:function(n,d,cl){var ne,at,i,ti='',an;ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;at=n.attributes;for(i=0;i<at.length;i++){if(at[i].specified&&at[i].nodeValue){an=at[i].nodeName.toLowerCase();if(an=='src')continue;if(an=='mce_src')an='src';if(an.indexOf('mce_')==-1&&!new RegExp('^(class|type)$').test(an))ti+=an.toLowerCase()+':\''+at[i].nodeValue+"',"}}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;n.parentNode.replaceChild(ne,n)},_createImg:function(cl,d,n){var i,nl,ti="",an,av,al=new Array();ne=d.createElement('img');ne.src=tinyMCE.getParam("theme_href")+'/images/spacer.gif';ne.width=tinyMCE.getAttrib(n,'width');ne.height=tinyMCE.getAttrib(n,'height');ne.className=cl;al.id=tinyMCE.getAttrib(n,'id');al.name=tinyMCE.getAttrib(n,'name');al.width=tinyMCE.getAttrib(n,'width');al.height=tinyMCE.getAttrib(n,'height');al.bgcolor=tinyMCE.getAttrib(n,'bgcolor');al.align=tinyMCE.getAttrib(n,'align');al.class_name=tinyMCE.getAttrib(n,'mce_class');nl=n.getElementsByTagName('div');for(i=0;i<nl.length;i++){av=tinyMCE.getAttrib(nl[i],'value');av=av.replace(new RegExp('\\\\','g'),'\\\\');av=av.replace(new RegExp('"','g'),'\\"');av=av.replace(new RegExp("'",'g'),"\\'");an=tinyMCE.getAttrib(nl[i],'name');al[an]=av}if(al.movie){al.src=al.movie;al.movie=null}for(an in al){if(al[an]!=null&&typeof(al[an])!="function"&&al[an]!='')ti+=an.toLowerCase()+':\''+al[an]+"',"}ti=ti.length>0?ti.substring(0,ti.length-1):ti;ne.title=ti;return ne},_getEmbed:function(cls,cb,mt,p,at){var h='',n;p.width=at.width?at.width:p.width;p.height=at.height?at.height:p.height;h+='<object classid="clsid:'+cls+'" codebase="'+cb+'"';h+=typeof(p.id)!="undefined"?' id="'+p.id+'"':'';h+=typeof(p.name)!="undefined"?' name="'+p.name+'"':'';h+=typeof(p.width)!="undefined"?' width="'+p.width+'"':'';h+=typeof(p.height)!="undefined"?' height="'+p.height+'"':'';h+=typeof(p.align)!="undefined"?' align="'+p.align+'"':'';h+='>';for(n in p){if(typeof(p[n])!="undefined"&&typeof(p[n])!="function"){h+='<param name="'+n+'" value="'+p[n]+'" />';if(n=='src'&&p[n].indexOf('://')!=-1&&mt=='application/x-mplayer2')h+='<param name="url" value="'+p[n]+'" />'}}h+='<embed type="'+mt+'"';for(n in p){if(typeof(p[n])=="function")continue;if(!(n=='url'&&mt=='application/x-mplayer2'))h+=' '+n+'="'+p[n]+'"'}h+='></embed></object>';return h},_parseAttributes:function(attribute_string){var attributeName="",endChr='"';var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue){withInValue=true;endChr=chr}else if(chr==endChr&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue=""}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr}return attributes}};tinyMCE.addPlugin("media",TinyMCE_MediaPlugin);
|
upload_to_tinymce_directory/plugins/media/editor_plugin_src.js
ADDED
@@ -0,0 +1,435 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 275 2007-05-01 15:35:08Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('media');
|
10 |
+
|
11 |
+
var TinyMCE_MediaPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Media',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
// Warn if user has flash plugin and media plugin at the same time
|
24 |
+
if (inst.hasPlugin('flash') && !tinyMCE.flashWarn) {
|
25 |
+
alert('Flash plugin is deprecated and should not be used together with the media plugin.');
|
26 |
+
tinyMCE.flashWarn = true;
|
27 |
+
}
|
28 |
+
|
29 |
+
if (!tinyMCE.settings['media_skip_plugin_css'])
|
30 |
+
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/media/css/content.css");
|
31 |
+
},
|
32 |
+
|
33 |
+
getControlHTML : function(cn) {
|
34 |
+
switch (cn) {
|
35 |
+
case "media":
|
36 |
+
return tinyMCE.getButtonHTML(cn, 'lang_media_desc', '{$pluginurl}/images/media.gif', 'mceMedia');
|
37 |
+
}
|
38 |
+
|
39 |
+
return "";
|
40 |
+
},
|
41 |
+
|
42 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
43 |
+
// Handle commands
|
44 |
+
switch (command) {
|
45 |
+
case "mceMedia":
|
46 |
+
tinyMCE.openWindow({
|
47 |
+
file : '../../plugins/media/media.htm',
|
48 |
+
width : 430 + tinyMCE.getLang('lang_media_delta_width', 0),
|
49 |
+
height : 470 + tinyMCE.getLang('lang_media_delta_height', 0)
|
50 |
+
}, {
|
51 |
+
editor_id : editor_id,
|
52 |
+
inline : "yes"
|
53 |
+
});
|
54 |
+
|
55 |
+
return true;
|
56 |
+
}
|
57 |
+
|
58 |
+
// Pass to next handler in chain
|
59 |
+
return false;
|
60 |
+
},
|
61 |
+
|
62 |
+
cleanup : function(type, content, inst) {
|
63 |
+
var nl, img, i, ne, d, s, ci;
|
64 |
+
|
65 |
+
switch (type) {
|
66 |
+
case "insert_to_editor":
|
67 |
+
img = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
|
68 |
+
content = content.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, '<img class="mceItem$1" title="$2" src="' + img + '" />');
|
69 |
+
content = content.replace(/<object([^>]*)>/gi, '<div class="mceItemObject" $1>');
|
70 |
+
content = content.replace(/<embed([^>]*)>/gi, '<div class="mceItemObjectEmbed" $1>');
|
71 |
+
content = content.replace(/<\/(object|embed)([^>]*)>/gi, '</div>');
|
72 |
+
content = content.replace(/<param([^>]*)>/gi, '<div $1 class="mceItemParam"></div>');
|
73 |
+
content = content.replace(new RegExp('\\/ class="mceItemParam"><\\/div>', 'gi'), 'class="mceItemParam"></div>');
|
74 |
+
break;
|
75 |
+
|
76 |
+
case "insert_to_editor_dom":
|
77 |
+
d = inst.getDoc();
|
78 |
+
nl = content.getElementsByTagName("img");
|
79 |
+
for (i=0; i<nl.length; i++) {
|
80 |
+
if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(nl[i].className)) {
|
81 |
+
nl[i].width = nl[i].title.replace(/.*width:[^0-9]?([0-9]+)%?.*/g, '$1');
|
82 |
+
nl[i].height = nl[i].title.replace(/.*height:[^0-9]?([0-9]+)%?.*/g, '$1');
|
83 |
+
//nl[i].align = nl[i].title.replace(/.*align:([a-z]+).*/gi, '$1');
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
nl = tinyMCE.selectElements(content, 'DIV', function (n) {return tinyMCE.hasCSSClass(n, 'mceItemObject');});
|
88 |
+
for (i=0; i<nl.length; i++) {
|
89 |
+
ci = tinyMCE.getAttrib(nl[i], "classid").toLowerCase().replace(/\s+/g, '');
|
90 |
+
|
91 |
+
switch (ci) {
|
92 |
+
case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':
|
93 |
+
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemFlash', d, nl[i]), nl[i]);
|
94 |
+
break;
|
95 |
+
|
96 |
+
case 'clsid:166b1bca-3f9c-11cf-8075-444553540000':
|
97 |
+
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemShockWave', d, nl[i]), nl[i]);
|
98 |
+
break;
|
99 |
+
|
100 |
+
case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':
|
101 |
+
case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':
|
102 |
+
case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':
|
103 |
+
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemWindowsMedia', d, nl[i]), nl[i]);
|
104 |
+
break;
|
105 |
+
|
106 |
+
case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':
|
107 |
+
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemQuickTime', d, nl[i]), nl[i]);
|
108 |
+
break;
|
109 |
+
|
110 |
+
case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':
|
111 |
+
nl[i].parentNode.replaceChild(TinyMCE_MediaPlugin._createImg('mceItemRealMedia', d, nl[i]), nl[i]);
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
// Handle embed (if any)
|
117 |
+
nl = tinyMCE.selectNodes(content, function (n) {return n.className == 'mceItemObjectEmbed';});
|
118 |
+
for (i=0; i<nl.length; i++) {
|
119 |
+
switch (tinyMCE.getAttrib(nl[i], 'type')) {
|
120 |
+
case 'application/x-shockwave-flash':
|
121 |
+
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemFlash');
|
122 |
+
break;
|
123 |
+
|
124 |
+
case 'application/x-director':
|
125 |
+
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemShockWave');
|
126 |
+
break;
|
127 |
+
|
128 |
+
case 'application/x-mplayer2':
|
129 |
+
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemWindowsMedia');
|
130 |
+
break;
|
131 |
+
|
132 |
+
case 'video/quicktime':
|
133 |
+
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemQuickTime');
|
134 |
+
break;
|
135 |
+
|
136 |
+
case 'audio/x-pn-realaudio-plugin':
|
137 |
+
TinyMCE_MediaPlugin._createImgFromEmbed(nl[i], d, 'mceItemRealMedia');
|
138 |
+
break;
|
139 |
+
}
|
140 |
+
}
|
141 |
+
break;
|
142 |
+
|
143 |
+
case "get_from_editor":
|
144 |
+
var startPos = -1, endPos, attribs, chunkBefore, chunkAfter, embedHTML, at, pl, cb, mt, ex;
|
145 |
+
|
146 |
+
while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
|
147 |
+
endPos = content.indexOf('/>', startPos);
|
148 |
+
attribs = TinyMCE_MediaPlugin._parseAttributes(content.substring(startPos + 4, endPos));
|
149 |
+
|
150 |
+
// Is not flash, skip it
|
151 |
+
if (!/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(attribs['class']))
|
152 |
+
continue;
|
153 |
+
|
154 |
+
endPos += 2;
|
155 |
+
|
156 |
+
// Parse attributes
|
157 |
+
at = attribs['title'];
|
158 |
+
if (at) {
|
159 |
+
at = at.replace(/&(#39|apos);/g, "'");
|
160 |
+
at = at.replace(/&#quot;/g, '"');
|
161 |
+
|
162 |
+
try {
|
163 |
+
pl = eval('x={' + at + '};');
|
164 |
+
} catch (ex) {
|
165 |
+
pl = {};
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
// Use object/embed
|
170 |
+
if (!tinyMCE.getParam('media_use_script', false)) {
|
171 |
+
switch (attribs['class']) {
|
172 |
+
case 'mceItemFlash':
|
173 |
+
ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000';
|
174 |
+
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
|
175 |
+
mt = 'application/x-shockwave-flash';
|
176 |
+
break;
|
177 |
+
|
178 |
+
case 'mceItemShockWave':
|
179 |
+
ci = '166B1BCA-3F9C-11CF-8075-444553540000';
|
180 |
+
cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
|
181 |
+
mt = 'application/x-director';
|
182 |
+
break;
|
183 |
+
|
184 |
+
case 'mceItemWindowsMedia':
|
185 |
+
ci = tinyMCE.getParam('media_wmp6_compatible') ? '05589FA1-C356-11CE-BF01-00AA0055595A' : '6BF52A52-394A-11D3-B153-00C04F79FAA6';
|
186 |
+
cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
|
187 |
+
mt = 'application/x-mplayer2';
|
188 |
+
break;
|
189 |
+
|
190 |
+
case 'mceItemQuickTime':
|
191 |
+
ci = '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
|
192 |
+
cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
|
193 |
+
mt = 'video/quicktime';
|
194 |
+
break;
|
195 |
+
|
196 |
+
case 'mceItemRealMedia':
|
197 |
+
ci = 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
|
198 |
+
cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
|
199 |
+
mt = 'audio/x-pn-realaudio-plugin';
|
200 |
+
break;
|
201 |
+
}
|
202 |
+
|
203 |
+
// Force absolute URL
|
204 |
+
if (!tinyMCE.getParam("relative_urls"))
|
205 |
+
pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
|
206 |
+
|
207 |
+
embedHTML = TinyMCE_MediaPlugin._getEmbed(ci, cb, mt, pl, attribs);
|
208 |
+
} else {
|
209 |
+
// Use script version
|
210 |
+
switch (attribs['class']) {
|
211 |
+
case 'mceItemFlash':
|
212 |
+
s = 'writeFlash';
|
213 |
+
break;
|
214 |
+
|
215 |
+
case 'mceItemShockWave':
|
216 |
+
s = 'writeShockWave';
|
217 |
+
break;
|
218 |
+
|
219 |
+
case 'mceItemWindowsMedia':
|
220 |
+
s = 'writeWindowsMedia';
|
221 |
+
break;
|
222 |
+
|
223 |
+
case 'mceItemQuickTime':
|
224 |
+
s = 'writeQuickTime';
|
225 |
+
break;
|
226 |
+
|
227 |
+
case 'mceItemRealMedia':
|
228 |
+
s = 'writeRealMedia';
|
229 |
+
break;
|
230 |
+
}
|
231 |
+
|
232 |
+
if (attribs.width)
|
233 |
+
at = at.replace(/width:[^0-9]?[0-9]+%?[^0-9]?/g, "width:'" + attribs.width + "'");
|
234 |
+
|
235 |
+
if (attribs.height)
|
236 |
+
at = at.replace(/height:[^0-9]?[0-9]+%?[^0-9]?/g, "height:'" + attribs.height + "'");
|
237 |
+
|
238 |
+
// Force absolute URL
|
239 |
+
if (!tinyMCE.getParam("relative_urls")) {
|
240 |
+
pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
|
241 |
+
at = at.replace(new RegExp("src:'[^']*'", "g"), "src:'" + pl.src + "'");
|
242 |
+
}
|
243 |
+
|
244 |
+
embedHTML = '<script type="text/javascript">' + s + '({' + at + '});</script>';
|
245 |
+
}
|
246 |
+
|
247 |
+
// Insert embed/object chunk
|
248 |
+
chunkBefore = content.substring(0, startPos);
|
249 |
+
chunkAfter = content.substring(endPos);
|
250 |
+
content = chunkBefore + embedHTML + chunkAfter;
|
251 |
+
}
|
252 |
+
break;
|
253 |
+
}
|
254 |
+
|
255 |
+
return content;
|
256 |
+
},
|
257 |
+
|
258 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
259 |
+
if (node == null)
|
260 |
+
return;
|
261 |
+
|
262 |
+
do {
|
263 |
+
if (node.nodeName == "IMG" && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(node, 'class'))) {
|
264 |
+
tinyMCE.switchClass(editor_id + '_media', 'mceButtonSelected');
|
265 |
+
return true;
|
266 |
+
}
|
267 |
+
} while ((node = node.parentNode));
|
268 |
+
|
269 |
+
tinyMCE.switchClass(editor_id + '_media', 'mceButtonNormal');
|
270 |
+
|
271 |
+
return true;
|
272 |
+
},
|
273 |
+
|
274 |
+
_createImgFromEmbed : function(n, d, cl) {
|
275 |
+
var ne, at, i, ti = '', an;
|
276 |
+
|
277 |
+
ne = d.createElement('img');
|
278 |
+
ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
|
279 |
+
ne.width = tinyMCE.getAttrib(n, 'width');
|
280 |
+
ne.height = tinyMCE.getAttrib(n, 'height');
|
281 |
+
ne.className = cl;
|
282 |
+
|
283 |
+
at = n.attributes;
|
284 |
+
for (i=0; i<at.length; i++) {
|
285 |
+
if (at[i].specified && at[i].nodeValue) {
|
286 |
+
an = at[i].nodeName.toLowerCase();
|
287 |
+
|
288 |
+
if (an == 'src')
|
289 |
+
continue;
|
290 |
+
|
291 |
+
if (an == 'mce_src')
|
292 |
+
an = 'src';
|
293 |
+
|
294 |
+
if (an.indexOf('mce_') == -1 && !new RegExp('^(class|type)$').test(an))
|
295 |
+
ti += an.toLowerCase() + ':\'' + at[i].nodeValue + "',";
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
|
300 |
+
ne.title = ti;
|
301 |
+
|
302 |
+
n.parentNode.replaceChild(ne, n);
|
303 |
+
},
|
304 |
+
|
305 |
+
_createImg : function(cl, d, n) {
|
306 |
+
var i, nl, ti = "", an, av, al = new Array();
|
307 |
+
|
308 |
+
ne = d.createElement('img');
|
309 |
+
ne.src = tinyMCE.getParam("theme_href") + '/images/spacer.gif';
|
310 |
+
ne.width = tinyMCE.getAttrib(n, 'width');
|
311 |
+
ne.height = tinyMCE.getAttrib(n, 'height');
|
312 |
+
ne.className = cl;
|
313 |
+
|
314 |
+
al.id = tinyMCE.getAttrib(n, 'id');
|
315 |
+
al.name = tinyMCE.getAttrib(n, 'name');
|
316 |
+
al.width = tinyMCE.getAttrib(n, 'width');
|
317 |
+
al.height = tinyMCE.getAttrib(n, 'height');
|
318 |
+
al.bgcolor = tinyMCE.getAttrib(n, 'bgcolor');
|
319 |
+
al.align = tinyMCE.getAttrib(n, 'align');
|
320 |
+
al.class_name = tinyMCE.getAttrib(n, 'mce_class');
|
321 |
+
|
322 |
+
nl = n.getElementsByTagName('div');
|
323 |
+
for (i=0; i<nl.length; i++) {
|
324 |
+
av = tinyMCE.getAttrib(nl[i], 'value');
|
325 |
+
av = av.replace(new RegExp('\\\\', 'g'), '\\\\');
|
326 |
+
av = av.replace(new RegExp('"', 'g'), '\\"');
|
327 |
+
av = av.replace(new RegExp("'", 'g'), "\\'");
|
328 |
+
an = tinyMCE.getAttrib(nl[i], 'name');
|
329 |
+
al[an] = av;
|
330 |
+
}
|
331 |
+
|
332 |
+
if (al.movie) {
|
333 |
+
al.src = al.movie;
|
334 |
+
al.movie = null;
|
335 |
+
}
|
336 |
+
|
337 |
+
for (an in al) {
|
338 |
+
if (al[an] != null && typeof(al[an]) != "function" && al[an] != '')
|
339 |
+
ti += an.toLowerCase() + ':\'' + al[an] + "',";
|
340 |
+
}
|
341 |
+
|
342 |
+
ti = ti.length > 0 ? ti.substring(0, ti.length - 1) : ti;
|
343 |
+
ne.title = ti;
|
344 |
+
|
345 |
+
return ne;
|
346 |
+
},
|
347 |
+
|
348 |
+
_getEmbed : function(cls, cb, mt, p, at) {
|
349 |
+
var h = '', n;
|
350 |
+
|
351 |
+
p.width = at.width ? at.width : p.width;
|
352 |
+
p.height = at.height ? at.height : p.height;
|
353 |
+
|
354 |
+
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
|
355 |
+
h += typeof(p.id) != "undefined" ? ' id="' + p.id + '"' : '';
|
356 |
+
h += typeof(p.name) != "undefined" ? ' name="' + p.name + '"' : '';
|
357 |
+
h += typeof(p.width) != "undefined" ? ' width="' + p.width + '"' : '';
|
358 |
+
h += typeof(p.height) != "undefined" ? ' height="' + p.height + '"' : '';
|
359 |
+
h += typeof(p.align) != "undefined" ? ' align="' + p.align + '"' : '';
|
360 |
+
h += '>';
|
361 |
+
|
362 |
+
for (n in p) {
|
363 |
+
if (typeof(p[n]) != "undefined" && typeof(p[n]) != "function") {
|
364 |
+
h += '<param name="' + n + '" value="' + p[n] + '" />';
|
365 |
+
|
366 |
+
// Add extra url parameter if it's an absolute URL on WMP
|
367 |
+
if (n == 'src' && p[n].indexOf('://') != -1 && mt == 'application/x-mplayer2')
|
368 |
+
h += '<param name="url" value="' + p[n] + '" />';
|
369 |
+
}
|
370 |
+
}
|
371 |
+
|
372 |
+
h += '<embed type="' + mt + '"';
|
373 |
+
|
374 |
+
for (n in p) {
|
375 |
+
if (typeof(p[n]) == "function")
|
376 |
+
continue;
|
377 |
+
|
378 |
+
// Skip url parameter for embed tag on WMP
|
379 |
+
if (!(n == 'url' && mt == 'application/x-mplayer2'))
|
380 |
+
h += ' ' + n + '="' + p[n] + '"';
|
381 |
+
}
|
382 |
+
|
383 |
+
h += '></embed></object>';
|
384 |
+
|
385 |
+
return h;
|
386 |
+
},
|
387 |
+
|
388 |
+
_parseAttributes : function(attribute_string) {
|
389 |
+
var attributeName = "", endChr = '"';
|
390 |
+
var attributeValue = "";
|
391 |
+
var withInName;
|
392 |
+
var withInValue;
|
393 |
+
var attributes = new Array();
|
394 |
+
var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
|
395 |
+
|
396 |
+
if (attribute_string == null || attribute_string.length < 2)
|
397 |
+
return null;
|
398 |
+
|
399 |
+
withInName = withInValue = false;
|
400 |
+
|
401 |
+
for (var i=0; i<attribute_string.length; i++) {
|
402 |
+
var chr = attribute_string.charAt(i);
|
403 |
+
|
404 |
+
if ((chr == '"' || chr == "'") && !withInValue) {
|
405 |
+
withInValue = true;
|
406 |
+
endChr = chr;
|
407 |
+
} else if (chr == endChr && withInValue) {
|
408 |
+
withInValue = false;
|
409 |
+
|
410 |
+
var pos = attributeName.lastIndexOf(' ');
|
411 |
+
if (pos != -1)
|
412 |
+
attributeName = attributeName.substring(pos+1);
|
413 |
+
|
414 |
+
attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
|
415 |
+
|
416 |
+
attributeName = "";
|
417 |
+
attributeValue = "";
|
418 |
+
} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
|
419 |
+
withInName = true;
|
420 |
+
|
421 |
+
if (chr == '=' && withInName)
|
422 |
+
withInName = false;
|
423 |
+
|
424 |
+
if (withInName)
|
425 |
+
attributeName += chr;
|
426 |
+
|
427 |
+
if (withInValue)
|
428 |
+
attributeValue += chr;
|
429 |
+
}
|
430 |
+
|
431 |
+
return attributes;
|
432 |
+
}
|
433 |
+
};
|
434 |
+
|
435 |
+
tinyMCE.addPlugin("media", TinyMCE_MediaPlugin);
|
upload_to_tinymce_directory/plugins/media/images/flash.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/images/media.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/images/quicktime.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/images/realmedia.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/images/shockwave.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/images/windowsmedia.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/media/jscripts/embed.js
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
|
3 |
+
*/
|
4 |
+
|
5 |
+
function writeFlash(p) {
|
6 |
+
writeEmbed(
|
7 |
+
'D27CDB6E-AE6D-11cf-96B8-444553540000',
|
8 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
9 |
+
'application/x-shockwave-flash',
|
10 |
+
p
|
11 |
+
);
|
12 |
+
}
|
13 |
+
|
14 |
+
function writeShockWave(p) {
|
15 |
+
writeEmbed(
|
16 |
+
'166B1BCA-3F9C-11CF-8075-444553540000',
|
17 |
+
'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
|
18 |
+
'application/x-director',
|
19 |
+
p
|
20 |
+
);
|
21 |
+
}
|
22 |
+
|
23 |
+
function writeQuickTime(p) {
|
24 |
+
writeEmbed(
|
25 |
+
'02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
|
26 |
+
'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
|
27 |
+
'video/quicktime',
|
28 |
+
p
|
29 |
+
);
|
30 |
+
}
|
31 |
+
|
32 |
+
function writeRealMedia(p) {
|
33 |
+
writeEmbed(
|
34 |
+
'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
|
35 |
+
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
|
36 |
+
'audio/x-pn-realaudio-plugin',
|
37 |
+
p
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
function writeWindowsMedia(p) {
|
42 |
+
p.url = p.src;
|
43 |
+
writeEmbed(
|
44 |
+
'6BF52A52-394A-11D3-B153-00C04F79FAA6',
|
45 |
+
'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
|
46 |
+
'application/x-mplayer2',
|
47 |
+
p
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
function writeEmbed(cls, cb, mt, p) {
|
52 |
+
var h = '', n;
|
53 |
+
|
54 |
+
h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
|
55 |
+
h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
|
56 |
+
h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
|
57 |
+
h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
|
58 |
+
h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
|
59 |
+
h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
|
60 |
+
h += '>';
|
61 |
+
|
62 |
+
for (n in p)
|
63 |
+
h += '<param name="' + n + '" value="' + p[n] + '">';
|
64 |
+
|
65 |
+
h += '<embed type="' + mt + '"';
|
66 |
+
|
67 |
+
for (n in p)
|
68 |
+
h += n + '="' + p[n] + '" ';
|
69 |
+
|
70 |
+
h += '></embed></object>';
|
71 |
+
|
72 |
+
document.write(h);
|
73 |
+
}
|
upload_to_tinymce_directory/plugins/media/jscripts/media.js
ADDED
@@ -0,0 +1,590 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var oldWidth, oldHeight;
|
2 |
+
var url = tinyMCE.getParam("media_external_list_url");
|
3 |
+
if (url != null) {
|
4 |
+
// Fix relative
|
5 |
+
if (url.charAt(0) != '/' && url.indexOf('://') == -1)
|
6 |
+
url = tinyMCE.documentBasePath + "/" + url;
|
7 |
+
|
8 |
+
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
|
9 |
+
}
|
10 |
+
|
11 |
+
function init() {
|
12 |
+
var pl = "", f, val;
|
13 |
+
var type = "flash", fe, i;
|
14 |
+
|
15 |
+
tinyMCEPopup.resizeToInnerSize();
|
16 |
+
f = document.forms[0]
|
17 |
+
|
18 |
+
fe = tinyMCE.selectedInstance.getFocusElement();
|
19 |
+
if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) {
|
20 |
+
pl = "x={" + fe.title + "};";
|
21 |
+
|
22 |
+
switch (tinyMCE.getAttrib(fe, 'class')) {
|
23 |
+
case 'mceItemFlash':
|
24 |
+
type = 'flash';
|
25 |
+
break;
|
26 |
+
|
27 |
+
case 'mceItemShockWave':
|
28 |
+
type = 'shockwave';
|
29 |
+
break;
|
30 |
+
|
31 |
+
case 'mceItemWindowsMedia':
|
32 |
+
type = 'wmp';
|
33 |
+
break;
|
34 |
+
|
35 |
+
case 'mceItemQuickTime':
|
36 |
+
type = 'qt';
|
37 |
+
break;
|
38 |
+
|
39 |
+
case 'mceItemRealMedia':
|
40 |
+
type = 'rmp';
|
41 |
+
break;
|
42 |
+
}
|
43 |
+
|
44 |
+
document.forms[0].insert.value = tinyMCE.getLang('lang_update', 'Insert', true);
|
45 |
+
}
|
46 |
+
|
47 |
+
document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
|
48 |
+
document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
|
49 |
+
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
50 |
+
|
51 |
+
var html = getMediaListHTML('filebrowser','src','media','media');
|
52 |
+
if (html == "")
|
53 |
+
document.getElementById("linklistrow").style.display = 'none';
|
54 |
+
else
|
55 |
+
document.getElementById("linklistcontainer").innerHTML = html;
|
56 |
+
|
57 |
+
// Resize some elements
|
58 |
+
if (isVisible('filebrowsercontainer'))
|
59 |
+
document.getElementById('src').style.width = '230px';
|
60 |
+
|
61 |
+
// Setup form
|
62 |
+
if (pl != "") {
|
63 |
+
pl = eval(pl);
|
64 |
+
|
65 |
+
switch (type) {
|
66 |
+
case "flash":
|
67 |
+
setBool(pl, 'flash', 'play');
|
68 |
+
setBool(pl, 'flash', 'loop');
|
69 |
+
setBool(pl, 'flash', 'menu');
|
70 |
+
setBool(pl, 'flash', 'swliveconnect');
|
71 |
+
setStr(pl, 'flash', 'quality');
|
72 |
+
setStr(pl, 'flash', 'scale');
|
73 |
+
setStr(pl, 'flash', 'salign');
|
74 |
+
setStr(pl, 'flash', 'wmode');
|
75 |
+
setStr(pl, 'flash', 'base');
|
76 |
+
setStr(pl, 'flash', 'flashvars');
|
77 |
+
break;
|
78 |
+
|
79 |
+
case "qt":
|
80 |
+
setBool(pl, 'qt', 'loop');
|
81 |
+
setBool(pl, 'qt', 'autoplay');
|
82 |
+
setBool(pl, 'qt', 'cache');
|
83 |
+
setBool(pl, 'qt', 'controller');
|
84 |
+
setBool(pl, 'qt', 'correction');
|
85 |
+
setBool(pl, 'qt', 'enablejavascript');
|
86 |
+
setBool(pl, 'qt', 'kioskmode');
|
87 |
+
setBool(pl, 'qt', 'autohref');
|
88 |
+
setBool(pl, 'qt', 'playeveryframe');
|
89 |
+
setBool(pl, 'qt', 'tarsetcache');
|
90 |
+
setStr(pl, 'qt', 'scale');
|
91 |
+
setStr(pl, 'qt', 'starttime');
|
92 |
+
setStr(pl, 'qt', 'endtime');
|
93 |
+
setStr(pl, 'qt', 'tarset');
|
94 |
+
setStr(pl, 'qt', 'qtsrcchokespeed');
|
95 |
+
setStr(pl, 'qt', 'volume');
|
96 |
+
setStr(pl, 'qt', 'qtsrc');
|
97 |
+
break;
|
98 |
+
|
99 |
+
case "shockwave":
|
100 |
+
setBool(pl, 'shockwave', 'sound');
|
101 |
+
setBool(pl, 'shockwave', 'progress');
|
102 |
+
setBool(pl, 'shockwave', 'autostart');
|
103 |
+
setBool(pl, 'shockwave', 'swliveconnect');
|
104 |
+
setStr(pl, 'shockwave', 'swvolume');
|
105 |
+
setStr(pl, 'shockwave', 'swstretchstyle');
|
106 |
+
setStr(pl, 'shockwave', 'swstretchhalign');
|
107 |
+
setStr(pl, 'shockwave', 'swstretchvalign');
|
108 |
+
break;
|
109 |
+
|
110 |
+
case "wmp":
|
111 |
+
setBool(pl, 'wmp', 'autostart');
|
112 |
+
setBool(pl, 'wmp', 'enabled');
|
113 |
+
setBool(pl, 'wmp', 'enablecontextmenu');
|
114 |
+
setBool(pl, 'wmp', 'fullscreen');
|
115 |
+
setBool(pl, 'wmp', 'invokeurls');
|
116 |
+
setBool(pl, 'wmp', 'mute');
|
117 |
+
setBool(pl, 'wmp', 'stretchtofit');
|
118 |
+
setBool(pl, 'wmp', 'windowlessvideo');
|
119 |
+
setStr(pl, 'wmp', 'balance');
|
120 |
+
setStr(pl, 'wmp', 'baseurl');
|
121 |
+
setStr(pl, 'wmp', 'captioningid');
|
122 |
+
setStr(pl, 'wmp', 'currentmarker');
|
123 |
+
setStr(pl, 'wmp', 'currentposition');
|
124 |
+
setStr(pl, 'wmp', 'defaultframe');
|
125 |
+
setStr(pl, 'wmp', 'playcount');
|
126 |
+
setStr(pl, 'wmp', 'rate');
|
127 |
+
setStr(pl, 'wmp', 'uimode');
|
128 |
+
setStr(pl, 'wmp', 'volume');
|
129 |
+
break;
|
130 |
+
|
131 |
+
case "rmp":
|
132 |
+
setBool(pl, 'rmp', 'autostart');
|
133 |
+
setBool(pl, 'rmp', 'loop');
|
134 |
+
setBool(pl, 'rmp', 'autogotourl');
|
135 |
+
setBool(pl, 'rmp', 'center');
|
136 |
+
setBool(pl, 'rmp', 'imagestatus');
|
137 |
+
setBool(pl, 'rmp', 'maintainaspect');
|
138 |
+
setBool(pl, 'rmp', 'nojava');
|
139 |
+
setBool(pl, 'rmp', 'prefetch');
|
140 |
+
setBool(pl, 'rmp', 'shuffle');
|
141 |
+
setStr(pl, 'rmp', 'console');
|
142 |
+
setStr(pl, 'rmp', 'controls');
|
143 |
+
setStr(pl, 'rmp', 'numloop');
|
144 |
+
setStr(pl, 'rmp', 'scriptcallbacks');
|
145 |
+
break;
|
146 |
+
}
|
147 |
+
|
148 |
+
setStr(pl, null, 'src');
|
149 |
+
setStr(pl, null, 'id');
|
150 |
+
setStr(pl, null, 'name');
|
151 |
+
setStr(pl, null, 'vspace');
|
152 |
+
setStr(pl, null, 'hspace');
|
153 |
+
setStr(pl, null, 'bgcolor');
|
154 |
+
setStr(pl, null, 'align');
|
155 |
+
setStr(pl, null, 'width');
|
156 |
+
setStr(pl, null, 'height');
|
157 |
+
|
158 |
+
if ((val = tinyMCE.getAttrib(fe, "width")) != "")
|
159 |
+
pl.width = f.width.value = val;
|
160 |
+
|
161 |
+
if ((val = tinyMCE.getAttrib(fe, "height")) != "")
|
162 |
+
pl.height = f.height.value = val;
|
163 |
+
|
164 |
+
oldWidth = pl.width ? parseInt(pl.width) : 0;
|
165 |
+
oldHeight = pl.height ? parseInt(pl.height) : 0;
|
166 |
+
} else
|
167 |
+
oldWidth = oldHeight = 0;
|
168 |
+
|
169 |
+
selectByValue(f, 'media_type', type);
|
170 |
+
changedType(type);
|
171 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
172 |
+
|
173 |
+
TinyMCE_EditableSelects.init();
|
174 |
+
generatePreview();
|
175 |
+
}
|
176 |
+
|
177 |
+
function insertMedia() {
|
178 |
+
var fe, f = document.forms[0], h;
|
179 |
+
|
180 |
+
if (!AutoValidator.validate(f)) {
|
181 |
+
alert(tinyMCE.getLang('lang_invalid_data'));
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
f.width.value = f.width.value == "" ? 100 : f.width.value;
|
186 |
+
f.height.value = f.height.value == "" ? 100 : f.height.value;
|
187 |
+
|
188 |
+
fe = tinyMCE.selectedInstance.getFocusElement();
|
189 |
+
if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(fe, 'class'))) {
|
190 |
+
switch (f.media_type.options[f.media_type.selectedIndex].value) {
|
191 |
+
case "flash":
|
192 |
+
fe.className = "mceItemFlash";
|
193 |
+
break;
|
194 |
+
|
195 |
+
case "shockwave":
|
196 |
+
fe.className = "mceItemShockWave";
|
197 |
+
break;
|
198 |
+
|
199 |
+
case "qt":
|
200 |
+
fe.className = "mceItemQuickTime";
|
201 |
+
break;
|
202 |
+
|
203 |
+
case "wmp":
|
204 |
+
fe.className = "mceItemWindowsMedia";
|
205 |
+
break;
|
206 |
+
|
207 |
+
case "rmp":
|
208 |
+
fe.className = "mceItemRealMedia";
|
209 |
+
break;
|
210 |
+
}
|
211 |
+
|
212 |
+
if (fe.width != f.width.value || fe.height != f.height.height)
|
213 |
+
tinyMCE.selectedInstance.repaint();
|
214 |
+
|
215 |
+
fe.title = serializeParameters();
|
216 |
+
fe.width = f.width.value;
|
217 |
+
fe.height = f.height.value;
|
218 |
+
fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
|
219 |
+
fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
|
220 |
+
fe.align = f.align.options[f.align.selectedIndex].value;
|
221 |
+
} else {
|
222 |
+
h = '<img src="' + tinyMCE.getParam("theme_href") + '/images/spacer.gif"' ;
|
223 |
+
|
224 |
+
switch (f.media_type.options[f.media_type.selectedIndex].value) {
|
225 |
+
case "flash":
|
226 |
+
h += ' class="mceItemFlash"';
|
227 |
+
break;
|
228 |
+
|
229 |
+
case "shockwave":
|
230 |
+
h += ' class="mceItemShockWave"';
|
231 |
+
break;
|
232 |
+
|
233 |
+
case "qt":
|
234 |
+
h += ' class="mceItemQuickTime"';
|
235 |
+
break;
|
236 |
+
|
237 |
+
case "wmp":
|
238 |
+
h += ' class="mceItemWindowsMedia"';
|
239 |
+
break;
|
240 |
+
|
241 |
+
case "rmp":
|
242 |
+
h += ' class="mceItemRealMedia"';
|
243 |
+
break;
|
244 |
+
}
|
245 |
+
|
246 |
+
h += ' title="' + serializeParameters() + '"';
|
247 |
+
h += ' width="' + f.width.value + '"';
|
248 |
+
h += ' height="' + f.height.value + '"';
|
249 |
+
h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
|
250 |
+
|
251 |
+
h += ' />';
|
252 |
+
|
253 |
+
tinyMCE.selectedInstance.execCommand('mceInsertContent', false, h);
|
254 |
+
}
|
255 |
+
|
256 |
+
tinyMCEPopup.close();
|
257 |
+
}
|
258 |
+
|
259 |
+
function getMediaListHTML() {
|
260 |
+
if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
|
261 |
+
var html = "";
|
262 |
+
|
263 |
+
html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.src.value=this.options[this.selectedIndex].value;">';
|
264 |
+
html += '<option value="">---</option>';
|
265 |
+
|
266 |
+
for (var i=0; i<tinyMCEMediaList.length; i++)
|
267 |
+
html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
|
268 |
+
|
269 |
+
html += '</select>';
|
270 |
+
|
271 |
+
return html;
|
272 |
+
}
|
273 |
+
|
274 |
+
return "";
|
275 |
+
}
|
276 |
+
|
277 |
+
function getType(v) {
|
278 |
+
var fo, i, c, el, x, f = document.forms[0];
|
279 |
+
|
280 |
+
fo = tinyMCE.getParam("media_types", "flash=swf;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
|
281 |
+
|
282 |
+
// YouTube
|
283 |
+
if (v.indexOf('http://www.youtube.com/watch?v=') == 0) {
|
284 |
+
f.width.value = '425';
|
285 |
+
f.height.value = '350';
|
286 |
+
f.src.value = 'http://www.youtube.com/v/' + v.substring('http://www.youtube.com/watch?v='.length);
|
287 |
+
return 'flash';
|
288 |
+
}
|
289 |
+
|
290 |
+
// Google video
|
291 |
+
if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
|
292 |
+
f.width.value = '425';
|
293 |
+
f.height.value = '326';
|
294 |
+
f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';
|
295 |
+
return 'flash';
|
296 |
+
}
|
297 |
+
|
298 |
+
for (i=0; i<fo.length; i++) {
|
299 |
+
c = fo[i].split('=');
|
300 |
+
|
301 |
+
el = c[1].split(',');
|
302 |
+
for (x=0; x<el.length; x++)
|
303 |
+
if (v.indexOf('.' + el[x]) != -1)
|
304 |
+
return c[0];
|
305 |
+
}
|
306 |
+
|
307 |
+
return null;
|
308 |
+
}
|
309 |
+
|
310 |
+
function switchType(v) {
|
311 |
+
var t = getType(v), d = document, f = d.forms[0];
|
312 |
+
|
313 |
+
if (!t)
|
314 |
+
return;
|
315 |
+
|
316 |
+
selectByValue(d.forms[0], 'media_type', t);
|
317 |
+
changedType(t);
|
318 |
+
|
319 |
+
// Update qtsrc also
|
320 |
+
if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
|
321 |
+
alert(tinyMCE.getLang("lang_media_qt_stream_warn"));
|
322 |
+
|
323 |
+
if (f.qt_qtsrc.value == '')
|
324 |
+
f.qt_qtsrc.value = f.src.value;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
|
328 |
+
function changedType(t) {
|
329 |
+
var d = document;
|
330 |
+
|
331 |
+
d.getElementById('flash_options').style.display = 'none';
|
332 |
+
d.getElementById('qt_options').style.display = 'none';
|
333 |
+
d.getElementById('shockwave_options').style.display = 'none';
|
334 |
+
d.getElementById('wmp_options').style.display = 'none';
|
335 |
+
d.getElementById('rmp_options').style.display = 'none';
|
336 |
+
d.getElementById(t + '_options').style.display = 'block';
|
337 |
+
}
|
338 |
+
|
339 |
+
function serializeParameters() {
|
340 |
+
var d = document, f = d.forms[0], s = '';
|
341 |
+
|
342 |
+
switch (f.media_type.options[f.media_type.selectedIndex].value) {
|
343 |
+
case "flash":
|
344 |
+
s += getBool('flash', 'play', true);
|
345 |
+
s += getBool('flash', 'loop', true);
|
346 |
+
s += getBool('flash', 'menu', true);
|
347 |
+
s += getBool('flash', 'swliveconnect', false);
|
348 |
+
s += getStr('flash', 'quality');
|
349 |
+
s += getStr('flash', 'scale');
|
350 |
+
s += getStr('flash', 'salign');
|
351 |
+
s += getStr('flash', 'wmode');
|
352 |
+
s += getStr('flash', 'base');
|
353 |
+
s += getStr('flash', 'flashvars');
|
354 |
+
break;
|
355 |
+
|
356 |
+
case "qt":
|
357 |
+
s += getBool('qt', 'loop', false);
|
358 |
+
s += getBool('qt', 'autoplay', true);
|
359 |
+
s += getBool('qt', 'cache', false);
|
360 |
+
s += getBool('qt', 'controller', true);
|
361 |
+
s += getBool('qt', 'correction', false, 'none', 'full');
|
362 |
+
s += getBool('qt', 'enablejavascript', false);
|
363 |
+
s += getBool('qt', 'kioskmode', false);
|
364 |
+
s += getBool('qt', 'autohref', false);
|
365 |
+
s += getBool('qt', 'playeveryframe', false);
|
366 |
+
s += getBool('qt', 'targetcache', false);
|
367 |
+
s += getStr('qt', 'scale');
|
368 |
+
s += getStr('qt', 'starttime');
|
369 |
+
s += getStr('qt', 'endtime');
|
370 |
+
s += getStr('qt', 'target');
|
371 |
+
s += getStr('qt', 'qtsrcchokespeed');
|
372 |
+
s += getStr('qt', 'volume');
|
373 |
+
s += getStr('qt', 'qtsrc');
|
374 |
+
break;
|
375 |
+
|
376 |
+
case "shockwave":
|
377 |
+
s += getBool('shockwave', 'sound');
|
378 |
+
s += getBool('shockwave', 'progress');
|
379 |
+
s += getBool('shockwave', 'autostart');
|
380 |
+
s += getBool('shockwave', 'swliveconnect');
|
381 |
+
s += getStr('shockwave', 'swvolume');
|
382 |
+
s += getStr('shockwave', 'swstretchstyle');
|
383 |
+
s += getStr('shockwave', 'swstretchhalign');
|
384 |
+
s += getStr('shockwave', 'swstretchvalign');
|
385 |
+
break;
|
386 |
+
|
387 |
+
case "wmp":
|
388 |
+
s += getBool('wmp', 'autostart', true);
|
389 |
+
s += getBool('wmp', 'enabled', false);
|
390 |
+
s += getBool('wmp', 'enablecontextmenu', true);
|
391 |
+
s += getBool('wmp', 'fullscreen', false);
|
392 |
+
s += getBool('wmp', 'invokeurls', true);
|
393 |
+
s += getBool('wmp', 'mute', false);
|
394 |
+
s += getBool('wmp', 'stretchtofit', false);
|
395 |
+
s += getBool('wmp', 'windowlessvideo', false);
|
396 |
+
s += getStr('wmp', 'balance');
|
397 |
+
s += getStr('wmp', 'baseurl');
|
398 |
+
s += getStr('wmp', 'captioningid');
|
399 |
+
s += getStr('wmp', 'currentmarker');
|
400 |
+
s += getStr('wmp', 'currentposition');
|
401 |
+
s += getStr('wmp', 'defaultframe');
|
402 |
+
s += getStr('wmp', 'playcount');
|
403 |
+
s += getStr('wmp', 'rate');
|
404 |
+
s += getStr('wmp', 'uimode');
|
405 |
+
s += getStr('wmp', 'volume');
|
406 |
+
break;
|
407 |
+
|
408 |
+
case "rmp":
|
409 |
+
s += getBool('rmp', 'autostart', false);
|
410 |
+
s += getBool('rmp', 'loop', false);
|
411 |
+
s += getBool('rmp', 'autogotourl', true);
|
412 |
+
s += getBool('rmp', 'center', false);
|
413 |
+
s += getBool('rmp', 'imagestatus', true);
|
414 |
+
s += getBool('rmp', 'maintainaspect', false);
|
415 |
+
s += getBool('rmp', 'nojava', false);
|
416 |
+
s += getBool('rmp', 'prefetch', false);
|
417 |
+
s += getBool('rmp', 'shuffle', false);
|
418 |
+
s += getStr('rmp', 'console');
|
419 |
+
s += getStr('rmp', 'controls');
|
420 |
+
s += getStr('rmp', 'numloop');
|
421 |
+
s += getStr('rmp', 'scriptcallbacks');
|
422 |
+
break;
|
423 |
+
}
|
424 |
+
|
425 |
+
s += getStr(null, 'id');
|
426 |
+
s += getStr(null, 'name');
|
427 |
+
s += getStr(null, 'src');
|
428 |
+
s += getStr(null, 'align');
|
429 |
+
s += getStr(null, 'bgcolor');
|
430 |
+
s += getInt(null, 'vspace');
|
431 |
+
s += getInt(null, 'hspace');
|
432 |
+
s += getStr(null, 'width');
|
433 |
+
s += getStr(null, 'height');
|
434 |
+
|
435 |
+
s = s.length > 0 ? s.substring(0, s.length - 1) : s;
|
436 |
+
|
437 |
+
return s;
|
438 |
+
}
|
439 |
+
|
440 |
+
function setBool(pl, p, n) {
|
441 |
+
if (typeof(pl[n]) == "undefined")
|
442 |
+
return;
|
443 |
+
|
444 |
+
document.forms[0].elements[p + "_" + n].checked = pl[n];
|
445 |
+
}
|
446 |
+
|
447 |
+
function setStr(pl, p, n) {
|
448 |
+
var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
|
449 |
+
|
450 |
+
if (typeof(pl[n]) == "undefined")
|
451 |
+
return;
|
452 |
+
|
453 |
+
if (e.type == "text")
|
454 |
+
e.value = pl[n];
|
455 |
+
else
|
456 |
+
selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
|
457 |
+
}
|
458 |
+
|
459 |
+
function getBool(p, n, d, tv, fv) {
|
460 |
+
var v = document.forms[0].elements[p + "_" + n].checked;
|
461 |
+
|
462 |
+
tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
|
463 |
+
fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
|
464 |
+
|
465 |
+
return (v == d) ? '' : n + (v ? ':' + tv + ',' : ':' + fv + ',');
|
466 |
+
}
|
467 |
+
|
468 |
+
function getStr(p, n, d) {
|
469 |
+
var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
|
470 |
+
var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
|
471 |
+
|
472 |
+
return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
|
473 |
+
}
|
474 |
+
|
475 |
+
function getInt(p, n, d) {
|
476 |
+
var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
|
477 |
+
var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
|
478 |
+
|
479 |
+
return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
|
480 |
+
}
|
481 |
+
|
482 |
+
function jsEncode(s) {
|
483 |
+
s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
|
484 |
+
s = s.replace(new RegExp('"', 'g'), '\\"');
|
485 |
+
s = s.replace(new RegExp("'", 'g'), "\\'");
|
486 |
+
|
487 |
+
return s;
|
488 |
+
}
|
489 |
+
|
490 |
+
function generatePreview(c) {
|
491 |
+
var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
|
492 |
+
|
493 |
+
p.innerHTML = '<!-- x --->';
|
494 |
+
|
495 |
+
nw = parseInt(f.width.value);
|
496 |
+
nh = parseInt(f.height.value);
|
497 |
+
|
498 |
+
if (f.width.value != "" && f.height.value != "") {
|
499 |
+
if (f.constrain.checked) {
|
500 |
+
if (c == 'width' && oldWidth != 0) {
|
501 |
+
wp = nw / oldWidth;
|
502 |
+
nh = Math.round(wp * nh);
|
503 |
+
f.height.value = nh;
|
504 |
+
} else if (c == 'height' && oldHeight != 0) {
|
505 |
+
hp = nh / oldHeight;
|
506 |
+
nw = Math.round(hp * nw);
|
507 |
+
f.width.value = nw;
|
508 |
+
}
|
509 |
+
}
|
510 |
+
}
|
511 |
+
|
512 |
+
if (f.width.value != "")
|
513 |
+
oldWidth = nw;
|
514 |
+
|
515 |
+
if (f.height.value != "")
|
516 |
+
oldHeight = nh;
|
517 |
+
|
518 |
+
// After constrain
|
519 |
+
pl = serializeParameters();
|
520 |
+
|
521 |
+
switch (f.media_type.options[f.media_type.selectedIndex].value) {
|
522 |
+
case "flash":
|
523 |
+
cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
|
524 |
+
codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
|
525 |
+
type = 'application/x-shockwave-flash';
|
526 |
+
break;
|
527 |
+
|
528 |
+
case "shockwave":
|
529 |
+
cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
|
530 |
+
codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
|
531 |
+
type = 'application/x-director';
|
532 |
+
break;
|
533 |
+
|
534 |
+
case "qt":
|
535 |
+
cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
|
536 |
+
codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
|
537 |
+
type = 'video/quicktime';
|
538 |
+
break;
|
539 |
+
|
540 |
+
case "wmp":
|
541 |
+
cls = tinyMCE.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
|
542 |
+
codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
|
543 |
+
type = 'application/x-mplayer2';
|
544 |
+
break;
|
545 |
+
|
546 |
+
case "rmp":
|
547 |
+
cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
|
548 |
+
codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
|
549 |
+
type = 'audio/x-pn-realaudio-plugin';
|
550 |
+
break;
|
551 |
+
}
|
552 |
+
|
553 |
+
if (pl == '') {
|
554 |
+
p.innerHTML = '';
|
555 |
+
return;
|
556 |
+
}
|
557 |
+
|
558 |
+
pl = eval('x={' + pl + '};');
|
559 |
+
|
560 |
+
if (!pl.src) {
|
561 |
+
p.innerHTML = '';
|
562 |
+
return;
|
563 |
+
}
|
564 |
+
|
565 |
+
pl.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], pl.src);
|
566 |
+
pl.width = !pl.width ? 100 : pl.width;
|
567 |
+
pl.height = !pl.height ? 100 : pl.height;
|
568 |
+
pl.id = !pl.id ? 'obj' : pl.id;
|
569 |
+
pl.name = !pl.name ? 'eobj' : pl.name;
|
570 |
+
pl.align = !pl.align ? '' : pl.align;
|
571 |
+
|
572 |
+
h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
|
573 |
+
|
574 |
+
for (n in pl) {
|
575 |
+
h += '<param name="' + n + '" value="' + pl[n] + '">';
|
576 |
+
|
577 |
+
// Add extra url parameter if it's an absolute URL
|
578 |
+
if (n == 'src' && pl[n].indexOf('://') != -1)
|
579 |
+
h += '<param name="url" value="' + pl[n] + '" />';
|
580 |
+
}
|
581 |
+
|
582 |
+
h += '<embed type="' + type + '" ';
|
583 |
+
|
584 |
+
for (n in pl)
|
585 |
+
h += n + '="' + pl[n] + '" ';
|
586 |
+
|
587 |
+
h += '></embed></object>';
|
588 |
+
|
589 |
+
p.innerHTML = "<!-- x --->" + h;
|
590 |
+
}
|
upload_to_tinymce_directory/plugins/media/langs/en.js
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('media',{
|
4 |
+
title : 'Insert / edit embedded media',
|
5 |
+
desc : 'Insert / edit embedded media',
|
6 |
+
general : 'General',
|
7 |
+
advanced : 'Advanced',
|
8 |
+
file : 'File/URL',
|
9 |
+
list : 'List',
|
10 |
+
size : 'Dimensions',
|
11 |
+
preview : 'Preview',
|
12 |
+
constrain_proportions : 'Constrain proportions',
|
13 |
+
type : 'Type',
|
14 |
+
id : 'Id',
|
15 |
+
name : 'Name',
|
16 |
+
class_name : 'Class',
|
17 |
+
vspace : 'V-Space',
|
18 |
+
hspace : 'H-Space',
|
19 |
+
play : 'Auto play',
|
20 |
+
loop : 'Loop',
|
21 |
+
menu : 'Show menu',
|
22 |
+
quality : 'Quality',
|
23 |
+
scale : 'Scale',
|
24 |
+
align : 'Align',
|
25 |
+
salign : 'SAlign',
|
26 |
+
wmode : 'WMode',
|
27 |
+
bgcolor : 'Background',
|
28 |
+
base : 'Base',
|
29 |
+
flashvars : 'Flashvars',
|
30 |
+
liveconnect : 'SWLiveConnect',
|
31 |
+
autohref : 'AutoHREF',
|
32 |
+
cache : 'Cache',
|
33 |
+
hidden : 'Hidden',
|
34 |
+
controller : 'Controller',
|
35 |
+
kioskmode : 'Kiosk mode',
|
36 |
+
playeveryframe : 'Play every frame',
|
37 |
+
targetcache : 'Target cache',
|
38 |
+
correction : 'No correction',
|
39 |
+
enablejavascript : 'Enable JavaScript',
|
40 |
+
starttime : 'Start time',
|
41 |
+
endtime : 'End time',
|
42 |
+
href : 'Href',
|
43 |
+
qtsrcchokespeed : 'Choke speed',
|
44 |
+
target : 'Target',
|
45 |
+
volume : 'Volume',
|
46 |
+
autostart : 'Auto start',
|
47 |
+
enabled : 'Enabled',
|
48 |
+
fullscreen : 'Fullscreen',
|
49 |
+
invokeurls : 'Invoke URLs',
|
50 |
+
mute : 'Mute',
|
51 |
+
stretchtofit : 'Stretch to fit',
|
52 |
+
windowlessvideo : 'Windowless video',
|
53 |
+
balance : 'Balance',
|
54 |
+
baseurl : 'Base URL',
|
55 |
+
captioningid : 'Captioning id',
|
56 |
+
currentmarker : 'Current marker',
|
57 |
+
currentposition : 'Current position',
|
58 |
+
defaultframe : 'Default frame',
|
59 |
+
playcount : 'Play count',
|
60 |
+
rate : 'Rate',
|
61 |
+
uimode : 'UI Mode',
|
62 |
+
flash_options : 'Flash options',
|
63 |
+
qt_options : 'Quicktime options',
|
64 |
+
wmp_options : 'Windows media player options',
|
65 |
+
rmp_options : 'Real media player options',
|
66 |
+
shockwave_options : 'Shockwave options',
|
67 |
+
autogotourl : 'Auto goto URL',
|
68 |
+
center : 'Center',
|
69 |
+
imagestatus : 'Image status',
|
70 |
+
maintainaspect : 'Maintain aspect',
|
71 |
+
nojava : 'No java',
|
72 |
+
prefetch : 'Prefetch',
|
73 |
+
shuffle : 'Shuffle',
|
74 |
+
console : 'Console',
|
75 |
+
numloop : 'Num loops',
|
76 |
+
controls : 'Controls',
|
77 |
+
scriptcallbacks : 'Script callbacks',
|
78 |
+
swstretchstyle : 'Stretch style',
|
79 |
+
swstretchhalign : 'Stretch H-Align',
|
80 |
+
swstretchvalign : 'Stretch V-Align',
|
81 |
+
sound : 'Sound',
|
82 |
+
progress : 'Progress',
|
83 |
+
qtsrc : 'QT Src',
|
84 |
+
qt_stream_warn : 'Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..',
|
85 |
+
align_top : 'Top',
|
86 |
+
align_right : 'Right',
|
87 |
+
align_bottom : 'Bottom',
|
88 |
+
align_left : 'Left',
|
89 |
+
align_center : 'Center',
|
90 |
+
align_top_left : 'Top left',
|
91 |
+
align_top_right : 'Top right',
|
92 |
+
align_bottom_left : 'Bottom left',
|
93 |
+
align_bottom_right : 'Bottom right'
|
94 |
+
});
|
upload_to_tinymce_directory/plugins/media/media.htm
ADDED
@@ -0,0 +1,723 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_media_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="jscripts/media.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
10 |
+
<link href="css/media.css" rel="stylesheet" type="text/css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertMedia();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{$lang_media_general}</a></span></li>
|
18 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_media_advanced}</a></span></li>
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_media_general}</legend>
|
26 |
+
|
27 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
28 |
+
<tr>
|
29 |
+
<td><label for="media_type">{$lang_media_type}</label></td>
|
30 |
+
<td>
|
31 |
+
<select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
|
32 |
+
<option value="flash">Flash</option>
|
33 |
+
<option value="qt">Quicktime</option>
|
34 |
+
<option value="shockwave">Shockware</option>
|
35 |
+
<option value="wmp">Windows Media</option>
|
36 |
+
<option value="rmp">Real Media</option>
|
37 |
+
</select>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
<tr>
|
41 |
+
<td><label for="src">{$lang_media_file}</label></td>
|
42 |
+
<td>
|
43 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
44 |
+
<tr>
|
45 |
+
<td><input id="src" name="src" type="text" value="" onchange="switchType(this.value);generatePreview();" /></td>
|
46 |
+
<td id="filebrowsercontainer"> </td>
|
47 |
+
</tr>
|
48 |
+
</table>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
<tr id="linklistrow">
|
52 |
+
<td><label for="linklist">{$lang_media_list}</label></td>
|
53 |
+
<td id="linklistcontainer"> </td>
|
54 |
+
</tr>
|
55 |
+
<tr>
|
56 |
+
<td><label for="width">{$lang_media_size}</label></td>
|
57 |
+
<td>
|
58 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
59 |
+
<tr>
|
60 |
+
<td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
|
61 |
+
<td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
|
62 |
+
<td><label id="constrainlabel" for="constrain">{$lang_media_constrain_proportions}</label></td>
|
63 |
+
</tr>
|
64 |
+
</table>
|
65 |
+
</tr>
|
66 |
+
</table>
|
67 |
+
</fieldset>
|
68 |
+
|
69 |
+
<fieldset>
|
70 |
+
<legend>{$lang_media_preview}</legend>
|
71 |
+
<div id="prev"></div>
|
72 |
+
</fieldset>
|
73 |
+
</div>
|
74 |
+
|
75 |
+
<div id="advanced_panel" class="panel">
|
76 |
+
<fieldset>
|
77 |
+
<legend>{$lang_media_advanced}</legend>
|
78 |
+
|
79 |
+
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
80 |
+
<tr>
|
81 |
+
<td><label for="id">{$lang_media_id}</label></td>
|
82 |
+
<td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
|
83 |
+
<td><label for="name">{$lang_media_name}</label></td>
|
84 |
+
<td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
|
85 |
+
</tr>
|
86 |
+
|
87 |
+
<tr>
|
88 |
+
<td><label for="align">{$lang_media_align}</label></td>
|
89 |
+
<td>
|
90 |
+
<select id="align" name="align" onchange="generatePreview();">
|
91 |
+
<option value="">{$lang_not_set}</option>
|
92 |
+
<option value="top">{$lang_media_align_top}</option>
|
93 |
+
<option value="right">{$lang_media_align_right}</option>
|
94 |
+
<option value="bottom">{$lang_media_align_bottom}</option>
|
95 |
+
<option value="left">{$lang_media_align_left}</option>
|
96 |
+
</select>
|
97 |
+
</td>
|
98 |
+
|
99 |
+
<td><label for="bgcolor">{$lang_media_bgcolor}</label></td>
|
100 |
+
<td>
|
101 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
102 |
+
<tr>
|
103 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
|
104 |
+
<td id="bgcolor_pickcontainer"> </td>
|
105 |
+
</tr>
|
106 |
+
</table>
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
|
110 |
+
<tr>
|
111 |
+
<td><label for="vspace">{$lang_media_vspace}</label></td>
|
112 |
+
<td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
|
113 |
+
<td><label for="hspace">{$lang_media_hspace}</label></td>
|
114 |
+
<td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
|
115 |
+
</tr>
|
116 |
+
</table>
|
117 |
+
</fieldset>
|
118 |
+
|
119 |
+
<fieldset id="flash_options">
|
120 |
+
<legend>{$lang_media_flash_options}</legend>
|
121 |
+
|
122 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
123 |
+
<tr>
|
124 |
+
<td><label for="flash_quality">{$lang_media_quality}</label></td>
|
125 |
+
<td>
|
126 |
+
<select id="flash_quality" name="flash_quality" onchange="generatePreview();">
|
127 |
+
<option value="">{$lang_not_set}</option>
|
128 |
+
<option value="high">high</option>
|
129 |
+
<option value="low">low</option>
|
130 |
+
<option value="autolow">autolow</option>
|
131 |
+
<option value="autohigh">autohigh</option>
|
132 |
+
<option value="best">best</option>
|
133 |
+
</select>
|
134 |
+
</td>
|
135 |
+
|
136 |
+
<td><label for="flash_scale">{$lang_media_scale}</label></td>
|
137 |
+
<td>
|
138 |
+
<select id="flash_scale" name="flash_scale" onchange="generatePreview();">
|
139 |
+
<option value="">{$lang_not_set}</option>
|
140 |
+
<option value="showall">showall</option>
|
141 |
+
<option value="noborder">noborder</option>
|
142 |
+
<option value="exactfit">exactfit</option>
|
143 |
+
</select>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
|
147 |
+
<tr>
|
148 |
+
<td><label for="flash_wmode">{$lang_media_wmode}</label></td>
|
149 |
+
<td>
|
150 |
+
<select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
|
151 |
+
<option value="">{$lang_not_set}</option>
|
152 |
+
<option value="window">window</option>
|
153 |
+
<option value="opaque">opaque</option>
|
154 |
+
<option value="transparent">transparent</option>
|
155 |
+
</select>
|
156 |
+
</td>
|
157 |
+
|
158 |
+
<td><label for="flash_salign">{$lang_media_salign}</label></td>
|
159 |
+
<td>
|
160 |
+
<select id="flash_salign" name="flash_salign" onchange="generatePreview();">
|
161 |
+
<option value="">{$lang_not_set}</option>
|
162 |
+
<option value="l">{$lang_media_align_left}</option>
|
163 |
+
<option value="t">{$lang_media_align_top}</option>
|
164 |
+
<option value="r">{$lang_media_align_right}</option>
|
165 |
+
<option value="b">{$lang_media_align_bottom}</option>
|
166 |
+
<option value="tl">{$lang_media_align_top_left}</option>
|
167 |
+
<option value="tr">{$lang_media_align_top_right}</option>
|
168 |
+
<option value="bl">{$lang_media_align_bottom_left}</option>
|
169 |
+
<option value="br">{$lang_media_align_bottom_right}</option>
|
170 |
+
</select>
|
171 |
+
</td>
|
172 |
+
</tr>
|
173 |
+
|
174 |
+
<tr>
|
175 |
+
<td colspan="2">
|
176 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
177 |
+
<tr>
|
178 |
+
<td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
|
179 |
+
<td><label for="flash_play">{$lang_media_play}</label></td>
|
180 |
+
</tr>
|
181 |
+
</table>
|
182 |
+
</td>
|
183 |
+
|
184 |
+
<td colspan="2">
|
185 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
186 |
+
<tr>
|
187 |
+
<td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
|
188 |
+
<td><label for="flash_loop">{$lang_media_loop}</label></td>
|
189 |
+
</tr>
|
190 |
+
</table>
|
191 |
+
</td>
|
192 |
+
</tr>
|
193 |
+
|
194 |
+
<tr>
|
195 |
+
<td colspan="2">
|
196 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
197 |
+
<tr>
|
198 |
+
<td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
|
199 |
+
<td><label for="flash_menu">{$lang_media_menu}</label></td>
|
200 |
+
</tr>
|
201 |
+
</table>
|
202 |
+
</td>
|
203 |
+
|
204 |
+
<td colspan="2">
|
205 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
206 |
+
<tr>
|
207 |
+
<td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
|
208 |
+
<td><label for="flash_swliveconnect">{$lang_media_liveconnect}</label></td>
|
209 |
+
</tr>
|
210 |
+
</table>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
</table>
|
214 |
+
|
215 |
+
<table>
|
216 |
+
<tr>
|
217 |
+
<td><label for="flash_base">{$lang_media_base}</label></td>
|
218 |
+
<td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
|
219 |
+
</tr>
|
220 |
+
|
221 |
+
<tr>
|
222 |
+
<td><label for="flash_flashvars">{$lang_media_flashvars}</label></td>
|
223 |
+
<td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
|
224 |
+
</tr>
|
225 |
+
</table>
|
226 |
+
</fieldset>
|
227 |
+
|
228 |
+
<fieldset id="qt_options">
|
229 |
+
<legend>{$lang_media_qt_options}</legend>
|
230 |
+
|
231 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
232 |
+
<tr>
|
233 |
+
<td colspan="2">
|
234 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
235 |
+
<tr>
|
236 |
+
<td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
|
237 |
+
<td><label for="qt_loop">{$lang_media_loop}</label></td>
|
238 |
+
</tr>
|
239 |
+
</table>
|
240 |
+
</td>
|
241 |
+
|
242 |
+
<td colspan="2">
|
243 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
244 |
+
<tr>
|
245 |
+
<td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
|
246 |
+
<td><label for="qt_autoplay">{$lang_media_play}</label></td>
|
247 |
+
</tr>
|
248 |
+
</table>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
|
252 |
+
<tr>
|
253 |
+
<td colspan="2">
|
254 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
255 |
+
<tr>
|
256 |
+
<td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
|
257 |
+
<td><label for="qt_cache">{$lang_media_cache}</label></td>
|
258 |
+
</tr>
|
259 |
+
</table>
|
260 |
+
</td>
|
261 |
+
|
262 |
+
<td colspan="2">
|
263 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
264 |
+
<tr>
|
265 |
+
<td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
|
266 |
+
<td><label for="qt_controller">{$lang_media_controller}</label></td>
|
267 |
+
</tr>
|
268 |
+
</table>
|
269 |
+
</td>
|
270 |
+
</tr>
|
271 |
+
|
272 |
+
<tr>
|
273 |
+
<td colspan="2">
|
274 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
275 |
+
<tr>
|
276 |
+
<td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
|
277 |
+
<td><label for="qt_correction">{$lang_media_correction}</label></td>
|
278 |
+
</tr>
|
279 |
+
</table>
|
280 |
+
</td>
|
281 |
+
|
282 |
+
<td colspan="2">
|
283 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
284 |
+
<tr>
|
285 |
+
<td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
|
286 |
+
<td><label for="qt_enablejavascript">{$lang_media_enablejavascript}</label></td>
|
287 |
+
</tr>
|
288 |
+
</table>
|
289 |
+
</td>
|
290 |
+
</tr>
|
291 |
+
|
292 |
+
<tr>
|
293 |
+
<td colspan="2">
|
294 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
295 |
+
<tr>
|
296 |
+
<td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
|
297 |
+
<td><label for="qt_kioskmode">{$lang_media_kioskmode}</label></td>
|
298 |
+
</tr>
|
299 |
+
</table>
|
300 |
+
</td>
|
301 |
+
|
302 |
+
<td colspan="2">
|
303 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
304 |
+
<tr>
|
305 |
+
<td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
|
306 |
+
<td><label for="qt_autohref">{$lang_media_autohref}</label></td>
|
307 |
+
</tr>
|
308 |
+
</table>
|
309 |
+
</td>
|
310 |
+
</tr>
|
311 |
+
|
312 |
+
<tr>
|
313 |
+
<td colspan="2">
|
314 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
315 |
+
<tr>
|
316 |
+
<td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
|
317 |
+
<td><label for="qt_playeveryframe">{$lang_media_playeveryframe}</label></td>
|
318 |
+
</tr>
|
319 |
+
</table>
|
320 |
+
</td>
|
321 |
+
|
322 |
+
<td colspan="2">
|
323 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
324 |
+
<tr>
|
325 |
+
<td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
|
326 |
+
<td><label for="qt_targetcache">{$lang_media_targetcache}</label></td>
|
327 |
+
</tr>
|
328 |
+
</table>
|
329 |
+
</td>
|
330 |
+
</tr>
|
331 |
+
|
332 |
+
<tr>
|
333 |
+
<td><label for="qt_scale">{$lang_media_scale}</label></td>
|
334 |
+
<td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
|
335 |
+
<option value="">{$lang_not_set}</option>
|
336 |
+
<option value="tofit">tofit</option>
|
337 |
+
<option value="aspect">aspect</option>
|
338 |
+
</select>
|
339 |
+
</td>
|
340 |
+
|
341 |
+
<td colspan="2"> </td>
|
342 |
+
</tr>
|
343 |
+
|
344 |
+
<tr>
|
345 |
+
<td><label for="qt_starttime">{$lang_media_starttime}</label></td>
|
346 |
+
<td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
|
347 |
+
|
348 |
+
<td><label for="qt_endtime">{$lang_media_endtime}</label></td>
|
349 |
+
<td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
|
350 |
+
</tr>
|
351 |
+
|
352 |
+
<tr>
|
353 |
+
<td><label for="qt_target">{$lang_media_target}</label></td>
|
354 |
+
<td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
|
355 |
+
|
356 |
+
<td><label for="qt_href">{$lang_media_href}</label></td>
|
357 |
+
<td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
|
358 |
+
</tr>
|
359 |
+
|
360 |
+
<tr>
|
361 |
+
<td><label for="qt_qtsrcchokespeed">{$lang_media_qtsrcchokespeed}</label></td>
|
362 |
+
<td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
|
363 |
+
|
364 |
+
<td><label for="qt_volume">{$lang_media_volume}</label></td>
|
365 |
+
<td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
|
366 |
+
</tr>
|
367 |
+
|
368 |
+
<tr>
|
369 |
+
<td><label for="qt_qtsrc">{$lang_media_qtsrc}</label></td>
|
370 |
+
<td colspan="4">
|
371 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
372 |
+
<tr>
|
373 |
+
<td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
|
374 |
+
<td id="qtsrcfilebrowsercontainer"> </td>
|
375 |
+
</tr>
|
376 |
+
</table>
|
377 |
+
</td>
|
378 |
+
</tr>
|
379 |
+
</table>
|
380 |
+
</fieldset>
|
381 |
+
|
382 |
+
<fieldset id="wmp_options">
|
383 |
+
<legend>{$lang_media_wmp_options}</legend>
|
384 |
+
|
385 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
386 |
+
<tr>
|
387 |
+
<td colspan="2">
|
388 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
389 |
+
<tr>
|
390 |
+
<td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
|
391 |
+
<td><label for="wmp_autostart">{$lang_media_autostart}</label></td>
|
392 |
+
</tr>
|
393 |
+
</table>
|
394 |
+
</td>
|
395 |
+
|
396 |
+
<td colspan="2">
|
397 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
398 |
+
<tr>
|
399 |
+
<td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
|
400 |
+
<td><label for="wmp_enabled">{$lang_media_enabled}</label></td>
|
401 |
+
</tr>
|
402 |
+
</table>
|
403 |
+
</td>
|
404 |
+
</tr>
|
405 |
+
|
406 |
+
<tr>
|
407 |
+
<td colspan="2">
|
408 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
409 |
+
<tr>
|
410 |
+
<td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
|
411 |
+
<td><label for="wmp_enablecontextmenu">{$lang_media_menu}</label></td>
|
412 |
+
</tr>
|
413 |
+
</table>
|
414 |
+
</td>
|
415 |
+
|
416 |
+
<td colspan="2">
|
417 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
418 |
+
<tr>
|
419 |
+
<td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
|
420 |
+
<td><label for="wmp_fullscreen">{$lang_media_fullscreen}</label></td>
|
421 |
+
</tr>
|
422 |
+
</table>
|
423 |
+
</td>
|
424 |
+
</tr>
|
425 |
+
|
426 |
+
<tr>
|
427 |
+
<td colspan="2">
|
428 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
429 |
+
<tr>
|
430 |
+
<td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
|
431 |
+
<td><label for="wmp_invokeurls">{$lang_media_invokeurls}</label></td>
|
432 |
+
</tr>
|
433 |
+
</table>
|
434 |
+
</td>
|
435 |
+
|
436 |
+
<td colspan="2">
|
437 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
438 |
+
<tr>
|
439 |
+
<td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
|
440 |
+
<td><label for="wmp_mute">{$lang_media_mute}</label></td>
|
441 |
+
</tr>
|
442 |
+
</table>
|
443 |
+
</td>
|
444 |
+
</tr>
|
445 |
+
|
446 |
+
<tr>
|
447 |
+
<td colspan="2">
|
448 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
449 |
+
<tr>
|
450 |
+
<td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
|
451 |
+
<td><label for="wmp_stretchtofit">{$lang_media_stretchtofit}</label></td>
|
452 |
+
</tr>
|
453 |
+
</table>
|
454 |
+
</td>
|
455 |
+
|
456 |
+
<td colspan="2">
|
457 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
458 |
+
<tr>
|
459 |
+
<td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
|
460 |
+
<td><label for="wmp_windowlessvideo">{$lang_media_windowlessvideo}</label></td>
|
461 |
+
</tr>
|
462 |
+
</table>
|
463 |
+
</td>
|
464 |
+
</tr>
|
465 |
+
|
466 |
+
<tr>
|
467 |
+
<td><label for="wmp_balance">{$lang_media_balance}</label></td>
|
468 |
+
<td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
|
469 |
+
|
470 |
+
<td><label for="wmp_baseurl">{$lang_media_baseurl}</label></td>
|
471 |
+
<td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
|
472 |
+
</tr>
|
473 |
+
|
474 |
+
<tr>
|
475 |
+
<td><label for="wmp_captioningid">{$lang_media_captioningid}</label></td>
|
476 |
+
<td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
|
477 |
+
|
478 |
+
<td><label for="wmp_currentmarker">{$lang_media_currentmarker}</label></td>
|
479 |
+
<td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
|
480 |
+
</tr>
|
481 |
+
|
482 |
+
<tr>
|
483 |
+
<td><label for="wmp_currentposition">{$lang_media_currentposition}</label></td>
|
484 |
+
<td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
|
485 |
+
|
486 |
+
<td><label for="wmp_defaultframe">{$lang_media_defaultframe}</label></td>
|
487 |
+
<td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
|
488 |
+
</tr>
|
489 |
+
|
490 |
+
<tr>
|
491 |
+
<td><label for="wmp_playcount">{$lang_media_playcount}</label></td>
|
492 |
+
<td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
|
493 |
+
|
494 |
+
<td><label for="wmp_rate">{$lang_media_rate}</label></td>
|
495 |
+
<td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
|
496 |
+
</tr>
|
497 |
+
|
498 |
+
<tr>
|
499 |
+
<td><label for="wmp_uimode">{$lang_media_uimode}</label></td>
|
500 |
+
<td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
|
501 |
+
|
502 |
+
<td><label for="wmp_volume">{$lang_media_volume}</label></td>
|
503 |
+
<td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
|
504 |
+
</tr>
|
505 |
+
|
506 |
+
</table>
|
507 |
+
</fieldset>
|
508 |
+
|
509 |
+
<fieldset id="rmp_options">
|
510 |
+
<legend>{$lang_media_rmp_options}</legend>
|
511 |
+
|
512 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
513 |
+
<tr>
|
514 |
+
<td colspan="2">
|
515 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
516 |
+
<tr>
|
517 |
+
<td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
|
518 |
+
<td><label for="rmp_autostart">{$lang_media_autostart}</label></td>
|
519 |
+
</tr>
|
520 |
+
</table>
|
521 |
+
</td>
|
522 |
+
|
523 |
+
<td colspan="2">
|
524 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
525 |
+
<tr>
|
526 |
+
<td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
|
527 |
+
<td><label for="rmp_loop">{$lang_media_loop}</label></td>
|
528 |
+
</tr>
|
529 |
+
</table>
|
530 |
+
</td>
|
531 |
+
</tr>
|
532 |
+
|
533 |
+
<tr>
|
534 |
+
<td colspan="2">
|
535 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
536 |
+
<tr>
|
537 |
+
<td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
|
538 |
+
<td><label for="rmp_autogotourl">{$lang_media_autogotourl}</label></td>
|
539 |
+
</tr>
|
540 |
+
</table>
|
541 |
+
</td>
|
542 |
+
|
543 |
+
<td colspan="2">
|
544 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
545 |
+
<tr>
|
546 |
+
<td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
|
547 |
+
<td><label for="rmp_center">{$lang_media_center}</label></td>
|
548 |
+
</tr>
|
549 |
+
</table>
|
550 |
+
</td>
|
551 |
+
</tr>
|
552 |
+
|
553 |
+
<tr>
|
554 |
+
<td colspan="2">
|
555 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
556 |
+
<tr>
|
557 |
+
<td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
|
558 |
+
<td><label for="rmp_imagestatus">{$lang_media_imagestatus}</label></td>
|
559 |
+
</tr>
|
560 |
+
</table>
|
561 |
+
</td>
|
562 |
+
|
563 |
+
<td colspan="2">
|
564 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
565 |
+
<tr>
|
566 |
+
<td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
|
567 |
+
<td><label for="rmp_maintainaspect">{$lang_media_maintainaspect}</label></td>
|
568 |
+
</tr>
|
569 |
+
</table>
|
570 |
+
</td>
|
571 |
+
</tr>
|
572 |
+
|
573 |
+
<tr>
|
574 |
+
<td colspan="2">
|
575 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
576 |
+
<tr>
|
577 |
+
<td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
|
578 |
+
<td><label for="rmp_nojava">{$lang_media_nojava}</label></td>
|
579 |
+
</tr>
|
580 |
+
</table>
|
581 |
+
</td>
|
582 |
+
|
583 |
+
<td colspan="2">
|
584 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
585 |
+
<tr>
|
586 |
+
<td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
|
587 |
+
<td><label for="rmp_prefetch">{$lang_media_prefetch}</label></td>
|
588 |
+
</tr>
|
589 |
+
</table>
|
590 |
+
</td>
|
591 |
+
</tr>
|
592 |
+
|
593 |
+
<tr>
|
594 |
+
<td colspan="2">
|
595 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
596 |
+
<tr>
|
597 |
+
<td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
|
598 |
+
<td><label for="rmp_shuffle">{$lang_media_shuffle}</label></td>
|
599 |
+
</tr>
|
600 |
+
</table>
|
601 |
+
</td>
|
602 |
+
|
603 |
+
<td colspan="2">
|
604 |
+
|
605 |
+
</td>
|
606 |
+
</tr>
|
607 |
+
|
608 |
+
<tr>
|
609 |
+
<td><label for="rmp_console">{$lang_media_console}</label></td>
|
610 |
+
<td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
|
611 |
+
|
612 |
+
<td><label for="rmp_controls">{$lang_media_controls}</label></td>
|
613 |
+
<td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
|
614 |
+
</tr>
|
615 |
+
|
616 |
+
<tr>
|
617 |
+
<td><label for="rmp_numloop">{$lang_media_numloop}</label></td>
|
618 |
+
<td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
|
619 |
+
|
620 |
+
<td><label for="rmp_scriptcallbacks">{$lang_media_scriptcallbacks}</label></td>
|
621 |
+
<td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
|
622 |
+
</tr>
|
623 |
+
</table>
|
624 |
+
</fieldset>
|
625 |
+
|
626 |
+
<fieldset id="shockwave_options">
|
627 |
+
<legend>{$lang_media_shockwave_options}</legend>
|
628 |
+
|
629 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
630 |
+
<tr>
|
631 |
+
<td><label for="shockwave_swstretchstyle">{$lang_media_swstretchstyle}</label></td>
|
632 |
+
<td>
|
633 |
+
<select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
|
634 |
+
<option value="none">{$lang_not_set}</option>
|
635 |
+
<option value="meet">Meet</option>
|
636 |
+
<option value="fill">Fill</option>
|
637 |
+
<option value="stage">Stage</option>
|
638 |
+
</select>
|
639 |
+
</td>
|
640 |
+
|
641 |
+
<td><label for="shockwave_swvolume">{$lang_media_volume}</label></td>
|
642 |
+
<td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
|
643 |
+
</tr>
|
644 |
+
|
645 |
+
<tr>
|
646 |
+
<td><label for="shockwave_swstretchhalign">{$lang_media_swstretchhalign}</label></td>
|
647 |
+
<td>
|
648 |
+
<select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
|
649 |
+
<option value="none">{$lang_not_set}</option>
|
650 |
+
<option value="left">{$lang_media_align_left}</option>
|
651 |
+
<option value="center">{$lang_media_align_center}</option>
|
652 |
+
<option value="right">{$lang_media_align_right}</option>
|
653 |
+
</select>
|
654 |
+
</td>
|
655 |
+
|
656 |
+
<td><label for="shockwave_swstretchvalign">{$lang_media_swstretchvalign}</label></td>
|
657 |
+
<td>
|
658 |
+
<select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
|
659 |
+
<option value="none">{$lang_not_set}</option>
|
660 |
+
<option value="meet">Meet</option>
|
661 |
+
<option value="fill">Fill</option>
|
662 |
+
<option value="stage">Stage</option>
|
663 |
+
</select>
|
664 |
+
</td>
|
665 |
+
</tr>
|
666 |
+
|
667 |
+
<tr>
|
668 |
+
<td colspan="2">
|
669 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
670 |
+
<tr>
|
671 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
|
672 |
+
<td><label for="shockwave_autostart">{$lang_media_autostart}</label></td>
|
673 |
+
</tr>
|
674 |
+
</table>
|
675 |
+
</td>
|
676 |
+
|
677 |
+
<td colspan="2">
|
678 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
679 |
+
<tr>
|
680 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
|
681 |
+
<td><label for="shockwave_sound">{$lang_media_sound}</label></td>
|
682 |
+
</tr>
|
683 |
+
</table>
|
684 |
+
</td>
|
685 |
+
</tr>
|
686 |
+
|
687 |
+
|
688 |
+
<tr>
|
689 |
+
<td colspan="2">
|
690 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
691 |
+
<tr>
|
692 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
|
693 |
+
<td><label for="shockwave_swliveconnect">{$lang_media_liveconnect}</label></td>
|
694 |
+
</tr>
|
695 |
+
</table>
|
696 |
+
</td>
|
697 |
+
|
698 |
+
<td colspan="2">
|
699 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
700 |
+
<tr>
|
701 |
+
<td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
|
702 |
+
<td><label for="shockwave_progress">{$lang_media_progress}</label></td>
|
703 |
+
</tr>
|
704 |
+
</table>
|
705 |
+
</td>
|
706 |
+
</tr>
|
707 |
+
</table>
|
708 |
+
</fieldset>
|
709 |
+
</div>
|
710 |
+
</div>
|
711 |
+
|
712 |
+
<div class="mceActionPanel">
|
713 |
+
<div style="float: left">
|
714 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertMedia();" />
|
715 |
+
</div>
|
716 |
+
|
717 |
+
<div style="float: right">
|
718 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
719 |
+
</div>
|
720 |
+
</div>
|
721 |
+
</form>
|
722 |
+
</body>
|
723 |
+
</html>
|
upload_to_tinymce_directory/plugins/print/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('print');var TinyMCE_PrintPlugin={getInfo:function(){return{longname:'Print',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"print":return tinyMCE.getButtonHTML(cn,'lang_print_desc','{$pluginurl}/images/print.gif','mcePrint')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePrint":tinyMCE.getInstanceById(editor_id).contentWindow.print();return true}return false}};tinyMCE.addPlugin("print",TinyMCE_PrintPlugin);
|
upload_to_tinymce_directory/plugins/print/editor_plugin_src.js
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import theme specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('print');
|
10 |
+
|
11 |
+
var TinyMCE_PrintPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Print',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
getControlHTML : function(cn) {
|
23 |
+
switch (cn) {
|
24 |
+
case "print":
|
25 |
+
return tinyMCE.getButtonHTML(cn, 'lang_print_desc', '{$pluginurl}/images/print.gif', 'mcePrint');
|
26 |
+
}
|
27 |
+
|
28 |
+
return "";
|
29 |
+
},
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Executes the search/replace commands.
|
33 |
+
*/
|
34 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
35 |
+
// Handle commands
|
36 |
+
switch (command) {
|
37 |
+
case "mcePrint":
|
38 |
+
tinyMCE.getInstanceById(editor_id).contentWindow.print();
|
39 |
+
return true;
|
40 |
+
}
|
41 |
+
|
42 |
+
// Pass to next handler in chain
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
};
|
46 |
+
|
47 |
+
tinyMCE.addPlugin("print", TinyMCE_PrintPlugin);
|
upload_to_tinymce_directory/plugins/print/images/print.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/print/langs/en.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('',{
|
4 |
+
print_desc : 'Print'
|
5 |
+
});
|
upload_to_tinymce_directory/plugins/print/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/searchreplace/css/searchreplace.css
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* stylesheet for advsearchreplace plugin*/
|
2 |
+
|
3 |
+
.panel_wrapper { height: 85px; }
|
4 |
+
.panel_wrapper div.current { height: 85px; }
|
5 |
+
|
6 |
+
/* MS IE only styles */
|
7 |
+
* html .panel_wrapper { height: 100px; }
|
8 |
+
* html .panel_wrapper div.current { height: 100px; }
|
9 |
+
|
10 |
+
#replaceBtn, #replaceAllBtn {
|
11 |
+
padding-bottom: 2px;
|
12 |
+
font-weight: bold;
|
13 |
+
width: 90px;
|
14 |
+
height: 21px;
|
15 |
+
border: 0;
|
16 |
+
cursor: pointer;
|
17 |
+
}
|
18 |
+
|
19 |
+
#replaceBtn { background: url(../images/replace_button_bg.gif); }
|
20 |
+
#replaceAllBtn { background: url(../images/replace_all_button_bg.gif); }
|
upload_to_tinymce_directory/plugins/searchreplace/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('searchreplace');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id),selectedText=inst.selection.getSelectedText(),rng;function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key]}function replaceSel(search_str,str,back){inst.execCommand('mceInsertContent',false,str)}if(!value)value=[];defValue("editor_id",editor_id);defValue("searchstring",selectedText);defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");defValue("resizable","no");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();template['file']='../../plugins/searchreplace/searchreplace.htm';template['width']=380;template['height']=155+(tinyMCE.isNS7?20:0)+(tinyMCE.isMSIE?15:0);template['width']+=tinyMCE.getLang('lang_searchreplace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_delta_height',0);inst.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=inst.selection.getRng();r.collapse(true);r.select()}else inst.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value)}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards'])}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng}else alert(tinyMCE.getLang('lang_searchreplace_notfound'))}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'))}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true}return false}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin);
|
upload_to_tinymce_directory/plugins/searchreplace/editor_plugin_src.js
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 126 2006-10-22 16:19:55Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
tinyMCE.importPluginLanguagePack('searchreplace');
|
9 |
+
|
10 |
+
var TinyMCE_SearchReplacePlugin = {
|
11 |
+
getInfo : function() {
|
12 |
+
return {
|
13 |
+
longname : 'Search/Replace',
|
14 |
+
author : 'Moxiecode Systems AB',
|
15 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
16 |
+
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',
|
17 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
18 |
+
};
|
19 |
+
},
|
20 |
+
|
21 |
+
initInstance : function (inst) {
|
22 |
+
inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true);
|
23 |
+
// No CTRL+R for "replace" because browsers will reload page instead of executing plugin
|
24 |
+
},
|
25 |
+
|
26 |
+
getControlHTML : function (cn) {
|
27 |
+
switch (cn) {
|
28 |
+
case "search" :
|
29 |
+
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif','mceSearch', true);
|
30 |
+
|
31 |
+
case "replace" :
|
32 |
+
return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true);
|
33 |
+
}
|
34 |
+
|
35 |
+
return "";
|
36 |
+
},
|
37 |
+
|
38 |
+
execCommand : function (editor_id, element, command, user_interface, value) {
|
39 |
+
var inst = tinyMCE.getInstanceById(editor_id), selectedText = inst.selection.getSelectedText(), rng;
|
40 |
+
|
41 |
+
function defValue(key, default_value) {
|
42 |
+
value[key] = typeof(value[key]) == "undefined" ? default_value : value[key];
|
43 |
+
}
|
44 |
+
|
45 |
+
function replaceSel(search_str, str, back) {
|
46 |
+
inst.execCommand('mceInsertContent', false, str);
|
47 |
+
}
|
48 |
+
|
49 |
+
if (!value)
|
50 |
+
value = [];
|
51 |
+
|
52 |
+
defValue("editor_id", editor_id);
|
53 |
+
defValue("searchstring", selectedText);
|
54 |
+
defValue("replacestring", null);
|
55 |
+
defValue("replacemode", "none");
|
56 |
+
defValue("casesensitive", false);
|
57 |
+
defValue("backwards", false);
|
58 |
+
defValue("wrap", false);
|
59 |
+
defValue("wholeword", false);
|
60 |
+
defValue("inline", "yes");
|
61 |
+
defValue("resizable", "no");
|
62 |
+
|
63 |
+
switch (command) {
|
64 |
+
case "mceResetSearch" :
|
65 |
+
tinyMCE.lastSearchRng = null;
|
66 |
+
return true;
|
67 |
+
|
68 |
+
case "mceSearch" :
|
69 |
+
if (user_interface) {
|
70 |
+
var template = new Array();
|
71 |
+
|
72 |
+
template['file'] = '../../plugins/searchreplace/searchreplace.htm';
|
73 |
+
template['width'] = 380;
|
74 |
+
template['height'] = 155 + (tinyMCE.isNS7 ? 20 : 0) + (tinyMCE.isMSIE ? 15 : 0);
|
75 |
+
template['width'] += tinyMCE.getLang('lang_searchreplace_delta_width', 0);
|
76 |
+
template['height'] += tinyMCE.getLang('lang_searchreplace_delta_height', 0);
|
77 |
+
|
78 |
+
inst.execCommand('SelectAll');
|
79 |
+
|
80 |
+
if (tinyMCE.isMSIE) {
|
81 |
+
var r = inst.selection.getRng();
|
82 |
+
r.collapse(true);
|
83 |
+
r.select();
|
84 |
+
} else
|
85 |
+
inst.selection.getSel().collapseToStart();
|
86 |
+
|
87 |
+
tinyMCE.openWindow(template, value);
|
88 |
+
} else {
|
89 |
+
var win = tinyMCE.getInstanceById(editor_id).contentWindow;
|
90 |
+
var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document;
|
91 |
+
var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body;
|
92 |
+
if (body.innerHTML == "") {
|
93 |
+
alert(tinyMCE.getLang('lang_searchreplace_notfound'));
|
94 |
+
return true;
|
95 |
+
}
|
96 |
+
|
97 |
+
if (value['replacemode'] == "current") {
|
98 |
+
replaceSel(value['string'], value['replacestring'], value['backwards']);
|
99 |
+
value['replacemode'] = "none";
|
100 |
+
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
|
101 |
+
return true;
|
102 |
+
}
|
103 |
+
|
104 |
+
if (tinyMCE.isMSIE) {
|
105 |
+
var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange();
|
106 |
+
var flags = 0;
|
107 |
+
if (value['wholeword'])
|
108 |
+
flags = flags | 2;
|
109 |
+
|
110 |
+
if (value['casesensitive'])
|
111 |
+
flags = flags | 4;
|
112 |
+
|
113 |
+
if (!rng.findText) {
|
114 |
+
alert('This operation is currently not supported by this browser.');
|
115 |
+
return true;
|
116 |
+
}
|
117 |
+
|
118 |
+
if (value['replacemode'] == "all") {
|
119 |
+
while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
|
120 |
+
rng.scrollIntoView();
|
121 |
+
rng.select();
|
122 |
+
rng.collapse(false);
|
123 |
+
replaceSel(value['string'], value['replacestring'], value['backwards']);
|
124 |
+
}
|
125 |
+
|
126 |
+
alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
|
127 |
+
return true;
|
128 |
+
}
|
129 |
+
|
130 |
+
if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) {
|
131 |
+
rng.scrollIntoView();
|
132 |
+
rng.select();
|
133 |
+
rng.collapse(value['backwards']);
|
134 |
+
tinyMCE.lastSearchRng = rng;
|
135 |
+
} else
|
136 |
+
alert(tinyMCE.getLang('lang_searchreplace_notfound'));
|
137 |
+
|
138 |
+
} else {
|
139 |
+
if (value['replacemode'] == "all") {
|
140 |
+
while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
|
141 |
+
replaceSel(value['string'], value['replacestring'], value['backwards']);
|
142 |
+
|
143 |
+
alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));
|
144 |
+
return true;
|
145 |
+
}
|
146 |
+
|
147 |
+
if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false))
|
148 |
+
alert(tinyMCE.getLang('lang_searchreplace_notfound'));
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
return true;
|
153 |
+
|
154 |
+
case "mceSearchReplace" :
|
155 |
+
value['replacestring'] = "";
|
156 |
+
tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false);
|
157 |
+
return true;
|
158 |
+
}
|
159 |
+
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
};
|
163 |
+
|
164 |
+
tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin);
|
upload_to_tinymce_directory/plugins/searchreplace/images/replace.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/searchreplace/images/replace_all_button_bg.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/searchreplace/images/replace_button_bg.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/searchreplace/images/search.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/searchreplace/jscripts/searchreplace.js
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function init() {
|
2 |
+
tinyMCEPopup.resizeToInnerSize();
|
3 |
+
|
4 |
+
// start with appropiate tab
|
5 |
+
var task = (tinyMCE.getWindowArg("replacestring") != null) ? "replace" : "search";
|
6 |
+
mcTabs.displayTab(task + '_tab', task +'_panel');
|
7 |
+
manageReplaceButtons();
|
8 |
+
|
9 |
+
var formObj = document.forms[0];
|
10 |
+
|
11 |
+
formObj[task + "_panel_searchstring"].value = tinyMCE.getWindowArg("searchstring");
|
12 |
+
formObj["replace_panel_replacestring"].value = (tinyMCE.getWindowArg("replacestring") != null) ? tinyMCE.getWindowArg("replacestring") : "";
|
13 |
+
formObj[task + "_panel_casesensitivebox"].checked = tinyMCE.getWindowArg("casesensitive");
|
14 |
+
formObj[task + "_panel_backwardsu"].checked = tinyMCE.getWindowArg("backwards");
|
15 |
+
formObj[task + "_panel_backwardsd"].checked = !tinyMCE.getWindowArg("backwards");
|
16 |
+
|
17 |
+
tinyMCEPopup.execCommand("mceResetSearch", false, {dummy : ""}, false);
|
18 |
+
}
|
19 |
+
|
20 |
+
function searchNext(replacemode) {
|
21 |
+
// "search" or "replace" mode of operation?
|
22 |
+
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
|
23 |
+
|
24 |
+
var formObj = document.forms[0];
|
25 |
+
|
26 |
+
if (task == "replace") {
|
27 |
+
// Whats the point?
|
28 |
+
if (formObj[task + "_panel_searchstring"].value == "" || formObj[task + "_panel_searchstring"].value == formObj[task + "_panel_replacestring"].value)
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Do search
|
33 |
+
tinyMCEPopup.execCommand('mceSearch', false, {
|
34 |
+
string : formObj[task + "_panel_searchstring"].value,
|
35 |
+
replacestring : formObj["replace_panel_replacestring"].value,
|
36 |
+
replacemode : replacemode,
|
37 |
+
casesensitive : formObj[task + "_panel_casesensitivebox"].checked,
|
38 |
+
backwards : false
|
39 |
+
}, false);
|
40 |
+
|
41 |
+
window.focus();
|
42 |
+
}
|
43 |
+
|
44 |
+
function cancelAction() {
|
45 |
+
tinyMCEPopup.close();
|
46 |
+
}
|
47 |
+
|
48 |
+
function manageReplaceButtons() {
|
49 |
+
// "search" or "replace" mode of operation?
|
50 |
+
var task = (document.getElementById("search_tab").className == "current") ? "search" : "replace";
|
51 |
+
document.getElementById("replace_buttons").style.visibility = (task == "replace") ? "visible" : "hidden";
|
52 |
+
}
|
53 |
+
|
54 |
+
function copyValues(link) {
|
55 |
+
// check if tab is already active
|
56 |
+
var tab = link;
|
57 |
+
while (tab.tagName && tab.tagName.toLowerCase() != "li") tab = tab.parentNode;
|
58 |
+
if (tab.className) return false; // tab is already active -> no need to copy any values!
|
59 |
+
|
60 |
+
// copy values from one panel to the other (if they exist there)
|
61 |
+
var from_panel_name = tab.id.match(/^search/i) ? "replace_panel" : "search_panel";
|
62 |
+
var to_panel_name = (from_panel_name == "search_panel") ? "replace_panel" : "search_panel";
|
63 |
+
|
64 |
+
// find all elements with IDs to copy their values
|
65 |
+
var elms = document.getElementById(from_panel_name).getElementsByTagName("*");
|
66 |
+
for (var i = 0; i < elms.length; i++) {
|
67 |
+
if (elms[i].id && elms[i].id != "") {
|
68 |
+
var checked = "undefined";
|
69 |
+
if (elms[i].type.toLowerCase() == "checkbox" || elms[i].type.toLowerCase() == "radio")
|
70 |
+
checked = elms[i].checked;
|
71 |
+
|
72 |
+
// copy values if element exists in other panel
|
73 |
+
var to_elm_name = to_panel_name + elms[i].id.substring(from_panel_name.length, elms[i].id.length);
|
74 |
+
var to_elm = document.getElementById(to_elm_name);
|
75 |
+
if (to_elm) {
|
76 |
+
if (checked != "undefined")
|
77 |
+
to_elm.checked = checked;
|
78 |
+
else
|
79 |
+
to_elm.value = elms[i].value;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
return false;
|
85 |
+
}
|
upload_to_tinymce_directory/plugins/searchreplace/langs/en.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('',{
|
4 |
+
searchreplace_search_desc : 'Find',
|
5 |
+
searchreplace_searchnext_desc : 'Find again',
|
6 |
+
searchreplace_replace_desc : 'Find/Replace',
|
7 |
+
searchreplace_notfound : 'The search has been completed. The search string could not be found.',
|
8 |
+
searchreplace_search_title : 'Find',
|
9 |
+
searchreplace_replace_title : 'Find/Replace',
|
10 |
+
searchreplace_allreplaced : 'All occurrences of the search string were replaced.',
|
11 |
+
searchreplace_findwhat : 'Find what',
|
12 |
+
searchreplace_replacewith : 'Replace with',
|
13 |
+
searchreplace_direction : 'Direction',
|
14 |
+
searchreplace_up : 'Up',
|
15 |
+
searchreplace_down : 'Down',
|
16 |
+
searchreplace_case : 'Match case',
|
17 |
+
searchreplace_findnext : 'Find next',
|
18 |
+
searchreplace_replace : 'Replace',
|
19 |
+
searchreplace_replaceall : 'Replace all',
|
20 |
+
searchreplace_cancel : 'Cancel'
|
21 |
+
});
|
upload_to_tinymce_directory/plugins/searchreplace/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/searchreplace/searchreplace.htm
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_searchreplace_replace_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="jscripts/searchreplace.js"></script>
|
8 |
+
<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
|
9 |
+
<base target="_self" />
|
10 |
+
</head>
|
11 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none; margin: 4px;">
|
12 |
+
<form onsubmit="return false;" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="search_tab"><span><a href="javascript:mcTabs.displayTab('search_tab','search_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_search_desc}</a></span></li>
|
16 |
+
<li id="replace_tab"><span><a href="javascript:mcTabs.displayTab('replace_tab','replace_panel');manageReplaceButtons();" onmousedown="return copyValues(this);">{$lang_searchreplace_replace}</a></span></li>
|
17 |
+
</ul>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="panel_wrapper">
|
21 |
+
|
22 |
+
<div id="search_panel" class="panel">
|
23 |
+
<table border="0" cellspacing="0" cellpadding="2">
|
24 |
+
<tr>
|
25 |
+
<td><label for="search_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
|
26 |
+
<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td>
|
27 |
+
</tr>
|
28 |
+
<tr>
|
29 |
+
<td colspan="2">
|
30 |
+
<table border="0" cellspacing="0" cellpadding="0" class="direction">
|
31 |
+
<tr>
|
32 |
+
<td><label>{$lang_searchreplace_direction}</label></td>
|
33 |
+
<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
|
34 |
+
<td><label for="search_panel_backwardsu">{$lang_searchreplace_up}</label></td>
|
35 |
+
<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" /></td>
|
36 |
+
<td><label for="search_panel_backwardsd">{$lang_searchreplace_down}</label></td>
|
37 |
+
</tr>
|
38 |
+
</table>
|
39 |
+
</td>
|
40 |
+
</tr>
|
41 |
+
<tr>
|
42 |
+
<td colspan="2">
|
43 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
44 |
+
<tr>
|
45 |
+
<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
46 |
+
<td><label for="search_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
|
47 |
+
</tr>
|
48 |
+
</table>
|
49 |
+
</td>
|
50 |
+
</tr>
|
51 |
+
</table>
|
52 |
+
</div>
|
53 |
+
|
54 |
+
<div id="replace_panel" class="panel">
|
55 |
+
<table border="0" cellspacing="0" cellpadding="2">
|
56 |
+
<tr>
|
57 |
+
<td><label for="replace_panel_searchstring">{$lang_searchreplace_findwhat}</label></td>
|
58 |
+
<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td>
|
59 |
+
</tr>
|
60 |
+
<tr>
|
61 |
+
<td><label for="replace_panel_replacestring">{$lang_searchreplace_replacewith}</label></td>
|
62 |
+
<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td>
|
63 |
+
</tr>
|
64 |
+
<tr>
|
65 |
+
<td colspan="2">
|
66 |
+
<table border="0" cellspacing="0" cellpadding="0" class="direction">
|
67 |
+
<tr>
|
68 |
+
<td><label>{$lang_searchreplace_direction}</label></td>
|
69 |
+
<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
|
70 |
+
<td><label for="replace_panel_backwardsu">{$lang_searchreplace_up}</label></td>
|
71 |
+
<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" /></td>
|
72 |
+
<td><label for="replace_panel_backwardsd">{$lang_searchreplace_down}</label></td>
|
73 |
+
</tr>
|
74 |
+
</table>
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<td colspan="2">
|
79 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
80 |
+
<tr>
|
81 |
+
<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
|
82 |
+
<td><label for="replace_panel_casesensitivebox">{$lang_searchreplace_case}</label></td>
|
83 |
+
</tr>
|
84 |
+
</table>
|
85 |
+
</td>
|
86 |
+
</tr>
|
87 |
+
</table>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<div class="mceActionPanel">
|
93 |
+
<div style="text-align: center;">
|
94 |
+
<input type="button" id="insert" name="insert" value="{$lang_searchreplace_findnext}" onclick="searchNext('none');" />
|
95 |
+
<span id="replace_buttons">
|
96 |
+
<input type="button" id="replaceBtn" name="replaceBtn" value="{$lang_searchreplace_replace}" onclick="searchNext('current');" />
|
97 |
+
<input type="button" id="replaceAllBtn" name="replaceAllBtn" value="{$lang_searchreplace_replaceall}" onclick="searchNext('all');;" />
|
98 |
+
</span>
|
99 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_searchreplace_cancel}" onclick="tinyMCEPopup.close();" />
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</form>
|
103 |
+
</body>
|
104 |
+
</html>
|
upload_to_tinymce_directory/plugins/table/cell.htm
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_table_cell_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="jscripts/cell.js"></script>
|
8 |
+
<link href="css/cell.css" rel="stylesheet" type="text/css" />
|
9 |
+
<base target="_self" />
|
10 |
+
</head>
|
11 |
+
<body id="tablecell" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
12 |
+
<form onsubmit="updateAction();return false;" action="#">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
|
16 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
|
17 |
+
</ul>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="panel_wrapper">
|
21 |
+
<div id="general_panel" class="panel current">
|
22 |
+
<fieldset>
|
23 |
+
<legend>{$lang_table_general_props}</legend>
|
24 |
+
|
25 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
26 |
+
<tr>
|
27 |
+
<td><label for="align">{$lang_table_align}</label></td>
|
28 |
+
<td>
|
29 |
+
<select id="align" name="align">
|
30 |
+
<option value="">{$lang_not_set}</option>
|
31 |
+
<option value="center">{$lang_table_align_middle}</option>
|
32 |
+
<option value="left">{$lang_table_align_left}</option>
|
33 |
+
<option value="right">{$lang_table_align_right}</option>
|
34 |
+
</select>
|
35 |
+
</td>
|
36 |
+
|
37 |
+
<td><label for="celltype">{$lang_table_cell_type}</label></td>
|
38 |
+
<td>
|
39 |
+
<select id="celltype" name="celltype">
|
40 |
+
<option value="td">{$lang_table_td}</option>
|
41 |
+
<option value="th">{$lang_table_th}</option>
|
42 |
+
</select>
|
43 |
+
</td>
|
44 |
+
</tr>
|
45 |
+
|
46 |
+
<tr>
|
47 |
+
<td><label for="valign">{$lang_table_valign}</label></td>
|
48 |
+
<td>
|
49 |
+
<select id="valign" name="valign">
|
50 |
+
<option value="">{$lang_not_set}</option>
|
51 |
+
<option value="top">{$lang_table_align_top}</option>
|
52 |
+
<option value="middle">{$lang_table_align_middle}</option>
|
53 |
+
<option value="bottom">{$lang_table_align_bottom}</option>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
|
57 |
+
<td><label for="scope">{$lang_table_scope}</label></td>
|
58 |
+
<td>
|
59 |
+
<select id="scope" name="scope">
|
60 |
+
<option value="">{$lang_not_set}</option>
|
61 |
+
<option value="col">{$lang_table_col}</option>
|
62 |
+
<option value="row">{$lang_table_row}</option>
|
63 |
+
<option value="rowgroup">{$lang_table_rowgroup}</option>
|
64 |
+
<option value="colgroup">{$lang_table_colgroup}</option>
|
65 |
+
</select>
|
66 |
+
</td>
|
67 |
+
|
68 |
+
</tr>
|
69 |
+
|
70 |
+
<tr>
|
71 |
+
<td><label for="width">{$lang_table_width}</label></td>
|
72 |
+
<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
|
73 |
+
|
74 |
+
<td><label for="height">{$lang_table_height}</label></td>
|
75 |
+
<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
|
76 |
+
</tr>
|
77 |
+
|
78 |
+
<tr id="styleSelectRow">
|
79 |
+
<td><label for="class">{$lang_class_name}</label></td>
|
80 |
+
<td colspan="3">
|
81 |
+
<select id="class" name="class">
|
82 |
+
<option value="" selected="selected">{$lang_not_set}</option>
|
83 |
+
</select>
|
84 |
+
</td>
|
85 |
+
</tr>
|
86 |
+
</table>
|
87 |
+
</fieldset>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
<div id="advanced_panel" class="panel">
|
91 |
+
<fieldset>
|
92 |
+
<legend>{$lang_table_advanced_props}</legend>
|
93 |
+
|
94 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
95 |
+
<tr>
|
96 |
+
<td class="column1"><label for="id">{$lang_table_id}</label></td>
|
97 |
+
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
98 |
+
</tr>
|
99 |
+
|
100 |
+
<tr>
|
101 |
+
<td><label for="style">{$lang_table_style}</label></td>
|
102 |
+
<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
|
103 |
+
</tr>
|
104 |
+
|
105 |
+
<tr>
|
106 |
+
<td class="column1"><label for="dir">{$lang_table_langdir}</label></td>
|
107 |
+
<td>
|
108 |
+
<select id="dir" name="dir" style="width: 200px">
|
109 |
+
<option value="">{$lang_not_set}</option>
|
110 |
+
<option value="ltr">{$lang_table_ltr}</option>
|
111 |
+
<option value="rtl">{$lang_table_rtl}</option>
|
112 |
+
</select>
|
113 |
+
</td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="column1"><label for="lang">{$lang_table_langcode}</label></td>
|
118 |
+
<td>
|
119 |
+
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
120 |
+
</td>
|
121 |
+
</tr>
|
122 |
+
|
123 |
+
<tr>
|
124 |
+
<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td>
|
125 |
+
<td>
|
126 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
127 |
+
<tr>
|
128 |
+
<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
|
129 |
+
<td id="backgroundimagebrowsercontainer"> </td>
|
130 |
+
</tr>
|
131 |
+
</table>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
+
|
135 |
+
<tr>
|
136 |
+
<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td>
|
137 |
+
<td>
|
138 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
139 |
+
<tr>
|
140 |
+
<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
|
141 |
+
<td id="bordercolor_pickcontainer"> </td>
|
142 |
+
</tr>
|
143 |
+
</table>
|
144 |
+
</td>
|
145 |
+
</tr>
|
146 |
+
|
147 |
+
<tr>
|
148 |
+
<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td>
|
149 |
+
<td>
|
150 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
151 |
+
<tr>
|
152 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
|
153 |
+
<td id="bgcolor_pickcontainer"> </td>
|
154 |
+
</tr>
|
155 |
+
</table>
|
156 |
+
</td>
|
157 |
+
</tr>
|
158 |
+
</table>
|
159 |
+
</fieldset>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
|
163 |
+
<div class="mceActionPanel">
|
164 |
+
<div>
|
165 |
+
<select id="action" name="action">
|
166 |
+
<option value="cell">{$lang_table_cell_cell}</option>
|
167 |
+
<option value="row">{$lang_table_cell_row}</option>
|
168 |
+
<option value="all">{$lang_table_cell_all}</option>
|
169 |
+
</select>
|
170 |
+
</div>
|
171 |
+
|
172 |
+
<div style="float: left">
|
173 |
+
<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
|
174 |
+
</div>
|
175 |
+
|
176 |
+
<div style="float: right">
|
177 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
178 |
+
</div>
|
179 |
+
</div>
|
180 |
+
</form>
|
181 |
+
</body>
|
182 |
+
</html>
|
upload_to_tinymce_directory/plugins/table/css/cell.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for cell dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 200px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#action {
|
12 |
+
margin-bottom: 3px;
|
13 |
+
}
|
14 |
+
|
15 |
+
#class {
|
16 |
+
width: 150px;
|
17 |
+
}
|
upload_to_tinymce_directory/plugins/table/css/row.css
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for row dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 200px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#action {
|
12 |
+
margin-bottom: 3px;
|
13 |
+
}
|
14 |
+
|
15 |
+
#rowtype,#align,#valign,#class,#height {
|
16 |
+
width: 150px;
|
17 |
+
}
|
18 |
+
|
19 |
+
#height {
|
20 |
+
width: 50px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.col2 {
|
24 |
+
padding-left: 20px;
|
25 |
+
}
|
upload_to_tinymce_directory/plugins/table/css/table.css
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* CSS file for table dialog in the table plugin */
|
2 |
+
|
3 |
+
.panel_wrapper div.current {
|
4 |
+
height: 220px;
|
5 |
+
}
|
6 |
+
|
7 |
+
.advfield {
|
8 |
+
width: 200px;
|
9 |
+
}
|
10 |
+
|
11 |
+
#class {
|
12 |
+
width: 150px;
|
13 |
+
}
|
upload_to_tinymce_directory/plugins/table/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('table');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler)}inst.tableRowClipboard=null},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_table','table_delete.gif','lang_table_del','mceTableDelete'],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false))}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1",tdElm;var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_delete_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal')}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal')}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance)},10)}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true}return false}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML=" "}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan}}function getCellPos(grid,td){var x,y;for(y=0;y<grid.length;y++){for(x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y}}}return null}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null}function getTableGrid(table){var grid=new Array(),rows=table.rows,x,y,td,sd,xstart,x2,y2;for(y=0;y<rows.length;y++){for(x=0;x<rows[y].cells.length;x++){td=rows[y].cells[x];sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(x2=xstart;x2<xstart+sd['colspan'];x2++)grid[y2][x2]=td}}}return grid}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table),cpos=getCellPos(grid,td);var cells,lastElm;if(new_tr.cells.length!=tr.childNodes.length){cells=tr.childNodes;lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td}deleteMarked(tableElm)}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node}return null}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node}}return null}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td)}while((td=nexttd)!=null)}}while((tr=next)!=null)}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR")}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML=" "}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm}return newTR}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"})}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value})}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild(table);inst.repaint()}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(trElm&&tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}trElm.parentNode.insertBefore(newTR,trElm);grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex+1,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML=" ";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD)}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR)}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD)}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true}lastTDElm=tdElm}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex+1),tinyMCE.isGecko,true);break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML=" ";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD)}else tdElm.colSpan++;lastTDElm=tdElm}}grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,cpos.cellindex),tinyMCE.isGecko,true);break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm=tinyMCE.getParentElement(tableElm,"table");tableElm.parentNode.removeChild(tableElm);return true}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm)}lastTDElm=tdElm}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;grid=getTableGrid(tableElm);inst.selection.selectNode(getCell(grid,cpos.rowindex,0),tinyMCE.isGecko,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML=" ";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan)}addRows(tdElm,trElm,rowspan)}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td}}if(rowCells.length>0)rows[rows.length]=rowCells}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td}}}if(rowCells.length>0)rows[rows.length]=rowCells}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y}x2=x;y2=y;grid[y][x]._selected=true}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true}lastRowSpan=sd['rowspan']}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true}lastColSpan=sd['colspan']}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!=" "&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm}if(tdElm.rowSpan>1)tdElm.rowSpan--}}}}break}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint()}return true}return false}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
|
upload_to_tinymce_directory/plugins/table/editor_plugin_src.js
ADDED
@@ -0,0 +1,1073 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('table');
|
10 |
+
|
11 |
+
var TinyMCE_TablePlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Tables',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
if (tinyMCE.isGecko) {
|
24 |
+
var doc = inst.getDoc();
|
25 |
+
tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
|
26 |
+
}
|
27 |
+
|
28 |
+
inst.tableRowClipboard = null;
|
29 |
+
},
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Returns the HTML contents of the table control.
|
33 |
+
*/
|
34 |
+
getControlHTML : function(control_name) {
|
35 |
+
var controls = new Array(
|
36 |
+
['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
|
37 |
+
['delete_table', 'table_delete.gif', 'lang_table_del', 'mceTableDelete'],
|
38 |
+
['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
|
39 |
+
['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
|
40 |
+
['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
|
41 |
+
['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
|
42 |
+
['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
|
43 |
+
['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
|
44 |
+
['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
|
45 |
+
['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
|
46 |
+
['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
|
47 |
+
['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
|
48 |
+
|
49 |
+
// Render table control
|
50 |
+
for (var i=0; i<controls.length; i++) {
|
51 |
+
var but = controls[i];
|
52 |
+
var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
|
53 |
+
|
54 |
+
if (but[0] == control_name)
|
55 |
+
return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
|
56 |
+
}
|
57 |
+
|
58 |
+
// Special tablecontrols
|
59 |
+
if (control_name == "tablecontrols") {
|
60 |
+
var html = "";
|
61 |
+
|
62 |
+
html += tinyMCE.getControlHTML("table");
|
63 |
+
html += tinyMCE.getControlHTML("separator");
|
64 |
+
html += tinyMCE.getControlHTML("row_props");
|
65 |
+
html += tinyMCE.getControlHTML("cell_props");
|
66 |
+
html += tinyMCE.getControlHTML("separator");
|
67 |
+
html += tinyMCE.getControlHTML("row_before");
|
68 |
+
html += tinyMCE.getControlHTML("row_after");
|
69 |
+
html += tinyMCE.getControlHTML("delete_row");
|
70 |
+
html += tinyMCE.getControlHTML("separator");
|
71 |
+
html += tinyMCE.getControlHTML("col_before");
|
72 |
+
html += tinyMCE.getControlHTML("col_after");
|
73 |
+
html += tinyMCE.getControlHTML("delete_col");
|
74 |
+
html += tinyMCE.getControlHTML("separator");
|
75 |
+
html += tinyMCE.getControlHTML("split_cells");
|
76 |
+
html += tinyMCE.getControlHTML("merge_cells");
|
77 |
+
|
78 |
+
return html;
|
79 |
+
}
|
80 |
+
|
81 |
+
return "";
|
82 |
+
},
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Executes the table commands.
|
86 |
+
*/
|
87 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
88 |
+
// Is table command
|
89 |
+
switch (command) {
|
90 |
+
case "mceInsertTable":
|
91 |
+
case "mceTableRowProps":
|
92 |
+
case "mceTableCellProps":
|
93 |
+
case "mceTableSplitCells":
|
94 |
+
case "mceTableMergeCells":
|
95 |
+
case "mceTableInsertRowBefore":
|
96 |
+
case "mceTableInsertRowAfter":
|
97 |
+
case "mceTableDeleteRow":
|
98 |
+
case "mceTableInsertColBefore":
|
99 |
+
case "mceTableInsertColAfter":
|
100 |
+
case "mceTableDeleteCol":
|
101 |
+
case "mceTableCutRow":
|
102 |
+
case "mceTableCopyRow":
|
103 |
+
case "mceTablePasteRowBefore":
|
104 |
+
case "mceTablePasteRowAfter":
|
105 |
+
case "mceTableDelete":
|
106 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
107 |
+
|
108 |
+
inst.execCommand('mceBeginUndoLevel');
|
109 |
+
TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
|
110 |
+
inst.execCommand('mceEndUndoLevel');
|
111 |
+
|
112 |
+
return true;
|
113 |
+
}
|
114 |
+
|
115 |
+
// Pass to next handler in chain
|
116 |
+
return false;
|
117 |
+
},
|
118 |
+
|
119 |
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
|
120 |
+
var colspan = "1", rowspan = "1", tdElm;
|
121 |
+
|
122 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
123 |
+
|
124 |
+
// Reset table controls
|
125 |
+
tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
|
126 |
+
tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonDisabled');
|
127 |
+
tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
|
128 |
+
tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
|
129 |
+
tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
|
130 |
+
tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
|
131 |
+
tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
|
132 |
+
tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
|
133 |
+
tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
|
134 |
+
tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
|
135 |
+
tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
|
136 |
+
tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
|
137 |
+
|
138 |
+
// Within a td element
|
139 |
+
if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
|
140 |
+
tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
|
141 |
+
tinyMCE.switchClass(editor_id + '_delete_table', 'mceButtonNormal');
|
142 |
+
tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
|
143 |
+
tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
|
144 |
+
tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
|
145 |
+
tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
|
146 |
+
tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
|
147 |
+
tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
|
148 |
+
|
149 |
+
colspan = tinyMCE.getAttrib(tdElm, "colspan");
|
150 |
+
rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
|
151 |
+
|
152 |
+
colspan = colspan == "" ? "1" : colspan;
|
153 |
+
rowspan = rowspan == "" ? "1" : rowspan;
|
154 |
+
|
155 |
+
if (colspan != "1" || rowspan != "1")
|
156 |
+
tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
|
157 |
+
}
|
158 |
+
|
159 |
+
// Within a tr element
|
160 |
+
if (tinyMCE.getParentElement(node, "tr"))
|
161 |
+
tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
|
162 |
+
|
163 |
+
// Within table
|
164 |
+
if (tinyMCE.getParentElement(node, "table")) {
|
165 |
+
tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
|
166 |
+
tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
|
167 |
+
}
|
168 |
+
},
|
169 |
+
|
170 |
+
// Private plugin internal methods
|
171 |
+
|
172 |
+
_mouseDownHandler : function(e) {
|
173 |
+
var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
|
174 |
+
var focusElm = tinyMCE.selectedInstance.getFocusElement();
|
175 |
+
|
176 |
+
// If press on special Mozilla create TD/TR thingie
|
177 |
+
if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
|
178 |
+
window.setTimeout(function() {
|
179 |
+
var tableElm = tinyMCE.getParentElement(focusElm, "table");
|
180 |
+
tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
|
181 |
+
}, 10);
|
182 |
+
}
|
183 |
+
},
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Executes the table commands.
|
187 |
+
*/
|
188 |
+
_doExecCommand : function(editor_id, element, command, user_interface, value) {
|
189 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
190 |
+
var focusElm = inst.getFocusElement();
|
191 |
+
var trElm = tinyMCE.getParentElement(focusElm, "tr");
|
192 |
+
var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
|
193 |
+
var tableElm = tinyMCE.getParentElement(focusElm, "table");
|
194 |
+
var doc = inst.contentWindow.document;
|
195 |
+
var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
|
196 |
+
|
197 |
+
// Get first TD if no TD found
|
198 |
+
if (trElm && tdElm == null)
|
199 |
+
tdElm = trElm.cells[0];
|
200 |
+
|
201 |
+
// ------- Inner functions ---------
|
202 |
+
function inArray(ar, v) {
|
203 |
+
for (var i=0; i<ar.length; i++) {
|
204 |
+
// Is array
|
205 |
+
if (ar[i].length > 0 && inArray(ar[i], v))
|
206 |
+
return true;
|
207 |
+
|
208 |
+
// Found value
|
209 |
+
if (ar[i] == v)
|
210 |
+
return true;
|
211 |
+
}
|
212 |
+
|
213 |
+
return false;
|
214 |
+
}
|
215 |
+
|
216 |
+
function makeTD() {
|
217 |
+
var newTD = doc.createElement("td");
|
218 |
+
newTD.innerHTML = " ";
|
219 |
+
}
|
220 |
+
|
221 |
+
function getColRowSpan(td) {
|
222 |
+
var colspan = tinyMCE.getAttrib(td, "colspan");
|
223 |
+
var rowspan = tinyMCE.getAttrib(td, "rowspan");
|
224 |
+
|
225 |
+
colspan = colspan == "" ? 1 : parseInt(colspan);
|
226 |
+
rowspan = rowspan == "" ? 1 : parseInt(rowspan);
|
227 |
+
|
228 |
+
return {colspan : colspan, rowspan : rowspan};
|
229 |
+
}
|
230 |
+
|
231 |
+
function getCellPos(grid, td) {
|
232 |
+
var x, y;
|
233 |
+
|
234 |
+
for (y=0; y<grid.length; y++) {
|
235 |
+
for (x=0; x<grid[y].length; x++) {
|
236 |
+
if (grid[y][x] == td)
|
237 |
+
return {cellindex : x, rowindex : y};
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
return null;
|
242 |
+
}
|
243 |
+
|
244 |
+
function getCell(grid, row, col) {
|
245 |
+
if (grid[row] && grid[row][col])
|
246 |
+
return grid[row][col];
|
247 |
+
|
248 |
+
return null;
|
249 |
+
}
|
250 |
+
|
251 |
+
function getTableGrid(table) {
|
252 |
+
var grid = new Array(), rows = table.rows, x, y, td, sd, xstart, x2, y2;
|
253 |
+
|
254 |
+
for (y=0; y<rows.length; y++) {
|
255 |
+
for (x=0; x<rows[y].cells.length; x++) {
|
256 |
+
td = rows[y].cells[x];
|
257 |
+
sd = getColRowSpan(td);
|
258 |
+
|
259 |
+
// All ready filled
|
260 |
+
for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
|
261 |
+
|
262 |
+
// Fill box
|
263 |
+
for (y2=y; y2<y+sd['rowspan']; y2++) {
|
264 |
+
if (!grid[y2])
|
265 |
+
grid[y2] = new Array();
|
266 |
+
|
267 |
+
for (x2=xstart; x2<xstart+sd['colspan']; x2++)
|
268 |
+
grid[y2][x2] = td;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
return grid;
|
274 |
+
}
|
275 |
+
|
276 |
+
function trimRow(table, tr, td, new_tr) {
|
277 |
+
var grid = getTableGrid(table), cpos = getCellPos(grid, td);
|
278 |
+
var cells, lastElm;
|
279 |
+
|
280 |
+
// Time to crop away some
|
281 |
+
if (new_tr.cells.length != tr.childNodes.length) {
|
282 |
+
cells = tr.childNodes;
|
283 |
+
lastElm = null;
|
284 |
+
|
285 |
+
for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
|
286 |
+
var remove = true;
|
287 |
+
var sd = getColRowSpan(td);
|
288 |
+
|
289 |
+
// Remove due to rowspan
|
290 |
+
if (inArray(cells, td)) {
|
291 |
+
new_tr.childNodes[x]._delete = true;
|
292 |
+
} else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
|
293 |
+
for (var i=x; i<x+td.colSpan; i++)
|
294 |
+
new_tr.childNodes[i]._delete = true;
|
295 |
+
}
|
296 |
+
|
297 |
+
if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
|
298 |
+
td.rowSpan = sd.rowspan + 1;
|
299 |
+
|
300 |
+
lastElm = td;
|
301 |
+
}
|
302 |
+
|
303 |
+
deleteMarked(tableElm);
|
304 |
+
}
|
305 |
+
}
|
306 |
+
|
307 |
+
function prevElm(node, name) {
|
308 |
+
while ((node = node.previousSibling) != null) {
|
309 |
+
if (node.nodeName == name)
|
310 |
+
return node;
|
311 |
+
}
|
312 |
+
|
313 |
+
return null;
|
314 |
+
}
|
315 |
+
|
316 |
+
function nextElm(node, names) {
|
317 |
+
var namesAr = names.split(',');
|
318 |
+
|
319 |
+
while ((node = node.nextSibling) != null) {
|
320 |
+
for (var i=0; i<namesAr.length; i++) {
|
321 |
+
if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
|
322 |
+
return node;
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
return null;
|
327 |
+
}
|
328 |
+
|
329 |
+
function deleteMarked(tbl) {
|
330 |
+
if (tbl.rows == 0)
|
331 |
+
return;
|
332 |
+
|
333 |
+
var tr = tbl.rows[0];
|
334 |
+
do {
|
335 |
+
var next = nextElm(tr, "TR");
|
336 |
+
|
337 |
+
// Delete row
|
338 |
+
if (tr._delete) {
|
339 |
+
tr.parentNode.removeChild(tr);
|
340 |
+
continue;
|
341 |
+
}
|
342 |
+
|
343 |
+
// Delete cells
|
344 |
+
var td = tr.cells[0];
|
345 |
+
if (td.cells > 1) {
|
346 |
+
do {
|
347 |
+
var nexttd = nextElm(td, "TD,TH");
|
348 |
+
|
349 |
+
if (td._delete)
|
350 |
+
td.parentNode.removeChild(td);
|
351 |
+
} while ((td = nexttd) != null);
|
352 |
+
}
|
353 |
+
} while ((tr = next) != null);
|
354 |
+
}
|
355 |
+
|
356 |
+
function addRows(td_elm, tr_elm, rowspan) {
|
357 |
+
// Add rows
|
358 |
+
td_elm.rowSpan = 1;
|
359 |
+
var trNext = nextElm(tr_elm, "TR");
|
360 |
+
for (var i=1; i<rowspan && trNext; i++) {
|
361 |
+
var newTD = doc.createElement("td");
|
362 |
+
newTD.innerHTML = " ";
|
363 |
+
|
364 |
+
if (tinyMCE.isMSIE)
|
365 |
+
trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
|
366 |
+
else
|
367 |
+
trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
|
368 |
+
|
369 |
+
trNext = nextElm(trNext, "TR");
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
+
function copyRow(doc, table, tr) {
|
374 |
+
var grid = getTableGrid(table);
|
375 |
+
var newTR = tr.cloneNode(false);
|
376 |
+
var cpos = getCellPos(grid, tr.cells[0]);
|
377 |
+
var lastCell = null;
|
378 |
+
var tableBorder = tinyMCE.getAttrib(table, "border");
|
379 |
+
var tdElm = null;
|
380 |
+
|
381 |
+
for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
|
382 |
+
var newTD = null;
|
383 |
+
|
384 |
+
if (lastCell != tdElm) {
|
385 |
+
for (var i=0; i<tr.cells.length; i++) {
|
386 |
+
if (tdElm == tr.cells[i]) {
|
387 |
+
newTD = tdElm.cloneNode(true);
|
388 |
+
break;
|
389 |
+
}
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
+
if (newTD == null) {
|
394 |
+
newTD = doc.createElement("td");
|
395 |
+
newTD.innerHTML = " ";
|
396 |
+
}
|
397 |
+
|
398 |
+
// Reset col/row span
|
399 |
+
newTD.colSpan = 1;
|
400 |
+
newTD.rowSpan = 1;
|
401 |
+
|
402 |
+
newTR.appendChild(newTD);
|
403 |
+
|
404 |
+
lastCell = tdElm;
|
405 |
+
}
|
406 |
+
|
407 |
+
return newTR;
|
408 |
+
}
|
409 |
+
|
410 |
+
// ---- Commands -----
|
411 |
+
|
412 |
+
// Handle commands
|
413 |
+
switch (command) {
|
414 |
+
case "mceTableRowProps":
|
415 |
+
if (trElm == null)
|
416 |
+
return true;
|
417 |
+
|
418 |
+
if (user_interface) {
|
419 |
+
// Setup template
|
420 |
+
var template = new Array();
|
421 |
+
|
422 |
+
template['file'] = '../../plugins/table/row.htm';
|
423 |
+
template['width'] = 380;
|
424 |
+
template['height'] = 295;
|
425 |
+
|
426 |
+
// Language specific width and height addons
|
427 |
+
template['width'] += tinyMCE.getLang('lang_table_rowprops_delta_width', 0);
|
428 |
+
template['height'] += tinyMCE.getLang('lang_table_rowprops_delta_height', 0);
|
429 |
+
|
430 |
+
// Open window
|
431 |
+
tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
|
432 |
+
}
|
433 |
+
|
434 |
+
return true;
|
435 |
+
|
436 |
+
case "mceTableCellProps":
|
437 |
+
if (tdElm == null)
|
438 |
+
return true;
|
439 |
+
|
440 |
+
if (user_interface) {
|
441 |
+
// Setup template
|
442 |
+
var template = new Array();
|
443 |
+
|
444 |
+
template['file'] = '../../plugins/table/cell.htm';
|
445 |
+
template['width'] = 380;
|
446 |
+
template['height'] = 295;
|
447 |
+
|
448 |
+
// Language specific width and height addons
|
449 |
+
template['width'] += tinyMCE.getLang('lang_table_cellprops_delta_width', 0);
|
450 |
+
template['height'] += tinyMCE.getLang('lang_table_cellprops_delta_height', 0);
|
451 |
+
|
452 |
+
// Open window
|
453 |
+
tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
|
454 |
+
}
|
455 |
+
|
456 |
+
return true;
|
457 |
+
|
458 |
+
case "mceInsertTable":
|
459 |
+
if (user_interface) {
|
460 |
+
// Setup template
|
461 |
+
var template = new Array();
|
462 |
+
|
463 |
+
template['file'] = '../../plugins/table/table.htm';
|
464 |
+
template['width'] = 380;
|
465 |
+
template['height'] = 295;
|
466 |
+
|
467 |
+
// Language specific width and height addons
|
468 |
+
template['width'] += tinyMCE.getLang('lang_table_table_delta_width', 0);
|
469 |
+
template['height'] += tinyMCE.getLang('lang_table_table_delta_height', 0);
|
470 |
+
|
471 |
+
// Open window
|
472 |
+
tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : value});
|
473 |
+
}
|
474 |
+
|
475 |
+
return true;
|
476 |
+
|
477 |
+
case "mceTableDelete":
|
478 |
+
var table = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
479 |
+
if (table) {
|
480 |
+
table.parentNode.removeChild(table);
|
481 |
+
inst.repaint();
|
482 |
+
}
|
483 |
+
return true;
|
484 |
+
|
485 |
+
case "mceTableSplitCells":
|
486 |
+
case "mceTableMergeCells":
|
487 |
+
case "mceTableInsertRowBefore":
|
488 |
+
case "mceTableInsertRowAfter":
|
489 |
+
case "mceTableDeleteRow":
|
490 |
+
case "mceTableInsertColBefore":
|
491 |
+
case "mceTableInsertColAfter":
|
492 |
+
case "mceTableDeleteCol":
|
493 |
+
case "mceTableCutRow":
|
494 |
+
case "mceTableCopyRow":
|
495 |
+
case "mceTablePasteRowBefore":
|
496 |
+
case "mceTablePasteRowAfter":
|
497 |
+
// No table just return (invalid command)
|
498 |
+
if (!tableElm)
|
499 |
+
return true;
|
500 |
+
|
501 |
+
// Table has a tbody use that reference
|
502 |
+
// Changed logic by ApTest 2005.07.12 (www.aptest.com)
|
503 |
+
// Now lookk at the focused element and take its parentNode. That will be a tbody or a table.
|
504 |
+
if (trElm && tableElm != trElm.parentNode)
|
505 |
+
tableElm = trElm.parentNode;
|
506 |
+
|
507 |
+
if (tableElm && trElm) {
|
508 |
+
switch (command) {
|
509 |
+
case "mceTableCutRow":
|
510 |
+
if (!trElm || !tdElm)
|
511 |
+
return true;
|
512 |
+
|
513 |
+
inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
|
514 |
+
inst.execCommand("mceTableDeleteRow");
|
515 |
+
break;
|
516 |
+
|
517 |
+
case "mceTableCopyRow":
|
518 |
+
if (!trElm || !tdElm)
|
519 |
+
return true;
|
520 |
+
|
521 |
+
inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
|
522 |
+
break;
|
523 |
+
|
524 |
+
case "mceTablePasteRowBefore":
|
525 |
+
if (!trElm || !tdElm)
|
526 |
+
return true;
|
527 |
+
|
528 |
+
var newTR = inst.tableRowClipboard.cloneNode(true);
|
529 |
+
|
530 |
+
var prevTR = prevElm(trElm, "TR");
|
531 |
+
if (prevTR != null)
|
532 |
+
trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
|
533 |
+
|
534 |
+
trElm.parentNode.insertBefore(newTR, trElm);
|
535 |
+
break;
|
536 |
+
|
537 |
+
case "mceTablePasteRowAfter":
|
538 |
+
if (!trElm || !tdElm)
|
539 |
+
return true;
|
540 |
+
|
541 |
+
var nextTR = nextElm(trElm, "TR");
|
542 |
+
var newTR = inst.tableRowClipboard.cloneNode(true);
|
543 |
+
|
544 |
+
trimRow(tableElm, trElm, tdElm, newTR);
|
545 |
+
|
546 |
+
if (nextTR == null)
|
547 |
+
trElm.parentNode.appendChild(newTR);
|
548 |
+
else
|
549 |
+
nextTR.parentNode.insertBefore(newTR, nextTR);
|
550 |
+
|
551 |
+
break;
|
552 |
+
|
553 |
+
case "mceTableInsertRowBefore":
|
554 |
+
if (!trElm || !tdElm)
|
555 |
+
return true;
|
556 |
+
|
557 |
+
var grid = getTableGrid(tableElm);
|
558 |
+
var cpos = getCellPos(grid, tdElm);
|
559 |
+
var newTR = doc.createElement("tr");
|
560 |
+
var lastTDElm = null;
|
561 |
+
|
562 |
+
cpos.rowindex--;
|
563 |
+
if (cpos.rowindex < 0)
|
564 |
+
cpos.rowindex = 0;
|
565 |
+
|
566 |
+
// Create cells
|
567 |
+
for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
|
568 |
+
if (tdElm != lastTDElm) {
|
569 |
+
var sd = getColRowSpan(tdElm);
|
570 |
+
|
571 |
+
if (sd['rowspan'] == 1) {
|
572 |
+
var newTD = doc.createElement("td");
|
573 |
+
|
574 |
+
newTD.innerHTML = " ";
|
575 |
+
newTD.colSpan = tdElm.colSpan;
|
576 |
+
|
577 |
+
newTR.appendChild(newTD);
|
578 |
+
} else
|
579 |
+
tdElm.rowSpan = sd['rowspan'] + 1;
|
580 |
+
|
581 |
+
lastTDElm = tdElm;
|
582 |
+
}
|
583 |
+
}
|
584 |
+
|
585 |
+
trElm.parentNode.insertBefore(newTR, trElm);
|
586 |
+
|
587 |
+
grid = getTableGrid(tableElm);
|
588 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex + 1, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
|
589 |
+
break;
|
590 |
+
|
591 |
+
case "mceTableInsertRowAfter":
|
592 |
+
if (!trElm || !tdElm)
|
593 |
+
return true;
|
594 |
+
|
595 |
+
var grid = getTableGrid(tableElm);
|
596 |
+
var cpos = getCellPos(grid, tdElm);
|
597 |
+
var newTR = doc.createElement("tr");
|
598 |
+
var lastTDElm = null;
|
599 |
+
|
600 |
+
// Create cells
|
601 |
+
for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
|
602 |
+
if (tdElm != lastTDElm) {
|
603 |
+
var sd = getColRowSpan(tdElm);
|
604 |
+
|
605 |
+
if (sd['rowspan'] == 1) {
|
606 |
+
var newTD = doc.createElement("td");
|
607 |
+
|
608 |
+
newTD.innerHTML = " ";
|
609 |
+
newTD.colSpan = tdElm.colSpan;
|
610 |
+
|
611 |
+
newTR.appendChild(newTD);
|
612 |
+
} else
|
613 |
+
tdElm.rowSpan = sd['rowspan'] + 1;
|
614 |
+
|
615 |
+
lastTDElm = tdElm;
|
616 |
+
}
|
617 |
+
}
|
618 |
+
|
619 |
+
if (newTR.hasChildNodes()) {
|
620 |
+
var nextTR = nextElm(trElm, "TR");
|
621 |
+
if (nextTR)
|
622 |
+
nextTR.parentNode.insertBefore(newTR, nextTR);
|
623 |
+
else
|
624 |
+
tableElm.appendChild(newTR);
|
625 |
+
}
|
626 |
+
|
627 |
+
grid = getTableGrid(tableElm);
|
628 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
|
629 |
+
break;
|
630 |
+
|
631 |
+
case "mceTableDeleteRow":
|
632 |
+
if (!trElm || !tdElm)
|
633 |
+
return true;
|
634 |
+
|
635 |
+
var grid = getTableGrid(tableElm);
|
636 |
+
var cpos = getCellPos(grid, tdElm);
|
637 |
+
|
638 |
+
// Only one row, remove whole table
|
639 |
+
if (grid.length == 1) {
|
640 |
+
tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
|
641 |
+
tableElm.parentNode.removeChild(tableElm);
|
642 |
+
return true;
|
643 |
+
}
|
644 |
+
|
645 |
+
// Move down row spanned cells
|
646 |
+
var cells = trElm.cells;
|
647 |
+
var nextTR = nextElm(trElm, "TR");
|
648 |
+
for (var x=0; x<cells.length; x++) {
|
649 |
+
if (cells[x].rowSpan > 1) {
|
650 |
+
var newTD = cells[x].cloneNode(true);
|
651 |
+
var sd = getColRowSpan(cells[x]);
|
652 |
+
|
653 |
+
newTD.rowSpan = sd.rowspan - 1;
|
654 |
+
|
655 |
+
var nextTD = nextTR.cells[x];
|
656 |
+
|
657 |
+
if (nextTD == null)
|
658 |
+
nextTR.appendChild(newTD);
|
659 |
+
else
|
660 |
+
nextTR.insertBefore(newTD, nextTD);
|
661 |
+
}
|
662 |
+
}
|
663 |
+
|
664 |
+
// Delete cells
|
665 |
+
var lastTDElm = null;
|
666 |
+
for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
|
667 |
+
if (tdElm != lastTDElm) {
|
668 |
+
var sd = getColRowSpan(tdElm);
|
669 |
+
|
670 |
+
if (sd.rowspan > 1) {
|
671 |
+
tdElm.rowSpan = sd.rowspan - 1;
|
672 |
+
} else {
|
673 |
+
trElm = tdElm.parentNode;
|
674 |
+
|
675 |
+
if (trElm.parentNode)
|
676 |
+
trElm._delete = true;
|
677 |
+
}
|
678 |
+
|
679 |
+
lastTDElm = tdElm;
|
680 |
+
}
|
681 |
+
}
|
682 |
+
|
683 |
+
deleteMarked(tableElm);
|
684 |
+
|
685 |
+
cpos.rowindex--;
|
686 |
+
if (cpos.rowindex < 0)
|
687 |
+
cpos.rowindex = 0;
|
688 |
+
|
689 |
+
// Recalculate grid and select
|
690 |
+
grid = getTableGrid(tableElm);
|
691 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
|
692 |
+
break;
|
693 |
+
|
694 |
+
case "mceTableInsertColBefore":
|
695 |
+
if (!trElm || !tdElm)
|
696 |
+
return true;
|
697 |
+
|
698 |
+
var grid = getTableGrid(tableElm);
|
699 |
+
var cpos = getCellPos(grid, tdElm);
|
700 |
+
var lastTDElm = null;
|
701 |
+
|
702 |
+
for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
|
703 |
+
if (tdElm != lastTDElm) {
|
704 |
+
var sd = getColRowSpan(tdElm);
|
705 |
+
|
706 |
+
if (sd['colspan'] == 1) {
|
707 |
+
var newTD = doc.createElement(tdElm.nodeName);
|
708 |
+
|
709 |
+
newTD.innerHTML = " ";
|
710 |
+
newTD.rowSpan = tdElm.rowSpan;
|
711 |
+
|
712 |
+
tdElm.parentNode.insertBefore(newTD, tdElm);
|
713 |
+
} else
|
714 |
+
tdElm.colSpan++;
|
715 |
+
|
716 |
+
lastTDElm = tdElm;
|
717 |
+
}
|
718 |
+
}
|
719 |
+
|
720 |
+
grid = getTableGrid(tableElm);
|
721 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex + 1), tinyMCE.isGecko, true); // Only collape on gecko
|
722 |
+
break;
|
723 |
+
|
724 |
+
case "mceTableInsertColAfter":
|
725 |
+
if (!trElm || !tdElm)
|
726 |
+
return true;
|
727 |
+
|
728 |
+
var grid = getTableGrid(tableElm);
|
729 |
+
var cpos = getCellPos(grid, tdElm);
|
730 |
+
var lastTDElm = null;
|
731 |
+
|
732 |
+
for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
|
733 |
+
if (tdElm != lastTDElm) {
|
734 |
+
var sd = getColRowSpan(tdElm);
|
735 |
+
|
736 |
+
if (sd['colspan'] == 1) {
|
737 |
+
var newTD = doc.createElement(tdElm.nodeName);
|
738 |
+
|
739 |
+
newTD.innerHTML = " ";
|
740 |
+
newTD.rowSpan = tdElm.rowSpan;
|
741 |
+
|
742 |
+
var nextTD = nextElm(tdElm, "TD,TH");
|
743 |
+
if (nextTD == null)
|
744 |
+
tdElm.parentNode.appendChild(newTD);
|
745 |
+
else
|
746 |
+
nextTD.parentNode.insertBefore(newTD, nextTD);
|
747 |
+
} else
|
748 |
+
tdElm.colSpan++;
|
749 |
+
|
750 |
+
lastTDElm = tdElm;
|
751 |
+
}
|
752 |
+
}
|
753 |
+
|
754 |
+
grid = getTableGrid(tableElm);
|
755 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex, cpos.cellindex), tinyMCE.isGecko, true); // Only collape on gecko
|
756 |
+
break;
|
757 |
+
|
758 |
+
case "mceTableDeleteCol":
|
759 |
+
if (!trElm || !tdElm)
|
760 |
+
return true;
|
761 |
+
|
762 |
+
var grid = getTableGrid(tableElm);
|
763 |
+
var cpos = getCellPos(grid, tdElm);
|
764 |
+
var lastTDElm = null;
|
765 |
+
|
766 |
+
// Only one col, remove whole table
|
767 |
+
if (grid.length > 1 && grid[0].length <= 1) {
|
768 |
+
tableElm = tinyMCE.getParentElement(tableElm, "table"); // Look for table instead of tbody
|
769 |
+
tableElm.parentNode.removeChild(tableElm);
|
770 |
+
return true;
|
771 |
+
}
|
772 |
+
|
773 |
+
// Delete cells
|
774 |
+
for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
|
775 |
+
if (tdElm != lastTDElm) {
|
776 |
+
var sd = getColRowSpan(tdElm);
|
777 |
+
|
778 |
+
if (sd['colspan'] > 1)
|
779 |
+
tdElm.colSpan = sd['colspan'] - 1;
|
780 |
+
else {
|
781 |
+
if (tdElm.parentNode)
|
782 |
+
tdElm.parentNode.removeChild(tdElm);
|
783 |
+
}
|
784 |
+
|
785 |
+
lastTDElm = tdElm;
|
786 |
+
}
|
787 |
+
}
|
788 |
+
|
789 |
+
cpos.cellindex--;
|
790 |
+
if (cpos.cellindex < 0)
|
791 |
+
cpos.cellindex = 0;
|
792 |
+
|
793 |
+
// Recalculate grid and select
|
794 |
+
grid = getTableGrid(tableElm);
|
795 |
+
inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), tinyMCE.isGecko, true); // Only collape on gecko
|
796 |
+
break;
|
797 |
+
|
798 |
+
case "mceTableSplitCells":
|
799 |
+
if (!trElm || !tdElm)
|
800 |
+
return true;
|
801 |
+
|
802 |
+
var spandata = getColRowSpan(tdElm);
|
803 |
+
|
804 |
+
var colspan = spandata["colspan"];
|
805 |
+
var rowspan = spandata["rowspan"];
|
806 |
+
|
807 |
+
// Needs splitting
|
808 |
+
if (colspan > 1 || rowspan > 1) {
|
809 |
+
// Generate cols
|
810 |
+
tdElm.colSpan = 1;
|
811 |
+
for (var i=1; i<colspan; i++) {
|
812 |
+
var newTD = doc.createElement("td");
|
813 |
+
|
814 |
+
newTD.innerHTML = " ";
|
815 |
+
|
816 |
+
trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
|
817 |
+
|
818 |
+
if (rowspan > 1)
|
819 |
+
addRows(newTD, trElm, rowspan);
|
820 |
+
}
|
821 |
+
|
822 |
+
addRows(tdElm, trElm, rowspan);
|
823 |
+
}
|
824 |
+
|
825 |
+
// Apply visual aids
|
826 |
+
tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
827 |
+
break;
|
828 |
+
|
829 |
+
case "mceTableMergeCells":
|
830 |
+
var rows = new Array();
|
831 |
+
var sel = inst.getSel();
|
832 |
+
var grid = getTableGrid(tableElm);
|
833 |
+
|
834 |
+
if (tinyMCE.isMSIE || sel.rangeCount == 1) {
|
835 |
+
if (user_interface) {
|
836 |
+
// Setup template
|
837 |
+
var template = new Array();
|
838 |
+
var sp = getColRowSpan(tdElm);
|
839 |
+
|
840 |
+
template['file'] = '../../plugins/table/merge_cells.htm';
|
841 |
+
template['width'] = 250;
|
842 |
+
template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
|
843 |
+
|
844 |
+
// Language specific width and height addons
|
845 |
+
template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0);
|
846 |
+
template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0);
|
847 |
+
|
848 |
+
// Open window
|
849 |
+
tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan});
|
850 |
+
|
851 |
+
return true;
|
852 |
+
} else {
|
853 |
+
var numRows = parseInt(value['numrows']);
|
854 |
+
var numCols = parseInt(value['numcols']);
|
855 |
+
var cpos = getCellPos(grid, tdElm);
|
856 |
+
|
857 |
+
if (("" + numRows) == "NaN")
|
858 |
+
numRows = 1;
|
859 |
+
|
860 |
+
if (("" + numCols) == "NaN")
|
861 |
+
numCols = 1;
|
862 |
+
|
863 |
+
// Get rows and cells
|
864 |
+
var tRows = tableElm.rows;
|
865 |
+
for (var y=cpos.rowindex; y<grid.length; y++) {
|
866 |
+
var rowCells = new Array();
|
867 |
+
|
868 |
+
for (var x=cpos.cellindex; x<grid[y].length; x++) {
|
869 |
+
var td = getCell(grid, y, x);
|
870 |
+
|
871 |
+
if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
|
872 |
+
var cp = getCellPos(grid, td);
|
873 |
+
|
874 |
+
// Within range
|
875 |
+
if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
|
876 |
+
rowCells[rowCells.length] = td;
|
877 |
+
}
|
878 |
+
}
|
879 |
+
|
880 |
+
if (rowCells.length > 0)
|
881 |
+
rows[rows.length] = rowCells;
|
882 |
+
}
|
883 |
+
|
884 |
+
//return true;
|
885 |
+
}
|
886 |
+
} else {
|
887 |
+
var cells = new Array();
|
888 |
+
var sel = inst.getSel();
|
889 |
+
var lastTR = null;
|
890 |
+
var curRow = null;
|
891 |
+
var x1 = -1, y1 = -1, x2, y2;
|
892 |
+
|
893 |
+
// Only one cell selected, whats the point?
|
894 |
+
if (sel.rangeCount < 2)
|
895 |
+
return true;
|
896 |
+
|
897 |
+
// Get all selected cells
|
898 |
+
for (var i=0; i<sel.rangeCount; i++) {
|
899 |
+
var rng = sel.getRangeAt(i);
|
900 |
+
var tdElm = rng.startContainer.childNodes[rng.startOffset];
|
901 |
+
|
902 |
+
if (!tdElm)
|
903 |
+
break;
|
904 |
+
|
905 |
+
if (tdElm.nodeName == "TD")
|
906 |
+
cells[cells.length] = tdElm;
|
907 |
+
}
|
908 |
+
|
909 |
+
// Get rows and cells
|
910 |
+
var tRows = tableElm.rows;
|
911 |
+
for (var y=0; y<tRows.length; y++) {
|
912 |
+
var rowCells = new Array();
|
913 |
+
|
914 |
+
for (var x=0; x<tRows[y].cells.length; x++) {
|
915 |
+
var td = tRows[y].cells[x];
|
916 |
+
|
917 |
+
for (var i=0; i<cells.length; i++) {
|
918 |
+
if (td == cells[i]) {
|
919 |
+
rowCells[rowCells.length] = td;
|
920 |
+
}
|
921 |
+
}
|
922 |
+
}
|
923 |
+
|
924 |
+
if (rowCells.length > 0)
|
925 |
+
rows[rows.length] = rowCells;
|
926 |
+
}
|
927 |
+
|
928 |
+
// Find selected cells in grid and box
|
929 |
+
var curRow = new Array();
|
930 |
+
var lastTR = null;
|
931 |
+
for (var y=0; y<grid.length; y++) {
|
932 |
+
for (var x=0; x<grid[y].length; x++) {
|
933 |
+
grid[y][x]._selected = false;
|
934 |
+
|
935 |
+
for (var i=0; i<cells.length; i++) {
|
936 |
+
if (grid[y][x] == cells[i]) {
|
937 |
+
// Get start pos
|
938 |
+
if (x1 == -1) {
|
939 |
+
x1 = x;
|
940 |
+
y1 = y;
|
941 |
+
}
|
942 |
+
|
943 |
+
// Get end pos
|
944 |
+
x2 = x;
|
945 |
+
y2 = y;
|
946 |
+
|
947 |
+
grid[y][x]._selected = true;
|
948 |
+
}
|
949 |
+
}
|
950 |
+
}
|
951 |
+
}
|
952 |
+
|
953 |
+
// Is there gaps, if so deny
|
954 |
+
for (var y=y1; y<=y2; y++) {
|
955 |
+
for (var x=x1; x<=x2; x++) {
|
956 |
+
if (!grid[y][x]._selected) {
|
957 |
+
alert("Invalid selection for merge.");
|
958 |
+
return true;
|
959 |
+
}
|
960 |
+
}
|
961 |
+
}
|
962 |
+
}
|
963 |
+
|
964 |
+
// Validate selection and get total rowspan and colspan
|
965 |
+
var rowSpan = 1, colSpan = 1;
|
966 |
+
|
967 |
+
// Validate horizontal and get total colspan
|
968 |
+
var lastRowSpan = -1;
|
969 |
+
for (var y=0; y<rows.length; y++) {
|
970 |
+
var rowColSpan = 0;
|
971 |
+
|
972 |
+
for (var x=0; x<rows[y].length; x++) {
|
973 |
+
var sd = getColRowSpan(rows[y][x]);
|
974 |
+
|
975 |
+
rowColSpan += sd['colspan'];
|
976 |
+
|
977 |
+
if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
|
978 |
+
alert("Invalid selection for merge.");
|
979 |
+
return true;
|
980 |
+
}
|
981 |
+
|
982 |
+
lastRowSpan = sd['rowspan'];
|
983 |
+
}
|
984 |
+
|
985 |
+
if (rowColSpan > colSpan)
|
986 |
+
colSpan = rowColSpan;
|
987 |
+
|
988 |
+
lastRowSpan = -1;
|
989 |
+
}
|
990 |
+
|
991 |
+
// Validate vertical and get total rowspan
|
992 |
+
var lastColSpan = -1;
|
993 |
+
for (var x=0; x<rows[0].length; x++) {
|
994 |
+
var colRowSpan = 0;
|
995 |
+
|
996 |
+
for (var y=0; y<rows.length; y++) {
|
997 |
+
var sd = getColRowSpan(rows[y][x]);
|
998 |
+
|
999 |
+
colRowSpan += sd['rowspan'];
|
1000 |
+
|
1001 |
+
if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
|
1002 |
+
alert("Invalid selection for merge.");
|
1003 |
+
return true;
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
lastColSpan = sd['colspan'];
|
1007 |
+
}
|
1008 |
+
|
1009 |
+
if (colRowSpan > rowSpan)
|
1010 |
+
rowSpan = colRowSpan;
|
1011 |
+
|
1012 |
+
lastColSpan = -1;
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
// Setup td
|
1016 |
+
tdElm = rows[0][0];
|
1017 |
+
tdElm.rowSpan = rowSpan;
|
1018 |
+
tdElm.colSpan = colSpan;
|
1019 |
+
|
1020 |
+
// Merge cells
|
1021 |
+
for (var y=0; y<rows.length; y++) {
|
1022 |
+
for (var x=0; x<rows[y].length; x++) {
|
1023 |
+
var html = rows[y][x].innerHTML;
|
1024 |
+
var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "");
|
1025 |
+
|
1026 |
+
if (chk != "<br/>" && chk != "<br>" && chk != " " && (x+y > 0))
|
1027 |
+
tdElm.innerHTML += html;
|
1028 |
+
|
1029 |
+
// Not current cell
|
1030 |
+
if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
|
1031 |
+
var cpos = getCellPos(grid, rows[y][x]);
|
1032 |
+
var tr = rows[y][x].parentNode;
|
1033 |
+
|
1034 |
+
tr.removeChild(rows[y][x]);
|
1035 |
+
rows[y][x]._deleted = true;
|
1036 |
+
|
1037 |
+
// Empty TR, remove it
|
1038 |
+
if (!tr.hasChildNodes()) {
|
1039 |
+
tr.parentNode.removeChild(tr);
|
1040 |
+
|
1041 |
+
var lastCell = null;
|
1042 |
+
for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
|
1043 |
+
if (cellElm != lastCell && cellElm.rowSpan > 1)
|
1044 |
+
cellElm.rowSpan--;
|
1045 |
+
|
1046 |
+
lastCell = cellElm;
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
if (tdElm.rowSpan > 1)
|
1050 |
+
tdElm.rowSpan--;
|
1051 |
+
}
|
1052 |
+
}
|
1053 |
+
}
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
break;
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
1060 |
+
tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
|
1061 |
+
tinyMCE.triggerNodeChange();
|
1062 |
+
inst.repaint();
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
return true;
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
// Pass to next handler in chain
|
1069 |
+
return false;
|
1070 |
+
}
|
1071 |
+
};
|
1072 |
+
|
1073 |
+
tinyMCE.addPlugin("table", TinyMCE_TablePlugin);
|
upload_to_tinymce_directory/plugins/table/images/buttons.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_cell_props.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_delete.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_delete_col.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_delete_row.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_insert_col_after.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_insert_col_before.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_insert_row_after.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_insert_row_before.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_merge_cells.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_row_props.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/images/table_split_cells.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/table/jscripts/cell.js
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function init() {
|
2 |
+
tinyMCEPopup.resizeToInnerSize();
|
3 |
+
|
4 |
+
document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
|
5 |
+
document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
|
6 |
+
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
|
7 |
+
|
8 |
+
var inst = tinyMCE.selectedInstance;
|
9 |
+
var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
|
10 |
+
var formObj = document.forms[0];
|
11 |
+
var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style"));
|
12 |
+
|
13 |
+
// Get table cell data
|
14 |
+
var celltype = tdElm.nodeName.toLowerCase();
|
15 |
+
var align = tinyMCE.getAttrib(tdElm, 'align');
|
16 |
+
var valign = tinyMCE.getAttrib(tdElm, 'valign');
|
17 |
+
var width = trimSize(getStyle(tdElm, 'width', 'width'));
|
18 |
+
var height = trimSize(getStyle(tdElm, 'height', 'height'));
|
19 |
+
var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
|
20 |
+
var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
|
21 |
+
var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false);
|
22 |
+
var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
|
23 |
+
var id = tinyMCE.getAttrib(tdElm, 'id');
|
24 |
+
var lang = tinyMCE.getAttrib(tdElm, 'lang');
|
25 |
+
var dir = tinyMCE.getAttrib(tdElm, 'dir');
|
26 |
+
var scope = tinyMCE.getAttrib(tdElm, 'scope');
|
27 |
+
|
28 |
+
// Setup form
|
29 |
+
addClassesToList('class', 'table_cell_styles');
|
30 |
+
formObj.bordercolor.value = bordercolor;
|
31 |
+
formObj.bgcolor.value = bgcolor;
|
32 |
+
formObj.backgroundimage.value = backgroundimage;
|
33 |
+
formObj.width.value = width;
|
34 |
+
formObj.height.value = height;
|
35 |
+
formObj.id.value = id;
|
36 |
+
formObj.lang.value = lang;
|
37 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
38 |
+
selectByValue(formObj, 'align', align);
|
39 |
+
selectByValue(formObj, 'valign', valign);
|
40 |
+
selectByValue(formObj, 'class', className);
|
41 |
+
selectByValue(formObj, 'celltype', celltype);
|
42 |
+
selectByValue(formObj, 'dir', dir);
|
43 |
+
selectByValue(formObj, 'scope', scope);
|
44 |
+
|
45 |
+
// Resize some elements
|
46 |
+
if (isVisible('backgroundimagebrowser'))
|
47 |
+
document.getElementById('backgroundimage').style.width = '180px';
|
48 |
+
|
49 |
+
updateColor('bordercolor_pick', 'bordercolor');
|
50 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
51 |
+
}
|
52 |
+
|
53 |
+
function updateAction() {
|
54 |
+
tinyMCEPopup.restoreSelection();
|
55 |
+
|
56 |
+
var inst = tinyMCE.selectedInstance;
|
57 |
+
var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
|
58 |
+
var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
|
59 |
+
var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
60 |
+
var formObj = document.forms[0];
|
61 |
+
|
62 |
+
inst.execCommand('mceBeginUndoLevel');
|
63 |
+
|
64 |
+
switch (getSelectValue(formObj, 'action')) {
|
65 |
+
case "cell":
|
66 |
+
var celltype = getSelectValue(formObj, 'celltype');
|
67 |
+
var scope = getSelectValue(formObj, 'scope');
|
68 |
+
|
69 |
+
if (tinyMCE.getParam("accessibility_warnings")) {
|
70 |
+
if (celltype == "th" && scope == "")
|
71 |
+
var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true));
|
72 |
+
else
|
73 |
+
var answer = true;
|
74 |
+
|
75 |
+
if (!answer)
|
76 |
+
return;
|
77 |
+
}
|
78 |
+
|
79 |
+
updateCell(tdElm);
|
80 |
+
break;
|
81 |
+
|
82 |
+
case "row":
|
83 |
+
var cell = trElm.firstChild;
|
84 |
+
|
85 |
+
if (cell.nodeName != "TD" && cell.nodeName != "TH")
|
86 |
+
cell = nextCell(cell);
|
87 |
+
|
88 |
+
do {
|
89 |
+
cell = updateCell(cell, true);
|
90 |
+
} while ((cell = nextCell(cell)) != null);
|
91 |
+
|
92 |
+
break;
|
93 |
+
|
94 |
+
case "all":
|
95 |
+
var rows = tableElm.getElementsByTagName("tr");
|
96 |
+
|
97 |
+
for (var i=0; i<rows.length; i++) {
|
98 |
+
var cell = rows[i].firstChild;
|
99 |
+
|
100 |
+
if (cell.nodeName != "TD" && cell.nodeName != "TH")
|
101 |
+
cell = nextCell(cell);
|
102 |
+
|
103 |
+
do {
|
104 |
+
cell = updateCell(cell, true);
|
105 |
+
} while ((cell = nextCell(cell)) != null);
|
106 |
+
}
|
107 |
+
|
108 |
+
break;
|
109 |
+
}
|
110 |
+
|
111 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
|
112 |
+
tinyMCE.triggerNodeChange();
|
113 |
+
inst.execCommand('mceEndUndoLevel');
|
114 |
+
tinyMCEPopup.close();
|
115 |
+
}
|
116 |
+
|
117 |
+
function nextCell(elm) {
|
118 |
+
while ((elm = elm.nextSibling) != null) {
|
119 |
+
if (elm.nodeName == "TD" || elm.nodeName == "TH")
|
120 |
+
return elm;
|
121 |
+
}
|
122 |
+
|
123 |
+
return null;
|
124 |
+
}
|
125 |
+
|
126 |
+
function updateCell(td, skip_id) {
|
127 |
+
var inst = tinyMCE.selectedInstance;
|
128 |
+
var formObj = document.forms[0];
|
129 |
+
var curCellType = td.nodeName.toLowerCase();
|
130 |
+
var celltype = getSelectValue(formObj, 'celltype');
|
131 |
+
var doc = inst.getDoc();
|
132 |
+
|
133 |
+
if (!skip_id)
|
134 |
+
td.setAttribute('id', formObj.id.value);
|
135 |
+
|
136 |
+
td.setAttribute('align', formObj.align.value);
|
137 |
+
td.setAttribute('vAlign', formObj.valign.value);
|
138 |
+
td.setAttribute('lang', formObj.lang.value);
|
139 |
+
td.setAttribute('dir', getSelectValue(formObj, 'dir'));
|
140 |
+
td.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
|
141 |
+
td.setAttribute('scope', formObj.scope.value);
|
142 |
+
tinyMCE.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
|
143 |
+
|
144 |
+
// Clear deprecated attributes
|
145 |
+
tinyMCE.setAttrib(td, 'width', '');
|
146 |
+
tinyMCE.setAttrib(td, 'height', '');
|
147 |
+
tinyMCE.setAttrib(td, 'bgColor', '');
|
148 |
+
tinyMCE.setAttrib(td, 'borderColor', '');
|
149 |
+
tinyMCE.setAttrib(td, 'background', '');
|
150 |
+
|
151 |
+
// Set styles
|
152 |
+
td.style.width = getCSSSize(formObj.width.value);
|
153 |
+
td.style.height = getCSSSize(formObj.height.value);
|
154 |
+
if (formObj.bordercolor.value != "") {
|
155 |
+
td.style.borderColor = formObj.bordercolor.value;
|
156 |
+
td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
|
157 |
+
td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
|
158 |
+
} else
|
159 |
+
td.style.borderColor = '';
|
160 |
+
|
161 |
+
td.style.backgroundColor = formObj.bgcolor.value;
|
162 |
+
|
163 |
+
if (formObj.backgroundimage.value != "")
|
164 |
+
td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
|
165 |
+
else
|
166 |
+
td.style.backgroundImage = '';
|
167 |
+
|
168 |
+
if (curCellType != celltype) {
|
169 |
+
// changing to a different node type
|
170 |
+
var newCell = doc.createElement(celltype);
|
171 |
+
|
172 |
+
for (var c=0; c<td.childNodes.length; c++)
|
173 |
+
newCell.appendChild(td.childNodes[c].cloneNode(1));
|
174 |
+
|
175 |
+
for (var a=0; a<td.attributes.length; a++) {
|
176 |
+
var attr = td.attributes[a];
|
177 |
+
newCell.setAttribute(attr.name, attr.value);
|
178 |
+
}
|
179 |
+
|
180 |
+
td.parentNode.replaceChild(newCell, td);
|
181 |
+
td = newCell;
|
182 |
+
}
|
183 |
+
|
184 |
+
return td;
|
185 |
+
}
|
186 |
+
|
187 |
+
function changedBackgroundImage() {
|
188 |
+
var formObj = document.forms[0];
|
189 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
190 |
+
|
191 |
+
st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
|
192 |
+
|
193 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
194 |
+
}
|
195 |
+
|
196 |
+
function changedSize() {
|
197 |
+
var formObj = document.forms[0];
|
198 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
199 |
+
|
200 |
+
var width = formObj.width.value;
|
201 |
+
if (width != "")
|
202 |
+
st['width'] = getCSSSize(width);
|
203 |
+
else
|
204 |
+
st['width'] = "";
|
205 |
+
|
206 |
+
var height = formObj.height.value;
|
207 |
+
if (height != "")
|
208 |
+
st['height'] = getCSSSize(height);
|
209 |
+
else
|
210 |
+
st['height'] = "";
|
211 |
+
|
212 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
213 |
+
}
|
214 |
+
|
215 |
+
function changedColor() {
|
216 |
+
var formObj = document.forms[0];
|
217 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
218 |
+
|
219 |
+
st['background-color'] = formObj.bgcolor.value;
|
220 |
+
st['border-color'] = formObj.bordercolor.value;
|
221 |
+
|
222 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
223 |
+
}
|
224 |
+
|
225 |
+
function changedStyle() {
|
226 |
+
var formObj = document.forms[0];
|
227 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
228 |
+
|
229 |
+
if (st['background-image'])
|
230 |
+
formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
231 |
+
else
|
232 |
+
formObj.backgroundimage.value = '';
|
233 |
+
|
234 |
+
if (st['width'])
|
235 |
+
formObj.width.value = trimSize(st['width']);
|
236 |
+
|
237 |
+
if (st['height'])
|
238 |
+
formObj.height.value = trimSize(st['height']);
|
239 |
+
|
240 |
+
if (st['background-color']) {
|
241 |
+
formObj.bgcolor.value = st['background-color'];
|
242 |
+
updateColor('bgcolor_pick','bgcolor');
|
243 |
+
}
|
244 |
+
|
245 |
+
if (st['border-color']) {
|
246 |
+
formObj.bordercolor.value = st['border-color'];
|
247 |
+
updateColor('bordercolor_pick','bordercolor');
|
248 |
+
}
|
249 |
+
}
|
upload_to_tinymce_directory/plugins/table/jscripts/merge_cells.js
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function init() {
|
2 |
+
tinyMCEPopup.resizeToInnerSize();
|
3 |
+
|
4 |
+
var formObj = document.forms[0];
|
5 |
+
|
6 |
+
formObj.numcols.value = tinyMCE.getWindowArg('numcols', 1);
|
7 |
+
formObj.numrows.value = tinyMCE.getWindowArg('numrows', 1);
|
8 |
+
}
|
9 |
+
|
10 |
+
function mergeCells() {
|
11 |
+
var args = new Array();
|
12 |
+
var formObj = document.forms[0];
|
13 |
+
|
14 |
+
if (!AutoValidator.validate(formObj)) {
|
15 |
+
alert(tinyMCE.getLang('lang_invalid_data'));
|
16 |
+
return false;
|
17 |
+
}
|
18 |
+
|
19 |
+
args["numcols"] = formObj.numcols.value;
|
20 |
+
args["numrows"] = formObj.numrows.value;
|
21 |
+
|
22 |
+
tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
|
23 |
+
tinyMCEPopup.close();
|
24 |
+
}
|
upload_to_tinymce_directory/plugins/table/jscripts/row.js
ADDED
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function init() {
|
2 |
+
tinyMCEPopup.resizeToInnerSize();
|
3 |
+
|
4 |
+
document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
|
5 |
+
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
6 |
+
|
7 |
+
var inst = tinyMCE.selectedInstance;
|
8 |
+
var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
|
9 |
+
var formObj = document.forms[0];
|
10 |
+
var st = tinyMCE.parseStyle(tinyMCE.getAttrib(trElm, "style"));
|
11 |
+
|
12 |
+
// Get table row data
|
13 |
+
var rowtype = trElm.parentNode.nodeName.toLowerCase();
|
14 |
+
var align = tinyMCE.getAttrib(trElm, 'align');
|
15 |
+
var valign = tinyMCE.getAttrib(trElm, 'valign');
|
16 |
+
var height = trimSize(getStyle(trElm, 'height', 'height'));
|
17 |
+
var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(trElm, 'class'), false);
|
18 |
+
var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
|
19 |
+
var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
|
20 |
+
var id = tinyMCE.getAttrib(trElm, 'id');
|
21 |
+
var lang = tinyMCE.getAttrib(trElm, 'lang');
|
22 |
+
var dir = tinyMCE.getAttrib(trElm, 'dir');
|
23 |
+
|
24 |
+
// Setup form
|
25 |
+
addClassesToList('class', 'table_row_styles');
|
26 |
+
formObj.bgcolor.value = bgcolor;
|
27 |
+
formObj.backgroundimage.value = backgroundimage;
|
28 |
+
formObj.height.value = height;
|
29 |
+
formObj.id.value = id;
|
30 |
+
formObj.lang.value = lang;
|
31 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
32 |
+
selectByValue(formObj, 'align', align);
|
33 |
+
selectByValue(formObj, 'valign', valign);
|
34 |
+
selectByValue(formObj, 'class', className);
|
35 |
+
selectByValue(formObj, 'rowtype', rowtype);
|
36 |
+
selectByValue(formObj, 'dir', dir);
|
37 |
+
|
38 |
+
// Resize some elements
|
39 |
+
if (isVisible('backgroundimagebrowser'))
|
40 |
+
document.getElementById('backgroundimage').style.width = '180px';
|
41 |
+
|
42 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
43 |
+
}
|
44 |
+
|
45 |
+
function updateAction() {
|
46 |
+
tinyMCEPopup.restoreSelection();
|
47 |
+
|
48 |
+
var inst = tinyMCE.selectedInstance;
|
49 |
+
var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
|
50 |
+
var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
51 |
+
var formObj = document.forms[0];
|
52 |
+
var action = getSelectValue(formObj, 'action');
|
53 |
+
|
54 |
+
inst.execCommand('mceBeginUndoLevel');
|
55 |
+
|
56 |
+
switch (action) {
|
57 |
+
case "row":
|
58 |
+
updateRow(trElm);
|
59 |
+
break;
|
60 |
+
|
61 |
+
case "all":
|
62 |
+
var rows = tableElm.getElementsByTagName("tr");
|
63 |
+
|
64 |
+
for (var i=0; i<rows.length; i++)
|
65 |
+
updateRow(rows[i], true);
|
66 |
+
|
67 |
+
break;
|
68 |
+
|
69 |
+
case "odd":
|
70 |
+
case "even":
|
71 |
+
var rows = tableElm.getElementsByTagName("tr");
|
72 |
+
|
73 |
+
for (var i=0; i<rows.length; i++) {
|
74 |
+
if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
|
75 |
+
updateRow(rows[i], true, true);
|
76 |
+
}
|
77 |
+
|
78 |
+
break;
|
79 |
+
}
|
80 |
+
|
81 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
|
82 |
+
tinyMCE.triggerNodeChange();
|
83 |
+
inst.execCommand('mceEndUndoLevel');
|
84 |
+
tinyMCEPopup.close();
|
85 |
+
}
|
86 |
+
|
87 |
+
function updateRow(tr_elm, skip_id, skip_parent) {
|
88 |
+
var inst = tinyMCE.selectedInstance;
|
89 |
+
var formObj = document.forms[0];
|
90 |
+
var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
|
91 |
+
var rowtype = getSelectValue(formObj, 'rowtype');
|
92 |
+
var doc = inst.getDoc();
|
93 |
+
|
94 |
+
// Update row element
|
95 |
+
if (!skip_id)
|
96 |
+
tr_elm.setAttribute('id', formObj.id.value);
|
97 |
+
|
98 |
+
tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
|
99 |
+
tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
|
100 |
+
tr_elm.setAttribute('lang', formObj.lang.value);
|
101 |
+
tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
|
102 |
+
tr_elm.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
|
103 |
+
tinyMCE.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
|
104 |
+
|
105 |
+
// Clear deprecated attributes
|
106 |
+
tr_elm.setAttribute('background', '');
|
107 |
+
tr_elm.setAttribute('bgColor', '');
|
108 |
+
tr_elm.setAttribute('height', '');
|
109 |
+
|
110 |
+
// Set styles
|
111 |
+
tr_elm.style.height = getCSSSize(formObj.height.value);
|
112 |
+
tr_elm.style.backgroundColor = formObj.bgcolor.value;
|
113 |
+
|
114 |
+
if (formObj.backgroundimage.value != "")
|
115 |
+
tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
|
116 |
+
else
|
117 |
+
tr_elm.style.backgroundImage = '';
|
118 |
+
|
119 |
+
// Setup new rowtype
|
120 |
+
if (curRowType != rowtype && !skip_parent) {
|
121 |
+
// first, clone the node we are working on
|
122 |
+
var newRow = tr_elm.cloneNode(1);
|
123 |
+
|
124 |
+
// next, find the parent of its new destination (creating it if necessary)
|
125 |
+
var theTable = tinyMCE.getParentElement(tr_elm, "table");
|
126 |
+
var dest = rowtype;
|
127 |
+
var newParent = null;
|
128 |
+
for (var i = 0; i < theTable.childNodes.length; i++) {
|
129 |
+
if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
|
130 |
+
newParent = theTable.childNodes[i];
|
131 |
+
}
|
132 |
+
|
133 |
+
if (newParent == null) {
|
134 |
+
newParent = doc.createElement(dest);
|
135 |
+
|
136 |
+
if (dest == "thead")
|
137 |
+
theTable.insertBefore(newParent, theTable.firstChild);
|
138 |
+
else
|
139 |
+
theTable.appendChild(newParent);
|
140 |
+
}
|
141 |
+
|
142 |
+
// append the row to the new parent
|
143 |
+
newParent.appendChild(newRow);
|
144 |
+
|
145 |
+
// remove the original
|
146 |
+
tr_elm.parentNode.removeChild(tr_elm);
|
147 |
+
|
148 |
+
// set tr_elm to the new node
|
149 |
+
tr_elm = newRow;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
|
153 |
+
function changedBackgroundImage() {
|
154 |
+
var formObj = document.forms[0];
|
155 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
156 |
+
|
157 |
+
st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
|
158 |
+
|
159 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
160 |
+
}
|
161 |
+
|
162 |
+
function changedStyle() {
|
163 |
+
var formObj = document.forms[0];
|
164 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
165 |
+
|
166 |
+
if (st['background-image'])
|
167 |
+
formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
168 |
+
else
|
169 |
+
formObj.backgroundimage.value = '';
|
170 |
+
|
171 |
+
if (st['height'])
|
172 |
+
formObj.height.value = trimSize(st['height']);
|
173 |
+
|
174 |
+
if (st['background-color']) {
|
175 |
+
formObj.bgcolor.value = st['background-color'];
|
176 |
+
updateColor('bgcolor_pick','bgcolor');
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
function changedSize() {
|
181 |
+
var formObj = document.forms[0];
|
182 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
183 |
+
|
184 |
+
var height = formObj.height.value;
|
185 |
+
if (height != "")
|
186 |
+
st['height'] = getCSSSize(height);
|
187 |
+
else
|
188 |
+
st['height'] = "";
|
189 |
+
|
190 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
191 |
+
}
|
192 |
+
|
193 |
+
function changedColor() {
|
194 |
+
var formObj = document.forms[0];
|
195 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
196 |
+
|
197 |
+
st['background-color'] = formObj.bgcolor.value;
|
198 |
+
|
199 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
200 |
+
}
|
upload_to_tinymce_directory/plugins/table/jscripts/table.js
ADDED
@@ -0,0 +1,364 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var action, orgTableWidth, orgTableHeight;
|
2 |
+
|
3 |
+
function insertTable() {
|
4 |
+
var formObj = document.forms[0];
|
5 |
+
var inst = tinyMCE.selectedInstance;
|
6 |
+
var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption;
|
7 |
+
var html = '', capEl;
|
8 |
+
var elm = tinyMCE.tableElm;
|
9 |
+
var cellLimit, rowLimit, colLimit;
|
10 |
+
|
11 |
+
if (!AutoValidator.validate(formObj)) {
|
12 |
+
alert(tinyMCE.getLang('lang_invalid_data'));
|
13 |
+
return false;
|
14 |
+
}
|
15 |
+
|
16 |
+
tinyMCEPopup.restoreSelection();
|
17 |
+
|
18 |
+
// Get form data
|
19 |
+
cols = formObj.elements['cols'].value;
|
20 |
+
rows = formObj.elements['rows'].value;
|
21 |
+
border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0;
|
22 |
+
cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
|
23 |
+
cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
|
24 |
+
align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
|
25 |
+
width = formObj.elements['width'].value;
|
26 |
+
height = formObj.elements['height'].value;
|
27 |
+
bordercolor = formObj.elements['bordercolor'].value;
|
28 |
+
bgcolor = formObj.elements['bgcolor'].value;
|
29 |
+
className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
|
30 |
+
id = formObj.elements['id'].value;
|
31 |
+
summary = formObj.elements['summary'].value;
|
32 |
+
style = formObj.elements['style'].value;
|
33 |
+
dir = formObj.elements['dir'].value;
|
34 |
+
lang = formObj.elements['lang'].value;
|
35 |
+
background = formObj.elements['backgroundimage'].value;
|
36 |
+
caption = formObj.elements['caption'].checked;
|
37 |
+
|
38 |
+
cellLimit = tinyMCE.getParam('table_cell_limit', false);
|
39 |
+
rowLimit = tinyMCE.getParam('table_row_limit', false);
|
40 |
+
colLimit = tinyMCE.getParam('table_col_limit', false);
|
41 |
+
|
42 |
+
// Validate table size
|
43 |
+
if (colLimit && cols > colLimit) {
|
44 |
+
alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
|
45 |
+
return false;
|
46 |
+
} else if (rowLimit && rows > rowLimit) {
|
47 |
+
alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
|
48 |
+
return false;
|
49 |
+
} else if (cellLimit && cols * rows > cellLimit) {
|
50 |
+
alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
// Update table
|
55 |
+
if (action == "update") {
|
56 |
+
inst.execCommand('mceBeginUndoLevel');
|
57 |
+
|
58 |
+
tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);
|
59 |
+
tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);
|
60 |
+
tinyMCE.setAttrib(elm, 'border', border, true);
|
61 |
+
tinyMCE.setAttrib(elm, 'align', align);
|
62 |
+
tinyMCE.setAttrib(elm, 'class', className);
|
63 |
+
tinyMCE.setAttrib(elm, 'style', style);
|
64 |
+
tinyMCE.setAttrib(elm, 'id', id);
|
65 |
+
tinyMCE.setAttrib(elm, 'summary', summary);
|
66 |
+
tinyMCE.setAttrib(elm, 'dir', dir);
|
67 |
+
tinyMCE.setAttrib(elm, 'lang', lang);
|
68 |
+
|
69 |
+
capEl = elm.getElementsByTagName('caption')[0];
|
70 |
+
|
71 |
+
if (capEl && !caption)
|
72 |
+
capEl.parentNode.removeChild(capEl);
|
73 |
+
|
74 |
+
if (!capEl && caption) {
|
75 |
+
capEl = elm.ownerDocument.createElement('caption');
|
76 |
+
capEl.innerHTML = ' ';
|
77 |
+
elm.insertBefore(capEl, elm.firstChild);
|
78 |
+
}
|
79 |
+
|
80 |
+
// Not inline styles
|
81 |
+
if (!tinyMCE.getParam("inline_styles"))
|
82 |
+
tinyMCE.setAttrib(elm, 'width', width, true);
|
83 |
+
|
84 |
+
// Remove these since they are not valid XHTML
|
85 |
+
tinyMCE.setAttrib(elm, 'borderColor', '');
|
86 |
+
tinyMCE.setAttrib(elm, 'bgColor', '');
|
87 |
+
tinyMCE.setAttrib(elm, 'background', '');
|
88 |
+
tinyMCE.setAttrib(elm, 'height', '');
|
89 |
+
|
90 |
+
if (background != '')
|
91 |
+
elm.style.backgroundImage = "url('" + background + "')";
|
92 |
+
else
|
93 |
+
elm.style.backgroundImage = '';
|
94 |
+
|
95 |
+
if (tinyMCE.getParam("inline_styles"))
|
96 |
+
elm.style.borderWidth = border + "px";
|
97 |
+
|
98 |
+
if (tinyMCE.getParam("inline_styles")) {
|
99 |
+
if (width != '')
|
100 |
+
elm.style.width = getCSSSize(width);
|
101 |
+
}
|
102 |
+
|
103 |
+
if (bordercolor != "") {
|
104 |
+
elm.style.borderColor = bordercolor;
|
105 |
+
elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
|
106 |
+
elm.style.borderWidth = border == "" ? "1px" : border;
|
107 |
+
} else
|
108 |
+
elm.style.borderColor = '';
|
109 |
+
|
110 |
+
elm.style.backgroundColor = bgcolor;
|
111 |
+
elm.style.height = getCSSSize(height);
|
112 |
+
|
113 |
+
tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);
|
114 |
+
|
115 |
+
// Fix for stange MSIE align bug
|
116 |
+
tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;
|
117 |
+
|
118 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
|
119 |
+
tinyMCE.triggerNodeChange();
|
120 |
+
inst.execCommand('mceEndUndoLevel');
|
121 |
+
|
122 |
+
// Repaint if dimensions changed
|
123 |
+
if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
|
124 |
+
inst.repaint();
|
125 |
+
|
126 |
+
tinyMCEPopup.close();
|
127 |
+
return true;
|
128 |
+
}
|
129 |
+
|
130 |
+
// Create new table
|
131 |
+
html += '<table';
|
132 |
+
|
133 |
+
html += makeAttrib('id', id);
|
134 |
+
html += makeAttrib('border', border);
|
135 |
+
html += makeAttrib('cellpadding', cellpadding);
|
136 |
+
html += makeAttrib('cellspacing', cellspacing);
|
137 |
+
html += makeAttrib('width', width);
|
138 |
+
//html += makeAttrib('height', height);
|
139 |
+
//html += makeAttrib('bordercolor', bordercolor);
|
140 |
+
//html += makeAttrib('bgcolor', bgcolor);
|
141 |
+
html += makeAttrib('align', align);
|
142 |
+
html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));
|
143 |
+
html += makeAttrib('style', style);
|
144 |
+
html += makeAttrib('summary', summary);
|
145 |
+
html += makeAttrib('dir', dir);
|
146 |
+
html += makeAttrib('lang', lang);
|
147 |
+
html += '>';
|
148 |
+
|
149 |
+
if (caption)
|
150 |
+
html += '<caption> </caption>';
|
151 |
+
|
152 |
+
for (var y=0; y<rows; y++) {
|
153 |
+
html += "<tr>";
|
154 |
+
|
155 |
+
for (var x=0; x<cols; x++)
|
156 |
+
html += '<td> </td>';
|
157 |
+
|
158 |
+
html += "</tr>";
|
159 |
+
}
|
160 |
+
|
161 |
+
html += "</table>";
|
162 |
+
|
163 |
+
inst.execCommand('mceBeginUndoLevel');
|
164 |
+
inst.execCommand('mceInsertContent', false, html);
|
165 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);
|
166 |
+
inst.execCommand('mceEndUndoLevel');
|
167 |
+
|
168 |
+
tinyMCEPopup.close();
|
169 |
+
}
|
170 |
+
|
171 |
+
function makeAttrib(attrib, value) {
|
172 |
+
var formObj = document.forms[0];
|
173 |
+
var valueElm = formObj.elements[attrib];
|
174 |
+
|
175 |
+
if (typeof(value) == "undefined" || value == null) {
|
176 |
+
value = "";
|
177 |
+
|
178 |
+
if (valueElm)
|
179 |
+
value = valueElm.value;
|
180 |
+
}
|
181 |
+
|
182 |
+
if (value == "")
|
183 |
+
return "";
|
184 |
+
|
185 |
+
// XML encode it
|
186 |
+
value = value.replace(/&/g, '&');
|
187 |
+
value = value.replace(/\"/g, '"');
|
188 |
+
value = value.replace(/</g, '<');
|
189 |
+
value = value.replace(/>/g, '>');
|
190 |
+
|
191 |
+
return ' ' + attrib + '="' + value + '"';
|
192 |
+
}
|
193 |
+
|
194 |
+
function init() {
|
195 |
+
tinyMCEPopup.resizeToInnerSize();
|
196 |
+
|
197 |
+
document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
|
198 |
+
document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
|
199 |
+
document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
|
200 |
+
document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
|
201 |
+
|
202 |
+
var cols = 2, rows = 2, border = tinyMCE.getParam('table_default_border', '0'), cellpadding = tinyMCE.getParam('table_default_cellpadding', ''), cellspacing = tinyMCE.getParam('table_default_cellspacing', '');
|
203 |
+
var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
|
204 |
+
var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
|
205 |
+
var inst = tinyMCE.selectedInstance;
|
206 |
+
var formObj = document.forms[0];
|
207 |
+
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
|
208 |
+
|
209 |
+
tinyMCE.tableElm = elm;
|
210 |
+
action = tinyMCE.getWindowArg('action');
|
211 |
+
if (action == null)
|
212 |
+
action = tinyMCE.tableElm ? "update" : "insert";
|
213 |
+
|
214 |
+
if (tinyMCE.tableElm && action != "insert") {
|
215 |
+
var rowsAr = tinyMCE.tableElm.rows;
|
216 |
+
var cols = 0;
|
217 |
+
for (var i=0; i<rowsAr.length; i++)
|
218 |
+
if (rowsAr[i].cells.length > cols)
|
219 |
+
cols = rowsAr[i].cells.length;
|
220 |
+
|
221 |
+
cols = cols;
|
222 |
+
rows = rowsAr.length;
|
223 |
+
|
224 |
+
st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style"));
|
225 |
+
border = trimSize(getStyle(elm, 'border', 'borderWidth'));
|
226 |
+
cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', "");
|
227 |
+
cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', "");
|
228 |
+
width = trimSize(getStyle(elm, 'width', 'width'));
|
229 |
+
height = trimSize(getStyle(elm, 'height', 'height'));
|
230 |
+
bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
|
231 |
+
bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
|
232 |
+
align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align);
|
233 |
+
className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false);
|
234 |
+
id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id');
|
235 |
+
summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary');
|
236 |
+
style = tinyMCE.serializeStyle(st);
|
237 |
+
dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
|
238 |
+
lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
|
239 |
+
background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
240 |
+
formObj.caption.checked = tinyMCE.tableElm.getElementsByTagName('caption').length > 0;
|
241 |
+
|
242 |
+
orgTableWidth = width;
|
243 |
+
orgTableHeight = height;
|
244 |
+
|
245 |
+
action = "update";
|
246 |
+
}
|
247 |
+
|
248 |
+
addClassesToList('class', "table_styles");
|
249 |
+
|
250 |
+
// Update form
|
251 |
+
selectByValue(formObj, 'align', align);
|
252 |
+
selectByValue(formObj, 'class', className);
|
253 |
+
formObj.cols.value = cols;
|
254 |
+
formObj.rows.value = rows;
|
255 |
+
formObj.border.value = border;
|
256 |
+
formObj.cellpadding.value = cellpadding;
|
257 |
+
formObj.cellspacing.value = cellspacing;
|
258 |
+
formObj.width.value = width;
|
259 |
+
formObj.height.value = height;
|
260 |
+
formObj.bordercolor.value = bordercolor;
|
261 |
+
formObj.bgcolor.value = bgcolor;
|
262 |
+
formObj.id.value = id;
|
263 |
+
formObj.summary.value = summary;
|
264 |
+
formObj.style.value = style;
|
265 |
+
formObj.dir.value = dir;
|
266 |
+
formObj.lang.value = lang;
|
267 |
+
formObj.backgroundimage.value = background;
|
268 |
+
formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
|
269 |
+
|
270 |
+
updateColor('bordercolor_pick', 'bordercolor');
|
271 |
+
updateColor('bgcolor_pick', 'bgcolor');
|
272 |
+
|
273 |
+
// Resize some elements
|
274 |
+
if (isVisible('backgroundimagebrowser'))
|
275 |
+
document.getElementById('backgroundimage').style.width = '180px';
|
276 |
+
|
277 |
+
// Disable some fields in update mode
|
278 |
+
if (action == "update") {
|
279 |
+
formObj.cols.disabled = true;
|
280 |
+
formObj.rows.disabled = true;
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
function changedSize() {
|
285 |
+
var formObj = document.forms[0];
|
286 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
287 |
+
|
288 |
+
var width = formObj.width.value;
|
289 |
+
if (width != "")
|
290 |
+
st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : "";
|
291 |
+
else
|
292 |
+
st['width'] = "";
|
293 |
+
|
294 |
+
var height = formObj.height.value;
|
295 |
+
if (height != "")
|
296 |
+
st['height'] = getCSSSize(height);
|
297 |
+
else
|
298 |
+
st['height'] = "";
|
299 |
+
|
300 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
301 |
+
}
|
302 |
+
|
303 |
+
function changedBackgroundImage() {
|
304 |
+
var formObj = document.forms[0];
|
305 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
306 |
+
|
307 |
+
st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
|
308 |
+
|
309 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
310 |
+
}
|
311 |
+
|
312 |
+
function changedBorder() {
|
313 |
+
var formObj = document.forms[0];
|
314 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
315 |
+
|
316 |
+
// Update border width if the element has a color
|
317 |
+
if (formObj.border.value != "" && formObj.bordercolor.value != "")
|
318 |
+
st['border-width'] = formObj.border.value + "px";
|
319 |
+
|
320 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
321 |
+
}
|
322 |
+
|
323 |
+
function changedColor() {
|
324 |
+
var formObj = document.forms[0];
|
325 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
326 |
+
|
327 |
+
st['background-color'] = formObj.bgcolor.value;
|
328 |
+
|
329 |
+
if (formObj.bordercolor.value != "") {
|
330 |
+
st['border-color'] = formObj.bordercolor.value;
|
331 |
+
|
332 |
+
// Add border-width if it's missing
|
333 |
+
if (!st['border-width'])
|
334 |
+
st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
|
335 |
+
}
|
336 |
+
|
337 |
+
formObj.style.value = tinyMCE.serializeStyle(st);
|
338 |
+
}
|
339 |
+
|
340 |
+
function changedStyle() {
|
341 |
+
var formObj = document.forms[0];
|
342 |
+
var st = tinyMCE.parseStyle(formObj.style.value);
|
343 |
+
|
344 |
+
if (st['background-image'])
|
345 |
+
formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
|
346 |
+
else
|
347 |
+
formObj.backgroundimage.value = '';
|
348 |
+
|
349 |
+
if (st['width'])
|
350 |
+
formObj.width.value = trimSize(st['width']);
|
351 |
+
|
352 |
+
if (st['height'])
|
353 |
+
formObj.height.value = trimSize(st['height']);
|
354 |
+
|
355 |
+
if (st['background-color']) {
|
356 |
+
formObj.bgcolor.value = st['background-color'];
|
357 |
+
updateColor('bgcolor_pick','bgcolor');
|
358 |
+
}
|
359 |
+
|
360 |
+
if (st['border-color']) {
|
361 |
+
formObj.bordercolor.value = st['border-color'];
|
362 |
+
updateColor('bordercolor_pick','bordercolor');
|
363 |
+
}
|
364 |
+
}
|
upload_to_tinymce_directory/plugins/table/langs/en.js
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('table',{
|
4 |
+
general_tab : 'General',
|
5 |
+
advanced_tab : 'Advanced',
|
6 |
+
general_props : 'General properties',
|
7 |
+
advanced_props : 'Advanced properties',
|
8 |
+
desc : 'Inserts a new table',
|
9 |
+
row_before_desc : 'Insert row before',
|
10 |
+
row_after_desc : 'Insert row after',
|
11 |
+
delete_row_desc : 'Delete row',
|
12 |
+
col_before_desc : 'Insert column before',
|
13 |
+
col_after_desc : 'Insert column after',
|
14 |
+
delete_col_desc : 'Remove column',
|
15 |
+
rowtype : 'Row in table part',
|
16 |
+
title : 'Insert/Modify table',
|
17 |
+
width : 'Width',
|
18 |
+
height : 'Height',
|
19 |
+
cols : 'Columns',
|
20 |
+
rows : 'Rows',
|
21 |
+
cellspacing : 'Cellspacing',
|
22 |
+
cellpadding : 'Cellpadding',
|
23 |
+
border : 'Border',
|
24 |
+
align : 'Alignment',
|
25 |
+
align_default : 'Default',
|
26 |
+
align_left : 'Left',
|
27 |
+
align_right : 'Right',
|
28 |
+
align_middle : 'Center',
|
29 |
+
row_title : 'Table row properties',
|
30 |
+
cell_title : 'Table cell properties',
|
31 |
+
cell_type : 'Cell type',
|
32 |
+
row_desc : 'Table row properties',
|
33 |
+
cell_desc : 'Table cell properties',
|
34 |
+
valign : 'Vertical alignment',
|
35 |
+
align_top : 'Top',
|
36 |
+
align_bottom : 'Bottom',
|
37 |
+
props_desc : 'Table properties',
|
38 |
+
bordercolor : 'Border color',
|
39 |
+
bgcolor : 'Background color',
|
40 |
+
merge_cells_title : 'Merge table cells',
|
41 |
+
split_cells_desc : 'Split merged table cells',
|
42 |
+
merge_cells_desc : 'Merge table cells',
|
43 |
+
cut_row_desc : 'Cut table row',
|
44 |
+
copy_row_desc : 'Copy table row',
|
45 |
+
paste_row_before_desc : 'Paste table row before',
|
46 |
+
paste_row_after_desc : 'Paste table row after',
|
47 |
+
id : 'Id',
|
48 |
+
style: 'Style',
|
49 |
+
langdir : 'Language direction',
|
50 |
+
langcode : 'Language code',
|
51 |
+
mime : 'Target MIME type',
|
52 |
+
ltr : 'Left to right',
|
53 |
+
rtl : 'Right to left',
|
54 |
+
bgimage : 'Background image',
|
55 |
+
summary : 'Summary',
|
56 |
+
td : "Data",
|
57 |
+
th : "Header",
|
58 |
+
cell_cell : 'Update current cell',
|
59 |
+
cell_row : 'Update all cells in row',
|
60 |
+
cell_all : 'Update all cells in table',
|
61 |
+
row_row : 'Update current row',
|
62 |
+
row_odd : 'Update odd rows in table',
|
63 |
+
row_even : 'Update even rows in table',
|
64 |
+
row_all : 'Update all rows in table',
|
65 |
+
thead : 'Table Head',
|
66 |
+
tbody : 'Table Body',
|
67 |
+
tfoot : 'Table Foot',
|
68 |
+
del : 'Delete table',
|
69 |
+
scope : 'Scope',
|
70 |
+
row : 'Row',
|
71 |
+
col : 'Col',
|
72 |
+
rowgroup : 'Row Group',
|
73 |
+
colgroup : 'Col Group',
|
74 |
+
col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
|
75 |
+
row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
|
76 |
+
cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
|
77 |
+
missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.',
|
78 |
+
caption : 'Table caption'
|
79 |
+
});
|
upload_to_tinymce_directory/plugins/table/merge_cells.htm
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_table_merge_cells_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
|
8 |
+
<base target="_self" />
|
9 |
+
</head>
|
10 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 8px" style="display: none">
|
11 |
+
<form onsubmit="insertTable();return false;" action="#">
|
12 |
+
<fieldset>
|
13 |
+
<legend>{$lang_table_merge_cells_title}</legend>
|
14 |
+
<table border="0" cellpadding="0" cellspacing="3" width="100%">
|
15 |
+
<tr>
|
16 |
+
<td>{$lang_table_cols}:</td>
|
17 |
+
<td align="right"><input type="text" name="numcols" value="" class="number min1" style="width: 30px" /></td>
|
18 |
+
<td>
|
19 |
+
</tr>
|
20 |
+
<tr>
|
21 |
+
<td>{$lang_table_rows}:</td>
|
22 |
+
<td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td>
|
23 |
+
</tr>
|
24 |
+
</table>
|
25 |
+
</fieldset>
|
26 |
+
|
27 |
+
<div class="mceActionPanel">
|
28 |
+
<div style="float: left">
|
29 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="mergeCells();" />
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<div style="float: right">
|
33 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</form>
|
37 |
+
</body>
|
38 |
+
</html>
|
upload_to_tinymce_directory/plugins/table/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Check the TinyMCE documentation for details on this plugin.
|
upload_to_tinymce_directory/plugins/table/row.htm
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_table_row_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="jscripts/row.js"></script>
|
8 |
+
<link href="css/row.css" rel="stylesheet" type="text/css" />
|
9 |
+
<base target="_self" />
|
10 |
+
</head>
|
11 |
+
<body id="tablerow" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
12 |
+
<form onsubmit="updateAction();return false;">
|
13 |
+
<div class="tabs">
|
14 |
+
<ul>
|
15 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
|
16 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
|
17 |
+
</ul>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
<div class="panel_wrapper">
|
21 |
+
<div id="general_panel" class="panel current">
|
22 |
+
<fieldset>
|
23 |
+
<legend>{$lang_table_general_props}</legend>
|
24 |
+
|
25 |
+
<table border="0" cellpadding="4" cellspacing="0">
|
26 |
+
<tr>
|
27 |
+
<td><label for="rowtype">{$lang_table_rowtype}</label></td>
|
28 |
+
<td class="col2">
|
29 |
+
<select id="rowtype" name="rowtype">
|
30 |
+
<option value="thead">{$lang_table_thead}</option>
|
31 |
+
<option value="tbody">{$lang_table_tbody}</option>
|
32 |
+
<option value="tfoot">{$lang_table_tfoot}</option>
|
33 |
+
</select>
|
34 |
+
</td>
|
35 |
+
</tr>
|
36 |
+
|
37 |
+
<tr>
|
38 |
+
<td><label for="align">{$lang_table_align}</label></td>
|
39 |
+
<td class="col2">
|
40 |
+
<select id="align" name="align">
|
41 |
+
<option value="">{$lang_not_set}</option>
|
42 |
+
<option value="center">{$lang_table_align_middle}</option>
|
43 |
+
<option value="left">{$lang_table_align_left}</option>
|
44 |
+
<option value="right">{$lang_table_align_right}</option>
|
45 |
+
</select>
|
46 |
+
</td>
|
47 |
+
</tr>
|
48 |
+
|
49 |
+
<tr>
|
50 |
+
<td><label for="valign">{$lang_table_valign}</label></td>
|
51 |
+
<td class="col2">
|
52 |
+
<select id="valign" name="valign">
|
53 |
+
<option value="">{$lang_not_set}</option>
|
54 |
+
<option value="top">{$lang_table_align_top}</option>
|
55 |
+
<option value="middle">{$lang_table_align_middle}</option>
|
56 |
+
<option value="bottom">{$lang_table_align_bottom}</option>
|
57 |
+
</select>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
|
61 |
+
<tr id="styleSelectRow">
|
62 |
+
<td><label for="class">{$lang_class_name}</label></td>
|
63 |
+
<td class="col2">
|
64 |
+
<select id="class" name="class">
|
65 |
+
<option value="" selected="selected">{$lang_not_set}</option>
|
66 |
+
</select>
|
67 |
+
</td>
|
68 |
+
</tr>
|
69 |
+
|
70 |
+
<tr>
|
71 |
+
<td><label for="height">{$lang_table_height}</label></td>
|
72 |
+
<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
|
73 |
+
</tr>
|
74 |
+
</table>
|
75 |
+
</fieldset>
|
76 |
+
</div>
|
77 |
+
|
78 |
+
<div id="advanced_panel" class="panel">
|
79 |
+
<fieldset>
|
80 |
+
<legend>{$lang_table_advanced_props}</legend>
|
81 |
+
|
82 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
83 |
+
<tr>
|
84 |
+
<td class="column1"><label for="id">{$lang_table_id}</label></td>
|
85 |
+
<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td>
|
86 |
+
</tr>
|
87 |
+
|
88 |
+
<tr>
|
89 |
+
<td><label for="style">{$lang_table_style}</label></td>
|
90 |
+
<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
|
91 |
+
</tr>
|
92 |
+
|
93 |
+
<tr>
|
94 |
+
<td class="column1"><label for="dir">{$lang_table_langdir}</label></td>
|
95 |
+
<td>
|
96 |
+
<select id="dir" name="dir" style="width: 200px">
|
97 |
+
<option value="">{$lang_not_set}</option>
|
98 |
+
<option value="ltr">{$lang_table_ltr}</option>
|
99 |
+
<option value="rtl">{$lang_table_rtl}</option>
|
100 |
+
</select>
|
101 |
+
</td>
|
102 |
+
</tr>
|
103 |
+
|
104 |
+
<tr>
|
105 |
+
<td class="column1"><label for="lang">{$lang_table_langcode}</label></td>
|
106 |
+
<td>
|
107 |
+
<input id="lang" name="lang" type="text" value="" style="width: 200px" />
|
108 |
+
</td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td>
|
113 |
+
<td>
|
114 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
115 |
+
<tr>
|
116 |
+
<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
|
117 |
+
<td id="backgroundimagebrowsercontainer"> </td>
|
118 |
+
</tr>
|
119 |
+
</table>
|
120 |
+
</td>
|
121 |
+
</tr>
|
122 |
+
|
123 |
+
<tr>
|
124 |
+
<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td>
|
125 |
+
<td>
|
126 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
127 |
+
<tr>
|
128 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
|
129 |
+
<td id="bgcolor_pickcontainer"> </td>
|
130 |
+
</tr>
|
131 |
+
</table>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
+
</table>
|
135 |
+
</fieldset>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<div class="mceActionPanel">
|
140 |
+
<div>
|
141 |
+
<select id="action" name="action">
|
142 |
+
<option value="row">{$lang_table_row_row}</option>
|
143 |
+
<option value="odd">{$lang_table_row_odd}</option>
|
144 |
+
<option value="even">{$lang_table_row_even}</option>
|
145 |
+
<option value="all">{$lang_table_row_all}</option>
|
146 |
+
</select>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div style="float: left">
|
150 |
+
<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
<div style="float: right">
|
154 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
</form>
|
158 |
+
</body>
|
159 |
+
</html>
|
upload_to_tinymce_directory/plugins/table/table.htm
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_table_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
|
9 |
+
<link href="css/table.css" rel="stylesheet" type="text/css" />
|
10 |
+
<base target="_self" />
|
11 |
+
</head>
|
12 |
+
<body id="table" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
13 |
+
<form onsubmit="insertTable();return false;" action="#">
|
14 |
+
<div class="tabs">
|
15 |
+
<ul>
|
16 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
|
17 |
+
<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
|
18 |
+
</ul>
|
19 |
+
</div>
|
20 |
+
|
21 |
+
<div class="panel_wrapper">
|
22 |
+
<div id="general_panel" class="panel current">
|
23 |
+
<fieldset>
|
24 |
+
<legend>{$lang_table_general_props}</legend>
|
25 |
+
|
26 |
+
<table border="0" cellpadding="4" cellspacing="0" width="100%">
|
27 |
+
<tr>
|
28 |
+
<td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
|
29 |
+
<td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
|
30 |
+
<td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
|
31 |
+
<td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td>
|
32 |
+
</tr>
|
33 |
+
<tr>
|
34 |
+
<td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
|
35 |
+
<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td>
|
36 |
+
<td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
|
37 |
+
<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td>
|
38 |
+
</tr>
|
39 |
+
<tr>
|
40 |
+
<td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
|
41 |
+
<td><select id="align" name="align">
|
42 |
+
<option value="">{$lang_not_set}</option>
|
43 |
+
<option value="center">{$lang_table_align_middle}</option>
|
44 |
+
<option value="left">{$lang_table_align_left}</option>
|
45 |
+
<option value="right">{$lang_table_align_right}</option>
|
46 |
+
</select></td>
|
47 |
+
<td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
|
48 |
+
<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td>
|
49 |
+
</tr>
|
50 |
+
<tr id="width_row">
|
51 |
+
<td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
|
52 |
+
<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
|
53 |
+
<td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
|
54 |
+
<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td>
|
55 |
+
</tr>
|
56 |
+
<tr id="styleSelectRow">
|
57 |
+
<td><label id="classlabel" for="class">{$lang_class_name}</label></td>
|
58 |
+
<td colspan="3">
|
59 |
+
<select id="class" name="class">
|
60 |
+
<option value="" selected>{$lang_not_set}</option>
|
61 |
+
</select></td>
|
62 |
+
</tr>
|
63 |
+
<tr>
|
64 |
+
<td class="column1"><label for="caption">{$lang_table_caption}</label></td>
|
65 |
+
<td><input id="caption" name="caption" type="checkbox" value="true" /></td>
|
66 |
+
</tr>
|
67 |
+
</table>
|
68 |
+
</fieldset>
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<div id="advanced_panel" class="panel">
|
72 |
+
<fieldset>
|
73 |
+
<legend>{$lang_table_advanced_props}</legend>
|
74 |
+
|
75 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
76 |
+
<tr>
|
77 |
+
<td class="column1"><label for="id">{$lang_table_id}</label></td>
|
78 |
+
<td><input id="id" name="id" type="text" value="" class="advfield" /></td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<tr>
|
82 |
+
<td class="column1"><label for="summary">{$lang_table_summary}</label></td>
|
83 |
+
<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
<tr>
|
87 |
+
<td><label for="style">{$lang_table_style}</label></td>
|
88 |
+
<td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
|
89 |
+
</tr>
|
90 |
+
|
91 |
+
<tr>
|
92 |
+
<td class="column1"><label for="dir">{$lang_table_langdir}</label></td>
|
93 |
+
<td>
|
94 |
+
<select id="dir" name="dir" class="advfield">
|
95 |
+
<option value="">{$lang_not_set}</option>
|
96 |
+
<option value="ltr">{$lang_table_ltr}</option>
|
97 |
+
<option value="rtl">{$lang_table_rtl}</option>
|
98 |
+
</select>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
+
|
102 |
+
<tr>
|
103 |
+
<td class="column1"><label id="langlabel" for="lang">{$lang_table_langcode}</label></td>
|
104 |
+
<td>
|
105 |
+
<input id="lang" name="lang" type="text" value="" class="advfield" />
|
106 |
+
</td>
|
107 |
+
</tr>
|
108 |
+
|
109 |
+
<tr>
|
110 |
+
<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td>
|
111 |
+
<td>
|
112 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
113 |
+
<tr>
|
114 |
+
<td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
|
115 |
+
<td id="backgroundimagebrowsercontainer"> </td>
|
116 |
+
</tr>
|
117 |
+
</table>
|
118 |
+
</td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td>
|
123 |
+
<td>
|
124 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
125 |
+
<tr>
|
126 |
+
<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
|
127 |
+
<td id="bordercolor_pickcontainer"> </td>
|
128 |
+
</tr>
|
129 |
+
</table>
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
|
133 |
+
<tr>
|
134 |
+
<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td>
|
135 |
+
<td>
|
136 |
+
<table border="0" cellpadding="0" cellspacing="0">
|
137 |
+
<tr>
|
138 |
+
<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
|
139 |
+
<td id="bgcolor_pickcontainer"> </td>
|
140 |
+
</tr>
|
141 |
+
</table>
|
142 |
+
</td>
|
143 |
+
</tr>
|
144 |
+
</table>
|
145 |
+
</fieldset>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div class="mceActionPanel">
|
150 |
+
<div style="float: left">
|
151 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertTable();" />
|
152 |
+
</div>
|
153 |
+
|
154 |
+
<div style="float: right">
|
155 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
156 |
+
</div>
|
157 |
+
</div>
|
158 |
+
</form>
|
159 |
+
</body>
|
160 |
+
</html>
|
upload_to_tinymce_directory/plugins/visualchars/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('visualchars');var TinyMCE_VisualCharsPlugin={getInfo:function(){return{longname:'Visual characters',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){inst.visualChars={state:false}},getControlHTML:function(cn){switch(cn){case"visualchars":return tinyMCE.getButtonHTML(cn,'lang_visualchars_desc','{$pluginurl}/images/visualchars.gif','mceVisualChars',false)}return""},execCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);switch(command){case"mceVisualChars":this._toggleVisualChars(editor_id,inst);return true}return false},cleanup:function(type,content,inst){if(type=="insert_to_editor_dom"||type=="get_from_editor_dom"){inst.visualChars.state=true;this._toggleVisualChars(inst.editorId,inst)}return content},_toggleVisualChars:function(editor_id,inst){var nl,i,h,d=inst.getDoc(),b=inst.getBody(),nv,s=inst.selection,bo;inst.visualChars.state=!inst.visualChars.state;bo=s.getBookmark(true);tinyMCE.switchClass(editor_id+'_visualchars',inst.visualChars.state?'mceButtonSelected':'mceButtonNormal');if(inst.visualChars.state){nl=tinyMCE.selectNodes(b,function(n){return n.nodeType==3&&n.nodeValue&&n.nodeValue.indexOf('\u00a0')!=-1});for(i=0;i<nl.length;i++){nv=nl[i].nodeValue;nv=nv.replace(/(\u00a0+)/g,'<span class="mceItemHiddenVisualChar">$1</span>');nv=nv.replace(/\u00a0/g,'\u00b7');tinyMCE.setOuterHTML(nl[i],nv,d)}}else{nl=tinyMCE.selectNodes(b,function(n){return n.nodeType==1&&n.nodeName=='SPAN'&&n.className=='mceItemHiddenVisualChar'});for(i=0;i<nl.length;i++)tinyMCE.setOuterHTML(nl[i],nl[i].innerHTML.replace(/(·|\u00b7)/g,' '),d)}}};tinyMCE.addPlugin("visualchars",TinyMCE_VisualCharsPlugin);
|
upload_to_tinymce_directory/plugins/visualchars/editor_plugin_src.js
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('visualchars');
|
10 |
+
|
11 |
+
var TinyMCE_VisualCharsPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'Visual characters',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
inst.visualChars = {
|
24 |
+
state : false
|
25 |
+
};
|
26 |
+
},
|
27 |
+
|
28 |
+
getControlHTML : function(cn) {
|
29 |
+
switch (cn) {
|
30 |
+
case "visualchars":
|
31 |
+
return tinyMCE.getButtonHTML(cn, 'lang_visualchars_desc', '{$pluginurl}/images/visualchars.gif', 'mceVisualChars', false);
|
32 |
+
}
|
33 |
+
|
34 |
+
return "";
|
35 |
+
},
|
36 |
+
|
37 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
38 |
+
var inst = tinyMCE.getInstanceById(editor_id);
|
39 |
+
|
40 |
+
switch (command) {
|
41 |
+
case "mceVisualChars":
|
42 |
+
this._toggleVisualChars(editor_id, inst);
|
43 |
+
return true;
|
44 |
+
}
|
45 |
+
|
46 |
+
return false;
|
47 |
+
},
|
48 |
+
|
49 |
+
cleanup : function(type, content, inst) {
|
50 |
+
if (type == "insert_to_editor_dom" || type == "get_from_editor_dom") {
|
51 |
+
inst.visualChars.state = true;
|
52 |
+
this._toggleVisualChars(inst.editorId, inst);
|
53 |
+
}
|
54 |
+
|
55 |
+
return content;
|
56 |
+
},
|
57 |
+
|
58 |
+
// Private plugin internal methods
|
59 |
+
|
60 |
+
_toggleVisualChars : function(editor_id, inst) {
|
61 |
+
var nl, i, h, d = inst.getDoc(), b = inst.getBody(), nv, s = inst.selection, bo;
|
62 |
+
|
63 |
+
inst.visualChars.state = !inst.visualChars.state;
|
64 |
+
|
65 |
+
bo = s.getBookmark(true);
|
66 |
+
|
67 |
+
tinyMCE.switchClass(editor_id + '_visualchars', inst.visualChars.state ? 'mceButtonSelected' : 'mceButtonNormal');
|
68 |
+
|
69 |
+
if (inst.visualChars.state) {
|
70 |
+
nl = tinyMCE.selectNodes(b, function(n) {return n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1;});
|
71 |
+
|
72 |
+
for (i=0; i<nl.length; i++) {
|
73 |
+
nv = nl[i].nodeValue;
|
74 |
+
nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHiddenVisualChar">$1</span>');
|
75 |
+
nv = nv.replace(/\u00a0/g, '\u00b7');
|
76 |
+
tinyMCE.setOuterHTML(nl[i], nv, d);
|
77 |
+
}
|
78 |
+
} else {
|
79 |
+
nl = tinyMCE.selectNodes(b, function(n) {return n.nodeType == 1 && n.nodeName == 'SPAN' && n.className == 'mceItemHiddenVisualChar';});
|
80 |
+
|
81 |
+
for (i=0; i<nl.length; i++)
|
82 |
+
tinyMCE.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(·|\u00b7)/g, ' '), d);
|
83 |
+
}
|
84 |
+
|
85 |
+
//s.moveToBookmark(bo);
|
86 |
+
}
|
87 |
+
};
|
88 |
+
|
89 |
+
tinyMCE.addPlugin("visualchars", TinyMCE_VisualCharsPlugin);
|
upload_to_tinymce_directory/plugins/visualchars/images/visualchars.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/visualchars/langs/en.js
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// EN lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('visualchars',{
|
4 |
+
desc : 'Visual control characters on/off.'
|
5 |
+
});
|
upload_to_tinymce_directory/plugins/xhtmlxtras/abbr.htm
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_title_abbr_element}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/element_common.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/abbr.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertAbbr();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_general_tab}</a></span></li>
|
18 |
+
<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_events_tab}</a></span></li> -->
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_xhtmlxtras_fieldset_attrib_tab}</legend>
|
26 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
29 |
+
<td><input id="title" name="title" type="text" value="" class="field" /></td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
33 |
+
<td><input id="id" name="id" type="text" value="" class="field" /></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td class="label"><label id="classlabel" for="class">{$lang_xhtmlxtras_attribute_label_class}</label>:</td>
|
37 |
+
<td>
|
38 |
+
<select id="class" name="class" class="field mceEditableSelect">
|
39 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
40 |
+
</select>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
45 |
+
<td><input id="style" name="style" type="text" value="" class="field" /></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
49 |
+
<td>
|
50 |
+
<select id="dir" name="dir" class="field">
|
51 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
52 |
+
<option value="ltr">{$lang_xhtmlxtras_attribute_option_ltr}</option>
|
53 |
+
<option value="rtl">{$lang_xhtmlxtras_attribute_option_rtl}</option>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
59 |
+
<td>
|
60 |
+
<input id="lang" name="lang" type="text" value="" class="field" />
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
</fieldset>
|
65 |
+
</div>
|
66 |
+
<div id="events_panel" class="panel">
|
67 |
+
<fieldset>
|
68 |
+
<legend>{$lang_xhtmlxtras_fieldset_events_tab}</legend>
|
69 |
+
|
70 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
71 |
+
<tr>
|
72 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
73 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
|
74 |
+
</tr>
|
75 |
+
|
76 |
+
<tr>
|
77 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
78 |
+
<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<tr>
|
82 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
83 |
+
<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
<tr>
|
87 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
88 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
|
89 |
+
</tr>
|
90 |
+
|
91 |
+
<tr>
|
92 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
93 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
|
94 |
+
</tr>
|
95 |
+
|
96 |
+
<tr>
|
97 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
98 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr>
|
102 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
103 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
108 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
113 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
118 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
123 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
128 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
|
129 |
+
</tr>
|
130 |
+
</table>
|
131 |
+
</fieldset>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="mceActionPanel">
|
135 |
+
<div style="float: left">
|
136 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertAbbr();" />
|
137 |
+
</div>
|
138 |
+
<div style="float: left">
|
139 |
+
<input type="button" id="remove" name="remove" value="{$lang_xhtmlxtras_remove}" onclick="removeAbbr();" style="display: none;" />
|
140 |
+
</div>
|
141 |
+
<div style="float: right">
|
142 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
</form>
|
147 |
+
</body>
|
148 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/acronym.htm
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_title_acronym_element}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/element_common.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/acronym.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertAcronym();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_general_tab}</a></span></li>
|
18 |
+
<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_events_tab}</a></span></li> -->
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_xhtmlxtras_fieldset_attrib_tab}</legend>
|
26 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
29 |
+
<td><input id="title" name="title" type="text" value="" class="field" /></td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
33 |
+
<td><input id="id" name="id" type="text" value="" class="field" /></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td class="label"><label id="classlabel" for="class">{$lang_xhtmlxtras_attribute_label_class}</label>:</td>
|
37 |
+
<td>
|
38 |
+
<select id="class" name="class" class="field mceEditableSelect">
|
39 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
40 |
+
</select>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
45 |
+
<td><input id="style" name="style" type="text" value="" class="field" /></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
49 |
+
<td>
|
50 |
+
<select id="dir" name="dir" class="field">
|
51 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
52 |
+
<option value="ltr">{$lang_xhtmlxtras_attribute_option_ltr}</option>
|
53 |
+
<option value="rtl">{$lang_xhtmlxtras_attribute_option_rtl}</option>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
59 |
+
<td>
|
60 |
+
<input id="lang" name="lang" type="text" value="" class="field" />
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
</fieldset>
|
65 |
+
</div>
|
66 |
+
<div id="events_panel" class="panel">
|
67 |
+
<fieldset>
|
68 |
+
<legend>{$lang_xhtmlxtras_fieldset_events_tab}</legend>
|
69 |
+
|
70 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
71 |
+
<tr>
|
72 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
73 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
|
74 |
+
</tr>
|
75 |
+
|
76 |
+
<tr>
|
77 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
78 |
+
<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<tr>
|
82 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
83 |
+
<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
<tr>
|
87 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
88 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
|
89 |
+
</tr>
|
90 |
+
|
91 |
+
<tr>
|
92 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
93 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
|
94 |
+
</tr>
|
95 |
+
|
96 |
+
<tr>
|
97 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
98 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr>
|
102 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
103 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
108 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
113 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
118 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
123 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
128 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
|
129 |
+
</tr>
|
130 |
+
</table>
|
131 |
+
</fieldset>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="mceActionPanel">
|
135 |
+
<div style="float: left">
|
136 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertAcronym();" />
|
137 |
+
</div>
|
138 |
+
<div style="float: left">
|
139 |
+
<input type="button" id="remove" name="remove" value="{$lang_xhtmlxtras_remove}" onclick="removeAcronym();" style="display: none;" />
|
140 |
+
</div>
|
141 |
+
<div style="float: right">
|
142 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
</form>
|
147 |
+
</body>
|
148 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/attributes.htm
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_attribs_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/attributes.js"></script>
|
9 |
+
<link rel="stylesheet" type="text/css" href="css/attributes.css" />
|
10 |
+
<base target="_self" />
|
11 |
+
</head>
|
12 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
13 |
+
<form onsubmit="insertAction();return false;" action="#">
|
14 |
+
<div class="tabs">
|
15 |
+
<ul>
|
16 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_attribute_attrib_tab}</a></span></li>
|
17 |
+
<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_attribute_events_tab}</a></span></li>
|
18 |
+
</ul>
|
19 |
+
</div>
|
20 |
+
|
21 |
+
<div class="panel_wrapper">
|
22 |
+
<div id="general_panel" class="panel current">
|
23 |
+
<fieldset>
|
24 |
+
<legend>{$lang_xhtmlxtras_attribute_attrib_tab}</legend>
|
25 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
26 |
+
<tr>
|
27 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
28 |
+
<td><input id="title" name="title" type="text" value="" /></td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
32 |
+
<td><input id="id" name="id" type="text" value="" /></td>
|
33 |
+
</tr>
|
34 |
+
<tr>
|
35 |
+
<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
|
36 |
+
<td>
|
37 |
+
<select id="classlist" name="classlist" class="mceEditableSelect">
|
38 |
+
<option value="" selected>{$lang_not_set}</option>
|
39 |
+
</select>
|
40 |
+
</td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
44 |
+
<td><input id="style" name="style" type="text" value="" /></td>
|
45 |
+
</tr>
|
46 |
+
<tr>
|
47 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
48 |
+
<td>
|
49 |
+
<select id="dir" name="dir">
|
50 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
51 |
+
<option value="ltr">{$lang_xhtmlxtras_option_ltr}</option>
|
52 |
+
<option value="rtl">{$lang_xhtmlxtras_option_rtl}</option>
|
53 |
+
</select>
|
54 |
+
</td>
|
55 |
+
</tr>
|
56 |
+
<tr>
|
57 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
58 |
+
<td>
|
59 |
+
<input id="lang" name="lang" type="text" value="" />
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
<tr>
|
63 |
+
<td><label id="tabindexlabel" for="tabindex">{$lang_xhtmlxtras_attribute_label_tabindex}</label></td>
|
64 |
+
<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
|
65 |
+
</tr>
|
66 |
+
|
67 |
+
<tr>
|
68 |
+
<td><label id="accesskeylabel" for="accesskey">{$lang_xhtmlxtras_attribute_label_accesskey}</label></td>
|
69 |
+
<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
|
70 |
+
</tr>
|
71 |
+
</table>
|
72 |
+
</fieldset>
|
73 |
+
</div>
|
74 |
+
<div id="events_panel" class="panel">
|
75 |
+
<fieldset>
|
76 |
+
<legend>{$lang_xhtmlxtras_attribute_events_tab}</legend>
|
77 |
+
|
78 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
79 |
+
<tr>
|
80 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
81 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" /></td>
|
82 |
+
</tr>
|
83 |
+
|
84 |
+
<tr>
|
85 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
86 |
+
<td><input id="onblur" name="onblur" type="text" value="" /></td>
|
87 |
+
</tr>
|
88 |
+
|
89 |
+
<tr>
|
90 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
91 |
+
<td><input id="onclick" name="onclick" type="text" value="" /></td>
|
92 |
+
</tr>
|
93 |
+
|
94 |
+
<tr>
|
95 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
96 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td>
|
97 |
+
</tr>
|
98 |
+
|
99 |
+
<tr>
|
100 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
101 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td>
|
102 |
+
</tr>
|
103 |
+
|
104 |
+
<tr>
|
105 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
106 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td>
|
107 |
+
</tr>
|
108 |
+
|
109 |
+
<tr>
|
110 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
111 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td>
|
112 |
+
</tr>
|
113 |
+
|
114 |
+
<tr>
|
115 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
116 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td>
|
117 |
+
</tr>
|
118 |
+
|
119 |
+
<tr>
|
120 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
121 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td>
|
122 |
+
</tr>
|
123 |
+
|
124 |
+
<tr>
|
125 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
126 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td>
|
127 |
+
</tr>
|
128 |
+
|
129 |
+
<tr>
|
130 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
131 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td>
|
132 |
+
</tr>
|
133 |
+
|
134 |
+
<tr>
|
135 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
136 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td>
|
137 |
+
</tr>
|
138 |
+
</table>
|
139 |
+
</fieldset>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<div class="mceActionPanel">
|
143 |
+
<div style="float: left">
|
144 |
+
<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
|
145 |
+
</div>
|
146 |
+
<div style="float: right">
|
147 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
</form>
|
152 |
+
</body>
|
153 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/cite.htm
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_title_cite_element}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/element_common.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/cite.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertCite();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_general_tab}</a></span></li>
|
18 |
+
<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_events_tab}</a></span></li> -->
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_xhtmlxtras_fieldset_attrib_tab}</legend>
|
26 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
29 |
+
<td><input id="title" name="title" type="text" value="" class="field" /></td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
33 |
+
<td><input id="id" name="id" type="text" value="" class="field" /></td>
|
34 |
+
</tr>
|
35 |
+
<tr>
|
36 |
+
<td class="label"><label id="classlabel" for="class">{$lang_xhtmlxtras_attribute_label_class}</label>:</td>
|
37 |
+
<td>
|
38 |
+
<select id="class" name="class" class="field mceEditableSelect">
|
39 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
40 |
+
</select>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
45 |
+
<td><input id="style" name="style" type="text" value="" class="field" /></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
49 |
+
<td>
|
50 |
+
<select id="dir" name="dir" class="field">
|
51 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
52 |
+
<option value="ltr">{$lang_xhtmlxtras_attribute_option_ltr}</option>
|
53 |
+
<option value="rtl">{$lang_xhtmlxtras_attribute_option_rtl}</option>
|
54 |
+
</select>
|
55 |
+
</td>
|
56 |
+
</tr>
|
57 |
+
<tr>
|
58 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
59 |
+
<td>
|
60 |
+
<input id="lang" name="lang" type="text" value="" class="field" />
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
</fieldset>
|
65 |
+
</div>
|
66 |
+
<div id="events_panel" class="panel">
|
67 |
+
<fieldset>
|
68 |
+
<legend>{$lang_xhtmlxtras_fieldset_events_tab}</legend>
|
69 |
+
|
70 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
71 |
+
<tr>
|
72 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
73 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
|
74 |
+
</tr>
|
75 |
+
|
76 |
+
<tr>
|
77 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
78 |
+
<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
|
79 |
+
</tr>
|
80 |
+
|
81 |
+
<tr>
|
82 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
83 |
+
<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
|
84 |
+
</tr>
|
85 |
+
|
86 |
+
<tr>
|
87 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
88 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
|
89 |
+
</tr>
|
90 |
+
|
91 |
+
<tr>
|
92 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
93 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
|
94 |
+
</tr>
|
95 |
+
|
96 |
+
<tr>
|
97 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
98 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr>
|
102 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
103 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
108 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
113 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
118 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
123 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
128 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
|
129 |
+
</tr>
|
130 |
+
</table>
|
131 |
+
</fieldset>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
<div class="mceActionPanel">
|
135 |
+
<div style="float: left">
|
136 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertCite();" />
|
137 |
+
</div>
|
138 |
+
<div style="float: left">
|
139 |
+
<input type="button" id="remove" name="remove" value="{$lang_xhtmlxtras_remove}" onclick="removeCite();" style="display: none;" />
|
140 |
+
</div>
|
141 |
+
<div style="float: right">
|
142 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
|
146 |
+
</form>
|
147 |
+
</body>
|
148 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/css/attributes.css
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.panel_wrapper div.current {
|
2 |
+
height: 290px;
|
3 |
+
}
|
4 |
+
|
5 |
+
#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey {
|
6 |
+
width: 200px;
|
7 |
+
}
|
8 |
+
|
9 |
+
#events_panel input {
|
10 |
+
width: 200px;
|
11 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/css/popup.css
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
a.mceButtonNormal img, a.mceButtonSelected img {border: 1px solid #F0F0EE !important;}
|
2 |
+
a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {border: 1px solid #0A246A !important; cursor: default; background-color: #B6BDD2;}
|
3 |
+
|
4 |
+
img {
|
5 |
+
border: 0;
|
6 |
+
}
|
7 |
+
|
8 |
+
input.field, select.field {
|
9 |
+
width: 200px;
|
10 |
+
}
|
11 |
+
|
12 |
+
input.picker {
|
13 |
+
width: 179px;
|
14 |
+
margin-left: 5px;
|
15 |
+
}
|
16 |
+
|
17 |
+
input.disabled {
|
18 |
+
border-color: #F2F2F2;
|
19 |
+
}
|
20 |
+
|
21 |
+
img.picker {
|
22 |
+
vertical-align: text-bottom;
|
23 |
+
cursor: pointer;
|
24 |
+
}
|
25 |
+
|
26 |
+
h1 {
|
27 |
+
padding: 0 0 5px 0;
|
28 |
+
}
|
29 |
+
|
30 |
+
#remove {
|
31 |
+
font-weight: bold;
|
32 |
+
width: 90px;
|
33 |
+
height: 21px;
|
34 |
+
border: 0px;
|
35 |
+
background-image: url('../images/remove_button_bg.gif');
|
36 |
+
cursor: pointer;
|
37 |
+
margin-left: 3px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.panel_wrapper div.current {
|
41 |
+
height: 160px;
|
42 |
+
}
|
43 |
+
|
44 |
+
#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {
|
45 |
+
height: 220px;
|
46 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/css/xhtmlxtras.css
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
ins {
|
2 |
+
border-bottom: 1px solid green;
|
3 |
+
text-decoration: none;
|
4 |
+
color: green;
|
5 |
+
}
|
6 |
+
|
7 |
+
del {
|
8 |
+
color: Red;
|
9 |
+
text-decoration: line-through;
|
10 |
+
}
|
11 |
+
|
12 |
+
cite {
|
13 |
+
border-bottom: 1px dashed blue;
|
14 |
+
}
|
15 |
+
|
16 |
+
acronym {
|
17 |
+
border-bottom: 1px dotted #CCC;
|
18 |
+
cursor: help;
|
19 |
+
}
|
20 |
+
|
21 |
+
abbr, html\:abbr {
|
22 |
+
border-bottom: 1px dashed #CCC;
|
23 |
+
cursor: help;
|
24 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/del.htm
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_title_del_element}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/element_common.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/del.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body id="xhtmlxtrasins" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertDel();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_general_tab}</a></span></li>
|
18 |
+
<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_events_tab}</a></span></li> -->
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_xhtmlxtras_fieldset_general_tab}</legend>
|
26 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label id="datetimelabel" for="datetime">{$lang_xhtmlxtras_attribute_label_datetime}</label>:</td>
|
29 |
+
<td>
|
30 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
31 |
+
<tr>
|
32 |
+
<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field" /></td>
|
33 |
+
<td><a href="javascript:insertDateTime('datetime');" class="mceButtonNormal"><img src="images/date_time.gif" class="picker" alt="{$lang_xhtmlxtras_insert_date}" title="{$lang_xhtmlxtras_insert_date}" /></a></td>
|
34 |
+
</tr>
|
35 |
+
</table>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td class="label"><label id="citelabel" for="cite">{$lang_xhtmlxtras_attribute_label_cite}</label>:</td>
|
40 |
+
<td><input id="cite" name="cite" type="text" value="" class="field" /></td>
|
41 |
+
</tr>
|
42 |
+
</table>
|
43 |
+
</fieldset>
|
44 |
+
<fieldset>
|
45 |
+
<legend>{$lang_xhtmlxtras_fieldset_attrib_tab}</legend>
|
46 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
47 |
+
<tr>
|
48 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
49 |
+
<td><input id="title" name="title" type="text" value="" class="field" /></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
53 |
+
<td><input id="id" name="id" type="text" value="" class="field" /></td>
|
54 |
+
</tr>
|
55 |
+
<tr>
|
56 |
+
<td class="label"><label id="classlabel" for="class">{$lang_xhtmlxtras_attribute_label_class}</label>:</td>
|
57 |
+
<td>
|
58 |
+
<select id="class" name="class" class="field mceEditableSelect">
|
59 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
60 |
+
</select>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
<tr>
|
64 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
65 |
+
<td><input id="style" name="style" type="text" value="" class="field" /></td>
|
66 |
+
</tr>
|
67 |
+
<tr>
|
68 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
69 |
+
<td>
|
70 |
+
<select id="dir" name="dir" class="field">
|
71 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
72 |
+
<option value="ltr">{$lang_xhtmlxtras_attribute_option_ltr}</option>
|
73 |
+
<option value="rtl">{$lang_xhtmlxtras_attribute_option_rtl}</option>
|
74 |
+
</select>
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
79 |
+
<td>
|
80 |
+
<input id="lang" name="lang" type="text" value="" class="field" />
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
</table>
|
84 |
+
</fieldset>
|
85 |
+
</div>
|
86 |
+
<div id="events_panel" class="panel">
|
87 |
+
<fieldset>
|
88 |
+
<legend>{$lang_xhtmlxtras_fieldset_events_tab}</legend>
|
89 |
+
|
90 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
91 |
+
<tr>
|
92 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
93 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
|
94 |
+
</tr>
|
95 |
+
|
96 |
+
<tr>
|
97 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
98 |
+
<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr>
|
102 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
103 |
+
<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
108 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
113 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
118 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
123 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
128 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
133 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
|
134 |
+
</tr>
|
135 |
+
|
136 |
+
<tr>
|
137 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
138 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
|
139 |
+
</tr>
|
140 |
+
|
141 |
+
<tr>
|
142 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
143 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
|
144 |
+
</tr>
|
145 |
+
|
146 |
+
<tr>
|
147 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
148 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
|
149 |
+
</tr>
|
150 |
+
</table>
|
151 |
+
</fieldset>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
<div class="mceActionPanel">
|
155 |
+
<div style="float: left">
|
156 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertDel();" />
|
157 |
+
</div>
|
158 |
+
<div style="float: left">
|
159 |
+
<input type="button" id="remove" name="remove" value="{$lang_xhtmlxtras_remove}" onclick="removeDel();" style="display: none;" />
|
160 |
+
</div>
|
161 |
+
<div style="float: right">
|
162 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
</form>
|
167 |
+
|
168 |
+
</body>
|
169 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/editor_plugin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
tinyMCE.importPluginLanguagePack('xhtmlxtras');var TinyMCE_XHTMLXtrasPlugin={getInfo:function(){return{longname:'XHTML Xtras Plugin',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},initInstance:function(inst){tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/xhtmlxtras/css/xhtmlxtras.css")},getControlHTML:function(cn){switch(cn){case"cite":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_cite_desc','{$pluginurl}/images/cite.gif','mceCite',true);case"acronym":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_acronym_desc','{$pluginurl}/images/acronym.gif','mceAcronym',true);case"abbr":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_abbr_desc','{$pluginurl}/images/abbr.gif','mceAbbr',true);case"del":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_del_desc','{$pluginurl}/images/del.gif','mceDel',true);case"ins":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_ins_desc','{$pluginurl}/images/ins.gif','mceIns',true);case"attribs":return tinyMCE.getButtonHTML(cn,'lang_xhtmlxtras_attribs_desc','{$pluginurl}/images/attribs.gif','mceAttributes',true)}return""},execCommand:function(editor_id,element,command,user_interface,value){var template,inst,elm;switch(command){case"mceCite":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/cite.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAcronym":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/acronym.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAbbr":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/abbr.htm';template['width']=350;template['height']=250;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceIns":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/ins.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceDel":if(!this._anySel(editor_id))return true;template=new Array();template['file']='../../plugins/xhtmlxtras/del.htm';template['width']=350;template['height']=310;tinyMCE.openWindow(template,{editor_id:editor_id});return true;case"mceAttributes":inst=tinyMCE.getInstanceById(editor_id);elm=inst.getFocusElement();if(elm&&elm.nodeName!=='BODY'&&elm.className.indexOf('mceItem')==-1){tinyMCE.openWindow({file:'../../plugins/xhtmlxtras/attributes.htm',width:380,height:370},{editor_id:editor_id})}return true}return false},cleanup:function(type,content,inst){if(type=='insert_to_editor'&&tinyMCE.isIE&&!tinyMCE.isOpera){content=content.replace(/<abbr([^>]+)>/gi,'<html:ABBR $1>');content=content.replace(/<\/abbr>/gi,'</html:ABBR>')}return content},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var elm=tinyMCE.getParentElement(node);if(node==null)return;tinyMCE.switchClass(editor_id+'_attribs','mceButtonDisabled');if(!any_selection){tinyMCE.switchClass(editor_id+'_cite','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_acronym','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_abbr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_del','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_ins','mceButtonDisabled')}else{tinyMCE.switchClass(editor_id+'_cite','mceButtonNormal');tinyMCE.switchClass(editor_id+'_acronym','mceButtonNormal');tinyMCE.switchClass(editor_id+'_abbr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_del','mceButtonNormal');tinyMCE.switchClass(editor_id+'_ins','mceButtonNormal')}if(elm&&elm.nodeName!='BODY'&&elm.className.indexOf('mceItem')==-1)tinyMCE.switchClass(editor_id+'_attribs','mceButtonNormal');switch(node.nodeName){case"CITE":tinyMCE.switchClass(editor_id+'_cite','mceButtonSelected');return true;case"ACRONYM":tinyMCE.switchClass(editor_id+'_acronym','mceButtonSelected');return true;case"abbr":case"HTML:ABBR":case"ABBR":tinyMCE.switchClass(editor_id+'_abbr','mceButtonSelected');return true;case"DEL":tinyMCE.switchClass(editor_id+'_del','mceButtonSelected');return true;case"INS":tinyMCE.switchClass(editor_id+'_ins','mceButtonSelected');return true}return true},_anySel:function(editor_id){var inst=tinyMCE.getInstanceById(editor_id),t=inst.selection.getSelectedText(),pe;pe=tinyMCE.getParentElement(inst.getFocusElement(),'CITE,ACRONYM,ABBR,HTML:ABBR,DEL,INS');return pe||inst.getFocusElement().nodeName=="IMG"||(t&&t.length>0)}};tinyMCE.addPlugin("xhtmlxtras",TinyMCE_XHTMLXtrasPlugin);
|
upload_to_tinymce_directory/plugins/xhtmlxtras/editor_plugin_src.js
ADDED
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Import plugin specific language pack */
|
9 |
+
tinyMCE.importPluginLanguagePack('xhtmlxtras');
|
10 |
+
|
11 |
+
var TinyMCE_XHTMLXtrasPlugin = {
|
12 |
+
getInfo : function() {
|
13 |
+
return {
|
14 |
+
longname : 'XHTML Xtras Plugin',
|
15 |
+
author : 'Moxiecode Systems AB',
|
16 |
+
authorurl : 'http://tinymce.moxiecode.com',
|
17 |
+
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras',
|
18 |
+
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
|
19 |
+
};
|
20 |
+
},
|
21 |
+
|
22 |
+
initInstance : function(inst) {
|
23 |
+
tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/xhtmlxtras/css/xhtmlxtras.css");
|
24 |
+
},
|
25 |
+
|
26 |
+
getControlHTML : function(cn) {
|
27 |
+
switch (cn) {
|
28 |
+
case "cite":
|
29 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_cite_desc', '{$pluginurl}/images/cite.gif', 'mceCite', true);
|
30 |
+
|
31 |
+
case "acronym":
|
32 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_acronym_desc', '{$pluginurl}/images/acronym.gif', 'mceAcronym', true);
|
33 |
+
|
34 |
+
case "abbr":
|
35 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_abbr_desc', '{$pluginurl}/images/abbr.gif', 'mceAbbr', true);
|
36 |
+
|
37 |
+
case "del":
|
38 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_del_desc', '{$pluginurl}/images/del.gif', 'mceDel', true);
|
39 |
+
|
40 |
+
case "ins":
|
41 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_ins_desc', '{$pluginurl}/images/ins.gif', 'mceIns', true);
|
42 |
+
|
43 |
+
case "attribs":
|
44 |
+
return tinyMCE.getButtonHTML(cn, 'lang_xhtmlxtras_attribs_desc', '{$pluginurl}/images/attribs.gif', 'mceAttributes', true);
|
45 |
+
}
|
46 |
+
|
47 |
+
return "";
|
48 |
+
},
|
49 |
+
|
50 |
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
51 |
+
var template, inst, elm;
|
52 |
+
|
53 |
+
switch (command) {
|
54 |
+
case "mceCite":
|
55 |
+
if (!this._anySel(editor_id))
|
56 |
+
return true;
|
57 |
+
|
58 |
+
template = new Array();
|
59 |
+
template['file'] = '../../plugins/xhtmlxtras/cite.htm';
|
60 |
+
template['width'] = 350;
|
61 |
+
template['height'] = 250;
|
62 |
+
tinyMCE.openWindow(template, {editor_id : editor_id});
|
63 |
+
return true;
|
64 |
+
|
65 |
+
case "mceAcronym":
|
66 |
+
if (!this._anySel(editor_id))
|
67 |
+
return true;
|
68 |
+
|
69 |
+
template = new Array();
|
70 |
+
template['file'] = '../../plugins/xhtmlxtras/acronym.htm';
|
71 |
+
template['width'] = 350;
|
72 |
+
template['height'] = 250;
|
73 |
+
tinyMCE.openWindow(template, {editor_id : editor_id});
|
74 |
+
return true;
|
75 |
+
|
76 |
+
case "mceAbbr":
|
77 |
+
if (!this._anySel(editor_id))
|
78 |
+
return true;
|
79 |
+
|
80 |
+
template = new Array();
|
81 |
+
template['file'] = '../../plugins/xhtmlxtras/abbr.htm';
|
82 |
+
template['width'] = 350;
|
83 |
+
template['height'] = 250;
|
84 |
+
tinyMCE.openWindow(template, {editor_id : editor_id});
|
85 |
+
return true;
|
86 |
+
|
87 |
+
case "mceIns":
|
88 |
+
if (!this._anySel(editor_id))
|
89 |
+
return true;
|
90 |
+
|
91 |
+
template = new Array();
|
92 |
+
template['file'] = '../../plugins/xhtmlxtras/ins.htm';
|
93 |
+
template['width'] = 350;
|
94 |
+
template['height'] = 310;
|
95 |
+
tinyMCE.openWindow(template, {editor_id : editor_id});
|
96 |
+
return true;
|
97 |
+
|
98 |
+
case "mceDel":
|
99 |
+
if (!this._anySel(editor_id))
|
100 |
+
return true;
|
101 |
+
|
102 |
+
template = new Array();
|
103 |
+
template['file'] = '../../plugins/xhtmlxtras/del.htm';
|
104 |
+
template['width'] = 350;
|
105 |
+
template['height'] = 310;
|
106 |
+
tinyMCE.openWindow(template, {editor_id : editor_id});
|
107 |
+
return true;
|
108 |
+
|
109 |
+
case "mceAttributes":
|
110 |
+
inst = tinyMCE.getInstanceById(editor_id);
|
111 |
+
elm = inst.getFocusElement();
|
112 |
+
|
113 |
+
if (elm && elm.nodeName !== 'BODY' && elm.className.indexOf('mceItem') == -1) {
|
114 |
+
tinyMCE.openWindow({
|
115 |
+
file : '../../plugins/xhtmlxtras/attributes.htm',
|
116 |
+
width : 380,
|
117 |
+
height : 370
|
118 |
+
}, {editor_id : editor_id});
|
119 |
+
}
|
120 |
+
|
121 |
+
return true;
|
122 |
+
}
|
123 |
+
|
124 |
+
return false;
|
125 |
+
},
|
126 |
+
|
127 |
+
cleanup : function(type, content, inst) {
|
128 |
+
if (type == 'insert_to_editor' && tinyMCE.isIE && !tinyMCE.isOpera) {
|
129 |
+
content = content.replace(/<abbr([^>]+)>/gi, '<html:ABBR $1>');
|
130 |
+
content = content.replace(/<\/abbr>/gi, '</html:ABBR>');
|
131 |
+
}
|
132 |
+
|
133 |
+
return content;
|
134 |
+
},
|
135 |
+
|
136 |
+
handleNodeChange : function(editor_id, node, undo_index,undo_levels, visual_aid, any_selection) {
|
137 |
+
var elm = tinyMCE.getParentElement(node);
|
138 |
+
|
139 |
+
if (node == null)
|
140 |
+
return;
|
141 |
+
|
142 |
+
tinyMCE.switchClass(editor_id + '_attribs', 'mceButtonDisabled');
|
143 |
+
|
144 |
+
if (!any_selection) {
|
145 |
+
// Disable the buttons
|
146 |
+
tinyMCE.switchClass(editor_id + '_cite', 'mceButtonDisabled');
|
147 |
+
tinyMCE.switchClass(editor_id + '_acronym', 'mceButtonDisabled');
|
148 |
+
tinyMCE.switchClass(editor_id + '_abbr', 'mceButtonDisabled');
|
149 |
+
tinyMCE.switchClass(editor_id + '_del', 'mceButtonDisabled');
|
150 |
+
tinyMCE.switchClass(editor_id + '_ins', 'mceButtonDisabled');
|
151 |
+
} else {
|
152 |
+
// A selection means the buttons should be active.
|
153 |
+
tinyMCE.switchClass(editor_id + '_cite', 'mceButtonNormal');
|
154 |
+
tinyMCE.switchClass(editor_id + '_acronym', 'mceButtonNormal');
|
155 |
+
tinyMCE.switchClass(editor_id + '_abbr', 'mceButtonNormal');
|
156 |
+
tinyMCE.switchClass(editor_id + '_del', 'mceButtonNormal');
|
157 |
+
tinyMCE.switchClass(editor_id + '_ins', 'mceButtonNormal');
|
158 |
+
}
|
159 |
+
|
160 |
+
if (elm && elm.nodeName != 'BODY' && elm.className.indexOf('mceItem') == -1)
|
161 |
+
tinyMCE.switchClass(editor_id + '_attribs', 'mceButtonNormal');
|
162 |
+
|
163 |
+
switch (node.nodeName) {
|
164 |
+
case "CITE":
|
165 |
+
tinyMCE.switchClass(editor_id + '_cite', 'mceButtonSelected');
|
166 |
+
return true;
|
167 |
+
|
168 |
+
case "ACRONYM":
|
169 |
+
tinyMCE.switchClass(editor_id + '_acronym', 'mceButtonSelected');
|
170 |
+
return true;
|
171 |
+
|
172 |
+
case "abbr": // IE
|
173 |
+
case "HTML:ABBR": // FF
|
174 |
+
case "ABBR":
|
175 |
+
tinyMCE.switchClass(editor_id + '_abbr', 'mceButtonSelected');
|
176 |
+
return true;
|
177 |
+
|
178 |
+
case "DEL":
|
179 |
+
tinyMCE.switchClass(editor_id + '_del', 'mceButtonSelected');
|
180 |
+
return true;
|
181 |
+
|
182 |
+
case "INS":
|
183 |
+
tinyMCE.switchClass(editor_id + '_ins', 'mceButtonSelected');
|
184 |
+
return true;
|
185 |
+
}
|
186 |
+
|
187 |
+
return true;
|
188 |
+
},
|
189 |
+
|
190 |
+
_anySel : function(editor_id) {
|
191 |
+
var inst = tinyMCE.getInstanceById(editor_id), t = inst.selection.getSelectedText(), pe;
|
192 |
+
|
193 |
+
pe = tinyMCE.getParentElement(inst.getFocusElement(), 'CITE,ACRONYM,ABBR,HTML:ABBR,DEL,INS');
|
194 |
+
|
195 |
+
return pe || inst.getFocusElement().nodeName == "IMG" || (t && t.length > 0);
|
196 |
+
}
|
197 |
+
};
|
198 |
+
|
199 |
+
tinyMCE.addPlugin("xhtmlxtras", TinyMCE_XHTMLXtrasPlugin);
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/abbr.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/acronym.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/attribs.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/cite.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/date_time.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/del.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/ins.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/images/remove_button_bg.gif
ADDED
Binary file
|
upload_to_tinymce_directory/plugins/xhtmlxtras/ins.htm
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_xhtmlxtras_title_ins_element}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
|
7 |
+
<script language="javascript" type="text/javascript" src="../../utils/editable_selects.js"></script>
|
8 |
+
<script language="javascript" type="text/javascript" src="jscripts/element_common.js"></script>
|
9 |
+
<script language="javascript" type="text/javascript" src="jscripts/ins.js"></script>
|
10 |
+
<link rel="stylesheet" type="text/css" href="css/popup.css" />
|
11 |
+
<base target="_self" />
|
12 |
+
</head>
|
13 |
+
<body id="xhtmlxtrasins" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
14 |
+
<form onsubmit="insertIns();return false;" action="#">
|
15 |
+
<div class="tabs">
|
16 |
+
<ul>
|
17 |
+
<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_xhtmlxtras_general_tab}</a></span></li>
|
18 |
+
<!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_xhtmlxtras_events_tab}</a></span></li> -->
|
19 |
+
</ul>
|
20 |
+
</div>
|
21 |
+
|
22 |
+
<div class="panel_wrapper">
|
23 |
+
<div id="general_panel" class="panel current">
|
24 |
+
<fieldset>
|
25 |
+
<legend>{$lang_xhtmlxtras_fieldset_general_tab}</legend>
|
26 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
27 |
+
<tr>
|
28 |
+
<td class="label"><label id="datetimelabel" for="datetime">{$lang_xhtmlxtras_attribute_label_datetime}</label>:</td>
|
29 |
+
<td>
|
30 |
+
<table border="0" cellspacing="0" cellpadding="0">
|
31 |
+
<tr>
|
32 |
+
<td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field" /></td>
|
33 |
+
<td><a href="javascript:insertDateTime('datetime');" class="mceButtonNormal"><img src="images/date_time.gif" class="picker" alt="{$lang_xhtmlxtras_insert_date}" title="{$lang_xhtmlxtras_insert_date}" /></a></td>
|
34 |
+
</tr>
|
35 |
+
</table>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td class="label"><label id="citelabel" for="cite">{$lang_xhtmlxtras_attribute_label_cite}</label>:</td>
|
40 |
+
<td><input id="cite" name="cite" type="text" value="" class="field" /></td>
|
41 |
+
</tr>
|
42 |
+
</table>
|
43 |
+
</fieldset>
|
44 |
+
<fieldset>
|
45 |
+
<legend>{$lang_xhtmlxtras_fieldset_attrib_tab}</legend>
|
46 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
47 |
+
<tr>
|
48 |
+
<td class="label"><label id="titlelabel" for="title">{$lang_xhtmlxtras_attribute_label_title}</label>:</td>
|
49 |
+
<td><input id="title" name="title" type="text" value="" class="field" /></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="label"><label id="idlabel" for="id">{$lang_xhtmlxtras_attribute_label_id}</label>:</td>
|
53 |
+
<td><input id="id" name="id" type="text" value="" class="field" /></td>
|
54 |
+
</tr>
|
55 |
+
<tr>
|
56 |
+
<td class="label"><label id="classlabel" for="class">{$lang_xhtmlxtras_attribute_label_class}</label>:</td>
|
57 |
+
<td>
|
58 |
+
<select id="class" name="class" class="field mceEditableSelect">
|
59 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
60 |
+
</select>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
<tr>
|
64 |
+
<td class="label"><label id="stylelabel" for="class">{$lang_xhtmlxtras_attribute_label_style}</label>:</td>
|
65 |
+
<td><input id="style" name="style" type="text" value="" class="field" /></td>
|
66 |
+
</tr>
|
67 |
+
<tr>
|
68 |
+
<td class="label"><label id="dirlabel" for="dir">{$lang_xhtmlxtras_attribute_label_langdir}</label>:</td>
|
69 |
+
<td>
|
70 |
+
<select id="dir" name="dir" class="field">
|
71 |
+
<option value="">{$lang_xhtmlxtras_not_set}</option>
|
72 |
+
<option value="ltr">{$lang_xhtmlxtras_attribute_option_ltr}</option>
|
73 |
+
<option value="rtl">{$lang_xhtmlxtras_attribute_option_rtl}</option>
|
74 |
+
</select>
|
75 |
+
</td>
|
76 |
+
</tr>
|
77 |
+
<tr>
|
78 |
+
<td class="label"><label id="langlabel" for="lang">{$lang_xhtmlxtras_attribute_label_langcode}</label>:</td>
|
79 |
+
<td>
|
80 |
+
<input id="lang" name="lang" type="text" value="" class="field" />
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
</table>
|
84 |
+
</fieldset>
|
85 |
+
</div>
|
86 |
+
<div id="events_panel" class="panel">
|
87 |
+
<fieldset>
|
88 |
+
<legend>{$lang_xhtmlxtras_fieldset_events_tab}</legend>
|
89 |
+
|
90 |
+
<table border="0" cellpadding="0" cellspacing="4">
|
91 |
+
<tr>
|
92 |
+
<td class="label"><label for="onfocus">onfocus</label>:</td>
|
93 |
+
<td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td>
|
94 |
+
</tr>
|
95 |
+
|
96 |
+
<tr>
|
97 |
+
<td class="label"><label for="onblur">onblur</label>:</td>
|
98 |
+
<td><input id="onblur" name="onblur" type="text" value="" class="field" /></td>
|
99 |
+
</tr>
|
100 |
+
|
101 |
+
<tr>
|
102 |
+
<td class="label"><label for="onclick">onclick</label>:</td>
|
103 |
+
<td><input id="onclick" name="onclick" type="text" value="" class="field" /></td>
|
104 |
+
</tr>
|
105 |
+
|
106 |
+
<tr>
|
107 |
+
<td class="label"><label for="ondblclick">ondblclick</label>:</td>
|
108 |
+
<td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td>
|
109 |
+
</tr>
|
110 |
+
|
111 |
+
<tr>
|
112 |
+
<td class="label"><label for="onmousedown">onmousedown</label>:</td>
|
113 |
+
<td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td>
|
114 |
+
</tr>
|
115 |
+
|
116 |
+
<tr>
|
117 |
+
<td class="label"><label for="onmouseup">onmouseup</label>:</td>
|
118 |
+
<td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td>
|
119 |
+
</tr>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td class="label"><label for="onmouseover">onmouseover</label>:</td>
|
123 |
+
<td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td>
|
124 |
+
</tr>
|
125 |
+
|
126 |
+
<tr>
|
127 |
+
<td class="label"><label for="onmousemove">onmousemove</label>:</td>
|
128 |
+
<td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td>
|
129 |
+
</tr>
|
130 |
+
|
131 |
+
<tr>
|
132 |
+
<td class="label"><label for="onmouseout">onmouseout</label>:</td>
|
133 |
+
<td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td>
|
134 |
+
</tr>
|
135 |
+
|
136 |
+
<tr>
|
137 |
+
<td class="label"><label for="onkeypress">onkeypress</label>:</td>
|
138 |
+
<td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td>
|
139 |
+
</tr>
|
140 |
+
|
141 |
+
<tr>
|
142 |
+
<td class="label"><label for="onkeydown">onkeydown</label>:</td>
|
143 |
+
<td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td>
|
144 |
+
</tr>
|
145 |
+
|
146 |
+
<tr>
|
147 |
+
<td class="label"><label for="onkeyup">onkeyup</label>:</td>
|
148 |
+
<td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td>
|
149 |
+
</tr>
|
150 |
+
</table>
|
151 |
+
</fieldset>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
<div class="mceActionPanel">
|
155 |
+
<div style="float: left">
|
156 |
+
<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertIns();" />
|
157 |
+
</div>
|
158 |
+
<div style="float: left">
|
159 |
+
<input type="button" id="remove" name="remove" value="{$lang_xhtmlxtras_remove}" onclick="removeIns();" style="display: none;" />
|
160 |
+
</div>
|
161 |
+
<div style="float: right">
|
162 |
+
<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
|
163 |
+
</div>
|
164 |
+
</div>
|
165 |
+
|
166 |
+
</form>
|
167 |
+
|
168 |
+
</body>
|
169 |
+
</html>
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/abbr.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
SXE.initElementDialog('abbr');
|
16 |
+
if (SXE.currentAction == "update") {
|
17 |
+
SXE.showRemoveButton();
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function insertAbbr() {
|
22 |
+
SXE.insertElement(tinyMCE.isIE && !tinyMCE.isOpera ? 'html:ABBR' : 'abbr');
|
23 |
+
tinyMCEPopup.close();
|
24 |
+
}
|
25 |
+
|
26 |
+
function removeAbbr() {
|
27 |
+
SXE.removeElement('abbr');
|
28 |
+
tinyMCEPopup.close();
|
29 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/acronym.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
SXE.initElementDialog('acronym');
|
16 |
+
if (SXE.currentAction == "update") {
|
17 |
+
SXE.showRemoveButton();
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function insertAcronym() {
|
22 |
+
SXE.insertElement('acronym');
|
23 |
+
tinyMCEPopup.close();
|
24 |
+
}
|
25 |
+
|
26 |
+
function removeAcronym() {
|
27 |
+
SXE.removeElement('acronym');
|
28 |
+
tinyMCEPopup.close();
|
29 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/attributes.js
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
16 |
+
var elm = inst.getFocusElement();
|
17 |
+
|
18 |
+
var f = document.forms[0];
|
19 |
+
|
20 |
+
var onclick = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onclick'));
|
21 |
+
|
22 |
+
setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
|
23 |
+
setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
|
24 |
+
setFormValue('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"))));
|
25 |
+
setFormValue('dir', tinyMCE.getAttrib(elm, 'dir'));
|
26 |
+
setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
|
27 |
+
setFormValue('tabindex', tinyMCE.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
|
28 |
+
setFormValue('accesskey', tinyMCE.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
|
29 |
+
setFormValue('onfocus', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onfocus')));
|
30 |
+
setFormValue('onblur', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onblur')));
|
31 |
+
setFormValue('onclick', onclick);
|
32 |
+
setFormValue('ondblclick', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'ondblclick')));
|
33 |
+
setFormValue('onmousedown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousedown')));
|
34 |
+
setFormValue('onmouseup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseup')));
|
35 |
+
setFormValue('onmouseover', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
|
36 |
+
setFormValue('onmousemove', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousemove')));
|
37 |
+
setFormValue('onmouseout', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
|
38 |
+
setFormValue('onkeypress', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeypress')));
|
39 |
+
setFormValue('onkeydown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeydown')));
|
40 |
+
setFormValue('onkeyup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeyup')));
|
41 |
+
|
42 |
+
className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(elm, 'class'), false);
|
43 |
+
|
44 |
+
addClassesToList('classlist', 'advlink_styles');
|
45 |
+
selectByValue(f, 'classlist', className, true);
|
46 |
+
|
47 |
+
TinyMCE_EditableSelects.init();
|
48 |
+
}
|
49 |
+
|
50 |
+
function setFormValue(name, value) {
|
51 |
+
if(value && document.forms[0].elements[name]){
|
52 |
+
document.forms[0].elements[name].value = value;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
function insertAction() {
|
57 |
+
var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
|
58 |
+
var elm = inst.getFocusElement();
|
59 |
+
|
60 |
+
tinyMCEPopup.execCommand("mceBeginUndoLevel");
|
61 |
+
tinyMCEPopup.restoreSelection();
|
62 |
+
|
63 |
+
setAllAttribs(elm);
|
64 |
+
|
65 |
+
tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
|
66 |
+
tinyMCE._setEventsEnabled(inst.getBody(), false);
|
67 |
+
tinyMCEPopup.execCommand("mceEndUndoLevel");
|
68 |
+
tinyMCEPopup.close();
|
69 |
+
}
|
70 |
+
|
71 |
+
function setAttrib(elm, attrib, value) {
|
72 |
+
var formObj = document.forms[0];
|
73 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
74 |
+
|
75 |
+
if (typeof(value) == "undefined" || value == null) {
|
76 |
+
value = "";
|
77 |
+
|
78 |
+
if (valueElm)
|
79 |
+
value = valueElm.value;
|
80 |
+
}
|
81 |
+
|
82 |
+
if (value != "") {
|
83 |
+
tinyMCE.setAttrib(elm, attrib.toLowerCase(), value);
|
84 |
+
|
85 |
+
if (attrib == "style")
|
86 |
+
attrib = "style.cssText";
|
87 |
+
|
88 |
+
if (attrib.substring(0, 2) == 'on')
|
89 |
+
value = 'return true;' + value;
|
90 |
+
|
91 |
+
if (attrib == "class")
|
92 |
+
attrib = "className";
|
93 |
+
|
94 |
+
eval('elm.' + attrib + "=value;");
|
95 |
+
} else
|
96 |
+
elm.removeAttribute(attrib);
|
97 |
+
}
|
98 |
+
|
99 |
+
function setAllAttribs(elm) {
|
100 |
+
var f = document.forms[0];
|
101 |
+
|
102 |
+
setAttrib(elm, 'title');
|
103 |
+
setAttrib(elm, 'id');
|
104 |
+
setAttrib(elm, 'style');
|
105 |
+
setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
|
106 |
+
setAttrib(elm, 'dir');
|
107 |
+
setAttrib(elm, 'lang');
|
108 |
+
setAttrib(elm, 'tabindex');
|
109 |
+
setAttrib(elm, 'accesskey');
|
110 |
+
setAttrib(elm, 'onfocus');
|
111 |
+
setAttrib(elm, 'onblur');
|
112 |
+
setAttrib(elm, 'onclick');
|
113 |
+
setAttrib(elm, 'ondblclick');
|
114 |
+
setAttrib(elm, 'onmousedown');
|
115 |
+
setAttrib(elm, 'onmouseup');
|
116 |
+
setAttrib(elm, 'onmouseover');
|
117 |
+
setAttrib(elm, 'onmousemove');
|
118 |
+
setAttrib(elm, 'onmouseout');
|
119 |
+
setAttrib(elm, 'onkeypress');
|
120 |
+
setAttrib(elm, 'onkeydown');
|
121 |
+
setAttrib(elm, 'onkeyup');
|
122 |
+
|
123 |
+
// Refresh in old MSIE
|
124 |
+
if (tinyMCE.isMSIE5)
|
125 |
+
elm.outerHTML = elm.outerHTML;
|
126 |
+
}
|
127 |
+
|
128 |
+
function insertAttribute() {
|
129 |
+
tinyMCEPopup.close();
|
130 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/cite.js
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
SXE.initElementDialog('cite');
|
16 |
+
if (SXE.currentAction == "update") {
|
17 |
+
SXE.showRemoveButton();
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
function insertCite() {
|
22 |
+
SXE.insertElement('cite');
|
23 |
+
tinyMCEPopup.close();
|
24 |
+
}
|
25 |
+
|
26 |
+
function removeCite() {
|
27 |
+
SXE.removeElement('cite');
|
28 |
+
tinyMCEPopup.close();
|
29 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/del.js
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
SXE.initElementDialog('del');
|
16 |
+
if (SXE.currentAction == "update") {
|
17 |
+
setFormValue('datetime', tinyMCE.getAttrib(SXE.updateElement, 'datetime'));
|
18 |
+
setFormValue('cite', tinyMCE.getAttrib(SXE.updateElement, 'cite'));
|
19 |
+
SXE.showRemoveButton();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
function setElementAttribs(elm) {
|
24 |
+
setAllCommonAttribs(elm);
|
25 |
+
setAttrib(elm, 'datetime');
|
26 |
+
setAttrib(elm, 'cite');
|
27 |
+
}
|
28 |
+
|
29 |
+
function insertDel() {
|
30 |
+
var elm = tinyMCE.getParentElement(SXE.focusElement, 'del');
|
31 |
+
|
32 |
+
tinyMCEPopup.execCommand('mceBeginUndoLevel');
|
33 |
+
if (elm == null) {
|
34 |
+
var s = SXE.inst.selection.getSelectedHTML();
|
35 |
+
if(s.length > 0) {
|
36 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, '<del id="#sxe_temp_del#">' + s + '</del>');
|
37 |
+
var elementArray = tinyMCE.getElementsByAttributeValue(SXE.inst.getBody(), 'del', 'id', '#sxe_temp_del#');
|
38 |
+
for (var i=0; i<elementArray.length; i++) {
|
39 |
+
var elm = elementArray[i];
|
40 |
+
setElementAttribs(elm);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
} else {
|
44 |
+
setElementAttribs(elm);
|
45 |
+
}
|
46 |
+
tinyMCE.triggerNodeChange();
|
47 |
+
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
48 |
+
tinyMCEPopup.close();
|
49 |
+
}
|
50 |
+
|
51 |
+
function removeDel() {
|
52 |
+
SXE.removeElement('del');
|
53 |
+
tinyMCEPopup.close();
|
54 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/element_common.js
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function initCommonAttributes(elm) {
|
9 |
+
var formObj = document.forms[0];
|
10 |
+
|
11 |
+
// Setup form data for common element attributes
|
12 |
+
setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
|
13 |
+
setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
|
14 |
+
selectByValue(formObj, 'class', tinyMCE.getAttrib(elm, 'class'), true);
|
15 |
+
setFormValue('style', tinyMCE.getAttrib(elm, 'style'));
|
16 |
+
selectByValue(formObj, 'dir', tinyMCE.getAttrib(elm, 'dir'));
|
17 |
+
setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
|
18 |
+
setFormValue('onfocus', tinyMCE.getAttrib(elm, 'onfocus'));
|
19 |
+
setFormValue('onblur', tinyMCE.getAttrib(elm, 'onblur'));
|
20 |
+
setFormValue('onclick', tinyMCE.getAttrib(elm, 'onclick'));
|
21 |
+
setFormValue('ondblclick', tinyMCE.getAttrib(elm, 'ondblclick'));
|
22 |
+
setFormValue('onmousedown', tinyMCE.getAttrib(elm, 'onmousedown'));
|
23 |
+
setFormValue('onmouseup', tinyMCE.getAttrib(elm, 'onmouseup'));
|
24 |
+
setFormValue('onmouseover', tinyMCE.getAttrib(elm, 'onmouseover'));
|
25 |
+
setFormValue('onmousemove', tinyMCE.getAttrib(elm, 'onmousemove'));
|
26 |
+
setFormValue('onmouseout', tinyMCE.getAttrib(elm, 'onmouseout'));
|
27 |
+
setFormValue('onkeypress', tinyMCE.getAttrib(elm, 'onkeypress'));
|
28 |
+
setFormValue('onkeydown', tinyMCE.getAttrib(elm, 'onkeydown'));
|
29 |
+
setFormValue('onkeyup', tinyMCE.getAttrib(elm, 'onkeyup'));
|
30 |
+
}
|
31 |
+
|
32 |
+
function setFormValue(name, value) {
|
33 |
+
if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
|
34 |
+
}
|
35 |
+
|
36 |
+
function insertDateTime(id) {
|
37 |
+
document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
|
38 |
+
}
|
39 |
+
|
40 |
+
function getDateTime(d, fmt) {
|
41 |
+
fmt = fmt.replace("%D", "%m/%d/%y");
|
42 |
+
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
43 |
+
fmt = fmt.replace("%Y", "" + d.getFullYear());
|
44 |
+
fmt = fmt.replace("%y", "" + d.getYear());
|
45 |
+
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
|
46 |
+
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
|
47 |
+
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
|
48 |
+
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
|
49 |
+
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
|
50 |
+
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
|
51 |
+
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
|
52 |
+
fmt = fmt.replace("%%", "%");
|
53 |
+
|
54 |
+
return fmt;
|
55 |
+
}
|
56 |
+
|
57 |
+
function addZeros(value, len) {
|
58 |
+
var i;
|
59 |
+
|
60 |
+
value = "" + value;
|
61 |
+
|
62 |
+
if (value.length < len) {
|
63 |
+
for (i=0; i<(len-value.length); i++)
|
64 |
+
value = "0" + value;
|
65 |
+
}
|
66 |
+
|
67 |
+
return value;
|
68 |
+
}
|
69 |
+
|
70 |
+
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
|
71 |
+
if (!form_obj || !form_obj.elements[field_name])
|
72 |
+
return;
|
73 |
+
|
74 |
+
var sel = form_obj.elements[field_name];
|
75 |
+
|
76 |
+
var found = false;
|
77 |
+
for (var i=0; i<sel.options.length; i++) {
|
78 |
+
var option = sel.options[i];
|
79 |
+
|
80 |
+
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
|
81 |
+
option.selected = true;
|
82 |
+
found = true;
|
83 |
+
} else
|
84 |
+
option.selected = false;
|
85 |
+
}
|
86 |
+
|
87 |
+
if (!found && add_custom && value != '') {
|
88 |
+
var option = new Option('Value: ' + value, value);
|
89 |
+
option.selected = true;
|
90 |
+
sel.options[sel.options.length] = option;
|
91 |
+
}
|
92 |
+
|
93 |
+
return found;
|
94 |
+
}
|
95 |
+
|
96 |
+
function setAttrib(elm, attrib, value) {
|
97 |
+
var formObj = document.forms[0];
|
98 |
+
var valueElm = formObj.elements[attrib.toLowerCase()];
|
99 |
+
|
100 |
+
if (typeof(value) == "undefined" || value == null) {
|
101 |
+
value = "";
|
102 |
+
|
103 |
+
if (valueElm)
|
104 |
+
value = valueElm.value;
|
105 |
+
}
|
106 |
+
|
107 |
+
if (value != "") {
|
108 |
+
if (attrib == "style")
|
109 |
+
attrib = "style.cssText";
|
110 |
+
|
111 |
+
if (attrib.substring(0, 2) == 'on')
|
112 |
+
value = 'return true;' + value;
|
113 |
+
|
114 |
+
if (attrib == "class") {
|
115 |
+
tinyMCE.addCSSClass(elm, value);
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
elm.setAttribute(attrib.toLowerCase(), value);
|
120 |
+
} else
|
121 |
+
elm.removeAttribute(attrib);
|
122 |
+
}
|
123 |
+
|
124 |
+
function setAllCommonAttribs(elm) {
|
125 |
+
setAttrib(elm, 'title');
|
126 |
+
setAttrib(elm, 'id');
|
127 |
+
setAttrib(elm, 'class');
|
128 |
+
setAttrib(elm, 'style');
|
129 |
+
setAttrib(elm, 'dir');
|
130 |
+
setAttrib(elm, 'lang');
|
131 |
+
/*setAttrib(elm, 'onfocus');
|
132 |
+
setAttrib(elm, 'onblur');
|
133 |
+
setAttrib(elm, 'onclick');
|
134 |
+
setAttrib(elm, 'ondblclick');
|
135 |
+
setAttrib(elm, 'onmousedown');
|
136 |
+
setAttrib(elm, 'onmouseup');
|
137 |
+
setAttrib(elm, 'onmouseover');
|
138 |
+
setAttrib(elm, 'onmousemove');
|
139 |
+
setAttrib(elm, 'onmouseout');
|
140 |
+
setAttrib(elm, 'onkeypress');
|
141 |
+
setAttrib(elm, 'onkeydown');
|
142 |
+
setAttrib(elm, 'onkeyup');*/
|
143 |
+
}
|
144 |
+
|
145 |
+
SXE = {
|
146 |
+
currentAction : "insert",
|
147 |
+
inst : tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')),
|
148 |
+
updateElement : null
|
149 |
+
}
|
150 |
+
|
151 |
+
SXE.focusElement = SXE.inst.getFocusElement();
|
152 |
+
|
153 |
+
SXE.initElementDialog = function(element_name) {
|
154 |
+
addClassesToList('class', 'xhtmlxtras_styles');
|
155 |
+
TinyMCE_EditableSelects.init();
|
156 |
+
|
157 |
+
element_name = element_name.toLowerCase();
|
158 |
+
var elm = tinyMCE.getParentElement(SXE.focusElement, element_name);
|
159 |
+
if (elm != null && elm.nodeName == element_name.toUpperCase()) {
|
160 |
+
SXE.currentAction = "update";
|
161 |
+
}
|
162 |
+
|
163 |
+
if (SXE.currentAction == "update") {
|
164 |
+
initCommonAttributes(elm);
|
165 |
+
SXE.updateElement = elm;
|
166 |
+
}
|
167 |
+
|
168 |
+
document.forms[0].insert.value = tinyMCE.getLang('lang_' + SXE.currentAction, 'Insert', true);
|
169 |
+
}
|
170 |
+
|
171 |
+
SXE.insertElement = function(element_name) {
|
172 |
+
var elm = tinyMCE.getParentElement(SXE.focusElement, element_name), h, tagName;
|
173 |
+
|
174 |
+
tinyMCEPopup.execCommand('mceBeginUndoLevel');
|
175 |
+
if (elm == null) {
|
176 |
+
var s = SXE.inst.selection.getSelectedHTML();
|
177 |
+
if(s.length > 0) {
|
178 |
+
tagName = element_name;
|
179 |
+
|
180 |
+
if (tinyMCE.isIE && !tinyMCE.isOpera && element_name.indexOf('html:') == 0)
|
181 |
+
element_name = element_name.substring(5).toLowerCase();
|
182 |
+
|
183 |
+
h = '<' + tagName + ' id="#sxe_temp_' + element_name + '#">' + s + '</' + tagName + '>';
|
184 |
+
|
185 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, h);
|
186 |
+
|
187 |
+
var elementArray = tinyMCE.getElementsByAttributeValue(SXE.inst.getBody(), element_name, 'id', '#sxe_temp_' + element_name + '#');
|
188 |
+
for (var i=0; i<elementArray.length; i++) {
|
189 |
+
var elm = elementArray[i];
|
190 |
+
|
191 |
+
elm.id = '';
|
192 |
+
elm.setAttribute('id', '');
|
193 |
+
elm.removeAttribute('id');
|
194 |
+
|
195 |
+
setAllCommonAttribs(elm);
|
196 |
+
}
|
197 |
+
}
|
198 |
+
} else {
|
199 |
+
setAllCommonAttribs(elm);
|
200 |
+
}
|
201 |
+
tinyMCE.triggerNodeChange();
|
202 |
+
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
203 |
+
}
|
204 |
+
|
205 |
+
SXE.removeElement = function(element_name){
|
206 |
+
element_name = element_name.toLowerCase();
|
207 |
+
elm = tinyMCE.getParentElement(SXE.focusElement, element_name);
|
208 |
+
if(elm && elm.nodeName == element_name.toUpperCase()){
|
209 |
+
tinyMCEPopup.execCommand('mceBeginUndoLevel');
|
210 |
+
tinyMCE.execCommand('mceRemoveNode', false, elm);
|
211 |
+
tinyMCE.triggerNodeChange();
|
212 |
+
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
SXE.showRemoveButton = function() {
|
217 |
+
document.getElementById("remove").style.display = 'block';
|
218 |
+
}
|
219 |
+
|
220 |
+
SXE.containsClass = function(elm,cl) {
|
221 |
+
return (elm.className.indexOf(cl) > -1) ? true : false;
|
222 |
+
}
|
223 |
+
|
224 |
+
SXE.removeClass = function(elm,cl) {
|
225 |
+
if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
|
226 |
+
return true;
|
227 |
+
}
|
228 |
+
var classNames = elm.className.split(" ");
|
229 |
+
var newClassNames = "";
|
230 |
+
for (var x = 0, cnl = classNames.length; x < cnl; x++) {
|
231 |
+
if (classNames[x] != cl) {
|
232 |
+
newClassNames += (classNames[x] + " ");
|
233 |
+
}
|
234 |
+
}
|
235 |
+
elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
|
236 |
+
}
|
237 |
+
|
238 |
+
SXE.addClass = function(elm,cl) {
|
239 |
+
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
|
240 |
+
return true;
|
241 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/jscripts/ins.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
|
3 |
+
*
|
4 |
+
* @author Moxiecode - based on work by Andrew Tetlaw
|
5 |
+
* @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
|
6 |
+
*/
|
7 |
+
|
8 |
+
function preinit() {
|
9 |
+
// Initialize
|
10 |
+
tinyMCE.setWindowArg('mce_windowresize', false);
|
11 |
+
}
|
12 |
+
|
13 |
+
function init() {
|
14 |
+
tinyMCEPopup.resizeToInnerSize();
|
15 |
+
SXE.initElementDialog('ins');
|
16 |
+
if (SXE.currentAction == "update") {
|
17 |
+
setFormValue('datetime', tinyMCE.getAttrib(SXE.updateElement, 'datetime'));
|
18 |
+
setFormValue('cite', tinyMCE.getAttrib(SXE.updateElement, 'cite'));
|
19 |
+
SXE.showRemoveButton();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
function setElementAttribs(elm) {
|
24 |
+
setAllCommonAttribs(elm);
|
25 |
+
setAttrib(elm, 'datetime');
|
26 |
+
setAttrib(elm, 'cite');
|
27 |
+
}
|
28 |
+
|
29 |
+
function insertIns() {
|
30 |
+
var elm = tinyMCE.getParentElement(SXE.focusElement, 'ins');
|
31 |
+
tinyMCEPopup.execCommand('mceBeginUndoLevel');
|
32 |
+
if (elm == null) {
|
33 |
+
var s = SXE.inst.selection.getSelectedHTML();
|
34 |
+
if(s.length > 0) {
|
35 |
+
tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>');
|
36 |
+
var elementArray = tinyMCE.getElementsByAttributeValue(SXE.inst.getBody(), 'ins', 'id', '#sxe_temp_ins#');
|
37 |
+
for (var i=0; i<elementArray.length; i++) {
|
38 |
+
var elm = elementArray[i];
|
39 |
+
setElementAttribs(elm);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
} else {
|
43 |
+
setElementAttribs(elm);
|
44 |
+
}
|
45 |
+
tinyMCE.triggerNodeChange();
|
46 |
+
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
47 |
+
tinyMCEPopup.close();
|
48 |
+
}
|
49 |
+
|
50 |
+
function removeIns() {
|
51 |
+
SXE.removeElement('ins');
|
52 |
+
tinyMCEPopup.close();
|
53 |
+
}
|
upload_to_tinymce_directory/plugins/xhtmlxtras/langs/en.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// UK lang variables
|
2 |
+
|
3 |
+
tinyMCE.addToLang('xhtmlxtras',{
|
4 |
+
cite_desc : 'Citation',
|
5 |
+
abbr_desc : 'Abbreviation',
|
6 |
+
acronym_desc : 'Acronym',
|
7 |
+
del_desc : 'Deletion',
|
8 |
+
ins_desc : 'Insertion',
|
9 |
+
attribute_label_title : 'Title',
|
10 |
+
attribute_label_id : 'ID',
|
11 |
+
attribute_label_class : 'Class',
|
12 |
+
attribute_label_style : 'Style',
|
13 |
+
attribute_label_cite : 'Cite',
|
14 |
+
attribute_label_datetime : 'Date/Time',
|
15 |
+
attribute_label_langdir : 'Text Direction',
|
16 |
+
attribute_option_ltr : 'Left to right',
|
17 |
+
attribute_option_rtl : 'Right to left',
|
18 |
+
attribute_label_langcode : 'Language',
|
19 |
+
attribute_label_tabindex : 'TabIndex',
|
20 |
+
attribute_label_accesskey : 'AccessKey',
|
21 |
+
attribute_label_cite : 'Cite',
|
22 |
+
attribute_events_tab : 'Events',
|
23 |
+
attribute_attrib_tab : 'Attributes',
|
24 |
+
general_tab : 'General',
|
25 |
+
attrib_tab : 'Attributes',
|
26 |
+
events_tab : 'Events',
|
27 |
+
fieldset_general_tab : 'General Settings',
|
28 |
+
fieldset_attrib_tab : 'Element Attributes',
|
29 |
+
fieldset_events_tab : 'Element Events',
|
30 |
+
title_ins_element : 'Insertion Element',
|
31 |
+
title_del_element : 'Deletion Element',
|
32 |
+
title_acronym_element : 'Acronym Element',
|
33 |
+
title_abbr_element : 'Abbreviation Element',
|
34 |
+
title_cite_element : 'Citation Element',
|
35 |
+
remove : 'Remove',
|
36 |
+
not_set : '--not set--',
|
37 |
+
insert_date : 'Insert current date/time',
|
38 |
+
option_ltr : 'Left to right',
|
39 |
+
option_rtl : 'Right to left',
|
40 |
+
attribs_desc : 'Insert/Edit Attributes',
|
41 |
+
attribs_title : 'Insert/Edit Attributes'
|
42 |
+
});
|
upload_to_tinymce_directory/readme.txt
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Upload both folders to TinyMCE�s directory at wp-includes/js/tinymce/
|
upload_to_tinymce_directory/themes/advanced/color_picker.htm
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
2 |
+
<head>
|
3 |
+
<title>{$lang_theme_colorpicker_title}</title>
|
4 |
+
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
5 |
+
<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
|
6 |
+
<script language="javascript" type="text/javascript" src="jscripts/color_picker.js"></script>
|
7 |
+
<link href="css/colorpicker.css" rel="stylesheet" type="text/css" />
|
8 |
+
<base target="_self" />
|
9 |
+
</head>
|
10 |
+
<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
|
11 |
+
<div class="tabs">
|
12 |
+
<ul>
|
13 |
+
<li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{$lang_color_picker_tab}</a></span></li>
|
14 |
+
<li id="rgb_tab"><span><a href="#" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{$lang_web_colors_tab}</a></span></li>
|
15 |
+
<li id="named_tab"><span><a href="#" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{$lang_named_colors_tab}</a></span></li>
|
16 |
+
</ul>
|
17 |
+
</div>
|
18 |
+
|
19 |
+
<div class="panel_wrapper">
|
20 |
+
<div id="picker_panel" class="panel current">
|
21 |
+
<fieldset>
|
22 |
+
<legend>{$lang_color_picker}</legend>
|
23 |
+
<div id="picker">
|
24 |
+
<img id="colorpicker" src="images/colors.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" />
|
25 |
+
|
26 |
+
<div id="light">
|
27 |
+
<!-- Will be filled with divs -->
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<br style="clear: both" />
|
31 |
+
</div>
|
32 |
+
</fieldset>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
<div id="rgb_panel" class="panel">
|
36 |
+
<fieldset>
|
37 |
+
<legend>{$lang_web_colors}</legend>
|
38 |
+
<div id="webcolors">
|
39 |
+
<!-- Gets filled with web safe colors-->
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<br style="clear: both" />
|
43 |
+
</fieldset>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div id="named_panel" class="panel">
|
47 |
+
<fieldset>
|
48 |
+
<legend>{$lang_named_colors}</legend>
|
49 |
+
<div id="namedcolors">
|
50 |
+
<!-- Gets filled with named colors-->
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<br style="clear: both" />
|
54 |
+
|
55 |
+
<div id="colornamecontainer">
|
56 |
+
{$lang_color_name} <span id="colorname"></span>
|
57 |
+
</div>
|
58 |
+
</fieldset>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div class="mceActionPanel">
|
63 |
+
<div style="float: left">
|
64 |
+
<input type="button" id="insert" name="insert" value="{$lang_theme_colorpicker_apply}" onclick="insertAction();" />
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div id="preview"></div>
|
68 |
+
|
69 |
+
<div id="previewblock">
|
70 |
+
<label for="color">{$lang_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text" />
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
</body>
|
74 |
+
</html>
|
upload_to_tinymce_directory/themes/advanced/css/colorpicker.css
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Colorpicker dialog specific CSS */
|
2 |
+
|
3 |
+
#preview {
|
4 |
+
float: right;
|
5 |
+
width: 50px;
|
6 |
+
height: 14px;
|
7 |
+
line-height: 1px;
|
8 |
+
border: 1px solid black;
|
9 |
+
margin-left: 5px;
|
10 |
+
}
|
11 |
+
|
12 |
+
#colorpicker {
|
13 |
+
float: left;
|
14 |
+
cursor: crosshair;
|
15 |
+
}
|
16 |
+
|
17 |
+
#light {
|
18 |
+
border: 1px solid gray;
|
19 |
+
margin-left: 5px;
|
20 |
+
float: left;
|
21 |
+
width: 15px;
|
22 |
+
cursor: crosshair;
|
23 |
+
}
|
24 |
+
|
25 |
+
#light div {
|
26 |
+
overflow: hidden;
|
27 |
+
}
|
28 |
+
|
29 |
+
#previewblock {
|
30 |
+
float: right;
|
31 |
+
padding-left: 10px;
|
32 |
+
height: 20px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.panel_wrapper div.current {
|
36 |
+
height: 175px;
|
37 |
+
}
|
38 |
+
|
39 |
+
#namedcolors {
|
40 |
+
width: 150px;
|
41 |
+
}
|
42 |
+
|
43 |
+
#namedcolors a {
|
44 |
+
display: block;
|
45 |
+
float: left;
|
46 |
+
width: 10px; height: 10px;
|
47 |
+
margin: 1px 1px 0 0;
|
48 |
+
overflow: hidden;
|
49 |
+
}
|
50 |
+
|
51 |
+
#colornamecontainer {
|
52 |
+
margin-top: 5px;
|
53 |
+
}
|
upload_to_tinymce_directory/themes/advanced/images/colors.jpg
ADDED
Binary file
|