typo 4.1 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/TODO-4.2 +14 -0
- data/TODO.MULTIUSERS +45 -0
- data/app/controllers/admin/base_controller.rb +18 -0
- data/app/controllers/admin/general_controller.rb +14 -0
- data/app/controllers/application.rb +2 -1
- data/app/controllers/articles_controller.rb +18 -21
- data/app/helpers/admin/base_helper.rb +4 -4
- data/app/helpers/admin/feedback_helper.rb +3 -3
- data/app/helpers/application_helper.rb +2 -6
- data/app/helpers/sidebar_helper.rb +2 -2
- data/app/models/blog.rb +9 -1
- data/app/models/category.rb +9 -9
- data/app/models/comment.rb +1 -1
- data/app/models/content_state/presumed_ham.rb +2 -2
- data/app/models/resource.rb +2 -0
- data/app/views/admin/categories/_categories.rhtml +10 -6
- data/app/views/admin/categories/edit.rhtml +3 -1
- data/app/views/admin/comments/_form.rhtml +3 -3
- data/app/views/admin/comments/list.rhtml +7 -5
- data/app/views/admin/comments/new.rhtml +3 -1
- data/app/views/admin/comments/show.rhtml +3 -1
- data/app/views/admin/content/_articles.rhtml +1 -1
- data/app/views/admin/content/_form.rhtml +4 -2
- data/app/views/admin/content/new.rhtml +1 -0
- data/app/views/admin/content/preview.rhtml +8 -8
- data/app/views/admin/feedback/_item.rhtml +3 -1
- data/app/views/admin/feedback/list.rhtml +4 -4
- data/app/views/admin/general/index.rhtml +14 -1
- data/app/views/admin/pages/_form.rhtml +1 -1
- data/app/views/admin/pages/destroy.rhtml +1 -1
- data/app/views/admin/pages/new.rhtml +1 -0
- data/app/views/admin/shared/_edit.rhtml +2 -2
- data/app/views/layouts/administration.rhtml +5 -2
- data/app/views/layouts/minimal.rhtml +134 -2
- data/config/boot.rb +1 -1
- data/config/environment.rb +11 -3
- data/config/environments/test.rb +0 -7
- data/config/routes.rb +3 -0
- data/db/migrate/004_add_sidebars.rb +21 -3
- data/db/migrate/056_create_notifications.rb +1 -1
- data/db/migrate/062_add_sitealizer_plugin.rb +18 -0
- data/db/schema.mysql-v3.sql +217 -0
- data/db/schema.mysql.sql +31 -5
- data/db/schema.postgresql.sql +31 -6
- data/db/schema.rb +17 -7
- data/db/schema.sqlite.sql +31 -6
- data/db/schema.sqlserver.sql +32 -6
- data/db/schema_version +1 -1
- data/lang/de_DE.rb +493 -0
- data/lang/fr_FR.rb +28 -4
- data/lang/ro_RO.rb +554 -0
- data/lib/tasks/release.rake +7 -7
- data/lib/typo_version.rb +1 -1
- data/public/images/sitealizer/bar.gif +0 -0
- data/public/images/sitealizer/uv.png +0 -0
- data/public/images/sitealizer/vh.png +0 -0
- data/public/javascripts/tiny_mce/blank.htm +9 -0
- data/public/javascripts/tiny_mce/langs/en.js +41 -0
- data/public/javascripts/tiny_mce/license.txt +504 -0
- data/public/javascripts/tiny_mce/themes/advanced/about.htm +52 -0
- data/public/javascripts/tiny_mce/themes/advanced/anchor.htm +33 -0
- data/public/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
- data/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +13 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_content.css +58 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_popup.css +331 -0
- data/public/javascripts/tiny_mce/themes/advanced/css/editor_ui.css +97 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/about.htm +31 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/common_buttons.htm +162 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/create_accessible_content.htm +45 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_anchor_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_image_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_link_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/images/insert_table_window.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/index.htm +27 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_anchor_button.htm +32 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_image_button.htm +65 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_link_button.htm +33 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/insert_table_button.htm +71 -0
- data/public/javascripts/tiny_mce/themes/advanced/docs/en/style.css +28 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
- data/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1534 -0
- data/public/javascripts/tiny_mce/themes/advanced/image.htm +100 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/anchor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/anchor_symbol.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/backcolor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_de_se.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_fr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bold_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/browse.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/bullist.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/button_menu.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/buttons.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cancel_button_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/charmap.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cleanup.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/close.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/code.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/color.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/copy.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/custom_1.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/cut.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/forecolor.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/help.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/hr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/image.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/indent.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/insert_button_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_de_se.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/italic_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifycenter.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyfull.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyleft.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/justifyright.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/link.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/menu_check.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/newdocument.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/numlist.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/opacity.png +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/outdent.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/paste.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/redo.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/removeformat.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/separator.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/spacer.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/statusbar_resize.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/strikethrough.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/sub.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/sup.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_es.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_fr.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_ru.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/underline_tw.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/undo.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/unlink.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/visualaid.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_end.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/images/xp/tabs_bg.gif +0 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/about.js +75 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/anchor.js +74 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/charmap.js +326 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/color_picker.js +108 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/image.js +81 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/link.js +70 -0
- data/public/javascripts/tiny_mce/themes/advanced/jscripts/source_editor.js +60 -0
- data/public/javascripts/tiny_mce/themes/advanced/langs/en.js +82 -0
- data/public/javascripts/tiny_mce/themes/advanced/link.htm +100 -0
- data/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +32 -0
- data/public/javascripts/tiny_mce/tiny_mce.js +1 -0
- data/public/javascripts/tiny_mce/tiny_mce_popup.js +288 -0
- data/public/javascripts/tiny_mce/tiny_mce_src.js +7284 -0
- data/public/javascripts/tiny_mce/utils/editable_selects.js +61 -0
- data/public/javascripts/tiny_mce/utils/form_utils.js +210 -0
- data/public/javascripts/tiny_mce/utils/mclayer.js +210 -0
- data/public/javascripts/tiny_mce/utils/mctabs.js +74 -0
- data/public/javascripts/tiny_mce/utils/validate.js +219 -0
- data/public/stylesheets/administration.css +5 -1
- data/public/stylesheets/minimal.css +1 -0
- data/test/functional/admin/categories_controller_test.rb +2 -2
- data/test/functional/xml_controller_test.rb +72 -40
- data/test/test_helper.rb +1 -17
- data/test/unit/article_test.rb +1 -1
- data/test/unit/trigger_test.rb +1 -1
- data/themes/scribbish/views/articles/_comment.rhtml +13 -17
- data/themes/scribbish/views/articles/_comment_form.rhtml +7 -5
- data/themes/scribbish/views/articles/_comment_list.rhtml +7 -0
- data/themes/scribbish/views/articles/read.rhtml +1 -1
- data/vendor/plugins/aimpresence_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/archives_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/audioscrobbler_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/audioscrobbler_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/audioscrobbler_sidebar/README +27 -0
- data/vendor/plugins/backpack_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/backpack_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/backpack_sidebar/README +27 -0
- data/vendor/plugins/category_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/sitealizer/CHANGELOG +6 -0
- data/vendor/plugins/sitealizer/LICENSE +22 -0
- data/vendor/plugins/sitealizer/README +82 -0
- data/vendor/plugins/sitealizer/Rakefile +22 -0
- data/vendor/plugins/sitealizer/init.rb +24 -0
- data/vendor/plugins/sitealizer/install.rb +22 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/bar.gif +0 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/uv.png +0 -0
- data/vendor/plugins/sitealizer/lib/app/assets/images/vh.png +0 -0
- data/vendor/plugins/sitealizer/lib/app/controllers/sitealizer_controller.rb +118 -0
- data/vendor/plugins/sitealizer/lib/app/models/site_tracker.rb +145 -0
- data/vendor/plugins/sitealizer/lib/app/views/layouts/sitealizer.rhtml +66 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_browsers.rhtml +23 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_daily_stats.rhtml +67 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_hits_summary.rhtml +0 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_hosts.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_keywords.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_languages.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_main_frame.rhtml +84 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_monthly_hits.rhtml +67 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_page_urls.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_platforms.rhtml +21 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_referers.rhtml +22 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_robots.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/_search_engines.rhtml +19 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/hourly_stats.rhtml +39 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/index.rhtml +8 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/login.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/menu.rhtml +74 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/referrer_stats.rhtml +20 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/search_stats.rhtml +25 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/summary.rhtml +22 -0
- data/vendor/plugins/sitealizer/lib/app/views/sitealizer/visitor_info.rhtml +30 -0
- data/vendor/plugins/sitealizer/lib/config.yml +18 -0
- data/vendor/plugins/sitealizer/lib/sitealizer/parser.rb +347 -0
- data/vendor/plugins/sitealizer/lib/sitealizer.rb +78 -0
- data/vendor/plugins/sitealizer/lib/tasks/sitealizer.rake +36 -0
- data/vendor/plugins/sitealizer/test/fixtures/sitealizer.yml +89 -0
- data/vendor/plugins/sitealizer/test/sitealizer_controller_test.rb +208 -0
- data/vendor/plugins/sitealizer/test/sitealizer_parser_test.rb +169 -0
- data/vendor/plugins/sitealizer/test/test_helper.rb +7 -0
- data/vendor/plugins/tada_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/tada_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/tada_sidebar/README +27 -0
- data/vendor/plugins/tag_sidebar/views/content.rhtml +1 -1
- data/vendor/plugins/tiny_mce/README +10 -0
- data/vendor/plugins/tiny_mce/Rakefile +22 -0
- data/vendor/plugins/tiny_mce/TODO +2 -0
- data/vendor/plugins/tiny_mce/changelog +1017 -0
- data/vendor/plugins/tiny_mce/init.rb +3 -0
- data/vendor/plugins/tiny_mce/install.rb +1 -0
- data/vendor/plugins/tiny_mce/lib/tiny_mce.rb +36 -0
- data/vendor/plugins/tiny_mce/lib/tiny_mce_helper.rb +48 -0
- data/vendor/plugins/tiny_mce/tasks/tiny_mce.rake +40 -0
- data/vendor/plugins/tiny_mce/test/helper_testcase.rb +38 -0
- data/vendor/plugins/tiny_mce/test/tiny_mce_helper_test.rb +67 -0
- data/vendor/plugins/tiny_mce/test/tiny_mce_test.rb +85 -0
- data/vendor/plugins/tiny_mce/tiny_mce_options.yml +121 -0
- data/vendor/plugins/xbox_sidebar/MAINTAINERS +26 -0
- data/vendor/plugins/xbox_sidebar/MIT-LICENSE +21 -0
- data/vendor/plugins/xbox_sidebar/README +27 -0
- data/vendor/plugins/xml_sidebar/lib/xml_sidebar.rb +1 -1
- data/vendor/plugins/xml_sidebar/views/content.rhtml +4 -4
- metadata +220 -4
- data/TODO-4.1 +0 -16
@@ -0,0 +1,1534 @@
|
|
1
|
+
/**
|
2
|
+
* $Id: editor_template_src.js 129 2006-10-23 09:45:17Z spocke $
|
3
|
+
*
|
4
|
+
* @author Moxiecode
|
5
|
+
* @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved.
|
6
|
+
*/
|
7
|
+
|
8
|
+
/* Import theme specific language pack */
|
9
|
+
tinyMCE.importThemeLanguagePack('advanced');
|
10
|
+
|
11
|
+
var TinyMCE_AdvancedTheme = {
|
12
|
+
// Private theme fields
|
13
|
+
_defColors : "000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",
|
14
|
+
_autoImportCSSClasses : true,
|
15
|
+
_resizer : {},
|
16
|
+
_buttons : [
|
17
|
+
// Control id, button img, button title, command, user_interface, value
|
18
|
+
['bold', '{$lang_bold_img}', 'lang_bold_desc', 'Bold'],
|
19
|
+
['italic', '{$lang_italic_img}', 'lang_italic_desc', 'Italic'],
|
20
|
+
['underline', '{$lang_underline_img}', 'lang_underline_desc', 'Underline'],
|
21
|
+
['strikethrough', 'strikethrough.gif', 'lang_striketrough_desc', 'Strikethrough'],
|
22
|
+
['justifyleft', 'justifyleft.gif', 'lang_justifyleft_desc', 'JustifyLeft'],
|
23
|
+
['justifycenter', 'justifycenter.gif', 'lang_justifycenter_desc', 'JustifyCenter'],
|
24
|
+
['justifyright', 'justifyright.gif', 'lang_justifyright_desc', 'JustifyRight'],
|
25
|
+
['justifyfull', 'justifyfull.gif', 'lang_justifyfull_desc', 'JustifyFull'],
|
26
|
+
['bullist', 'bullist.gif', 'lang_bullist_desc', 'InsertUnorderedList'],
|
27
|
+
['numlist', 'numlist.gif', 'lang_numlist_desc', 'InsertOrderedList'],
|
28
|
+
['outdent', 'outdent.gif', 'lang_outdent_desc', 'Outdent'],
|
29
|
+
['indent', 'indent.gif', 'lang_indent_desc', 'Indent'],
|
30
|
+
['cut', 'cut.gif', 'lang_cut_desc', 'Cut'],
|
31
|
+
['copy', 'copy.gif', 'lang_copy_desc', 'Copy'],
|
32
|
+
['paste', 'paste.gif', 'lang_paste_desc', 'Paste'],
|
33
|
+
['undo', 'undo.gif', 'lang_undo_desc', 'Undo'],
|
34
|
+
['redo', 'redo.gif', 'lang_redo_desc', 'Redo'],
|
35
|
+
['link', 'link.gif', 'lang_link_desc', 'mceLink', true],
|
36
|
+
['unlink', 'unlink.gif', 'lang_unlink_desc', 'unlink'],
|
37
|
+
['image', 'image.gif', 'lang_image_desc', 'mceImage', true],
|
38
|
+
['cleanup', 'cleanup.gif', 'lang_cleanup_desc', 'mceCleanup'],
|
39
|
+
['help', 'help.gif', 'lang_help_desc', 'mceHelp'],
|
40
|
+
['code', 'code.gif', 'lang_theme_code_desc', 'mceCodeEditor'],
|
41
|
+
['hr', 'hr.gif', 'lang_theme_hr_desc', 'inserthorizontalrule'],
|
42
|
+
['removeformat', 'removeformat.gif', 'lang_theme_removeformat_desc', 'removeformat'],
|
43
|
+
['sub', 'sub.gif', 'lang_theme_sub_desc', 'subscript'],
|
44
|
+
['sup', 'sup.gif', 'lang_theme_sup_desc', 'superscript'],
|
45
|
+
['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'forecolor', true],
|
46
|
+
['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'HiliteColor', true],
|
47
|
+
['charmap', 'charmap.gif', 'lang_theme_charmap_desc', 'mceCharMap'],
|
48
|
+
['visualaid', 'visualaid.gif', 'lang_theme_visualaid_desc', 'mceToggleVisualAid'],
|
49
|
+
['anchor', 'anchor.gif', 'lang_theme_anchor_desc', 'mceInsertAnchor'],
|
50
|
+
['newdocument', 'newdocument.gif', 'lang_newdocument_desc', 'mceNewDocument']
|
51
|
+
],
|
52
|
+
|
53
|
+
_buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells,delete_table',
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Returns HTML code for the specificed control.
|
57
|
+
*/
|
58
|
+
getControlHTML : function(button_name) {
|
59
|
+
var i, x, but;
|
60
|
+
|
61
|
+
// Lookup button in button list
|
62
|
+
for (i=0; i<TinyMCE_AdvancedTheme._buttons.length; i++) {
|
63
|
+
but = TinyMCE_AdvancedTheme._buttons[i];
|
64
|
+
|
65
|
+
if (but[0] == button_name && (button_name == "forecolor" || button_name == "backcolor"))
|
66
|
+
return tinyMCE.getMenuButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3] + "Menu", but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
|
67
|
+
|
68
|
+
if (but[0] == button_name)
|
69
|
+
return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
|
70
|
+
}
|
71
|
+
|
72
|
+
// Custom controlls other than buttons
|
73
|
+
switch (button_name) {
|
74
|
+
case "formatselect":
|
75
|
+
var html = '<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';
|
76
|
+
var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
|
77
|
+
var lookup = [
|
78
|
+
['p', '{$lang_theme_paragraph}'],
|
79
|
+
['address', '{$lang_theme_address}'],
|
80
|
+
['pre', '{$lang_theme_pre}'],
|
81
|
+
['h1', '{$lang_theme_h1}'],
|
82
|
+
['h2', '{$lang_theme_h2}'],
|
83
|
+
['h3', '{$lang_theme_h3}'],
|
84
|
+
['h4', '{$lang_theme_h4}'],
|
85
|
+
['h5', '{$lang_theme_h5}'],
|
86
|
+
['h6', '{$lang_theme_h6}'],
|
87
|
+
['div', '{$lang_theme_div}'],
|
88
|
+
['blockquote', '{$lang_theme_blockquote}'],
|
89
|
+
['code', '{$lang_theme_code}'],
|
90
|
+
['dt', '{$lang_theme_dt}'],
|
91
|
+
['dd', '{$lang_theme_dd}'],
|
92
|
+
['samp', '{$lang_theme_samp}']
|
93
|
+
];
|
94
|
+
|
95
|
+
html += '<option value="">{$lang_theme_block}</option>';
|
96
|
+
|
97
|
+
// Build format select
|
98
|
+
for (var i=0; i<formats.length; i++) {
|
99
|
+
for (var x=0; x<lookup.length; x++) {
|
100
|
+
if (formats[i] == lookup[x][0])
|
101
|
+
html += '<option value="<' + lookup[x][0] + '>">' + lookup[x][1] + '</option>';
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
html += '</select>';
|
106
|
+
|
107
|
+
return html;
|
108
|
+
|
109
|
+
case "styleselect":
|
110
|
+
return '<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';
|
111
|
+
|
112
|
+
case "fontselect":
|
113
|
+
var fontHTML = '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';
|
114
|
+
var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
|
115
|
+
var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
|
116
|
+
var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
|
117
|
+
for (i=0; i<fonts.length; i++) {
|
118
|
+
if (fonts[i] != '') {
|
119
|
+
var parts = fonts[i].split('=');
|
120
|
+
fontHTML += '<option value="' + parts[1] + '">' + parts[0] + '</option>';
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
fontHTML += '</select>';
|
125
|
+
return fontHTML;
|
126
|
+
|
127
|
+
case "fontsizeselect":
|
128
|
+
return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
|
129
|
+
'<option value="0">{$lang_theme_font_size}</option>'+
|
130
|
+
'<option value="1">1 (8 pt)</option>'+
|
131
|
+
'<option value="2">2 (10 pt)</option>'+
|
132
|
+
'<option value="3">3 (12 pt)</option>'+
|
133
|
+
'<option value="4">4 (14 pt)</option>'+
|
134
|
+
'<option value="5">5 (18 pt)</option>'+
|
135
|
+
'<option value="6">6 (24 pt)</option>'+
|
136
|
+
'<option value="7">7 (36 pt)</option>'+
|
137
|
+
'</select>';
|
138
|
+
|
139
|
+
case "|":
|
140
|
+
case "separator":
|
141
|
+
return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
|
142
|
+
|
143
|
+
case "spacer":
|
144
|
+
return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';
|
145
|
+
|
146
|
+
case "rowseparator":
|
147
|
+
return '<br />';
|
148
|
+
}
|
149
|
+
|
150
|
+
return "";
|
151
|
+
},
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Theme specific execcommand handling.
|
155
|
+
*/
|
156
|
+
execCommand : function(editor_id, element, command, user_interface, value) {
|
157
|
+
switch (command) {
|
158
|
+
case 'mceHelp':
|
159
|
+
tinyMCE.openWindow({
|
160
|
+
file : 'about.htm',
|
161
|
+
width : 480,
|
162
|
+
height : 380
|
163
|
+
}, {
|
164
|
+
tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
|
165
|
+
tinymce_releasedate : tinyMCE.releaseDate,
|
166
|
+
inline : "yes"
|
167
|
+
});
|
168
|
+
return true;
|
169
|
+
|
170
|
+
case "mceLink":
|
171
|
+
var inst = tinyMCE.getInstanceById(editor_id);
|
172
|
+
var doc = inst.getDoc();
|
173
|
+
var selectedText = "";
|
174
|
+
|
175
|
+
if (tinyMCE.isMSIE) {
|
176
|
+
var rng = doc.selection.createRange();
|
177
|
+
selectedText = rng.text;
|
178
|
+
} else
|
179
|
+
selectedText = inst.getSel().toString();
|
180
|
+
|
181
|
+
if (!tinyMCE.linkElement) {
|
182
|
+
if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
|
183
|
+
return true;
|
184
|
+
}
|
185
|
+
|
186
|
+
var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
|
187
|
+
|
188
|
+
if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
|
189
|
+
tinyMCE.linkElement = tinyMCE.selectedElement;
|
190
|
+
|
191
|
+
// Is anchor not a link
|
192
|
+
if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
|
193
|
+
tinyMCE.linkElement = null;
|
194
|
+
|
195
|
+
if (tinyMCE.linkElement) {
|
196
|
+
href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
|
197
|
+
target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
|
198
|
+
title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
|
199
|
+
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
|
200
|
+
style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
|
201
|
+
|
202
|
+
// Try old onclick to if copy/pasted content
|
203
|
+
if (onclick == "")
|
204
|
+
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
|
205
|
+
|
206
|
+
onclick = tinyMCE.cleanupEventStr(onclick);
|
207
|
+
|
208
|
+
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
|
209
|
+
|
210
|
+
// Use mce_href if defined
|
211
|
+
mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
|
212
|
+
if (mceRealHref != "") {
|
213
|
+
href = mceRealHref;
|
214
|
+
|
215
|
+
if (tinyMCE.getParam('convert_urls'))
|
216
|
+
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
|
217
|
+
}
|
218
|
+
|
219
|
+
action = "update";
|
220
|
+
}
|
221
|
+
|
222
|
+
var template = new Array();
|
223
|
+
|
224
|
+
template['file'] = 'link.htm';
|
225
|
+
template['width'] = 310;
|
226
|
+
template['height'] = 200;
|
227
|
+
|
228
|
+
// Language specific width and height addons
|
229
|
+
template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
|
230
|
+
template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
|
231
|
+
|
232
|
+
if (inst.settings['insertlink_callback']) {
|
233
|
+
var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
|
234
|
+
if (returnVal && returnVal['href'])
|
235
|
+
TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
|
236
|
+
} else {
|
237
|
+
tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
|
238
|
+
}
|
239
|
+
|
240
|
+
return true;
|
241
|
+
|
242
|
+
case "mceImage":
|
243
|
+
var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
|
244
|
+
var title = "", onmouseover = "", onmouseout = "", action = "insert";
|
245
|
+
var img = tinyMCE.imgElement;
|
246
|
+
var inst = tinyMCE.getInstanceById(editor_id);
|
247
|
+
|
248
|
+
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
|
249
|
+
img = tinyMCE.selectedElement;
|
250
|
+
tinyMCE.imgElement = img;
|
251
|
+
}
|
252
|
+
|
253
|
+
if (img) {
|
254
|
+
// Is it a internal MCE visual aid image, then skip this one.
|
255
|
+
if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
|
256
|
+
return true;
|
257
|
+
|
258
|
+
src = tinyMCE.getAttrib(img, 'src');
|
259
|
+
alt = tinyMCE.getAttrib(img, 'alt');
|
260
|
+
|
261
|
+
// Try polling out the title
|
262
|
+
if (alt == "")
|
263
|
+
alt = tinyMCE.getAttrib(img, 'title');
|
264
|
+
|
265
|
+
// Fix width/height attributes if the styles is specified
|
266
|
+
if (tinyMCE.isGecko) {
|
267
|
+
var w = img.style.width;
|
268
|
+
if (w != null && w != "")
|
269
|
+
img.setAttribute("width", w);
|
270
|
+
|
271
|
+
var h = img.style.height;
|
272
|
+
if (h != null && h != "")
|
273
|
+
img.setAttribute("height", h);
|
274
|
+
}
|
275
|
+
|
276
|
+
border = tinyMCE.getAttrib(img, 'border');
|
277
|
+
hspace = tinyMCE.getAttrib(img, 'hspace');
|
278
|
+
vspace = tinyMCE.getAttrib(img, 'vspace');
|
279
|
+
width = tinyMCE.getAttrib(img, 'width');
|
280
|
+
height = tinyMCE.getAttrib(img, 'height');
|
281
|
+
align = tinyMCE.getAttrib(img, 'align');
|
282
|
+
onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
|
283
|
+
onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
|
284
|
+
title = tinyMCE.getAttrib(img, 'title');
|
285
|
+
|
286
|
+
// Is realy specified?
|
287
|
+
if (tinyMCE.isMSIE) {
|
288
|
+
width = img.attributes['width'].specified ? width : "";
|
289
|
+
height = img.attributes['height'].specified ? height : "";
|
290
|
+
}
|
291
|
+
|
292
|
+
//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
|
293
|
+
//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
|
294
|
+
|
295
|
+
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
|
296
|
+
|
297
|
+
// Use mce_src if defined
|
298
|
+
mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
|
299
|
+
if (mceRealSrc != "") {
|
300
|
+
src = mceRealSrc;
|
301
|
+
|
302
|
+
if (tinyMCE.getParam('convert_urls'))
|
303
|
+
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
|
304
|
+
}
|
305
|
+
|
306
|
+
//if (onmouseover != "")
|
307
|
+
// onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");
|
308
|
+
|
309
|
+
//if (onmouseout != "")
|
310
|
+
// onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");
|
311
|
+
|
312
|
+
action = "update";
|
313
|
+
}
|
314
|
+
|
315
|
+
var template = new Array();
|
316
|
+
|
317
|
+
template['file'] = 'image.htm?src={$src}';
|
318
|
+
template['width'] = 355;
|
319
|
+
template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0);
|
320
|
+
|
321
|
+
// Language specific width and height addons
|
322
|
+
template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);
|
323
|
+
template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
|
324
|
+
|
325
|
+
if (inst.settings['insertimage_callback']) {
|
326
|
+
var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");
|
327
|
+
if (returnVal && returnVal['src'])
|
328
|
+
TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']);
|
329
|
+
} else
|
330
|
+
tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});
|
331
|
+
|
332
|
+
return true;
|
333
|
+
|
334
|
+
case "forecolor":
|
335
|
+
var fcp = new TinyMCE_Layer(editor_id + '_fcPreview', false), p, img, elm;
|
336
|
+
|
337
|
+
TinyMCE_AdvancedTheme._hideMenus(editor_id);
|
338
|
+
|
339
|
+
if (!fcp.exists()) {
|
340
|
+
fcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
|
341
|
+
elm = fcp.getElement();
|
342
|
+
elm._editor_id = editor_id;
|
343
|
+
elm._command = "forecolor";
|
344
|
+
elm._switchId = editor_id + "_forecolor";
|
345
|
+
tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
|
346
|
+
tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
|
347
|
+
tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
|
348
|
+
}
|
349
|
+
|
350
|
+
img = tinyMCE.selectNodes(document.getElementById(editor_id + "_forecolor"), function(n) {return n.nodeName == "IMG";})[0];
|
351
|
+
p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
|
352
|
+
|
353
|
+
fcp.moveTo(p.absLeft, p.absTop);
|
354
|
+
fcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).foreColor;
|
355
|
+
fcp.show();
|
356
|
+
|
357
|
+
return false;
|
358
|
+
|
359
|
+
case "forecolorMenu":
|
360
|
+
TinyMCE_AdvancedTheme._hideMenus(editor_id);
|
361
|
+
|
362
|
+
// Create color layer
|
363
|
+
var ml = new TinyMCE_Layer(editor_id + '_fcMenu');
|
364
|
+
|
365
|
+
if (!ml.exists())
|
366
|
+
ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_text_colors', 'forecolor'));
|
367
|
+
|
368
|
+
tinyMCE.switchClass(editor_id + '_forecolor', 'mceMenuButtonFocus');
|
369
|
+
ml.moveRelativeTo(document.getElementById(editor_id + "_forecolor"), 'bl');
|
370
|
+
|
371
|
+
ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
|
372
|
+
|
373
|
+
if (tinyMCE.isOpera)
|
374
|
+
ml.moveBy(0, -2);
|
375
|
+
|
376
|
+
ml.show();
|
377
|
+
return true;
|
378
|
+
|
379
|
+
case "HiliteColor":
|
380
|
+
var bcp = new TinyMCE_Layer(editor_id + '_bcPreview', false), p, img;
|
381
|
+
|
382
|
+
TinyMCE_AdvancedTheme._hideMenus(editor_id);
|
383
|
+
|
384
|
+
if (!bcp.exists()) {
|
385
|
+
bcp.create('div', 'mceColorPreview', document.getElementById(editor_id + '_toolbar'));
|
386
|
+
elm = bcp.getElement();
|
387
|
+
elm._editor_id = editor_id;
|
388
|
+
elm._command = "HiliteColor";
|
389
|
+
elm._switchId = editor_id + "_backcolor";
|
390
|
+
tinyMCE.addEvent(elm, 'click', TinyMCE_AdvancedTheme._handleMenuEvent);
|
391
|
+
tinyMCE.addEvent(elm, 'mouseover', TinyMCE_AdvancedTheme._handleMenuEvent);
|
392
|
+
tinyMCE.addEvent(elm, 'mouseout', TinyMCE_AdvancedTheme._handleMenuEvent);
|
393
|
+
}
|
394
|
+
|
395
|
+
img = tinyMCE.selectNodes(document.getElementById(editor_id + "_backcolor"), function(n) {return n.nodeName == "IMG";})[0];
|
396
|
+
p = tinyMCE.getAbsPosition(img, document.getElementById(editor_id + '_toolbar'));
|
397
|
+
|
398
|
+
bcp.moveTo(p.absLeft, p.absTop);
|
399
|
+
bcp.getElement().style.backgroundColor = value != null ? value : tinyMCE.getInstanceById(editor_id).backColor;
|
400
|
+
bcp.show();
|
401
|
+
|
402
|
+
return false;
|
403
|
+
|
404
|
+
case "HiliteColorMenu":
|
405
|
+
TinyMCE_AdvancedTheme._hideMenus(editor_id);
|
406
|
+
|
407
|
+
// Create color layer
|
408
|
+
var ml = new TinyMCE_Layer(editor_id + '_bcMenu');
|
409
|
+
|
410
|
+
if (!ml.exists())
|
411
|
+
ml.create('div', 'mceMenu', document.body, TinyMCE_AdvancedTheme._getColorHTML(editor_id, 'theme_advanced_background_colors', 'HiliteColor'));
|
412
|
+
|
413
|
+
tinyMCE.switchClass(editor_id + '_backcolor', 'mceMenuButtonFocus');
|
414
|
+
ml.moveRelativeTo(document.getElementById(editor_id + "_backcolor"), 'bl');
|
415
|
+
|
416
|
+
ml.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? -1 : 1, -1);
|
417
|
+
|
418
|
+
if (tinyMCE.isOpera)
|
419
|
+
ml.moveBy(0, -2);
|
420
|
+
|
421
|
+
ml.show();
|
422
|
+
return true;
|
423
|
+
|
424
|
+
case "mceColorPicker":
|
425
|
+
if (user_interface) {
|
426
|
+
var template = new Array();
|
427
|
+
var inputColor = value['document'].getElementById(value['element_id']).value;
|
428
|
+
|
429
|
+
template['file'] = 'color_picker.htm';
|
430
|
+
template['width'] = 220;
|
431
|
+
template['height'] = 190;
|
432
|
+
template['close_previous'] = "no";
|
433
|
+
|
434
|
+
template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
|
435
|
+
template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
|
436
|
+
|
437
|
+
if (typeof(value['store_selection']) == "undefined")
|
438
|
+
value['store_selection'] = true;
|
439
|
+
|
440
|
+
tinyMCE.lastColorPickerValue = value;
|
441
|
+
tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor});
|
442
|
+
} else {
|
443
|
+
var savedVal = tinyMCE.lastColorPickerValue;
|
444
|
+
var elm = savedVal['document'].getElementById(savedVal['element_id']);
|
445
|
+
elm.value = value;
|
446
|
+
|
447
|
+
if (elm.onchange != null && elm.onchange != '')
|
448
|
+
eval('elm.onchange();');
|
449
|
+
}
|
450
|
+
return true;
|
451
|
+
|
452
|
+
case "mceCodeEditor":
|
453
|
+
var template = new Array();
|
454
|
+
|
455
|
+
template['file'] = 'source_editor.htm';
|
456
|
+
template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720));
|
457
|
+
template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580));
|
458
|
+
|
459
|
+
tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
|
460
|
+
return true;
|
461
|
+
|
462
|
+
case "mceCharMap":
|
463
|
+
var template = new Array();
|
464
|
+
|
465
|
+
template['file'] = 'charmap.htm';
|
466
|
+
template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
|
467
|
+
template['height'] = 250;
|
468
|
+
|
469
|
+
template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
|
470
|
+
template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
|
471
|
+
|
472
|
+
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
473
|
+
return true;
|
474
|
+
|
475
|
+
case "mceInsertAnchor":
|
476
|
+
var template = new Array();
|
477
|
+
|
478
|
+
template['file'] = 'anchor.htm';
|
479
|
+
template['width'] = 320;
|
480
|
+
template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
|
481
|
+
|
482
|
+
template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0);
|
483
|
+
template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0);
|
484
|
+
|
485
|
+
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
|
486
|
+
return true;
|
487
|
+
|
488
|
+
case "mceNewDocument":
|
489
|
+
if (confirm(tinyMCE.getLang('lang_newdocument')))
|
490
|
+
tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' ');
|
491
|
+
|
492
|
+
return true;
|
493
|
+
}
|
494
|
+
|
495
|
+
return false;
|
496
|
+
},
|
497
|
+
|
498
|
+
/**
|
499
|
+
* Editor instance template function.
|
500
|
+
*/
|
501
|
+
getEditorTemplate : function(settings, editorId) {
|
502
|
+
function removeFromArray(in_array, remove_array) {
|
503
|
+
var outArray = new Array(), skip;
|
504
|
+
|
505
|
+
for (var i=0; i<in_array.length; i++) {
|
506
|
+
skip = false;
|
507
|
+
|
508
|
+
for (var j=0; j<remove_array.length; j++) {
|
509
|
+
if (in_array[i] == remove_array[j]) {
|
510
|
+
skip = true;
|
511
|
+
}
|
512
|
+
}
|
513
|
+
|
514
|
+
if (!skip) {
|
515
|
+
outArray[outArray.length] = in_array[i];
|
516
|
+
}
|
517
|
+
}
|
518
|
+
|
519
|
+
return outArray;
|
520
|
+
}
|
521
|
+
|
522
|
+
function addToArray(in_array, add_array) {
|
523
|
+
for (var i=0; i<add_array.length; i++) {
|
524
|
+
in_array[in_array.length] = add_array[i];
|
525
|
+
}
|
526
|
+
|
527
|
+
return in_array;
|
528
|
+
}
|
529
|
+
|
530
|
+
var template = new Array();
|
531
|
+
var deltaHeight = 0;
|
532
|
+
var resizing = tinyMCE.getParam("theme_advanced_resizing", false);
|
533
|
+
var path = tinyMCE.getParam("theme_advanced_path", true);
|
534
|
+
var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '"> </div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
|
535
|
+
var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
|
536
|
+
|
537
|
+
// Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
|
538
|
+
var styleSelectHTML = '<option value="">{$lang_theme_style_select}</option>';
|
539
|
+
if (settings['theme_advanced_styles']) {
|
540
|
+
var stylesAr = settings['theme_advanced_styles'].split(';');
|
541
|
+
|
542
|
+
for (var i=0; i<stylesAr.length; i++) {
|
543
|
+
var key, value;
|
544
|
+
|
545
|
+
key = stylesAr[i].split('=')[0];
|
546
|
+
value = stylesAr[i].split('=')[1];
|
547
|
+
|
548
|
+
styleSelectHTML += '<option value="' + value + '">' + key + '</option>';
|
549
|
+
}
|
550
|
+
|
551
|
+
TinyMCE_AdvancedTheme._autoImportCSSClasses = false;
|
552
|
+
}
|
553
|
+
|
554
|
+
switch(layoutManager) {
|
555
|
+
case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)...
|
556
|
+
var toolbarHTML = "";
|
557
|
+
var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom");
|
558
|
+
var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center");
|
559
|
+
var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity
|
560
|
+
var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
|
561
|
+
var defVals = {
|
562
|
+
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
|
563
|
+
theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
|
564
|
+
theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
|
565
|
+
};
|
566
|
+
|
567
|
+
// Add accessibility control
|
568
|
+
toolbarHTML += '<a href="#" accesskey="q" title="' + tinyMCE.getLang("lang_toolbar_focus") + '"';
|
569
|
+
|
570
|
+
if (!tinyMCE.getParam("accessibility_focus"))
|
571
|
+
toolbarHTML += ' onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"';
|
572
|
+
|
573
|
+
toolbarHTML += '></a>';
|
574
|
+
|
575
|
+
// Render rows
|
576
|
+
for (var i=1; i<100; i++) {
|
577
|
+
var def = defVals["theme_advanced_buttons" + i];
|
578
|
+
|
579
|
+
var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
|
580
|
+
if (buttons.length == 0)
|
581
|
+
break;
|
582
|
+
|
583
|
+
buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
|
584
|
+
buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ','));
|
585
|
+
buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons);
|
586
|
+
|
587
|
+
for (var b=0; b<buttons.length; b++)
|
588
|
+
toolbarHTML += tinyMCE.getControlHTML(buttons[b]);
|
589
|
+
|
590
|
+
if (buttons.length > 0) {
|
591
|
+
toolbarHTML += "<br />";
|
592
|
+
deltaHeight -= 23;
|
593
|
+
}
|
594
|
+
}
|
595
|
+
|
596
|
+
// Add accessibility control
|
597
|
+
toolbarHTML += '<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"></a>';
|
598
|
+
|
599
|
+
// Setup template html
|
600
|
+
template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width_style};height:{$height_style}"><tbody>';
|
601
|
+
|
602
|
+
if (toolbarLocation == "top") {
|
603
|
+
template['html'] += '<tr><td class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
|
604
|
+
}
|
605
|
+
|
606
|
+
if (statusbarLocation == "top") {
|
607
|
+
template['html'] += '<tr><td class="mceStatusbarTop" height="1">' + statusbarHTML + '</td></tr>';
|
608
|
+
deltaHeight -= 23;
|
609
|
+
}
|
610
|
+
|
611
|
+
template['html'] += '<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';
|
612
|
+
|
613
|
+
if (toolbarLocation == "bottom") {
|
614
|
+
template['html'] += '<tr><td class="mceToolbarBottom" align="' + toolbarAlign + '" height="1"><span id="' + editorId + '_toolbar" class="mceToolbarContainer">' + toolbarHTML + '</span></td></tr>';
|
615
|
+
}
|
616
|
+
|
617
|
+
// External toolbar changes
|
618
|
+
if (toolbarLocation == "external") {
|
619
|
+
var bod = document.body;
|
620
|
+
var elm = document.createElement ("div");
|
621
|
+
|
622
|
+
toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML);
|
623
|
+
toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId});
|
624
|
+
|
625
|
+
elm.className = "mceToolbarExternal";
|
626
|
+
elm.id = editorId+"_toolbar";
|
627
|
+
elm.innerHTML = '<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';
|
628
|
+
bod.appendChild (elm);
|
629
|
+
// bod.style.marginTop = elm.offsetHeight + "px";
|
630
|
+
|
631
|
+
deltaHeight = 0;
|
632
|
+
tinyMCE.getInstanceById(editorId).toolbarElement = elm;
|
633
|
+
|
634
|
+
//template['html'] = '<div id="mceExternalToolbar" align="center" class="mceToolbarExternal"><table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table></div>' + template["html"];
|
635
|
+
} else {
|
636
|
+
tinyMCE.getInstanceById(editorId).toolbarElement = null;
|
637
|
+
}
|
638
|
+
|
639
|
+
if (statusbarLocation == "bottom") {
|
640
|
+
template['html'] += '<tr><td class="mceStatusbarBottom" height="1">' + statusbarHTML + '</td></tr>';
|
641
|
+
deltaHeight -= 23;
|
642
|
+
}
|
643
|
+
|
644
|
+
template['html'] += '</tbody></table>';
|
645
|
+
//"SimpleLayout"
|
646
|
+
break;
|
647
|
+
|
648
|
+
case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom.
|
649
|
+
template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
|
650
|
+
|
651
|
+
var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ",");
|
652
|
+
var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container");
|
653
|
+
var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center");
|
654
|
+
|
655
|
+
//Render Containers:
|
656
|
+
for (var i = 0; i < containers.length; i++)
|
657
|
+
{
|
658
|
+
if (containers[i] == "mceEditor") //Exceptions for mceEditor and ...
|
659
|
+
template['html'] += '<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';
|
660
|
+
else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath:
|
661
|
+
{
|
662
|
+
var pathClass = "mceStatusbar";
|
663
|
+
|
664
|
+
if (i == containers.length-1)
|
665
|
+
{
|
666
|
+
pathClass = "mceStatusbarBottom";
|
667
|
+
}
|
668
|
+
else if (i == 0)
|
669
|
+
{
|
670
|
+
pathClass = "mceStatusbar";
|
671
|
+
}
|
672
|
+
else
|
673
|
+
{
|
674
|
+
deltaHeight-=2;
|
675
|
+
}
|
676
|
+
|
677
|
+
template['html'] += '<tr><td class="' + pathClass + '" height="1">' + statusbarHTML + '</td></tr>';
|
678
|
+
deltaHeight -= 22;
|
679
|
+
} else { // Render normal Container
|
680
|
+
var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ',');
|
681
|
+
var curContainerHTML = "";
|
682
|
+
var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign);
|
683
|
+
var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS);
|
684
|
+
|
685
|
+
curContainer = removeFromArray(curContainer, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
|
686
|
+
|
687
|
+
for (var j=0; j<curContainer.length; j++)
|
688
|
+
curContainerHTML += tinyMCE.getControlHTML(curContainer[j]);
|
689
|
+
|
690
|
+
if (curContainer.length > 0) {
|
691
|
+
curContainerHTML += "<br />";
|
692
|
+
deltaHeight -= 23;
|
693
|
+
}
|
694
|
+
|
695
|
+
template['html'] += '<tr><td class="' + curCSS + '" align="' + curAlign + '" height="1">' + curContainerHTML + '</td></tr>';
|
696
|
+
}
|
697
|
+
}
|
698
|
+
|
699
|
+
template['html'] += '</tbody></table>';
|
700
|
+
//RowLayout
|
701
|
+
break;
|
702
|
+
|
703
|
+
case "CustomLayout" : //User defined layout callback...
|
704
|
+
var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
|
705
|
+
|
706
|
+
if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") {
|
707
|
+
template = eval(customLayout + "(template);");
|
708
|
+
}
|
709
|
+
break;
|
710
|
+
}
|
711
|
+
|
712
|
+
if (resizing)
|
713
|
+
template['html'] += '<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';
|
714
|
+
|
715
|
+
template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
|
716
|
+
template['delta_width'] = 0;
|
717
|
+
template['delta_height'] = deltaHeight;
|
718
|
+
|
719
|
+
return template;
|
720
|
+
},
|
721
|
+
|
722
|
+
initInstance : function(inst) {
|
723
|
+
if (tinyMCE.getParam("theme_advanced_resizing", false)) {
|
724
|
+
if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
|
725
|
+
var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width");
|
726
|
+
var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height");
|
727
|
+
|
728
|
+
TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
|
729
|
+
}
|
730
|
+
}
|
731
|
+
|
732
|
+
inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
|
733
|
+
},
|
734
|
+
|
735
|
+
_handleMenuEvent : function(e) {
|
736
|
+
var te = tinyMCE.isMSIE ? window.event.srcElement : e.target;
|
737
|
+
tinyMCE._menuButtonEvent(e.type == "mouseover" ? "over" : "out", document.getElementById(te._switchId));
|
738
|
+
|
739
|
+
if (e.type == "click")
|
740
|
+
tinyMCE.execInstanceCommand(te._editor_id, te._command);
|
741
|
+
},
|
742
|
+
|
743
|
+
_hideMenus : function(id) {
|
744
|
+
var fcml = new TinyMCE_Layer(id + '_fcMenu'), bcml = new TinyMCE_Layer(id + '_bcMenu');
|
745
|
+
|
746
|
+
if (fcml.exists() && fcml.isVisible()) {
|
747
|
+
tinyMCE.switchClass(id + '_forecolor', 'mceMenuButton');
|
748
|
+
fcml.hide();
|
749
|
+
}
|
750
|
+
|
751
|
+
if (bcml.exists() && bcml.isVisible()) {
|
752
|
+
tinyMCE.switchClass(id + '_backcolor', 'mceMenuButton');
|
753
|
+
bcml.hide();
|
754
|
+
}
|
755
|
+
},
|
756
|
+
|
757
|
+
/**
|
758
|
+
* Node change handler.
|
759
|
+
*/
|
760
|
+
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
|
761
|
+
var alignNode, breakOut, classNode;
|
762
|
+
|
763
|
+
function selectByValue(select_elm, value, first_index) {
|
764
|
+
first_index = typeof(first_index) == "undefined" ? false : true;
|
765
|
+
|
766
|
+
if (select_elm) {
|
767
|
+
for (var i=0; i<select_elm.options.length; i++) {
|
768
|
+
var ov = "" + select_elm.options[i].value;
|
769
|
+
|
770
|
+
if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) {
|
771
|
+
select_elm.selectedIndex = i;
|
772
|
+
return true;
|
773
|
+
}
|
774
|
+
|
775
|
+
if (ov == value) {
|
776
|
+
select_elm.selectedIndex = i;
|
777
|
+
return true;
|
778
|
+
}
|
779
|
+
}
|
780
|
+
}
|
781
|
+
|
782
|
+
return false;
|
783
|
+
};
|
784
|
+
|
785
|
+
function getAttrib(elm, name) {
|
786
|
+
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
|
787
|
+
};
|
788
|
+
|
789
|
+
// No node provided
|
790
|
+
if (node == null)
|
791
|
+
return;
|
792
|
+
|
793
|
+
// Update path
|
794
|
+
var pathElm = document.getElementById(editor_id + "_path");
|
795
|
+
var inst = tinyMCE.getInstanceById(editor_id);
|
796
|
+
var doc = inst.getDoc();
|
797
|
+
TinyMCE_AdvancedTheme._hideMenus(editor_id);
|
798
|
+
|
799
|
+
if (pathElm) {
|
800
|
+
// Get node path
|
801
|
+
var parentNode = node;
|
802
|
+
var path = new Array();
|
803
|
+
|
804
|
+
while (parentNode != null) {
|
805
|
+
if (parentNode.nodeName.toUpperCase() == "BODY") {
|
806
|
+
break;
|
807
|
+
}
|
808
|
+
|
809
|
+
// Only append element nodes to path
|
810
|
+
if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) {
|
811
|
+
path[path.length] = parentNode;
|
812
|
+
}
|
813
|
+
|
814
|
+
parentNode = parentNode.parentNode;
|
815
|
+
}
|
816
|
+
|
817
|
+
// Setup HTML
|
818
|
+
var html = "";
|
819
|
+
for (var i=path.length-1; i>=0; i--) {
|
820
|
+
var nodeName = path[i].nodeName.toLowerCase();
|
821
|
+
var nodeData = "";
|
822
|
+
|
823
|
+
if (nodeName.indexOf("html:") == 0)
|
824
|
+
nodeName = nodeName.substring(5);
|
825
|
+
|
826
|
+
if (nodeName == "b") {
|
827
|
+
nodeName = "strong";
|
828
|
+
}
|
829
|
+
|
830
|
+
if (nodeName == "i") {
|
831
|
+
nodeName = "em";
|
832
|
+
}
|
833
|
+
|
834
|
+
if (nodeName == "span") {
|
835
|
+
var cn = tinyMCE.getAttrib(path[i], "class");
|
836
|
+
if (cn != "" && cn.indexOf('mceItem') == -1)
|
837
|
+
nodeData += "class: " + cn + " ";
|
838
|
+
|
839
|
+
var st = tinyMCE.getAttrib(path[i], "style");
|
840
|
+
if (st != "") {
|
841
|
+
st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
|
842
|
+
nodeData += "style: " + st + " ";
|
843
|
+
}
|
844
|
+
}
|
845
|
+
|
846
|
+
if (nodeName == "font") {
|
847
|
+
if (tinyMCE.getParam("convert_fonts_to_spans"))
|
848
|
+
nodeName = "span";
|
849
|
+
|
850
|
+
var face = tinyMCE.getAttrib(path[i], "face");
|
851
|
+
if (face != "")
|
852
|
+
nodeData += "font: " + face + " ";
|
853
|
+
|
854
|
+
var size = tinyMCE.getAttrib(path[i], "size");
|
855
|
+
if (size != "")
|
856
|
+
nodeData += "size: " + size + " ";
|
857
|
+
|
858
|
+
var color = tinyMCE.getAttrib(path[i], "color");
|
859
|
+
if (color != "")
|
860
|
+
nodeData += "color: " + color + " ";
|
861
|
+
}
|
862
|
+
|
863
|
+
if (getAttrib(path[i], 'id') != "") {
|
864
|
+
nodeData += "id: " + path[i].getAttribute('id') + " ";
|
865
|
+
}
|
866
|
+
|
867
|
+
var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
|
868
|
+
if (className != "" && className.indexOf('mceItem') == -1)
|
869
|
+
nodeData += "class: " + className + " ";
|
870
|
+
|
871
|
+
if (getAttrib(path[i], 'src') != "") {
|
872
|
+
var src = tinyMCE.getAttrib(path[i], "mce_src");
|
873
|
+
|
874
|
+
if (src == "")
|
875
|
+
src = tinyMCE.getAttrib(path[i], "src");
|
876
|
+
|
877
|
+
nodeData += "src: " + src + " ";
|
878
|
+
}
|
879
|
+
|
880
|
+
if (path[i].nodeName == 'A' && getAttrib(path[i], 'href') != "") {
|
881
|
+
var href = tinyMCE.getAttrib(path[i], "mce_href");
|
882
|
+
|
883
|
+
if (href == "")
|
884
|
+
href = tinyMCE.getAttrib(path[i], "href");
|
885
|
+
|
886
|
+
nodeData += "href: " + href + " ";
|
887
|
+
}
|
888
|
+
|
889
|
+
className = tinyMCE.getAttrib(path[i], "class");
|
890
|
+
if ((nodeName == "img" || nodeName == "span") && className.indexOf('mceItem') != -1) {
|
891
|
+
nodeName = className.replace(/mceItem([a-z]+)/gi, '$1').toLowerCase();
|
892
|
+
nodeData = path[i].getAttribute('title');
|
893
|
+
}
|
894
|
+
|
895
|
+
if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
|
896
|
+
nodeName = "a";
|
897
|
+
nodeName += "#" + anchor;
|
898
|
+
nodeData = "";
|
899
|
+
}
|
900
|
+
|
901
|
+
if (getAttrib(path[i], 'name').indexOf("mce_") != 0) {
|
902
|
+
var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
|
903
|
+
if (className != "" && className.indexOf('mceItem') == -1) {
|
904
|
+
nodeName += "." + className;
|
905
|
+
}
|
906
|
+
}
|
907
|
+
|
908
|
+
var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
|
909
|
+
html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>';
|
910
|
+
|
911
|
+
if (i > 0) {
|
912
|
+
html += " » ";
|
913
|
+
}
|
914
|
+
}
|
915
|
+
|
916
|
+
pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' ';
|
917
|
+
}
|
918
|
+
|
919
|
+
// Reset old states
|
920
|
+
tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal');
|
921
|
+
tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal');
|
922
|
+
tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal');
|
923
|
+
tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal');
|
924
|
+
tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
|
925
|
+
tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
|
926
|
+
tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
|
927
|
+
tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
|
928
|
+
tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
|
929
|
+
tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
|
930
|
+
tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal');
|
931
|
+
tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal');
|
932
|
+
tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal');
|
933
|
+
tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled');
|
934
|
+
tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled');
|
935
|
+
tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled');
|
936
|
+
tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal');
|
937
|
+
tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal');
|
938
|
+
|
939
|
+
if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
|
940
|
+
tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected');
|
941
|
+
|
942
|
+
// Get link
|
943
|
+
var anchorLink = tinyMCE.getParentElement(node, "a", "href");
|
944
|
+
|
945
|
+
if (anchorLink || any_selection) {
|
946
|
+
tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
|
947
|
+
tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
|
948
|
+
}
|
949
|
+
|
950
|
+
// Handle visual aid
|
951
|
+
tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal');
|
952
|
+
|
953
|
+
if (undo_levels != -1) {
|
954
|
+
tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled');
|
955
|
+
tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled');
|
956
|
+
}
|
957
|
+
|
958
|
+
// Within li, blockquote
|
959
|
+
if (tinyMCE.getParentElement(node, "li,blockquote"))
|
960
|
+
tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal');
|
961
|
+
|
962
|
+
// Has redo levels
|
963
|
+
if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
|
964
|
+
tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal');
|
965
|
+
|
966
|
+
// Has undo levels
|
967
|
+
if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
|
968
|
+
tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal');
|
969
|
+
|
970
|
+
// Select class in select box
|
971
|
+
var selectElm = document.getElementById(editor_id + "_styleSelect");
|
972
|
+
|
973
|
+
if (selectElm) {
|
974
|
+
TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);
|
975
|
+
|
976
|
+
classNode = node;
|
977
|
+
breakOut = false;
|
978
|
+
var index = 0;
|
979
|
+
|
980
|
+
do {
|
981
|
+
if (classNode && classNode.className) {
|
982
|
+
for (var i=0; i<selectElm.options.length; i++) {
|
983
|
+
if (selectElm.options[i].value == classNode.className) {
|
984
|
+
index = i;
|
985
|
+
breakOut = true;
|
986
|
+
break;
|
987
|
+
}
|
988
|
+
}
|
989
|
+
}
|
990
|
+
} while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null);
|
991
|
+
|
992
|
+
selectElm.selectedIndex = index;
|
993
|
+
}
|
994
|
+
|
995
|
+
// Select formatblock
|
996
|
+
var selectElm = document.getElementById(editor_id + "_formatSelect");
|
997
|
+
if (selectElm) {
|
998
|
+
var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");
|
999
|
+
|
1000
|
+
if (elm)
|
1001
|
+
selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");
|
1002
|
+
else
|
1003
|
+
selectByValue(selectElm, "");
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
// Select fontselect
|
1007
|
+
var selectElm = document.getElementById(editor_id + "_fontNameSelect");
|
1008
|
+
if (selectElm) {
|
1009
|
+
if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
|
1010
|
+
var face = inst.queryCommandValue('FontName');
|
1011
|
+
|
1012
|
+
face = face == null || face == "" ? "" : face;
|
1013
|
+
|
1014
|
+
selectByValue(selectElm, face, face != "");
|
1015
|
+
} else {
|
1016
|
+
var elm = tinyMCE.getParentElement(node, "font", "face");
|
1017
|
+
|
1018
|
+
if (elm) {
|
1019
|
+
var family = tinyMCE.getAttrib(elm, "face");
|
1020
|
+
|
1021
|
+
if (family == '')
|
1022
|
+
family = '' + elm.style.fontFamily;
|
1023
|
+
|
1024
|
+
if (!selectByValue(selectElm, family, family != ""))
|
1025
|
+
selectByValue(selectElm, "");
|
1026
|
+
} else
|
1027
|
+
selectByValue(selectElm, "");
|
1028
|
+
}
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
// Select fontsize
|
1032
|
+
var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
|
1033
|
+
if (selectElm) {
|
1034
|
+
if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
|
1035
|
+
var size = inst.queryCommandValue('FontSize');
|
1036
|
+
selectByValue(selectElm, size == null || size == "" ? "0" : size);
|
1037
|
+
} else {
|
1038
|
+
var elm = tinyMCE.getParentElement(node, "font", "size");
|
1039
|
+
if (elm) {
|
1040
|
+
var size = tinyMCE.getAttrib(elm, "size");
|
1041
|
+
|
1042
|
+
if (size == '') {
|
1043
|
+
var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
|
1044
|
+
|
1045
|
+
size = '' + elm.style.fontSize;
|
1046
|
+
|
1047
|
+
for (var i=0; i<sizes.length; i++) {
|
1048
|
+
if (('' + sizes[i]) == size) {
|
1049
|
+
size = i;
|
1050
|
+
break;
|
1051
|
+
}
|
1052
|
+
}
|
1053
|
+
}
|
1054
|
+
|
1055
|
+
if (!selectByValue(selectElm, size))
|
1056
|
+
selectByValue(selectElm, "");
|
1057
|
+
} else
|
1058
|
+
selectByValue(selectElm, "0");
|
1059
|
+
}
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
// Handle align attributes
|
1063
|
+
alignNode = node;
|
1064
|
+
breakOut = false;
|
1065
|
+
do {
|
1066
|
+
if (!alignNode.getAttribute || !alignNode.getAttribute('align'))
|
1067
|
+
continue;
|
1068
|
+
|
1069
|
+
switch (alignNode.getAttribute('align').toLowerCase()) {
|
1070
|
+
case "left":
|
1071
|
+
tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected');
|
1072
|
+
breakOut = true;
|
1073
|
+
break;
|
1074
|
+
|
1075
|
+
case "right":
|
1076
|
+
tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected');
|
1077
|
+
breakOut = true;
|
1078
|
+
break;
|
1079
|
+
|
1080
|
+
case "middle":
|
1081
|
+
case "center":
|
1082
|
+
tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
|
1083
|
+
breakOut = true;
|
1084
|
+
break;
|
1085
|
+
|
1086
|
+
case "justify":
|
1087
|
+
tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected');
|
1088
|
+
breakOut = true;
|
1089
|
+
break;
|
1090
|
+
}
|
1091
|
+
} while (!breakOut && (alignNode = alignNode.parentNode) != null);
|
1092
|
+
|
1093
|
+
// Div justification
|
1094
|
+
var div = tinyMCE.getParentElement(node, "div");
|
1095
|
+
if (div && div.style.textAlign == "center")
|
1096
|
+
tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
|
1097
|
+
|
1098
|
+
// Do special text
|
1099
|
+
if (!setup_content) {
|
1100
|
+
// , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub"
|
1101
|
+
var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub");
|
1102
|
+
for (var i=0; i<ar.length; i+=2) {
|
1103
|
+
if (inst.queryCommandState(ar[i]))
|
1104
|
+
tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected');
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A"))
|
1108
|
+
tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
|
1109
|
+
}
|
1110
|
+
|
1111
|
+
// Handle elements
|
1112
|
+
do {
|
1113
|
+
switch (node.nodeName) {
|
1114
|
+
case "UL":
|
1115
|
+
tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
|
1116
|
+
break;
|
1117
|
+
|
1118
|
+
case "OL":
|
1119
|
+
tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
|
1120
|
+
break;
|
1121
|
+
|
1122
|
+
case "HR":
|
1123
|
+
tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected');
|
1124
|
+
break;
|
1125
|
+
|
1126
|
+
case "IMG":
|
1127
|
+
if (getAttrib(node, 'name').indexOf('mce_') != 0 && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
|
1128
|
+
tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
|
1129
|
+
}
|
1130
|
+
break;
|
1131
|
+
}
|
1132
|
+
} while ((node = node.parentNode) != null);
|
1133
|
+
},
|
1134
|
+
|
1135
|
+
// Private theme internal functions
|
1136
|
+
|
1137
|
+
// This function auto imports CSS classes into the class selection droplist
|
1138
|
+
_setupCSSClasses : function(editor_id) {
|
1139
|
+
var i, selectElm;
|
1140
|
+
|
1141
|
+
if (!TinyMCE_AdvancedTheme._autoImportCSSClasses)
|
1142
|
+
return;
|
1143
|
+
|
1144
|
+
selectElm = document.getElementById(editor_id + '_styleSelect');
|
1145
|
+
|
1146
|
+
if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
|
1147
|
+
var csses = tinyMCE.getCSSClasses(editor_id);
|
1148
|
+
if (csses && selectElm) {
|
1149
|
+
for (i=0; i<csses.length; i++)
|
1150
|
+
selectElm.options[selectElm.options.length] = new Option(csses[i], csses[i]);
|
1151
|
+
}
|
1152
|
+
|
1153
|
+
// Only do this once
|
1154
|
+
if (csses != null && csses.length > 0)
|
1155
|
+
selectElm.setAttribute('cssImported', 'true');
|
1156
|
+
}
|
1157
|
+
},
|
1158
|
+
|
1159
|
+
_setCookie : function(name, value, expires, path, domain, secure) {
|
1160
|
+
var curCookie = name + "=" + escape(value) +
|
1161
|
+
((expires) ? "; expires=" + expires.toGMTString() : "") +
|
1162
|
+
((path) ? "; path=" + escape(path) : "") +
|
1163
|
+
((domain) ? "; domain=" + domain : "") +
|
1164
|
+
((secure) ? "; secure" : "");
|
1165
|
+
|
1166
|
+
document.cookie = curCookie;
|
1167
|
+
},
|
1168
|
+
|
1169
|
+
_getCookie : function(name) {
|
1170
|
+
var dc = document.cookie;
|
1171
|
+
var prefix = name + "=";
|
1172
|
+
var begin = dc.indexOf("; " + prefix);
|
1173
|
+
|
1174
|
+
if (begin == -1) {
|
1175
|
+
begin = dc.indexOf(prefix);
|
1176
|
+
|
1177
|
+
if (begin != 0)
|
1178
|
+
return null;
|
1179
|
+
} else
|
1180
|
+
begin += 2;
|
1181
|
+
|
1182
|
+
var end = document.cookie.indexOf(";", begin);
|
1183
|
+
|
1184
|
+
if (end == -1)
|
1185
|
+
end = dc.length;
|
1186
|
+
|
1187
|
+
return unescape(dc.substring(begin + prefix.length, end));
|
1188
|
+
},
|
1189
|
+
|
1190
|
+
_resizeTo : function(inst, w, h, set_w) {
|
1191
|
+
var editorContainer = document.getElementById(inst.editorId + '_parent');
|
1192
|
+
var tableElm = editorContainer.firstChild;
|
1193
|
+
var iframe = inst.iframeElement;
|
1194
|
+
|
1195
|
+
if (w == null || w == "null") {
|
1196
|
+
set_w = false;
|
1197
|
+
w = 0;
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
if (h == null || h == "null")
|
1201
|
+
return;
|
1202
|
+
|
1203
|
+
w = parseInt(w);
|
1204
|
+
h = parseInt(h);
|
1205
|
+
|
1206
|
+
if (tinyMCE.isGecko) {
|
1207
|
+
w += 2;
|
1208
|
+
h += 2;
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
var dx = w - tableElm.clientWidth;
|
1212
|
+
var dy = h - tableElm.clientHeight;
|
1213
|
+
|
1214
|
+
w = w < 1 ? 30 : w;
|
1215
|
+
h = h < 1 ? 30 : h;
|
1216
|
+
|
1217
|
+
if (set_w)
|
1218
|
+
tableElm.style.width = w + "px";
|
1219
|
+
|
1220
|
+
tableElm.style.height = h + "px";
|
1221
|
+
|
1222
|
+
iw = iframe.clientWidth + dx;
|
1223
|
+
ih = iframe.clientHeight + dy;
|
1224
|
+
|
1225
|
+
iw = iw < 1 ? 30 : iw;
|
1226
|
+
ih = ih < 1 ? 30 : ih;
|
1227
|
+
|
1228
|
+
if (tinyMCE.isGecko) {
|
1229
|
+
iw -= 2;
|
1230
|
+
ih -= 2;
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
if (set_w)
|
1234
|
+
iframe.style.width = iw + "px";
|
1235
|
+
|
1236
|
+
iframe.style.height = ih + "px";
|
1237
|
+
|
1238
|
+
// Is it to small, make it bigger again
|
1239
|
+
if (set_w) {
|
1240
|
+
var tableBodyElm = tableElm.firstChild;
|
1241
|
+
var minIframeWidth = tableBodyElm.scrollWidth;
|
1242
|
+
if (inst.iframeElement.clientWidth < minIframeWidth) {
|
1243
|
+
dx = minIframeWidth - inst.iframeElement.clientWidth;
|
1244
|
+
|
1245
|
+
inst.iframeElement.style.width = (iw + dx) + "px";
|
1246
|
+
}
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
// Remove pesky table controls
|
1250
|
+
inst.useCSS = false;
|
1251
|
+
},
|
1252
|
+
|
1253
|
+
/**
|
1254
|
+
* Handles resizing events.
|
1255
|
+
*/
|
1256
|
+
_resizeEventHandler : function(e) {
|
1257
|
+
var resizer = TinyMCE_AdvancedTheme._resizer;
|
1258
|
+
|
1259
|
+
// Do nothing
|
1260
|
+
if (!resizer.resizing)
|
1261
|
+
return;
|
1262
|
+
|
1263
|
+
e = typeof(e) == "undefined" ? window.event : e;
|
1264
|
+
|
1265
|
+
var dx = e.screenX - resizer.downX;
|
1266
|
+
var dy = e.screenY - resizer.downY;
|
1267
|
+
var resizeBox = resizer.resizeBox;
|
1268
|
+
var editorId = resizer.editorId;
|
1269
|
+
|
1270
|
+
switch (e.type) {
|
1271
|
+
case "mousemove":
|
1272
|
+
var w, h;
|
1273
|
+
|
1274
|
+
w = resizer.width + dx;
|
1275
|
+
h = resizer.height + dy;
|
1276
|
+
|
1277
|
+
w = w < 1 ? 1 : w;
|
1278
|
+
h = h < 1 ? 1 : h;
|
1279
|
+
|
1280
|
+
if (resizer.horizontal)
|
1281
|
+
resizeBox.style.width = w + "px";
|
1282
|
+
|
1283
|
+
resizeBox.style.height = h + "px";
|
1284
|
+
break;
|
1285
|
+
|
1286
|
+
case "mouseup":
|
1287
|
+
TinyMCE_AdvancedTheme._setResizing(e, editorId, false);
|
1288
|
+
TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal);
|
1289
|
+
|
1290
|
+
// Expire in a month
|
1291
|
+
if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
|
1292
|
+
var expires = new Date();
|
1293
|
+
expires.setTime(expires.getTime() + 3600000 * 24 * 30);
|
1294
|
+
|
1295
|
+
// Set the cookies
|
1296
|
+
TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
|
1297
|
+
TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
|
1298
|
+
}
|
1299
|
+
break;
|
1300
|
+
}
|
1301
|
+
},
|
1302
|
+
|
1303
|
+
/**
|
1304
|
+
* Starts/stops the editor resizing.
|
1305
|
+
*/
|
1306
|
+
_setResizing : function(e, editor_id, state) {
|
1307
|
+
e = typeof(e) == "undefined" ? window.event : e;
|
1308
|
+
|
1309
|
+
var resizer = TinyMCE_AdvancedTheme._resizer;
|
1310
|
+
var editorContainer = document.getElementById(editor_id + '_parent');
|
1311
|
+
var editorArea = document.getElementById(editor_id + '_parent').firstChild;
|
1312
|
+
var resizeBox = document.getElementById(editor_id + '_resize_box');
|
1313
|
+
var inst = tinyMCE.getInstanceById(editor_id);
|
1314
|
+
|
1315
|
+
if (state) {
|
1316
|
+
// Place box over editor area
|
1317
|
+
var width = editorArea.clientWidth;
|
1318
|
+
var height = editorArea.clientHeight;
|
1319
|
+
|
1320
|
+
resizeBox.style.width = width + "px";
|
1321
|
+
resizeBox.style.height = height + "px";
|
1322
|
+
|
1323
|
+
resizer.iframeWidth = inst.iframeElement.clientWidth;
|
1324
|
+
resizer.iframeHeight = inst.iframeElement.clientHeight;
|
1325
|
+
|
1326
|
+
// Hide editor and show resize box
|
1327
|
+
editorArea.style.display = "none";
|
1328
|
+
resizeBox.style.display = "block";
|
1329
|
+
|
1330
|
+
// Add event handlers, only once
|
1331
|
+
if (!resizer.eventHandlers) {
|
1332
|
+
if (tinyMCE.isMSIE)
|
1333
|
+
tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
|
1334
|
+
else
|
1335
|
+
tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
|
1336
|
+
|
1337
|
+
tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler);
|
1338
|
+
|
1339
|
+
resizer.eventHandlers = true;
|
1340
|
+
}
|
1341
|
+
|
1342
|
+
resizer.resizing = true;
|
1343
|
+
resizer.downX = e.screenX;
|
1344
|
+
resizer.downY = e.screenY;
|
1345
|
+
resizer.width = parseInt(resizeBox.style.width);
|
1346
|
+
resizer.height = parseInt(resizeBox.style.height);
|
1347
|
+
resizer.editorId = editor_id;
|
1348
|
+
resizer.resizeBox = resizeBox;
|
1349
|
+
resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true);
|
1350
|
+
} else {
|
1351
|
+
resizer.resizing = false;
|
1352
|
+
resizeBox.style.display = "none";
|
1353
|
+
editorArea.style.display = tinyMCE.isMSIE && !tinyMCE.isOpera ? "block" : "table";
|
1354
|
+
tinyMCE.execCommand('mceResetDesignMode');
|
1355
|
+
}
|
1356
|
+
},
|
1357
|
+
|
1358
|
+
_getColorHTML : function(id, n, cm) {
|
1359
|
+
var i, h, cl;
|
1360
|
+
|
1361
|
+
h = '<span class="mceMenuLine"></span>';
|
1362
|
+
cl = tinyMCE.getParam(n, TinyMCE_AdvancedTheme._defColors).split(',');
|
1363
|
+
|
1364
|
+
h += '<table class="mceColors"><tr>';
|
1365
|
+
for (i=0; i<cl.length; i++) {
|
1366
|
+
c = 'tinyMCE.execInstanceCommand(\'' + id + '\', \'' + cm + '\', false, \'#' + cl[i] + '\');';
|
1367
|
+
h += '<td><a href="javascript:' + c + '" style="background-color: #' + cl[i] + '" onclick="' + c + ';return false;"></a></td>';
|
1368
|
+
|
1369
|
+
if ((i+1) % 8 == 0)
|
1370
|
+
h += '</tr><tr>';
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
h += '</tr></table>';
|
1374
|
+
/*
|
1375
|
+
h += '<a href="" class="mceMoreColors">More colors</a>';
|
1376
|
+
*/
|
1377
|
+
|
1378
|
+
return h;
|
1379
|
+
},
|
1380
|
+
|
1381
|
+
_insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
|
1382
|
+
tinyMCE.execCommand('mceBeginUndoLevel');
|
1383
|
+
|
1384
|
+
if (src == "")
|
1385
|
+
return;
|
1386
|
+
|
1387
|
+
if (!tinyMCE.imgElement && tinyMCE.isSafari) {
|
1388
|
+
var html = "";
|
1389
|
+
|
1390
|
+
html += '<img src="' + src + '" alt="' + alt + '"';
|
1391
|
+
html += ' border="' + border + '" hspace="' + hspace + '"';
|
1392
|
+
html += ' vspace="' + vspace + '" width="' + width + '"';
|
1393
|
+
html += ' height="' + height + '" align="' + align + '" title="' + title + '" onmouseover="' + onmouseover + '" onmouseout="' + onmouseout + '" />';
|
1394
|
+
|
1395
|
+
tinyMCE.execCommand("mceInsertContent", false, html);
|
1396
|
+
} else {
|
1397
|
+
if (!tinyMCE.imgElement && tinyMCE.selectedInstance) {
|
1398
|
+
if (tinyMCE.isSafari)
|
1399
|
+
tinyMCE.execCommand("mceInsertContent", false, '<img src="' + tinyMCE.uniqueURL + '" />');
|
1400
|
+
else
|
1401
|
+
tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);
|
1402
|
+
|
1403
|
+
tinyMCE.imgElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);
|
1404
|
+
}
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
if (tinyMCE.imgElement) {
|
1408
|
+
var needsRepaint = false;
|
1409
|
+
var msrc = src;
|
1410
|
+
|
1411
|
+
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");
|
1412
|
+
|
1413
|
+
if (tinyMCE.getParam('convert_urls'))
|
1414
|
+
msrc = src;
|
1415
|
+
|
1416
|
+
if (onmouseover && onmouseover != "")
|
1417
|
+
onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";
|
1418
|
+
|
1419
|
+
if (onmouseout && onmouseout != "")
|
1420
|
+
onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";
|
1421
|
+
|
1422
|
+
// Use alt as title if it's undefined
|
1423
|
+
if (typeof(title) == "undefined")
|
1424
|
+
title = alt;
|
1425
|
+
|
1426
|
+
if (width != tinyMCE.imgElement.getAttribute("width") || height != tinyMCE.imgElement.getAttribute("height") || align != tinyMCE.imgElement.getAttribute("align"))
|
1427
|
+
needsRepaint = true;
|
1428
|
+
|
1429
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'src', src);
|
1430
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'mce_src', msrc);
|
1431
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'alt', alt);
|
1432
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'title', title);
|
1433
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'align', align);
|
1434
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'border', border, true);
|
1435
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'hspace', hspace, true);
|
1436
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'vspace', vspace, true);
|
1437
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'width', width, true);
|
1438
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'height', height, true);
|
1439
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseover', onmouseover);
|
1440
|
+
tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseout', onmouseout);
|
1441
|
+
|
1442
|
+
// Fix for bug #989846 - Image resize bug
|
1443
|
+
if (width && width != "")
|
1444
|
+
tinyMCE.imgElement.style.pixelWidth = width;
|
1445
|
+
|
1446
|
+
if (height && height != "")
|
1447
|
+
tinyMCE.imgElement.style.pixelHeight = height;
|
1448
|
+
|
1449
|
+
if (needsRepaint)
|
1450
|
+
tinyMCE.selectedInstance.repaint();
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
tinyMCE.execCommand('mceEndUndoLevel');
|
1454
|
+
},
|
1455
|
+
|
1456
|
+
_insertLink : function(href, target, title, onclick, style_class) {
|
1457
|
+
tinyMCE.execCommand('mceBeginUndoLevel');
|
1458
|
+
|
1459
|
+
if (tinyMCE.selectedInstance && tinyMCE.selectedElement && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
|
1460
|
+
var doc = tinyMCE.selectedInstance.getDoc();
|
1461
|
+
var linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
|
1462
|
+
var newLink = false;
|
1463
|
+
|
1464
|
+
if (!linkElement) {
|
1465
|
+
linkElement = doc.createElement("a");
|
1466
|
+
newLink = true;
|
1467
|
+
}
|
1468
|
+
|
1469
|
+
var mhref = href;
|
1470
|
+
var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");
|
1471
|
+
mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
|
1472
|
+
|
1473
|
+
tinyMCE.setAttrib(linkElement, 'href', thref);
|
1474
|
+
tinyMCE.setAttrib(linkElement, 'mce_href', mhref);
|
1475
|
+
tinyMCE.setAttrib(linkElement, 'target', target);
|
1476
|
+
tinyMCE.setAttrib(linkElement, 'title', title);
|
1477
|
+
tinyMCE.setAttrib(linkElement, 'onclick', onclick);
|
1478
|
+
tinyMCE.setAttrib(linkElement, 'class', style_class);
|
1479
|
+
|
1480
|
+
if (newLink) {
|
1481
|
+
linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));
|
1482
|
+
tinyMCE.selectedElement.parentNode.replaceChild(linkElement, tinyMCE.selectedElement);
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
return;
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
if (!tinyMCE.linkElement && tinyMCE.selectedInstance) {
|
1489
|
+
if (tinyMCE.isSafari) {
|
1490
|
+
tinyMCE.execCommand("mceInsertContent", false, '<a href="' + tinyMCE.uniqueURL + '">' + tinyMCE.selectedInstance.selection.getSelectedHTML() + '</a>');
|
1491
|
+
} else
|
1492
|
+
tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
|
1493
|
+
|
1494
|
+
tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
|
1495
|
+
|
1496
|
+
var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
|
1497
|
+
|
1498
|
+
for (var i=0; i<elementArray.length; i++) {
|
1499
|
+
var mhref = href;
|
1500
|
+
var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, elementArray[i]);");
|
1501
|
+
mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
|
1502
|
+
|
1503
|
+
tinyMCE.setAttrib(elementArray[i], 'href', thref);
|
1504
|
+
tinyMCE.setAttrib(elementArray[i], 'mce_href', mhref);
|
1505
|
+
tinyMCE.setAttrib(elementArray[i], 'target', target);
|
1506
|
+
tinyMCE.setAttrib(elementArray[i], 'title', title);
|
1507
|
+
tinyMCE.setAttrib(elementArray[i], 'onclick', onclick);
|
1508
|
+
tinyMCE.setAttrib(elementArray[i], 'class', style_class);
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
tinyMCE.linkElement = elementArray[0];
|
1512
|
+
}
|
1513
|
+
|
1514
|
+
if (tinyMCE.linkElement) {
|
1515
|
+
var mhref = href;
|
1516
|
+
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);");
|
1517
|
+
mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
|
1518
|
+
|
1519
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href);
|
1520
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref);
|
1521
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target);
|
1522
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title);
|
1523
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick);
|
1524
|
+
tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class);
|
1525
|
+
}
|
1526
|
+
|
1527
|
+
tinyMCE.execCommand('mceEndUndoLevel');
|
1528
|
+
}
|
1529
|
+
};
|
1530
|
+
|
1531
|
+
tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme);
|
1532
|
+
|
1533
|
+
// Add default buttons maps for advanced theme and all internal plugins
|
1534
|
+
tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
|