Fix line endings in a number of files. refs #1604
Showing
221 changed files
with
2446 additions
and
2446 deletions
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n({en:{ | 1 | tinyMCE.addI18n({en:{ |
| 2 | common:{ | 2 | common:{ |
| 3 | edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", | 3 | edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", |
| 4 | apply:"Apply", | 4 | apply:"Apply", |
| 5 | insert:"Insert", | 5 | insert:"Insert", |
| 6 | update:"Update", | 6 | update:"Update", |
| 7 | cancel:"Cancel", | 7 | cancel:"Cancel", |
| 8 | close:"Close", | 8 | close:"Close", |
| 9 | browse:"Browse", | 9 | browse:"Browse", |
| 10 | class_name:"Class", | 10 | class_name:"Class", |
| 11 | not_set:"-- Not set --", | 11 | not_set:"-- Not set --", |
| 12 | clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", | 12 | clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", |
| 13 | clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", | 13 | clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", |
| 14 | popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", | 14 | popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", |
| 15 | invalid_data:"Error: Invalid values entered, these are marked in red.", | 15 | invalid_data:"Error: Invalid values entered, these are marked in red.", |
| 16 | more_colors:"More colors" | 16 | more_colors:"More colors" |
| 17 | }, | 17 | }, |
| 18 | contextmenu:{ | 18 | contextmenu:{ |
| 19 | align:"Alignment", | 19 | align:"Alignment", |
| 20 | left:"Left", | 20 | left:"Left", |
| 21 | center:"Center", | 21 | center:"Center", |
| 22 | right:"Right", | 22 | right:"Right", |
| 23 | full:"Full" | 23 | full:"Full" |
| 24 | }, | 24 | }, |
| 25 | insertdatetime:{ | 25 | insertdatetime:{ |
| 26 | date_fmt:"%Y-%m-%d", | 26 | date_fmt:"%Y-%m-%d", |
| 27 | time_fmt:"%H:%M:%S", | 27 | time_fmt:"%H:%M:%S", |
| 28 | insertdate_desc:"Insert date", | 28 | insertdate_desc:"Insert date", |
| 29 | inserttime_desc:"Insert time", | 29 | inserttime_desc:"Insert time", |
| 30 | months_long:"January,February,March,April,May,June,July,August,September,October,November,December", | 30 | months_long:"January,February,March,April,May,June,July,August,September,October,November,December", |
| 31 | months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", | 31 | months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", |
| 32 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", | 32 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", |
| 33 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" | 33 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" |
| 34 | }, | 34 | }, |
| 35 | print:{ | 35 | print:{ |
| 36 | print_desc:"Print" | 36 | print_desc:"Print" |
| 37 | }, | 37 | }, |
| 38 | preview:{ | 38 | preview:{ |
| 39 | preview_desc:"Preview" | 39 | preview_desc:"Preview" |
| 40 | }, | 40 | }, |
| 41 | directionality:{ | 41 | directionality:{ |
| 42 | ltr_desc:"Direction left to right", | 42 | ltr_desc:"Direction left to right", |
| 43 | rtl_desc:"Direction right to left" | 43 | rtl_desc:"Direction right to left" |
| 44 | }, | 44 | }, |
| 45 | layer:{ | 45 | layer:{ |
| 46 | insertlayer_desc:"Insert new layer", | 46 | insertlayer_desc:"Insert new layer", |
| 47 | forward_desc:"Move forward", | 47 | forward_desc:"Move forward", |
| 48 | backward_desc:"Move backward", | 48 | backward_desc:"Move backward", |
| 49 | absolute_desc:"Toggle absolute positioning", | 49 | absolute_desc:"Toggle absolute positioning", |
| 50 | content:"New layer..." | 50 | content:"New layer..." |
| 51 | }, | 51 | }, |
| 52 | save:{ | 52 | save:{ |
| 53 | save_desc:"Save", | 53 | save_desc:"Save", |
| 54 | cancel_desc:"Cancel all changes" | 54 | cancel_desc:"Cancel all changes" |
| 55 | }, | 55 | }, |
| 56 | nonbreaking:{ | 56 | nonbreaking:{ |
| 57 | nonbreaking_desc:"Insert non-breaking space character" | 57 | nonbreaking_desc:"Insert non-breaking space character" |
| 58 | }, | 58 | }, |
| 59 | iespell:{ | 59 | iespell:{ |
| 60 | iespell_desc:"Run spell checking", | 60 | iespell_desc:"Run spell checking", |
| 61 | download:"ieSpell not detected. Do you want to install it now?" | 61 | download:"ieSpell not detected. Do you want to install it now?" |
| 62 | }, | 62 | }, |
| 63 | advhr:{ | 63 | advhr:{ |
| 64 | advhr_desc:"Horizontal rule" | 64 | advhr_desc:"Horizontal rule" |
| 65 | }, | 65 | }, |
| 66 | emotions:{ | 66 | emotions:{ |
| 67 | emotions_desc:"Emotions" | 67 | emotions_desc:"Emotions" |
| 68 | }, | 68 | }, |
| 69 | searchreplace:{ | 69 | searchreplace:{ |
| 70 | search_desc:"Find", | 70 | search_desc:"Find", |
| 71 | replace_desc:"Find/Replace" | 71 | replace_desc:"Find/Replace" |
| 72 | }, | 72 | }, |
| 73 | advimage:{ | 73 | advimage:{ |
| 74 | image_desc:"Insert/edit image" | 74 | image_desc:"Insert/edit image" |
| 75 | }, | 75 | }, |
| 76 | advlink:{ | 76 | advlink:{ |
| 77 | link_desc:"Insert/edit link" | 77 | link_desc:"Insert/edit link" |
| 78 | }, | 78 | }, |
| 79 | xhtmlxtras:{ | 79 | xhtmlxtras:{ |
| 80 | cite_desc:"Citation", | 80 | cite_desc:"Citation", |
| 81 | abbr_desc:"Abbreviation", | 81 | abbr_desc:"Abbreviation", |
| 82 | acronym_desc:"Acronym", | 82 | acronym_desc:"Acronym", |
| 83 | del_desc:"Deletion", | 83 | del_desc:"Deletion", |
| 84 | ins_desc:"Insertion", | 84 | ins_desc:"Insertion", |
| 85 | attribs_desc:"Insert/Edit Attributes" | 85 | attribs_desc:"Insert/Edit Attributes" |
| 86 | }, | 86 | }, |
| 87 | style:{ | 87 | style:{ |
| 88 | desc:"Edit CSS Style" | 88 | desc:"Edit CSS Style" |
| 89 | }, | 89 | }, |
| 90 | paste:{ | 90 | paste:{ |
| 91 | paste_text_desc:"Paste as Plain Text", | 91 | paste_text_desc:"Paste as Plain Text", |
| 92 | paste_word_desc:"Paste from Word", | 92 | paste_word_desc:"Paste from Word", |
| 93 | selectall_desc:"Select All", | 93 | selectall_desc:"Select All", |
| 94 | plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", | 94 | plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", |
| 95 | plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." | 95 | plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." |
| 96 | }, | 96 | }, |
| 97 | paste_dlg:{ | 97 | paste_dlg:{ |
| 98 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", | 98 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", |
| 99 | text_linebreaks:"Keep linebreaks", | 99 | text_linebreaks:"Keep linebreaks", |
| 100 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." | 100 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." |
| 101 | }, | 101 | }, |
| 102 | table:{ | 102 | table:{ |
| 103 | desc:"Inserts a new table", | 103 | desc:"Inserts a new table", |
| 104 | row_before_desc:"Insert row before", | 104 | row_before_desc:"Insert row before", |
| 105 | row_after_desc:"Insert row after", | 105 | row_after_desc:"Insert row after", |
| 106 | delete_row_desc:"Delete row", | 106 | delete_row_desc:"Delete row", |
| 107 | col_before_desc:"Insert column before", | 107 | col_before_desc:"Insert column before", |
| 108 | col_after_desc:"Insert column after", | 108 | col_after_desc:"Insert column after", |
| 109 | delete_col_desc:"Remove column", | 109 | delete_col_desc:"Remove column", |
| 110 | split_cells_desc:"Split merged table cells", | 110 | split_cells_desc:"Split merged table cells", |
| 111 | merge_cells_desc:"Merge table cells", | 111 | merge_cells_desc:"Merge table cells", |
| 112 | row_desc:"Table row properties", | 112 | row_desc:"Table row properties", |
| 113 | cell_desc:"Table cell properties", | 113 | cell_desc:"Table cell properties", |
| 114 | props_desc:"Table properties", | 114 | props_desc:"Table properties", |
| 115 | paste_row_before_desc:"Paste table row before", | 115 | paste_row_before_desc:"Paste table row before", |
| 116 | paste_row_after_desc:"Paste table row after", | 116 | paste_row_after_desc:"Paste table row after", |
| 117 | cut_row_desc:"Cut table row", | 117 | cut_row_desc:"Cut table row", |
| 118 | copy_row_desc:"Copy table row", | 118 | copy_row_desc:"Copy table row", |
| 119 | del:"Delete table", | 119 | del:"Delete table", |
| 120 | row:"Row", | 120 | row:"Row", |
| 121 | col:"Column", | 121 | col:"Column", |
| 122 | cell:"Cell" | 122 | cell:"Cell" |
| 123 | }, | 123 | }, |
| 124 | autosave:{ | 124 | autosave:{ |
| 125 | unload_msg:"The changes you made will be lost if you navigate away from this page.", | 125 | unload_msg:"The changes you made will be lost if you navigate away from this page.", |
| 126 | restore_content:"Restore auto-saved content.", | 126 | restore_content:"Restore auto-saved content.", |
| 127 | warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." | 127 | warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." |
| 128 | }, | 128 | }, |
| 129 | fullscreen:{ | 129 | fullscreen:{ |
| 130 | desc:"Toggle fullscreen mode" | 130 | desc:"Toggle fullscreen mode" |
| 131 | }, | 131 | }, |
| 132 | media:{ | 132 | media:{ |
| 133 | desc:"Insert / edit embedded media", | 133 | desc:"Insert / edit embedded media", |
| 134 | edit:"Edit embedded media" | 134 | edit:"Edit embedded media" |
| 135 | }, | 135 | }, |
| 136 | fullpage:{ | 136 | fullpage:{ |
| 137 | desc:"Document properties" | 137 | desc:"Document properties" |
| 138 | }, | 138 | }, |
| 139 | template:{ | 139 | template:{ |
| 140 | desc:"Insert predefined template content" | 140 | desc:"Insert predefined template content" |
| 141 | }, | 141 | }, |
| 142 | visualchars:{ | 142 | visualchars:{ |
| 143 | desc:"Visual control characters on/off." | 143 | desc:"Visual control characters on/off." |
| 144 | }, | 144 | }, |
| 145 | spellchecker:{ | 145 | spellchecker:{ |
| 146 | desc:"Toggle spellchecker", | 146 | desc:"Toggle spellchecker", |
| 147 | menu:"Spellchecker settings", | 147 | menu:"Spellchecker settings", |
| 148 | ignore_word:"Ignore word", | 148 | ignore_word:"Ignore word", |
| 149 | ignore_words:"Ignore all", | 149 | ignore_words:"Ignore all", |
| 150 | langs:"Languages", | 150 | langs:"Languages", |
| 151 | wait:"Please wait...", | 151 | wait:"Please wait...", |
| 152 | sug:"Suggestions", | 152 | sug:"Suggestions", |
| 153 | no_sug:"No suggestions", | 153 | no_sug:"No suggestions", |
| 154 | no_mpell:"No misspellings found." | 154 | no_mpell:"No misspellings found." |
| 155 | }, | 155 | }, |
| 156 | pagebreak:{ | 156 | pagebreak:{ |
| 157 | desc:"Insert page break." | 157 | desc:"Insert page break." |
| 158 | }, | 158 | }, |
| 159 | advlist:{ | 159 | advlist:{ |
| 160 | types:"Types", | 160 | types:"Types", |
| 161 | def:"Default", | 161 | def:"Default", |
| 162 | lower_alpha:"Lower alpha", | 162 | lower_alpha:"Lower alpha", |
| 163 | lower_greek:"Lower greek", | 163 | lower_greek:"Lower greek", |
| 164 | lower_roman:"Lower roman", | 164 | lower_roman:"Lower roman", |
| 165 | upper_alpha:"Upper alpha", | 165 | upper_alpha:"Upper alpha", |
| 166 | upper_roman:"Upper roman", | 166 | upper_roman:"Upper roman", |
| 167 | circle:"Circle", | 167 | circle:"Circle", |
| 168 | disc:"Disc", | 168 | disc:"Disc", |
| 169 | square:"Square" | 169 | square:"Square" |
| 170 | }}}); | 170 | }}}); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | input.radio {border:1px none #000; background:transparent; vertical-align:middle;} | 1 | input.radio {border:1px none #000; background:transparent; vertical-align:middle;} |
| 2 | .panel_wrapper div.current {height:80px;} | 2 | .panel_wrapper div.current {height:80px;} |
| 3 | #width {width:50px; vertical-align:middle;} | 3 | #width {width:50px; vertical-align:middle;} |
| 4 | #width2 {width:50px; vertical-align:middle;} | 4 | #width2 {width:50px; vertical-align:middle;} |
| 5 | #size {width:100px;} | 5 | #size {width:100px;} | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.AdvancedHRPlugin', { | 12 | tinymce.create('tinymce.plugins.AdvancedHRPlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | // Register commands | 14 | // Register commands |
| 15 | ed.addCommand('mceAdvancedHr', function() { | 15 | ed.addCommand('mceAdvancedHr', function() { |
| 16 | ed.windowManager.open({ | 16 | ed.windowManager.open({ |
| 17 | file : url + '/rule.htm', | 17 | file : url + '/rule.htm', |
| 18 | width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), | 18 | width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), |
| 19 | height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), | 19 | height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), |
| 20 | inline : 1 | 20 | inline : 1 |
| 21 | }, { | 21 | }, { |
| 22 | plugin_url : url | 22 | plugin_url : url |
| 23 | }); | 23 | }); |
| 24 | }); | 24 | }); |
| 25 | 25 | ||
| 26 | // Register buttons | 26 | // Register buttons |
| 27 | ed.addButton('advhr', { | 27 | ed.addButton('advhr', { |
| 28 | title : 'advhr.advhr_desc', | 28 | title : 'advhr.advhr_desc', |
| 29 | cmd : 'mceAdvancedHr' | 29 | cmd : 'mceAdvancedHr' |
| 30 | }); | 30 | }); |
| 31 | 31 | ||
| 32 | ed.onNodeChange.add(function(ed, cm, n) { | 32 | ed.onNodeChange.add(function(ed, cm, n) { |
| 33 | cm.setActive('advhr', n.nodeName == 'HR'); | 33 | cm.setActive('advhr', n.nodeName == 'HR'); |
| 34 | }); | 34 | }); |
| 35 | 35 | ||
| 36 | ed.onClick.add(function(ed, e) { | 36 | ed.onClick.add(function(ed, e) { |
| 37 | e = e.target; | 37 | e = e.target; |
| 38 | 38 | ||
| 39 | if (e.nodeName === 'HR') | 39 | if (e.nodeName === 'HR') |
| 40 | ed.selection.select(e); | 40 | ed.selection.select(e); |
| 41 | }); | 41 | }); |
| 42 | }, | 42 | }, |
| 43 | 43 | ||
| 44 | getInfo : function() { | 44 | getInfo : function() { |
| 45 | return { | 45 | return { |
| 46 | longname : 'Advanced HR', | 46 | longname : 'Advanced HR', |
| 47 | author : 'Moxiecode Systems AB', | 47 | author : 'Moxiecode Systems AB', |
| 48 | authorurl : 'http://tinymce.moxiecode.com', | 48 | authorurl : 'http://tinymce.moxiecode.com', |
| 49 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', | 49 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', |
| 50 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 50 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 51 | }; | 51 | }; |
| 52 | } | 52 | } |
| 53 | }); | 53 | }); |
| 54 | 54 | ||
| 55 | // Register plugin | 55 | // Register plugin |
| 56 | tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); | 56 | tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); |
| 57 | })(); | 57 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | var AdvHRDialog = { | 1 | var AdvHRDialog = { |
| 2 | init : function(ed) { | 2 | init : function(ed) { |
| 3 | var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; | 3 | var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; |
| 4 | 4 | ||
| 5 | w = dom.getAttrib(n, 'width'); | 5 | w = dom.getAttrib(n, 'width'); |
| 6 | f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); | 6 | f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); |
| 7 | f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; | 7 | f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; |
| 8 | f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); | 8 | f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); |
| 9 | selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); | 9 | selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); |
| 10 | }, | 10 | }, |
| 11 | 11 | ||
| 12 | update : function() { | 12 | update : function() { |
| 13 | var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; | 13 | var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; |
| 14 | 14 | ||
| 15 | h = '<hr'; | 15 | h = '<hr'; |
| 16 | 16 | ||
| 17 | if (f.size.value) { | 17 | if (f.size.value) { |
| 18 | h += ' size="' + f.size.value + '"'; | 18 | h += ' size="' + f.size.value + '"'; |
| 19 | st += ' height:' + f.size.value + 'px;'; | 19 | st += ' height:' + f.size.value + 'px;'; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | if (f.width.value) { | 22 | if (f.width.value) { |
| 23 | h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"'; | 23 | h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"'; |
| 24 | st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';'; | 24 | st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';'; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | if (f.noshade.checked) { | 27 | if (f.noshade.checked) { |
| 28 | h += ' noshade="noshade"'; | 28 | h += ' noshade="noshade"'; |
| 29 | st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;'; | 29 | st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;'; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | if (ed.settings.inline_styles) | 32 | if (ed.settings.inline_styles) |
| 33 | h += ' style="' + tinymce.trim(st) + '"'; | 33 | h += ' style="' + tinymce.trim(st) + '"'; |
| 34 | 34 | ||
| 35 | h += ' />'; | 35 | h += ' />'; |
| 36 | 36 | ||
| 37 | ed.execCommand("mceInsertContent", false, h); | 37 | ed.execCommand("mceInsertContent", false, h); |
| 38 | tinyMCEPopup.close(); | 38 | tinyMCEPopup.close(); |
| 39 | } | 39 | } |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | tinyMCEPopup.requireLangPack(); | 42 | tinyMCEPopup.requireLangPack(); |
| 43 | tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog); | 43 | tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog); | ... | ... |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> | 3 | <head> |
| 4 | <title>{#advhr.advhr_desc}</title> | 4 | <title>{#advhr.advhr_desc}</title> |
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> |
| 6 | <script type="text/javascript" src="js/rule.js"></script> | 6 | <script type="text/javascript" src="js/rule.js"></script> |
| 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> |
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> |
| 9 | <link href="css/advhr.css" rel="stylesheet" type="text/css" /> | 9 | <link href="css/advhr.css" rel="stylesheet" type="text/css" /> |
| 10 | </head> | 10 | </head> |
| 11 | <body> | 11 | <body> |
| 12 | <form onsubmit="AdvHRDialog.update();return false;" action="#"> | 12 | <form onsubmit="AdvHRDialog.update();return false;" action="#"> |
| 13 | <div class="tabs"> | 13 | <div class="tabs"> |
| 14 | <ul> | 14 | <ul> |
| 15 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li> | 15 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li> |
| 16 | </ul> | 16 | </ul> |
| 17 | </div> | 17 | </div> |
| 18 | 18 | ||
| 19 | <div class="panel_wrapper"> | 19 | <div class="panel_wrapper"> |
| 20 | <div id="general_panel" class="panel current"> | 20 | <div id="general_panel" class="panel current"> |
| 21 | <table border="0" cellpadding="4" cellspacing="0"> | 21 | <table border="0" cellpadding="4" cellspacing="0"> |
| 22 | <tr> | 22 | <tr> |
| 23 | <td><label for="width">{#advhr_dlg.width}</label></td> | 23 | <td><label for="width">{#advhr_dlg.width}</label></td> |
| 24 | <td class="nowrap"> | 24 | <td class="nowrap"> |
| 25 | <input id="width" name="width" type="text" value="" class="mceFocus" /> | 25 | <input id="width" name="width" type="text" value="" class="mceFocus" /> |
| 26 | <select name="width2" id="width2"> | 26 | <select name="width2" id="width2"> |
| 27 | <option value="">px</option> | 27 | <option value="">px</option> |
| 28 | <option value="%">%</option> | 28 | <option value="%">%</option> |
| 29 | </select> | 29 | </select> |
| 30 | </td> | 30 | </td> |
| 31 | </tr> | 31 | </tr> |
| 32 | <tr> | 32 | <tr> |
| 33 | <td><label for="size">{#advhr_dlg.size}</label></td> | 33 | <td><label for="size">{#advhr_dlg.size}</label></td> |
| 34 | <td><select id="size" name="size"> | 34 | <td><select id="size" name="size"> |
| 35 | <option value="">Normal</option> | 35 | <option value="">Normal</option> |
| 36 | <option value="1">1</option> | 36 | <option value="1">1</option> |
| 37 | <option value="2">2</option> | 37 | <option value="2">2</option> |
| 38 | <option value="3">3</option> | 38 | <option value="3">3</option> |
| 39 | <option value="4">4</option> | 39 | <option value="4">4</option> |
| 40 | <option value="5">5</option> | 40 | <option value="5">5</option> |
| 41 | </select></td> | 41 | </select></td> |
| 42 | </tr> | 42 | </tr> |
| 43 | <tr> | 43 | <tr> |
| 44 | <td><label for="noshade">{#advhr_dlg.noshade}</label></td> | 44 | <td><label for="noshade">{#advhr_dlg.noshade}</label></td> |
| 45 | <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td> | 45 | <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td> |
| 46 | </tr> | 46 | </tr> |
| 47 | </table> | 47 | </table> |
| 48 | </div> | 48 | </div> |
| 49 | </div> | 49 | </div> |
| 50 | 50 | ||
| 51 | <div class="mceActionPanel"> | 51 | <div class="mceActionPanel"> |
| 52 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | 52 | <input type="submit" id="insert" name="insert" value="{#insert}" /> |
| 53 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | 53 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> |
| 54 | </div> | 54 | </div> |
| 55 | </form> | 55 | </form> |
| 56 | </body> | 56 | </body> |
| 57 | </html> | 57 | </html> | ... | ... |
| 1 | #src_list, #over_list, #out_list {width:280px;} | 1 | #src_list, #over_list, #out_list {width:280px;} |
| 2 | .mceActionPanel {margin-top:7px;} | 2 | .mceActionPanel {margin-top:7px;} |
| 3 | .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} | 3 | .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} |
| 4 | .checkbox {border:0;} | 4 | .checkbox {border:0;} |
| 5 | .panel_wrapper div.current {height:305px;} | 5 | .panel_wrapper div.current {height:305px;} |
| 6 | #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} | 6 | #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} |
| 7 | #align, #classlist {width:150px;} | 7 | #align, #classlist {width:150px;} |
| 8 | #width, #height {vertical-align:middle; width:50px; text-align:center;} | 8 | #width, #height {vertical-align:middle; width:50px; text-align:center;} |
| 9 | #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} | 9 | #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} |
| 10 | #class_list {width:180px;} | 10 | #class_list {width:180px;} |
| 11 | input {width: 280px;} | 11 | input {width: 280px;} |
| 12 | #constrain, #onmousemovecheck {width:auto;} | 12 | #constrain, #onmousemovecheck {width:auto;} |
| 13 | #id, #dir, #lang, #usemap, #longdesc {width:200px;} | 13 | #id, #dir, #lang, #usemap, #longdesc {width:200px;} | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', { | 12 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | // Register commands | 14 | // Register commands |
| 15 | ed.addCommand('mceAdvImage', function() { | 15 | ed.addCommand('mceAdvImage', function() { |
| 16 | // Internal image object like a flash placeholder | 16 | // Internal image object like a flash placeholder |
| 17 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) | 17 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) |
| 18 | return; | 18 | return; |
| 19 | 19 | ||
| 20 | ed.windowManager.open({ | 20 | ed.windowManager.open({ |
| 21 | file : url + '/image.htm', | 21 | file : url + '/image.htm', |
| 22 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), | 22 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), |
| 23 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), | 23 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), |
| 24 | inline : 1 | 24 | inline : 1 |
| 25 | }, { | 25 | }, { |
| 26 | plugin_url : url | 26 | plugin_url : url |
| 27 | }); | 27 | }); |
| 28 | }); | 28 | }); |
| 29 | 29 | ||
| 30 | // Register buttons | 30 | // Register buttons |
| 31 | ed.addButton('image', { | 31 | ed.addButton('image', { |
| 32 | title : 'advimage.image_desc', | 32 | title : 'advimage.image_desc', |
| 33 | cmd : 'mceAdvImage' | 33 | cmd : 'mceAdvImage' |
| 34 | }); | 34 | }); |
| 35 | }, | 35 | }, |
| 36 | 36 | ||
| 37 | getInfo : function() { | 37 | getInfo : function() { |
| 38 | return { | 38 | return { |
| 39 | longname : 'Advanced image', | 39 | longname : 'Advanced image', |
| 40 | author : 'Moxiecode Systems AB', | 40 | author : 'Moxiecode Systems AB', |
| 41 | authorurl : 'http://tinymce.moxiecode.com', | 41 | authorurl : 'http://tinymce.moxiecode.com', |
| 42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', | 42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', |
| 43 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 43 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 44 | }; | 44 | }; |
| 45 | } | 45 | } |
| 46 | }); | 46 | }); |
| 47 | 47 | ||
| 48 | // Register plugin | 48 | // Register plugin |
| 49 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); | 49 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); |
| 50 | })(); | 50 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n('en.advimage_dlg',{ | 1 | tinyMCE.addI18n('en.advimage_dlg',{ |
| 2 | tab_general:"General", | 2 | tab_general:"General", |
| 3 | tab_appearance:"Appearance", | 3 | tab_appearance:"Appearance", |
| 4 | tab_advanced:"Advanced", | 4 | tab_advanced:"Advanced", |
| 5 | general:"General", | 5 | general:"General", |
| 6 | title:"Title", | 6 | title:"Title", |
| 7 | preview:"Preview", | 7 | preview:"Preview", |
| 8 | constrain_proportions:"Constrain proportions", | 8 | constrain_proportions:"Constrain proportions", |
| 9 | langdir:"Language direction", | 9 | langdir:"Language direction", |
| 10 | langcode:"Language code", | 10 | langcode:"Language code", |
| 11 | long_desc:"Long description link", | 11 | long_desc:"Long description link", |
| 12 | style:"Style", | 12 | style:"Style", |
| 13 | classes:"Classes", | 13 | classes:"Classes", |
| 14 | ltr:"Left to right", | 14 | ltr:"Left to right", |
| 15 | rtl:"Right to left", | 15 | rtl:"Right to left", |
| 16 | id:"Id", | 16 | id:"Id", |
| 17 | map:"Image map", | 17 | map:"Image map", |
| 18 | swap_image:"Swap image", | 18 | swap_image:"Swap image", |
| 19 | alt_image:"Alternative image", | 19 | alt_image:"Alternative image", |
| 20 | mouseover:"for mouse over", | 20 | mouseover:"for mouse over", |
| 21 | mouseout:"for mouse out", | 21 | mouseout:"for mouse out", |
| 22 | misc:"Miscellaneous", | 22 | misc:"Miscellaneous", |
| 23 | example_img:"Appearance preview image", | 23 | example_img:"Appearance preview image", |
| 24 | 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.", | 24 | 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.", |
| 25 | dialog_title:"Insert/edit image", | 25 | dialog_title:"Insert/edit image", |
| 26 | src:"Image URL", | 26 | src:"Image URL", |
| 27 | alt:"Image description", | 27 | alt:"Image description", |
| 28 | list:"Image list", | 28 | list:"Image list", |
| 29 | border:"Border", | 29 | border:"Border", |
| 30 | dimensions:"Dimensions", | 30 | dimensions:"Dimensions", |
| 31 | vspace:"Vertical space", | 31 | vspace:"Vertical space", |
| 32 | hspace:"Horizontal space", | 32 | hspace:"Horizontal space", |
| 33 | align:"Alignment", | 33 | align:"Alignment", |
| 34 | align_baseline:"Baseline", | 34 | align_baseline:"Baseline", |
| 35 | align_top:"Top", | 35 | align_top:"Top", |
| 36 | align_middle:"Middle", | 36 | align_middle:"Middle", |
| 37 | align_bottom:"Bottom", | 37 | align_bottom:"Bottom", |
| 38 | align_texttop:"Text top", | 38 | align_texttop:"Text top", |
| 39 | align_textbottom:"Text bottom", | 39 | align_textbottom:"Text bottom", |
| 40 | align_left:"Left", | 40 | align_left:"Left", |
| 41 | align_right:"Right", | 41 | align_right:"Right", |
| 42 | image_list:"Image list" | 42 | image_list:"Image list" |
| 43 | }); | 43 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | .mceLinkList, .mceAnchorList, #targetlist {width:280px;} | 1 | .mceLinkList, .mceAnchorList, #targetlist {width:280px;} |
| 2 | .mceActionPanel {margin-top:7px;} | 2 | .mceActionPanel {margin-top:7px;} |
| 3 | .panel_wrapper div.current {height:320px;} | 3 | .panel_wrapper div.current {height:320px;} |
| 4 | #classlist, #title, #href {width:280px;} | 4 | #classlist, #title, #href {width:280px;} |
| 5 | #popupurl, #popupname {width:200px;} | 5 | #popupurl, #popupname {width:200px;} |
| 6 | #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} | 6 | #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} |
| 7 | #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} | 7 | #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} |
| 8 | #events_panel input {width:200px;} | 8 | #events_panel input {width:200px;} | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { | 12 | tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | this.editor = ed; | 14 | this.editor = ed; |
| 15 | 15 | ||
| 16 | // Register commands | 16 | // Register commands |
| 17 | ed.addCommand('mceAdvLink', function() { | 17 | ed.addCommand('mceAdvLink', function() { |
| 18 | var se = ed.selection; | 18 | var se = ed.selection; |
| 19 | 19 | ||
| 20 | // No selection and not in link | 20 | // No selection and not in link |
| 21 | if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) | 21 | if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) |
| 22 | return; | 22 | return; |
| 23 | 23 | ||
| 24 | ed.windowManager.open({ | 24 | ed.windowManager.open({ |
| 25 | file : url + '/link.htm', | 25 | file : url + '/link.htm', |
| 26 | width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), | 26 | width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), |
| 27 | height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), | 27 | height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), |
| 28 | inline : 1 | 28 | inline : 1 |
| 29 | }, { | 29 | }, { |
| 30 | plugin_url : url | 30 | plugin_url : url |
| 31 | }); | 31 | }); |
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | // Register buttons | 34 | // Register buttons |
| 35 | ed.addButton('link', { | 35 | ed.addButton('link', { |
| 36 | title : 'advlink.link_desc', | 36 | title : 'advlink.link_desc', |
| 37 | cmd : 'mceAdvLink' | 37 | cmd : 'mceAdvLink' |
| 38 | }); | 38 | }); |
| 39 | 39 | ||
| 40 | ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); | 40 | ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); |
| 41 | 41 | ||
| 42 | ed.onNodeChange.add(function(ed, cm, n, co) { | 42 | ed.onNodeChange.add(function(ed, cm, n, co) { |
| 43 | cm.setDisabled('link', co && n.nodeName != 'A'); | 43 | cm.setDisabled('link', co && n.nodeName != 'A'); |
| 44 | cm.setActive('link', n.nodeName == 'A' && !n.name); | 44 | cm.setActive('link', n.nodeName == 'A' && !n.name); |
| 45 | }); | 45 | }); |
| 46 | }, | 46 | }, |
| 47 | 47 | ||
| 48 | getInfo : function() { | 48 | getInfo : function() { |
| 49 | return { | 49 | return { |
| 50 | longname : 'Advanced link', | 50 | longname : 'Advanced link', |
| 51 | author : 'Moxiecode Systems AB', | 51 | author : 'Moxiecode Systems AB', |
| 52 | authorurl : 'http://tinymce.moxiecode.com', | 52 | authorurl : 'http://tinymce.moxiecode.com', |
| 53 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', | 53 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', |
| 54 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 54 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 55 | }; | 55 | }; |
| 56 | } | 56 | } |
| 57 | }); | 57 | }); |
| 58 | 58 | ||
| 59 | // Register plugin | 59 | // Register plugin |
| 60 | tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); | 60 | tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); |
| 61 | })(); | 61 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n('en.advlink_dlg',{ | 1 | tinyMCE.addI18n('en.advlink_dlg',{ |
| 2 | title:"Insert/edit link", | 2 | title:"Insert/edit link", |
| 3 | url:"Link URL", | 3 | url:"Link URL", |
| 4 | target:"Target", | 4 | target:"Target", |
| 5 | titlefield:"Title", | 5 | titlefield:"Title", |
| 6 | is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", | 6 | is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", |
| 7 | is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", | 7 | is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", |
| 8 | list:"Link list", | 8 | list:"Link list", |
| 9 | general_tab:"General", | 9 | general_tab:"General", |
| 10 | popup_tab:"Popup", | 10 | popup_tab:"Popup", |
| 11 | events_tab:"Events", | 11 | events_tab:"Events", |
| 12 | advanced_tab:"Advanced", | 12 | advanced_tab:"Advanced", |
| 13 | general_props:"General properties", | 13 | general_props:"General properties", |
| 14 | popup_props:"Popup properties", | 14 | popup_props:"Popup properties", |
| 15 | event_props:"Events", | 15 | event_props:"Events", |
| 16 | advanced_props:"Advanced properties", | 16 | advanced_props:"Advanced properties", |
| 17 | popup_opts:"Options", | 17 | popup_opts:"Options", |
| 18 | anchor_names:"Anchors", | 18 | anchor_names:"Anchors", |
| 19 | target_same:"Open in this window / frame", | 19 | target_same:"Open in this window / frame", |
| 20 | target_parent:"Open in parent window / frame", | 20 | target_parent:"Open in parent window / frame", |
| 21 | target_top:"Open in top frame (replaces all frames)", | 21 | target_top:"Open in top frame (replaces all frames)", |
| 22 | target_blank:"Open in new window", | 22 | target_blank:"Open in new window", |
| 23 | popup:"Javascript popup", | 23 | popup:"Javascript popup", |
| 24 | popup_url:"Popup URL", | 24 | popup_url:"Popup URL", |
| 25 | popup_name:"Window name", | 25 | popup_name:"Window name", |
| 26 | popup_return:"Insert 'return false'", | 26 | popup_return:"Insert 'return false'", |
| 27 | popup_scrollbars:"Show scrollbars", | 27 | popup_scrollbars:"Show scrollbars", |
| 28 | popup_statusbar:"Show status bar", | 28 | popup_statusbar:"Show status bar", |
| 29 | popup_toolbar:"Show toolbars", | 29 | popup_toolbar:"Show toolbars", |
| 30 | popup_menubar:"Show menu bar", | 30 | popup_menubar:"Show menu bar", |
| 31 | popup_location:"Show location bar", | 31 | popup_location:"Show location bar", |
| 32 | popup_resizable:"Make window resizable", | 32 | popup_resizable:"Make window resizable", |
| 33 | popup_dependent:"Dependent (Mozilla/Firefox only)", | 33 | popup_dependent:"Dependent (Mozilla/Firefox only)", |
| 34 | popup_size:"Size", | 34 | popup_size:"Size", |
| 35 | popup_position:"Position (X/Y)", | 35 | popup_position:"Position (X/Y)", |
| 36 | id:"Id", | 36 | id:"Id", |
| 37 | style:"Style", | 37 | style:"Style", |
| 38 | classes:"Classes", | 38 | classes:"Classes", |
| 39 | target_name:"Target name", | 39 | target_name:"Target name", |
| 40 | langdir:"Language direction", | 40 | langdir:"Language direction", |
| 41 | target_langcode:"Target language", | 41 | target_langcode:"Target language", |
| 42 | langcode:"Language code", | 42 | langcode:"Language code", |
| 43 | encoding:"Target character encoding", | 43 | encoding:"Target character encoding", |
| 44 | mime:"Target MIME type", | 44 | mime:"Target MIME type", |
| 45 | rel:"Relationship page to target", | 45 | rel:"Relationship page to target", |
| 46 | rev:"Relationship target to page", | 46 | rev:"Relationship target to page", |
| 47 | tabindex:"Tabindex", | 47 | tabindex:"Tabindex", |
| 48 | accesskey:"Accesskey", | 48 | accesskey:"Accesskey", |
| 49 | ltr:"Left to right", | 49 | ltr:"Left to right", |
| 50 | rtl:"Right to left", | 50 | rtl:"Right to left", |
| 51 | link_list:"Link list" | 51 | link_list:"Link list" |
| 52 | }); | 52 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | var each = tinymce.each; | 12 | var each = tinymce.each; |
| 13 | 13 | ||
| 14 | tinymce.create('tinymce.plugins.AdvListPlugin', { | 14 | tinymce.create('tinymce.plugins.AdvListPlugin', { |
| 15 | init : function(ed, url) { | 15 | init : function(ed, url) { |
| 16 | var t = this; | 16 | var t = this; |
| 17 | 17 | ||
| 18 | t.editor = ed; | 18 | t.editor = ed; |
| 19 | 19 | ||
| 20 | function buildFormats(str) { | 20 | function buildFormats(str) { |
| 21 | var formats = []; | 21 | var formats = []; |
| 22 | 22 | ||
| 23 | each(str.split(/,/), function(type) { | 23 | each(str.split(/,/), function(type) { |
| 24 | formats.push({ | 24 | formats.push({ |
| 25 | title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), | 25 | title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), |
| 26 | styles : { | 26 | styles : { |
| 27 | listStyleType : type == 'default' ? '' : type | 27 | listStyleType : type == 'default' ? '' : type |
| 28 | } | 28 | } |
| 29 | }); | 29 | }); |
| 30 | }); | 30 | }); |
| 31 | 31 | ||
| 32 | return formats; | 32 | return formats; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | // Setup number formats from config or default | 35 | // Setup number formats from config or default |
| 36 | t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); | 36 | t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); |
| 37 | t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); | 37 | t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); |
| 38 | }, | 38 | }, |
| 39 | 39 | ||
| 40 | createControl: function(name, cm) { | 40 | createControl: function(name, cm) { |
| 41 | var t = this, btn, format; | 41 | var t = this, btn, format; |
| 42 | 42 | ||
| 43 | if (name == 'numlist' || name == 'bullist') { | 43 | if (name == 'numlist' || name == 'bullist') { |
| 44 | // Default to first item if it's a default item | 44 | // Default to first item if it's a default item |
| 45 | if (t[name][0].title == 'advlist.def') | 45 | if (t[name][0].title == 'advlist.def') |
| 46 | format = t[name][0]; | 46 | format = t[name][0]; |
| 47 | 47 | ||
| 48 | function hasFormat(node, format) { | 48 | function hasFormat(node, format) { |
| 49 | var state = true; | 49 | var state = true; |
| 50 | 50 | ||
| 51 | each(format.styles, function(value, name) { | 51 | each(format.styles, function(value, name) { |
| 52 | // Format doesn't match | 52 | // Format doesn't match |
| 53 | if (t.editor.dom.getStyle(node, name) != value) { | 53 | if (t.editor.dom.getStyle(node, name) != value) { |
| 54 | state = false; | 54 | state = false; |
| 55 | return false; | 55 | return false; |
| 56 | } | 56 | } |
| 57 | }); | 57 | }); |
| 58 | 58 | ||
| 59 | return state; | 59 | return state; |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | function applyListFormat() { | 62 | function applyListFormat() { |
| 63 | var list, ed = t.editor, dom = ed.dom, sel = ed.selection; | 63 | var list, ed = t.editor, dom = ed.dom, sel = ed.selection; |
| 64 | 64 | ||
| 65 | // Check for existing list element | 65 | // Check for existing list element |
| 66 | list = dom.getParent(sel.getNode(), 'ol,ul'); | 66 | list = dom.getParent(sel.getNode(), 'ol,ul'); |
| 67 | 67 | ||
| 68 | // Switch/add list type if needed | 68 | // Switch/add list type if needed |
| 69 | if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) | 69 | if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) |
| 70 | ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); | 70 | ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); |
| 71 | 71 | ||
| 72 | // Append styles to new list element | 72 | // Append styles to new list element |
| 73 | if (format) { | 73 | if (format) { |
| 74 | list = dom.getParent(sel.getNode(), 'ol,ul'); | 74 | list = dom.getParent(sel.getNode(), 'ol,ul'); |
| 75 | 75 | ||
| 76 | if (list) { | 76 | if (list) { |
| 77 | dom.setStyles(list, format.styles); | 77 | dom.setStyles(list, format.styles); |
| 78 | list.removeAttribute('_mce_style'); | 78 | list.removeAttribute('_mce_style'); |
| 79 | } | 79 | } |
| 80 | } | 80 | } |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | btn = cm.createSplitButton(name, { | 83 | btn = cm.createSplitButton(name, { |
| 84 | title : 'advanced.' + name + '_desc', | 84 | title : 'advanced.' + name + '_desc', |
| 85 | 'class' : 'mce_' + name, | 85 | 'class' : 'mce_' + name, |
| 86 | onclick : function() { | 86 | onclick : function() { |
| 87 | applyListFormat(); | 87 | applyListFormat(); |
| 88 | } | 88 | } |
| 89 | }); | 89 | }); |
| 90 | 90 | ||
| 91 | btn.onRenderMenu.add(function(btn, menu) { | 91 | btn.onRenderMenu.add(function(btn, menu) { |
| 92 | menu.onShowMenu.add(function() { | 92 | menu.onShowMenu.add(function() { |
| 93 | var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList; | 93 | var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList; |
| 94 | 94 | ||
| 95 | if (list || format) { | 95 | if (list || format) { |
| 96 | fmtList = t[name]; | 96 | fmtList = t[name]; |
| 97 | 97 | ||
| 98 | // Unselect existing items | 98 | // Unselect existing items |
| 99 | each(menu.items, function(item) { | 99 | each(menu.items, function(item) { |
| 100 | var state = true; | 100 | var state = true; |
| 101 | 101 | ||
| 102 | item.setSelected(0); | 102 | item.setSelected(0); |
| 103 | 103 | ||
| 104 | if (list && !item.isDisabled()) { | 104 | if (list && !item.isDisabled()) { |
| 105 | each(fmtList, function(fmt) { | 105 | each(fmtList, function(fmt) { |
| 106 | if (fmt.id == item.id) { | 106 | if (fmt.id == item.id) { |
| 107 | if (!hasFormat(list, fmt)) { | 107 | if (!hasFormat(list, fmt)) { |
| 108 | state = false; | 108 | state = false; |
| 109 | return false; | 109 | return false; |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | }); | 112 | }); |
| 113 | 113 | ||
| 114 | if (state) | 114 | if (state) |
| 115 | item.setSelected(1); | 115 | item.setSelected(1); |
| 116 | } | 116 | } |
| 117 | }); | 117 | }); |
| 118 | 118 | ||
| 119 | // Select the current format | 119 | // Select the current format |
| 120 | if (!list) | 120 | if (!list) |
| 121 | menu.items[format.id].setSelected(1); | 121 | menu.items[format.id].setSelected(1); |
| 122 | } | 122 | } |
| 123 | }); | 123 | }); |
| 124 | 124 | ||
| 125 | menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | 125 | menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1); |
| 126 | 126 | ||
| 127 | each(t[name], function(item) { | 127 | each(t[name], function(item) { |
| 128 | item.id = t.editor.dom.uniqueId(); | 128 | item.id = t.editor.dom.uniqueId(); |
| 129 | 129 | ||
| 130 | menu.add({id : item.id, title : item.title, onclick : function() { | 130 | menu.add({id : item.id, title : item.title, onclick : function() { |
| 131 | format = item; | 131 | format = item; |
| 132 | applyListFormat(); | 132 | applyListFormat(); |
| 133 | }}); | 133 | }}); |
| 134 | }); | 134 | }); |
| 135 | }); | 135 | }); |
| 136 | 136 | ||
| 137 | return btn; | 137 | return btn; |
| 138 | } | 138 | } |
| 139 | }, | 139 | }, |
| 140 | 140 | ||
| 141 | getInfo : function() { | 141 | getInfo : function() { |
| 142 | return { | 142 | return { |
| 143 | longname : 'Advanced lists', | 143 | longname : 'Advanced lists', |
| 144 | author : 'Moxiecode Systems AB', | 144 | author : 'Moxiecode Systems AB', |
| 145 | authorurl : 'http://tinymce.moxiecode.com', | 145 | authorurl : 'http://tinymce.moxiecode.com', |
| 146 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', | 146 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', |
| 147 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 147 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 148 | }; | 148 | }; |
| 149 | } | 149 | } |
| 150 | }); | 150 | }); |
| 151 | 151 | ||
| 152 | // Register plugin | 152 | // Register plugin |
| 153 | tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); | 153 | tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); |
| 154 | })(); | 154 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n('en.autosave',{ | 1 | tinyMCE.addI18n('en.autosave',{ |
| 2 | restore_content: "Restore auto-saved content", | 2 | restore_content: "Restore auto-saved content", |
| 3 | warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" | 3 | warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" |
| 4 | }); | 4 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.BBCodePlugin', { | 12 | tinymce.create('tinymce.plugins.BBCodePlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); | 14 | var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); |
| 15 | 15 | ||
| 16 | ed.onBeforeSetContent.add(function(ed, o) { | 16 | ed.onBeforeSetContent.add(function(ed, o) { |
| 17 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | 17 | o.content = t['_' + dialect + '_bbcode2html'](o.content); |
| 18 | }); | 18 | }); |
| 19 | 19 | ||
| 20 | ed.onPostProcess.add(function(ed, o) { | 20 | ed.onPostProcess.add(function(ed, o) { |
| 21 | if (o.set) | 21 | if (o.set) |
| 22 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | 22 | o.content = t['_' + dialect + '_bbcode2html'](o.content); |
| 23 | 23 | ||
| 24 | if (o.get) | 24 | if (o.get) |
| 25 | o.content = t['_' + dialect + '_html2bbcode'](o.content); | 25 | o.content = t['_' + dialect + '_html2bbcode'](o.content); |
| 26 | }); | 26 | }); |
| 27 | }, | 27 | }, |
| 28 | 28 | ||
| 29 | getInfo : function() { | 29 | getInfo : function() { |
| 30 | return { | 30 | return { |
| 31 | longname : 'BBCode Plugin', | 31 | longname : 'BBCode Plugin', |
| 32 | author : 'Moxiecode Systems AB', | 32 | author : 'Moxiecode Systems AB', |
| 33 | authorurl : 'http://tinymce.moxiecode.com', | 33 | authorurl : 'http://tinymce.moxiecode.com', |
| 34 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', | 34 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', |
| 35 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 35 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 36 | }; | 36 | }; |
| 37 | }, | 37 | }, |
| 38 | 38 | ||
| 39 | // Private methods | 39 | // Private methods |
| 40 | 40 | ||
| 41 | // HTML -> BBCode in PunBB dialect | 41 | // HTML -> BBCode in PunBB dialect |
| 42 | _punbb_html2bbcode : function(s) { | 42 | _punbb_html2bbcode : function(s) { |
| 43 | s = tinymce.trim(s); | 43 | s = tinymce.trim(s); |
| 44 | 44 | ||
| 45 | function rep(re, str) { | 45 | function rep(re, str) { |
| 46 | s = s.replace(re, str); | 46 | s = s.replace(re, str); |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | // example: <strong> to [b] | 49 | // example: <strong> to [b] |
| 50 | rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); | 50 | rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); |
| 51 | rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | 51 | rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); |
| 52 | rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | 52 | rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); |
| 53 | rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | 53 | rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); |
| 54 | rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | 54 | rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); |
| 55 | rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"); | 55 | rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"); |
| 56 | rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"); | 56 | rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"); |
| 57 | rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"); | 57 | rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"); |
| 58 | rep(/<font>(.*?)<\/font>/gi,"$1"); | 58 | rep(/<font>(.*?)<\/font>/gi,"$1"); |
| 59 | rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"); | 59 | rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"); |
| 60 | rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"); | 60 | rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"); |
| 61 | rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"); | 61 | rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"); |
| 62 | rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); | 62 | rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); |
| 63 | rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); | 63 | rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); |
| 64 | rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); | 64 | rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); |
| 65 | rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); | 65 | rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); |
| 66 | rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); | 66 | rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); |
| 67 | rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); | 67 | rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); |
| 68 | rep(/<\/(strong|b)>/gi,"[/b]"); | 68 | rep(/<\/(strong|b)>/gi,"[/b]"); |
| 69 | rep(/<(strong|b)>/gi,"[b]"); | 69 | rep(/<(strong|b)>/gi,"[b]"); |
| 70 | rep(/<\/(em|i)>/gi,"[/i]"); | 70 | rep(/<\/(em|i)>/gi,"[/i]"); |
| 71 | rep(/<(em|i)>/gi,"[i]"); | 71 | rep(/<(em|i)>/gi,"[i]"); |
| 72 | rep(/<\/u>/gi,"[/u]"); | 72 | rep(/<\/u>/gi,"[/u]"); |
| 73 | rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"); | 73 | rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"); |
| 74 | rep(/<u>/gi,"[u]"); | 74 | rep(/<u>/gi,"[u]"); |
| 75 | rep(/<blockquote[^>]*>/gi,"[quote]"); | 75 | rep(/<blockquote[^>]*>/gi,"[quote]"); |
| 76 | rep(/<\/blockquote>/gi,"[/quote]"); | 76 | rep(/<\/blockquote>/gi,"[/quote]"); |
| 77 | rep(/<br \/>/gi,"\n"); | 77 | rep(/<br \/>/gi,"\n"); |
| 78 | rep(/<br\/>/gi,"\n"); | 78 | rep(/<br\/>/gi,"\n"); |
| 79 | rep(/<br>/gi,"\n"); | 79 | rep(/<br>/gi,"\n"); |
| 80 | rep(/<p>/gi,""); | 80 | rep(/<p>/gi,""); |
| 81 | rep(/<\/p>/gi,"\n"); | 81 | rep(/<\/p>/gi,"\n"); |
| 82 | rep(/ /gi," "); | 82 | rep(/ /gi," "); |
| 83 | rep(/"/gi,"\""); | 83 | rep(/"/gi,"\""); |
| 84 | rep(/</gi,"<"); | 84 | rep(/</gi,"<"); |
| 85 | rep(/>/gi,">"); | 85 | rep(/>/gi,">"); |
| 86 | rep(/&/gi,"&"); | 86 | rep(/&/gi,"&"); |
| 87 | 87 | ||
| 88 | return s; | 88 | return s; |
| 89 | }, | 89 | }, |
| 90 | 90 | ||
| 91 | // BBCode -> HTML from PunBB dialect | 91 | // BBCode -> HTML from PunBB dialect |
| 92 | _punbb_bbcode2html : function(s) { | 92 | _punbb_bbcode2html : function(s) { |
| 93 | s = tinymce.trim(s); | 93 | s = tinymce.trim(s); |
| 94 | 94 | ||
| 95 | function rep(re, str) { | 95 | function rep(re, str) { |
| 96 | s = s.replace(re, str); | 96 | s = s.replace(re, str); |
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | // example: [b] to <strong> | 99 | // example: [b] to <strong> |
| 100 | rep(/\n/gi,"<br />"); | 100 | rep(/\n/gi,"<br />"); |
| 101 | rep(/\[b\]/gi,"<strong>"); | 101 | rep(/\[b\]/gi,"<strong>"); |
| 102 | rep(/\[\/b\]/gi,"</strong>"); | 102 | rep(/\[\/b\]/gi,"</strong>"); |
| 103 | rep(/\[i\]/gi,"<em>"); | 103 | rep(/\[i\]/gi,"<em>"); |
| 104 | rep(/\[\/i\]/gi,"</em>"); | 104 | rep(/\[\/i\]/gi,"</em>"); |
| 105 | rep(/\[u\]/gi,"<u>"); | 105 | rep(/\[u\]/gi,"<u>"); |
| 106 | rep(/\[\/u\]/gi,"</u>"); | 106 | rep(/\[\/u\]/gi,"</u>"); |
| 107 | rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"); | 107 | rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"); |
| 108 | rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"); | 108 | rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"); |
| 109 | rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); | 109 | rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); |
| 110 | rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>"); | 110 | rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>"); |
| 111 | rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> "); | 111 | rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> "); |
| 112 | rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> "); | 112 | rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> "); |
| 113 | 113 | ||
| 114 | return s; | 114 | return s; |
| 115 | } | 115 | } |
| 116 | }); | 116 | }); |
| 117 | 117 | ||
| 118 | // Register plugin | 118 | // Register plugin |
| 119 | tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); | 119 | tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); |
| 120 | })(); | 120 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; | 12 | var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; |
| 13 | 13 | ||
| 14 | /** | 14 | /** |
| 15 | * This plugin a context menu to TinyMCE editor instances. | 15 | * This plugin a context menu to TinyMCE editor instances. |
| 16 | * | 16 | * |
| 17 | * @class tinymce.plugins.ContextMenu | 17 | * @class tinymce.plugins.ContextMenu |
| 18 | */ | 18 | */ |
| 19 | tinymce.create('tinymce.plugins.ContextMenu', { | 19 | tinymce.create('tinymce.plugins.ContextMenu', { |
| 20 | /** | 20 | /** |
| 21 | * Initializes the plugin, this will be executed after the plugin has been created. | 21 | * Initializes the plugin, this will be executed after the plugin has been created. |
| 22 | * This call is done before the editor instance has finished it's initialization so use the onInit event | 22 | * This call is done before the editor instance has finished it's initialization so use the onInit event |
| 23 | * of the editor instance to intercept that event. | 23 | * of the editor instance to intercept that event. |
| 24 | * | 24 | * |
| 25 | * @method init | 25 | * @method init |
| 26 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | 26 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. |
| 27 | * @param {string} url Absolute URL to where the plugin is located. | 27 | * @param {string} url Absolute URL to where the plugin is located. |
| 28 | */ | 28 | */ |
| 29 | init : function(ed) { | 29 | init : function(ed) { |
| 30 | var t = this, lastRng; | 30 | var t = this, lastRng; |
| 31 | 31 | ||
| 32 | t.editor = ed; | 32 | t.editor = ed; |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * This event gets fired when the context menu is shown. | 35 | * This event gets fired when the context menu is shown. |
| 36 | * | 36 | * |
| 37 | * @event onContextMenu | 37 | * @event onContextMenu |
| 38 | * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. | 38 | * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. |
| 39 | * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. | 39 | * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. |
| 40 | */ | 40 | */ |
| 41 | t.onContextMenu = new tinymce.util.Dispatcher(this); | 41 | t.onContextMenu = new tinymce.util.Dispatcher(this); |
| 42 | 42 | ||
| 43 | ed.onContextMenu.add(function(ed, e) { | 43 | ed.onContextMenu.add(function(ed, e) { |
| 44 | if (!e.ctrlKey) { | 44 | if (!e.ctrlKey) { |
| 45 | // Restore the last selection since it was removed | 45 | // Restore the last selection since it was removed |
| 46 | if (lastRng) | 46 | if (lastRng) |
| 47 | ed.selection.setRng(lastRng); | 47 | ed.selection.setRng(lastRng); |
| 48 | 48 | ||
| 49 | t._getMenu(ed).showMenu(e.clientX, e.clientY); | 49 | t._getMenu(ed).showMenu(e.clientX, e.clientY); |
| 50 | Event.add(ed.getDoc(), 'click', function(e) { | 50 | Event.add(ed.getDoc(), 'click', function(e) { |
| 51 | hide(ed, e); | 51 | hide(ed, e); |
| 52 | }); | 52 | }); |
| 53 | Event.cancel(e); | 53 | Event.cancel(e); |
| 54 | } | 54 | } |
| 55 | }); | 55 | }); |
| 56 | 56 | ||
| 57 | ed.onRemove.add(function() { | 57 | ed.onRemove.add(function() { |
| 58 | if (t._menu) | 58 | if (t._menu) |
| 59 | t._menu.removeAll(); | 59 | t._menu.removeAll(); |
| 60 | }); | 60 | }); |
| 61 | 61 | ||
| 62 | function hide(ed, e) { | 62 | function hide(ed, e) { |
| 63 | lastRng = null; | 63 | lastRng = null; |
| 64 | 64 | ||
| 65 | // Since the contextmenu event moves | 65 | // Since the contextmenu event moves |
| 66 | // the selection we need to store it away | 66 | // the selection we need to store it away |
| 67 | if (e && e.button == 2) { | 67 | if (e && e.button == 2) { |
| 68 | lastRng = ed.selection.getRng(); | 68 | lastRng = ed.selection.getRng(); |
| 69 | return; | 69 | return; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | if (t._menu) { | 72 | if (t._menu) { |
| 73 | t._menu.removeAll(); | 73 | t._menu.removeAll(); |
| 74 | t._menu.destroy(); | 74 | t._menu.destroy(); |
| 75 | Event.remove(ed.getDoc(), 'click', hide); | 75 | Event.remove(ed.getDoc(), 'click', hide); |
| 76 | } | 76 | } |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | ed.onMouseDown.add(hide); | 79 | ed.onMouseDown.add(hide); |
| 80 | ed.onKeyDown.add(hide); | 80 | ed.onKeyDown.add(hide); |
| 81 | }, | 81 | }, |
| 82 | 82 | ||
| 83 | /** | 83 | /** |
| 84 | * Returns information about the plugin as a name/value array. | 84 | * Returns information about the plugin as a name/value array. |
| 85 | * The current keys are longname, author, authorurl, infourl and version. | 85 | * The current keys are longname, author, authorurl, infourl and version. |
| 86 | * | 86 | * |
| 87 | * @method getInfo | 87 | * @method getInfo |
| 88 | * @return {Object} Name/value array containing information about the plugin. | 88 | * @return {Object} Name/value array containing information about the plugin. |
| 89 | */ | 89 | */ |
| 90 | getInfo : function() { | 90 | getInfo : function() { |
| 91 | return { | 91 | return { |
| 92 | longname : 'Contextmenu', | 92 | longname : 'Contextmenu', |
| 93 | author : 'Moxiecode Systems AB', | 93 | author : 'Moxiecode Systems AB', |
| 94 | authorurl : 'http://tinymce.moxiecode.com', | 94 | authorurl : 'http://tinymce.moxiecode.com', |
| 95 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', | 95 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', |
| 96 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 96 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 97 | }; | 97 | }; |
| 98 | }, | 98 | }, |
| 99 | 99 | ||
| 100 | _getMenu : function(ed) { | 100 | _getMenu : function(ed) { |
| 101 | var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; | 101 | var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; |
| 102 | 102 | ||
| 103 | if (m) { | 103 | if (m) { |
| 104 | m.removeAll(); | 104 | m.removeAll(); |
| 105 | m.destroy(); | 105 | m.destroy(); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | p1 = DOM.getPos(ed.getContentAreaContainer()); | 108 | p1 = DOM.getPos(ed.getContentAreaContainer()); |
| 109 | p2 = DOM.getPos(ed.getContainer()); | 109 | p2 = DOM.getPos(ed.getContainer()); |
| 110 | 110 | ||
| 111 | m = ed.controlManager.createDropMenu('contextmenu', { | 111 | m = ed.controlManager.createDropMenu('contextmenu', { |
| 112 | offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), | 112 | offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), |
| 113 | offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), | 113 | offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), |
| 114 | constrain : 1 | 114 | constrain : 1 |
| 115 | }); | 115 | }); |
| 116 | 116 | ||
| 117 | t._menu = m; | 117 | t._menu = m; |
| 118 | 118 | ||
| 119 | m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); | 119 | m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); |
| 120 | m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); | 120 | m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); |
| 121 | m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); | 121 | m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); |
| 122 | 122 | ||
| 123 | if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { | 123 | if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { |
| 124 | m.addSeparator(); | 124 | m.addSeparator(); |
| 125 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); | 125 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); |
| 126 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); | 126 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | m.addSeparator(); | 129 | m.addSeparator(); |
| 130 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); | 130 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); |
| 131 | 131 | ||
| 132 | m.addSeparator(); | 132 | m.addSeparator(); |
| 133 | am = m.addMenu({title : 'contextmenu.align'}); | 133 | am = m.addMenu({title : 'contextmenu.align'}); |
| 134 | am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); | 134 | am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); |
| 135 | am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); | 135 | am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); |
| 136 | am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); | 136 | am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); |
| 137 | am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); | 137 | am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); |
| 138 | 138 | ||
| 139 | t.onContextMenu.dispatch(t, m, el, col); | 139 | t.onContextMenu.dispatch(t, m, el, col); |
| 140 | 140 | ||
| 141 | return m; | 141 | return m; |
| 142 | } | 142 | } |
| 143 | }); | 143 | }); |
| 144 | 144 | ||
| 145 | // Register plugin | 145 | // Register plugin |
| 146 | tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); | 146 | tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); |
| 147 | })(); | 147 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.Directionality', { | 12 | tinymce.create('tinymce.plugins.Directionality', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this; | 14 | var t = this; |
| 15 | 15 | ||
| 16 | t.editor = ed; | 16 | t.editor = ed; |
| 17 | 17 | ||
| 18 | ed.addCommand('mceDirectionLTR', function() { | 18 | ed.addCommand('mceDirectionLTR', function() { |
| 19 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | 19 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); |
| 20 | 20 | ||
| 21 | if (e) { | 21 | if (e) { |
| 22 | if (ed.dom.getAttrib(e, "dir") != "ltr") | 22 | if (ed.dom.getAttrib(e, "dir") != "ltr") |
| 23 | ed.dom.setAttrib(e, "dir", "ltr"); | 23 | ed.dom.setAttrib(e, "dir", "ltr"); |
| 24 | else | 24 | else |
| 25 | ed.dom.setAttrib(e, "dir", ""); | 25 | ed.dom.setAttrib(e, "dir", ""); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | ed.nodeChanged(); | 28 | ed.nodeChanged(); |
| 29 | }); | 29 | }); |
| 30 | 30 | ||
| 31 | ed.addCommand('mceDirectionRTL', function() { | 31 | ed.addCommand('mceDirectionRTL', function() { |
| 32 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | 32 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); |
| 33 | 33 | ||
| 34 | if (e) { | 34 | if (e) { |
| 35 | if (ed.dom.getAttrib(e, "dir") != "rtl") | 35 | if (ed.dom.getAttrib(e, "dir") != "rtl") |
| 36 | ed.dom.setAttrib(e, "dir", "rtl"); | 36 | ed.dom.setAttrib(e, "dir", "rtl"); |
| 37 | else | 37 | else |
| 38 | ed.dom.setAttrib(e, "dir", ""); | 38 | ed.dom.setAttrib(e, "dir", ""); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | ed.nodeChanged(); | 41 | ed.nodeChanged(); |
| 42 | }); | 42 | }); |
| 43 | 43 | ||
| 44 | ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); | 44 | ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); |
| 45 | ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); | 45 | ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); |
| 46 | 46 | ||
| 47 | ed.onNodeChange.add(t._nodeChange, t); | 47 | ed.onNodeChange.add(t._nodeChange, t); |
| 48 | }, | 48 | }, |
| 49 | 49 | ||
| 50 | getInfo : function() { | 50 | getInfo : function() { |
| 51 | return { | 51 | return { |
| 52 | longname : 'Directionality', | 52 | longname : 'Directionality', |
| 53 | author : 'Moxiecode Systems AB', | 53 | author : 'Moxiecode Systems AB', |
| 54 | authorurl : 'http://tinymce.moxiecode.com', | 54 | authorurl : 'http://tinymce.moxiecode.com', |
| 55 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', | 55 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', |
| 56 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 56 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 57 | }; | 57 | }; |
| 58 | }, | 58 | }, |
| 59 | 59 | ||
| 60 | // Private methods | 60 | // Private methods |
| 61 | 61 | ||
| 62 | _nodeChange : function(ed, cm, n) { | 62 | _nodeChange : function(ed, cm, n) { |
| 63 | var dom = ed.dom, dir; | 63 | var dom = ed.dom, dir; |
| 64 | 64 | ||
| 65 | n = dom.getParent(n, dom.isBlock); | 65 | n = dom.getParent(n, dom.isBlock); |
| 66 | if (!n) { | 66 | if (!n) { |
| 67 | cm.setDisabled('ltr', 1); | 67 | cm.setDisabled('ltr', 1); |
| 68 | cm.setDisabled('rtl', 1); | 68 | cm.setDisabled('rtl', 1); |
| 69 | return; | 69 | return; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | dir = dom.getAttrib(n, 'dir'); | 72 | dir = dom.getAttrib(n, 'dir'); |
| 73 | cm.setActive('ltr', dir == "ltr"); | 73 | cm.setActive('ltr', dir == "ltr"); |
| 74 | cm.setDisabled('ltr', 0); | 74 | cm.setDisabled('ltr', 0); |
| 75 | cm.setActive('rtl', dir == "rtl"); | 75 | cm.setActive('rtl', dir == "rtl"); |
| 76 | cm.setDisabled('rtl', 0); | 76 | cm.setDisabled('rtl', 0); |
| 77 | } | 77 | } |
| 78 | }); | 78 | }); |
| 79 | 79 | ||
| 80 | // Register plugin | 80 | // Register plugin |
| 81 | tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); | 81 | tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); |
| 82 | })(); | 82 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function(tinymce) { | 11 | (function(tinymce) { |
| 12 | tinymce.create('tinymce.plugins.EmotionsPlugin', { | 12 | tinymce.create('tinymce.plugins.EmotionsPlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | // Register commands | 14 | // Register commands |
| 15 | ed.addCommand('mceEmotion', function() { | 15 | ed.addCommand('mceEmotion', function() { |
| 16 | ed.windowManager.open({ | 16 | ed.windowManager.open({ |
| 17 | file : url + '/emotions.htm', | 17 | file : url + '/emotions.htm', |
| 18 | width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), | 18 | width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), |
| 19 | height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), | 19 | height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), |
| 20 | inline : 1 | 20 | inline : 1 |
| 21 | }, { | 21 | }, { |
| 22 | plugin_url : url | 22 | plugin_url : url |
| 23 | }); | 23 | }); |
| 24 | }); | 24 | }); |
| 25 | 25 | ||
| 26 | // Register buttons | 26 | // Register buttons |
| 27 | ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); | 27 | ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); |
| 28 | }, | 28 | }, |
| 29 | 29 | ||
| 30 | getInfo : function() { | 30 | getInfo : function() { |
| 31 | return { | 31 | return { |
| 32 | longname : 'Emotions', | 32 | longname : 'Emotions', |
| 33 | author : 'Moxiecode Systems AB', | 33 | author : 'Moxiecode Systems AB', |
| 34 | authorurl : 'http://tinymce.moxiecode.com', | 34 | authorurl : 'http://tinymce.moxiecode.com', |
| 35 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', | 35 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', |
| 36 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 36 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 37 | }; | 37 | }; |
| 38 | } | 38 | } |
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | // Register plugin | 41 | // Register plugin |
| 42 | tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); | 42 | tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); |
| 43 | })(tinymce); | 43 | })(tinymce); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> | 3 | <head> |
| 4 | <title>{#emotions_dlg.title}</title> | 4 | <title>{#emotions_dlg.title}</title> |
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> |
| 6 | <script type="text/javascript" src="js/emotions.js"></script> | 6 | <script type="text/javascript" src="js/emotions.js"></script> |
| 7 | </head> | 7 | </head> |
| 8 | <body style="display: none"> | 8 | <body style="display: none"> |
| 9 | <div align="center"> | 9 | <div align="center"> |
| 10 | <div class="title">{#emotions_dlg.title}:<br /><br /></div> | 10 | <div class="title">{#emotions_dlg.title}:<br /><br /></div> |
| 11 | 11 | ||
| 12 | <table border="0" cellspacing="0" cellpadding="4"> | 12 | <table border="0" cellspacing="0" cellpadding="4"> |
| 13 | <tr> | 13 | <tr> |
| 14 | <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td> | 14 | <td><a href="javascript:EmotionsDialog.insert('smiley-cool.gif','emotions_dlg.cool');"><img src="img/smiley-cool.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cool}" title="{#emotions_dlg.cool}" /></a></td> |
| 15 | <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td> | 15 | <td><a href="javascript:EmotionsDialog.insert('smiley-cry.gif','emotions_dlg.cry');"><img src="img/smiley-cry.gif" width="18" height="18" border="0" alt="{#emotions_dlg.cry}" title="{#emotions_dlg.cry}" /></a></td> |
| 16 | <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td> | 16 | <td><a href="javascript:EmotionsDialog.insert('smiley-embarassed.gif','emotions_dlg.embarassed');"><img src="img/smiley-embarassed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.embarassed}" title="{#emotions_dlg.embarassed}" /></a></td> |
| 17 | <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td> | 17 | <td><a href="javascript:EmotionsDialog.insert('smiley-foot-in-mouth.gif','emotions_dlg.foot_in_mouth');"><img src="img/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.foot_in_mouth}" title="{#emotions_dlg.foot_in_mouth}" /></a></td> |
| 18 | </tr> | 18 | </tr> |
| 19 | <tr> | 19 | <tr> |
| 20 | <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td> | 20 | <td><a href="javascript:EmotionsDialog.insert('smiley-frown.gif','emotions_dlg.frown');"><img src="img/smiley-frown.gif" width="18" height="18" border="0" alt="{#emotions_dlg.frown}" title="{#emotions_dlg.frown}" /></a></td> |
| 21 | <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td> | 21 | <td><a href="javascript:EmotionsDialog.insert('smiley-innocent.gif','emotions_dlg.innocent');"><img src="img/smiley-innocent.gif" width="18" height="18" border="0" alt="{#emotions_dlg.innocent}" title="{#emotions_dlg.innocent}" /></a></td> |
| 22 | <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td> | 22 | <td><a href="javascript:EmotionsDialog.insert('smiley-kiss.gif','emotions_dlg.kiss');"><img src="img/smiley-kiss.gif" width="18" height="18" border="0" alt="{#emotions_dlg.kiss}" title="{#emotions_dlg.kiss}" /></a></td> |
| 23 | <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td> | 23 | <td><a href="javascript:EmotionsDialog.insert('smiley-laughing.gif','emotions_dlg.laughing');"><img src="img/smiley-laughing.gif" width="18" height="18" border="0" alt="{#emotions_dlg.laughing}" title="{#emotions_dlg.laughing}" /></a></td> |
| 24 | </tr> | 24 | </tr> |
| 25 | <tr> | 25 | <tr> |
| 26 | <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td> | 26 | <td><a href="javascript:EmotionsDialog.insert('smiley-money-mouth.gif','emotions_dlg.money_mouth');"><img src="img/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{#emotions_dlg.money_mouth}" title="{#emotions_dlg.money_mouth}" /></a></td> |
| 27 | <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td> | 27 | <td><a href="javascript:EmotionsDialog.insert('smiley-sealed.gif','emotions_dlg.sealed');"><img src="img/smiley-sealed.gif" width="18" height="18" border="0" alt="{#emotions_dlg.sealed}" title="{#emotions_dlg.sealed}" /></a></td> |
| 28 | <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td> | 28 | <td><a href="javascript:EmotionsDialog.insert('smiley-smile.gif','emotions_dlg.smile');"><img src="img/smiley-smile.gif" width="18" height="18" border="0" alt="{#emotions_dlg.smile}" title="{#emotions_dlg.smile}" /></a></td> |
| 29 | <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td> | 29 | <td><a href="javascript:EmotionsDialog.insert('smiley-surprised.gif','emotions_dlg.surprised');"><img src="img/smiley-surprised.gif" width="18" height="18" border="0" alt="{#emotions_dlg.surprised}" title="{#emotions_dlg.surprised}" /></a></td> |
| 30 | </tr> | 30 | </tr> |
| 31 | <tr> | 31 | <tr> |
| 32 | <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td> | 32 | <td><a href="javascript:EmotionsDialog.insert('smiley-tongue-out.gif','emotions_dlg.tongue_out');"><img src="img/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{#emotions_dlg.tongue-out}" title="{#emotions_dlg.tongue_out}" /></a></td> |
| 33 | <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td> | 33 | <td><a href="javascript:EmotionsDialog.insert('smiley-undecided.gif','emotions_dlg.undecided');"><img src="img/smiley-undecided.gif" width="18" height="18" border="0" alt="{#emotions_dlg.undecided}" title="{#emotions_dlg.undecided}" /></a></td> |
| 34 | <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td> | 34 | <td><a href="javascript:EmotionsDialog.insert('smiley-wink.gif','emotions_dlg.wink');"><img src="img/smiley-wink.gif" width="18" height="18" border="0" alt="{#emotions_dlg.wink}" title="{#emotions_dlg.wink}" /></a></td> |
| 35 | <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td> | 35 | <td><a href="javascript:EmotionsDialog.insert('smiley-yell.gif','emotions_dlg.yell');"><img src="img/smiley-yell.gif" width="18" height="18" border="0" alt="{#emotions_dlg.yell}" title="{#emotions_dlg.yell}" /></a></td> |
| 36 | </tr> | 36 | </tr> |
| 37 | </table> | 37 | </table> |
| 38 | </div> | 38 | </div> |
| 39 | </body> | 39 | </body> |
| 40 | </html> | 40 | </html> | ... | ... |
| 1 | tinyMCEPopup.requireLangPack(); | 1 | tinyMCEPopup.requireLangPack(); |
| 2 | 2 | ||
| 3 | var EmotionsDialog = { | 3 | var EmotionsDialog = { |
| 4 | init : function(ed) { | 4 | init : function(ed) { |
| 5 | tinyMCEPopup.resizeToInnerSize(); | 5 | tinyMCEPopup.resizeToInnerSize(); |
| 6 | }, | 6 | }, |
| 7 | 7 | ||
| 8 | insert : function(file, title) { | 8 | insert : function(file, title) { |
| 9 | var ed = tinyMCEPopup.editor, dom = ed.dom; | 9 | var ed = tinyMCEPopup.editor, dom = ed.dom; |
| 10 | 10 | ||
| 11 | tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { | 11 | tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { |
| 12 | src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, | 12 | src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, |
| 13 | alt : ed.getLang(title), | 13 | alt : ed.getLang(title), |
| 14 | title : ed.getLang(title), | 14 | title : ed.getLang(title), |
| 15 | border : 0 | 15 | border : 0 |
| 16 | })); | 16 | })); |
| 17 | 17 | ||
| 18 | tinyMCEPopup.close(); | 18 | tinyMCEPopup.close(); |
| 19 | } | 19 | } |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); | 22 | tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); | ... | ... |
| 1 | tinyMCE.addI18n('en.emotions_dlg',{ | 1 | tinyMCE.addI18n('en.emotions_dlg',{ |
| 2 | title:"Insert emotion", | 2 | title:"Insert emotion", |
| 3 | desc:"Emotions", | 3 | desc:"Emotions", |
| 4 | cool:"Cool", | 4 | cool:"Cool", |
| 5 | cry:"Cry", | 5 | cry:"Cry", |
| 6 | embarassed:"Embarassed", | 6 | embarassed:"Embarassed", |
| 7 | foot_in_mouth:"Foot in mouth", | 7 | foot_in_mouth:"Foot in mouth", |
| 8 | frown:"Frown", | 8 | frown:"Frown", |
| 9 | innocent:"Innocent", | 9 | innocent:"Innocent", |
| 10 | kiss:"Kiss", | 10 | kiss:"Kiss", |
| 11 | laughing:"Laughing", | 11 | laughing:"Laughing", |
| 12 | money_mouth:"Money mouth", | 12 | money_mouth:"Money mouth", |
| 13 | sealed:"Sealed", | 13 | sealed:"Sealed", |
| 14 | smile:"Smile", | 14 | smile:"Smile", |
| 15 | surprised:"Surprised", | 15 | surprised:"Surprised", |
| 16 | tongue_out:"Tongue out", | 16 | tongue_out:"Tongue out", |
| 17 | undecided:"Undecided", | 17 | undecided:"Undecided", |
| 18 | wink:"Wink", | 18 | wink:"Wink", |
| 19 | yell:"Yell" | 19 | yell:"Yell" |
| 20 | }); | 20 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> | 3 | <head> |
| 4 | <title>{#example_dlg.title}</title> | 4 | <title>{#example_dlg.title}</title> |
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> |
| 6 | <script type="text/javascript" src="js/dialog.js"></script> | 6 | <script type="text/javascript" src="js/dialog.js"></script> |
| 7 | </head> | 7 | </head> |
| 8 | <body> | 8 | <body> |
| 9 | 9 | ||
| 10 | <form onsubmit="ExampleDialog.insert();return false;" action="#"> | 10 | <form onsubmit="ExampleDialog.insert();return false;" action="#"> |
| 11 | <p>Here is a example dialog.</p> | 11 | <p>Here is a example dialog.</p> |
| 12 | <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p> | 12 | <p>Selected text: <input id="someval" name="someval" type="text" class="text" /></p> |
| 13 | <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p> | 13 | <p>Custom arg: <input id="somearg" name="somearg" type="text" class="text" /></p> |
| 14 | 14 | ||
| 15 | <div class="mceActionPanel"> | 15 | <div class="mceActionPanel"> |
| 16 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" /> | 16 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" /> |
| 17 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | 17 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> |
| 18 | </div> | 18 | </div> |
| 19 | </form> | 19 | </form> |
| 20 | 20 | ||
| 21 | </body> | 21 | </body> |
| 22 | </html> | 22 | </html> | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | // Load plugin specific language pack | 12 | // Load plugin specific language pack |
| 13 | tinymce.PluginManager.requireLangPack('example'); | 13 | tinymce.PluginManager.requireLangPack('example'); |
| 14 | 14 | ||
| 15 | tinymce.create('tinymce.plugins.ExamplePlugin', { | 15 | tinymce.create('tinymce.plugins.ExamplePlugin', { |
| 16 | /** | 16 | /** |
| 17 | * Initializes the plugin, this will be executed after the plugin has been created. | 17 | * Initializes the plugin, this will be executed after the plugin has been created. |
| 18 | * This call is done before the editor instance has finished it's initialization so use the onInit event | 18 | * This call is done before the editor instance has finished it's initialization so use the onInit event |
| 19 | * of the editor instance to intercept that event. | 19 | * of the editor instance to intercept that event. |
| 20 | * | 20 | * |
| 21 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | 21 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. |
| 22 | * @param {string} url Absolute URL to where the plugin is located. | 22 | * @param {string} url Absolute URL to where the plugin is located. |
| 23 | */ | 23 | */ |
| 24 | init : function(ed, url) { | 24 | init : function(ed, url) { |
| 25 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | 25 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); |
| 26 | ed.addCommand('mceExample', function() { | 26 | ed.addCommand('mceExample', function() { |
| 27 | ed.windowManager.open({ | 27 | ed.windowManager.open({ |
| 28 | file : url + '/dialog.htm', | 28 | file : url + '/dialog.htm', |
| 29 | width : 320 + parseInt(ed.getLang('example.delta_width', 0)), | 29 | width : 320 + parseInt(ed.getLang('example.delta_width', 0)), |
| 30 | height : 120 + parseInt(ed.getLang('example.delta_height', 0)), | 30 | height : 120 + parseInt(ed.getLang('example.delta_height', 0)), |
| 31 | inline : 1 | 31 | inline : 1 |
| 32 | }, { | 32 | }, { |
| 33 | plugin_url : url, // Plugin absolute URL | 33 | plugin_url : url, // Plugin absolute URL |
| 34 | some_custom_arg : 'custom arg' // Custom argument | 34 | some_custom_arg : 'custom arg' // Custom argument |
| 35 | }); | 35 | }); |
| 36 | }); | 36 | }); |
| 37 | 37 | ||
| 38 | // Register example button | 38 | // Register example button |
| 39 | ed.addButton('example', { | 39 | ed.addButton('example', { |
| 40 | title : 'example.desc', | 40 | title : 'example.desc', |
| 41 | cmd : 'mceExample', | 41 | cmd : 'mceExample', |
| 42 | image : url + '/img/example.gif' | 42 | image : url + '/img/example.gif' |
| 43 | }); | 43 | }); |
| 44 | 44 | ||
| 45 | // Add a node change handler, selects the button in the UI when a image is selected | 45 | // Add a node change handler, selects the button in the UI when a image is selected |
| 46 | ed.onNodeChange.add(function(ed, cm, n) { | 46 | ed.onNodeChange.add(function(ed, cm, n) { |
| 47 | cm.setActive('example', n.nodeName == 'IMG'); | 47 | cm.setActive('example', n.nodeName == 'IMG'); |
| 48 | }); | 48 | }); |
| 49 | }, | 49 | }, |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * Creates control instances based in the incomming name. This method is normally not | 52 | * Creates control instances based in the incomming name. This method is normally not |
| 53 | * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons | 53 | * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons |
| 54 | * but you sometimes need to create more complex controls like listboxes, split buttons etc then this | 54 | * but you sometimes need to create more complex controls like listboxes, split buttons etc then this |
| 55 | * method can be used to create those. | 55 | * method can be used to create those. |
| 56 | * | 56 | * |
| 57 | * @param {String} n Name of the control to create. | 57 | * @param {String} n Name of the control to create. |
| 58 | * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. | 58 | * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. |
| 59 | * @return {tinymce.ui.Control} New control instance or null if no control was created. | 59 | * @return {tinymce.ui.Control} New control instance or null if no control was created. |
| 60 | */ | 60 | */ |
| 61 | createControl : function(n, cm) { | 61 | createControl : function(n, cm) { |
| 62 | return null; | 62 | return null; |
| 63 | }, | 63 | }, |
| 64 | 64 | ||
| 65 | /** | 65 | /** |
| 66 | * Returns information about the plugin as a name/value array. | 66 | * Returns information about the plugin as a name/value array. |
| 67 | * The current keys are longname, author, authorurl, infourl and version. | 67 | * The current keys are longname, author, authorurl, infourl and version. |
| 68 | * | 68 | * |
| 69 | * @return {Object} Name/value array containing information about the plugin. | 69 | * @return {Object} Name/value array containing information about the plugin. |
| 70 | */ | 70 | */ |
| 71 | getInfo : function() { | 71 | getInfo : function() { |
| 72 | return { | 72 | return { |
| 73 | longname : 'Example plugin', | 73 | longname : 'Example plugin', |
| 74 | author : 'Some author', | 74 | author : 'Some author', |
| 75 | authorurl : 'http://tinymce.moxiecode.com', | 75 | authorurl : 'http://tinymce.moxiecode.com', |
| 76 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', | 76 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', |
| 77 | version : "1.0" | 77 | version : "1.0" |
| 78 | }; | 78 | }; |
| 79 | } | 79 | } |
| 80 | }); | 80 | }); |
| 81 | 81 | ||
| 82 | // Register plugin | 82 | // Register plugin |
| 83 | tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); | 83 | tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); |
| 84 | })(); | 84 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | tinyMCEPopup.requireLangPack(); | 1 | tinyMCEPopup.requireLangPack(); |
| 2 | 2 | ||
| 3 | var ExampleDialog = { | 3 | var ExampleDialog = { |
| 4 | init : function() { | 4 | init : function() { |
| 5 | var f = document.forms[0]; | 5 | var f = document.forms[0]; |
| 6 | 6 | ||
| 7 | // Get the selected contents as text and place it in the input | 7 | // Get the selected contents as text and place it in the input |
| 8 | f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); | 8 | f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); |
| 9 | f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); | 9 | f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); |
| 10 | }, | 10 | }, |
| 11 | 11 | ||
| 12 | insert : function() { | 12 | insert : function() { |
| 13 | // Insert the contents from the input into the document | 13 | // Insert the contents from the input into the document |
| 14 | tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); | 14 | tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); |
| 15 | tinyMCEPopup.close(); | 15 | tinyMCEPopup.close(); |
| 16 | } | 16 | } |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); | 19 | tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); | ... | ... |
| 1 | /* Hide the advanced tab */ | 1 | /* Hide the advanced tab */ |
| 2 | #advanced_tab { | 2 | #advanced_tab { |
| 3 | display: none; | 3 | display: none; |
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | #metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { | 6 | #metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { |
| 7 | width: 280px; | 7 | width: 280px; |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | #doctype, #docencoding { | 10 | #doctype, #docencoding { |
| 11 | width: 200px; | 11 | width: 200px; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | #langcode { | 14 | #langcode { |
| 15 | width: 30px; | 15 | width: 30px; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | #bgimage { | 18 | #bgimage { |
| 19 | width: 220px; | 19 | width: 220px; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | #fontface { | 22 | #fontface { |
| 23 | width: 240px; | 23 | width: 240px; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | #leftmargin, #rightmargin, #topmargin, #bottommargin { | 26 | #leftmargin, #rightmargin, #topmargin, #bottommargin { |
| 27 | width: 50px; | 27 | width: 50px; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | .panel_wrapper div.current { | 30 | .panel_wrapper div.current { |
| 31 | height: 400px; | 31 | height: 400px; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | #stylesheet, #style { | 34 | #stylesheet, #style { |
| 35 | width: 240px; | 35 | width: 240px; |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /* Head list classes */ | 38 | /* Head list classes */ |
| 39 | 39 | ||
| 40 | .headlistwrapper { | 40 | .headlistwrapper { |
| 41 | width: 100%; | 41 | width: 100%; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | .addbutton, .removebutton, .moveupbutton, .movedownbutton { | 44 | .addbutton, .removebutton, .moveupbutton, .movedownbutton { |
| 45 | border-top: 1px solid; | 45 | border-top: 1px solid; |
| 46 | border-left: 1px solid; | 46 | border-left: 1px solid; |
| 47 | border-bottom: 1px solid; | 47 | border-bottom: 1px solid; |
| 48 | border-right: 1px solid; | 48 | border-right: 1px solid; |
| 49 | border-color: #F0F0EE; | 49 | border-color: #F0F0EE; |
| 50 | cursor: default; | 50 | cursor: default; |
| 51 | display: block; | 51 | display: block; |
| 52 | width: 20px; | 52 | width: 20px; |
| 53 | height: 20px; | 53 | height: 20px; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | #doctypes { | 56 | #doctypes { |
| 57 | width: 200px; | 57 | width: 200px; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | .addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { | 60 | .addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { |
| 61 | border: 1px solid #0A246A; | 61 | border: 1px solid #0A246A; |
| 62 | background-color: #B6BDD2; | 62 | background-color: #B6BDD2; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | .addbutton { | 65 | .addbutton { |
| 66 | background-image: url('../images/add.gif'); | 66 | background-image: url('../images/add.gif'); |
| 67 | float: left; | 67 | float: left; |
| 68 | margin-right: 3px; | 68 | margin-right: 3px; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | .removebutton { | 71 | .removebutton { |
| 72 | background-image: url('../images/remove.gif'); | 72 | background-image: url('../images/remove.gif'); |
| 73 | float: left; | 73 | float: left; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | .moveupbutton { | 76 | .moveupbutton { |
| 77 | background-image: url('../images/move_up.gif'); | 77 | background-image: url('../images/move_up.gif'); |
| 78 | float: left; | 78 | float: left; |
| 79 | margin-right: 3px; | 79 | margin-right: 3px; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | .movedownbutton { | 82 | .movedownbutton { |
| 83 | background-image: url('../images/move_down.gif'); | 83 | background-image: url('../images/move_down.gif'); |
| 84 | float: left; | 84 | float: left; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | .selected { | 87 | .selected { |
| 88 | border: 1px solid #0A246A; | 88 | border: 1px solid #0A246A; |
| 89 | background-color: #B6BDD2; | 89 | background-color: #B6BDD2; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | .toolbar { | 92 | .toolbar { |
| 93 | width: 100%; | 93 | width: 100%; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | #headlist { | 96 | #headlist { |
| 97 | width: 100%; | 97 | width: 100%; |
| 98 | margin-top: 3px; | 98 | margin-top: 3px; |
| 99 | font-size: 11px; | 99 | font-size: 11px; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | #info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { | 102 | #info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { |
| 103 | display: none; | 103 | display: none; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | #addmenu { | 106 | #addmenu { |
| 107 | position: absolute; | 107 | position: absolute; |
| 108 | border: 1px solid gray; | 108 | border: 1px solid gray; |
| 109 | display: none; | 109 | display: none; |
| 110 | z-index: 100; | 110 | z-index: 100; |
| 111 | background-color: white; | 111 | background-color: white; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | #addmenu a { | 114 | #addmenu a { |
| 115 | display: block; | 115 | display: block; |
| 116 | width: 100%; | 116 | width: 100%; |
| 117 | line-height: 20px; | 117 | line-height: 20px; |
| 118 | text-decoration: none; | 118 | text-decoration: none; |
| 119 | background-color: white; | 119 | background-color: white; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | #addmenu a:hover { | 122 | #addmenu a:hover { |
| 123 | background-color: #B6BDD2; | 123 | background-color: #B6BDD2; |
| 124 | color: black; | 124 | color: black; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | #addmenu span { | 127 | #addmenu span { |
| 128 | padding-left: 10px; | 128 | padding-left: 10px; |
| 129 | padding-right: 10px; | 129 | padding-right: 10px; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | #updateElementPanel { | 132 | #updateElementPanel { |
| 133 | display: none; | 133 | display: none; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | #script_element .panel_wrapper div.current { | 136 | #script_element .panel_wrapper div.current { |
| 137 | height: 108px; | 137 | height: 108px; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | #style_element .panel_wrapper div.current { | 140 | #style_element .panel_wrapper div.current { |
| 141 | height: 108px; | 141 | height: 108px; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | #link_element .panel_wrapper div.current { | 144 | #link_element .panel_wrapper div.current { |
| 145 | height: 140px; | 145 | height: 140px; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | #element_script_value { | 148 | #element_script_value { |
| 149 | width: 100%; | 149 | width: 100%; |
| 150 | height: 100px; | 150 | height: 100px; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | #element_comment_value { | 153 | #element_comment_value { |
| 154 | width: 100%; | 154 | width: 100%; |
| 155 | height: 120px; | 155 | height: 120px; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | #element_style_value { | 158 | #element_style_value { |
| 159 | width: 100%; | 159 | width: 100%; |
| 160 | height: 100px; | 160 | height: 100px; |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | #element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { | 163 | #element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { |
| 164 | width: 250px; | 164 | width: 250px; |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | .updateElementButton { | 167 | .updateElementButton { |
| 168 | margin-top: 3px; | 168 | margin-top: 3px; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | /* MSIE specific styles */ | 171 | /* MSIE specific styles */ |
| 172 | 172 | ||
| 173 | * html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { | 173 | * html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { |
| 174 | width: 22px; | 174 | width: 22px; |
| 175 | height: 22px; | 175 | height: 22px; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | textarea { | 178 | textarea { |
| 179 | height: 55px; | 179 | height: 55px; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | .panel_wrapper div.current {height:420px;} | 182 | .panel_wrapper div.current {height:420px;} |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.FullPagePlugin', { | 12 | tinymce.create('tinymce.plugins.FullPagePlugin', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this; | 14 | var t = this; |
| 15 | 15 | ||
| 16 | t.editor = ed; | 16 | t.editor = ed; |
| 17 | 17 | ||
| 18 | // Register commands | 18 | // Register commands |
| 19 | ed.addCommand('mceFullPageProperties', function() { | 19 | ed.addCommand('mceFullPageProperties', function() { |
| 20 | ed.windowManager.open({ | 20 | ed.windowManager.open({ |
| 21 | file : url + '/fullpage.htm', | 21 | file : url + '/fullpage.htm', |
| 22 | width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), | 22 | width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), |
| 23 | height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), | 23 | height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), |
| 24 | inline : 1 | 24 | inline : 1 |
| 25 | }, { | 25 | }, { |
| 26 | plugin_url : url, | 26 | plugin_url : url, |
| 27 | head_html : t.head | 27 | head_html : t.head |
| 28 | }); | 28 | }); |
| 29 | }); | 29 | }); |
| 30 | 30 | ||
| 31 | // Register buttons | 31 | // Register buttons |
| 32 | ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); | 32 | ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); |
| 33 | 33 | ||
| 34 | ed.onBeforeSetContent.add(t._setContent, t); | 34 | ed.onBeforeSetContent.add(t._setContent, t); |
| 35 | ed.onSetContent.add(t._setBodyAttribs, t); | 35 | ed.onSetContent.add(t._setBodyAttribs, t); |
| 36 | ed.onGetContent.add(t._getContent, t); | 36 | ed.onGetContent.add(t._getContent, t); |
| 37 | }, | 37 | }, |
| 38 | 38 | ||
| 39 | getInfo : function() { | 39 | getInfo : function() { |
| 40 | return { | 40 | return { |
| 41 | longname : 'Fullpage', | 41 | longname : 'Fullpage', |
| 42 | author : 'Moxiecode Systems AB', | 42 | author : 'Moxiecode Systems AB', |
| 43 | authorurl : 'http://tinymce.moxiecode.com', | 43 | authorurl : 'http://tinymce.moxiecode.com', |
| 44 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', | 44 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', |
| 45 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 45 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 46 | }; | 46 | }; |
| 47 | }, | 47 | }, |
| 48 | 48 | ||
| 49 | // Private plugin internal methods | 49 | // Private plugin internal methods |
| 50 | 50 | ||
| 51 | _setBodyAttribs : function(ed, o) { | 51 | _setBodyAttribs : function(ed, o) { |
| 52 | var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); | 52 | var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); |
| 53 | 53 | ||
| 54 | if (attr && attr[1]) { | 54 | if (attr && attr[1]) { |
| 55 | bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); | 55 | bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); |
| 56 | 56 | ||
| 57 | if (bdattr) { | 57 | if (bdattr) { |
| 58 | for(i = 0, len = bdattr.length; i < len; i++) { | 58 | for(i = 0, len = bdattr.length; i < len; i++) { |
| 59 | kv = bdattr[i].split('='); | 59 | kv = bdattr[i].split('='); |
| 60 | k = kv[0].replace(/\s/,''); | 60 | k = kv[0].replace(/\s/,''); |
| 61 | v = kv[1]; | 61 | v = kv[1]; |
| 62 | 62 | ||
| 63 | if (v) { | 63 | if (v) { |
| 64 | v = v.replace(/^\s+/,'').replace(/\s+$/,''); | 64 | v = v.replace(/^\s+/,'').replace(/\s+$/,''); |
| 65 | t = v.match(/^["'](.*)["']$/); | 65 | t = v.match(/^["'](.*)["']$/); |
| 66 | 66 | ||
| 67 | if (t) | 67 | if (t) |
| 68 | v = t[1]; | 68 | v = t[1]; |
| 69 | } else | 69 | } else |
| 70 | v = k; | 70 | v = k; |
| 71 | 71 | ||
| 72 | ed.dom.setAttrib(ed.getBody(), 'style', v); | 72 | ed.dom.setAttrib(ed.getBody(), 'style', v); |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | }, | 76 | }, |
| 77 | 77 | ||
| 78 | _createSerializer : function() { | 78 | _createSerializer : function() { |
| 79 | return new tinymce.dom.Serializer({ | 79 | return new tinymce.dom.Serializer({ |
| 80 | dom : this.editor.dom, | 80 | dom : this.editor.dom, |
| 81 | apply_source_formatting : true | 81 | apply_source_formatting : true |
| 82 | }); | 82 | }); |
| 83 | }, | 83 | }, |
| 84 | 84 | ||
| 85 | _setContent : function(ed, o) { | 85 | _setContent : function(ed, o) { |
| 86 | var t = this, sp, ep, c = o.content, v, st = ''; | 86 | var t = this, sp, ep, c = o.content, v, st = ''; |
| 87 | 87 | ||
| 88 | // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate | 88 | // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate |
| 89 | if (o.format == 'raw' && t.head) | 89 | if (o.format == 'raw' && t.head) |
| 90 | return; | 90 | return; |
| 91 | 91 | ||
| 92 | if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) | 92 | if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) |
| 93 | return; | 93 | return; |
| 94 | 94 | ||
| 95 | // Parse out head, body and footer | 95 | // Parse out head, body and footer |
| 96 | c = c.replace(/<(\/?)BODY/gi, '<$1body'); | 96 | c = c.replace(/<(\/?)BODY/gi, '<$1body'); |
| 97 | sp = c.indexOf('<body'); | 97 | sp = c.indexOf('<body'); |
| 98 | 98 | ||
| 99 | if (sp != -1) { | 99 | if (sp != -1) { |
| 100 | sp = c.indexOf('>', sp); | 100 | sp = c.indexOf('>', sp); |
| 101 | t.head = c.substring(0, sp + 1); | 101 | t.head = c.substring(0, sp + 1); |
| 102 | 102 | ||
| 103 | ep = c.indexOf('</body', sp); | 103 | ep = c.indexOf('</body', sp); |
| 104 | if (ep == -1) | 104 | if (ep == -1) |
| 105 | ep = c.indexOf('</body', ep); | 105 | ep = c.indexOf('</body', ep); |
| 106 | 106 | ||
| 107 | o.content = c.substring(sp + 1, ep); | 107 | o.content = c.substring(sp + 1, ep); |
| 108 | t.foot = c.substring(ep); | 108 | t.foot = c.substring(ep); |
| 109 | 109 | ||
| 110 | function low(s) { | 110 | function low(s) { |
| 111 | return s.replace(/<\/?[A-Z]+/g, function(a) { | 111 | return s.replace(/<\/?[A-Z]+/g, function(a) { |
| 112 | return a.toLowerCase(); | 112 | return a.toLowerCase(); |
| 113 | }) | 113 | }) |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | t.head = low(t.head); | 116 | t.head = low(t.head); |
| 117 | t.foot = low(t.foot); | 117 | t.foot = low(t.foot); |
| 118 | } else { | 118 | } else { |
| 119 | t.head = ''; | 119 | t.head = ''; |
| 120 | if (ed.getParam('fullpage_default_xml_pi')) | 120 | if (ed.getParam('fullpage_default_xml_pi')) |
| 121 | t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n'; | 121 | t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n'; |
| 122 | 122 | ||
| 123 | t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'); | 123 | t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'); |
| 124 | t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n'; | 124 | t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n'; |
| 125 | 125 | ||
| 126 | if (v = ed.getParam('fullpage_default_encoding')) | 126 | if (v = ed.getParam('fullpage_default_encoding')) |
| 127 | t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n'; | 127 | t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n'; |
| 128 | 128 | ||
| 129 | if (v = ed.getParam('fullpage_default_font_family')) | 129 | if (v = ed.getParam('fullpage_default_font_family')) |
| 130 | st += 'font-family: ' + v + ';'; | 130 | st += 'font-family: ' + v + ';'; |
| 131 | 131 | ||
| 132 | if (v = ed.getParam('fullpage_default_font_size')) | 132 | if (v = ed.getParam('fullpage_default_font_size')) |
| 133 | st += 'font-size: ' + v + ';'; | 133 | st += 'font-size: ' + v + ';'; |
| 134 | 134 | ||
| 135 | if (v = ed.getParam('fullpage_default_text_color')) | 135 | if (v = ed.getParam('fullpage_default_text_color')) |
| 136 | st += 'color: ' + v + ';'; | 136 | st += 'color: ' + v + ';'; |
| 137 | 137 | ||
| 138 | t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n'; | 138 | t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n'; |
| 139 | t.foot = '\n</body>\n</html>'; | 139 | t.foot = '\n</body>\n</html>'; |
| 140 | } | 140 | } |
| 141 | }, | 141 | }, |
| 142 | 142 | ||
| 143 | _getContent : function(ed, o) { | 143 | _getContent : function(ed, o) { |
| 144 | var t = this; | 144 | var t = this; |
| 145 | 145 | ||
| 146 | if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) | 146 | if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) |
| 147 | o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); | 147 | o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); |
| 148 | } | 148 | } |
| 149 | }); | 149 | }); |
| 150 | 150 | ||
| 151 | // Register plugin | 151 | // Register plugin |
| 152 | tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); | 152 | tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); |
| 153 | })(); | 153 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n('en.fullpage_dlg',{ | 1 | tinyMCE.addI18n('en.fullpage_dlg',{ |
| 2 | title:"Document properties", | 2 | title:"Document properties", |
| 3 | meta_tab:"General", | 3 | meta_tab:"General", |
| 4 | appearance_tab:"Appearance", | 4 | appearance_tab:"Appearance", |
| 5 | advanced_tab:"Advanced", | 5 | advanced_tab:"Advanced", |
| 6 | meta_props:"Meta information", | 6 | meta_props:"Meta information", |
| 7 | langprops:"Language and encoding", | 7 | langprops:"Language and encoding", |
| 8 | meta_title:"Title", | 8 | meta_title:"Title", |
| 9 | meta_keywords:"Keywords", | 9 | meta_keywords:"Keywords", |
| 10 | meta_description:"Description", | 10 | meta_description:"Description", |
| 11 | meta_robots:"Robots", | 11 | meta_robots:"Robots", |
| 12 | doctypes:"Doctype", | 12 | doctypes:"Doctype", |
| 13 | langcode:"Language code", | 13 | langcode:"Language code", |
| 14 | langdir:"Language direction", | 14 | langdir:"Language direction", |
| 15 | ltr:"Left to right", | 15 | ltr:"Left to right", |
| 16 | rtl:"Right to left", | 16 | rtl:"Right to left", |
| 17 | xml_pi:"XML declaration", | 17 | xml_pi:"XML declaration", |
| 18 | encoding:"Character encoding", | 18 | encoding:"Character encoding", |
| 19 | appearance_bgprops:"Background properties", | 19 | appearance_bgprops:"Background properties", |
| 20 | appearance_marginprops:"Body margins", | 20 | appearance_marginprops:"Body margins", |
| 21 | appearance_linkprops:"Link colors", | 21 | appearance_linkprops:"Link colors", |
| 22 | appearance_textprops:"Text properties", | 22 | appearance_textprops:"Text properties", |
| 23 | bgcolor:"Background color", | 23 | bgcolor:"Background color", |
| 24 | bgimage:"Background image", | 24 | bgimage:"Background image", |
| 25 | left_margin:"Left margin", | 25 | left_margin:"Left margin", |
| 26 | right_margin:"Right margin", | 26 | right_margin:"Right margin", |
| 27 | top_margin:"Top margin", | 27 | top_margin:"Top margin", |
| 28 | bottom_margin:"Bottom margin", | 28 | bottom_margin:"Bottom margin", |
| 29 | text_color:"Text color", | 29 | text_color:"Text color", |
| 30 | font_size:"Font size", | 30 | font_size:"Font size", |
| 31 | font_face:"Font face", | 31 | font_face:"Font face", |
| 32 | link_color:"Link color", | 32 | link_color:"Link color", |
| 33 | hover_color:"Hover color", | 33 | hover_color:"Hover color", |
| 34 | visited_color:"Visited color", | 34 | visited_color:"Visited color", |
| 35 | active_color:"Active color", | 35 | active_color:"Active color", |
| 36 | textcolor:"Color", | 36 | textcolor:"Color", |
| 37 | fontsize:"Font size", | 37 | fontsize:"Font size", |
| 38 | fontface:"Font family", | 38 | fontface:"Font family", |
| 39 | meta_index_follow:"Index and follow the links", | 39 | meta_index_follow:"Index and follow the links", |
| 40 | meta_index_nofollow:"Index and don't follow the links", | 40 | meta_index_nofollow:"Index and don't follow the links", |
| 41 | meta_noindex_follow:"Do not index but follow the links", | 41 | meta_noindex_follow:"Do not index but follow the links", |
| 42 | meta_noindex_nofollow:"Do not index and don\'t follow the links", | 42 | meta_noindex_nofollow:"Do not index and don\'t follow the links", |
| 43 | appearance_style:"Stylesheet and style properties", | 43 | appearance_style:"Stylesheet and style properties", |
| 44 | stylesheet:"Stylesheet", | 44 | stylesheet:"Stylesheet", |
| 45 | style:"Style", | 45 | style:"Style", |
| 46 | author:"Author", | 46 | author:"Author", |
| 47 | copyright:"Copyright", | 47 | copyright:"Copyright", |
| 48 | add:"Add new element", | 48 | add:"Add new element", |
| 49 | remove:"Remove selected element", | 49 | remove:"Remove selected element", |
| 50 | moveup:"Move selected element up", | 50 | moveup:"Move selected element up", |
| 51 | movedown:"Move selected element down", | 51 | movedown:"Move selected element down", |
| 52 | head_elements:"Head elements", | 52 | head_elements:"Head elements", |
| 53 | info:"Information", | 53 | info:"Information", |
| 54 | add_title:"Title element", | 54 | add_title:"Title element", |
| 55 | add_meta:"Meta element", | 55 | add_meta:"Meta element", |
| 56 | add_script:"Script element", | 56 | add_script:"Script element", |
| 57 | add_style:"Style element", | 57 | add_style:"Style element", |
| 58 | add_link:"Link element", | 58 | add_link:"Link element", |
| 59 | add_base:"Base element", | 59 | add_base:"Base element", |
| 60 | add_comment:"Comment node", | 60 | add_comment:"Comment node", |
| 61 | title_element:"Title element", | 61 | title_element:"Title element", |
| 62 | script_element:"Script element", | 62 | script_element:"Script element", |
| 63 | style_element:"Style element", | 63 | style_element:"Style element", |
| 64 | base_element:"Base element", | 64 | base_element:"Base element", |
| 65 | link_element:"Link element", | 65 | link_element:"Link element", |
| 66 | meta_element:"Meta element", | 66 | meta_element:"Meta element", |
| 67 | comment_element:"Comment", | 67 | comment_element:"Comment", |
| 68 | src:"Src", | 68 | src:"Src", |
| 69 | language:"Language", | 69 | language:"Language", |
| 70 | href:"Href", | 70 | href:"Href", |
| 71 | target:"Target", | 71 | target:"Target", |
| 72 | type:"Type", | 72 | type:"Type", |
| 73 | charset:"Charset", | 73 | charset:"Charset", |
| 74 | defer:"Defer", | 74 | defer:"Defer", |
| 75 | media:"Media", | 75 | media:"Media", |
| 76 | properties:"Properties", | 76 | properties:"Properties", |
| 77 | name:"Name", | 77 | name:"Name", |
| 78 | value:"Value", | 78 | value:"Value", |
| 79 | content:"Content", | 79 | content:"Content", |
| 80 | rel:"Rel", | 80 | rel:"Rel", |
| 81 | rev:"Rev", | 81 | rev:"Rev", |
| 82 | hreflang:"Href lang", | 82 | hreflang:"Href lang", |
| 83 | general_props:"General", | 83 | general_props:"General", |
| 84 | advanced_props:"Advanced" | 84 | advanced_props:"Advanced" |
| 85 | }); | 85 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> | 3 | <head> |
| 4 | <title></title> | 4 | <title></title> |
| 5 | <script type="text/javascript" src="../../tiny_mce.js"></script> | 5 | <script type="text/javascript" src="../../tiny_mce.js"></script> |
| 6 | <script type="text/javascript"> | 6 | <script type="text/javascript"> |
| 7 | function patchCallback(settings, key) { | 7 | function patchCallback(settings, key) { |
| 8 | if (settings[key]) | 8 | if (settings[key]) |
| 9 | settings[key] = "window.opener." + settings[key]; | 9 | settings[key] = "window.opener." + settings[key]; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id; | 12 | var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id; |
| 13 | 13 | ||
| 14 | // Clone array | 14 | // Clone array |
| 15 | for (var n in paSe) | 15 | for (var n in paSe) |
| 16 | settings[n] = paSe[n]; | 16 | settings[n] = paSe[n]; |
| 17 | 17 | ||
| 18 | // Override options for fullscreen | 18 | // Override options for fullscreen |
| 19 | for (var n in paSe.fullscreen_settings) | 19 | for (var n in paSe.fullscreen_settings) |
| 20 | settings[n] = paSe.fullscreen_settings[n]; | 20 | settings[n] = paSe.fullscreen_settings[n]; |
| 21 | 21 | ||
| 22 | // Patch callbacks, make them point to window.opener | 22 | // Patch callbacks, make them point to window.opener |
| 23 | patchCallback(settings, 'urlconverter_callback'); | 23 | patchCallback(settings, 'urlconverter_callback'); |
| 24 | patchCallback(settings, 'insertlink_callback'); | 24 | patchCallback(settings, 'insertlink_callback'); |
| 25 | patchCallback(settings, 'insertimage_callback'); | 25 | patchCallback(settings, 'insertimage_callback'); |
| 26 | patchCallback(settings, 'setupcontent_callback'); | 26 | patchCallback(settings, 'setupcontent_callback'); |
| 27 | patchCallback(settings, 'save_callback'); | 27 | patchCallback(settings, 'save_callback'); |
| 28 | patchCallback(settings, 'onchange_callback'); | 28 | patchCallback(settings, 'onchange_callback'); |
| 29 | patchCallback(settings, 'init_instance_callback'); | 29 | patchCallback(settings, 'init_instance_callback'); |
| 30 | patchCallback(settings, 'file_browser_callback'); | 30 | patchCallback(settings, 'file_browser_callback'); |
| 31 | patchCallback(settings, 'cleanup_callback'); | 31 | patchCallback(settings, 'cleanup_callback'); |
| 32 | patchCallback(settings, 'execcommand_callback'); | 32 | patchCallback(settings, 'execcommand_callback'); |
| 33 | patchCallback(settings, 'oninit'); | 33 | patchCallback(settings, 'oninit'); |
| 34 | 34 | ||
| 35 | // Set options | 35 | // Set options |
| 36 | delete settings.id; | 36 | delete settings.id; |
| 37 | settings['mode'] = 'exact'; | 37 | settings['mode'] = 'exact'; |
| 38 | settings['elements'] = 'fullscreenarea'; | 38 | settings['elements'] = 'fullscreenarea'; |
| 39 | settings['add_unload_trigger'] = false; | 39 | settings['add_unload_trigger'] = false; |
| 40 | settings['ask'] = false; | 40 | settings['ask'] = false; |
| 41 | settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); | 41 | settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); |
| 42 | settings['fullscreen_is_enabled'] = true; | 42 | settings['fullscreen_is_enabled'] = true; |
| 43 | settings['fullscreen_editor_id'] = oeID; | 43 | settings['fullscreen_editor_id'] = oeID; |
| 44 | settings['theme_advanced_resizing'] = false; | 44 | settings['theme_advanced_resizing'] = false; |
| 45 | settings['strict_loading_mode'] = true; | 45 | settings['strict_loading_mode'] = true; |
| 46 | 46 | ||
| 47 | settings.save_onsavecallback = function() { | 47 | settings.save_onsavecallback = function() { |
| 48 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'}); | 48 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'}); |
| 49 | window.opener.tinyMCE.get(oeID).execCommand('mceSave'); | 49 | window.opener.tinyMCE.get(oeID).execCommand('mceSave'); |
| 50 | window.close(); | 50 | window.close(); |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | function unloadHandler(e) { | 53 | function unloadHandler(e) { |
| 54 | moveContent(); | 54 | moveContent(); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | function moveContent() { | 57 | function moveContent() { |
| 58 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent()); | 58 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent()); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | function closeFullscreen() { | 61 | function closeFullscreen() { |
| 62 | moveContent(); | 62 | moveContent(); |
| 63 | window.close(); | 63 | window.close(); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | function doParentSubmit() { | 66 | function doParentSubmit() { |
| 67 | moveContent(); | 67 | moveContent(); |
| 68 | 68 | ||
| 69 | if (window.opener.tinyMCE.selectedInstance.formElement.form) | 69 | if (window.opener.tinyMCE.selectedInstance.formElement.form) |
| 70 | window.opener.tinyMCE.selectedInstance.formElement.form.submit(); | 70 | window.opener.tinyMCE.selectedInstance.formElement.form.submit(); |
| 71 | 71 | ||
| 72 | window.close(); | 72 | window.close(); |
| 73 | 73 | ||
| 74 | return false; | 74 | return false; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | function render() { | 77 | function render() { |
| 78 | var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM; | 78 | var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM; |
| 79 | 79 | ||
| 80 | e.value = window.opener.tinyMCE.get(oeID).getContent(); | 80 | e.value = window.opener.tinyMCE.get(oeID).getContent(); |
| 81 | 81 | ||
| 82 | vp = dom.getViewPort(); | 82 | vp = dom.getViewPort(); |
| 83 | settings.width = vp.w; | 83 | settings.width = vp.w; |
| 84 | settings.height = vp.h - 15; | 84 | settings.height = vp.h - 15; |
| 85 | 85 | ||
| 86 | tinymce.dom.Event.add(window, 'resize', function() { | 86 | tinymce.dom.Event.add(window, 'resize', function() { |
| 87 | var vp = dom.getViewPort(); | 87 | var vp = dom.getViewPort(); |
| 88 | 88 | ||
| 89 | tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h); | 89 | tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h); |
| 90 | }); | 90 | }); |
| 91 | 91 | ||
| 92 | tinyMCE.init(settings); | 92 | tinyMCE.init(settings); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | // Add onunload | 95 | // Add onunload |
| 96 | tinymce.dom.Event.add(window, "beforeunload", unloadHandler); | 96 | tinymce.dom.Event.add(window, "beforeunload", unloadHandler); |
| 97 | </script> | 97 | </script> |
| 98 | </head> | 98 | </head> |
| 99 | <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> | 99 | <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> |
| 100 | <form onsubmit="doParentSubmit();"> | 100 | <form onsubmit="doParentSubmit();"> |
| 101 | <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> | 101 | <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> |
| 102 | </form> | 102 | </form> |
| 103 | 103 | ||
| 104 | <script type="text/javascript"> | 104 | <script type="text/javascript"> |
| 105 | render(); | 105 | render(); |
| 106 | </script> | 106 | </script> |
| 107 | 107 | ||
| 108 | </body> | 108 | </body> |
| 109 | </html> | 109 | </html> | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.IESpell', { | 12 | tinymce.create('tinymce.plugins.IESpell', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this, sp; | 14 | var t = this, sp; |
| 15 | 15 | ||
| 16 | if (!tinymce.isIE) | 16 | if (!tinymce.isIE) |
| 17 | return; | 17 | return; |
| 18 | 18 | ||
| 19 | t.editor = ed; | 19 | t.editor = ed; |
| 20 | 20 | ||
| 21 | // Register commands | 21 | // Register commands |
| 22 | ed.addCommand('mceIESpell', function() { | 22 | ed.addCommand('mceIESpell', function() { |
| 23 | try { | 23 | try { |
| 24 | sp = new ActiveXObject("ieSpell.ieSpellExtension"); | 24 | sp = new ActiveXObject("ieSpell.ieSpellExtension"); |
| 25 | sp.CheckDocumentNode(ed.getDoc().documentElement); | 25 | sp.CheckDocumentNode(ed.getDoc().documentElement); |
| 26 | } catch (e) { | 26 | } catch (e) { |
| 27 | if (e.number == -2146827859) { | 27 | if (e.number == -2146827859) { |
| 28 | ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { | 28 | ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { |
| 29 | if (s) | 29 | if (s) |
| 30 | window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); | 30 | window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); |
| 31 | }); | 31 | }); |
| 32 | } else | 32 | } else |
| 33 | ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); | 33 | ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); |
| 34 | } | 34 | } |
| 35 | }); | 35 | }); |
| 36 | 36 | ||
| 37 | // Register buttons | 37 | // Register buttons |
| 38 | ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); | 38 | ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); |
| 39 | }, | 39 | }, |
| 40 | 40 | ||
| 41 | getInfo : function() { | 41 | getInfo : function() { |
| 42 | return { | 42 | return { |
| 43 | longname : 'IESpell (IE Only)', | 43 | longname : 'IESpell (IE Only)', |
| 44 | author : 'Moxiecode Systems AB', | 44 | author : 'Moxiecode Systems AB', |
| 45 | authorurl : 'http://tinymce.moxiecode.com', | 45 | authorurl : 'http://tinymce.moxiecode.com', |
| 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', | 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', |
| 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 48 | }; | 48 | }; |
| 49 | } | 49 | } |
| 50 | }); | 50 | }); |
| 51 | 51 | ||
| 52 | // Register plugin | 52 | // Register plugin |
| 53 | tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); | 53 | tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); |
| 54 | })(); | 54 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.InsertDateTime', { | 12 | tinymce.create('tinymce.plugins.InsertDateTime', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this; | 14 | var t = this; |
| 15 | 15 | ||
| 16 | t.editor = ed; | 16 | t.editor = ed; |
| 17 | 17 | ||
| 18 | ed.addCommand('mceInsertDate', function() { | 18 | ed.addCommand('mceInsertDate', function() { |
| 19 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); | 19 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); |
| 20 | 20 | ||
| 21 | ed.execCommand('mceInsertContent', false, str); | 21 | ed.execCommand('mceInsertContent', false, str); |
| 22 | }); | 22 | }); |
| 23 | 23 | ||
| 24 | ed.addCommand('mceInsertTime', function() { | 24 | ed.addCommand('mceInsertTime', function() { |
| 25 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); | 25 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); |
| 26 | 26 | ||
| 27 | ed.execCommand('mceInsertContent', false, str); | 27 | ed.execCommand('mceInsertContent', false, str); |
| 28 | }); | 28 | }); |
| 29 | 29 | ||
| 30 | ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); | 30 | ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); |
| 31 | ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); | 31 | ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); |
| 32 | }, | 32 | }, |
| 33 | 33 | ||
| 34 | getInfo : function() { | 34 | getInfo : function() { |
| 35 | return { | 35 | return { |
| 36 | longname : 'Insert date/time', | 36 | longname : 'Insert date/time', |
| 37 | author : 'Moxiecode Systems AB', | 37 | author : 'Moxiecode Systems AB', |
| 38 | authorurl : 'http://tinymce.moxiecode.com', | 38 | authorurl : 'http://tinymce.moxiecode.com', |
| 39 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', | 39 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', |
| 40 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 40 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 41 | }; | 41 | }; |
| 42 | }, | 42 | }, |
| 43 | 43 | ||
| 44 | // Private methods | 44 | // Private methods |
| 45 | 45 | ||
| 46 | _getDateTime : function(d, fmt) { | 46 | _getDateTime : function(d, fmt) { |
| 47 | var ed = this.editor; | 47 | var ed = this.editor; |
| 48 | 48 | ||
| 49 | function addZeros(value, len) { | 49 | function addZeros(value, len) { |
| 50 | value = "" + value; | 50 | value = "" + value; |
| 51 | 51 | ||
| 52 | if (value.length < len) { | 52 | if (value.length < len) { |
| 53 | for (var i=0; i<(len-value.length); i++) | 53 | for (var i=0; i<(len-value.length); i++) |
| 54 | value = "0" + value; | 54 | value = "0" + value; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | return value; | 57 | return value; |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | fmt = fmt.replace("%D", "%m/%d/%y"); | 60 | fmt = fmt.replace("%D", "%m/%d/%y"); |
| 61 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | 61 | fmt = fmt.replace("%r", "%I:%M:%S %p"); |
| 62 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | 62 | fmt = fmt.replace("%Y", "" + d.getFullYear()); |
| 63 | fmt = fmt.replace("%y", "" + d.getYear()); | 63 | fmt = fmt.replace("%y", "" + d.getYear()); |
| 64 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | 64 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); |
| 65 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | 65 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); |
| 66 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | 66 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); |
| 67 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | 67 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); |
| 68 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | 68 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); |
| 69 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | 69 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); |
| 70 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | 70 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); |
| 71 | fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); | 71 | fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); |
| 72 | fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); | 72 | fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); |
| 73 | fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); | 73 | fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); |
| 74 | fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); | 74 | fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); |
| 75 | fmt = fmt.replace("%%", "%"); | 75 | fmt = fmt.replace("%%", "%"); |
| 76 | 76 | ||
| 77 | return fmt; | 77 | return fmt; |
| 78 | } | 78 | } |
| 79 | }); | 79 | }); |
| 80 | 80 | ||
| 81 | // Register plugin | 81 | // Register plugin |
| 82 | tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); | 82 | tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); |
| 83 | })(); | 83 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | * | 9 | * |
| 10 | * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align | 10 | * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align |
| 11 | * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash | 11 | * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash |
| 12 | * | 12 | * |
| 13 | * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are | 13 | * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are |
| 14 | * not apart of the newer specifications for HTML and XHTML. | 14 | * not apart of the newer specifications for HTML and XHTML. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | (function(tinymce) { | 17 | (function(tinymce) { |
| 18 | // Override inline_styles setting to force TinyMCE to produce deprecated contents | 18 | // Override inline_styles setting to force TinyMCE to produce deprecated contents |
| 19 | tinymce.onAddEditor.addToTop(function(tinymce, editor) { | 19 | tinymce.onAddEditor.addToTop(function(tinymce, editor) { |
| 20 | editor.settings.inline_styles = false; | 20 | editor.settings.inline_styles = false; |
| 21 | }); | 21 | }); |
| 22 | 22 | ||
| 23 | // Create the legacy ouput plugin | 23 | // Create the legacy ouput plugin |
| 24 | tinymce.create('tinymce.plugins.LegacyOutput', { | 24 | tinymce.create('tinymce.plugins.LegacyOutput', { |
| 25 | init : function(editor) { | 25 | init : function(editor) { |
| 26 | editor.onInit.add(function() { | 26 | editor.onInit.add(function() { |
| 27 | var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', | 27 | var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', |
| 28 | fontSizes = tinymce.explode(editor.settings.font_size_style_values), | 28 | fontSizes = tinymce.explode(editor.settings.font_size_style_values), |
| 29 | serializer = editor.serializer; | 29 | serializer = editor.serializer; |
| 30 | 30 | ||
| 31 | // Override some internal formats to produce legacy elements and attributes | 31 | // Override some internal formats to produce legacy elements and attributes |
| 32 | editor.formatter.register({ | 32 | editor.formatter.register({ |
| 33 | // Change alignment formats to use the deprecated align attribute | 33 | // Change alignment formats to use the deprecated align attribute |
| 34 | alignleft : {selector : alignElements, attributes : {align : 'left'}}, | 34 | alignleft : {selector : alignElements, attributes : {align : 'left'}}, |
| 35 | aligncenter : {selector : alignElements, attributes : {align : 'center'}}, | 35 | aligncenter : {selector : alignElements, attributes : {align : 'center'}}, |
| 36 | alignright : {selector : alignElements, attributes : {align : 'right'}}, | 36 | alignright : {selector : alignElements, attributes : {align : 'right'}}, |
| 37 | alignfull : {selector : alignElements, attributes : {align : 'full'}}, | 37 | alignfull : {selector : alignElements, attributes : {align : 'full'}}, |
| 38 | 38 | ||
| 39 | // Change the basic formatting elements to use deprecated element types | 39 | // Change the basic formatting elements to use deprecated element types |
| 40 | bold : {inline : 'b'}, | 40 | bold : {inline : 'b'}, |
| 41 | italic : {inline : 'i'}, | 41 | italic : {inline : 'i'}, |
| 42 | underline : {inline : 'u'}, | 42 | underline : {inline : 'u'}, |
| 43 | strikethrough : {inline : 'strike'}, | 43 | strikethrough : {inline : 'strike'}, |
| 44 | 44 | ||
| 45 | // Change font size and font family to use the deprecated font element | 45 | // Change font size and font family to use the deprecated font element |
| 46 | fontname : {inline : 'font', attributes : {face : '%value'}}, | 46 | fontname : {inline : 'font', attributes : {face : '%value'}}, |
| 47 | fontsize : { | 47 | fontsize : { |
| 48 | inline : 'font', | 48 | inline : 'font', |
| 49 | attributes : { | 49 | attributes : { |
| 50 | size : function(vars) { | 50 | size : function(vars) { |
| 51 | return tinymce.inArray(fontSizes, vars.value) + 1; | 51 | return tinymce.inArray(fontSizes, vars.value) + 1; |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | }, | 54 | }, |
| 55 | 55 | ||
| 56 | // Setup font elements for colors as well | 56 | // Setup font elements for colors as well |
| 57 | forecolor : {inline : 'font', styles : {color : '%value'}}, | 57 | forecolor : {inline : 'font', styles : {color : '%value'}}, |
| 58 | hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} | 58 | hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} |
| 59 | }); | 59 | }); |
| 60 | 60 | ||
| 61 | // Force parsing of the serializer rules | 61 | // Force parsing of the serializer rules |
| 62 | serializer._setup(); | 62 | serializer._setup(); |
| 63 | 63 | ||
| 64 | // Check that deprecated elements are allowed if not add them | 64 | // Check that deprecated elements are allowed if not add them |
| 65 | tinymce.each('b,i,u,strike'.split(','), function(name) { | 65 | tinymce.each('b,i,u,strike'.split(','), function(name) { |
| 66 | var rule = serializer.rules[name]; | 66 | var rule = serializer.rules[name]; |
| 67 | 67 | ||
| 68 | if (!rule) | 68 | if (!rule) |
| 69 | serializer.addRules(name); | 69 | serializer.addRules(name); |
| 70 | }); | 70 | }); |
| 71 | 71 | ||
| 72 | // Add font element if it's missing | 72 | // Add font element if it's missing |
| 73 | if (!serializer.rules["font"]) | 73 | if (!serializer.rules["font"]) |
| 74 | serializer.addRules("font[face|size|color|style]"); | 74 | serializer.addRules("font[face|size|color|style]"); |
| 75 | 75 | ||
| 76 | // Add the missing and depreacted align attribute for the serialization engine | 76 | // Add the missing and depreacted align attribute for the serialization engine |
| 77 | tinymce.each(alignElements.split(','), function(name) { | 77 | tinymce.each(alignElements.split(','), function(name) { |
| 78 | var rule = serializer.rules[name], found; | 78 | var rule = serializer.rules[name], found; |
| 79 | 79 | ||
| 80 | if (rule) { | 80 | if (rule) { |
| 81 | tinymce.each(rule.attribs, function(name, attr) { | 81 | tinymce.each(rule.attribs, function(name, attr) { |
| 82 | if (attr.name == 'align') { | 82 | if (attr.name == 'align') { |
| 83 | found = true; | 83 | found = true; |
| 84 | return false; | 84 | return false; |
| 85 | } | 85 | } |
| 86 | }); | 86 | }); |
| 87 | 87 | ||
| 88 | if (!found) | 88 | if (!found) |
| 89 | rule.attribs.push({name : 'align'}); | 89 | rule.attribs.push({name : 'align'}); |
| 90 | } | 90 | } |
| 91 | }); | 91 | }); |
| 92 | 92 | ||
| 93 | // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes | 93 | // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes |
| 94 | editor.onNodeChange.add(function(editor, control_manager) { | 94 | editor.onNodeChange.add(function(editor, control_manager) { |
| 95 | var control, fontElm, fontName, fontSize; | 95 | var control, fontElm, fontName, fontSize; |
| 96 | 96 | ||
| 97 | // Find font element get it's name and size | 97 | // Find font element get it's name and size |
| 98 | fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); | 98 | fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); |
| 99 | if (fontElm) { | 99 | if (fontElm) { |
| 100 | fontName = fontElm.face; | 100 | fontName = fontElm.face; |
| 101 | fontSize = fontElm.size; | 101 | fontSize = fontElm.size; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | // Select/unselect the font name in droplist | 104 | // Select/unselect the font name in droplist |
| 105 | if (control = control_manager.get('fontselect')) { | 105 | if (control = control_manager.get('fontselect')) { |
| 106 | control.select(function(value) { | 106 | control.select(function(value) { |
| 107 | return value == fontName; | 107 | return value == fontName; |
| 108 | }); | 108 | }); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | // Select/unselect the font size in droplist | 111 | // Select/unselect the font size in droplist |
| 112 | if (control = control_manager.get('fontsizeselect')) { | 112 | if (control = control_manager.get('fontsizeselect')) { |
| 113 | control.select(function(value) { | 113 | control.select(function(value) { |
| 114 | var index = tinymce.inArray(fontSizes, value.fontSize); | 114 | var index = tinymce.inArray(fontSizes, value.fontSize); |
| 115 | 115 | ||
| 116 | return index + 1 == fontSize; | 116 | return index + 1 == fontSize; |
| 117 | }); | 117 | }); |
| 118 | } | 118 | } |
| 119 | }); | 119 | }); |
| 120 | }); | 120 | }); |
| 121 | }, | 121 | }, |
| 122 | 122 | ||
| 123 | getInfo : function() { | 123 | getInfo : function() { |
| 124 | return { | 124 | return { |
| 125 | longname : 'LegacyOutput', | 125 | longname : 'LegacyOutput', |
| 126 | author : 'Moxiecode Systems AB', | 126 | author : 'Moxiecode Systems AB', |
| 127 | authorurl : 'http://tinymce.moxiecode.com', | 127 | authorurl : 'http://tinymce.moxiecode.com', |
| 128 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', | 128 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', |
| 129 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 129 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 130 | }; | 130 | }; |
| 131 | } | 131 | } |
| 132 | }); | 132 | }); |
| 133 | 133 | ||
| 134 | // Register plugin | 134 | // Register plugin |
| 135 | tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); | 135 | tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); |
| 136 | })(tinymce); | 136 | })(tinymce); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | .mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} | 1 | .mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} |
| 2 | .mceItemShockWave {background-image: url(../img/shockwave.gif);} | 2 | .mceItemShockWave {background-image: url(../img/shockwave.gif);} |
| 3 | .mceItemFlash {background-image:url(../img/flash.gif);} | 3 | .mceItemFlash {background-image:url(../img/flash.gif);} |
| 4 | .mceItemQuickTime {background-image:url(../img/quicktime.gif);} | 4 | .mceItemQuickTime {background-image:url(../img/quicktime.gif);} |
| 5 | .mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} | 5 | .mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} |
| 6 | .mceItemRealMedia {background-image:url(../img/realmedia.gif);} | 6 | .mceItemRealMedia {background-image:url(../img/realmedia.gif);} | ... | ... |
| 1 | #id, #name, #hspace, #vspace, #class_name, #align { width: 100px } | 1 | #id, #name, #hspace, #vspace, #class_name, #align { width: 100px } |
| 2 | #hspace, #vspace { width: 50px } | 2 | #hspace, #vspace { width: 50px } |
| 3 | #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } | 3 | #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } |
| 4 | #flash_base, #flash_flashvars { width: 240px } | 4 | #flash_base, #flash_flashvars { width: 240px } |
| 5 | #width, #height { width: 40px } | 5 | #width, #height { width: 40px } |
| 6 | #src, #media_type { width: 250px } | 6 | #src, #media_type { width: 250px } |
| 7 | #class { width: 120px } | 7 | #class { width: 120px } |
| 8 | #prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } | 8 | #prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } |
| 9 | .panel_wrapper div.current { height: 390px; overflow: auto } | 9 | .panel_wrapper div.current { height: 390px; overflow: auto } |
| 10 | #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } | 10 | #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } |
| 11 | .mceAddSelectValue { background-color: #DDDDDD } | 11 | .mceAddSelectValue { background-color: #DDDDDD } |
| 12 | #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 { width: 70px } | 12 | #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 { width: 70px } |
| 13 | #wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } | 13 | #wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } |
| 14 | #rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } | 14 | #rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } |
| 15 | #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } | 15 | #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } |
| 16 | #qt_qtsrc { width: 200px } | 16 | #qt_qtsrc { width: 200px } | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | /** | 1 | /** |
| 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. | 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. |
| 3 | */ | 3 | */ |
| 4 | 4 | ||
| 5 | function writeFlash(p) { | 5 | function writeFlash(p) { |
| 6 | writeEmbed( | 6 | writeEmbed( |
| 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', | 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', |
| 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', |
| 9 | 'application/x-shockwave-flash', | 9 | 'application/x-shockwave-flash', |
| 10 | p | 10 | p |
| 11 | ); | 11 | ); |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | function writeShockWave(p) { | 14 | function writeShockWave(p) { |
| 15 | writeEmbed( | 15 | writeEmbed( |
| 16 | '166B1BCA-3F9C-11CF-8075-444553540000', | 16 | '166B1BCA-3F9C-11CF-8075-444553540000', |
| 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', | 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', |
| 18 | 'application/x-director', | 18 | 'application/x-director', |
| 19 | p | 19 | p |
| 20 | ); | 20 | ); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | function writeQuickTime(p) { | 23 | function writeQuickTime(p) { |
| 24 | writeEmbed( | 24 | writeEmbed( |
| 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', | 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', |
| 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', | 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', |
| 27 | 'video/quicktime', | 27 | 'video/quicktime', |
| 28 | p | 28 | p |
| 29 | ); | 29 | ); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | function writeRealMedia(p) { | 32 | function writeRealMedia(p) { |
| 33 | writeEmbed( | 33 | writeEmbed( |
| 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', | 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', |
| 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', |
| 36 | 'audio/x-pn-realaudio-plugin', | 36 | 'audio/x-pn-realaudio-plugin', |
| 37 | p | 37 | p |
| 38 | ); | 38 | ); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | function writeWindowsMedia(p) { | 41 | function writeWindowsMedia(p) { |
| 42 | p.url = p.src; | 42 | p.url = p.src; |
| 43 | writeEmbed( | 43 | writeEmbed( |
| 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', | 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', |
| 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', | 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', |
| 46 | 'application/x-mplayer2', | 46 | 'application/x-mplayer2', |
| 47 | p | 47 | p |
| 48 | ); | 48 | ); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | function writeEmbed(cls, cb, mt, p) { | 51 | function writeEmbed(cls, cb, mt, p) { |
| 52 | var h = '', n; | 52 | var h = '', n; |
| 53 | 53 | ||
| 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; | 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; |
| 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; | 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; |
| 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; | 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; |
| 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; | 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; |
| 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; | 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; |
| 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; | 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; |
| 60 | h += '>'; | 60 | h += '>'; |
| 61 | 61 | ||
| 62 | for (n in p) | 62 | for (n in p) |
| 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; | 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; |
| 64 | 64 | ||
| 65 | h += '<embed type="' + mt + '"'; | 65 | h += '<embed type="' + mt + '"'; |
| 66 | 66 | ||
| 67 | for (n in p) | 67 | for (n in p) |
| 68 | h += n + '="' + p[n] + '" '; | 68 | h += n + '="' + p[n] + '" '; |
| 69 | 69 | ||
| 70 | h += '></embed></object>'; | 70 | h += '></embed></object>'; |
| 71 | 71 | ||
| 72 | document.write(h); | 72 | document.write(h); |
| 73 | } | 73 | } | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | tinyMCE.addI18n('en.media_dlg',{ | 1 | tinyMCE.addI18n('en.media_dlg',{ |
| 2 | title:"Insert / edit embedded media", | 2 | title:"Insert / edit embedded media", |
| 3 | general:"General", | 3 | general:"General", |
| 4 | advanced:"Advanced", | 4 | advanced:"Advanced", |
| 5 | file:"File/URL", | 5 | file:"File/URL", |
| 6 | list:"List", | 6 | list:"List", |
| 7 | size:"Dimensions", | 7 | size:"Dimensions", |
| 8 | preview:"Preview", | 8 | preview:"Preview", |
| 9 | constrain_proportions:"Constrain proportions", | 9 | constrain_proportions:"Constrain proportions", |
| 10 | type:"Type", | 10 | type:"Type", |
| 11 | id:"Id", | 11 | id:"Id", |
| 12 | name:"Name", | 12 | name:"Name", |
| 13 | class_name:"Class", | 13 | class_name:"Class", |
| 14 | vspace:"V-Space", | 14 | vspace:"V-Space", |
| 15 | hspace:"H-Space", | 15 | hspace:"H-Space", |
| 16 | play:"Auto play", | 16 | play:"Auto play", |
| 17 | loop:"Loop", | 17 | loop:"Loop", |
| 18 | menu:"Show menu", | 18 | menu:"Show menu", |
| 19 | quality:"Quality", | 19 | quality:"Quality", |
| 20 | scale:"Scale", | 20 | scale:"Scale", |
| 21 | align:"Align", | 21 | align:"Align", |
| 22 | salign:"SAlign", | 22 | salign:"SAlign", |
| 23 | wmode:"WMode", | 23 | wmode:"WMode", |
| 24 | bgcolor:"Background", | 24 | bgcolor:"Background", |
| 25 | base:"Base", | 25 | base:"Base", |
| 26 | flashvars:"Flashvars", | 26 | flashvars:"Flashvars", |
| 27 | liveconnect:"SWLiveConnect", | 27 | liveconnect:"SWLiveConnect", |
| 28 | autohref:"AutoHREF", | 28 | autohref:"AutoHREF", |
| 29 | cache:"Cache", | 29 | cache:"Cache", |
| 30 | hidden:"Hidden", | 30 | hidden:"Hidden", |
| 31 | controller:"Controller", | 31 | controller:"Controller", |
| 32 | kioskmode:"Kiosk mode", | 32 | kioskmode:"Kiosk mode", |
| 33 | playeveryframe:"Play every frame", | 33 | playeveryframe:"Play every frame", |
| 34 | targetcache:"Target cache", | 34 | targetcache:"Target cache", |
| 35 | correction:"No correction", | 35 | correction:"No correction", |
| 36 | enablejavascript:"Enable JavaScript", | 36 | enablejavascript:"Enable JavaScript", |
| 37 | starttime:"Start time", | 37 | starttime:"Start time", |
| 38 | endtime:"End time", | 38 | endtime:"End time", |
| 39 | href:"Href", | 39 | href:"Href", |
| 40 | qtsrcchokespeed:"Choke speed", | 40 | qtsrcchokespeed:"Choke speed", |
| 41 | target:"Target", | 41 | target:"Target", |
| 42 | volume:"Volume", | 42 | volume:"Volume", |
| 43 | autostart:"Auto start", | 43 | autostart:"Auto start", |
| 44 | enabled:"Enabled", | 44 | enabled:"Enabled", |
| 45 | fullscreen:"Fullscreen", | 45 | fullscreen:"Fullscreen", |
| 46 | invokeurls:"Invoke URLs", | 46 | invokeurls:"Invoke URLs", |
| 47 | mute:"Mute", | 47 | mute:"Mute", |
| 48 | stretchtofit:"Stretch to fit", | 48 | stretchtofit:"Stretch to fit", |
| 49 | windowlessvideo:"Windowless video", | 49 | windowlessvideo:"Windowless video", |
| 50 | balance:"Balance", | 50 | balance:"Balance", |
| 51 | baseurl:"Base URL", | 51 | baseurl:"Base URL", |
| 52 | captioningid:"Captioning id", | 52 | captioningid:"Captioning id", |
| 53 | currentmarker:"Current marker", | 53 | currentmarker:"Current marker", |
| 54 | currentposition:"Current position", | 54 | currentposition:"Current position", |
| 55 | defaultframe:"Default frame", | 55 | defaultframe:"Default frame", |
| 56 | playcount:"Play count", | 56 | playcount:"Play count", |
| 57 | rate:"Rate", | 57 | rate:"Rate", |
| 58 | uimode:"UI Mode", | 58 | uimode:"UI Mode", |
| 59 | flash_options:"Flash options", | 59 | flash_options:"Flash options", |
| 60 | qt_options:"Quicktime options", | 60 | qt_options:"Quicktime options", |
| 61 | wmp_options:"Windows media player options", | 61 | wmp_options:"Windows media player options", |
| 62 | rmp_options:"Real media player options", | 62 | rmp_options:"Real media player options", |
| 63 | shockwave_options:"Shockwave options", | 63 | shockwave_options:"Shockwave options", |
| 64 | autogotourl:"Auto goto URL", | 64 | autogotourl:"Auto goto URL", |
| 65 | center:"Center", | 65 | center:"Center", |
| 66 | imagestatus:"Image status", | 66 | imagestatus:"Image status", |
| 67 | maintainaspect:"Maintain aspect", | 67 | maintainaspect:"Maintain aspect", |
| 68 | nojava:"No java", | 68 | nojava:"No java", |
| 69 | prefetch:"Prefetch", | 69 | prefetch:"Prefetch", |
| 70 | shuffle:"Shuffle", | 70 | shuffle:"Shuffle", |
| 71 | console:"Console", | 71 | console:"Console", |
| 72 | numloop:"Num loops", | 72 | numloop:"Num loops", |
| 73 | controls:"Controls", | 73 | controls:"Controls", |
| 74 | scriptcallbacks:"Script callbacks", | 74 | scriptcallbacks:"Script callbacks", |
| 75 | swstretchstyle:"Stretch style", | 75 | swstretchstyle:"Stretch style", |
| 76 | swstretchhalign:"Stretch H-Align", | 76 | swstretchhalign:"Stretch H-Align", |
| 77 | swstretchvalign:"Stretch V-Align", | 77 | swstretchvalign:"Stretch V-Align", |
| 78 | sound:"Sound", | 78 | sound:"Sound", |
| 79 | progress:"Progress", | 79 | progress:"Progress", |
| 80 | qtsrc:"QT Src", | 80 | qtsrc:"QT Src", |
| 81 | 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..", | 81 | 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..", |
| 82 | align_top:"Top", | 82 | align_top:"Top", |
| 83 | align_right:"Right", | 83 | align_right:"Right", |
| 84 | align_bottom:"Bottom", | 84 | align_bottom:"Bottom", |
| 85 | align_left:"Left", | 85 | align_left:"Left", |
| 86 | align_center:"Center", | 86 | align_center:"Center", |
| 87 | align_top_left:"Top left", | 87 | align_top_left:"Top left", |
| 88 | align_top_right:"Top right", | 88 | align_top_right:"Top right", |
| 89 | align_bottom_left:"Bottom left", | 89 | align_bottom_left:"Bottom left", |
| 90 | align_bottom_right:"Bottom right", | 90 | align_bottom_right:"Bottom right", |
| 91 | flv_options:"Flash video options", | 91 | flv_options:"Flash video options", |
| 92 | flv_scalemode:"Scale mode", | 92 | flv_scalemode:"Scale mode", |
| 93 | flv_buffer:"Buffer", | 93 | flv_buffer:"Buffer", |
| 94 | flv_startimage:"Start image", | 94 | flv_startimage:"Start image", |
| 95 | flv_starttime:"Start time", | 95 | flv_starttime:"Start time", |
| 96 | flv_defaultvolume:"Default volumne", | 96 | flv_defaultvolume:"Default volumne", |
| 97 | flv_hiddengui:"Hidden GUI", | 97 | flv_hiddengui:"Hidden GUI", |
| 98 | flv_autostart:"Auto start", | 98 | flv_autostart:"Auto start", |
| 99 | flv_loop:"Loop", | 99 | flv_loop:"Loop", |
| 100 | flv_showscalemodes:"Show scale modes", | 100 | flv_showscalemodes:"Show scale modes", |
| 101 | flv_smoothvideo:"Smooth video", | 101 | flv_smoothvideo:"Smooth video", |
| 102 | flv_jscallback:"JS Callback" | 102 | flv_jscallback:"JS Callback" |
| 103 | }); | 103 | }); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | tinymce.create('tinymce.plugins.Nonbreaking', { | 12 | tinymce.create('tinymce.plugins.Nonbreaking', { |
| 13 | init : function(ed, url) { | 13 | init : function(ed, url) { |
| 14 | var t = this; | 14 | var t = this; |
| 15 | 15 | ||
| 16 | t.editor = ed; | 16 | t.editor = ed; |
| 17 | 17 | ||
| 18 | // Register commands | 18 | // Register commands |
| 19 | ed.addCommand('mceNonBreaking', function() { | 19 | ed.addCommand('mceNonBreaking', function() { |
| 20 | ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' '); | 20 | ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span _mce_bogus="1" class="mceItemHidden mceItemNbsp"> </span>' : ' '); |
| 21 | }); | 21 | }); |
| 22 | 22 | ||
| 23 | // Register buttons | 23 | // Register buttons |
| 24 | ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); | 24 | ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); |
| 25 | 25 | ||
| 26 | if (ed.getParam('nonbreaking_force_tab')) { | 26 | if (ed.getParam('nonbreaking_force_tab')) { |
| 27 | ed.onKeyDown.add(function(ed, e) { | 27 | ed.onKeyDown.add(function(ed, e) { |
| 28 | if (tinymce.isIE && e.keyCode == 9) { | 28 | if (tinymce.isIE && e.keyCode == 9) { |
| 29 | ed.execCommand('mceNonBreaking'); | 29 | ed.execCommand('mceNonBreaking'); |
| 30 | ed.execCommand('mceNonBreaking'); | 30 | ed.execCommand('mceNonBreaking'); |
| 31 | ed.execCommand('mceNonBreaking'); | 31 | ed.execCommand('mceNonBreaking'); |
| 32 | tinymce.dom.Event.cancel(e); | 32 | tinymce.dom.Event.cancel(e); |
| 33 | } | 33 | } |
| 34 | }); | 34 | }); |
| 35 | } | 35 | } |
| 36 | }, | 36 | }, |
| 37 | 37 | ||
| 38 | getInfo : function() { | 38 | getInfo : function() { |
| 39 | return { | 39 | return { |
| 40 | longname : 'Nonbreaking space', | 40 | longname : 'Nonbreaking space', |
| 41 | author : 'Moxiecode Systems AB', | 41 | author : 'Moxiecode Systems AB', |
| 42 | authorurl : 'http://tinymce.moxiecode.com', | 42 | authorurl : 'http://tinymce.moxiecode.com', |
| 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', | 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', |
| 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 45 | }; | 45 | }; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | // Private methods | 48 | // Private methods |
| 49 | }); | 49 | }); |
| 50 | 50 | ||
| 51 | // Register plugin | 51 | // Register plugin |
| 52 | tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); | 52 | tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); |
| 53 | })(); | 53 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | /** | 1 | /** |
| 2 | * editor_plugin_src.js | 2 | * editor_plugin_src.js |
| 3 | * | 3 | * |
| 4 | * Copyright 2009, Moxiecode Systems AB | 4 | * Copyright 2009, Moxiecode Systems AB |
| 5 | * Released under LGPL License. | 5 | * Released under LGPL License. |
| 6 | * | 6 | * |
| 7 | * License: http://tinymce.moxiecode.com/license | 7 | * License: http://tinymce.moxiecode.com/license |
| 8 | * Contributing: http://tinymce.moxiecode.com/contributing | 8 | * Contributing: http://tinymce.moxiecode.com/contributing |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | (function() { | 11 | (function() { |
| 12 | var Event = tinymce.dom.Event; | 12 | var Event = tinymce.dom.Event; |
| 13 | 13 | ||
| 14 | tinymce.create('tinymce.plugins.NonEditablePlugin', { | 14 | tinymce.create('tinymce.plugins.NonEditablePlugin', { |
| 15 | init : function(ed, url) { | 15 | init : function(ed, url) { |
| 16 | var t = this, editClass, nonEditClass; | 16 | var t = this, editClass, nonEditClass; |
| 17 | 17 | ||
| 18 | t.editor = ed; | 18 | t.editor = ed; |
| 19 | editClass = ed.getParam("noneditable_editable_class", "mceEditable"); | 19 | editClass = ed.getParam("noneditable_editable_class", "mceEditable"); |
| 20 | nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); | 20 | nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); |
| 21 | 21 | ||
| 22 | ed.onNodeChange.addToTop(function(ed, cm, n) { | 22 | ed.onNodeChange.addToTop(function(ed, cm, n) { |
| 23 | var sc, ec; | 23 | var sc, ec; |
| 24 | 24 | ||
| 25 | // Block if start or end is inside a non editable element | 25 | // Block if start or end is inside a non editable element |
| 26 | sc = ed.dom.getParent(ed.selection.getStart(), function(n) { | 26 | sc = ed.dom.getParent(ed.selection.getStart(), function(n) { |
| 27 | return ed.dom.hasClass(n, nonEditClass); | 27 | return ed.dom.hasClass(n, nonEditClass); |
| 28 | }); | 28 | }); |
| 29 | 29 | ||
| 30 | ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { | 30 | ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { |
| 31 | return ed.dom.hasClass(n, nonEditClass); | 31 | return ed.dom.hasClass(n, nonEditClass); |
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | // Block or unblock | 34 | // Block or unblock |
| 35 | if (sc || ec) { | 35 | if (sc || ec) { |
| 36 | t._setDisabled(1); | 36 | t._setDisabled(1); |
| 37 | return false; | 37 | return false; |
| 38 | } else | 38 | } else |
| 39 | t._setDisabled(0); | 39 | t._setDisabled(0); |
| 40 | }); | 40 | }); |
| 41 | }, | 41 | }, |
| 42 | 42 | ||
| 43 | getInfo : function() { | 43 | getInfo : function() { |
| 44 | return { | 44 | return { |
| 45 | longname : 'Non editable elements', | 45 | longname : 'Non editable elements', |
| 46 | author : 'Moxiecode Systems AB', | 46 | author : 'Moxiecode Systems AB', |
| 47 | authorurl : 'http://tinymce.moxiecode.com', | 47 | authorurl : 'http://tinymce.moxiecode.com', |
| 48 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', | 48 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', |
| 49 | version : tinymce.majorVersion + "." + tinymce.minorVersion | 49 | version : tinymce.majorVersion + "." + tinymce.minorVersion |
| 50 | }; | 50 | }; |
| 51 | }, | 51 | }, |
| 52 | 52 | ||
| 53 | _block : function(ed, e) { | 53 | _block : function(ed, e) { |
| 54 | var k = e.keyCode; | 54 | var k = e.keyCode; |
| 55 | 55 | ||
| 56 | // Don't block arrow keys, pg up/down, and F1-F12 | 56 | // Don't block arrow keys, pg up/down, and F1-F12 |
| 57 | if ((k > 32 && k < 41) || (k > 111 && k < 124)) | 57 | if ((k > 32 && k < 41) || (k > 111 && k < 124)) |
| 58 | return; | 58 | return; |
| 59 | 59 | ||
| 60 | return Event.cancel(e); | 60 | return Event.cancel(e); |
| 61 | }, | 61 | }, |
| 62 | 62 | ||
| 63 | _setDisabled : function(s) { | 63 | _setDisabled : function(s) { |
| 64 | var t = this, ed = t.editor; | 64 | var t = this, ed = t.editor; |
| 65 | 65 | ||
| 66 | tinymce.each(ed.controlManager.controls, function(c) { | 66 | tinymce.each(ed.controlManager.controls, function(c) { |
| 67 | c.setDisabled(s); | 67 | c.setDisabled(s); |
| 68 | }); | 68 | }); |
| 69 | 69 | ||
| 70 | if (s !== t.disabled) { | 70 | if (s !== t.disabled) { |
| 71 | if (s) { | 71 | if (s) { |
| 72 | ed.onKeyDown.addToTop(t._block); | 72 | ed.onKeyDown.addToTop(t._block); |
| 73 | ed.onKeyPress.addToTop(t._block); | 73 | ed.onKeyPress.addToTop(t._block); |
| 74 | ed.onKeyUp.addToTop(t._block); | 74 | ed.onKeyUp.addToTop(t._block); |
| 75 | ed.onPaste.addToTop(t._block); | 75 | ed.onPaste.addToTop(t._block); |
| 76 | } else { | 76 | } else { |
| 77 | ed.onKeyDown.remove(t._block); | 77 | ed.onKeyDown.remove(t._block); |
| 78 | ed.onKeyPress.remove(t._block); | 78 | ed.onKeyPress.remove(t._block); |
| 79 | ed.onKeyUp.remove(t._block); | 79 | ed.onKeyUp.remove(t._block); |
| 80 | ed.onPaste.remove(t._block); | 80 | ed.onPaste.remove(t._block); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | t.disabled = s; | 83 | t.disabled = s; |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | }); | 86 | }); |
| 87 | 87 | ||
| 88 | // Register plugin | 88 | // Register plugin |
| 89 | tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); | 89 | tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); |
| 90 | })(); | 90 | })(); |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
-
Please register or sign in to post a comment