diff options
Diffstat (limited to 'public/javascripts')
246 files changed, 142 insertions, 34313 deletions
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index f8148e2..f68fee8 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js | |||
| @@ -1,27 +1,35 @@ | |||
| 1 | function hide_all() { | ||
| 2 | $('#recent_changes_toggle').attr("class", "unselected"); | ||
| 3 | $('#my_work_toggle').attr("class", "unselected"); | ||
| 4 | $('#current_drafts_toggle').attr("class", "unselected"); | ||
| 5 | $('#admin_sitemap_toggle').attr("class", "unselected"); | ||
| 6 | |||
| 7 | $('#current_drafts_table').hide(); | ||
| 8 | $('#my_work_table').hide(); | ||
| 9 | $('#recent_changes_table').hide(); | ||
| 10 | $('#admin_sitemap_table').hide(); | ||
| 11 | } | ||
| 12 | |||
| 1 | $(document).ready(function () { | 13 | $(document).ready(function () { |
| 2 | admin_search.initialize(); | 14 | admin_search.initialize(); |
| 3 | 15 | ||
| 4 | $(".with_editor").tinymce({ | 16 | tinymce.init({ |
| 5 | script_url : '/javascripts/tiny_mce/tiny_mce.js', | 17 | selector: 'textarea.with_editor', |
| 6 | theme: "advanced", | 18 | license_key: 'gpl', |
| 7 | mode : "specific_textareas", | 19 | promotion: false, |
| 8 | editor_selector : "with_editor", | 20 | menubar: false, |
| 9 | plugins : "safari, paste", | 21 | plugins: 'code', |
| 10 | paste_auto_cleanup_on_paste : true, | 22 | toolbar: 'bold italic underline | bullist numlist | link unlink | blocks | code', |
| 11 | paste_strip_class_attributes : true, | 23 | extended_valid_elements: 'aggregate[tags|limit|order_by|order_direction|partial|conditions]', |
| 12 | paste_remove_spans : true, | 24 | relative_urls: false, |
| 13 | paste_remove_styles : true, | 25 | entity_encoding: 'raw', |
| 14 | theme_advanced_toolbar_location : "top", | 26 | setup: function(editor) { |
| 15 | theme_advanced_toolbar_align : "left", | 27 | editor.on('init', function() { |
| 16 | theme_advanced_buttons1 : "bold, italic, underline, bullist, numlist, link, unlink, formatselect, code", | 28 | cccms.setup_autosave(); |
| 17 | theme_advanced_buttons2 : "", | 29 | }); |
| 18 | theme_advanced_buttons3 : "", | 30 | } |
| 19 | extended_valid_elements : "aggregate[tags|limit|order_by|order_direction|partial]", | 31 | }); |
| 20 | relative_urls : false, | 32 | |
| 21 | entity_encoding : "raw", | ||
| 22 | oninit : cccms.setup_autosave() | ||
| 23 | }); | ||
| 24 | |||
| 25 | if ($("#menu_search_term").length != 0) { | 33 | if ($("#menu_search_term").length != 0) { |
| 26 | menu_items.initialize_search(); | 34 | menu_items.initialize_search(); |
| 27 | } | 35 | } |
| @@ -43,22 +51,49 @@ $(document).ready(function () { | |||
| 43 | } | 51 | } |
| 44 | 52 | ||
| 45 | if ($('#recent_changes_toggle').length != 0) { | 53 | if ($('#recent_changes_toggle').length != 0) { |
| 46 | $('#current_drafts_table').hide(); | 54 | hide_all(); |
| 47 | $('#recent_changes_toggle').attr("class", "selected"); | 55 | $('#recent_changes_toggle').attr("class", "selected"); |
| 56 | $('#recent_changes_table').show(); | ||
| 48 | 57 | ||
| 49 | $('#recent_changes_toggle').bind("click", function(){ | 58 | $('#recent_changes_toggle').bind("click", function(){ |
| 59 | hide_all(); | ||
| 50 | $('#recent_changes_toggle').attr("class", "selected"); | 60 | $('#recent_changes_toggle').attr("class", "selected"); |
| 51 | $('#current_drafts_toggle').attr("class", "unselected"); | ||
| 52 | $('#recent_changes_table').show(); | 61 | $('#recent_changes_table').show(); |
| 53 | $('#current_drafts_table').hide(); | 62 | return false; |
| 63 | }); | ||
| 64 | |||
| 65 | $('#my_work_toggle').bind("click", function(){ | ||
| 66 | hide_all(); | ||
| 67 | $('#my_work_toggle').attr("class", "selected"); | ||
| 68 | $('#my_work_table').show(); | ||
| 69 | return false; | ||
| 70 | }); | ||
| 71 | |||
| 72 | $('#admin_wizard_my_work').bind("click", function(){ | ||
| 73 | hide_all(); | ||
| 74 | $('#my_work_toggle').attr("class", "selected"); | ||
| 75 | $('#my_work_table').show(); | ||
| 54 | return false; | 76 | return false; |
| 55 | }); | 77 | }); |
| 56 | 78 | ||
| 57 | $('#current_drafts_toggle').bind("click", function(){ | 79 | $('#current_drafts_toggle').bind("click", function(){ |
| 58 | $('#recent_changes_toggle').attr("class", "unselected"); | 80 | hide_all(); |
| 59 | $('#current_drafts_toggle').attr("class", "selected"); | 81 | $('#current_drafts_toggle').attr("class", "selected"); |
| 60 | $('#current_drafts_table').show(); | 82 | $('#current_drafts_table').show(); |
| 61 | $('#recent_changes_table').hide(); | 83 | return false; |
| 84 | }); | ||
| 85 | |||
| 86 | $('#admin_sitemap_toggle').bind("click", function(){ | ||
| 87 | hide_all(); | ||
| 88 | $('#admin_sitemap_toggle').attr("class", "selected"); | ||
| 89 | $('#admin_sitemap_table').show(); | ||
| 90 | return false; | ||
| 91 | }); | ||
| 92 | |||
| 93 | $('#admin_wizard_create_page').bind("click", function(){ | ||
| 94 | hide_all(); | ||
| 95 | $('#admin_sitemap_toggle').attr("class", "selected"); | ||
| 96 | $('#admin_sitemap_table').show(); | ||
| 62 | return false; | 97 | return false; |
| 63 | }); | 98 | }); |
| 64 | } | 99 | } |
diff --git a/public/javascripts/admin_search.js b/public/javascripts/admin_search.js index 6d3ca93..78577e7 100644 --- a/public/javascripts/admin_search.js +++ b/public/javascripts/admin_search.js | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | admin_search = { | 1 | admin_search = { |
| 2 | 2 | ||
| 3 | initialize : function() { | 3 | initialize : function() { |
| 4 | $(document).bind("keydown", 'Alt+f', function(){ | 4 | $(document).bind("keydown", 'Alt+f', function(){ |
| 5 | admin_search.display_toggle(); | 5 | admin_search.display_toggle(); |
| 6 | return false; | 6 | return false; |
| 7 | }); | 7 | }); |
| 8 | }, | 8 | }, |
| 9 | 9 | ||
| 10 | display_toggle : function() { | 10 | display_toggle : function() { |
| 11 | if ($('#search_widget').css("display") != "none") { | 11 | if ($('#search_widget').css("display") != "none") { |
| 12 | $('#search_widget').fadeOut(); | 12 | $('#search_widget').fadeOut(); |
| @@ -16,7 +16,7 @@ admin_search = { | |||
| 16 | $('#search_term').attr("value", ""); | 16 | $('#search_term').attr("value", ""); |
| 17 | $('#search_term').focus(); | 17 | $('#search_term').focus(); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | $("#search_term").bind("keyup", function() { | 20 | $("#search_term").bind("keyup", function() { |
| 21 | if ($(this).attr("value")) { | 21 | if ($(this).attr("value")) { |
| 22 | $.ajax({ | 22 | $.ajax({ |
| @@ -31,11 +31,11 @@ admin_search = { | |||
| 31 | } | 31 | } |
| 32 | else { | 32 | else { |
| 33 | $('#search_results').slideUp(); | 33 | $('#search_results').slideUp(); |
| 34 | $('#search_results').empty(); | 34 | $('#search_results').empty(); |
| 35 | } | 35 | } |
| 36 | }); | 36 | }); |
| 37 | }, | 37 | }, |
| 38 | 38 | ||
| 39 | show_results : function(results) { | 39 | show_results : function(results) { |
| 40 | $('#search_results').empty(); | 40 | $('#search_results').empty(); |
| 41 | for (result in results) { | 41 | for (result in results) { |
| @@ -46,7 +46,7 @@ admin_search = { | |||
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | menu_items = { | 48 | menu_items = { |
| 49 | 49 | ||
| 50 | initialize_search : function() { | 50 | initialize_search : function() { |
| 51 | $("#menu_search_term").bind("keyup", function() { | 51 | $("#menu_search_term").bind("keyup", function() { |
| 52 | if ($(this).attr("value")) { | 52 | if ($(this).attr("value")) { |
| @@ -62,28 +62,28 @@ menu_items = { | |||
| 62 | } | 62 | } |
| 63 | else { | 63 | else { |
| 64 | $('#search_results').slideUp(); | 64 | $('#search_results').slideUp(); |
| 65 | $('#search_results').empty(); | 65 | $('#search_results').empty(); |
| 66 | } | 66 | } |
| 67 | }); | 67 | }); |
| 68 | }, | 68 | }, |
| 69 | 69 | ||
| 70 | show_results : function(results) { | 70 | show_results : function(results) { |
| 71 | $("#search_results").empty(); | 71 | $("#search_results").empty(); |
| 72 | for (result in results) { | 72 | for (result in results) { |
| 73 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); | 73 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); |
| 74 | $(link).bind("click", menu_items.link_closure(results[result])); | 74 | $(link).bind("click", menu_items.link_closure(results[result])); |
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | // Sometimes I don't get jquery; wrap() didn't work *sigh* | 77 | // Sometimes I don't get jquery; wrap() didn't work *sigh* |
| 78 | // Guess I'll need a book someday or another framework | 78 | // Guess I'll need a book someday or another framework |
| 79 | var wrapper = $("<div></div>"); | 79 | var wrapper = $("<div></div>"); |
| 80 | $(wrapper).append(link) | 80 | $(wrapper).append(link) |
| 81 | 81 | ||
| 82 | $("#search_results").append(wrapper); | 82 | $("#search_results").append(wrapper); |
| 83 | 83 | ||
| 84 | } | 84 | } |
| 85 | }, | 85 | }, |
| 86 | 86 | ||
| 87 | link_closure : function(node) { | 87 | link_closure : function(node) { |
| 88 | var barf = function(){ | 88 | var barf = function(){ |
| 89 | $("#menu_item_node_id").val(node.node_id); | 89 | $("#menu_item_node_id").val(node.node_id); |
| @@ -91,7 +91,7 @@ menu_items = { | |||
| 91 | $("#menu_item_title").val(node.title); | 91 | $("#menu_item_title").val(node.title); |
| 92 | return false; | 92 | return false; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | return barf; | 95 | return barf; |
| 96 | } | 96 | } |
| 97 | }; | 97 | }; |
| @@ -99,7 +99,7 @@ menu_items = { | |||
| 99 | parent_search = { | 99 | parent_search = { |
| 100 | initialize_search : function() { | 100 | initialize_search : function() { |
| 101 | parent_search.initialize_radio_buttons(); | 101 | parent_search.initialize_radio_buttons(); |
| 102 | 102 | ||
| 103 | $("#parent_search_term").bind("keyup", function() { | 103 | $("#parent_search_term").bind("keyup", function() { |
| 104 | if ($(this).attr("value")) { | 104 | if ($(this).attr("value")) { |
| 105 | $.ajax({ | 105 | $.ajax({ |
| @@ -114,28 +114,31 @@ parent_search = { | |||
| 114 | } | 114 | } |
| 115 | else { | 115 | else { |
| 116 | $('#search_results').slideUp(); | 116 | $('#search_results').slideUp(); |
| 117 | $('#search_results').empty(); | 117 | $('#search_results').empty(); |
| 118 | } | 118 | } |
| 119 | }); | 119 | }); |
| 120 | }, | 120 | }, |
| 121 | 121 | ||
| 122 | show_results : function(results) { | 122 | show_results : function(results) { |
| 123 | $("#search_results").empty(); | 123 | $("#search_results").empty(); |
| 124 | var found = false; | ||
| 124 | for (result in results) { | 125 | for (result in results) { |
| 125 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); | 126 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); |
| 126 | $(link).bind("click", parent_search.link_closure(results[result])); | 127 | $(link).bind("click", parent_search.link_closure(results[result])); |
| 127 | 128 | ||
| 128 | 129 | ||
| 129 | // Sometimes I don't get jquery; wrap() didn't work *sigh* | 130 | // Sometimes I don't get jquery; wrap() didn't work *sigh* |
| 130 | // Guess I'll need a book someday or another framework | 131 | // Guess I'll need a book someday or another framework |
| 131 | var wrapper = $("<div></div>"); | 132 | var wrapper = $("<div></div>"); |
| 132 | $(wrapper).append(link) | 133 | $(wrapper).append(link); |
| 133 | 134 | ||
| 134 | $("#search_results").append(wrapper); | 135 | $("#search_results").append(wrapper); |
| 135 | 136 | found = true; | |
| 136 | } | 137 | } |
| 138 | if (found) | ||
| 139 | $('#search_results').slideDown(); | ||
| 137 | }, | 140 | }, |
| 138 | 141 | ||
| 139 | link_closure : function(node) { | 142 | link_closure : function(node) { |
| 140 | var barf = function(){ | 143 | var barf = function(){ |
| 141 | $("#parent_search_term").attr("value", node.title); | 144 | $("#parent_search_term").attr("value", node.title); |
| @@ -144,64 +147,80 @@ parent_search = { | |||
| 144 | $('#search_results').empty(); | 147 | $('#search_results').empty(); |
| 145 | return false; | 148 | return false; |
| 146 | } | 149 | } |
| 147 | 150 | ||
| 148 | return barf; | 151 | return barf; |
| 149 | }, | 152 | }, |
| 150 | 153 | ||
| 151 | initialize_radio_buttons : function() { | 154 | initialize_radio_buttons : function() { |
| 152 | $("#kind_top_level").bind("change", function(){ | 155 | $("#kind_top_level").bind("change", function(){ |
| 153 | $("#parent_search_field").hide(); | 156 | $("#parent_search_field").hide(); |
| 154 | }); | 157 | }); |
| 155 | 158 | ||
| 156 | $("#kind_update").bind("change", function(){ | 159 | $("#kind_update").bind("change", function(){ |
| 157 | $("#parent_search_field").hide(); | 160 | $("#parent_search_field").hide(); |
| 158 | }); | 161 | }); |
| 159 | 162 | ||
| 163 | $("#kind_press_release").bind("change", function(){ | ||
| 164 | $("#parent_search_field").hide(); | ||
| 165 | }); | ||
| 166 | |||
| 160 | $("#kind_generic").bind("change", function(){ | 167 | $("#kind_generic").bind("change", function(){ |
| 161 | $("#parent_search_field").show(); | 168 | $("#parent_search_field").show(); |
| 162 | }); | 169 | }); |
| 163 | 170 | ||
| 164 | } | 171 | } |
| 165 | } | 172 | } |
| 166 | 173 | ||
| 167 | move_to_search = { | 174 | move_to_search = { |
| 168 | initialize_search : function() { | 175 | initialize_search : function() { |
| 169 | $("#move_to_search_term").bind("keyup", function() { | 176 | $("#move_to_search_term").bind("keyup", function() { move_to_search.do_search($(this))}); |
| 170 | if ($(this).attr("value")) { | 177 | $("#move_to_search_term").bind("keydown", function() { move_to_search.do_search($(this))}); |
| 171 | $.ajax({ | 178 | $("#move_to_search_term").bind("keypress", function() { move_to_search.do_search($(this))}); |
| 172 | type: "GET", | 179 | $("#move_to_search_term").bind("paste", function() { move_to_search.do_search($(this))}); |
| 173 | url: "/admin/menu_search", | 180 | $("#move_to_search_term").bind("cut", function() { move_to_search.do_search($(this))}); |
| 174 | data: "search_term=" + $(this).attr("value"), | ||
| 175 | dataType: "json", | ||
| 176 | success : function(results) { | ||
| 177 | move_to_search.show_results(results); | ||
| 178 | } | ||
| 179 | }); | ||
| 180 | } | ||
| 181 | else { | ||
| 182 | $('#search_results').slideUp(); | ||
| 183 | $('#search_results').empty(); | ||
| 184 | } | ||
| 185 | }); | ||
| 186 | }, | 181 | }, |
| 187 | 182 | ||
| 183 | do_search : function(_this) { | ||
| 184 | if (_this.attr("value")) { | ||
| 185 | $.ajax({ | ||
| 186 | type: "GET", | ||
| 187 | url: "/admin/menu_search", | ||
| 188 | data: "search_term=" + _this.attr("value"), | ||
| 189 | dataType: "json", | ||
| 190 | success : function(results) { | ||
| 191 | move_to_search.show_results(results); | ||
| 192 | } | ||
| 193 | }); | ||
| 194 | } | ||
| 195 | else { | ||
| 196 | $('#search_results').slideUp(); | ||
| 197 | $('#search_results').empty(); | ||
| 198 | } | ||
| 199 | }, | ||
| 200 | |||
| 188 | show_results : function(results) { | 201 | show_results : function(results) { |
| 189 | $("#search_results").empty(); | 202 | $("#search_results").empty(); |
| 203 | var found = false; | ||
| 190 | for (result in results) { | 204 | for (result in results) { |
| 191 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); | 205 | var link = $(("<a href='#'>"+ results[result].title + "</a>")); |
| 192 | $(link).bind("click", move_to_search.link_closure(results[result])); | 206 | $(link).bind("click", move_to_search.link_closure(results[result])); |
| 193 | 207 | ||
| 194 | 208 | ||
| 195 | // Sometimes I don't get jquery; wrap() didn't work *sigh* | 209 | // Sometimes I don't get jquery; wrap() didn't work *sigh* |
| 196 | // Guess I'll need a book someday or another framework | 210 | // Guess I'll need a book someday or another framework |
| 197 | var wrapper = $("<div></div>"); | 211 | var wrapper = $("<div></div>"); |
| 198 | $(wrapper).append(link) | 212 | $(wrapper).append(link) |
| 199 | 213 | ||
| 200 | $("#search_results").append(wrapper); | 214 | $("#search_results").append(wrapper); |
| 201 | 215 | found = true; | |
| 202 | } | 216 | } |
| 217 | if (found) | ||
| 218 | $('#search_results').slideDown(); | ||
| 219 | else | ||
| 220 | $('#search_results').slideUp(); | ||
| 221 | |||
| 203 | }, | 222 | }, |
| 204 | 223 | ||
| 205 | link_closure : function(node) { | 224 | link_closure : function(node) { |
| 206 | var barf = function(){ | 225 | var barf = function(){ |
| 207 | $("#move_to_search_term").attr("value", node.title); | 226 | $("#move_to_search_term").attr("value", node.title); |
| @@ -210,7 +229,7 @@ move_to_search = { | |||
| 210 | $('#search_results').empty(); | 229 | $('#search_results').empty(); |
| 211 | return false; | 230 | return false; |
| 212 | } | 231 | } |
| 213 | 232 | ||
| 214 | return barf; | 233 | return barf; |
| 215 | } | 234 | } |
| 216 | } \ No newline at end of file | 235 | } |
diff --git a/public/javascripts/public.js b/public/javascripts/public.js index 0919360..10f04e8 100644 --- a/public/javascripts/public.js +++ b/public/javascripts/public.js | |||
| @@ -18,6 +18,13 @@ $(document).ready(function(){ | |||
| 18 | $("div#headline_image a img").bind("click", function(){ | 18 | $("div#headline_image a img").bind("click", function(){ |
| 19 | $(".shadowbox_image:first").trigger("click"); | 19 | $(".shadowbox_image:first").trigger("click"); |
| 20 | }); | 20 | }); |
| 21 | |||
| 22 | document.getElementById("light-mode").addEventListener("change", () => { | ||
| 23 | if (document.getElementById("light-mode").checked) | ||
| 24 | localStorage.setItem("override-prefers-color-scheme", 1); | ||
| 25 | else | ||
| 26 | localStorage.removeItem("override-prefers-color-scheme"); | ||
| 27 | }); | ||
| 21 | }); | 28 | }); |
| 22 | 29 | ||
| 23 | 30 | ||
| @@ -38,4 +45,4 @@ var image_handler = { | |||
| 38 | path = path_name.replace(/\/(de|en)*\/*/, ""); | 45 | path = path_name.replace(/\/(de|en)*\/*/, ""); |
| 39 | gallery_path = ""; | 46 | gallery_path = ""; |
| 40 | } | 47 | } |
| 41 | }; \ No newline at end of file | 48 | }; |
diff --git a/public/javascripts/tiny_mce/jquery.tinymce.js b/public/javascripts/tiny_mce/jquery.tinymce.js deleted file mode 100644 index bb01508..0000000 --- a/public/javascripts/tiny_mce/jquery.tinymce.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(b){var c,a=[];function e(g,f,i){var h;h=b.fn[f];b.fn[f]=function(){var j;if(g!=="after"){j=i.apply(this,arguments);if(j!==undefined){return j}}j=h.apply(this,arguments);if(g!=="before"){i.apply(this,arguments)}return j}}b.fn.tinymce=function(i){var h=this,g,j="",f;if(!h.length){return}if(!i){return tinyMCE.get(this[0].id)}function k(){if(d){d();d=null}h.each(function(m,p){var l,o=p.id||tinymce.DOM.uniqueId();p.id=o;l=new tinymce.Editor(o,i);l.render()})}if(!window.tinymce&&!c&&(g=i.script_url)){c=1;if(/_(src|dev)\.js/g.test(g)){j="_src"}window.tinyMCEPreInit={base:g.substring(0,g.lastIndexOf("/")),suffix:j,query:""};b.getScript(g,function(){tinymce.dom.Event.domLoaded=1;c=2;k();b.each(a,function(l,m){m()})})}else{if(c===1){a.push(k)}else{k()}}};b.extend(b.expr[":"],{tinymce:function(f){return f.id&&!!tinyMCE.get(f.id)}});function d(){function f(){this.find("span.mceEditor,div.mceEditor").each(function(j,k){var h;if(h=tinyMCE.get(k.id.replace(/_parent$/,""))){h.remove()}})}function g(i){var h;if(i!==undefined){f.call(this);this.each(function(k,l){var j;if(j=tinyMCE.get(l.id)){j.setContent(i)}})}else{if(this.length>0){if(h=tinyMCE.get(this[0].id)){return h.getContent()}}}}e("both","text",function(h){if(h!==undefined){return g.call(this,h)}if(this.length>0){if(ed=tinyMCE.get(this[0].id)){return ed.getContent().replace(/<[^>]+>/g,"")}}});b.each(["val","html"],function(j,h){e("both",h,g)});b.each(["append","prepend"],function(j,h){e("before",h,function(i){if(i!==undefined){this.each(function(l,m){var k;if(k=tinyMCE.get(m.id)){if(h==="append"){k.setContent(k.getContent()+i)}else{k.setContent(i+k.getContent())}}})}})});e("both","attr",function(h,i){if(h&&h==="value"){return g.call(this,i)}});b.each(["remove","replaceWith","replaceAll","empty"],function(j,h){e("before",h,f)})}})(jQuery); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/langs/en.js b/public/javascripts/tiny_mce/langs/en.js deleted file mode 100644 index 8519b4d..0000000 --- a/public/javascripts/tiny_mce/langs/en.js +++ /dev/null | |||
| @@ -1,154 +0,0 @@ | |||
| 1 | tinyMCE.addI18n({en:{ | ||
| 2 | common:{ | ||
| 3 | edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", | ||
| 4 | apply:"Apply", | ||
| 5 | insert:"Insert", | ||
| 6 | update:"Update", | ||
| 7 | cancel:"Cancel", | ||
| 8 | close:"Close", | ||
| 9 | browse:"Browse", | ||
| 10 | class_name:"Class", | ||
| 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?", | ||
| 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.", | ||
| 15 | invalid_data:"Error: Invalid values entered, these are marked in red.", | ||
| 16 | more_colors:"More colors" | ||
| 17 | }, | ||
| 18 | contextmenu:{ | ||
| 19 | align:"Alignment", | ||
| 20 | left:"Left", | ||
| 21 | center:"Center", | ||
| 22 | right:"Right", | ||
| 23 | full:"Full" | ||
| 24 | }, | ||
| 25 | insertdatetime:{ | ||
| 26 | date_fmt:"%Y-%m-%d", | ||
| 27 | time_fmt:"%H:%M:%S", | ||
| 28 | insertdate_desc:"Insert date", | ||
| 29 | inserttime_desc:"Insert time", | ||
| 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", | ||
| 32 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", | ||
| 33 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" | ||
| 34 | }, | ||
| 35 | print:{ | ||
| 36 | print_desc:"Print" | ||
| 37 | }, | ||
| 38 | preview:{ | ||
| 39 | preview_desc:"Preview" | ||
| 40 | }, | ||
| 41 | directionality:{ | ||
| 42 | ltr_desc:"Direction left to right", | ||
| 43 | rtl_desc:"Direction right to left" | ||
| 44 | }, | ||
| 45 | layer:{ | ||
| 46 | insertlayer_desc:"Insert new layer", | ||
| 47 | forward_desc:"Move forward", | ||
| 48 | backward_desc:"Move backward", | ||
| 49 | absolute_desc:"Toggle absolute positioning", | ||
| 50 | content:"New layer..." | ||
| 51 | }, | ||
| 52 | save:{ | ||
| 53 | save_desc:"Save", | ||
| 54 | cancel_desc:"Cancel all changes" | ||
| 55 | }, | ||
| 56 | nonbreaking:{ | ||
| 57 | nonbreaking_desc:"Insert non-breaking space character" | ||
| 58 | }, | ||
| 59 | iespell:{ | ||
| 60 | iespell_desc:"Run spell checking", | ||
| 61 | download:"ieSpell not detected. Do you want to install it now?" | ||
| 62 | }, | ||
| 63 | advhr:{ | ||
| 64 | advhr_desc:"Horizontal rule" | ||
| 65 | }, | ||
| 66 | emotions:{ | ||
| 67 | emotions_desc:"Emotions" | ||
| 68 | }, | ||
| 69 | searchreplace:{ | ||
| 70 | search_desc:"Find", | ||
| 71 | replace_desc:"Find/Replace" | ||
| 72 | }, | ||
| 73 | advimage:{ | ||
| 74 | image_desc:"Insert/edit image" | ||
| 75 | }, | ||
| 76 | advlink:{ | ||
| 77 | link_desc:"Insert/edit link" | ||
| 78 | }, | ||
| 79 | xhtmlxtras:{ | ||
| 80 | cite_desc:"Citation", | ||
| 81 | abbr_desc:"Abbreviation", | ||
| 82 | acronym_desc:"Acronym", | ||
| 83 | del_desc:"Deletion", | ||
| 84 | ins_desc:"Insertion", | ||
| 85 | attribs_desc:"Insert/Edit Attributes" | ||
| 86 | }, | ||
| 87 | style:{ | ||
| 88 | desc:"Edit CSS Style" | ||
| 89 | }, | ||
| 90 | paste:{ | ||
| 91 | paste_text_desc:"Paste as Plain Text", | ||
| 92 | paste_word_desc:"Paste from Word", | ||
| 93 | selectall_desc:"Select All" | ||
| 94 | }, | ||
| 95 | paste_dlg:{ | ||
| 96 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", | ||
| 97 | text_linebreaks:"Keep linebreaks", | ||
| 98 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." | ||
| 99 | }, | ||
| 100 | table:{ | ||
| 101 | desc:"Inserts a new table", | ||
| 102 | row_before_desc:"Insert row before", | ||
| 103 | row_after_desc:"Insert row after", | ||
| 104 | delete_row_desc:"Delete row", | ||
| 105 | col_before_desc:"Insert column before", | ||
| 106 | col_after_desc:"Insert column after", | ||
| 107 | delete_col_desc:"Remove column", | ||
| 108 | split_cells_desc:"Split merged table cells", | ||
| 109 | merge_cells_desc:"Merge table cells", | ||
| 110 | row_desc:"Table row properties", | ||
| 111 | cell_desc:"Table cell properties", | ||
| 112 | props_desc:"Table properties", | ||
| 113 | paste_row_before_desc:"Paste table row before", | ||
| 114 | paste_row_after_desc:"Paste table row after", | ||
| 115 | cut_row_desc:"Cut table row", | ||
| 116 | copy_row_desc:"Copy table row", | ||
| 117 | del:"Delete table", | ||
| 118 | row:"Row", | ||
| 119 | col:"Column", | ||
| 120 | cell:"Cell" | ||
| 121 | }, | ||
| 122 | autosave:{ | ||
| 123 | unload_msg:"The changes you made will be lost if you navigate away from this page." | ||
| 124 | }, | ||
| 125 | fullscreen:{ | ||
| 126 | desc:"Toggle fullscreen mode" | ||
| 127 | }, | ||
| 128 | media:{ | ||
| 129 | desc:"Insert / edit embedded media", | ||
| 130 | edit:"Edit embedded media" | ||
| 131 | }, | ||
| 132 | fullpage:{ | ||
| 133 | desc:"Document properties" | ||
| 134 | }, | ||
| 135 | template:{ | ||
| 136 | desc:"Insert predefined template content" | ||
| 137 | }, | ||
| 138 | visualchars:{ | ||
| 139 | desc:"Visual control characters on/off." | ||
| 140 | }, | ||
| 141 | spellchecker:{ | ||
| 142 | desc:"Toggle spellchecker", | ||
| 143 | menu:"Spellchecker settings", | ||
| 144 | ignore_word:"Ignore word", | ||
| 145 | ignore_words:"Ignore all", | ||
| 146 | langs:"Languages", | ||
| 147 | wait:"Please wait...", | ||
| 148 | sug:"Suggestions", | ||
| 149 | no_sug:"No suggestions", | ||
| 150 | no_mpell:"No misspellings found." | ||
| 151 | }, | ||
| 152 | pagebreak:{ | ||
| 153 | desc:"Insert page break." | ||
| 154 | }}}); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/license.txt b/public/javascripts/tiny_mce/license.txt deleted file mode 100644 index 60d6d4c..0000000 --- a/public/javascripts/tiny_mce/license.txt +++ /dev/null | |||
| @@ -1,504 +0,0 @@ | |||
| 1 | GNU LESSER GENERAL PUBLIC LICENSE | ||
| 2 | Version 2.1, February 1999 | ||
| 3 | |||
| 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. | ||
| 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 6 | Everyone is permitted to copy and distribute verbatim copies | ||
| 7 | of this license document, but changing it is not allowed. | ||
| 8 | |||
| 9 | [This is the first released version of the Lesser GPL. It also counts | ||
| 10 | as the successor of the GNU Library Public License, version 2, hence | ||
| 11 | the version number 2.1.] | ||
| 12 | |||
| 13 | Preamble | ||
| 14 | |||
| 15 | The licenses for most software are designed to take away your | ||
| 16 | freedom to share and change it. By contrast, the GNU General Public | ||
| 17 | Licenses are intended to guarantee your freedom to share and change | ||
| 18 | free software--to make sure the software is free for all its users. | ||
| 19 | |||
| 20 | This license, the Lesser General Public License, applies to some | ||
| 21 | specially designated software packages--typically libraries--of the | ||
| 22 | Free Software Foundation and other authors who decide to use it. You | ||
| 23 | can use it too, but we suggest you first think carefully about whether | ||
| 24 | this license or the ordinary General Public License is the better | ||
| 25 | strategy to use in any particular case, based on the explanations below. | ||
| 26 | |||
| 27 | When we speak of free software, we are referring to freedom of use, | ||
| 28 | not price. Our General Public Licenses are designed to make sure that | ||
| 29 | you have the freedom to distribute copies of free software (and charge | ||
| 30 | for this service if you wish); that you receive source code or can get | ||
| 31 | it if you want it; that you can change the software and use pieces of | ||
| 32 | it in new free programs; and that you are informed that you can do | ||
| 33 | these things. | ||
| 34 | |||
| 35 | To protect your rights, we need to make restrictions that forbid | ||
| 36 | distributors to deny you these rights or to ask you to surrender these | ||
| 37 | rights. These restrictions translate to certain responsibilities for | ||
| 38 | you if you distribute copies of the library or if you modify it. | ||
| 39 | |||
| 40 | For example, if you distribute copies of the library, whether gratis | ||
| 41 | or for a fee, you must give the recipients all the rights that we gave | ||
| 42 | you. You must make sure that they, too, receive or can get the source | ||
| 43 | code. If you link other code with the library, you must provide | ||
| 44 | complete object files to the recipients, so that they can relink them | ||
| 45 | with the library after making changes to the library and recompiling | ||
| 46 | it. And you must show them these terms so they know their rights. | ||
| 47 | |||
| 48 | We protect your rights with a two-step method: (1) we copyright the | ||
| 49 | library, and (2) we offer you this license, which gives you legal | ||
| 50 | permission to copy, distribute and/or modify the library. | ||
| 51 | |||
| 52 | To protect each distributor, we want to make it very clear that | ||
| 53 | there is no warranty for the free library. Also, if the library is | ||
| 54 | modified by someone else and passed on, the recipients should know | ||
| 55 | that what they have is not the original version, so that the original | ||
| 56 | author's reputation will not be affected by problems that might be | ||
| 57 | introduced by others. | ||
| 58 | |||
| 59 | Finally, software patents pose a constant threat to the existence of | ||
| 60 | any free program. We wish to make sure that a company cannot | ||
| 61 | effectively restrict the users of a free program by obtaining a | ||
| 62 | restrictive license from a patent holder. Therefore, we insist that | ||
| 63 | any patent license obtained for a version of the library must be | ||
| 64 | consistent with the full freedom of use specified in this license. | ||
| 65 | |||
| 66 | Most GNU software, including some libraries, is covered by the | ||
| 67 | ordinary GNU General Public License. This license, the GNU Lesser | ||
| 68 | General Public License, applies to certain designated libraries, and | ||
| 69 | is quite different from the ordinary General Public License. We use | ||
| 70 | this license for certain libraries in order to permit linking those | ||
| 71 | libraries into non-free programs. | ||
| 72 | |||
| 73 | When a program is linked with a library, whether statically or using | ||
| 74 | a shared library, the combination of the two is legally speaking a | ||
| 75 | combined work, a derivative of the original library. The ordinary | ||
| 76 | General Public License therefore permits such linking only if the | ||
| 77 | entire combination fits its criteria of freedom. The Lesser General | ||
| 78 | Public License permits more lax criteria for linking other code with | ||
| 79 | the library. | ||
| 80 | |||
| 81 | We call this license the "Lesser" General Public License because it | ||
| 82 | does Less to protect the user's freedom than the ordinary General | ||
| 83 | Public License. It also provides other free software developers Less | ||
| 84 | of an advantage over competing non-free programs. These disadvantages | ||
| 85 | are the reason we use the ordinary General Public License for many | ||
| 86 | libraries. However, the Lesser license provides advantages in certain | ||
| 87 | special circumstances. | ||
| 88 | |||
| 89 | For example, on rare occasions, there may be a special need to | ||
| 90 | encourage the widest possible use of a certain library, so that it becomes | ||
| 91 | a de-facto standard. To achieve this, non-free programs must be | ||
| 92 | allowed to use the library. A more frequent case is that a free | ||
| 93 | library does the same job as widely used non-free libraries. In this | ||
| 94 | case, there is little to gain by limiting the free library to free | ||
| 95 | software only, so we use the Lesser General Public License. | ||
| 96 | |||
| 97 | In other cases, permission to use a particular library in non-free | ||
| 98 | programs enables a greater number of people to use a large body of | ||
| 99 | free software. For example, permission to use the GNU C Library in | ||
| 100 | non-free programs enables many more people to use the whole GNU | ||
| 101 | operating system, as well as its variant, the GNU/Linux operating | ||
| 102 | system. | ||
| 103 | |||
| 104 | Although the Lesser General Public License is Less protective of the | ||
| 105 | users' freedom, it does ensure that the user of a program that is | ||
| 106 | linked with the Library has the freedom and the wherewithal to run | ||
| 107 | that program using a modified version of the Library. | ||
| 108 | |||
| 109 | The precise terms and conditions for copying, distribution and | ||
| 110 | modification follow. Pay close attention to the difference between a | ||
| 111 | "work based on the library" and a "work that uses the library". The | ||
| 112 | former contains code derived from the library, whereas the latter must | ||
| 113 | be combined with the library in order to run. | ||
| 114 | |||
| 115 | GNU LESSER GENERAL PUBLIC LICENSE | ||
| 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 117 | |||
| 118 | 0. This License Agreement applies to any software library or other | ||
| 119 | program which contains a notice placed by the copyright holder or | ||
| 120 | other authorized party saying it may be distributed under the terms of | ||
| 121 | this Lesser General Public License (also called "this License"). | ||
| 122 | Each licensee is addressed as "you". | ||
| 123 | |||
| 124 | A "library" means a collection of software functions and/or data | ||
| 125 | prepared so as to be conveniently linked with application programs | ||
| 126 | (which use some of those functions and data) to form executables. | ||
| 127 | |||
| 128 | The "Library", below, refers to any such software library or work | ||
| 129 | which has been distributed under these terms. A "work based on the | ||
| 130 | Library" means either the Library or any derivative work under | ||
| 131 | copyright law: that is to say, a work containing the Library or a | ||
| 132 | portion of it, either verbatim or with modifications and/or translated | ||
| 133 | straightforwardly into another language. (Hereinafter, translation is | ||
| 134 | included without limitation in the term "modification".) | ||
| 135 | |||
| 136 | "Source code" for a work means the preferred form of the work for | ||
| 137 | making modifications to it. For a library, complete source code means | ||
| 138 | all the source code for all modules it contains, plus any associated | ||
| 139 | interface definition files, plus the scripts used to control compilation | ||
| 140 | and installation of the library. | ||
| 141 | |||
| 142 | Activities other than copying, distribution and modification are not | ||
| 143 | covered by this License; they are outside its scope. The act of | ||
| 144 | running a program using the Library is not restricted, and output from | ||
| 145 | such a program is covered only if its contents constitute a work based | ||
| 146 | on the Library (independent of the use of the Library in a tool for | ||
| 147 | writing it). Whether that is true depends on what the Library does | ||
| 148 | and what the program that uses the Library does. | ||
| 149 | |||
| 150 | 1. You may copy and distribute verbatim copies of the Library's | ||
| 151 | complete source code as you receive it, in any medium, provided that | ||
| 152 | you conspicuously and appropriately publish on each copy an | ||
| 153 | appropriate copyright notice and disclaimer of warranty; keep intact | ||
| 154 | all the notices that refer to this License and to the absence of any | ||
| 155 | warranty; and distribute a copy of this License along with the | ||
| 156 | Library. | ||
| 157 | |||
| 158 | You may charge a fee for the physical act of transferring a copy, | ||
| 159 | and you may at your option offer warranty protection in exchange for a | ||
| 160 | fee. | ||
| 161 | |||
| 162 | 2. You may modify your copy or copies of the Library or any portion | ||
| 163 | of it, thus forming a work based on the Library, and copy and | ||
| 164 | distribute such modifications or work under the terms of Section 1 | ||
| 165 | above, provided that you also meet all of these conditions: | ||
| 166 | |||
| 167 | a) The modified work must itself be a software library. | ||
| 168 | |||
| 169 | b) You must cause the files modified to carry prominent notices | ||
| 170 | stating that you changed the files and the date of any change. | ||
| 171 | |||
| 172 | c) You must cause the whole of the work to be licensed at no | ||
| 173 | charge to all third parties under the terms of this License. | ||
| 174 | |||
| 175 | d) If a facility in the modified Library refers to a function or a | ||
| 176 | table of data to be supplied by an application program that uses | ||
| 177 | the facility, other than as an argument passed when the facility | ||
| 178 | is invoked, then you must make a good faith effort to ensure that, | ||
| 179 | in the event an application does not supply such function or | ||
| 180 | table, the facility still operates, and performs whatever part of | ||
| 181 | its purpose remains meaningful. | ||
| 182 | |||
| 183 | (For example, a function in a library to compute square roots has | ||
| 184 | a purpose that is entirely well-defined independent of the | ||
| 185 | application. Therefore, Subsection 2d requires that any | ||
| 186 | application-supplied function or table used by this function must | ||
| 187 | be optional: if the application does not supply it, the square | ||
| 188 | root function must still compute square roots.) | ||
| 189 | |||
| 190 | These requirements apply to the modified work as a whole. If | ||
| 191 | identifiable sections of that work are not derived from the Library, | ||
| 192 | and can be reasonably considered independent and separate works in | ||
| 193 | themselves, then this License, and its terms, do not apply to those | ||
| 194 | sections when you distribute them as separate works. But when you | ||
| 195 | distribute the same sections as part of a whole which is a work based | ||
| 196 | on the Library, the distribution of the whole must be on the terms of | ||
| 197 | this License, whose permissions for other licensees extend to the | ||
| 198 | entire whole, and thus to each and every part regardless of who wrote | ||
| 199 | it. | ||
| 200 | |||
| 201 | Thus, it is not the intent of this section to claim rights or contest | ||
| 202 | your rights to work written entirely by you; rather, the intent is to | ||
| 203 | exercise the right to control the distribution of derivative or | ||
| 204 | collective works based on the Library. | ||
| 205 | |||
| 206 | In addition, mere aggregation of another work not based on the Library | ||
| 207 | with the Library (or with a work based on the Library) on a volume of | ||
| 208 | a storage or distribution medium does not bring the other work under | ||
| 209 | the scope of this License. | ||
| 210 | |||
| 211 | 3. You may opt to apply the terms of the ordinary GNU General Public | ||
| 212 | License instead of this License to a given copy of the Library. To do | ||
| 213 | this, you must alter all the notices that refer to this License, so | ||
| 214 | that they refer to the ordinary GNU General Public License, version 2, | ||
| 215 | instead of to this License. (If a newer version than version 2 of the | ||
| 216 | ordinary GNU General Public License has appeared, then you can specify | ||
| 217 | that version instead if you wish.) Do not make any other change in | ||
| 218 | these notices. | ||
| 219 | |||
| 220 | Once this change is made in a given copy, it is irreversible for | ||
| 221 | that copy, so the ordinary GNU General Public License applies to all | ||
| 222 | subsequent copies and derivative works made from that copy. | ||
| 223 | |||
| 224 | This option is useful when you wish to copy part of the code of | ||
| 225 | the Library into a program that is not a library. | ||
| 226 | |||
| 227 | 4. You may copy and distribute the Library (or a portion or | ||
| 228 | derivative of it, under Section 2) in object code or executable form | ||
| 229 | under the terms of Sections 1 and 2 above provided that you accompany | ||
| 230 | it with the complete corresponding machine-readable source code, which | ||
| 231 | must be distributed under the terms of Sections 1 and 2 above on a | ||
| 232 | medium customarily used for software interchange. | ||
| 233 | |||
| 234 | If distribution of object code is made by offering access to copy | ||
| 235 | from a designated place, then offering equivalent access to copy the | ||
| 236 | source code from the same place satisfies the requirement to | ||
| 237 | distribute the source code, even though third parties are not | ||
| 238 | compelled to copy the source along with the object code. | ||
| 239 | |||
| 240 | 5. A program that contains no derivative of any portion of the | ||
| 241 | Library, but is designed to work with the Library by being compiled or | ||
| 242 | linked with it, is called a "work that uses the Library". Such a | ||
| 243 | work, in isolation, is not a derivative work of the Library, and | ||
| 244 | therefore falls outside the scope of this License. | ||
| 245 | |||
| 246 | However, linking a "work that uses the Library" with the Library | ||
| 247 | creates an executable that is a derivative of the Library (because it | ||
| 248 | contains portions of the Library), rather than a "work that uses the | ||
| 249 | library". The executable is therefore covered by this License. | ||
| 250 | Section 6 states terms for distribution of such executables. | ||
| 251 | |||
| 252 | When a "work that uses the Library" uses material from a header file | ||
| 253 | that is part of the Library, the object code for the work may be a | ||
| 254 | derivative work of the Library even though the source code is not. | ||
| 255 | Whether this is true is especially significant if the work can be | ||
| 256 | linked without the Library, or if the work is itself a library. The | ||
| 257 | threshold for this to be true is not precisely defined by law. | ||
| 258 | |||
| 259 | If such an object file uses only numerical parameters, data | ||
| 260 | structure layouts and accessors, and small macros and small inline | ||
| 261 | functions (ten lines or less in length), then the use of the object | ||
| 262 | file is unrestricted, regardless of whether it is legally a derivative | ||
| 263 | work. (Executables containing this object code plus portions of the | ||
| 264 | Library will still fall under Section 6.) | ||
| 265 | |||
| 266 | Otherwise, if the work is a derivative of the Library, you may | ||
| 267 | distribute the object code for the work under the terms of Section 6. | ||
| 268 | Any executables containing that work also fall under Section 6, | ||
| 269 | whether or not they are linked directly with the Library itself. | ||
| 270 | |||
| 271 | 6. As an exception to the Sections above, you may also combine or | ||
| 272 | link a "work that uses the Library" with the Library to produce a | ||
| 273 | work containing portions of the Library, and distribute that work | ||
| 274 | under terms of your choice, provided that the terms permit | ||
| 275 | modification of the work for the customer's own use and reverse | ||
| 276 | engineering for debugging such modifications. | ||
| 277 | |||
| 278 | You must give prominent notice with each copy of the work that the | ||
| 279 | Library is used in it and that the Library and its use are covered by | ||
| 280 | this License. You must supply a copy of this License. If the work | ||
| 281 | during execution displays copyright notices, you must include the | ||
| 282 | copyright notice for the Library among them, as well as a reference | ||
| 283 | directing the user to the copy of this License. Also, you must do one | ||
| 284 | of these things: | ||
| 285 | |||
| 286 | a) Accompany the work with the complete corresponding | ||
| 287 | machine-readable source code for the Library including whatever | ||
| 288 | changes were used in the work (which must be distributed under | ||
| 289 | Sections 1 and 2 above); and, if the work is an executable linked | ||
| 290 | with the Library, with the complete machine-readable "work that | ||
| 291 | uses the Library", as object code and/or source code, so that the | ||
| 292 | user can modify the Library and then relink to produce a modified | ||
| 293 | executable containing the modified Library. (It is understood | ||
| 294 | that the user who changes the contents of definitions files in the | ||
| 295 | Library will not necessarily be able to recompile the application | ||
| 296 | to use the modified definitions.) | ||
| 297 | |||
| 298 | b) Use a suitable shared library mechanism for linking with the | ||
| 299 | Library. A suitable mechanism is one that (1) uses at run time a | ||
| 300 | copy of the library already present on the user's computer system, | ||
| 301 | rather than copying library functions into the executable, and (2) | ||
| 302 | will operate properly with a modified version of the library, if | ||
| 303 | the user installs one, as long as the modified version is | ||
| 304 | interface-compatible with the version that the work was made with. | ||
| 305 | |||
| 306 | c) Accompany the work with a written offer, valid for at | ||
| 307 | least three years, to give the same user the materials | ||
| 308 | specified in Subsection 6a, above, for a charge no more | ||
| 309 | than the cost of performing this distribution. | ||
| 310 | |||
| 311 | d) If distribution of the work is made by offering access to copy | ||
| 312 | from a designated place, offer equivalent access to copy the above | ||
| 313 | specified materials from the same place. | ||
| 314 | |||
| 315 | e) Verify that the user has already received a copy of these | ||
| 316 | materials or that you have already sent this user a copy. | ||
| 317 | |||
| 318 | For an executable, the required form of the "work that uses the | ||
| 319 | Library" must include any data and utility programs needed for | ||
| 320 | reproducing the executable from it. However, as a special exception, | ||
| 321 | the materials to be distributed need not include anything that is | ||
| 322 | normally distributed (in either source or binary form) with the major | ||
| 323 | components (compiler, kernel, and so on) of the operating system on | ||
| 324 | which the executable runs, unless that component itself accompanies | ||
| 325 | the executable. | ||
| 326 | |||
| 327 | It may happen that this requirement contradicts the license | ||
| 328 | restrictions of other proprietary libraries that do not normally | ||
| 329 | accompany the operating system. Such a contradiction means you cannot | ||
| 330 | use both them and the Library together in an executable that you | ||
| 331 | distribute. | ||
| 332 | |||
| 333 | 7. You may place library facilities that are a work based on the | ||
| 334 | Library side-by-side in a single library together with other library | ||
| 335 | facilities not covered by this License, and distribute such a combined | ||
| 336 | library, provided that the separate distribution of the work based on | ||
| 337 | the Library and of the other library facilities is otherwise | ||
| 338 | permitted, and provided that you do these two things: | ||
| 339 | |||
| 340 | a) Accompany the combined library with a copy of the same work | ||
| 341 | based on the Library, uncombined with any other library | ||
| 342 | facilities. This must be distributed under the terms of the | ||
| 343 | Sections above. | ||
| 344 | |||
| 345 | b) Give prominent notice with the combined library of the fact | ||
| 346 | that part of it is a work based on the Library, and explaining | ||
| 347 | where to find the accompanying uncombined form of the same work. | ||
| 348 | |||
| 349 | 8. You may not copy, modify, sublicense, link with, or distribute | ||
| 350 | the Library except as expressly provided under this License. Any | ||
| 351 | attempt otherwise to copy, modify, sublicense, link with, or | ||
| 352 | distribute the Library is void, and will automatically terminate your | ||
| 353 | rights under this License. However, parties who have received copies, | ||
| 354 | or rights, from you under this License will not have their licenses | ||
| 355 | terminated so long as such parties remain in full compliance. | ||
| 356 | |||
| 357 | 9. You are not required to accept this License, since you have not | ||
| 358 | signed it. However, nothing else grants you permission to modify or | ||
| 359 | distribute the Library or its derivative works. These actions are | ||
| 360 | prohibited by law if you do not accept this License. Therefore, by | ||
| 361 | modifying or distributing the Library (or any work based on the | ||
| 362 | Library), you indicate your acceptance of this License to do so, and | ||
| 363 | all its terms and conditions for copying, distributing or modifying | ||
| 364 | the Library or works based on it. | ||
| 365 | |||
| 366 | 10. Each time you redistribute the Library (or any work based on the | ||
| 367 | Library), the recipient automatically receives a license from the | ||
| 368 | original licensor to copy, distribute, link with or modify the Library | ||
| 369 | subject to these terms and conditions. You may not impose any further | ||
| 370 | restrictions on the recipients' exercise of the rights granted herein. | ||
| 371 | You are not responsible for enforcing compliance by third parties with | ||
| 372 | this License. | ||
| 373 | |||
| 374 | 11. If, as a consequence of a court judgment or allegation of patent | ||
| 375 | infringement or for any other reason (not limited to patent issues), | ||
| 376 | conditions are imposed on you (whether by court order, agreement or | ||
| 377 | otherwise) that contradict the conditions of this License, they do not | ||
| 378 | excuse you from the conditions of this License. If you cannot | ||
| 379 | distribute so as to satisfy simultaneously your obligations under this | ||
| 380 | License and any other pertinent obligations, then as a consequence you | ||
| 381 | may not distribute the Library at all. For example, if a patent | ||
| 382 | license would not permit royalty-free redistribution of the Library by | ||
| 383 | all those who receive copies directly or indirectly through you, then | ||
| 384 | the only way you could satisfy both it and this License would be to | ||
| 385 | refrain entirely from distribution of the Library. | ||
| 386 | |||
| 387 | If any portion of this section is held invalid or unenforceable under any | ||
| 388 | particular circumstance, the balance of the section is intended to apply, | ||
| 389 | and the section as a whole is intended to apply in other circumstances. | ||
| 390 | |||
| 391 | It is not the purpose of this section to induce you to infringe any | ||
| 392 | patents or other property right claims or to contest validity of any | ||
| 393 | such claims; this section has the sole purpose of protecting the | ||
| 394 | integrity of the free software distribution system which is | ||
| 395 | implemented by public license practices. Many people have made | ||
| 396 | generous contributions to the wide range of software distributed | ||
| 397 | through that system in reliance on consistent application of that | ||
| 398 | system; it is up to the author/donor to decide if he or she is willing | ||
| 399 | to distribute software through any other system and a licensee cannot | ||
| 400 | impose that choice. | ||
| 401 | |||
| 402 | This section is intended to make thoroughly clear what is believed to | ||
| 403 | be a consequence of the rest of this License. | ||
| 404 | |||
| 405 | 12. If the distribution and/or use of the Library is restricted in | ||
| 406 | certain countries either by patents or by copyrighted interfaces, the | ||
| 407 | original copyright holder who places the Library under this License may add | ||
| 408 | an explicit geographical distribution limitation excluding those countries, | ||
| 409 | so that distribution is permitted only in or among countries not thus | ||
| 410 | excluded. In such case, this License incorporates the limitation as if | ||
| 411 | written in the body of this License. | ||
| 412 | |||
| 413 | 13. The Free Software Foundation may publish revised and/or new | ||
| 414 | versions of the Lesser General Public License from time to time. | ||
| 415 | Such new versions will be similar in spirit to the present version, | ||
| 416 | but may differ in detail to address new problems or concerns. | ||
| 417 | |||
| 418 | Each version is given a distinguishing version number. If the Library | ||
| 419 | specifies a version number of this License which applies to it and | ||
| 420 | "any later version", you have the option of following the terms and | ||
| 421 | conditions either of that version or of any later version published by | ||
| 422 | the Free Software Foundation. If the Library does not specify a | ||
| 423 | license version number, you may choose any version ever published by | ||
| 424 | the Free Software Foundation. | ||
| 425 | |||
| 426 | 14. If you wish to incorporate parts of the Library into other free | ||
| 427 | programs whose distribution conditions are incompatible with these, | ||
| 428 | write to the author to ask for permission. For software which is | ||
| 429 | copyrighted by the Free Software Foundation, write to the Free | ||
| 430 | Software Foundation; we sometimes make exceptions for this. Our | ||
| 431 | decision will be guided by the two goals of preserving the free status | ||
| 432 | of all derivatives of our free software and of promoting the sharing | ||
| 433 | and reuse of software generally. | ||
| 434 | |||
| 435 | NO WARRANTY | ||
| 436 | |||
| 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | ||
| 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | ||
| 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | ||
| 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | ||
| 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | ||
| 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | ||
| 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
| 446 | |||
| 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | ||
| 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | ||
| 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | ||
| 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | ||
| 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | ||
| 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||
| 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||
| 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||
| 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | ||
| 456 | DAMAGES. | ||
| 457 | |||
| 458 | END OF TERMS AND CONDITIONS | ||
| 459 | |||
| 460 | How to Apply These Terms to Your New Libraries | ||
| 461 | |||
| 462 | If you develop a new library, and you want it to be of the greatest | ||
| 463 | possible use to the public, we recommend making it free software that | ||
| 464 | everyone can redistribute and change. You can do so by permitting | ||
| 465 | redistribution under these terms (or, alternatively, under the terms of the | ||
| 466 | ordinary General Public License). | ||
| 467 | |||
| 468 | To apply these terms, attach the following notices to the library. It is | ||
| 469 | safest to attach them to the start of each source file to most effectively | ||
| 470 | convey the exclusion of warranty; and each file should have at least the | ||
| 471 | "copyright" line and a pointer to where the full notice is found. | ||
| 472 | |||
| 473 | <one line to give the library's name and a brief idea of what it does.> | ||
| 474 | Copyright (C) <year> <name of author> | ||
| 475 | |||
| 476 | This library is free software; you can redistribute it and/or | ||
| 477 | modify it under the terms of the GNU Lesser General Public | ||
| 478 | License as published by the Free Software Foundation; either | ||
| 479 | version 2.1 of the License, or (at your option) any later version. | ||
| 480 | |||
| 481 | This library is distributed in the hope that it will be useful, | ||
| 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 484 | Lesser General Public License for more details. | ||
| 485 | |||
| 486 | You should have received a copy of the GNU Lesser General Public | ||
| 487 | License along with this library; if not, write to the Free Software | ||
| 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 489 | |||
| 490 | Also add information on how to contact you by electronic and paper mail. | ||
| 491 | |||
| 492 | You should also get your employer (if you work as a programmer) or your | ||
| 493 | school, if any, to sign a "copyright disclaimer" for the library, if | ||
| 494 | necessary. Here is a sample; alter the names: | ||
| 495 | |||
| 496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | ||
| 497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | ||
| 498 | |||
| 499 | <signature of Ty Coon>, 1 April 1990 | ||
| 500 | Ty Coon, President of Vice | ||
| 501 | |||
| 502 | That's all there is to it! | ||
| 503 | |||
| 504 | |||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css b/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css deleted file mode 100644 index 0e22834..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | input.radio {border:1px none #000; background:transparent; vertical-align:middle;} | ||
| 2 | .panel_wrapper div.current {height:80px;} | ||
| 3 | #width {width:50px; vertical-align:middle;} | ||
| 4 | #width2 {width:50px; vertical-align:middle;} | ||
| 5 | #size {width:100px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js deleted file mode 100644 index 4d3b062..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js deleted file mode 100644 index 8a84753..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedHRPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceAdvancedHr', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/rule.htm', | ||
| 15 | width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), | ||
| 16 | height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | // Register buttons | ||
| 24 | ed.addButton('advhr', { | ||
| 25 | title : 'advhr.advhr_desc', | ||
| 26 | cmd : 'mceAdvancedHr' | ||
| 27 | }); | ||
| 28 | |||
| 29 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 30 | cm.setActive('advhr', n.nodeName == 'HR'); | ||
| 31 | }); | ||
| 32 | |||
| 33 | ed.onClick.add(function(ed, e) { | ||
| 34 | e = e.target; | ||
| 35 | |||
| 36 | if (e.nodeName === 'HR') | ||
| 37 | ed.selection.select(e); | ||
| 38 | }); | ||
| 39 | }, | ||
| 40 | |||
| 41 | getInfo : function() { | ||
| 42 | return { | ||
| 43 | longname : 'Advanced HR', | ||
| 44 | author : 'Moxiecode Systems AB', | ||
| 45 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', | ||
| 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 48 | }; | ||
| 49 | } | ||
| 50 | }); | ||
| 51 | |||
| 52 | // Register plugin | ||
| 53 | tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); | ||
| 54 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/js/rule.js b/public/javascripts/tiny_mce/plugins/advhr/js/rule.js deleted file mode 100644 index b6cbd66..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/js/rule.js +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | var AdvHRDialog = { | ||
| 2 | init : function(ed) { | ||
| 3 | var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; | ||
| 4 | |||
| 5 | w = dom.getAttrib(n, 'width'); | ||
| 6 | f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); | ||
| 7 | f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; | ||
| 8 | f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); | ||
| 9 | selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); | ||
| 10 | }, | ||
| 11 | |||
| 12 | update : function() { | ||
| 13 | var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; | ||
| 14 | |||
| 15 | h = '<hr'; | ||
| 16 | |||
| 17 | if (f.size.value) { | ||
| 18 | h += ' size="' + f.size.value + '"'; | ||
| 19 | st += ' height:' + f.size.value + 'px;'; | ||
| 20 | } | ||
| 21 | |||
| 22 | if (f.width.value) { | ||
| 23 | h += ' width="' + f.width.value + (f.width2.value == '%' ? '%' : '') + '"'; | ||
| 24 | st += ' width:' + f.width.value + (f.width2.value == '%' ? '%' : 'px') + ';'; | ||
| 25 | } | ||
| 26 | |||
| 27 | if (f.noshade.checked) { | ||
| 28 | h += ' noshade="noshade"'; | ||
| 29 | st += ' border-width: 1px; border-style: solid; border-color: #CCCCCC; color: #ffffff;'; | ||
| 30 | } | ||
| 31 | |||
| 32 | if (ed.settings.inline_styles) | ||
| 33 | h += ' style="' + tinymce.trim(st) + '"'; | ||
| 34 | |||
| 35 | h += ' />'; | ||
| 36 | |||
| 37 | ed.execCommand("mceInsertContent", false, h); | ||
| 38 | tinyMCEPopup.close(); | ||
| 39 | } | ||
| 40 | }; | ||
| 41 | |||
| 42 | tinyMCEPopup.requireLangPack(); | ||
| 43 | tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js deleted file mode 100644 index 873bfd8..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.advhr_dlg',{ | ||
| 2 | width:"Width", | ||
| 3 | size:"Height", | ||
| 4 | noshade:"No shadow" | ||
| 5 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advhr/rule.htm b/public/javascripts/tiny_mce/plugins/advhr/rule.htm deleted file mode 100644 index 75ca339..0000000 --- a/public/javascripts/tiny_mce/plugins/advhr/rule.htm +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advhr.advhr_desc}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/rule.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <link href="css/advhr.css" rel="stylesheet" type="text/css" /> | ||
| 10 | </head> | ||
| 11 | <body> | ||
| 12 | <form onsubmit="AdvHRDialog.update();return false;" action="#"> | ||
| 13 | <div class="tabs"> | ||
| 14 | <ul> | ||
| 15 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advhr.advhr_desc}</a></span></li> | ||
| 16 | </ul> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="panel_wrapper"> | ||
| 20 | <div id="general_panel" class="panel current"> | ||
| 21 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 22 | <tr> | ||
| 23 | <td><label for="width">{#advhr_dlg.width}</label></td> | ||
| 24 | <td class="nowrap"> | ||
| 25 | <input id="width" name="width" type="text" value="" class="mceFocus" /> | ||
| 26 | <select name="width2" id="width2"> | ||
| 27 | <option value="">px</option> | ||
| 28 | <option value="%">%</option> | ||
| 29 | </select> | ||
| 30 | </td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td><label for="size">{#advhr_dlg.size}</label></td> | ||
| 34 | <td><select id="size" name="size"> | ||
| 35 | <option value="">Normal</option> | ||
| 36 | <option value="1">1</option> | ||
| 37 | <option value="2">2</option> | ||
| 38 | <option value="3">3</option> | ||
| 39 | <option value="4">4</option> | ||
| 40 | <option value="5">5</option> | ||
| 41 | </select></td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td><label for="noshade">{#advhr_dlg.noshade}</label></td> | ||
| 45 | <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td> | ||
| 46 | </tr> | ||
| 47 | </table> | ||
| 48 | </div> | ||
| 49 | </div> | ||
| 50 | |||
| 51 | <div class="mceActionPanel"> | ||
| 52 | <div style="float: left"> | ||
| 53 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 54 | </div> | ||
| 55 | |||
| 56 | <div style="float: right"> | ||
| 57 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 58 | </div> | ||
| 59 | </div> | ||
| 60 | </form> | ||
| 61 | </body> | ||
| 62 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css deleted file mode 100644 index 0a6251a..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #src_list, #over_list, #out_list {width:280px;} | ||
| 2 | .mceActionPanel {margin-top:7px;} | ||
| 3 | .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} | ||
| 4 | .checkbox {border:0;} | ||
| 5 | .panel_wrapper div.current {height:305px;} | ||
| 6 | #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} | ||
| 7 | #align, #classlist {width:150px;} | ||
| 8 | #width, #height {vertical-align:middle; width:50px; text-align:center;} | ||
| 9 | #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} | ||
| 10 | #class_list {width:180px;} | ||
| 11 | input {width: 280px;} | ||
| 12 | #constrain, #onmousemovecheck {width:auto;} | ||
| 13 | #id, #dir, #lang, #usemap, #longdesc {width:200px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js deleted file mode 100644 index 4c7a9c3..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js deleted file mode 100644 index f526842..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceAdvImage', function() { | ||
| 13 | // Internal image object like a flash placeholder | ||
| 14 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) | ||
| 15 | return; | ||
| 16 | |||
| 17 | ed.windowManager.open({ | ||
| 18 | file : url + '/image.htm', | ||
| 19 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), | ||
| 20 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), | ||
| 21 | inline : 1 | ||
| 22 | }, { | ||
| 23 | plugin_url : url | ||
| 24 | }); | ||
| 25 | }); | ||
| 26 | |||
| 27 | // Register buttons | ||
| 28 | ed.addButton('image', { | ||
| 29 | title : 'advimage.image_desc', | ||
| 30 | cmd : 'mceAdvImage' | ||
| 31 | }); | ||
| 32 | }, | ||
| 33 | |||
| 34 | getInfo : function() { | ||
| 35 | return { | ||
| 36 | longname : 'Advanced image', | ||
| 37 | author : 'Moxiecode Systems AB', | ||
| 38 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 39 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', | ||
| 40 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 41 | }; | ||
| 42 | } | ||
| 43 | }); | ||
| 44 | |||
| 45 | // Register plugin | ||
| 46 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); | ||
| 47 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/image.htm b/public/javascripts/tiny_mce/plugins/advimage/image.htm deleted file mode 100644 index 5d26150..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/image.htm +++ /dev/null | |||
| @@ -1,237 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advimage_dlg.dialog_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 10 | <script type="text/javascript" src="js/image.js"></script> | ||
| 11 | <link href="css/advimage.css" rel="stylesheet" type="text/css" /> | ||
| 12 | </head> | ||
| 13 | <body id="advimage" style="display: none"> | ||
| 14 | <form onsubmit="ImageDialog.insert();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advimage_dlg.tab_general}</a></span></li> | ||
| 18 | <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#advimage_dlg.tab_appearance}</a></span></li> | ||
| 19 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advimage_dlg.tab_advanced}</a></span></li> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#advimage_dlg.general}</legend> | ||
| 27 | |||
| 28 | <table class="properties"> | ||
| 29 | <tr> | ||
| 30 | <td class="column1"><label id="srclabel" for="src">{#advimage_dlg.src}</label></td> | ||
| 31 | <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> | ||
| 32 | <tr> | ||
| 33 | <td><input name="src" type="text" id="src" value="" class="mceFocus" onchange="ImageDialog.showPreviewImage(this.value);" /></td> | ||
| 34 | <td id="srcbrowsercontainer"> </td> | ||
| 35 | </tr> | ||
| 36 | </table></td> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <td><label for="src_list">{#advimage_dlg.image_list}</label></td> | ||
| 40 | <td><select id="src_list" name="src_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;document.getElementById('title').value=this.options[this.selectedIndex].text;ImageDialog.showPreviewImage(this.options[this.selectedIndex].value);"><option value=""></option></select></td> | ||
| 41 | </tr> | ||
| 42 | <tr> | ||
| 43 | <td class="column1"><label id="altlabel" for="alt">{#advimage_dlg.alt}</label></td> | ||
| 44 | <td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> | ||
| 45 | </tr> | ||
| 46 | <tr> | ||
| 47 | <td class="column1"><label id="titlelabel" for="title">{#advimage_dlg.title}</label></td> | ||
| 48 | <td colspan="2"><input id="title" name="title" type="text" value="" /></td> | ||
| 49 | </tr> | ||
| 50 | </table> | ||
| 51 | </fieldset> | ||
| 52 | |||
| 53 | <fieldset> | ||
| 54 | <legend>{#advimage_dlg.preview}</legend> | ||
| 55 | <div id="prev"></div> | ||
| 56 | </fieldset> | ||
| 57 | </div> | ||
| 58 | |||
| 59 | <div id="appearance_panel" class="panel"> | ||
| 60 | <fieldset> | ||
| 61 | <legend>{#advimage_dlg.tab_appearance}</legend> | ||
| 62 | |||
| 63 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 64 | <tr> | ||
| 65 | <td class="column1"><label id="alignlabel" for="align">{#advimage_dlg.align}</label></td> | ||
| 66 | <td><select id="align" name="align" onchange="ImageDialog.updateStyle('align');ImageDialog.changeAppearance();"> | ||
| 67 | <option value="">{#not_set}</option> | ||
| 68 | <option value="baseline">{#advimage_dlg.align_baseline}</option> | ||
| 69 | <option value="top">{#advimage_dlg.align_top}</option> | ||
| 70 | <option value="middle">{#advimage_dlg.align_middle}</option> | ||
| 71 | <option value="bottom">{#advimage_dlg.align_bottom}</option> | ||
| 72 | <option value="text-top">{#advimage_dlg.align_texttop}</option> | ||
| 73 | <option value="text-bottom">{#advimage_dlg.align_textbottom}</option> | ||
| 74 | <option value="left">{#advimage_dlg.align_left}</option> | ||
| 75 | <option value="right">{#advimage_dlg.align_right}</option> | ||
| 76 | </select> | ||
| 77 | </td> | ||
| 78 | <td rowspan="6" valign="top"> | ||
| 79 | <div class="alignPreview"> | ||
| 80 | <img id="alignSampleImg" src="img/sample.gif" alt="{#advimage_dlg.example_img}" /> | ||
| 81 | Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam | ||
| 82 | nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum | ||
| 83 | edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam | ||
| 84 | erat volutpat. | ||
| 85 | </div> | ||
| 86 | </td> | ||
| 87 | </tr> | ||
| 88 | |||
| 89 | <tr> | ||
| 90 | <td class="column1"><label id="widthlabel" for="width">{#advimage_dlg.dimensions}</label></td> | ||
| 91 | <td class="nowrap"> | ||
| 92 | <input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeHeight();" /> x | ||
| 93 | <input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="ImageDialog.changeWidth();" /> px | ||
| 94 | </td> | ||
| 95 | </tr> | ||
| 96 | |||
| 97 | <tr> | ||
| 98 | <td> </td> | ||
| 99 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 100 | <tr> | ||
| 101 | <td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td> | ||
| 102 | <td><label id="constrainlabel" for="constrain">{#advimage_dlg.constrain_proportions}</label></td> | ||
| 103 | </tr> | ||
| 104 | </table></td> | ||
| 105 | </tr> | ||
| 106 | |||
| 107 | <tr> | ||
| 108 | <td class="column1"><label id="vspacelabel" for="vspace">{#advimage_dlg.vspace}</label></td> | ||
| 109 | <td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('vspace');ImageDialog.changeAppearance();" /> | ||
| 110 | </td> | ||
| 111 | </tr> | ||
| 112 | |||
| 113 | <tr> | ||
| 114 | <td class="column1"><label id="hspacelabel" for="hspace">{#advimage_dlg.hspace}</label></td> | ||
| 115 | <td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('hspace');ImageDialog.changeAppearance();" /></td> | ||
| 116 | </tr> | ||
| 117 | |||
| 118 | <tr> | ||
| 119 | <td class="column1"><label id="borderlabel" for="border">{#advimage_dlg.border}</label></td> | ||
| 120 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" onblur="ImageDialog.updateStyle('border');ImageDialog.changeAppearance();" /></td> | ||
| 121 | </tr> | ||
| 122 | |||
| 123 | <tr> | ||
| 124 | <td><label for="class_list">{#class_name}</label></td> | ||
| 125 | <td colspan="2"><select id="class_list" name="class_list" class="mceEditableSelect"><option value=""></option></select></td> | ||
| 126 | </tr> | ||
| 127 | |||
| 128 | <tr> | ||
| 129 | <td class="column1"><label id="stylelabel" for="style">{#advimage_dlg.style}</label></td> | ||
| 130 | <td colspan="2"><input id="style" name="style" type="text" value="" onchange="ImageDialog.changeAppearance();" /></td> | ||
| 131 | </tr> | ||
| 132 | |||
| 133 | <!-- <tr> | ||
| 134 | <td class="column1"><label id="classeslabel" for="classes">{#advimage_dlg.classes}</label></td> | ||
| 135 | <td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> | ||
| 136 | </tr> --> | ||
| 137 | </table> | ||
| 138 | </fieldset> | ||
| 139 | </div> | ||
| 140 | |||
| 141 | <div id="advanced_panel" class="panel"> | ||
| 142 | <fieldset> | ||
| 143 | <legend>{#advimage_dlg.swap_image}</legend> | ||
| 144 | |||
| 145 | <input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="ImageDialog.setSwapImage(this.checked);" /> | ||
| 146 | <label id="onmousemovechecklabel" for="onmousemovecheck">{#advimage_dlg.alt_image}</label> | ||
| 147 | |||
| 148 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 149 | <tr> | ||
| 150 | <td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{#advimage_dlg.mouseover}</label></td> | ||
| 151 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 152 | <tr> | ||
| 153 | <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> | ||
| 154 | <td id="onmouseoversrccontainer"> </td> | ||
| 155 | </tr> | ||
| 156 | </table></td> | ||
| 157 | </tr> | ||
| 158 | <tr> | ||
| 159 | <td><label for="over_list">{#advimage_dlg.image_list}</label></td> | ||
| 160 | <td><select id="over_list" name="over_list" onchange="document.getElementById('onmouseoversrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td> | ||
| 161 | </tr> | ||
| 162 | <tr> | ||
| 163 | <td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{#advimage_dlg.mouseout}</label></td> | ||
| 164 | <td class="column2"><table border="0" cellspacing="0" cellpadding="0"> | ||
| 165 | <tr> | ||
| 166 | <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> | ||
| 167 | <td id="onmouseoutsrccontainer"> </td> | ||
| 168 | </tr> | ||
| 169 | </table></td> | ||
| 170 | </tr> | ||
| 171 | <tr> | ||
| 172 | <td><label for="out_list">{#advimage_dlg.image_list}</label></td> | ||
| 173 | <td><select id="out_list" name="out_list" onchange="document.getElementById('onmouseoutsrc').value=this.options[this.selectedIndex].value;"><option value=""></option></select></td> | ||
| 174 | </tr> | ||
| 175 | </table> | ||
| 176 | </fieldset> | ||
| 177 | |||
| 178 | <fieldset> | ||
| 179 | <legend>{#advimage_dlg.misc}</legend> | ||
| 180 | |||
| 181 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 182 | <tr> | ||
| 183 | <td class="column1"><label id="idlabel" for="id">{#advimage_dlg.id}</label></td> | ||
| 184 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 185 | </tr> | ||
| 186 | |||
| 187 | <tr> | ||
| 188 | <td class="column1"><label id="dirlabel" for="dir">{#advimage_dlg.langdir}</label></td> | ||
| 189 | <td> | ||
| 190 | <select id="dir" name="dir" onchange="ImageDialog.changeAppearance();"> | ||
| 191 | <option value="">{#not_set}</option> | ||
| 192 | <option value="ltr">{#advimage_dlg.ltr}</option> | ||
| 193 | <option value="rtl">{#advimage_dlg.rtl}</option> | ||
| 194 | </select> | ||
| 195 | </td> | ||
| 196 | </tr> | ||
| 197 | |||
| 198 | <tr> | ||
| 199 | <td class="column1"><label id="langlabel" for="lang">{#advimage_dlg.langcode}</label></td> | ||
| 200 | <td> | ||
| 201 | <input id="lang" name="lang" type="text" value="" /> | ||
| 202 | </td> | ||
| 203 | </tr> | ||
| 204 | |||
| 205 | <tr> | ||
| 206 | <td class="column1"><label id="usemaplabel" for="usemap">{#advimage_dlg.map}</label></td> | ||
| 207 | <td> | ||
| 208 | <input id="usemap" name="usemap" type="text" value="" /> | ||
| 209 | </td> | ||
| 210 | </tr> | ||
| 211 | |||
| 212 | <tr> | ||
| 213 | <td class="column1"><label id="longdesclabel" for="longdesc">{#advimage_dlg.long_desc}</label></td> | ||
| 214 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 215 | <tr> | ||
| 216 | <td><input id="longdesc" name="longdesc" type="text" value="" /></td> | ||
| 217 | <td id="longdesccontainer"> </td> | ||
| 218 | </tr> | ||
| 219 | </table></td> | ||
| 220 | </tr> | ||
| 221 | </table> | ||
| 222 | </fieldset> | ||
| 223 | </div> | ||
| 224 | </div> | ||
| 225 | |||
| 226 | <div class="mceActionPanel"> | ||
| 227 | <div style="float: left"> | ||
| 228 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 229 | </div> | ||
| 230 | |||
| 231 | <div style="float: right"> | ||
| 232 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 233 | </div> | ||
| 234 | </div> | ||
| 235 | </form> | ||
| 236 | </body> | ||
| 237 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif deleted file mode 100644 index 53bf689..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/js/image.js b/public/javascripts/tiny_mce/plugins/advimage/js/image.js deleted file mode 100644 index 3477226..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/js/image.js +++ /dev/null | |||
| @@ -1,443 +0,0 @@ | |||
| 1 | var ImageDialog = { | ||
| 2 | preInit : function() { | ||
| 3 | var url; | ||
| 4 | |||
| 5 | tinyMCEPopup.requireLangPack(); | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_image_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function(ed) { | ||
| 12 | var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(); | ||
| 13 | |||
| 14 | tinyMCEPopup.resizeToInnerSize(); | ||
| 15 | this.fillClassList('class_list'); | ||
| 16 | this.fillFileList('src_list', 'tinyMCEImageList'); | ||
| 17 | this.fillFileList('over_list', 'tinyMCEImageList'); | ||
| 18 | this.fillFileList('out_list', 'tinyMCEImageList'); | ||
| 19 | TinyMCE_EditableSelects.init(); | ||
| 20 | |||
| 21 | if (n.nodeName == 'IMG') { | ||
| 22 | nl.src.value = dom.getAttrib(n, 'src'); | ||
| 23 | nl.width.value = dom.getAttrib(n, 'width'); | ||
| 24 | nl.height.value = dom.getAttrib(n, 'height'); | ||
| 25 | nl.alt.value = dom.getAttrib(n, 'alt'); | ||
| 26 | nl.title.value = dom.getAttrib(n, 'title'); | ||
| 27 | nl.vspace.value = this.getAttrib(n, 'vspace'); | ||
| 28 | nl.hspace.value = this.getAttrib(n, 'hspace'); | ||
| 29 | nl.border.value = this.getAttrib(n, 'border'); | ||
| 30 | selectByValue(f, 'align', this.getAttrib(n, 'align')); | ||
| 31 | selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); | ||
| 32 | nl.style.value = dom.getAttrib(n, 'style'); | ||
| 33 | nl.id.value = dom.getAttrib(n, 'id'); | ||
| 34 | nl.dir.value = dom.getAttrib(n, 'dir'); | ||
| 35 | nl.lang.value = dom.getAttrib(n, 'lang'); | ||
| 36 | nl.usemap.value = dom.getAttrib(n, 'usemap'); | ||
| 37 | nl.longdesc.value = dom.getAttrib(n, 'longdesc'); | ||
| 38 | nl.insert.value = ed.getLang('update'); | ||
| 39 | |||
| 40 | if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) | ||
| 41 | nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); | ||
| 42 | |||
| 43 | if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) | ||
| 44 | nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); | ||
| 45 | |||
| 46 | if (ed.settings.inline_styles) { | ||
| 47 | // Move attribs to styles | ||
| 48 | if (dom.getAttrib(n, 'align')) | ||
| 49 | this.updateStyle('align'); | ||
| 50 | |||
| 51 | if (dom.getAttrib(n, 'hspace')) | ||
| 52 | this.updateStyle('hspace'); | ||
| 53 | |||
| 54 | if (dom.getAttrib(n, 'border')) | ||
| 55 | this.updateStyle('border'); | ||
| 56 | |||
| 57 | if (dom.getAttrib(n, 'vspace')) | ||
| 58 | this.updateStyle('vspace'); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | // Setup browse button | ||
| 63 | document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); | ||
| 64 | if (isVisible('srcbrowser')) | ||
| 65 | document.getElementById('src').style.width = '260px'; | ||
| 66 | |||
| 67 | // Setup browse button | ||
| 68 | document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); | ||
| 69 | if (isVisible('overbrowser')) | ||
| 70 | document.getElementById('onmouseoversrc').style.width = '260px'; | ||
| 71 | |||
| 72 | // Setup browse button | ||
| 73 | document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); | ||
| 74 | if (isVisible('outbrowser')) | ||
| 75 | document.getElementById('onmouseoutsrc').style.width = '260px'; | ||
| 76 | |||
| 77 | // If option enabled default contrain proportions to checked | ||
| 78 | if (ed.getParam("advimage_constrain_proportions", true)) | ||
| 79 | f.constrain.checked = true; | ||
| 80 | |||
| 81 | // Check swap image if valid data | ||
| 82 | if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) | ||
| 83 | this.setSwapImage(true); | ||
| 84 | else | ||
| 85 | this.setSwapImage(false); | ||
| 86 | |||
| 87 | this.changeAppearance(); | ||
| 88 | this.showPreviewImage(nl.src.value, 1); | ||
| 89 | }, | ||
| 90 | |||
| 91 | insert : function(file, title) { | ||
| 92 | var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; | ||
| 93 | |||
| 94 | if (f.src.value === '') { | ||
| 95 | if (ed.selection.getNode().nodeName == 'IMG') { | ||
| 96 | ed.dom.remove(ed.selection.getNode()); | ||
| 97 | ed.execCommand('mceRepaint'); | ||
| 98 | } | ||
| 99 | |||
| 100 | tinyMCEPopup.close(); | ||
| 101 | return; | ||
| 102 | } | ||
| 103 | |||
| 104 | if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { | ||
| 105 | if (!f.alt.value) { | ||
| 106 | tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { | ||
| 107 | if (s) | ||
| 108 | t.insertAndClose(); | ||
| 109 | }); | ||
| 110 | |||
| 111 | return; | ||
| 112 | } | ||
| 113 | } | ||
| 114 | |||
| 115 | t.insertAndClose(); | ||
| 116 | }, | ||
| 117 | |||
| 118 | insertAndClose : function() { | ||
| 119 | var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; | ||
| 120 | |||
| 121 | tinyMCEPopup.restoreSelection(); | ||
| 122 | |||
| 123 | // Fixes crash in Safari | ||
| 124 | if (tinymce.isWebKit) | ||
| 125 | ed.getWin().focus(); | ||
| 126 | |||
| 127 | if (!ed.settings.inline_styles) { | ||
| 128 | args = { | ||
| 129 | vspace : nl.vspace.value, | ||
| 130 | hspace : nl.hspace.value, | ||
| 131 | border : nl.border.value, | ||
| 132 | align : getSelectValue(f, 'align') | ||
| 133 | }; | ||
| 134 | } else { | ||
| 135 | // Remove deprecated values | ||
| 136 | args = { | ||
| 137 | vspace : '', | ||
| 138 | hspace : '', | ||
| 139 | border : '', | ||
| 140 | align : '' | ||
| 141 | }; | ||
| 142 | } | ||
| 143 | |||
| 144 | tinymce.extend(args, { | ||
| 145 | src : nl.src.value, | ||
| 146 | width : nl.width.value, | ||
| 147 | height : nl.height.value, | ||
| 148 | alt : nl.alt.value, | ||
| 149 | title : nl.title.value, | ||
| 150 | 'class' : getSelectValue(f, 'class_list'), | ||
| 151 | style : nl.style.value, | ||
| 152 | id : nl.id.value, | ||
| 153 | dir : nl.dir.value, | ||
| 154 | lang : nl.lang.value, | ||
| 155 | usemap : nl.usemap.value, | ||
| 156 | longdesc : nl.longdesc.value | ||
| 157 | }); | ||
| 158 | |||
| 159 | args.onmouseover = args.onmouseout = ''; | ||
| 160 | |||
| 161 | if (f.onmousemovecheck.checked) { | ||
| 162 | if (nl.onmouseoversrc.value) | ||
| 163 | args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; | ||
| 164 | |||
| 165 | if (nl.onmouseoutsrc.value) | ||
| 166 | args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; | ||
| 167 | } | ||
| 168 | |||
| 169 | el = ed.selection.getNode(); | ||
| 170 | |||
| 171 | if (el && el.nodeName == 'IMG') { | ||
| 172 | ed.dom.setAttribs(el, args); | ||
| 173 | } else { | ||
| 174 | ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); | ||
| 175 | ed.dom.setAttribs('__mce_tmp', args); | ||
| 176 | ed.dom.setAttrib('__mce_tmp', 'id', ''); | ||
| 177 | ed.undoManager.add(); | ||
| 178 | } | ||
| 179 | |||
| 180 | tinyMCEPopup.close(); | ||
| 181 | }, | ||
| 182 | |||
| 183 | getAttrib : function(e, at) { | ||
| 184 | var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; | ||
| 185 | |||
| 186 | if (ed.settings.inline_styles) { | ||
| 187 | switch (at) { | ||
| 188 | case 'align': | ||
| 189 | if (v = dom.getStyle(e, 'float')) | ||
| 190 | return v; | ||
| 191 | |||
| 192 | if (v = dom.getStyle(e, 'vertical-align')) | ||
| 193 | return v; | ||
| 194 | |||
| 195 | break; | ||
| 196 | |||
| 197 | case 'hspace': | ||
| 198 | v = dom.getStyle(e, 'margin-left') | ||
| 199 | v2 = dom.getStyle(e, 'margin-right'); | ||
| 200 | |||
| 201 | if (v && v == v2) | ||
| 202 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 203 | |||
| 204 | break; | ||
| 205 | |||
| 206 | case 'vspace': | ||
| 207 | v = dom.getStyle(e, 'margin-top') | ||
| 208 | v2 = dom.getStyle(e, 'margin-bottom'); | ||
| 209 | if (v && v == v2) | ||
| 210 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 211 | |||
| 212 | break; | ||
| 213 | |||
| 214 | case 'border': | ||
| 215 | v = 0; | ||
| 216 | |||
| 217 | tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { | ||
| 218 | sv = dom.getStyle(e, 'border-' + sv + '-width'); | ||
| 219 | |||
| 220 | // False or not the same as prev | ||
| 221 | if (!sv || (sv != v && v !== 0)) { | ||
| 222 | v = 0; | ||
| 223 | return false; | ||
| 224 | } | ||
| 225 | |||
| 226 | if (sv) | ||
| 227 | v = sv; | ||
| 228 | }); | ||
| 229 | |||
| 230 | if (v) | ||
| 231 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 232 | |||
| 233 | break; | ||
| 234 | } | ||
| 235 | } | ||
| 236 | |||
| 237 | if (v = dom.getAttrib(e, at)) | ||
| 238 | return v; | ||
| 239 | |||
| 240 | return ''; | ||
| 241 | }, | ||
| 242 | |||
| 243 | setSwapImage : function(st) { | ||
| 244 | var f = document.forms[0]; | ||
| 245 | |||
| 246 | f.onmousemovecheck.checked = st; | ||
| 247 | setBrowserDisabled('overbrowser', !st); | ||
| 248 | setBrowserDisabled('outbrowser', !st); | ||
| 249 | |||
| 250 | if (f.over_list) | ||
| 251 | f.over_list.disabled = !st; | ||
| 252 | |||
| 253 | if (f.out_list) | ||
| 254 | f.out_list.disabled = !st; | ||
| 255 | |||
| 256 | f.onmouseoversrc.disabled = !st; | ||
| 257 | f.onmouseoutsrc.disabled = !st; | ||
| 258 | }, | ||
| 259 | |||
| 260 | fillClassList : function(id) { | ||
| 261 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 262 | |||
| 263 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { | ||
| 264 | cl = []; | ||
| 265 | |||
| 266 | tinymce.each(v.split(';'), function(v) { | ||
| 267 | var p = v.split('='); | ||
| 268 | |||
| 269 | cl.push({'title' : p[0], 'class' : p[1]}); | ||
| 270 | }); | ||
| 271 | } else | ||
| 272 | cl = tinyMCEPopup.editor.dom.getClasses(); | ||
| 273 | |||
| 274 | if (cl.length > 0) { | ||
| 275 | lst.options.length = 0; | ||
| 276 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 277 | |||
| 278 | tinymce.each(cl, function(o) { | ||
| 279 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); | ||
| 280 | }); | ||
| 281 | } else | ||
| 282 | dom.remove(dom.getParent(id, 'tr')); | ||
| 283 | }, | ||
| 284 | |||
| 285 | fillFileList : function(id, l) { | ||
| 286 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 287 | |||
| 288 | l = window[l]; | ||
| 289 | lst.options.length = 0; | ||
| 290 | |||
| 291 | if (l && l.length > 0) { | ||
| 292 | lst.options[lst.options.length] = new Option('', ''); | ||
| 293 | |||
| 294 | tinymce.each(l, function(o) { | ||
| 295 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 296 | }); | ||
| 297 | } else | ||
| 298 | dom.remove(dom.getParent(id, 'tr')); | ||
| 299 | }, | ||
| 300 | |||
| 301 | resetImageData : function() { | ||
| 302 | var f = document.forms[0]; | ||
| 303 | |||
| 304 | f.elements.width.value = f.elements.height.value = ''; | ||
| 305 | }, | ||
| 306 | |||
| 307 | updateImageData : function(img, st) { | ||
| 308 | var f = document.forms[0]; | ||
| 309 | |||
| 310 | if (!st) { | ||
| 311 | f.elements.width.value = img.width; | ||
| 312 | f.elements.height.value = img.height; | ||
| 313 | } | ||
| 314 | |||
| 315 | this.preloadImg = img; | ||
| 316 | }, | ||
| 317 | |||
| 318 | changeAppearance : function() { | ||
| 319 | var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); | ||
| 320 | |||
| 321 | if (img) { | ||
| 322 | if (ed.getParam('inline_styles')) { | ||
| 323 | ed.dom.setAttrib(img, 'style', f.style.value); | ||
| 324 | } else { | ||
| 325 | img.align = f.align.value; | ||
| 326 | img.border = f.border.value; | ||
| 327 | img.hspace = f.hspace.value; | ||
| 328 | img.vspace = f.vspace.value; | ||
| 329 | } | ||
| 330 | } | ||
| 331 | }, | ||
| 332 | |||
| 333 | changeHeight : function() { | ||
| 334 | var f = document.forms[0], tp, t = this; | ||
| 335 | |||
| 336 | if (!f.constrain.checked || !t.preloadImg) { | ||
| 337 | return; | ||
| 338 | } | ||
| 339 | |||
| 340 | if (f.width.value == "" || f.height.value == "") | ||
| 341 | return; | ||
| 342 | |||
| 343 | tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; | ||
| 344 | f.height.value = tp.toFixed(0); | ||
| 345 | }, | ||
| 346 | |||
| 347 | changeWidth : function() { | ||
| 348 | var f = document.forms[0], tp, t = this; | ||
| 349 | |||
| 350 | if (!f.constrain.checked || !t.preloadImg) { | ||
| 351 | return; | ||
| 352 | } | ||
| 353 | |||
| 354 | if (f.width.value == "" || f.height.value == "") | ||
| 355 | return; | ||
| 356 | |||
| 357 | tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; | ||
| 358 | f.width.value = tp.toFixed(0); | ||
| 359 | }, | ||
| 360 | |||
| 361 | updateStyle : function(ty) { | ||
| 362 | var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); | ||
| 363 | |||
| 364 | if (tinyMCEPopup.editor.settings.inline_styles) { | ||
| 365 | // Handle align | ||
| 366 | if (ty == 'align') { | ||
| 367 | dom.setStyle(img, 'float', ''); | ||
| 368 | dom.setStyle(img, 'vertical-align', ''); | ||
| 369 | |||
| 370 | v = getSelectValue(f, 'align'); | ||
| 371 | if (v) { | ||
| 372 | if (v == 'left' || v == 'right') | ||
| 373 | dom.setStyle(img, 'float', v); | ||
| 374 | else | ||
| 375 | img.style.verticalAlign = v; | ||
| 376 | } | ||
| 377 | } | ||
| 378 | |||
| 379 | // Handle border | ||
| 380 | if (ty == 'border') { | ||
| 381 | dom.setStyle(img, 'border', ''); | ||
| 382 | |||
| 383 | v = f.border.value; | ||
| 384 | if (v || v == '0') { | ||
| 385 | if (v == '0') | ||
| 386 | img.style.border = '0'; | ||
| 387 | else | ||
| 388 | img.style.border = v + 'px solid black'; | ||
| 389 | } | ||
| 390 | } | ||
| 391 | |||
| 392 | // Handle hspace | ||
| 393 | if (ty == 'hspace') { | ||
| 394 | dom.setStyle(img, 'marginLeft', ''); | ||
| 395 | dom.setStyle(img, 'marginRight', ''); | ||
| 396 | |||
| 397 | v = f.hspace.value; | ||
| 398 | if (v) { | ||
| 399 | img.style.marginLeft = v + 'px'; | ||
| 400 | img.style.marginRight = v + 'px'; | ||
| 401 | } | ||
| 402 | } | ||
| 403 | |||
| 404 | // Handle vspace | ||
| 405 | if (ty == 'vspace') { | ||
| 406 | dom.setStyle(img, 'marginTop', ''); | ||
| 407 | dom.setStyle(img, 'marginBottom', ''); | ||
| 408 | |||
| 409 | v = f.vspace.value; | ||
| 410 | if (v) { | ||
| 411 | img.style.marginTop = v + 'px'; | ||
| 412 | img.style.marginBottom = v + 'px'; | ||
| 413 | } | ||
| 414 | } | ||
| 415 | |||
| 416 | // Merge | ||
| 417 | dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText)); | ||
| 418 | } | ||
| 419 | }, | ||
| 420 | |||
| 421 | changeMouseMove : function() { | ||
| 422 | }, | ||
| 423 | |||
| 424 | showPreviewImage : function(u, st) { | ||
| 425 | if (!u) { | ||
| 426 | tinyMCEPopup.dom.setHTML('prev', ''); | ||
| 427 | return; | ||
| 428 | } | ||
| 429 | |||
| 430 | if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) | ||
| 431 | this.resetImageData(); | ||
| 432 | |||
| 433 | u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); | ||
| 434 | |||
| 435 | if (!st) | ||
| 436 | tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this);" onerror="ImageDialog.resetImageData();" />'); | ||
| 437 | else | ||
| 438 | tinyMCEPopup.dom.setHTML('prev', '<img id="previewImg" src="' + u + '" border="0" onload="ImageDialog.updateImageData(this, 1);" />'); | ||
| 439 | } | ||
| 440 | }; | ||
| 441 | |||
| 442 | ImageDialog.preInit(); | ||
| 443 | tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js deleted file mode 100644 index f493d19..0000000 --- a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.advimage_dlg',{ | ||
| 2 | tab_general:"General", | ||
| 3 | tab_appearance:"Appearance", | ||
| 4 | tab_advanced:"Advanced", | ||
| 5 | general:"General", | ||
| 6 | title:"Title", | ||
| 7 | preview:"Preview", | ||
| 8 | constrain_proportions:"Constrain proportions", | ||
| 9 | langdir:"Language direction", | ||
| 10 | langcode:"Language code", | ||
| 11 | long_desc:"Long description link", | ||
| 12 | style:"Style", | ||
| 13 | classes:"Classes", | ||
| 14 | ltr:"Left to right", | ||
| 15 | rtl:"Right to left", | ||
| 16 | id:"Id", | ||
| 17 | map:"Image map", | ||
| 18 | swap_image:"Swap image", | ||
| 19 | alt_image:"Alternative image", | ||
| 20 | mouseover:"for mouse over", | ||
| 21 | mouseout:"for mouse out", | ||
| 22 | misc:"Miscellaneous", | ||
| 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.", | ||
| 25 | dialog_title:"Insert/edit image", | ||
| 26 | src:"Image URL", | ||
| 27 | alt:"Image description", | ||
| 28 | list:"Image list", | ||
| 29 | border:"Border", | ||
| 30 | dimensions:"Dimensions", | ||
| 31 | vspace:"Vertical space", | ||
| 32 | hspace:"Horizontal space", | ||
| 33 | align:"Alignment", | ||
| 34 | align_baseline:"Baseline", | ||
| 35 | align_top:"Top", | ||
| 36 | align_middle:"Middle", | ||
| 37 | align_bottom:"Bottom", | ||
| 38 | align_texttop:"Text top", | ||
| 39 | align_textbottom:"Text bottom", | ||
| 40 | align_left:"Left", | ||
| 41 | align_right:"Right", | ||
| 42 | image_list:"Image list" | ||
| 43 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css deleted file mode 100644 index 1436431..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | .mceLinkList, .mceAnchorList, #targetlist {width:280px;} | ||
| 2 | .mceActionPanel {margin-top:7px;} | ||
| 3 | .panel_wrapper div.current {height:320px;} | ||
| 4 | #classlist, #title, #href {width:280px;} | ||
| 5 | #popupurl, #popupname {width:200px;} | ||
| 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;} | ||
| 8 | #events_panel input {width:200px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js deleted file mode 100644 index 983fe5a..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js deleted file mode 100644 index fc5325a..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | this.editor = ed; | ||
| 12 | |||
| 13 | // Register commands | ||
| 14 | ed.addCommand('mceAdvLink', function() { | ||
| 15 | var se = ed.selection; | ||
| 16 | |||
| 17 | // No selection and not in link | ||
| 18 | if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) | ||
| 19 | return; | ||
| 20 | |||
| 21 | ed.windowManager.open({ | ||
| 22 | file : url + '/link.htm', | ||
| 23 | width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), | ||
| 24 | height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), | ||
| 25 | inline : 1 | ||
| 26 | }, { | ||
| 27 | plugin_url : url | ||
| 28 | }); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Register buttons | ||
| 32 | ed.addButton('link', { | ||
| 33 | title : 'advlink.link_desc', | ||
| 34 | cmd : 'mceAdvLink' | ||
| 35 | }); | ||
| 36 | |||
| 37 | ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); | ||
| 38 | |||
| 39 | ed.onNodeChange.add(function(ed, cm, n, co) { | ||
| 40 | cm.setDisabled('link', co && n.nodeName != 'A'); | ||
| 41 | cm.setActive('link', n.nodeName == 'A' && !n.name); | ||
| 42 | }); | ||
| 43 | }, | ||
| 44 | |||
| 45 | getInfo : function() { | ||
| 46 | return { | ||
| 47 | longname : 'Advanced link', | ||
| 48 | author : 'Moxiecode Systems AB', | ||
| 49 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 50 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', | ||
| 51 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 52 | }; | ||
| 53 | } | ||
| 54 | }); | ||
| 55 | |||
| 56 | // Register plugin | ||
| 57 | tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); | ||
| 58 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js deleted file mode 100644 index bb7922a..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js +++ /dev/null | |||
| @@ -1,528 +0,0 @@ | |||
| 1 | /* Functions for the advlink plugin popup */ | ||
| 2 | |||
| 3 | tinyMCEPopup.requireLangPack(); | ||
| 4 | |||
| 5 | var templates = { | ||
| 6 | "window.open" : "window.open('${url}','${target}','${options}')" | ||
| 7 | }; | ||
| 8 | |||
| 9 | function preinit() { | ||
| 10 | var url; | ||
| 11 | |||
| 12 | if (url = tinyMCEPopup.getParam("external_link_list_url")) | ||
| 13 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 14 | } | ||
| 15 | |||
| 16 | function changeClass() { | ||
| 17 | var f = document.forms[0]; | ||
| 18 | |||
| 19 | f.classes.value = getSelectValue(f, 'classlist'); | ||
| 20 | } | ||
| 21 | |||
| 22 | function init() { | ||
| 23 | tinyMCEPopup.resizeToInnerSize(); | ||
| 24 | |||
| 25 | var formObj = document.forms[0]; | ||
| 26 | var inst = tinyMCEPopup.editor; | ||
| 27 | var elm = inst.selection.getNode(); | ||
| 28 | var action = "insert"; | ||
| 29 | var html; | ||
| 30 | |||
| 31 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); | ||
| 32 | document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); | ||
| 33 | document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href'); | ||
| 34 | document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href'); | ||
| 35 | document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); | ||
| 36 | |||
| 37 | // Link list | ||
| 38 | html = getLinkListHTML('linklisthref','href'); | ||
| 39 | if (html == "") | ||
| 40 | document.getElementById("linklisthrefrow").style.display = 'none'; | ||
| 41 | else | ||
| 42 | document.getElementById("linklisthrefcontainer").innerHTML = html; | ||
| 43 | |||
| 44 | // Resize some elements | ||
| 45 | if (isVisible('hrefbrowser')) | ||
| 46 | document.getElementById('href').style.width = '260px'; | ||
| 47 | |||
| 48 | if (isVisible('popupurlbrowser')) | ||
| 49 | document.getElementById('popupurl').style.width = '180px'; | ||
| 50 | |||
| 51 | elm = inst.dom.getParent(elm, "A"); | ||
| 52 | if (elm != null && elm.nodeName == "A") | ||
| 53 | action = "update"; | ||
| 54 | |||
| 55 | formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); | ||
| 56 | |||
| 57 | setPopupControlsDisabled(true); | ||
| 58 | |||
| 59 | if (action == "update") { | ||
| 60 | var href = inst.dom.getAttrib(elm, 'href'); | ||
| 61 | var onclick = inst.dom.getAttrib(elm, 'onclick'); | ||
| 62 | |||
| 63 | // Setup form data | ||
| 64 | setFormValue('href', href); | ||
| 65 | setFormValue('title', inst.dom.getAttrib(elm, 'title')); | ||
| 66 | setFormValue('id', inst.dom.getAttrib(elm, 'id')); | ||
| 67 | setFormValue('style', inst.dom.getAttrib(elm, "style")); | ||
| 68 | setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); | ||
| 69 | setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); | ||
| 70 | setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); | ||
| 71 | setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); | ||
| 72 | setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); | ||
| 73 | setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); | ||
| 74 | setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); | ||
| 75 | setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); | ||
| 76 | setFormValue('type', inst.dom.getAttrib(elm, 'type')); | ||
| 77 | setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); | ||
| 78 | setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); | ||
| 79 | setFormValue('onclick', onclick); | ||
| 80 | setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); | ||
| 81 | setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); | ||
| 82 | setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); | ||
| 83 | setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); | ||
| 84 | setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); | ||
| 85 | setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); | ||
| 86 | setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); | ||
| 87 | setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); | ||
| 88 | setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); | ||
| 89 | setFormValue('target', inst.dom.getAttrib(elm, 'target')); | ||
| 90 | setFormValue('classes', inst.dom.getAttrib(elm, 'class')); | ||
| 91 | |||
| 92 | // Parse onclick data | ||
| 93 | if (onclick != null && onclick.indexOf('window.open') != -1) | ||
| 94 | parseWindowOpen(onclick); | ||
| 95 | else | ||
| 96 | parseFunction(onclick); | ||
| 97 | |||
| 98 | // Select by the values | ||
| 99 | selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); | ||
| 100 | selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); | ||
| 101 | selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); | ||
| 102 | selectByValue(formObj, 'linklisthref', href); | ||
| 103 | |||
| 104 | if (href.charAt(0) == '#') | ||
| 105 | selectByValue(formObj, 'anchorlist', href); | ||
| 106 | |||
| 107 | addClassesToList('classlist', 'advlink_styles'); | ||
| 108 | |||
| 109 | selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); | ||
| 110 | selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); | ||
| 111 | } else | ||
| 112 | addClassesToList('classlist', 'advlink_styles'); | ||
| 113 | } | ||
| 114 | |||
| 115 | function checkPrefix(n) { | ||
| 116 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) | ||
| 117 | n.value = 'mailto:' + n.value; | ||
| 118 | |||
| 119 | if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) | ||
| 120 | n.value = 'http://' + n.value; | ||
| 121 | } | ||
| 122 | |||
| 123 | function setFormValue(name, value) { | ||
| 124 | document.forms[0].elements[name].value = value; | ||
| 125 | } | ||
| 126 | |||
| 127 | function parseWindowOpen(onclick) { | ||
| 128 | var formObj = document.forms[0]; | ||
| 129 | |||
| 130 | // Preprocess center code | ||
| 131 | if (onclick.indexOf('return false;') != -1) { | ||
| 132 | formObj.popupreturn.checked = true; | ||
| 133 | onclick = onclick.replace('return false;', ''); | ||
| 134 | } else | ||
| 135 | formObj.popupreturn.checked = false; | ||
| 136 | |||
| 137 | var onClickData = parseLink(onclick); | ||
| 138 | |||
| 139 | if (onClickData != null) { | ||
| 140 | formObj.ispopup.checked = true; | ||
| 141 | setPopupControlsDisabled(false); | ||
| 142 | |||
| 143 | var onClickWindowOptions = parseOptions(onClickData['options']); | ||
| 144 | var url = onClickData['url']; | ||
| 145 | |||
| 146 | formObj.popupname.value = onClickData['target']; | ||
| 147 | formObj.popupurl.value = url; | ||
| 148 | formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); | ||
| 149 | formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); | ||
| 150 | |||
| 151 | formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); | ||
| 152 | formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); | ||
| 153 | |||
| 154 | if (formObj.popupleft.value.indexOf('screen') != -1) | ||
| 155 | formObj.popupleft.value = "c"; | ||
| 156 | |||
| 157 | if (formObj.popuptop.value.indexOf('screen') != -1) | ||
| 158 | formObj.popuptop.value = "c"; | ||
| 159 | |||
| 160 | formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; | ||
| 161 | formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; | ||
| 162 | formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; | ||
| 163 | formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; | ||
| 164 | formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; | ||
| 165 | formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; | ||
| 166 | formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; | ||
| 167 | |||
| 168 | buildOnClick(); | ||
| 169 | } | ||
| 170 | } | ||
| 171 | |||
| 172 | function parseFunction(onclick) { | ||
| 173 | var formObj = document.forms[0]; | ||
| 174 | var onClickData = parseLink(onclick); | ||
| 175 | |||
| 176 | // TODO: Add stuff here | ||
| 177 | } | ||
| 178 | |||
| 179 | function getOption(opts, name) { | ||
| 180 | return typeof(opts[name]) == "undefined" ? "" : opts[name]; | ||
| 181 | } | ||
| 182 | |||
| 183 | function setPopupControlsDisabled(state) { | ||
| 184 | var formObj = document.forms[0]; | ||
| 185 | |||
| 186 | formObj.popupname.disabled = state; | ||
| 187 | formObj.popupurl.disabled = state; | ||
| 188 | formObj.popupwidth.disabled = state; | ||
| 189 | formObj.popupheight.disabled = state; | ||
| 190 | formObj.popupleft.disabled = state; | ||
| 191 | formObj.popuptop.disabled = state; | ||
| 192 | formObj.popuplocation.disabled = state; | ||
| 193 | formObj.popupscrollbars.disabled = state; | ||
| 194 | formObj.popupmenubar.disabled = state; | ||
| 195 | formObj.popupresizable.disabled = state; | ||
| 196 | formObj.popuptoolbar.disabled = state; | ||
| 197 | formObj.popupstatus.disabled = state; | ||
| 198 | formObj.popupreturn.disabled = state; | ||
| 199 | formObj.popupdependent.disabled = state; | ||
| 200 | |||
| 201 | setBrowserDisabled('popupurlbrowser', state); | ||
| 202 | } | ||
| 203 | |||
| 204 | function parseLink(link) { | ||
| 205 | link = link.replace(new RegExp(''', 'g'), "'"); | ||
| 206 | |||
| 207 | var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); | ||
| 208 | |||
| 209 | // Is function name a template function | ||
| 210 | var template = templates[fnName]; | ||
| 211 | if (template) { | ||
| 212 | // Build regexp | ||
| 213 | var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); | ||
| 214 | var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; | ||
| 215 | var replaceStr = ""; | ||
| 216 | for (var i=0; i<variableNames.length; i++) { | ||
| 217 | // Is string value | ||
| 218 | if (variableNames[i].indexOf("'${") != -1) | ||
| 219 | regExp += "'(.*)'"; | ||
| 220 | else // Number value | ||
| 221 | regExp += "([0-9]*)"; | ||
| 222 | |||
| 223 | replaceStr += "$" + (i+1); | ||
| 224 | |||
| 225 | // Cleanup variable name | ||
| 226 | variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), ""); | ||
| 227 | |||
| 228 | if (i != variableNames.length-1) { | ||
| 229 | regExp += "\\s*,\\s*"; | ||
| 230 | replaceStr += "<delim>"; | ||
| 231 | } else | ||
| 232 | regExp += ".*"; | ||
| 233 | } | ||
| 234 | |||
| 235 | regExp += "\\);?"; | ||
| 236 | |||
| 237 | // Build variable array | ||
| 238 | var variables = []; | ||
| 239 | variables["_function"] = fnName; | ||
| 240 | var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>'); | ||
| 241 | for (var i=0; i<variableNames.length; i++) | ||
| 242 | variables[variableNames[i]] = variableValues[i]; | ||
| 243 | |||
| 244 | return variables; | ||
| 245 | } | ||
| 246 | |||
| 247 | return null; | ||
| 248 | } | ||
| 249 | |||
| 250 | function parseOptions(opts) { | ||
| 251 | if (opts == null || opts == "") | ||
| 252 | return []; | ||
| 253 | |||
| 254 | // Cleanup the options | ||
| 255 | opts = opts.toLowerCase(); | ||
| 256 | opts = opts.replace(/;/g, ","); | ||
| 257 | opts = opts.replace(/[^0-9a-z=,]/g, ""); | ||
| 258 | |||
| 259 | var optionChunks = opts.split(','); | ||
| 260 | var options = []; | ||
| 261 | |||
| 262 | for (var i=0; i<optionChunks.length; i++) { | ||
| 263 | var parts = optionChunks[i].split('='); | ||
| 264 | |||
| 265 | if (parts.length == 2) | ||
| 266 | options[parts[0]] = parts[1]; | ||
| 267 | } | ||
| 268 | |||
| 269 | return options; | ||
| 270 | } | ||
| 271 | |||
| 272 | function buildOnClick() { | ||
| 273 | var formObj = document.forms[0]; | ||
| 274 | |||
| 275 | if (!formObj.ispopup.checked) { | ||
| 276 | formObj.onclick.value = ""; | ||
| 277 | return; | ||
| 278 | } | ||
| 279 | |||
| 280 | var onclick = "window.open('"; | ||
| 281 | var url = formObj.popupurl.value; | ||
| 282 | |||
| 283 | onclick += url + "','"; | ||
| 284 | onclick += formObj.popupname.value + "','"; | ||
| 285 | |||
| 286 | if (formObj.popuplocation.checked) | ||
| 287 | onclick += "location=yes,"; | ||
| 288 | |||
| 289 | if (formObj.popupscrollbars.checked) | ||
| 290 | onclick += "scrollbars=yes,"; | ||
| 291 | |||
| 292 | if (formObj.popupmenubar.checked) | ||
| 293 | onclick += "menubar=yes,"; | ||
| 294 | |||
| 295 | if (formObj.popupresizable.checked) | ||
| 296 | onclick += "resizable=yes,"; | ||
| 297 | |||
| 298 | if (formObj.popuptoolbar.checked) | ||
| 299 | onclick += "toolbar=yes,"; | ||
| 300 | |||
| 301 | if (formObj.popupstatus.checked) | ||
| 302 | onclick += "status=yes,"; | ||
| 303 | |||
| 304 | if (formObj.popupdependent.checked) | ||
| 305 | onclick += "dependent=yes,"; | ||
| 306 | |||
| 307 | if (formObj.popupwidth.value != "") | ||
| 308 | onclick += "width=" + formObj.popupwidth.value + ","; | ||
| 309 | |||
| 310 | if (formObj.popupheight.value != "") | ||
| 311 | onclick += "height=" + formObj.popupheight.value + ","; | ||
| 312 | |||
| 313 | if (formObj.popupleft.value != "") { | ||
| 314 | if (formObj.popupleft.value != "c") | ||
| 315 | onclick += "left=" + formObj.popupleft.value + ","; | ||
| 316 | else | ||
| 317 | onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',"; | ||
| 318 | } | ||
| 319 | |||
| 320 | if (formObj.popuptop.value != "") { | ||
| 321 | if (formObj.popuptop.value != "c") | ||
| 322 | onclick += "top=" + formObj.popuptop.value + ","; | ||
| 323 | else | ||
| 324 | onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',"; | ||
| 325 | } | ||
| 326 | |||
| 327 | if (onclick.charAt(onclick.length-1) == ',') | ||
| 328 | onclick = onclick.substring(0, onclick.length-1); | ||
| 329 | |||
| 330 | onclick += "');"; | ||
| 331 | |||
| 332 | if (formObj.popupreturn.checked) | ||
| 333 | onclick += "return false;"; | ||
| 334 | |||
| 335 | // tinyMCE.debug(onclick); | ||
| 336 | |||
| 337 | formObj.onclick.value = onclick; | ||
| 338 | |||
| 339 | if (formObj.href.value == "") | ||
| 340 | formObj.href.value = url; | ||
| 341 | } | ||
| 342 | |||
| 343 | function setAttrib(elm, attrib, value) { | ||
| 344 | var formObj = document.forms[0]; | ||
| 345 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 346 | var dom = tinyMCEPopup.editor.dom; | ||
| 347 | |||
| 348 | if (typeof(value) == "undefined" || value == null) { | ||
| 349 | value = ""; | ||
| 350 | |||
| 351 | if (valueElm) | ||
| 352 | value = valueElm.value; | ||
| 353 | } | ||
| 354 | |||
| 355 | // Clean up the style | ||
| 356 | if (attrib == 'style') | ||
| 357 | value = dom.serializeStyle(dom.parseStyle(value)); | ||
| 358 | |||
| 359 | dom.setAttrib(elm, attrib, value); | ||
| 360 | } | ||
| 361 | |||
| 362 | function getAnchorListHTML(id, target) { | ||
| 363 | var inst = tinyMCEPopup.editor; | ||
| 364 | var nodes = inst.dom.select('a.mceItemAnchor,img.mceItemAnchor'), name, i; | ||
| 365 | var html = ""; | ||
| 366 | |||
| 367 | html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" o2nfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value='; | ||
| 368 | html += 'this.options[this.selectedIndex].value;">'; | ||
| 369 | html += '<option value="">---</option>'; | ||
| 370 | |||
| 371 | for (i=0; i<nodes.length; i++) { | ||
| 372 | if ((name = inst.dom.getAttrib(nodes[i], "name")) != "") | ||
| 373 | html += '<option value="#' + name + '">' + name + '</option>'; | ||
| 374 | } | ||
| 375 | |||
| 376 | html += '</select>'; | ||
| 377 | |||
| 378 | return html; | ||
| 379 | } | ||
| 380 | |||
| 381 | function insertAction() { | ||
| 382 | var inst = tinyMCEPopup.editor; | ||
| 383 | var elm, elementArray, i; | ||
| 384 | |||
| 385 | elm = inst.selection.getNode(); | ||
| 386 | checkPrefix(document.forms[0].href); | ||
| 387 | |||
| 388 | elm = inst.dom.getParent(elm, "A"); | ||
| 389 | |||
| 390 | // Remove element if there is no href | ||
| 391 | if (!document.forms[0].href.value) { | ||
| 392 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 393 | i = inst.selection.getBookmark(); | ||
| 394 | inst.dom.remove(elm, 1); | ||
| 395 | inst.selection.moveToBookmark(i); | ||
| 396 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 397 | tinyMCEPopup.close(); | ||
| 398 | return; | ||
| 399 | } | ||
| 400 | |||
| 401 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 402 | |||
| 403 | // Create new anchor elements | ||
| 404 | if (elm == null) { | ||
| 405 | inst.getDoc().execCommand("unlink", false, null); | ||
| 406 | tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); | ||
| 407 | |||
| 408 | elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); | ||
| 409 | for (i=0; i<elementArray.length; i++) | ||
| 410 | setAllAttribs(elm = elementArray[i]); | ||
| 411 | } else | ||
| 412 | setAllAttribs(elm); | ||
| 413 | |||
| 414 | // Don't move caret if selection was image | ||
| 415 | if (elm.childNodes.length != 1 || elm.firstChild.nodeName != 'IMG') { | ||
| 416 | inst.focus(); | ||
| 417 | inst.selection.select(elm); | ||
| 418 | inst.selection.collapse(0); | ||
| 419 | tinyMCEPopup.storeSelection(); | ||
| 420 | } | ||
| 421 | |||
| 422 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 423 | tinyMCEPopup.close(); | ||
| 424 | } | ||
| 425 | |||
| 426 | function setAllAttribs(elm) { | ||
| 427 | var formObj = document.forms[0]; | ||
| 428 | var href = formObj.href.value; | ||
| 429 | var target = getSelectValue(formObj, 'targetlist'); | ||
| 430 | |||
| 431 | setAttrib(elm, 'href', href); | ||
| 432 | setAttrib(elm, 'title'); | ||
| 433 | setAttrib(elm, 'target', target == '_self' ? '' : target); | ||
| 434 | setAttrib(elm, 'id'); | ||
| 435 | setAttrib(elm, 'style'); | ||
| 436 | setAttrib(elm, 'class', getSelectValue(formObj, 'classlist')); | ||
| 437 | setAttrib(elm, 'rel'); | ||
| 438 | setAttrib(elm, 'rev'); | ||
| 439 | setAttrib(elm, 'charset'); | ||
| 440 | setAttrib(elm, 'hreflang'); | ||
| 441 | setAttrib(elm, 'dir'); | ||
| 442 | setAttrib(elm, 'lang'); | ||
| 443 | setAttrib(elm, 'tabindex'); | ||
| 444 | setAttrib(elm, 'accesskey'); | ||
| 445 | setAttrib(elm, 'type'); | ||
| 446 | setAttrib(elm, 'onfocus'); | ||
| 447 | setAttrib(elm, 'onblur'); | ||
| 448 | setAttrib(elm, 'onclick'); | ||
| 449 | setAttrib(elm, 'ondblclick'); | ||
| 450 | setAttrib(elm, 'onmousedown'); | ||
| 451 | setAttrib(elm, 'onmouseup'); | ||
| 452 | setAttrib(elm, 'onmouseover'); | ||
| 453 | setAttrib(elm, 'onmousemove'); | ||
| 454 | setAttrib(elm, 'onmouseout'); | ||
| 455 | setAttrib(elm, 'onkeypress'); | ||
| 456 | setAttrib(elm, 'onkeydown'); | ||
| 457 | setAttrib(elm, 'onkeyup'); | ||
| 458 | |||
| 459 | // Refresh in old MSIE | ||
| 460 | if (tinyMCE.isMSIE5) | ||
| 461 | elm.outerHTML = elm.outerHTML; | ||
| 462 | } | ||
| 463 | |||
| 464 | function getSelectValue(form_obj, field_name) { | ||
| 465 | var elm = form_obj.elements[field_name]; | ||
| 466 | |||
| 467 | if (!elm || elm.options == null || elm.selectedIndex == -1) | ||
| 468 | return ""; | ||
| 469 | |||
| 470 | return elm.options[elm.selectedIndex].value; | ||
| 471 | } | ||
| 472 | |||
| 473 | function getLinkListHTML(elm_id, target_form_element, onchange_func) { | ||
| 474 | if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0) | ||
| 475 | return ""; | ||
| 476 | |||
| 477 | var html = ""; | ||
| 478 | |||
| 479 | html += '<select id="' + elm_id + '" name="' + elm_id + '"'; | ||
| 480 | html += ' class="mceLinkList" onfoc2us="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; | ||
| 481 | html += 'this.options[this.selectedIndex].value;'; | ||
| 482 | |||
| 483 | if (typeof(onchange_func) != "undefined") | ||
| 484 | html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);'; | ||
| 485 | |||
| 486 | html += '"><option value="">---</option>'; | ||
| 487 | |||
| 488 | for (var i=0; i<tinyMCELinkList.length; i++) | ||
| 489 | html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>'; | ||
| 490 | |||
| 491 | html += '</select>'; | ||
| 492 | |||
| 493 | return html; | ||
| 494 | |||
| 495 | // tinyMCE.debug('-- image list start --', html, '-- image list end --'); | ||
| 496 | } | ||
| 497 | |||
| 498 | function getTargetListHTML(elm_id, target_form_element) { | ||
| 499 | var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); | ||
| 500 | var html = ''; | ||
| 501 | |||
| 502 | html += '<select id="' + elm_id + '" name="' + elm_id + '" onf2ocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value='; | ||
| 503 | html += 'this.options[this.selectedIndex].value;">'; | ||
| 504 | html += '<option value="_self">' + tinyMCEPopup.getLang('advlink_dlg.target_same') + '</option>'; | ||
| 505 | html += '<option value="_blank">' + tinyMCEPopup.getLang('advlink_dlg.target_blank') + ' (_blank)</option>'; | ||
| 506 | html += '<option value="_parent">' + tinyMCEPopup.getLang('advlink_dlg.target_parent') + ' (_parent)</option>'; | ||
| 507 | html += '<option value="_top">' + tinyMCEPopup.getLang('advlink_dlg.target_top') + ' (_top)</option>'; | ||
| 508 | |||
| 509 | for (var i=0; i<targets.length; i++) { | ||
| 510 | var key, value; | ||
| 511 | |||
| 512 | if (targets[i] == "") | ||
| 513 | continue; | ||
| 514 | |||
| 515 | key = targets[i].split('=')[0]; | ||
| 516 | value = targets[i].split('=')[1]; | ||
| 517 | |||
| 518 | html += '<option value="' + key + '">' + value + ' (' + key + ')</option>'; | ||
| 519 | } | ||
| 520 | |||
| 521 | html += '</select>'; | ||
| 522 | |||
| 523 | return html; | ||
| 524 | } | ||
| 525 | |||
| 526 | // While loading | ||
| 527 | preinit(); | ||
| 528 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js deleted file mode 100644 index c71ffbd..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.advlink_dlg',{ | ||
| 2 | title:"Insert/edit link", | ||
| 3 | url:"Link URL", | ||
| 4 | target:"Target", | ||
| 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?", | ||
| 7 | is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", | ||
| 8 | list:"Link list", | ||
| 9 | general_tab:"General", | ||
| 10 | popup_tab:"Popup", | ||
| 11 | events_tab:"Events", | ||
| 12 | advanced_tab:"Advanced", | ||
| 13 | general_props:"General properties", | ||
| 14 | popup_props:"Popup properties", | ||
| 15 | event_props:"Events", | ||
| 16 | advanced_props:"Advanced properties", | ||
| 17 | popup_opts:"Options", | ||
| 18 | anchor_names:"Anchors", | ||
| 19 | target_same:"Open in this window / frame", | ||
| 20 | target_parent:"Open in parent window / frame", | ||
| 21 | target_top:"Open in top frame (replaces all frames)", | ||
| 22 | target_blank:"Open in new window", | ||
| 23 | popup:"Javascript popup", | ||
| 24 | popup_url:"Popup URL", | ||
| 25 | popup_name:"Window name", | ||
| 26 | popup_return:"Insert 'return false'", | ||
| 27 | popup_scrollbars:"Show scrollbars", | ||
| 28 | popup_statusbar:"Show status bar", | ||
| 29 | popup_toolbar:"Show toolbars", | ||
| 30 | popup_menubar:"Show menu bar", | ||
| 31 | popup_location:"Show location bar", | ||
| 32 | popup_resizable:"Make window resizable", | ||
| 33 | popup_dependent:"Dependent (Mozilla/Firefox only)", | ||
| 34 | popup_size:"Size", | ||
| 35 | popup_position:"Position (X/Y)", | ||
| 36 | id:"Id", | ||
| 37 | style:"Style", | ||
| 38 | classes:"Classes", | ||
| 39 | target_name:"Target name", | ||
| 40 | langdir:"Language direction", | ||
| 41 | target_langcode:"Target language", | ||
| 42 | langcode:"Language code", | ||
| 43 | encoding:"Target character encoding", | ||
| 44 | mime:"Target MIME type", | ||
| 45 | rel:"Relationship page to target", | ||
| 46 | rev:"Relationship target to page", | ||
| 47 | tabindex:"Tabindex", | ||
| 48 | accesskey:"Accesskey", | ||
| 49 | ltr:"Left to right", | ||
| 50 | rtl:"Right to left", | ||
| 51 | link_list:"Link list" | ||
| 52 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/advlink/link.htm b/public/javascripts/tiny_mce/plugins/advlink/link.htm deleted file mode 100644 index cc8b0b8..0000000 --- a/public/javascripts/tiny_mce/plugins/advlink/link.htm +++ /dev/null | |||
| @@ -1,338 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advlink_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="js/advlink.js"></script> | ||
| 10 | <link href="css/advlink.css" rel="stylesheet" type="text/css" /> | ||
| 11 | </head> | ||
| 12 | <body id="advlink" style="display: none"> | ||
| 13 | <form onsubmit="insertAction();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advlink_dlg.general_tab}</a></span></li> | ||
| 17 | <li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{#advlink_dlg.popup_tab}</a></span></li> | ||
| 18 | <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#advlink_dlg.events_tab}</a></span></li> | ||
| 19 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#advlink_dlg.advanced_tab}</a></span></li> | ||
| 20 | </ul> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div class="panel_wrapper"> | ||
| 24 | <div id="general_panel" class="panel current"> | ||
| 25 | <fieldset> | ||
| 26 | <legend>{#advlink_dlg.general_props}</legend> | ||
| 27 | |||
| 28 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 29 | <tr> | ||
| 30 | <td class="nowrap"><label id="hreflabel" for="href">{#advlink_dlg.url}</label></td> | ||
| 31 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 32 | <tr> | ||
| 33 | <td><input id="href" name="href" type="text" class="mceFocus" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td> | ||
| 34 | <td id="hrefbrowsercontainer"> </td> | ||
| 35 | </tr> | ||
| 36 | </table></td> | ||
| 37 | </tr> | ||
| 38 | <tr id="linklisthrefrow"> | ||
| 39 | <td class="column1"><label for="linklisthref">{#advlink_dlg.list}</label></td> | ||
| 40 | <td colspan="2" id="linklisthrefcontainer"><select id="linklisthref"><option value=""></option></select></td> | ||
| 41 | </tr> | ||
| 42 | <tr> | ||
| 43 | <td class="column1"><label for="anchorlist">{#advlink_dlg.anchor_names}</label></td> | ||
| 44 | <td colspan="2" id="anchorlistcontainer"><select id="anchorlist"><option value=""></option></select></td> | ||
| 45 | </tr> | ||
| 46 | <tr> | ||
| 47 | <td><label id="targetlistlabel" for="targetlist">{#advlink_dlg.target}</label></td> | ||
| 48 | <td id="targetlistcontainer"><select id="targetlist"><option value=""></option></select></td> | ||
| 49 | </tr> | ||
| 50 | <tr> | ||
| 51 | <td class="nowrap"><label id="titlelabel" for="title">{#advlink_dlg.titlefield}</label></td> | ||
| 52 | <td><input id="title" name="title" type="text" value="" /></td> | ||
| 53 | </tr> | ||
| 54 | <tr> | ||
| 55 | <td><label id="classlabel" for="classlist">{#class_name}</label></td> | ||
| 56 | <td> | ||
| 57 | <select id="classlist" name="classlist" onchange="changeClass();"> | ||
| 58 | <option value="" selected="selected">{#not_set}</option> | ||
| 59 | </select> | ||
| 60 | </td> | ||
| 61 | </tr> | ||
| 62 | </table> | ||
| 63 | </fieldset> | ||
| 64 | </div> | ||
| 65 | |||
| 66 | <div id="popup_panel" class="panel"> | ||
| 67 | <fieldset> | ||
| 68 | <legend>{#advlink_dlg.popup_props}</legend> | ||
| 69 | |||
| 70 | <input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" /> | ||
| 71 | <label id="ispopuplabel" for="ispopup">{#advlink_dlg.popup}</label> | ||
| 72 | |||
| 73 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 74 | <tr> | ||
| 75 | <td class="nowrap"><label for="popupurl">{#advlink_dlg.popup_url}</label> </td> | ||
| 76 | <td> | ||
| 77 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 78 | <tr> | ||
| 79 | <td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td> | ||
| 80 | <td id="popupurlbrowsercontainer"> </td> | ||
| 81 | </tr> | ||
| 82 | </table> | ||
| 83 | </td> | ||
| 84 | </tr> | ||
| 85 | <tr> | ||
| 86 | <td class="nowrap"><label for="popupname">{#advlink_dlg.popup_name}</label> </td> | ||
| 87 | <td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td> | ||
| 88 | </tr> | ||
| 89 | <tr> | ||
| 90 | <td class="nowrap"><label>{#advlink_dlg.popup_size}</label> </td> | ||
| 91 | <td class="nowrap"> | ||
| 92 | <input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x | ||
| 93 | <input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px | ||
| 94 | </td> | ||
| 95 | </tr> | ||
| 96 | <tr> | ||
| 97 | <td class="nowrap" id="labelleft"><label>{#advlink_dlg.popup_position}</label> </td> | ||
| 98 | <td class="nowrap"> | ||
| 99 | <input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> / | ||
| 100 | <input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center) | ||
| 101 | </td> | ||
| 102 | </tr> | ||
| 103 | </table> | ||
| 104 | |||
| 105 | <fieldset> | ||
| 106 | <legend>{#advlink_dlg.popup_opts}</legend> | ||
| 107 | |||
| 108 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 109 | <tr> | ||
| 110 | <td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 111 | <td class="nowrap"><label id="popuplocationlabel" for="popuplocation">{#advlink_dlg.popup_location}</label></td> | ||
| 112 | <td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 113 | <td class="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{#advlink_dlg.popup_scrollbars}</label></td> | ||
| 114 | </tr> | ||
| 115 | <tr> | ||
| 116 | <td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 117 | <td class="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{#advlink_dlg.popup_menubar}</label></td> | ||
| 118 | <td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 119 | <td class="nowrap"><label id="popupresizablelabel" for="popupresizable">{#advlink_dlg.popup_resizable}</label></td> | ||
| 120 | </tr> | ||
| 121 | <tr> | ||
| 122 | <td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 123 | <td class="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{#advlink_dlg.popup_toolbar}</label></td> | ||
| 124 | <td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 125 | <td class="nowrap"><label id="popupdependentlabel" for="popupdependent">{#advlink_dlg.popup_dependent}</label></td> | ||
| 126 | </tr> | ||
| 127 | <tr> | ||
| 128 | <td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td> | ||
| 129 | <td class="nowrap"><label id="popupstatuslabel" for="popupstatus">{#advlink_dlg.popup_statusbar}</label></td> | ||
| 130 | <td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td> | ||
| 131 | <td class="nowrap"><label id="popupreturnlabel" for="popupreturn">{#advlink_dlg.popup_return}</label></td> | ||
| 132 | </tr> | ||
| 133 | </table> | ||
| 134 | </fieldset> | ||
| 135 | </fieldset> | ||
| 136 | </div> | ||
| 137 | |||
| 138 | <div id="advanced_panel" class="panel"> | ||
| 139 | <fieldset> | ||
| 140 | <legend>{#advlink_dlg.advanced_props}</legend> | ||
| 141 | |||
| 142 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 143 | <tr> | ||
| 144 | <td class="column1"><label id="idlabel" for="id">{#advlink_dlg.id}</label></td> | ||
| 145 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 146 | </tr> | ||
| 147 | |||
| 148 | <tr> | ||
| 149 | <td><label id="stylelabel" for="style">{#advlink_dlg.style}</label></td> | ||
| 150 | <td><input type="text" id="style" name="style" value="" /></td> | ||
| 151 | </tr> | ||
| 152 | |||
| 153 | <tr> | ||
| 154 | <td><label id="classeslabel" for="classes">{#advlink_dlg.classes}</label></td> | ||
| 155 | <td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> | ||
| 156 | </tr> | ||
| 157 | |||
| 158 | <tr> | ||
| 159 | <td><label id="targetlabel" for="target">{#advlink_dlg.target_name}</label></td> | ||
| 160 | <td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td> | ||
| 161 | </tr> | ||
| 162 | |||
| 163 | <tr> | ||
| 164 | <td class="column1"><label id="dirlabel" for="dir">{#advlink_dlg.langdir}</label></td> | ||
| 165 | <td> | ||
| 166 | <select id="dir" name="dir"> | ||
| 167 | <option value="">{#not_set}</option> | ||
| 168 | <option value="ltr">{#advlink_dlg.ltr}</option> | ||
| 169 | <option value="rtl">{#advlink_dlg.rtl}</option> | ||
| 170 | </select> | ||
| 171 | </td> | ||
| 172 | </tr> | ||
| 173 | |||
| 174 | <tr> | ||
| 175 | <td><label id="hreflanglabel" for="hreflang">{#advlink_dlg.target_langcode}</label></td> | ||
| 176 | <td><input type="text" id="hreflang" name="hreflang" value="" /></td> | ||
| 177 | </tr> | ||
| 178 | |||
| 179 | <tr> | ||
| 180 | <td class="column1"><label id="langlabel" for="lang">{#advlink_dlg.langcode}</label></td> | ||
| 181 | <td> | ||
| 182 | <input id="lang" name="lang" type="text" value="" /> | ||
| 183 | </td> | ||
| 184 | </tr> | ||
| 185 | |||
| 186 | <tr> | ||
| 187 | <td><label id="charsetlabel" for="charset">{#advlink_dlg.encoding}</label></td> | ||
| 188 | <td><input type="text" id="charset" name="charset" value="" /></td> | ||
| 189 | </tr> | ||
| 190 | |||
| 191 | <tr> | ||
| 192 | <td><label id="typelabel" for="type">{#advlink_dlg.mime}</label></td> | ||
| 193 | <td><input type="text" id="type" name="type" value="" /></td> | ||
| 194 | </tr> | ||
| 195 | |||
| 196 | <tr> | ||
| 197 | <td><label id="rellabel" for="rel">{#advlink_dlg.rel}</label></td> | ||
| 198 | <td><select id="rel" name="rel"> | ||
| 199 | <option value="">{#not_set}</option> | ||
| 200 | <option value="lightbox">Lightbox</option> | ||
| 201 | <option value="alternate">Alternate</option> | ||
| 202 | <option value="designates">Designates</option> | ||
| 203 | <option value="stylesheet">Stylesheet</option> | ||
| 204 | <option value="start">Start</option> | ||
| 205 | <option value="next">Next</option> | ||
| 206 | <option value="prev">Prev</option> | ||
| 207 | <option value="contents">Contents</option> | ||
| 208 | <option value="index">Index</option> | ||
| 209 | <option value="glossary">Glossary</option> | ||
| 210 | <option value="copyright">Copyright</option> | ||
| 211 | <option value="chapter">Chapter</option> | ||
| 212 | <option value="subsection">Subsection</option> | ||
| 213 | <option value="appendix">Appendix</option> | ||
| 214 | <option value="help">Help</option> | ||
| 215 | <option value="bookmark">Bookmark</option> | ||
| 216 | <option value="nofollow">No Follow</option> | ||
| 217 | <option value="tag">Tag</option> | ||
| 218 | </select> | ||
| 219 | </td> | ||
| 220 | </tr> | ||
| 221 | |||
| 222 | <tr> | ||
| 223 | <td><label id="revlabel" for="rev">{#advlink_dlg.rev}</label></td> | ||
| 224 | <td><select id="rev" name="rev"> | ||
| 225 | <option value="">{#not_set}</option> | ||
| 226 | <option value="alternate">Alternate</option> | ||
| 227 | <option value="designates">Designates</option> | ||
| 228 | <option value="stylesheet">Stylesheet</option> | ||
| 229 | <option value="start">Start</option> | ||
| 230 | <option value="next">Next</option> | ||
| 231 | <option value="prev">Prev</option> | ||
| 232 | <option value="contents">Contents</option> | ||
| 233 | <option value="index">Index</option> | ||
| 234 | <option value="glossary">Glossary</option> | ||
| 235 | <option value="copyright">Copyright</option> | ||
| 236 | <option value="chapter">Chapter</option> | ||
| 237 | <option value="subsection">Subsection</option> | ||
| 238 | <option value="appendix">Appendix</option> | ||
| 239 | <option value="help">Help</option> | ||
| 240 | <option value="bookmark">Bookmark</option> | ||
| 241 | </select> | ||
| 242 | </td> | ||
| 243 | </tr> | ||
| 244 | |||
| 245 | <tr> | ||
| 246 | <td><label id="tabindexlabel" for="tabindex">{#advlink_dlg.tabindex}</label></td> | ||
| 247 | <td><input type="text" id="tabindex" name="tabindex" value="" /></td> | ||
| 248 | </tr> | ||
| 249 | |||
| 250 | <tr> | ||
| 251 | <td><label id="accesskeylabel" for="accesskey">{#advlink_dlg.accesskey}</label></td> | ||
| 252 | <td><input type="text" id="accesskey" name="accesskey" value="" /></td> | ||
| 253 | </tr> | ||
| 254 | </table> | ||
| 255 | </fieldset> | ||
| 256 | </div> | ||
| 257 | |||
| 258 | <div id="events_panel" class="panel"> | ||
| 259 | <fieldset> | ||
| 260 | <legend>{#advlink_dlg.event_props}</legend> | ||
| 261 | |||
| 262 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 263 | <tr> | ||
| 264 | <td class="column1"><label for="onfocus">onfocus</label></td> | ||
| 265 | <td><input id="onfocus" name="onfocus" type="text" value="" /></td> | ||
| 266 | </tr> | ||
| 267 | |||
| 268 | <tr> | ||
| 269 | <td class="column1"><label for="onblur">onblur</label></td> | ||
| 270 | <td><input id="onblur" name="onblur" type="text" value="" /></td> | ||
| 271 | </tr> | ||
| 272 | |||
| 273 | <tr> | ||
| 274 | <td class="column1"><label for="onclick">onclick</label></td> | ||
| 275 | <td><input id="onclick" name="onclick" type="text" value="" /></td> | ||
| 276 | </tr> | ||
| 277 | |||
| 278 | <tr> | ||
| 279 | <td class="column1"><label for="ondblclick">ondblclick</label></td> | ||
| 280 | <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> | ||
| 281 | </tr> | ||
| 282 | |||
| 283 | <tr> | ||
| 284 | <td class="column1"><label for="onmousedown">onmousedown</label></td> | ||
| 285 | <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> | ||
| 286 | </tr> | ||
| 287 | |||
| 288 | <tr> | ||
| 289 | <td class="column1"><label for="onmouseup">onmouseup</label></td> | ||
| 290 | <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> | ||
| 291 | </tr> | ||
| 292 | |||
| 293 | <tr> | ||
| 294 | <td class="column1"><label for="onmouseover">onmouseover</label></td> | ||
| 295 | <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> | ||
| 296 | </tr> | ||
| 297 | |||
| 298 | <tr> | ||
| 299 | <td class="column1"><label for="onmousemove">onmousemove</label></td> | ||
| 300 | <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> | ||
| 301 | </tr> | ||
| 302 | |||
| 303 | <tr> | ||
| 304 | <td class="column1"><label for="onmouseout">onmouseout</label></td> | ||
| 305 | <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> | ||
| 306 | </tr> | ||
| 307 | |||
| 308 | <tr> | ||
| 309 | <td class="column1"><label for="onkeypress">onkeypress</label></td> | ||
| 310 | <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> | ||
| 311 | </tr> | ||
| 312 | |||
| 313 | <tr> | ||
| 314 | <td class="column1"><label for="onkeydown">onkeydown</label></td> | ||
| 315 | <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> | ||
| 316 | </tr> | ||
| 317 | |||
| 318 | <tr> | ||
| 319 | <td class="column1"><label for="onkeyup">onkeyup</label></td> | ||
| 320 | <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> | ||
| 321 | </tr> | ||
| 322 | </table> | ||
| 323 | </fieldset> | ||
| 324 | </div> | ||
| 325 | </div> | ||
| 326 | |||
| 327 | <div class="mceActionPanel"> | ||
| 328 | <div style="float: left"> | ||
| 329 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 330 | </div> | ||
| 331 | |||
| 332 | <div style="float: right"> | ||
| 333 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 334 | </div> | ||
| 335 | </div> | ||
| 336 | </form> | ||
| 337 | </body> | ||
| 338 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js deleted file mode 100644 index 220b84a..0000000 --- a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js deleted file mode 100644 index 8b2f374..0000000 --- a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,114 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | /** | ||
| 10 | * Auto Resize | ||
| 11 | * | ||
| 12 | * This plugin automatically resizes the content area to fit its content height. | ||
| 13 | * It will retain a minimum height, which is the height of the content area when | ||
| 14 | * it's initialized. | ||
| 15 | */ | ||
| 16 | tinymce.create('tinymce.plugins.AutoResizePlugin', { | ||
| 17 | /** | ||
| 18 | * Initializes the plugin, this will be executed after the plugin has been created. | ||
| 19 | * This call is done before the editor instance has finished it's initialization so use the onInit event | ||
| 20 | * of the editor instance to intercept that event. | ||
| 21 | * | ||
| 22 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | ||
| 23 | * @param {string} url Absolute URL to where the plugin is located. | ||
| 24 | */ | ||
| 25 | init : function(ed, url) { | ||
| 26 | var t = this; | ||
| 27 | |||
| 28 | if (ed.getParam('fullscreen_is_enabled')) | ||
| 29 | return; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * This method gets executed each time the editor needs to resize. | ||
| 33 | */ | ||
| 34 | function resize() { | ||
| 35 | var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; | ||
| 36 | |||
| 37 | // Get height differently depending on the browser used | ||
| 38 | myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight; | ||
| 39 | |||
| 40 | // Don't make it smaller than the minimum height | ||
| 41 | if (myHeight > t.autoresize_min_height) | ||
| 42 | resizeHeight = myHeight; | ||
| 43 | |||
| 44 | // Resize content element | ||
| 45 | DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); | ||
| 46 | |||
| 47 | // if we're throbbing, we'll re-throb to match the new size | ||
| 48 | if (t.throbbing) { | ||
| 49 | ed.setProgressState(false); | ||
| 50 | ed.setProgressState(true); | ||
| 51 | } | ||
| 52 | }; | ||
| 53 | |||
| 54 | t.editor = ed; | ||
| 55 | |||
| 56 | // Define minimum height | ||
| 57 | t.autoresize_min_height = ed.getElement().offsetHeight; | ||
| 58 | |||
| 59 | // Things to do when the editor is ready | ||
| 60 | ed.onInit.add(function(ed, l) { | ||
| 61 | // Show throbber until content area is resized properly | ||
| 62 | ed.setProgressState(true); | ||
| 63 | t.throbbing = true; | ||
| 64 | |||
| 65 | // Hide scrollbars | ||
| 66 | ed.getBody().style.overflowY = "hidden"; | ||
| 67 | }); | ||
| 68 | |||
| 69 | // Add appropriate listeners for resizing content area | ||
| 70 | ed.onChange.add(resize); | ||
| 71 | ed.onSetContent.add(resize); | ||
| 72 | ed.onPaste.add(resize); | ||
| 73 | ed.onKeyUp.add(resize); | ||
| 74 | ed.onPostRender.add(resize); | ||
| 75 | |||
| 76 | ed.onLoadContent.add(function(ed, l) { | ||
| 77 | resize(); | ||
| 78 | |||
| 79 | // Because the content area resizes when its content CSS loads, | ||
| 80 | // and we can't easily add a listener to its onload event, | ||
| 81 | // we'll just trigger a resize after a short loading period | ||
| 82 | setTimeout(function() { | ||
| 83 | resize(); | ||
| 84 | |||
| 85 | // Disable throbber | ||
| 86 | ed.setProgressState(false); | ||
| 87 | t.throbbing = false; | ||
| 88 | }, 1250); | ||
| 89 | }); | ||
| 90 | |||
| 91 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | ||
| 92 | ed.addCommand('mceAutoResize', resize); | ||
| 93 | }, | ||
| 94 | |||
| 95 | /** | ||
| 96 | * Returns information about the plugin as a name/value array. | ||
| 97 | * The current keys are longname, author, authorurl, infourl and version. | ||
| 98 | * | ||
| 99 | * @return {Object} Name/value array containing information about the plugin. | ||
| 100 | */ | ||
| 101 | getInfo : function() { | ||
| 102 | return { | ||
| 103 | longname : 'Auto Resize', | ||
| 104 | author : 'Moxiecode Systems AB', | ||
| 105 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 106 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', | ||
| 107 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 108 | }; | ||
| 109 | } | ||
| 110 | }); | ||
| 111 | |||
| 112 | // Register plugin | ||
| 113 | tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); | ||
| 114 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js deleted file mode 100644 index 091a063..0000000 --- a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.AutoSavePlugin",{init:function(a,b){var c=this;c.editor=a;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:tinymce.majorVersion+"."+tinymce.minorVersion}},"static":{_beforeUnloadHandler:function(){var a;tinymce.each(tinyMCE.editors,function(b){if(b.getParam("fullscreen_is_enabled")){return}if(b.isDirty()){a=b.getLang("autosave.unload_msg");return false}});return a}}});tinymce.PluginManager.add("autosave",tinymce.plugins.AutoSavePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js deleted file mode 100644 index 3c4325a..0000000 --- a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.AutoSavePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; | ||
| 16 | }, | ||
| 17 | |||
| 18 | getInfo : function() { | ||
| 19 | return { | ||
| 20 | longname : 'Auto save', | ||
| 21 | author : 'Moxiecode Systems AB', | ||
| 22 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 23 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', | ||
| 24 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 25 | }; | ||
| 26 | }, | ||
| 27 | |||
| 28 | // Private plugin internal methods | ||
| 29 | |||
| 30 | 'static' : { | ||
| 31 | _beforeUnloadHandler : function() { | ||
| 32 | var msg; | ||
| 33 | |||
| 34 | tinymce.each(tinyMCE.editors, function(ed) { | ||
| 35 | if (ed.getParam("fullscreen_is_enabled")) | ||
| 36 | return; | ||
| 37 | |||
| 38 | if (ed.isDirty()) { | ||
| 39 | msg = ed.getLang("autosave.unload_msg"); | ||
| 40 | return false; | ||
| 41 | } | ||
| 42 | }); | ||
| 43 | |||
| 44 | return msg; | ||
| 45 | } | ||
| 46 | } | ||
| 47 | }); | ||
| 48 | |||
| 49 | // Register plugin | ||
| 50 | tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); | ||
| 51 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js deleted file mode 100644 index 930fdff..0000000 --- a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/<font>(.*?)<\/font>/gi,"$1");b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");b(/<u>/gi,"[u]");b(/<blockquote[^>]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/<br \/>/gi,"\n");b(/<br\/>/gi,"\n");b(/<br>/gi,"\n");b(/<p>/gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"<br />");b(/\[b\]/gi,"<strong>");b(/\[\/b\]/gi,"</strong>");b(/\[i\]/gi,"<em>");b(/\[\/i\]/gi,"</em>");b(/\[u\]/gi,"<u>");b(/\[\/u\]/gi,"</u>");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>');b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>');b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>');b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js deleted file mode 100644 index 1d7493e..0000000 --- a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,117 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.BBCodePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); | ||
| 12 | |||
| 13 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 14 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | ||
| 15 | }); | ||
| 16 | |||
| 17 | ed.onPostProcess.add(function(ed, o) { | ||
| 18 | if (o.set) | ||
| 19 | o.content = t['_' + dialect + '_bbcode2html'](o.content); | ||
| 20 | |||
| 21 | if (o.get) | ||
| 22 | o.content = t['_' + dialect + '_html2bbcode'](o.content); | ||
| 23 | }); | ||
| 24 | }, | ||
| 25 | |||
| 26 | getInfo : function() { | ||
| 27 | return { | ||
| 28 | longname : 'BBCode Plugin', | ||
| 29 | author : 'Moxiecode Systems AB', | ||
| 30 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 31 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', | ||
| 32 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 33 | }; | ||
| 34 | }, | ||
| 35 | |||
| 36 | // Private methods | ||
| 37 | |||
| 38 | // HTML -> BBCode in PunBB dialect | ||
| 39 | _punbb_html2bbcode : function(s) { | ||
| 40 | s = tinymce.trim(s); | ||
| 41 | |||
| 42 | function rep(re, str) { | ||
| 43 | s = s.replace(re, str); | ||
| 44 | }; | ||
| 45 | |||
| 46 | // example: <strong> to [b] | ||
| 47 | rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"); | ||
| 48 | rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | ||
| 49 | rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | ||
| 50 | rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); | ||
| 51 | rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); | ||
| 52 | rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"); | ||
| 53 | rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"); | ||
| 54 | rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"); | ||
| 55 | rep(/<font>(.*?)<\/font>/gi,"$1"); | ||
| 56 | rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"); | ||
| 57 | rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"); | ||
| 58 | rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"); | ||
| 59 | rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); | ||
| 60 | rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); | ||
| 61 | rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); | ||
| 62 | rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); | ||
| 63 | rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); | ||
| 64 | rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); | ||
| 65 | rep(/<\/(strong|b)>/gi,"[/b]"); | ||
| 66 | rep(/<(strong|b)>/gi,"[b]"); | ||
| 67 | rep(/<\/(em|i)>/gi,"[/i]"); | ||
| 68 | rep(/<(em|i)>/gi,"[i]"); | ||
| 69 | rep(/<\/u>/gi,"[/u]"); | ||
| 70 | rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"); | ||
| 71 | rep(/<u>/gi,"[u]"); | ||
| 72 | rep(/<blockquote[^>]*>/gi,"[quote]"); | ||
| 73 | rep(/<\/blockquote>/gi,"[/quote]"); | ||
| 74 | rep(/<br \/>/gi,"\n"); | ||
| 75 | rep(/<br\/>/gi,"\n"); | ||
| 76 | rep(/<br>/gi,"\n"); | ||
| 77 | rep(/<p>/gi,""); | ||
| 78 | rep(/<\/p>/gi,"\n"); | ||
| 79 | rep(/ /gi," "); | ||
| 80 | rep(/"/gi,"\""); | ||
| 81 | rep(/</gi,"<"); | ||
| 82 | rep(/>/gi,">"); | ||
| 83 | rep(/&/gi,"&"); | ||
| 84 | |||
| 85 | return s; | ||
| 86 | }, | ||
| 87 | |||
| 88 | // BBCode -> HTML from PunBB dialect | ||
| 89 | _punbb_bbcode2html : function(s) { | ||
| 90 | s = tinymce.trim(s); | ||
| 91 | |||
| 92 | function rep(re, str) { | ||
| 93 | s = s.replace(re, str); | ||
| 94 | }; | ||
| 95 | |||
| 96 | // example: [b] to <strong> | ||
| 97 | rep(/\n/gi,"<br />"); | ||
| 98 | rep(/\[b\]/gi,"<strong>"); | ||
| 99 | rep(/\[\/b\]/gi,"</strong>"); | ||
| 100 | rep(/\[i\]/gi,"<em>"); | ||
| 101 | rep(/\[\/i\]/gi,"</em>"); | ||
| 102 | rep(/\[u\]/gi,"<u>"); | ||
| 103 | rep(/\[\/u\]/gi,"</u>"); | ||
| 104 | rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"); | ||
| 105 | rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"); | ||
| 106 | rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); | ||
| 107 | rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>"); | ||
| 108 | rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span> "); | ||
| 109 | rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span> "); | ||
| 110 | |||
| 111 | return s; | ||
| 112 | } | ||
| 113 | }); | ||
| 114 | |||
| 115 | // Register plugin | ||
| 116 | tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); | ||
| 117 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js deleted file mode 100644 index 24ee2eb..0000000 --- a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js deleted file mode 100644 index a2c1866..0000000 --- a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.ContextMenu', { | ||
| 12 | init : function(ed) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.onContextMenu = new tinymce.util.Dispatcher(this); | ||
| 17 | |||
| 18 | ed.onContextMenu.add(function(ed, e) { | ||
| 19 | if (!e.ctrlKey) { | ||
| 20 | t._getMenu(ed).showMenu(e.clientX, e.clientY); | ||
| 21 | Event.add(ed.getDoc(), 'click', hide); | ||
| 22 | Event.cancel(e); | ||
| 23 | } | ||
| 24 | }); | ||
| 25 | |||
| 26 | function hide() { | ||
| 27 | if (t._menu) { | ||
| 28 | t._menu.removeAll(); | ||
| 29 | t._menu.destroy(); | ||
| 30 | Event.remove(ed.getDoc(), 'click', hide); | ||
| 31 | } | ||
| 32 | }; | ||
| 33 | |||
| 34 | ed.onMouseDown.add(hide); | ||
| 35 | ed.onKeyDown.add(hide); | ||
| 36 | }, | ||
| 37 | |||
| 38 | getInfo : function() { | ||
| 39 | return { | ||
| 40 | longname : 'Contextmenu', | ||
| 41 | author : 'Moxiecode Systems AB', | ||
| 42 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', | ||
| 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 45 | }; | ||
| 46 | }, | ||
| 47 | |||
| 48 | _getMenu : function(ed) { | ||
| 49 | var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2; | ||
| 50 | |||
| 51 | if (m) { | ||
| 52 | m.removeAll(); | ||
| 53 | m.destroy(); | ||
| 54 | } | ||
| 55 | |||
| 56 | p1 = DOM.getPos(ed.getContentAreaContainer()); | ||
| 57 | p2 = DOM.getPos(ed.getContainer()); | ||
| 58 | |||
| 59 | m = ed.controlManager.createDropMenu('contextmenu', { | ||
| 60 | offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0), | ||
| 61 | offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0), | ||
| 62 | constrain : 1 | ||
| 63 | }); | ||
| 64 | |||
| 65 | t._menu = m; | ||
| 66 | |||
| 67 | m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); | ||
| 68 | m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); | ||
| 69 | m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); | ||
| 70 | |||
| 71 | if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { | ||
| 72 | m.addSeparator(); | ||
| 73 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); | ||
| 74 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); | ||
| 75 | } | ||
| 76 | |||
| 77 | m.addSeparator(); | ||
| 78 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); | ||
| 79 | |||
| 80 | m.addSeparator(); | ||
| 81 | am = m.addMenu({title : 'contextmenu.align'}); | ||
| 82 | am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); | ||
| 83 | am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); | ||
| 84 | am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); | ||
| 85 | am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); | ||
| 86 | |||
| 87 | t.onContextMenu.dispatch(t, m, el, col); | ||
| 88 | |||
| 89 | return m; | ||
| 90 | } | ||
| 91 | }); | ||
| 92 | |||
| 93 | // Register plugin | ||
| 94 | tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); | ||
| 95 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js deleted file mode 100644 index bce8e73..0000000 --- a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js deleted file mode 100644 index 81818e3..0000000 --- a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,79 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Directionality', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | ed.addCommand('mceDirectionLTR', function() { | ||
| 16 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | ||
| 17 | |||
| 18 | if (e) { | ||
| 19 | if (ed.dom.getAttrib(e, "dir") != "ltr") | ||
| 20 | ed.dom.setAttrib(e, "dir", "ltr"); | ||
| 21 | else | ||
| 22 | ed.dom.setAttrib(e, "dir", ""); | ||
| 23 | } | ||
| 24 | |||
| 25 | ed.nodeChanged(); | ||
| 26 | }); | ||
| 27 | |||
| 28 | ed.addCommand('mceDirectionRTL', function() { | ||
| 29 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); | ||
| 30 | |||
| 31 | if (e) { | ||
| 32 | if (ed.dom.getAttrib(e, "dir") != "rtl") | ||
| 33 | ed.dom.setAttrib(e, "dir", "rtl"); | ||
| 34 | else | ||
| 35 | ed.dom.setAttrib(e, "dir", ""); | ||
| 36 | } | ||
| 37 | |||
| 38 | ed.nodeChanged(); | ||
| 39 | }); | ||
| 40 | |||
| 41 | ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); | ||
| 42 | ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); | ||
| 43 | |||
| 44 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 45 | }, | ||
| 46 | |||
| 47 | getInfo : function() { | ||
| 48 | return { | ||
| 49 | longname : 'Directionality', | ||
| 50 | author : 'Moxiecode Systems AB', | ||
| 51 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 52 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', | ||
| 53 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 54 | }; | ||
| 55 | }, | ||
| 56 | |||
| 57 | // Private methods | ||
| 58 | |||
| 59 | _nodeChange : function(ed, cm, n) { | ||
| 60 | var dom = ed.dom, dir; | ||
| 61 | |||
| 62 | n = dom.getParent(n, dom.isBlock); | ||
| 63 | if (!n) { | ||
| 64 | cm.setDisabled('ltr', 1); | ||
| 65 | cm.setDisabled('rtl', 1); | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | dir = dom.getAttrib(n, 'dir'); | ||
| 70 | cm.setActive('ltr', dir == "ltr"); | ||
| 71 | cm.setDisabled('ltr', 0); | ||
| 72 | cm.setActive('rtl', dir == "rtl"); | ||
| 73 | cm.setDisabled('rtl', 0); | ||
| 74 | } | ||
| 75 | }); | ||
| 76 | |||
| 77 | // Register plugin | ||
| 78 | tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); | ||
| 79 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js deleted file mode 100644 index 4783bc3..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.EmotionsPlugin",{init:function(a,b){a.addCommand("mceEmotion",function(){a.windowManager.open({file:b+"/emotions.htm",width:250+parseInt(a.getLang("emotions.delta_width",0)),height:160+parseInt(a.getLang("emotions.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("emotions",tinymce.plugins.EmotionsPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js deleted file mode 100644 index df0d370..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.EmotionsPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceEmotion', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/emotions.htm', | ||
| 15 | width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), | ||
| 16 | height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | // Register buttons | ||
| 24 | ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); | ||
| 25 | }, | ||
| 26 | |||
| 27 | getInfo : function() { | ||
| 28 | return { | ||
| 29 | longname : 'Emotions', | ||
| 30 | author : 'Moxiecode Systems AB', | ||
| 31 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 32 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', | ||
| 33 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 34 | }; | ||
| 35 | } | ||
| 36 | }); | ||
| 37 | |||
| 38 | // Register plugin | ||
| 39 | tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); | ||
| 40 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm deleted file mode 100644 index 55a1d72..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#emotions_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/emotions.js"></script> | ||
| 7 | </head> | ||
| 8 | <body style="display: none"> | ||
| 9 | <div align="center"> | ||
| 10 | <div class="title">{#emotions_dlg.title}:<br /><br /></div> | ||
| 11 | |||
| 12 | <table border="0" cellspacing="0" cellpadding="4"> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 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> | ||
| 37 | </table> | ||
| 38 | </div> | ||
| 39 | </body> | ||
| 40 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif deleted file mode 100644 index ba90cc3..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif deleted file mode 100644 index 74d897a..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif deleted file mode 100644 index 963a96b..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif deleted file mode 100644 index 16f68cc..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif deleted file mode 100644 index 716f55e..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif deleted file mode 100644 index 334d49e..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif deleted file mode 100644 index 4efd549..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif deleted file mode 100644 index 1606c11..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif deleted file mode 100644 index ca2451e..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif deleted file mode 100644 index b33d3cc..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif deleted file mode 100644 index e6a9e60..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif deleted file mode 100644 index cb99cdd..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif deleted file mode 100644 index 2075dc1..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif deleted file mode 100644 index bef7e25..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif deleted file mode 100644 index 9faf1af..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif deleted file mode 100644 index 648e6e8..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js deleted file mode 100644 index c549367..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var EmotionsDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | tinyMCEPopup.resizeToInnerSize(); | ||
| 6 | }, | ||
| 7 | |||
| 8 | insert : function(file, title) { | ||
| 9 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 10 | |||
| 11 | tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', { | ||
| 12 | src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file, | ||
| 13 | alt : ed.getLang(title), | ||
| 14 | title : ed.getLang(title), | ||
| 15 | border : 0 | ||
| 16 | })); | ||
| 17 | |||
| 18 | tinyMCEPopup.close(); | ||
| 19 | } | ||
| 20 | }; | ||
| 21 | |||
| 22 | tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js deleted file mode 100644 index 3b57ad9..0000000 --- a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.emotions_dlg',{ | ||
| 2 | title:"Insert emotion", | ||
| 3 | desc:"Emotions", | ||
| 4 | cool:"Cool", | ||
| 5 | cry:"Cry", | ||
| 6 | embarassed:"Embarassed", | ||
| 7 | foot_in_mouth:"Foot in mouth", | ||
| 8 | frown:"Frown", | ||
| 9 | innocent:"Innocent", | ||
| 10 | kiss:"Kiss", | ||
| 11 | laughing:"Laughing", | ||
| 12 | money_mouth:"Money mouth", | ||
| 13 | sealed:"Sealed", | ||
| 14 | smile:"Smile", | ||
| 15 | surprised:"Surprised", | ||
| 16 | tongue_out:"Tongue out", | ||
| 17 | undecided:"Undecided", | ||
| 18 | wink:"Wink", | ||
| 19 | yell:"Yell" | ||
| 20 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/dialog.htm b/public/javascripts/tiny_mce/plugins/example/dialog.htm deleted file mode 100644 index b4c6284..0000000 --- a/public/javascripts/tiny_mce/plugins/example/dialog.htm +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#example_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/dialog.js"></script> | ||
| 7 | </head> | ||
| 8 | <body> | ||
| 9 | |||
| 10 | <form onsubmit="ExampleDialog.insert();return false;" action="#"> | ||
| 11 | <p>Here is a example dialog.</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> | ||
| 14 | |||
| 15 | <div class="mceActionPanel"> | ||
| 16 | <div style="float: left"> | ||
| 17 | <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" /> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div style="float: right"> | ||
| 21 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | </form> | ||
| 25 | |||
| 26 | </body> | ||
| 27 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js deleted file mode 100644 index ec1f81e..0000000 --- a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js deleted file mode 100644 index 5050550..0000000 --- a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | // Load plugin specific language pack | ||
| 10 | tinymce.PluginManager.requireLangPack('example'); | ||
| 11 | |||
| 12 | tinymce.create('tinymce.plugins.ExamplePlugin', { | ||
| 13 | /** | ||
| 14 | * Initializes the plugin, this will be executed after the plugin has been created. | ||
| 15 | * This call is done before the editor instance has finished it's initialization so use the onInit event | ||
| 16 | * of the editor instance to intercept that event. | ||
| 17 | * | ||
| 18 | * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. | ||
| 19 | * @param {string} url Absolute URL to where the plugin is located. | ||
| 20 | */ | ||
| 21 | init : function(ed, url) { | ||
| 22 | // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); | ||
| 23 | ed.addCommand('mceExample', function() { | ||
| 24 | ed.windowManager.open({ | ||
| 25 | file : url + '/dialog.htm', | ||
| 26 | width : 320 + parseInt(ed.getLang('example.delta_width', 0)), | ||
| 27 | height : 120 + parseInt(ed.getLang('example.delta_height', 0)), | ||
| 28 | inline : 1 | ||
| 29 | }, { | ||
| 30 | plugin_url : url, // Plugin absolute URL | ||
| 31 | some_custom_arg : 'custom arg' // Custom argument | ||
| 32 | }); | ||
| 33 | }); | ||
| 34 | |||
| 35 | // Register example button | ||
| 36 | ed.addButton('example', { | ||
| 37 | title : 'example.desc', | ||
| 38 | cmd : 'mceExample', | ||
| 39 | image : url + '/img/example.gif' | ||
| 40 | }); | ||
| 41 | |||
| 42 | // Add a node change handler, selects the button in the UI when a image is selected | ||
| 43 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 44 | cm.setActive('example', n.nodeName == 'IMG'); | ||
| 45 | }); | ||
| 46 | }, | ||
| 47 | |||
| 48 | /** | ||
| 49 | * Creates control instances based in the incomming name. This method is normally not | ||
| 50 | * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons | ||
| 51 | * but you sometimes need to create more complex controls like listboxes, split buttons etc then this | ||
| 52 | * method can be used to create those. | ||
| 53 | * | ||
| 54 | * @param {String} n Name of the control to create. | ||
| 55 | * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. | ||
| 56 | * @return {tinymce.ui.Control} New control instance or null if no control was created. | ||
| 57 | */ | ||
| 58 | createControl : function(n, cm) { | ||
| 59 | return null; | ||
| 60 | }, | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Returns information about the plugin as a name/value array. | ||
| 64 | * The current keys are longname, author, authorurl, infourl and version. | ||
| 65 | * | ||
| 66 | * @return {Object} Name/value array containing information about the plugin. | ||
| 67 | */ | ||
| 68 | getInfo : function() { | ||
| 69 | return { | ||
| 70 | longname : 'Example plugin', | ||
| 71 | author : 'Some author', | ||
| 72 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 73 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', | ||
| 74 | version : "1.0" | ||
| 75 | }; | ||
| 76 | } | ||
| 77 | }); | ||
| 78 | |||
| 79 | // Register plugin | ||
| 80 | tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); | ||
| 81 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/img/example.gif b/public/javascripts/tiny_mce/plugins/example/img/example.gif deleted file mode 100644 index 1ab5da4..0000000 --- a/public/javascripts/tiny_mce/plugins/example/img/example.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/example/js/dialog.js b/public/javascripts/tiny_mce/plugins/example/js/dialog.js deleted file mode 100644 index fa83411..0000000 --- a/public/javascripts/tiny_mce/plugins/example/js/dialog.js +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var ExampleDialog = { | ||
| 4 | init : function() { | ||
| 5 | var f = document.forms[0]; | ||
| 6 | |||
| 7 | // Get the selected contents as text and place it in the input | ||
| 8 | f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'}); | ||
| 9 | f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg'); | ||
| 10 | }, | ||
| 11 | |||
| 12 | insert : function() { | ||
| 13 | // Insert the contents from the input into the document | ||
| 14 | tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value); | ||
| 15 | tinyMCEPopup.close(); | ||
| 16 | } | ||
| 17 | }; | ||
| 18 | |||
| 19 | tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en.js b/public/javascripts/tiny_mce/plugins/example/langs/en.js deleted file mode 100644 index e0784f8..0000000 --- a/public/javascripts/tiny_mce/plugins/example/langs/en.js +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.example',{ | ||
| 2 | desc : 'This is just a template button' | ||
| 3 | }); | ||
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js deleted file mode 100644 index ebcf948..0000000 --- a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.example_dlg',{ | ||
| 2 | title : 'This is just a example title' | ||
| 3 | }); | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css deleted file mode 100644 index 7a3334f..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +++ /dev/null | |||
| @@ -1,182 +0,0 @@ | |||
| 1 | /* Hide the advanced tab */ | ||
| 2 | #advanced_tab { | ||
| 3 | display: none; | ||
| 4 | } | ||
| 5 | |||
| 6 | #metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright { | ||
| 7 | width: 280px; | ||
| 8 | } | ||
| 9 | |||
| 10 | #doctype, #docencoding { | ||
| 11 | width: 200px; | ||
| 12 | } | ||
| 13 | |||
| 14 | #langcode { | ||
| 15 | width: 30px; | ||
| 16 | } | ||
| 17 | |||
| 18 | #bgimage { | ||
| 19 | width: 220px; | ||
| 20 | } | ||
| 21 | |||
| 22 | #fontface { | ||
| 23 | width: 240px; | ||
| 24 | } | ||
| 25 | |||
| 26 | #leftmargin, #rightmargin, #topmargin, #bottommargin { | ||
| 27 | width: 50px; | ||
| 28 | } | ||
| 29 | |||
| 30 | .panel_wrapper div.current { | ||
| 31 | height: 400px; | ||
| 32 | } | ||
| 33 | |||
| 34 | #stylesheet, #style { | ||
| 35 | width: 240px; | ||
| 36 | } | ||
| 37 | |||
| 38 | /* Head list classes */ | ||
| 39 | |||
| 40 | .headlistwrapper { | ||
| 41 | width: 100%; | ||
| 42 | } | ||
| 43 | |||
| 44 | .addbutton, .removebutton, .moveupbutton, .movedownbutton { | ||
| 45 | border-top: 1px solid; | ||
| 46 | border-left: 1px solid; | ||
| 47 | border-bottom: 1px solid; | ||
| 48 | border-right: 1px solid; | ||
| 49 | border-color: #F0F0EE; | ||
| 50 | cursor: default; | ||
| 51 | display: block; | ||
| 52 | width: 20px; | ||
| 53 | height: 20px; | ||
| 54 | } | ||
| 55 | |||
| 56 | #doctypes { | ||
| 57 | width: 200px; | ||
| 58 | } | ||
| 59 | |||
| 60 | .addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover { | ||
| 61 | border: 1px solid #0A246A; | ||
| 62 | background-color: #B6BDD2; | ||
| 63 | } | ||
| 64 | |||
| 65 | .addbutton { | ||
| 66 | background-image: url('../images/add.gif'); | ||
| 67 | float: left; | ||
| 68 | margin-right: 3px; | ||
| 69 | } | ||
| 70 | |||
| 71 | .removebutton { | ||
| 72 | background-image: url('../images/remove.gif'); | ||
| 73 | float: left; | ||
| 74 | } | ||
| 75 | |||
| 76 | .moveupbutton { | ||
| 77 | background-image: url('../images/move_up.gif'); | ||
| 78 | float: left; | ||
| 79 | margin-right: 3px; | ||
| 80 | } | ||
| 81 | |||
| 82 | .movedownbutton { | ||
| 83 | background-image: url('../images/move_down.gif'); | ||
| 84 | float: left; | ||
| 85 | } | ||
| 86 | |||
| 87 | .selected { | ||
| 88 | border: 1px solid #0A246A; | ||
| 89 | background-color: #B6BDD2; | ||
| 90 | } | ||
| 91 | |||
| 92 | .toolbar { | ||
| 93 | width: 100%; | ||
| 94 | } | ||
| 95 | |||
| 96 | #headlist { | ||
| 97 | width: 100%; | ||
| 98 | margin-top: 3px; | ||
| 99 | font-size: 11px; | ||
| 100 | } | ||
| 101 | |||
| 102 | #info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element { | ||
| 103 | display: none; | ||
| 104 | } | ||
| 105 | |||
| 106 | #addmenu { | ||
| 107 | position: absolute; | ||
| 108 | border: 1px solid gray; | ||
| 109 | display: none; | ||
| 110 | z-index: 100; | ||
| 111 | background-color: white; | ||
| 112 | } | ||
| 113 | |||
| 114 | #addmenu a { | ||
| 115 | display: block; | ||
| 116 | width: 100%; | ||
| 117 | line-height: 20px; | ||
| 118 | text-decoration: none; | ||
| 119 | background-color: white; | ||
| 120 | } | ||
| 121 | |||
| 122 | #addmenu a:hover { | ||
| 123 | background-color: #B6BDD2; | ||
| 124 | color: black; | ||
| 125 | } | ||
| 126 | |||
| 127 | #addmenu span { | ||
| 128 | padding-left: 10px; | ||
| 129 | padding-right: 10px; | ||
| 130 | } | ||
| 131 | |||
| 132 | #updateElementPanel { | ||
| 133 | display: none; | ||
| 134 | } | ||
| 135 | |||
| 136 | #script_element .panel_wrapper div.current { | ||
| 137 | height: 108px; | ||
| 138 | } | ||
| 139 | |||
| 140 | #style_element .panel_wrapper div.current { | ||
| 141 | height: 108px; | ||
| 142 | } | ||
| 143 | |||
| 144 | #link_element .panel_wrapper div.current { | ||
| 145 | height: 140px; | ||
| 146 | } | ||
| 147 | |||
| 148 | #element_script_value { | ||
| 149 | width: 100%; | ||
| 150 | height: 100px; | ||
| 151 | } | ||
| 152 | |||
| 153 | #element_comment_value { | ||
| 154 | width: 100%; | ||
| 155 | height: 120px; | ||
| 156 | } | ||
| 157 | |||
| 158 | #element_style_value { | ||
| 159 | width: 100%; | ||
| 160 | height: 100px; | ||
| 161 | } | ||
| 162 | |||
| 163 | #element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title { | ||
| 164 | width: 250px; | ||
| 165 | } | ||
| 166 | |||
| 167 | .updateElementButton { | ||
| 168 | margin-top: 3px; | ||
| 169 | } | ||
| 170 | |||
| 171 | /* MSIE specific styles */ | ||
| 172 | |||
| 173 | * html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton { | ||
| 174 | width: 22px; | ||
| 175 | height: 22px; | ||
| 176 | } | ||
| 177 | |||
| 178 | textarea { | ||
| 179 | height: 55px; | ||
| 180 | } | ||
| 181 | |||
| 182 | .panel_wrapper div.current {height:420px;} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js deleted file mode 100644 index 8e11bfc..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c<e;c++){g=l[c].split("=");b=g[0].replace(/\s/,"");h=g[1];if(h){h=h.replace(/^\s+/,"").replace(/\s+$/,"");j=h.match(/^["'](.*)["']$/);if(j){h=j[1]}}else{h=b}d.dom.setAttrib(d.getBody(),"style",h)}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true})},_setContent:function(d,b){var h=this,a,j,f=b.content,g,i="";if(b.source_view&&d.getParam("fullpage_hide_in_source_view")){return}f=f.replace(/<(\/?)BODY/gi,"<$1body");a=f.indexOf("<body");if(a!=-1){a=f.indexOf(">",a);h.head=f.substring(0,a+1);j=f.indexOf("</body",a);if(j==-1){j=f.indexOf("</body",j)}b.content=f.substring(a+1,j);h.foot=f.substring(j);function e(c){return c.replace(/<\/?[A-Z]+/g,function(k){return k.toLowerCase()})}h.head=e(h.head);h.foot=e(h.foot)}else{h.head="";if(d.getParam("fullpage_default_xml_pi")){h.head+='<?xml version="1.0" encoding="'+d.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'}h.head+=d.getParam("fullpage_default_doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');h.head+="\n<html>\n<head>\n<title>"+d.getParam("fullpage_default_title","Untitled document")+"</title>\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='<meta http-equiv="Content-Type" content="'+g+'" />\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="</head>\n<body"+(i?' style="'+i+'"':"")+">\n";h.foot="\n</body>\n</html>"}},_getContent:function(a,c){var b=this;if(!c.source_view||!a.getParam("fullpage_hide_in_source_view")){c.content=tinymce.trim(b.head)+"\n"+tinymce.trim(c.content)+"\n"+tinymce.trim(b.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js deleted file mode 100644 index c7d5aca..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,146 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1029 2009-02-24 22:32:21Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.FullPagePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceFullPageProperties', function() { | ||
| 17 | ed.windowManager.open({ | ||
| 18 | file : url + '/fullpage.htm', | ||
| 19 | width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), | ||
| 20 | height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), | ||
| 21 | inline : 1 | ||
| 22 | }, { | ||
| 23 | plugin_url : url, | ||
| 24 | head_html : t.head | ||
| 25 | }); | ||
| 26 | }); | ||
| 27 | |||
| 28 | // Register buttons | ||
| 29 | ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); | ||
| 30 | |||
| 31 | ed.onBeforeSetContent.add(t._setContent, t); | ||
| 32 | ed.onSetContent.add(t._setBodyAttribs, t); | ||
| 33 | ed.onGetContent.add(t._getContent, t); | ||
| 34 | }, | ||
| 35 | |||
| 36 | getInfo : function() { | ||
| 37 | return { | ||
| 38 | longname : 'Fullpage', | ||
| 39 | author : 'Moxiecode Systems AB', | ||
| 40 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 41 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', | ||
| 42 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 43 | }; | ||
| 44 | }, | ||
| 45 | |||
| 46 | // Private plugin internal methods | ||
| 47 | |||
| 48 | _setBodyAttribs : function(ed, o) { | ||
| 49 | var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i); | ||
| 50 | |||
| 51 | if (attr && attr[1]) { | ||
| 52 | bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g); | ||
| 53 | |||
| 54 | if (bdattr) { | ||
| 55 | for(i = 0, len = bdattr.length; i < len; i++) { | ||
| 56 | kv = bdattr[i].split('='); | ||
| 57 | k = kv[0].replace(/\s/,''); | ||
| 58 | v = kv[1]; | ||
| 59 | |||
| 60 | if (v) { | ||
| 61 | v = v.replace(/^\s+/,'').replace(/\s+$/,''); | ||
| 62 | t = v.match(/^["'](.*)["']$/); | ||
| 63 | |||
| 64 | if (t) | ||
| 65 | v = t[1]; | ||
| 66 | } else | ||
| 67 | v = k; | ||
| 68 | |||
| 69 | ed.dom.setAttrib(ed.getBody(), 'style', v); | ||
| 70 | } | ||
| 71 | } | ||
| 72 | } | ||
| 73 | }, | ||
| 74 | |||
| 75 | _createSerializer : function() { | ||
| 76 | return new tinymce.dom.Serializer({ | ||
| 77 | dom : this.editor.dom, | ||
| 78 | apply_source_formatting : true | ||
| 79 | }); | ||
| 80 | }, | ||
| 81 | |||
| 82 | _setContent : function(ed, o) { | ||
| 83 | var t = this, sp, ep, c = o.content, v, st = ''; | ||
| 84 | |||
| 85 | if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) | ||
| 86 | return; | ||
| 87 | |||
| 88 | // Parse out head, body and footer | ||
| 89 | c = c.replace(/<(\/?)BODY/gi, '<$1body'); | ||
| 90 | sp = c.indexOf('<body'); | ||
| 91 | |||
| 92 | if (sp != -1) { | ||
| 93 | sp = c.indexOf('>', sp); | ||
| 94 | t.head = c.substring(0, sp + 1); | ||
| 95 | |||
| 96 | ep = c.indexOf('</body', sp); | ||
| 97 | if (ep == -1) | ||
| 98 | ep = c.indexOf('</body', ep); | ||
| 99 | |||
| 100 | o.content = c.substring(sp + 1, ep); | ||
| 101 | t.foot = c.substring(ep); | ||
| 102 | |||
| 103 | function low(s) { | ||
| 104 | return s.replace(/<\/?[A-Z]+/g, function(a) { | ||
| 105 | return a.toLowerCase(); | ||
| 106 | }) | ||
| 107 | }; | ||
| 108 | |||
| 109 | t.head = low(t.head); | ||
| 110 | t.foot = low(t.foot); | ||
| 111 | } else { | ||
| 112 | t.head = ''; | ||
| 113 | if (ed.getParam('fullpage_default_xml_pi')) | ||
| 114 | t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n'; | ||
| 115 | |||
| 116 | 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">'); | ||
| 117 | t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n'; | ||
| 118 | |||
| 119 | if (v = ed.getParam('fullpage_default_encoding')) | ||
| 120 | t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n'; | ||
| 121 | |||
| 122 | if (v = ed.getParam('fullpage_default_font_family')) | ||
| 123 | st += 'font-family: ' + v + ';'; | ||
| 124 | |||
| 125 | if (v = ed.getParam('fullpage_default_font_size')) | ||
| 126 | st += 'font-size: ' + v + ';'; | ||
| 127 | |||
| 128 | if (v = ed.getParam('fullpage_default_text_color')) | ||
| 129 | st += 'color: ' + v + ';'; | ||
| 130 | |||
| 131 | t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n'; | ||
| 132 | t.foot = '\n</body>\n</html>'; | ||
| 133 | } | ||
| 134 | }, | ||
| 135 | |||
| 136 | _getContent : function(ed, o) { | ||
| 137 | var t = this; | ||
| 138 | |||
| 139 | if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) | ||
| 140 | o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot); | ||
| 141 | } | ||
| 142 | }); | ||
| 143 | |||
| 144 | // Register plugin | ||
| 145 | tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); | ||
| 146 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm deleted file mode 100644 index 3ea4081..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +++ /dev/null | |||
| @@ -1,576 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#fullpage_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/fullpage.js"></script> | ||
| 9 | <link href="css/fullpage.css" rel="stylesheet" type="text/css" /> | ||
| 10 | </head> | ||
| 11 | <body id="advlink" style="display: none"> | ||
| 12 | <form onsubmit="updateAction();return false;" name="fullpage" action="#"> | ||
| 13 | <div class="tabs"> | ||
| 14 | <ul> | ||
| 15 | <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li> | ||
| 16 | <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li> | ||
| 17 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li> | ||
| 18 | </ul> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div class="panel_wrapper"> | ||
| 22 | <div id="meta_panel" class="panel current"> | ||
| 23 | <fieldset> | ||
| 24 | <legend>{#fullpage_dlg.meta_props}</legend> | ||
| 25 | |||
| 26 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 27 | <tr> | ||
| 28 | <td class="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label> </td> | ||
| 29 | <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td class="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label> </td> | ||
| 33 | <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td class="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label> </td> | ||
| 37 | <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td class="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label> </td> | ||
| 41 | <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label> </td> | ||
| 45 | <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label> </td> | ||
| 49 | <td> | ||
| 50 | <select id="metarobots" name="metarobots"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option> | ||
| 53 | <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option> | ||
| 54 | <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option> | ||
| 55 | <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option> | ||
| 56 | </select> | ||
| 57 | </td> | ||
| 58 | </tr> | ||
| 59 | </table> | ||
| 60 | </fieldset> | ||
| 61 | |||
| 62 | <fieldset> | ||
| 63 | <legend>{#fullpage_dlg.langprops}</legend> | ||
| 64 | |||
| 65 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 66 | <tr> | ||
| 67 | <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td> | ||
| 68 | <td> | ||
| 69 | <select id="docencoding" name="docencoding"> | ||
| 70 | <option value="">{#not_set}</option> | ||
| 71 | </select> | ||
| 72 | </td> | ||
| 73 | </tr> | ||
| 74 | <tr> | ||
| 75 | <td class="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label> </td> | ||
| 76 | <td> | ||
| 77 | <select id="doctypes" name="doctypes"> | ||
| 78 | <option value="">{#not_set}</option> | ||
| 79 | </select> | ||
| 80 | </td> | ||
| 81 | </tr> | ||
| 82 | <tr> | ||
| 83 | <td class="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label> </td> | ||
| 84 | <td><input type="text" id="langcode" name="langcode" value="" /></td> | ||
| 85 | </tr> | ||
| 86 | <tr> | ||
| 87 | <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td> | ||
| 88 | <td> | ||
| 89 | <select id="langdir" name="langdir"> | ||
| 90 | <option value="">{#not_set}</option> | ||
| 91 | <option value="ltr">{#fullpage_dlg.ltr}</option> | ||
| 92 | <option value="rtl">{#fullpage_dlg.rtl}</option> | ||
| 93 | </select> | ||
| 94 | </td> | ||
| 95 | </tr> | ||
| 96 | <tr> | ||
| 97 | <td class="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label> </td> | ||
| 98 | <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td> | ||
| 99 | </tr> | ||
| 100 | </table> | ||
| 101 | </fieldset> | ||
| 102 | </div> | ||
| 103 | |||
| 104 | <div id="appearance_panel" class="panel"> | ||
| 105 | <fieldset> | ||
| 106 | <legend>{#fullpage_dlg.appearance_textprops}</legend> | ||
| 107 | |||
| 108 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 109 | <tr> | ||
| 110 | <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td> | ||
| 111 | <td> | ||
| 112 | <select id="fontface" name="fontface" onchange="changedStyleField(this);"> | ||
| 113 | <option value="">{#not_set}</option> | ||
| 114 | </select> | ||
| 115 | </td> | ||
| 116 | </tr> | ||
| 117 | |||
| 118 | <tr> | ||
| 119 | <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td> | ||
| 120 | <td> | ||
| 121 | <select id="fontsize" name="fontsize" onchange="changedStyleField(this);"> | ||
| 122 | <option value="">{#not_set}</option> | ||
| 123 | </select> | ||
| 124 | </td> | ||
| 125 | </tr> | ||
| 126 | |||
| 127 | <tr> | ||
| 128 | <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td> | ||
| 129 | <td> | ||
| 130 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 131 | <tr> | ||
| 132 | <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td> | ||
| 133 | <td id="textcolor_pickcontainer"> </td> | ||
| 134 | </tr> | ||
| 135 | </table> | ||
| 136 | </td> | ||
| 137 | </tr> | ||
| 138 | </table> | ||
| 139 | </fieldset> | ||
| 140 | |||
| 141 | <fieldset> | ||
| 142 | <legend>{#fullpage_dlg.appearance_bgprops}</legend> | ||
| 143 | |||
| 144 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 145 | <tr> | ||
| 146 | <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td> | ||
| 147 | <td> | ||
| 148 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 149 | <tr> | ||
| 150 | <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 151 | <td id="bgimage_pickcontainer"> </td> | ||
| 152 | </tr> | ||
| 153 | </table> | ||
| 154 | </td> | ||
| 155 | </tr> | ||
| 156 | <tr> | ||
| 157 | <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td> | ||
| 158 | <td> | ||
| 159 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 160 | <tr> | ||
| 161 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td> | ||
| 162 | <td id="bgcolor_pickcontainer"> </td> | ||
| 163 | </tr> | ||
| 164 | </table> | ||
| 165 | </td> | ||
| 166 | </tr> | ||
| 167 | </table> | ||
| 168 | </fieldset> | ||
| 169 | |||
| 170 | <fieldset> | ||
| 171 | <legend>{#fullpage_dlg.appearance_marginprops}</legend> | ||
| 172 | |||
| 173 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 174 | <tr> | ||
| 175 | <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td> | ||
| 176 | <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 177 | <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td> | ||
| 178 | <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 179 | </tr> | ||
| 180 | <tr> | ||
| 181 | <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td> | ||
| 182 | <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 183 | <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td> | ||
| 184 | <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 185 | </tr> | ||
| 186 | </table> | ||
| 187 | </fieldset> | ||
| 188 | |||
| 189 | <fieldset> | ||
| 190 | <legend>{#fullpage_dlg.appearance_linkprops}</legend> | ||
| 191 | |||
| 192 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 193 | <tr> | ||
| 194 | <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td> | ||
| 195 | <td> | ||
| 196 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 197 | <tr> | ||
| 198 | <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td> | ||
| 199 | <td id="link_color_pickcontainer"> </td> | ||
| 200 | </tr> | ||
| 201 | </table> | ||
| 202 | </td> | ||
| 203 | |||
| 204 | <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td> | ||
| 205 | <td> | ||
| 206 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 207 | <tr> | ||
| 208 | <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td> | ||
| 209 | <td id="visited_color_pickcontainer"> </td> | ||
| 210 | </tr> | ||
| 211 | </table> | ||
| 212 | </td> | ||
| 213 | </tr> | ||
| 214 | |||
| 215 | <tr> | ||
| 216 | <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td> | ||
| 217 | <td> | ||
| 218 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 219 | <tr> | ||
| 220 | <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td> | ||
| 221 | <td id="active_color_pickcontainer"> </td> | ||
| 222 | </tr> | ||
| 223 | </table> | ||
| 224 | </td> | ||
| 225 | |||
| 226 | <td> </td> | ||
| 227 | <td> </td> | ||
| 228 | |||
| 229 | <!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td> | ||
| 230 | <td> | ||
| 231 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 232 | <tr> | ||
| 233 | <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td> | ||
| 234 | <td id="hover_color_pickcontainer"> </td> | ||
| 235 | </tr> | ||
| 236 | </table> | ||
| 237 | </td> --> | ||
| 238 | </tr> | ||
| 239 | </table> | ||
| 240 | </fieldset> | ||
| 241 | |||
| 242 | <fieldset> | ||
| 243 | <legend>{#fullpage_dlg.appearance_style}</legend> | ||
| 244 | |||
| 245 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 246 | <tr> | ||
| 247 | <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td> | ||
| 248 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 249 | <tr> | ||
| 250 | <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td> | ||
| 251 | <td id="stylesheet_browsercontainer"> </td> | ||
| 252 | </tr> | ||
| 253 | </table></td> | ||
| 254 | </tr> | ||
| 255 | <tr> | ||
| 256 | <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td> | ||
| 257 | <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td> | ||
| 258 | </tr> | ||
| 259 | </table> | ||
| 260 | </fieldset> | ||
| 261 | </div> | ||
| 262 | |||
| 263 | <div id="advanced_panel" class="panel"> | ||
| 264 | <div id="addmenu"> | ||
| 265 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 266 | <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr> | ||
| 267 | <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr> | ||
| 268 | <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr> | ||
| 269 | <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr> | ||
| 270 | <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr> | ||
| 271 | <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr> | ||
| 272 | <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr> | ||
| 273 | </table> | ||
| 274 | </div> | ||
| 275 | |||
| 276 | <fieldset> | ||
| 277 | <legend>{#fullpage_dlg.head_elements}</legend> | ||
| 278 | |||
| 279 | <div class="headlistwrapper"> | ||
| 280 | <div class="toolbar"> | ||
| 281 | <div style="float: left"> | ||
| 282 | <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a> | ||
| 283 | <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a> | ||
| 284 | </div> | ||
| 285 | <div style="float: right"> | ||
| 286 | <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a> | ||
| 287 | <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a> | ||
| 288 | </div> | ||
| 289 | <br style="clear: both" /> | ||
| 290 | </div> | ||
| 291 | <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);"> | ||
| 292 | <option value="title_0"><title>Some title bla bla bla</title></option> | ||
| 293 | <option value="meta_1"><meta name="keywords">Some bla bla bla</meta></option> | ||
| 294 | <option value="meta_2"><meta name="description">Some bla bla bla bla bla bla bla bla bla</meta></option> | ||
| 295 | <option value="script_3"><script language="javascript">...</script></option> | ||
| 296 | <option value="style_4"><style>...</style></option> | ||
| 297 | <option value="base_5"><base href="." /></option> | ||
| 298 | <option value="comment_6"><!-- ... --></option> | ||
| 299 | <option value="link_7"><link href="." /></option> | ||
| 300 | </select> | ||
| 301 | </div> | ||
| 302 | </fieldset> | ||
| 303 | |||
| 304 | <fieldset id="meta_element"> | ||
| 305 | <legend>{#fullpage_dlg.meta_element}</legend> | ||
| 306 | |||
| 307 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 308 | <tr> | ||
| 309 | <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td> | ||
| 310 | <td><select id="element_meta_type"> | ||
| 311 | <option value="name">name</option> | ||
| 312 | <option value="http-equiv">http-equiv</option> | ||
| 313 | </select></td> | ||
| 314 | </tr> | ||
| 315 | <tr> | ||
| 316 | <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td> | ||
| 317 | <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td> | ||
| 318 | </tr> | ||
| 319 | <tr> | ||
| 320 | <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td> | ||
| 321 | <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td> | ||
| 322 | </tr> | ||
| 323 | </table> | ||
| 324 | |||
| 325 | <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 326 | </fieldset> | ||
| 327 | |||
| 328 | <fieldset id="title_element"> | ||
| 329 | <legend>{#fullpage_dlg.title_element}</legend> | ||
| 330 | |||
| 331 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 332 | <tr> | ||
| 333 | <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td> | ||
| 334 | <td><input id="element_title" name="element_title" type="text" value="" /></td> | ||
| 335 | </tr> | ||
| 336 | </table> | ||
| 337 | |||
| 338 | <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 339 | </fieldset> | ||
| 340 | |||
| 341 | <fieldset id="script_element"> | ||
| 342 | <legend>{#fullpage_dlg.script_element}</legend> | ||
| 343 | |||
| 344 | <div class="tabs"> | ||
| 345 | <ul> | ||
| 346 | <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li> | ||
| 347 | <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li> | ||
| 348 | </ul> | ||
| 349 | </div> | ||
| 350 | |||
| 351 | <br style="clear: both" /> | ||
| 352 | |||
| 353 | <div class="panel_wrapper"> | ||
| 354 | <div id="script_props_panel" class="panel current"> | ||
| 355 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 356 | <tr> | ||
| 357 | <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td> | ||
| 358 | <td><select id="element_script_type"> | ||
| 359 | <option value="text/javascript">text/javascript</option> | ||
| 360 | <option value="text/jscript">text/jscript</option> | ||
| 361 | <option value="text/vbscript">text/vbscript</option> | ||
| 362 | <option value="text/vbs">text/vbs</option> | ||
| 363 | <option value="text/ecmascript">text/ecmascript</option> | ||
| 364 | <option value="text/xml">text/xml</option> | ||
| 365 | </select></td> | ||
| 366 | </tr> | ||
| 367 | <tr> | ||
| 368 | <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td> | ||
| 369 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 370 | <tr> | ||
| 371 | <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td> | ||
| 372 | <td id="script_src_pickcontainer"> </td> | ||
| 373 | </tr> | ||
| 374 | </table></td> | ||
| 375 | </tr> | ||
| 376 | <tr> | ||
| 377 | <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td> | ||
| 378 | <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td> | ||
| 379 | </tr> | ||
| 380 | <tr> | ||
| 381 | <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td> | ||
| 382 | <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td> | ||
| 383 | </tr> | ||
| 384 | </table> | ||
| 385 | </div> | ||
| 386 | |||
| 387 | <div id="script_value_panel" class="panel"> | ||
| 388 | <textarea id="element_script_value"></textarea> | ||
| 389 | </div> | ||
| 390 | </div> | ||
| 391 | |||
| 392 | <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 393 | </fieldset> | ||
| 394 | |||
| 395 | <fieldset id="style_element"> | ||
| 396 | <legend>{#fullpage_dlg.style_element}</legend> | ||
| 397 | |||
| 398 | <div class="tabs"> | ||
| 399 | <ul> | ||
| 400 | <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li> | ||
| 401 | <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li> | ||
| 402 | </ul> | ||
| 403 | </div> | ||
| 404 | |||
| 405 | <br style="clear: both" /> | ||
| 406 | |||
| 407 | <div class="panel_wrapper"> | ||
| 408 | <div id="style_props_panel" class="panel current"> | ||
| 409 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 410 | <tr> | ||
| 411 | <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td> | ||
| 412 | <td><select id="element_style_type"> | ||
| 413 | <option value="text/css">text/css</option> | ||
| 414 | </select></td> | ||
| 415 | </tr> | ||
| 416 | <tr> | ||
| 417 | <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td> | ||
| 418 | <td><select id="element_style_media"></select></td> | ||
| 419 | </tr> | ||
| 420 | </table> | ||
| 421 | </div> | ||
| 422 | |||
| 423 | <div id="style_value_panel" class="panel"> | ||
| 424 | <textarea id="element_style_value"></textarea> | ||
| 425 | </div> | ||
| 426 | </div> | ||
| 427 | |||
| 428 | <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 429 | </fieldset> | ||
| 430 | |||
| 431 | <fieldset id="base_element"> | ||
| 432 | <legend>{#fullpage_dlg.base_element}</legend> | ||
| 433 | |||
| 434 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 435 | <tr> | ||
| 436 | <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td> | ||
| 437 | <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td> | ||
| 438 | </tr> | ||
| 439 | <tr> | ||
| 440 | <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td> | ||
| 441 | <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td> | ||
| 442 | </tr> | ||
| 443 | </table> | ||
| 444 | |||
| 445 | <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 446 | </fieldset> | ||
| 447 | |||
| 448 | <fieldset id="link_element"> | ||
| 449 | <legend>{#fullpage_dlg.link_element}</legend> | ||
| 450 | |||
| 451 | <div class="tabs"> | ||
| 452 | <ul> | ||
| 453 | <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li> | ||
| 454 | <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li> | ||
| 455 | </ul> | ||
| 456 | </div> | ||
| 457 | |||
| 458 | <br style="clear: both" /> | ||
| 459 | |||
| 460 | <div class="panel_wrapper"> | ||
| 461 | <div id="link_general_panel" class="panel current"> | ||
| 462 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 463 | <tr> | ||
| 464 | <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td> | ||
| 465 | <td><table border="0" cellpadding="0" cellspacing="0"> | ||
| 466 | <tr> | ||
| 467 | <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td> | ||
| 468 | <td id="link_href_pickcontainer"> </td> | ||
| 469 | </tr> | ||
| 470 | </table></td> | ||
| 471 | </tr> | ||
| 472 | <tr> | ||
| 473 | <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td> | ||
| 474 | <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td> | ||
| 475 | </tr> | ||
| 476 | <tr> | ||
| 477 | <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td> | ||
| 478 | <td><select id="element_link_type" name="element_link_type"> | ||
| 479 | <option value="text/css">text/css</option> | ||
| 480 | <option value="text/javascript">text/javascript</option> | ||
| 481 | </select></td> | ||
| 482 | </tr> | ||
| 483 | <tr> | ||
| 484 | <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td> | ||
| 485 | <td><select id="element_link_media" name="element_link_media"></select></td> | ||
| 486 | </tr> | ||
| 487 | <tr> | ||
| 488 | <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td> | ||
| 489 | <td><select id="element_style_rel" name="element_style_rel"> | ||
| 490 | <option value="">{#not_set}</option> | ||
| 491 | <option value="stylesheet">Stylesheet</option> | ||
| 492 | <option value="alternate">Alternate</option> | ||
| 493 | <option value="designates">Designates</option> | ||
| 494 | <option value="start">Start</option> | ||
| 495 | <option value="next">Next</option> | ||
| 496 | <option value="prev">Prev</option> | ||
| 497 | <option value="contents">Contents</option> | ||
| 498 | <option value="index">Index</option> | ||
| 499 | <option value="glossary">Glossary</option> | ||
| 500 | <option value="copyright">Copyright</option> | ||
| 501 | <option value="chapter">Chapter</option> | ||
| 502 | <option value="subsection">Subsection</option> | ||
| 503 | <option value="appendix">Appendix</option> | ||
| 504 | <option value="help">Help</option> | ||
| 505 | <option value="bookmark">Bookmark</option> | ||
| 506 | </select> | ||
| 507 | </td> | ||
| 508 | </tr> | ||
| 509 | </table> | ||
| 510 | </div> | ||
| 511 | |||
| 512 | <div id="link_advanced_panel" class="panel"> | ||
| 513 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 514 | <tr> | ||
| 515 | <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td> | ||
| 516 | <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td> | ||
| 517 | </tr> | ||
| 518 | <tr> | ||
| 519 | <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td> | ||
| 520 | <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td> | ||
| 521 | </tr> | ||
| 522 | <tr> | ||
| 523 | <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td> | ||
| 524 | <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td> | ||
| 525 | </tr> | ||
| 526 | <tr> | ||
| 527 | <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td> | ||
| 528 | <td><select id="element_style_rev" name="element_style_rev"> | ||
| 529 | <option value="">{#not_set}</option> | ||
| 530 | <option value="alternate">Alternate</option> | ||
| 531 | <option value="designates">Designates</option> | ||
| 532 | <option value="stylesheet">Stylesheet</option> | ||
| 533 | <option value="start">Start</option> | ||
| 534 | <option value="next">Next</option> | ||
| 535 | <option value="prev">Prev</option> | ||
| 536 | <option value="contents">Contents</option> | ||
| 537 | <option value="index">Index</option> | ||
| 538 | <option value="glossary">Glossary</option> | ||
| 539 | <option value="copyright">Copyright</option> | ||
| 540 | <option value="chapter">Chapter</option> | ||
| 541 | <option value="subsection">Subsection</option> | ||
| 542 | <option value="appendix">Appendix</option> | ||
| 543 | <option value="help">Help</option> | ||
| 544 | <option value="bookmark">Bookmark</option> | ||
| 545 | </select> | ||
| 546 | </td> | ||
| 547 | </tr> | ||
| 548 | </table> | ||
| 549 | </div> | ||
| 550 | </div> | ||
| 551 | |||
| 552 | <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 553 | </fieldset> | ||
| 554 | |||
| 555 | <fieldset id="comment_element"> | ||
| 556 | <legend>{#fullpage_dlg.comment_element}</legend> | ||
| 557 | |||
| 558 | <textarea id="element_comment_value"></textarea> | ||
| 559 | |||
| 560 | <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" /> | ||
| 561 | </fieldset> | ||
| 562 | </div> | ||
| 563 | </div> | ||
| 564 | |||
| 565 | <div class="mceActionPanel"> | ||
| 566 | <div style="float: left"> | ||
| 567 | <input type="submit" id="insert" name="update" value="{#update}" /> | ||
| 568 | </div> | ||
| 569 | |||
| 570 | <div style="float: right"> | ||
| 571 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 572 | </div> | ||
| 573 | </div> | ||
| 574 | </form> | ||
| 575 | </body> | ||
| 576 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js deleted file mode 100644 index dd3a29c..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +++ /dev/null | |||
| @@ -1,461 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var doc; | ||
| 4 | |||
| 5 | var defaultDocTypes = | ||
| 6 | 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' + | ||
| 7 | 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' + | ||
| 8 | 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' + | ||
| 9 | 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' + | ||
| 10 | 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' + | ||
| 11 | 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' + | ||
| 12 | 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'; | ||
| 13 | |||
| 14 | var defaultEncodings = | ||
| 15 | 'Western european (iso-8859-1)=iso-8859-1,' + | ||
| 16 | 'Central European (iso-8859-2)=iso-8859-2,' + | ||
| 17 | 'Unicode (UTF-8)=utf-8,' + | ||
| 18 | 'Chinese traditional (Big5)=big5,' + | ||
| 19 | 'Cyrillic (iso-8859-5)=iso-8859-5,' + | ||
| 20 | 'Japanese (iso-2022-jp)=iso-2022-jp,' + | ||
| 21 | 'Greek (iso-8859-7)=iso-8859-7,' + | ||
| 22 | 'Korean (iso-2022-kr)=iso-2022-kr,' + | ||
| 23 | 'ASCII (us-ascii)=us-ascii'; | ||
| 24 | |||
| 25 | var defaultMediaTypes = | ||
| 26 | 'all=all,' + | ||
| 27 | 'screen=screen,' + | ||
| 28 | 'print=print,' + | ||
| 29 | 'tty=tty,' + | ||
| 30 | 'tv=tv,' + | ||
| 31 | 'projection=projection,' + | ||
| 32 | 'handheld=handheld,' + | ||
| 33 | 'braille=braille,' + | ||
| 34 | 'aural=aural'; | ||
| 35 | |||
| 36 | var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; | ||
| 37 | var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; | ||
| 38 | |||
| 39 | function init() { | ||
| 40 | var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style; | ||
| 41 | |||
| 42 | // Setup doctype select box | ||
| 43 | doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(','); | ||
| 44 | for (i=0; i<doctypes.length; i++) { | ||
| 45 | p = doctypes[i].split('='); | ||
| 46 | |||
| 47 | if (p.length > 1) | ||
| 48 | addSelectValue(f, 'doctypes', p[0], p[1]); | ||
| 49 | } | ||
| 50 | |||
| 51 | // Setup fonts select box | ||
| 52 | fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';'); | ||
| 53 | for (i=0; i<fonts.length; i++) { | ||
| 54 | p = fonts[i].split('='); | ||
| 55 | |||
| 56 | if (p.length > 1) | ||
| 57 | addSelectValue(f, 'fontface', p[0], p[1]); | ||
| 58 | } | ||
| 59 | |||
| 60 | // Setup fontsize select box | ||
| 61 | fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(','); | ||
| 62 | for (i=0; i<fonts.length; i++) | ||
| 63 | addSelectValue(f, 'fontsize', fonts[i], fonts[i]); | ||
| 64 | |||
| 65 | // Setup mediatype select boxs | ||
| 66 | mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(','); | ||
| 67 | for (i=0; i<mediaTypes.length; i++) { | ||
| 68 | p = mediaTypes[i].split('='); | ||
| 69 | |||
| 70 | if (p.length > 1) { | ||
| 71 | addSelectValue(f, 'element_style_media', p[0], p[1]); | ||
| 72 | addSelectValue(f, 'element_link_media', p[0], p[1]); | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | // Setup encodings select box | ||
| 77 | encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(','); | ||
| 78 | for (i=0; i<encodings.length; i++) { | ||
| 79 | p = encodings[i].split('='); | ||
| 80 | |||
| 81 | if (p.length > 1) { | ||
| 82 | addSelectValue(f, 'docencoding', p[0], p[1]); | ||
| 83 | addSelectValue(f, 'element_script_charset', p[0], p[1]); | ||
| 84 | addSelectValue(f, 'element_link_charset', p[0], p[1]); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 89 | document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); | ||
| 90 | //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color'); | ||
| 91 | document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); | ||
| 92 | document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); | ||
| 93 | document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); | ||
| 94 | document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); | ||
| 95 | document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage'); | ||
| 96 | document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage'); | ||
| 97 | document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); | ||
| 98 | |||
| 99 | // Resize some elements | ||
| 100 | if (isVisible('stylesheetbrowser')) | ||
| 101 | document.getElementById('stylesheet').style.width = '220px'; | ||
| 102 | |||
| 103 | if (isVisible('link_href_browser')) | ||
| 104 | document.getElementById('element_link_href').style.width = '230px'; | ||
| 105 | |||
| 106 | if (isVisible('bgimage_browser')) | ||
| 107 | document.getElementById('bgimage').style.width = '210px'; | ||
| 108 | |||
| 109 | // Add iframe | ||
| 110 | dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}}); | ||
| 111 | doc = dom.get('documentIframe').contentWindow.document; | ||
| 112 | h = tinyMCEPopup.getWindowArg('head_html'); | ||
| 113 | |||
| 114 | // Preprocess the HTML disable scripts and urls | ||
| 115 | h = h.replace(/<script>/gi, '<script type="text/javascript">'); | ||
| 116 | h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-'); | ||
| 117 | h = h.replace(/(src=|href=)/g, 'mce_$1'); | ||
| 118 | |||
| 119 | // Write in the content in the iframe | ||
| 120 | doc.write(h + '</body></html>'); | ||
| 121 | doc.close(); | ||
| 122 | |||
| 123 | // Parse xml and doctype | ||
| 124 | xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); | ||
| 125 | xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1); | ||
| 126 | docType = getReItem(/<\!DOCTYPE.*?>/gi, h.replace(/\n/g, ''), 0).replace(/ +/g, ' '); | ||
| 127 | f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1); | ||
| 128 | |||
| 129 | // Parse title | ||
| 130 | if (e = doc.getElementsByTagName('title')[0]) | ||
| 131 | el.metatitle.value = e.textContent || e.text; | ||
| 132 | |||
| 133 | // Parse meta | ||
| 134 | tinymce.each(doc.getElementsByTagName('meta'), function(n) { | ||
| 135 | var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || ''; | ||
| 136 | |||
| 137 | e = el['meta' + na]; | ||
| 138 | |||
| 139 | if (na == 'robots') { | ||
| 140 | selectByValue(f, 'metarobots', tinymce.trim(va), true, true); | ||
| 141 | return; | ||
| 142 | } | ||
| 143 | |||
| 144 | switch (eq.toLowerCase()) { | ||
| 145 | case "content-type": | ||
| 146 | tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1); | ||
| 147 | |||
| 148 | // Override XML encoding | ||
| 149 | if (tmp != "") | ||
| 150 | xmlEnc = tmp; | ||
| 151 | |||
| 152 | return; | ||
| 153 | } | ||
| 154 | |||
| 155 | if (e) | ||
| 156 | e.value = va; | ||
| 157 | }); | ||
| 158 | |||
| 159 | selectByValue(f, 'doctypes', docType, true, true); | ||
| 160 | selectByValue(f, 'docencoding', xmlEnc, true, true); | ||
| 161 | selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true); | ||
| 162 | |||
| 163 | if (xmlVer != '') | ||
| 164 | el.xml_pi.checked = true; | ||
| 165 | |||
| 166 | // Parse appearance | ||
| 167 | |||
| 168 | // Parse primary stylesheet | ||
| 169 | tinymce.each(doc.getElementsByTagName("link"), function(l) { | ||
| 170 | var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || ''; | ||
| 171 | |||
| 172 | if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") { | ||
| 173 | f.stylesheet.value = l.getAttribute('mce_href', 2) || ''; | ||
| 174 | return false; | ||
| 175 | } | ||
| 176 | }); | ||
| 177 | |||
| 178 | // Get from style elements | ||
| 179 | tinymce.each(doc.getElementsByTagName("style"), function(st) { | ||
| 180 | var tmp = parseStyleElement(st); | ||
| 181 | |||
| 182 | for (x=0; x<tmp.length; x++) { | ||
| 183 | if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color']) | ||
| 184 | f.visited_color.value = tmp[x].data['color']; | ||
| 185 | |||
| 186 | if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color']) | ||
| 187 | f.link_color.value = tmp[x].data['color']; | ||
| 188 | |||
| 189 | if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color']) | ||
| 190 | f.active_color.value = tmp[x].data['color']; | ||
| 191 | } | ||
| 192 | }); | ||
| 193 | |||
| 194 | f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text"); | ||
| 195 | f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink"); | ||
| 196 | f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link"); | ||
| 197 | f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink"); | ||
| 198 | f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor"); | ||
| 199 | f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background"); | ||
| 200 | |||
| 201 | // Get from style info | ||
| 202 | style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style')); | ||
| 203 | |||
| 204 | if (style['font-family']) | ||
| 205 | selectByValue(f, 'fontface', style['font-family'], true, true); | ||
| 206 | else | ||
| 207 | selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true); | ||
| 208 | |||
| 209 | if (style['font-size']) | ||
| 210 | selectByValue(f, 'fontsize', style['font-size'], true, true); | ||
| 211 | else | ||
| 212 | selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true); | ||
| 213 | |||
| 214 | if (style['color']) | ||
| 215 | f.textcolor.value = convertRGBToHex(style['color']); | ||
| 216 | |||
| 217 | if (style['background-image']) | ||
| 218 | f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 219 | |||
| 220 | if (style['background-color']) | ||
| 221 | f.bgcolor.value = style['background-color']; | ||
| 222 | |||
| 223 | if (style['margin']) { | ||
| 224 | tmp = style['margin'].replace(/[^0-9 ]/g, ''); | ||
| 225 | tmp = tmp.split(/ +/); | ||
| 226 | f.topmargin.value = tmp.length > 0 ? tmp[0] : ''; | ||
| 227 | f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0]; | ||
| 228 | f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0]; | ||
| 229 | f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0]; | ||
| 230 | } | ||
| 231 | |||
| 232 | if (style['margin-left']) | ||
| 233 | f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, ''); | ||
| 234 | |||
| 235 | if (style['margin-right']) | ||
| 236 | f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, ''); | ||
| 237 | |||
| 238 | if (style['margin-top']) | ||
| 239 | f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, ''); | ||
| 240 | |||
| 241 | if (style['margin-bottom']) | ||
| 242 | f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, ''); | ||
| 243 | |||
| 244 | f.style.value = tinyMCEPopup.dom.serializeStyle(style); | ||
| 245 | |||
| 246 | // Update colors | ||
| 247 | updateColor('textcolor_pick', 'textcolor'); | ||
| 248 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 249 | updateColor('visited_color_pick', 'visited_color'); | ||
| 250 | updateColor('active_color_pick', 'active_color'); | ||
| 251 | updateColor('link_color_pick', 'link_color'); | ||
| 252 | } | ||
| 253 | |||
| 254 | function getReItem(r, s, i) { | ||
| 255 | var c = r.exec(s); | ||
| 256 | |||
| 257 | if (c && c.length > i) | ||
| 258 | return c[i]; | ||
| 259 | |||
| 260 | return ''; | ||
| 261 | } | ||
| 262 | |||
| 263 | function updateAction() { | ||
| 264 | var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser; | ||
| 265 | |||
| 266 | head = doc.getElementsByTagName('head')[0]; | ||
| 267 | |||
| 268 | // Fix scripts without a type | ||
| 269 | nl = doc.getElementsByTagName('script'); | ||
| 270 | for (i=0; i<nl.length; i++) { | ||
| 271 | if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '') | ||
| 272 | nl[i].setAttribute('mce_type', 'text/javascript'); | ||
| 273 | } | ||
| 274 | |||
| 275 | // Get primary stylesheet | ||
| 276 | nl = doc.getElementsByTagName("link"); | ||
| 277 | for (i=0; i<nl.length; i++) { | ||
| 278 | l = nl[i]; | ||
| 279 | |||
| 280 | tmp = tinyMCEPopup.dom.getAttrib(l, 'media'); | ||
| 281 | |||
| 282 | if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") { | ||
| 283 | addlink = false; | ||
| 284 | |||
| 285 | if (f.stylesheet.value == '') | ||
| 286 | l.parentNode.removeChild(l); | ||
| 287 | else | ||
| 288 | l.setAttribute('mce_href', f.stylesheet.value); | ||
| 289 | |||
| 290 | break; | ||
| 291 | } | ||
| 292 | } | ||
| 293 | |||
| 294 | // Add new link | ||
| 295 | if (f.stylesheet.value != '') { | ||
| 296 | l = doc.createElement('link'); | ||
| 297 | |||
| 298 | l.setAttribute('type', 'text/css'); | ||
| 299 | l.setAttribute('mce_href', f.stylesheet.value); | ||
| 300 | l.setAttribute('rel', 'stylesheet'); | ||
| 301 | |||
| 302 | head.appendChild(l); | ||
| 303 | } | ||
| 304 | |||
| 305 | setMeta(head, 'keywords', f.metakeywords.value); | ||
| 306 | setMeta(head, 'description', f.metadescription.value); | ||
| 307 | setMeta(head, 'author', f.metaauthor.value); | ||
| 308 | setMeta(head, 'copyright', f.metacopyright.value); | ||
| 309 | setMeta(head, 'robots', getSelectValue(f, 'metarobots')); | ||
| 310 | setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding')); | ||
| 311 | |||
| 312 | doc.body.dir = getSelectValue(f, 'langdir'); | ||
| 313 | doc.body.style.cssText = f.style.value; | ||
| 314 | |||
| 315 | doc.body.setAttribute('vLink', f.visited_color.value); | ||
| 316 | doc.body.setAttribute('link', f.link_color.value); | ||
| 317 | doc.body.setAttribute('text', f.textcolor.value); | ||
| 318 | doc.body.setAttribute('aLink', f.active_color.value); | ||
| 319 | |||
| 320 | doc.body.style.fontFamily = getSelectValue(f, 'fontface'); | ||
| 321 | doc.body.style.fontSize = getSelectValue(f, 'fontsize'); | ||
| 322 | doc.body.style.backgroundColor = f.bgcolor.value; | ||
| 323 | |||
| 324 | if (f.leftmargin.value != '') | ||
| 325 | doc.body.style.marginLeft = f.leftmargin.value + 'px'; | ||
| 326 | |||
| 327 | if (f.rightmargin.value != '') | ||
| 328 | doc.body.style.marginRight = f.rightmargin.value + 'px'; | ||
| 329 | |||
| 330 | if (f.bottommargin.value != '') | ||
| 331 | doc.body.style.marginBottom = f.bottommargin.value + 'px'; | ||
| 332 | |||
| 333 | if (f.topmargin.value != '') | ||
| 334 | doc.body.style.marginTop = f.topmargin.value + 'px'; | ||
| 335 | |||
| 336 | html = doc.getElementsByTagName('html')[0]; | ||
| 337 | html.setAttribute('lang', f.langcode.value); | ||
| 338 | html.setAttribute('xml:lang', f.langcode.value); | ||
| 339 | |||
| 340 | if (f.bgimage.value != '') | ||
| 341 | doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')"; | ||
| 342 | else | ||
| 343 | doc.body.style.backgroundImage = ''; | ||
| 344 | |||
| 345 | ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer(); | ||
| 346 | ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head'); | ||
| 347 | |||
| 348 | h = ser.serialize(doc.documentElement); | ||
| 349 | h = h.substring(0, h.lastIndexOf('</body>')); | ||
| 350 | |||
| 351 | if (h.indexOf('<title>') == -1) | ||
| 352 | h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); | ||
| 353 | else | ||
| 354 | h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>'); | ||
| 355 | |||
| 356 | if ((v = getSelectValue(f, 'doctypes')) != '') | ||
| 357 | h = v + '\n' + h; | ||
| 358 | |||
| 359 | if (f.xml_pi.checked) { | ||
| 360 | s = '<?xml version="1.0"'; | ||
| 361 | |||
| 362 | if ((v = getSelectValue(f, 'docencoding')) != '') | ||
| 363 | s += ' encoding="' + v + '"'; | ||
| 364 | |||
| 365 | s += '?>\n'; | ||
| 366 | h = s + h; | ||
| 367 | } | ||
| 368 | |||
| 369 | h = h.replace(/type=\"\-mce\-/gi, 'type="'); | ||
| 370 | |||
| 371 | tinyMCEPopup.editor.plugins.fullpage.head = h; | ||
| 372 | tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {}); | ||
| 373 | tinyMCEPopup.close(); | ||
| 374 | } | ||
| 375 | |||
| 376 | function changedStyleField(field) { | ||
| 377 | } | ||
| 378 | |||
| 379 | function setMeta(he, k, v) { | ||
| 380 | var nl, i, m; | ||
| 381 | |||
| 382 | nl = he.getElementsByTagName('meta'); | ||
| 383 | for (i=0; i<nl.length; i++) { | ||
| 384 | if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) { | ||
| 385 | if (v == '') | ||
| 386 | nl[i].parentNode.removeChild(nl[i]); | ||
| 387 | else | ||
| 388 | nl[i].setAttribute('content', "text/html; charset=" + v); | ||
| 389 | |||
| 390 | return; | ||
| 391 | } | ||
| 392 | |||
| 393 | if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) { | ||
| 394 | if (v == '') | ||
| 395 | nl[i].parentNode.removeChild(nl[i]); | ||
| 396 | else | ||
| 397 | nl[i].setAttribute('content', v); | ||
| 398 | return; | ||
| 399 | } | ||
| 400 | } | ||
| 401 | |||
| 402 | if (v == '') | ||
| 403 | return; | ||
| 404 | |||
| 405 | m = doc.createElement('meta'); | ||
| 406 | |||
| 407 | if (k == 'Content-Type') | ||
| 408 | m.httpEquiv = k; | ||
| 409 | else | ||
| 410 | m.setAttribute('name', k); | ||
| 411 | |||
| 412 | m.setAttribute('content', v); | ||
| 413 | he.appendChild(m); | ||
| 414 | } | ||
| 415 | |||
| 416 | function parseStyleElement(e) { | ||
| 417 | var v = e.innerHTML; | ||
| 418 | var p, i, r; | ||
| 419 | |||
| 420 | v = v.replace(/<!--/gi, ''); | ||
| 421 | v = v.replace(/-->/gi, ''); | ||
| 422 | v = v.replace(/[\n\r]/gi, ''); | ||
| 423 | v = v.replace(/\s+/gi, ' '); | ||
| 424 | |||
| 425 | r = []; | ||
| 426 | p = v.split(/{|}/); | ||
| 427 | |||
| 428 | for (i=0; i<p.length; i+=2) { | ||
| 429 | if (p[i] != "") | ||
| 430 | r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])}; | ||
| 431 | } | ||
| 432 | |||
| 433 | return r; | ||
| 434 | } | ||
| 435 | |||
| 436 | function serializeStyleElement(d) { | ||
| 437 | var i, s, st; | ||
| 438 | |||
| 439 | s = '<!--\n'; | ||
| 440 | |||
| 441 | for (i=0; i<d.length; i++) { | ||
| 442 | s += d[i].rule + ' {\n'; | ||
| 443 | |||
| 444 | st = tinyMCE.serializeStyle(d[i].data); | ||
| 445 | |||
| 446 | if (st != '') | ||
| 447 | st += ';'; | ||
| 448 | |||
| 449 | s += st.replace(/;/g, ';\n'); | ||
| 450 | s += '}\n'; | ||
| 451 | |||
| 452 | if (i != d.length - 1) | ||
| 453 | s += '\n'; | ||
| 454 | } | ||
| 455 | |||
| 456 | s += '\n-->'; | ||
| 457 | |||
| 458 | return s; | ||
| 459 | } | ||
| 460 | |||
| 461 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js deleted file mode 100644 index f5801b8..0000000 --- a/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.fullpage_dlg',{ | ||
| 2 | title:"Document properties", | ||
| 3 | meta_tab:"General", | ||
| 4 | appearance_tab:"Appearance", | ||
| 5 | advanced_tab:"Advanced", | ||
| 6 | meta_props:"Meta information", | ||
| 7 | langprops:"Language and encoding", | ||
| 8 | meta_title:"Title", | ||
| 9 | meta_keywords:"Keywords", | ||
| 10 | meta_description:"Description", | ||
| 11 | meta_robots:"Robots", | ||
| 12 | doctypes:"Doctype", | ||
| 13 | langcode:"Language code", | ||
| 14 | langdir:"Language direction", | ||
| 15 | ltr:"Left to right", | ||
| 16 | rtl:"Right to left", | ||
| 17 | xml_pi:"XML declaration", | ||
| 18 | encoding:"Character encoding", | ||
| 19 | appearance_bgprops:"Background properties", | ||
| 20 | appearance_marginprops:"Body margins", | ||
| 21 | appearance_linkprops:"Link colors", | ||
| 22 | appearance_textprops:"Text properties", | ||
| 23 | bgcolor:"Background color", | ||
| 24 | bgimage:"Background image", | ||
| 25 | left_margin:"Left margin", | ||
| 26 | right_margin:"Right margin", | ||
| 27 | top_margin:"Top margin", | ||
| 28 | bottom_margin:"Bottom margin", | ||
| 29 | text_color:"Text color", | ||
| 30 | font_size:"Font size", | ||
| 31 | font_face:"Font face", | ||
| 32 | link_color:"Link color", | ||
| 33 | hover_color:"Hover color", | ||
| 34 | visited_color:"Visited color", | ||
| 35 | active_color:"Active color", | ||
| 36 | textcolor:"Color", | ||
| 37 | fontsize:"Font size", | ||
| 38 | fontface:"Font family", | ||
| 39 | meta_index_follow:"Index and 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", | ||
| 42 | meta_noindex_nofollow:"Do not index and don\'t follow the links", | ||
| 43 | appearance_style:"Stylesheet and style properties", | ||
| 44 | stylesheet:"Stylesheet", | ||
| 45 | style:"Style", | ||
| 46 | author:"Author", | ||
| 47 | copyright:"Copyright", | ||
| 48 | add:"Add new element", | ||
| 49 | remove:"Remove selected element", | ||
| 50 | moveup:"Move selected element up", | ||
| 51 | movedown:"Move selected element down", | ||
| 52 | head_elements:"Head elements", | ||
| 53 | info:"Information", | ||
| 54 | add_title:"Title element", | ||
| 55 | add_meta:"Meta element", | ||
| 56 | add_script:"Script element", | ||
| 57 | add_style:"Style element", | ||
| 58 | add_link:"Link element", | ||
| 59 | add_base:"Base element", | ||
| 60 | add_comment:"Comment node", | ||
| 61 | title_element:"Title element", | ||
| 62 | script_element:"Script element", | ||
| 63 | style_element:"Style element", | ||
| 64 | base_element:"Base element", | ||
| 65 | link_element:"Link element", | ||
| 66 | meta_element:"Meta element", | ||
| 67 | comment_element:"Comment", | ||
| 68 | src:"Src", | ||
| 69 | language:"Language", | ||
| 70 | href:"Href", | ||
| 71 | target:"Target", | ||
| 72 | type:"Type", | ||
| 73 | charset:"Charset", | ||
| 74 | defer:"Defer", | ||
| 75 | media:"Media", | ||
| 76 | properties:"Properties", | ||
| 77 | name:"Name", | ||
| 78 | value:"Value", | ||
| 79 | content:"Content", | ||
| 80 | rel:"Rel", | ||
| 81 | rev:"Rev", | ||
| 82 | hreflang:"Href lang", | ||
| 83 | general_props:"General", | ||
| 84 | advanced_props:"Advanced" | ||
| 85 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js deleted file mode 100644 index dfb3f16..0000000 --- a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js deleted file mode 100644 index 77a8c3b..0000000 --- a/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 923 2008-09-09 16:45:29Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.FullScreenPlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, s = {}, vp; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | |||
| 17 | // Register commands | ||
| 18 | ed.addCommand('mceFullScreen', function() { | ||
| 19 | var win, de = DOM.doc.documentElement; | ||
| 20 | |||
| 21 | if (ed.getParam('fullscreen_is_enabled')) { | ||
| 22 | if (ed.getParam('fullscreen_new_window')) | ||
| 23 | closeFullscreen(); // Call to close in new window | ||
| 24 | else { | ||
| 25 | DOM.win.setTimeout(function() { | ||
| 26 | tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); | ||
| 27 | tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); | ||
| 28 | tinyMCE.remove(ed); | ||
| 29 | DOM.remove('mce_fullscreen_container'); | ||
| 30 | de.style.overflow = ed.getParam('fullscreen_html_overflow'); | ||
| 31 | DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); | ||
| 32 | DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); | ||
| 33 | tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings | ||
| 34 | }, 10); | ||
| 35 | } | ||
| 36 | |||
| 37 | return; | ||
| 38 | } | ||
| 39 | |||
| 40 | if (ed.getParam('fullscreen_new_window')) { | ||
| 41 | win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); | ||
| 42 | try { | ||
| 43 | win.resizeTo(screen.availWidth, screen.availHeight); | ||
| 44 | } catch (e) { | ||
| 45 | // Ignore | ||
| 46 | } | ||
| 47 | } else { | ||
| 48 | tinyMCE.oldSettings = tinyMCE.settings; // Store old settings | ||
| 49 | s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; | ||
| 50 | s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); | ||
| 51 | vp = DOM.getViewPort(); | ||
| 52 | s.fullscreen_scrollx = vp.x; | ||
| 53 | s.fullscreen_scrolly = vp.y; | ||
| 54 | |||
| 55 | // Fixes an Opera bug where the scrollbars doesn't reappear | ||
| 56 | if (tinymce.isOpera && s.fullscreen_overflow == 'visible') | ||
| 57 | s.fullscreen_overflow = 'auto'; | ||
| 58 | |||
| 59 | // Fixes an IE bug where horizontal scrollbars would appear | ||
| 60 | if (tinymce.isIE && s.fullscreen_overflow == 'scroll') | ||
| 61 | s.fullscreen_overflow = 'auto'; | ||
| 62 | |||
| 63 | // Fixes an IE bug where the scrollbars doesn't reappear | ||
| 64 | if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) | ||
| 65 | s.fullscreen_html_overflow = 'auto'; | ||
| 66 | |||
| 67 | if (s.fullscreen_overflow == '0px') | ||
| 68 | s.fullscreen_overflow = ''; | ||
| 69 | |||
| 70 | DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); | ||
| 71 | de.style.overflow = 'hidden'; //Fix for IE6/7 | ||
| 72 | vp = DOM.getViewPort(); | ||
| 73 | DOM.win.scrollTo(0, 0); | ||
| 74 | |||
| 75 | if (tinymce.isIE) | ||
| 76 | vp.h -= 1; | ||
| 77 | |||
| 78 | n = DOM.add(DOM.doc.body, 'div', {id : 'mce_fullscreen_container', style : 'position:' + (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel) ? 'absolute' : 'fixed') + ';top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); | ||
| 79 | DOM.add(n, 'div', {id : 'mce_fullscreen'}); | ||
| 80 | |||
| 81 | tinymce.each(ed.settings, function(v, n) { | ||
| 82 | s[n] = v; | ||
| 83 | }); | ||
| 84 | |||
| 85 | s.id = 'mce_fullscreen'; | ||
| 86 | s.width = n.clientWidth; | ||
| 87 | s.height = n.clientHeight - 15; | ||
| 88 | s.fullscreen_is_enabled = true; | ||
| 89 | s.fullscreen_editor_id = ed.id; | ||
| 90 | s.theme_advanced_resizing = false; | ||
| 91 | s.save_onsavecallback = function() { | ||
| 92 | ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'}); | ||
| 93 | ed.execCommand('mceSave'); | ||
| 94 | }; | ||
| 95 | |||
| 96 | tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { | ||
| 97 | s[k] = v; | ||
| 98 | }); | ||
| 99 | |||
| 100 | if (s.theme_advanced_toolbar_location === 'external') | ||
| 101 | s.theme_advanced_toolbar_location = 'top'; | ||
| 102 | |||
| 103 | t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); | ||
| 104 | t.fullscreenEditor.onInit.add(function() { | ||
| 105 | t.fullscreenEditor.setContent(ed.getContent()); | ||
| 106 | t.fullscreenEditor.focus(); | ||
| 107 | }); | ||
| 108 | |||
| 109 | t.fullscreenEditor.render(); | ||
| 110 | tinyMCE.add(t.fullscreenEditor); | ||
| 111 | |||
| 112 | t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); | ||
| 113 | t.fullscreenElement.update(); | ||
| 114 | //document.body.overflow = 'hidden'; | ||
| 115 | |||
| 116 | t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { | ||
| 117 | var vp = tinymce.DOM.getViewPort(); | ||
| 118 | |||
| 119 | t.fullscreenEditor.theme.resizeTo(vp.w, vp.h); | ||
| 120 | }); | ||
| 121 | } | ||
| 122 | }); | ||
| 123 | |||
| 124 | // Register buttons | ||
| 125 | ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); | ||
| 126 | |||
| 127 | ed.onNodeChange.add(function(ed, cm) { | ||
| 128 | cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); | ||
| 129 | }); | ||
| 130 | }, | ||
| 131 | |||
| 132 | getInfo : function() { | ||
| 133 | return { | ||
| 134 | longname : 'Fullscreen', | ||
| 135 | author : 'Moxiecode Systems AB', | ||
| 136 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 137 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', | ||
| 138 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 139 | }; | ||
| 140 | } | ||
| 141 | }); | ||
| 142 | |||
| 143 | // Register plugin | ||
| 144 | tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); | ||
| 145 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm b/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm deleted file mode 100644 index 6ec4f26..0000000 --- a/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +++ /dev/null | |||
| @@ -1,110 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title></title> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 6 | <script type="text/javascript" src="../../tiny_mce.js"></script> | ||
| 7 | <script type="text/javascript"> | ||
| 8 | function patchCallback(settings, key) { | ||
| 9 | if (settings[key]) | ||
| 10 | settings[key] = "window.opener." + settings[key]; | ||
| 11 | } | ||
| 12 | |||
| 13 | var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id; | ||
| 14 | |||
| 15 | // Clone array | ||
| 16 | for (var n in paSe) | ||
| 17 | settings[n] = paSe[n]; | ||
| 18 | |||
| 19 | // Override options for fullscreen | ||
| 20 | for (var n in paSe.fullscreen_settings) | ||
| 21 | settings[n] = paSe.fullscreen_settings[n]; | ||
| 22 | |||
| 23 | // Patch callbacks, make them point to window.opener | ||
| 24 | patchCallback(settings, 'urlconverter_callback'); | ||
| 25 | patchCallback(settings, 'insertlink_callback'); | ||
| 26 | patchCallback(settings, 'insertimage_callback'); | ||
| 27 | patchCallback(settings, 'setupcontent_callback'); | ||
| 28 | patchCallback(settings, 'save_callback'); | ||
| 29 | patchCallback(settings, 'onchange_callback'); | ||
| 30 | patchCallback(settings, 'init_instance_callback'); | ||
| 31 | patchCallback(settings, 'file_browser_callback'); | ||
| 32 | patchCallback(settings, 'cleanup_callback'); | ||
| 33 | patchCallback(settings, 'execcommand_callback'); | ||
| 34 | patchCallback(settings, 'oninit'); | ||
| 35 | |||
| 36 | // Set options | ||
| 37 | delete settings.id; | ||
| 38 | settings['mode'] = 'exact'; | ||
| 39 | settings['elements'] = 'fullscreenarea'; | ||
| 40 | settings['add_unload_trigger'] = false; | ||
| 41 | settings['ask'] = false; | ||
| 42 | settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI(); | ||
| 43 | settings['fullscreen_is_enabled'] = true; | ||
| 44 | settings['fullscreen_editor_id'] = oeID; | ||
| 45 | settings['theme_advanced_resizing'] = false; | ||
| 46 | settings['strict_loading_mode'] = true; | ||
| 47 | |||
| 48 | settings.save_onsavecallback = function() { | ||
| 49 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'}); | ||
| 50 | window.opener.tinyMCE.get(oeID).execCommand('mceSave'); | ||
| 51 | window.close(); | ||
| 52 | }; | ||
| 53 | |||
| 54 | function unloadHandler(e) { | ||
| 55 | moveContent(); | ||
| 56 | } | ||
| 57 | |||
| 58 | function moveContent() { | ||
| 59 | window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent()); | ||
| 60 | } | ||
| 61 | |||
| 62 | function closeFullscreen() { | ||
| 63 | moveContent(); | ||
| 64 | window.close(); | ||
| 65 | } | ||
| 66 | |||
| 67 | function doParentSubmit() { | ||
| 68 | moveContent(); | ||
| 69 | |||
| 70 | if (window.opener.tinyMCE.selectedInstance.formElement.form) | ||
| 71 | window.opener.tinyMCE.selectedInstance.formElement.form.submit(); | ||
| 72 | |||
| 73 | window.close(); | ||
| 74 | |||
| 75 | return false; | ||
| 76 | } | ||
| 77 | |||
| 78 | function render() { | ||
| 79 | var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM; | ||
| 80 | |||
| 81 | e.value = window.opener.tinyMCE.get(oeID).getContent(); | ||
| 82 | |||
| 83 | vp = dom.getViewPort(); | ||
| 84 | settings.width = vp.w; | ||
| 85 | settings.height = vp.h - 15; | ||
| 86 | |||
| 87 | tinymce.dom.Event.add(window, 'resize', function() { | ||
| 88 | var vp = dom.getViewPort(); | ||
| 89 | |||
| 90 | tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h); | ||
| 91 | }); | ||
| 92 | |||
| 93 | tinyMCE.init(settings); | ||
| 94 | } | ||
| 95 | |||
| 96 | // Add onunload | ||
| 97 | tinymce.dom.Event.add(window, "beforeunload", unloadHandler); | ||
| 98 | </script> | ||
| 99 | </head> | ||
| 100 | <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> | ||
| 101 | <form onsubmit="doParentSubmit();"> | ||
| 102 | <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> | ||
| 103 | </form> | ||
| 104 | |||
| 105 | <script type="text/javascript"> | ||
| 106 | render(); | ||
| 107 | </script> | ||
| 108 | |||
| 109 | </body> | ||
| 110 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js deleted file mode 100644 index e9cba10..0000000 --- a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js deleted file mode 100644 index a68f69a..0000000 --- a/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.IESpell', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, sp; | ||
| 12 | |||
| 13 | if (!tinymce.isIE) | ||
| 14 | return; | ||
| 15 | |||
| 16 | t.editor = ed; | ||
| 17 | |||
| 18 | // Register commands | ||
| 19 | ed.addCommand('mceIESpell', function() { | ||
| 20 | try { | ||
| 21 | sp = new ActiveXObject("ieSpell.ieSpellExtension"); | ||
| 22 | sp.CheckDocumentNode(ed.getDoc().documentElement); | ||
| 23 | } catch (e) { | ||
| 24 | if (e.number == -2146827859) { | ||
| 25 | ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { | ||
| 26 | if (s) | ||
| 27 | window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); | ||
| 28 | }); | ||
| 29 | } else | ||
| 30 | ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); | ||
| 31 | } | ||
| 32 | }); | ||
| 33 | |||
| 34 | // Register buttons | ||
| 35 | ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); | ||
| 36 | }, | ||
| 37 | |||
| 38 | getInfo : function() { | ||
| 39 | return { | ||
| 40 | longname : 'IESpell (IE Only)', | ||
| 41 | author : 'Moxiecode Systems AB', | ||
| 42 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 43 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', | ||
| 44 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 45 | }; | ||
| 46 | } | ||
| 47 | }); | ||
| 48 | |||
| 49 | // Register plugin | ||
| 50 | tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); | ||
| 51 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js deleted file mode 100644 index 07ea477..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js deleted file mode 100644 index fffca5a..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,632 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.InlinePopups', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | // Replace window manager | ||
| 14 | ed.onBeforeRenderUI.add(function() { | ||
| 15 | ed.windowManager = new tinymce.InlineWindowManager(ed); | ||
| 16 | DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); | ||
| 17 | }); | ||
| 18 | }, | ||
| 19 | |||
| 20 | getInfo : function() { | ||
| 21 | return { | ||
| 22 | longname : 'InlinePopups', | ||
| 23 | author : 'Moxiecode Systems AB', | ||
| 24 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 25 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', | ||
| 26 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 27 | }; | ||
| 28 | } | ||
| 29 | }); | ||
| 30 | |||
| 31 | tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { | ||
| 32 | InlineWindowManager : function(ed) { | ||
| 33 | var t = this; | ||
| 34 | |||
| 35 | t.parent(ed); | ||
| 36 | t.zIndex = 300000; | ||
| 37 | t.count = 0; | ||
| 38 | t.windows = {}; | ||
| 39 | }, | ||
| 40 | |||
| 41 | open : function(f, p) { | ||
| 42 | var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u; | ||
| 43 | |||
| 44 | f = f || {}; | ||
| 45 | p = p || {}; | ||
| 46 | |||
| 47 | // Run native windows | ||
| 48 | if (!f.inline) | ||
| 49 | return t.parent(f, p); | ||
| 50 | |||
| 51 | // Only store selection if the type is a normal window | ||
| 52 | if (!f.type) | ||
| 53 | t.bookmark = ed.selection.getBookmark(1); | ||
| 54 | |||
| 55 | id = DOM.uniqueId(); | ||
| 56 | vp = DOM.getViewPort(); | ||
| 57 | f.width = parseInt(f.width || 320); | ||
| 58 | f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); | ||
| 59 | f.min_width = parseInt(f.min_width || 150); | ||
| 60 | f.min_height = parseInt(f.min_height || 100); | ||
| 61 | f.max_width = parseInt(f.max_width || 2000); | ||
| 62 | f.max_height = parseInt(f.max_height || 2000); | ||
| 63 | f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); | ||
| 64 | f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); | ||
| 65 | f.movable = f.resizable = true; | ||
| 66 | p.mce_width = f.width; | ||
| 67 | p.mce_height = f.height; | ||
| 68 | p.mce_inline = true; | ||
| 69 | p.mce_window_id = id; | ||
| 70 | p.mce_auto_focus = f.auto_focus; | ||
| 71 | |||
| 72 | // Transpose | ||
| 73 | // po = DOM.getPos(ed.getContainer()); | ||
| 74 | // f.left -= po.x; | ||
| 75 | // f.top -= po.y; | ||
| 76 | |||
| 77 | t.features = f; | ||
| 78 | t.params = p; | ||
| 79 | t.onOpen.dispatch(t, f, p); | ||
| 80 | |||
| 81 | if (f.type) { | ||
| 82 | opt += ' mceModal'; | ||
| 83 | |||
| 84 | if (f.type) | ||
| 85 | opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); | ||
| 86 | |||
| 87 | f.resizable = false; | ||
| 88 | } | ||
| 89 | |||
| 90 | if (f.statusbar) | ||
| 91 | opt += ' mceStatusbar'; | ||
| 92 | |||
| 93 | if (f.resizable) | ||
| 94 | opt += ' mceResizable'; | ||
| 95 | |||
| 96 | if (f.minimizable) | ||
| 97 | opt += ' mceMinimizable'; | ||
| 98 | |||
| 99 | if (f.maximizable) | ||
| 100 | opt += ' mceMaximizable'; | ||
| 101 | |||
| 102 | if (f.movable) | ||
| 103 | opt += ' mceMovable'; | ||
| 104 | |||
| 105 | // Create DOM objects | ||
| 106 | t._addAll(DOM.doc.body, | ||
| 107 | ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, | ||
| 108 | ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, | ||
| 109 | ['div', {id : id + '_top', 'class' : 'mceTop'}, | ||
| 110 | ['div', {'class' : 'mceLeft'}], | ||
| 111 | ['div', {'class' : 'mceCenter'}], | ||
| 112 | ['div', {'class' : 'mceRight'}], | ||
| 113 | ['span', {id : id + '_title'}, f.title || ''] | ||
| 114 | ], | ||
| 115 | |||
| 116 | ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, | ||
| 117 | ['div', {id : id + '_left', 'class' : 'mceLeft'}], | ||
| 118 | ['span', {id : id + '_content'}], | ||
| 119 | ['div', {id : id + '_right', 'class' : 'mceRight'}] | ||
| 120 | ], | ||
| 121 | |||
| 122 | ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, | ||
| 123 | ['div', {'class' : 'mceLeft'}], | ||
| 124 | ['div', {'class' : 'mceCenter'}], | ||
| 125 | ['div', {'class' : 'mceRight'}], | ||
| 126 | ['span', {id : id + '_status'}, 'Content'] | ||
| 127 | ], | ||
| 128 | |||
| 129 | ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], | ||
| 130 | ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 131 | ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 132 | ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 133 | ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], | ||
| 134 | ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], | ||
| 135 | ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], | ||
| 136 | ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], | ||
| 137 | ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], | ||
| 138 | ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], | ||
| 139 | ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], | ||
| 140 | ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], | ||
| 141 | ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] | ||
| 142 | ] | ||
| 143 | ] | ||
| 144 | ); | ||
| 145 | |||
| 146 | DOM.setStyles(id, {top : -10000, left : -10000}); | ||
| 147 | |||
| 148 | // Fix gecko rendering bug, where the editors iframe messed with window contents | ||
| 149 | if (tinymce.isGecko) | ||
| 150 | DOM.setStyle(id, 'overflow', 'auto'); | ||
| 151 | |||
| 152 | // Measure borders | ||
| 153 | if (!f.type) { | ||
| 154 | dw += DOM.get(id + '_left').clientWidth; | ||
| 155 | dw += DOM.get(id + '_right').clientWidth; | ||
| 156 | dh += DOM.get(id + '_top').clientHeight; | ||
| 157 | dh += DOM.get(id + '_bottom').clientHeight; | ||
| 158 | } | ||
| 159 | |||
| 160 | // Resize window | ||
| 161 | DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); | ||
| 162 | |||
| 163 | u = f.url || f.file; | ||
| 164 | if (u) { | ||
| 165 | if (tinymce.relaxedDomain) | ||
| 166 | u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; | ||
| 167 | |||
| 168 | u = tinymce._addVer(u); | ||
| 169 | } | ||
| 170 | |||
| 171 | if (!f.type) { | ||
| 172 | DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); | ||
| 173 | DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); | ||
| 174 | DOM.setAttrib(id + '_ifr', 'src', u); | ||
| 175 | } else { | ||
| 176 | DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); | ||
| 177 | |||
| 178 | if (f.type == 'confirm') | ||
| 179 | DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); | ||
| 180 | |||
| 181 | DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); | ||
| 182 | DOM.setHTML(id + '_content', f.content.replace('\n', '<br />')); | ||
| 183 | } | ||
| 184 | |||
| 185 | // Register events | ||
| 186 | mdf = Event.add(id, 'mousedown', function(e) { | ||
| 187 | var n = e.target, w, vp; | ||
| 188 | |||
| 189 | w = t.windows[id]; | ||
| 190 | t.focus(id); | ||
| 191 | |||
| 192 | if (n.nodeName == 'A' || n.nodeName == 'a') { | ||
| 193 | if (n.className == 'mceMax') { | ||
| 194 | w.oldPos = w.element.getXY(); | ||
| 195 | w.oldSize = w.element.getSize(); | ||
| 196 | |||
| 197 | vp = DOM.getViewPort(); | ||
| 198 | |||
| 199 | // Reduce viewport size to avoid scrollbars | ||
| 200 | vp.w -= 2; | ||
| 201 | vp.h -= 2; | ||
| 202 | |||
| 203 | w.element.moveTo(vp.x, vp.y); | ||
| 204 | w.element.resizeTo(vp.w, vp.h); | ||
| 205 | DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); | ||
| 206 | DOM.addClass(id + '_wrapper', 'mceMaximized'); | ||
| 207 | } else if (n.className == 'mceMed') { | ||
| 208 | // Reset to old size | ||
| 209 | w.element.moveTo(w.oldPos.x, w.oldPos.y); | ||
| 210 | w.element.resizeTo(w.oldSize.w, w.oldSize.h); | ||
| 211 | w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); | ||
| 212 | |||
| 213 | DOM.removeClass(id + '_wrapper', 'mceMaximized'); | ||
| 214 | } else if (n.className == 'mceMove') | ||
| 215 | return t._startDrag(id, e, n.className); | ||
| 216 | else if (DOM.hasClass(n, 'mceResize')) | ||
| 217 | return t._startDrag(id, e, n.className.substring(13)); | ||
| 218 | } | ||
| 219 | }); | ||
| 220 | |||
| 221 | clf = Event.add(id, 'click', function(e) { | ||
| 222 | var n = e.target; | ||
| 223 | |||
| 224 | t.focus(id); | ||
| 225 | |||
| 226 | if (n.nodeName == 'A' || n.nodeName == 'a') { | ||
| 227 | switch (n.className) { | ||
| 228 | case 'mceClose': | ||
| 229 | t.close(null, id); | ||
| 230 | return Event.cancel(e); | ||
| 231 | |||
| 232 | case 'mceButton mceOk': | ||
| 233 | case 'mceButton mceCancel': | ||
| 234 | f.button_func(n.className == 'mceButton mceOk'); | ||
| 235 | return Event.cancel(e); | ||
| 236 | } | ||
| 237 | } | ||
| 238 | }); | ||
| 239 | |||
| 240 | // Add window | ||
| 241 | w = t.windows[id] = { | ||
| 242 | id : id, | ||
| 243 | mousedown_func : mdf, | ||
| 244 | click_func : clf, | ||
| 245 | element : new Element(id, {blocker : 1, container : ed.getContainer()}), | ||
| 246 | iframeElement : new Element(id + '_ifr'), | ||
| 247 | features : f, | ||
| 248 | deltaWidth : dw, | ||
| 249 | deltaHeight : dh | ||
| 250 | }; | ||
| 251 | |||
| 252 | w.iframeElement.on('focus', function() { | ||
| 253 | t.focus(id); | ||
| 254 | }); | ||
| 255 | |||
| 256 | // Setup blocker | ||
| 257 | if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { | ||
| 258 | DOM.add(DOM.doc.body, 'div', { | ||
| 259 | id : 'mceModalBlocker', | ||
| 260 | 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', | ||
| 261 | style : {zIndex : t.zIndex - 1} | ||
| 262 | }); | ||
| 263 | |||
| 264 | DOM.show('mceModalBlocker'); // Reduces flicker in IE | ||
| 265 | } else | ||
| 266 | DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); | ||
| 267 | |||
| 268 | if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) | ||
| 269 | DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); | ||
| 270 | |||
| 271 | t.focus(id); | ||
| 272 | t._fixIELayout(id, 1); | ||
| 273 | |||
| 274 | // Focus ok button | ||
| 275 | if (DOM.get(id + '_ok')) | ||
| 276 | DOM.get(id + '_ok').focus(); | ||
| 277 | |||
| 278 | t.count++; | ||
| 279 | |||
| 280 | return w; | ||
| 281 | }, | ||
| 282 | |||
| 283 | focus : function(id) { | ||
| 284 | var t = this, w; | ||
| 285 | |||
| 286 | if (w = t.windows[id]) { | ||
| 287 | w.zIndex = this.zIndex++; | ||
| 288 | w.element.setStyle('zIndex', w.zIndex); | ||
| 289 | w.element.update(); | ||
| 290 | |||
| 291 | id = id + '_wrapper'; | ||
| 292 | DOM.removeClass(t.lastId, 'mceFocus'); | ||
| 293 | DOM.addClass(id, 'mceFocus'); | ||
| 294 | t.lastId = id; | ||
| 295 | } | ||
| 296 | }, | ||
| 297 | |||
| 298 | _addAll : function(te, ne) { | ||
| 299 | var i, n, t = this, dom = tinymce.DOM; | ||
| 300 | |||
| 301 | if (is(ne, 'string')) | ||
| 302 | te.appendChild(dom.doc.createTextNode(ne)); | ||
| 303 | else if (ne.length) { | ||
| 304 | te = te.appendChild(dom.create(ne[0], ne[1])); | ||
| 305 | |||
| 306 | for (i=2; i<ne.length; i++) | ||
| 307 | t._addAll(te, ne[i]); | ||
| 308 | } | ||
| 309 | }, | ||
| 310 | |||
| 311 | _startDrag : function(id, se, ac) { | ||
| 312 | var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh; | ||
| 313 | |||
| 314 | // Get positons and sizes | ||
| 315 | // cp = DOM.getPos(t.editor.getContainer()); | ||
| 316 | cp = {x : 0, y : 0}; | ||
| 317 | vp = DOM.getViewPort(); | ||
| 318 | |||
| 319 | // Reduce viewport size to avoid scrollbars while dragging | ||
| 320 | vp.w -= 2; | ||
| 321 | vp.h -= 2; | ||
| 322 | |||
| 323 | sex = se.screenX; | ||
| 324 | sey = se.screenY; | ||
| 325 | dx = dy = dw = dh = 0; | ||
| 326 | |||
| 327 | // Handle mouse up | ||
| 328 | mu = Event.add(d, 'mouseup', function(e) { | ||
| 329 | Event.remove(d, 'mouseup', mu); | ||
| 330 | Event.remove(d, 'mousemove', mm); | ||
| 331 | |||
| 332 | if (eb) | ||
| 333 | eb.remove(); | ||
| 334 | |||
| 335 | we.moveBy(dx, dy); | ||
| 336 | we.resizeBy(dw, dh); | ||
| 337 | sz = we.getSize(); | ||
| 338 | DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight}); | ||
| 339 | t._fixIELayout(id, 1); | ||
| 340 | |||
| 341 | return Event.cancel(e); | ||
| 342 | }); | ||
| 343 | |||
| 344 | if (ac != 'Move') | ||
| 345 | startMove(); | ||
| 346 | |||
| 347 | function startMove() { | ||
| 348 | if (eb) | ||
| 349 | return; | ||
| 350 | |||
| 351 | t._fixIELayout(id, 0); | ||
| 352 | |||
| 353 | // Setup event blocker | ||
| 354 | DOM.add(d.body, 'div', { | ||
| 355 | id : 'mceEventBlocker', | ||
| 356 | 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'), | ||
| 357 | style : {zIndex : t.zIndex + 1} | ||
| 358 | }); | ||
| 359 | |||
| 360 | if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel)) | ||
| 361 | DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); | ||
| 362 | |||
| 363 | eb = new Element('mceEventBlocker'); | ||
| 364 | eb.update(); | ||
| 365 | |||
| 366 | // Setup placeholder | ||
| 367 | p = we.getXY(); | ||
| 368 | sz = we.getSize(); | ||
| 369 | sx = cp.x + p.x - vp.x; | ||
| 370 | sy = cp.y + p.y - vp.y; | ||
| 371 | DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}}); | ||
| 372 | ph = new Element('mcePlaceHolder'); | ||
| 373 | }; | ||
| 374 | |||
| 375 | // Handle mouse move/drag | ||
| 376 | mm = Event.add(d, 'mousemove', function(e) { | ||
| 377 | var x, y, v; | ||
| 378 | |||
| 379 | startMove(); | ||
| 380 | |||
| 381 | x = e.screenX - sex; | ||
| 382 | y = e.screenY - sey; | ||
| 383 | |||
| 384 | switch (ac) { | ||
| 385 | case 'ResizeW': | ||
| 386 | dx = x; | ||
| 387 | dw = 0 - x; | ||
| 388 | break; | ||
| 389 | |||
| 390 | case 'ResizeE': | ||
| 391 | dw = x; | ||
| 392 | break; | ||
| 393 | |||
| 394 | case 'ResizeN': | ||
| 395 | case 'ResizeNW': | ||
| 396 | case 'ResizeNE': | ||
| 397 | if (ac == "ResizeNW") { | ||
| 398 | dx = x; | ||
| 399 | dw = 0 - x; | ||
| 400 | } else if (ac == "ResizeNE") | ||
| 401 | dw = x; | ||
| 402 | |||
| 403 | dy = y; | ||
| 404 | dh = 0 - y; | ||
| 405 | break; | ||
| 406 | |||
| 407 | case 'ResizeS': | ||
| 408 | case 'ResizeSW': | ||
| 409 | case 'ResizeSE': | ||
| 410 | if (ac == "ResizeSW") { | ||
| 411 | dx = x; | ||
| 412 | dw = 0 - x; | ||
| 413 | } else if (ac == "ResizeSE") | ||
| 414 | dw = x; | ||
| 415 | |||
| 416 | dh = y; | ||
| 417 | break; | ||
| 418 | |||
| 419 | case 'mceMove': | ||
| 420 | dx = x; | ||
| 421 | dy = y; | ||
| 422 | break; | ||
| 423 | } | ||
| 424 | |||
| 425 | // Boundary check | ||
| 426 | if (dw < (v = w.features.min_width - sz.w)) { | ||
| 427 | if (dx !== 0) | ||
| 428 | dx += dw - v; | ||
| 429 | |||
| 430 | dw = v; | ||
| 431 | } | ||
| 432 | |||
| 433 | if (dh < (v = w.features.min_height - sz.h)) { | ||
| 434 | if (dy !== 0) | ||
| 435 | dy += dh - v; | ||
| 436 | |||
| 437 | dh = v; | ||
| 438 | } | ||
| 439 | |||
| 440 | dw = Math.min(dw, w.features.max_width - sz.w); | ||
| 441 | dh = Math.min(dh, w.features.max_height - sz.h); | ||
| 442 | dx = Math.max(dx, vp.x - (sx + vp.x)); | ||
| 443 | dy = Math.max(dy, vp.y - (sy + vp.y)); | ||
| 444 | dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x)); | ||
| 445 | dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y)); | ||
| 446 | |||
| 447 | // Move if needed | ||
| 448 | if (dx + dy !== 0) { | ||
| 449 | if (sx + dx < 0) | ||
| 450 | dx = 0; | ||
| 451 | |||
| 452 | if (sy + dy < 0) | ||
| 453 | dy = 0; | ||
| 454 | |||
| 455 | ph.moveTo(sx + dx, sy + dy); | ||
| 456 | } | ||
| 457 | |||
| 458 | // Resize if needed | ||
| 459 | if (dw + dh !== 0) | ||
| 460 | ph.resizeTo(sz.w + dw, sz.h + dh); | ||
| 461 | |||
| 462 | return Event.cancel(e); | ||
| 463 | }); | ||
| 464 | |||
| 465 | return Event.cancel(se); | ||
| 466 | }, | ||
| 467 | |||
| 468 | resizeBy : function(dw, dh, id) { | ||
| 469 | var w = this.windows[id]; | ||
| 470 | |||
| 471 | if (w) { | ||
| 472 | w.element.resizeBy(dw, dh); | ||
| 473 | w.iframeElement.resizeBy(dw, dh); | ||
| 474 | } | ||
| 475 | }, | ||
| 476 | |||
| 477 | close : function(win, id) { | ||
| 478 | var t = this, w, d = DOM.doc, ix = 0, fw, id; | ||
| 479 | |||
| 480 | id = t._findId(id || win); | ||
| 481 | |||
| 482 | // Probably not inline | ||
| 483 | if (!t.windows[id]) { | ||
| 484 | t.parent(win); | ||
| 485 | return; | ||
| 486 | } | ||
| 487 | |||
| 488 | t.count--; | ||
| 489 | |||
| 490 | if (t.count == 0) | ||
| 491 | DOM.remove('mceModalBlocker'); | ||
| 492 | |||
| 493 | if (w = t.windows[id]) { | ||
| 494 | t.onClose.dispatch(t); | ||
| 495 | Event.remove(d, 'mousedown', w.mousedownFunc); | ||
| 496 | Event.remove(d, 'click', w.clickFunc); | ||
| 497 | Event.clear(id); | ||
| 498 | Event.clear(id + '_ifr'); | ||
| 499 | |||
| 500 | DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak | ||
| 501 | w.element.remove(); | ||
| 502 | delete t.windows[id]; | ||
| 503 | |||
| 504 | // Find front most window and focus that | ||
| 505 | each (t.windows, function(w) { | ||
| 506 | if (w.zIndex > ix) { | ||
| 507 | fw = w; | ||
| 508 | ix = w.zIndex; | ||
| 509 | } | ||
| 510 | }); | ||
| 511 | |||
| 512 | if (fw) | ||
| 513 | t.focus(fw.id); | ||
| 514 | } | ||
| 515 | }, | ||
| 516 | |||
| 517 | setTitle : function(w, ti) { | ||
| 518 | var e; | ||
| 519 | |||
| 520 | w = this._findId(w); | ||
| 521 | |||
| 522 | if (e = DOM.get(w + '_title')) | ||
| 523 | e.innerHTML = DOM.encode(ti); | ||
| 524 | }, | ||
| 525 | |||
| 526 | alert : function(txt, cb, s) { | ||
| 527 | var t = this, w; | ||
| 528 | |||
| 529 | w = t.open({ | ||
| 530 | title : t, | ||
| 531 | type : 'alert', | ||
| 532 | button_func : function(s) { | ||
| 533 | if (cb) | ||
| 534 | cb.call(s || t, s); | ||
| 535 | |||
| 536 | t.close(null, w.id); | ||
| 537 | }, | ||
| 538 | content : DOM.encode(t.editor.getLang(txt, txt)), | ||
| 539 | inline : 1, | ||
| 540 | width : 400, | ||
| 541 | height : 130 | ||
| 542 | }); | ||
| 543 | }, | ||
| 544 | |||
| 545 | confirm : function(txt, cb, s) { | ||
| 546 | var t = this, w; | ||
| 547 | |||
| 548 | w = t.open({ | ||
| 549 | title : t, | ||
| 550 | type : 'confirm', | ||
| 551 | button_func : function(s) { | ||
| 552 | if (cb) | ||
| 553 | cb.call(s || t, s); | ||
| 554 | |||
| 555 | t.close(null, w.id); | ||
| 556 | }, | ||
| 557 | content : DOM.encode(t.editor.getLang(txt, txt)), | ||
| 558 | inline : 1, | ||
| 559 | width : 400, | ||
| 560 | height : 130 | ||
| 561 | }); | ||
| 562 | }, | ||
| 563 | |||
| 564 | // Internal functions | ||
| 565 | |||
| 566 | _findId : function(w) { | ||
| 567 | var t = this; | ||
| 568 | |||
| 569 | if (typeof(w) == 'string') | ||
| 570 | return w; | ||
| 571 | |||
| 572 | each(t.windows, function(wo) { | ||
| 573 | var ifr = DOM.get(wo.id + '_ifr'); | ||
| 574 | |||
| 575 | if (ifr && w == ifr.contentWindow) { | ||
| 576 | w = wo.id; | ||
| 577 | return false; | ||
| 578 | } | ||
| 579 | }); | ||
| 580 | |||
| 581 | return w; | ||
| 582 | }, | ||
| 583 | |||
| 584 | _fixIELayout : function(id, s) { | ||
| 585 | var w, img; | ||
| 586 | |||
| 587 | if (!tinymce.isIE6) | ||
| 588 | return; | ||
| 589 | |||
| 590 | // Fixes the bug where hover flickers and does odd things in IE6 | ||
| 591 | each(['n','s','w','e','nw','ne','sw','se'], function(v) { | ||
| 592 | var e = DOM.get(id + '_resize_' + v); | ||
| 593 | |||
| 594 | DOM.setStyles(e, { | ||
| 595 | width : s ? e.clientWidth : '', | ||
| 596 | height : s ? e.clientHeight : '', | ||
| 597 | cursor : DOM.getStyle(e, 'cursor', 1) | ||
| 598 | }); | ||
| 599 | |||
| 600 | DOM.setStyle(id + "_bottom", 'bottom', '-1px'); | ||
| 601 | |||
| 602 | e = 0; | ||
| 603 | }); | ||
| 604 | |||
| 605 | // Fixes graphics glitch | ||
| 606 | if (w = this.windows[id]) { | ||
| 607 | // Fixes rendering bug after resize | ||
| 608 | w.element.hide(); | ||
| 609 | w.element.show(); | ||
| 610 | |||
| 611 | // Forced a repaint of the window | ||
| 612 | //DOM.get(id).style.filter = ''; | ||
| 613 | |||
| 614 | // IE has a bug where images used in CSS won't get loaded | ||
| 615 | // sometimes when the cache in the browser is disabled | ||
| 616 | // This fix tries to solve it by loading the images using the image object | ||
| 617 | each(DOM.select('div,a', id), function(e, i) { | ||
| 618 | if (e.currentStyle.backgroundImage != 'none') { | ||
| 619 | img = new Image(); | ||
| 620 | img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); | ||
| 621 | } | ||
| 622 | }); | ||
| 623 | |||
| 624 | DOM.get(id).style.filter = ''; | ||
| 625 | } | ||
| 626 | } | ||
| 627 | }); | ||
| 628 | |||
| 629 | // Register plugin | ||
| 630 | tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); | ||
| 631 | })(); | ||
| 632 | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif deleted file mode 100644 index 94abd08..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif deleted file mode 100644 index e671094..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif deleted file mode 100644 index 6baf64a..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif deleted file mode 100644 index 497307a..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif deleted file mode 100644 index c894b2e..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif deleted file mode 100644 index c2a2ad4..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif deleted file mode 100644 index 43a735f..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css b/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css deleted file mode 100644 index 5e6fd7d..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | /* Clearlooks 2 */ | ||
| 2 | |||
| 3 | /* Reset */ | ||
| 4 | .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block} | ||
| 5 | |||
| 6 | /* General */ | ||
| 7 | .clearlooks2 {position:absolute; direction:ltr} | ||
| 8 | .clearlooks2 .mceWrapper {position:static} | ||
| 9 | .mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} | ||
| 10 | .clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} | ||
| 11 | .clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} | ||
| 12 | |||
| 13 | /* Top */ | ||
| 14 | .clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px} | ||
| 15 | .clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)} | ||
| 16 | .clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} | ||
| 17 | .clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} | ||
| 18 | .clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} | ||
| 19 | .clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0} | ||
| 20 | .clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px} | ||
| 21 | .clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0} | ||
| 22 | .clearlooks2 .mceFocus .mceTop span {color:#FFF} | ||
| 23 | |||
| 24 | /* Middle */ | ||
| 25 | .clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0} | ||
| 26 | .clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)} | ||
| 27 | .clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} | ||
| 28 | .clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} | ||
| 29 | .clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)} | ||
| 30 | |||
| 31 | /* Bottom */ | ||
| 32 | .clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px} | ||
| 33 | .clearlooks2 .mceBottom {left:0; bottom:0; width:100%} | ||
| 34 | .clearlooks2 .mceBottom div {top:0} | ||
| 35 | .clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px} | ||
| 36 | .clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} | ||
| 37 | .clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0} | ||
| 38 | .clearlooks2 .mceBottom span {display:none} | ||
| 39 | .clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px} | ||
| 40 | .clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0} | ||
| 41 | .clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px} | ||
| 42 | .clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0} | ||
| 43 | .clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px} | ||
| 44 | |||
| 45 | /* Actions */ | ||
| 46 | .clearlooks2 a {width:29px; height:16px; top:3px;} | ||
| 47 | .clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0} | ||
| 48 | .clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0} | ||
| 49 | .clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0} | ||
| 50 | .clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0} | ||
| 51 | .clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px} | ||
| 52 | .clearlooks2 .mceMovable .mceMove {display:block} | ||
| 53 | .clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px} | ||
| 54 | .clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px} | ||
| 55 | .clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px} | ||
| 56 | .clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px} | ||
| 57 | .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} | ||
| 58 | .clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px} | ||
| 59 | .clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px} | ||
| 60 | .clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px} | ||
| 61 | .clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px} | ||
| 62 | |||
| 63 | /* Resize */ | ||
| 64 | .clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px} | ||
| 65 | .clearlooks2 .mceResizable .mceResize {display:block} | ||
| 66 | .clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none} | ||
| 67 | .clearlooks2 .mceMinimizable .mceMin {display:block} | ||
| 68 | .clearlooks2 .mceMaximizable .mceMax {display:block} | ||
| 69 | .clearlooks2 .mceMaximized .mceMed {display:block} | ||
| 70 | .clearlooks2 .mceMaximized .mceMax {display:none} | ||
| 71 | .clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize} | ||
| 72 | .clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize} | ||
| 73 | .clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize} | ||
| 74 | .clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;} | ||
| 75 | .clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize} | ||
| 76 | .clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize} | ||
| 77 | .clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize} | ||
| 78 | .clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize} | ||
| 79 | |||
| 80 | /* Alert/Confirm */ | ||
| 81 | .clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0} | ||
| 82 | .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px} | ||
| 83 | .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal} | ||
| 84 | .clearlooks2 a:hover {font-weight:bold;} | ||
| 85 | .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5} | ||
| 86 | .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px} | ||
| 87 | .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)} | ||
| 88 | .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px} | ||
| 89 | .clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto} | ||
| 90 | .clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm b/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm deleted file mode 100644 index f9ec642..0000000 --- a/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm +++ /dev/null | |||
| @@ -1,387 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>Template for dialogs</title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | |||
| 9 | <div class="mceEditor"> | ||
| 10 | <div class="clearlooks2" style="width:400px; height:100px; left:10px;"> | ||
| 11 | <div class="mceWrapper"> | ||
| 12 | <div class="mceTop"> | ||
| 13 | <div class="mceLeft"></div> | ||
| 14 | <div class="mceCenter"></div> | ||
| 15 | <div class="mceRight"></div> | ||
| 16 | <span>Blured</span> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="mceMiddle"> | ||
| 20 | <div class="mceLeft"></div> | ||
| 21 | <span>Content</span> | ||
| 22 | <div class="mceRight"></div> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div class="mceBottom"> | ||
| 26 | <div class="mceLeft"></div> | ||
| 27 | <div class="mceCenter"></div> | ||
| 28 | <div class="mceRight"></div> | ||
| 29 | <span>Statusbar text.</span> | ||
| 30 | </div> | ||
| 31 | |||
| 32 | <a class="mceMove" href="#"></a> | ||
| 33 | <a class="mceMin" href="#"></a> | ||
| 34 | <a class="mceMax" href="#"></a> | ||
| 35 | <a class="mceMed" href="#"></a> | ||
| 36 | <a class="mceClose" href="#"></a> | ||
| 37 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 38 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 39 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 40 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 41 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 42 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 43 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 44 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 45 | </div> | ||
| 46 | </div> | ||
| 47 | |||
| 48 | <div class="clearlooks2" style="width:400px; height:100px; left:420px;"> | ||
| 49 | <div class="mceWrapper mceMovable mceFocus"> | ||
| 50 | <div class="mceTop"> | ||
| 51 | <div class="mceLeft"></div> | ||
| 52 | <div class="mceCenter"></div> | ||
| 53 | <div class="mceRight"></div> | ||
| 54 | <span>Focused</span> | ||
| 55 | </div> | ||
| 56 | |||
| 57 | <div class="mceMiddle"> | ||
| 58 | <div class="mceLeft"></div> | ||
| 59 | <span>Content</span> | ||
| 60 | <div class="mceRight"></div> | ||
| 61 | </div> | ||
| 62 | |||
| 63 | <div class="mceBottom"> | ||
| 64 | <div class="mceLeft"></div> | ||
| 65 | <div class="mceCenter"></div> | ||
| 66 | <div class="mceRight"></div> | ||
| 67 | <span>Statusbar text.</span> | ||
| 68 | </div> | ||
| 69 | |||
| 70 | <a class="mceMove" href="#"></a> | ||
| 71 | <a class="mceMin" href="#"></a> | ||
| 72 | <a class="mceMax" href="#"></a> | ||
| 73 | <a class="mceMed" href="#"></a> | ||
| 74 | <a class="mceClose" href="#"></a> | ||
| 75 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 76 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 77 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 78 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 79 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 80 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 81 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 82 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 83 | </div> | ||
| 84 | </div> | ||
| 85 | |||
| 86 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;"> | ||
| 87 | <div class="mceWrapper mceMovable mceFocus mceStatusbar"> | ||
| 88 | <div class="mceTop"> | ||
| 89 | <div class="mceLeft"></div> | ||
| 90 | <div class="mceCenter"></div> | ||
| 91 | <div class="mceRight"></div> | ||
| 92 | <span>Statusbar</span> | ||
| 93 | </div> | ||
| 94 | |||
| 95 | <div class="mceMiddle"> | ||
| 96 | <div class="mceLeft"></div> | ||
| 97 | <span>Content</span> | ||
| 98 | <div class="mceRight"></div> | ||
| 99 | </div> | ||
| 100 | |||
| 101 | <div class="mceBottom"> | ||
| 102 | <div class="mceLeft"></div> | ||
| 103 | <div class="mceCenter"></div> | ||
| 104 | <div class="mceRight"></div> | ||
| 105 | <span>Statusbar text.</span> | ||
| 106 | </div> | ||
| 107 | |||
| 108 | <a class="mceMove" href="#"></a> | ||
| 109 | <a class="mceMin" href="#"></a> | ||
| 110 | <a class="mceMax" href="#"></a> | ||
| 111 | <a class="mceMed" href="#"></a> | ||
| 112 | <a class="mceClose" href="#"></a> | ||
| 113 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 114 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 115 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 116 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 117 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 118 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 119 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 120 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 121 | </div> | ||
| 122 | </div> | ||
| 123 | |||
| 124 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;"> | ||
| 125 | <div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable"> | ||
| 126 | <div class="mceTop"> | ||
| 127 | <div class="mceLeft"></div> | ||
| 128 | <div class="mceCenter"></div> | ||
| 129 | <div class="mceRight"></div> | ||
| 130 | <span>Statusbar, Resizable</span> | ||
| 131 | </div> | ||
| 132 | |||
| 133 | <div class="mceMiddle"> | ||
| 134 | <div class="mceLeft"></div> | ||
| 135 | <span>Content</span> | ||
| 136 | <div class="mceRight"></div> | ||
| 137 | </div> | ||
| 138 | |||
| 139 | <div class="mceBottom"> | ||
| 140 | <div class="mceLeft"></div> | ||
| 141 | <div class="mceCenter"></div> | ||
| 142 | <div class="mceRight"></div> | ||
| 143 | <span>Statusbar text.</span> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | <a class="mceMove" href="#"></a> | ||
| 147 | <a class="mceMin" href="#"></a> | ||
| 148 | <a class="mceMax" href="#"></a> | ||
| 149 | <a class="mceMed" href="#"></a> | ||
| 150 | <a class="mceClose" href="#"></a> | ||
| 151 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 152 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 153 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 154 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 155 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 156 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 157 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 158 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 159 | </div> | ||
| 160 | </div> | ||
| 161 | |||
| 162 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;"> | ||
| 163 | <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable"> | ||
| 164 | <div class="mceTop"> | ||
| 165 | <div class="mceLeft"></div> | ||
| 166 | <div class="mceCenter"></div> | ||
| 167 | <div class="mceRight"></div> | ||
| 168 | <span>Resizable, Maximizable</span> | ||
| 169 | </div> | ||
| 170 | |||
| 171 | <div class="mceMiddle"> | ||
| 172 | <div class="mceLeft"></div> | ||
| 173 | <span>Content</span> | ||
| 174 | <div class="mceRight"></div> | ||
| 175 | </div> | ||
| 176 | |||
| 177 | <div class="mceBottom"> | ||
| 178 | <div class="mceLeft"></div> | ||
| 179 | <div class="mceCenter"></div> | ||
| 180 | <div class="mceRight"></div> | ||
| 181 | <span>Statusbar text.</span> | ||
| 182 | </div> | ||
| 183 | |||
| 184 | <a class="mceMove" href="#"></a> | ||
| 185 | <a class="mceMin" href="#"></a> | ||
| 186 | <a class="mceMax" href="#"></a> | ||
| 187 | <a class="mceMed" href="#"></a> | ||
| 188 | <a class="mceClose" href="#"></a> | ||
| 189 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 190 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 191 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 192 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 193 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 194 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 195 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 196 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 197 | </div> | ||
| 198 | </div> | ||
| 199 | |||
| 200 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;"> | ||
| 201 | <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable"> | ||
| 202 | <div class="mceTop"> | ||
| 203 | <div class="mceLeft"></div> | ||
| 204 | <div class="mceCenter"></div> | ||
| 205 | <div class="mceRight"></div> | ||
| 206 | <span>Blurred, Maximizable, Statusbar, Resizable</span> | ||
| 207 | </div> | ||
| 208 | |||
| 209 | <div class="mceMiddle"> | ||
| 210 | <div class="mceLeft"></div> | ||
| 211 | <span>Content</span> | ||
| 212 | <div class="mceRight"></div> | ||
| 213 | </div> | ||
| 214 | |||
| 215 | <div class="mceBottom"> | ||
| 216 | <div class="mceLeft"></div> | ||
| 217 | <div class="mceCenter"></div> | ||
| 218 | <div class="mceRight"></div> | ||
| 219 | <span>Statusbar text.</span> | ||
| 220 | </div> | ||
| 221 | |||
| 222 | <a class="mceMove" href="#"></a> | ||
| 223 | <a class="mceMin" href="#"></a> | ||
| 224 | <a class="mceMax" href="#"></a> | ||
| 225 | <a class="mceMed" href="#"></a> | ||
| 226 | <a class="mceClose" href="#"></a> | ||
| 227 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 228 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 229 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 230 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 231 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 232 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 233 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 234 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 235 | </div> | ||
| 236 | </div> | ||
| 237 | |||
| 238 | <div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;"> | ||
| 239 | <div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable"> | ||
| 240 | <div class="mceTop"> | ||
| 241 | <div class="mceLeft"></div> | ||
| 242 | <div class="mceCenter"></div> | ||
| 243 | <div class="mceRight"></div> | ||
| 244 | <span>Maximized, Maximizable, Minimizable</span> | ||
| 245 | </div> | ||
| 246 | |||
| 247 | <div class="mceMiddle"> | ||
| 248 | <div class="mceLeft"></div> | ||
| 249 | <span>Content</span> | ||
| 250 | <div class="mceRight"></div> | ||
| 251 | </div> | ||
| 252 | |||
| 253 | <div class="mceBottom"> | ||
| 254 | <div class="mceLeft"></div> | ||
| 255 | <div class="mceCenter"></div> | ||
| 256 | <div class="mceRight"></div> | ||
| 257 | <span>Statusbar text.</span> | ||
| 258 | </div> | ||
| 259 | |||
| 260 | <a class="mceMove" href="#"></a> | ||
| 261 | <a class="mceMin" href="#"></a> | ||
| 262 | <a class="mceMax" href="#"></a> | ||
| 263 | <a class="mceMed" href="#"></a> | ||
| 264 | <a class="mceClose" href="#"></a> | ||
| 265 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 266 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 267 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 268 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 269 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 270 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 271 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 272 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 273 | </div> | ||
| 274 | </div> | ||
| 275 | |||
| 276 | <div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;"> | ||
| 277 | <div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable"> | ||
| 278 | <div class="mceTop"> | ||
| 279 | <div class="mceLeft"></div> | ||
| 280 | <div class="mceCenter"></div> | ||
| 281 | <div class="mceRight"></div> | ||
| 282 | <span>Blured</span> | ||
| 283 | </div> | ||
| 284 | |||
| 285 | <div class="mceMiddle"> | ||
| 286 | <div class="mceLeft"></div> | ||
| 287 | <span>Content</span> | ||
| 288 | <div class="mceRight"></div> | ||
| 289 | </div> | ||
| 290 | |||
| 291 | <div class="mceBottom"> | ||
| 292 | <div class="mceLeft"></div> | ||
| 293 | <div class="mceCenter"></div> | ||
| 294 | <div class="mceRight"></div> | ||
| 295 | <span>Statusbar text.</span> | ||
| 296 | </div> | ||
| 297 | |||
| 298 | <a class="mceMove" href="#"></a> | ||
| 299 | <a class="mceMin" href="#"></a> | ||
| 300 | <a class="mceMax" href="#"></a> | ||
| 301 | <a class="mceMed" href="#"></a> | ||
| 302 | <a class="mceClose" href="#"></a> | ||
| 303 | <a class="mceResize mceResizeN" href="#"></a> | ||
| 304 | <a class="mceResize mceResizeS" href="#"></a> | ||
| 305 | <a class="mceResize mceResizeW" href="#"></a> | ||
| 306 | <a class="mceResize mceResizeE" href="#"></a> | ||
| 307 | <a class="mceResize mceResizeNW" href="#"></a> | ||
| 308 | <a class="mceResize mceResizeNE" href="#"></a> | ||
| 309 | <a class="mceResize mceResizeSW" href="#"></a> | ||
| 310 | <a class="mceResize mceResizeSE" href="#"></a> | ||
| 311 | </div> | ||
| 312 | </div> | ||
| 313 | |||
| 314 | <div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;"> | ||
| 315 | <div class="mceWrapper mceMovable mceFocus mceModal mceAlert"> | ||
| 316 | <div class="mceTop"> | ||
| 317 | <div class="mceLeft"></div> | ||
| 318 | <div class="mceCenter"></div> | ||
| 319 | <div class="mceRight"></div> | ||
| 320 | <span>Alert</span> | ||
| 321 | </div> | ||
| 322 | |||
| 323 | <div class="mceMiddle"> | ||
| 324 | <div class="mceLeft"></div> | ||
| 325 | <span> | ||
| 326 | This is a very long error message. This is a very long error message. | ||
| 327 | This is a very long error message. This is a very long error message. | ||
| 328 | This is a very long error message. This is a very long error message. | ||
| 329 | This is a very long error message. This is a very long error message. | ||
| 330 | This is a very long error message. This is a very long error message. | ||
| 331 | This is a very long error message. This is a very long error message. | ||
| 332 | </span> | ||
| 333 | <div class="mceRight"></div> | ||
| 334 | <div class="mceIcon"></div> | ||
| 335 | </div> | ||
| 336 | |||
| 337 | <div class="mceBottom"> | ||
| 338 | <div class="mceLeft"></div> | ||
| 339 | <div class="mceCenter"></div> | ||
| 340 | <div class="mceRight"></div> | ||
| 341 | </div> | ||
| 342 | |||
| 343 | <a class="mceMove" href="#"></a> | ||
| 344 | <a class="mceButton mceOk" href="#">Ok</a> | ||
| 345 | <a class="mceClose" href="#"></a> | ||
| 346 | </div> | ||
| 347 | </div> | ||
| 348 | |||
| 349 | <div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;"> | ||
| 350 | <div class="mceWrapper mceMovable mceFocus mceModal mceConfirm"> | ||
| 351 | <div class="mceTop"> | ||
| 352 | <div class="mceLeft"></div> | ||
| 353 | <div class="mceCenter"></div> | ||
| 354 | <div class="mceRight"></div> | ||
| 355 | <span>Confirm</span> | ||
| 356 | </div> | ||
| 357 | |||
| 358 | <div class="mceMiddle"> | ||
| 359 | <div class="mceLeft"></div> | ||
| 360 | <span> | ||
| 361 | This is a very long error message. This is a very long error message. | ||
| 362 | This is a very long error message. This is a very long error message. | ||
| 363 | This is a very long error message. This is a very long error message. | ||
| 364 | This is a very long error message. This is a very long error message. | ||
| 365 | This is a very long error message. This is a very long error message. | ||
| 366 | This is a very long error message. This is a very long error message. | ||
| 367 | </span> | ||
| 368 | <div class="mceRight"></div> | ||
| 369 | <div class="mceIcon"></div> | ||
| 370 | </div> | ||
| 371 | |||
| 372 | <div class="mceBottom"> | ||
| 373 | <div class="mceLeft"></div> | ||
| 374 | <div class="mceCenter"></div> | ||
| 375 | <div class="mceRight"></div> | ||
| 376 | </div> | ||
| 377 | |||
| 378 | <a class="mceMove" href="#"></a> | ||
| 379 | <a class="mceButton mceOk" href="#">Ok</a> | ||
| 380 | <a class="mceButton mceCancel" href="#">Cancel</a> | ||
| 381 | <a class="mceClose" href="#"></a> | ||
| 382 | </div> | ||
| 383 | </div> | ||
| 384 | </div> | ||
| 385 | |||
| 386 | </body> | ||
| 387 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js deleted file mode 100644 index 938ce6b..0000000 --- a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length<d){for(var f=0;f<(d-g.length);f++){g="0"+g}}return g}a=a.replace("%D","%m/%d/%y");a=a.replace("%r","%I:%M:%S %p");a=a.replace("%Y",""+e.getFullYear());a=a.replace("%y",""+e.getYear());a=a.replace("%m",b(e.getMonth()+1,2));a=a.replace("%d",b(e.getDate(),2));a=a.replace("%H",""+b(e.getHours(),2));a=a.replace("%M",""+b(e.getMinutes(),2));a=a.replace("%S",""+b(e.getSeconds(),2));a=a.replace("%I",""+((e.getHours()+11)%12+1));a=a.replace("%p",""+(e.getHours()<12?"AM":"PM"));a=a.replace("%B",""+c.getLang("insertdatetime.months_long").split(",")[e.getMonth()]);a=a.replace("%b",""+c.getLang("insertdatetime.months_short").split(",")[e.getMonth()]);a=a.replace("%A",""+c.getLang("insertdatetime.day_long").split(",")[e.getDay()]);a=a.replace("%a",""+c.getLang("insertdatetime.day_short").split(",")[e.getDay()]);a=a.replace("%%","%");return a}});tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js deleted file mode 100644 index 9ab3135..0000000 --- a/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.InsertDateTime', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | ed.addCommand('mceInsertDate', function() { | ||
| 16 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt'))); | ||
| 17 | |||
| 18 | ed.execCommand('mceInsertContent', false, str); | ||
| 19 | }); | ||
| 20 | |||
| 21 | ed.addCommand('mceInsertTime', function() { | ||
| 22 | var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt'))); | ||
| 23 | |||
| 24 | ed.execCommand('mceInsertContent', false, str); | ||
| 25 | }); | ||
| 26 | |||
| 27 | ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'}); | ||
| 28 | ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'}); | ||
| 29 | }, | ||
| 30 | |||
| 31 | getInfo : function() { | ||
| 32 | return { | ||
| 33 | longname : 'Insert date/time', | ||
| 34 | author : 'Moxiecode Systems AB', | ||
| 35 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 36 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime', | ||
| 37 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 38 | }; | ||
| 39 | }, | ||
| 40 | |||
| 41 | // Private methods | ||
| 42 | |||
| 43 | _getDateTime : function(d, fmt) { | ||
| 44 | var ed = this.editor; | ||
| 45 | |||
| 46 | function addZeros(value, len) { | ||
| 47 | value = "" + value; | ||
| 48 | |||
| 49 | if (value.length < len) { | ||
| 50 | for (var i=0; i<(len-value.length); i++) | ||
| 51 | value = "0" + value; | ||
| 52 | } | ||
| 53 | |||
| 54 | return value; | ||
| 55 | }; | ||
| 56 | |||
| 57 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 58 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 59 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 60 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 61 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 62 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 63 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 64 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 65 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 66 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 67 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 68 | fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]); | ||
| 69 | fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]); | ||
| 70 | fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]); | ||
| 71 | fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]); | ||
| 72 | fmt = fmt.replace("%%", "%"); | ||
| 73 | |||
| 74 | return fmt; | ||
| 75 | } | ||
| 76 | }); | ||
| 77 | |||
| 78 | // Register plugin | ||
| 79 | tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime); | ||
| 80 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js deleted file mode 100644 index f88a6dd..0000000 --- a/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Layer",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertLayer",c._insertLayer,c);a.addCommand("mceMoveForward",function(){c._move(1)});a.addCommand("mceMoveBackward",function(){c._move(-1)});a.addCommand("mceMakeAbsolute",function(){c._toggleAbsolute()});a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"});a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"});a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"});a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"});a.onInit.add(function(){if(tinymce.isIE){a.getDoc().execCommand("2D-Position",false,true)}});a.onNodeChange.add(c._nodeChange,c);a.onVisualAid.add(c._visualAid,c)},getInfo:function(){return{longname:"Layer",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var c,d;c=this._getParentLayer(e);d=b.dom.getParent(e,"DIV,P,IMG");if(!d){a.setDisabled("absolute",1);a.setDisabled("moveforward",1);a.setDisabled("movebackward",1)}else{a.setDisabled("absolute",0);a.setDisabled("moveforward",!c);a.setDisabled("movebackward",!c);a.setActive("absolute",c&&c.style.position.toLowerCase()=="absolute")}},_visualAid:function(a,c,b){var d=a.dom;tinymce.each(d.select("div,p",c),function(f){if(/^(absolute|relative|static)$/i.test(f.style.position)){if(b){d.addClass(f,"mceItemVisualAid")}else{d.removeClass(f,"mceItemVisualAid")}}})},_move:function(h){var b=this.editor,f,g=[],e=this._getParentLayer(b.selection.getNode()),c=-1,j=-1,a;a=[];tinymce.walk(b.getBody(),function(d){if(d.nodeType==1&&/^(absolute|relative|static)$/i.test(d.style.position)){a.push(d)}},"childNodes");for(f=0;f<a.length;f++){g[f]=a[f].style.zIndex?parseInt(a[f].style.zIndex):0;if(c<0&&a[f]==e){c=f}}if(h<0){for(f=0;f<g.length;f++){if(g[f]<g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;f<g.length;f++){if(g[f]>g[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js deleted file mode 100644 index a72f6c3..0000000 --- a/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,209 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 652 2008-02-29 13:09:46Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Layer', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceInsertLayer', t._insertLayer, t); | ||
| 17 | |||
| 18 | ed.addCommand('mceMoveForward', function() { | ||
| 19 | t._move(1); | ||
| 20 | }); | ||
| 21 | |||
| 22 | ed.addCommand('mceMoveBackward', function() { | ||
| 23 | t._move(-1); | ||
| 24 | }); | ||
| 25 | |||
| 26 | ed.addCommand('mceMakeAbsolute', function() { | ||
| 27 | t._toggleAbsolute(); | ||
| 28 | }); | ||
| 29 | |||
| 30 | // Register buttons | ||
| 31 | ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); | ||
| 32 | ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); | ||
| 33 | ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); | ||
| 34 | ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); | ||
| 35 | |||
| 36 | ed.onInit.add(function() { | ||
| 37 | if (tinymce.isIE) | ||
| 38 | ed.getDoc().execCommand('2D-Position', false, true); | ||
| 39 | }); | ||
| 40 | |||
| 41 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 42 | ed.onVisualAid.add(t._visualAid, t); | ||
| 43 | }, | ||
| 44 | |||
| 45 | getInfo : function() { | ||
| 46 | return { | ||
| 47 | longname : 'Layer', | ||
| 48 | author : 'Moxiecode Systems AB', | ||
| 49 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 50 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', | ||
| 51 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 52 | }; | ||
| 53 | }, | ||
| 54 | |||
| 55 | // Private methods | ||
| 56 | |||
| 57 | _nodeChange : function(ed, cm, n) { | ||
| 58 | var le, p; | ||
| 59 | |||
| 60 | le = this._getParentLayer(n); | ||
| 61 | p = ed.dom.getParent(n, 'DIV,P,IMG'); | ||
| 62 | |||
| 63 | if (!p) { | ||
| 64 | cm.setDisabled('absolute', 1); | ||
| 65 | cm.setDisabled('moveforward', 1); | ||
| 66 | cm.setDisabled('movebackward', 1); | ||
| 67 | } else { | ||
| 68 | cm.setDisabled('absolute', 0); | ||
| 69 | cm.setDisabled('moveforward', !le); | ||
| 70 | cm.setDisabled('movebackward', !le); | ||
| 71 | cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); | ||
| 72 | } | ||
| 73 | }, | ||
| 74 | |||
| 75 | // Private methods | ||
| 76 | |||
| 77 | _visualAid : function(ed, e, s) { | ||
| 78 | var dom = ed.dom; | ||
| 79 | |||
| 80 | tinymce.each(dom.select('div,p', e), function(e) { | ||
| 81 | if (/^(absolute|relative|static)$/i.test(e.style.position)) { | ||
| 82 | if (s) | ||
| 83 | dom.addClass(e, 'mceItemVisualAid'); | ||
| 84 | else | ||
| 85 | dom.removeClass(e, 'mceItemVisualAid'); | ||
| 86 | } | ||
| 87 | }); | ||
| 88 | }, | ||
| 89 | |||
| 90 | _move : function(d) { | ||
| 91 | var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; | ||
| 92 | |||
| 93 | nl = []; | ||
| 94 | tinymce.walk(ed.getBody(), function(n) { | ||
| 95 | if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) | ||
| 96 | nl.push(n); | ||
| 97 | }, 'childNodes'); | ||
| 98 | |||
| 99 | // Find z-indexes | ||
| 100 | for (i=0; i<nl.length; i++) { | ||
| 101 | z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0; | ||
| 102 | |||
| 103 | if (ci < 0 && nl[i] == le) | ||
| 104 | ci = i; | ||
| 105 | } | ||
| 106 | |||
| 107 | if (d < 0) { | ||
| 108 | // Move back | ||
| 109 | |||
| 110 | // Try find a lower one | ||
| 111 | for (i=0; i<z.length; i++) { | ||
| 112 | if (z[i] < z[ci]) { | ||
| 113 | fi = i; | ||
| 114 | break; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | if (fi > -1) { | ||
| 119 | nl[ci].style.zIndex = z[fi]; | ||
| 120 | nl[fi].style.zIndex = z[ci]; | ||
| 121 | } else { | ||
| 122 | if (z[ci] > 0) | ||
| 123 | nl[ci].style.zIndex = z[ci] - 1; | ||
| 124 | } | ||
| 125 | } else { | ||
| 126 | // Move forward | ||
| 127 | |||
| 128 | // Try find a higher one | ||
| 129 | for (i=0; i<z.length; i++) { | ||
| 130 | if (z[i] > z[ci]) { | ||
| 131 | fi = i; | ||
| 132 | break; | ||
| 133 | } | ||
| 134 | } | ||
| 135 | |||
| 136 | if (fi > -1) { | ||
| 137 | nl[ci].style.zIndex = z[fi]; | ||
| 138 | nl[fi].style.zIndex = z[ci]; | ||
| 139 | } else | ||
| 140 | nl[ci].style.zIndex = z[ci] + 1; | ||
| 141 | } | ||
| 142 | |||
| 143 | ed.execCommand('mceRepaint'); | ||
| 144 | }, | ||
| 145 | |||
| 146 | _getParentLayer : function(n) { | ||
| 147 | return this.editor.dom.getParent(n, function(n) { | ||
| 148 | return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); | ||
| 149 | }); | ||
| 150 | }, | ||
| 151 | |||
| 152 | _insertLayer : function() { | ||
| 153 | var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); | ||
| 154 | |||
| 155 | ed.dom.add(ed.getBody(), 'div', { | ||
| 156 | style : { | ||
| 157 | position : 'absolute', | ||
| 158 | left : p.x, | ||
| 159 | top : (p.y > 20 ? p.y : 20), | ||
| 160 | width : 100, | ||
| 161 | height : 100 | ||
| 162 | }, | ||
| 163 | 'class' : 'mceItemVisualAid' | ||
| 164 | }, ed.selection.getContent() || ed.getLang('layer.content')); | ||
| 165 | }, | ||
| 166 | |||
| 167 | _toggleAbsolute : function() { | ||
| 168 | var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); | ||
| 169 | |||
| 170 | if (!le) | ||
| 171 | le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); | ||
| 172 | |||
| 173 | if (le) { | ||
| 174 | if (le.style.position.toLowerCase() == "absolute") { | ||
| 175 | ed.dom.setStyles(le, { | ||
| 176 | position : '', | ||
| 177 | left : '', | ||
| 178 | top : '', | ||
| 179 | width : '', | ||
| 180 | height : '' | ||
| 181 | }); | ||
| 182 | |||
| 183 | ed.dom.removeClass(le, 'mceItemVisualAid'); | ||
| 184 | } else { | ||
| 185 | if (le.style.left == "") | ||
| 186 | le.style.left = 20 + 'px'; | ||
| 187 | |||
| 188 | if (le.style.top == "") | ||
| 189 | le.style.top = 20 + 'px'; | ||
| 190 | |||
| 191 | if (le.style.width == "") | ||
| 192 | le.style.width = le.width ? (le.width + 'px') : '100px'; | ||
| 193 | |||
| 194 | if (le.style.height == "") | ||
| 195 | le.style.height = le.height ? (le.height + 'px') : '100px'; | ||
| 196 | |||
| 197 | le.style.position = "absolute"; | ||
| 198 | ed.addVisual(ed.getBody()); | ||
| 199 | } | ||
| 200 | |||
| 201 | ed.execCommand('mceRepaint'); | ||
| 202 | ed.nodeChanged(); | ||
| 203 | } | ||
| 204 | } | ||
| 205 | }); | ||
| 206 | |||
| 207 | // Register plugin | ||
| 208 | tinymce.PluginManager.add('layer', tinymce.plugins.Layer); | ||
| 209 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/css/content.css b/public/javascripts/tiny_mce/plugins/media/css/content.css deleted file mode 100644 index 1bf6a75..0000000 --- a/public/javascripts/tiny_mce/plugins/media/css/content.css +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 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);} | ||
| 3 | .mceItemFlash {background-image:url(../img/flash.gif);} | ||
| 4 | .mceItemQuickTime {background-image:url(../img/quicktime.gif);} | ||
| 5 | .mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} | ||
| 6 | .mceItemRealMedia {background-image:url(../img/realmedia.gif);} | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/css/media.css b/public/javascripts/tiny_mce/plugins/media/css/media.css deleted file mode 100644 index 2d08794..0000000 --- a/public/javascripts/tiny_mce/plugins/media/css/media.css +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #id, #name, #hspace, #vspace, #class_name, #align { width: 100px } | ||
| 2 | #hspace, #vspace { width: 50px } | ||
| 3 | #flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } | ||
| 4 | #flash_base, #flash_flashvars { width: 240px } | ||
| 5 | #width, #height { width: 40px } | ||
| 6 | #src, #media_type { width: 250px } | ||
| 7 | #class { width: 120px } | ||
| 8 | #prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto } | ||
| 9 | .panel_wrapper div.current { height: 390px; overflow: auto } | ||
| 10 | #flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } | ||
| 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 } | ||
| 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 } | ||
| 15 | #shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } | ||
| 16 | #qt_qtsrc { width: 200px } | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin.js deleted file mode 100644 index 2889be5..0000000 --- a/public/javascripts/tiny_mce/plugins/media/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js deleted file mode 100644 index 2692e0a..0000000 --- a/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,411 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1222 2009-09-03 17:26:47Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.MediaPlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.url = url; | ||
| 17 | |||
| 18 | function isMediaElm(n) { | ||
| 19 | return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); | ||
| 20 | }; | ||
| 21 | |||
| 22 | ed.onPreInit.add(function() { | ||
| 23 | // Force in _value parameter this extra parameter is required for older Opera versions | ||
| 24 | ed.serializer.addRules('param[name|value|_mce_value]'); | ||
| 25 | }); | ||
| 26 | |||
| 27 | // Register commands | ||
| 28 | ed.addCommand('mceMedia', function() { | ||
| 29 | ed.windowManager.open({ | ||
| 30 | file : url + '/media.htm', | ||
| 31 | width : 430 + parseInt(ed.getLang('media.delta_width', 0)), | ||
| 32 | height : 470 + parseInt(ed.getLang('media.delta_height', 0)), | ||
| 33 | inline : 1 | ||
| 34 | }, { | ||
| 35 | plugin_url : url | ||
| 36 | }); | ||
| 37 | }); | ||
| 38 | |||
| 39 | // Register buttons | ||
| 40 | ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); | ||
| 41 | |||
| 42 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 43 | cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n)); | ||
| 44 | }); | ||
| 45 | |||
| 46 | ed.onInit.add(function() { | ||
| 47 | var lo = { | ||
| 48 | mceItemFlash : 'flash', | ||
| 49 | mceItemShockWave : 'shockwave', | ||
| 50 | mceItemWindowsMedia : 'windowsmedia', | ||
| 51 | mceItemQuickTime : 'quicktime', | ||
| 52 | mceItemRealMedia : 'realmedia' | ||
| 53 | }; | ||
| 54 | |||
| 55 | ed.selection.onSetContent.add(function() { | ||
| 56 | t._spansToImgs(ed.getBody()); | ||
| 57 | }); | ||
| 58 | |||
| 59 | ed.selection.onBeforeSetContent.add(t._objectsToSpans, t); | ||
| 60 | |||
| 61 | if (ed.settings.content_css !== false) | ||
| 62 | ed.dom.loadCSS(url + "/css/content.css"); | ||
| 63 | |||
| 64 | if (ed.theme && ed.theme.onResolveName) { | ||
| 65 | ed.theme.onResolveName.add(function(th, o) { | ||
| 66 | if (o.name == 'img') { | ||
| 67 | each(lo, function(v, k) { | ||
| 68 | if (ed.dom.hasClass(o.node, k)) { | ||
| 69 | o.name = v; | ||
| 70 | o.title = ed.dom.getAttrib(o.node, 'title'); | ||
| 71 | return false; | ||
| 72 | } | ||
| 73 | }); | ||
| 74 | } | ||
| 75 | }); | ||
| 76 | } | ||
| 77 | |||
| 78 | if (ed && ed.plugins.contextmenu) { | ||
| 79 | ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { | ||
| 80 | if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) { | ||
| 81 | m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); | ||
| 82 | } | ||
| 83 | }); | ||
| 84 | } | ||
| 85 | }); | ||
| 86 | |||
| 87 | ed.onBeforeSetContent.add(t._objectsToSpans, t); | ||
| 88 | |||
| 89 | ed.onSetContent.add(function() { | ||
| 90 | t._spansToImgs(ed.getBody()); | ||
| 91 | }); | ||
| 92 | |||
| 93 | ed.onPreProcess.add(function(ed, o) { | ||
| 94 | var dom = ed.dom; | ||
| 95 | |||
| 96 | if (o.set) { | ||
| 97 | t._spansToImgs(o.node); | ||
| 98 | |||
| 99 | each(dom.select('IMG', o.node), function(n) { | ||
| 100 | var p; | ||
| 101 | |||
| 102 | if (isMediaElm(n)) { | ||
| 103 | p = t._parse(n.title); | ||
| 104 | dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100)); | ||
| 105 | dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100)); | ||
| 106 | } | ||
| 107 | }); | ||
| 108 | } | ||
| 109 | |||
| 110 | if (o.get) { | ||
| 111 | each(dom.select('IMG', o.node), function(n) { | ||
| 112 | var ci, cb, mt; | ||
| 113 | |||
| 114 | if (ed.getParam('media_use_script')) { | ||
| 115 | if (isMediaElm(n)) | ||
| 116 | n.className = n.className.replace(/mceItem/g, 'mceTemp'); | ||
| 117 | |||
| 118 | return; | ||
| 119 | } | ||
| 120 | |||
| 121 | switch (n.className) { | ||
| 122 | case 'mceItemFlash': | ||
| 123 | ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; | ||
| 124 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 125 | mt = 'application/x-shockwave-flash'; | ||
| 126 | break; | ||
| 127 | |||
| 128 | case 'mceItemShockWave': | ||
| 129 | ci = '166b1bca-3f9c-11cf-8075-444553540000'; | ||
| 130 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; | ||
| 131 | mt = 'application/x-director'; | ||
| 132 | break; | ||
| 133 | |||
| 134 | case 'mceItemWindowsMedia': | ||
| 135 | ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6'; | ||
| 136 | cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 137 | mt = 'application/x-mplayer2'; | ||
| 138 | break; | ||
| 139 | |||
| 140 | case 'mceItemQuickTime': | ||
| 141 | ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b'; | ||
| 142 | cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; | ||
| 143 | mt = 'video/quicktime'; | ||
| 144 | break; | ||
| 145 | |||
| 146 | case 'mceItemRealMedia': | ||
| 147 | ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa'; | ||
| 148 | cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 149 | mt = 'audio/x-pn-realaudio-plugin'; | ||
| 150 | break; | ||
| 151 | } | ||
| 152 | |||
| 153 | if (ci) { | ||
| 154 | dom.replace(t._buildObj({ | ||
| 155 | classid : ci, | ||
| 156 | codebase : cb, | ||
| 157 | type : mt | ||
| 158 | }, n), n); | ||
| 159 | } | ||
| 160 | }); | ||
| 161 | } | ||
| 162 | }); | ||
| 163 | |||
| 164 | ed.onPostProcess.add(function(ed, o) { | ||
| 165 | o.content = o.content.replace(/_mce_value=/g, 'value='); | ||
| 166 | }); | ||
| 167 | |||
| 168 | function getAttr(s, n) { | ||
| 169 | n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); | ||
| 170 | |||
| 171 | return n ? ed.dom.decode(n[1]) : ''; | ||
| 172 | }; | ||
| 173 | |||
| 174 | ed.onPostProcess.add(function(ed, o) { | ||
| 175 | if (ed.getParam('media_use_script')) { | ||
| 176 | o.content = o.content.replace(/<img[^>]+>/g, function(im) { | ||
| 177 | var cl = getAttr(im, 'class'); | ||
| 178 | |||
| 179 | if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) { | ||
| 180 | at = t._parse(getAttr(im, 'title')); | ||
| 181 | at.width = getAttr(im, 'width'); | ||
| 182 | at.height = getAttr(im, 'height'); | ||
| 183 | im = '<script type="text/javascript">write' + cl.substring(7) + '({' + t._serialize(at) + '});</script>'; | ||
| 184 | } | ||
| 185 | |||
| 186 | return im; | ||
| 187 | }); | ||
| 188 | } | ||
| 189 | }); | ||
| 190 | }, | ||
| 191 | |||
| 192 | getInfo : function() { | ||
| 193 | return { | ||
| 194 | longname : 'Media', | ||
| 195 | author : 'Moxiecode Systems AB', | ||
| 196 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 197 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', | ||
| 198 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 199 | }; | ||
| 200 | }, | ||
| 201 | |||
| 202 | // Private methods | ||
| 203 | _objectsToSpans : function(ed, o) { | ||
| 204 | var t = this, h = o.content; | ||
| 205 | |||
| 206 | h = h.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { | ||
| 207 | var o = t._parse(c); | ||
| 208 | |||
| 209 | return '<img class="mceItem' + b + '" title="' + ed.dom.encode(c) + '" src="' + t.url + '/img/trans.gif" width="' + o.width + '" height="' + o.height + '" />' | ||
| 210 | }); | ||
| 211 | |||
| 212 | h = h.replace(/<object([^>]*)>/gi, '<span class="mceItemObject" $1>'); | ||
| 213 | h = h.replace(/<embed([^>]*)\/?>/gi, '<span class="mceItemEmbed" $1></span>'); | ||
| 214 | h = h.replace(/<embed([^>]*)>/gi, '<span class="mceItemEmbed" $1>'); | ||
| 215 | h = h.replace(/<\/(object)([^>]*)>/gi, '</span>'); | ||
| 216 | h = h.replace(/<\/embed>/gi, ''); | ||
| 217 | h = h.replace(/<param([^>]*)>/gi, function(a, b) {return '<span ' + b.replace(/value=/gi, '_mce_value=') + ' class="mceItemParam"></span>'}); | ||
| 218 | h = h.replace(/\/ class=\"mceItemParam\"><\/span>/gi, 'class="mceItemParam"></span>'); | ||
| 219 | |||
| 220 | o.content = h; | ||
| 221 | }, | ||
| 222 | |||
| 223 | _buildObj : function(o, n) { | ||
| 224 | var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title), stc; | ||
| 225 | |||
| 226 | stc = ed.getParam('media_strict', true) && o.type == 'application/x-shockwave-flash'; | ||
| 227 | |||
| 228 | p.width = o.width = dom.getAttrib(n, 'width') || 100; | ||
| 229 | p.height = o.height = dom.getAttrib(n, 'height') || 100; | ||
| 230 | |||
| 231 | if (p.src) | ||
| 232 | p.src = ed.convertURL(p.src, 'src', n); | ||
| 233 | |||
| 234 | if (stc) { | ||
| 235 | ob = dom.create('span', { | ||
| 236 | id : p.id, | ||
| 237 | mce_name : 'object', | ||
| 238 | type : 'application/x-shockwave-flash', | ||
| 239 | data : p.src, | ||
| 240 | style : dom.getAttrib(n, 'style'), | ||
| 241 | width : o.width, | ||
| 242 | height : o.height | ||
| 243 | }); | ||
| 244 | } else { | ||
| 245 | ob = dom.create('span', { | ||
| 246 | id : p.id, | ||
| 247 | mce_name : 'object', | ||
| 248 | classid : "clsid:" + o.classid, | ||
| 249 | style : dom.getAttrib(n, 'style'), | ||
| 250 | codebase : o.codebase, | ||
| 251 | width : o.width, | ||
| 252 | height : o.height | ||
| 253 | }); | ||
| 254 | } | ||
| 255 | |||
| 256 | each (p, function(v, k) { | ||
| 257 | if (!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(k)) { | ||
| 258 | // Use url instead of src in IE for Windows media | ||
| 259 | if (o.type == 'application/x-mplayer2' && k == 'src' && !p.url) | ||
| 260 | k = 'url'; | ||
| 261 | |||
| 262 | if (v) | ||
| 263 | dom.add(ob, 'span', {mce_name : 'param', name : k, '_mce_value' : v}); | ||
| 264 | } | ||
| 265 | }); | ||
| 266 | |||
| 267 | if (!stc) | ||
| 268 | dom.add(ob, 'span', tinymce.extend({mce_name : 'embed', type : o.type, style : dom.getAttrib(n, 'style')}, p)); | ||
| 269 | |||
| 270 | return ob; | ||
| 271 | }, | ||
| 272 | |||
| 273 | _spansToImgs : function(p) { | ||
| 274 | var t = this, dom = t.editor.dom, im, ci; | ||
| 275 | |||
| 276 | each(dom.select('span', p), function(n) { | ||
| 277 | // Convert object into image | ||
| 278 | if (dom.getAttrib(n, 'class') == 'mceItemObject') { | ||
| 279 | ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); | ||
| 280 | |||
| 281 | switch (ci) { | ||
| 282 | case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': | ||
| 283 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 284 | break; | ||
| 285 | |||
| 286 | case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': | ||
| 287 | dom.replace(t._createImg('mceItemShockWave', n), n); | ||
| 288 | break; | ||
| 289 | |||
| 290 | case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': | ||
| 291 | case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': | ||
| 292 | case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': | ||
| 293 | dom.replace(t._createImg('mceItemWindowsMedia', n), n); | ||
| 294 | break; | ||
| 295 | |||
| 296 | case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': | ||
| 297 | dom.replace(t._createImg('mceItemQuickTime', n), n); | ||
| 298 | break; | ||
| 299 | |||
| 300 | case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': | ||
| 301 | dom.replace(t._createImg('mceItemRealMedia', n), n); | ||
| 302 | break; | ||
| 303 | |||
| 304 | default: | ||
| 305 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 306 | } | ||
| 307 | |||
| 308 | return; | ||
| 309 | } | ||
| 310 | |||
| 311 | // Convert embed into image | ||
| 312 | if (dom.getAttrib(n, 'class') == 'mceItemEmbed') { | ||
| 313 | switch (dom.getAttrib(n, 'type')) { | ||
| 314 | case 'application/x-shockwave-flash': | ||
| 315 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 316 | break; | ||
| 317 | |||
| 318 | case 'application/x-director': | ||
| 319 | dom.replace(t._createImg('mceItemShockWave', n), n); | ||
| 320 | break; | ||
| 321 | |||
| 322 | case 'application/x-mplayer2': | ||
| 323 | dom.replace(t._createImg('mceItemWindowsMedia', n), n); | ||
| 324 | break; | ||
| 325 | |||
| 326 | case 'video/quicktime': | ||
| 327 | dom.replace(t._createImg('mceItemQuickTime', n), n); | ||
| 328 | break; | ||
| 329 | |||
| 330 | case 'audio/x-pn-realaudio-plugin': | ||
| 331 | dom.replace(t._createImg('mceItemRealMedia', n), n); | ||
| 332 | break; | ||
| 333 | |||
| 334 | default: | ||
| 335 | dom.replace(t._createImg('mceItemFlash', n), n); | ||
| 336 | } | ||
| 337 | } | ||
| 338 | }); | ||
| 339 | }, | ||
| 340 | |||
| 341 | _createImg : function(cl, n) { | ||
| 342 | var im, dom = this.editor.dom, pa = {}, ti = '', args; | ||
| 343 | |||
| 344 | args = ['id', 'name', 'width', 'height', 'bgcolor', 'align', 'flashvars', 'src', 'wmode', 'allowfullscreen', 'quality', 'data']; | ||
| 345 | |||
| 346 | // Create image | ||
| 347 | im = dom.create('img', { | ||
| 348 | src : this.url + '/img/trans.gif', | ||
| 349 | width : dom.getAttrib(n, 'width') || 100, | ||
| 350 | height : dom.getAttrib(n, 'height') || 100, | ||
| 351 | style : dom.getAttrib(n, 'style'), | ||
| 352 | 'class' : cl | ||
| 353 | }); | ||
| 354 | |||
| 355 | // Setup base parameters | ||
| 356 | each(args, function(na) { | ||
| 357 | var v = dom.getAttrib(n, na); | ||
| 358 | |||
| 359 | if (v) | ||
| 360 | pa[na] = v; | ||
| 361 | }); | ||
| 362 | |||
| 363 | // Add optional parameters | ||
| 364 | each(dom.select('span', n), function(n) { | ||
| 365 | if (dom.hasClass(n, 'mceItemParam')) | ||
| 366 | pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_mce_value'); | ||
| 367 | }); | ||
| 368 | |||
| 369 | // Use src not movie | ||
| 370 | if (pa.movie) { | ||
| 371 | pa.src = pa.movie; | ||
| 372 | delete pa.movie; | ||
| 373 | } | ||
| 374 | |||
| 375 | // No src try data | ||
| 376 | if (!pa.src) { | ||
| 377 | pa.src = pa.data; | ||
| 378 | delete pa.data; | ||
| 379 | } | ||
| 380 | |||
| 381 | // Merge with embed args | ||
| 382 | n = dom.select('.mceItemEmbed', n)[0]; | ||
| 383 | if (n) { | ||
| 384 | each(args, function(na) { | ||
| 385 | var v = dom.getAttrib(n, na); | ||
| 386 | |||
| 387 | if (v && !pa[na]) | ||
| 388 | pa[na] = v; | ||
| 389 | }); | ||
| 390 | } | ||
| 391 | |||
| 392 | delete pa.width; | ||
| 393 | delete pa.height; | ||
| 394 | |||
| 395 | im.title = this._serialize(pa); | ||
| 396 | |||
| 397 | return im; | ||
| 398 | }, | ||
| 399 | |||
| 400 | _parse : function(s) { | ||
| 401 | return tinymce.util.JSON.parse('{' + s + '}'); | ||
| 402 | }, | ||
| 403 | |||
| 404 | _serialize : function(o) { | ||
| 405 | return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); | ||
| 406 | } | ||
| 407 | }); | ||
| 408 | |||
| 409 | // Register plugin | ||
| 410 | tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); | ||
| 411 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flash.gif b/public/javascripts/tiny_mce/plugins/media/img/flash.gif deleted file mode 100644 index cb192e6..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/flash.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf b/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf deleted file mode 100644 index 042c2ab..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif b/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif deleted file mode 100644 index 3b04991..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif deleted file mode 100644 index fdfe0b9..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif b/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif deleted file mode 100644 index 5f235df..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/trans.gif b/public/javascripts/tiny_mce/plugins/media/img/trans.gif deleted file mode 100644 index 3884865..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/trans.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif b/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif deleted file mode 100644 index ab50f2d..0000000 --- a/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/media/js/embed.js b/public/javascripts/tiny_mce/plugins/media/js/embed.js deleted file mode 100644 index f8dc810..0000000 --- a/public/javascripts/tiny_mce/plugins/media/js/embed.js +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. | ||
| 3 | */ | ||
| 4 | |||
| 5 | function writeFlash(p) { | ||
| 6 | writeEmbed( | ||
| 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', | ||
| 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 9 | 'application/x-shockwave-flash', | ||
| 10 | p | ||
| 11 | ); | ||
| 12 | } | ||
| 13 | |||
| 14 | function writeShockWave(p) { | ||
| 15 | writeEmbed( | ||
| 16 | '166B1BCA-3F9C-11CF-8075-444553540000', | ||
| 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', | ||
| 18 | 'application/x-director', | ||
| 19 | p | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | function writeQuickTime(p) { | ||
| 24 | writeEmbed( | ||
| 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', | ||
| 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', | ||
| 27 | 'video/quicktime', | ||
| 28 | p | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | |||
| 32 | function writeRealMedia(p) { | ||
| 33 | writeEmbed( | ||
| 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', | ||
| 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 36 | 'audio/x-pn-realaudio-plugin', | ||
| 37 | p | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | |||
| 41 | function writeWindowsMedia(p) { | ||
| 42 | p.url = p.src; | ||
| 43 | writeEmbed( | ||
| 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', | ||
| 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', | ||
| 46 | 'application/x-mplayer2', | ||
| 47 | p | ||
| 48 | ); | ||
| 49 | } | ||
| 50 | |||
| 51 | function writeEmbed(cls, cb, mt, p) { | ||
| 52 | var h = '', n; | ||
| 53 | |||
| 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; | ||
| 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; | ||
| 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; | ||
| 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; | ||
| 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; | ||
| 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; | ||
| 60 | h += '>'; | ||
| 61 | |||
| 62 | for (n in p) | ||
| 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; | ||
| 64 | |||
| 65 | h += '<embed type="' + mt + '"'; | ||
| 66 | |||
| 67 | for (n in p) | ||
| 68 | h += n + '="' + p[n] + '" '; | ||
| 69 | |||
| 70 | h += '></embed></object>'; | ||
| 71 | |||
| 72 | document.write(h); | ||
| 73 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/js/media.js b/public/javascripts/tiny_mce/plugins/media/js/media.js deleted file mode 100644 index 86cfa98..0000000 --- a/public/javascripts/tiny_mce/plugins/media/js/media.js +++ /dev/null | |||
| @@ -1,630 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var oldWidth, oldHeight, ed, url; | ||
| 4 | |||
| 5 | if (url = tinyMCEPopup.getParam("media_external_list_url")) | ||
| 6 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | var pl = "", f, val; | ||
| 10 | var type = "flash", fe, i; | ||
| 11 | |||
| 12 | ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | tinyMCEPopup.resizeToInnerSize(); | ||
| 15 | f = document.forms[0] | ||
| 16 | |||
| 17 | fe = ed.selection.getNode(); | ||
| 18 | if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { | ||
| 19 | pl = fe.title; | ||
| 20 | |||
| 21 | switch (ed.dom.getAttrib(fe, 'class')) { | ||
| 22 | case 'mceItemFlash': | ||
| 23 | type = 'flash'; | ||
| 24 | break; | ||
| 25 | |||
| 26 | case 'mceItemFlashVideo': | ||
| 27 | type = 'flv'; | ||
| 28 | break; | ||
| 29 | |||
| 30 | case 'mceItemShockWave': | ||
| 31 | type = 'shockwave'; | ||
| 32 | break; | ||
| 33 | |||
| 34 | case 'mceItemWindowsMedia': | ||
| 35 | type = 'wmp'; | ||
| 36 | break; | ||
| 37 | |||
| 38 | case 'mceItemQuickTime': | ||
| 39 | type = 'qt'; | ||
| 40 | break; | ||
| 41 | |||
| 42 | case 'mceItemRealMedia': | ||
| 43 | type = 'rmp'; | ||
| 44 | break; | ||
| 45 | } | ||
| 46 | |||
| 47 | document.forms[0].insert.value = ed.getLang('update', 'Insert', true); | ||
| 48 | } | ||
| 49 | |||
| 50 | document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); | ||
| 51 | document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media'); | ||
| 52 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 53 | |||
| 54 | var html = getMediaListHTML('medialist','src','media','media'); | ||
| 55 | if (html == "") | ||
| 56 | document.getElementById("linklistrow").style.display = 'none'; | ||
| 57 | else | ||
| 58 | document.getElementById("linklistcontainer").innerHTML = html; | ||
| 59 | |||
| 60 | // Resize some elements | ||
| 61 | if (isVisible('filebrowser')) | ||
| 62 | document.getElementById('src').style.width = '230px'; | ||
| 63 | |||
| 64 | // Setup form | ||
| 65 | if (pl != "") { | ||
| 66 | pl = tinyMCEPopup.editor.plugins.media._parse(pl); | ||
| 67 | |||
| 68 | switch (type) { | ||
| 69 | case "flash": | ||
| 70 | setBool(pl, 'flash', 'play'); | ||
| 71 | setBool(pl, 'flash', 'loop'); | ||
| 72 | setBool(pl, 'flash', 'menu'); | ||
| 73 | setBool(pl, 'flash', 'swliveconnect'); | ||
| 74 | setStr(pl, 'flash', 'quality'); | ||
| 75 | setStr(pl, 'flash', 'scale'); | ||
| 76 | setStr(pl, 'flash', 'salign'); | ||
| 77 | setStr(pl, 'flash', 'wmode'); | ||
| 78 | setStr(pl, 'flash', 'base'); | ||
| 79 | setStr(pl, 'flash', 'flashvars'); | ||
| 80 | break; | ||
| 81 | |||
| 82 | case "qt": | ||
| 83 | setBool(pl, 'qt', 'loop'); | ||
| 84 | setBool(pl, 'qt', 'autoplay'); | ||
| 85 | setBool(pl, 'qt', 'cache'); | ||
| 86 | setBool(pl, 'qt', 'controller'); | ||
| 87 | setBool(pl, 'qt', 'correction'); | ||
| 88 | setBool(pl, 'qt', 'enablejavascript'); | ||
| 89 | setBool(pl, 'qt', 'kioskmode'); | ||
| 90 | setBool(pl, 'qt', 'autohref'); | ||
| 91 | setBool(pl, 'qt', 'playeveryframe'); | ||
| 92 | setBool(pl, 'qt', 'tarsetcache'); | ||
| 93 | setStr(pl, 'qt', 'scale'); | ||
| 94 | setStr(pl, 'qt', 'starttime'); | ||
| 95 | setStr(pl, 'qt', 'endtime'); | ||
| 96 | setStr(pl, 'qt', 'tarset'); | ||
| 97 | setStr(pl, 'qt', 'qtsrcchokespeed'); | ||
| 98 | setStr(pl, 'qt', 'volume'); | ||
| 99 | setStr(pl, 'qt', 'qtsrc'); | ||
| 100 | break; | ||
| 101 | |||
| 102 | case "shockwave": | ||
| 103 | setBool(pl, 'shockwave', 'sound'); | ||
| 104 | setBool(pl, 'shockwave', 'progress'); | ||
| 105 | setBool(pl, 'shockwave', 'autostart'); | ||
| 106 | setBool(pl, 'shockwave', 'swliveconnect'); | ||
| 107 | setStr(pl, 'shockwave', 'swvolume'); | ||
| 108 | setStr(pl, 'shockwave', 'swstretchstyle'); | ||
| 109 | setStr(pl, 'shockwave', 'swstretchhalign'); | ||
| 110 | setStr(pl, 'shockwave', 'swstretchvalign'); | ||
| 111 | break; | ||
| 112 | |||
| 113 | case "wmp": | ||
| 114 | setBool(pl, 'wmp', 'autostart'); | ||
| 115 | setBool(pl, 'wmp', 'enabled'); | ||
| 116 | setBool(pl, 'wmp', 'enablecontextmenu'); | ||
| 117 | setBool(pl, 'wmp', 'fullscreen'); | ||
| 118 | setBool(pl, 'wmp', 'invokeurls'); | ||
| 119 | setBool(pl, 'wmp', 'mute'); | ||
| 120 | setBool(pl, 'wmp', 'stretchtofit'); | ||
| 121 | setBool(pl, 'wmp', 'windowlessvideo'); | ||
| 122 | setStr(pl, 'wmp', 'balance'); | ||
| 123 | setStr(pl, 'wmp', 'baseurl'); | ||
| 124 | setStr(pl, 'wmp', 'captioningid'); | ||
| 125 | setStr(pl, 'wmp', 'currentmarker'); | ||
| 126 | setStr(pl, 'wmp', 'currentposition'); | ||
| 127 | setStr(pl, 'wmp', 'defaultframe'); | ||
| 128 | setStr(pl, 'wmp', 'playcount'); | ||
| 129 | setStr(pl, 'wmp', 'rate'); | ||
| 130 | setStr(pl, 'wmp', 'uimode'); | ||
| 131 | setStr(pl, 'wmp', 'volume'); | ||
| 132 | break; | ||
| 133 | |||
| 134 | case "rmp": | ||
| 135 | setBool(pl, 'rmp', 'autostart'); | ||
| 136 | setBool(pl, 'rmp', 'loop'); | ||
| 137 | setBool(pl, 'rmp', 'autogotourl'); | ||
| 138 | setBool(pl, 'rmp', 'center'); | ||
| 139 | setBool(pl, 'rmp', 'imagestatus'); | ||
| 140 | setBool(pl, 'rmp', 'maintainaspect'); | ||
| 141 | setBool(pl, 'rmp', 'nojava'); | ||
| 142 | setBool(pl, 'rmp', 'prefetch'); | ||
| 143 | setBool(pl, 'rmp', 'shuffle'); | ||
| 144 | setStr(pl, 'rmp', 'console'); | ||
| 145 | setStr(pl, 'rmp', 'controls'); | ||
| 146 | setStr(pl, 'rmp', 'numloop'); | ||
| 147 | setStr(pl, 'rmp', 'scriptcallbacks'); | ||
| 148 | break; | ||
| 149 | } | ||
| 150 | |||
| 151 | setStr(pl, null, 'src'); | ||
| 152 | setStr(pl, null, 'id'); | ||
| 153 | setStr(pl, null, 'name'); | ||
| 154 | setStr(pl, null, 'vspace'); | ||
| 155 | setStr(pl, null, 'hspace'); | ||
| 156 | setStr(pl, null, 'bgcolor'); | ||
| 157 | setStr(pl, null, 'align'); | ||
| 158 | setStr(pl, null, 'width'); | ||
| 159 | setStr(pl, null, 'height'); | ||
| 160 | |||
| 161 | if ((val = ed.dom.getAttrib(fe, "width")) != "") | ||
| 162 | pl.width = f.width.value = val; | ||
| 163 | |||
| 164 | if ((val = ed.dom.getAttrib(fe, "height")) != "") | ||
| 165 | pl.height = f.height.value = val; | ||
| 166 | |||
| 167 | oldWidth = pl.width ? parseInt(pl.width) : 0; | ||
| 168 | oldHeight = pl.height ? parseInt(pl.height) : 0; | ||
| 169 | } else | ||
| 170 | oldWidth = oldHeight = 0; | ||
| 171 | |||
| 172 | selectByValue(f, 'media_type', type); | ||
| 173 | changedType(type); | ||
| 174 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 175 | |||
| 176 | TinyMCE_EditableSelects.init(); | ||
| 177 | generatePreview(); | ||
| 178 | } | ||
| 179 | |||
| 180 | function insertMedia() { | ||
| 181 | var fe, f = document.forms[0], h; | ||
| 182 | |||
| 183 | tinyMCEPopup.restoreSelection(); | ||
| 184 | |||
| 185 | if (!AutoValidator.validate(f)) { | ||
| 186 | tinyMCEPopup.alert(ed.getLang('invalid_data')); | ||
| 187 | return false; | ||
| 188 | } | ||
| 189 | |||
| 190 | f.width.value = f.width.value == "" ? 100 : f.width.value; | ||
| 191 | f.height.value = f.height.value == "" ? 100 : f.height.value; | ||
| 192 | |||
| 193 | fe = ed.selection.getNode(); | ||
| 194 | if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) { | ||
| 195 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 196 | case "flash": | ||
| 197 | fe.className = "mceItemFlash"; | ||
| 198 | break; | ||
| 199 | |||
| 200 | case "flv": | ||
| 201 | fe.className = "mceItemFlashVideo"; | ||
| 202 | break; | ||
| 203 | |||
| 204 | case "shockwave": | ||
| 205 | fe.className = "mceItemShockWave"; | ||
| 206 | break; | ||
| 207 | |||
| 208 | case "qt": | ||
| 209 | fe.className = "mceItemQuickTime"; | ||
| 210 | break; | ||
| 211 | |||
| 212 | case "wmp": | ||
| 213 | fe.className = "mceItemWindowsMedia"; | ||
| 214 | break; | ||
| 215 | |||
| 216 | case "rmp": | ||
| 217 | fe.className = "mceItemRealMedia"; | ||
| 218 | break; | ||
| 219 | } | ||
| 220 | |||
| 221 | if (fe.width != f.width.value || fe.height != f.height.value) | ||
| 222 | ed.execCommand('mceRepaint'); | ||
| 223 | |||
| 224 | fe.title = serializeParameters(); | ||
| 225 | fe.width = f.width.value; | ||
| 226 | fe.height = f.height.value; | ||
| 227 | fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : ''); | ||
| 228 | fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : ''); | ||
| 229 | fe.align = f.align.options[f.align.selectedIndex].value; | ||
| 230 | } else { | ||
| 231 | h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ; | ||
| 232 | |||
| 233 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 234 | case "flash": | ||
| 235 | h += ' class="mceItemFlash"'; | ||
| 236 | break; | ||
| 237 | |||
| 238 | case "flv": | ||
| 239 | h += ' class="mceItemFlashVideo"'; | ||
| 240 | break; | ||
| 241 | |||
| 242 | case "shockwave": | ||
| 243 | h += ' class="mceItemShockWave"'; | ||
| 244 | break; | ||
| 245 | |||
| 246 | case "qt": | ||
| 247 | h += ' class="mceItemQuickTime"'; | ||
| 248 | break; | ||
| 249 | |||
| 250 | case "wmp": | ||
| 251 | h += ' class="mceItemWindowsMedia"'; | ||
| 252 | break; | ||
| 253 | |||
| 254 | case "rmp": | ||
| 255 | h += ' class="mceItemRealMedia"'; | ||
| 256 | break; | ||
| 257 | } | ||
| 258 | |||
| 259 | h += ' title="' + serializeParameters() + '"'; | ||
| 260 | h += ' width="' + f.width.value + '"'; | ||
| 261 | h += ' height="' + f.height.value + '"'; | ||
| 262 | h += ' align="' + f.align.options[f.align.selectedIndex].value + '"'; | ||
| 263 | |||
| 264 | h += ' />'; | ||
| 265 | |||
| 266 | ed.execCommand('mceInsertContent', false, h); | ||
| 267 | } | ||
| 268 | |||
| 269 | tinyMCEPopup.close(); | ||
| 270 | } | ||
| 271 | |||
| 272 | function updatePreview() { | ||
| 273 | var f = document.forms[0], type; | ||
| 274 | |||
| 275 | f.width.value = f.width.value || '320'; | ||
| 276 | f.height.value = f.height.value || '240'; | ||
| 277 | |||
| 278 | type = getType(f.src.value); | ||
| 279 | selectByValue(f, 'media_type', type); | ||
| 280 | changedType(type); | ||
| 281 | generatePreview(); | ||
| 282 | } | ||
| 283 | |||
| 284 | function getMediaListHTML() { | ||
| 285 | if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { | ||
| 286 | var html = ""; | ||
| 287 | |||
| 288 | html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">'; | ||
| 289 | html += '<option value="">---</option>'; | ||
| 290 | |||
| 291 | for (var i=0; i<tinyMCEMediaList.length; i++) | ||
| 292 | html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>'; | ||
| 293 | |||
| 294 | html += '</select>'; | ||
| 295 | |||
| 296 | return html; | ||
| 297 | } | ||
| 298 | |||
| 299 | return ""; | ||
| 300 | } | ||
| 301 | |||
| 302 | function getType(v) { | ||
| 303 | var fo, i, c, el, x, f = document.forms[0]; | ||
| 304 | |||
| 305 | fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';'); | ||
| 306 | |||
| 307 | // YouTube | ||
| 308 | if (v.match(/watch\?v=(.+)(.*)/)) { | ||
| 309 | f.width.value = '425'; | ||
| 310 | f.height.value = '350'; | ||
| 311 | f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1]; | ||
| 312 | return 'flash'; | ||
| 313 | } | ||
| 314 | |||
| 315 | // Google video | ||
| 316 | if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) { | ||
| 317 | f.width.value = '425'; | ||
| 318 | f.height.value = '326'; | ||
| 319 | f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en'; | ||
| 320 | return 'flash'; | ||
| 321 | } | ||
| 322 | |||
| 323 | for (i=0; i<fo.length; i++) { | ||
| 324 | c = fo[i].split('='); | ||
| 325 | |||
| 326 | el = c[1].split(','); | ||
| 327 | for (x=0; x<el.length; x++) | ||
| 328 | if (v.indexOf('.' + el[x]) != -1) | ||
| 329 | return c[0]; | ||
| 330 | } | ||
| 331 | |||
| 332 | return null; | ||
| 333 | } | ||
| 334 | |||
| 335 | function switchType(v) { | ||
| 336 | var t = getType(v), d = document, f = d.forms[0]; | ||
| 337 | |||
| 338 | if (!t) | ||
| 339 | return; | ||
| 340 | |||
| 341 | selectByValue(d.forms[0], 'media_type', t); | ||
| 342 | changedType(t); | ||
| 343 | |||
| 344 | // Update qtsrc also | ||
| 345 | if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) { | ||
| 346 | alert(ed.getLang("media_qt_stream_warn")); | ||
| 347 | |||
| 348 | if (f.qt_qtsrc.value == '') | ||
| 349 | f.qt_qtsrc.value = f.src.value; | ||
| 350 | } | ||
| 351 | } | ||
| 352 | |||
| 353 | function changedType(t) { | ||
| 354 | var d = document; | ||
| 355 | |||
| 356 | d.getElementById('flash_options').style.display = 'none'; | ||
| 357 | d.getElementById('flv_options').style.display = 'none'; | ||
| 358 | d.getElementById('qt_options').style.display = 'none'; | ||
| 359 | d.getElementById('shockwave_options').style.display = 'none'; | ||
| 360 | d.getElementById('wmp_options').style.display = 'none'; | ||
| 361 | d.getElementById('rmp_options').style.display = 'none'; | ||
| 362 | |||
| 363 | if (t) | ||
| 364 | d.getElementById(t + '_options').style.display = 'block'; | ||
| 365 | } | ||
| 366 | |||
| 367 | function serializeParameters() { | ||
| 368 | var d = document, f = d.forms[0], s = ''; | ||
| 369 | |||
| 370 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 371 | case "flash": | ||
| 372 | s += getBool('flash', 'play', true); | ||
| 373 | s += getBool('flash', 'loop', true); | ||
| 374 | s += getBool('flash', 'menu', true); | ||
| 375 | s += getBool('flash', 'swliveconnect', false); | ||
| 376 | s += getStr('flash', 'quality'); | ||
| 377 | s += getStr('flash', 'scale'); | ||
| 378 | s += getStr('flash', 'salign'); | ||
| 379 | s += getStr('flash', 'wmode'); | ||
| 380 | s += getStr('flash', 'base'); | ||
| 381 | s += getStr('flash', 'flashvars'); | ||
| 382 | break; | ||
| 383 | |||
| 384 | case "qt": | ||
| 385 | s += getBool('qt', 'loop', false); | ||
| 386 | s += getBool('qt', 'autoplay', true); | ||
| 387 | s += getBool('qt', 'cache', false); | ||
| 388 | s += getBool('qt', 'controller', true); | ||
| 389 | s += getBool('qt', 'correction', false, 'none', 'full'); | ||
| 390 | s += getBool('qt', 'enablejavascript', false); | ||
| 391 | s += getBool('qt', 'kioskmode', false); | ||
| 392 | s += getBool('qt', 'autohref', false); | ||
| 393 | s += getBool('qt', 'playeveryframe', false); | ||
| 394 | s += getBool('qt', 'targetcache', false); | ||
| 395 | s += getStr('qt', 'scale'); | ||
| 396 | s += getStr('qt', 'starttime'); | ||
| 397 | s += getStr('qt', 'endtime'); | ||
| 398 | s += getStr('qt', 'target'); | ||
| 399 | s += getStr('qt', 'qtsrcchokespeed'); | ||
| 400 | s += getStr('qt', 'volume'); | ||
| 401 | s += getStr('qt', 'qtsrc'); | ||
| 402 | break; | ||
| 403 | |||
| 404 | case "shockwave": | ||
| 405 | s += getBool('shockwave', 'sound'); | ||
| 406 | s += getBool('shockwave', 'progress'); | ||
| 407 | s += getBool('shockwave', 'autostart'); | ||
| 408 | s += getBool('shockwave', 'swliveconnect'); | ||
| 409 | s += getStr('shockwave', 'swvolume'); | ||
| 410 | s += getStr('shockwave', 'swstretchstyle'); | ||
| 411 | s += getStr('shockwave', 'swstretchhalign'); | ||
| 412 | s += getStr('shockwave', 'swstretchvalign'); | ||
| 413 | break; | ||
| 414 | |||
| 415 | case "wmp": | ||
| 416 | s += getBool('wmp', 'autostart', true); | ||
| 417 | s += getBool('wmp', 'enabled', false); | ||
| 418 | s += getBool('wmp', 'enablecontextmenu', true); | ||
| 419 | s += getBool('wmp', 'fullscreen', false); | ||
| 420 | s += getBool('wmp', 'invokeurls', true); | ||
| 421 | s += getBool('wmp', 'mute', false); | ||
| 422 | s += getBool('wmp', 'stretchtofit', false); | ||
| 423 | s += getBool('wmp', 'windowlessvideo', false); | ||
| 424 | s += getStr('wmp', 'balance'); | ||
| 425 | s += getStr('wmp', 'baseurl'); | ||
| 426 | s += getStr('wmp', 'captioningid'); | ||
| 427 | s += getStr('wmp', 'currentmarker'); | ||
| 428 | s += getStr('wmp', 'currentposition'); | ||
| 429 | s += getStr('wmp', 'defaultframe'); | ||
| 430 | s += getStr('wmp', 'playcount'); | ||
| 431 | s += getStr('wmp', 'rate'); | ||
| 432 | s += getStr('wmp', 'uimode'); | ||
| 433 | s += getStr('wmp', 'volume'); | ||
| 434 | break; | ||
| 435 | |||
| 436 | case "rmp": | ||
| 437 | s += getBool('rmp', 'autostart', false); | ||
| 438 | s += getBool('rmp', 'loop', false); | ||
| 439 | s += getBool('rmp', 'autogotourl', true); | ||
| 440 | s += getBool('rmp', 'center', false); | ||
| 441 | s += getBool('rmp', 'imagestatus', true); | ||
| 442 | s += getBool('rmp', 'maintainaspect', false); | ||
| 443 | s += getBool('rmp', 'nojava', false); | ||
| 444 | s += getBool('rmp', 'prefetch', false); | ||
| 445 | s += getBool('rmp', 'shuffle', false); | ||
| 446 | s += getStr('rmp', 'console'); | ||
| 447 | s += getStr('rmp', 'controls'); | ||
| 448 | s += getStr('rmp', 'numloop'); | ||
| 449 | s += getStr('rmp', 'scriptcallbacks'); | ||
| 450 | break; | ||
| 451 | } | ||
| 452 | |||
| 453 | s += getStr(null, 'id'); | ||
| 454 | s += getStr(null, 'name'); | ||
| 455 | s += getStr(null, 'src'); | ||
| 456 | s += getStr(null, 'align'); | ||
| 457 | s += getStr(null, 'bgcolor'); | ||
| 458 | s += getInt(null, 'vspace'); | ||
| 459 | s += getInt(null, 'hspace'); | ||
| 460 | s += getStr(null, 'width'); | ||
| 461 | s += getStr(null, 'height'); | ||
| 462 | |||
| 463 | s = s.length > 0 ? s.substring(0, s.length - 1) : s; | ||
| 464 | |||
| 465 | return s; | ||
| 466 | } | ||
| 467 | |||
| 468 | function setBool(pl, p, n) { | ||
| 469 | if (typeof(pl[n]) == "undefined") | ||
| 470 | return; | ||
| 471 | |||
| 472 | document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false'; | ||
| 473 | } | ||
| 474 | |||
| 475 | function setStr(pl, p, n) { | ||
| 476 | var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n]; | ||
| 477 | |||
| 478 | if (typeof(pl[n]) == "undefined") | ||
| 479 | return; | ||
| 480 | |||
| 481 | if (e.type == "text") | ||
| 482 | e.value = pl[n]; | ||
| 483 | else | ||
| 484 | selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]); | ||
| 485 | } | ||
| 486 | |||
| 487 | function getBool(p, n, d, tv, fv) { | ||
| 488 | var v = document.forms[0].elements[p + "_" + n].checked; | ||
| 489 | |||
| 490 | tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'"; | ||
| 491 | fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'"; | ||
| 492 | |||
| 493 | return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',"); | ||
| 494 | } | ||
| 495 | |||
| 496 | function getStr(p, n, d) { | ||
| 497 | var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; | ||
| 498 | var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; | ||
| 499 | |||
| 500 | if (n == 'src') | ||
| 501 | v = tinyMCEPopup.editor.convertURL(v, 'src', null); | ||
| 502 | |||
| 503 | return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',"); | ||
| 504 | } | ||
| 505 | |||
| 506 | function getInt(p, n, d) { | ||
| 507 | var e = document.forms[0].elements[(p != null ? p + "_" : "") + n]; | ||
| 508 | var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value; | ||
| 509 | |||
| 510 | return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ","); | ||
| 511 | } | ||
| 512 | |||
| 513 | function jsEncode(s) { | ||
| 514 | s = s.replace(new RegExp('\\\\', 'g'), '\\\\'); | ||
| 515 | s = s.replace(new RegExp('"', 'g'), '\\"'); | ||
| 516 | s = s.replace(new RegExp("'", 'g'), "\\'"); | ||
| 517 | |||
| 518 | return s; | ||
| 519 | } | ||
| 520 | |||
| 521 | function generatePreview(c) { | ||
| 522 | var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh; | ||
| 523 | |||
| 524 | p.innerHTML = '<!-- x --->'; | ||
| 525 | |||
| 526 | nw = parseInt(f.width.value); | ||
| 527 | nh = parseInt(f.height.value); | ||
| 528 | |||
| 529 | if (f.width.value != "" && f.height.value != "") { | ||
| 530 | if (f.constrain.checked) { | ||
| 531 | if (c == 'width' && oldWidth != 0) { | ||
| 532 | wp = nw / oldWidth; | ||
| 533 | nh = Math.round(wp * nh); | ||
| 534 | f.height.value = nh; | ||
| 535 | } else if (c == 'height' && oldHeight != 0) { | ||
| 536 | hp = nh / oldHeight; | ||
| 537 | nw = Math.round(hp * nw); | ||
| 538 | f.width.value = nw; | ||
| 539 | } | ||
| 540 | } | ||
| 541 | } | ||
| 542 | |||
| 543 | if (f.width.value != "") | ||
| 544 | oldWidth = nw; | ||
| 545 | |||
| 546 | if (f.height.value != "") | ||
| 547 | oldHeight = nh; | ||
| 548 | |||
| 549 | // After constrain | ||
| 550 | pl = serializeParameters(); | ||
| 551 | |||
| 552 | switch (f.media_type.options[f.media_type.selectedIndex].value) { | ||
| 553 | case "flash": | ||
| 554 | cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'; | ||
| 555 | codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; | ||
| 556 | type = 'application/x-shockwave-flash'; | ||
| 557 | break; | ||
| 558 | |||
| 559 | case "shockwave": | ||
| 560 | cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000'; | ||
| 561 | codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; | ||
| 562 | type = 'application/x-director'; | ||
| 563 | break; | ||
| 564 | |||
| 565 | case "qt": | ||
| 566 | cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'; | ||
| 567 | codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; | ||
| 568 | type = 'video/quicktime'; | ||
| 569 | break; | ||
| 570 | |||
| 571 | case "wmp": | ||
| 572 | cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'; | ||
| 573 | codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 574 | type = 'application/x-mplayer2'; | ||
| 575 | break; | ||
| 576 | |||
| 577 | case "rmp": | ||
| 578 | cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'; | ||
| 579 | codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; | ||
| 580 | type = 'audio/x-pn-realaudio-plugin'; | ||
| 581 | break; | ||
| 582 | } | ||
| 583 | |||
| 584 | if (pl == '') { | ||
| 585 | p.innerHTML = ''; | ||
| 586 | return; | ||
| 587 | } | ||
| 588 | |||
| 589 | pl = tinyMCEPopup.editor.plugins.media._parse(pl); | ||
| 590 | |||
| 591 | if (!pl.src) { | ||
| 592 | p.innerHTML = ''; | ||
| 593 | return; | ||
| 594 | } | ||
| 595 | |||
| 596 | pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src); | ||
| 597 | pl.width = !pl.width ? 100 : pl.width; | ||
| 598 | pl.height = !pl.height ? 100 : pl.height; | ||
| 599 | pl.id = !pl.id ? 'obj' : pl.id; | ||
| 600 | pl.name = !pl.name ? 'eobj' : pl.name; | ||
| 601 | pl.align = !pl.align ? '' : pl.align; | ||
| 602 | |||
| 603 | // Avoid annoying warning about insecure items | ||
| 604 | if (!tinymce.isIE || document.location.protocol != 'https:') { | ||
| 605 | h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">'; | ||
| 606 | |||
| 607 | for (n in pl) { | ||
| 608 | h += '<param name="' + n + '" value="' + pl[n] + '">'; | ||
| 609 | |||
| 610 | // Add extra url parameter if it's an absolute URL | ||
| 611 | if (n == 'src' && pl[n].indexOf('://') != -1) | ||
| 612 | h += '<param name="url" value="' + pl[n] + '" />'; | ||
| 613 | } | ||
| 614 | } | ||
| 615 | |||
| 616 | h += '<embed type="' + type + '" '; | ||
| 617 | |||
| 618 | for (n in pl) | ||
| 619 | h += n + '="' + pl[n] + '" '; | ||
| 620 | |||
| 621 | h += '></embed>'; | ||
| 622 | |||
| 623 | // Avoid annoying warning about insecure items | ||
| 624 | if (!tinymce.isIE || document.location.protocol != 'https:') | ||
| 625 | h += '</object>'; | ||
| 626 | |||
| 627 | p.innerHTML = "<!-- x --->" + h; | ||
| 628 | } | ||
| 629 | |||
| 630 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js deleted file mode 100644 index 6d0a996..0000000 --- a/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,103 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.media_dlg',{ | ||
| 2 | title:"Insert / edit embedded media", | ||
| 3 | general:"General", | ||
| 4 | advanced:"Advanced", | ||
| 5 | file:"File/URL", | ||
| 6 | list:"List", | ||
| 7 | size:"Dimensions", | ||
| 8 | preview:"Preview", | ||
| 9 | constrain_proportions:"Constrain proportions", | ||
| 10 | type:"Type", | ||
| 11 | id:"Id", | ||
| 12 | name:"Name", | ||
| 13 | class_name:"Class", | ||
| 14 | vspace:"V-Space", | ||
| 15 | hspace:"H-Space", | ||
| 16 | play:"Auto play", | ||
| 17 | loop:"Loop", | ||
| 18 | menu:"Show menu", | ||
| 19 | quality:"Quality", | ||
| 20 | scale:"Scale", | ||
| 21 | align:"Align", | ||
| 22 | salign:"SAlign", | ||
| 23 | wmode:"WMode", | ||
| 24 | bgcolor:"Background", | ||
| 25 | base:"Base", | ||
| 26 | flashvars:"Flashvars", | ||
| 27 | liveconnect:"SWLiveConnect", | ||
| 28 | autohref:"AutoHREF", | ||
| 29 | cache:"Cache", | ||
| 30 | hidden:"Hidden", | ||
| 31 | controller:"Controller", | ||
| 32 | kioskmode:"Kiosk mode", | ||
| 33 | playeveryframe:"Play every frame", | ||
| 34 | targetcache:"Target cache", | ||
| 35 | correction:"No correction", | ||
| 36 | enablejavascript:"Enable JavaScript", | ||
| 37 | starttime:"Start time", | ||
| 38 | endtime:"End time", | ||
| 39 | href:"Href", | ||
| 40 | qtsrcchokespeed:"Choke speed", | ||
| 41 | target:"Target", | ||
| 42 | volume:"Volume", | ||
| 43 | autostart:"Auto start", | ||
| 44 | enabled:"Enabled", | ||
| 45 | fullscreen:"Fullscreen", | ||
| 46 | invokeurls:"Invoke URLs", | ||
| 47 | mute:"Mute", | ||
| 48 | stretchtofit:"Stretch to fit", | ||
| 49 | windowlessvideo:"Windowless video", | ||
| 50 | balance:"Balance", | ||
| 51 | baseurl:"Base URL", | ||
| 52 | captioningid:"Captioning id", | ||
| 53 | currentmarker:"Current marker", | ||
| 54 | currentposition:"Current position", | ||
| 55 | defaultframe:"Default frame", | ||
| 56 | playcount:"Play count", | ||
| 57 | rate:"Rate", | ||
| 58 | uimode:"UI Mode", | ||
| 59 | flash_options:"Flash options", | ||
| 60 | qt_options:"Quicktime options", | ||
| 61 | wmp_options:"Windows media player options", | ||
| 62 | rmp_options:"Real media player options", | ||
| 63 | shockwave_options:"Shockwave options", | ||
| 64 | autogotourl:"Auto goto URL", | ||
| 65 | center:"Center", | ||
| 66 | imagestatus:"Image status", | ||
| 67 | maintainaspect:"Maintain aspect", | ||
| 68 | nojava:"No java", | ||
| 69 | prefetch:"Prefetch", | ||
| 70 | shuffle:"Shuffle", | ||
| 71 | console:"Console", | ||
| 72 | numloop:"Num loops", | ||
| 73 | controls:"Controls", | ||
| 74 | scriptcallbacks:"Script callbacks", | ||
| 75 | swstretchstyle:"Stretch style", | ||
| 76 | swstretchhalign:"Stretch H-Align", | ||
| 77 | swstretchvalign:"Stretch V-Align", | ||
| 78 | sound:"Sound", | ||
| 79 | progress:"Progress", | ||
| 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..", | ||
| 82 | align_top:"Top", | ||
| 83 | align_right:"Right", | ||
| 84 | align_bottom:"Bottom", | ||
| 85 | align_left:"Left", | ||
| 86 | align_center:"Center", | ||
| 87 | align_top_left:"Top left", | ||
| 88 | align_top_right:"Top right", | ||
| 89 | align_bottom_left:"Bottom left", | ||
| 90 | align_bottom_right:"Bottom right", | ||
| 91 | flv_options:"Flash video options", | ||
| 92 | flv_scalemode:"Scale mode", | ||
| 93 | flv_buffer:"Buffer", | ||
| 94 | flv_startimage:"Start image", | ||
| 95 | flv_starttime:"Start time", | ||
| 96 | flv_defaultvolume:"Default volumne", | ||
| 97 | flv_hiddengui:"Hidden GUI", | ||
| 98 | flv_autostart:"Auto start", | ||
| 99 | flv_loop:"Loop", | ||
| 100 | flv_showscalemodes:"Show scale modes", | ||
| 101 | flv_smoothvideo:"Smooth video", | ||
| 102 | flv_jscallback:"JS Callback" | ||
| 103 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/media/media.htm b/public/javascripts/tiny_mce/plugins/media/media.htm deleted file mode 100644 index 911c03d..0000000 --- a/public/javascripts/tiny_mce/plugins/media/media.htm +++ /dev/null | |||
| @@ -1,822 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#media_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/media.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 10 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 11 | <link href="css/media.css" rel="stylesheet" type="text/css" /> | ||
| 12 | </head> | ||
| 13 | <body style="display: none"> | ||
| 14 | <form onsubmit="insertMedia();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li> | ||
| 18 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#media_dlg.general}</legend> | ||
| 26 | |||
| 27 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 28 | <tr> | ||
| 29 | <td><label for="media_type">{#media_dlg.type}</label></td> | ||
| 30 | <td> | ||
| 31 | <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();"> | ||
| 32 | <option value="flash">Flash</option> | ||
| 33 | <!-- <option value="flv">Flash video (FLV)</option> --> | ||
| 34 | <option value="qt">Quicktime</option> | ||
| 35 | <option value="shockwave">Shockwave</option> | ||
| 36 | <option value="wmp">Windows Media</option> | ||
| 37 | <option value="rmp">Real Media</option> | ||
| 38 | </select> | ||
| 39 | </td> | ||
| 40 | </tr> | ||
| 41 | <tr> | ||
| 42 | <td><label for="src">{#media_dlg.file}</label></td> | ||
| 43 | <td> | ||
| 44 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 45 | <tr> | ||
| 46 | <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td> | ||
| 47 | <td id="filebrowsercontainer"> </td> | ||
| 48 | </tr> | ||
| 49 | </table> | ||
| 50 | </td> | ||
| 51 | </tr> | ||
| 52 | <tr id="linklistrow"> | ||
| 53 | <td><label for="linklist">{#media_dlg.list}</label></td> | ||
| 54 | <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td> | ||
| 55 | </tr> | ||
| 56 | <tr> | ||
| 57 | <td><label for="width">{#media_dlg.size}</label></td> | ||
| 58 | <td> | ||
| 59 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 60 | <tr> | ||
| 61 | <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td> | ||
| 62 | <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td> | ||
| 63 | <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td> | ||
| 64 | </tr> | ||
| 65 | </table> | ||
| 66 | </td> | ||
| 67 | </tr> | ||
| 68 | </table> | ||
| 69 | </fieldset> | ||
| 70 | |||
| 71 | <fieldset> | ||
| 72 | <legend>{#media_dlg.preview}</legend> | ||
| 73 | <div id="prev"></div> | ||
| 74 | </fieldset> | ||
| 75 | </div> | ||
| 76 | |||
| 77 | <div id="advanced_panel" class="panel"> | ||
| 78 | <fieldset> | ||
| 79 | <legend>{#media_dlg.advanced}</legend> | ||
| 80 | |||
| 81 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 82 | <tr> | ||
| 83 | <td><label for="id">{#media_dlg.id}</label></td> | ||
| 84 | <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td> | ||
| 85 | <td><label for="name">{#media_dlg.name}</label></td> | ||
| 86 | <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td> | ||
| 87 | </tr> | ||
| 88 | |||
| 89 | <tr> | ||
| 90 | <td><label for="align">{#media_dlg.align}</label></td> | ||
| 91 | <td> | ||
| 92 | <select id="align" name="align" onchange="generatePreview();"> | ||
| 93 | <option value="">{#not_set}</option> | ||
| 94 | <option value="top">{#media_dlg.align_top}</option> | ||
| 95 | <option value="right">{#media_dlg.align_right}</option> | ||
| 96 | <option value="bottom">{#media_dlg.align_bottom}</option> | ||
| 97 | <option value="left">{#media_dlg.align_left}</option> | ||
| 98 | </select> | ||
| 99 | </td> | ||
| 100 | |||
| 101 | <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td> | ||
| 102 | <td> | ||
| 103 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 104 | <tr> | ||
| 105 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td> | ||
| 106 | <td id="bgcolor_pickcontainer"> </td> | ||
| 107 | </tr> | ||
| 108 | </table> | ||
| 109 | </td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td><label for="vspace">{#media_dlg.vspace}</label></td> | ||
| 114 | <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td> | ||
| 115 | <td><label for="hspace">{#media_dlg.hspace}</label></td> | ||
| 116 | <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td> | ||
| 117 | </tr> | ||
| 118 | </table> | ||
| 119 | </fieldset> | ||
| 120 | |||
| 121 | <fieldset id="flash_options"> | ||
| 122 | <legend>{#media_dlg.flash_options}</legend> | ||
| 123 | |||
| 124 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 125 | <tr> | ||
| 126 | <td><label for="flash_quality">{#media_dlg.quality}</label></td> | ||
| 127 | <td> | ||
| 128 | <select id="flash_quality" name="flash_quality" onchange="generatePreview();"> | ||
| 129 | <option value="">{#not_set}</option> | ||
| 130 | <option value="high">high</option> | ||
| 131 | <option value="low">low</option> | ||
| 132 | <option value="autolow">autolow</option> | ||
| 133 | <option value="autohigh">autohigh</option> | ||
| 134 | <option value="best">best</option> | ||
| 135 | </select> | ||
| 136 | </td> | ||
| 137 | |||
| 138 | <td><label for="flash_scale">{#media_dlg.scale}</label></td> | ||
| 139 | <td> | ||
| 140 | <select id="flash_scale" name="flash_scale" onchange="generatePreview();"> | ||
| 141 | <option value="">{#not_set}</option> | ||
| 142 | <option value="showall">showall</option> | ||
| 143 | <option value="noborder">noborder</option> | ||
| 144 | <option value="exactfit">exactfit</option> | ||
| 145 | <option value="noscale">noscale</option> | ||
| 146 | </select> | ||
| 147 | </td> | ||
| 148 | </tr> | ||
| 149 | |||
| 150 | <tr> | ||
| 151 | <td><label for="flash_wmode">{#media_dlg.wmode}</label></td> | ||
| 152 | <td> | ||
| 153 | <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();"> | ||
| 154 | <option value="">{#not_set}</option> | ||
| 155 | <option value="window">window</option> | ||
| 156 | <option value="opaque">opaque</option> | ||
| 157 | <option value="transparent">transparent</option> | ||
| 158 | </select> | ||
| 159 | </td> | ||
| 160 | |||
| 161 | <td><label for="flash_salign">{#media_dlg.salign}</label></td> | ||
| 162 | <td> | ||
| 163 | <select id="flash_salign" name="flash_salign" onchange="generatePreview();"> | ||
| 164 | <option value="">{#not_set}</option> | ||
| 165 | <option value="l">{#media_dlg.align_left}</option> | ||
| 166 | <option value="t">{#media_dlg.align_top}</option> | ||
| 167 | <option value="r">{#media_dlg.align_right}</option> | ||
| 168 | <option value="b">{#media_dlg.align_bottom}</option> | ||
| 169 | <option value="tl">{#media_dlg.align_top_left}</option> | ||
| 170 | <option value="tr">{#media_dlg.align_top_right}</option> | ||
| 171 | <option value="bl">{#media_dlg.align_bottom_left}</option> | ||
| 172 | <option value="br">{#media_dlg.align_bottom_right}</option> | ||
| 173 | </select> | ||
| 174 | </td> | ||
| 175 | </tr> | ||
| 176 | |||
| 177 | <tr> | ||
| 178 | <td colspan="2"> | ||
| 179 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 180 | <tr> | ||
| 181 | <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td> | ||
| 182 | <td><label for="flash_play">{#media_dlg.play}</label></td> | ||
| 183 | </tr> | ||
| 184 | </table> | ||
| 185 | </td> | ||
| 186 | |||
| 187 | <td colspan="2"> | ||
| 188 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 189 | <tr> | ||
| 190 | <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td> | ||
| 191 | <td><label for="flash_loop">{#media_dlg.loop}</label></td> | ||
| 192 | </tr> | ||
| 193 | </table> | ||
| 194 | </td> | ||
| 195 | </tr> | ||
| 196 | |||
| 197 | <tr> | ||
| 198 | <td colspan="2"> | ||
| 199 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 200 | <tr> | ||
| 201 | <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td> | ||
| 202 | <td><label for="flash_menu">{#media_dlg.menu}</label></td> | ||
| 203 | </tr> | ||
| 204 | </table> | ||
| 205 | </td> | ||
| 206 | |||
| 207 | <td colspan="2"> | ||
| 208 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 209 | <tr> | ||
| 210 | <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td> | ||
| 211 | <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td> | ||
| 212 | </tr> | ||
| 213 | </table> | ||
| 214 | </td> | ||
| 215 | </tr> | ||
| 216 | </table> | ||
| 217 | |||
| 218 | <table> | ||
| 219 | <tr> | ||
| 220 | <td><label for="flash_base">{#media_dlg.base}</label></td> | ||
| 221 | <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td> | ||
| 222 | </tr> | ||
| 223 | |||
| 224 | <tr> | ||
| 225 | <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td> | ||
| 226 | <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td> | ||
| 227 | </tr> | ||
| 228 | </table> | ||
| 229 | </fieldset> | ||
| 230 | |||
| 231 | <fieldset id="flv_options"> | ||
| 232 | <legend>{#media_dlg.flv_options}</legend> | ||
| 233 | |||
| 234 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 235 | <tr> | ||
| 236 | <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td> | ||
| 237 | <td> | ||
| 238 | <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();"> | ||
| 239 | <option value="">{#not_set}</option> | ||
| 240 | <option value="none">none</option> | ||
| 241 | <option value="double">double</option> | ||
| 242 | <option value="full">full</option> | ||
| 243 | </select> | ||
| 244 | </td> | ||
| 245 | |||
| 246 | <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td> | ||
| 247 | <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td> | ||
| 248 | </tr> | ||
| 249 | |||
| 250 | <tr> | ||
| 251 | <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td> | ||
| 252 | <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td> | ||
| 253 | |||
| 254 | <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td> | ||
| 255 | <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td> | ||
| 256 | </tr> | ||
| 257 | |||
| 258 | <tr> | ||
| 259 | <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td> | ||
| 260 | <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td> | ||
| 261 | |||
| 262 | |||
| 263 | </tr> | ||
| 264 | |||
| 265 | <tr> | ||
| 266 | <td colspan="2"> | ||
| 267 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 268 | <tr> | ||
| 269 | <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td> | ||
| 270 | <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td> | ||
| 271 | </tr> | ||
| 272 | </table> | ||
| 273 | </td> | ||
| 274 | |||
| 275 | <td colspan="2"> | ||
| 276 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 277 | <tr> | ||
| 278 | <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td> | ||
| 279 | <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td> | ||
| 280 | </tr> | ||
| 281 | </table> | ||
| 282 | </td> | ||
| 283 | </tr> | ||
| 284 | |||
| 285 | <tr> | ||
| 286 | <td colspan="2"> | ||
| 287 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 288 | <tr> | ||
| 289 | <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td> | ||
| 290 | <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td> | ||
| 291 | </tr> | ||
| 292 | </table> | ||
| 293 | </td> | ||
| 294 | |||
| 295 | <td colspan="2"> | ||
| 296 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 297 | <tr> | ||
| 298 | <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td> | ||
| 299 | <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td> | ||
| 300 | </tr> | ||
| 301 | </table> | ||
| 302 | </td> | ||
| 303 | </tr> | ||
| 304 | |||
| 305 | <tr> | ||
| 306 | <td colspan="2"> | ||
| 307 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 308 | <tr> | ||
| 309 | <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td> | ||
| 310 | <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td> | ||
| 311 | </tr> | ||
| 312 | </table> | ||
| 313 | </td> | ||
| 314 | |||
| 315 | <td colspan="2"> | ||
| 316 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 317 | <tr> | ||
| 318 | <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td> | ||
| 319 | <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td> | ||
| 320 | </tr> | ||
| 321 | </table> | ||
| 322 | </td> | ||
| 323 | </tr> | ||
| 324 | </table> | ||
| 325 | </fieldset> | ||
| 326 | |||
| 327 | <fieldset id="qt_options"> | ||
| 328 | <legend>{#media_dlg.qt_options}</legend> | ||
| 329 | |||
| 330 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 331 | <tr> | ||
| 332 | <td colspan="2"> | ||
| 333 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 334 | <tr> | ||
| 335 | <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td> | ||
| 336 | <td><label for="qt_loop">{#media_dlg.loop}</label></td> | ||
| 337 | </tr> | ||
| 338 | </table> | ||
| 339 | </td> | ||
| 340 | |||
| 341 | <td colspan="2"> | ||
| 342 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 343 | <tr> | ||
| 344 | <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td> | ||
| 345 | <td><label for="qt_autoplay">{#media_dlg.play}</label></td> | ||
| 346 | </tr> | ||
| 347 | </table> | ||
| 348 | </td> | ||
| 349 | </tr> | ||
| 350 | |||
| 351 | <tr> | ||
| 352 | <td colspan="2"> | ||
| 353 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 354 | <tr> | ||
| 355 | <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td> | ||
| 356 | <td><label for="qt_cache">{#media_dlg.cache}</label></td> | ||
| 357 | </tr> | ||
| 358 | </table> | ||
| 359 | </td> | ||
| 360 | |||
| 361 | <td colspan="2"> | ||
| 362 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 363 | <tr> | ||
| 364 | <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td> | ||
| 365 | <td><label for="qt_controller">{#media_dlg.controller}</label></td> | ||
| 366 | </tr> | ||
| 367 | </table> | ||
| 368 | </td> | ||
| 369 | </tr> | ||
| 370 | |||
| 371 | <tr> | ||
| 372 | <td colspan="2"> | ||
| 373 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 374 | <tr> | ||
| 375 | <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td> | ||
| 376 | <td><label for="qt_correction">{#media_dlg.correction}</label></td> | ||
| 377 | </tr> | ||
| 378 | </table> | ||
| 379 | </td> | ||
| 380 | |||
| 381 | <td colspan="2"> | ||
| 382 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 383 | <tr> | ||
| 384 | <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td> | ||
| 385 | <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td> | ||
| 386 | </tr> | ||
| 387 | </table> | ||
| 388 | </td> | ||
| 389 | </tr> | ||
| 390 | |||
| 391 | <tr> | ||
| 392 | <td colspan="2"> | ||
| 393 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 394 | <tr> | ||
| 395 | <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td> | ||
| 396 | <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td> | ||
| 397 | </tr> | ||
| 398 | </table> | ||
| 399 | </td> | ||
| 400 | |||
| 401 | <td colspan="2"> | ||
| 402 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 403 | <tr> | ||
| 404 | <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td> | ||
| 405 | <td><label for="qt_autohref">{#media_dlg.autohref}</label></td> | ||
| 406 | </tr> | ||
| 407 | </table> | ||
| 408 | </td> | ||
| 409 | </tr> | ||
| 410 | |||
| 411 | <tr> | ||
| 412 | <td colspan="2"> | ||
| 413 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 414 | <tr> | ||
| 415 | <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td> | ||
| 416 | <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td> | ||
| 417 | </tr> | ||
| 418 | </table> | ||
| 419 | </td> | ||
| 420 | |||
| 421 | <td colspan="2"> | ||
| 422 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 423 | <tr> | ||
| 424 | <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td> | ||
| 425 | <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td> | ||
| 426 | </tr> | ||
| 427 | </table> | ||
| 428 | </td> | ||
| 429 | </tr> | ||
| 430 | |||
| 431 | <tr> | ||
| 432 | <td><label for="qt_scale">{#media_dlg.scale}</label></td> | ||
| 433 | <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();"> | ||
| 434 | <option value="">{#not_set}</option> | ||
| 435 | <option value="tofit">tofit</option> | ||
| 436 | <option value="aspect">aspect</option> | ||
| 437 | </select> | ||
| 438 | </td> | ||
| 439 | |||
| 440 | <td colspan="2"> </td> | ||
| 441 | </tr> | ||
| 442 | |||
| 443 | <tr> | ||
| 444 | <td><label for="qt_starttime">{#media_dlg.starttime}</label></td> | ||
| 445 | <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td> | ||
| 446 | |||
| 447 | <td><label for="qt_endtime">{#media_dlg.endtime}</label></td> | ||
| 448 | <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td> | ||
| 449 | </tr> | ||
| 450 | |||
| 451 | <tr> | ||
| 452 | <td><label for="qt_target">{#media_dlg.target}</label></td> | ||
| 453 | <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td> | ||
| 454 | |||
| 455 | <td><label for="qt_href">{#media_dlg.href}</label></td> | ||
| 456 | <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td> | ||
| 457 | </tr> | ||
| 458 | |||
| 459 | <tr> | ||
| 460 | <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td> | ||
| 461 | <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td> | ||
| 462 | |||
| 463 | <td><label for="qt_volume">{#media_dlg.volume}</label></td> | ||
| 464 | <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td> | ||
| 465 | </tr> | ||
| 466 | |||
| 467 | <tr> | ||
| 468 | <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td> | ||
| 469 | <td colspan="4"> | ||
| 470 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 471 | <tr> | ||
| 472 | <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td> | ||
| 473 | <td id="qtsrcfilebrowsercontainer"> </td> | ||
| 474 | </tr> | ||
| 475 | </table> | ||
| 476 | </td> | ||
| 477 | </tr> | ||
| 478 | </table> | ||
| 479 | </fieldset> | ||
| 480 | |||
| 481 | <fieldset id="wmp_options"> | ||
| 482 | <legend>{#media_dlg.wmp_options}</legend> | ||
| 483 | |||
| 484 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 485 | <tr> | ||
| 486 | <td colspan="2"> | ||
| 487 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 488 | <tr> | ||
| 489 | <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td> | ||
| 490 | <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td> | ||
| 491 | </tr> | ||
| 492 | </table> | ||
| 493 | </td> | ||
| 494 | |||
| 495 | <td colspan="2"> | ||
| 496 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 497 | <tr> | ||
| 498 | <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td> | ||
| 499 | <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td> | ||
| 500 | </tr> | ||
| 501 | </table> | ||
| 502 | </td> | ||
| 503 | </tr> | ||
| 504 | |||
| 505 | <tr> | ||
| 506 | <td colspan="2"> | ||
| 507 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 508 | <tr> | ||
| 509 | <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td> | ||
| 510 | <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td> | ||
| 511 | </tr> | ||
| 512 | </table> | ||
| 513 | </td> | ||
| 514 | |||
| 515 | <td colspan="2"> | ||
| 516 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 517 | <tr> | ||
| 518 | <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td> | ||
| 519 | <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td> | ||
| 520 | </tr> | ||
| 521 | </table> | ||
| 522 | </td> | ||
| 523 | </tr> | ||
| 524 | |||
| 525 | <tr> | ||
| 526 | <td colspan="2"> | ||
| 527 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 528 | <tr> | ||
| 529 | <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td> | ||
| 530 | <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td> | ||
| 531 | </tr> | ||
| 532 | </table> | ||
| 533 | </td> | ||
| 534 | |||
| 535 | <td colspan="2"> | ||
| 536 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 537 | <tr> | ||
| 538 | <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td> | ||
| 539 | <td><label for="wmp_mute">{#media_dlg.mute}</label></td> | ||
| 540 | </tr> | ||
| 541 | </table> | ||
| 542 | </td> | ||
| 543 | </tr> | ||
| 544 | |||
| 545 | <tr> | ||
| 546 | <td colspan="2"> | ||
| 547 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 548 | <tr> | ||
| 549 | <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td> | ||
| 550 | <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td> | ||
| 551 | </tr> | ||
| 552 | </table> | ||
| 553 | </td> | ||
| 554 | |||
| 555 | <td colspan="2"> | ||
| 556 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 557 | <tr> | ||
| 558 | <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td> | ||
| 559 | <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td> | ||
| 560 | </tr> | ||
| 561 | </table> | ||
| 562 | </td> | ||
| 563 | </tr> | ||
| 564 | |||
| 565 | <tr> | ||
| 566 | <td><label for="wmp_balance">{#media_dlg.balance}</label></td> | ||
| 567 | <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td> | ||
| 568 | |||
| 569 | <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td> | ||
| 570 | <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td> | ||
| 571 | </tr> | ||
| 572 | |||
| 573 | <tr> | ||
| 574 | <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td> | ||
| 575 | <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td> | ||
| 576 | |||
| 577 | <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td> | ||
| 578 | <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td> | ||
| 579 | </tr> | ||
| 580 | |||
| 581 | <tr> | ||
| 582 | <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td> | ||
| 583 | <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td> | ||
| 584 | |||
| 585 | <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td> | ||
| 586 | <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td> | ||
| 587 | </tr> | ||
| 588 | |||
| 589 | <tr> | ||
| 590 | <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td> | ||
| 591 | <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td> | ||
| 592 | |||
| 593 | <td><label for="wmp_rate">{#media_dlg.rate}</label></td> | ||
| 594 | <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td> | ||
| 595 | </tr> | ||
| 596 | |||
| 597 | <tr> | ||
| 598 | <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td> | ||
| 599 | <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td> | ||
| 600 | |||
| 601 | <td><label for="wmp_volume">{#media_dlg.volume}</label></td> | ||
| 602 | <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td> | ||
| 603 | </tr> | ||
| 604 | |||
| 605 | </table> | ||
| 606 | </fieldset> | ||
| 607 | |||
| 608 | <fieldset id="rmp_options"> | ||
| 609 | <legend>{#media_dlg.rmp_options}</legend> | ||
| 610 | |||
| 611 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 612 | <tr> | ||
| 613 | <td colspan="2"> | ||
| 614 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 615 | <tr> | ||
| 616 | <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td> | ||
| 617 | <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td> | ||
| 618 | </tr> | ||
| 619 | </table> | ||
| 620 | </td> | ||
| 621 | |||
| 622 | <td colspan="2"> | ||
| 623 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 624 | <tr> | ||
| 625 | <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td> | ||
| 626 | <td><label for="rmp_loop">{#media_dlg.loop}</label></td> | ||
| 627 | </tr> | ||
| 628 | </table> | ||
| 629 | </td> | ||
| 630 | </tr> | ||
| 631 | |||
| 632 | <tr> | ||
| 633 | <td colspan="2"> | ||
| 634 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 635 | <tr> | ||
| 636 | <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td> | ||
| 637 | <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td> | ||
| 638 | </tr> | ||
| 639 | </table> | ||
| 640 | </td> | ||
| 641 | |||
| 642 | <td colspan="2"> | ||
| 643 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 644 | <tr> | ||
| 645 | <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td> | ||
| 646 | <td><label for="rmp_center">{#media_dlg.center}</label></td> | ||
| 647 | </tr> | ||
| 648 | </table> | ||
| 649 | </td> | ||
| 650 | </tr> | ||
| 651 | |||
| 652 | <tr> | ||
| 653 | <td colspan="2"> | ||
| 654 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 655 | <tr> | ||
| 656 | <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td> | ||
| 657 | <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td> | ||
| 658 | </tr> | ||
| 659 | </table> | ||
| 660 | </td> | ||
| 661 | |||
| 662 | <td colspan="2"> | ||
| 663 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 664 | <tr> | ||
| 665 | <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td> | ||
| 666 | <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td> | ||
| 667 | </tr> | ||
| 668 | </table> | ||
| 669 | </td> | ||
| 670 | </tr> | ||
| 671 | |||
| 672 | <tr> | ||
| 673 | <td colspan="2"> | ||
| 674 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 675 | <tr> | ||
| 676 | <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td> | ||
| 677 | <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td> | ||
| 678 | </tr> | ||
| 679 | </table> | ||
| 680 | </td> | ||
| 681 | |||
| 682 | <td colspan="2"> | ||
| 683 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 684 | <tr> | ||
| 685 | <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td> | ||
| 686 | <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td> | ||
| 687 | </tr> | ||
| 688 | </table> | ||
| 689 | </td> | ||
| 690 | </tr> | ||
| 691 | |||
| 692 | <tr> | ||
| 693 | <td colspan="2"> | ||
| 694 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 695 | <tr> | ||
| 696 | <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td> | ||
| 697 | <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td> | ||
| 698 | </tr> | ||
| 699 | </table> | ||
| 700 | </td> | ||
| 701 | |||
| 702 | <td colspan="2"> | ||
| 703 | | ||
| 704 | </td> | ||
| 705 | </tr> | ||
| 706 | |||
| 707 | <tr> | ||
| 708 | <td><label for="rmp_console">{#media_dlg.console}</label></td> | ||
| 709 | <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td> | ||
| 710 | |||
| 711 | <td><label for="rmp_controls">{#media_dlg.controls}</label></td> | ||
| 712 | <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td> | ||
| 713 | </tr> | ||
| 714 | |||
| 715 | <tr> | ||
| 716 | <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td> | ||
| 717 | <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td> | ||
| 718 | |||
| 719 | <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td> | ||
| 720 | <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td> | ||
| 721 | </tr> | ||
| 722 | </table> | ||
| 723 | </fieldset> | ||
| 724 | |||
| 725 | <fieldset id="shockwave_options"> | ||
| 726 | <legend>{#media_dlg.shockwave_options}</legend> | ||
| 727 | |||
| 728 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 729 | <tr> | ||
| 730 | <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td> | ||
| 731 | <td> | ||
| 732 | <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();"> | ||
| 733 | <option value="none">{#not_set}</option> | ||
| 734 | <option value="meet">Meet</option> | ||
| 735 | <option value="fill">Fill</option> | ||
| 736 | <option value="stage">Stage</option> | ||
| 737 | </select> | ||
| 738 | </td> | ||
| 739 | |||
| 740 | <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td> | ||
| 741 | <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td> | ||
| 742 | </tr> | ||
| 743 | |||
| 744 | <tr> | ||
| 745 | <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td> | ||
| 746 | <td> | ||
| 747 | <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();"> | ||
| 748 | <option value="none">{#not_set}</option> | ||
| 749 | <option value="left">{#media_dlg.align_left}</option> | ||
| 750 | <option value="center">{#media_dlg.align_center}</option> | ||
| 751 | <option value="right">{#media_dlg.align_right}</option> | ||
| 752 | </select> | ||
| 753 | </td> | ||
| 754 | |||
| 755 | <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td> | ||
| 756 | <td> | ||
| 757 | <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();"> | ||
| 758 | <option value="none">{#not_set}</option> | ||
| 759 | <option value="meet">Meet</option> | ||
| 760 | <option value="fill">Fill</option> | ||
| 761 | <option value="stage">Stage</option> | ||
| 762 | </select> | ||
| 763 | </td> | ||
| 764 | </tr> | ||
| 765 | |||
| 766 | <tr> | ||
| 767 | <td colspan="2"> | ||
| 768 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 769 | <tr> | ||
| 770 | <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td> | ||
| 771 | <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td> | ||
| 772 | </tr> | ||
| 773 | </table> | ||
| 774 | </td> | ||
| 775 | |||
| 776 | <td colspan="2"> | ||
| 777 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 778 | <tr> | ||
| 779 | <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td> | ||
| 780 | <td><label for="shockwave_sound">{#media_dlg.sound}</label></td> | ||
| 781 | </tr> | ||
| 782 | </table> | ||
| 783 | </td> | ||
| 784 | </tr> | ||
| 785 | |||
| 786 | |||
| 787 | <tr> | ||
| 788 | <td colspan="2"> | ||
| 789 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 790 | <tr> | ||
| 791 | <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td> | ||
| 792 | <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td> | ||
| 793 | </tr> | ||
| 794 | </table> | ||
| 795 | </td> | ||
| 796 | |||
| 797 | <td colspan="2"> | ||
| 798 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 799 | <tr> | ||
| 800 | <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td> | ||
| 801 | <td><label for="shockwave_progress">{#media_dlg.progress}</label></td> | ||
| 802 | </tr> | ||
| 803 | </table> | ||
| 804 | </td> | ||
| 805 | </tr> | ||
| 806 | </table> | ||
| 807 | </fieldset> | ||
| 808 | </div> | ||
| 809 | </div> | ||
| 810 | |||
| 811 | <div class="mceActionPanel"> | ||
| 812 | <div style="float: left"> | ||
| 813 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 814 | </div> | ||
| 815 | |||
| 816 | <div style="float: right"> | ||
| 817 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 818 | </div> | ||
| 819 | </div> | ||
| 820 | </form> | ||
| 821 | </body> | ||
| 822 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js deleted file mode 100644 index f2dbbff..0000000 --- a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?'<span class="mceItemHidden mceVisualNbsp">·</span>':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js deleted file mode 100644 index b723756..0000000 --- a/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Nonbreaking', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceNonBreaking', function() { | ||
| 17 | ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? '<span class="mceItemHidden mceVisualNbsp">·</span>' : ' '); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // Register buttons | ||
| 21 | ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); | ||
| 22 | |||
| 23 | if (ed.getParam('nonbreaking_force_tab')) { | ||
| 24 | ed.onKeyDown.add(function(ed, e) { | ||
| 25 | if (tinymce.isIE && e.keyCode == 9) { | ||
| 26 | ed.execCommand('mceNonBreaking'); | ||
| 27 | ed.execCommand('mceNonBreaking'); | ||
| 28 | ed.execCommand('mceNonBreaking'); | ||
| 29 | tinymce.dom.Event.cancel(e); | ||
| 30 | } | ||
| 31 | }); | ||
| 32 | } | ||
| 33 | }, | ||
| 34 | |||
| 35 | getInfo : function() { | ||
| 36 | return { | ||
| 37 | longname : 'Nonbreaking space', | ||
| 38 | author : 'Moxiecode Systems AB', | ||
| 39 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 40 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', | ||
| 41 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 42 | }; | ||
| 43 | } | ||
| 44 | |||
| 45 | // Private methods | ||
| 46 | }); | ||
| 47 | |||
| 48 | // Register plugin | ||
| 49 | tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); | ||
| 50 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js deleted file mode 100644 index 9945cd8..0000000 --- a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(h,g,k){var j,i;j=h.dom.getParent(h.selection.getStart(),function(l){return h.dom.hasClass(l,b)});i=h.dom.getParent(h.selection.getEnd(),function(l){return h.dom.hasClass(l,b)});if(j||i){f._setDisabled(1);return false}else{f._setDisabled(0)}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js deleted file mode 100644 index 77db577..0000000 --- a/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 743 2008-03-23 17:47:33Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.NonEditablePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, editClass, nonEditClass; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | editClass = ed.getParam("noneditable_editable_class", "mceEditable"); | ||
| 17 | nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); | ||
| 18 | |||
| 19 | ed.onNodeChange.addToTop(function(ed, cm, n) { | ||
| 20 | var sc, ec; | ||
| 21 | |||
| 22 | // Block if start or end is inside a non editable element | ||
| 23 | sc = ed.dom.getParent(ed.selection.getStart(), function(n) { | ||
| 24 | return ed.dom.hasClass(n, nonEditClass); | ||
| 25 | }); | ||
| 26 | |||
| 27 | ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { | ||
| 28 | return ed.dom.hasClass(n, nonEditClass); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Block or unblock | ||
| 32 | if (sc || ec) { | ||
| 33 | t._setDisabled(1); | ||
| 34 | return false; | ||
| 35 | } else | ||
| 36 | t._setDisabled(0); | ||
| 37 | }); | ||
| 38 | }, | ||
| 39 | |||
| 40 | getInfo : function() { | ||
| 41 | return { | ||
| 42 | longname : 'Non editable elements', | ||
| 43 | author : 'Moxiecode Systems AB', | ||
| 44 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 45 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', | ||
| 46 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 47 | }; | ||
| 48 | }, | ||
| 49 | |||
| 50 | _block : function(ed, e) { | ||
| 51 | var k = e.keyCode; | ||
| 52 | |||
| 53 | // Don't block arrow keys, pg up/down, and F1-F12 | ||
| 54 | if ((k > 32 && k < 41) || (k > 111 && k < 124)) | ||
| 55 | return; | ||
| 56 | |||
| 57 | return Event.cancel(e); | ||
| 58 | }, | ||
| 59 | |||
| 60 | _setDisabled : function(s) { | ||
| 61 | var t = this, ed = t.editor; | ||
| 62 | |||
| 63 | tinymce.each(ed.controlManager.controls, function(c) { | ||
| 64 | c.setDisabled(s); | ||
| 65 | }); | ||
| 66 | |||
| 67 | if (s !== t.disabled) { | ||
| 68 | if (s) { | ||
| 69 | ed.onKeyDown.addToTop(t._block); | ||
| 70 | ed.onKeyPress.addToTop(t._block); | ||
| 71 | ed.onKeyUp.addToTop(t._block); | ||
| 72 | ed.onPaste.addToTop(t._block); | ||
| 73 | } else { | ||
| 74 | ed.onKeyDown.remove(t._block); | ||
| 75 | ed.onKeyPress.remove(t._block); | ||
| 76 | ed.onKeyUp.remove(t._block); | ||
| 77 | ed.onPaste.remove(t._block); | ||
| 78 | } | ||
| 79 | |||
| 80 | t.disabled = s; | ||
| 81 | } | ||
| 82 | } | ||
| 83 | }); | ||
| 84 | |||
| 85 | // Register plugin | ||
| 86 | tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); | ||
| 87 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css b/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css deleted file mode 100644 index c949d58..0000000 --- a/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | .mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js deleted file mode 100644 index a212f69..0000000 --- a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+d+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js deleted file mode 100644 index 16f5748..0000000 --- a/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.PageBreakPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE; | ||
| 12 | |||
| 13 | pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mcePageBreak', function() { | ||
| 17 | ed.execCommand('mceInsertContent', 0, pb); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // Register buttons | ||
| 21 | ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); | ||
| 22 | |||
| 23 | ed.onInit.add(function() { | ||
| 24 | if (ed.settings.content_css !== false) | ||
| 25 | ed.dom.loadCSS(url + "/css/content.css"); | ||
| 26 | |||
| 27 | if (ed.theme.onResolveName) { | ||
| 28 | ed.theme.onResolveName.add(function(th, o) { | ||
| 29 | if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) | ||
| 30 | o.name = 'pagebreak'; | ||
| 31 | }); | ||
| 32 | } | ||
| 33 | }); | ||
| 34 | |||
| 35 | ed.onClick.add(function(ed, e) { | ||
| 36 | e = e.target; | ||
| 37 | |||
| 38 | if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) | ||
| 39 | ed.selection.select(e); | ||
| 40 | }); | ||
| 41 | |||
| 42 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 43 | cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); | ||
| 44 | }); | ||
| 45 | |||
| 46 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 47 | o.content = o.content.replace(pbRE, pb); | ||
| 48 | }); | ||
| 49 | |||
| 50 | ed.onPostProcess.add(function(ed, o) { | ||
| 51 | if (o.get) | ||
| 52 | o.content = o.content.replace(/<img[^>]+>/g, function(im) { | ||
| 53 | if (im.indexOf('class="mcePageBreak') !== -1) | ||
| 54 | im = sep; | ||
| 55 | |||
| 56 | return im; | ||
| 57 | }); | ||
| 58 | }); | ||
| 59 | }, | ||
| 60 | |||
| 61 | getInfo : function() { | ||
| 62 | return { | ||
| 63 | longname : 'PageBreak', | ||
| 64 | author : 'Moxiecode Systems AB', | ||
| 65 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 66 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', | ||
| 67 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 68 | }; | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | |||
| 72 | // Register plugin | ||
| 73 | tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); | ||
| 74 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif deleted file mode 100644 index acdf408..0000000 --- a/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif b/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif deleted file mode 100644 index 3884865..0000000 --- a/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js deleted file mode 100644 index 7b2bbd9..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"\uFEFF");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);if(p.innerHTML==="\uFEFF"){c.execCommand("mcePasteWord");l.preventDefault();return}g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var q="",n=o.select("div[id=_mcePaste]");a(n,function(r){q+=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js deleted file mode 100644 index 8b6cae3..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,531 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1225 2009-09-07 19:06:19Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.PastePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this, cb; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | t.url = url; | ||
| 17 | |||
| 18 | // Setup plugin events | ||
| 19 | t.onPreProcess = new tinymce.util.Dispatcher(t); | ||
| 20 | t.onPostProcess = new tinymce.util.Dispatcher(t); | ||
| 21 | |||
| 22 | // Register default handlers | ||
| 23 | t.onPreProcess.add(t._preProcess); | ||
| 24 | t.onPostProcess.add(t._postProcess); | ||
| 25 | |||
| 26 | // Register optional preprocess handler | ||
| 27 | t.onPreProcess.add(function(pl, o) { | ||
| 28 | ed.execCallback('paste_preprocess', pl, o); | ||
| 29 | }); | ||
| 30 | |||
| 31 | // Register optional postprocess | ||
| 32 | t.onPostProcess.add(function(pl, o) { | ||
| 33 | ed.execCallback('paste_postprocess', pl, o); | ||
| 34 | }); | ||
| 35 | |||
| 36 | // This function executes the process handlers and inserts the contents | ||
| 37 | function process(o) { | ||
| 38 | var dom = ed.dom; | ||
| 39 | |||
| 40 | // Execute pre process handlers | ||
| 41 | t.onPreProcess.dispatch(t, o); | ||
| 42 | |||
| 43 | // Create DOM structure | ||
| 44 | o.node = dom.create('div', 0, o.content); | ||
| 45 | |||
| 46 | // Execute post process handlers | ||
| 47 | t.onPostProcess.dispatch(t, o); | ||
| 48 | |||
| 49 | // Serialize content | ||
| 50 | o.content = ed.serializer.serialize(o.node, {getInner : 1}); | ||
| 51 | |||
| 52 | // Insert cleaned content. We need to handle insertion of contents containing block elements separately | ||
| 53 | if (/<(p|h[1-6]|ul|ol)/.test(o.content)) | ||
| 54 | t._insertBlockContent(ed, dom, o.content); | ||
| 55 | else | ||
| 56 | t._insert(o.content); | ||
| 57 | }; | ||
| 58 | |||
| 59 | // Add command for external usage | ||
| 60 | ed.addCommand('mceInsertClipboardContent', function(u, o) { | ||
| 61 | process(o); | ||
| 62 | }); | ||
| 63 | |||
| 64 | // This function grabs the contents from the clipboard by adding a | ||
| 65 | // hidden div and placing the caret inside it and after the browser paste | ||
| 66 | // is done it grabs that contents and processes that | ||
| 67 | function grabContent(e) { | ||
| 68 | var n, or, rng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY; | ||
| 69 | |||
| 70 | if (dom.get('_mcePaste')) | ||
| 71 | return; | ||
| 72 | |||
| 73 | // Create container to paste into | ||
| 74 | n = dom.add(body, 'div', {id : '_mcePaste'}, '\uFEFF'); | ||
| 75 | |||
| 76 | // If contentEditable mode we need to find out the position of the closest element | ||
| 77 | if (body != ed.getDoc().body) | ||
| 78 | posY = dom.getPos(ed.selection.getStart(), body).y; | ||
| 79 | else | ||
| 80 | posY = body.scrollTop; | ||
| 81 | |||
| 82 | // Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles | ||
| 83 | dom.setStyles(n, { | ||
| 84 | position : 'absolute', | ||
| 85 | left : -10000, | ||
| 86 | top : posY, | ||
| 87 | width : 1, | ||
| 88 | height : 1, | ||
| 89 | overflow : 'hidden' | ||
| 90 | }); | ||
| 91 | |||
| 92 | if (tinymce.isIE) { | ||
| 93 | // Select the container | ||
| 94 | rng = dom.doc.body.createTextRange(); | ||
| 95 | rng.moveToElementText(n); | ||
| 96 | rng.execCommand('Paste'); | ||
| 97 | |||
| 98 | // Remove container | ||
| 99 | dom.remove(n); | ||
| 100 | |||
| 101 | // Check if the contents was changed, if it wasn't then clipboard extraction failed probably due | ||
| 102 | // to IE security settings so we pass the junk though better than nothing right | ||
| 103 | if (n.innerHTML === '\uFEFF') { | ||
| 104 | ed.execCommand('mcePasteWord'); | ||
| 105 | e.preventDefault(); | ||
| 106 | return; | ||
| 107 | } | ||
| 108 | |||
| 109 | // Process contents | ||
| 110 | process({content : n.innerHTML}); | ||
| 111 | |||
| 112 | // Block the real paste event | ||
| 113 | return tinymce.dom.Event.cancel(e); | ||
| 114 | } else { | ||
| 115 | or = ed.selection.getRng(); | ||
| 116 | |||
| 117 | // Move caret into hidden div | ||
| 118 | n = n.firstChild; | ||
| 119 | rng = ed.getDoc().createRange(); | ||
| 120 | rng.setStart(n, 0); | ||
| 121 | rng.setEnd(n, 1); | ||
| 122 | sel.setRng(rng); | ||
| 123 | |||
| 124 | // Wait a while and grab the pasted contents | ||
| 125 | window.setTimeout(function() { | ||
| 126 | var h = '', nl = dom.select('div[id=_mcePaste]'); | ||
| 127 | |||
| 128 | // WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string | ||
| 129 | each(nl, function(n) { | ||
| 130 | h += (dom.select('> span.Apple-style-span div', n)[0] || dom.select('> span.Apple-style-span', n)[0] || n).innerHTML; | ||
| 131 | }); | ||
| 132 | |||
| 133 | // Remove the nodes | ||
| 134 | each(nl, function(n) { | ||
| 135 | dom.remove(n); | ||
| 136 | }); | ||
| 137 | |||
| 138 | // Restore the old selection | ||
| 139 | if (or) | ||
| 140 | sel.setRng(or); | ||
| 141 | |||
| 142 | process({content : h}); | ||
| 143 | }, 0); | ||
| 144 | } | ||
| 145 | }; | ||
| 146 | |||
| 147 | // Check if we should use the new auto process method | ||
| 148 | if (ed.getParam('paste_auto_cleanup_on_paste', true)) { | ||
| 149 | // Is it's Opera or older FF use key handler | ||
| 150 | if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { | ||
| 151 | ed.onKeyDown.add(function(ed, e) { | ||
| 152 | if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) | ||
| 153 | grabContent(e); | ||
| 154 | }); | ||
| 155 | } else { | ||
| 156 | // Grab contents on paste event on Gecko and WebKit | ||
| 157 | ed.onPaste.addToTop(function(ed, e) { | ||
| 158 | return grabContent(e); | ||
| 159 | }); | ||
| 160 | } | ||
| 161 | } | ||
| 162 | |||
| 163 | // Block all drag/drop events | ||
| 164 | if (ed.getParam('paste_block_drop')) { | ||
| 165 | ed.onInit.add(function() { | ||
| 166 | ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { | ||
| 167 | e.preventDefault(); | ||
| 168 | e.stopPropagation(); | ||
| 169 | |||
| 170 | return false; | ||
| 171 | }); | ||
| 172 | }); | ||
| 173 | } | ||
| 174 | |||
| 175 | // Add legacy support | ||
| 176 | t._legacySupport(); | ||
| 177 | }, | ||
| 178 | |||
| 179 | getInfo : function() { | ||
| 180 | return { | ||
| 181 | longname : 'Paste text/word', | ||
| 182 | author : 'Moxiecode Systems AB', | ||
| 183 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 184 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', | ||
| 185 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 186 | }; | ||
| 187 | }, | ||
| 188 | |||
| 189 | _preProcess : function(pl, o) { | ||
| 190 | var ed = this.editor, h = o.content, process, stripClass; | ||
| 191 | |||
| 192 | //console.log('Before preprocess:' + o.content); | ||
| 193 | |||
| 194 | function process(items) { | ||
| 195 | each(items, function(v) { | ||
| 196 | // Remove or replace | ||
| 197 | if (v.constructor == RegExp) | ||
| 198 | h = h.replace(v, ''); | ||
| 199 | else | ||
| 200 | h = h.replace(v[0], v[1]); | ||
| 201 | }); | ||
| 202 | }; | ||
| 203 | |||
| 204 | // Detect Word content and process it more aggressive | ||
| 205 | if (/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(h) || o.wordContent) { | ||
| 206 | o.wordContent = true; // Mark the pasted contents as word specific content | ||
| 207 | //console.log('Word contents detected.'); | ||
| 208 | |||
| 209 | // Process away some basic content | ||
| 210 | process([ | ||
| 211 | /^\s*( )+/g, // nbsp entities at the start of contents | ||
| 212 | /( |<br[^>]*>)+\s*$/g // nbsp entities at the end of contents | ||
| 213 | ]); | ||
| 214 | |||
| 215 | if (ed.getParam('paste_convert_middot_lists', true)) { | ||
| 216 | process([ | ||
| 217 | [/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker | ||
| 218 | [/(<span[^>]+:\s*symbol[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert symbol spans to list items | ||
| 219 | [/(<span[^>]+mso-list:[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list to item marker | ||
| 220 | ]); | ||
| 221 | } | ||
| 222 | |||
| 223 | process([ | ||
| 224 | /<!--[\s\S]+?-->/gi, // Word comments | ||
| 225 | /<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi, // Remove some tags including VML content | ||
| 226 | /<\\?\?xml[^>]*>/gi, // XML namespace declarations | ||
| 227 | /<\/?o:[^>]*>/gi, // MS namespaced elements <o:tag> | ||
| 228 | / (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi, // on.., class, style and language attributes with quotes | ||
| 229 | / (id|name|language|type|on\w+|v:\w+)=(\w+)/gi, // on.., class, style and language attributes without quotes (IE) | ||
| 230 | [/<(\/?)s>/gi, '<$1strike>'], // Convert <s> into <strike> for line-though | ||
| 231 | /<script[^>]+>[\s\S]*?<\/script>/gi, // All scripts elements for msoShowComment for example | ||
| 232 | [/ /g, '\u00a0'] // Replace nsbp entites to char since it's easier to handle | ||
| 233 | ]); | ||
| 234 | |||
| 235 | // Remove all spans if no styles is to be retained | ||
| 236 | if (!ed.getParam('paste_retain_style_properties')) { | ||
| 237 | process([ | ||
| 238 | /<\/?(span)[^>]*>/gi | ||
| 239 | ]); | ||
| 240 | } | ||
| 241 | } | ||
| 242 | |||
| 243 | // Allow for class names to be retained if desired; either all, or just the ones from Word | ||
| 244 | // Note that the paste_strip_class_attributes: 'none, verify_css_classes: true is also a good variation. | ||
| 245 | stripClass = ed.getParam('paste_strip_class_attributes'); | ||
| 246 | if (stripClass != 'none') { | ||
| 247 | // Cleans everything but mceItem... classes | ||
| 248 | function cleanClasses(str, cls) { | ||
| 249 | var i, out = ''; | ||
| 250 | |||
| 251 | // Remove all classes | ||
| 252 | if (stripClass == 'all') | ||
| 253 | return ''; | ||
| 254 | |||
| 255 | cls = tinymce.explode(cls, ' '); | ||
| 256 | |||
| 257 | for (i = cls.length - 1; i >= 0; i--) { | ||
| 258 | // Remove Mso classes | ||
| 259 | if (!/^(Mso)/i.test(cls[i])) | ||
| 260 | out += (!out ? '' : ' ') + cls[i]; | ||
| 261 | } | ||
| 262 | |||
| 263 | return ' class="' + out + '"'; | ||
| 264 | }; | ||
| 265 | |||
| 266 | process([ | ||
| 267 | [/ class=\"([^\"]*)\"/gi, cleanClasses], // class attributes with quotes | ||
| 268 | [/ class=(\w+)/gi, cleanClasses] // class attributes without quotes (IE) | ||
| 269 | ]); | ||
| 270 | } | ||
| 271 | |||
| 272 | // Remove spans option | ||
| 273 | if (ed.getParam('paste_remove_spans')) { | ||
| 274 | process([ | ||
| 275 | /<\/?(span)[^>]*>/gi | ||
| 276 | ]); | ||
| 277 | } | ||
| 278 | |||
| 279 | //console.log('After preprocess:' + h); | ||
| 280 | |||
| 281 | o.content = h; | ||
| 282 | }, | ||
| 283 | |||
| 284 | /** | ||
| 285 | * Various post process items. | ||
| 286 | */ | ||
| 287 | _postProcess : function(pl, o) { | ||
| 288 | var t = this, ed = t.editor, dom = ed.dom, styleProps; | ||
| 289 | |||
| 290 | if (o.wordContent) { | ||
| 291 | // Remove named anchors or TOC links | ||
| 292 | each(dom.select('a', o.node), function(a) { | ||
| 293 | if (!a.href || a.href.indexOf('#_Toc') != -1) | ||
| 294 | dom.remove(a, 1); | ||
| 295 | }); | ||
| 296 | |||
| 297 | if (t.editor.getParam('paste_convert_middot_lists', true)) | ||
| 298 | t._convertLists(pl, o); | ||
| 299 | |||
| 300 | // Process styles | ||
| 301 | styleProps = ed.getParam('paste_retain_style_properties'); // retained properties | ||
| 302 | |||
| 303 | // If string property then split it | ||
| 304 | if (tinymce.is(styleProps, 'string')) | ||
| 305 | styleProps = tinymce.explode(styleProps); | ||
| 306 | |||
| 307 | // Retains some style properties | ||
| 308 | each(dom.select('*', o.node), function(el) { | ||
| 309 | var newStyle = {}, npc = 0, i, sp, sv; | ||
| 310 | |||
| 311 | // Store a subset of the existing styles | ||
| 312 | if (styleProps) { | ||
| 313 | for (i = 0; i < styleProps.length; i++) { | ||
| 314 | sp = styleProps[i]; | ||
| 315 | sv = dom.getStyle(el, sp); | ||
| 316 | |||
| 317 | if (sv) { | ||
| 318 | newStyle[sp] = sv; | ||
| 319 | npc++; | ||
| 320 | } | ||
| 321 | } | ||
| 322 | } | ||
| 323 | |||
| 324 | // Remove all of the existing styles | ||
| 325 | dom.setAttrib(el, 'style', ''); | ||
| 326 | |||
| 327 | if (styleProps && npc > 0) | ||
| 328 | dom.setStyles(el, newStyle); // Add back the stored subset of styles | ||
| 329 | else // Remove empty span tags that do not have class attributes | ||
| 330 | if (el.nodeName == 'SPAN' && !el.className) | ||
| 331 | dom.remove(el, true); | ||
| 332 | }); | ||
| 333 | } | ||
| 334 | |||
| 335 | // Remove all style information or only specifically on WebKit to avoid the style bug on that browser | ||
| 336 | if (ed.getParam("paste_remove_styles") || (ed.getParam("paste_remove_styles_if_webkit") && tinymce.isWebKit)) { | ||
| 337 | each(dom.select('*[style]', o.node), function(el) { | ||
| 338 | el.removeAttribute('style'); | ||
| 339 | el.removeAttribute('mce_style'); | ||
| 340 | }); | ||
| 341 | } else { | ||
| 342 | if (tinymce.isWebKit) { | ||
| 343 | // We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." /> | ||
| 344 | // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles | ||
| 345 | each(dom.select('*', o.node), function(el) { | ||
| 346 | el.removeAttribute('mce_style'); | ||
| 347 | }); | ||
| 348 | } | ||
| 349 | } | ||
| 350 | }, | ||
| 351 | |||
| 352 | /** | ||
| 353 | * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. | ||
| 354 | */ | ||
| 355 | _convertLists : function(pl, o) { | ||
| 356 | var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; | ||
| 357 | |||
| 358 | // Convert middot lists into real semantic lists | ||
| 359 | each(dom.select('p', o.node), function(p) { | ||
| 360 | var sib, val = '', type, html, idx, parents; | ||
| 361 | |||
| 362 | // Get text node value at beginning of paragraph | ||
| 363 | for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) | ||
| 364 | val += sib.nodeValue; | ||
| 365 | |||
| 366 | val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); | ||
| 367 | |||
| 368 | // Detect unordered lists look for bullets | ||
| 369 | if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(val)) | ||
| 370 | type = 'ul'; | ||
| 371 | |||
| 372 | // Detect ordered lists 1., a. or ixv. | ||
| 373 | if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(val)) | ||
| 374 | type = 'ol'; | ||
| 375 | |||
| 376 | // Check if node value matches the list pattern: o | ||
| 377 | if (type) { | ||
| 378 | margin = parseFloat(p.style.marginLeft || 0); | ||
| 379 | |||
| 380 | if (margin > lastMargin) | ||
| 381 | levels.push(margin); | ||
| 382 | |||
| 383 | if (!listElm || type != lastType) { | ||
| 384 | listElm = dom.create(type); | ||
| 385 | dom.insertAfter(listElm, p); | ||
| 386 | } else { | ||
| 387 | // Nested list element | ||
| 388 | if (margin > lastMargin) { | ||
| 389 | listElm = li.appendChild(dom.create(type)); | ||
| 390 | } else if (margin < lastMargin) { | ||
| 391 | // Find parent level based on margin value | ||
| 392 | idx = tinymce.inArray(levels, margin); | ||
| 393 | parents = dom.getParents(listElm.parentNode, type); | ||
| 394 | listElm = parents[parents.length - 1 - idx] || listElm; | ||
| 395 | } | ||
| 396 | } | ||
| 397 | |||
| 398 | // Remove middot or number spans if they exists | ||
| 399 | each(dom.select('span', p), function(span) { | ||
| 400 | var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); | ||
| 401 | |||
| 402 | // Remove span with the middot or the number | ||
| 403 | if (type == 'ul' && /^[\u2022\u00b7\u00a7\u00d8o]/.test(html)) | ||
| 404 | dom.remove(span); | ||
| 405 | else if (/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) | ||
| 406 | dom.remove(span); | ||
| 407 | }); | ||
| 408 | |||
| 409 | html = p.innerHTML; | ||
| 410 | |||
| 411 | // Remove middot/list items | ||
| 412 | if (type == 'ul') | ||
| 413 | html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/, ''); | ||
| 414 | else | ||
| 415 | html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); | ||
| 416 | |||
| 417 | // Create li and add paragraph data into the new li | ||
| 418 | li = listElm.appendChild(dom.create('li', 0, html)); | ||
| 419 | dom.remove(p); | ||
| 420 | |||
| 421 | lastMargin = margin; | ||
| 422 | lastType = type; | ||
| 423 | } else | ||
| 424 | listElm = lastMargin = 0; // End list element | ||
| 425 | }); | ||
| 426 | |||
| 427 | // Remove any left over makers | ||
| 428 | html = o.node.innerHTML; | ||
| 429 | if (html.indexOf('__MCE_ITEM__') != -1) | ||
| 430 | o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); | ||
| 431 | }, | ||
| 432 | |||
| 433 | /** | ||
| 434 | * This method will split the current block parent and insert the contents inside the split position. | ||
| 435 | * This logic can be improved so text nodes at the start/end remain in the start/end block elements | ||
| 436 | */ | ||
| 437 | _insertBlockContent : function(ed, dom, content) { | ||
| 438 | var parentBlock, marker, sel = ed.selection, last, elm, vp, y, elmHeight; | ||
| 439 | |||
| 440 | function select(n) { | ||
| 441 | var r; | ||
| 442 | |||
| 443 | if (tinymce.isIE) { | ||
| 444 | r = ed.getDoc().body.createTextRange(); | ||
| 445 | r.moveToElementText(n); | ||
| 446 | r.collapse(false); | ||
| 447 | r.select(); | ||
| 448 | } else { | ||
| 449 | sel.select(n, 1); | ||
| 450 | sel.collapse(false); | ||
| 451 | } | ||
| 452 | }; | ||
| 453 | |||
| 454 | // Insert a marker for the caret position | ||
| 455 | this._insert('<span id="_marker"> </span>', 1); | ||
| 456 | marker = dom.get('_marker'); | ||
| 457 | parentBlock = dom.getParent(marker, 'p,h1,h2,h3,h4,h5,h6,ul,ol,th,td'); | ||
| 458 | |||
| 459 | // If it's a parent block but not a table cell | ||
| 460 | if (parentBlock && !/TD|TH/.test(parentBlock.nodeName)) { | ||
| 461 | // Split parent block | ||
| 462 | marker = dom.split(parentBlock, marker); | ||
| 463 | |||
| 464 | // Insert nodes before the marker | ||
| 465 | each(dom.create('div', 0, content).childNodes, function(n) { | ||
| 466 | last = marker.parentNode.insertBefore(n.cloneNode(true), marker); | ||
| 467 | }); | ||
| 468 | |||
| 469 | // Move caret after marker | ||
| 470 | select(last); | ||
| 471 | } else { | ||
| 472 | dom.setOuterHTML(marker, content); | ||
| 473 | sel.select(ed.getBody(), 1); | ||
| 474 | sel.collapse(0); | ||
| 475 | } | ||
| 476 | |||
| 477 | dom.remove('_marker'); // Remove marker if it's left | ||
| 478 | |||
| 479 | // Get element, position and height | ||
| 480 | elm = sel.getStart(); | ||
| 481 | vp = dom.getViewPort(ed.getWin()); | ||
| 482 | y = ed.dom.getPos(elm).y; | ||
| 483 | elmHeight = elm.clientHeight; | ||
| 484 | |||
| 485 | // Is element within viewport if not then scroll it into view | ||
| 486 | if (y < vp.y || y + elmHeight > vp.y + vp.h) | ||
| 487 | ed.getDoc().body.scrollTop = y < vp.y ? y : y - vp.h + 25; | ||
| 488 | }, | ||
| 489 | |||
| 490 | /** | ||
| 491 | * Inserts the specified contents at the caret position. | ||
| 492 | */ | ||
| 493 | _insert : function(h, skip_undo) { | ||
| 494 | var ed = this.editor; | ||
| 495 | |||
| 496 | // First delete the contents seems to work better on WebKit | ||
| 497 | if (!ed.selection.isCollapsed()) | ||
| 498 | ed.getDoc().execCommand('Delete', false, null); | ||
| 499 | |||
| 500 | // It's better to use the insertHTML method on Gecko since it will combine paragraphs correctly before inserting the contents | ||
| 501 | ed.execCommand(tinymce.isGecko ? 'insertHTML' : 'mceInsertContent', false, h, {skip_undo : skip_undo}); | ||
| 502 | }, | ||
| 503 | |||
| 504 | /** | ||
| 505 | * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. | ||
| 506 | */ | ||
| 507 | _legacySupport : function() { | ||
| 508 | var t = this, ed = t.editor; | ||
| 509 | |||
| 510 | // Register commands for backwards compatibility | ||
| 511 | each(['mcePasteText', 'mcePasteWord'], function(cmd) { | ||
| 512 | ed.addCommand(cmd, function() { | ||
| 513 | ed.windowManager.open({ | ||
| 514 | file : t.url + (cmd == 'mcePasteText' ? '/pastetext.htm' : '/pasteword.htm'), | ||
| 515 | width : parseInt(ed.getParam("paste_dialog_width", "450")), | ||
| 516 | height : parseInt(ed.getParam("paste_dialog_height", "400")), | ||
| 517 | inline : 1 | ||
| 518 | }); | ||
| 519 | }); | ||
| 520 | }); | ||
| 521 | |||
| 522 | // Register buttons for backwards compatibility | ||
| 523 | ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText'}); | ||
| 524 | ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord'}); | ||
| 525 | ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'selectall'}); | ||
| 526 | } | ||
| 527 | }); | ||
| 528 | |||
| 529 | // Register plugin | ||
| 530 | tinymce.PluginManager.add('paste', tinymce.plugins.PastePlugin); | ||
| 531 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js b/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js deleted file mode 100644 index c524f9e..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var PasteTextDialog = { | ||
| 4 | init : function() { | ||
| 5 | this.resize(); | ||
| 6 | }, | ||
| 7 | |||
| 8 | insert : function() { | ||
| 9 | var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; | ||
| 10 | |||
| 11 | // Convert linebreaks into paragraphs | ||
| 12 | if (document.getElementById('linebreaks').checked) { | ||
| 13 | lines = h.split(/\r?\n/); | ||
| 14 | if (lines.length > 1) { | ||
| 15 | h = ''; | ||
| 16 | tinymce.each(lines, function(row) { | ||
| 17 | h += '<p>' + row + '</p>'; | ||
| 18 | }); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); | ||
| 23 | tinyMCEPopup.close(); | ||
| 24 | }, | ||
| 25 | |||
| 26 | resize : function() { | ||
| 27 | var vp = tinyMCEPopup.dom.getViewPort(window), el; | ||
| 28 | |||
| 29 | el = document.getElementById('content'); | ||
| 30 | |||
| 31 | el.style.width = (vp.w - 20) + 'px'; | ||
| 32 | el.style.height = (vp.h - 90) + 'px'; | ||
| 33 | } | ||
| 34 | }; | ||
| 35 | |||
| 36 | tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js b/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js deleted file mode 100644 index a52731c..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var PasteWordDialog = { | ||
| 4 | init : function() { | ||
| 5 | var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; | ||
| 6 | |||
| 7 | // Create iframe | ||
| 8 | el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>'; | ||
| 9 | ifr = document.getElementById('iframe'); | ||
| 10 | doc = ifr.contentWindow.document; | ||
| 11 | |||
| 12 | // Force absolute CSS urls | ||
| 13 | css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; | ||
| 14 | css = css.concat(tinymce.explode(ed.settings.content_css) || []); | ||
| 15 | tinymce.each(css, function(u) { | ||
| 16 | cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />'; | ||
| 17 | }); | ||
| 18 | |||
| 19 | // Write content into iframe | ||
| 20 | doc.open(); | ||
| 21 | doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>'); | ||
| 22 | doc.close(); | ||
| 23 | |||
| 24 | doc.designMode = 'on'; | ||
| 25 | this.resize(); | ||
| 26 | |||
| 27 | window.setTimeout(function() { | ||
| 28 | ifr.contentWindow.focus(); | ||
| 29 | }, 10); | ||
| 30 | }, | ||
| 31 | |||
| 32 | insert : function() { | ||
| 33 | var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; | ||
| 34 | |||
| 35 | tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); | ||
| 36 | tinyMCEPopup.close(); | ||
| 37 | }, | ||
| 38 | |||
| 39 | resize : function() { | ||
| 40 | var vp = tinyMCEPopup.dom.getViewPort(window), el; | ||
| 41 | |||
| 42 | el = document.getElementById('iframe'); | ||
| 43 | |||
| 44 | if (el) { | ||
| 45 | el.style.width = (vp.w - 20) + 'px'; | ||
| 46 | el.style.height = (vp.h - 90) + 'px'; | ||
| 47 | } | ||
| 48 | } | ||
| 49 | }; | ||
| 50 | |||
| 51 | tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js deleted file mode 100644 index eeac778..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.paste_dlg',{ | ||
| 2 | text_title:"Use CTRL+V on your keyboard to paste the text into the window.", | ||
| 3 | text_linebreaks:"Keep linebreaks", | ||
| 4 | word_title:"Use CTRL+V on your keyboard to paste the text into the window." | ||
| 5 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/pastetext.htm b/public/javascripts/tiny_mce/plugins/paste/pastetext.htm deleted file mode 100644 index 42c3d9c..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/pastetext.htm +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>{#paste.paste_text_desc}</title> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/pastetext.js"></script> | ||
| 7 | </head> | ||
| 8 | <body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;"> | ||
| 9 | <form name="source" onsubmit="return PasteTextDialog.insert();" action="#"> | ||
| 10 | <div style="float: left" class="title">{#paste.paste_text_desc}</div> | ||
| 11 | |||
| 12 | <div style="float: right"> | ||
| 13 | <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label> | ||
| 14 | </div> | ||
| 15 | |||
| 16 | <br style="clear: both" /> | ||
| 17 | |||
| 18 | <div>{#paste_dlg.text_title}</div> | ||
| 19 | |||
| 20 | <textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea> | ||
| 21 | |||
| 22 | <div class="mceActionPanel"> | ||
| 23 | <div style="float: left"> | ||
| 24 | <input type="submit" name="insert" value="{#insert}" id="insert" /> | ||
| 25 | </div> | ||
| 26 | |||
| 27 | <div style="float: right"> | ||
| 28 | <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" /> | ||
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | </form> | ||
| 32 | </body> | ||
| 33 | </html> \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/paste/pasteword.htm b/public/javascripts/tiny_mce/plugins/paste/pasteword.htm deleted file mode 100644 index f4a9b3d..0000000 --- a/public/javascripts/tiny_mce/plugins/paste/pasteword.htm +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 4 | <title>{#paste.paste_word_desc}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/pasteword.js"></script> | ||
| 7 | </head> | ||
| 8 | <body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;"> | ||
| 9 | <form name="source" onsubmit="return PasteWordDialog.insert();" action="#"> | ||
| 10 | <div class="title">{#paste.paste_word_desc}</div> | ||
| 11 | |||
| 12 | <div>{#paste_dlg.word_title}</div> | ||
| 13 | |||
| 14 | <div id="iframecontainer"></div> | ||
| 15 | |||
| 16 | <div class="mceActionPanel"> | ||
| 17 | <div style="float: left"> | ||
| 18 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div style="float: right"> | ||
| 22 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 23 | </div> | ||
| 24 | </div> | ||
| 25 | </form> | ||
| 26 | </body> | ||
| 27 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js deleted file mode 100644 index 507909c..0000000 --- a/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js deleted file mode 100644 index 0582ab8..0000000 --- a/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1056 2009-03-13 12:47:03Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Preview', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this, css = tinymce.explode(ed.settings.content_css); | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Force absolute CSS urls | ||
| 16 | tinymce.each(css, function(u, k) { | ||
| 17 | css[k] = ed.documentBaseURI.toAbsolute(u); | ||
| 18 | }); | ||
| 19 | |||
| 20 | ed.addCommand('mcePreview', function() { | ||
| 21 | ed.windowManager.open({ | ||
| 22 | file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), | ||
| 23 | width : parseInt(ed.getParam("plugin_preview_width", "550")), | ||
| 24 | height : parseInt(ed.getParam("plugin_preview_height", "600")), | ||
| 25 | resizable : "yes", | ||
| 26 | scrollbars : "yes", | ||
| 27 | popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), | ||
| 28 | inline : ed.getParam("plugin_preview_inline", 1) | ||
| 29 | }, { | ||
| 30 | base : ed.documentBaseURI.getURI() | ||
| 31 | }); | ||
| 32 | }); | ||
| 33 | |||
| 34 | ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); | ||
| 35 | }, | ||
| 36 | |||
| 37 | getInfo : function() { | ||
| 38 | return { | ||
| 39 | longname : 'Preview', | ||
| 40 | author : 'Moxiecode Systems AB', | ||
| 41 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', | ||
| 43 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 44 | }; | ||
| 45 | } | ||
| 46 | }); | ||
| 47 | |||
| 48 | // Register plugin | ||
| 49 | tinymce.PluginManager.add('preview', tinymce.plugins.Preview); | ||
| 50 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/example.html b/public/javascripts/tiny_mce/plugins/preview/example.html deleted file mode 100644 index b2c3d90..0000000 --- a/public/javascripts/tiny_mce/plugins/preview/example.html +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <script language="javascript" src="../../tiny_mce_popup.js"></script> | ||
| 4 | <script type="text/javascript" src="jscripts/embed.js"></script> | ||
| 5 | <script type="text/javascript"> | ||
| 6 | tinyMCEPopup.onInit.add(function(ed) { | ||
| 7 | var dom = tinyMCEPopup.dom; | ||
| 8 | |||
| 9 | // Load editor content_css | ||
| 10 | tinymce.each(ed.settings.content_css.split(','), function(u) { | ||
| 11 | dom.loadCSS(ed.documentBaseURI.toAbsolute(u)); | ||
| 12 | }); | ||
| 13 | |||
| 14 | // Place contents inside div container | ||
| 15 | dom.setHTML('content', ed.getContent()); | ||
| 16 | }); | ||
| 17 | </script> | ||
| 18 | <title>Example of a custom preview page</title> | ||
| 19 | </head> | ||
| 20 | <body> | ||
| 21 | |||
| 22 | Editor contents: <br /> | ||
| 23 | <div id="content"> | ||
| 24 | <!-- Gets filled with editor contents --> | ||
| 25 | </div> | ||
| 26 | |||
| 27 | </body> | ||
| 28 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js b/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js deleted file mode 100644 index f8dc810..0000000 --- a/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. | ||
| 3 | */ | ||
| 4 | |||
| 5 | function writeFlash(p) { | ||
| 6 | writeEmbed( | ||
| 7 | 'D27CDB6E-AE6D-11cf-96B8-444553540000', | ||
| 8 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 9 | 'application/x-shockwave-flash', | ||
| 10 | p | ||
| 11 | ); | ||
| 12 | } | ||
| 13 | |||
| 14 | function writeShockWave(p) { | ||
| 15 | writeEmbed( | ||
| 16 | '166B1BCA-3F9C-11CF-8075-444553540000', | ||
| 17 | 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', | ||
| 18 | 'application/x-director', | ||
| 19 | p | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | function writeQuickTime(p) { | ||
| 24 | writeEmbed( | ||
| 25 | '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', | ||
| 26 | 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', | ||
| 27 | 'video/quicktime', | ||
| 28 | p | ||
| 29 | ); | ||
| 30 | } | ||
| 31 | |||
| 32 | function writeRealMedia(p) { | ||
| 33 | writeEmbed( | ||
| 34 | 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', | ||
| 35 | 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', | ||
| 36 | 'audio/x-pn-realaudio-plugin', | ||
| 37 | p | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | |||
| 41 | function writeWindowsMedia(p) { | ||
| 42 | p.url = p.src; | ||
| 43 | writeEmbed( | ||
| 44 | '6BF52A52-394A-11D3-B153-00C04F79FAA6', | ||
| 45 | 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', | ||
| 46 | 'application/x-mplayer2', | ||
| 47 | p | ||
| 48 | ); | ||
| 49 | } | ||
| 50 | |||
| 51 | function writeEmbed(cls, cb, mt, p) { | ||
| 52 | var h = '', n; | ||
| 53 | |||
| 54 | h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"'; | ||
| 55 | h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : ''; | ||
| 56 | h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : ''; | ||
| 57 | h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : ''; | ||
| 58 | h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : ''; | ||
| 59 | h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : ''; | ||
| 60 | h += '>'; | ||
| 61 | |||
| 62 | for (n in p) | ||
| 63 | h += '<param name="' + n + '" value="' + p[n] + '">'; | ||
| 64 | |||
| 65 | h += '<embed type="' + mt + '"'; | ||
| 66 | |||
| 67 | for (n in p) | ||
| 68 | h += n + '="' + p[n] + '" '; | ||
| 69 | |||
| 70 | h += '></embed></object>'; | ||
| 71 | |||
| 72 | document.write(h); | ||
| 73 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/preview/preview.html b/public/javascripts/tiny_mce/plugins/preview/preview.html deleted file mode 100644 index 67e7b14..0000000 --- a/public/javascripts/tiny_mce/plugins/preview/preview.html +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 5 | <script type="text/javascript" src="jscripts/embed.js"></script> | ||
| 6 | <script type="text/javascript"><!-- | ||
| 7 | document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">'); | ||
| 8 | // --> | ||
| 9 | </script> | ||
| 10 | <title>{#preview.preview_desc}</title> | ||
| 11 | </head> | ||
| 12 | <body id="content"> | ||
| 13 | <script type="text/javascript"> | ||
| 14 | document.write(tinyMCEPopup.editor.getContent()); | ||
| 15 | </script> | ||
| 16 | </body> | ||
| 17 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin.js deleted file mode 100644 index b5b3a55..0000000 --- a/public/javascripts/tiny_mce/plugins/print/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js deleted file mode 100644 index 51fe156..0000000 --- a/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Print', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | ed.addCommand('mcePrint', function() { | ||
| 12 | ed.getWin().print(); | ||
| 13 | }); | ||
| 14 | |||
| 15 | ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); | ||
| 16 | }, | ||
| 17 | |||
| 18 | getInfo : function() { | ||
| 19 | return { | ||
| 20 | longname : 'Print', | ||
| 21 | author : 'Moxiecode Systems AB', | ||
| 22 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 23 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', | ||
| 24 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | }); | ||
| 28 | |||
| 29 | // Register plugin | ||
| 30 | tinymce.PluginManager.add('print', tinymce.plugins.Print); | ||
| 31 | })(); | ||
diff --git a/public/javascripts/tiny_mce/plugins/safari/blank.htm b/public/javascripts/tiny_mce/plugins/safari/blank.htm deleted file mode 100644 index 266808c..0000000 --- a/public/javascripts/tiny_mce/plugins/safari/blank.htm +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | <!-- WebKit --> \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js deleted file mode 100644 index 794477c..0000000 --- a/public/javascripts/tiny_mce/plugins/safari/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.dom.Event,c=tinymce.grep,d=tinymce.each,b=tinymce.inArray;function e(j,i,h){var g,k;g=j.createTreeWalker(i,NodeFilter.SHOW_ALL,null,false);while(k=g.nextNode()){if(h){if(!h(k)){return false}}if(k.nodeType==3&&k.nodeValue&&/[^\s\u00a0]+/.test(k.nodeValue)){return false}if(k.nodeType==1&&/^(HR|IMG|TABLE)$/.test(k.nodeName)){return false}}return true}tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];f.addCommand("CreateLink",function(k,j){var m=f.selection.getNode(),l=f.dom,i;if(m&&(/^(left|right)$/i.test(l.getStyle(m,"float",1))||/^(left|right)$/i.test(l.getAttrib(m,"align")))){i=l.create("a",{href:j},m.cloneNode());m.parentNode.replaceChild(i,m);f.selection.select(i)}else{f.getDoc().execCommand("CreateLink",false,j)}});f.onKeyUp.add(function(j,o){var l,i,m,p,k;if(o.keyCode==46||o.keyCode==8){i=j.getBody();l=i.innerHTML;k=j.selection;if(i.childNodes.length==1&&!/<(img|hr)/.test(l)&&tinymce.trim(l.replace(/<[^>]+>/g,"")).length==0){j.setContent('<p><br mce_bogus="1" /></p>',{format:"raw"});p=i.firstChild;m=k.getRng();m.setStart(p,0);m.setEnd(p,0);k.setRng(m)}}});f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.addCommand("mceInsertContent",function(j,i){f.getDoc().execCommand("InsertText",false,"mce_marker");f.getBody().innerHTML=f.getBody().innerHTML.replace(/mce_marker/g,f.dom.processHTML(i)+'<span id="_mce_tmp">XX</span>');f.selection.select(f.dom.get("_mce_tmp"));f.getDoc().execCommand("Delete",false," ")});f.onKeyPress.add(function(o,p){var q,v,r,l,j,k,i,u,m,t,s;if(p.keyCode==13){i=o.selection;q=i.getNode();if(p.shiftKey||o.settings.force_br_newlines&&q.nodeName!="LI"){g._insertBR(o);a.cancel(p)}if(v=h.getParent(q,"LI")){r=h.getParent(v,"OL,UL");u=o.getDoc();s=h.create("p");h.add(s,"br",{mce_bogus:"1"});if(e(u,v)){if(k=h.getParent(r.parentNode,"LI,OL,UL")){return}k=h.getParent(r,"p,h1,h2,h3,h4,h5,h6,div")||r;l=u.createRange();l.setStartBefore(k);l.setEndBefore(v);j=u.createRange();j.setStartAfter(v);j.setEndAfter(k);m=l.cloneContents();t=j.cloneContents();if(!e(u,t)){h.insertAfter(t,k)}h.insertAfter(s,k);if(!e(u,m)){h.insertAfter(m,k)}h.remove(k);k=s.firstChild;l=u.createRange();l.setStartBefore(k);l.setEndBefore(k);i.setRng(l);return a.cancel(p)}}}});f.onExecCommand.add(function(i,k){var j,m,n,l;if(k=="InsertUnorderedList"||k=="InsertOrderedList"){j=i.selection;m=i.dom;if(n=m.getParent(j.getNode(),function(o){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)})){l=j.getBookmark();m.remove(n,1);j.moveToBookmark(l)}}});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onInit.add(function(){g._fixWebKitSpans()});f.onSetContent.add(function(){h=f.dom;d(["strong","b","em","u","strike","sub","sup","a"],function(i){d(c(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;d(c(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");j.content=j.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var g=this,f=g.editor;a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",b(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[b(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js deleted file mode 100644 index 6667b7c..0000000 --- a/public/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,438 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray; | ||
| 10 | |||
| 11 | function isEmpty(d, e, f) { | ||
| 12 | var w, n; | ||
| 13 | |||
| 14 | w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false); | ||
| 15 | while (n = w.nextNode()) { | ||
| 16 | // Filter func | ||
| 17 | if (f) { | ||
| 18 | if (!f(n)) | ||
| 19 | return false; | ||
| 20 | } | ||
| 21 | |||
| 22 | // Non whitespace text node | ||
| 23 | if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue)) | ||
| 24 | return false; | ||
| 25 | |||
| 26 | // Is non text element byt still content | ||
| 27 | if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName)) | ||
| 28 | return false; | ||
| 29 | } | ||
| 30 | |||
| 31 | return true; | ||
| 32 | }; | ||
| 33 | |||
| 34 | tinymce.create('tinymce.plugins.Safari', { | ||
| 35 | init : function(ed) { | ||
| 36 | var t = this, dom; | ||
| 37 | |||
| 38 | // Ignore on non webkit | ||
| 39 | if (!tinymce.isWebKit) | ||
| 40 | return; | ||
| 41 | |||
| 42 | t.editor = ed; | ||
| 43 | t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; | ||
| 44 | t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; | ||
| 45 | |||
| 46 | // Safari CreateLink command will not work correctly on images that is aligned | ||
| 47 | ed.addCommand('CreateLink', function(u, v) { | ||
| 48 | var n = ed.selection.getNode(), dom = ed.dom, a; | ||
| 49 | |||
| 50 | if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) { | ||
| 51 | a = dom.create('a', {href : v}, n.cloneNode()); | ||
| 52 | n.parentNode.replaceChild(a, n); | ||
| 53 | ed.selection.select(a); | ||
| 54 | } else | ||
| 55 | ed.getDoc().execCommand("CreateLink", false, v); | ||
| 56 | }); | ||
| 57 | |||
| 58 | /* | ||
| 59 | // WebKit generates spans out of thin air this patch used to remove them but it will also remove styles we want so it's disabled for now | ||
| 60 | ed.onPaste.add(function(ed, e) { | ||
| 61 | function removeStyles(e) { | ||
| 62 | e = e.target; | ||
| 63 | |||
| 64 | if (e.nodeType == 1) { | ||
| 65 | e.style.cssText = ''; | ||
| 66 | |||
| 67 | each(ed.dom.select('*', e), function(e) { | ||
| 68 | e.style.cssText = ''; | ||
| 69 | }); | ||
| 70 | } | ||
| 71 | }; | ||
| 72 | |||
| 73 | Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles); | ||
| 74 | |||
| 75 | window.setTimeout(function() { | ||
| 76 | Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles); | ||
| 77 | }, 0); | ||
| 78 | }); | ||
| 79 | */ | ||
| 80 | ed.onKeyUp.add(function(ed, e) { | ||
| 81 | var h, b, r, n, s; | ||
| 82 | |||
| 83 | // If backspace or delete key | ||
| 84 | if (e.keyCode == 46 || e.keyCode == 8) { | ||
| 85 | b = ed.getBody(); | ||
| 86 | h = b.innerHTML; | ||
| 87 | s = ed.selection; | ||
| 88 | |||
| 89 | // If there is no text content or images or hr elements then remove everything | ||
| 90 | if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) { | ||
| 91 | // Inject paragrah and bogus br | ||
| 92 | ed.setContent('<p><br mce_bogus="1" /></p>', {format : 'raw'}); | ||
| 93 | |||
| 94 | // Move caret before bogus br | ||
| 95 | n = b.firstChild; | ||
| 96 | r = s.getRng(); | ||
| 97 | r.setStart(n, 0); | ||
| 98 | r.setEnd(n, 0); | ||
| 99 | s.setRng(r); | ||
| 100 | } | ||
| 101 | } | ||
| 102 | }); | ||
| 103 | |||
| 104 | // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 | ||
| 105 | ed.addCommand('FormatBlock', function(u, v) { | ||
| 106 | var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); | ||
| 107 | |||
| 108 | if (e) | ||
| 109 | dom.replace(dom.create(v), e, 1); | ||
| 110 | else | ||
| 111 | ed.getDoc().execCommand("FormatBlock", false, v); | ||
| 112 | }); | ||
| 113 | |||
| 114 | // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 | ||
| 115 | ed.addCommand('mceInsertContent', function(u, v) { | ||
| 116 | ed.getDoc().execCommand("InsertText", false, 'mce_marker'); | ||
| 117 | ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + '<span id="_mce_tmp">XX</span>'); | ||
| 118 | ed.selection.select(ed.dom.get('_mce_tmp')); | ||
| 119 | ed.getDoc().execCommand("Delete", false, ' '); | ||
| 120 | }); | ||
| 121 | |||
| 122 | /* ed.onKeyDown.add(function(ed, e) { | ||
| 123 | // Ctrl+A select all will fail on WebKit since if you paste the contents you selected it will produce a odd div wrapper | ||
| 124 | if ((e.ctrlKey || e.metaKey) && e.keyCode == 65) { | ||
| 125 | ed.selection.select(ed.getBody(), 1); | ||
| 126 | return Event.cancel(e); | ||
| 127 | } | ||
| 128 | });*/ | ||
| 129 | |||
| 130 | ed.onKeyPress.add(function(ed, e) { | ||
| 131 | var se, li, lic, r1, r2, n, sel, doc, be, af, pa; | ||
| 132 | |||
| 133 | if (e.keyCode == 13) { | ||
| 134 | sel = ed.selection; | ||
| 135 | se = sel.getNode(); | ||
| 136 | |||
| 137 | // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 | ||
| 138 | if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') { | ||
| 139 | t._insertBR(ed); | ||
| 140 | Event.cancel(e); | ||
| 141 | } | ||
| 142 | |||
| 143 | // Workaround for DIV elements produced by Safari | ||
| 144 | if (li = dom.getParent(se, 'LI')) { | ||
| 145 | lic = dom.getParent(li, 'OL,UL'); | ||
| 146 | doc = ed.getDoc(); | ||
| 147 | |||
| 148 | pa = dom.create('p'); | ||
| 149 | dom.add(pa, 'br', {mce_bogus : "1"}); | ||
| 150 | |||
| 151 | if (isEmpty(doc, li)) { | ||
| 152 | // If list in list then use browser default behavior | ||
| 153 | if (n = dom.getParent(lic.parentNode, 'LI,OL,UL')) | ||
| 154 | return; | ||
| 155 | |||
| 156 | n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic; | ||
| 157 | |||
| 158 | // Create range from the start of block element to the list item | ||
| 159 | r1 = doc.createRange(); | ||
| 160 | r1.setStartBefore(n); | ||
| 161 | r1.setEndBefore(li); | ||
| 162 | |||
| 163 | // Create range after the list to the end of block element | ||
| 164 | r2 = doc.createRange(); | ||
| 165 | r2.setStartAfter(li); | ||
| 166 | r2.setEndAfter(n); | ||
| 167 | |||
| 168 | be = r1.cloneContents(); | ||
| 169 | af = r2.cloneContents(); | ||
| 170 | |||
| 171 | if (!isEmpty(doc, af)) | ||
| 172 | dom.insertAfter(af, n); | ||
| 173 | |||
| 174 | dom.insertAfter(pa, n); | ||
| 175 | |||
| 176 | if (!isEmpty(doc, be)) | ||
| 177 | dom.insertAfter(be, n); | ||
| 178 | |||
| 179 | dom.remove(n); | ||
| 180 | |||
| 181 | n = pa.firstChild; | ||
| 182 | r1 = doc.createRange(); | ||
| 183 | r1.setStartBefore(n); | ||
| 184 | r1.setEndBefore(n); | ||
| 185 | sel.setRng(r1); | ||
| 186 | |||
| 187 | return Event.cancel(e); | ||
| 188 | } | ||
| 189 | } | ||
| 190 | } | ||
| 191 | }); | ||
| 192 | |||
| 193 | // Safari doesn't place lists outside block elements | ||
| 194 | ed.onExecCommand.add(function(ed, cmd) { | ||
| 195 | var sel, dom, bl, bm; | ||
| 196 | |||
| 197 | if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') { | ||
| 198 | sel = ed.selection; | ||
| 199 | dom = ed.dom; | ||
| 200 | |||
| 201 | if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) { | ||
| 202 | bm = sel.getBookmark(); | ||
| 203 | dom.remove(bl, 1); | ||
| 204 | sel.moveToBookmark(bm); | ||
| 205 | } | ||
| 206 | } | ||
| 207 | }); | ||
| 208 | |||
| 209 | // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 | ||
| 210 | ed.onClick.add(function(ed, e) { | ||
| 211 | e = e.target; | ||
| 212 | |||
| 213 | if (e.nodeName == 'IMG') { | ||
| 214 | t.selElm = e; | ||
| 215 | ed.selection.select(e); | ||
| 216 | } else | ||
| 217 | t.selElm = null; | ||
| 218 | }); | ||
| 219 | |||
| 220 | ed.onInit.add(function() { | ||
| 221 | t._fixWebKitSpans(); | ||
| 222 | }); | ||
| 223 | |||
| 224 | ed.onSetContent.add(function() { | ||
| 225 | dom = ed.dom; | ||
| 226 | |||
| 227 | // Convert strong,b,em,u,strike to spans | ||
| 228 | each(['strong','b','em','u','strike','sub','sup','a'], function(v) { | ||
| 229 | each(grep(dom.select(v)).reverse(), function(n) { | ||
| 230 | var nn = n.nodeName.toLowerCase(), st; | ||
| 231 | |||
| 232 | // Convert anchors into images | ||
| 233 | if (nn == 'a') { | ||
| 234 | if (n.name) | ||
| 235 | dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); | ||
| 236 | |||
| 237 | return; | ||
| 238 | } | ||
| 239 | |||
| 240 | switch (nn) { | ||
| 241 | case 'b': | ||
| 242 | case 'strong': | ||
| 243 | if (nn == 'b') | ||
| 244 | nn = 'strong'; | ||
| 245 | |||
| 246 | st = 'font-weight: bold;'; | ||
| 247 | break; | ||
| 248 | |||
| 249 | case 'em': | ||
| 250 | st = 'font-style: italic;'; | ||
| 251 | break; | ||
| 252 | |||
| 253 | case 'u': | ||
| 254 | st = 'text-decoration: underline;'; | ||
| 255 | break; | ||
| 256 | |||
| 257 | case 'sub': | ||
| 258 | st = 'vertical-align: sub;'; | ||
| 259 | break; | ||
| 260 | |||
| 261 | case 'sup': | ||
| 262 | st = 'vertical-align: super;'; | ||
| 263 | break; | ||
| 264 | |||
| 265 | case 'strike': | ||
| 266 | st = 'text-decoration: line-through;'; | ||
| 267 | break; | ||
| 268 | } | ||
| 269 | |||
| 270 | dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); | ||
| 271 | }); | ||
| 272 | }); | ||
| 273 | }); | ||
| 274 | |||
| 275 | ed.onPreProcess.add(function(ed, o) { | ||
| 276 | dom = ed.dom; | ||
| 277 | |||
| 278 | each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { | ||
| 279 | var v, bg; | ||
| 280 | |||
| 281 | if (o.get) { | ||
| 282 | if (dom.hasClass(n, 'Apple-style-span')) { | ||
| 283 | bg = n.style.backgroundColor; | ||
| 284 | |||
| 285 | switch (dom.getAttrib(n, 'mce_name')) { | ||
| 286 | case 'font': | ||
| 287 | if (!ed.settings.convert_fonts_to_spans) | ||
| 288 | dom.setAttrib(n, 'style', ''); | ||
| 289 | break; | ||
| 290 | |||
| 291 | case 'strong': | ||
| 292 | case 'em': | ||
| 293 | case 'sub': | ||
| 294 | case 'sup': | ||
| 295 | dom.setAttrib(n, 'style', ''); | ||
| 296 | break; | ||
| 297 | |||
| 298 | case 'strike': | ||
| 299 | case 'u': | ||
| 300 | if (!ed.settings.inline_styles) | ||
| 301 | dom.setAttrib(n, 'style', ''); | ||
| 302 | else | ||
| 303 | dom.setAttrib(n, 'mce_name', ''); | ||
| 304 | |||
| 305 | break; | ||
| 306 | |||
| 307 | default: | ||
| 308 | if (!ed.settings.inline_styles) | ||
| 309 | dom.setAttrib(n, 'style', ''); | ||
| 310 | } | ||
| 311 | |||
| 312 | |||
| 313 | if (bg) | ||
| 314 | n.style.backgroundColor = bg; | ||
| 315 | } | ||
| 316 | } | ||
| 317 | |||
| 318 | if (dom.hasClass(n, 'mceItemRemoved')) | ||
| 319 | dom.remove(n, 1); | ||
| 320 | }); | ||
| 321 | }); | ||
| 322 | |||
| 323 | ed.onPostProcess.add(function(ed, o) { | ||
| 324 | // Safari adds BR at end of all block elements | ||
| 325 | o.content = o.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g, '</$1>'); | ||
| 326 | |||
| 327 | // Safari adds id="undefined" to HR elements | ||
| 328 | o.content = o.content.replace(/ id=\"undefined\"/g, ''); | ||
| 329 | }); | ||
| 330 | }, | ||
| 331 | |||
| 332 | getInfo : function() { | ||
| 333 | return { | ||
| 334 | longname : 'Safari compatibility', | ||
| 335 | author : 'Moxiecode Systems AB', | ||
| 336 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 337 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', | ||
| 338 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 339 | }; | ||
| 340 | }, | ||
| 341 | |||
| 342 | // Internal methods | ||
| 343 | |||
| 344 | _fixWebKitSpans : function() { | ||
| 345 | var t = this, ed = t.editor; | ||
| 346 | |||
| 347 | // Use mutator events on new WebKit | ||
| 348 | Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { | ||
| 349 | e = e.target; | ||
| 350 | |||
| 351 | if (e && e.nodeType == 1) | ||
| 352 | t._fixAppleSpan(e); | ||
| 353 | }); | ||
| 354 | }, | ||
| 355 | |||
| 356 | _fixAppleSpan : function(e) { | ||
| 357 | var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; | ||
| 358 | |||
| 359 | if (dom.getAttrib(e, 'mce_fixed')) | ||
| 360 | return; | ||
| 361 | |||
| 362 | // Handle Apple style spans | ||
| 363 | if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { | ||
| 364 | st = e.style; | ||
| 365 | |||
| 366 | if (!s.convert_fonts_to_spans) { | ||
| 367 | if (st.fontSize) { | ||
| 368 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 369 | dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); | ||
| 370 | } | ||
| 371 | |||
| 372 | if (st.fontFamily) { | ||
| 373 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 374 | dom.setAttrib(e, 'face', st.fontFamily); | ||
| 375 | } | ||
| 376 | |||
| 377 | if (st.color) { | ||
| 378 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 379 | dom.setAttrib(e, 'color', dom.toHex(st.color)); | ||
| 380 | } | ||
| 381 | |||
| 382 | if (st.backgroundColor) { | ||
| 383 | dom.setAttrib(e, 'mce_name', 'font'); | ||
| 384 | dom.setStyle(e, 'background-color', st.backgroundColor); | ||
| 385 | } | ||
| 386 | } else { | ||
| 387 | if (st.fontSize) | ||
| 388 | dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); | ||
| 389 | } | ||
| 390 | |||
| 391 | if (st.fontWeight == 'bold') | ||
| 392 | dom.setAttrib(e, 'mce_name', 'strong'); | ||
| 393 | |||
| 394 | if (st.fontStyle == 'italic') | ||
| 395 | dom.setAttrib(e, 'mce_name', 'em'); | ||
| 396 | |||
| 397 | if (st.textDecoration == 'underline') | ||
| 398 | dom.setAttrib(e, 'mce_name', 'u'); | ||
| 399 | |||
| 400 | if (st.textDecoration == 'line-through') | ||
| 401 | dom.setAttrib(e, 'mce_name', 'strike'); | ||
| 402 | |||
| 403 | if (st.verticalAlign == 'super') | ||
| 404 | dom.setAttrib(e, 'mce_name', 'sup'); | ||
| 405 | |||
| 406 | if (st.verticalAlign == 'sub') | ||
| 407 | dom.setAttrib(e, 'mce_name', 'sub'); | ||
| 408 | |||
| 409 | dom.setAttrib(e, 'mce_fixed', '1'); | ||
| 410 | } | ||
| 411 | }, | ||
| 412 | |||
| 413 | _insertBR : function(ed) { | ||
| 414 | var dom = ed.dom, s = ed.selection, r = s.getRng(), br; | ||
| 415 | |||
| 416 | // Insert BR element | ||
| 417 | r.insertNode(br = dom.create('br')); | ||
| 418 | |||
| 419 | // Place caret after BR | ||
| 420 | r.setStartAfter(br); | ||
| 421 | r.setEndAfter(br); | ||
| 422 | s.setRng(r); | ||
| 423 | |||
| 424 | // Could not place caret after BR then insert an nbsp entity and move the caret | ||
| 425 | if (s.getSel().focusNode == br.previousSibling) { | ||
| 426 | s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); | ||
| 427 | s.collapse(1); | ||
| 428 | } | ||
| 429 | |||
| 430 | // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 | ||
| 431 | ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y); | ||
| 432 | } | ||
| 433 | }); | ||
| 434 | |||
| 435 | // Register plugin | ||
| 436 | tinymce.PluginManager.add('safari', tinymce.plugins.Safari); | ||
| 437 | })(); | ||
| 438 | |||
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin.js deleted file mode 100644 index 8e93996..0000000 --- a/public/javascripts/tiny_mce/plugins/save/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js deleted file mode 100644 index b38be4d..0000000 --- a/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,98 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 851 2008-05-26 15:38:49Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.Save', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceSave', t._save, t); | ||
| 17 | ed.addCommand('mceCancel', t._cancel, t); | ||
| 18 | |||
| 19 | // Register buttons | ||
| 20 | ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); | ||
| 21 | ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); | ||
| 22 | |||
| 23 | ed.onNodeChange.add(t._nodeChange, t); | ||
| 24 | ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); | ||
| 25 | }, | ||
| 26 | |||
| 27 | getInfo : function() { | ||
| 28 | return { | ||
| 29 | longname : 'Save', | ||
| 30 | author : 'Moxiecode Systems AB', | ||
| 31 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 32 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', | ||
| 33 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 34 | }; | ||
| 35 | }, | ||
| 36 | |||
| 37 | // Private methods | ||
| 38 | |||
| 39 | _nodeChange : function(ed, cm, n) { | ||
| 40 | var ed = this.editor; | ||
| 41 | |||
| 42 | if (ed.getParam('save_enablewhendirty')) { | ||
| 43 | cm.setDisabled('save', !ed.isDirty()); | ||
| 44 | cm.setDisabled('cancel', !ed.isDirty()); | ||
| 45 | } | ||
| 46 | }, | ||
| 47 | |||
| 48 | // Private methods | ||
| 49 | |||
| 50 | _save : function() { | ||
| 51 | var ed = this.editor, formObj, os, i, elementId; | ||
| 52 | |||
| 53 | formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); | ||
| 54 | |||
| 55 | if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) | ||
| 56 | return; | ||
| 57 | |||
| 58 | tinyMCE.triggerSave(); | ||
| 59 | |||
| 60 | // Use callback instead | ||
| 61 | if (os = ed.getParam("save_onsavecallback")) { | ||
| 62 | if (ed.execCallback('save_onsavecallback', ed)) { | ||
| 63 | ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); | ||
| 64 | ed.nodeChanged(); | ||
| 65 | } | ||
| 66 | |||
| 67 | return; | ||
| 68 | } | ||
| 69 | |||
| 70 | if (formObj) { | ||
| 71 | ed.isNotDirty = true; | ||
| 72 | |||
| 73 | if (formObj.onsubmit == null || formObj.onsubmit() != false) | ||
| 74 | formObj.submit(); | ||
| 75 | |||
| 76 | ed.nodeChanged(); | ||
| 77 | } else | ||
| 78 | ed.windowManager.alert("Error: No form element found."); | ||
| 79 | }, | ||
| 80 | |||
| 81 | _cancel : function() { | ||
| 82 | var ed = this.editor, os, h = tinymce.trim(ed.startContent); | ||
| 83 | |||
| 84 | // Use callback instead | ||
| 85 | if (os = ed.getParam("save_oncancelcallback")) { | ||
| 86 | ed.execCallback('save_oncancelcallback', ed); | ||
| 87 | return; | ||
| 88 | } | ||
| 89 | |||
| 90 | ed.setContent(h); | ||
| 91 | ed.undoManager.clear(); | ||
| 92 | ed.nodeChanged(); | ||
| 93 | } | ||
| 94 | }); | ||
| 95 | |||
| 96 | // Register plugin | ||
| 97 | tinymce.PluginManager.add('save', tinymce.plugins.Save); | ||
| 98 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css deleted file mode 100644 index ecdf58c..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | .panel_wrapper {height:85px;} | ||
| 2 | .panel_wrapper div.current {height:85px;} | ||
| 3 | |||
| 4 | /* IE */ | ||
| 5 | * html .panel_wrapper {height:100px;} | ||
| 6 | * html .panel_wrapper div.current {height:100px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js deleted file mode 100644 index c3f8358..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:160+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js deleted file mode 100644 index 59edc3b..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 686 2008-03-09 18:13:49Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.SearchReplacePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | function open(m) { | ||
| 12 | ed.windowManager.open({ | ||
| 13 | file : url + '/searchreplace.htm', | ||
| 14 | width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), | ||
| 15 | height : 160 + parseInt(ed.getLang('searchreplace.delta_height', 0)), | ||
| 16 | inline : 1, | ||
| 17 | auto_focus : 0 | ||
| 18 | }, { | ||
| 19 | mode : m, | ||
| 20 | search_string : ed.selection.getContent({format : 'text'}), | ||
| 21 | plugin_url : url | ||
| 22 | }); | ||
| 23 | }; | ||
| 24 | |||
| 25 | // Register commands | ||
| 26 | ed.addCommand('mceSearch', function() { | ||
| 27 | open('search'); | ||
| 28 | }); | ||
| 29 | |||
| 30 | ed.addCommand('mceReplace', function() { | ||
| 31 | open('replace'); | ||
| 32 | }); | ||
| 33 | |||
| 34 | // Register buttons | ||
| 35 | ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); | ||
| 36 | ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); | ||
| 37 | |||
| 38 | ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); | ||
| 39 | }, | ||
| 40 | |||
| 41 | getInfo : function() { | ||
| 42 | return { | ||
| 43 | longname : 'Search/Replace', | ||
| 44 | author : 'Moxiecode Systems AB', | ||
| 45 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 46 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', | ||
| 47 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 48 | }; | ||
| 49 | } | ||
| 50 | }); | ||
| 51 | |||
| 52 | // Register plugin | ||
| 53 | tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); | ||
| 54 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js deleted file mode 100644 index a8585cc..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ /dev/null | |||
| @@ -1,126 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var SearchReplaceDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); | ||
| 6 | |||
| 7 | this.switchMode(m); | ||
| 8 | |||
| 9 | f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); | ||
| 10 | |||
| 11 | // Focus input field | ||
| 12 | f[m + '_panel_searchstring'].focus(); | ||
| 13 | }, | ||
| 14 | |||
| 15 | switchMode : function(m) { | ||
| 16 | var f, lm = this.lastMode; | ||
| 17 | |||
| 18 | if (lm != m) { | ||
| 19 | f = document.forms[0]; | ||
| 20 | |||
| 21 | if (lm) { | ||
| 22 | f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; | ||
| 23 | f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; | ||
| 24 | f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; | ||
| 25 | f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; | ||
| 26 | } | ||
| 27 | |||
| 28 | mcTabs.displayTab(m + '_tab', m + '_panel'); | ||
| 29 | document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 30 | document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 31 | this.lastMode = m; | ||
| 32 | } | ||
| 33 | }, | ||
| 34 | |||
| 35 | searchNext : function(a) { | ||
| 36 | var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; | ||
| 37 | |||
| 38 | // Get input | ||
| 39 | f = document.forms[0]; | ||
| 40 | s = f[m + '_panel_searchstring'].value; | ||
| 41 | b = f[m + '_panel_backwardsu'].checked; | ||
| 42 | ca = f[m + '_panel_casesensitivebox'].checked; | ||
| 43 | rs = f['replace_panel_replacestring'].value; | ||
| 44 | |||
| 45 | if (s == '') | ||
| 46 | return; | ||
| 47 | |||
| 48 | function fix() { | ||
| 49 | // Correct Firefox graphics glitches | ||
| 50 | r = se.getRng().cloneRange(); | ||
| 51 | ed.getDoc().execCommand('SelectAll', false, null); | ||
| 52 | se.setRng(r); | ||
| 53 | }; | ||
| 54 | |||
| 55 | function replace() { | ||
| 56 | if (tinymce.isIE) | ||
| 57 | ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE | ||
| 58 | else | ||
| 59 | ed.getDoc().execCommand('InsertHTML', false, rs); | ||
| 60 | }; | ||
| 61 | |||
| 62 | // IE flags | ||
| 63 | if (ca) | ||
| 64 | fl = fl | 4; | ||
| 65 | |||
| 66 | switch (a) { | ||
| 67 | case 'all': | ||
| 68 | // Move caret to beginning of text | ||
| 69 | ed.execCommand('SelectAll'); | ||
| 70 | ed.selection.collapse(true); | ||
| 71 | |||
| 72 | if (tinymce.isIE) { | ||
| 73 | while (r.findText(s, b ? -1 : 1, fl)) { | ||
| 74 | r.scrollIntoView(); | ||
| 75 | r.select(); | ||
| 76 | replace(); | ||
| 77 | fo = 1; | ||
| 78 | } | ||
| 79 | |||
| 80 | tinyMCEPopup.storeSelection(); | ||
| 81 | } else { | ||
| 82 | while (w.find(s, ca, b, false, false, false, false)) { | ||
| 83 | replace(); | ||
| 84 | fo = 1; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | if (fo) | ||
| 89 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); | ||
| 90 | else | ||
| 91 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 92 | |||
| 93 | return; | ||
| 94 | |||
| 95 | case 'current': | ||
| 96 | if (!ed.selection.isCollapsed()) | ||
| 97 | replace(); | ||
| 98 | |||
| 99 | break; | ||
| 100 | } | ||
| 101 | |||
| 102 | se.collapse(b); | ||
| 103 | r = se.getRng(); | ||
| 104 | |||
| 105 | // Whats the point | ||
| 106 | if (!s) | ||
| 107 | return; | ||
| 108 | |||
| 109 | if (tinymce.isIE) { | ||
| 110 | if (r.findText(s, b ? -1 : 1, fl)) { | ||
| 111 | r.scrollIntoView(); | ||
| 112 | r.select(); | ||
| 113 | } else | ||
| 114 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 115 | |||
| 116 | tinyMCEPopup.storeSelection(); | ||
| 117 | } else { | ||
| 118 | if (!w.find(s, ca, b, false, false, false, false)) | ||
| 119 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 120 | else | ||
| 121 | fix(); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | }; | ||
| 125 | |||
| 126 | tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js deleted file mode 100644 index 370959a..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.searchreplace_dlg',{ | ||
| 2 | searchnext_desc:"Find again", | ||
| 3 | notfound:"The search has been completed. The search string could not be found.", | ||
| 4 | search_title:"Find", | ||
| 5 | replace_title:"Find/Replace", | ||
| 6 | allreplaced:"All occurrences of the search string were replaced.", | ||
| 7 | findwhat:"Find what", | ||
| 8 | replacewith:"Replace with", | ||
| 9 | direction:"Direction", | ||
| 10 | up:"Up", | ||
| 11 | down:"Down", | ||
| 12 | mcase:"Match case", | ||
| 13 | findnext:"Find next", | ||
| 14 | replace:"Replace", | ||
| 15 | replaceall:"Replace all" | ||
| 16 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm deleted file mode 100644 index 0b42486..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#searchreplace_dlg.replace_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/searchreplace.js"></script> | ||
| 9 | <link rel="stylesheet" type="text/css" href="css/searchreplace.css" /> | ||
| 10 | </head> | ||
| 11 | <body style="display:none;"> | ||
| 12 | <form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#"> | ||
| 13 | <div class="tabs"> | ||
| 14 | <ul> | ||
| 15 | <li id="search_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li> | ||
| 16 | <li id="replace_tab"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li> | ||
| 17 | </ul> | ||
| 18 | </div> | ||
| 19 | |||
| 20 | <div class="panel_wrapper"> | ||
| 21 | <div id="search_panel" class="panel"> | ||
| 22 | <table border="0" cellspacing="0" cellpadding="2"> | ||
| 23 | <tr> | ||
| 24 | <td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td> | ||
| 25 | <td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" /></td> | ||
| 26 | </tr> | ||
| 27 | <tr> | ||
| 28 | <td colspan="2"> | ||
| 29 | <table border="0" cellspacing="0" cellpadding="0" class="direction"> | ||
| 30 | <tr> | ||
| 31 | <td><label>{#searchreplace_dlg.direction}</label></td> | ||
| 32 | <td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td> | ||
| 33 | <td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td> | ||
| 34 | <td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td> | ||
| 35 | <td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td> | ||
| 36 | </tr> | ||
| 37 | </table> | ||
| 38 | </td> | ||
| 39 | </tr> | ||
| 40 | <tr> | ||
| 41 | <td colspan="2"> | ||
| 42 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 43 | <tr> | ||
| 44 | <td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td> | ||
| 45 | <td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td> | ||
| 46 | </tr> | ||
| 47 | </table> | ||
| 48 | </td> | ||
| 49 | </tr> | ||
| 50 | </table> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | <div id="replace_panel" class="panel"> | ||
| 54 | <table border="0" cellspacing="0" cellpadding="2"> | ||
| 55 | <tr> | ||
| 56 | <td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td> | ||
| 57 | <td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" /></td> | ||
| 58 | </tr> | ||
| 59 | <tr> | ||
| 60 | <td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td> | ||
| 61 | <td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" /></td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td colspan="2"> | ||
| 65 | <table border="0" cellspacing="0" cellpadding="0" class="direction"> | ||
| 66 | <tr> | ||
| 67 | <td><label>{#searchreplace_dlg.direction}</label></td> | ||
| 68 | <td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td> | ||
| 69 | <td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td> | ||
| 70 | <td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td> | ||
| 71 | <td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td> | ||
| 72 | </tr> | ||
| 73 | </table> | ||
| 74 | </td> | ||
| 75 | </tr> | ||
| 76 | <tr> | ||
| 77 | <td colspan="2"> | ||
| 78 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 79 | <tr> | ||
| 80 | <td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td> | ||
| 81 | <td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td> | ||
| 82 | </tr> | ||
| 83 | </table> | ||
| 84 | </td> | ||
| 85 | </tr> | ||
| 86 | </table> | ||
| 87 | </div> | ||
| 88 | |||
| 89 | </div> | ||
| 90 | |||
| 91 | <div class="mceActionPanel"> | ||
| 92 | <div style="float: left"> | ||
| 93 | <input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" /> | ||
| 94 | <input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" /> | ||
| 95 | <input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" /> | ||
| 96 | </div> | ||
| 97 | |||
| 98 | <div style="float: right"> | ||
| 99 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 100 | </div> | ||
| 101 | </div> | ||
| 102 | </form> | ||
| 103 | </body> | ||
| 104 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css b/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css deleted file mode 100644 index 24efa02..0000000 --- a/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | .mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js deleted file mode 100644 index 377e4e8..0000000 --- a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;e.addCommand("mceSpellCheck",function(){if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);e.windowManager.alert("spellchecker.no_mpell")}})}else{g._done()}});e.onInit.add(function(){if(e.settings.content_css!==false){e.dom.loadCSS(f+"/css/content.css")}});e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={};this._walk(e.getBody(),function(h){if(h.nodeType==3){d+=h.nodeValue+" "}});d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));c(d.split(" "),function(h){if(!f[h]){g.push(h);f[h]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(o){var i,h,g,f,e,n="",k=this.editor,p=this._getSeparators(),j=k.dom,d=[];var l=k.selection,m=l.getBookmark();c(o,function(q){n+=(n?"|":"")+q});i=new RegExp("(["+p+"])("+n+")(["+p+"])","g");h=new RegExp("^("+n+")","g");g=new RegExp("("+n+")(["+p+"]?)$","g");f=new RegExp("^("+n+")(["+p+"]?)$","g");e=new RegExp("("+n+")(["+p+"])","g");this._walk(this.editor.getBody(),function(q){if(q.nodeType==3){d.push(q)}});c(d,function(r){var q;if(r.nodeType==3){q=r.nodeValue;if(i.test(q)||h.test(q)||g.test(q)||f.test(q)){q=j.encode(q);q=q.replace(e,'<span class="mceItemHiddenSpellWord">$1</span>$2');q=q.replace(g,'<span class="mceItemHiddenSpellWord">$1</span>$2');j.replace(j.create("span",{"class":"mceItemHidden"},q),r)}}});l.moveToBookmark(m)},_showMenu:function(g,i){var h=this,g=h.editor,d=h._menu,k,j=g.dom,f=j.getViewPort(g.getWin());if(!d){k=b.getPos(g.getContentAreaContainer());d=g.controlManager.createDropMenu("spellcheckermenu",{offset_x:k.x,offset_y:k.y,"class":"mceNoIcons"});h._menu=d}if(j.hasClass(i.target,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);h._sendRPC("getSuggestions",[h.selectedLang,j.decode(i.target.innerHTML)],function(e){d.removeAll();if(e.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(e,function(l){d.add({title:l,onclick:function(){j.replace(g.getDoc().createTextNode(l),i.target);h._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}d.add({title:"spellchecker.ignore_word",onclick:function(){j.remove(i.target,1);h._checkDone()}});d.add({title:"spellchecker.ignore_words",onclick:function(){h._removeWords(j.decode(i.target.innerHTML));h._checkDone()}});d.update()});g.selection.select(i.target);k=j.getPos(i.target);d.showMenu(k.x,k.y+i.target.offsetHeight-f.y);return tinymce.dom.Event.cancel(i)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,h,d){var g=this,f=g.editor.getParam("spellchecker_rpc_url","{backend}");if(f=="{backend}"){g.editor.setProgressState(0);alert("Please specify: spellchecker_rpc_url");return}a.sendRPC({url:f,method:e,params:h,success:d,error:function(j,i){g.editor.setProgressState(0);g.editor.windowManager.alert(j.errstr||("Error response: "+i.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js deleted file mode 100644 index c913c46..0000000 --- a/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,338 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.SpellcheckerPlugin', { | ||
| 12 | getInfo : function() { | ||
| 13 | return { | ||
| 14 | longname : 'Spellchecker', | ||
| 15 | author : 'Moxiecode Systems AB', | ||
| 16 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 17 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', | ||
| 18 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 19 | }; | ||
| 20 | }, | ||
| 21 | |||
| 22 | init : function(ed, url) { | ||
| 23 | var t = this, cm; | ||
| 24 | |||
| 25 | t.url = url; | ||
| 26 | t.editor = ed; | ||
| 27 | |||
| 28 | // Register commands | ||
| 29 | ed.addCommand('mceSpellCheck', function() { | ||
| 30 | if (!t.active) { | ||
| 31 | ed.setProgressState(1); | ||
| 32 | t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { | ||
| 33 | if (r.length > 0) { | ||
| 34 | t.active = 1; | ||
| 35 | t._markWords(r); | ||
| 36 | ed.setProgressState(0); | ||
| 37 | ed.nodeChanged(); | ||
| 38 | } else { | ||
| 39 | ed.setProgressState(0); | ||
| 40 | ed.windowManager.alert('spellchecker.no_mpell'); | ||
| 41 | } | ||
| 42 | }); | ||
| 43 | } else | ||
| 44 | t._done(); | ||
| 45 | }); | ||
| 46 | |||
| 47 | ed.onInit.add(function() { | ||
| 48 | if (ed.settings.content_css !== false) | ||
| 49 | ed.dom.loadCSS(url + '/css/content.css'); | ||
| 50 | }); | ||
| 51 | |||
| 52 | ed.onClick.add(t._showMenu, t); | ||
| 53 | ed.onContextMenu.add(t._showMenu, t); | ||
| 54 | ed.onBeforeGetContent.add(function() { | ||
| 55 | if (t.active) | ||
| 56 | t._removeWords(); | ||
| 57 | }); | ||
| 58 | |||
| 59 | ed.onNodeChange.add(function(ed, cm) { | ||
| 60 | cm.setActive('spellchecker', t.active); | ||
| 61 | }); | ||
| 62 | |||
| 63 | ed.onSetContent.add(function() { | ||
| 64 | t._done(); | ||
| 65 | }); | ||
| 66 | |||
| 67 | ed.onBeforeGetContent.add(function() { | ||
| 68 | t._done(); | ||
| 69 | }); | ||
| 70 | |||
| 71 | ed.onBeforeExecCommand.add(function(ed, cmd) { | ||
| 72 | if (cmd == 'mceFullScreen') | ||
| 73 | t._done(); | ||
| 74 | }); | ||
| 75 | |||
| 76 | // Find selected language | ||
| 77 | t.languages = {}; | ||
| 78 | each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { | ||
| 79 | if (k.indexOf('+') === 0) { | ||
| 80 | k = k.substring(1); | ||
| 81 | t.selectedLang = v; | ||
| 82 | } | ||
| 83 | |||
| 84 | t.languages[k] = v; | ||
| 85 | }); | ||
| 86 | }, | ||
| 87 | |||
| 88 | createControl : function(n, cm) { | ||
| 89 | var t = this, c, ed = t.editor; | ||
| 90 | |||
| 91 | if (n == 'spellchecker') { | ||
| 92 | c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); | ||
| 93 | |||
| 94 | c.onRenderMenu.add(function(c, m) { | ||
| 95 | m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 96 | each(t.languages, function(v, k) { | ||
| 97 | var o = {icon : 1}, mi; | ||
| 98 | |||
| 99 | o.onclick = function() { | ||
| 100 | mi.setSelected(1); | ||
| 101 | t.selectedItem.setSelected(0); | ||
| 102 | t.selectedItem = mi; | ||
| 103 | t.selectedLang = v; | ||
| 104 | }; | ||
| 105 | |||
| 106 | o.title = k; | ||
| 107 | mi = m.add(o); | ||
| 108 | mi.setSelected(v == t.selectedLang); | ||
| 109 | |||
| 110 | if (v == t.selectedLang) | ||
| 111 | t.selectedItem = mi; | ||
| 112 | }) | ||
| 113 | }); | ||
| 114 | |||
| 115 | return c; | ||
| 116 | } | ||
| 117 | }, | ||
| 118 | |||
| 119 | // Internal functions | ||
| 120 | |||
| 121 | _walk : function(n, f) { | ||
| 122 | var d = this.editor.getDoc(), w; | ||
| 123 | |||
| 124 | if (d.createTreeWalker) { | ||
| 125 | w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 126 | |||
| 127 | while ((n = w.nextNode()) != null) | ||
| 128 | f.call(this, n); | ||
| 129 | } else | ||
| 130 | tinymce.walk(n, f, 'childNodes'); | ||
| 131 | }, | ||
| 132 | |||
| 133 | _getSeparators : function() { | ||
| 134 | var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); | ||
| 135 | |||
| 136 | // Build word separator regexp | ||
| 137 | for (i=0; i<str.length; i++) | ||
| 138 | re += '\\' + str.charAt(i); | ||
| 139 | |||
| 140 | return re; | ||
| 141 | }, | ||
| 142 | |||
| 143 | _getWords : function() { | ||
| 144 | var ed = this.editor, wl = [], tx = '', lo = {}; | ||
| 145 | |||
| 146 | // Get area text | ||
| 147 | this._walk(ed.getBody(), function(n) { | ||
| 148 | if (n.nodeType == 3) | ||
| 149 | tx += n.nodeValue + ' '; | ||
| 150 | }); | ||
| 151 | |||
| 152 | // Split words by separator | ||
| 153 | tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' '); | ||
| 154 | tx = tinymce.trim(tx.replace(/(\s+)/g, ' ')); | ||
| 155 | |||
| 156 | // Build word array and remove duplicates | ||
| 157 | each(tx.split(' '), function(v) { | ||
| 158 | if (!lo[v]) { | ||
| 159 | wl.push(v); | ||
| 160 | lo[v] = 1; | ||
| 161 | } | ||
| 162 | }); | ||
| 163 | |||
| 164 | return wl; | ||
| 165 | }, | ||
| 166 | |||
| 167 | _removeWords : function(w) { | ||
| 168 | var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark(); | ||
| 169 | |||
| 170 | each(dom.select('span').reverse(), function(n) { | ||
| 171 | if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) { | ||
| 172 | if (!w || dom.decode(n.innerHTML) == w) | ||
| 173 | dom.remove(n, 1); | ||
| 174 | } | ||
| 175 | }); | ||
| 176 | |||
| 177 | se.moveToBookmark(b); | ||
| 178 | }, | ||
| 179 | |||
| 180 | _markWords : function(wl) { | ||
| 181 | var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = []; | ||
| 182 | var se = ed.selection, b = se.getBookmark(); | ||
| 183 | |||
| 184 | each(wl, function(v) { | ||
| 185 | w += (w ? '|' : '') + v; | ||
| 186 | }); | ||
| 187 | |||
| 188 | r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g'); | ||
| 189 | r2 = new RegExp('^(' + w + ')', 'g'); | ||
| 190 | r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g'); | ||
| 191 | r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g'); | ||
| 192 | r5 = new RegExp('(' + w + ')([' + re + '])', 'g'); | ||
| 193 | |||
| 194 | // Collect all text nodes | ||
| 195 | this._walk(this.editor.getBody(), function(n) { | ||
| 196 | if (n.nodeType == 3) { | ||
| 197 | nl.push(n); | ||
| 198 | } | ||
| 199 | }); | ||
| 200 | |||
| 201 | // Wrap incorrect words in spans | ||
| 202 | each(nl, function(n) { | ||
| 203 | var v; | ||
| 204 | |||
| 205 | if (n.nodeType == 3) { | ||
| 206 | v = n.nodeValue; | ||
| 207 | |||
| 208 | if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) { | ||
| 209 | v = dom.encode(v); | ||
| 210 | v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2'); | ||
| 211 | v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2'); | ||
| 212 | |||
| 213 | dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n); | ||
| 214 | } | ||
| 215 | } | ||
| 216 | }); | ||
| 217 | |||
| 218 | se.moveToBookmark(b); | ||
| 219 | }, | ||
| 220 | |||
| 221 | _showMenu : function(ed, e) { | ||
| 222 | var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); | ||
| 223 | |||
| 224 | if (!m) { | ||
| 225 | p1 = DOM.getPos(ed.getContentAreaContainer()); | ||
| 226 | //p2 = DOM.getPos(ed.getContainer()); | ||
| 227 | |||
| 228 | m = ed.controlManager.createDropMenu('spellcheckermenu', { | ||
| 229 | offset_x : p1.x, | ||
| 230 | offset_y : p1.y, | ||
| 231 | 'class' : 'mceNoIcons' | ||
| 232 | }); | ||
| 233 | |||
| 234 | t._menu = m; | ||
| 235 | } | ||
| 236 | |||
| 237 | if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) { | ||
| 238 | m.removeAll(); | ||
| 239 | m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 240 | |||
| 241 | t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) { | ||
| 242 | m.removeAll(); | ||
| 243 | |||
| 244 | if (r.length > 0) { | ||
| 245 | m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 246 | each(r, function(v) { | ||
| 247 | m.add({title : v, onclick : function() { | ||
| 248 | dom.replace(ed.getDoc().createTextNode(v), e.target); | ||
| 249 | t._checkDone(); | ||
| 250 | }}); | ||
| 251 | }); | ||
| 252 | |||
| 253 | m.addSeparator(); | ||
| 254 | } else | ||
| 255 | m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); | ||
| 256 | |||
| 257 | m.add({ | ||
| 258 | title : 'spellchecker.ignore_word', | ||
| 259 | onclick : function() { | ||
| 260 | dom.remove(e.target, 1); | ||
| 261 | t._checkDone(); | ||
| 262 | } | ||
| 263 | }); | ||
| 264 | |||
| 265 | m.add({ | ||
| 266 | title : 'spellchecker.ignore_words', | ||
| 267 | onclick : function() { | ||
| 268 | t._removeWords(dom.decode(e.target.innerHTML)); | ||
| 269 | t._checkDone(); | ||
| 270 | } | ||
| 271 | }); | ||
| 272 | |||
| 273 | m.update(); | ||
| 274 | }); | ||
| 275 | |||
| 276 | ed.selection.select(e.target); | ||
| 277 | p1 = dom.getPos(e.target); | ||
| 278 | m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); | ||
| 279 | |||
| 280 | return tinymce.dom.Event.cancel(e); | ||
| 281 | } else | ||
| 282 | m.hideMenu(); | ||
| 283 | }, | ||
| 284 | |||
| 285 | _checkDone : function() { | ||
| 286 | var t = this, ed = t.editor, dom = ed.dom, o; | ||
| 287 | |||
| 288 | each(dom.select('span'), function(n) { | ||
| 289 | if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { | ||
| 290 | o = true; | ||
| 291 | return false; | ||
| 292 | } | ||
| 293 | }); | ||
| 294 | |||
| 295 | if (!o) | ||
| 296 | t._done(); | ||
| 297 | }, | ||
| 298 | |||
| 299 | _done : function() { | ||
| 300 | var t = this, la = t.active; | ||
| 301 | |||
| 302 | if (t.active) { | ||
| 303 | t.active = 0; | ||
| 304 | t._removeWords(); | ||
| 305 | |||
| 306 | if (t._menu) | ||
| 307 | t._menu.hideMenu(); | ||
| 308 | |||
| 309 | if (la) | ||
| 310 | t.editor.nodeChanged(); | ||
| 311 | } | ||
| 312 | }, | ||
| 313 | |||
| 314 | _sendRPC : function(m, p, cb) { | ||
| 315 | var t = this, url = t.editor.getParam("spellchecker_rpc_url", "{backend}"); | ||
| 316 | |||
| 317 | if (url == '{backend}') { | ||
| 318 | t.editor.setProgressState(0); | ||
| 319 | alert('Please specify: spellchecker_rpc_url'); | ||
| 320 | return; | ||
| 321 | } | ||
| 322 | |||
| 323 | JSONRequest.sendRPC({ | ||
| 324 | url : url, | ||
| 325 | method : m, | ||
| 326 | params : p, | ||
| 327 | success : cb, | ||
| 328 | error : function(e, x) { | ||
| 329 | t.editor.setProgressState(0); | ||
| 330 | t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); | ||
| 331 | } | ||
| 332 | }); | ||
| 333 | } | ||
| 334 | }); | ||
| 335 | |||
| 336 | // Register plugin | ||
| 337 | tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); | ||
| 338 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif b/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif deleted file mode 100644 index 7d0a4db..0000000 --- a/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/plugins/style/css/props.css b/public/javascripts/tiny_mce/plugins/style/css/props.css deleted file mode 100644 index eb1f264..0000000 --- a/public/javascripts/tiny_mce/plugins/style/css/props.css +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #text_font {width:250px;} | ||
| 2 | #text_size {width:70px;} | ||
| 3 | .mceAddSelectValue {background:#DDD;} | ||
| 4 | select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} | ||
| 5 | #box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} | ||
| 6 | #positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} | ||
| 7 | #positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} | ||
| 8 | .panel_wrapper div.current {padding-top:10px;height:230px;} | ||
| 9 | .delim {border-left:1px solid gray;} | ||
| 10 | .tdelim {border-bottom:1px solid gray;} | ||
| 11 | #block_display {width:145px;} | ||
| 12 | #list_type {width:115px;} | ||
| 13 | .disabled {background:#EEE;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin.js deleted file mode 100644 index cab2153..0000000 --- a/public/javascripts/tiny_mce/plugins/style/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js deleted file mode 100644 index 6c817ce..0000000 --- a/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.StylePlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceStyleProps', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/props.htm', | ||
| 15 | width : 480 + parseInt(ed.getLang('style.delta_width', 0)), | ||
| 16 | height : 320 + parseInt(ed.getLang('style.delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url, | ||
| 20 | style_text : ed.selection.getNode().style.cssText | ||
| 21 | }); | ||
| 22 | }); | ||
| 23 | |||
| 24 | ed.addCommand('mceSetElementStyle', function(ui, v) { | ||
| 25 | if (e = ed.selection.getNode()) { | ||
| 26 | ed.dom.setAttrib(e, 'style', v); | ||
| 27 | ed.execCommand('mceRepaint'); | ||
| 28 | } | ||
| 29 | }); | ||
| 30 | |||
| 31 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 32 | cm.setDisabled('styleprops', n.nodeName === 'BODY'); | ||
| 33 | }); | ||
| 34 | |||
| 35 | // Register buttons | ||
| 36 | ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); | ||
| 37 | }, | ||
| 38 | |||
| 39 | getInfo : function() { | ||
| 40 | return { | ||
| 41 | longname : 'Style', | ||
| 42 | author : 'Moxiecode Systems AB', | ||
| 43 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 44 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', | ||
| 45 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 46 | }; | ||
| 47 | } | ||
| 48 | }); | ||
| 49 | |||
| 50 | // Register plugin | ||
| 51 | tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); | ||
| 52 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/js/props.js b/public/javascripts/tiny_mce/plugins/style/js/props.js deleted file mode 100644 index a8dd93d..0000000 --- a/public/javascripts/tiny_mce/plugins/style/js/props.js +++ /dev/null | |||
| @@ -1,641 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var defaultFonts = "" + | ||
| 4 | "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + | ||
| 5 | "Times New Roman, Times, serif=Times New Roman, Times, serif;" + | ||
| 6 | "Courier New, Courier, mono=Courier New, Courier, mono;" + | ||
| 7 | "Times New Roman, Times, serif=Times New Roman, Times, serif;" + | ||
| 8 | "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + | ||
| 9 | "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + | ||
| 10 | "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; | ||
| 11 | |||
| 12 | var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; | ||
| 13 | var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; | ||
| 14 | var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; | ||
| 15 | var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; | ||
| 16 | var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; | ||
| 17 | var defaultTextStyle = "normal;italic;oblique"; | ||
| 18 | var defaultVariant = "normal;small-caps"; | ||
| 19 | var defaultLineHeight = "normal"; | ||
| 20 | var defaultAttachment = "fixed;scroll"; | ||
| 21 | var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; | ||
| 22 | var defaultPosH = "left;center;right"; | ||
| 23 | var defaultPosV = "top;center;bottom"; | ||
| 24 | var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; | ||
| 25 | var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; | ||
| 26 | var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; | ||
| 27 | var defaultBorderWidth = "thin;medium;thick"; | ||
| 28 | var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; | ||
| 29 | |||
| 30 | function init() { | ||
| 31 | var ce = document.getElementById('container'), h; | ||
| 32 | |||
| 33 | ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); | ||
| 34 | |||
| 35 | h = getBrowserHTML('background_image_browser','background_image','image','advimage'); | ||
| 36 | document.getElementById("background_image_browser").innerHTML = h; | ||
| 37 | |||
| 38 | document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); | ||
| 39 | document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); | ||
| 40 | document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); | ||
| 41 | document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); | ||
| 42 | document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); | ||
| 43 | document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); | ||
| 44 | |||
| 45 | fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); | ||
| 46 | fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); | ||
| 47 | fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); | ||
| 48 | fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); | ||
| 49 | fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); | ||
| 50 | fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); | ||
| 51 | fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); | ||
| 52 | fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); | ||
| 53 | fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); | ||
| 54 | |||
| 55 | fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); | ||
| 56 | fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); | ||
| 57 | |||
| 58 | fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); | ||
| 59 | fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); | ||
| 60 | |||
| 61 | fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); | ||
| 62 | fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); | ||
| 63 | |||
| 64 | fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); | ||
| 65 | fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); | ||
| 66 | fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); | ||
| 67 | fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); | ||
| 68 | fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); | ||
| 69 | fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); | ||
| 70 | fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); | ||
| 71 | fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); | ||
| 72 | fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); | ||
| 73 | |||
| 74 | fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); | ||
| 75 | fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); | ||
| 76 | fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); | ||
| 77 | fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); | ||
| 78 | fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); | ||
| 79 | fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); | ||
| 80 | fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); | ||
| 81 | fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); | ||
| 82 | fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); | ||
| 83 | fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); | ||
| 84 | fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); | ||
| 85 | fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); | ||
| 86 | |||
| 87 | fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); | ||
| 88 | fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); | ||
| 89 | fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); | ||
| 90 | fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); | ||
| 91 | |||
| 92 | fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); | ||
| 93 | fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); | ||
| 94 | fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); | ||
| 95 | fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); | ||
| 96 | |||
| 97 | fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); | ||
| 98 | fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); | ||
| 99 | fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); | ||
| 100 | fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); | ||
| 101 | |||
| 102 | fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); | ||
| 103 | fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); | ||
| 104 | |||
| 105 | fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); | ||
| 106 | fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); | ||
| 107 | |||
| 108 | fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); | ||
| 109 | fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); | ||
| 110 | fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); | ||
| 111 | |||
| 112 | fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); | ||
| 113 | fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); | ||
| 114 | fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); | ||
| 115 | fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); | ||
| 116 | |||
| 117 | fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); | ||
| 118 | fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); | ||
| 119 | fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); | ||
| 120 | fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); | ||
| 121 | |||
| 122 | TinyMCE_EditableSelects.init(); | ||
| 123 | setupFormData(); | ||
| 124 | showDisabledControls(); | ||
| 125 | } | ||
| 126 | |||
| 127 | function setupFormData() { | ||
| 128 | var ce = document.getElementById('container'), f = document.forms[0], s, b, i; | ||
| 129 | |||
| 130 | // Setup text fields | ||
| 131 | |||
| 132 | selectByValue(f, 'text_font', ce.style.fontFamily, true, true); | ||
| 133 | selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); | ||
| 134 | selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); | ||
| 135 | selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); | ||
| 136 | selectByValue(f, 'text_style', ce.style.fontStyle, true, true); | ||
| 137 | selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); | ||
| 138 | selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); | ||
| 139 | selectByValue(f, 'text_case', ce.style.textTransform, true, true); | ||
| 140 | selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); | ||
| 141 | f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); | ||
| 142 | updateColor('text_color_pick', 'text_color'); | ||
| 143 | f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); | ||
| 144 | f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); | ||
| 145 | f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); | ||
| 146 | f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); | ||
| 147 | |||
| 148 | // Setup background fields | ||
| 149 | |||
| 150 | f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); | ||
| 151 | updateColor('background_color_pick', 'background_color'); | ||
| 152 | f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 153 | selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); | ||
| 154 | selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); | ||
| 155 | selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); | ||
| 156 | selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); | ||
| 157 | selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); | ||
| 158 | selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); | ||
| 159 | |||
| 160 | // Setup block fields | ||
| 161 | |||
| 162 | selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); | ||
| 163 | selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); | ||
| 164 | selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); | ||
| 165 | selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); | ||
| 166 | selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); | ||
| 167 | selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); | ||
| 168 | f.block_text_indent.value = getNum(ce.style.textIndent); | ||
| 169 | selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); | ||
| 170 | selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); | ||
| 171 | selectByValue(f, 'block_display', ce.style.display, true, true); | ||
| 172 | |||
| 173 | // Setup box fields | ||
| 174 | |||
| 175 | f.box_width.value = getNum(ce.style.width); | ||
| 176 | selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); | ||
| 177 | |||
| 178 | f.box_height.value = getNum(ce.style.height); | ||
| 179 | selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); | ||
| 180 | |||
| 181 | if (tinymce.isGecko) | ||
| 182 | selectByValue(f, 'box_float', ce.style.cssFloat, true, true); | ||
| 183 | else | ||
| 184 | selectByValue(f, 'box_float', ce.style.styleFloat, true, true); | ||
| 185 | |||
| 186 | selectByValue(f, 'box_clear', ce.style.clear, true, true); | ||
| 187 | |||
| 188 | setupBox(f, ce, 'box_padding', 'padding', ''); | ||
| 189 | setupBox(f, ce, 'box_margin', 'margin', ''); | ||
| 190 | |||
| 191 | // Setup border fields | ||
| 192 | |||
| 193 | setupBox(f, ce, 'border_style', 'border', 'Style'); | ||
| 194 | setupBox(f, ce, 'border_width', 'border', 'Width'); | ||
| 195 | setupBox(f, ce, 'border_color', 'border', 'Color'); | ||
| 196 | |||
| 197 | updateColor('border_color_top_pick', 'border_color_top'); | ||
| 198 | updateColor('border_color_right_pick', 'border_color_right'); | ||
| 199 | updateColor('border_color_bottom_pick', 'border_color_bottom'); | ||
| 200 | updateColor('border_color_left_pick', 'border_color_left'); | ||
| 201 | |||
| 202 | f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); | ||
| 203 | f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); | ||
| 204 | f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); | ||
| 205 | f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); | ||
| 206 | |||
| 207 | // Setup list fields | ||
| 208 | |||
| 209 | selectByValue(f, 'list_type', ce.style.listStyleType, true, true); | ||
| 210 | selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); | ||
| 211 | f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 212 | |||
| 213 | // Setup box fields | ||
| 214 | |||
| 215 | selectByValue(f, 'positioning_type', ce.style.position, true, true); | ||
| 216 | selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); | ||
| 217 | selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); | ||
| 218 | f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; | ||
| 219 | |||
| 220 | f.positioning_width.value = getNum(ce.style.width); | ||
| 221 | selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); | ||
| 222 | |||
| 223 | f.positioning_height.value = getNum(ce.style.height); | ||
| 224 | selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); | ||
| 225 | |||
| 226 | setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); | ||
| 227 | |||
| 228 | s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 229 | s = s.replace(/,/g, ' '); | ||
| 230 | |||
| 231 | if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { | ||
| 232 | f.positioning_clip_top.value = getNum(getVal(s, 0)); | ||
| 233 | selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); | ||
| 234 | f.positioning_clip_right.value = getNum(getVal(s, 1)); | ||
| 235 | selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); | ||
| 236 | f.positioning_clip_bottom.value = getNum(getVal(s, 2)); | ||
| 237 | selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); | ||
| 238 | f.positioning_clip_left.value = getNum(getVal(s, 3)); | ||
| 239 | selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); | ||
| 240 | } else { | ||
| 241 | f.positioning_clip_top.value = getNum(getVal(s, 0)); | ||
| 242 | selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); | ||
| 243 | f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; | ||
| 244 | } | ||
| 245 | |||
| 246 | // setupBox(f, ce, '', 'border', 'Color'); | ||
| 247 | } | ||
| 248 | |||
| 249 | function getMeasurement(s) { | ||
| 250 | return s.replace(/^([0-9.]+)(.*)$/, "$2"); | ||
| 251 | } | ||
| 252 | |||
| 253 | function getNum(s) { | ||
| 254 | if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) | ||
| 255 | return s.replace(/[^0-9.]/g, ''); | ||
| 256 | |||
| 257 | return s; | ||
| 258 | } | ||
| 259 | |||
| 260 | function inStr(s, n) { | ||
| 261 | return new RegExp(n, 'gi').test(s); | ||
| 262 | } | ||
| 263 | |||
| 264 | function getVal(s, i) { | ||
| 265 | var a = s.split(' '); | ||
| 266 | |||
| 267 | if (a.length > 1) | ||
| 268 | return a[i]; | ||
| 269 | |||
| 270 | return ""; | ||
| 271 | } | ||
| 272 | |||
| 273 | function setValue(f, n, v) { | ||
| 274 | if (f.elements[n].type == "text") | ||
| 275 | f.elements[n].value = v; | ||
| 276 | else | ||
| 277 | selectByValue(f, n, v, true, true); | ||
| 278 | } | ||
| 279 | |||
| 280 | function setupBox(f, ce, fp, pr, sf, b) { | ||
| 281 | if (typeof(b) == "undefined") | ||
| 282 | b = ['Top', 'Right', 'Bottom', 'Left']; | ||
| 283 | |||
| 284 | if (isSame(ce, pr, sf, b)) { | ||
| 285 | f.elements[fp + "_same"].checked = true; | ||
| 286 | |||
| 287 | setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); | ||
| 288 | f.elements[fp + "_top"].disabled = false; | ||
| 289 | |||
| 290 | f.elements[fp + "_right"].value = ""; | ||
| 291 | f.elements[fp + "_right"].disabled = true; | ||
| 292 | f.elements[fp + "_bottom"].value = ""; | ||
| 293 | f.elements[fp + "_bottom"].disabled = true; | ||
| 294 | f.elements[fp + "_left"].value = ""; | ||
| 295 | f.elements[fp + "_left"].disabled = true; | ||
| 296 | |||
| 297 | if (f.elements[fp + "_top_measurement"]) { | ||
| 298 | selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); | ||
| 299 | f.elements[fp + "_left_measurement"].disabled = true; | ||
| 300 | f.elements[fp + "_bottom_measurement"].disabled = true; | ||
| 301 | f.elements[fp + "_right_measurement"].disabled = true; | ||
| 302 | } | ||
| 303 | } else { | ||
| 304 | f.elements[fp + "_same"].checked = false; | ||
| 305 | |||
| 306 | setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); | ||
| 307 | f.elements[fp + "_top"].disabled = false; | ||
| 308 | |||
| 309 | setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); | ||
| 310 | f.elements[fp + "_right"].disabled = false; | ||
| 311 | |||
| 312 | setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); | ||
| 313 | f.elements[fp + "_bottom"].disabled = false; | ||
| 314 | |||
| 315 | setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); | ||
| 316 | f.elements[fp + "_left"].disabled = false; | ||
| 317 | |||
| 318 | if (f.elements[fp + "_top_measurement"]) { | ||
| 319 | selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); | ||
| 320 | selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); | ||
| 321 | selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); | ||
| 322 | selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); | ||
| 323 | f.elements[fp + "_left_measurement"].disabled = false; | ||
| 324 | f.elements[fp + "_bottom_measurement"].disabled = false; | ||
| 325 | f.elements[fp + "_right_measurement"].disabled = false; | ||
| 326 | } | ||
| 327 | } | ||
| 328 | } | ||
| 329 | |||
| 330 | function isSame(e, pr, sf, b) { | ||
| 331 | var a = [], i, x; | ||
| 332 | |||
| 333 | if (typeof(b) == "undefined") | ||
| 334 | b = ['Top', 'Right', 'Bottom', 'Left']; | ||
| 335 | |||
| 336 | if (typeof(sf) == "undefined" || sf == null) | ||
| 337 | sf = ""; | ||
| 338 | |||
| 339 | a[0] = e.style[pr + b[0] + sf]; | ||
| 340 | a[1] = e.style[pr + b[1] + sf]; | ||
| 341 | a[2] = e.style[pr + b[2] + sf]; | ||
| 342 | a[3] = e.style[pr + b[3] + sf]; | ||
| 343 | |||
| 344 | for (i=0; i<a.length; i++) { | ||
| 345 | if (a[i] == null) | ||
| 346 | return false; | ||
| 347 | |||
| 348 | for (x=0; x<a.length; x++) { | ||
| 349 | if (a[x] != a[i]) | ||
| 350 | return false; | ||
| 351 | } | ||
| 352 | } | ||
| 353 | |||
| 354 | return true; | ||
| 355 | }; | ||
| 356 | |||
| 357 | function hasEqualValues(a) { | ||
| 358 | var i, x; | ||
| 359 | |||
| 360 | for (i=0; i<a.length; i++) { | ||
| 361 | if (a[i] == null) | ||
| 362 | return false; | ||
| 363 | |||
| 364 | for (x=0; x<a.length; x++) { | ||
| 365 | if (a[x] != a[i]) | ||
| 366 | return false; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | |||
| 370 | return true; | ||
| 371 | } | ||
| 372 | |||
| 373 | function applyAction() { | ||
| 374 | var ce = document.getElementById('container'), ed = tinyMCEPopup.editor; | ||
| 375 | |||
| 376 | generateCSS(); | ||
| 377 | |||
| 378 | tinyMCEPopup.restoreSelection(); | ||
| 379 | ed.dom.setAttrib(ed.selection.getNode(), 'style', tinyMCEPopup.editor.dom.serializeStyle(tinyMCEPopup.editor.dom.parseStyle(ce.style.cssText))); | ||
| 380 | } | ||
| 381 | |||
| 382 | function updateAction() { | ||
| 383 | applyAction(); | ||
| 384 | tinyMCEPopup.close(); | ||
| 385 | } | ||
| 386 | |||
| 387 | function generateCSS() { | ||
| 388 | var ce = document.getElementById('container'), f = document.forms[0], num = new RegExp('[0-9]+', 'g'), s, t; | ||
| 389 | |||
| 390 | ce.style.cssText = ""; | ||
| 391 | |||
| 392 | // Build text styles | ||
| 393 | ce.style.fontFamily = f.text_font.value; | ||
| 394 | ce.style.fontSize = f.text_size.value + (isNum(f.text_size.value) ? (f.text_size_measurement.value || 'px') : ""); | ||
| 395 | ce.style.fontStyle = f.text_style.value; | ||
| 396 | ce.style.lineHeight = f.text_lineheight.value + (isNum(f.text_lineheight.value) ? f.text_lineheight_measurement.value : ""); | ||
| 397 | ce.style.textTransform = f.text_case.value; | ||
| 398 | ce.style.fontWeight = f.text_weight.value; | ||
| 399 | ce.style.fontVariant = f.text_variant.value; | ||
| 400 | ce.style.color = f.text_color.value; | ||
| 401 | |||
| 402 | s = ""; | ||
| 403 | s += f.text_underline.checked ? " underline" : ""; | ||
| 404 | s += f.text_overline.checked ? " overline" : ""; | ||
| 405 | s += f.text_linethrough.checked ? " line-through" : ""; | ||
| 406 | s += f.text_blink.checked ? " blink" : ""; | ||
| 407 | s = s.length > 0 ? s.substring(1) : s; | ||
| 408 | |||
| 409 | if (f.text_none.checked) | ||
| 410 | s = "none"; | ||
| 411 | |||
| 412 | ce.style.textDecoration = s; | ||
| 413 | |||
| 414 | // Build background styles | ||
| 415 | |||
| 416 | ce.style.backgroundColor = f.background_color.value; | ||
| 417 | ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; | ||
| 418 | ce.style.backgroundRepeat = f.background_repeat.value; | ||
| 419 | ce.style.backgroundAttachment = f.background_attachment.value; | ||
| 420 | |||
| 421 | if (f.background_hpos.value != "") { | ||
| 422 | s = ""; | ||
| 423 | s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; | ||
| 424 | s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); | ||
| 425 | ce.style.backgroundPosition = s; | ||
| 426 | } | ||
| 427 | |||
| 428 | // Build block styles | ||
| 429 | |||
| 430 | ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); | ||
| 431 | ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); | ||
| 432 | ce.style.verticalAlign = f.block_vertical_alignment.value; | ||
| 433 | ce.style.textAlign = f.block_text_align.value; | ||
| 434 | ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); | ||
| 435 | ce.style.whiteSpace = f.block_whitespace.value; | ||
| 436 | ce.style.display = f.block_display.value; | ||
| 437 | |||
| 438 | // Build box styles | ||
| 439 | |||
| 440 | ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); | ||
| 441 | ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); | ||
| 442 | ce.style.styleFloat = f.box_float.value; | ||
| 443 | |||
| 444 | if (tinymce.isGecko) | ||
| 445 | ce.style.cssFloat = f.box_float.value; | ||
| 446 | |||
| 447 | ce.style.clear = f.box_clear.value; | ||
| 448 | |||
| 449 | if (!f.box_padding_same.checked) { | ||
| 450 | ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); | ||
| 451 | ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); | ||
| 452 | ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); | ||
| 453 | ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); | ||
| 454 | } else | ||
| 455 | ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); | ||
| 456 | |||
| 457 | if (!f.box_margin_same.checked) { | ||
| 458 | ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); | ||
| 459 | ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); | ||
| 460 | ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); | ||
| 461 | ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); | ||
| 462 | } else | ||
| 463 | ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); | ||
| 464 | |||
| 465 | // Build border styles | ||
| 466 | |||
| 467 | if (!f.border_style_same.checked) { | ||
| 468 | ce.style.borderTopStyle = f.border_style_top.value; | ||
| 469 | ce.style.borderRightStyle = f.border_style_right.value; | ||
| 470 | ce.style.borderBottomStyle = f.border_style_bottom.value; | ||
| 471 | ce.style.borderLeftStyle = f.border_style_left.value; | ||
| 472 | } else | ||
| 473 | ce.style.borderStyle = f.border_style_top.value; | ||
| 474 | |||
| 475 | if (!f.border_width_same.checked) { | ||
| 476 | ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); | ||
| 477 | ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); | ||
| 478 | ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); | ||
| 479 | ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); | ||
| 480 | } else | ||
| 481 | ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); | ||
| 482 | |||
| 483 | if (!f.border_color_same.checked) { | ||
| 484 | ce.style.borderTopColor = f.border_color_top.value; | ||
| 485 | ce.style.borderRightColor = f.border_color_right.value; | ||
| 486 | ce.style.borderBottomColor = f.border_color_bottom.value; | ||
| 487 | ce.style.borderLeftColor = f.border_color_left.value; | ||
| 488 | } else | ||
| 489 | ce.style.borderColor = f.border_color_top.value; | ||
| 490 | |||
| 491 | // Build list styles | ||
| 492 | |||
| 493 | ce.style.listStyleType = f.list_type.value; | ||
| 494 | ce.style.listStylePosition = f.list_position.value; | ||
| 495 | ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; | ||
| 496 | |||
| 497 | // Build positioning styles | ||
| 498 | |||
| 499 | ce.style.position = f.positioning_type.value; | ||
| 500 | ce.style.visibility = f.positioning_visibility.value; | ||
| 501 | |||
| 502 | if (ce.style.width == "") | ||
| 503 | ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); | ||
| 504 | |||
| 505 | if (ce.style.height == "") | ||
| 506 | ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); | ||
| 507 | |||
| 508 | ce.style.zIndex = f.positioning_zindex.value; | ||
| 509 | ce.style.overflow = f.positioning_overflow.value; | ||
| 510 | |||
| 511 | if (!f.positioning_placement_same.checked) { | ||
| 512 | ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); | ||
| 513 | ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); | ||
| 514 | ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); | ||
| 515 | ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); | ||
| 516 | } else { | ||
| 517 | s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); | ||
| 518 | ce.style.top = s; | ||
| 519 | ce.style.right = s; | ||
| 520 | ce.style.bottom = s; | ||
| 521 | ce.style.left = s; | ||
| 522 | } | ||
| 523 | |||
| 524 | if (!f.positioning_clip_same.checked) { | ||
| 525 | s = "rect("; | ||
| 526 | s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; | ||
| 527 | s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; | ||
| 528 | s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; | ||
| 529 | s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); | ||
| 530 | s += ")"; | ||
| 531 | |||
| 532 | if (s != "rect(auto auto auto auto)") | ||
| 533 | ce.style.clip = s; | ||
| 534 | } else { | ||
| 535 | s = "rect("; | ||
| 536 | t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; | ||
| 537 | s += t + " "; | ||
| 538 | s += t + " "; | ||
| 539 | s += t + " "; | ||
| 540 | s += t + ")"; | ||
| 541 | |||
| 542 | if (s != "rect(auto auto auto auto)") | ||
| 543 | ce.style.clip = s; | ||
| 544 | } | ||
| 545 | |||
| 546 | ce.style.cssText = ce.style.cssText; | ||
| 547 | } | ||
| 548 | |||
| 549 | function isNum(s) { | ||
| 550 | return new RegExp('[0-9]+', 'g').test(s); | ||
| 551 | } | ||
| 552 | |||
| 553 | function showDisabledControls() { | ||
| 554 | var f = document.forms, i, a; | ||
| 555 | |||
| 556 | for (i=0; i<f.length; i++) { | ||
| 557 | for (a=0; a<f[i].elements.length; a++) { | ||
| 558 | if (f[i].elements[a].disabled) | ||
| 559 | tinyMCEPopup.editor.dom.addClass(f[i].elements[a], "disabled"); | ||
| 560 | else | ||
| 561 | tinyMCEPopup.editor.dom.removeClass(f[i].elements[a], "disabled"); | ||
| 562 | } | ||
| 563 | } | ||
| 564 | } | ||
| 565 | |||
| 566 | function fillSelect(f, s, param, dval, sep, em) { | ||
| 567 | var i, ar, p, se; | ||
| 568 | |||
| 569 | f = document.forms[f]; | ||
| 570 | sep = typeof(sep) == "undefined" ? ";" : sep; | ||
| 571 | |||
| 572 | if (em) | ||
| 573 | addSelectValue(f, s, "", ""); | ||
| 574 | |||
| 575 | ar = tinyMCEPopup.getParam(param, dval).split(sep); | ||
| 576 | for (i=0; i<ar.length; i++) { | ||
| 577 | se = false; | ||
| 578 | |||
| 579 | if (ar[i].charAt(0) == '+') { | ||
| 580 | ar[i] = ar[i].substring(1); | ||
| 581 | se = true; | ||
| 582 | } | ||
| 583 | |||
| 584 | p = ar[i].split('='); | ||
| 585 | |||
| 586 | if (p.length > 1) { | ||
| 587 | addSelectValue(f, s, p[0], p[1]); | ||
| 588 | |||
| 589 | if (se) | ||
| 590 | selectByValue(f, s, p[1]); | ||
| 591 | } else { | ||
| 592 | addSelectValue(f, s, p[0], p[0]); | ||
| 593 | |||
| 594 | if (se) | ||
| 595 | selectByValue(f, s, p[0]); | ||
| 596 | } | ||
| 597 | } | ||
| 598 | } | ||
| 599 | |||
| 600 | function toggleSame(ce, pre) { | ||
| 601 | var el = document.forms[0].elements, i; | ||
| 602 | |||
| 603 | if (ce.checked) { | ||
| 604 | el[pre + "_top"].disabled = false; | ||
| 605 | el[pre + "_right"].disabled = true; | ||
| 606 | el[pre + "_bottom"].disabled = true; | ||
| 607 | el[pre + "_left"].disabled = true; | ||
| 608 | |||
| 609 | if (el[pre + "_top_measurement"]) { | ||
| 610 | el[pre + "_top_measurement"].disabled = false; | ||
| 611 | el[pre + "_right_measurement"].disabled = true; | ||
| 612 | el[pre + "_bottom_measurement"].disabled = true; | ||
| 613 | el[pre + "_left_measurement"].disabled = true; | ||
| 614 | } | ||
| 615 | } else { | ||
| 616 | el[pre + "_top"].disabled = false; | ||
| 617 | el[pre + "_right"].disabled = false; | ||
| 618 | el[pre + "_bottom"].disabled = false; | ||
| 619 | el[pre + "_left"].disabled = false; | ||
| 620 | |||
| 621 | if (el[pre + "_top_measurement"]) { | ||
| 622 | el[pre + "_top_measurement"].disabled = false; | ||
| 623 | el[pre + "_right_measurement"].disabled = false; | ||
| 624 | el[pre + "_bottom_measurement"].disabled = false; | ||
| 625 | el[pre + "_left_measurement"].disabled = false; | ||
| 626 | } | ||
| 627 | } | ||
| 628 | |||
| 629 | showDisabledControls(); | ||
| 630 | } | ||
| 631 | |||
| 632 | function synch(fr, to) { | ||
| 633 | var f = document.forms[0]; | ||
| 634 | |||
| 635 | f.elements[to].value = f.elements[fr].value; | ||
| 636 | |||
| 637 | if (f.elements[fr + "_measurement"]) | ||
| 638 | selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); | ||
| 639 | } | ||
| 640 | |||
| 641 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js deleted file mode 100644 index 5026313..0000000 --- a/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.style_dlg',{ | ||
| 2 | title:"Edit CSS Style", | ||
| 3 | apply:"Apply", | ||
| 4 | text_tab:"Text", | ||
| 5 | background_tab:"Background", | ||
| 6 | block_tab:"Block", | ||
| 7 | box_tab:"Box", | ||
| 8 | border_tab:"Border", | ||
| 9 | list_tab:"List", | ||
| 10 | positioning_tab:"Positioning", | ||
| 11 | text_props:"Text", | ||
| 12 | text_font:"Font", | ||
| 13 | text_size:"Size", | ||
| 14 | text_weight:"Weight", | ||
| 15 | text_style:"Style", | ||
| 16 | text_variant:"Variant", | ||
| 17 | text_lineheight:"Line height", | ||
| 18 | text_case:"Case", | ||
| 19 | text_color:"Color", | ||
| 20 | text_decoration:"Decoration", | ||
| 21 | text_overline:"overline", | ||
| 22 | text_underline:"underline", | ||
| 23 | text_striketrough:"strikethrough", | ||
| 24 | text_blink:"blink", | ||
| 25 | text_none:"none", | ||
| 26 | background_color:"Background color", | ||
| 27 | background_image:"Background image", | ||
| 28 | background_repeat:"Repeat", | ||
| 29 | background_attachment:"Attachment", | ||
| 30 | background_hpos:"Horizontal position", | ||
| 31 | background_vpos:"Vertical position", | ||
| 32 | block_wordspacing:"Word spacing", | ||
| 33 | block_letterspacing:"Letter spacing", | ||
| 34 | block_vertical_alignment:"Vertical alignment", | ||
| 35 | block_text_align:"Text align", | ||
| 36 | block_text_indent:"Text indent", | ||
| 37 | block_whitespace:"Whitespace", | ||
| 38 | block_display:"Display", | ||
| 39 | box_width:"Width", | ||
| 40 | box_height:"Height", | ||
| 41 | box_float:"Float", | ||
| 42 | box_clear:"Clear", | ||
| 43 | padding:"Padding", | ||
| 44 | same:"Same for all", | ||
| 45 | top:"Top", | ||
| 46 | right:"Right", | ||
| 47 | bottom:"Bottom", | ||
| 48 | left:"Left", | ||
| 49 | margin:"Margin", | ||
| 50 | style:"Style", | ||
| 51 | width:"Width", | ||
| 52 | height:"Height", | ||
| 53 | color:"Color", | ||
| 54 | list_type:"Type", | ||
| 55 | bullet_image:"Bullet image", | ||
| 56 | position:"Position", | ||
| 57 | positioning_type:"Type", | ||
| 58 | visibility:"Visibility", | ||
| 59 | zindex:"Z-index", | ||
| 60 | overflow:"Overflow", | ||
| 61 | placement:"Placement", | ||
| 62 | clip:"Clip" | ||
| 63 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/style/props.htm b/public/javascripts/tiny_mce/plugins/style/props.htm deleted file mode 100644 index 3a1582c..0000000 --- a/public/javascripts/tiny_mce/plugins/style/props.htm +++ /dev/null | |||
| @@ -1,730 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#style_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <script type="text/javascript" src="js/props.js"></script> | ||
| 10 | <link href="css/props.css" rel="stylesheet" type="text/css" /> | ||
| 11 | </head> | ||
| 12 | |||
| 13 | <body id="styleprops" style="display: none"> | ||
| 14 | <form onsubmit="updateAction();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="text_tab" class="current"><span><a href="javascript:mcTabs.displayTab('text_tab','text_panel');" onMouseDown="return false;">{#style_dlg.text_tab}</a></span></li> | ||
| 18 | <li id="background_tab"><span><a href="javascript:mcTabs.displayTab('background_tab','background_panel');" onMouseDown="return false;">{#style_dlg.background_tab}</a></span></li> | ||
| 19 | <li id="block_tab"><span><a href="javascript:mcTabs.displayTab('block_tab','block_panel');" onMouseDown="return false;">{#style_dlg.block_tab}</a></span></li> | ||
| 20 | <li id="box_tab"><span><a href="javascript:mcTabs.displayTab('box_tab','box_panel');" onMouseDown="return false;">{#style_dlg.box_tab}</a></span></li> | ||
| 21 | <li id="border_tab"><span><a href="javascript:mcTabs.displayTab('border_tab','border_panel');" onMouseDown="return false;">{#style_dlg.border_tab}</a></span></li> | ||
| 22 | <li id="list_tab"><span><a href="javascript:mcTabs.displayTab('list_tab','list_panel');" onMouseDown="return false;">{#style_dlg.list_tab}</a></span></li> | ||
| 23 | <li id="positioning_tab"><span><a href="javascript:mcTabs.displayTab('positioning_tab','positioning_panel');" onMouseDown="return false;">{#style_dlg.positioning_tab}</a></span></li> | ||
| 24 | </ul> | ||
| 25 | </div> | ||
| 26 | |||
| 27 | <div class="panel_wrapper"> | ||
| 28 | <div id="text_panel" class="panel current"> | ||
| 29 | <table border="0" width="100%"> | ||
| 30 | <tr> | ||
| 31 | <td><label for="text_font">{#style_dlg.text_font}</label></td> | ||
| 32 | <td colspan="3"> | ||
| 33 | <select id="text_font" name="text_font" class="mceEditableSelect mceFocus"></select> | ||
| 34 | </td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td><label for="text_size">{#style_dlg.text_size}</label></td> | ||
| 38 | <td> | ||
| 39 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 40 | <tr> | ||
| 41 | <td><select id="text_size" name="text_size" class="mceEditableSelect"></select></td> | ||
| 42 | <td> </td> | ||
| 43 | <td><select id="text_size_measurement" name="text_size_measurement"></select></td> | ||
| 44 | </tr> | ||
| 45 | </table> | ||
| 46 | </td> | ||
| 47 | <td><label for="text_weight">{#style_dlg.text_weight}</label></td> | ||
| 48 | <td> | ||
| 49 | <select id="text_weight" name="text_weight"></select> | ||
| 50 | </td> | ||
| 51 | </tr> | ||
| 52 | <tr> | ||
| 53 | <td><label for="text_style">{#style_dlg.text_style}</label></td> | ||
| 54 | <td> | ||
| 55 | <select id="text_style" name="text_style" class="mceEditableSelect"></select> | ||
| 56 | </td> | ||
| 57 | <td><label for="text_variant">{#style_dlg.text_variant}</label></td> | ||
| 58 | <td> | ||
| 59 | <select id="text_variant" name="text_variant"></select> | ||
| 60 | </td> | ||
| 61 | </tr> | ||
| 62 | <tr> | ||
| 63 | <td><label for="text_lineheight">{#style_dlg.text_lineheight}</label></td> | ||
| 64 | <td> | ||
| 65 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 66 | <tr> | ||
| 67 | <td> | ||
| 68 | <select id="text_lineheight" name="text_lineheight" class="mceEditableSelect"></select> | ||
| 69 | </td> | ||
| 70 | <td> </td> | ||
| 71 | <td><select id="text_lineheight_measurement" name="text_lineheight_measurement"></select></td> | ||
| 72 | </tr> | ||
| 73 | </table> | ||
| 74 | </td> | ||
| 75 | <td><label for="text_case">{#style_dlg.text_case}</label></td> | ||
| 76 | <td> | ||
| 77 | <select id="text_case" name="text_case"></select> | ||
| 78 | </td> | ||
| 79 | </tr> | ||
| 80 | <tr> | ||
| 81 | <td><label for="text_color">{#style_dlg.text_color}</label></td> | ||
| 82 | <td colspan="2"> | ||
| 83 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 84 | <tr> | ||
| 85 | <td><input id="text_color" name="text_color" type="text" value="" size="9" onChange="updateColor('text_color_pick','text_color');" /></td> | ||
| 86 | <td id="text_color_pickcontainer"> </td> | ||
| 87 | </tr> | ||
| 88 | </table> | ||
| 89 | </td> | ||
| 90 | </tr> | ||
| 91 | <tr> | ||
| 92 | <td valign="top" style="vertical-align: top; padding-top: 3px;">{#style_dlg.text_decoration}</td> | ||
| 93 | <td colspan="2"> | ||
| 94 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 95 | <tr> | ||
| 96 | <td><input id="text_underline" name="text_underline" class="checkbox" type="checkbox" /></td> | ||
| 97 | <td><label for="text_underline">{#style_dlg.text_underline}</label></td> | ||
| 98 | </tr> | ||
| 99 | <tr> | ||
| 100 | <td><input id="text_overline" name="text_overline" class="checkbox" type="checkbox" /></td> | ||
| 101 | <td><label for="text_overline">{#style_dlg.text_overline}</label></td> | ||
| 102 | </tr> | ||
| 103 | <tr> | ||
| 104 | <td><input id="text_linethrough" name="text_linethrough" class="checkbox" type="checkbox" /></td> | ||
| 105 | <td><label for="text_linethrough">{#style_dlg.text_striketrough}</label></td> | ||
| 106 | </tr> | ||
| 107 | <tr> | ||
| 108 | <td><input id="text_blink" name="text_blink" class="checkbox" type="checkbox" /></td> | ||
| 109 | <td><label for="text_blink">{#style_dlg.text_blink}</label></td> | ||
| 110 | </tr> | ||
| 111 | <tr> | ||
| 112 | <td><input id="text_none" name="text_none" class="checkbox" type="checkbox" /></td> | ||
| 113 | <td><label for="text_none">{#style_dlg.text_none}</label></td> | ||
| 114 | </tr> | ||
| 115 | </table> | ||
| 116 | </td> | ||
| 117 | </tr> | ||
| 118 | </table> | ||
| 119 | </div> | ||
| 120 | |||
| 121 | <div id="background_panel" class="panel"> | ||
| 122 | <table border="0"> | ||
| 123 | <tr> | ||
| 124 | <td><label for="background_color">{#style_dlg.background_color}</label></td> | ||
| 125 | <td> | ||
| 126 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 127 | <tr> | ||
| 128 | <td><input id="background_color" name="background_color" type="text" value="" size="9" onChange="updateColor('background_color_pick','background_color');" /></td> | ||
| 129 | <td id="background_color_pickcontainer"> </td> | ||
| 130 | </tr> | ||
| 131 | </table> | ||
| 132 | </td> | ||
| 133 | </tr> | ||
| 134 | |||
| 135 | <tr> | ||
| 136 | <td><label for="background_image">{#style_dlg.background_image}</label></td> | ||
| 137 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 138 | <tr> | ||
| 139 | <td><input id="background_image" name="background_image" type="text" /></td> | ||
| 140 | <td id="background_image_browser"> </td> | ||
| 141 | </tr> | ||
| 142 | </table> | ||
| 143 | </td> | ||
| 144 | </tr> | ||
| 145 | |||
| 146 | <tr> | ||
| 147 | <td><label for="background_repeat">{#style_dlg.background_repeat}</label></td> | ||
| 148 | <td><select id="background_repeat" name="background_repeat" class="mceEditableSelect"></select></td> | ||
| 149 | </tr> | ||
| 150 | |||
| 151 | <tr> | ||
| 152 | <td><label for="background_attachment">{#style_dlg.background_attachment}</label></td> | ||
| 153 | <td><select id="background_attachment" name="background_attachment" class="mceEditableSelect"></select></td> | ||
| 154 | </tr> | ||
| 155 | |||
| 156 | <tr> | ||
| 157 | <td><label for="background_hpos">{#style_dlg.background_hpos}</label></td> | ||
| 158 | <td> | ||
| 159 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 160 | <tr> | ||
| 161 | <td><select id="background_hpos" name="background_hpos" class="mceEditableSelect"></select></td> | ||
| 162 | <td> </td> | ||
| 163 | <td><select id="background_hpos_measurement" name="background_hpos_measurement"></select></td> | ||
| 164 | </tr> | ||
| 165 | </table> | ||
| 166 | </td> | ||
| 167 | </tr> | ||
| 168 | |||
| 169 | <tr> | ||
| 170 | <td><label for="background_vpos">{#style_dlg.background_vpos}</label></td> | ||
| 171 | <td> | ||
| 172 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 173 | <tr> | ||
| 174 | <td><select id="background_vpos" name="background_vpos" class="mceEditableSelect"></select></td> | ||
| 175 | <td> </td> | ||
| 176 | <td><select id="background_vpos_measurement" name="background_vpos_measurement"></select></td> | ||
| 177 | </tr> | ||
| 178 | </table> | ||
| 179 | </td> | ||
| 180 | </tr> | ||
| 181 | </table> | ||
| 182 | </div> | ||
| 183 | |||
| 184 | <div id="block_panel" class="panel"> | ||
| 185 | <table border="0"> | ||
| 186 | <tr> | ||
| 187 | <td><label for="block_wordspacing">{#style_dlg.block_wordspacing}</label></td> | ||
| 188 | <td> | ||
| 189 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 190 | <tr> | ||
| 191 | <td><select id="block_wordspacing" name="block_wordspacing" class="mceEditableSelect"></select></td> | ||
| 192 | <td> </td> | ||
| 193 | <td><select id="block_wordspacing_measurement" name="block_wordspacing_measurement"></select></td> | ||
| 194 | </tr> | ||
| 195 | </table> | ||
| 196 | </td> | ||
| 197 | </tr> | ||
| 198 | |||
| 199 | <tr> | ||
| 200 | <td><label for="block_letterspacing">{#style_dlg.block_letterspacing}</label></td> | ||
| 201 | <td> | ||
| 202 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 203 | <tr> | ||
| 204 | <td><select id="block_letterspacing" name="block_letterspacing" class="mceEditableSelect"></select></td> | ||
| 205 | <td> </td> | ||
| 206 | <td><select id="block_letterspacing_measurement" name="block_letterspacing_measurement"></select></td> | ||
| 207 | </tr> | ||
| 208 | </table> | ||
| 209 | </td> | ||
| 210 | </tr> | ||
| 211 | |||
| 212 | <tr> | ||
| 213 | <td><label for="block_vertical_alignment">{#style_dlg.block_vertical_alignment}</label></td> | ||
| 214 | <td><select id="block_vertical_alignment" name="block_vertical_alignment" class="mceEditableSelect"></select></td> | ||
| 215 | </tr> | ||
| 216 | |||
| 217 | <tr> | ||
| 218 | <td><label for="block_text_align">{#style_dlg.block_text_align}</label></td> | ||
| 219 | <td><select id="block_text_align" name="block_text_align" class="mceEditableSelect"></select></td> | ||
| 220 | </tr> | ||
| 221 | |||
| 222 | <tr> | ||
| 223 | <td><label for="block_text_indent">{#style_dlg.block_text_indent}</label></td> | ||
| 224 | <td> | ||
| 225 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 226 | <tr> | ||
| 227 | <td><input type="text" id="block_text_indent" name="block_text_indent" /></td> | ||
| 228 | <td> </td> | ||
| 229 | <td><select id="block_text_indent_measurement" name="block_text_indent_measurement"></select></td> | ||
| 230 | </tr> | ||
| 231 | </table> | ||
| 232 | </td> | ||
| 233 | </tr> | ||
| 234 | |||
| 235 | <tr> | ||
| 236 | <td><label for="block_whitespace">{#style_dlg.block_whitespace}</label></td> | ||
| 237 | <td><select id="block_whitespace" name="block_whitespace" class="mceEditableSelect"></select></td> | ||
| 238 | </tr> | ||
| 239 | |||
| 240 | <tr> | ||
| 241 | <td><label for="block_display">{#style_dlg.block_display}</label></td> | ||
| 242 | <td><select id="block_display" name="block_display" class="mceEditableSelect"></select></td> | ||
| 243 | </tr> | ||
| 244 | </table> | ||
| 245 | </div> | ||
| 246 | |||
| 247 | <div id="box_panel" class="panel"> | ||
| 248 | <table border="0"> | ||
| 249 | <tr> | ||
| 250 | <td><label for="box_width">{#style_dlg.box_width}</label></td> | ||
| 251 | <td> | ||
| 252 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 253 | <tr> | ||
| 254 | <td><input type="text" id="box_width" name="box_width" class="mceEditableSelect" onChange="synch('box_width','positioning_width');" /></td> | ||
| 255 | <td> </td> | ||
| 256 | <td><select id="box_width_measurement" name="box_width_measurement"></select></td> | ||
| 257 | </tr> | ||
| 258 | </table> | ||
| 259 | </td> | ||
| 260 | <td> <label for="box_float">{#style_dlg.box_float}</label></td> | ||
| 261 | <td><select id="box_float" name="box_float" class="mceEditableSelect"></select></td> | ||
| 262 | </tr> | ||
| 263 | |||
| 264 | <tr> | ||
| 265 | <td><label for="box_height">{#style_dlg.box_height}</label></td> | ||
| 266 | <td> | ||
| 267 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 268 | <tr> | ||
| 269 | <td><input type="text" id="box_height" name="box_height" class="mceEditableSelect" onChange="synch('box_height','positioning_height');" /></td> | ||
| 270 | <td> </td> | ||
| 271 | <td><select id="box_height_measurement" name="box_height_measurement"></select></td> | ||
| 272 | </tr> | ||
| 273 | </table> | ||
| 274 | </td> | ||
| 275 | <td> <label for="box_clear">{#style_dlg.box_clear}</label></td> | ||
| 276 | <td><select id="box_clear" name="box_clear" class="mceEditableSelect"></select></td> | ||
| 277 | </tr> | ||
| 278 | </table> | ||
| 279 | <div style="float: left; width: 49%"> | ||
| 280 | <fieldset> | ||
| 281 | <legend>{#style_dlg.padding}</legend> | ||
| 282 | |||
| 283 | <table border="0"> | ||
| 284 | <tr> | ||
| 285 | <td> </td> | ||
| 286 | <td><input type="checkbox" id="box_padding_same" name="box_padding_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_padding');" /> <label for="box_padding_same">{#style_dlg.same}</label></td> | ||
| 287 | </tr> | ||
| 288 | <tr> | ||
| 289 | <td><label for="box_padding_top">{#style_dlg.top}</label></td> | ||
| 290 | <td> | ||
| 291 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 292 | <tr> | ||
| 293 | <td><input type="text" id="box_padding_top" name="box_padding_top" class="mceEditableSelect" /></td> | ||
| 294 | <td> </td> | ||
| 295 | <td><select id="box_padding_top_measurement" name="box_padding_top_measurement"></select></td> | ||
| 296 | </tr> | ||
| 297 | </table> | ||
| 298 | </td> | ||
| 299 | </tr> | ||
| 300 | <tr> | ||
| 301 | <td><label for="box_padding_right">{#style_dlg.right}</label></td> | ||
| 302 | <td> | ||
| 303 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 304 | <tr> | ||
| 305 | <td><input type="text" id="box_padding_right" name="box_padding_right" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 306 | <td> </td> | ||
| 307 | <td><select id="box_padding_right_measurement" name="box_padding_right_measurement" disabled="disabled"></select></td> | ||
| 308 | </tr> | ||
| 309 | </table> | ||
| 310 | </td> | ||
| 311 | </tr> | ||
| 312 | <tr> | ||
| 313 | <td><label for="box_padding_bottom">{#style_dlg.bottom}</label></td> | ||
| 314 | <td> | ||
| 315 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 316 | <tr> | ||
| 317 | <td><input type="text" id="box_padding_bottom" name="box_padding_bottom" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 318 | <td> </td> | ||
| 319 | <td><select id="box_padding_bottom_measurement" name="box_padding_bottom_measurement" disabled="disabled"></select></td> | ||
| 320 | </tr> | ||
| 321 | </table> | ||
| 322 | </td> | ||
| 323 | </tr> | ||
| 324 | <tr> | ||
| 325 | <td><label for="box_padding_left">{#style_dlg.left}</label></td> | ||
| 326 | <td> | ||
| 327 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 328 | <tr> | ||
| 329 | <td><input type="text" id="box_padding_left" name="box_padding_left" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 330 | <td> </td> | ||
| 331 | <td><select id="box_padding_left_measurement" name="box_padding_left_measurement" disabled="disabled"></select></td> | ||
| 332 | </tr> | ||
| 333 | </table> | ||
| 334 | </td> | ||
| 335 | </tr> | ||
| 336 | </table> | ||
| 337 | </fieldset> | ||
| 338 | </div> | ||
| 339 | |||
| 340 | <div style="float: right; width: 49%"> | ||
| 341 | <fieldset> | ||
| 342 | <legend>{#style_dlg.margin}</legend> | ||
| 343 | |||
| 344 | <table border="0"> | ||
| 345 | <tr> | ||
| 346 | <td> </td> | ||
| 347 | <td><input type="checkbox" id="box_margin_same" name="box_margin_same" class="checkbox" checked="checked" onClick="toggleSame(this,'box_margin');" /> <label for="box_margin_same">{#style_dlg.same}</label></td> | ||
| 348 | </tr> | ||
| 349 | <tr> | ||
| 350 | <td><label for="box_margin_top">{#style_dlg.top}</label></td> | ||
| 351 | <td> | ||
| 352 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 353 | <tr> | ||
| 354 | <td><input type="text" id="box_margin_top" name="box_margin_top" class="mceEditableSelect" /></td> | ||
| 355 | <td> </td> | ||
| 356 | <td><select id="box_margin_top_measurement" name="box_margin_top_measurement"></select></td> | ||
| 357 | </tr> | ||
| 358 | </table> | ||
| 359 | </td> | ||
| 360 | </tr> | ||
| 361 | <tr> | ||
| 362 | <td><label for="box_margin_right">{#style_dlg.right}</label></td> | ||
| 363 | <td> | ||
| 364 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 365 | <tr> | ||
| 366 | <td><input type="text" id="box_margin_right" name="box_margin_right" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 367 | <td> </td> | ||
| 368 | <td><select id="box_margin_right_measurement" name="box_margin_right_measurement" disabled="disabled"></select></td> | ||
| 369 | </tr> | ||
| 370 | </table> | ||
| 371 | </td> | ||
| 372 | </tr> | ||
| 373 | <tr> | ||
| 374 | <td><label for="box_margin_bottom">{#style_dlg.bottom}</label></td> | ||
| 375 | <td> | ||
| 376 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 377 | <tr> | ||
| 378 | <td><input type="text" id="box_margin_bottom" name="box_margin_bottom" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 379 | <td> </td> | ||
| 380 | <td><select id="box_margin_bottom_measurement" name="box_margin_bottom_measurement" disabled="disabled"></select></td> | ||
| 381 | </tr> | ||
| 382 | </table> | ||
| 383 | </td> | ||
| 384 | </tr> | ||
| 385 | <tr> | ||
| 386 | <td><label for="box_margin_left">{#style_dlg.left}</label></td> | ||
| 387 | <td> | ||
| 388 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 389 | <tr> | ||
| 390 | <td><input type="text" id="box_margin_left" name="box_margin_left" class="mceEditableSelect" disabled="disabled" /></td> | ||
| 391 | <td> </td> | ||
| 392 | <td><select id="box_margin_left_measurement" name="box_margin_left_measurement" disabled="disabled"></select></td> | ||
| 393 | </tr> | ||
| 394 | </table> | ||
| 395 | </td> | ||
| 396 | </tr> | ||
| 397 | </table> | ||
| 398 | </fieldset> | ||
| 399 | </div> | ||
| 400 | <br style="clear: both" /> | ||
| 401 | </div> | ||
| 402 | |||
| 403 | <div id="border_panel" class="panel"> | ||
| 404 | <table border="0" cellspacing="0" cellpadding="0" width="100%"> | ||
| 405 | <tr> | ||
| 406 | <td class="tdelim"> </td> | ||
| 407 | <td class="tdelim delim"> </td> | ||
| 408 | <td class="tdelim">{#style_dlg.style}</td> | ||
| 409 | <td class="tdelim delim"> </td> | ||
| 410 | <td class="tdelim">{#style_dlg.width}</td> | ||
| 411 | <td class="tdelim delim"> </td> | ||
| 412 | <td class="tdelim">{#style_dlg.color}</td> | ||
| 413 | </tr> | ||
| 414 | |||
| 415 | <tr> | ||
| 416 | <td> </td> | ||
| 417 | <td class="delim"> </td> | ||
| 418 | <td><input type="checkbox" id="border_style_same" name="border_style_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_style');" /> <label for="border_style_same">{#style_dlg.same}</label></td> | ||
| 419 | <td class="delim"> </td> | ||
| 420 | <td><input type="checkbox" id="border_width_same" name="border_width_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_width');" /> <label for="border_width_same">{#style_dlg.same}</label></td> | ||
| 421 | <td class="delim"> </td> | ||
| 422 | <td><input type="checkbox" id="border_color_same" name="border_color_same" class="checkbox" checked="checked" onClick="toggleSame(this,'border_color');" /> <label for="border_color_same">{#style_dlg.same}</label></td> | ||
| 423 | </tr> | ||
| 424 | |||
| 425 | <tr> | ||
| 426 | <td>{#style_dlg.top}</td> | ||
| 427 | <td class="delim"> </td> | ||
| 428 | <td><select id="border_style_top" name="border_style_top" class="mceEditableSelect"></select></td> | ||
| 429 | <td class="delim"> </td> | ||
| 430 | <td> | ||
| 431 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 432 | <tr> | ||
| 433 | <td><select id="border_width_top" name="border_width_top" class="mceEditableSelect"></select></td> | ||
| 434 | <td> </td> | ||
| 435 | <td><select id="border_width_top_measurement" name="border_width_top_measurement"></select></td> | ||
| 436 | </tr> | ||
| 437 | </table> | ||
| 438 | </td> | ||
| 439 | <td class="delim"> </td> | ||
| 440 | <td> | ||
| 441 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 442 | <tr> | ||
| 443 | <td><input id="border_color_top" name="border_color_top" type="text" value="" size="9" onChange="updateColor('border_color_top_pick','border_color_top');" /></td> | ||
| 444 | <td id="border_color_top_pickcontainer"> </td> | ||
| 445 | </tr> | ||
| 446 | </table> | ||
| 447 | </td> | ||
| 448 | </tr> | ||
| 449 | |||
| 450 | <tr> | ||
| 451 | <td>{#style_dlg.right}</td> | ||
| 452 | <td class="delim"> </td> | ||
| 453 | <td><select id="border_style_right" name="border_style_right" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 454 | <td class="delim"> </td> | ||
| 455 | <td> | ||
| 456 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 457 | <tr> | ||
| 458 | <td><select id="border_width_right" name="border_width_right" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 459 | <td> </td> | ||
| 460 | <td><select id="border_width_right_measurement" name="border_width_right_measurement" disabled="disabled"></select></td> | ||
| 461 | </tr> | ||
| 462 | </table> | ||
| 463 | </td> | ||
| 464 | <td class="delim"> </td> | ||
| 465 | <td> | ||
| 466 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 467 | <tr> | ||
| 468 | <td><input id="border_color_right" name="border_color_right" type="text" value="" size="9" onChange="updateColor('border_color_right_pick','border_color_right');" disabled="disabled" /></td> | ||
| 469 | <td id="border_color_right_pickcontainer"> </td> | ||
| 470 | </tr> | ||
| 471 | </table> | ||
| 472 | </td> | ||
| 473 | </tr> | ||
| 474 | |||
| 475 | <tr> | ||
| 476 | <td>{#style_dlg.bottom}</td> | ||
| 477 | <td class="delim"> </td> | ||
| 478 | <td><select id="border_style_bottom" name="border_style_bottom" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 479 | <td class="delim"> </td> | ||
| 480 | <td> | ||
| 481 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 482 | <tr> | ||
| 483 | <td><select id="border_width_bottom" name="border_width_bottom" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 484 | <td> </td> | ||
| 485 | <td><select id="border_width_bottom_measurement" name="border_width_bottom_measurement" disabled="disabled"></select></td> | ||
| 486 | </tr> | ||
| 487 | </table> | ||
| 488 | </td> | ||
| 489 | <td class="delim"> </td> | ||
| 490 | <td> | ||
| 491 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 492 | <tr> | ||
| 493 | <td><input id="border_color_bottom" name="border_color_bottom" type="text" value="" size="9" onChange="updateColor('border_color_bottom_pick','border_color_bottom');" disabled="disabled" /></td> | ||
| 494 | <td id="border_color_bottom_pickcontainer"> </td> | ||
| 495 | </tr> | ||
| 496 | </table> | ||
| 497 | </td> | ||
| 498 | </tr> | ||
| 499 | |||
| 500 | <tr> | ||
| 501 | <td>{#style_dlg.left}</td> | ||
| 502 | <td class="delim"> </td> | ||
| 503 | <td><select id="border_style_left" name="border_style_left" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 504 | <td class="delim"> </td> | ||
| 505 | <td> | ||
| 506 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 507 | <tr> | ||
| 508 | <td><select id="border_width_left" name="border_width_left" class="mceEditableSelect" disabled="disabled"></select></td> | ||
| 509 | <td> </td> | ||
| 510 | <td><select id="border_width_left_measurement" name="border_width_left_measurement" disabled="disabled"></select></td> | ||
| 511 | </tr> | ||
| 512 | </table> | ||
| 513 | </td> | ||
| 514 | <td class="delim"> </td> | ||
| 515 | <td> | ||
| 516 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 517 | <tr> | ||
| 518 | <td><input id="border_color_left" name="border_color_left" type="text" value="" size="9" onChange="updateColor('border_color_left_pick','border_color_left');" disabled="disabled" /></td> | ||
| 519 | <td id="border_color_left_pickcontainer"> </td> | ||
| 520 | </tr> | ||
| 521 | </table> | ||
| 522 | </td> | ||
| 523 | </tr> | ||
| 524 | </table> | ||
| 525 | </div> | ||
| 526 | |||
| 527 | <div id="list_panel" class="panel"> | ||
| 528 | <table border="0"> | ||
| 529 | <tr> | ||
| 530 | <td><label for="list_type">{#style_dlg.list_type}</label></td> | ||
| 531 | <td><select id="list_type" name="list_type" class="mceEditableSelect"></select></td> | ||
| 532 | </tr> | ||
| 533 | |||
| 534 | <tr> | ||
| 535 | <td><label for="list_bullet_image">{#style_dlg.bullet_image}</label></td> | ||
| 536 | <td><input id="list_bullet_image" name="list_bullet_image" type="text" /></td> | ||
| 537 | </tr> | ||
| 538 | |||
| 539 | <tr> | ||
| 540 | <td><label for="list_position">{#style_dlg.position}</label></td> | ||
| 541 | <td><select id="list_position" name="list_position" class="mceEditableSelect"></select></td> | ||
| 542 | </tr> | ||
| 543 | </table> | ||
| 544 | </div> | ||
| 545 | |||
| 546 | <div id="positioning_panel" class="panel"> | ||
| 547 | <table border="0"> | ||
| 548 | <tr> | ||
| 549 | <td><label for="positioning_type">{#style_dlg.positioning_type}</label></td> | ||
| 550 | <td><select id="positioning_type" name="positioning_type" class="mceEditableSelect"></select></td> | ||
| 551 | <td> <label for="positioning_visibility">{#style_dlg.visibility}</label></td> | ||
| 552 | <td><select id="positioning_visibility" name="positioning_visibility" class="mceEditableSelect"></select></td> | ||
| 553 | </tr> | ||
| 554 | |||
| 555 | <tr> | ||
| 556 | <td><label for="positioning_width">{#style_dlg.width}</label></td> | ||
| 557 | <td> | ||
| 558 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 559 | <tr> | ||
| 560 | <td><input type="text" id="positioning_width" name="positioning_width" onChange="synch('positioning_width','box_width');" /></td> | ||
| 561 | <td> </td> | ||
| 562 | <td><select id="positioning_width_measurement" name="positioning_width_measurement"></select></td> | ||
| 563 | </tr> | ||
| 564 | </table> | ||
| 565 | </td> | ||
| 566 | <td> <label for="positioning_zindex">{#style_dlg.zindex}</label></td> | ||
| 567 | <td><input type="text" id="positioning_zindex" name="positioning_zindex" /></td> | ||
| 568 | </tr> | ||
| 569 | |||
| 570 | <tr> | ||
| 571 | <td><label for="positioning_height">{#style_dlg.height}</label></td> | ||
| 572 | <td> | ||
| 573 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 574 | <tr> | ||
| 575 | <td><input type="text" id="positioning_height" name="positioning_height" onChange="synch('positioning_height','box_height');" /></td> | ||
| 576 | <td> </td> | ||
| 577 | <td><select id="positioning_height_measurement" name="positioning_height_measurement"></select></td> | ||
| 578 | </tr> | ||
| 579 | </table> | ||
| 580 | </td> | ||
| 581 | <td> <label for="positioning_overflow">{#style_dlg.overflow}</label></td> | ||
| 582 | <td><select id="positioning_overflow" name="positioning_overflow" class="mceEditableSelect"></select></td> | ||
| 583 | </tr> | ||
| 584 | </table> | ||
| 585 | |||
| 586 | <div style="float: left; width: 49%"> | ||
| 587 | <fieldset> | ||
| 588 | <legend>{#style_dlg.placement}</legend> | ||
| 589 | |||
| 590 | <table border="0"> | ||
| 591 | <tr> | ||
| 592 | <td> </td> | ||
| 593 | <td><input type="checkbox" id="positioning_placement_same" name="positioning_placement_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_placement');" /> <label for="positioning_placement_same">{#style_dlg.same}</label></td> | ||
| 594 | </tr> | ||
| 595 | <tr> | ||
| 596 | <td>{#style_dlg.top}</td> | ||
| 597 | <td> | ||
| 598 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 599 | <tr> | ||
| 600 | <td><input type="text" id="positioning_placement_top" name="positioning_placement_top" /></td> | ||
| 601 | <td> </td> | ||
| 602 | <td><select id="positioning_placement_top_measurement" name="positioning_placement_top_measurement"></select></td> | ||
| 603 | </tr> | ||
| 604 | </table> | ||
| 605 | </td> | ||
| 606 | </tr> | ||
| 607 | <tr> | ||
| 608 | <td>{#style_dlg.right}</td> | ||
| 609 | <td> | ||
| 610 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 611 | <tr> | ||
| 612 | <td><input type="text" id="positioning_placement_right" name="positioning_placement_right" disabled="disabled" /></td> | ||
| 613 | <td> </td> | ||
| 614 | <td><select id="positioning_placement_right_measurement" name="positioning_placement_right_measurement" disabled="disabled"></select></td> | ||
| 615 | </tr> | ||
| 616 | </table> | ||
| 617 | </td> | ||
| 618 | </tr> | ||
| 619 | <tr> | ||
| 620 | <td>{#style_dlg.bottom}</td> | ||
| 621 | <td> | ||
| 622 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 623 | <tr> | ||
| 624 | <td><input type="text" id="positioning_placement_bottom" name="positioning_placement_bottom" disabled="disabled" /></td> | ||
| 625 | <td> </td> | ||
| 626 | <td><select id="positioning_placement_bottom_measurement" name="positioning_placement_bottom_measurement" disabled="disabled"></select></td> | ||
| 627 | </tr> | ||
| 628 | </table> | ||
| 629 | </td> | ||
| 630 | </tr> | ||
| 631 | <tr> | ||
| 632 | <td>{#style_dlg.left}</td> | ||
| 633 | <td> | ||
| 634 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 635 | <tr> | ||
| 636 | <td><input type="text" id="positioning_placement_left" name="positioning_placement_left" disabled="disabled" /></td> | ||
| 637 | <td> </td> | ||
| 638 | <td><select id="positioning_placement_left_measurement" name="positioning_placement_left_measurement" disabled="disabled"></select></td> | ||
| 639 | </tr> | ||
| 640 | </table> | ||
| 641 | </td> | ||
| 642 | </tr> | ||
| 643 | </table> | ||
| 644 | </fieldset> | ||
| 645 | </div> | ||
| 646 | |||
| 647 | <div style="float: right; width: 49%"> | ||
| 648 | <fieldset> | ||
| 649 | <legend>{#style_dlg.clip}</legend> | ||
| 650 | |||
| 651 | <table border="0"> | ||
| 652 | <tr> | ||
| 653 | <td> </td> | ||
| 654 | <td><input type="checkbox" id="positioning_clip_same" name="positioning_clip_same" class="checkbox" checked="checked" onClick="toggleSame(this,'positioning_clip');" /> <label for="positioning_clip_same">{#style_dlg.same}</label></td> | ||
| 655 | </tr> | ||
| 656 | <tr> | ||
| 657 | <td>{#style_dlg.top}</td> | ||
| 658 | <td> | ||
| 659 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 660 | <tr> | ||
| 661 | <td><input type="text" id="positioning_clip_top" name="positioning_clip_top" /></td> | ||
| 662 | <td> </td> | ||
| 663 | <td><select id="positioning_clip_top_measurement" name="positioning_clip_top_measurement"></select></td> | ||
| 664 | </tr> | ||
| 665 | </table> | ||
| 666 | </td> | ||
| 667 | </tr> | ||
| 668 | <tr> | ||
| 669 | <td>{#style_dlg.right}</td> | ||
| 670 | <td> | ||
| 671 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 672 | <tr> | ||
| 673 | <td><input type="text" id="positioning_clip_right" name="positioning_clip_right" disabled="disabled" /></td> | ||
| 674 | <td> </td> | ||
| 675 | <td><select id="positioning_clip_right_measurement" name="positioning_clip_right_measurement" disabled="disabled"></select></td> | ||
| 676 | </tr> | ||
| 677 | </table> | ||
| 678 | </td> | ||
| 679 | </tr> | ||
| 680 | <tr> | ||
| 681 | <td>{#style_dlg.bottom}</td> | ||
| 682 | <td> | ||
| 683 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 684 | <tr> | ||
| 685 | <td><input type="text" id="positioning_clip_bottom" name="positioning_clip_bottom" disabled="disabled" /></td> | ||
| 686 | <td> </td> | ||
| 687 | <td><select id="positioning_clip_bottom_measurement" name="positioning_clip_bottom_measurement" disabled="disabled"></select></td> | ||
| 688 | </tr> | ||
| 689 | </table> | ||
| 690 | </td> | ||
| 691 | </tr> | ||
| 692 | <tr> | ||
| 693 | <td>{#style_dlg.left}</td> | ||
| 694 | <td> | ||
| 695 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 696 | <tr> | ||
| 697 | <td><input type="text" id="positioning_clip_left" name="positioning_clip_left" disabled="disabled" /></td> | ||
| 698 | <td> </td> | ||
| 699 | <td><select id="positioning_clip_left_measurement" name="positioning_clip_left_measurement" disabled="disabled"></select></td> | ||
| 700 | </tr> | ||
| 701 | </table> | ||
| 702 | </td> | ||
| 703 | </tr> | ||
| 704 | </table> | ||
| 705 | </fieldset> | ||
| 706 | </div> | ||
| 707 | <br style="clear: both" /> | ||
| 708 | </div> | ||
| 709 | </div> | ||
| 710 | |||
| 711 | <div class="mceActionPanel"> | ||
| 712 | <div style="float: left"> | ||
| 713 | <div style="float: left"><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 714 | |||
| 715 | <div style="float: left"> <input type="button" class="button" id="apply" name="apply" value="{#style_dlg.apply}" onClick="applyAction();" /></div> | ||
| 716 | <br style="clear: both" /> | ||
| 717 | </div> | ||
| 718 | |||
| 719 | <div style="float: right"> | ||
| 720 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onClick="tinyMCEPopup.close();" /> | ||
| 721 | </div> | ||
| 722 | </div> | ||
| 723 | </form> | ||
| 724 | |||
| 725 | <div style="display: none"> | ||
| 726 | <div id="container"></div> | ||
| 727 | </div> | ||
| 728 | |||
| 729 | </body> | ||
| 730 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js b/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js deleted file mode 100644 index 7f1fe26..0000000 --- a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.EditorManager.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js deleted file mode 100644 index 0fa8d81..0000000 --- a/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,109 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 787 2008-04-10 11:40:57Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.TabFocusPlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | function tabCancel(ed, e) { | ||
| 14 | if (e.keyCode === 9) | ||
| 15 | return Event.cancel(e); | ||
| 16 | }; | ||
| 17 | |||
| 18 | function tabHandler(ed, e) { | ||
| 19 | var x, i, f, el, v; | ||
| 20 | |||
| 21 | function find(d) { | ||
| 22 | f = DOM.getParent(ed.id, 'form'); | ||
| 23 | el = f.elements; | ||
| 24 | |||
| 25 | if (f) { | ||
| 26 | each(el, function(e, i) { | ||
| 27 | if (e.id == ed.id) { | ||
| 28 | x = i; | ||
| 29 | return false; | ||
| 30 | } | ||
| 31 | }); | ||
| 32 | |||
| 33 | if (d > 0) { | ||
| 34 | for (i = x + 1; i < el.length; i++) { | ||
| 35 | if (el[i].type != 'hidden') | ||
| 36 | return el[i]; | ||
| 37 | } | ||
| 38 | } else { | ||
| 39 | for (i = x - 1; i >= 0; i--) { | ||
| 40 | if (el[i].type != 'hidden') | ||
| 41 | return el[i]; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | return null; | ||
| 47 | }; | ||
| 48 | |||
| 49 | if (e.keyCode === 9) { | ||
| 50 | v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); | ||
| 51 | |||
| 52 | if (v.length == 1) { | ||
| 53 | v[1] = v[0]; | ||
| 54 | v[0] = ':prev'; | ||
| 55 | } | ||
| 56 | |||
| 57 | // Find element to focus | ||
| 58 | if (e.shiftKey) { | ||
| 59 | if (v[0] == ':prev') | ||
| 60 | el = find(-1); | ||
| 61 | else | ||
| 62 | el = DOM.get(v[0]); | ||
| 63 | } else { | ||
| 64 | if (v[1] == ':next') | ||
| 65 | el = find(1); | ||
| 66 | else | ||
| 67 | el = DOM.get(v[1]); | ||
| 68 | } | ||
| 69 | |||
| 70 | if (el) { | ||
| 71 | if (ed = tinymce.EditorManager.get(el.id || el.name)) | ||
| 72 | ed.focus(); | ||
| 73 | else | ||
| 74 | window.setTimeout(function() {window.focus();el.focus();}, 10); | ||
| 75 | |||
| 76 | return Event.cancel(e); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | }; | ||
| 80 | |||
| 81 | ed.onKeyUp.add(tabCancel); | ||
| 82 | |||
| 83 | if (tinymce.isGecko) { | ||
| 84 | ed.onKeyPress.add(tabHandler); | ||
| 85 | ed.onKeyDown.add(tabCancel); | ||
| 86 | } else | ||
| 87 | ed.onKeyDown.add(tabHandler); | ||
| 88 | |||
| 89 | ed.onInit.add(function() { | ||
| 90 | each(DOM.select('a:first,a:last', ed.getContainer()), function(n) { | ||
| 91 | Event.add(n, 'focus', function() {ed.focus();}); | ||
| 92 | }); | ||
| 93 | }); | ||
| 94 | }, | ||
| 95 | |||
| 96 | getInfo : function() { | ||
| 97 | return { | ||
| 98 | longname : 'Tabfocus', | ||
| 99 | author : 'Moxiecode Systems AB', | ||
| 100 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 101 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', | ||
| 102 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 103 | }; | ||
| 104 | } | ||
| 105 | }); | ||
| 106 | |||
| 107 | // Register plugin | ||
| 108 | tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); | ||
| 109 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/cell.htm b/public/javascripts/tiny_mce/plugins/table/cell.htm deleted file mode 100644 index 1fabc8d..0000000 --- a/public/javascripts/tiny_mce/plugins/table/cell.htm +++ /dev/null | |||
| @@ -1,183 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.cell_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/cell.js"></script> | ||
| 10 | <link href="css/cell.css" rel="stylesheet" type="text/css" /> | ||
| 11 | </head> | ||
| 12 | <body id="tablecell" style="display: none"> | ||
| 13 | <form onsubmit="updateAction();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 17 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 18 | </ul> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div class="panel_wrapper"> | ||
| 22 | <div id="general_panel" class="panel current"> | ||
| 23 | <fieldset> | ||
| 24 | <legend>{#table_dlg.general_props}</legend> | ||
| 25 | |||
| 26 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 27 | <tr> | ||
| 28 | <td><label for="align">{#table_dlg.align}</label></td> | ||
| 29 | <td> | ||
| 30 | <select id="align" name="align" class="mceFocus"> | ||
| 31 | <option value="">{#not_set}</option> | ||
| 32 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 33 | <option value="left">{#table_dlg.align_left}</option> | ||
| 34 | <option value="right">{#table_dlg.align_right}</option> | ||
| 35 | </select> | ||
| 36 | </td> | ||
| 37 | |||
| 38 | <td><label for="celltype">{#table_dlg.cell_type}</label></td> | ||
| 39 | <td> | ||
| 40 | <select id="celltype" name="celltype"> | ||
| 41 | <option value="td">{#table_dlg.td}</option> | ||
| 42 | <option value="th">{#table_dlg.th}</option> | ||
| 43 | </select> | ||
| 44 | </td> | ||
| 45 | </tr> | ||
| 46 | |||
| 47 | <tr> | ||
| 48 | <td><label for="valign">{#table_dlg.valign}</label></td> | ||
| 49 | <td> | ||
| 50 | <select id="valign" name="valign"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="top">{#table_dlg.align_top}</option> | ||
| 53 | <option value="middle">{#table_dlg.align_middle}</option> | ||
| 54 | <option value="bottom">{#table_dlg.align_bottom}</option> | ||
| 55 | </select> | ||
| 56 | </td> | ||
| 57 | |||
| 58 | <td><label for="scope">{#table_dlg.scope}</label></td> | ||
| 59 | <td> | ||
| 60 | <select id="scope" name="scope"> | ||
| 61 | <option value="">{#not_set}</option> | ||
| 62 | <option value="col">{#table.col}</option> | ||
| 63 | <option value="row">{#table.row}</option> | ||
| 64 | <option value="rowgroup">{#table_dlg.rowgroup}</option> | ||
| 65 | <option value="colgroup">{#table_dlg.colgroup}</option> | ||
| 66 | </select> | ||
| 67 | </td> | ||
| 68 | |||
| 69 | </tr> | ||
| 70 | |||
| 71 | <tr> | ||
| 72 | <td><label for="width">{#table_dlg.width}</label></td> | ||
| 73 | <td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 74 | |||
| 75 | <td><label for="height">{#table_dlg.height}</label></td> | ||
| 76 | <td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 77 | </tr> | ||
| 78 | |||
| 79 | <tr id="styleSelectRow"> | ||
| 80 | <td><label for="class">{#class_name}</label></td> | ||
| 81 | <td colspan="3"> | ||
| 82 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 83 | <option value="" selected="selected">{#not_set}</option> | ||
| 84 | </select> | ||
| 85 | </td> | ||
| 86 | </tr> | ||
| 87 | </table> | ||
| 88 | </fieldset> | ||
| 89 | </div> | ||
| 90 | |||
| 91 | <div id="advanced_panel" class="panel"> | ||
| 92 | <fieldset> | ||
| 93 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 94 | |||
| 95 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 96 | <tr> | ||
| 97 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 98 | <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 103 | <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 108 | <td> | ||
| 109 | <select id="dir" name="dir" style="width: 200px"> | ||
| 110 | <option value="">{#not_set}</option> | ||
| 111 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 112 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 113 | </select> | ||
| 114 | </td> | ||
| 115 | </tr> | ||
| 116 | |||
| 117 | <tr> | ||
| 118 | <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> | ||
| 119 | <td> | ||
| 120 | <input id="lang" name="lang" type="text" value="" style="width: 200px" /> | ||
| 121 | </td> | ||
| 122 | </tr> | ||
| 123 | |||
| 124 | <tr> | ||
| 125 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 126 | <td> | ||
| 127 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 128 | <tr> | ||
| 129 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td> | ||
| 130 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 131 | </tr> | ||
| 132 | </table> | ||
| 133 | </td> | ||
| 134 | </tr> | ||
| 135 | |||
| 136 | <tr> | ||
| 137 | <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> | ||
| 138 | <td> | ||
| 139 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 140 | <tr> | ||
| 141 | <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td> | ||
| 142 | <td id="bordercolor_pickcontainer"> </td> | ||
| 143 | </tr> | ||
| 144 | </table> | ||
| 145 | </td> | ||
| 146 | </tr> | ||
| 147 | |||
| 148 | <tr> | ||
| 149 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 150 | <td> | ||
| 151 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 152 | <tr> | ||
| 153 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 154 | <td id="bgcolor_pickcontainer"> </td> | ||
| 155 | </tr> | ||
| 156 | </table> | ||
| 157 | </td> | ||
| 158 | </tr> | ||
| 159 | </table> | ||
| 160 | </fieldset> | ||
| 161 | </div> | ||
| 162 | </div> | ||
| 163 | |||
| 164 | <div class="mceActionPanel"> | ||
| 165 | <div> | ||
| 166 | <select id="action" name="action"> | ||
| 167 | <option value="cell">{#table_dlg.cell_cell}</option> | ||
| 168 | <option value="row">{#table_dlg.cell_row}</option> | ||
| 169 | <option value="all">{#table_dlg.cell_all}</option> | ||
| 170 | </select> | ||
| 171 | </div> | ||
| 172 | |||
| 173 | <div style="float: left"> | ||
| 174 | <div><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 175 | </div> | ||
| 176 | |||
| 177 | <div style="float: right"> | ||
| 178 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 179 | </div> | ||
| 180 | </div> | ||
| 181 | </form> | ||
| 182 | </body> | ||
| 183 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/cell.css b/public/javascripts/tiny_mce/plugins/table/css/cell.css deleted file mode 100644 index a067ecd..0000000 --- a/public/javascripts/tiny_mce/plugins/table/css/cell.css +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | /* CSS file for cell dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 200px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #action { | ||
| 12 | margin-bottom: 3px; | ||
| 13 | } | ||
| 14 | |||
| 15 | #class { | ||
| 16 | width: 150px; | ||
| 17 | } \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/row.css b/public/javascripts/tiny_mce/plugins/table/css/row.css deleted file mode 100644 index 1f7755d..0000000 --- a/public/javascripts/tiny_mce/plugins/table/css/row.css +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /* CSS file for row dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 200px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #action { | ||
| 12 | margin-bottom: 3px; | ||
| 13 | } | ||
| 14 | |||
| 15 | #rowtype,#align,#valign,#class,#height { | ||
| 16 | width: 150px; | ||
| 17 | } | ||
| 18 | |||
| 19 | #height { | ||
| 20 | width: 50px; | ||
| 21 | } | ||
| 22 | |||
| 23 | .col2 { | ||
| 24 | padding-left: 20px; | ||
| 25 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/css/table.css b/public/javascripts/tiny_mce/plugins/table/css/table.css deleted file mode 100644 index d11c3f6..0000000 --- a/public/javascripts/tiny_mce/plugins/table/css/table.css +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | /* CSS file for table dialog in the table plugin */ | ||
| 2 | |||
| 3 | .panel_wrapper div.current { | ||
| 4 | height: 245px; | ||
| 5 | } | ||
| 6 | |||
| 7 | .advfield { | ||
| 8 | width: 200px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #class { | ||
| 12 | width: 150px; | ||
| 13 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin.js deleted file mode 100644 index 806ef28..0000000 --- a/public/javascripts/tiny_mce/plugins/table/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var b=tinymce.each;function a(d,e){var f=e.ownerDocument,c=f.createRange(),g;c.setStartBefore(e);c.setEnd(d.endContainer,d.endOffset);g=f.createElement("body");g.appendChild(c.cloneContents());return g.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}tinymce.create("tinymce.plugins.TablePlugin",{init:function(c,d){var e=this;e.editor=c;e.url=d;b([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(f){c.addButton(f[0],{title:f[1],cmd:f[2],ui:f[3]})});if(c.getParam("inline_styles")){c.onPreProcess.add(function(f,h){var g=f.dom;b(g.select("table",h.node),function(j){var i;if(i=g.getAttrib(j,"width")){g.setStyle(j,"width",i);g.setAttrib(j,"width")}if(i=g.getAttrib(j,"height")){g.setStyle(j,"height",i);g.setAttrib(j,"height")}})})}c.onInit.add(function(){if(!tinymce.isIE&&c.getParam("forced_root_block")){function f(){var g=c.getBody().lastChild;if(g&&g.nodeName=="TABLE"){c.dom.add(c.getBody(),"p",null,'<br mce_bogus="1" />')}}if(tinymce.isGecko){c.onKeyDown.add(function(h,j){var g,i,k=h.dom;if(j.keyCode==37||j.keyCode==38){g=h.selection.getRng();i=k.getParent(g.startContainer,"table");if(i&&h.getBody().firstChild==i){if(a(g,i)){g=k.createRng();g.setStartBefore(i);g.setEndBefore(i);h.selection.setRng(g);j.preventDefault()}}}})}c.onKeyUp.add(f);c.onSetContent.add(f);c.onVisualAid.add(f);c.onPreProcess.add(function(g,i){var h=i.node.lastChild;if(h&&h.childNodes.length==1&&h.firstChild.nodeName=="BR"){g.dom.remove(h)}});f()}if(c&&c.plugins.contextmenu){c.plugins.contextmenu.onContextMenu.add(function(i,g,k){var l,j=c.selection,h=j.getNode()||c.getBody();if(c.dom.getParent(k,"td")||c.dom.getParent(k,"th")){g.removeAll();if(h.nodeName=="A"&&!c.dom.getAttrib(h,"name")){g.add({title:"advanced.link_desc",icon:"link",cmd:c.plugins.advlink?"mceAdvLink":"mceLink",ui:true});g.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});g.addSeparator()}if(h.nodeName=="IMG"&&h.className.indexOf("mceItem")==-1){g.add({title:"advanced.image_desc",icon:"image",cmd:c.plugins.advimage?"mceAdvImage":"mceImage",ui:true});g.addSeparator()}g.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true,value:{action:"insert"}});g.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable",ui:true});g.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete",ui:true});g.addSeparator();l=g.addMenu({title:"table.cell"});l.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps",ui:true});l.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells",ui:true});l.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells",ui:true});l=g.addMenu({title:"table.row"});l.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps",ui:true});l.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});l.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});l.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});l.addSeparator();l.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});l.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});l.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"});l.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"});l=g.addMenu({title:"table.col"});l.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});l.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});l.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{g.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",ui:true})}})}});c.onKeyDown.add(function(f,g){if(g.keyCode==9&&f.dom.getParent(f.selection.getNode(),"TABLE")){if(!tinymce.isGecko&&!tinymce.isOpera){tinyMCE.execInstanceCommand(f.editorId,"mceTableMoveToNextRow",true);return tinymce.dom.Event.cancel(g)}f.undoManager.add()}});if(!tinymce.isIE){if(c.getParam("table_selection",true)){c.onClick.add(function(f,g){g=g.target;if(g.nodeName==="TABLE"){f.selection.select(g)}})}}c.onNodeChange.add(function(g,f,i){var h=g.dom.getParent(i,"td,th,caption");f.setActive("table",i.nodeName==="TABLE"||!!h);if(h&&h.nodeName==="CAPTION"){h=null}f.setDisabled("delete_table",!h);f.setDisabled("delete_col",!h);f.setDisabled("delete_table",!h);f.setDisabled("delete_row",!h);f.setDisabled("col_after",!h);f.setDisabled("col_before",!h);f.setDisabled("row_after",!h);f.setDisabled("row_before",!h);f.setDisabled("row_props",!h);f.setDisabled("cell_props",!h);f.setDisabled("split_cells",!h||(parseInt(g.dom.getAttrib(h,"colspan","1"))<2&&parseInt(g.dom.getAttrib(h,"rowspan","1"))<2));f.setDisabled("merge_cells",!h)});if(!tinymce.isIE){c.onBeforeSetContent.add(function(f,g){if(g.initial){g.content=g.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g,tinymce.isOpera?"<$1$2> </$1>":'<$1$2><br mce_bogus="1" /></$1>')}})}},execCommand:function(f,e,g){var d=this.editor,c;switch(f){case"mceTableMoveToNextRow":case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":d.execCommand("mceBeginUndoLevel");this._doExecCommand(f,e,g);d.execCommand("mceEndUndoLevel");return true}return false},getInfo:function(){return{longname:"Tables",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_doExecCommand:function(s,aa,af){var W=this.editor,av=W,h=this.url;var o=W.selection.getNode();var X=W.dom.getParent(o,"tr");var ar=W.dom.getParent(o,"td,th");var G=W.dom.getParent(o,"table");var l=W.contentWindow.document;var aw=G?G.getAttribute("border"):"";if(X&&ar==null){ar=X.cells[0]}function aq(y,x){for(var ay=0;ay<y.length;ay++){if(y[ay].length>0&&aq(y[ay],x)){return true}if(y[ay]==x){return true}}return false}function ak(x,i){var y;ae=f(G);x=x||0;i=i||0;x=Math.max(p.cellindex+x,0);i=Math.max(p.rowindex+i,0);W.execCommand("mceRepaint");y=e(ae,i,x);if(y){W.selection.select(y.firstChild||y);W.selection.collapse(1)}}function ai(){var i=l.createElement("td");if(!tinymce.isIE){i.innerHTML='<br mce_bogus="1"/>'}}function k(y){var x=W.dom.getAttrib(y,"colspan");var i=W.dom.getAttrib(y,"rowspan");x=x==""?1:parseInt(x);i=i==""?1:parseInt(i);return{colspan:x,rowspan:i}}function am(ay,aA){var i,az;for(az=0;az<ay.length;az++){for(i=0;i<ay[az].length;i++){if(ay[az][i]==aA){return{cellindex:i,rowindex:az}}}}return null}function e(x,y,i){if(x[y]&&x[y][i]){return x[y][i]}return null}function B(aD,ay){var aA=[],y=0,aB,az,ay,aC;for(aB=0;aB<aD.rows.length;aB++){for(az=0;az<aD.rows[aB].cells.length;az++,y++){aA[y]=aD.rows[aB].cells[az]}}for(aB=0;aB<aA.length;aB++){if(aA[aB]==ay){if(aC=aA[aB+1]){return aC}}}}function f(aF){var i=[],aG=aF.rows,aD,aC,az,aA,aE,ay,aB;for(aC=0;aC<aG.length;aC++){for(aD=0;aD<aG[aC].cells.length;aD++){az=aG[aC].cells[aD];aA=k(az);for(aE=aD;i[aC]&&i[aC][aE];aE++){}for(aB=aC;aB<aC+aA.rowspan;aB++){if(!i[aB]){i[aB]=[]}for(ay=aE;ay<aE+aA.colspan;ay++){i[aB][ay]=az}}}}return i}function n(aH,aE,az,ay){var y=f(aH),aG=am(y,az);var aI,aD;if(ay.cells.length!=aE.childNodes.length){aI=aE.childNodes;aD=null;for(var aF=0;az=e(y,aG.rowindex,aF);aF++){var aB=true;var aC=k(az);if(aq(aI,az)){ay.childNodes[aF]._delete=true}else{if((aD==null||az!=aD)&&aC.colspan>1){for(var aA=aF;aA<aF+az.colSpan;aA++){ay.childNodes[aA]._delete=true}}}if((aD==null||az!=aD)&&aC.rowspan>1){az.rowSpan=aC.rowspan+1}aD=az}C(G)}}function P(x,i){while((x=x.previousSibling)!=null){if(x.nodeName==i){return x}}return null}function ag(ay,az){var x=az.split(",");while((ay=ay.nextSibling)!=null){for(var y=0;y<x.length;y++){if(ay.nodeName.toLowerCase()==x[y].toLowerCase()){return ay}}}return null}function C(ay){if(ay.rows==0){return}var y=ay.rows[0];do{var x=ag(y,"TR");if(y._delete){y.parentNode.removeChild(y);continue}var az=y.cells[0];if(az.cells>1){do{var i=ag(az,"TD,TH");if(az._delete){az.parentNode.removeChild(az)}}while((az=i)!=null)}}while((y=x)!=null)}function q(ay,aB,aA){ay.rowSpan=1;var x=ag(aB,"TR");for(var az=1;az<aA&&x;az++){var y=l.createElement("td");if(!tinymce.isIE){y.innerHTML='<br mce_bogus="1"/>'}if(tinymce.isIE){x.insertBefore(y,x.cells(ay.cellIndex))}else{x.insertBefore(y,x.cells[ay.cellIndex])}x=ag(x,"TR")}}function T(aG,aI,aC){var y=f(aI);var ay=aC.cloneNode(false);var aH=am(y,aC.cells[0]);var aD=null;var aB=W.dom.getAttrib(aI,"border");var aA=null;for(var aF=0;aA=e(y,aH.rowindex,aF);aF++){var aE=null;if(aD!=aA){for(var az=0;az<aC.cells.length;az++){if(aA==aC.cells[az]){aE=aA.cloneNode(true);break}}}if(aE==null){aE=aG.createElement("td");if(!tinymce.isIE){aE.innerHTML='<br mce_bogus="1"/>'}}aE.colSpan=1;aE.rowSpan=1;ay.appendChild(aE);aD=aA}return ay}switch(s){case"mceTableMoveToNextRow":var M=B(G,ar);if(!M){W.execCommand("mceTableInsertRowAfter",ar);M=B(G,ar)}W.selection.select(M);W.selection.collapse(true);return true;case"mceTableRowProps":if(X==null){return true}if(aa){W.windowManager.open({url:h+"/row.htm",width:400+parseInt(W.getLang("table.rowprops_delta_width",0)),height:295+parseInt(W.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:h})}return true;case"mceTableCellProps":if(ar==null){return true}if(aa){W.windowManager.open({url:h+"/cell.htm",width:400+parseInt(W.getLang("table.cellprops_delta_width",0)),height:295+parseInt(W.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:h})}return true;case"mceInsertTable":if(aa){W.windowManager.open({url:h+"/table.htm",width:400+parseInt(W.getLang("table.table_delta_width",0)),height:320+parseInt(W.getLang("table.table_delta_height",0)),inline:1},{plugin_url:h,action:af?af.action:0})}return true;case"mceTableDelete":var H=W.dom.getParent(W.selection.getNode(),"table");if(H){H.parentNode.removeChild(H);W.execCommand("mceRepaint")}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!G){return true}if(X&&G!=X.parentNode){G=X.parentNode}if(G&&X){switch(s){case"mceTableCutRow":if(!X||!ar){return true}W.tableRowClipboard=T(l,G,X);W.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!X||!ar){return true}W.tableRowClipboard=T(l,G,X);break;case"mceTablePasteRowBefore":if(!X||!ar){return true}var w=W.tableRowClipboard.cloneNode(true);var j=P(X,"TR");if(j!=null){n(G,j,j.cells[0],w)}X.parentNode.insertBefore(w,X);break;case"mceTablePasteRowAfter":if(!X||!ar){return true}var Y=ag(X,"TR");var w=W.tableRowClipboard.cloneNode(true);n(G,X,ar,w);if(Y==null){X.parentNode.appendChild(w)}else{Y.parentNode.insertBefore(w,Y)}break;case"mceTableInsertRowBefore":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var w=l.createElement("tr");var v=null;p.rowindex--;if(p.rowindex<0){p.rowindex=0}for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan==1){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.colSpan=ar.colSpan;w.appendChild(K)}else{ar.rowSpan=F.rowspan+1}v=ar}}X.parentNode.insertBefore(w,X);ak(0,1);break;case"mceTableInsertRowAfter":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var w=l.createElement("tr");var v=null;for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan==1){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.colSpan=ar.colSpan;w.appendChild(K)}else{ar.rowSpan=F.rowspan+1}v=ar}}if(w.hasChildNodes()){var Y=ag(X,"TR");if(Y){Y.parentNode.insertBefore(w,Y)}else{G.appendChild(w)}}ak(0,1);break;case"mceTableDeleteRow":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);if(ae.length==1&&G.nodeName=="TBODY"){W.dom.remove(W.dom.getParent(G,"table"));return true}var E=X.cells;var Y=ag(X,"TR");for(var ad=0;ad<E.length;ad++){if(E[ad].rowSpan>1){var K=E[ad].cloneNode(true);var F=k(E[ad]);K.rowSpan=F.rowspan-1;var al=Y.cells[ad];if(al==null){Y.appendChild(K)}else{Y.insertBefore(K,al)}}}var v=null;for(var ad=0;ar=e(ae,p.rowindex,ad);ad++){if(ar!=v){var F=k(ar);if(F.rowspan>1){ar.rowSpan=F.rowspan-1}else{X=ar.parentNode;if(X.parentNode){X._delete=true}}v=ar}}C(G);ak(0,-1);break;case"mceTableInsertColBefore":if(!X||!ar){return true}var ae=f(W.dom.getParent(G,"table"));var p=am(ae,ar);var v=null;for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan==1){var K=l.createElement(ar.nodeName);if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.rowSpan=ar.rowSpan;ar.parentNode.insertBefore(K,ar)}else{ar.colSpan++}v=ar}}ak();break;case"mceTableInsertColAfter":if(!X||!ar){return true}var ae=f(W.dom.getParent(G,"table"));var p=am(ae,ar);var v=null;for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan==1){var K=l.createElement(ar.nodeName);if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}K.rowSpan=ar.rowSpan;var al=ag(ar,"TD,TH");if(al==null){ar.parentNode.appendChild(K)}else{al.parentNode.insertBefore(K,al)}}else{ar.colSpan++}v=ar}}ak(1);break;case"mceTableDeleteCol":if(!X||!ar){return true}var ae=f(G);var p=am(ae,ar);var v=null;if((ae.length>1&&ae[0].length<=1)&&G.nodeName=="TBODY"){W.dom.remove(W.dom.getParent(G,"table"));return true}for(var ab=0;ar=e(ae,ab,p.cellindex);ab++){if(ar!=v){var F=k(ar);if(F.colspan>1){ar.colSpan=F.colspan-1}else{if(ar.parentNode){ar.parentNode.removeChild(ar)}}v=ar}}ak(-1);break;case"mceTableSplitCells":if(!X||!ar){return true}var m=k(ar);var D=m.colspan;var I=m.rowspan;if(D>1||I>1){ar.colSpan=1;for(var an=1;an<D;an++){var K=l.createElement("td");if(!tinymce.isIE){K.innerHTML='<br mce_bogus="1"/>'}X.insertBefore(K,ag(ar,"TD,TH"));if(I>1){q(K,X,I)}}q(ar,X,I)}G=W.dom.getParent(W.selection.getNode(),"table");break;case"mceTableMergeCells":var ap=[];var S=W.selection.getSel();var ae=f(G);if(tinymce.isIE||S.rangeCount==1){if(aa){var u=k(ar);W.windowManager.open({url:h+"/merge_cells.htm",width:240+parseInt(W.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(W.getLang("table.merge_cells_delta_height",0)),inline:1},{action:"update",numcols:u.colspan,numrows:u.rowspan,plugin_url:h});return true}else{var V=parseInt(af.numrows);var d=parseInt(af.numcols);var p=am(ae,ar);if((""+V)=="NaN"){V=1}if((""+d)=="NaN"){d=1}var c=G.rows;for(var ab=p.rowindex;ab<ae.length;ab++){var ah=[];for(var ad=p.cellindex;ad<ae[ab].length;ad++){var g=e(ae,ab,ad);if(g&&!aq(ap,g)&&!aq(ah,g)){var O=am(ae,g);if(O.cellindex<p.cellindex+d&&O.rowindex<p.rowindex+V){ah[ah.length]=g}}}if(ah.length>0){ap[ap.length]=ah}var g=e(ae,p.rowindex,p.cellindex);b(av.dom.select("br",g),function(y,x){if(x>0&&av.dom.getAttrib("mce_bogus")){av.dom.remove(y)}})}}}else{var E=[];var S=W.selection.getSel();var Z=null;var ao=null;var A=-1,ax=-1,z,au;if(S.rangeCount<2){return true}for(var an=0;an<S.rangeCount;an++){var aj=S.getRangeAt(an);var ar=aj.startContainer.childNodes[aj.startOffset];if(!ar){break}if(ar.nodeName=="TD"||ar.nodeName=="TH"){E[E.length]=ar}}var c=G.rows;for(var ab=0;ab<c.length;ab++){var ah=[];for(var ad=0;ad<c[ab].cells.length;ad++){var g=c[ab].cells[ad];for(var an=0;an<E.length;an++){if(g==E[an]){ah[ah.length]=g}}}if(ah.length>0){ap[ap.length]=ah}}var ao=[];var Z=null;for(var ab=0;ab<ae.length;ab++){for(var ad=0;ad<ae[ab].length;ad++){ae[ab][ad]._selected=false;for(var an=0;an<E.length;an++){if(ae[ab][ad]==E[an]){if(A==-1){A=ad;ax=ab}z=ad;au=ab;ae[ab][ad]._selected=true}}}}for(var ab=ax;ab<=au;ab++){for(var ad=A;ad<=z;ad++){if(!ae[ab][ad]._selected){alert("Invalid selection for merge.");return true}}}}var t=1,r=1;var U=-1;for(var ab=0;ab<ap.length;ab++){var J=0;for(var ad=0;ad<ap[ab].length;ad++){var F=k(ap[ab][ad]);J+=F.colspan;if(U!=-1&&F.rowspan!=U){alert("Invalid selection for merge.");return true}U=F.rowspan}if(J>r){r=J}U=-1}var R=-1;for(var ad=0;ad<ap[0].length;ad++){var N=0;for(var ab=0;ab<ap.length;ab++){var F=k(ap[ab][ad]);N+=F.rowspan;if(R!=-1&&F.colspan!=R){alert("Invalid selection for merge.");return true}R=F.colspan}if(N>t){t=N}R=-1}ar=ap[0][0];ar.rowSpan=t;ar.colSpan=r;for(var ab=0;ab<ap.length;ab++){for(var ad=0;ad<ap[ab].length;ad++){var Q=ap[ab][ad].innerHTML;var L=Q.replace(/[ \t\r\n]/g,"");if(L!="<br/>"&&L!="<br>"&&L!='<br mce_bogus="1"/>'&&(ad+ab>0)){ar.innerHTML+=Q}if(ap[ab][ad]!=ar&&!ap[ab][ad]._deleted){var p=am(ae,ap[ab][ad]);var at=ap[ab][ad].parentNode;at.removeChild(ap[ab][ad]);ap[ab][ad]._deleted=true;if(!at.hasChildNodes()){at.parentNode.removeChild(at);var ac=null;for(var ad=0;cellElm=e(ae,p.rowindex,ad);ad++){if(cellElm!=ac&&cellElm.rowSpan>1){cellElm.rowSpan--}ac=cellElm}if(ar.rowSpan>1){ar.rowSpan--}}}}}b(av.dom.select("br",ar),function(y,x){if(x>0&&av.dom.getAttrib(y,"mce_bogus")){av.dom.remove(y)}});break}G=W.dom.getParent(W.selection.getNode(),"table");W.addVisual(G);W.nodeChanged()}return true}return false}});tinymce.PluginManager.add("table",tinymce.plugins.TablePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js deleted file mode 100644 index 87b1055..0000000 --- a/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,1202 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 1209 2009-08-20 12:35:10Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | // Checks if the selection/caret is at the start of the specified block element | ||
| 12 | function isAtStart(rng, par) { | ||
| 13 | var doc = par.ownerDocument, rng2 = doc.createRange(), elm; | ||
| 14 | |||
| 15 | rng2.setStartBefore(par); | ||
| 16 | rng2.setEnd(rng.endContainer, rng.endOffset); | ||
| 17 | |||
| 18 | elm = doc.createElement('body'); | ||
| 19 | elm.appendChild(rng2.cloneContents()); | ||
| 20 | |||
| 21 | // Check for text characters of other elements that should be treated as content | ||
| 22 | return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; | ||
| 23 | }; | ||
| 24 | |||
| 25 | tinymce.create('tinymce.plugins.TablePlugin', { | ||
| 26 | init : function(ed, url) { | ||
| 27 | var t = this; | ||
| 28 | |||
| 29 | t.editor = ed; | ||
| 30 | t.url = url; | ||
| 31 | |||
| 32 | // Register buttons | ||
| 33 | each([ | ||
| 34 | ['table', 'table.desc', 'mceInsertTable', true], | ||
| 35 | ['delete_table', 'table.del', 'mceTableDelete'], | ||
| 36 | ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], | ||
| 37 | ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], | ||
| 38 | ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], | ||
| 39 | ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], | ||
| 40 | ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], | ||
| 41 | ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], | ||
| 42 | ['row_props', 'table.row_desc', 'mceTableRowProps', true], | ||
| 43 | ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], | ||
| 44 | ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], | ||
| 45 | ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] | ||
| 46 | ], function(c) { | ||
| 47 | ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); | ||
| 48 | }); | ||
| 49 | |||
| 50 | if (ed.getParam('inline_styles')) { | ||
| 51 | // Force move of attribs to styles in strict mode | ||
| 52 | ed.onPreProcess.add(function(ed, o) { | ||
| 53 | var dom = ed.dom; | ||
| 54 | |||
| 55 | each(dom.select('table', o.node), function(n) { | ||
| 56 | var v; | ||
| 57 | |||
| 58 | if (v = dom.getAttrib(n, 'width')) { | ||
| 59 | dom.setStyle(n, 'width', v); | ||
| 60 | dom.setAttrib(n, 'width'); | ||
| 61 | } | ||
| 62 | |||
| 63 | if (v = dom.getAttrib(n, 'height')) { | ||
| 64 | dom.setStyle(n, 'height', v); | ||
| 65 | dom.setAttrib(n, 'height'); | ||
| 66 | } | ||
| 67 | }); | ||
| 68 | }); | ||
| 69 | } | ||
| 70 | |||
| 71 | ed.onInit.add(function() { | ||
| 72 | // Fixes an issue on Gecko where it's impossible to place the caret behind a table | ||
| 73 | // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled | ||
| 74 | if (!tinymce.isIE && ed.getParam('forced_root_block')) { | ||
| 75 | function fixTableCaretPos() { | ||
| 76 | var last = ed.getBody().lastChild; | ||
| 77 | |||
| 78 | if (last && last.nodeName == 'TABLE') | ||
| 79 | ed.dom.add(ed.getBody(), 'p', null, '<br mce_bogus="1" />'); | ||
| 80 | }; | ||
| 81 | |||
| 82 | // Fixes an bug where it's impossible to place the caret before a table in Gecko | ||
| 83 | // this fix solves it by detecting when the caret is at the beginning of such a table | ||
| 84 | // and then manually moves the caret infront of the table | ||
| 85 | if (tinymce.isGecko) { | ||
| 86 | ed.onKeyDown.add(function(ed, e) { | ||
| 87 | var rng, table, dom = ed.dom; | ||
| 88 | |||
| 89 | // On gecko it's not possible to place the caret before a table | ||
| 90 | if (e.keyCode == 37 || e.keyCode == 38) { | ||
| 91 | rng = ed.selection.getRng(); | ||
| 92 | table = dom.getParent(rng.startContainer, 'table'); | ||
| 93 | |||
| 94 | if (table && ed.getBody().firstChild == table) { | ||
| 95 | if (isAtStart(rng, table)) { | ||
| 96 | rng = dom.createRng(); | ||
| 97 | |||
| 98 | rng.setStartBefore(table); | ||
| 99 | rng.setEndBefore(table); | ||
| 100 | |||
| 101 | ed.selection.setRng(rng); | ||
| 102 | |||
| 103 | e.preventDefault(); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | } | ||
| 107 | }); | ||
| 108 | } | ||
| 109 | |||
| 110 | ed.onKeyUp.add(fixTableCaretPos); | ||
| 111 | ed.onSetContent.add(fixTableCaretPos); | ||
| 112 | ed.onVisualAid.add(fixTableCaretPos); | ||
| 113 | |||
| 114 | ed.onPreProcess.add(function(ed, o) { | ||
| 115 | var last = o.node.lastChild; | ||
| 116 | |||
| 117 | if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') | ||
| 118 | ed.dom.remove(last); | ||
| 119 | }); | ||
| 120 | |||
| 121 | fixTableCaretPos(); | ||
| 122 | } | ||
| 123 | |||
| 124 | if (ed && ed.plugins.contextmenu) { | ||
| 125 | ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { | ||
| 126 | var sm, se = ed.selection, el = se.getNode() || ed.getBody(); | ||
| 127 | |||
| 128 | if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th')) { | ||
| 129 | m.removeAll(); | ||
| 130 | |||
| 131 | if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { | ||
| 132 | m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); | ||
| 133 | m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); | ||
| 134 | m.addSeparator(); | ||
| 135 | } | ||
| 136 | |||
| 137 | if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { | ||
| 138 | m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); | ||
| 139 | m.addSeparator(); | ||
| 140 | } | ||
| 141 | |||
| 142 | m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true, value : {action : 'insert'}}); | ||
| 143 | m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable', ui : true}); | ||
| 144 | m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete', ui : true}); | ||
| 145 | m.addSeparator(); | ||
| 146 | |||
| 147 | // Cell menu | ||
| 148 | sm = m.addMenu({title : 'table.cell'}); | ||
| 149 | sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps', ui : true}); | ||
| 150 | sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells', ui : true}); | ||
| 151 | sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells', ui : true}); | ||
| 152 | |||
| 153 | // Row menu | ||
| 154 | sm = m.addMenu({title : 'table.row'}); | ||
| 155 | sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps', ui : true}); | ||
| 156 | sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); | ||
| 157 | sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); | ||
| 158 | sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); | ||
| 159 | sm.addSeparator(); | ||
| 160 | sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); | ||
| 161 | sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); | ||
| 162 | sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}); | ||
| 163 | sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}); | ||
| 164 | |||
| 165 | // Column menu | ||
| 166 | sm = m.addMenu({title : 'table.col'}); | ||
| 167 | sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); | ||
| 168 | sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); | ||
| 169 | sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); | ||
| 170 | } else | ||
| 171 | m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', ui : true}); | ||
| 172 | }); | ||
| 173 | } | ||
| 174 | }); | ||
| 175 | |||
| 176 | // Add undo level when new rows are created using the tab key | ||
| 177 | ed.onKeyDown.add(function(ed, e) { | ||
| 178 | if (e.keyCode == 9 && ed.dom.getParent(ed.selection.getNode(), 'TABLE')) { | ||
| 179 | if (!tinymce.isGecko && !tinymce.isOpera) { | ||
| 180 | tinyMCE.execInstanceCommand(ed.editorId, "mceTableMoveToNextRow", true); | ||
| 181 | return tinymce.dom.Event.cancel(e); | ||
| 182 | } | ||
| 183 | |||
| 184 | ed.undoManager.add(); | ||
| 185 | } | ||
| 186 | }); | ||
| 187 | |||
| 188 | // Select whole table is a table border is clicked | ||
| 189 | if (!tinymce.isIE) { | ||
| 190 | if (ed.getParam('table_selection', true)) { | ||
| 191 | ed.onClick.add(function(ed, e) { | ||
| 192 | e = e.target; | ||
| 193 | |||
| 194 | if (e.nodeName === 'TABLE') | ||
| 195 | ed.selection.select(e); | ||
| 196 | }); | ||
| 197 | } | ||
| 198 | } | ||
| 199 | |||
| 200 | ed.onNodeChange.add(function(ed, cm, n) { | ||
| 201 | var p = ed.dom.getParent(n, 'td,th,caption'); | ||
| 202 | |||
| 203 | cm.setActive('table', n.nodeName === 'TABLE' || !!p); | ||
| 204 | if (p && p.nodeName === 'CAPTION') | ||
| 205 | p = null; | ||
| 206 | |||
| 207 | cm.setDisabled('delete_table', !p); | ||
| 208 | cm.setDisabled('delete_col', !p); | ||
| 209 | cm.setDisabled('delete_table', !p); | ||
| 210 | cm.setDisabled('delete_row', !p); | ||
| 211 | cm.setDisabled('col_after', !p); | ||
| 212 | cm.setDisabled('col_before', !p); | ||
| 213 | cm.setDisabled('row_after', !p); | ||
| 214 | cm.setDisabled('row_before', !p); | ||
| 215 | cm.setDisabled('row_props', !p); | ||
| 216 | cm.setDisabled('cell_props', !p); | ||
| 217 | cm.setDisabled('split_cells', !p || (parseInt(ed.dom.getAttrib(p, 'colspan', '1')) < 2 && parseInt(ed.dom.getAttrib(p, 'rowspan', '1')) < 2)); | ||
| 218 | cm.setDisabled('merge_cells', !p); | ||
| 219 | }); | ||
| 220 | |||
| 221 | // Padd empty table cells | ||
| 222 | if (!tinymce.isIE) { | ||
| 223 | ed.onBeforeSetContent.add(function(ed, o) { | ||
| 224 | if (o.initial) | ||
| 225 | o.content = o.content.replace(/<(td|th)([^>]+|)>\s*<\/(td|th)>/g, tinymce.isOpera ? '<$1$2> </$1>' : '<$1$2><br mce_bogus="1" /></$1>'); | ||
| 226 | }); | ||
| 227 | } | ||
| 228 | }, | ||
| 229 | |||
| 230 | execCommand : function(cmd, ui, val) { | ||
| 231 | var ed = this.editor, b; | ||
| 232 | |||
| 233 | // Is table command | ||
| 234 | switch (cmd) { | ||
| 235 | case "mceTableMoveToNextRow": | ||
| 236 | case "mceInsertTable": | ||
| 237 | case "mceTableRowProps": | ||
| 238 | case "mceTableCellProps": | ||
| 239 | case "mceTableSplitCells": | ||
| 240 | case "mceTableMergeCells": | ||
| 241 | case "mceTableInsertRowBefore": | ||
| 242 | case "mceTableInsertRowAfter": | ||
| 243 | case "mceTableDeleteRow": | ||
| 244 | case "mceTableInsertColBefore": | ||
| 245 | case "mceTableInsertColAfter": | ||
| 246 | case "mceTableDeleteCol": | ||
| 247 | case "mceTableCutRow": | ||
| 248 | case "mceTableCopyRow": | ||
| 249 | case "mceTablePasteRowBefore": | ||
| 250 | case "mceTablePasteRowAfter": | ||
| 251 | case "mceTableDelete": | ||
| 252 | ed.execCommand('mceBeginUndoLevel'); | ||
| 253 | this._doExecCommand(cmd, ui, val); | ||
| 254 | ed.execCommand('mceEndUndoLevel'); | ||
| 255 | |||
| 256 | return true; | ||
| 257 | } | ||
| 258 | |||
| 259 | // Pass to next handler in chain | ||
| 260 | return false; | ||
| 261 | }, | ||
| 262 | |||
| 263 | getInfo : function() { | ||
| 264 | return { | ||
| 265 | longname : 'Tables', | ||
| 266 | author : 'Moxiecode Systems AB', | ||
| 267 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 268 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/table', | ||
| 269 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 270 | }; | ||
| 271 | }, | ||
| 272 | |||
| 273 | // Private plugin internal methods | ||
| 274 | |||
| 275 | /** | ||
| 276 | * Executes the table commands. | ||
| 277 | */ | ||
| 278 | _doExecCommand : function(command, user_interface, value) { | ||
| 279 | var inst = this.editor, ed = inst, url = this.url; | ||
| 280 | var focusElm = inst.selection.getNode(); | ||
| 281 | var trElm = inst.dom.getParent(focusElm, "tr"); | ||
| 282 | var tdElm = inst.dom.getParent(focusElm, "td,th"); | ||
| 283 | var tableElm = inst.dom.getParent(focusElm, "table"); | ||
| 284 | var doc = inst.contentWindow.document; | ||
| 285 | var tableBorder = tableElm ? tableElm.getAttribute("border") : ""; | ||
| 286 | |||
| 287 | // Get first TD if no TD found | ||
| 288 | if (trElm && tdElm == null) | ||
| 289 | tdElm = trElm.cells[0]; | ||
| 290 | |||
| 291 | function inArray(ar, v) { | ||
| 292 | for (var i=0; i<ar.length; i++) { | ||
| 293 | // Is array | ||
| 294 | if (ar[i].length > 0 && inArray(ar[i], v)) | ||
| 295 | return true; | ||
| 296 | |||
| 297 | // Found value | ||
| 298 | if (ar[i] == v) | ||
| 299 | return true; | ||
| 300 | } | ||
| 301 | |||
| 302 | return false; | ||
| 303 | } | ||
| 304 | |||
| 305 | function select(dx, dy) { | ||
| 306 | var td; | ||
| 307 | |||
| 308 | grid = getTableGrid(tableElm); | ||
| 309 | dx = dx || 0; | ||
| 310 | dy = dy || 0; | ||
| 311 | dx = Math.max(cpos.cellindex + dx, 0); | ||
| 312 | dy = Math.max(cpos.rowindex + dy, 0); | ||
| 313 | |||
| 314 | // Recalculate grid and select | ||
| 315 | inst.execCommand('mceRepaint'); | ||
| 316 | td = getCell(grid, dy, dx); | ||
| 317 | |||
| 318 | if (td) { | ||
| 319 | inst.selection.select(td.firstChild || td); | ||
| 320 | inst.selection.collapse(1); | ||
| 321 | } | ||
| 322 | }; | ||
| 323 | |||
| 324 | function makeTD() { | ||
| 325 | var newTD = doc.createElement("td"); | ||
| 326 | |||
| 327 | if (!tinymce.isIE) | ||
| 328 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 329 | } | ||
| 330 | |||
| 331 | function getColRowSpan(td) { | ||
| 332 | var colspan = inst.dom.getAttrib(td, "colspan"); | ||
| 333 | var rowspan = inst.dom.getAttrib(td, "rowspan"); | ||
| 334 | |||
| 335 | colspan = colspan == "" ? 1 : parseInt(colspan); | ||
| 336 | rowspan = rowspan == "" ? 1 : parseInt(rowspan); | ||
| 337 | |||
| 338 | return {colspan : colspan, rowspan : rowspan}; | ||
| 339 | } | ||
| 340 | |||
| 341 | function getCellPos(grid, td) { | ||
| 342 | var x, y; | ||
| 343 | |||
| 344 | for (y=0; y<grid.length; y++) { | ||
| 345 | for (x=0; x<grid[y].length; x++) { | ||
| 346 | if (grid[y][x] == td) | ||
| 347 | return {cellindex : x, rowindex : y}; | ||
| 348 | } | ||
| 349 | } | ||
| 350 | |||
| 351 | return null; | ||
| 352 | } | ||
| 353 | |||
| 354 | function getCell(grid, row, col) { | ||
| 355 | if (grid[row] && grid[row][col]) | ||
| 356 | return grid[row][col]; | ||
| 357 | |||
| 358 | return null; | ||
| 359 | } | ||
| 360 | |||
| 361 | function getNextCell(table, cell) { | ||
| 362 | var cells = [], x = 0, i, j, cell, nextCell; | ||
| 363 | |||
| 364 | for (i = 0; i < table.rows.length; i++) | ||
| 365 | for (j = 0; j < table.rows[i].cells.length; j++, x++) | ||
| 366 | cells[x] = table.rows[i].cells[j]; | ||
| 367 | |||
| 368 | for (i = 0; i < cells.length; i++) | ||
| 369 | if (cells[i] == cell) | ||
| 370 | if (nextCell = cells[i+1]) | ||
| 371 | return nextCell; | ||
| 372 | } | ||
| 373 | |||
| 374 | function getTableGrid(table) { | ||
| 375 | var grid = [], rows = table.rows, x, y, td, sd, xstart, x2, y2; | ||
| 376 | |||
| 377 | for (y=0; y<rows.length; y++) { | ||
| 378 | for (x=0; x<rows[y].cells.length; x++) { | ||
| 379 | td = rows[y].cells[x]; | ||
| 380 | sd = getColRowSpan(td); | ||
| 381 | |||
| 382 | // All ready filled | ||
| 383 | for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ; | ||
| 384 | |||
| 385 | // Fill box | ||
| 386 | for (y2=y; y2<y+sd['rowspan']; y2++) { | ||
| 387 | if (!grid[y2]) | ||
| 388 | grid[y2] = []; | ||
| 389 | |||
| 390 | for (x2=xstart; x2<xstart+sd['colspan']; x2++) | ||
| 391 | grid[y2][x2] = td; | ||
| 392 | } | ||
| 393 | } | ||
| 394 | } | ||
| 395 | |||
| 396 | return grid; | ||
| 397 | } | ||
| 398 | |||
| 399 | function trimRow(table, tr, td, new_tr) { | ||
| 400 | var grid = getTableGrid(table), cpos = getCellPos(grid, td); | ||
| 401 | var cells, lastElm; | ||
| 402 | |||
| 403 | // Time to crop away some | ||
| 404 | if (new_tr.cells.length != tr.childNodes.length) { | ||
| 405 | cells = tr.childNodes; | ||
| 406 | lastElm = null; | ||
| 407 | |||
| 408 | for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) { | ||
| 409 | var remove = true; | ||
| 410 | var sd = getColRowSpan(td); | ||
| 411 | |||
| 412 | // Remove due to rowspan | ||
| 413 | if (inArray(cells, td)) { | ||
| 414 | new_tr.childNodes[x]._delete = true; | ||
| 415 | } else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan | ||
| 416 | for (var i=x; i<x+td.colSpan; i++) | ||
| 417 | new_tr.childNodes[i]._delete = true; | ||
| 418 | } | ||
| 419 | |||
| 420 | if ((lastElm == null || td != lastElm) && sd.rowspan > 1) | ||
| 421 | td.rowSpan = sd.rowspan + 1; | ||
| 422 | |||
| 423 | lastElm = td; | ||
| 424 | } | ||
| 425 | |||
| 426 | deleteMarked(tableElm); | ||
| 427 | } | ||
| 428 | } | ||
| 429 | |||
| 430 | function prevElm(node, name) { | ||
| 431 | while ((node = node.previousSibling) != null) { | ||
| 432 | if (node.nodeName == name) | ||
| 433 | return node; | ||
| 434 | } | ||
| 435 | |||
| 436 | return null; | ||
| 437 | } | ||
| 438 | |||
| 439 | function nextElm(node, names) { | ||
| 440 | var namesAr = names.split(','); | ||
| 441 | |||
| 442 | while ((node = node.nextSibling) != null) { | ||
| 443 | for (var i=0; i<namesAr.length; i++) { | ||
| 444 | if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() ) | ||
| 445 | return node; | ||
| 446 | } | ||
| 447 | } | ||
| 448 | |||
| 449 | return null; | ||
| 450 | } | ||
| 451 | |||
| 452 | function deleteMarked(tbl) { | ||
| 453 | if (tbl.rows == 0) | ||
| 454 | return; | ||
| 455 | |||
| 456 | var tr = tbl.rows[0]; | ||
| 457 | do { | ||
| 458 | var next = nextElm(tr, "TR"); | ||
| 459 | |||
| 460 | // Delete row | ||
| 461 | if (tr._delete) { | ||
| 462 | tr.parentNode.removeChild(tr); | ||
| 463 | continue; | ||
| 464 | } | ||
| 465 | |||
| 466 | // Delete cells | ||
| 467 | var td = tr.cells[0]; | ||
| 468 | if (td.cells > 1) { | ||
| 469 | do { | ||
| 470 | var nexttd = nextElm(td, "TD,TH"); | ||
| 471 | |||
| 472 | if (td._delete) | ||
| 473 | td.parentNode.removeChild(td); | ||
| 474 | } while ((td = nexttd) != null); | ||
| 475 | } | ||
| 476 | } while ((tr = next) != null); | ||
| 477 | } | ||
| 478 | |||
| 479 | function addRows(td_elm, tr_elm, rowspan) { | ||
| 480 | // Add rows | ||
| 481 | td_elm.rowSpan = 1; | ||
| 482 | var trNext = nextElm(tr_elm, "TR"); | ||
| 483 | for (var i=1; i<rowspan && trNext; i++) { | ||
| 484 | var newTD = doc.createElement("td"); | ||
| 485 | |||
| 486 | if (!tinymce.isIE) | ||
| 487 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 488 | |||
| 489 | if (tinymce.isIE) | ||
| 490 | trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex)); | ||
| 491 | else | ||
| 492 | trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]); | ||
| 493 | |||
| 494 | trNext = nextElm(trNext, "TR"); | ||
| 495 | } | ||
| 496 | } | ||
| 497 | |||
| 498 | function copyRow(doc, table, tr) { | ||
| 499 | var grid = getTableGrid(table); | ||
| 500 | var newTR = tr.cloneNode(false); | ||
| 501 | var cpos = getCellPos(grid, tr.cells[0]); | ||
| 502 | var lastCell = null; | ||
| 503 | var tableBorder = inst.dom.getAttrib(table, "border"); | ||
| 504 | var tdElm = null; | ||
| 505 | |||
| 506 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 507 | var newTD = null; | ||
| 508 | |||
| 509 | if (lastCell != tdElm) { | ||
| 510 | for (var i=0; i<tr.cells.length; i++) { | ||
| 511 | if (tdElm == tr.cells[i]) { | ||
| 512 | newTD = tdElm.cloneNode(true); | ||
| 513 | break; | ||
| 514 | } | ||
| 515 | } | ||
| 516 | } | ||
| 517 | |||
| 518 | if (newTD == null) { | ||
| 519 | newTD = doc.createElement("td"); | ||
| 520 | |||
| 521 | if (!tinymce.isIE) | ||
| 522 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 523 | } | ||
| 524 | |||
| 525 | // Reset col/row span | ||
| 526 | newTD.colSpan = 1; | ||
| 527 | newTD.rowSpan = 1; | ||
| 528 | |||
| 529 | newTR.appendChild(newTD); | ||
| 530 | |||
| 531 | lastCell = tdElm; | ||
| 532 | } | ||
| 533 | |||
| 534 | return newTR; | ||
| 535 | } | ||
| 536 | |||
| 537 | // ---- Commands ----- | ||
| 538 | |||
| 539 | // Handle commands | ||
| 540 | switch (command) { | ||
| 541 | case "mceTableMoveToNextRow": | ||
| 542 | var nextCell = getNextCell(tableElm, tdElm); | ||
| 543 | |||
| 544 | if (!nextCell) { | ||
| 545 | inst.execCommand("mceTableInsertRowAfter", tdElm); | ||
| 546 | nextCell = getNextCell(tableElm, tdElm); | ||
| 547 | } | ||
| 548 | |||
| 549 | inst.selection.select(nextCell); | ||
| 550 | inst.selection.collapse(true); | ||
| 551 | |||
| 552 | return true; | ||
| 553 | |||
| 554 | case "mceTableRowProps": | ||
| 555 | if (trElm == null) | ||
| 556 | return true; | ||
| 557 | |||
| 558 | if (user_interface) { | ||
| 559 | inst.windowManager.open({ | ||
| 560 | url : url + '/row.htm', | ||
| 561 | width : 400 + parseInt(inst.getLang('table.rowprops_delta_width', 0)), | ||
| 562 | height : 295 + parseInt(inst.getLang('table.rowprops_delta_height', 0)), | ||
| 563 | inline : 1 | ||
| 564 | }, { | ||
| 565 | plugin_url : url | ||
| 566 | }); | ||
| 567 | } | ||
| 568 | |||
| 569 | return true; | ||
| 570 | |||
| 571 | case "mceTableCellProps": | ||
| 572 | if (tdElm == null) | ||
| 573 | return true; | ||
| 574 | |||
| 575 | if (user_interface) { | ||
| 576 | inst.windowManager.open({ | ||
| 577 | url : url + '/cell.htm', | ||
| 578 | width : 400 + parseInt(inst.getLang('table.cellprops_delta_width', 0)), | ||
| 579 | height : 295 + parseInt(inst.getLang('table.cellprops_delta_height', 0)), | ||
| 580 | inline : 1 | ||
| 581 | }, { | ||
| 582 | plugin_url : url | ||
| 583 | }); | ||
| 584 | } | ||
| 585 | |||
| 586 | return true; | ||
| 587 | |||
| 588 | case "mceInsertTable": | ||
| 589 | if (user_interface) { | ||
| 590 | inst.windowManager.open({ | ||
| 591 | url : url + '/table.htm', | ||
| 592 | width : 400 + parseInt(inst.getLang('table.table_delta_width', 0)), | ||
| 593 | height : 320 + parseInt(inst.getLang('table.table_delta_height', 0)), | ||
| 594 | inline : 1 | ||
| 595 | }, { | ||
| 596 | plugin_url : url, | ||
| 597 | action : value ? value.action : 0 | ||
| 598 | }); | ||
| 599 | } | ||
| 600 | |||
| 601 | return true; | ||
| 602 | |||
| 603 | case "mceTableDelete": | ||
| 604 | var table = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 605 | if (table) { | ||
| 606 | table.parentNode.removeChild(table); | ||
| 607 | inst.execCommand('mceRepaint'); | ||
| 608 | } | ||
| 609 | return true; | ||
| 610 | |||
| 611 | case "mceTableSplitCells": | ||
| 612 | case "mceTableMergeCells": | ||
| 613 | case "mceTableInsertRowBefore": | ||
| 614 | case "mceTableInsertRowAfter": | ||
| 615 | case "mceTableDeleteRow": | ||
| 616 | case "mceTableInsertColBefore": | ||
| 617 | case "mceTableInsertColAfter": | ||
| 618 | case "mceTableDeleteCol": | ||
| 619 | case "mceTableCutRow": | ||
| 620 | case "mceTableCopyRow": | ||
| 621 | case "mceTablePasteRowBefore": | ||
| 622 | case "mceTablePasteRowAfter": | ||
| 623 | // No table just return (invalid command) | ||
| 624 | if (!tableElm) | ||
| 625 | return true; | ||
| 626 | |||
| 627 | // Table has a tbody use that reference | ||
| 628 | // Changed logic by ApTest 2005.07.12 (www.aptest.com) | ||
| 629 | // Now lookk at the focused element and take its parentNode. That will be a tbody or a table. | ||
| 630 | if (trElm && tableElm != trElm.parentNode) | ||
| 631 | tableElm = trElm.parentNode; | ||
| 632 | |||
| 633 | if (tableElm && trElm) { | ||
| 634 | switch (command) { | ||
| 635 | case "mceTableCutRow": | ||
| 636 | if (!trElm || !tdElm) | ||
| 637 | return true; | ||
| 638 | |||
| 639 | inst.tableRowClipboard = copyRow(doc, tableElm, trElm); | ||
| 640 | inst.execCommand("mceTableDeleteRow"); | ||
| 641 | break; | ||
| 642 | |||
| 643 | case "mceTableCopyRow": | ||
| 644 | if (!trElm || !tdElm) | ||
| 645 | return true; | ||
| 646 | |||
| 647 | inst.tableRowClipboard = copyRow(doc, tableElm, trElm); | ||
| 648 | break; | ||
| 649 | |||
| 650 | case "mceTablePasteRowBefore": | ||
| 651 | if (!trElm || !tdElm) | ||
| 652 | return true; | ||
| 653 | |||
| 654 | var newTR = inst.tableRowClipboard.cloneNode(true); | ||
| 655 | |||
| 656 | var prevTR = prevElm(trElm, "TR"); | ||
| 657 | if (prevTR != null) | ||
| 658 | trimRow(tableElm, prevTR, prevTR.cells[0], newTR); | ||
| 659 | |||
| 660 | trElm.parentNode.insertBefore(newTR, trElm); | ||
| 661 | break; | ||
| 662 | |||
| 663 | case "mceTablePasteRowAfter": | ||
| 664 | if (!trElm || !tdElm) | ||
| 665 | return true; | ||
| 666 | |||
| 667 | var nextTR = nextElm(trElm, "TR"); | ||
| 668 | var newTR = inst.tableRowClipboard.cloneNode(true); | ||
| 669 | |||
| 670 | trimRow(tableElm, trElm, tdElm, newTR); | ||
| 671 | |||
| 672 | if (nextTR == null) | ||
| 673 | trElm.parentNode.appendChild(newTR); | ||
| 674 | else | ||
| 675 | nextTR.parentNode.insertBefore(newTR, nextTR); | ||
| 676 | |||
| 677 | break; | ||
| 678 | |||
| 679 | case "mceTableInsertRowBefore": | ||
| 680 | if (!trElm || !tdElm) | ||
| 681 | return true; | ||
| 682 | |||
| 683 | var grid = getTableGrid(tableElm); | ||
| 684 | var cpos = getCellPos(grid, tdElm); | ||
| 685 | var newTR = doc.createElement("tr"); | ||
| 686 | var lastTDElm = null; | ||
| 687 | |||
| 688 | cpos.rowindex--; | ||
| 689 | if (cpos.rowindex < 0) | ||
| 690 | cpos.rowindex = 0; | ||
| 691 | |||
| 692 | // Create cells | ||
| 693 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 694 | if (tdElm != lastTDElm) { | ||
| 695 | var sd = getColRowSpan(tdElm); | ||
| 696 | |||
| 697 | if (sd['rowspan'] == 1) { | ||
| 698 | var newTD = doc.createElement("td"); | ||
| 699 | |||
| 700 | if (!tinymce.isIE) | ||
| 701 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 702 | |||
| 703 | newTD.colSpan = tdElm.colSpan; | ||
| 704 | |||
| 705 | newTR.appendChild(newTD); | ||
| 706 | } else | ||
| 707 | tdElm.rowSpan = sd['rowspan'] + 1; | ||
| 708 | |||
| 709 | lastTDElm = tdElm; | ||
| 710 | } | ||
| 711 | } | ||
| 712 | |||
| 713 | trElm.parentNode.insertBefore(newTR, trElm); | ||
| 714 | select(0, 1); | ||
| 715 | break; | ||
| 716 | |||
| 717 | case "mceTableInsertRowAfter": | ||
| 718 | if (!trElm || !tdElm) | ||
| 719 | return true; | ||
| 720 | |||
| 721 | var grid = getTableGrid(tableElm); | ||
| 722 | var cpos = getCellPos(grid, tdElm); | ||
| 723 | var newTR = doc.createElement("tr"); | ||
| 724 | var lastTDElm = null; | ||
| 725 | |||
| 726 | // Create cells | ||
| 727 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 728 | if (tdElm != lastTDElm) { | ||
| 729 | var sd = getColRowSpan(tdElm); | ||
| 730 | |||
| 731 | if (sd['rowspan'] == 1) { | ||
| 732 | var newTD = doc.createElement("td"); | ||
| 733 | |||
| 734 | if (!tinymce.isIE) | ||
| 735 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 736 | |||
| 737 | newTD.colSpan = tdElm.colSpan; | ||
| 738 | |||
| 739 | newTR.appendChild(newTD); | ||
| 740 | } else | ||
| 741 | tdElm.rowSpan = sd['rowspan'] + 1; | ||
| 742 | |||
| 743 | lastTDElm = tdElm; | ||
| 744 | } | ||
| 745 | } | ||
| 746 | |||
| 747 | if (newTR.hasChildNodes()) { | ||
| 748 | var nextTR = nextElm(trElm, "TR"); | ||
| 749 | if (nextTR) | ||
| 750 | nextTR.parentNode.insertBefore(newTR, nextTR); | ||
| 751 | else | ||
| 752 | tableElm.appendChild(newTR); | ||
| 753 | } | ||
| 754 | |||
| 755 | select(0, 1); | ||
| 756 | break; | ||
| 757 | |||
| 758 | case "mceTableDeleteRow": | ||
| 759 | if (!trElm || !tdElm) | ||
| 760 | return true; | ||
| 761 | |||
| 762 | var grid = getTableGrid(tableElm); | ||
| 763 | var cpos = getCellPos(grid, tdElm); | ||
| 764 | |||
| 765 | // Only one row, remove whole table | ||
| 766 | if (grid.length == 1 && tableElm.nodeName == 'TBODY') { | ||
| 767 | inst.dom.remove(inst.dom.getParent(tableElm, "table")); | ||
| 768 | return true; | ||
| 769 | } | ||
| 770 | |||
| 771 | // Move down row spanned cells | ||
| 772 | var cells = trElm.cells; | ||
| 773 | var nextTR = nextElm(trElm, "TR"); | ||
| 774 | for (var x=0; x<cells.length; x++) { | ||
| 775 | if (cells[x].rowSpan > 1) { | ||
| 776 | var newTD = cells[x].cloneNode(true); | ||
| 777 | var sd = getColRowSpan(cells[x]); | ||
| 778 | |||
| 779 | newTD.rowSpan = sd.rowspan - 1; | ||
| 780 | |||
| 781 | var nextTD = nextTR.cells[x]; | ||
| 782 | |||
| 783 | if (nextTD == null) | ||
| 784 | nextTR.appendChild(newTD); | ||
| 785 | else | ||
| 786 | nextTR.insertBefore(newTD, nextTD); | ||
| 787 | } | ||
| 788 | } | ||
| 789 | |||
| 790 | // Delete cells | ||
| 791 | var lastTDElm = null; | ||
| 792 | for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 793 | if (tdElm != lastTDElm) { | ||
| 794 | var sd = getColRowSpan(tdElm); | ||
| 795 | |||
| 796 | if (sd.rowspan > 1) { | ||
| 797 | tdElm.rowSpan = sd.rowspan - 1; | ||
| 798 | } else { | ||
| 799 | trElm = tdElm.parentNode; | ||
| 800 | |||
| 801 | if (trElm.parentNode) | ||
| 802 | trElm._delete = true; | ||
| 803 | } | ||
| 804 | |||
| 805 | lastTDElm = tdElm; | ||
| 806 | } | ||
| 807 | } | ||
| 808 | |||
| 809 | deleteMarked(tableElm); | ||
| 810 | |||
| 811 | select(0, -1); | ||
| 812 | break; | ||
| 813 | |||
| 814 | case "mceTableInsertColBefore": | ||
| 815 | if (!trElm || !tdElm) | ||
| 816 | return true; | ||
| 817 | |||
| 818 | var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); | ||
| 819 | var cpos = getCellPos(grid, tdElm); | ||
| 820 | var lastTDElm = null; | ||
| 821 | |||
| 822 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 823 | if (tdElm != lastTDElm) { | ||
| 824 | var sd = getColRowSpan(tdElm); | ||
| 825 | |||
| 826 | if (sd['colspan'] == 1) { | ||
| 827 | var newTD = doc.createElement(tdElm.nodeName); | ||
| 828 | |||
| 829 | if (!tinymce.isIE) | ||
| 830 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 831 | |||
| 832 | newTD.rowSpan = tdElm.rowSpan; | ||
| 833 | |||
| 834 | tdElm.parentNode.insertBefore(newTD, tdElm); | ||
| 835 | } else | ||
| 836 | tdElm.colSpan++; | ||
| 837 | |||
| 838 | lastTDElm = tdElm; | ||
| 839 | } | ||
| 840 | } | ||
| 841 | |||
| 842 | select(); | ||
| 843 | break; | ||
| 844 | |||
| 845 | case "mceTableInsertColAfter": | ||
| 846 | if (!trElm || !tdElm) | ||
| 847 | return true; | ||
| 848 | |||
| 849 | var grid = getTableGrid(inst.dom.getParent(tableElm, "table")); | ||
| 850 | var cpos = getCellPos(grid, tdElm); | ||
| 851 | var lastTDElm = null; | ||
| 852 | |||
| 853 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 854 | if (tdElm != lastTDElm) { | ||
| 855 | var sd = getColRowSpan(tdElm); | ||
| 856 | |||
| 857 | if (sd['colspan'] == 1) { | ||
| 858 | var newTD = doc.createElement(tdElm.nodeName); | ||
| 859 | |||
| 860 | if (!tinymce.isIE) | ||
| 861 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 862 | |||
| 863 | newTD.rowSpan = tdElm.rowSpan; | ||
| 864 | |||
| 865 | var nextTD = nextElm(tdElm, "TD,TH"); | ||
| 866 | if (nextTD == null) | ||
| 867 | tdElm.parentNode.appendChild(newTD); | ||
| 868 | else | ||
| 869 | nextTD.parentNode.insertBefore(newTD, nextTD); | ||
| 870 | } else | ||
| 871 | tdElm.colSpan++; | ||
| 872 | |||
| 873 | lastTDElm = tdElm; | ||
| 874 | } | ||
| 875 | } | ||
| 876 | |||
| 877 | select(1); | ||
| 878 | break; | ||
| 879 | |||
| 880 | case "mceTableDeleteCol": | ||
| 881 | if (!trElm || !tdElm) | ||
| 882 | return true; | ||
| 883 | |||
| 884 | var grid = getTableGrid(tableElm); | ||
| 885 | var cpos = getCellPos(grid, tdElm); | ||
| 886 | var lastTDElm = null; | ||
| 887 | |||
| 888 | // Only one col, remove whole table | ||
| 889 | if ((grid.length > 1 && grid[0].length <= 1) && tableElm.nodeName == 'TBODY') { | ||
| 890 | inst.dom.remove(inst.dom.getParent(tableElm, "table")); | ||
| 891 | return true; | ||
| 892 | } | ||
| 893 | |||
| 894 | // Delete cells | ||
| 895 | for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) { | ||
| 896 | if (tdElm != lastTDElm) { | ||
| 897 | var sd = getColRowSpan(tdElm); | ||
| 898 | |||
| 899 | if (sd['colspan'] > 1) | ||
| 900 | tdElm.colSpan = sd['colspan'] - 1; | ||
| 901 | else { | ||
| 902 | if (tdElm.parentNode) | ||
| 903 | tdElm.parentNode.removeChild(tdElm); | ||
| 904 | } | ||
| 905 | |||
| 906 | lastTDElm = tdElm; | ||
| 907 | } | ||
| 908 | } | ||
| 909 | |||
| 910 | select(-1); | ||
| 911 | break; | ||
| 912 | |||
| 913 | case "mceTableSplitCells": | ||
| 914 | if (!trElm || !tdElm) | ||
| 915 | return true; | ||
| 916 | |||
| 917 | var spandata = getColRowSpan(tdElm); | ||
| 918 | |||
| 919 | var colspan = spandata["colspan"]; | ||
| 920 | var rowspan = spandata["rowspan"]; | ||
| 921 | |||
| 922 | // Needs splitting | ||
| 923 | if (colspan > 1 || rowspan > 1) { | ||
| 924 | // Generate cols | ||
| 925 | tdElm.colSpan = 1; | ||
| 926 | for (var i=1; i<colspan; i++) { | ||
| 927 | var newTD = doc.createElement("td"); | ||
| 928 | |||
| 929 | if (!tinymce.isIE) | ||
| 930 | newTD.innerHTML = '<br mce_bogus="1"/>'; | ||
| 931 | |||
| 932 | trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH")); | ||
| 933 | |||
| 934 | if (rowspan > 1) | ||
| 935 | addRows(newTD, trElm, rowspan); | ||
| 936 | } | ||
| 937 | |||
| 938 | addRows(tdElm, trElm, rowspan); | ||
| 939 | } | ||
| 940 | |||
| 941 | // Apply visual aids | ||
| 942 | tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 943 | break; | ||
| 944 | |||
| 945 | case "mceTableMergeCells": | ||
| 946 | var rows = []; | ||
| 947 | var sel = inst.selection.getSel(); | ||
| 948 | var grid = getTableGrid(tableElm); | ||
| 949 | |||
| 950 | if (tinymce.isIE || sel.rangeCount == 1) { | ||
| 951 | if (user_interface) { | ||
| 952 | // Setup template | ||
| 953 | var sp = getColRowSpan(tdElm); | ||
| 954 | |||
| 955 | inst.windowManager.open({ | ||
| 956 | url : url + '/merge_cells.htm', | ||
| 957 | width : 240 + parseInt(inst.getLang('table.merge_cells_delta_width', 0)), | ||
| 958 | height : 110 + parseInt(inst.getLang('table.merge_cells_delta_height', 0)), | ||
| 959 | inline : 1 | ||
| 960 | }, { | ||
| 961 | action : "update", | ||
| 962 | numcols : sp.colspan, | ||
| 963 | numrows : sp.rowspan, | ||
| 964 | plugin_url : url | ||
| 965 | }); | ||
| 966 | |||
| 967 | return true; | ||
| 968 | } else { | ||
| 969 | var numRows = parseInt(value['numrows']); | ||
| 970 | var numCols = parseInt(value['numcols']); | ||
| 971 | var cpos = getCellPos(grid, tdElm); | ||
| 972 | |||
| 973 | if (("" + numRows) == "NaN") | ||
| 974 | numRows = 1; | ||
| 975 | |||
| 976 | if (("" + numCols) == "NaN") | ||
| 977 | numCols = 1; | ||
| 978 | |||
| 979 | // Get rows and cells | ||
| 980 | var tRows = tableElm.rows; | ||
| 981 | for (var y=cpos.rowindex; y<grid.length; y++) { | ||
| 982 | var rowCells = []; | ||
| 983 | |||
| 984 | for (var x=cpos.cellindex; x<grid[y].length; x++) { | ||
| 985 | var td = getCell(grid, y, x); | ||
| 986 | |||
| 987 | if (td && !inArray(rows, td) && !inArray(rowCells, td)) { | ||
| 988 | var cp = getCellPos(grid, td); | ||
| 989 | |||
| 990 | // Within range | ||
| 991 | if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows) | ||
| 992 | rowCells[rowCells.length] = td; | ||
| 993 | } | ||
| 994 | } | ||
| 995 | |||
| 996 | if (rowCells.length > 0) | ||
| 997 | rows[rows.length] = rowCells; | ||
| 998 | |||
| 999 | var td = getCell(grid, cpos.rowindex, cpos.cellindex); | ||
| 1000 | each(ed.dom.select('br', td), function(e, i) { | ||
| 1001 | if (i > 0 && ed.dom.getAttrib('mce_bogus')) | ||
| 1002 | ed.dom.remove(e); | ||
| 1003 | }); | ||
| 1004 | } | ||
| 1005 | |||
| 1006 | //return true; | ||
| 1007 | } | ||
| 1008 | } else { | ||
| 1009 | var cells = []; | ||
| 1010 | var sel = inst.selection.getSel(); | ||
| 1011 | var lastTR = null; | ||
| 1012 | var curRow = null; | ||
| 1013 | var x1 = -1, y1 = -1, x2, y2; | ||
| 1014 | |||
| 1015 | // Only one cell selected, whats the point? | ||
| 1016 | if (sel.rangeCount < 2) | ||
| 1017 | return true; | ||
| 1018 | |||
| 1019 | // Get all selected cells | ||
| 1020 | for (var i=0; i<sel.rangeCount; i++) { | ||
| 1021 | var rng = sel.getRangeAt(i); | ||
| 1022 | var tdElm = rng.startContainer.childNodes[rng.startOffset]; | ||
| 1023 | |||
| 1024 | if (!tdElm) | ||
| 1025 | break; | ||
| 1026 | |||
| 1027 | if (tdElm.nodeName == "TD" || tdElm.nodeName == "TH") | ||
| 1028 | cells[cells.length] = tdElm; | ||
| 1029 | } | ||
| 1030 | |||
| 1031 | // Get rows and cells | ||
| 1032 | var tRows = tableElm.rows; | ||
| 1033 | for (var y=0; y<tRows.length; y++) { | ||
| 1034 | var rowCells = []; | ||
| 1035 | |||
| 1036 | for (var x=0; x<tRows[y].cells.length; x++) { | ||
| 1037 | var td = tRows[y].cells[x]; | ||
| 1038 | |||
| 1039 | for (var i=0; i<cells.length; i++) { | ||
| 1040 | if (td == cells[i]) { | ||
| 1041 | rowCells[rowCells.length] = td; | ||
| 1042 | } | ||
| 1043 | } | ||
| 1044 | } | ||
| 1045 | |||
| 1046 | if (rowCells.length > 0) | ||
| 1047 | rows[rows.length] = rowCells; | ||
| 1048 | } | ||
| 1049 | |||
| 1050 | // Find selected cells in grid and box | ||
| 1051 | var curRow = []; | ||
| 1052 | var lastTR = null; | ||
| 1053 | for (var y=0; y<grid.length; y++) { | ||
| 1054 | for (var x=0; x<grid[y].length; x++) { | ||
| 1055 | grid[y][x]._selected = false; | ||
| 1056 | |||
| 1057 | for (var i=0; i<cells.length; i++) { | ||
| 1058 | if (grid[y][x] == cells[i]) { | ||
| 1059 | // Get start pos | ||
| 1060 | if (x1 == -1) { | ||
| 1061 | x1 = x; | ||
| 1062 | y1 = y; | ||
| 1063 | } | ||
| 1064 | |||
| 1065 | // Get end pos | ||
| 1066 | x2 = x; | ||
| 1067 | y2 = y; | ||
| 1068 | |||
| 1069 | grid[y][x]._selected = true; | ||
| 1070 | } | ||
| 1071 | } | ||
| 1072 | } | ||
| 1073 | } | ||
| 1074 | |||
| 1075 | // Is there gaps, if so deny | ||
| 1076 | for (var y=y1; y<=y2; y++) { | ||
| 1077 | for (var x=x1; x<=x2; x++) { | ||
| 1078 | if (!grid[y][x]._selected) { | ||
| 1079 | alert("Invalid selection for merge."); | ||
| 1080 | return true; | ||
| 1081 | } | ||
| 1082 | } | ||
| 1083 | } | ||
| 1084 | } | ||
| 1085 | |||
| 1086 | // Validate selection and get total rowspan and colspan | ||
| 1087 | var rowSpan = 1, colSpan = 1; | ||
| 1088 | |||
| 1089 | // Validate horizontal and get total colspan | ||
| 1090 | var lastRowSpan = -1; | ||
| 1091 | for (var y=0; y<rows.length; y++) { | ||
| 1092 | var rowColSpan = 0; | ||
| 1093 | |||
| 1094 | for (var x=0; x<rows[y].length; x++) { | ||
| 1095 | var sd = getColRowSpan(rows[y][x]); | ||
| 1096 | |||
| 1097 | rowColSpan += sd['colspan']; | ||
| 1098 | |||
| 1099 | if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) { | ||
| 1100 | alert("Invalid selection for merge."); | ||
| 1101 | return true; | ||
| 1102 | } | ||
| 1103 | |||
| 1104 | lastRowSpan = sd['rowspan']; | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | if (rowColSpan > colSpan) | ||
| 1108 | colSpan = rowColSpan; | ||
| 1109 | |||
| 1110 | lastRowSpan = -1; | ||
| 1111 | } | ||
| 1112 | |||
| 1113 | // Validate vertical and get total rowspan | ||
| 1114 | var lastColSpan = -1; | ||
| 1115 | for (var x=0; x<rows[0].length; x++) { | ||
| 1116 | var colRowSpan = 0; | ||
| 1117 | |||
| 1118 | for (var y=0; y<rows.length; y++) { | ||
| 1119 | var sd = getColRowSpan(rows[y][x]); | ||
| 1120 | |||
| 1121 | colRowSpan += sd['rowspan']; | ||
| 1122 | |||
| 1123 | if (lastColSpan != -1 && sd['colspan'] != lastColSpan) { | ||
| 1124 | alert("Invalid selection for merge."); | ||
| 1125 | return true; | ||
| 1126 | } | ||
| 1127 | |||
| 1128 | lastColSpan = sd['colspan']; | ||
| 1129 | } | ||
| 1130 | |||
| 1131 | if (colRowSpan > rowSpan) | ||
| 1132 | rowSpan = colRowSpan; | ||
| 1133 | |||
| 1134 | lastColSpan = -1; | ||
| 1135 | } | ||
| 1136 | |||
| 1137 | // Setup td | ||
| 1138 | tdElm = rows[0][0]; | ||
| 1139 | tdElm.rowSpan = rowSpan; | ||
| 1140 | tdElm.colSpan = colSpan; | ||
| 1141 | |||
| 1142 | // Merge cells | ||
| 1143 | for (var y=0; y<rows.length; y++) { | ||
| 1144 | for (var x=0; x<rows[y].length; x++) { | ||
| 1145 | var html = rows[y][x].innerHTML; | ||
| 1146 | var chk = html.replace(/[ \t\r\n]/g, ""); | ||
| 1147 | |||
| 1148 | if (chk != "<br/>" && chk != "<br>" && chk != '<br mce_bogus="1"/>' && (x+y > 0)) | ||
| 1149 | tdElm.innerHTML += html; | ||
| 1150 | |||
| 1151 | // Not current cell | ||
| 1152 | if (rows[y][x] != tdElm && !rows[y][x]._deleted) { | ||
| 1153 | var cpos = getCellPos(grid, rows[y][x]); | ||
| 1154 | var tr = rows[y][x].parentNode; | ||
| 1155 | |||
| 1156 | tr.removeChild(rows[y][x]); | ||
| 1157 | rows[y][x]._deleted = true; | ||
| 1158 | |||
| 1159 | // Empty TR, remove it | ||
| 1160 | if (!tr.hasChildNodes()) { | ||
| 1161 | tr.parentNode.removeChild(tr); | ||
| 1162 | |||
| 1163 | var lastCell = null; | ||
| 1164 | for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) { | ||
| 1165 | if (cellElm != lastCell && cellElm.rowSpan > 1) | ||
| 1166 | cellElm.rowSpan--; | ||
| 1167 | |||
| 1168 | lastCell = cellElm; | ||
| 1169 | } | ||
| 1170 | |||
| 1171 | if (tdElm.rowSpan > 1) | ||
| 1172 | tdElm.rowSpan--; | ||
| 1173 | } | ||
| 1174 | } | ||
| 1175 | } | ||
| 1176 | } | ||
| 1177 | |||
| 1178 | // Remove all but one bogus br | ||
| 1179 | each(ed.dom.select('br', tdElm), function(e, i) { | ||
| 1180 | if (i > 0 && ed.dom.getAttrib(e, 'mce_bogus')) | ||
| 1181 | ed.dom.remove(e); | ||
| 1182 | }); | ||
| 1183 | |||
| 1184 | break; | ||
| 1185 | } | ||
| 1186 | |||
| 1187 | tableElm = inst.dom.getParent(inst.selection.getNode(), "table"); | ||
| 1188 | inst.addVisual(tableElm); | ||
| 1189 | inst.nodeChanged(); | ||
| 1190 | } | ||
| 1191 | |||
| 1192 | return true; | ||
| 1193 | } | ||
| 1194 | |||
| 1195 | // Pass to next handler in chain | ||
| 1196 | return false; | ||
| 1197 | } | ||
| 1198 | }); | ||
| 1199 | |||
| 1200 | // Register plugin | ||
| 1201 | tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); | ||
| 1202 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/cell.js b/public/javascripts/tiny_mce/plugins/table/js/cell.js deleted file mode 100644 index f23b067..0000000 --- a/public/javascripts/tiny_mce/plugins/table/js/cell.js +++ /dev/null | |||
| @@ -1,269 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var ed; | ||
| 4 | |||
| 5 | function init() { | ||
| 6 | ed = tinyMCEPopup.editor; | ||
| 7 | tinyMCEPopup.resizeToInnerSize(); | ||
| 8 | |||
| 9 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 10 | document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); | ||
| 11 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') | ||
| 12 | |||
| 13 | var inst = ed; | ||
| 14 | var tdElm = ed.dom.getParent(ed.selection.getNode(), "td,th"); | ||
| 15 | var formObj = document.forms[0]; | ||
| 16 | var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); | ||
| 17 | |||
| 18 | // Get table cell data | ||
| 19 | var celltype = tdElm.nodeName.toLowerCase(); | ||
| 20 | var align = ed.dom.getAttrib(tdElm, 'align'); | ||
| 21 | var valign = ed.dom.getAttrib(tdElm, 'valign'); | ||
| 22 | var width = trimSize(getStyle(tdElm, 'width', 'width')); | ||
| 23 | var height = trimSize(getStyle(tdElm, 'height', 'height')); | ||
| 24 | var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); | ||
| 25 | var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); | ||
| 26 | var className = ed.dom.getAttrib(tdElm, 'class'); | ||
| 27 | var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; | ||
| 28 | var id = ed.dom.getAttrib(tdElm, 'id'); | ||
| 29 | var lang = ed.dom.getAttrib(tdElm, 'lang'); | ||
| 30 | var dir = ed.dom.getAttrib(tdElm, 'dir'); | ||
| 31 | var scope = ed.dom.getAttrib(tdElm, 'scope'); | ||
| 32 | |||
| 33 | // Setup form | ||
| 34 | addClassesToList('class', 'table_cell_styles'); | ||
| 35 | TinyMCE_EditableSelects.init(); | ||
| 36 | |||
| 37 | formObj.bordercolor.value = bordercolor; | ||
| 38 | formObj.bgcolor.value = bgcolor; | ||
| 39 | formObj.backgroundimage.value = backgroundimage; | ||
| 40 | formObj.width.value = width; | ||
| 41 | formObj.height.value = height; | ||
| 42 | formObj.id.value = id; | ||
| 43 | formObj.lang.value = lang; | ||
| 44 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 45 | selectByValue(formObj, 'align', align); | ||
| 46 | selectByValue(formObj, 'valign', valign); | ||
| 47 | selectByValue(formObj, 'class', className, true, true); | ||
| 48 | selectByValue(formObj, 'celltype', celltype); | ||
| 49 | selectByValue(formObj, 'dir', dir); | ||
| 50 | selectByValue(formObj, 'scope', scope); | ||
| 51 | |||
| 52 | // Resize some elements | ||
| 53 | if (isVisible('backgroundimagebrowser')) | ||
| 54 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 55 | |||
| 56 | updateColor('bordercolor_pick', 'bordercolor'); | ||
| 57 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 58 | } | ||
| 59 | |||
| 60 | function updateAction() { | ||
| 61 | var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; | ||
| 62 | |||
| 63 | tinyMCEPopup.restoreSelection(); | ||
| 64 | el = ed.selection.getNode(); | ||
| 65 | tdElm = ed.dom.getParent(el, "td,th"); | ||
| 66 | trElm = ed.dom.getParent(el, "tr"); | ||
| 67 | tableElm = ed.dom.getParent(el, "table"); | ||
| 68 | |||
| 69 | ed.execCommand('mceBeginUndoLevel'); | ||
| 70 | |||
| 71 | switch (getSelectValue(formObj, 'action')) { | ||
| 72 | case "cell": | ||
| 73 | var celltype = getSelectValue(formObj, 'celltype'); | ||
| 74 | var scope = getSelectValue(formObj, 'scope'); | ||
| 75 | |||
| 76 | function doUpdate(s) { | ||
| 77 | if (s) { | ||
| 78 | updateCell(tdElm); | ||
| 79 | |||
| 80 | ed.addVisual(); | ||
| 81 | ed.nodeChanged(); | ||
| 82 | inst.execCommand('mceEndUndoLevel'); | ||
| 83 | tinyMCEPopup.close(); | ||
| 84 | } | ||
| 85 | }; | ||
| 86 | |||
| 87 | if (ed.getParam("accessibility_warnings", 1)) { | ||
| 88 | if (celltype == "th" && scope == "") | ||
| 89 | tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); | ||
| 90 | else | ||
| 91 | doUpdate(1); | ||
| 92 | |||
| 93 | return; | ||
| 94 | } | ||
| 95 | |||
| 96 | updateCell(tdElm); | ||
| 97 | break; | ||
| 98 | |||
| 99 | case "row": | ||
| 100 | var cell = trElm.firstChild; | ||
| 101 | |||
| 102 | if (cell.nodeName != "TD" && cell.nodeName != "TH") | ||
| 103 | cell = nextCell(cell); | ||
| 104 | |||
| 105 | do { | ||
| 106 | cell = updateCell(cell, true); | ||
| 107 | } while ((cell = nextCell(cell)) != null); | ||
| 108 | |||
| 109 | break; | ||
| 110 | |||
| 111 | case "all": | ||
| 112 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 113 | |||
| 114 | for (var i=0; i<rows.length; i++) { | ||
| 115 | var cell = rows[i].firstChild; | ||
| 116 | |||
| 117 | if (cell.nodeName != "TD" && cell.nodeName != "TH") | ||
| 118 | cell = nextCell(cell); | ||
| 119 | |||
| 120 | do { | ||
| 121 | cell = updateCell(cell, true); | ||
| 122 | } while ((cell = nextCell(cell)) != null); | ||
| 123 | } | ||
| 124 | |||
| 125 | break; | ||
| 126 | } | ||
| 127 | |||
| 128 | ed.addVisual(); | ||
| 129 | ed.nodeChanged(); | ||
| 130 | inst.execCommand('mceEndUndoLevel'); | ||
| 131 | tinyMCEPopup.close(); | ||
| 132 | } | ||
| 133 | |||
| 134 | function nextCell(elm) { | ||
| 135 | while ((elm = elm.nextSibling) != null) { | ||
| 136 | if (elm.nodeName == "TD" || elm.nodeName == "TH") | ||
| 137 | return elm; | ||
| 138 | } | ||
| 139 | |||
| 140 | return null; | ||
| 141 | } | ||
| 142 | |||
| 143 | function updateCell(td, skip_id) { | ||
| 144 | var inst = ed; | ||
| 145 | var formObj = document.forms[0]; | ||
| 146 | var curCellType = td.nodeName.toLowerCase(); | ||
| 147 | var celltype = getSelectValue(formObj, 'celltype'); | ||
| 148 | var doc = inst.getDoc(); | ||
| 149 | var dom = ed.dom; | ||
| 150 | |||
| 151 | if (!skip_id) | ||
| 152 | td.setAttribute('id', formObj.id.value); | ||
| 153 | |||
| 154 | td.setAttribute('align', formObj.align.value); | ||
| 155 | td.setAttribute('vAlign', formObj.valign.value); | ||
| 156 | td.setAttribute('lang', formObj.lang.value); | ||
| 157 | td.setAttribute('dir', getSelectValue(formObj, 'dir')); | ||
| 158 | td.setAttribute('style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value))); | ||
| 159 | td.setAttribute('scope', formObj.scope.value); | ||
| 160 | ed.dom.setAttrib(td, 'class', getSelectValue(formObj, 'class')); | ||
| 161 | |||
| 162 | // Clear deprecated attributes | ||
| 163 | ed.dom.setAttrib(td, 'width', ''); | ||
| 164 | ed.dom.setAttrib(td, 'height', ''); | ||
| 165 | ed.dom.setAttrib(td, 'bgColor', ''); | ||
| 166 | ed.dom.setAttrib(td, 'borderColor', ''); | ||
| 167 | ed.dom.setAttrib(td, 'background', ''); | ||
| 168 | |||
| 169 | // Set styles | ||
| 170 | td.style.width = getCSSSize(formObj.width.value); | ||
| 171 | td.style.height = getCSSSize(formObj.height.value); | ||
| 172 | if (formObj.bordercolor.value != "") { | ||
| 173 | td.style.borderColor = formObj.bordercolor.value; | ||
| 174 | td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle; | ||
| 175 | td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth; | ||
| 176 | } else | ||
| 177 | td.style.borderColor = ''; | ||
| 178 | |||
| 179 | td.style.backgroundColor = formObj.bgcolor.value; | ||
| 180 | |||
| 181 | if (formObj.backgroundimage.value != "") | ||
| 182 | td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; | ||
| 183 | else | ||
| 184 | td.style.backgroundImage = ''; | ||
| 185 | |||
| 186 | if (curCellType != celltype) { | ||
| 187 | // changing to a different node type | ||
| 188 | var newCell = doc.createElement(celltype); | ||
| 189 | |||
| 190 | for (var c=0; c<td.childNodes.length; c++) | ||
| 191 | newCell.appendChild(td.childNodes[c].cloneNode(1)); | ||
| 192 | |||
| 193 | for (var a=0; a<td.attributes.length; a++) | ||
| 194 | ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name)); | ||
| 195 | |||
| 196 | td.parentNode.replaceChild(newCell, td); | ||
| 197 | td = newCell; | ||
| 198 | } | ||
| 199 | |||
| 200 | dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText))); | ||
| 201 | |||
| 202 | return td; | ||
| 203 | } | ||
| 204 | |||
| 205 | function changedBackgroundImage() { | ||
| 206 | var formObj = document.forms[0]; | ||
| 207 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 208 | |||
| 209 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 210 | |||
| 211 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 212 | } | ||
| 213 | |||
| 214 | function changedSize() { | ||
| 215 | var formObj = document.forms[0]; | ||
| 216 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 217 | |||
| 218 | var width = formObj.width.value; | ||
| 219 | if (width != "") | ||
| 220 | st['width'] = getCSSSize(width); | ||
| 221 | else | ||
| 222 | st['width'] = ""; | ||
| 223 | |||
| 224 | var height = formObj.height.value; | ||
| 225 | if (height != "") | ||
| 226 | st['height'] = getCSSSize(height); | ||
| 227 | else | ||
| 228 | st['height'] = ""; | ||
| 229 | |||
| 230 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 231 | } | ||
| 232 | |||
| 233 | function changedColor() { | ||
| 234 | var formObj = document.forms[0]; | ||
| 235 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 236 | |||
| 237 | st['background-color'] = formObj.bgcolor.value; | ||
| 238 | st['border-color'] = formObj.bordercolor.value; | ||
| 239 | |||
| 240 | formObj.style.value = ed.dom.serializeStyle(st); | ||
| 241 | } | ||
| 242 | |||
| 243 | function changedStyle() { | ||
| 244 | var formObj = document.forms[0]; | ||
| 245 | var st = ed.dom.parseStyle(formObj.style.value); | ||
| 246 | |||
| 247 | if (st['background-image']) | ||
| 248 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 249 | else | ||
| 250 | formObj.backgroundimage.value = ''; | ||
| 251 | |||
| 252 | if (st['width']) | ||
| 253 | formObj.width.value = trimSize(st['width']); | ||
| 254 | |||
| 255 | if (st['height']) | ||
| 256 | formObj.height.value = trimSize(st['height']); | ||
| 257 | |||
| 258 | if (st['background-color']) { | ||
| 259 | formObj.bgcolor.value = st['background-color']; | ||
| 260 | updateColor('bgcolor_pick','bgcolor'); | ||
| 261 | } | ||
| 262 | |||
| 263 | if (st['border-color']) { | ||
| 264 | formObj.bordercolor.value = st['border-color']; | ||
| 265 | updateColor('bordercolor_pick','bordercolor'); | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js b/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js deleted file mode 100644 index 31d6df0..0000000 --- a/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | var f = document.forms[0], v; | ||
| 5 | |||
| 6 | tinyMCEPopup.resizeToInnerSize(); | ||
| 7 | |||
| 8 | f.numcols.value = tinyMCEPopup.getWindowArg('numcols', 1); | ||
| 9 | f.numrows.value = tinyMCEPopup.getWindowArg('numrows', 1); | ||
| 10 | } | ||
| 11 | |||
| 12 | function mergeCells() { | ||
| 13 | var args = [], f = document.forms[0]; | ||
| 14 | |||
| 15 | tinyMCEPopup.restoreSelection(); | ||
| 16 | |||
| 17 | if (!AutoValidator.validate(f)) { | ||
| 18 | tinyMCEPopup.alert(tinyMCEPopup.getLang('invalid_data')); | ||
| 19 | return false; | ||
| 20 | } | ||
| 21 | |||
| 22 | args["numcols"] = f.numcols.value; | ||
| 23 | args["numrows"] = f.numrows.value; | ||
| 24 | |||
| 25 | tinyMCEPopup.execCommand("mceTableMergeCells", false, args); | ||
| 26 | tinyMCEPopup.close(); | ||
| 27 | } | ||
| 28 | |||
| 29 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/row.js b/public/javascripts/tiny_mce/plugins/table/js/row.js deleted file mode 100644 index d25f635..0000000 --- a/public/javascripts/tiny_mce/plugins/table/js/row.js +++ /dev/null | |||
| @@ -1,212 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | tinyMCEPopup.resizeToInnerSize(); | ||
| 5 | |||
| 6 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 7 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 8 | |||
| 9 | var inst = tinyMCEPopup.editor; | ||
| 10 | var dom = inst.dom; | ||
| 11 | var trElm = dom.getParent(inst.selection.getNode(), "tr"); | ||
| 12 | var formObj = document.forms[0]; | ||
| 13 | var st = dom.parseStyle(dom.getAttrib(trElm, "style")); | ||
| 14 | |||
| 15 | // Get table row data | ||
| 16 | var rowtype = trElm.parentNode.nodeName.toLowerCase(); | ||
| 17 | var align = dom.getAttrib(trElm, 'align'); | ||
| 18 | var valign = dom.getAttrib(trElm, 'valign'); | ||
| 19 | var height = trimSize(getStyle(trElm, 'height', 'height')); | ||
| 20 | var className = dom.getAttrib(trElm, 'class'); | ||
| 21 | var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor')); | ||
| 22 | var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; | ||
| 23 | var id = dom.getAttrib(trElm, 'id'); | ||
| 24 | var lang = dom.getAttrib(trElm, 'lang'); | ||
| 25 | var dir = dom.getAttrib(trElm, 'dir'); | ||
| 26 | |||
| 27 | // Setup form | ||
| 28 | addClassesToList('class', 'table_row_styles'); | ||
| 29 | TinyMCE_EditableSelects.init(); | ||
| 30 | |||
| 31 | formObj.bgcolor.value = bgcolor; | ||
| 32 | formObj.backgroundimage.value = backgroundimage; | ||
| 33 | formObj.height.value = height; | ||
| 34 | formObj.id.value = id; | ||
| 35 | formObj.lang.value = lang; | ||
| 36 | formObj.style.value = dom.serializeStyle(st); | ||
| 37 | selectByValue(formObj, 'align', align); | ||
| 38 | selectByValue(formObj, 'valign', valign); | ||
| 39 | selectByValue(formObj, 'class', className, true, true); | ||
| 40 | selectByValue(formObj, 'rowtype', rowtype); | ||
| 41 | selectByValue(formObj, 'dir', dir); | ||
| 42 | |||
| 43 | // Resize some elements | ||
| 44 | if (isVisible('backgroundimagebrowser')) | ||
| 45 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 46 | |||
| 47 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 48 | } | ||
| 49 | |||
| 50 | function updateAction() { | ||
| 51 | var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0]; | ||
| 52 | var action = getSelectValue(formObj, 'action'); | ||
| 53 | |||
| 54 | tinyMCEPopup.restoreSelection(); | ||
| 55 | trElm = dom.getParent(inst.selection.getNode(), "tr"); | ||
| 56 | tableElm = dom.getParent(inst.selection.getNode(), "table"); | ||
| 57 | |||
| 58 | inst.execCommand('mceBeginUndoLevel'); | ||
| 59 | |||
| 60 | switch (action) { | ||
| 61 | case "row": | ||
| 62 | updateRow(trElm); | ||
| 63 | break; | ||
| 64 | |||
| 65 | case "all": | ||
| 66 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 67 | |||
| 68 | for (var i=0; i<rows.length; i++) | ||
| 69 | updateRow(rows[i], true); | ||
| 70 | |||
| 71 | break; | ||
| 72 | |||
| 73 | case "odd": | ||
| 74 | case "even": | ||
| 75 | var rows = tableElm.getElementsByTagName("tr"); | ||
| 76 | |||
| 77 | for (var i=0; i<rows.length; i++) { | ||
| 78 | if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even")) | ||
| 79 | updateRow(rows[i], true, true); | ||
| 80 | } | ||
| 81 | |||
| 82 | break; | ||
| 83 | } | ||
| 84 | |||
| 85 | inst.addVisual(); | ||
| 86 | inst.nodeChanged(); | ||
| 87 | inst.execCommand('mceEndUndoLevel'); | ||
| 88 | tinyMCEPopup.close(); | ||
| 89 | } | ||
| 90 | |||
| 91 | function updateRow(tr_elm, skip_id, skip_parent) { | ||
| 92 | var inst = tinyMCEPopup.editor; | ||
| 93 | var formObj = document.forms[0]; | ||
| 94 | var dom = inst.dom; | ||
| 95 | var curRowType = tr_elm.parentNode.nodeName.toLowerCase(); | ||
| 96 | var rowtype = getSelectValue(formObj, 'rowtype'); | ||
| 97 | var doc = inst.getDoc(); | ||
| 98 | |||
| 99 | // Update row element | ||
| 100 | if (!skip_id) | ||
| 101 | tr_elm.setAttribute('id', formObj.id.value); | ||
| 102 | |||
| 103 | tr_elm.setAttribute('align', getSelectValue(formObj, 'align')); | ||
| 104 | tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign')); | ||
| 105 | tr_elm.setAttribute('lang', formObj.lang.value); | ||
| 106 | tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir')); | ||
| 107 | tr_elm.setAttribute('style', dom.serializeStyle(dom.parseStyle(formObj.style.value))); | ||
| 108 | dom.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class')); | ||
| 109 | |||
| 110 | // Clear deprecated attributes | ||
| 111 | tr_elm.setAttribute('background', ''); | ||
| 112 | tr_elm.setAttribute('bgColor', ''); | ||
| 113 | tr_elm.setAttribute('height', ''); | ||
| 114 | |||
| 115 | // Set styles | ||
| 116 | tr_elm.style.height = getCSSSize(formObj.height.value); | ||
| 117 | tr_elm.style.backgroundColor = formObj.bgcolor.value; | ||
| 118 | |||
| 119 | if (formObj.backgroundimage.value != "") | ||
| 120 | tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')"; | ||
| 121 | else | ||
| 122 | tr_elm.style.backgroundImage = ''; | ||
| 123 | |||
| 124 | // Setup new rowtype | ||
| 125 | if (curRowType != rowtype && !skip_parent) { | ||
| 126 | // first, clone the node we are working on | ||
| 127 | var newRow = tr_elm.cloneNode(1); | ||
| 128 | |||
| 129 | // next, find the parent of its new destination (creating it if necessary) | ||
| 130 | var theTable = dom.getParent(tr_elm, "table"); | ||
| 131 | var dest = rowtype; | ||
| 132 | var newParent = null; | ||
| 133 | for (var i = 0; i < theTable.childNodes.length; i++) { | ||
| 134 | if (theTable.childNodes[i].nodeName.toLowerCase() == dest) | ||
| 135 | newParent = theTable.childNodes[i]; | ||
| 136 | } | ||
| 137 | |||
| 138 | if (newParent == null) { | ||
| 139 | newParent = doc.createElement(dest); | ||
| 140 | |||
| 141 | if (dest == "thead") { | ||
| 142 | if (theTable.firstChild.nodeName == 'CAPTION') | ||
| 143 | inst.dom.insertAfter(newParent, theTable.firstChild); | ||
| 144 | else | ||
| 145 | theTable.insertBefore(newParent, theTable.firstChild); | ||
| 146 | } else | ||
| 147 | theTable.appendChild(newParent); | ||
| 148 | } | ||
| 149 | |||
| 150 | // append the row to the new parent | ||
| 151 | newParent.appendChild(newRow); | ||
| 152 | |||
| 153 | // remove the original | ||
| 154 | tr_elm.parentNode.removeChild(tr_elm); | ||
| 155 | |||
| 156 | // set tr_elm to the new node | ||
| 157 | tr_elm = newRow; | ||
| 158 | } | ||
| 159 | |||
| 160 | dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(tr_elm.style.cssText))); | ||
| 161 | } | ||
| 162 | |||
| 163 | function changedBackgroundImage() { | ||
| 164 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 165 | var st = dom.parseStyle(formObj.style.value); | ||
| 166 | |||
| 167 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 168 | |||
| 169 | formObj.style.value = dom.serializeStyle(st); | ||
| 170 | } | ||
| 171 | |||
| 172 | function changedStyle() { | ||
| 173 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 174 | var st = dom.parseStyle(formObj.style.value); | ||
| 175 | |||
| 176 | if (st['background-image']) | ||
| 177 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 178 | else | ||
| 179 | formObj.backgroundimage.value = ''; | ||
| 180 | |||
| 181 | if (st['height']) | ||
| 182 | formObj.height.value = trimSize(st['height']); | ||
| 183 | |||
| 184 | if (st['background-color']) { | ||
| 185 | formObj.bgcolor.value = st['background-color']; | ||
| 186 | updateColor('bgcolor_pick','bgcolor'); | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | function changedSize() { | ||
| 191 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 192 | var st = dom.parseStyle(formObj.style.value); | ||
| 193 | |||
| 194 | var height = formObj.height.value; | ||
| 195 | if (height != "") | ||
| 196 | st['height'] = getCSSSize(height); | ||
| 197 | else | ||
| 198 | st['height'] = ""; | ||
| 199 | |||
| 200 | formObj.style.value = dom.serializeStyle(st); | ||
| 201 | } | ||
| 202 | |||
| 203 | function changedColor() { | ||
| 204 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 205 | var st = dom.parseStyle(formObj.style.value); | ||
| 206 | |||
| 207 | st['background-color'] = formObj.bgcolor.value; | ||
| 208 | |||
| 209 | formObj.style.value = dom.serializeStyle(st); | ||
| 210 | } | ||
| 211 | |||
| 212 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/js/table.js b/public/javascripts/tiny_mce/plugins/table/js/table.js deleted file mode 100644 index 182589d..0000000 --- a/public/javascripts/tiny_mce/plugins/table/js/table.js +++ /dev/null | |||
| @@ -1,440 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; | ||
| 4 | |||
| 5 | function insertTable() { | ||
| 6 | var formObj = document.forms[0]; | ||
| 7 | var inst = tinyMCEPopup.editor, dom = inst.dom; | ||
| 8 | var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; | ||
| 9 | var html = '', capEl, elm; | ||
| 10 | var cellLimit, rowLimit, colLimit; | ||
| 11 | |||
| 12 | tinyMCEPopup.restoreSelection(); | ||
| 13 | |||
| 14 | if (!AutoValidator.validate(formObj)) { | ||
| 15 | tinyMCEPopup.alert(inst.getLang('invalid_data')); | ||
| 16 | return false; | ||
| 17 | } | ||
| 18 | |||
| 19 | elm = dom.getParent(inst.selection.getNode(), 'table'); | ||
| 20 | |||
| 21 | // Get form data | ||
| 22 | cols = formObj.elements['cols'].value; | ||
| 23 | rows = formObj.elements['rows'].value; | ||
| 24 | border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; | ||
| 25 | cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; | ||
| 26 | cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; | ||
| 27 | align = getSelectValue(formObj, "align"); | ||
| 28 | frame = getSelectValue(formObj, "tframe"); | ||
| 29 | rules = getSelectValue(formObj, "rules"); | ||
| 30 | width = formObj.elements['width'].value; | ||
| 31 | height = formObj.elements['height'].value; | ||
| 32 | bordercolor = formObj.elements['bordercolor'].value; | ||
| 33 | bgcolor = formObj.elements['bgcolor'].value; | ||
| 34 | className = getSelectValue(formObj, "class"); | ||
| 35 | id = formObj.elements['id'].value; | ||
| 36 | summary = formObj.elements['summary'].value; | ||
| 37 | style = formObj.elements['style'].value; | ||
| 38 | dir = formObj.elements['dir'].value; | ||
| 39 | lang = formObj.elements['lang'].value; | ||
| 40 | background = formObj.elements['backgroundimage'].value; | ||
| 41 | caption = formObj.elements['caption'].checked; | ||
| 42 | |||
| 43 | cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); | ||
| 44 | rowLimit = tinyMCEPopup.getParam('table_row_limit', false); | ||
| 45 | colLimit = tinyMCEPopup.getParam('table_col_limit', false); | ||
| 46 | |||
| 47 | // Validate table size | ||
| 48 | if (colLimit && cols > colLimit) { | ||
| 49 | tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); | ||
| 50 | return false; | ||
| 51 | } else if (rowLimit && rows > rowLimit) { | ||
| 52 | tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); | ||
| 53 | return false; | ||
| 54 | } else if (cellLimit && cols * rows > cellLimit) { | ||
| 55 | tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); | ||
| 56 | return false; | ||
| 57 | } | ||
| 58 | |||
| 59 | // Update table | ||
| 60 | if (action == "update") { | ||
| 61 | inst.execCommand('mceBeginUndoLevel'); | ||
| 62 | |||
| 63 | dom.setAttrib(elm, 'cellPadding', cellpadding, true); | ||
| 64 | dom.setAttrib(elm, 'cellSpacing', cellspacing, true); | ||
| 65 | dom.setAttrib(elm, 'border', border); | ||
| 66 | dom.setAttrib(elm, 'align', align); | ||
| 67 | dom.setAttrib(elm, 'frame', frame); | ||
| 68 | dom.setAttrib(elm, 'rules', rules); | ||
| 69 | dom.setAttrib(elm, 'class', className); | ||
| 70 | dom.setAttrib(elm, 'style', style); | ||
| 71 | dom.setAttrib(elm, 'id', id); | ||
| 72 | dom.setAttrib(elm, 'summary', summary); | ||
| 73 | dom.setAttrib(elm, 'dir', dir); | ||
| 74 | dom.setAttrib(elm, 'lang', lang); | ||
| 75 | |||
| 76 | capEl = inst.dom.select('caption', elm)[0]; | ||
| 77 | |||
| 78 | if (capEl && !caption) | ||
| 79 | capEl.parentNode.removeChild(capEl); | ||
| 80 | |||
| 81 | if (!capEl && caption) { | ||
| 82 | capEl = elm.ownerDocument.createElement('caption'); | ||
| 83 | |||
| 84 | if (!tinymce.isIE) | ||
| 85 | capEl.innerHTML = '<br mce_bogus="1"/>'; | ||
| 86 | |||
| 87 | elm.insertBefore(capEl, elm.firstChild); | ||
| 88 | } | ||
| 89 | |||
| 90 | if (width && inst.settings.inline_styles) { | ||
| 91 | dom.setStyle(elm, 'width', width); | ||
| 92 | dom.setAttrib(elm, 'width', ''); | ||
| 93 | } else { | ||
| 94 | dom.setAttrib(elm, 'width', width, true); | ||
| 95 | dom.setStyle(elm, 'width', ''); | ||
| 96 | } | ||
| 97 | |||
| 98 | // Remove these since they are not valid XHTML | ||
| 99 | dom.setAttrib(elm, 'borderColor', ''); | ||
| 100 | dom.setAttrib(elm, 'bgColor', ''); | ||
| 101 | dom.setAttrib(elm, 'background', ''); | ||
| 102 | |||
| 103 | if (height && inst.settings.inline_styles) { | ||
| 104 | dom.setStyle(elm, 'height', height); | ||
| 105 | dom.setAttrib(elm, 'height', ''); | ||
| 106 | } else { | ||
| 107 | dom.setAttrib(elm, 'height', height, true); | ||
| 108 | dom.setStyle(elm, 'height', ''); | ||
| 109 | } | ||
| 110 | |||
| 111 | if (background != '') | ||
| 112 | elm.style.backgroundImage = "url('" + background + "')"; | ||
| 113 | else | ||
| 114 | elm.style.backgroundImage = ''; | ||
| 115 | |||
| 116 | /* if (tinyMCEPopup.getParam("inline_styles")) { | ||
| 117 | if (width != '') | ||
| 118 | elm.style.width = getCSSSize(width); | ||
| 119 | }*/ | ||
| 120 | |||
| 121 | if (bordercolor != "") { | ||
| 122 | elm.style.borderColor = bordercolor; | ||
| 123 | elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; | ||
| 124 | elm.style.borderWidth = border == "" ? "1px" : border; | ||
| 125 | } else | ||
| 126 | elm.style.borderColor = ''; | ||
| 127 | |||
| 128 | elm.style.backgroundColor = bgcolor; | ||
| 129 | elm.style.height = getCSSSize(height); | ||
| 130 | |||
| 131 | inst.addVisual(); | ||
| 132 | |||
| 133 | // Fix for stange MSIE align bug | ||
| 134 | //elm.outerHTML = elm.outerHTML; | ||
| 135 | |||
| 136 | inst.nodeChanged(); | ||
| 137 | inst.execCommand('mceEndUndoLevel'); | ||
| 138 | |||
| 139 | // Repaint if dimensions changed | ||
| 140 | if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) | ||
| 141 | inst.execCommand('mceRepaint'); | ||
| 142 | |||
| 143 | tinyMCEPopup.close(); | ||
| 144 | return true; | ||
| 145 | } | ||
| 146 | |||
| 147 | // Create new table | ||
| 148 | html += '<table'; | ||
| 149 | |||
| 150 | html += makeAttrib('id', id); | ||
| 151 | html += makeAttrib('border', border); | ||
| 152 | html += makeAttrib('cellpadding', cellpadding); | ||
| 153 | html += makeAttrib('cellspacing', cellspacing); | ||
| 154 | |||
| 155 | if (width && inst.settings.inline_styles) { | ||
| 156 | if (style) | ||
| 157 | style += '; '; | ||
| 158 | |||
| 159 | // Force px | ||
| 160 | if (/^[0-9\.]+$/.test(width)) | ||
| 161 | width += 'px'; | ||
| 162 | |||
| 163 | style += 'width: ' + width; | ||
| 164 | } else | ||
| 165 | html += makeAttrib('width', width); | ||
| 166 | |||
| 167 | /* if (height) { | ||
| 168 | if (style) | ||
| 169 | style += '; '; | ||
| 170 | |||
| 171 | style += 'height: ' + height; | ||
| 172 | }*/ | ||
| 173 | |||
| 174 | //html += makeAttrib('height', height); | ||
| 175 | //html += makeAttrib('bordercolor', bordercolor); | ||
| 176 | //html += makeAttrib('bgcolor', bgcolor); | ||
| 177 | html += makeAttrib('align', align); | ||
| 178 | html += makeAttrib('frame', frame); | ||
| 179 | html += makeAttrib('rules', rules); | ||
| 180 | html += makeAttrib('class', className); | ||
| 181 | html += makeAttrib('style', style); | ||
| 182 | html += makeAttrib('summary', summary); | ||
| 183 | html += makeAttrib('dir', dir); | ||
| 184 | html += makeAttrib('lang', lang); | ||
| 185 | html += '>'; | ||
| 186 | |||
| 187 | if (caption) { | ||
| 188 | if (!tinymce.isIE) | ||
| 189 | html += '<caption><br mce_bogus="1"/></caption>'; | ||
| 190 | else | ||
| 191 | html += '<caption></caption>'; | ||
| 192 | } | ||
| 193 | |||
| 194 | for (var y=0; y<rows; y++) { | ||
| 195 | html += "<tr>"; | ||
| 196 | |||
| 197 | for (var x=0; x<cols; x++) { | ||
| 198 | if (!tinymce.isIE) | ||
| 199 | html += '<td><br mce_bogus="1"/></td>'; | ||
| 200 | else | ||
| 201 | html += '<td></td>'; | ||
| 202 | } | ||
| 203 | |||
| 204 | html += "</tr>"; | ||
| 205 | } | ||
| 206 | |||
| 207 | html += "</table>"; | ||
| 208 | |||
| 209 | inst.execCommand('mceBeginUndoLevel'); | ||
| 210 | |||
| 211 | // Move table | ||
| 212 | if (inst.settings.fix_table_elements) { | ||
| 213 | var bm = inst.selection.getBookmark(), patt = ''; | ||
| 214 | |||
| 215 | inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />'); | ||
| 216 | |||
| 217 | tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { | ||
| 218 | if (patt) | ||
| 219 | patt += ','; | ||
| 220 | |||
| 221 | patt += n + ' ._mce_marker'; | ||
| 222 | }); | ||
| 223 | |||
| 224 | tinymce.each(inst.dom.select(patt), function(n) { | ||
| 225 | inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); | ||
| 226 | }); | ||
| 227 | |||
| 228 | dom.setOuterHTML(dom.select('._mce_marker')[0], html); | ||
| 229 | |||
| 230 | inst.selection.moveToBookmark(bm); | ||
| 231 | } else | ||
| 232 | inst.execCommand('mceInsertContent', false, html); | ||
| 233 | |||
| 234 | inst.addVisual(); | ||
| 235 | inst.execCommand('mceEndUndoLevel'); | ||
| 236 | |||
| 237 | tinyMCEPopup.close(); | ||
| 238 | } | ||
| 239 | |||
| 240 | function makeAttrib(attrib, value) { | ||
| 241 | var formObj = document.forms[0]; | ||
| 242 | var valueElm = formObj.elements[attrib]; | ||
| 243 | |||
| 244 | if (typeof(value) == "undefined" || value == null) { | ||
| 245 | value = ""; | ||
| 246 | |||
| 247 | if (valueElm) | ||
| 248 | value = valueElm.value; | ||
| 249 | } | ||
| 250 | |||
| 251 | if (value == "") | ||
| 252 | return ""; | ||
| 253 | |||
| 254 | // XML encode it | ||
| 255 | value = value.replace(/&/g, '&'); | ||
| 256 | value = value.replace(/\"/g, '"'); | ||
| 257 | value = value.replace(/</g, '<'); | ||
| 258 | value = value.replace(/>/g, '>'); | ||
| 259 | |||
| 260 | return ' ' + attrib + '="' + value + '"'; | ||
| 261 | } | ||
| 262 | |||
| 263 | function init() { | ||
| 264 | tinyMCEPopup.resizeToInnerSize(); | ||
| 265 | |||
| 266 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 267 | document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); | ||
| 268 | document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); | ||
| 269 | document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); | ||
| 270 | |||
| 271 | var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); | ||
| 272 | var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; | ||
| 273 | var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules, frame; | ||
| 274 | var inst = tinyMCEPopup.editor, dom = inst.dom; | ||
| 275 | var formObj = document.forms[0]; | ||
| 276 | var elm = dom.getParent(inst.selection.getNode(), "table"); | ||
| 277 | |||
| 278 | action = tinyMCEPopup.getWindowArg('action'); | ||
| 279 | |||
| 280 | if (!action) | ||
| 281 | action = elm ? "update" : "insert"; | ||
| 282 | |||
| 283 | if (elm && action != "insert") { | ||
| 284 | var rowsAr = elm.rows; | ||
| 285 | var cols = 0; | ||
| 286 | for (var i=0; i<rowsAr.length; i++) | ||
| 287 | if (rowsAr[i].cells.length > cols) | ||
| 288 | cols = rowsAr[i].cells.length; | ||
| 289 | |||
| 290 | cols = cols; | ||
| 291 | rows = rowsAr.length; | ||
| 292 | |||
| 293 | st = dom.parseStyle(dom.getAttrib(elm, "style")); | ||
| 294 | border = trimSize(getStyle(elm, 'border', 'borderWidth')); | ||
| 295 | cellpadding = dom.getAttrib(elm, 'cellpadding', ""); | ||
| 296 | cellspacing = dom.getAttrib(elm, 'cellspacing', ""); | ||
| 297 | width = trimSize(getStyle(elm, 'width', 'width')); | ||
| 298 | height = trimSize(getStyle(elm, 'height', 'height')); | ||
| 299 | bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); | ||
| 300 | bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); | ||
| 301 | align = dom.getAttrib(elm, 'align', align); | ||
| 302 | frame = dom.getAttrib(elm, 'frame'); | ||
| 303 | rules = dom.getAttrib(elm, 'rules'); | ||
| 304 | className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); | ||
| 305 | id = dom.getAttrib(elm, 'id'); | ||
| 306 | summary = dom.getAttrib(elm, 'summary'); | ||
| 307 | style = dom.serializeStyle(st); | ||
| 308 | dir = dom.getAttrib(elm, 'dir'); | ||
| 309 | lang = dom.getAttrib(elm, 'lang'); | ||
| 310 | background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 311 | formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; | ||
| 312 | |||
| 313 | orgTableWidth = width; | ||
| 314 | orgTableHeight = height; | ||
| 315 | |||
| 316 | action = "update"; | ||
| 317 | formObj.insert.value = inst.getLang('update'); | ||
| 318 | } | ||
| 319 | |||
| 320 | addClassesToList('class', "table_styles"); | ||
| 321 | TinyMCE_EditableSelects.init(); | ||
| 322 | |||
| 323 | // Update form | ||
| 324 | selectByValue(formObj, 'align', align); | ||
| 325 | selectByValue(formObj, 'tframe', frame); | ||
| 326 | selectByValue(formObj, 'rules', rules); | ||
| 327 | selectByValue(formObj, 'class', className, true, true); | ||
| 328 | formObj.cols.value = cols; | ||
| 329 | formObj.rows.value = rows; | ||
| 330 | formObj.border.value = border; | ||
| 331 | formObj.cellpadding.value = cellpadding; | ||
| 332 | formObj.cellspacing.value = cellspacing; | ||
| 333 | formObj.width.value = width; | ||
| 334 | formObj.height.value = height; | ||
| 335 | formObj.bordercolor.value = bordercolor; | ||
| 336 | formObj.bgcolor.value = bgcolor; | ||
| 337 | formObj.id.value = id; | ||
| 338 | formObj.summary.value = summary; | ||
| 339 | formObj.style.value = style; | ||
| 340 | formObj.dir.value = dir; | ||
| 341 | formObj.lang.value = lang; | ||
| 342 | formObj.backgroundimage.value = background; | ||
| 343 | |||
| 344 | updateColor('bordercolor_pick', 'bordercolor'); | ||
| 345 | updateColor('bgcolor_pick', 'bgcolor'); | ||
| 346 | |||
| 347 | // Resize some elements | ||
| 348 | if (isVisible('backgroundimagebrowser')) | ||
| 349 | document.getElementById('backgroundimage').style.width = '180px'; | ||
| 350 | |||
| 351 | // Disable some fields in update mode | ||
| 352 | if (action == "update") { | ||
| 353 | formObj.cols.disabled = true; | ||
| 354 | formObj.rows.disabled = true; | ||
| 355 | } | ||
| 356 | } | ||
| 357 | |||
| 358 | function changedSize() { | ||
| 359 | var formObj = document.forms[0]; | ||
| 360 | var st = dom.parseStyle(formObj.style.value); | ||
| 361 | |||
| 362 | /* var width = formObj.width.value; | ||
| 363 | if (width != "") | ||
| 364 | st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; | ||
| 365 | else | ||
| 366 | st['width'] = "";*/ | ||
| 367 | |||
| 368 | var height = formObj.height.value; | ||
| 369 | if (height != "") | ||
| 370 | st['height'] = getCSSSize(height); | ||
| 371 | else | ||
| 372 | st['height'] = ""; | ||
| 373 | |||
| 374 | formObj.style.value = dom.serializeStyle(st); | ||
| 375 | } | ||
| 376 | |||
| 377 | function changedBackgroundImage() { | ||
| 378 | var formObj = document.forms[0]; | ||
| 379 | var st = dom.parseStyle(formObj.style.value); | ||
| 380 | |||
| 381 | st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; | ||
| 382 | |||
| 383 | formObj.style.value = dom.serializeStyle(st); | ||
| 384 | } | ||
| 385 | |||
| 386 | function changedBorder() { | ||
| 387 | var formObj = document.forms[0]; | ||
| 388 | var st = dom.parseStyle(formObj.style.value); | ||
| 389 | |||
| 390 | // Update border width if the element has a color | ||
| 391 | if (formObj.border.value != "" && formObj.bordercolor.value != "") | ||
| 392 | st['border-width'] = formObj.border.value + "px"; | ||
| 393 | |||
| 394 | formObj.style.value = dom.serializeStyle(st); | ||
| 395 | } | ||
| 396 | |||
| 397 | function changedColor() { | ||
| 398 | var formObj = document.forms[0]; | ||
| 399 | var st = dom.parseStyle(formObj.style.value); | ||
| 400 | |||
| 401 | st['background-color'] = formObj.bgcolor.value; | ||
| 402 | |||
| 403 | if (formObj.bordercolor.value != "") { | ||
| 404 | st['border-color'] = formObj.bordercolor.value; | ||
| 405 | |||
| 406 | // Add border-width if it's missing | ||
| 407 | if (!st['border-width']) | ||
| 408 | st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; | ||
| 409 | } | ||
| 410 | |||
| 411 | formObj.style.value = dom.serializeStyle(st); | ||
| 412 | } | ||
| 413 | |||
| 414 | function changedStyle() { | ||
| 415 | var formObj = document.forms[0]; | ||
| 416 | var st = dom.parseStyle(formObj.style.value); | ||
| 417 | |||
| 418 | if (st['background-image']) | ||
| 419 | formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); | ||
| 420 | else | ||
| 421 | formObj.backgroundimage.value = ''; | ||
| 422 | |||
| 423 | if (st['width']) | ||
| 424 | formObj.width.value = trimSize(st['width']); | ||
| 425 | |||
| 426 | if (st['height']) | ||
| 427 | formObj.height.value = trimSize(st['height']); | ||
| 428 | |||
| 429 | if (st['background-color']) { | ||
| 430 | formObj.bgcolor.value = st['background-color']; | ||
| 431 | updateColor('bgcolor_pick','bgcolor'); | ||
| 432 | } | ||
| 433 | |||
| 434 | if (st['border-color']) { | ||
| 435 | formObj.bordercolor.value = st['border-color']; | ||
| 436 | updateColor('bordercolor_pick','bordercolor'); | ||
| 437 | } | ||
| 438 | } | ||
| 439 | |||
| 440 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js deleted file mode 100644 index 000332a..0000000 --- a/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,74 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.table_dlg',{ | ||
| 2 | general_tab:"General", | ||
| 3 | advanced_tab:"Advanced", | ||
| 4 | general_props:"General properties", | ||
| 5 | advanced_props:"Advanced properties", | ||
| 6 | rowtype:"Row in table part", | ||
| 7 | title:"Insert/Modify table", | ||
| 8 | width:"Width", | ||
| 9 | height:"Height", | ||
| 10 | cols:"Cols", | ||
| 11 | rows:"Rows", | ||
| 12 | cellspacing:"Cellspacing", | ||
| 13 | cellpadding:"Cellpadding", | ||
| 14 | border:"Border", | ||
| 15 | align:"Alignment", | ||
| 16 | align_default:"Default", | ||
| 17 | align_left:"Left", | ||
| 18 | align_right:"Right", | ||
| 19 | align_middle:"Center", | ||
| 20 | row_title:"Table row properties", | ||
| 21 | cell_title:"Table cell properties", | ||
| 22 | cell_type:"Cell type", | ||
| 23 | valign:"Vertical alignment", | ||
| 24 | align_top:"Top", | ||
| 25 | align_bottom:"Bottom", | ||
| 26 | bordercolor:"Border color", | ||
| 27 | bgcolor:"Background color", | ||
| 28 | merge_cells_title:"Merge table cells", | ||
| 29 | id:"Id", | ||
| 30 | style:"Style", | ||
| 31 | langdir:"Language direction", | ||
| 32 | langcode:"Language code", | ||
| 33 | mime:"Target MIME type", | ||
| 34 | ltr:"Left to right", | ||
| 35 | rtl:"Right to left", | ||
| 36 | bgimage:"Background image", | ||
| 37 | summary:"Summary", | ||
| 38 | td:"Data", | ||
| 39 | th:"Header", | ||
| 40 | cell_cell:"Update current cell", | ||
| 41 | cell_row:"Update all cells in row", | ||
| 42 | cell_all:"Update all cells in table", | ||
| 43 | row_row:"Update current row", | ||
| 44 | row_odd:"Update odd rows in table", | ||
| 45 | row_even:"Update even rows in table", | ||
| 46 | row_all:"Update all rows in table", | ||
| 47 | thead:"Table Head", | ||
| 48 | tbody:"Table Body", | ||
| 49 | tfoot:"Table Foot", | ||
| 50 | scope:"Scope", | ||
| 51 | rowgroup:"Row Group", | ||
| 52 | colgroup:"Col Group", | ||
| 53 | col_limit:"You've exceeded the maximum number of columns of {$cols}.", | ||
| 54 | row_limit:"You've exceeded the maximum number of rows of {$rows}.", | ||
| 55 | cell_limit:"You've exceeded the maximum number of cells of {$cells}.", | ||
| 56 | missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", | ||
| 57 | caption:"Table caption", | ||
| 58 | frame:"Frame", | ||
| 59 | frame_none:"none", | ||
| 60 | frame_groups:"groups", | ||
| 61 | frame_rows:"rows", | ||
| 62 | frame_cols:"cols", | ||
| 63 | frame_all:"all", | ||
| 64 | rules:"Rules", | ||
| 65 | rules_void:"void", | ||
| 66 | rules_above:"above", | ||
| 67 | rules_below:"below", | ||
| 68 | rules_hsides:"hsides", | ||
| 69 | rules_lhs:"lhs", | ||
| 70 | rules_rhs:"rhs", | ||
| 71 | rules_vsides:"vsides", | ||
| 72 | rules_box:"box", | ||
| 73 | rules_border:"border" | ||
| 74 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/merge_cells.htm b/public/javascripts/tiny_mce/plugins/table/merge_cells.htm deleted file mode 100644 index 25d42eb..0000000 --- a/public/javascripts/tiny_mce/plugins/table/merge_cells.htm +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.merge_cells_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 8 | <script type="text/javascript" src="js/merge_cells.js"></script> | ||
| 9 | </head> | ||
| 10 | <body style="margin: 8px"> | ||
| 11 | <form onsubmit="mergeCells();return false;" action="#"> | ||
| 12 | <fieldset> | ||
| 13 | <legend>{#table_dlg.merge_cells_title}</legend> | ||
| 14 | <table border="0" cellpadding="0" cellspacing="3" width="100%"> | ||
| 15 | <tr> | ||
| 16 | <td>{#table_dlg.cols}:</td> | ||
| 17 | <td align="right"><input type="text" name="numcols" value="" class="number min1 mceFocus" style="width: 30px" /></td> | ||
| 18 | </tr> | ||
| 19 | <tr> | ||
| 20 | <td>{#table_dlg.rows}:</td> | ||
| 21 | <td align="right"><input type="text" name="numrows" value="" class="number min1" style="width: 30px" /></td> | ||
| 22 | </tr> | ||
| 23 | </table> | ||
| 24 | </fieldset> | ||
| 25 | |||
| 26 | <div class="mceActionPanel"> | ||
| 27 | <div style="float: left"> | ||
| 28 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 29 | </div> | ||
| 30 | |||
| 31 | <div style="float: right"> | ||
| 32 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | </form> | ||
| 36 | </body> | ||
| 37 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/row.htm b/public/javascripts/tiny_mce/plugins/table/row.htm deleted file mode 100644 index 07ca13c..0000000 --- a/public/javascripts/tiny_mce/plugins/table/row.htm +++ /dev/null | |||
| @@ -1,160 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.row_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/row.js"></script> | ||
| 10 | <link href="css/row.css" rel="stylesheet" type="text/css" /> | ||
| 11 | </head> | ||
| 12 | <body id="tablerow" style="display: none"> | ||
| 13 | <form onsubmit="updateAction();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 17 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 18 | </ul> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div class="panel_wrapper"> | ||
| 22 | <div id="general_panel" class="panel current"> | ||
| 23 | <fieldset> | ||
| 24 | <legend>{#table_dlg.general_props}</legend> | ||
| 25 | |||
| 26 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 27 | <tr> | ||
| 28 | <td><label for="rowtype">{#table_dlg.rowtype}</label></td> | ||
| 29 | <td class="col2"> | ||
| 30 | <select id="rowtype" name="rowtype" class="mceFocus"> | ||
| 31 | <option value="thead">{#table_dlg.thead}</option> | ||
| 32 | <option value="tbody">{#table_dlg.tbody}</option> | ||
| 33 | <option value="tfoot">{#table_dlg.tfoot}</option> | ||
| 34 | </select> | ||
| 35 | </td> | ||
| 36 | </tr> | ||
| 37 | |||
| 38 | <tr> | ||
| 39 | <td><label for="align">{#table_dlg.align}</label></td> | ||
| 40 | <td class="col2"> | ||
| 41 | <select id="align" name="align"> | ||
| 42 | <option value="">{#not_set}</option> | ||
| 43 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 44 | <option value="left">{#table_dlg.align_left}</option> | ||
| 45 | <option value="right">{#table_dlg.align_right}</option> | ||
| 46 | </select> | ||
| 47 | </td> | ||
| 48 | </tr> | ||
| 49 | |||
| 50 | <tr> | ||
| 51 | <td><label for="valign">{#table_dlg.valign}</label></td> | ||
| 52 | <td class="col2"> | ||
| 53 | <select id="valign" name="valign"> | ||
| 54 | <option value="">{#not_set}</option> | ||
| 55 | <option value="top">{#table_dlg.align_top}</option> | ||
| 56 | <option value="middle">{#table_dlg.align_middle}</option> | ||
| 57 | <option value="bottom">{#table_dlg.align_bottom}</option> | ||
| 58 | </select> | ||
| 59 | </td> | ||
| 60 | </tr> | ||
| 61 | |||
| 62 | <tr id="styleSelectRow"> | ||
| 63 | <td><label for="class">{#class_name}</label></td> | ||
| 64 | <td class="col2"> | ||
| 65 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 66 | <option value="" selected="selected">{#not_set}</option> | ||
| 67 | </select> | ||
| 68 | </td> | ||
| 69 | </tr> | ||
| 70 | |||
| 71 | <tr> | ||
| 72 | <td><label for="height">{#table_dlg.height}</label></td> | ||
| 73 | <td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td> | ||
| 74 | </tr> | ||
| 75 | </table> | ||
| 76 | </fieldset> | ||
| 77 | </div> | ||
| 78 | |||
| 79 | <div id="advanced_panel" class="panel"> | ||
| 80 | <fieldset> | ||
| 81 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 82 | |||
| 83 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 84 | <tr> | ||
| 85 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 86 | <td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> | ||
| 87 | </tr> | ||
| 88 | |||
| 89 | <tr> | ||
| 90 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 91 | <td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td> | ||
| 92 | </tr> | ||
| 93 | |||
| 94 | <tr> | ||
| 95 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 96 | <td> | ||
| 97 | <select id="dir" name="dir" style="width: 200px"> | ||
| 98 | <option value="">{#not_set}</option> | ||
| 99 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 100 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 101 | </select> | ||
| 102 | </td> | ||
| 103 | </tr> | ||
| 104 | |||
| 105 | <tr> | ||
| 106 | <td class="column1"><label for="lang">{#table_dlg.langcode}</label></td> | ||
| 107 | <td> | ||
| 108 | <input id="lang" name="lang" type="text" value="" style="width: 200px" /> | ||
| 109 | </td> | ||
| 110 | </tr> | ||
| 111 | |||
| 112 | <tr> | ||
| 113 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 114 | <td> | ||
| 115 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 116 | <tr> | ||
| 117 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td> | ||
| 118 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 119 | </tr> | ||
| 120 | </table> | ||
| 121 | </td> | ||
| 122 | </tr> | ||
| 123 | |||
| 124 | <tr> | ||
| 125 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 126 | <td> | ||
| 127 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 128 | <tr> | ||
| 129 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 130 | <td id="bgcolor_pickcontainer"> </td> | ||
| 131 | </tr> | ||
| 132 | </table> | ||
| 133 | </td> | ||
| 134 | </tr> | ||
| 135 | </table> | ||
| 136 | </fieldset> | ||
| 137 | </div> | ||
| 138 | </div> | ||
| 139 | |||
| 140 | <div class="mceActionPanel"> | ||
| 141 | <div> | ||
| 142 | <select id="action" name="action"> | ||
| 143 | <option value="row">{#table_dlg.row_row}</option> | ||
| 144 | <option value="odd">{#table_dlg.row_odd}</option> | ||
| 145 | <option value="even">{#table_dlg.row_even}</option> | ||
| 146 | <option value="all">{#table_dlg.row_all}</option> | ||
| 147 | </select> | ||
| 148 | </div> | ||
| 149 | |||
| 150 | <div style="float: left"> | ||
| 151 | <div><input type="submit" id="insert" name="insert" value="{#update}" /></div> | ||
| 152 | </div> | ||
| 153 | |||
| 154 | <div style="float: right"> | ||
| 155 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 156 | </div> | ||
| 157 | </div> | ||
| 158 | </form> | ||
| 159 | </body> | ||
| 160 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/table/table.htm b/public/javascripts/tiny_mce/plugins/table/table.htm deleted file mode 100644 index 37e6159..0000000 --- a/public/javascripts/tiny_mce/plugins/table/table.htm +++ /dev/null | |||
| @@ -1,192 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#table_dlg.title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 10 | <script type="text/javascript" src="js/table.js"></script> | ||
| 11 | <link href="css/table.css" rel="stylesheet" type="text/css" /> | ||
| 12 | </head> | ||
| 13 | <body id="table" style="display: none"> | ||
| 14 | <form onsubmit="insertTable();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#table_dlg.general_tab}</a></span></li> | ||
| 18 | <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#table_dlg.advanced_tab}</a></span></li> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#table_dlg.general_props}</legend> | ||
| 26 | <table border="0" cellpadding="4" cellspacing="0" width="100%"> | ||
| 27 | <tr> | ||
| 28 | <td><label id="colslabel" for="cols">{#table_dlg.cols}</label></td> | ||
| 29 | <td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" class="required number min1 mceFocus" /></td> | ||
| 30 | <td><label id="rowslabel" for="rows">{#table_dlg.rows}</label></td> | ||
| 31 | <td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" class="required number min1" /></td> | ||
| 32 | </tr> | ||
| 33 | <tr> | ||
| 34 | <td><label id="cellpaddinglabel" for="cellpadding">{#table_dlg.cellpadding}</label></td> | ||
| 35 | <td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" class="number" /></td> | ||
| 36 | <td><label id="cellspacinglabel" for="cellspacing">{#table_dlg.cellspacing}</label></td> | ||
| 37 | <td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" class="number" /></td> | ||
| 38 | </tr> | ||
| 39 | <tr> | ||
| 40 | <td><label id="alignlabel" for="align">{#table_dlg.align}</label></td> | ||
| 41 | <td><select id="align" name="align"> | ||
| 42 | <option value="">{#not_set}</option> | ||
| 43 | <option value="center">{#table_dlg.align_middle}</option> | ||
| 44 | <option value="left">{#table_dlg.align_left}</option> | ||
| 45 | <option value="right">{#table_dlg.align_right}</option> | ||
| 46 | </select></td> | ||
| 47 | <td><label id="borderlabel" for="border">{#table_dlg.border}</label></td> | ||
| 48 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" class="number" /></td> | ||
| 49 | </tr> | ||
| 50 | <tr id="width_row"> | ||
| 51 | <td><label id="widthlabel" for="width">{#table_dlg.width}</label></td> | ||
| 52 | <td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> | ||
| 53 | <td><label id="heightlabel" for="height">{#table_dlg.height}</label></td> | ||
| 54 | <td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" class="size" /></td> | ||
| 55 | </tr> | ||
| 56 | <tr id="styleSelectRow"> | ||
| 57 | <td><label id="classlabel" for="class">{#class_name}</label></td> | ||
| 58 | <td colspan="3"> | ||
| 59 | <select id="class" name="class" class="mceEditableSelect"> | ||
| 60 | <option value="" selected="selected">{#not_set}</option> | ||
| 61 | </select></td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td class="column1"><label for="caption">{#table_dlg.caption}</label></td> | ||
| 65 | <td><input id="caption" name="caption" type="checkbox" class="checkbox" value="true" /></td> | ||
| 66 | </tr> | ||
| 67 | </table> | ||
| 68 | </fieldset> | ||
| 69 | </div> | ||
| 70 | |||
| 71 | <div id="advanced_panel" class="panel"> | ||
| 72 | <fieldset> | ||
| 73 | <legend>{#table_dlg.advanced_props}</legend> | ||
| 74 | |||
| 75 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 76 | <tr> | ||
| 77 | <td class="column1"><label for="id">{#table_dlg.id}</label></td> | ||
| 78 | <td><input id="id" name="id" type="text" value="" class="advfield" /></td> | ||
| 79 | </tr> | ||
| 80 | |||
| 81 | <tr> | ||
| 82 | <td class="column1"><label for="summary">{#table_dlg.summary}</label></td> | ||
| 83 | <td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> | ||
| 84 | </tr> | ||
| 85 | |||
| 86 | <tr> | ||
| 87 | <td><label for="style">{#table_dlg.style}</label></td> | ||
| 88 | <td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td> | ||
| 89 | </tr> | ||
| 90 | |||
| 91 | <tr> | ||
| 92 | <td class="column1"><label id="langlabel" for="lang">{#table_dlg.langcode}</label></td> | ||
| 93 | <td> | ||
| 94 | <input id="lang" name="lang" type="text" value="" class="advfield" /> | ||
| 95 | </td> | ||
| 96 | </tr> | ||
| 97 | |||
| 98 | <tr> | ||
| 99 | <td class="column1"><label for="backgroundimage">{#table_dlg.bgimage}</label></td> | ||
| 100 | <td> | ||
| 101 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 102 | <tr> | ||
| 103 | <td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td> | ||
| 104 | <td id="backgroundimagebrowsercontainer"> </td> | ||
| 105 | </tr> | ||
| 106 | </table> | ||
| 107 | </td> | ||
| 108 | </tr> | ||
| 109 | |||
| 110 | <tr> | ||
| 111 | <td class="column1"><label for="tframe">{#table_dlg.frame}</label></td> | ||
| 112 | <td> | ||
| 113 | <select id="tframe" name="tframe" class="advfield"> | ||
| 114 | <option value="">{#not_set}</option> | ||
| 115 | <option value="void">{#table_dlg.rules_void}</option> | ||
| 116 | <option value="above">{#table_dlg.rules_above}</option> | ||
| 117 | <option value="below">{#table_dlg.rules_below}</option> | ||
| 118 | <option value="hsides">{#table_dlg.rules_hsides}</option> | ||
| 119 | <option value="lhs">{#table_dlg.rules_lhs}</option> | ||
| 120 | <option value="rhs">{#table_dlg.rules_rhs}</option> | ||
| 121 | <option value="vsides">{#table_dlg.rules_vsides}</option> | ||
| 122 | <option value="box">{#table_dlg.rules_box}</option> | ||
| 123 | <option value="border">{#table_dlg.rules_border}</option> | ||
| 124 | </select> | ||
| 125 | </td> | ||
| 126 | </tr> | ||
| 127 | |||
| 128 | <tr> | ||
| 129 | <td class="column1"><label for="rules">{#table_dlg.rules}</label></td> | ||
| 130 | <td> | ||
| 131 | <select id="rules" name="rules" class="advfield"> | ||
| 132 | <option value="">{#not_set}</option> | ||
| 133 | <option value="none">{#table_dlg.frame_none}</option> | ||
| 134 | <option value="groups">{#table_dlg.frame_groups}</option> | ||
| 135 | <option value="rows">{#table_dlg.frame_rows}</option> | ||
| 136 | <option value="cols">{#table_dlg.frame_cols}</option> | ||
| 137 | <option value="all">{#table_dlg.frame_all}</option> | ||
| 138 | </select> | ||
| 139 | </td> | ||
| 140 | </tr> | ||
| 141 | |||
| 142 | <tr> | ||
| 143 | <td class="column1"><label for="dir">{#table_dlg.langdir}</label></td> | ||
| 144 | <td> | ||
| 145 | <select id="dir" name="dir" class="advfield"> | ||
| 146 | <option value="">{#not_set}</option> | ||
| 147 | <option value="ltr">{#table_dlg.ltr}</option> | ||
| 148 | <option value="rtl">{#table_dlg.rtl}</option> | ||
| 149 | </select> | ||
| 150 | </td> | ||
| 151 | </tr> | ||
| 152 | |||
| 153 | <tr> | ||
| 154 | <td class="column1"><label for="bordercolor">{#table_dlg.bordercolor}</label></td> | ||
| 155 | <td> | ||
| 156 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 157 | <tr> | ||
| 158 | <td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td> | ||
| 159 | <td id="bordercolor_pickcontainer"> </td> | ||
| 160 | </tr> | ||
| 161 | </table> | ||
| 162 | </td> | ||
| 163 | </tr> | ||
| 164 | |||
| 165 | <tr> | ||
| 166 | <td class="column1"><label for="bgcolor">{#table_dlg.bgcolor}</label></td> | ||
| 167 | <td> | ||
| 168 | <table border="0" cellpadding="0" cellspacing="0"> | ||
| 169 | <tr> | ||
| 170 | <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td> | ||
| 171 | <td id="bgcolor_pickcontainer"> </td> | ||
| 172 | </tr> | ||
| 173 | </table> | ||
| 174 | </td> | ||
| 175 | </tr> | ||
| 176 | </table> | ||
| 177 | </fieldset> | ||
| 178 | </div> | ||
| 179 | </div> | ||
| 180 | |||
| 181 | <div class="mceActionPanel"> | ||
| 182 | <div style="float: left"> | ||
| 183 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 184 | </div> | ||
| 185 | |||
| 186 | <div style="float: right"> | ||
| 187 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 188 | </div> | ||
| 189 | </div> | ||
| 190 | </form> | ||
| 191 | </body> | ||
| 192 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/blank.htm b/public/javascripts/tiny_mce/plugins/template/blank.htm deleted file mode 100644 index ecde53f..0000000 --- a/public/javascripts/tiny_mce/plugins/template/blank.htm +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>blank_page</title> | ||
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
| 5 | <script type="text/javascript"> | ||
| 6 | parent.TemplateDialog.loadCSSFiles(document); | ||
| 7 | </script> | ||
| 8 | </head> | ||
| 9 | <body id="mceTemplatePreview" class="mceContentBody"> | ||
| 10 | |||
| 11 | </body> | ||
| 12 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/css/template.css b/public/javascripts/tiny_mce/plugins/template/css/template.css deleted file mode 100644 index 2d23a49..0000000 --- a/public/javascripts/tiny_mce/plugins/template/css/template.css +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #frmbody { | ||
| 2 | padding: 10px; | ||
| 3 | background-color: #FFF; | ||
| 4 | border: 1px solid #CCC; | ||
| 5 | } | ||
| 6 | |||
| 7 | .frmRow { | ||
| 8 | margin-bottom: 10px; | ||
| 9 | } | ||
| 10 | |||
| 11 | #templatesrc { | ||
| 12 | border: none; | ||
| 13 | width: 320px; | ||
| 14 | height: 240px; | ||
| 15 | } | ||
| 16 | |||
| 17 | .title { | ||
| 18 | padding-bottom: 5px; | ||
| 19 | } | ||
| 20 | |||
| 21 | .mceActionPanel { | ||
| 22 | padding-top: 5px; | ||
| 23 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin.js deleted file mode 100644 index ebe3c27..0000000 --- a/public/javascripts/tiny_mce/plugins/template/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js deleted file mode 100644 index 09057ec..0000000 --- a/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,156 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | var each = tinymce.each; | ||
| 10 | |||
| 11 | tinymce.create('tinymce.plugins.TemplatePlugin', { | ||
| 12 | init : function(ed, url) { | ||
| 13 | var t = this; | ||
| 14 | |||
| 15 | t.editor = ed; | ||
| 16 | |||
| 17 | // Register commands | ||
| 18 | ed.addCommand('mceTemplate', function(ui) { | ||
| 19 | ed.windowManager.open({ | ||
| 20 | file : url + '/template.htm', | ||
| 21 | width : ed.getParam('template_popup_width', 750), | ||
| 22 | height : ed.getParam('template_popup_height', 600), | ||
| 23 | inline : 1 | ||
| 24 | }, { | ||
| 25 | plugin_url : url | ||
| 26 | }); | ||
| 27 | }); | ||
| 28 | |||
| 29 | ed.addCommand('mceInsertTemplate', t._insertTemplate, t); | ||
| 30 | |||
| 31 | // Register buttons | ||
| 32 | ed.addButton('template', {title : 'template.desc', cmd : 'mceTemplate'}); | ||
| 33 | |||
| 34 | ed.onPreProcess.add(function(ed, o) { | ||
| 35 | var dom = ed.dom; | ||
| 36 | |||
| 37 | each(dom.select('div', o.node), function(e) { | ||
| 38 | if (dom.hasClass(e, 'mceTmpl')) { | ||
| 39 | each(dom.select('*', e), function(e) { | ||
| 40 | if (dom.hasClass(e, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) | ||
| 41 | e.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); | ||
| 42 | }); | ||
| 43 | |||
| 44 | t._replaceVals(e); | ||
| 45 | } | ||
| 46 | }); | ||
| 47 | }); | ||
| 48 | }, | ||
| 49 | |||
| 50 | getInfo : function() { | ||
| 51 | return { | ||
| 52 | longname : 'Template plugin', | ||
| 53 | author : 'Moxiecode Systems AB', | ||
| 54 | authorurl : 'http://www.moxiecode.com', | ||
| 55 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template', | ||
| 56 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 57 | }; | ||
| 58 | }, | ||
| 59 | |||
| 60 | _insertTemplate : function(ui, v) { | ||
| 61 | var t = this, ed = t.editor, h, el, dom = ed.dom, sel = ed.selection.getContent(); | ||
| 62 | |||
| 63 | h = v.content; | ||
| 64 | |||
| 65 | each(t.editor.getParam('template_replace_values'), function(v, k) { | ||
| 66 | if (typeof(v) != 'function') | ||
| 67 | h = h.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); | ||
| 68 | }); | ||
| 69 | |||
| 70 | el = dom.create('div', null, h); | ||
| 71 | |||
| 72 | // Find template element within div | ||
| 73 | n = dom.select('.mceTmpl', el); | ||
| 74 | if (n && n.length > 0) { | ||
| 75 | el = dom.create('div', null); | ||
| 76 | el.appendChild(n[0].cloneNode(true)); | ||
| 77 | } | ||
| 78 | |||
| 79 | function hasClass(n, c) { | ||
| 80 | return new RegExp('\\b' + c + '\\b', 'g').test(n.className); | ||
| 81 | }; | ||
| 82 | |||
| 83 | each(dom.select('*', el), function(n) { | ||
| 84 | // Replace cdate | ||
| 85 | if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) | ||
| 86 | n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); | ||
| 87 | |||
| 88 | // Replace mdate | ||
| 89 | if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) | ||
| 90 | n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); | ||
| 91 | |||
| 92 | // Replace selection | ||
| 93 | if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) | ||
| 94 | n.innerHTML = sel; | ||
| 95 | }); | ||
| 96 | |||
| 97 | t._replaceVals(el); | ||
| 98 | |||
| 99 | ed.execCommand('mceInsertContent', false, el.innerHTML); | ||
| 100 | ed.addVisual(); | ||
| 101 | }, | ||
| 102 | |||
| 103 | _replaceVals : function(e) { | ||
| 104 | var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); | ||
| 105 | |||
| 106 | each(dom.select('*', e), function(e) { | ||
| 107 | each(vl, function(v, k) { | ||
| 108 | if (dom.hasClass(e, k)) { | ||
| 109 | if (typeof(vl[k]) == 'function') | ||
| 110 | vl[k](e); | ||
| 111 | } | ||
| 112 | }); | ||
| 113 | }); | ||
| 114 | }, | ||
| 115 | |||
| 116 | _getDateTime : function(d, fmt) { | ||
| 117 | if (!fmt) | ||
| 118 | return ""; | ||
| 119 | |||
| 120 | function addZeros(value, len) { | ||
| 121 | var i; | ||
| 122 | |||
| 123 | value = "" + value; | ||
| 124 | |||
| 125 | if (value.length < len) { | ||
| 126 | for (i=0; i<(len-value.length); i++) | ||
| 127 | value = "0" + value; | ||
| 128 | } | ||
| 129 | |||
| 130 | return value; | ||
| 131 | } | ||
| 132 | |||
| 133 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 134 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 135 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 136 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 137 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 138 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 139 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 140 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 141 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 142 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 143 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 144 | fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); | ||
| 145 | fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); | ||
| 146 | fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); | ||
| 147 | fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); | ||
| 148 | fmt = fmt.replace("%%", "%"); | ||
| 149 | |||
| 150 | return fmt; | ||
| 151 | } | ||
| 152 | }); | ||
| 153 | |||
| 154 | // Register plugin | ||
| 155 | tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); | ||
| 156 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/js/template.js b/public/javascripts/tiny_mce/plugins/template/js/template.js deleted file mode 100644 index 24045d7..0000000 --- a/public/javascripts/tiny_mce/plugins/template/js/template.js +++ /dev/null | |||
| @@ -1,106 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var TemplateDialog = { | ||
| 4 | preInit : function() { | ||
| 5 | var url = tinyMCEPopup.getParam("template_external_list_url"); | ||
| 6 | |||
| 7 | if (url != null) | ||
| 8 | document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var ed = tinyMCEPopup.editor, tsrc, sel, x, u; | ||
| 13 | |||
| 14 | tsrc = ed.getParam("template_templates", false); | ||
| 15 | sel = document.getElementById('tpath'); | ||
| 16 | |||
| 17 | // Setup external template list | ||
| 18 | if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { | ||
| 19 | for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++) | ||
| 20 | tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]}); | ||
| 21 | } | ||
| 22 | |||
| 23 | for (x=0; x<tsrc.length; x++) | ||
| 24 | sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src)); | ||
| 25 | |||
| 26 | this.resize(); | ||
| 27 | this.tsrc = tsrc; | ||
| 28 | }, | ||
| 29 | |||
| 30 | resize : function() { | ||
| 31 | var w, h, e; | ||
| 32 | |||
| 33 | if (!self.innerWidth) { | ||
| 34 | w = document.body.clientWidth - 50; | ||
| 35 | h = document.body.clientHeight - 160; | ||
| 36 | } else { | ||
| 37 | w = self.innerWidth - 50; | ||
| 38 | h = self.innerHeight - 170; | ||
| 39 | } | ||
| 40 | |||
| 41 | e = document.getElementById('templatesrc'); | ||
| 42 | |||
| 43 | if (e) { | ||
| 44 | e.style.height = Math.abs(h) + 'px'; | ||
| 45 | e.style.width = Math.abs(w - 5) + 'px'; | ||
| 46 | } | ||
| 47 | }, | ||
| 48 | |||
| 49 | loadCSSFiles : function(d) { | ||
| 50 | var ed = tinyMCEPopup.editor; | ||
| 51 | |||
| 52 | tinymce.each(ed.getParam("content_css", '').split(','), function(u) { | ||
| 53 | d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />'); | ||
| 54 | }); | ||
| 55 | }, | ||
| 56 | |||
| 57 | selectTemplate : function(u, ti) { | ||
| 58 | var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; | ||
| 59 | |||
| 60 | if (!u) | ||
| 61 | return; | ||
| 62 | |||
| 63 | d.body.innerHTML = this.templateHTML = this.getFileContents(u); | ||
| 64 | |||
| 65 | for (x=0; x<tsrc.length; x++) { | ||
| 66 | if (tsrc[x].title == ti) | ||
| 67 | document.getElementById('tmpldesc').innerHTML = tsrc[x].description || ''; | ||
| 68 | } | ||
| 69 | }, | ||
| 70 | |||
| 71 | insert : function() { | ||
| 72 | tinyMCEPopup.execCommand('mceInsertTemplate', false, { | ||
| 73 | content : this.templateHTML, | ||
| 74 | selection : tinyMCEPopup.editor.selection.getContent() | ||
| 75 | }); | ||
| 76 | |||
| 77 | tinyMCEPopup.close(); | ||
| 78 | }, | ||
| 79 | |||
| 80 | getFileContents : function(u) { | ||
| 81 | var x, d, t = 'text/plain'; | ||
| 82 | |||
| 83 | function g(s) { | ||
| 84 | x = 0; | ||
| 85 | |||
| 86 | try { | ||
| 87 | x = new ActiveXObject(s); | ||
| 88 | } catch (s) { | ||
| 89 | } | ||
| 90 | |||
| 91 | return x; | ||
| 92 | }; | ||
| 93 | |||
| 94 | x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest(); | ||
| 95 | |||
| 96 | // Synchronous AJAX load file | ||
| 97 | x.overrideMimeType && x.overrideMimeType(t); | ||
| 98 | x.open("GET", u, false); | ||
| 99 | x.send(null); | ||
| 100 | |||
| 101 | return x.responseText; | ||
| 102 | } | ||
| 103 | }; | ||
| 104 | |||
| 105 | TemplateDialog.preInit(); | ||
| 106 | tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog); | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js deleted file mode 100644 index 2471c3f..0000000 --- a/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.template_dlg',{ | ||
| 2 | title:"Templates", | ||
| 3 | label:"Template", | ||
| 4 | desc_label:"Description", | ||
| 5 | desc:"Insert predefined template content", | ||
| 6 | select:"Select a template", | ||
| 7 | preview:"Preview", | ||
| 8 | warning:"Warning: Updating a template with a different one may cause data loss.", | ||
| 9 | mdate_format:"%Y-%m-%d %H:%M:%S", | ||
| 10 | cdate_format:"%Y-%m-%d %H:%M:%S", | ||
| 11 | months_long:"January,February,March,April,May,June,July,August,September,October,November,December", | ||
| 12 | months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", | ||
| 13 | day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", | ||
| 14 | day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" | ||
| 15 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/template/template.htm b/public/javascripts/tiny_mce/plugins/template/template.htm deleted file mode 100644 index f7bb044..0000000 --- a/public/javascripts/tiny_mce/plugins/template/template.htm +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <title>{#template_dlg.title}</title> | ||
| 4 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 5 | <script type="text/javascript" src="js/template.js"></script> | ||
| 6 | <link href="css/template.css" rel="stylesheet" type="text/css" /> | ||
| 7 | </head> | ||
| 8 | <body onresize="TemplateDialog.resize();"> | ||
| 9 | <form onsubmit="TemplateDialog.insert();return false;"> | ||
| 10 | <div id="frmbody"> | ||
| 11 | <div class="title">{#template_dlg.desc}</div> | ||
| 12 | <div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label> | ||
| 13 | <select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus"> | ||
| 14 | <option value="">{#template_dlg.select}...</option> | ||
| 15 | </select> | ||
| 16 | <span id="warning"></span></div> | ||
| 17 | <div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label> | ||
| 18 | <span id="tmpldesc"></span></div> | ||
| 19 | <fieldset> | ||
| 20 | <legend>{#template_dlg.preview}</legend> | ||
| 21 | <iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe> | ||
| 22 | </fieldset> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div class="mceActionPanel"> | ||
| 26 | <div style="float: left"> | ||
| 27 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 28 | </div> | ||
| 29 | |||
| 30 | <div style="float: right"> | ||
| 31 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 32 | </div> | ||
| 33 | |||
| 34 | <br style="clear:both" /> | ||
| 35 | </div> | ||
| 36 | </form> | ||
| 37 | </body> | ||
| 38 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js deleted file mode 100644 index 53d31c4..0000000 --- a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state){c.state=true;c._toggleVisualChars()}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(){var m=this,g=m.editor,a,e,f,k=g.getDoc(),l=g.getBody(),j,n=g.selection,c;m.state=!m.state;g.controlManager.setActive("visualchars",m.state);if(m.state){a=[];tinymce.walk(l,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(e=0;e<a.length;e++){j=a[e].nodeValue;j=j.replace(/(\u00a0+)/g,'<span class="mceItemHidden mceVisualNbsp">$1</span>');j=j.replace(/\u00a0/g,"\u00b7");g.dom.setOuterHTML(a[e],j,k)}}else{a=tinymce.grep(g.dom.select("span",l),function(b){return g.dom.hasClass(b,"mceVisualNbsp")});for(e=0;e<a.length;e++){g.dom.setOuterHTML(a[e],a[e].innerHTML.replace(/(·|\u00b7)/g," "),k)}}}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js deleted file mode 100644 index 02ec4e6..0000000 --- a/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.VisualChars', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | var t = this; | ||
| 12 | |||
| 13 | t.editor = ed; | ||
| 14 | |||
| 15 | // Register commands | ||
| 16 | ed.addCommand('mceVisualChars', t._toggleVisualChars, t); | ||
| 17 | |||
| 18 | // Register buttons | ||
| 19 | ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); | ||
| 20 | |||
| 21 | ed.onBeforeGetContent.add(function(ed, o) { | ||
| 22 | if (t.state) { | ||
| 23 | t.state = true; | ||
| 24 | t._toggleVisualChars(); | ||
| 25 | } | ||
| 26 | }); | ||
| 27 | }, | ||
| 28 | |||
| 29 | getInfo : function() { | ||
| 30 | return { | ||
| 31 | longname : 'Visual characters', | ||
| 32 | author : 'Moxiecode Systems AB', | ||
| 33 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 34 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', | ||
| 35 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 36 | }; | ||
| 37 | }, | ||
| 38 | |||
| 39 | // Private methods | ||
| 40 | |||
| 41 | _toggleVisualChars : function() { | ||
| 42 | var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo; | ||
| 43 | |||
| 44 | t.state = !t.state; | ||
| 45 | ed.controlManager.setActive('visualchars', t.state); | ||
| 46 | |||
| 47 | if (t.state) { | ||
| 48 | nl = []; | ||
| 49 | tinymce.walk(b, function(n) { | ||
| 50 | if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) | ||
| 51 | nl.push(n); | ||
| 52 | }, 'childNodes'); | ||
| 53 | |||
| 54 | for (i=0; i<nl.length; i++) { | ||
| 55 | nv = nl[i].nodeValue; | ||
| 56 | nv = nv.replace(/(\u00a0+)/g, '<span class="mceItemHidden mceVisualNbsp">$1</span>'); | ||
| 57 | nv = nv.replace(/\u00a0/g, '\u00b7'); | ||
| 58 | ed.dom.setOuterHTML(nl[i], nv, d); | ||
| 59 | } | ||
| 60 | } else { | ||
| 61 | nl = tinymce.grep(ed.dom.select('span', b), function(n) { | ||
| 62 | return ed.dom.hasClass(n, 'mceVisualNbsp'); | ||
| 63 | }); | ||
| 64 | |||
| 65 | for (i=0; i<nl.length; i++) | ||
| 66 | ed.dom.setOuterHTML(nl[i], nl[i].innerHTML.replace(/(·|\u00b7)/g, ' '), d); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | }); | ||
| 70 | |||
| 71 | // Register plugin | ||
| 72 | tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); | ||
| 73 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js b/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js deleted file mode 100644 index f192835..0000000 --- a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js deleted file mode 100644 index 41b78a9..0000000 --- a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.WordCount', { | ||
| 10 | block : 0, | ||
| 11 | id : null, | ||
| 12 | countre : null, | ||
| 13 | cleanre : null, | ||
| 14 | |||
| 15 | init : function(ed, url) { | ||
| 16 | var t = this, last = 0; | ||
| 17 | |||
| 18 | t.countre = ed.getParam('wordcount_countregex', /\S\s+/g); | ||
| 19 | t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g); | ||
| 20 | t.id = ed.id + '-word-count'; | ||
| 21 | |||
| 22 | ed.onPostRender.add(function(ed, cm) { | ||
| 23 | var row, id; | ||
| 24 | |||
| 25 | // Add it to the specified id or the theme advanced path | ||
| 26 | id = ed.getParam('wordcount_target_id'); | ||
| 27 | if (!id) { | ||
| 28 | row = tinymce.DOM.get(ed.id + '_path_row'); | ||
| 29 | |||
| 30 | if (row) | ||
| 31 | tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>'); | ||
| 32 | } else | ||
| 33 | tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>'); | ||
| 34 | }); | ||
| 35 | |||
| 36 | ed.onInit.add(function(ed) { | ||
| 37 | ed.selection.onSetContent.add(function() { | ||
| 38 | t._count(ed); | ||
| 39 | }); | ||
| 40 | |||
| 41 | t._count(ed); | ||
| 42 | }); | ||
| 43 | |||
| 44 | ed.onSetContent.add(function(ed) { | ||
| 45 | t._count(ed); | ||
| 46 | }); | ||
| 47 | |||
| 48 | ed.onKeyUp.add(function(ed, e) { | ||
| 49 | if (e.keyCode == last) | ||
| 50 | return; | ||
| 51 | |||
| 52 | if (13 == e.keyCode || 8 == last || 46 == last) | ||
| 53 | t._count(ed); | ||
| 54 | |||
| 55 | last = e.keyCode; | ||
| 56 | }); | ||
| 57 | }, | ||
| 58 | |||
| 59 | _count : function(ed) { | ||
| 60 | var t = this, tc = 0; | ||
| 61 | |||
| 62 | // Keep multiple calls from happening at the same time | ||
| 63 | if (t.block) | ||
| 64 | return; | ||
| 65 | |||
| 66 | t.block = 1; | ||
| 67 | |||
| 68 | setTimeout(function() { | ||
| 69 | var tx = ed.getContent({format : 'raw'}); | ||
| 70 | |||
| 71 | if (tx) { | ||
| 72 | tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars | ||
| 73 | tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation | ||
| 74 | tx.replace(t.countre, function() {tc++;}); // count the words | ||
| 75 | } | ||
| 76 | |||
| 77 | tinymce.DOM.setHTML(t.id, tc.toString()); | ||
| 78 | |||
| 79 | setTimeout(function() {t.block = 0;}, 2000); | ||
| 80 | }, 1); | ||
| 81 | }, | ||
| 82 | |||
| 83 | getInfo: function() { | ||
| 84 | return { | ||
| 85 | longname : 'Word Count plugin', | ||
| 86 | author : 'Moxiecode Systems AB', | ||
| 87 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 88 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', | ||
| 89 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 90 | }; | ||
| 91 | } | ||
| 92 | }); | ||
| 93 | |||
| 94 | tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); | ||
| 95 | })(); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm deleted file mode 100644 index 3928a17..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ /dev/null | |||
| @@ -1,148 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_abbr_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/abbr.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | </head> | ||
| 13 | <body style="display: none"> | ||
| 14 | <form onsubmit="insertAbbr();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 18 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 29 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 33 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 37 | <td> | ||
| 38 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 39 | <option value="">{#not_set}</option> | ||
| 40 | </select> | ||
| 41 | </td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 45 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 49 | <td> | ||
| 50 | <select id="dir" name="dir" class="field"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 53 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 54 | </select> | ||
| 55 | </td> | ||
| 56 | </tr> | ||
| 57 | <tr> | ||
| 58 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 59 | <td> | ||
| 60 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | </table> | ||
| 64 | </fieldset> | ||
| 65 | </div> | ||
| 66 | <div id="events_panel" class="panel"> | ||
| 67 | <fieldset> | ||
| 68 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 69 | |||
| 70 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 71 | <tr> | ||
| 72 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 73 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 74 | </tr> | ||
| 75 | |||
| 76 | <tr> | ||
| 77 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 78 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 79 | </tr> | ||
| 80 | |||
| 81 | <tr> | ||
| 82 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 83 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 84 | </tr> | ||
| 85 | |||
| 86 | <tr> | ||
| 87 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 88 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 89 | </tr> | ||
| 90 | |||
| 91 | <tr> | ||
| 92 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 93 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 94 | </tr> | ||
| 95 | |||
| 96 | <tr> | ||
| 97 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 98 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 103 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 108 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 113 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 114 | </tr> | ||
| 115 | |||
| 116 | <tr> | ||
| 117 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 118 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 119 | </tr> | ||
| 120 | |||
| 121 | <tr> | ||
| 122 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 123 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 124 | </tr> | ||
| 125 | |||
| 126 | <tr> | ||
| 127 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 128 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 129 | </tr> | ||
| 130 | </table> | ||
| 131 | </fieldset> | ||
| 132 | </div> | ||
| 133 | </div> | ||
| 134 | <div class="mceActionPanel"> | ||
| 135 | <div style="float: left"> | ||
| 136 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 137 | </div> | ||
| 138 | <div style="float: left"> | ||
| 139 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAbbr();" style="display: none;" /> | ||
| 140 | </div> | ||
| 141 | <div style="float: right"> | ||
| 142 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 143 | </div> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | </form> | ||
| 147 | </body> | ||
| 148 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm deleted file mode 100644 index 4d4ebaa..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ /dev/null | |||
| @@ -1,148 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_acronym_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/acronym.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | </head> | ||
| 13 | <body style="display: none"> | ||
| 14 | <form onsubmit="insertAcronym();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 18 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 29 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 33 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 37 | <td> | ||
| 38 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 39 | <option value="">{#not_set}</option> | ||
| 40 | </select> | ||
| 41 | </td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 45 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 49 | <td> | ||
| 50 | <select id="dir" name="dir" class="field"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 53 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 54 | </select> | ||
| 55 | </td> | ||
| 56 | </tr> | ||
| 57 | <tr> | ||
| 58 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 59 | <td> | ||
| 60 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | </table> | ||
| 64 | </fieldset> | ||
| 65 | </div> | ||
| 66 | <div id="events_panel" class="panel"> | ||
| 67 | <fieldset> | ||
| 68 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 69 | |||
| 70 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 71 | <tr> | ||
| 72 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 73 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 74 | </tr> | ||
| 75 | |||
| 76 | <tr> | ||
| 77 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 78 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 79 | </tr> | ||
| 80 | |||
| 81 | <tr> | ||
| 82 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 83 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 84 | </tr> | ||
| 85 | |||
| 86 | <tr> | ||
| 87 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 88 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 89 | </tr> | ||
| 90 | |||
| 91 | <tr> | ||
| 92 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 93 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 94 | </tr> | ||
| 95 | |||
| 96 | <tr> | ||
| 97 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 98 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 103 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 108 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 113 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 114 | </tr> | ||
| 115 | |||
| 116 | <tr> | ||
| 117 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 118 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 119 | </tr> | ||
| 120 | |||
| 121 | <tr> | ||
| 122 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 123 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 124 | </tr> | ||
| 125 | |||
| 126 | <tr> | ||
| 127 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 128 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 129 | </tr> | ||
| 130 | </table> | ||
| 131 | </fieldset> | ||
| 132 | </div> | ||
| 133 | </div> | ||
| 134 | <div class="mceActionPanel"> | ||
| 135 | <div style="float: left"> | ||
| 136 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 137 | </div> | ||
| 138 | <div style="float: left"> | ||
| 139 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeAcronym();" style="display: none;" /> | ||
| 140 | </div> | ||
| 141 | <div style="float: right"> | ||
| 142 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 143 | </div> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | </form> | ||
| 147 | </body> | ||
| 148 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm deleted file mode 100644 index 322b468..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ /dev/null | |||
| @@ -1,153 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.attribs_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 9 | <script type="text/javascript" src="js/attributes.js"></script> | ||
| 10 | <link rel="stylesheet" type="text/css" href="css/attributes.css" /> | ||
| 11 | </head> | ||
| 12 | <body style="display: none"> | ||
| 13 | <form onsubmit="insertAction();return false;" action="#"> | ||
| 14 | <div class="tabs"> | ||
| 15 | <ul> | ||
| 16 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_attrib_tab}</a></span></li> | ||
| 17 | <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.attribute_events_tab}</a></span></li> | ||
| 18 | </ul> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div class="panel_wrapper"> | ||
| 22 | <div id="general_panel" class="panel current"> | ||
| 23 | <fieldset> | ||
| 24 | <legend>{#xhtmlxtras_dlg.attribute_attrib_tab}</legend> | ||
| 25 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 26 | <tr> | ||
| 27 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 28 | <td><input id="title" name="title" type="text" value="" class="mceFocus" /></td> | ||
| 29 | </tr> | ||
| 30 | <tr> | ||
| 31 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 32 | <td><input id="id" name="id" type="text" value="" /></td> | ||
| 33 | </tr> | ||
| 34 | <tr> | ||
| 35 | <td><label id="classlabel" for="classlist">{#class_name}</label></td> | ||
| 36 | <td> | ||
| 37 | <select id="classlist" name="classlist" class="mceEditableSelect"> | ||
| 38 | <option value="" selected="selected">{#not_set}</option> | ||
| 39 | </select> | ||
| 40 | </td> | ||
| 41 | </tr> | ||
| 42 | <tr> | ||
| 43 | <td class="label"><label id="stylelabel" for="style">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 44 | <td><input id="style" name="style" type="text" value="" /></td> | ||
| 45 | </tr> | ||
| 46 | <tr> | ||
| 47 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 48 | <td> | ||
| 49 | <select id="dir" name="dir"> | ||
| 50 | <option value="">{#not_set}</option> | ||
| 51 | <option value="ltr">{#xhtmlxtras_dlg.option_ltr}</option> | ||
| 52 | <option value="rtl">{#xhtmlxtras_dlg.option_rtl}</option> | ||
| 53 | </select> | ||
| 54 | </td> | ||
| 55 | </tr> | ||
| 56 | <tr> | ||
| 57 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 58 | <td> | ||
| 59 | <input id="lang" name="lang" type="text" value="" /> | ||
| 60 | </td> | ||
| 61 | </tr> | ||
| 62 | <tr> | ||
| 63 | <td><label id="tabindexlabel" for="tabindex">{#xhtmlxtras_dlg.attribute_label_tabindex}</label></td> | ||
| 64 | <td><input type="text" id="tabindex" name="tabindex" value="" /></td> | ||
| 65 | </tr> | ||
| 66 | |||
| 67 | <tr> | ||
| 68 | <td><label id="accesskeylabel" for="accesskey">{#xhtmlxtras_dlg.attribute_label_accesskey}</label></td> | ||
| 69 | <td><input type="text" id="accesskey" name="accesskey" value="" /></td> | ||
| 70 | </tr> | ||
| 71 | </table> | ||
| 72 | </fieldset> | ||
| 73 | </div> | ||
| 74 | <div id="events_panel" class="panel"> | ||
| 75 | <fieldset> | ||
| 76 | <legend>{#xhtmlxtras_dlg.attribute_events_tab}</legend> | ||
| 77 | |||
| 78 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 79 | <tr> | ||
| 80 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 81 | <td><input id="onfocus" name="onfocus" type="text" value="" /></td> | ||
| 82 | </tr> | ||
| 83 | |||
| 84 | <tr> | ||
| 85 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 86 | <td><input id="onblur" name="onblur" type="text" value="" /></td> | ||
| 87 | </tr> | ||
| 88 | |||
| 89 | <tr> | ||
| 90 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 91 | <td><input id="onclick" name="onclick" type="text" value="" /></td> | ||
| 92 | </tr> | ||
| 93 | |||
| 94 | <tr> | ||
| 95 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 96 | <td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> | ||
| 97 | </tr> | ||
| 98 | |||
| 99 | <tr> | ||
| 100 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 101 | <td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> | ||
| 102 | </tr> | ||
| 103 | |||
| 104 | <tr> | ||
| 105 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 106 | <td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> | ||
| 107 | </tr> | ||
| 108 | |||
| 109 | <tr> | ||
| 110 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 111 | <td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> | ||
| 112 | </tr> | ||
| 113 | |||
| 114 | <tr> | ||
| 115 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 116 | <td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> | ||
| 117 | </tr> | ||
| 118 | |||
| 119 | <tr> | ||
| 120 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 121 | <td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> | ||
| 122 | </tr> | ||
| 123 | |||
| 124 | <tr> | ||
| 125 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 126 | <td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> | ||
| 127 | </tr> | ||
| 128 | |||
| 129 | <tr> | ||
| 130 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 131 | <td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> | ||
| 132 | </tr> | ||
| 133 | |||
| 134 | <tr> | ||
| 135 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 136 | <td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> | ||
| 137 | </tr> | ||
| 138 | </table> | ||
| 139 | </fieldset> | ||
| 140 | </div> | ||
| 141 | </div> | ||
| 142 | <div class="mceActionPanel"> | ||
| 143 | <div style="float: left"> | ||
| 144 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 145 | </div> | ||
| 146 | <div style="float: right"> | ||
| 147 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 148 | </div> | ||
| 149 | </div> | ||
| 150 | |||
| 151 | </form> | ||
| 152 | </body> | ||
| 153 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm deleted file mode 100644 index cdfaf4e..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +++ /dev/null | |||
| @@ -1,148 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_cite_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/cite.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | </head> | ||
| 13 | <body style="display: none"> | ||
| 14 | <form onsubmit="insertCite();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 18 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 29 | <td><input id="title" name="title" type="text" value="" class="field mceFocus" /></td> | ||
| 30 | </tr> | ||
| 31 | <tr> | ||
| 32 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 33 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 37 | <td> | ||
| 38 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 39 | <option value="">{#not_set}</option> | ||
| 40 | </select> | ||
| 41 | </td> | ||
| 42 | </tr> | ||
| 43 | <tr> | ||
| 44 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 45 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 46 | </tr> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 49 | <td> | ||
| 50 | <select id="dir" name="dir" class="field"> | ||
| 51 | <option value="">{#not_set}</option> | ||
| 52 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 53 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 54 | </select> | ||
| 55 | </td> | ||
| 56 | </tr> | ||
| 57 | <tr> | ||
| 58 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 59 | <td> | ||
| 60 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | </table> | ||
| 64 | </fieldset> | ||
| 65 | </div> | ||
| 66 | <div id="events_panel" class="panel"> | ||
| 67 | <fieldset> | ||
| 68 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 69 | |||
| 70 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 71 | <tr> | ||
| 72 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 73 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 74 | </tr> | ||
| 75 | |||
| 76 | <tr> | ||
| 77 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 78 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 79 | </tr> | ||
| 80 | |||
| 81 | <tr> | ||
| 82 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 83 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 84 | </tr> | ||
| 85 | |||
| 86 | <tr> | ||
| 87 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 88 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 89 | </tr> | ||
| 90 | |||
| 91 | <tr> | ||
| 92 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 93 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 94 | </tr> | ||
| 95 | |||
| 96 | <tr> | ||
| 97 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 98 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 103 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 108 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 113 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 114 | </tr> | ||
| 115 | |||
| 116 | <tr> | ||
| 117 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 118 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 119 | </tr> | ||
| 120 | |||
| 121 | <tr> | ||
| 122 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 123 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 124 | </tr> | ||
| 125 | |||
| 126 | <tr> | ||
| 127 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 128 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 129 | </tr> | ||
| 130 | </table> | ||
| 131 | </fieldset> | ||
| 132 | </div> | ||
| 133 | </div> | ||
| 134 | <div class="mceActionPanel"> | ||
| 135 | <div style="float: left"> | ||
| 136 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 137 | </div> | ||
| 138 | <div style="float: left"> | ||
| 139 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeCite();" style="display: none;" /> | ||
| 140 | </div> | ||
| 141 | <div style="float: right"> | ||
| 142 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 143 | </div> | ||
| 144 | </div> | ||
| 145 | |||
| 146 | </form> | ||
| 147 | </body> | ||
| 148 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css deleted file mode 100644 index 9a6a235..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | .panel_wrapper div.current { | ||
| 2 | height: 290px; | ||
| 3 | } | ||
| 4 | |||
| 5 | #id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { | ||
| 6 | width: 200px; | ||
| 7 | } | ||
| 8 | |||
| 9 | #events_panel input { | ||
| 10 | width: 200px; | ||
| 11 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css b/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css deleted file mode 100644 index e67114d..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | input.field, select.field {width:200px;} | ||
| 2 | input.picker {width:179px; margin-left: 5px;} | ||
| 3 | input.disabled {border-color:#F2F2F2;} | ||
| 4 | img.picker {vertical-align:text-bottom; cursor:pointer;} | ||
| 5 | h1 {padding: 0 0 5px 0;} | ||
| 6 | .panel_wrapper div.current {height:160px;} | ||
| 7 | #xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} | ||
| 8 | a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} | ||
| 9 | #datetime {width:180px;} | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm deleted file mode 100644 index f45676e..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +++ /dev/null | |||
| @@ -1,169 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_del_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/del.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | </head> | ||
| 13 | <body id="xhtmlxtrasins" style="display: none"> | ||
| 14 | <form onsubmit="insertDel();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 18 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> | ||
| 29 | <td> | ||
| 30 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 31 | <tr> | ||
| 32 | <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> | ||
| 33 | <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td> | ||
| 34 | </tr> | ||
| 35 | </table> | ||
| 36 | </td> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> | ||
| 40 | <td><input id="cite" name="cite" type="text" value="" class="field" /></td> | ||
| 41 | </tr> | ||
| 42 | </table> | ||
| 43 | </fieldset> | ||
| 44 | <fieldset> | ||
| 45 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 46 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 49 | <td><input id="title" name="title" type="text" value="" class="field" /></td> | ||
| 50 | </tr> | ||
| 51 | <tr> | ||
| 52 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 53 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 54 | </tr> | ||
| 55 | <tr> | ||
| 56 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 57 | <td> | ||
| 58 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 59 | <option value="">{#not_set}</option> | ||
| 60 | </select> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 65 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 66 | </tr> | ||
| 67 | <tr> | ||
| 68 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 69 | <td> | ||
| 70 | <select id="dir" name="dir" class="field"> | ||
| 71 | <option value="">{#not_set}</option> | ||
| 72 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 73 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 74 | </select> | ||
| 75 | </td> | ||
| 76 | </tr> | ||
| 77 | <tr> | ||
| 78 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 79 | <td> | ||
| 80 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 81 | </td> | ||
| 82 | </tr> | ||
| 83 | </table> | ||
| 84 | </fieldset> | ||
| 85 | </div> | ||
| 86 | <div id="events_panel" class="panel"> | ||
| 87 | <fieldset> | ||
| 88 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 89 | |||
| 90 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 91 | <tr> | ||
| 92 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 93 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 94 | </tr> | ||
| 95 | |||
| 96 | <tr> | ||
| 97 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 98 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 103 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 108 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 113 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 114 | </tr> | ||
| 115 | |||
| 116 | <tr> | ||
| 117 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 118 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 119 | </tr> | ||
| 120 | |||
| 121 | <tr> | ||
| 122 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 123 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 124 | </tr> | ||
| 125 | |||
| 126 | <tr> | ||
| 127 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 128 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 129 | </tr> | ||
| 130 | |||
| 131 | <tr> | ||
| 132 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 133 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 134 | </tr> | ||
| 135 | |||
| 136 | <tr> | ||
| 137 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 138 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 139 | </tr> | ||
| 140 | |||
| 141 | <tr> | ||
| 142 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 143 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 144 | </tr> | ||
| 145 | |||
| 146 | <tr> | ||
| 147 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 148 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 149 | </tr> | ||
| 150 | </table> | ||
| 151 | </fieldset> | ||
| 152 | </div> | ||
| 153 | </div> | ||
| 154 | <div class="mceActionPanel"> | ||
| 155 | <div style="float: left"> | ||
| 156 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 157 | </div> | ||
| 158 | <div style="float: left"> | ||
| 159 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeDel();" style="display: none;" /> | ||
| 160 | </div> | ||
| 161 | <div style="float: right"> | ||
| 162 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 163 | </div> | ||
| 164 | </div> | ||
| 165 | |||
| 166 | </form> | ||
| 167 | |||
| 168 | </body> | ||
| 169 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js deleted file mode 100644 index 8c7f48e..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(b,c){b.addCommand("mceCite",function(){b.windowManager.open({file:c+"/cite.htm",width:350+parseInt(b.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:c})});b.addCommand("mceAcronym",function(){b.windowManager.open({file:c+"/acronym.htm",width:350+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.acronym_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAbbr",function(){b.windowManager.open({file:c+"/abbr.htm",width:350+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(b.getLang("xhtmlxtras.abbr_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceDel",function(){b.windowManager.open({file:c+"/del.htm",width:340+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.del_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceIns",function(){b.windowManager.open({file:c+"/ins.htm",width:340+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(b.getLang("xhtmlxtras.ins_delta_width",0)),inline:1},{plugin_url:c})});b.addCommand("mceAttributes",function(){b.windowManager.open({file:c+"/attributes.htm",width:380,height:370,inline:1},{plugin_url:c})});b.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});b.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});b.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});b.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});b.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});b.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});if(tinymce.isIE){function a(d,e){if(e.set){e.content=e.content.replace(/<abbr([^>]+)>/gi,"<html:abbr $1>");e.content=e.content.replace(/<\/abbr>/gi,"</html:abbr>")}}b.onBeforeSetContent.add(a);b.onPostProcess.add(a)}b.onNodeChange.add(function(e,d,g,f){g=e.dom.getParent(g,"CITE,ACRONYM,ABBR,DEL,INS");d.setDisabled("cite",f);d.setDisabled("acronym",f);d.setDisabled("abbr",f);d.setDisabled("del",f);d.setDisabled("ins",f);d.setDisabled("attribs",g&&g.nodeName=="BODY");d.setActive("cite",0);d.setActive("acronym",0);d.setActive("abbr",0);d.setActive("del",0);d.setActive("ins",0);if(g){do{d.setDisabled(g.nodeName.toLowerCase(),0);d.setActive(g.nodeName.toLowerCase(),1)}while(g=g.parentNode)}})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js deleted file mode 100644 index bef06f2..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,136 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { | ||
| 10 | init : function(ed, url) { | ||
| 11 | // Register commands | ||
| 12 | ed.addCommand('mceCite', function() { | ||
| 13 | ed.windowManager.open({ | ||
| 14 | file : url + '/cite.htm', | ||
| 15 | width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), | ||
| 16 | height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), | ||
| 17 | inline : 1 | ||
| 18 | }, { | ||
| 19 | plugin_url : url | ||
| 20 | }); | ||
| 21 | }); | ||
| 22 | |||
| 23 | ed.addCommand('mceAcronym', function() { | ||
| 24 | ed.windowManager.open({ | ||
| 25 | file : url + '/acronym.htm', | ||
| 26 | width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), | ||
| 27 | height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), | ||
| 28 | inline : 1 | ||
| 29 | }, { | ||
| 30 | plugin_url : url | ||
| 31 | }); | ||
| 32 | }); | ||
| 33 | |||
| 34 | ed.addCommand('mceAbbr', function() { | ||
| 35 | ed.windowManager.open({ | ||
| 36 | file : url + '/abbr.htm', | ||
| 37 | width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), | ||
| 38 | height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), | ||
| 39 | inline : 1 | ||
| 40 | }, { | ||
| 41 | plugin_url : url | ||
| 42 | }); | ||
| 43 | }); | ||
| 44 | |||
| 45 | ed.addCommand('mceDel', function() { | ||
| 46 | ed.windowManager.open({ | ||
| 47 | file : url + '/del.htm', | ||
| 48 | width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), | ||
| 49 | height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), | ||
| 50 | inline : 1 | ||
| 51 | }, { | ||
| 52 | plugin_url : url | ||
| 53 | }); | ||
| 54 | }); | ||
| 55 | |||
| 56 | ed.addCommand('mceIns', function() { | ||
| 57 | ed.windowManager.open({ | ||
| 58 | file : url + '/ins.htm', | ||
| 59 | width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), | ||
| 60 | height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), | ||
| 61 | inline : 1 | ||
| 62 | }, { | ||
| 63 | plugin_url : url | ||
| 64 | }); | ||
| 65 | }); | ||
| 66 | |||
| 67 | ed.addCommand('mceAttributes', function() { | ||
| 68 | ed.windowManager.open({ | ||
| 69 | file : url + '/attributes.htm', | ||
| 70 | width : 380, | ||
| 71 | height : 370, | ||
| 72 | inline : 1 | ||
| 73 | }, { | ||
| 74 | plugin_url : url | ||
| 75 | }); | ||
| 76 | }); | ||
| 77 | |||
| 78 | // Register buttons | ||
| 79 | ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); | ||
| 80 | ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); | ||
| 81 | ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); | ||
| 82 | ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); | ||
| 83 | ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); | ||
| 84 | ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); | ||
| 85 | |||
| 86 | if (tinymce.isIE) { | ||
| 87 | function fix(ed, o) { | ||
| 88 | if (o.set) { | ||
| 89 | o.content = o.content.replace(/<abbr([^>]+)>/gi, '<html:abbr $1>'); | ||
| 90 | o.content = o.content.replace(/<\/abbr>/gi, '</html:abbr>'); | ||
| 91 | } | ||
| 92 | }; | ||
| 93 | |||
| 94 | ed.onBeforeSetContent.add(fix); | ||
| 95 | ed.onPostProcess.add(fix); | ||
| 96 | } | ||
| 97 | |||
| 98 | ed.onNodeChange.add(function(ed, cm, n, co) { | ||
| 99 | n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); | ||
| 100 | |||
| 101 | cm.setDisabled('cite', co); | ||
| 102 | cm.setDisabled('acronym', co); | ||
| 103 | cm.setDisabled('abbr', co); | ||
| 104 | cm.setDisabled('del', co); | ||
| 105 | cm.setDisabled('ins', co); | ||
| 106 | cm.setDisabled('attribs', n && n.nodeName == 'BODY'); | ||
| 107 | cm.setActive('cite', 0); | ||
| 108 | cm.setActive('acronym', 0); | ||
| 109 | cm.setActive('abbr', 0); | ||
| 110 | cm.setActive('del', 0); | ||
| 111 | cm.setActive('ins', 0); | ||
| 112 | |||
| 113 | // Activate all | ||
| 114 | if (n) { | ||
| 115 | do { | ||
| 116 | cm.setDisabled(n.nodeName.toLowerCase(), 0); | ||
| 117 | cm.setActive(n.nodeName.toLowerCase(), 1); | ||
| 118 | } while (n = n.parentNode); | ||
| 119 | } | ||
| 120 | }); | ||
| 121 | }, | ||
| 122 | |||
| 123 | getInfo : function() { | ||
| 124 | return { | ||
| 125 | longname : 'XHTML Xtras Plugin', | ||
| 126 | author : 'Moxiecode Systems AB', | ||
| 127 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 128 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', | ||
| 129 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 130 | }; | ||
| 131 | } | ||
| 132 | }); | ||
| 133 | |||
| 134 | // Register plugin | ||
| 135 | tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); | ||
| 136 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm b/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm deleted file mode 100644 index 9fa21c4..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +++ /dev/null | |||
| @@ -1,169 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#xhtmlxtras_dlg.title_ins_element}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/editable_selects.js"></script> | ||
| 9 | <script type="text/javascript" src="js/element_common.js"></script> | ||
| 10 | <script type="text/javascript" src="js/ins.js"></script> | ||
| 11 | <link rel="stylesheet" type="text/css" href="css/popup.css" /> | ||
| 12 | </head> | ||
| 13 | <body id="xhtmlxtrasins" style="display: none"> | ||
| 14 | <form onsubmit="insertIns();return false;" action="#"> | ||
| 15 | <div class="tabs"> | ||
| 16 | <ul> | ||
| 17 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.general_tab}</a></span></li> | ||
| 18 | <!-- <li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{#xhtmlxtras_dlg.events_tab}</a></span></li> --> | ||
| 19 | </ul> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div class="panel_wrapper"> | ||
| 23 | <div id="general_panel" class="panel current"> | ||
| 24 | <fieldset> | ||
| 25 | <legend>{#xhtmlxtras_dlg.fieldset_general_tab}</legend> | ||
| 26 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 27 | <tr> | ||
| 28 | <td class="label"><label id="datetimelabel" for="datetime">{#xhtmlxtras_dlg.attribute_label_datetime}</label>:</td> | ||
| 29 | <td> | ||
| 30 | <table border="0" cellspacing="0" cellpadding="0"> | ||
| 31 | <tr> | ||
| 32 | <td><input id="datetime" name="datetime" type="text" value="" maxlength="19" class="field mceFocus" /></td> | ||
| 33 | <td><a href="javascript:insertDateTime('datetime');" onmousedown="return false;" class="browse"><span class="datetime" title="{#xhtmlxtras_dlg.insert_date}"></span></a></td> | ||
| 34 | </tr> | ||
| 35 | </table> | ||
| 36 | </td> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <td class="label"><label id="citelabel" for="cite">{#xhtmlxtras_dlg.attribute_label_cite}</label>:</td> | ||
| 40 | <td><input id="cite" name="cite" type="text" value="" class="field" /></td> | ||
| 41 | </tr> | ||
| 42 | </table> | ||
| 43 | </fieldset> | ||
| 44 | <fieldset> | ||
| 45 | <legend>{#xhtmlxtras_dlg.fieldset_attrib_tab}</legend> | ||
| 46 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 47 | <tr> | ||
| 48 | <td class="label"><label id="titlelabel" for="title">{#xhtmlxtras_dlg.attribute_label_title}</label>:</td> | ||
| 49 | <td><input id="title" name="title" type="text" value="" class="field" /></td> | ||
| 50 | </tr> | ||
| 51 | <tr> | ||
| 52 | <td class="label"><label id="idlabel" for="id">{#xhtmlxtras_dlg.attribute_label_id}</label>:</td> | ||
| 53 | <td><input id="id" name="id" type="text" value="" class="field" /></td> | ||
| 54 | </tr> | ||
| 55 | <tr> | ||
| 56 | <td class="label"><label id="classlabel" for="class">{#xhtmlxtras_dlg.attribute_label_class}</label>:</td> | ||
| 57 | <td> | ||
| 58 | <select id="class" name="class" class="field mceEditableSelect"> | ||
| 59 | <option value="">{#not_set}</option> | ||
| 60 | </select> | ||
| 61 | </td> | ||
| 62 | </tr> | ||
| 63 | <tr> | ||
| 64 | <td class="label"><label id="stylelabel" for="class">{#xhtmlxtras_dlg.attribute_label_style}</label>:</td> | ||
| 65 | <td><input id="style" name="style" type="text" value="" class="field" /></td> | ||
| 66 | </tr> | ||
| 67 | <tr> | ||
| 68 | <td class="label"><label id="dirlabel" for="dir">{#xhtmlxtras_dlg.attribute_label_langdir}</label>:</td> | ||
| 69 | <td> | ||
| 70 | <select id="dir" name="dir" class="field"> | ||
| 71 | <option value="">{#not_set}</option> | ||
| 72 | <option value="ltr">{#xhtmlxtras_dlg.attribute_option_ltr}</option> | ||
| 73 | <option value="rtl">{#xhtmlxtras_dlg.attribute_option_rtl}</option> | ||
| 74 | </select> | ||
| 75 | </td> | ||
| 76 | </tr> | ||
| 77 | <tr> | ||
| 78 | <td class="label"><label id="langlabel" for="lang">{#xhtmlxtras_dlg.attribute_label_langcode}</label>:</td> | ||
| 79 | <td> | ||
| 80 | <input id="lang" name="lang" type="text" value="" class="field" /> | ||
| 81 | </td> | ||
| 82 | </tr> | ||
| 83 | </table> | ||
| 84 | </fieldset> | ||
| 85 | </div> | ||
| 86 | <div id="events_panel" class="panel"> | ||
| 87 | <fieldset> | ||
| 88 | <legend>{#xhtmlxtras_dlg.fieldset_events_tab}</legend> | ||
| 89 | |||
| 90 | <table border="0" cellpadding="0" cellspacing="4"> | ||
| 91 | <tr> | ||
| 92 | <td class="label"><label for="onfocus">onfocus</label>:</td> | ||
| 93 | <td><input id="onfocus" name="onfocus" type="text" value="" class="field" /></td> | ||
| 94 | </tr> | ||
| 95 | |||
| 96 | <tr> | ||
| 97 | <td class="label"><label for="onblur">onblur</label>:</td> | ||
| 98 | <td><input id="onblur" name="onblur" type="text" value="" class="field" /></td> | ||
| 99 | </tr> | ||
| 100 | |||
| 101 | <tr> | ||
| 102 | <td class="label"><label for="onclick">onclick</label>:</td> | ||
| 103 | <td><input id="onclick" name="onclick" type="text" value="" class="field" /></td> | ||
| 104 | </tr> | ||
| 105 | |||
| 106 | <tr> | ||
| 107 | <td class="label"><label for="ondblclick">ondblclick</label>:</td> | ||
| 108 | <td><input id="ondblclick" name="ondblclick" type="text" value="" class="field" /></td> | ||
| 109 | </tr> | ||
| 110 | |||
| 111 | <tr> | ||
| 112 | <td class="label"><label for="onmousedown">onmousedown</label>:</td> | ||
| 113 | <td><input id="onmousedown" name="onmousedown" type="text" value="" class="field" /></td> | ||
| 114 | </tr> | ||
| 115 | |||
| 116 | <tr> | ||
| 117 | <td class="label"><label for="onmouseup">onmouseup</label>:</td> | ||
| 118 | <td><input id="onmouseup" name="onmouseup" type="text" value="" class="field" /></td> | ||
| 119 | </tr> | ||
| 120 | |||
| 121 | <tr> | ||
| 122 | <td class="label"><label for="onmouseover">onmouseover</label>:</td> | ||
| 123 | <td><input id="onmouseover" name="onmouseover" type="text" value="" class="field" /></td> | ||
| 124 | </tr> | ||
| 125 | |||
| 126 | <tr> | ||
| 127 | <td class="label"><label for="onmousemove">onmousemove</label>:</td> | ||
| 128 | <td><input id="onmousemove" name="onmousemove" type="text" value="" class="field" /></td> | ||
| 129 | </tr> | ||
| 130 | |||
| 131 | <tr> | ||
| 132 | <td class="label"><label for="onmouseout">onmouseout</label>:</td> | ||
| 133 | <td><input id="onmouseout" name="onmouseout" type="text" value="" class="field" /></td> | ||
| 134 | </tr> | ||
| 135 | |||
| 136 | <tr> | ||
| 137 | <td class="label"><label for="onkeypress">onkeypress</label>:</td> | ||
| 138 | <td><input id="onkeypress" name="onkeypress" type="text" value="" class="field" /></td> | ||
| 139 | </tr> | ||
| 140 | |||
| 141 | <tr> | ||
| 142 | <td class="label"><label for="onkeydown">onkeydown</label>:</td> | ||
| 143 | <td><input id="onkeydown" name="onkeydown" type="text" value="" class="field" /></td> | ||
| 144 | </tr> | ||
| 145 | |||
| 146 | <tr> | ||
| 147 | <td class="label"><label for="onkeyup">onkeyup</label>:</td> | ||
| 148 | <td><input id="onkeyup" name="onkeyup" type="text" value="" class="field" /></td> | ||
| 149 | </tr> | ||
| 150 | </table> | ||
| 151 | </fieldset> | ||
| 152 | </div> | ||
| 153 | </div> | ||
| 154 | <div class="mceActionPanel"> | ||
| 155 | <div style="float: left"> | ||
| 156 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 157 | </div> | ||
| 158 | <div style="float: left"> | ||
| 159 | <input type="button" id="remove" name="remove" class="button" value="{#xhtmlxtras_dlg.remove}" onclick="removeIns();" style="display: none;" /> | ||
| 160 | </div> | ||
| 161 | <div style="float: right"> | ||
| 162 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 163 | </div> | ||
| 164 | </div> | ||
| 165 | |||
| 166 | </form> | ||
| 167 | |||
| 168 | </body> | ||
| 169 | </html> | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js deleted file mode 100644 index e84b6a8..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('abbr'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertAbbr() { | ||
| 16 | SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeAbbr() { | ||
| 21 | SXE.removeElement('abbr'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js deleted file mode 100644 index 933d122..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('acronym'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertAcronym() { | ||
| 16 | SXE.insertElement('acronym'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeAcronym() { | ||
| 21 | SXE.removeElement('acronym'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js deleted file mode 100644 index 23c7fa4..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ /dev/null | |||
| @@ -1,123 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | tinyMCEPopup.resizeToInnerSize(); | ||
| 10 | var inst = tinyMCEPopup.editor; | ||
| 11 | var dom = inst.dom; | ||
| 12 | var elm = inst.selection.getNode(); | ||
| 13 | var f = document.forms[0]; | ||
| 14 | var onclick = dom.getAttrib(elm, 'onclick'); | ||
| 15 | |||
| 16 | setFormValue('title', dom.getAttrib(elm, 'title')); | ||
| 17 | setFormValue('id', dom.getAttrib(elm, 'id')); | ||
| 18 | setFormValue('style', dom.getAttrib(elm, "style")); | ||
| 19 | setFormValue('dir', dom.getAttrib(elm, 'dir')); | ||
| 20 | setFormValue('lang', dom.getAttrib(elm, 'lang')); | ||
| 21 | setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); | ||
| 22 | setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); | ||
| 23 | setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); | ||
| 24 | setFormValue('onblur', dom.getAttrib(elm, 'onblur')); | ||
| 25 | setFormValue('onclick', onclick); | ||
| 26 | setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); | ||
| 27 | setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); | ||
| 28 | setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); | ||
| 29 | setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); | ||
| 30 | setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); | ||
| 31 | setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); | ||
| 32 | setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); | ||
| 33 | setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); | ||
| 34 | setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); | ||
| 35 | className = dom.getAttrib(elm, 'class'); | ||
| 36 | |||
| 37 | addClassesToList('classlist', 'advlink_styles'); | ||
| 38 | selectByValue(f, 'classlist', className, true); | ||
| 39 | |||
| 40 | TinyMCE_EditableSelects.init(); | ||
| 41 | } | ||
| 42 | |||
| 43 | function setFormValue(name, value) { | ||
| 44 | if(value && document.forms[0].elements[name]){ | ||
| 45 | document.forms[0].elements[name].value = value; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | function insertAction() { | ||
| 50 | var inst = tinyMCEPopup.editor; | ||
| 51 | var elm = inst.selection.getNode(); | ||
| 52 | |||
| 53 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 54 | setAllAttribs(elm); | ||
| 55 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 56 | tinyMCEPopup.close(); | ||
| 57 | } | ||
| 58 | |||
| 59 | function setAttrib(elm, attrib, value) { | ||
| 60 | var formObj = document.forms[0]; | ||
| 61 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 62 | var inst = tinyMCEPopup.editor; | ||
| 63 | var dom = inst.dom; | ||
| 64 | |||
| 65 | if (typeof(value) == "undefined" || value == null) { | ||
| 66 | value = ""; | ||
| 67 | |||
| 68 | if (valueElm) | ||
| 69 | value = valueElm.value; | ||
| 70 | } | ||
| 71 | |||
| 72 | if (value != "") { | ||
| 73 | dom.setAttrib(elm, attrib.toLowerCase(), value); | ||
| 74 | |||
| 75 | if (attrib == "style") | ||
| 76 | attrib = "style.cssText"; | ||
| 77 | |||
| 78 | if (attrib.substring(0, 2) == 'on') | ||
| 79 | value = 'return true;' + value; | ||
| 80 | |||
| 81 | if (attrib == "class") | ||
| 82 | attrib = "className"; | ||
| 83 | |||
| 84 | elm[attrib]=value; | ||
| 85 | } else | ||
| 86 | elm.removeAttribute(attrib); | ||
| 87 | } | ||
| 88 | |||
| 89 | function setAllAttribs(elm) { | ||
| 90 | var f = document.forms[0]; | ||
| 91 | |||
| 92 | setAttrib(elm, 'title'); | ||
| 93 | setAttrib(elm, 'id'); | ||
| 94 | setAttrib(elm, 'style'); | ||
| 95 | setAttrib(elm, 'class', getSelectValue(f, 'classlist')); | ||
| 96 | setAttrib(elm, 'dir'); | ||
| 97 | setAttrib(elm, 'lang'); | ||
| 98 | setAttrib(elm, 'tabindex'); | ||
| 99 | setAttrib(elm, 'accesskey'); | ||
| 100 | setAttrib(elm, 'onfocus'); | ||
| 101 | setAttrib(elm, 'onblur'); | ||
| 102 | setAttrib(elm, 'onclick'); | ||
| 103 | setAttrib(elm, 'ondblclick'); | ||
| 104 | setAttrib(elm, 'onmousedown'); | ||
| 105 | setAttrib(elm, 'onmouseup'); | ||
| 106 | setAttrib(elm, 'onmouseover'); | ||
| 107 | setAttrib(elm, 'onmousemove'); | ||
| 108 | setAttrib(elm, 'onmouseout'); | ||
| 109 | setAttrib(elm, 'onkeypress'); | ||
| 110 | setAttrib(elm, 'onkeydown'); | ||
| 111 | setAttrib(elm, 'onkeyup'); | ||
| 112 | |||
| 113 | // Refresh in old MSIE | ||
| 114 | // if (tinyMCE.isMSIE5) | ||
| 115 | // elm.outerHTML = elm.outerHTML; | ||
| 116 | } | ||
| 117 | |||
| 118 | function insertAttribute() { | ||
| 119 | tinyMCEPopup.close(); | ||
| 120 | } | ||
| 121 | |||
| 122 | tinyMCEPopup.onInit.add(init); | ||
| 123 | tinyMCEPopup.requireLangPack(); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js deleted file mode 100644 index c36f7fd..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('cite'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | SXE.showRemoveButton(); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | function insertCite() { | ||
| 16 | SXE.insertElement('cite'); | ||
| 17 | tinyMCEPopup.close(); | ||
| 18 | } | ||
| 19 | |||
| 20 | function removeCite() { | ||
| 21 | SXE.removeElement('cite'); | ||
| 22 | tinyMCEPopup.close(); | ||
| 23 | } | ||
| 24 | |||
| 25 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js deleted file mode 100644 index 7049f2b..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('del'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); | ||
| 12 | setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); | ||
| 13 | SXE.showRemoveButton(); | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | function setElementAttribs(elm) { | ||
| 18 | setAllCommonAttribs(elm); | ||
| 19 | setAttrib(elm, 'datetime'); | ||
| 20 | setAttrib(elm, 'cite'); | ||
| 21 | } | ||
| 22 | |||
| 23 | function insertDel() { | ||
| 24 | var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); | ||
| 25 | |||
| 26 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 27 | if (elm == null) { | ||
| 28 | var s = SXE.inst.selection.getContent(); | ||
| 29 | if(s.length > 0) { | ||
| 30 | insertInlineElement('del'); | ||
| 31 | var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';}); | ||
| 32 | for (var i=0; i<elementArray.length; i++) { | ||
| 33 | var elm = elementArray[i]; | ||
| 34 | setElementAttribs(elm); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | } else { | ||
| 38 | setElementAttribs(elm); | ||
| 39 | } | ||
| 40 | tinyMCEPopup.editor.nodeChanged(); | ||
| 41 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 42 | tinyMCEPopup.close(); | ||
| 43 | } | ||
| 44 | |||
| 45 | function insertInlineElement(en) { | ||
| 46 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 47 | |||
| 48 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 49 | tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { | ||
| 50 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 51 | dom.replace(dom.create(en), n, 1); | ||
| 52 | }); | ||
| 53 | } | ||
| 54 | |||
| 55 | function removeDel() { | ||
| 56 | SXE.removeElement('del'); | ||
| 57 | tinyMCEPopup.close(); | ||
| 58 | } | ||
| 59 | |||
| 60 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js deleted file mode 100644 index 70f168a..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +++ /dev/null | |||
| @@ -1,231 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | tinyMCEPopup.requireLangPack(); | ||
| 9 | |||
| 10 | function initCommonAttributes(elm) { | ||
| 11 | var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom; | ||
| 12 | |||
| 13 | // Setup form data for common element attributes | ||
| 14 | setFormValue('title', dom.getAttrib(elm, 'title')); | ||
| 15 | setFormValue('id', dom.getAttrib(elm, 'id')); | ||
| 16 | selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true); | ||
| 17 | setFormValue('style', dom.getAttrib(elm, 'style')); | ||
| 18 | selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir')); | ||
| 19 | setFormValue('lang', dom.getAttrib(elm, 'lang')); | ||
| 20 | setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); | ||
| 21 | setFormValue('onblur', dom.getAttrib(elm, 'onblur')); | ||
| 22 | setFormValue('onclick', dom.getAttrib(elm, 'onclick')); | ||
| 23 | setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); | ||
| 24 | setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); | ||
| 25 | setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); | ||
| 26 | setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); | ||
| 27 | setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); | ||
| 28 | setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); | ||
| 29 | setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); | ||
| 30 | setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); | ||
| 31 | setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); | ||
| 32 | } | ||
| 33 | |||
| 34 | function setFormValue(name, value) { | ||
| 35 | if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value; | ||
| 36 | } | ||
| 37 | |||
| 38 | function insertDateTime(id) { | ||
| 39 | document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S"); | ||
| 40 | } | ||
| 41 | |||
| 42 | function getDateTime(d, fmt) { | ||
| 43 | fmt = fmt.replace("%D", "%m/%d/%y"); | ||
| 44 | fmt = fmt.replace("%r", "%I:%M:%S %p"); | ||
| 45 | fmt = fmt.replace("%Y", "" + d.getFullYear()); | ||
| 46 | fmt = fmt.replace("%y", "" + d.getYear()); | ||
| 47 | fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); | ||
| 48 | fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); | ||
| 49 | fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); | ||
| 50 | fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); | ||
| 51 | fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); | ||
| 52 | fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); | ||
| 53 | fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); | ||
| 54 | fmt = fmt.replace("%%", "%"); | ||
| 55 | |||
| 56 | return fmt; | ||
| 57 | } | ||
| 58 | |||
| 59 | function addZeros(value, len) { | ||
| 60 | var i; | ||
| 61 | |||
| 62 | value = "" + value; | ||
| 63 | |||
| 64 | if (value.length < len) { | ||
| 65 | for (i=0; i<(len-value.length); i++) | ||
| 66 | value = "0" + value; | ||
| 67 | } | ||
| 68 | |||
| 69 | return value; | ||
| 70 | } | ||
| 71 | |||
| 72 | function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { | ||
| 73 | if (!form_obj || !form_obj.elements[field_name]) | ||
| 74 | return; | ||
| 75 | |||
| 76 | var sel = form_obj.elements[field_name]; | ||
| 77 | |||
| 78 | var found = false; | ||
| 79 | for (var i=0; i<sel.options.length; i++) { | ||
| 80 | var option = sel.options[i]; | ||
| 81 | |||
| 82 | if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { | ||
| 83 | option.selected = true; | ||
| 84 | found = true; | ||
| 85 | } else | ||
| 86 | option.selected = false; | ||
| 87 | } | ||
| 88 | |||
| 89 | if (!found && add_custom && value != '') { | ||
| 90 | var option = new Option('Value: ' + value, value); | ||
| 91 | option.selected = true; | ||
| 92 | sel.options[sel.options.length] = option; | ||
| 93 | } | ||
| 94 | |||
| 95 | return found; | ||
| 96 | } | ||
| 97 | |||
| 98 | function setAttrib(elm, attrib, value) { | ||
| 99 | var formObj = document.forms[0]; | ||
| 100 | var valueElm = formObj.elements[attrib.toLowerCase()]; | ||
| 101 | tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value); | ||
| 102 | } | ||
| 103 | |||
| 104 | function setAllCommonAttribs(elm) { | ||
| 105 | setAttrib(elm, 'title'); | ||
| 106 | setAttrib(elm, 'id'); | ||
| 107 | setAttrib(elm, 'class'); | ||
| 108 | setAttrib(elm, 'style'); | ||
| 109 | setAttrib(elm, 'dir'); | ||
| 110 | setAttrib(elm, 'lang'); | ||
| 111 | /*setAttrib(elm, 'onfocus'); | ||
| 112 | setAttrib(elm, 'onblur'); | ||
| 113 | setAttrib(elm, 'onclick'); | ||
| 114 | setAttrib(elm, 'ondblclick'); | ||
| 115 | setAttrib(elm, 'onmousedown'); | ||
| 116 | setAttrib(elm, 'onmouseup'); | ||
| 117 | setAttrib(elm, 'onmouseover'); | ||
| 118 | setAttrib(elm, 'onmousemove'); | ||
| 119 | setAttrib(elm, 'onmouseout'); | ||
| 120 | setAttrib(elm, 'onkeypress'); | ||
| 121 | setAttrib(elm, 'onkeydown'); | ||
| 122 | setAttrib(elm, 'onkeyup');*/ | ||
| 123 | } | ||
| 124 | |||
| 125 | SXE = { | ||
| 126 | currentAction : "insert", | ||
| 127 | inst : tinyMCEPopup.editor, | ||
| 128 | updateElement : null | ||
| 129 | } | ||
| 130 | |||
| 131 | SXE.focusElement = SXE.inst.selection.getNode(); | ||
| 132 | |||
| 133 | SXE.initElementDialog = function(element_name) { | ||
| 134 | addClassesToList('class', 'xhtmlxtras_styles'); | ||
| 135 | TinyMCE_EditableSelects.init(); | ||
| 136 | |||
| 137 | element_name = element_name.toLowerCase(); | ||
| 138 | var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()); | ||
| 139 | if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) { | ||
| 140 | SXE.currentAction = "update"; | ||
| 141 | } | ||
| 142 | |||
| 143 | if (SXE.currentAction == "update") { | ||
| 144 | initCommonAttributes(elm); | ||
| 145 | SXE.updateElement = elm; | ||
| 146 | } | ||
| 147 | |||
| 148 | document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true); | ||
| 149 | } | ||
| 150 | |||
| 151 | SXE.insertElement = function(element_name) { | ||
| 152 | var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName; | ||
| 153 | |||
| 154 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 155 | if (elm == null) { | ||
| 156 | var s = SXE.inst.selection.getContent(); | ||
| 157 | if(s.length > 0) { | ||
| 158 | tagName = element_name; | ||
| 159 | |||
| 160 | if (tinymce.isIE && element_name.indexOf('html:') == 0) | ||
| 161 | element_name = element_name.substring(5).toLowerCase(); | ||
| 162 | |||
| 163 | insertInlineElement(element_name); | ||
| 164 | var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); | ||
| 165 | for (var i=0; i<elementArray.length; i++) { | ||
| 166 | var elm = elementArray[i]; | ||
| 167 | |||
| 168 | if (SXE.inst.dom.getAttrib(elm, '_mce_new')) { | ||
| 169 | elm.id = ''; | ||
| 170 | elm.setAttribute('id', ''); | ||
| 171 | elm.removeAttribute('id'); | ||
| 172 | elm.removeAttribute('_mce_new'); | ||
| 173 | |||
| 174 | setAllCommonAttribs(elm); | ||
| 175 | } | ||
| 176 | } | ||
| 177 | } | ||
| 178 | } else { | ||
| 179 | setAllCommonAttribs(elm); | ||
| 180 | } | ||
| 181 | SXE.inst.nodeChanged(); | ||
| 182 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 183 | } | ||
| 184 | |||
| 185 | SXE.removeElement = function(element_name){ | ||
| 186 | element_name = element_name.toLowerCase(); | ||
| 187 | elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()); | ||
| 188 | if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){ | ||
| 189 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 190 | tinyMCE.execCommand('mceRemoveNode', false, elm); | ||
| 191 | SXE.inst.nodeChanged(); | ||
| 192 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 193 | } | ||
| 194 | } | ||
| 195 | |||
| 196 | SXE.showRemoveButton = function() { | ||
| 197 | document.getElementById("remove").style.display = 'block'; | ||
| 198 | } | ||
| 199 | |||
| 200 | SXE.containsClass = function(elm,cl) { | ||
| 201 | return (elm.className.indexOf(cl) > -1) ? true : false; | ||
| 202 | } | ||
| 203 | |||
| 204 | SXE.removeClass = function(elm,cl) { | ||
| 205 | if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { | ||
| 206 | return true; | ||
| 207 | } | ||
| 208 | var classNames = elm.className.split(" "); | ||
| 209 | var newClassNames = ""; | ||
| 210 | for (var x = 0, cnl = classNames.length; x < cnl; x++) { | ||
| 211 | if (classNames[x] != cl) { | ||
| 212 | newClassNames += (classNames[x] + " "); | ||
| 213 | } | ||
| 214 | } | ||
| 215 | elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end | ||
| 216 | } | ||
| 217 | |||
| 218 | SXE.addClass = function(elm,cl) { | ||
| 219 | if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; | ||
| 220 | return true; | ||
| 221 | } | ||
| 222 | |||
| 223 | function insertInlineElement(en) { | ||
| 224 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 225 | |||
| 226 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 227 | tinymce.each(dom.select('span,font'), function(n) { | ||
| 228 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 229 | dom.replace(dom.create(en, {_mce_new : 1}), n, 1); | ||
| 230 | }); | ||
| 231 | } | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js deleted file mode 100644 index 4fcc998..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +++ /dev/null | |||
| @@ -1,59 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode - based on work by Andrew Tetlaw | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | function init() { | ||
| 9 | SXE.initElementDialog('ins'); | ||
| 10 | if (SXE.currentAction == "update") { | ||
| 11 | setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); | ||
| 12 | setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); | ||
| 13 | SXE.showRemoveButton(); | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | function setElementAttribs(elm) { | ||
| 18 | setAllCommonAttribs(elm); | ||
| 19 | setAttrib(elm, 'datetime'); | ||
| 20 | setAttrib(elm, 'cite'); | ||
| 21 | } | ||
| 22 | |||
| 23 | function insertIns() { | ||
| 24 | var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); | ||
| 25 | tinyMCEPopup.execCommand('mceBeginUndoLevel'); | ||
| 26 | if (elm == null) { | ||
| 27 | var s = SXE.inst.selection.getContent(); | ||
| 28 | if(s.length > 0) { | ||
| 29 | insertInlineElement('INS'); | ||
| 30 | var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';}); | ||
| 31 | for (var i=0; i<elementArray.length; i++) { | ||
| 32 | var elm = elementArray[i]; | ||
| 33 | setElementAttribs(elm); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } else { | ||
| 37 | setElementAttribs(elm); | ||
| 38 | } | ||
| 39 | tinyMCEPopup.editor.nodeChanged(); | ||
| 40 | tinyMCEPopup.execCommand('mceEndUndoLevel'); | ||
| 41 | tinyMCEPopup.close(); | ||
| 42 | } | ||
| 43 | |||
| 44 | function removeIns() { | ||
| 45 | SXE.removeElement('ins'); | ||
| 46 | tinyMCEPopup.close(); | ||
| 47 | } | ||
| 48 | |||
| 49 | function insertInlineElement(en) { | ||
| 50 | var ed = tinyMCEPopup.editor, dom = ed.dom; | ||
| 51 | |||
| 52 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 53 | tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) { | ||
| 54 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') | ||
| 55 | dom.replace(dom.create(en), n, 1); | ||
| 56 | }); | ||
| 57 | } | ||
| 58 | |||
| 59 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js deleted file mode 100644 index 45b6b26..0000000 --- a/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.xhtmlxtras_dlg',{ | ||
| 2 | attribute_label_title:"Title", | ||
| 3 | attribute_label_id:"ID", | ||
| 4 | attribute_label_class:"Class", | ||
| 5 | attribute_label_style:"Style", | ||
| 6 | attribute_label_cite:"Cite", | ||
| 7 | attribute_label_datetime:"Date/Time", | ||
| 8 | attribute_label_langdir:"Text Direction", | ||
| 9 | attribute_option_ltr:"Left to right", | ||
| 10 | attribute_option_rtl:"Right to left", | ||
| 11 | attribute_label_langcode:"Language", | ||
| 12 | attribute_label_tabindex:"TabIndex", | ||
| 13 | attribute_label_accesskey:"AccessKey", | ||
| 14 | attribute_events_tab:"Events", | ||
| 15 | attribute_attrib_tab:"Attributes", | ||
| 16 | general_tab:"General", | ||
| 17 | attrib_tab:"Attributes", | ||
| 18 | events_tab:"Events", | ||
| 19 | fieldset_general_tab:"General Settings", | ||
| 20 | fieldset_attrib_tab:"Element Attributes", | ||
| 21 | fieldset_events_tab:"Element Events", | ||
| 22 | title_ins_element:"Insertion Element", | ||
| 23 | title_del_element:"Deletion Element", | ||
| 24 | title_acronym_element:"Acronym Element", | ||
| 25 | title_abbr_element:"Abbreviation Element", | ||
| 26 | title_cite_element:"Citation Element", | ||
| 27 | remove:"Remove", | ||
| 28 | insert_date:"Insert current date/time", | ||
| 29 | option_ltr:"Left to right", | ||
| 30 | option_rtl:"Right to left", | ||
| 31 | attribs_title:"Insert/Edit Attributes" | ||
| 32 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/about.htm b/public/javascripts/tiny_mce/themes/advanced/about.htm deleted file mode 100644 index e5df7aa..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/about.htm +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.about_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="js/about.js"></script> | ||
| 8 | </head> | ||
| 9 | <body id="about" style="display: none"> | ||
| 10 | <div class="tabs"> | ||
| 11 | <ul> | ||
| 12 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li> | ||
| 13 | <li id="help_tab" style="display:none"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li> | ||
| 14 | <li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li> | ||
| 15 | </ul> | ||
| 16 | </div> | ||
| 17 | |||
| 18 | <div class="panel_wrapper"> | ||
| 19 | <div id="general_panel" class="panel current"> | ||
| 20 | <h3>{#advanced_dlg.about_title}</h3> | ||
| 21 | <p>Version: <span id="version"></span> (<span id="date"></span>)</p> | ||
| 22 | <p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a> | ||
| 23 | by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p> | ||
| 24 | <p>Copyright © 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p> | ||
| 25 | <p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p> | ||
| 26 | |||
| 27 | <div id="buttoncontainer"> | ||
| 28 | <a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> | ||
| 29 | <a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> | ||
| 30 | <a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | |||
| 34 | <div id="plugins_panel" class="panel"> | ||
| 35 | <div id="pluginscontainer"> | ||
| 36 | <h3>{#advanced_dlg.about_loaded}</h3> | ||
| 37 | |||
| 38 | <div id="plugintablecontainer"> | ||
| 39 | </div> | ||
| 40 | |||
| 41 | <p> </p> | ||
| 42 | </div> | ||
| 43 | </div> | ||
| 44 | |||
| 45 | <div id="help_panel" class="panel noscroll" style="overflow: visible;"> | ||
| 46 | <div id="iframecontainer"></div> | ||
| 47 | </div> | ||
| 48 | </div> | ||
| 49 | |||
| 50 | <div class="mceActionPanel"> | ||
| 51 | <div style="float: right"> | ||
| 52 | <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" /> | ||
| 53 | </div> | ||
| 54 | </div> | ||
| 55 | </body> | ||
| 56 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/anchor.htm b/public/javascripts/tiny_mce/themes/advanced/anchor.htm deleted file mode 100644 index 42095a1..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/anchor.htm +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.anchor_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/anchor.js"></script> | ||
| 7 | </head> | ||
| 8 | <body style="display: none"> | ||
| 9 | <form onsubmit="AnchorDialog.update();return false;" action="#"> | ||
| 10 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 11 | <tr> | ||
| 12 | <td colspan="2" class="title">{#advanced_dlg.anchor_title}</td> | ||
| 13 | </tr> | ||
| 14 | <tr> | ||
| 15 | <td class="nowrap">{#advanced_dlg.anchor_name}:</td> | ||
| 16 | <td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" /></td> | ||
| 17 | </tr> | ||
| 18 | </table> | ||
| 19 | |||
| 20 | <div class="mceActionPanel"> | ||
| 21 | <div style="float: left"> | ||
| 22 | <input type="submit" id="insert" name="insert" value="{#update}" /> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div style="float: right"> | ||
| 26 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 27 | </div> | ||
| 28 | </div> | ||
| 29 | </form> | ||
| 30 | </body> | ||
| 31 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/charmap.htm b/public/javascripts/tiny_mce/themes/advanced/charmap.htm deleted file mode 100644 index f11a38a..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/charmap.htm +++ /dev/null | |||
| @@ -1,53 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.charmap_title}</title> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | ||
| 6 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 7 | <script type="text/javascript" src="js/charmap.js"></script> | ||
| 8 | </head> | ||
| 9 | <body id="charmap" style="display:none"> | ||
| 10 | <table align="center" border="0" cellspacing="0" cellpadding="2"> | ||
| 11 | <tr> | ||
| 12 | <td colspan="2" class="title">{#advanced_dlg.charmap_title}</td> | ||
| 13 | </tr> | ||
| 14 | <tr> | ||
| 15 | <td id="charmapView" rowspan="2" align="left" valign="top"> | ||
| 16 | <!-- Chars will be rendered here --> | ||
| 17 | </td> | ||
| 18 | <td width="100" align="center" valign="top"> | ||
| 19 | <table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px"> | ||
| 20 | <tr> | ||
| 21 | <td id="codeV"> </td> | ||
| 22 | </tr> | ||
| 23 | <tr> | ||
| 24 | <td id="codeN"> </td> | ||
| 25 | </tr> | ||
| 26 | </table> | ||
| 27 | </td> | ||
| 28 | </tr> | ||
| 29 | <tr> | ||
| 30 | <td valign="bottom" style="padding-bottom: 3px;"> | ||
| 31 | <table width="100" align="center" border="0" cellpadding="2" cellspacing="0"> | ||
| 32 | <tr> | ||
| 33 | <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td> | ||
| 34 | </tr> | ||
| 35 | <tr> | ||
| 36 | <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center"> </td> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <td style="font-size: 1px;"> </td> | ||
| 40 | </tr> | ||
| 41 | <tr> | ||
| 42 | <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center"> </td> | ||
| 46 | </tr> | ||
| 47 | </table> | ||
| 48 | </td> | ||
| 49 | </tr> | ||
| 50 | </table> | ||
| 51 | |||
| 52 | </body> | ||
| 53 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/color_picker.htm b/public/javascripts/tiny_mce/themes/advanced/color_picker.htm deleted file mode 100644 index cbd6b88..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +++ /dev/null | |||
| @@ -1,75 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.colorpicker_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="js/color_picker.js"></script> | ||
| 8 | </head> | ||
| 9 | <body id="colorpicker" style="display: none"> | ||
| 10 | <form onsubmit="insertAction();return false" action="#"> | ||
| 11 | <div class="tabs"> | ||
| 12 | <ul> | ||
| 13 | <li id="picker_tab" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li> | ||
| 14 | <li id="rgb_tab"><span><a href="javascript:;" onclick="generateWebColors();mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li> | ||
| 15 | <li id="named_tab"><span><a href="javascript:;" onclick="generateNamedColors();javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li> | ||
| 16 | </ul> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="panel_wrapper"> | ||
| 20 | <div id="picker_panel" class="panel current"> | ||
| 21 | <fieldset> | ||
| 22 | <legend>{#advanced_dlg.colorpicker_picker_title}</legend> | ||
| 23 | <div id="picker"> | ||
| 24 | <img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" /> | ||
| 25 | |||
| 26 | <div id="light"> | ||
| 27 | <!-- Will be filled with divs --> | ||
| 28 | </div> | ||
| 29 | |||
| 30 | <br style="clear: both" /> | ||
| 31 | </div> | ||
| 32 | </fieldset> | ||
| 33 | </div> | ||
| 34 | |||
| 35 | <div id="rgb_panel" class="panel"> | ||
| 36 | <fieldset> | ||
| 37 | <legend>{#advanced_dlg.colorpicker_palette_title}</legend> | ||
| 38 | <div id="webcolors"> | ||
| 39 | <!-- Gets filled with web safe colors--> | ||
| 40 | </div> | ||
| 41 | |||
| 42 | <br style="clear: both" /> | ||
| 43 | </fieldset> | ||
| 44 | </div> | ||
| 45 | |||
| 46 | <div id="named_panel" class="panel"> | ||
| 47 | <fieldset> | ||
| 48 | <legend>{#advanced_dlg.colorpicker_named_title}</legend> | ||
| 49 | <div id="namedcolors"> | ||
| 50 | <!-- Gets filled with named colors--> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | <br style="clear: both" /> | ||
| 54 | |||
| 55 | <div id="colornamecontainer"> | ||
| 56 | {#advanced_dlg.colorpicker_name} <span id="colorname"></span> | ||
| 57 | </div> | ||
| 58 | </fieldset> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | |||
| 62 | <div class="mceActionPanel"> | ||
| 63 | <div style="float: left"> | ||
| 64 | <input type="submit" id="insert" name="insert" value="{#apply}" /> | ||
| 65 | </div> | ||
| 66 | |||
| 67 | <div id="preview"></div> | ||
| 68 | |||
| 69 | <div id="previewblock"> | ||
| 70 | <label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" maxlength="8" class="text mceFocus" /> | ||
| 71 | </div> | ||
| 72 | </div> | ||
| 73 | </form> | ||
| 74 | </body> | ||
| 75 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/editor_template.js b/public/javascripts/tiny_mce/themes/advanced/editor_template.js deleted file mode 100644 index 628c793..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/editor_template.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";if(j.settings.convert_fonts_to_spans){o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){j.onNodeChange.add(l._nodeChanged,l);if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(j){var i=this.editor,k=i.controlManager.get("styleselect");if(k.getLength()==0){f(i.dom.getClasses(),function(l){k.add(l["class"],l["class"])})}},_createStyleSelect:function(m){var j=this,i=j.editor,k=i.controlManager,l=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){if(l.selectedValue===n){i.execCommand("mceSetStyleInfo",0,{command:"removeformat"});l.select();return false}else{i.execCommand("mceSetCSSClass",0,n)}}});if(l){f(i.getParam("theme_advanced_styles","","hash"),function(o,n){if(o){l.add(j.editor.translate(n),o)}});l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",j._importClasses,j);b.add(p.id+"_text","mousedown",j._importClasses,j);b.add(p.id+"_open","focus",j._importClasses,j);b.add(p.id+"_open","mousedown",j._importClasses,j)}else{b.add(p.id,"focus",j._importClasses,j)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",cmd:"FontName"});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(l,u,k,q){var y=this,i,r=0,x,m,z=y.settings,w,j,o;if(z.readonly){return}e.each(y.stateControls,function(n){u.setActive(n,l.queryCommandState(y.controls[n][1]))});u.setActive("visualaid",l.hasVisual);u.setDisabled("undo",!l.undoManager.hasUndo()&&!l.typing);u.setDisabled("redo",!l.undoManager.hasRedo());u.setDisabled("outdent",!l.queryCommandState("Outdent"));i=d.getParent(k,"A");if(m=u.get("link")){if(!i||!i.name){m.setDisabled(!i&&q);m.setActive(!!i)}}if(m=u.get("unlink")){m.setDisabled(!i&&q);m.setActive(!!i&&!i.name)}if(m=u.get("anchor")){m.setActive(!!i&&i.name);if(e.isWebKit){i=d.getParent(k,"IMG");m.setActive(!!i&&d.getAttrib(i,"mce_name")=="a")}}i=d.getParent(k,"IMG");if(m=u.get("image")){m.setActive(!!i&&k.className.indexOf("mceItem")==-1)}if(m=u.get("styleselect")){if(k.className){y._importClasses();m.select(k.className)}else{m.select()}}if(m=u.get("formatselect")){i=d.getParent(k,d.isBlock);if(i){m.select(i.nodeName.toLowerCase())}}if(l.settings.convert_fonts_to_spans){l.dom.getParent(k,function(p){if(p.nodeName==="SPAN"){if(!w&&p.className){w=p.className}if(!j&&p.style.fontSize){j=p.style.fontSize}if(!o&&p.style.fontFamily){o=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(m=u.get("fontselect")){m.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==o})}if(m=u.get("fontsizeselect")){m.select(function(n){if(n.fontSize&&n.fontSize===j){return true}if(n["class"]&&n["class"]===w){return true}})}}else{if(m=u.get("fontselect")){m.select(l.queryCommandValue("FontName"))}if(m=u.get("fontsizeselect")){x=l.queryCommandValue("FontSize");m.select(function(n){return n.fontSize==x})}}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){i=d.get(l.id+"_path")||d.add(l.id+"_path_row","span",{id:l.id+"_path"});d.setHTML(i,"");l.dom.getParent(k,function(A){var p=A.nodeName.toLowerCase(),s,v,t="";if(A.nodeType!=1||A.nodeName==="BR"||(d.hasClass(A,"mceItemHidden")||d.hasClass(A,"mceItemRemoved"))){return}if(x=d.getAttrib(A,"mce_name")){p=x}if(e.isIE&&A.scopeName!=="HTML"){p=A.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(x=d.getAttrib(A,"src")){t+="src: "+x+" "}break;case"a":if(x=d.getAttrib(A,"name")){t+="name: "+x+" ";p+="#"+x}if(x=d.getAttrib(A,"href")){t+="href: "+x+" "}break;case"font":if(z.convert_fonts_to_spans){p="span"}if(x=d.getAttrib(A,"face")){t+="font: "+x+" "}if(x=d.getAttrib(A,"size")){t+="size: "+x+" "}if(x=d.getAttrib(A,"color")){t+="color: "+x+" "}break;case"span":if(x=d.getAttrib(A,"style")){t+="style: "+x+" "}break}if(x=d.getAttrib(A,"id")){t+="id: "+x+" "}if(x=A.className){x=x.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(x&&x.indexOf("mceItem")==-1){t+="class: "+x+" ";if(d.isBlock(A)||p=="img"||p=="span"){p+="."+x}}}p=p.replace(/(html:)/g,"");p={name:p,node:A,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(r++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},l.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js b/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js deleted file mode 100644 index 21eb259..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +++ /dev/null | |||
| @@ -1,1153 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_template_src.js 1045 2009-03-04 20:03:18Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function(tinymce) { | ||
| 9 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; | ||
| 10 | |||
| 11 | // Tell it to load theme specific language pack(s) | ||
| 12 | tinymce.ThemeManager.requireLangPack('advanced'); | ||
| 13 | |||
| 14 | tinymce.create('tinymce.themes.AdvancedTheme', { | ||
| 15 | sizes : [8, 10, 12, 14, 18, 24, 36], | ||
| 16 | |||
| 17 | // Control name lookup, format: title, command | ||
| 18 | controls : { | ||
| 19 | bold : ['bold_desc', 'Bold'], | ||
| 20 | italic : ['italic_desc', 'Italic'], | ||
| 21 | underline : ['underline_desc', 'Underline'], | ||
| 22 | strikethrough : ['striketrough_desc', 'Strikethrough'], | ||
| 23 | justifyleft : ['justifyleft_desc', 'JustifyLeft'], | ||
| 24 | justifycenter : ['justifycenter_desc', 'JustifyCenter'], | ||
| 25 | justifyright : ['justifyright_desc', 'JustifyRight'], | ||
| 26 | justifyfull : ['justifyfull_desc', 'JustifyFull'], | ||
| 27 | bullist : ['bullist_desc', 'InsertUnorderedList'], | ||
| 28 | numlist : ['numlist_desc', 'InsertOrderedList'], | ||
| 29 | outdent : ['outdent_desc', 'Outdent'], | ||
| 30 | indent : ['indent_desc', 'Indent'], | ||
| 31 | cut : ['cut_desc', 'Cut'], | ||
| 32 | copy : ['copy_desc', 'Copy'], | ||
| 33 | paste : ['paste_desc', 'Paste'], | ||
| 34 | undo : ['undo_desc', 'Undo'], | ||
| 35 | redo : ['redo_desc', 'Redo'], | ||
| 36 | link : ['link_desc', 'mceLink'], | ||
| 37 | unlink : ['unlink_desc', 'unlink'], | ||
| 38 | image : ['image_desc', 'mceImage'], | ||
| 39 | cleanup : ['cleanup_desc', 'mceCleanup'], | ||
| 40 | help : ['help_desc', 'mceHelp'], | ||
| 41 | code : ['code_desc', 'mceCodeEditor'], | ||
| 42 | hr : ['hr_desc', 'InsertHorizontalRule'], | ||
| 43 | removeformat : ['removeformat_desc', 'RemoveFormat'], | ||
| 44 | sub : ['sub_desc', 'subscript'], | ||
| 45 | sup : ['sup_desc', 'superscript'], | ||
| 46 | forecolor : ['forecolor_desc', 'ForeColor'], | ||
| 47 | forecolorpicker : ['forecolor_desc', 'mceForeColor'], | ||
| 48 | backcolor : ['backcolor_desc', 'HiliteColor'], | ||
| 49 | backcolorpicker : ['backcolor_desc', 'mceBackColor'], | ||
| 50 | charmap : ['charmap_desc', 'mceCharMap'], | ||
| 51 | visualaid : ['visualaid_desc', 'mceToggleVisualAid'], | ||
| 52 | anchor : ['anchor_desc', 'mceInsertAnchor'], | ||
| 53 | newdocument : ['newdocument_desc', 'mceNewDocument'], | ||
| 54 | blockquote : ['blockquote_desc', 'mceBlockQuote'] | ||
| 55 | }, | ||
| 56 | |||
| 57 | stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], | ||
| 58 | |||
| 59 | init : function(ed, url) { | ||
| 60 | var t = this, s, v, o; | ||
| 61 | |||
| 62 | t.editor = ed; | ||
| 63 | t.url = url; | ||
| 64 | t.onResolveName = new tinymce.util.Dispatcher(this); | ||
| 65 | |||
| 66 | // Default settings | ||
| 67 | t.settings = s = extend({ | ||
| 68 | theme_advanced_path : true, | ||
| 69 | theme_advanced_toolbar_location : 'bottom', | ||
| 70 | theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", | ||
| 71 | theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", | ||
| 72 | theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", | ||
| 73 | theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", | ||
| 74 | theme_advanced_toolbar_align : "center", | ||
| 75 | theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", | ||
| 76 | theme_advanced_more_colors : 1, | ||
| 77 | theme_advanced_row_height : 23, | ||
| 78 | theme_advanced_resize_horizontal : 1, | ||
| 79 | theme_advanced_resizing_use_cookie : 1, | ||
| 80 | theme_advanced_font_sizes : "1,2,3,4,5,6,7", | ||
| 81 | readonly : ed.settings.readonly | ||
| 82 | }, ed.settings); | ||
| 83 | |||
| 84 | // Setup default font_size_style_values | ||
| 85 | if (!s.font_size_style_values) | ||
| 86 | s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; | ||
| 87 | |||
| 88 | if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { | ||
| 89 | s.font_size_style_values = tinymce.explode(s.font_size_style_values); | ||
| 90 | s.font_size_classes = tinymce.explode(s.font_size_classes || ''); | ||
| 91 | |||
| 92 | // Parse string value | ||
| 93 | o = {}; | ||
| 94 | ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; | ||
| 95 | each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { | ||
| 96 | var cl; | ||
| 97 | |||
| 98 | if (k == v && v >= 1 && v <= 7) { | ||
| 99 | k = v + ' (' + t.sizes[v - 1] + 'pt)'; | ||
| 100 | |||
| 101 | if (ed.settings.convert_fonts_to_spans) { | ||
| 102 | cl = s.font_size_classes[v - 1]; | ||
| 103 | v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | if (/^\s*\./.test(v)) | ||
| 108 | cl = v.replace(/\./g, ''); | ||
| 109 | |||
| 110 | o[k] = cl ? {'class' : cl} : {fontSize : v}; | ||
| 111 | }); | ||
| 112 | |||
| 113 | s.theme_advanced_font_sizes = o; | ||
| 114 | } | ||
| 115 | |||
| 116 | if ((v = s.theme_advanced_path_location) && v != 'none') | ||
| 117 | s.theme_advanced_statusbar_location = s.theme_advanced_path_location; | ||
| 118 | |||
| 119 | if (s.theme_advanced_statusbar_location == 'none') | ||
| 120 | s.theme_advanced_statusbar_location = 0; | ||
| 121 | |||
| 122 | // Init editor | ||
| 123 | ed.onInit.add(function() { | ||
| 124 | ed.onNodeChange.add(t._nodeChanged, t); | ||
| 125 | |||
| 126 | if (ed.settings.content_css !== false) | ||
| 127 | ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); | ||
| 128 | }); | ||
| 129 | |||
| 130 | ed.onSetProgressState.add(function(ed, b, ti) { | ||
| 131 | var co, id = ed.id, tb; | ||
| 132 | |||
| 133 | if (b) { | ||
| 134 | t.progressTimer = setTimeout(function() { | ||
| 135 | co = ed.getContainer(); | ||
| 136 | co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); | ||
| 137 | tb = DOM.get(ed.id + '_tbl'); | ||
| 138 | |||
| 139 | DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); | ||
| 140 | DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); | ||
| 141 | }, ti || 0); | ||
| 142 | } else { | ||
| 143 | DOM.remove(id + '_blocker'); | ||
| 144 | DOM.remove(id + '_progress'); | ||
| 145 | clearTimeout(t.progressTimer); | ||
| 146 | } | ||
| 147 | }); | ||
| 148 | |||
| 149 | DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); | ||
| 150 | |||
| 151 | if (s.skin_variant) | ||
| 152 | DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); | ||
| 153 | }, | ||
| 154 | |||
| 155 | createControl : function(n, cf) { | ||
| 156 | var cd, c; | ||
| 157 | |||
| 158 | if (c = cf.createControl(n)) | ||
| 159 | return c; | ||
| 160 | |||
| 161 | switch (n) { | ||
| 162 | case "styleselect": | ||
| 163 | return this._createStyleSelect(); | ||
| 164 | |||
| 165 | case "formatselect": | ||
| 166 | return this._createBlockFormats(); | ||
| 167 | |||
| 168 | case "fontselect": | ||
| 169 | return this._createFontSelect(); | ||
| 170 | |||
| 171 | case "fontsizeselect": | ||
| 172 | return this._createFontSizeSelect(); | ||
| 173 | |||
| 174 | case "forecolor": | ||
| 175 | return this._createForeColorMenu(); | ||
| 176 | |||
| 177 | case "backcolor": | ||
| 178 | return this._createBackColorMenu(); | ||
| 179 | } | ||
| 180 | |||
| 181 | if ((cd = this.controls[n])) | ||
| 182 | return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); | ||
| 183 | }, | ||
| 184 | |||
| 185 | execCommand : function(cmd, ui, val) { | ||
| 186 | var f = this['_' + cmd]; | ||
| 187 | |||
| 188 | if (f) { | ||
| 189 | f.call(this, ui, val); | ||
| 190 | return true; | ||
| 191 | } | ||
| 192 | |||
| 193 | return false; | ||
| 194 | }, | ||
| 195 | |||
| 196 | _importClasses : function(e) { | ||
| 197 | var ed = this.editor, c = ed.controlManager.get('styleselect'); | ||
| 198 | |||
| 199 | if (c.getLength() == 0) { | ||
| 200 | each(ed.dom.getClasses(), function(o) { | ||
| 201 | c.add(o['class'], o['class']); | ||
| 202 | }); | ||
| 203 | } | ||
| 204 | }, | ||
| 205 | |||
| 206 | _createStyleSelect : function(n) { | ||
| 207 | var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { | ||
| 208 | title : 'advanced.style_select', | ||
| 209 | onselect : function(v) { | ||
| 210 | if (c.selectedValue === v) { | ||
| 211 | ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); | ||
| 212 | c.select(); | ||
| 213 | return false; | ||
| 214 | } else | ||
| 215 | ed.execCommand('mceSetCSSClass', 0, v); | ||
| 216 | } | ||
| 217 | }); | ||
| 218 | |||
| 219 | if (c) { | ||
| 220 | each(ed.getParam('theme_advanced_styles', '', 'hash'), function(v, k) { | ||
| 221 | if (v) | ||
| 222 | c.add(t.editor.translate(k), v); | ||
| 223 | }); | ||
| 224 | |||
| 225 | c.onPostRender.add(function(ed, n) { | ||
| 226 | if (!c.NativeListBox) { | ||
| 227 | Event.add(n.id + '_text', 'focus', t._importClasses, t); | ||
| 228 | Event.add(n.id + '_text', 'mousedown', t._importClasses, t); | ||
| 229 | Event.add(n.id + '_open', 'focus', t._importClasses, t); | ||
| 230 | Event.add(n.id + '_open', 'mousedown', t._importClasses, t); | ||
| 231 | } else | ||
| 232 | Event.add(n.id, 'focus', t._importClasses, t); | ||
| 233 | }); | ||
| 234 | } | ||
| 235 | |||
| 236 | return c; | ||
| 237 | }, | ||
| 238 | |||
| 239 | _createFontSelect : function() { | ||
| 240 | var c, t = this, ed = t.editor; | ||
| 241 | |||
| 242 | c = ed.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); | ||
| 243 | if (c) { | ||
| 244 | each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { | ||
| 245 | c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); | ||
| 246 | }); | ||
| 247 | } | ||
| 248 | |||
| 249 | return c; | ||
| 250 | }, | ||
| 251 | |||
| 252 | _createFontSizeSelect : function() { | ||
| 253 | var t = this, ed = t.editor, c, i = 0, cl = []; | ||
| 254 | |||
| 255 | c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { | ||
| 256 | if (v.fontSize) | ||
| 257 | ed.execCommand('FontSize', false, v.fontSize); | ||
| 258 | else { | ||
| 259 | each(t.settings.theme_advanced_font_sizes, function(v, k) { | ||
| 260 | if (v['class']) | ||
| 261 | cl.push(v['class']); | ||
| 262 | }); | ||
| 263 | |||
| 264 | ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl}); | ||
| 265 | } | ||
| 266 | }}); | ||
| 267 | |||
| 268 | if (c) { | ||
| 269 | each(t.settings.theme_advanced_font_sizes, function(v, k) { | ||
| 270 | var fz = v.fontSize; | ||
| 271 | |||
| 272 | if (fz >= 1 && fz <= 7) | ||
| 273 | fz = t.sizes[parseInt(fz) - 1] + 'pt'; | ||
| 274 | |||
| 275 | c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); | ||
| 276 | }); | ||
| 277 | } | ||
| 278 | |||
| 279 | return c; | ||
| 280 | }, | ||
| 281 | |||
| 282 | _createBlockFormats : function() { | ||
| 283 | var c, fmts = { | ||
| 284 | p : 'advanced.paragraph', | ||
| 285 | address : 'advanced.address', | ||
| 286 | pre : 'advanced.pre', | ||
| 287 | h1 : 'advanced.h1', | ||
| 288 | h2 : 'advanced.h2', | ||
| 289 | h3 : 'advanced.h3', | ||
| 290 | h4 : 'advanced.h4', | ||
| 291 | h5 : 'advanced.h5', | ||
| 292 | h6 : 'advanced.h6', | ||
| 293 | div : 'advanced.div', | ||
| 294 | blockquote : 'advanced.blockquote', | ||
| 295 | code : 'advanced.code', | ||
| 296 | dt : 'advanced.dt', | ||
| 297 | dd : 'advanced.dd', | ||
| 298 | samp : 'advanced.samp' | ||
| 299 | }, t = this; | ||
| 300 | |||
| 301 | c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); | ||
| 302 | if (c) { | ||
| 303 | each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { | ||
| 304 | c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); | ||
| 305 | }); | ||
| 306 | } | ||
| 307 | |||
| 308 | return c; | ||
| 309 | }, | ||
| 310 | |||
| 311 | _createForeColorMenu : function() { | ||
| 312 | var c, t = this, s = t.settings, o = {}, v; | ||
| 313 | |||
| 314 | if (s.theme_advanced_more_colors) { | ||
| 315 | o.more_colors_func = function() { | ||
| 316 | t._mceColorPicker(0, { | ||
| 317 | color : c.value, | ||
| 318 | func : function(co) { | ||
| 319 | c.setColor(co); | ||
| 320 | } | ||
| 321 | }); | ||
| 322 | }; | ||
| 323 | } | ||
| 324 | |||
| 325 | if (v = s.theme_advanced_text_colors) | ||
| 326 | o.colors = v; | ||
| 327 | |||
| 328 | if (s.theme_advanced_default_foreground_color) | ||
| 329 | o.default_color = s.theme_advanced_default_foreground_color; | ||
| 330 | |||
| 331 | o.title = 'advanced.forecolor_desc'; | ||
| 332 | o.cmd = 'ForeColor'; | ||
| 333 | o.scope = this; | ||
| 334 | |||
| 335 | c = t.editor.controlManager.createColorSplitButton('forecolor', o); | ||
| 336 | |||
| 337 | return c; | ||
| 338 | }, | ||
| 339 | |||
| 340 | _createBackColorMenu : function() { | ||
| 341 | var c, t = this, s = t.settings, o = {}, v; | ||
| 342 | |||
| 343 | if (s.theme_advanced_more_colors) { | ||
| 344 | o.more_colors_func = function() { | ||
| 345 | t._mceColorPicker(0, { | ||
| 346 | color : c.value, | ||
| 347 | func : function(co) { | ||
| 348 | c.setColor(co); | ||
| 349 | } | ||
| 350 | }); | ||
| 351 | }; | ||
| 352 | } | ||
| 353 | |||
| 354 | if (v = s.theme_advanced_background_colors) | ||
| 355 | o.colors = v; | ||
| 356 | |||
| 357 | if (s.theme_advanced_default_background_color) | ||
| 358 | o.default_color = s.theme_advanced_default_background_color; | ||
| 359 | |||
| 360 | o.title = 'advanced.backcolor_desc'; | ||
| 361 | o.cmd = 'HiliteColor'; | ||
| 362 | o.scope = this; | ||
| 363 | |||
| 364 | c = t.editor.controlManager.createColorSplitButton('backcolor', o); | ||
| 365 | |||
| 366 | return c; | ||
| 367 | }, | ||
| 368 | |||
| 369 | renderUI : function(o) { | ||
| 370 | var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; | ||
| 371 | |||
| 372 | n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); | ||
| 373 | |||
| 374 | if (!DOM.boxModel) | ||
| 375 | n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); | ||
| 376 | |||
| 377 | n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); | ||
| 378 | n = tb = DOM.add(n, 'tbody'); | ||
| 379 | |||
| 380 | switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { | ||
| 381 | case "rowlayout": | ||
| 382 | ic = t._rowLayout(s, tb, o); | ||
| 383 | break; | ||
| 384 | |||
| 385 | case "customlayout": | ||
| 386 | ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); | ||
| 387 | break; | ||
| 388 | |||
| 389 | default: | ||
| 390 | ic = t._simpleLayout(s, tb, o, p); | ||
| 391 | } | ||
| 392 | |||
| 393 | n = o.targetNode; | ||
| 394 | |||
| 395 | // Add classes to first and last TRs | ||
| 396 | nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8 | ||
| 397 | DOM.addClass(nl[0], 'mceFirst'); | ||
| 398 | DOM.addClass(nl[nl.length - 1], 'mceLast'); | ||
| 399 | |||
| 400 | // Add classes to first and last TDs | ||
| 401 | each(DOM.select('tr', tb), function(n) { | ||
| 402 | DOM.addClass(n.firstChild, 'mceFirst'); | ||
| 403 | DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); | ||
| 404 | }); | ||
| 405 | |||
| 406 | if (DOM.get(s.theme_advanced_toolbar_container)) | ||
| 407 | DOM.get(s.theme_advanced_toolbar_container).appendChild(p); | ||
| 408 | else | ||
| 409 | DOM.insertAfter(p, n); | ||
| 410 | |||
| 411 | Event.add(ed.id + '_path_row', 'click', function(e) { | ||
| 412 | e = e.target; | ||
| 413 | |||
| 414 | if (e.nodeName == 'A') { | ||
| 415 | t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); | ||
| 416 | |||
| 417 | return Event.cancel(e); | ||
| 418 | } | ||
| 419 | }); | ||
| 420 | /* | ||
| 421 | if (DOM.get(ed.id + '_path_row')) { | ||
| 422 | Event.add(ed.id + '_tbl', 'mouseover', function(e) { | ||
| 423 | var re; | ||
| 424 | |||
| 425 | e = e.target; | ||
| 426 | |||
| 427 | if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { | ||
| 428 | re = DOM.get(ed.id + '_path_row'); | ||
| 429 | t.lastPath = re.innerHTML; | ||
| 430 | DOM.setHTML(re, e.parentNode.title); | ||
| 431 | } | ||
| 432 | }); | ||
| 433 | |||
| 434 | Event.add(ed.id + '_tbl', 'mouseout', function(e) { | ||
| 435 | if (t.lastPath) { | ||
| 436 | DOM.setHTML(ed.id + '_path_row', t.lastPath); | ||
| 437 | t.lastPath = 0; | ||
| 438 | } | ||
| 439 | }); | ||
| 440 | } | ||
| 441 | */ | ||
| 442 | |||
| 443 | if (!ed.getParam('accessibility_focus')) | ||
| 444 | Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();}); | ||
| 445 | |||
| 446 | if (s.theme_advanced_toolbar_location == 'external') | ||
| 447 | o.deltaHeight = 0; | ||
| 448 | |||
| 449 | t.deltaHeight = o.deltaHeight; | ||
| 450 | o.targetNode = null; | ||
| 451 | |||
| 452 | return { | ||
| 453 | iframeContainer : ic, | ||
| 454 | editorContainer : ed.id + '_parent', | ||
| 455 | sizeContainer : sc, | ||
| 456 | deltaHeight : o.deltaHeight | ||
| 457 | }; | ||
| 458 | }, | ||
| 459 | |||
| 460 | getInfo : function() { | ||
| 461 | return { | ||
| 462 | longname : 'Advanced theme', | ||
| 463 | author : 'Moxiecode Systems AB', | ||
| 464 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 465 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 466 | } | ||
| 467 | }, | ||
| 468 | |||
| 469 | resizeBy : function(dw, dh) { | ||
| 470 | var e = DOM.get(this.editor.id + '_tbl'); | ||
| 471 | |||
| 472 | this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); | ||
| 473 | }, | ||
| 474 | |||
| 475 | resizeTo : function(w, h) { | ||
| 476 | var ed = this.editor, s = ed.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'), dh; | ||
| 477 | |||
| 478 | // Boundery fix box | ||
| 479 | w = Math.max(s.theme_advanced_resizing_min_width || 100, w); | ||
| 480 | h = Math.max(s.theme_advanced_resizing_min_height || 100, h); | ||
| 481 | w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); | ||
| 482 | h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); | ||
| 483 | |||
| 484 | // Calc difference between iframe and container | ||
| 485 | dh = e.clientHeight - ifr.clientHeight; | ||
| 486 | |||
| 487 | // Resize iframe and container | ||
| 488 | DOM.setStyle(ifr, 'height', h - dh); | ||
| 489 | DOM.setStyles(e, {width : w, height : h}); | ||
| 490 | }, | ||
| 491 | |||
| 492 | destroy : function() { | ||
| 493 | var id = this.editor.id; | ||
| 494 | |||
| 495 | Event.clear(id + '_resize'); | ||
| 496 | Event.clear(id + '_path_row'); | ||
| 497 | Event.clear(id + '_external_close'); | ||
| 498 | }, | ||
| 499 | |||
| 500 | // Internal functions | ||
| 501 | |||
| 502 | _simpleLayout : function(s, tb, o, p) { | ||
| 503 | var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; | ||
| 504 | |||
| 505 | if (s.readonly) { | ||
| 506 | n = DOM.add(tb, 'tr'); | ||
| 507 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 508 | return ic; | ||
| 509 | } | ||
| 510 | |||
| 511 | // Create toolbar container at top | ||
| 512 | if (lo == 'top') | ||
| 513 | t._addToolbars(tb, o); | ||
| 514 | |||
| 515 | // Create external toolbar | ||
| 516 | if (lo == 'external') { | ||
| 517 | n = c = DOM.create('div', {style : 'position:relative'}); | ||
| 518 | n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); | ||
| 519 | DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); | ||
| 520 | n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); | ||
| 521 | etb = DOM.add(n, 'tbody'); | ||
| 522 | |||
| 523 | if (p.firstChild.className == 'mceOldBoxModel') | ||
| 524 | p.firstChild.appendChild(c); | ||
| 525 | else | ||
| 526 | p.insertBefore(c, p.firstChild); | ||
| 527 | |||
| 528 | t._addToolbars(etb, o); | ||
| 529 | |||
| 530 | ed.onMouseUp.add(function() { | ||
| 531 | var e = DOM.get(ed.id + '_external'); | ||
| 532 | DOM.show(e); | ||
| 533 | |||
| 534 | DOM.hide(lastExtID); | ||
| 535 | |||
| 536 | var f = Event.add(ed.id + '_external_close', 'click', function() { | ||
| 537 | DOM.hide(ed.id + '_external'); | ||
| 538 | Event.remove(ed.id + '_external_close', 'click', f); | ||
| 539 | }); | ||
| 540 | |||
| 541 | DOM.show(e); | ||
| 542 | DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); | ||
| 543 | |||
| 544 | // Fixes IE rendering bug | ||
| 545 | DOM.hide(e); | ||
| 546 | DOM.show(e); | ||
| 547 | e.style.filter = ''; | ||
| 548 | |||
| 549 | lastExtID = ed.id + '_external'; | ||
| 550 | |||
| 551 | e = null; | ||
| 552 | }); | ||
| 553 | } | ||
| 554 | |||
| 555 | if (sl == 'top') | ||
| 556 | t._addStatusBar(tb, o); | ||
| 557 | |||
| 558 | // Create iframe container | ||
| 559 | if (!s.theme_advanced_toolbar_container) { | ||
| 560 | n = DOM.add(tb, 'tr'); | ||
| 561 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 562 | } | ||
| 563 | |||
| 564 | // Create toolbar container at bottom | ||
| 565 | if (lo == 'bottom') | ||
| 566 | t._addToolbars(tb, o); | ||
| 567 | |||
| 568 | if (sl == 'bottom') | ||
| 569 | t._addStatusBar(tb, o); | ||
| 570 | |||
| 571 | return ic; | ||
| 572 | }, | ||
| 573 | |||
| 574 | _rowLayout : function(s, tb, o) { | ||
| 575 | var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; | ||
| 576 | |||
| 577 | dc = s.theme_advanced_containers_default_class || ''; | ||
| 578 | da = s.theme_advanced_containers_default_align || 'center'; | ||
| 579 | |||
| 580 | each(explode(s.theme_advanced_containers || ''), function(c, i) { | ||
| 581 | var v = s['theme_advanced_container_' + c] || ''; | ||
| 582 | |||
| 583 | switch (v.toLowerCase()) { | ||
| 584 | case 'mceeditor': | ||
| 585 | n = DOM.add(tb, 'tr'); | ||
| 586 | n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); | ||
| 587 | break; | ||
| 588 | |||
| 589 | case 'mceelementpath': | ||
| 590 | t._addStatusBar(tb, o); | ||
| 591 | break; | ||
| 592 | |||
| 593 | default: | ||
| 594 | a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); | ||
| 595 | a = 'mce' + t._ufirst(a); | ||
| 596 | |||
| 597 | n = DOM.add(DOM.add(tb, 'tr'), 'td', { | ||
| 598 | 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da | ||
| 599 | }); | ||
| 600 | |||
| 601 | to = cf.createToolbar("toolbar" + i); | ||
| 602 | t._addControls(v, to); | ||
| 603 | DOM.setHTML(n, to.renderHTML()); | ||
| 604 | o.deltaHeight -= s.theme_advanced_row_height; | ||
| 605 | } | ||
| 606 | }); | ||
| 607 | |||
| 608 | return ic; | ||
| 609 | }, | ||
| 610 | |||
| 611 | _addControls : function(v, tb) { | ||
| 612 | var t = this, s = t.settings, di, cf = t.editor.controlManager; | ||
| 613 | |||
| 614 | if (s.theme_advanced_disable && !t._disabled) { | ||
| 615 | di = {}; | ||
| 616 | |||
| 617 | each(explode(s.theme_advanced_disable), function(v) { | ||
| 618 | di[v] = 1; | ||
| 619 | }); | ||
| 620 | |||
| 621 | t._disabled = di; | ||
| 622 | } else | ||
| 623 | di = t._disabled; | ||
| 624 | |||
| 625 | each(explode(v), function(n) { | ||
| 626 | var c; | ||
| 627 | |||
| 628 | if (di && di[n]) | ||
| 629 | return; | ||
| 630 | |||
| 631 | // Compatiblity with 2.x | ||
| 632 | if (n == 'tablecontrols') { | ||
| 633 | each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { | ||
| 634 | n = t.createControl(n, cf); | ||
| 635 | |||
| 636 | if (n) | ||
| 637 | tb.add(n); | ||
| 638 | }); | ||
| 639 | |||
| 640 | return; | ||
| 641 | } | ||
| 642 | |||
| 643 | c = t.createControl(n, cf); | ||
| 644 | |||
| 645 | if (c) | ||
| 646 | tb.add(c); | ||
| 647 | }); | ||
| 648 | }, | ||
| 649 | |||
| 650 | _addToolbars : function(c, o) { | ||
| 651 | var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a; | ||
| 652 | |||
| 653 | a = s.theme_advanced_toolbar_align.toLowerCase(); | ||
| 654 | a = 'mce' + t._ufirst(a); | ||
| 655 | |||
| 656 | n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a}); | ||
| 657 | |||
| 658 | if (!ed.getParam('accessibility_focus')) | ||
| 659 | h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->')); | ||
| 660 | |||
| 661 | h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->')); | ||
| 662 | |||
| 663 | // Create toolbar and add the controls | ||
| 664 | for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { | ||
| 665 | tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); | ||
| 666 | |||
| 667 | if (s['theme_advanced_buttons' + i + '_add']) | ||
| 668 | v += ',' + s['theme_advanced_buttons' + i + '_add']; | ||
| 669 | |||
| 670 | if (s['theme_advanced_buttons' + i + '_add_before']) | ||
| 671 | v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; | ||
| 672 | |||
| 673 | t._addControls(v, tb); | ||
| 674 | |||
| 675 | //n.appendChild(n = tb.render()); | ||
| 676 | h.push(tb.renderHTML()); | ||
| 677 | |||
| 678 | o.deltaHeight -= s.theme_advanced_row_height; | ||
| 679 | } | ||
| 680 | |||
| 681 | h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->')); | ||
| 682 | DOM.setHTML(n, h.join('')); | ||
| 683 | }, | ||
| 684 | |||
| 685 | _addStatusBar : function(tb, o) { | ||
| 686 | var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; | ||
| 687 | |||
| 688 | n = DOM.add(tb, 'tr'); | ||
| 689 | n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); | ||
| 690 | n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); | ||
| 691 | DOM.add(n, 'a', {href : '#', accesskey : 'x'}); | ||
| 692 | |||
| 693 | if (s.theme_advanced_resizing) { | ||
| 694 | DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); | ||
| 695 | |||
| 696 | if (s.theme_advanced_resizing_use_cookie) { | ||
| 697 | ed.onPostRender.add(function() { | ||
| 698 | var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); | ||
| 699 | |||
| 700 | if (!o) | ||
| 701 | return; | ||
| 702 | |||
| 703 | if (s.theme_advanced_resize_horizontal) | ||
| 704 | c.style.width = Math.max(10, o.cw) + 'px'; | ||
| 705 | |||
| 706 | c.style.height = Math.max(10, o.ch) + 'px'; | ||
| 707 | DOM.get(ed.id + '_ifr').style.height = Math.max(10, parseInt(o.ch) + t.deltaHeight) + 'px'; | ||
| 708 | }); | ||
| 709 | } | ||
| 710 | |||
| 711 | ed.onPostRender.add(function() { | ||
| 712 | Event.add(ed.id + '_resize', 'mousedown', function(e) { | ||
| 713 | var c, p, w, h, n, pa; | ||
| 714 | |||
| 715 | // Measure container | ||
| 716 | c = DOM.get(ed.id + '_tbl'); | ||
| 717 | w = c.clientWidth; | ||
| 718 | h = c.clientHeight; | ||
| 719 | |||
| 720 | miw = s.theme_advanced_resizing_min_width || 100; | ||
| 721 | mih = s.theme_advanced_resizing_min_height || 100; | ||
| 722 | maw = s.theme_advanced_resizing_max_width || 0xFFFF; | ||
| 723 | mah = s.theme_advanced_resizing_max_height || 0xFFFF; | ||
| 724 | |||
| 725 | // Setup placeholder | ||
| 726 | p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); | ||
| 727 | DOM.setStyles(p, {width : w, height : h}); | ||
| 728 | |||
| 729 | // Replace with placeholder | ||
| 730 | DOM.hide(c); | ||
| 731 | DOM.show(p); | ||
| 732 | |||
| 733 | // Create internal resize obj | ||
| 734 | r = { | ||
| 735 | x : e.screenX, | ||
| 736 | y : e.screenY, | ||
| 737 | w : w, | ||
| 738 | h : h, | ||
| 739 | dx : null, | ||
| 740 | dy : null | ||
| 741 | }; | ||
| 742 | |||
| 743 | // Start listening | ||
| 744 | mf = Event.add(DOM.doc, 'mousemove', function(e) { | ||
| 745 | var w, h; | ||
| 746 | |||
| 747 | // Calc delta values | ||
| 748 | r.dx = e.screenX - r.x; | ||
| 749 | r.dy = e.screenY - r.y; | ||
| 750 | |||
| 751 | // Boundery fix box | ||
| 752 | w = Math.max(miw, r.w + r.dx); | ||
| 753 | h = Math.max(mih, r.h + r.dy); | ||
| 754 | w = Math.min(maw, w); | ||
| 755 | h = Math.min(mah, h); | ||
| 756 | |||
| 757 | // Resize placeholder | ||
| 758 | if (s.theme_advanced_resize_horizontal) | ||
| 759 | p.style.width = w + 'px'; | ||
| 760 | |||
| 761 | p.style.height = h + 'px'; | ||
| 762 | |||
| 763 | return Event.cancel(e); | ||
| 764 | }); | ||
| 765 | |||
| 766 | me = Event.add(DOM.doc, 'mouseup', function(e) { | ||
| 767 | var ifr; | ||
| 768 | |||
| 769 | // Stop listening | ||
| 770 | Event.remove(DOM.doc, 'mousemove', mf); | ||
| 771 | Event.remove(DOM.doc, 'mouseup', me); | ||
| 772 | |||
| 773 | c.style.display = ''; | ||
| 774 | DOM.remove(p); | ||
| 775 | |||
| 776 | if (r.dx === null) | ||
| 777 | return; | ||
| 778 | |||
| 779 | ifr = DOM.get(ed.id + '_ifr'); | ||
| 780 | |||
| 781 | if (s.theme_advanced_resize_horizontal) | ||
| 782 | c.style.width = Math.max(10, r.w + r.dx) + 'px'; | ||
| 783 | |||
| 784 | c.style.height = Math.max(10, r.h + r.dy) + 'px'; | ||
| 785 | ifr.style.height = Math.max(10, ifr.clientHeight + r.dy) + 'px'; | ||
| 786 | |||
| 787 | if (s.theme_advanced_resizing_use_cookie) { | ||
| 788 | Cookie.setHash("TinyMCE_" + ed.id + "_size", { | ||
| 789 | cw : r.w + r.dx, | ||
| 790 | ch : r.h + r.dy | ||
| 791 | }); | ||
| 792 | } | ||
| 793 | }); | ||
| 794 | |||
| 795 | return Event.cancel(e); | ||
| 796 | }); | ||
| 797 | }); | ||
| 798 | } | ||
| 799 | |||
| 800 | o.deltaHeight -= 21; | ||
| 801 | n = tb = null; | ||
| 802 | }, | ||
| 803 | |||
| 804 | _nodeChanged : function(ed, cm, n, co) { | ||
| 805 | var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn; | ||
| 806 | |||
| 807 | if (s.readonly) | ||
| 808 | return; | ||
| 809 | |||
| 810 | tinymce.each(t.stateControls, function(c) { | ||
| 811 | cm.setActive(c, ed.queryCommandState(t.controls[c][1])); | ||
| 812 | }); | ||
| 813 | |||
| 814 | cm.setActive('visualaid', ed.hasVisual); | ||
| 815 | cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); | ||
| 816 | cm.setDisabled('redo', !ed.undoManager.hasRedo()); | ||
| 817 | cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); | ||
| 818 | |||
| 819 | p = DOM.getParent(n, 'A'); | ||
| 820 | if (c = cm.get('link')) { | ||
| 821 | if (!p || !p.name) { | ||
| 822 | c.setDisabled(!p && co); | ||
| 823 | c.setActive(!!p); | ||
| 824 | } | ||
| 825 | } | ||
| 826 | |||
| 827 | if (c = cm.get('unlink')) { | ||
| 828 | c.setDisabled(!p && co); | ||
| 829 | c.setActive(!!p && !p.name); | ||
| 830 | } | ||
| 831 | |||
| 832 | if (c = cm.get('anchor')) { | ||
| 833 | c.setActive(!!p && p.name); | ||
| 834 | |||
| 835 | if (tinymce.isWebKit) { | ||
| 836 | p = DOM.getParent(n, 'IMG'); | ||
| 837 | c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); | ||
| 838 | } | ||
| 839 | } | ||
| 840 | |||
| 841 | p = DOM.getParent(n, 'IMG'); | ||
| 842 | if (c = cm.get('image')) | ||
| 843 | c.setActive(!!p && n.className.indexOf('mceItem') == -1); | ||
| 844 | |||
| 845 | if (c = cm.get('styleselect')) { | ||
| 846 | if (n.className) { | ||
| 847 | t._importClasses(); | ||
| 848 | c.select(n.className); | ||
| 849 | } else | ||
| 850 | c.select(); | ||
| 851 | } | ||
| 852 | |||
| 853 | if (c = cm.get('formatselect')) { | ||
| 854 | p = DOM.getParent(n, DOM.isBlock); | ||
| 855 | |||
| 856 | if (p) | ||
| 857 | c.select(p.nodeName.toLowerCase()); | ||
| 858 | } | ||
| 859 | |||
| 860 | if (ed.settings.convert_fonts_to_spans) { | ||
| 861 | ed.dom.getParent(n, function(n) { | ||
| 862 | if (n.nodeName === 'SPAN') { | ||
| 863 | if (!cl && n.className) | ||
| 864 | cl = n.className; | ||
| 865 | |||
| 866 | if (!fz && n.style.fontSize) | ||
| 867 | fz = n.style.fontSize; | ||
| 868 | |||
| 869 | if (!fn && n.style.fontFamily) | ||
| 870 | fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); | ||
| 871 | } | ||
| 872 | |||
| 873 | return false; | ||
| 874 | }); | ||
| 875 | |||
| 876 | if (c = cm.get('fontselect')) { | ||
| 877 | c.select(function(v) { | ||
| 878 | return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; | ||
| 879 | }); | ||
| 880 | } | ||
| 881 | |||
| 882 | if (c = cm.get('fontsizeselect')) { | ||
| 883 | c.select(function(v) { | ||
| 884 | if (v.fontSize && v.fontSize === fz) | ||
| 885 | return true; | ||
| 886 | |||
| 887 | if (v['class'] && v['class'] === cl) | ||
| 888 | return true; | ||
| 889 | }); | ||
| 890 | } | ||
| 891 | } else { | ||
| 892 | if (c = cm.get('fontselect')) | ||
| 893 | c.select(ed.queryCommandValue('FontName')); | ||
| 894 | |||
| 895 | if (c = cm.get('fontsizeselect')) { | ||
| 896 | v = ed.queryCommandValue('FontSize'); | ||
| 897 | c.select(function(iv) { | ||
| 898 | return iv.fontSize == v; | ||
| 899 | }); | ||
| 900 | } | ||
| 901 | } | ||
| 902 | |||
| 903 | if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { | ||
| 904 | p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); | ||
| 905 | DOM.setHTML(p, ''); | ||
| 906 | |||
| 907 | ed.dom.getParent(n, function(n) { | ||
| 908 | var na = n.nodeName.toLowerCase(), u, pi, ti = ''; | ||
| 909 | |||
| 910 | // Ignore non element and hidden elements | ||
| 911 | if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) | ||
| 912 | return; | ||
| 913 | |||
| 914 | // Fake name | ||
| 915 | if (v = DOM.getAttrib(n, 'mce_name')) | ||
| 916 | na = v; | ||
| 917 | |||
| 918 | // Handle prefix | ||
| 919 | if (tinymce.isIE && n.scopeName !== 'HTML') | ||
| 920 | na = n.scopeName + ':' + na; | ||
| 921 | |||
| 922 | // Remove internal prefix | ||
| 923 | na = na.replace(/mce\:/g, ''); | ||
| 924 | |||
| 925 | // Handle node name | ||
| 926 | switch (na) { | ||
| 927 | case 'b': | ||
| 928 | na = 'strong'; | ||
| 929 | break; | ||
| 930 | |||
| 931 | case 'i': | ||
| 932 | na = 'em'; | ||
| 933 | break; | ||
| 934 | |||
| 935 | case 'img': | ||
| 936 | if (v = DOM.getAttrib(n, 'src')) | ||
| 937 | ti += 'src: ' + v + ' '; | ||
| 938 | |||
| 939 | break; | ||
| 940 | |||
| 941 | case 'a': | ||
| 942 | if (v = DOM.getAttrib(n, 'name')) { | ||
| 943 | ti += 'name: ' + v + ' '; | ||
| 944 | na += '#' + v; | ||
| 945 | } | ||
| 946 | |||
| 947 | if (v = DOM.getAttrib(n, 'href')) | ||
| 948 | ti += 'href: ' + v + ' '; | ||
| 949 | |||
| 950 | break; | ||
| 951 | |||
| 952 | case 'font': | ||
| 953 | if (s.convert_fonts_to_spans) | ||
| 954 | na = 'span'; | ||
| 955 | |||
| 956 | if (v = DOM.getAttrib(n, 'face')) | ||
| 957 | ti += 'font: ' + v + ' '; | ||
| 958 | |||
| 959 | if (v = DOM.getAttrib(n, 'size')) | ||
| 960 | ti += 'size: ' + v + ' '; | ||
| 961 | |||
| 962 | if (v = DOM.getAttrib(n, 'color')) | ||
| 963 | ti += 'color: ' + v + ' '; | ||
| 964 | |||
| 965 | break; | ||
| 966 | |||
| 967 | case 'span': | ||
| 968 | if (v = DOM.getAttrib(n, 'style')) | ||
| 969 | ti += 'style: ' + v + ' '; | ||
| 970 | |||
| 971 | break; | ||
| 972 | } | ||
| 973 | |||
| 974 | if (v = DOM.getAttrib(n, 'id')) | ||
| 975 | ti += 'id: ' + v + ' '; | ||
| 976 | |||
| 977 | if (v = n.className) { | ||
| 978 | v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); | ||
| 979 | |||
| 980 | if (v && v.indexOf('mceItem') == -1) { | ||
| 981 | ti += 'class: ' + v + ' '; | ||
| 982 | |||
| 983 | if (DOM.isBlock(n) || na == 'img' || na == 'span') | ||
| 984 | na += '.' + v; | ||
| 985 | } | ||
| 986 | } | ||
| 987 | |||
| 988 | na = na.replace(/(html:)/g, ''); | ||
| 989 | na = {name : na, node : n, title : ti}; | ||
| 990 | t.onResolveName.dispatch(t, na); | ||
| 991 | ti = na.title; | ||
| 992 | na = na.name; | ||
| 993 | |||
| 994 | //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; | ||
| 995 | pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); | ||
| 996 | |||
| 997 | if (p.hasChildNodes()) { | ||
| 998 | p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild); | ||
| 999 | p.insertBefore(pi, p.firstChild); | ||
| 1000 | } else | ||
| 1001 | p.appendChild(pi); | ||
| 1002 | }, ed.getBody()); | ||
| 1003 | } | ||
| 1004 | }, | ||
| 1005 | |||
| 1006 | // Commands gets called by execCommand | ||
| 1007 | |||
| 1008 | _sel : function(v) { | ||
| 1009 | this.editor.execCommand('mceSelectNodeDepth', false, v); | ||
| 1010 | }, | ||
| 1011 | |||
| 1012 | _mceInsertAnchor : function(ui, v) { | ||
| 1013 | var ed = this.editor; | ||
| 1014 | |||
| 1015 | ed.windowManager.open({ | ||
| 1016 | url : tinymce.baseURL + '/themes/advanced/anchor.htm', | ||
| 1017 | width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), | ||
| 1018 | height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), | ||
| 1019 | inline : true | ||
| 1020 | }, { | ||
| 1021 | theme_url : this.url | ||
| 1022 | }); | ||
| 1023 | }, | ||
| 1024 | |||
| 1025 | _mceCharMap : function() { | ||
| 1026 | var ed = this.editor; | ||
| 1027 | |||
| 1028 | ed.windowManager.open({ | ||
| 1029 | url : tinymce.baseURL + '/themes/advanced/charmap.htm', | ||
| 1030 | width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), | ||
| 1031 | height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), | ||
| 1032 | inline : true | ||
| 1033 | }, { | ||
| 1034 | theme_url : this.url | ||
| 1035 | }); | ||
| 1036 | }, | ||
| 1037 | |||
| 1038 | _mceHelp : function() { | ||
| 1039 | var ed = this.editor; | ||
| 1040 | |||
| 1041 | ed.windowManager.open({ | ||
| 1042 | url : tinymce.baseURL + '/themes/advanced/about.htm', | ||
| 1043 | width : 480, | ||
| 1044 | height : 380, | ||
| 1045 | inline : true | ||
| 1046 | }, { | ||
| 1047 | theme_url : this.url | ||
| 1048 | }); | ||
| 1049 | }, | ||
| 1050 | |||
| 1051 | _mceColorPicker : function(u, v) { | ||
| 1052 | var ed = this.editor; | ||
| 1053 | |||
| 1054 | v = v || {}; | ||
| 1055 | |||
| 1056 | ed.windowManager.open({ | ||
| 1057 | url : tinymce.baseURL + '/themes/advanced/color_picker.htm', | ||
| 1058 | width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), | ||
| 1059 | height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), | ||
| 1060 | close_previous : false, | ||
| 1061 | inline : true | ||
| 1062 | }, { | ||
| 1063 | input_color : v.color, | ||
| 1064 | func : v.func, | ||
| 1065 | theme_url : this.url | ||
| 1066 | }); | ||
| 1067 | }, | ||
| 1068 | |||
| 1069 | _mceCodeEditor : function(ui, val) { | ||
| 1070 | var ed = this.editor; | ||
| 1071 | |||
| 1072 | ed.windowManager.open({ | ||
| 1073 | url : tinymce.baseURL + '/themes/advanced/source_editor.htm', | ||
| 1074 | width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), | ||
| 1075 | height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), | ||
| 1076 | inline : true, | ||
| 1077 | resizable : true, | ||
| 1078 | maximizable : true | ||
| 1079 | }, { | ||
| 1080 | theme_url : this.url | ||
| 1081 | }); | ||
| 1082 | }, | ||
| 1083 | |||
| 1084 | _mceImage : function(ui, val) { | ||
| 1085 | var ed = this.editor; | ||
| 1086 | |||
| 1087 | // Internal image object like a flash placeholder | ||
| 1088 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) | ||
| 1089 | return; | ||
| 1090 | |||
| 1091 | ed.windowManager.open({ | ||
| 1092 | url : tinymce.baseURL + '/themes/advanced/image.htm', | ||
| 1093 | width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), | ||
| 1094 | height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), | ||
| 1095 | inline : true | ||
| 1096 | }, { | ||
| 1097 | theme_url : this.url | ||
| 1098 | }); | ||
| 1099 | }, | ||
| 1100 | |||
| 1101 | _mceLink : function(ui, val) { | ||
| 1102 | var ed = this.editor; | ||
| 1103 | |||
| 1104 | ed.windowManager.open({ | ||
| 1105 | url : tinymce.baseURL + '/themes/advanced/link.htm', | ||
| 1106 | width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), | ||
| 1107 | height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), | ||
| 1108 | inline : true | ||
| 1109 | }, { | ||
| 1110 | theme_url : this.url | ||
| 1111 | }); | ||
| 1112 | }, | ||
| 1113 | |||
| 1114 | _mceNewDocument : function() { | ||
| 1115 | var ed = this.editor; | ||
| 1116 | |||
| 1117 | ed.windowManager.confirm('advanced.newdocument', function(s) { | ||
| 1118 | if (s) | ||
| 1119 | ed.execCommand('mceSetContent', false, ''); | ||
| 1120 | }); | ||
| 1121 | }, | ||
| 1122 | |||
| 1123 | _mceForeColor : function() { | ||
| 1124 | var t = this; | ||
| 1125 | |||
| 1126 | this._mceColorPicker(0, { | ||
| 1127 | color: t.fgColor, | ||
| 1128 | func : function(co) { | ||
| 1129 | t.fgColor = co; | ||
| 1130 | t.editor.execCommand('ForeColor', false, co); | ||
| 1131 | } | ||
| 1132 | }); | ||
| 1133 | }, | ||
| 1134 | |||
| 1135 | _mceBackColor : function() { | ||
| 1136 | var t = this; | ||
| 1137 | |||
| 1138 | this._mceColorPicker(0, { | ||
| 1139 | color: t.bgColor, | ||
| 1140 | func : function(co) { | ||
| 1141 | t.bgColor = co; | ||
| 1142 | t.editor.execCommand('HiliteColor', false, co); | ||
| 1143 | } | ||
| 1144 | }); | ||
| 1145 | }, | ||
| 1146 | |||
| 1147 | _ufirst : function(s) { | ||
| 1148 | return s.substring(0, 1).toUpperCase() + s.substring(1); | ||
| 1149 | } | ||
| 1150 | }); | ||
| 1151 | |||
| 1152 | tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); | ||
| 1153 | }(tinymce)); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/image.htm b/public/javascripts/tiny_mce/themes/advanced/image.htm deleted file mode 100644 index 7ec1052..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/image.htm +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.image_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="js/image.js"></script> | ||
| 9 | </head> | ||
| 10 | <body id="image" style="display: none"> | ||
| 11 | <form onsubmit="ImageDialog.update();return false;" action="#"> | ||
| 12 | <div class="tabs"> | ||
| 13 | <ul> | ||
| 14 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li> | ||
| 15 | </ul> | ||
| 16 | </div> | ||
| 17 | |||
| 18 | <div class="panel_wrapper"> | ||
| 19 | <div id="general_panel" class="panel current"> | ||
| 20 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 21 | <tr> | ||
| 22 | <td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td> | ||
| 23 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 24 | <tr> | ||
| 25 | <td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td> | ||
| 26 | <td id="srcbrowsercontainer"> </td> | ||
| 27 | </tr> | ||
| 28 | </table></td> | ||
| 29 | </tr> | ||
| 30 | <tr> | ||
| 31 | <td><label for="image_list">{#advanced_dlg.image_list}</label></td> | ||
| 32 | <td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td> | ||
| 33 | </tr> | ||
| 34 | <tr> | ||
| 35 | <td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td> | ||
| 36 | <td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td> | ||
| 37 | </tr> | ||
| 38 | <tr> | ||
| 39 | <td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td> | ||
| 40 | <td><select id="align" name="align" onchange="ImageDialog.updateStyle();"> | ||
| 41 | <option value="">{#not_set}</option> | ||
| 42 | <option value="baseline">{#advanced_dlg.image_align_baseline}</option> | ||
| 43 | <option value="top">{#advanced_dlg.image_align_top}</option> | ||
| 44 | <option value="middle">{#advanced_dlg.image_align_middle}</option> | ||
| 45 | <option value="bottom">{#advanced_dlg.image_align_bottom}</option> | ||
| 46 | <option value="text-top">{#advanced_dlg.image_align_texttop}</option> | ||
| 47 | <option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option> | ||
| 48 | <option value="left">{#advanced_dlg.image_align_left}</option> | ||
| 49 | <option value="right">{#advanced_dlg.image_align_right}</option> | ||
| 50 | </select></td> | ||
| 51 | </tr> | ||
| 52 | <tr> | ||
| 53 | <td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td> | ||
| 54 | <td><input id="width" name="width" type="text" value="" size="3" maxlength="5" /> | ||
| 55 | x | ||
| 56 | <input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td> | ||
| 57 | </tr> | ||
| 58 | <tr> | ||
| 59 | <td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td> | ||
| 60 | <td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 61 | </tr> | ||
| 62 | <tr> | ||
| 63 | <td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td> | ||
| 64 | <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 65 | </tr> | ||
| 66 | <tr> | ||
| 67 | <td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td> | ||
| 68 | <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td> | ||
| 69 | </tr> | ||
| 70 | </table> | ||
| 71 | </div> | ||
| 72 | </div> | ||
| 73 | |||
| 74 | <div class="mceActionPanel"> | ||
| 75 | <div style="float: left"> | ||
| 76 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 77 | </div> | ||
| 78 | |||
| 79 | <div style="float: right"> | ||
| 80 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 81 | </div> | ||
| 82 | </div> | ||
| 83 | </form> | ||
| 84 | </body> | ||
| 85 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg b/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg deleted file mode 100644 index b4c542d..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/img/icons.gif b/public/javascripts/tiny_mce/themes/advanced/img/icons.gif deleted file mode 100644 index ccac36f..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/img/icons.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/about.js b/public/javascripts/tiny_mce/themes/advanced/js/about.js deleted file mode 100644 index 5cee9ed..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/about.js +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | function init() { | ||
| 4 | var ed, tcont; | ||
| 5 | |||
| 6 | tinyMCEPopup.resizeToInnerSize(); | ||
| 7 | ed = tinyMCEPopup.editor; | ||
| 8 | |||
| 9 | // Give FF some time | ||
| 10 | window.setTimeout(insertHelpIFrame, 10); | ||
| 11 | |||
| 12 | tcont = document.getElementById('plugintablecontainer'); | ||
| 13 | document.getElementById('plugins_tab').style.display = 'none'; | ||
| 14 | |||
| 15 | var html = ""; | ||
| 16 | html += '<table id="plugintable">'; | ||
| 17 | html += '<thead>'; | ||
| 18 | html += '<tr>'; | ||
| 19 | html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>'; | ||
| 20 | html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>'; | ||
| 21 | html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>'; | ||
| 22 | html += '</tr>'; | ||
| 23 | html += '</thead>'; | ||
| 24 | html += '<tbody>'; | ||
| 25 | |||
| 26 | tinymce.each(ed.plugins, function(p, n) { | ||
| 27 | var info; | ||
| 28 | |||
| 29 | if (!p.getInfo) | ||
| 30 | return; | ||
| 31 | |||
| 32 | html += '<tr>'; | ||
| 33 | |||
| 34 | info = p.getInfo(); | ||
| 35 | |||
| 36 | if (info.infourl != null && info.infourl != '') | ||
| 37 | html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>'; | ||
| 38 | else | ||
| 39 | html += '<td width="50%" title="' + n + '">' + info.longname + '</td>'; | ||
| 40 | |||
| 41 | if (info.authorurl != null && info.authorurl != '') | ||
| 42 | html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>'; | ||
| 43 | else | ||
| 44 | html += '<td width="35%">' + info.author + '</td>'; | ||
| 45 | |||
| 46 | html += '<td width="15%">' + info.version + '</td>'; | ||
| 47 | html += '</tr>'; | ||
| 48 | |||
| 49 | document.getElementById('plugins_tab').style.display = ''; | ||
| 50 | |||
| 51 | }); | ||
| 52 | |||
| 53 | html += '</tbody>'; | ||
| 54 | html += '</table>'; | ||
| 55 | |||
| 56 | tcont.innerHTML = html; | ||
| 57 | |||
| 58 | tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; | ||
| 59 | tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; | ||
| 60 | } | ||
| 61 | |||
| 62 | function insertHelpIFrame() { | ||
| 63 | var html; | ||
| 64 | |||
| 65 | if (tinyMCEPopup.getParam('docs_url')) { | ||
| 66 | html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>'; | ||
| 67 | document.getElementById('iframecontainer').innerHTML = html; | ||
| 68 | document.getElementById('help_tab').style.display = 'block'; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/anchor.js b/public/javascripts/tiny_mce/themes/advanced/js/anchor.js deleted file mode 100644 index b5efd1e..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/anchor.js +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var AnchorDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | var action, elm, f = document.forms[0]; | ||
| 6 | |||
| 7 | this.editor = ed; | ||
| 8 | elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG'); | ||
| 9 | v = ed.dom.getAttrib(elm, 'name'); | ||
| 10 | |||
| 11 | if (v) { | ||
| 12 | this.action = 'update'; | ||
| 13 | f.anchorName.value = v; | ||
| 14 | } | ||
| 15 | |||
| 16 | f.insert.value = ed.getLang(elm ? 'update' : 'insert'); | ||
| 17 | }, | ||
| 18 | |||
| 19 | update : function() { | ||
| 20 | var ed = this.editor; | ||
| 21 | |||
| 22 | tinyMCEPopup.restoreSelection(); | ||
| 23 | |||
| 24 | if (this.action != 'update') | ||
| 25 | ed.selection.collapse(1); | ||
| 26 | |||
| 27 | // Webkit acts weird if empty inline element is inserted so we need to use a image instead | ||
| 28 | if (tinymce.isWebKit) | ||
| 29 | ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'})); | ||
| 30 | else | ||
| 31 | ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, '')); | ||
| 32 | |||
| 33 | tinyMCEPopup.close(); | ||
| 34 | } | ||
| 35 | }; | ||
| 36 | |||
| 37 | tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/charmap.js b/public/javascripts/tiny_mce/themes/advanced/js/charmap.js deleted file mode 100644 index 8467ef6..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/charmap.js +++ /dev/null | |||
| @@ -1,325 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var charmap = [ | ||
| 4 | [' ', ' ', true, 'no-break space'], | ||
| 5 | ['&', '&', true, 'ampersand'], | ||
| 6 | ['"', '"', true, 'quotation mark'], | ||
| 7 | // finance | ||
| 8 | ['¢', '¢', true, 'cent sign'], | ||
| 9 | ['€', '€', true, 'euro sign'], | ||
| 10 | ['£', '£', true, 'pound sign'], | ||
| 11 | ['¥', '¥', true, 'yen sign'], | ||
| 12 | // signs | ||
| 13 | ['©', '©', true, 'copyright sign'], | ||
| 14 | ['®', '®', true, 'registered sign'], | ||
| 15 | ['™', '™', true, 'trade mark sign'], | ||
| 16 | ['‰', '‰', true, 'per mille sign'], | ||
| 17 | ['µ', 'µ', true, 'micro sign'], | ||
| 18 | ['·', '·', true, 'middle dot'], | ||
| 19 | ['•', '•', true, 'bullet'], | ||
| 20 | ['…', '…', true, 'three dot leader'], | ||
| 21 | ['′', '′', true, 'minutes / feet'], | ||
| 22 | ['″', '″', true, 'seconds / inches'], | ||
| 23 | ['§', '§', true, 'section sign'], | ||
| 24 | ['¶', '¶', true, 'paragraph sign'], | ||
| 25 | ['ß', 'ß', true, 'sharp s / ess-zed'], | ||
| 26 | // quotations | ||
| 27 | ['‹', '‹', true, 'single left-pointing angle quotation mark'], | ||
| 28 | ['›', '›', true, 'single right-pointing angle quotation mark'], | ||
| 29 | ['«', '«', true, 'left pointing guillemet'], | ||
| 30 | ['»', '»', true, 'right pointing guillemet'], | ||
| 31 | ['‘', '‘', true, 'left single quotation mark'], | ||
| 32 | ['’', '’', true, 'right single quotation mark'], | ||
| 33 | ['“', '“', true, 'left double quotation mark'], | ||
| 34 | ['”', '”', true, 'right double quotation mark'], | ||
| 35 | ['‚', '‚', true, 'single low-9 quotation mark'], | ||
| 36 | ['„', '„', true, 'double low-9 quotation mark'], | ||
| 37 | ['<', '<', true, 'less-than sign'], | ||
| 38 | ['>', '>', true, 'greater-than sign'], | ||
| 39 | ['≤', '≤', true, 'less-than or equal to'], | ||
| 40 | ['≥', '≥', true, 'greater-than or equal to'], | ||
| 41 | ['–', '–', true, 'en dash'], | ||
| 42 | ['—', '—', true, 'em dash'], | ||
| 43 | ['¯', '¯', true, 'macron'], | ||
| 44 | ['‾', '‾', true, 'overline'], | ||
| 45 | ['¤', '¤', true, 'currency sign'], | ||
| 46 | ['¦', '¦', true, 'broken bar'], | ||
| 47 | ['¨', '¨', true, 'diaeresis'], | ||
| 48 | ['¡', '¡', true, 'inverted exclamation mark'], | ||
| 49 | ['¿', '¿', true, 'turned question mark'], | ||
| 50 | ['ˆ', 'ˆ', true, 'circumflex accent'], | ||
| 51 | ['˜', '˜', true, 'small tilde'], | ||
| 52 | ['°', '°', true, 'degree sign'], | ||
| 53 | ['−', '−', true, 'minus sign'], | ||
| 54 | ['±', '±', true, 'plus-minus sign'], | ||
| 55 | ['÷', '÷', true, 'division sign'], | ||
| 56 | ['⁄', '⁄', true, 'fraction slash'], | ||
| 57 | ['×', '×', true, 'multiplication sign'], | ||
| 58 | ['¹', '¹', true, 'superscript one'], | ||
| 59 | ['²', '²', true, 'superscript two'], | ||
| 60 | ['³', '³', true, 'superscript three'], | ||
| 61 | ['¼', '¼', true, 'fraction one quarter'], | ||
| 62 | ['½', '½', true, 'fraction one half'], | ||
| 63 | ['¾', '¾', true, 'fraction three quarters'], | ||
| 64 | // math / logical | ||
| 65 | ['ƒ', 'ƒ', true, 'function / florin'], | ||
| 66 | ['∫', '∫', true, 'integral'], | ||
| 67 | ['∑', '∑', true, 'n-ary sumation'], | ||
| 68 | ['∞', '∞', true, 'infinity'], | ||
| 69 | ['√', '√', true, 'square root'], | ||
| 70 | ['∼', '∼', false,'similar to'], | ||
| 71 | ['≅', '≅', false,'approximately equal to'], | ||
| 72 | ['≈', '≈', true, 'almost equal to'], | ||
| 73 | ['≠', '≠', true, 'not equal to'], | ||
| 74 | ['≡', '≡', true, 'identical to'], | ||
| 75 | ['∈', '∈', false,'element of'], | ||
| 76 | ['∉', '∉', false,'not an element of'], | ||
| 77 | ['∋', '∋', false,'contains as member'], | ||
| 78 | ['∏', '∏', true, 'n-ary product'], | ||
| 79 | ['∧', '∧', false,'logical and'], | ||
| 80 | ['∨', '∨', false,'logical or'], | ||
| 81 | ['¬', '¬', true, 'not sign'], | ||
| 82 | ['∩', '∩', true, 'intersection'], | ||
| 83 | ['∪', '∪', false,'union'], | ||
| 84 | ['∂', '∂', true, 'partial differential'], | ||
| 85 | ['∀', '∀', false,'for all'], | ||
| 86 | ['∃', '∃', false,'there exists'], | ||
| 87 | ['∅', '∅', false,'diameter'], | ||
| 88 | ['∇', '∇', false,'backward difference'], | ||
| 89 | ['∗', '∗', false,'asterisk operator'], | ||
| 90 | ['∝', '∝', false,'proportional to'], | ||
| 91 | ['∠', '∠', false,'angle'], | ||
| 92 | // undefined | ||
| 93 | ['´', '´', true, 'acute accent'], | ||
| 94 | ['¸', '¸', true, 'cedilla'], | ||
| 95 | ['ª', 'ª', true, 'feminine ordinal indicator'], | ||
| 96 | ['º', 'º', true, 'masculine ordinal indicator'], | ||
| 97 | ['†', '†', true, 'dagger'], | ||
| 98 | ['‡', '‡', true, 'double dagger'], | ||
| 99 | // alphabetical special chars | ||
| 100 | ['À', 'À', true, 'A - grave'], | ||
| 101 | ['Á', 'Á', true, 'A - acute'], | ||
| 102 | ['Â', 'Â', true, 'A - circumflex'], | ||
| 103 | ['Ã', 'Ã', true, 'A - tilde'], | ||
| 104 | ['Ä', 'Ä', true, 'A - diaeresis'], | ||
| 105 | ['Å', 'Å', true, 'A - ring above'], | ||
| 106 | ['Æ', 'Æ', true, 'ligature AE'], | ||
| 107 | ['Ç', 'Ç', true, 'C - cedilla'], | ||
| 108 | ['È', 'È', true, 'E - grave'], | ||
| 109 | ['É', 'É', true, 'E - acute'], | ||
| 110 | ['Ê', 'Ê', true, 'E - circumflex'], | ||
| 111 | ['Ë', 'Ë', true, 'E - diaeresis'], | ||
| 112 | ['Ì', 'Ì', true, 'I - grave'], | ||
| 113 | ['Í', 'Í', true, 'I - acute'], | ||
| 114 | ['Î', 'Î', true, 'I - circumflex'], | ||
| 115 | ['Ï', 'Ï', true, 'I - diaeresis'], | ||
| 116 | ['Ð', 'Ð', true, 'ETH'], | ||
| 117 | ['Ñ', 'Ñ', true, 'N - tilde'], | ||
| 118 | ['Ò', 'Ò', true, 'O - grave'], | ||
| 119 | ['Ó', 'Ó', true, 'O - acute'], | ||
| 120 | ['Ô', 'Ô', true, 'O - circumflex'], | ||
| 121 | ['Õ', 'Õ', true, 'O - tilde'], | ||
| 122 | ['Ö', 'Ö', true, 'O - diaeresis'], | ||
| 123 | ['Ø', 'Ø', true, 'O - slash'], | ||
| 124 | ['Œ', 'Œ', true, 'ligature OE'], | ||
| 125 | ['Š', 'Š', true, 'S - caron'], | ||
| 126 | ['Ù', 'Ù', true, 'U - grave'], | ||
| 127 | ['Ú', 'Ú', true, 'U - acute'], | ||
| 128 | ['Û', 'Û', true, 'U - circumflex'], | ||
| 129 | ['Ü', 'Ü', true, 'U - diaeresis'], | ||
| 130 | ['Ý', 'Ý', true, 'Y - acute'], | ||
| 131 | ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], | ||
| 132 | ['Þ', 'Þ', true, 'THORN'], | ||
| 133 | ['à', 'à', true, 'a - grave'], | ||
| 134 | ['á', 'á', true, 'a - acute'], | ||
| 135 | ['â', 'â', true, 'a - circumflex'], | ||
| 136 | ['ã', 'ã', true, 'a - tilde'], | ||
| 137 | ['ä', 'ä', true, 'a - diaeresis'], | ||
| 138 | ['å', 'å', true, 'a - ring above'], | ||
| 139 | ['æ', 'æ', true, 'ligature ae'], | ||
| 140 | ['ç', 'ç', true, 'c - cedilla'], | ||
| 141 | ['è', 'è', true, 'e - grave'], | ||
| 142 | ['é', 'é', true, 'e - acute'], | ||
| 143 | ['ê', 'ê', true, 'e - circumflex'], | ||
| 144 | ['ë', 'ë', true, 'e - diaeresis'], | ||
| 145 | ['ì', 'ì', true, 'i - grave'], | ||
| 146 | ['í', 'í', true, 'i - acute'], | ||
| 147 | ['î', 'î', true, 'i - circumflex'], | ||
| 148 | ['ï', 'ï', true, 'i - diaeresis'], | ||
| 149 | ['ð', 'ð', true, 'eth'], | ||
| 150 | ['ñ', 'ñ', true, 'n - tilde'], | ||
| 151 | ['ò', 'ò', true, 'o - grave'], | ||
| 152 | ['ó', 'ó', true, 'o - acute'], | ||
| 153 | ['ô', 'ô', true, 'o - circumflex'], | ||
| 154 | ['õ', 'õ', true, 'o - tilde'], | ||
| 155 | ['ö', 'ö', true, 'o - diaeresis'], | ||
| 156 | ['ø', 'ø', true, 'o slash'], | ||
| 157 | ['œ', 'œ', true, 'ligature oe'], | ||
| 158 | ['š', 'š', true, 's - caron'], | ||
| 159 | ['ù', 'ù', true, 'u - grave'], | ||
| 160 | ['ú', 'ú', true, 'u - acute'], | ||
| 161 | ['û', 'û', true, 'u - circumflex'], | ||
| 162 | ['ü', 'ü', true, 'u - diaeresis'], | ||
| 163 | ['ý', 'ý', true, 'y - acute'], | ||
| 164 | ['þ', 'þ', true, 'thorn'], | ||
| 165 | ['ÿ', 'ÿ', true, 'y - diaeresis'], | ||
| 166 | ['Α', 'Α', true, 'Alpha'], | ||
| 167 | ['Β', 'Β', true, 'Beta'], | ||
| 168 | ['Γ', 'Γ', true, 'Gamma'], | ||
| 169 | ['Δ', 'Δ', true, 'Delta'], | ||
| 170 | ['Ε', 'Ε', true, 'Epsilon'], | ||
| 171 | ['Ζ', 'Ζ', true, 'Zeta'], | ||
| 172 | ['Η', 'Η', true, 'Eta'], | ||
| 173 | ['Θ', 'Θ', true, 'Theta'], | ||
| 174 | ['Ι', 'Ι', true, 'Iota'], | ||
| 175 | ['Κ', 'Κ', true, 'Kappa'], | ||
| 176 | ['Λ', 'Λ', true, 'Lambda'], | ||
| 177 | ['Μ', 'Μ', true, 'Mu'], | ||
| 178 | ['Ν', 'Ν', true, 'Nu'], | ||
| 179 | ['Ξ', 'Ξ', true, 'Xi'], | ||
| 180 | ['Ο', 'Ο', true, 'Omicron'], | ||
| 181 | ['Π', 'Π', true, 'Pi'], | ||
| 182 | ['Ρ', 'Ρ', true, 'Rho'], | ||
| 183 | ['Σ', 'Σ', true, 'Sigma'], | ||
| 184 | ['Τ', 'Τ', true, 'Tau'], | ||
| 185 | ['Υ', 'Υ', true, 'Upsilon'], | ||
| 186 | ['Φ', 'Φ', true, 'Phi'], | ||
| 187 | ['Χ', 'Χ', true, 'Chi'], | ||
| 188 | ['Ψ', 'Ψ', true, 'Psi'], | ||
| 189 | ['Ω', 'Ω', true, 'Omega'], | ||
| 190 | ['α', 'α', true, 'alpha'], | ||
| 191 | ['β', 'β', true, 'beta'], | ||
| 192 | ['γ', 'γ', true, 'gamma'], | ||
| 193 | ['δ', 'δ', true, 'delta'], | ||
| 194 | ['ε', 'ε', true, 'epsilon'], | ||
| 195 | ['ζ', 'ζ', true, 'zeta'], | ||
| 196 | ['η', 'η', true, 'eta'], | ||
| 197 | ['θ', 'θ', true, 'theta'], | ||
| 198 | ['ι', 'ι', true, 'iota'], | ||
| 199 | ['κ', 'κ', true, 'kappa'], | ||
| 200 | ['λ', 'λ', true, 'lambda'], | ||
| 201 | ['μ', 'μ', true, 'mu'], | ||
| 202 | ['ν', 'ν', true, 'nu'], | ||
| 203 | ['ξ', 'ξ', true, 'xi'], | ||
| 204 | ['ο', 'ο', true, 'omicron'], | ||
| 205 | ['π', 'π', true, 'pi'], | ||
| 206 | ['ρ', 'ρ', true, 'rho'], | ||
| 207 | ['ς', 'ς', true, 'final sigma'], | ||
| 208 | ['σ', 'σ', true, 'sigma'], | ||
| 209 | ['τ', 'τ', true, 'tau'], | ||
| 210 | ['υ', 'υ', true, 'upsilon'], | ||
| 211 | ['φ', 'φ', true, 'phi'], | ||
| 212 | ['χ', 'χ', true, 'chi'], | ||
| 213 | ['ψ', 'ψ', true, 'psi'], | ||
| 214 | ['ω', 'ω', true, 'omega'], | ||
| 215 | // symbols | ||
| 216 | ['ℵ', 'ℵ', false,'alef symbol'], | ||
| 217 | ['ϖ', 'ϖ', false,'pi symbol'], | ||
| 218 | ['ℜ', 'ℜ', false,'real part symbol'], | ||
| 219 | ['ϑ','ϑ', false,'theta symbol'], | ||
| 220 | ['ϒ', 'ϒ', false,'upsilon - hook symbol'], | ||
| 221 | ['℘', '℘', false,'Weierstrass p'], | ||
| 222 | ['ℑ', 'ℑ', false,'imaginary part'], | ||
| 223 | // arrows | ||
| 224 | ['←', '←', true, 'leftwards arrow'], | ||
| 225 | ['↑', '↑', true, 'upwards arrow'], | ||
| 226 | ['→', '→', true, 'rightwards arrow'], | ||
| 227 | ['↓', '↓', true, 'downwards arrow'], | ||
| 228 | ['↔', '↔', true, 'left right arrow'], | ||
| 229 | ['↵', '↵', false,'carriage return'], | ||
| 230 | ['⇐', '⇐', false,'leftwards double arrow'], | ||
| 231 | ['⇑', '⇑', false,'upwards double arrow'], | ||
| 232 | ['⇒', '⇒', false,'rightwards double arrow'], | ||
| 233 | ['⇓', '⇓', false,'downwards double arrow'], | ||
| 234 | ['⇔', '⇔', false,'left right double arrow'], | ||
| 235 | ['∴', '∴', false,'therefore'], | ||
| 236 | ['⊂', '⊂', false,'subset of'], | ||
| 237 | ['⊃', '⊃', false,'superset of'], | ||
| 238 | ['⊄', '⊄', false,'not a subset of'], | ||
| 239 | ['⊆', '⊆', false,'subset of or equal to'], | ||
| 240 | ['⊇', '⊇', false,'superset of or equal to'], | ||
| 241 | ['⊕', '⊕', false,'circled plus'], | ||
| 242 | ['⊗', '⊗', false,'circled times'], | ||
| 243 | ['⊥', '⊥', false,'perpendicular'], | ||
| 244 | ['⋅', '⋅', false,'dot operator'], | ||
| 245 | ['⌈', '⌈', false,'left ceiling'], | ||
| 246 | ['⌉', '⌉', false,'right ceiling'], | ||
| 247 | ['⌊', '⌊', false,'left floor'], | ||
| 248 | ['⌋', '⌋', false,'right floor'], | ||
| 249 | ['⟨', '〈', false,'left-pointing angle bracket'], | ||
| 250 | ['⟩', '〉', false,'right-pointing angle bracket'], | ||
| 251 | ['◊', '◊', true,'lozenge'], | ||
| 252 | ['♠', '♠', false,'black spade suit'], | ||
| 253 | ['♣', '♣', true, 'black club suit'], | ||
| 254 | ['♥', '♥', true, 'black heart suit'], | ||
| 255 | ['♦', '♦', true, 'black diamond suit'], | ||
| 256 | [' ', ' ', false,'en space'], | ||
| 257 | [' ', ' ', false,'em space'], | ||
| 258 | [' ', ' ', false,'thin space'], | ||
| 259 | ['‌', '‌', false,'zero width non-joiner'], | ||
| 260 | ['‍', '‍', false,'zero width joiner'], | ||
| 261 | ['‎', '‎', false,'left-to-right mark'], | ||
| 262 | ['‏', '‏', false,'right-to-left mark'], | ||
| 263 | ['­', '­', false,'soft hyphen'] | ||
| 264 | ]; | ||
| 265 | |||
| 266 | tinyMCEPopup.onInit.add(function() { | ||
| 267 | tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); | ||
| 268 | }); | ||
| 269 | |||
| 270 | function renderCharMapHTML() { | ||
| 271 | var charsPerRow = 20, tdWidth=20, tdHeight=20, i; | ||
| 272 | var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">'; | ||
| 273 | var cols=-1; | ||
| 274 | |||
| 275 | for (i=0; i<charmap.length; i++) { | ||
| 276 | if (charmap[i][2]==true) { | ||
| 277 | cols++; | ||
| 278 | html += '' | ||
| 279 | + '<td class="charmap">' | ||
| 280 | + '<a onmouseover="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">' | ||
| 281 | + charmap[i][1] | ||
| 282 | + '</a></td>'; | ||
| 283 | if ((cols+1) % charsPerRow == 0) | ||
| 284 | html += '</tr><tr height="' + tdHeight + '">'; | ||
| 285 | } | ||
| 286 | } | ||
| 287 | |||
| 288 | if (cols % charsPerRow > 0) { | ||
| 289 | var padd = charsPerRow - (cols % charsPerRow); | ||
| 290 | for (var i=0; i<padd-1; i++) | ||
| 291 | html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"> </td>'; | ||
| 292 | } | ||
| 293 | |||
| 294 | html += '</tr></table>'; | ||
| 295 | |||
| 296 | return html; | ||
| 297 | } | ||
| 298 | |||
| 299 | function insertChar(chr) { | ||
| 300 | tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); | ||
| 301 | |||
| 302 | // Refocus in window | ||
| 303 | if (tinyMCEPopup.isWindow) | ||
| 304 | window.focus(); | ||
| 305 | |||
| 306 | tinyMCEPopup.editor.focus(); | ||
| 307 | tinyMCEPopup.close(); | ||
| 308 | } | ||
| 309 | |||
| 310 | function previewChar(codeA, codeB, codeN) { | ||
| 311 | var elmA = document.getElementById('codeA'); | ||
| 312 | var elmB = document.getElementById('codeB'); | ||
| 313 | var elmV = document.getElementById('codeV'); | ||
| 314 | var elmN = document.getElementById('codeN'); | ||
| 315 | |||
| 316 | if (codeA=='#160;') { | ||
| 317 | elmV.innerHTML = '__'; | ||
| 318 | } else { | ||
| 319 | elmV.innerHTML = '&' + codeA; | ||
| 320 | } | ||
| 321 | |||
| 322 | elmB.innerHTML = '&' + codeA; | ||
| 323 | elmA.innerHTML = '&' + codeB; | ||
| 324 | elmN.innerHTML = codeN; | ||
| 325 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js b/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js deleted file mode 100644 index fd9700f..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js +++ /dev/null | |||
| @@ -1,253 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var detail = 50, strhex = "0123456789abcdef", i, isMouseDown = false, isMouseOver = false; | ||
| 4 | |||
| 5 | var colors = [ | ||
| 6 | "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", | ||
| 7 | "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", | ||
| 8 | "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", | ||
| 9 | "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", | ||
| 10 | "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", | ||
| 11 | "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", | ||
| 12 | "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", | ||
| 13 | "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", | ||
| 14 | "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", | ||
| 15 | "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", | ||
| 16 | "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", | ||
| 17 | "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", | ||
| 18 | "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", | ||
| 19 | "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", | ||
| 20 | "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", | ||
| 21 | "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", | ||
| 22 | "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", | ||
| 23 | "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", | ||
| 24 | "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", | ||
| 25 | "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", | ||
| 26 | "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", | ||
| 27 | "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", | ||
| 28 | "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", | ||
| 29 | "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", | ||
| 30 | "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", | ||
| 31 | "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", | ||
| 32 | "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" | ||
| 33 | ]; | ||
| 34 | |||
| 35 | var named = { | ||
| 36 | '#F0F8FF':'AliceBlue','#FAEBD7':'AntiqueWhite','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', | ||
| 37 | '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'BlanchedAlmond','#0000FF':'Blue','#8A2BE2':'BlueViolet','#A52A2A':'Brown', | ||
| 38 | '#DEB887':'BurlyWood','#5F9EA0':'CadetBlue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'CornflowerBlue', | ||
| 39 | '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'DarkBlue','#008B8B':'DarkCyan','#B8860B':'DarkGoldenRod', | ||
| 40 | '#A9A9A9':'DarkGray','#A9A9A9':'DarkGrey','#006400':'DarkGreen','#BDB76B':'DarkKhaki','#8B008B':'DarkMagenta','#556B2F':'DarkOliveGreen', | ||
| 41 | '#FF8C00':'Darkorange','#9932CC':'DarkOrchid','#8B0000':'DarkRed','#E9967A':'DarkSalmon','#8FBC8F':'DarkSeaGreen','#483D8B':'DarkSlateBlue', | ||
| 42 | '#2F4F4F':'DarkSlateGray','#2F4F4F':'DarkSlateGrey','#00CED1':'DarkTurquoise','#9400D3':'DarkViolet','#FF1493':'DeepPink','#00BFFF':'DeepSkyBlue', | ||
| 43 | '#696969':'DimGray','#696969':'DimGrey','#1E90FF':'DodgerBlue','#B22222':'FireBrick','#FFFAF0':'FloralWhite','#228B22':'ForestGreen', | ||
| 44 | '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'GhostWhite','#FFD700':'Gold','#DAA520':'GoldenRod','#808080':'Gray','#808080':'Grey', | ||
| 45 | '#008000':'Green','#ADFF2F':'GreenYellow','#F0FFF0':'HoneyDew','#FF69B4':'HotPink','#CD5C5C':'IndianRed','#4B0082':'Indigo','#FFFFF0':'Ivory', | ||
| 46 | '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'LavenderBlush','#7CFC00':'LawnGreen','#FFFACD':'LemonChiffon','#ADD8E6':'LightBlue', | ||
| 47 | '#F08080':'LightCoral','#E0FFFF':'LightCyan','#FAFAD2':'LightGoldenRodYellow','#D3D3D3':'LightGray','#D3D3D3':'LightGrey','#90EE90':'LightGreen', | ||
| 48 | '#FFB6C1':'LightPink','#FFA07A':'LightSalmon','#20B2AA':'LightSeaGreen','#87CEFA':'LightSkyBlue','#778899':'LightSlateGray','#778899':'LightSlateGrey', | ||
| 49 | '#B0C4DE':'LightSteelBlue','#FFFFE0':'LightYellow','#00FF00':'Lime','#32CD32':'LimeGreen','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', | ||
| 50 | '#66CDAA':'MediumAquaMarine','#0000CD':'MediumBlue','#BA55D3':'MediumOrchid','#9370D8':'MediumPurple','#3CB371':'MediumSeaGreen','#7B68EE':'MediumSlateBlue', | ||
| 51 | '#00FA9A':'MediumSpringGreen','#48D1CC':'MediumTurquoise','#C71585':'MediumVioletRed','#191970':'MidnightBlue','#F5FFFA':'MintCream','#FFE4E1':'MistyRose','#FFE4B5':'Moccasin', | ||
| 52 | '#FFDEAD':'NavajoWhite','#000080':'Navy','#FDF5E6':'OldLace','#808000':'Olive','#6B8E23':'OliveDrab','#FFA500':'Orange','#FF4500':'OrangeRed','#DA70D6':'Orchid', | ||
| 53 | '#EEE8AA':'PaleGoldenRod','#98FB98':'PaleGreen','#AFEEEE':'PaleTurquoise','#D87093':'PaleVioletRed','#FFEFD5':'PapayaWhip','#FFDAB9':'PeachPuff', | ||
| 54 | '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'PowderBlue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'RosyBrown','#4169E1':'RoyalBlue', | ||
| 55 | '#8B4513':'SaddleBrown','#FA8072':'Salmon','#F4A460':'SandyBrown','#2E8B57':'SeaGreen','#FFF5EE':'SeaShell','#A0522D':'Sienna','#C0C0C0':'Silver', | ||
| 56 | '#87CEEB':'SkyBlue','#6A5ACD':'SlateBlue','#708090':'SlateGray','#708090':'SlateGrey','#FFFAFA':'Snow','#00FF7F':'SpringGreen', | ||
| 57 | '#4682B4':'SteelBlue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', | ||
| 58 | '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'WhiteSmoke','#FFFF00':'Yellow','#9ACD32':'YellowGreen' | ||
| 59 | }; | ||
| 60 | |||
| 61 | function init() { | ||
| 62 | var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')); | ||
| 63 | |||
| 64 | tinyMCEPopup.resizeToInnerSize(); | ||
| 65 | |||
| 66 | generatePicker(); | ||
| 67 | |||
| 68 | if (inputColor) { | ||
| 69 | changeFinalColor(inputColor); | ||
| 70 | |||
| 71 | col = convertHexToRGB(inputColor); | ||
| 72 | |||
| 73 | if (col) | ||
| 74 | updateLight(col.r, col.g, col.b); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | |||
| 78 | function insertAction() { | ||
| 79 | var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); | ||
| 80 | |||
| 81 | tinyMCEPopup.restoreSelection(); | ||
| 82 | |||
| 83 | if (f) | ||
| 84 | f(color); | ||
| 85 | |||
| 86 | tinyMCEPopup.close(); | ||
| 87 | } | ||
| 88 | |||
| 89 | function showColor(color, name) { | ||
| 90 | if (name) | ||
| 91 | document.getElementById("colorname").innerHTML = name; | ||
| 92 | |||
| 93 | document.getElementById("preview").style.backgroundColor = color; | ||
| 94 | document.getElementById("color").value = color.toLowerCase(); | ||
| 95 | } | ||
| 96 | |||
| 97 | function convertRGBToHex(col) { | ||
| 98 | var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); | ||
| 99 | |||
| 100 | if (!col) | ||
| 101 | return col; | ||
| 102 | |||
| 103 | var rgb = col.replace(re, "$1,$2,$3").split(','); | ||
| 104 | if (rgb.length == 3) { | ||
| 105 | r = parseInt(rgb[0]).toString(16); | ||
| 106 | g = parseInt(rgb[1]).toString(16); | ||
| 107 | b = parseInt(rgb[2]).toString(16); | ||
| 108 | |||
| 109 | r = r.length == 1 ? '0' + r : r; | ||
| 110 | g = g.length == 1 ? '0' + g : g; | ||
| 111 | b = b.length == 1 ? '0' + b : b; | ||
| 112 | |||
| 113 | return "#" + r + g + b; | ||
| 114 | } | ||
| 115 | |||
| 116 | return col; | ||
| 117 | } | ||
| 118 | |||
| 119 | function convertHexToRGB(col) { | ||
| 120 | if (col.indexOf('#') != -1) { | ||
| 121 | col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); | ||
| 122 | |||
| 123 | r = parseInt(col.substring(0, 2), 16); | ||
| 124 | g = parseInt(col.substring(2, 4), 16); | ||
| 125 | b = parseInt(col.substring(4, 6), 16); | ||
| 126 | |||
| 127 | return {r : r, g : g, b : b}; | ||
| 128 | } | ||
| 129 | |||
| 130 | return null; | ||
| 131 | } | ||
| 132 | |||
| 133 | function generatePicker() { | ||
| 134 | var el = document.getElementById('light'), h = '', i; | ||
| 135 | |||
| 136 | for (i = 0; i < detail; i++){ | ||
| 137 | h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"' | ||
| 138 | + ' onclick="changeFinalColor(this.style.backgroundColor)"' | ||
| 139 | + ' onmousedown="isMouseDown = true; return false;"' | ||
| 140 | + ' onmouseup="isMouseDown = false;"' | ||
| 141 | + ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"' | ||
| 142 | + ' onmouseover="isMouseOver = true;"' | ||
| 143 | + ' onmouseout="isMouseOver = false;"' | ||
| 144 | + '></div>'; | ||
| 145 | } | ||
| 146 | |||
| 147 | el.innerHTML = h; | ||
| 148 | } | ||
| 149 | |||
| 150 | function generateWebColors() { | ||
| 151 | var el = document.getElementById('webcolors'), h = '', i; | ||
| 152 | |||
| 153 | if (el.className == 'generated') | ||
| 154 | return; | ||
| 155 | |||
| 156 | h += '<table border="0" cellspacing="1" cellpadding="0">' | ||
| 157 | + '<tr>'; | ||
| 158 | |||
| 159 | for (i=0; i<colors.length; i++) { | ||
| 160 | h += '<td bgcolor="' + colors[i] + '" width="10" height="10">' | ||
| 161 | + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">' | ||
| 162 | + '</a></td>'; | ||
| 163 | if ((i+1) % 18 == 0) | ||
| 164 | h += '</tr><tr>'; | ||
| 165 | } | ||
| 166 | |||
| 167 | h += '</table>'; | ||
| 168 | |||
| 169 | el.innerHTML = h; | ||
| 170 | el.className = 'generated'; | ||
| 171 | } | ||
| 172 | |||
| 173 | function generateNamedColors() { | ||
| 174 | var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; | ||
| 175 | |||
| 176 | if (el.className == 'generated') | ||
| 177 | return; | ||
| 178 | |||
| 179 | for (n in named) { | ||
| 180 | v = named[n]; | ||
| 181 | h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>' | ||
| 182 | } | ||
| 183 | |||
| 184 | el.innerHTML = h; | ||
| 185 | el.className = 'generated'; | ||
| 186 | } | ||
| 187 | |||
| 188 | function dechex(n) { | ||
| 189 | return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); | ||
| 190 | } | ||
| 191 | |||
| 192 | function computeColor(e) { | ||
| 193 | var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; | ||
| 194 | |||
| 195 | x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); | ||
| 196 | y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); | ||
| 197 | |||
| 198 | partWidth = document.getElementById('colors').width / 6; | ||
| 199 | partDetail = detail / 2; | ||
| 200 | imHeight = document.getElementById('colors').height; | ||
| 201 | |||
| 202 | r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; | ||
| 203 | g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); | ||
| 204 | b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); | ||
| 205 | |||
| 206 | coef = (imHeight - y) / imHeight; | ||
| 207 | r = 128 + (r - 128) * coef; | ||
| 208 | g = 128 + (g - 128) * coef; | ||
| 209 | b = 128 + (b - 128) * coef; | ||
| 210 | |||
| 211 | changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); | ||
| 212 | updateLight(r, g, b); | ||
| 213 | } | ||
| 214 | |||
| 215 | function updateLight(r, g, b) { | ||
| 216 | var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; | ||
| 217 | |||
| 218 | for (i=0; i<detail; i++) { | ||
| 219 | if ((i>=0) && (i<partDetail)) { | ||
| 220 | finalCoef = i / partDetail; | ||
| 221 | finalR = dechex(255 - (255 - r) * finalCoef); | ||
| 222 | finalG = dechex(255 - (255 - g) * finalCoef); | ||
| 223 | finalB = dechex(255 - (255 - b) * finalCoef); | ||
| 224 | } else { | ||
| 225 | finalCoef = 2 - i / partDetail; | ||
| 226 | finalR = dechex(r * finalCoef); | ||
| 227 | finalG = dechex(g * finalCoef); | ||
| 228 | finalB = dechex(b * finalCoef); | ||
| 229 | } | ||
| 230 | |||
| 231 | color = finalR + finalG + finalB; | ||
| 232 | |||
| 233 | setCol('gs' + i, '#'+color); | ||
| 234 | } | ||
| 235 | } | ||
| 236 | |||
| 237 | function changeFinalColor(color) { | ||
| 238 | if (color.indexOf('#') == -1) | ||
| 239 | color = convertRGBToHex(color); | ||
| 240 | |||
| 241 | setCol('preview', color); | ||
| 242 | document.getElementById('color').value = color; | ||
| 243 | } | ||
| 244 | |||
| 245 | function setCol(e, c) { | ||
| 246 | try { | ||
| 247 | document.getElementById(e).style.backgroundColor = c; | ||
| 248 | } catch (ex) { | ||
| 249 | // Ignore IE warning | ||
| 250 | } | ||
| 251 | } | ||
| 252 | |||
| 253 | tinyMCEPopup.onInit.add(init); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/image.js b/public/javascripts/tiny_mce/themes/advanced/js/image.js deleted file mode 100644 index 4982ce0..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/image.js +++ /dev/null | |||
| @@ -1,245 +0,0 @@ | |||
| 1 | var ImageDialog = { | ||
| 2 | preInit : function() { | ||
| 3 | var url; | ||
| 4 | |||
| 5 | tinyMCEPopup.requireLangPack(); | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_image_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | // Setup browse button | ||
| 15 | document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); | ||
| 16 | if (isVisible('srcbrowser')) | ||
| 17 | document.getElementById('src').style.width = '180px'; | ||
| 18 | |||
| 19 | e = ed.selection.getNode(); | ||
| 20 | |||
| 21 | this.fillFileList('image_list', 'tinyMCEImageList'); | ||
| 22 | |||
| 23 | if (e.nodeName == 'IMG') { | ||
| 24 | f.src.value = ed.dom.getAttrib(e, 'src'); | ||
| 25 | f.alt.value = ed.dom.getAttrib(e, 'alt'); | ||
| 26 | f.border.value = this.getAttrib(e, 'border'); | ||
| 27 | f.vspace.value = this.getAttrib(e, 'vspace'); | ||
| 28 | f.hspace.value = this.getAttrib(e, 'hspace'); | ||
| 29 | f.width.value = ed.dom.getAttrib(e, 'width'); | ||
| 30 | f.height.value = ed.dom.getAttrib(e, 'height'); | ||
| 31 | f.insert.value = ed.getLang('update'); | ||
| 32 | this.styleVal = ed.dom.getAttrib(e, 'style'); | ||
| 33 | selectByValue(f, 'image_list', f.src.value); | ||
| 34 | selectByValue(f, 'align', this.getAttrib(e, 'align')); | ||
| 35 | this.updateStyle(); | ||
| 36 | } | ||
| 37 | }, | ||
| 38 | |||
| 39 | fillFileList : function(id, l) { | ||
| 40 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 41 | |||
| 42 | l = window[l]; | ||
| 43 | |||
| 44 | if (l && l.length > 0) { | ||
| 45 | lst.options[lst.options.length] = new Option('', ''); | ||
| 46 | |||
| 47 | tinymce.each(l, function(o) { | ||
| 48 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 49 | }); | ||
| 50 | } else | ||
| 51 | dom.remove(dom.getParent(id, 'tr')); | ||
| 52 | }, | ||
| 53 | |||
| 54 | update : function() { | ||
| 55 | var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; | ||
| 56 | |||
| 57 | tinyMCEPopup.restoreSelection(); | ||
| 58 | |||
| 59 | if (f.src.value === '') { | ||
| 60 | if (ed.selection.getNode().nodeName == 'IMG') { | ||
| 61 | ed.dom.remove(ed.selection.getNode()); | ||
| 62 | ed.execCommand('mceRepaint'); | ||
| 63 | } | ||
| 64 | |||
| 65 | tinyMCEPopup.close(); | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | |||
| 69 | if (!ed.settings.inline_styles) { | ||
| 70 | args = tinymce.extend(args, { | ||
| 71 | vspace : nl.vspace.value, | ||
| 72 | hspace : nl.hspace.value, | ||
| 73 | border : nl.border.value, | ||
| 74 | align : getSelectValue(f, 'align') | ||
| 75 | }); | ||
| 76 | } else | ||
| 77 | args.style = this.styleVal; | ||
| 78 | |||
| 79 | tinymce.extend(args, { | ||
| 80 | src : f.src.value, | ||
| 81 | alt : f.alt.value, | ||
| 82 | width : f.width.value, | ||
| 83 | height : f.height.value | ||
| 84 | }); | ||
| 85 | |||
| 86 | el = ed.selection.getNode(); | ||
| 87 | |||
| 88 | if (el && el.nodeName == 'IMG') { | ||
| 89 | ed.dom.setAttribs(el, args); | ||
| 90 | } else { | ||
| 91 | ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1}); | ||
| 92 | ed.dom.setAttribs('__mce_tmp', args); | ||
| 93 | ed.dom.setAttrib('__mce_tmp', 'id', ''); | ||
| 94 | ed.undoManager.add(); | ||
| 95 | } | ||
| 96 | |||
| 97 | tinyMCEPopup.close(); | ||
| 98 | }, | ||
| 99 | |||
| 100 | updateStyle : function() { | ||
| 101 | var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; | ||
| 102 | |||
| 103 | if (tinyMCEPopup.editor.settings.inline_styles) { | ||
| 104 | st = tinyMCEPopup.dom.parseStyle(this.styleVal); | ||
| 105 | |||
| 106 | // Handle align | ||
| 107 | v = getSelectValue(f, 'align'); | ||
| 108 | if (v) { | ||
| 109 | if (v == 'left' || v == 'right') { | ||
| 110 | st['float'] = v; | ||
| 111 | delete st['vertical-align']; | ||
| 112 | } else { | ||
| 113 | st['vertical-align'] = v; | ||
| 114 | delete st['float']; | ||
| 115 | } | ||
| 116 | } else { | ||
| 117 | delete st['float']; | ||
| 118 | delete st['vertical-align']; | ||
| 119 | } | ||
| 120 | |||
| 121 | // Handle border | ||
| 122 | v = f.border.value; | ||
| 123 | if (v || v == '0') { | ||
| 124 | if (v == '0') | ||
| 125 | st['border'] = '0'; | ||
| 126 | else | ||
| 127 | st['border'] = v + 'px solid black'; | ||
| 128 | } else | ||
| 129 | delete st['border']; | ||
| 130 | |||
| 131 | // Handle hspace | ||
| 132 | v = f.hspace.value; | ||
| 133 | if (v) { | ||
| 134 | delete st['margin']; | ||
| 135 | st['margin-left'] = v + 'px'; | ||
| 136 | st['margin-right'] = v + 'px'; | ||
| 137 | } else { | ||
| 138 | delete st['margin-left']; | ||
| 139 | delete st['margin-right']; | ||
| 140 | } | ||
| 141 | |||
| 142 | // Handle vspace | ||
| 143 | v = f.vspace.value; | ||
| 144 | if (v) { | ||
| 145 | delete st['margin']; | ||
| 146 | st['margin-top'] = v + 'px'; | ||
| 147 | st['margin-bottom'] = v + 'px'; | ||
| 148 | } else { | ||
| 149 | delete st['margin-top']; | ||
| 150 | delete st['margin-bottom']; | ||
| 151 | } | ||
| 152 | |||
| 153 | // Merge | ||
| 154 | st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st)); | ||
| 155 | this.styleVal = dom.serializeStyle(st); | ||
| 156 | } | ||
| 157 | }, | ||
| 158 | |||
| 159 | getAttrib : function(e, at) { | ||
| 160 | var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; | ||
| 161 | |||
| 162 | if (ed.settings.inline_styles) { | ||
| 163 | switch (at) { | ||
| 164 | case 'align': | ||
| 165 | if (v = dom.getStyle(e, 'float')) | ||
| 166 | return v; | ||
| 167 | |||
| 168 | if (v = dom.getStyle(e, 'vertical-align')) | ||
| 169 | return v; | ||
| 170 | |||
| 171 | break; | ||
| 172 | |||
| 173 | case 'hspace': | ||
| 174 | v = dom.getStyle(e, 'margin-left') | ||
| 175 | v2 = dom.getStyle(e, 'margin-right'); | ||
| 176 | if (v && v == v2) | ||
| 177 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 178 | |||
| 179 | break; | ||
| 180 | |||
| 181 | case 'vspace': | ||
| 182 | v = dom.getStyle(e, 'margin-top') | ||
| 183 | v2 = dom.getStyle(e, 'margin-bottom'); | ||
| 184 | if (v && v == v2) | ||
| 185 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 186 | |||
| 187 | break; | ||
| 188 | |||
| 189 | case 'border': | ||
| 190 | v = 0; | ||
| 191 | |||
| 192 | tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { | ||
| 193 | sv = dom.getStyle(e, 'border-' + sv + '-width'); | ||
| 194 | |||
| 195 | // False or not the same as prev | ||
| 196 | if (!sv || (sv != v && v !== 0)) { | ||
| 197 | v = 0; | ||
| 198 | return false; | ||
| 199 | } | ||
| 200 | |||
| 201 | if (sv) | ||
| 202 | v = sv; | ||
| 203 | }); | ||
| 204 | |||
| 205 | if (v) | ||
| 206 | return parseInt(v.replace(/[^0-9]/g, '')); | ||
| 207 | |||
| 208 | break; | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | if (v = dom.getAttrib(e, at)) | ||
| 213 | return v; | ||
| 214 | |||
| 215 | return ''; | ||
| 216 | }, | ||
| 217 | |||
| 218 | resetImageData : function() { | ||
| 219 | var f = document.forms[0]; | ||
| 220 | |||
| 221 | f.width.value = f.height.value = ""; | ||
| 222 | }, | ||
| 223 | |||
| 224 | updateImageData : function() { | ||
| 225 | var f = document.forms[0], t = ImageDialog; | ||
| 226 | |||
| 227 | if (f.width.value == "") | ||
| 228 | f.width.value = t.preloadImg.width; | ||
| 229 | |||
| 230 | if (f.height.value == "") | ||
| 231 | f.height.value = t.preloadImg.height; | ||
| 232 | }, | ||
| 233 | |||
| 234 | getImageData : function() { | ||
| 235 | var f = document.forms[0]; | ||
| 236 | |||
| 237 | this.preloadImg = new Image(); | ||
| 238 | this.preloadImg.onload = this.updateImageData; | ||
| 239 | this.preloadImg.onerror = this.resetImageData; | ||
| 240 | this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); | ||
| 241 | } | ||
| 242 | }; | ||
| 243 | |||
| 244 | ImageDialog.preInit(); | ||
| 245 | tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/link.js b/public/javascripts/tiny_mce/themes/advanced/js/link.js deleted file mode 100644 index f67a5bc..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/link.js +++ /dev/null | |||
| @@ -1,156 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var LinkDialog = { | ||
| 4 | preInit : function() { | ||
| 5 | var url; | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_link_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | // Setup browse button | ||
| 15 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); | ||
| 16 | if (isVisible('hrefbrowser')) | ||
| 17 | document.getElementById('href').style.width = '180px'; | ||
| 18 | |||
| 19 | this.fillClassList('class_list'); | ||
| 20 | this.fillFileList('link_list', 'tinyMCELinkList'); | ||
| 21 | this.fillTargetList('target_list'); | ||
| 22 | |||
| 23 | if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { | ||
| 24 | f.href.value = ed.dom.getAttrib(e, 'href'); | ||
| 25 | f.linktitle.value = ed.dom.getAttrib(e, 'title'); | ||
| 26 | f.insert.value = ed.getLang('update'); | ||
| 27 | selectByValue(f, 'link_list', f.href.value); | ||
| 28 | selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); | ||
| 29 | selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); | ||
| 30 | } | ||
| 31 | }, | ||
| 32 | |||
| 33 | update : function() { | ||
| 34 | var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; | ||
| 35 | |||
| 36 | tinyMCEPopup.restoreSelection(); | ||
| 37 | e = ed.dom.getParent(ed.selection.getNode(), 'A'); | ||
| 38 | |||
| 39 | // Remove element if there is no href | ||
| 40 | if (!f.href.value) { | ||
| 41 | if (e) { | ||
| 42 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 43 | b = ed.selection.getBookmark(); | ||
| 44 | ed.dom.remove(e, 1); | ||
| 45 | ed.selection.moveToBookmark(b); | ||
| 46 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 47 | tinyMCEPopup.close(); | ||
| 48 | return; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 53 | |||
| 54 | // Create new anchor elements | ||
| 55 | if (e == null) { | ||
| 56 | ed.getDoc().execCommand("unlink", false, null); | ||
| 57 | tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); | ||
| 58 | |||
| 59 | tinymce.each(ed.dom.select("a"), function(n) { | ||
| 60 | if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { | ||
| 61 | e = n; | ||
| 62 | |||
| 63 | ed.dom.setAttribs(e, { | ||
| 64 | href : f.href.value, | ||
| 65 | title : f.linktitle.value, | ||
| 66 | target : f.target_list ? getSelectValue(f, "target_list") : null, | ||
| 67 | 'class' : f.class_list ? getSelectValue(f, "class_list") : null | ||
| 68 | }); | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | } else { | ||
| 72 | ed.dom.setAttribs(e, { | ||
| 73 | href : f.href.value, | ||
| 74 | title : f.linktitle.value, | ||
| 75 | target : f.target_list ? getSelectValue(f, "target_list") : null, | ||
| 76 | 'class' : f.class_list ? getSelectValue(f, "class_list") : null | ||
| 77 | }); | ||
| 78 | } | ||
| 79 | |||
| 80 | // Don't move caret if selection was image | ||
| 81 | if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { | ||
| 82 | ed.focus(); | ||
| 83 | ed.selection.select(e); | ||
| 84 | ed.selection.collapse(0); | ||
| 85 | tinyMCEPopup.storeSelection(); | ||
| 86 | } | ||
| 87 | |||
| 88 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 89 | tinyMCEPopup.close(); | ||
| 90 | }, | ||
| 91 | |||
| 92 | checkPrefix : function(n) { | ||
| 93 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) | ||
| 94 | n.value = 'mailto:' + n.value; | ||
| 95 | |||
| 96 | if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) | ||
| 97 | n.value = 'http://' + n.value; | ||
| 98 | }, | ||
| 99 | |||
| 100 | fillFileList : function(id, l) { | ||
| 101 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 102 | |||
| 103 | l = window[l]; | ||
| 104 | |||
| 105 | if (l && l.length > 0) { | ||
| 106 | lst.options[lst.options.length] = new Option('', ''); | ||
| 107 | |||
| 108 | tinymce.each(l, function(o) { | ||
| 109 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 110 | }); | ||
| 111 | } else | ||
| 112 | dom.remove(dom.getParent(id, 'tr')); | ||
| 113 | }, | ||
| 114 | |||
| 115 | fillClassList : function(id) { | ||
| 116 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 117 | |||
| 118 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { | ||
| 119 | cl = []; | ||
| 120 | |||
| 121 | tinymce.each(v.split(';'), function(v) { | ||
| 122 | var p = v.split('='); | ||
| 123 | |||
| 124 | cl.push({'title' : p[0], 'class' : p[1]}); | ||
| 125 | }); | ||
| 126 | } else | ||
| 127 | cl = tinyMCEPopup.editor.dom.getClasses(); | ||
| 128 | |||
| 129 | if (cl.length > 0) { | ||
| 130 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 131 | |||
| 132 | tinymce.each(cl, function(o) { | ||
| 133 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); | ||
| 134 | }); | ||
| 135 | } else | ||
| 136 | dom.remove(dom.getParent(id, 'tr')); | ||
| 137 | }, | ||
| 138 | |||
| 139 | fillTargetList : function(id) { | ||
| 140 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v; | ||
| 141 | |||
| 142 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 143 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); | ||
| 144 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); | ||
| 145 | |||
| 146 | if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { | ||
| 147 | tinymce.each(v.split(','), function(v) { | ||
| 148 | v = v.split('='); | ||
| 149 | lst.options[lst.options.length] = new Option(v[0], v[1]); | ||
| 150 | }); | ||
| 151 | } | ||
| 152 | } | ||
| 153 | }; | ||
| 154 | |||
| 155 | LinkDialog.preInit(); | ||
| 156 | tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js b/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js deleted file mode 100644 index 2793286..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | tinyMCEPopup.onInit.add(onLoadInit); | ||
| 3 | |||
| 4 | function saveContent() { | ||
| 5 | tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); | ||
| 6 | tinyMCEPopup.close(); | ||
| 7 | } | ||
| 8 | |||
| 9 | function onLoadInit() { | ||
| 10 | tinyMCEPopup.resizeToInnerSize(); | ||
| 11 | |||
| 12 | // Remove Gecko spellchecking | ||
| 13 | if (tinymce.isGecko) | ||
| 14 | document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); | ||
| 15 | |||
| 16 | document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); | ||
| 17 | |||
| 18 | if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { | ||
| 19 | setWrap('soft'); | ||
| 20 | document.getElementById('wraped').checked = true; | ||
| 21 | } | ||
| 22 | |||
| 23 | resizeInputs(); | ||
| 24 | } | ||
| 25 | |||
| 26 | function setWrap(val) { | ||
| 27 | var v, n, s = document.getElementById('htmlSource'); | ||
| 28 | |||
| 29 | s.wrap = val; | ||
| 30 | |||
| 31 | if (!tinymce.isIE) { | ||
| 32 | v = s.value; | ||
| 33 | n = s.cloneNode(false); | ||
| 34 | n.setAttribute("wrap", val); | ||
| 35 | s.parentNode.replaceChild(n, s); | ||
| 36 | n.value = v; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | function toggleWordWrap(elm) { | ||
| 41 | if (elm.checked) | ||
| 42 | setWrap('soft'); | ||
| 43 | else | ||
| 44 | setWrap('off'); | ||
| 45 | } | ||
| 46 | |||
| 47 | var wHeight=0, wWidth=0, owHeight=0, owWidth=0; | ||
| 48 | |||
| 49 | function resizeInputs() { | ||
| 50 | var el = document.getElementById('htmlSource'); | ||
| 51 | |||
| 52 | if (!tinymce.isIE) { | ||
| 53 | wHeight = self.innerHeight - 65; | ||
| 54 | wWidth = self.innerWidth - 16; | ||
| 55 | } else { | ||
| 56 | wHeight = document.body.clientHeight - 70; | ||
| 57 | wWidth = document.body.clientWidth - 16; | ||
| 58 | } | ||
| 59 | |||
| 60 | el.style.height = Math.abs(wHeight) + 'px'; | ||
| 61 | el.style.width = Math.abs(wWidth) + 'px'; | ||
| 62 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/langs/en.js b/public/javascripts/tiny_mce/themes/advanced/langs/en.js deleted file mode 100644 index 69694b1..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/langs/en.js +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.advanced',{ | ||
| 2 | style_select:"Styles", | ||
| 3 | font_size:"Font size", | ||
| 4 | fontdefault:"Font family", | ||
| 5 | block:"Format", | ||
| 6 | paragraph:"Paragraph", | ||
| 7 | div:"Div", | ||
| 8 | address:"Address", | ||
| 9 | pre:"Preformatted", | ||
| 10 | h1:"Heading 1", | ||
| 11 | h2:"Heading 2", | ||
| 12 | h3:"Heading 3", | ||
| 13 | h4:"Heading 4", | ||
| 14 | h5:"Heading 5", | ||
| 15 | h6:"Heading 6", | ||
| 16 | blockquote:"Blockquote", | ||
| 17 | code:"Code", | ||
| 18 | samp:"Code sample", | ||
| 19 | dt:"Definition term ", | ||
| 20 | dd:"Definition description", | ||
| 21 | bold_desc:"Bold (Ctrl+B)", | ||
| 22 | italic_desc:"Italic (Ctrl+I)", | ||
| 23 | underline_desc:"Underline (Ctrl+U)", | ||
| 24 | striketrough_desc:"Strikethrough", | ||
| 25 | justifyleft_desc:"Align left", | ||
| 26 | justifycenter_desc:"Align center", | ||
| 27 | justifyright_desc:"Align right", | ||
| 28 | justifyfull_desc:"Align full", | ||
| 29 | bullist_desc:"Unordered list", | ||
| 30 | numlist_desc:"Ordered list", | ||
| 31 | outdent_desc:"Outdent", | ||
| 32 | indent_desc:"Indent", | ||
| 33 | undo_desc:"Undo (Ctrl+Z)", | ||
| 34 | redo_desc:"Redo (Ctrl+Y)", | ||
| 35 | link_desc:"Insert/edit link", | ||
| 36 | unlink_desc:"Unlink", | ||
| 37 | image_desc:"Insert/edit image", | ||
| 38 | cleanup_desc:"Cleanup messy code", | ||
| 39 | code_desc:"Edit HTML Source", | ||
| 40 | sub_desc:"Subscript", | ||
| 41 | sup_desc:"Superscript", | ||
| 42 | hr_desc:"Insert horizontal ruler", | ||
| 43 | removeformat_desc:"Remove formatting", | ||
| 44 | custom1_desc:"Your custom description here", | ||
| 45 | forecolor_desc:"Select text color", | ||
| 46 | backcolor_desc:"Select background color", | ||
| 47 | charmap_desc:"Insert custom character", | ||
| 48 | visualaid_desc:"Toggle guidelines/invisible elements", | ||
| 49 | anchor_desc:"Insert/edit anchor", | ||
| 50 | cut_desc:"Cut", | ||
| 51 | copy_desc:"Copy", | ||
| 52 | paste_desc:"Paste", | ||
| 53 | image_props_desc:"Image properties", | ||
| 54 | newdocument_desc:"New document", | ||
| 55 | help_desc:"Help", | ||
| 56 | blockquote_desc:"Blockquote", | ||
| 57 | clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", | ||
| 58 | path:"Path", | ||
| 59 | newdocument:"Are you sure you want clear all contents?", | ||
| 60 | toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", | ||
| 61 | more_colors:"More colors" | ||
| 62 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js b/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js deleted file mode 100644 index 9d124d7..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.advanced_dlg',{ | ||
| 2 | about_title:"About TinyMCE", | ||
| 3 | about_general:"About", | ||
| 4 | about_help:"Help", | ||
| 5 | about_license:"License", | ||
| 6 | about_plugins:"Plugins", | ||
| 7 | about_plugin:"Plugin", | ||
| 8 | about_author:"Author", | ||
| 9 | about_version:"Version", | ||
| 10 | about_loaded:"Loaded plugins", | ||
| 11 | anchor_title:"Insert/edit anchor", | ||
| 12 | anchor_name:"Anchor name", | ||
| 13 | code_title:"HTML Source Editor", | ||
| 14 | code_wordwrap:"Word wrap", | ||
| 15 | colorpicker_title:"Select a color", | ||
| 16 | colorpicker_picker_tab:"Picker", | ||
| 17 | colorpicker_picker_title:"Color picker", | ||
| 18 | colorpicker_palette_tab:"Palette", | ||
| 19 | colorpicker_palette_title:"Palette colors", | ||
| 20 | colorpicker_named_tab:"Named", | ||
| 21 | colorpicker_named_title:"Named colors", | ||
| 22 | colorpicker_color:"Color:", | ||
| 23 | colorpicker_name:"Name:", | ||
| 24 | charmap_title:"Select custom character", | ||
| 25 | image_title:"Insert/edit image", | ||
| 26 | image_src:"Image URL", | ||
| 27 | image_alt:"Image description", | ||
| 28 | image_list:"Image list", | ||
| 29 | image_border:"Border", | ||
| 30 | image_dimensions:"Dimensions", | ||
| 31 | image_vspace:"Vertical space", | ||
| 32 | image_hspace:"Horizontal space", | ||
| 33 | image_align:"Alignment", | ||
| 34 | image_align_baseline:"Baseline", | ||
| 35 | image_align_top:"Top", | ||
| 36 | image_align_middle:"Middle", | ||
| 37 | image_align_bottom:"Bottom", | ||
| 38 | image_align_texttop:"Text top", | ||
| 39 | image_align_textbottom:"Text bottom", | ||
| 40 | image_align_left:"Left", | ||
| 41 | image_align_right:"Right", | ||
| 42 | link_title:"Insert/edit link", | ||
| 43 | link_url:"Link URL", | ||
| 44 | link_target:"Target", | ||
| 45 | link_target_same:"Open link in the same window", | ||
| 46 | link_target_blank:"Open link in a new window", | ||
| 47 | link_titlefield:"Title", | ||
| 48 | link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", | ||
| 49 | link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", | ||
| 50 | link_list:"Link list" | ||
| 51 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/link.htm b/public/javascripts/tiny_mce/themes/advanced/link.htm deleted file mode 100644 index a78bd33..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/link.htm +++ /dev/null | |||
| @@ -1,63 +0,0 @@ | |||
| 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"> | ||
| 3 | <head> | ||
| 4 | <title>{#advanced_dlg.link_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="../../utils/mctabs.js"></script> | ||
| 7 | <script type="text/javascript" src="../../utils/form_utils.js"></script> | ||
| 8 | <script type="text/javascript" src="../../utils/validate.js"></script> | ||
| 9 | <script type="text/javascript" src="js/link.js"></script> | ||
| 10 | </head> | ||
| 11 | <body id="link" style="display: none"> | ||
| 12 | <form onsubmit="LinkDialog.update();return false;" action="#"> | ||
| 13 | <div class="tabs"> | ||
| 14 | <ul> | ||
| 15 | <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li> | ||
| 16 | </ul> | ||
| 17 | </div> | ||
| 18 | |||
| 19 | <div class="panel_wrapper"> | ||
| 20 | <div id="general_panel" class="panel current"> | ||
| 21 | |||
| 22 | <table border="0" cellpadding="4" cellspacing="0"> | ||
| 23 | <tr> | ||
| 24 | <td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td> | ||
| 25 | <td><table border="0" cellspacing="0" cellpadding="0"> | ||
| 26 | <tr> | ||
| 27 | <td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> | ||
| 28 | <td id="hrefbrowsercontainer"> </td> | ||
| 29 | </tr> | ||
| 30 | </table></td> | ||
| 31 | </tr> | ||
| 32 | <tr> | ||
| 33 | <td><label for="link_list">{#advanced_dlg.link_list}</label></td> | ||
| 34 | <td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td> | ||
| 35 | </tr> | ||
| 36 | <tr> | ||
| 37 | <td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td> | ||
| 38 | <td><select id="target_list" name="target_list"></select></td> | ||
| 39 | </tr> | ||
| 40 | <tr> | ||
| 41 | <td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td> | ||
| 42 | <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td> | ||
| 43 | </tr> | ||
| 44 | <tr> | ||
| 45 | <td><label for="class_list">{#class_name}</label></td> | ||
| 46 | <td><select id="class_list" name="class_list"></select></td> | ||
| 47 | </tr> | ||
| 48 | </table> | ||
| 49 | </div> | ||
| 50 | </div> | ||
| 51 | |||
| 52 | <div class="mceActionPanel"> | ||
| 53 | <div style="float: left"> | ||
| 54 | <input type="submit" id="insert" name="insert" value="{#insert}" /> | ||
| 55 | </div> | ||
| 56 | |||
| 57 | <div style="float: right"> | ||
| 58 | <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" /> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | </form> | ||
| 62 | </body> | ||
| 63 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css deleted file mode 100644 index 19da194..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} | ||
| 2 | body {background:#FFF;} | ||
| 3 | body.mceForceColors {background:#FFF; color:#000;} | ||
| 4 | h1 {font-size: 2em} | ||
| 5 | h2 {font-size: 1.5em} | ||
| 6 | h3 {font-size: 1.17em} | ||
| 7 | h4 {font-size: 1em} | ||
| 8 | h5 {font-size: .83em} | ||
| 9 | h6 {font-size: .75em} | ||
| 10 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} | ||
| 11 | a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} | ||
| 12 | img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} | ||
| 13 | img {border:0;} | ||
| 14 | table {cursor:default} | ||
| 15 | table td, table th {cursor:text} | ||
| 16 | ins {border-bottom:1px solid green; text-decoration: none; color:green} | ||
| 17 | del {color:red; text-decoration:line-through} | ||
| 18 | cite {border-bottom:1px dashed blue} | ||
| 19 | acronym {border-bottom:1px dotted #CCC; cursor:help} | ||
| 20 | abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} | ||
| 21 | |||
| 22 | /* IE */ | ||
| 23 | * html body { | ||
| 24 | scrollbar-3dlight-color:#F0F0EE; | ||
| 25 | scrollbar-arrow-color:#676662; | ||
| 26 | scrollbar-base-color:#F0F0EE; | ||
| 27 | scrollbar-darkshadow-color:#DDD; | ||
| 28 | scrollbar-face-color:#E0E0DD; | ||
| 29 | scrollbar-highlight-color:#F0F0EE; | ||
| 30 | scrollbar-shadow-color:#F0F0EE; | ||
| 31 | scrollbar-track-color:#F5F5F5; | ||
| 32 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css deleted file mode 100644 index 873c67e..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +++ /dev/null | |||
| @@ -1,116 +0,0 @@ | |||
| 1 | /* Generic */ | ||
| 2 | body { | ||
| 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; | ||
| 4 | scrollbar-3dlight-color:#F0F0EE; | ||
| 5 | scrollbar-arrow-color:#676662; | ||
| 6 | scrollbar-base-color:#F0F0EE; | ||
| 7 | scrollbar-darkshadow-color:#DDDDDD; | ||
| 8 | scrollbar-face-color:#E0E0DD; | ||
| 9 | scrollbar-highlight-color:#F0F0EE; | ||
| 10 | scrollbar-shadow-color:#F0F0EE; | ||
| 11 | scrollbar-track-color:#F5F5F5; | ||
| 12 | background:#F0F0EE; | ||
| 13 | padding:0; | ||
| 14 | margin:8px 8px 0 8px; | ||
| 15 | } | ||
| 16 | |||
| 17 | html {background:#F0F0EE;} | ||
| 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 19 | textarea {resize:none;outline:none;} | ||
| 20 | a:link, a:visited {color:black;} | ||
| 21 | a:hover {color:#2B6FB6;} | ||
| 22 | .nowrap {white-space: nowrap} | ||
| 23 | |||
| 24 | /* Forms */ | ||
| 25 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} | ||
| 26 | legend {color:#2B6FB6; font-weight:bold;} | ||
| 27 | label.msg {display:none;} | ||
| 28 | label.invalid {color:#EE0000; display:inline;} | ||
| 29 | input.invalid {border:1px solid #EE0000;} | ||
| 30 | input {background:#FFF; border:1px solid #CCC;} | ||
| 31 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 32 | input, select, textarea {border:1px solid #808080;} | ||
| 33 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 34 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 35 | .input_noborder {border:0;} | ||
| 36 | |||
| 37 | /* Buttons */ | ||
| 38 | #insert, #cancel, input.button, .updateButton { | ||
| 39 | border:0; margin:0; padding:0; | ||
| 40 | font-weight:bold; | ||
| 41 | width:94px; height:26px; | ||
| 42 | background:url(img/buttons.png) 0 -26px; | ||
| 43 | cursor:pointer; | ||
| 44 | padding-bottom:2px; | ||
| 45 | } | ||
| 46 | |||
| 47 | #insert {background:url(img/buttons.png) 0 -52px;} | ||
| 48 | #cancel {background:url(img/buttons.png) 0 0;} | ||
| 49 | |||
| 50 | /* Browse */ | ||
| 51 | a.pickcolor, a.browse {text-decoration:none} | ||
| 52 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} | ||
| 53 | .mceOldBoxModel a.browse span {width:22px; height:20px;} | ||
| 54 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} | ||
| 55 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 56 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} | ||
| 57 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} | ||
| 58 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} | ||
| 59 | a.pickcolor:hover span {background-color:#B2BBD0;} | ||
| 60 | a.pickcolor:hover span.disabled {} | ||
| 61 | |||
| 62 | /* Charmap */ | ||
| 63 | table.charmap {border:1px solid #AAA; text-align:center} | ||
| 64 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} | ||
| 65 | #charmap a {display:block; color:#000; text-decoration:none; border:0} | ||
| 66 | #charmap a:hover {background:#CCC;color:#2B6FB6} | ||
| 67 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} | ||
| 68 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} | ||
| 69 | |||
| 70 | /* Source */ | ||
| 71 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} | ||
| 72 | .mceActionPanel {margin-top:5px;} | ||
| 73 | |||
| 74 | /* Tabs classes */ | ||
| 75 | .tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} | ||
| 76 | .tabs ul {margin:0; padding:0; list-style:none;} | ||
| 77 | .tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} | ||
| 78 | .tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} | ||
| 79 | .tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} | ||
| 80 | .tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} | ||
| 81 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} | ||
| 82 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} | ||
| 83 | |||
| 84 | /* Panels */ | ||
| 85 | .panel_wrapper div.panel {display:none;} | ||
| 86 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} | ||
| 87 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} | ||
| 88 | |||
| 89 | /* Columns */ | ||
| 90 | .column {float:left;} | ||
| 91 | .properties {width:100%;} | ||
| 92 | .properties .column1 {} | ||
| 93 | .properties .column2 {text-align:left;} | ||
| 94 | |||
| 95 | /* Titles */ | ||
| 96 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} | ||
| 97 | h3 {font-size:14px;} | ||
| 98 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} | ||
| 99 | |||
| 100 | /* Dialog specific */ | ||
| 101 | #link .panel_wrapper, #link div.current {height:125px;} | ||
| 102 | #image .panel_wrapper, #image div.current {height:200px;} | ||
| 103 | #plugintable thead {font-weight:bold; background:#DDD;} | ||
| 104 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} | ||
| 105 | #plugintable {width:96%; margin-top:10px;} | ||
| 106 | #pluginscontainer {height:290px; overflow:auto;} | ||
| 107 | #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} | ||
| 108 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} | ||
| 109 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} | ||
| 110 | #colorpicker #light div {overflow:hidden;} | ||
| 111 | #colorpicker #previewblock {float:right; padding-left:10px; height:20px;} | ||
| 112 | #colorpicker .panel_wrapper div.current {height:175px;} | ||
| 113 | #colorpicker #namedcolors {width:150px;} | ||
| 114 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} | ||
| 115 | #colorpicker #colornamecontainer {margin-top:5px;} | ||
| 116 | #colorpicker #picker_panel fieldset {margin:auto;width:325px;} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png deleted file mode 100644 index 7dd5841..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif deleted file mode 100644 index 2eafd79..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif deleted file mode 100644 index 85e31df..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif deleted file mode 100644 index adfdddc..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif deleted file mode 100644 index 5bb90fd..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif b/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif deleted file mode 100644 index ce4be63..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css b/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css deleted file mode 100644 index 230a2ee..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +++ /dev/null | |||
| @@ -1,214 +0,0 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} | ||
| 3 | .defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 4 | .defaultSkin table td {vertical-align:middle} | ||
| 5 | |||
| 6 | /* Containers */ | ||
| 7 | .defaultSkin table {background:#F0F0EE} | ||
| 8 | .defaultSkin iframe {display:block; background:#FFF} | ||
| 9 | .defaultSkin .mceToolbar {height:26px} | ||
| 10 | .defaultSkin .mceLeft {text-align:left} | ||
| 11 | .defaultSkin .mceRight {text-align:right} | ||
| 12 | |||
| 13 | /* External */ | ||
| 14 | .defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} | ||
| 15 | .defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} | ||
| 16 | .defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} | ||
| 17 | |||
| 18 | /* Layout */ | ||
| 19 | .defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} | ||
| 20 | .defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} | ||
| 21 | .defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} | ||
| 22 | .defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} | ||
| 23 | .defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} | ||
| 24 | .defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} | ||
| 25 | .defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} | ||
| 26 | .defaultSkin .mceStatusbar div {float:left; margin:2px} | ||
| 27 | .defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} | ||
| 28 | .defaultSkin .mceStatusbar a:hover {text-decoration:underline} | ||
| 29 | .defaultSkin table.mceToolbar {margin-left:3px} | ||
| 30 | .defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 31 | .defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 32 | .defaultSkin td.mceCenter {text-align:center;} | ||
| 33 | .defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} | ||
| 34 | .defaultSkin td.mceRight table {margin:0 0 0 auto;} | ||
| 35 | |||
| 36 | /* Button */ | ||
| 37 | .defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} | ||
| 38 | .defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} | ||
| 39 | .defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 40 | .defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 41 | .defaultSkin .mceButtonLabeled {width:auto} | ||
| 42 | .defaultSkin .mceButtonLabeled span.mceIcon {float:left} | ||
| 43 | .defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} | ||
| 44 | .defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} | ||
| 45 | |||
| 46 | /* Separator */ | ||
| 47 | .defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} | ||
| 48 | |||
| 49 | /* ListBox */ | ||
| 50 | .defaultSkin .mceListBox {direction:ltr} | ||
| 51 | .defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} | ||
| 52 | .defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} | ||
| 53 | .defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} | ||
| 54 | .defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} | ||
| 55 | .defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} | ||
| 56 | .defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} | ||
| 57 | .defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} | ||
| 58 | .defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} | ||
| 59 | .defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} | ||
| 60 | .defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} | ||
| 61 | |||
| 62 | /* SplitButton */ | ||
| 63 | .defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} | ||
| 64 | .defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} | ||
| 65 | .defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} | ||
| 66 | .defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;} | ||
| 67 | .defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} | ||
| 68 | .defaultSkin .mceSplitButton span.mceOpen {display:none} | ||
| 69 | .defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} | ||
| 70 | .defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} | ||
| 71 | .defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 72 | .defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 73 | .defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} | ||
| 74 | |||
| 75 | /* ColorSplitButton */ | ||
| 76 | .defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} | ||
| 77 | .defaultSkin .mceColorSplitMenu td {padding:2px} | ||
| 78 | .defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} | ||
| 79 | .defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} | ||
| 80 | .defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} | ||
| 81 | .defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} | ||
| 82 | .defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} | ||
| 83 | .defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} | ||
| 84 | .defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} | ||
| 85 | |||
| 86 | /* Menu */ | ||
| 87 | .defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} | ||
| 88 | .defaultSkin .mceNoIcons span.mceIcon {width:0;} | ||
| 89 | .defaultSkin .mceNoIcons a .mceText {padding-left:10px} | ||
| 90 | .defaultSkin .mceMenu table {background:#FFF} | ||
| 91 | .defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} | ||
| 92 | .defaultSkin .mceMenu td {height:20px} | ||
| 93 | .defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} | ||
| 94 | .defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} | ||
| 95 | .defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} | ||
| 96 | .defaultSkin .mceMenu pre.mceText {font-family:Monospace} | ||
| 97 | .defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} | ||
| 98 | .defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} | ||
| 99 | .defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} | ||
| 100 | .defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} | ||
| 101 | .defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} | ||
| 102 | .defaultSkin .mceMenuItemDisabled .mceText {color:#888} | ||
| 103 | .defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} | ||
| 104 | .defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} | ||
| 105 | .defaultSkin .mceMenu span.mceMenuLine {display:none} | ||
| 106 | .defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} | ||
| 107 | |||
| 108 | /* Progress,Resize */ | ||
| 109 | .defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} | ||
| 110 | .defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} | ||
| 111 | .defaultSkin .mcePlaceHolder {border:1px dotted gray} | ||
| 112 | |||
| 113 | /* Formats */ | ||
| 114 | .defaultSkin .mce_formatPreview a {font-size:10px} | ||
| 115 | .defaultSkin .mce_p span.mceText {} | ||
| 116 | .defaultSkin .mce_address span.mceText {font-style:italic} | ||
| 117 | .defaultSkin .mce_pre span.mceText {font-family:monospace} | ||
| 118 | .defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} | ||
| 119 | .defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} | ||
| 120 | .defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} | ||
| 121 | .defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} | ||
| 122 | .defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} | ||
| 123 | .defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} | ||
| 124 | |||
| 125 | /* Theme */ | ||
| 126 | .defaultSkin span.mce_bold {background-position:0 0} | ||
| 127 | .defaultSkin span.mce_italic {background-position:-60px 0} | ||
| 128 | .defaultSkin span.mce_underline {background-position:-140px 0} | ||
| 129 | .defaultSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 130 | .defaultSkin span.mce_undo {background-position:-160px 0} | ||
| 131 | .defaultSkin span.mce_redo {background-position:-100px 0} | ||
| 132 | .defaultSkin span.mce_cleanup {background-position:-40px 0} | ||
| 133 | .defaultSkin span.mce_bullist {background-position:-20px 0} | ||
| 134 | .defaultSkin span.mce_numlist {background-position:-80px 0} | ||
| 135 | .defaultSkin span.mce_justifyleft {background-position:-460px 0} | ||
| 136 | .defaultSkin span.mce_justifyright {background-position:-480px 0} | ||
| 137 | .defaultSkin span.mce_justifycenter {background-position:-420px 0} | ||
| 138 | .defaultSkin span.mce_justifyfull {background-position:-440px 0} | ||
| 139 | .defaultSkin span.mce_anchor {background-position:-200px 0} | ||
| 140 | .defaultSkin span.mce_indent {background-position:-400px 0} | ||
| 141 | .defaultSkin span.mce_outdent {background-position:-540px 0} | ||
| 142 | .defaultSkin span.mce_link {background-position:-500px 0} | ||
| 143 | .defaultSkin span.mce_unlink {background-position:-640px 0} | ||
| 144 | .defaultSkin span.mce_sub {background-position:-600px 0} | ||
| 145 | .defaultSkin span.mce_sup {background-position:-620px 0} | ||
| 146 | .defaultSkin span.mce_removeformat {background-position:-580px 0} | ||
| 147 | .defaultSkin span.mce_newdocument {background-position:-520px 0} | ||
| 148 | .defaultSkin span.mce_image {background-position:-380px 0} | ||
| 149 | .defaultSkin span.mce_help {background-position:-340px 0} | ||
| 150 | .defaultSkin span.mce_code {background-position:-260px 0} | ||
| 151 | .defaultSkin span.mce_hr {background-position:-360px 0} | ||
| 152 | .defaultSkin span.mce_visualaid {background-position:-660px 0} | ||
| 153 | .defaultSkin span.mce_charmap {background-position:-240px 0} | ||
| 154 | .defaultSkin span.mce_paste {background-position:-560px 0} | ||
| 155 | .defaultSkin span.mce_copy {background-position:-700px 0} | ||
| 156 | .defaultSkin span.mce_cut {background-position:-680px 0} | ||
| 157 | .defaultSkin span.mce_blockquote {background-position:-220px 0} | ||
| 158 | .defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} | ||
| 159 | .defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} | ||
| 160 | .defaultSkin span.mce_forecolorpicker {background-position:-720px 0} | ||
| 161 | .defaultSkin span.mce_backcolorpicker {background-position:-760px 0} | ||
| 162 | |||
| 163 | /* Plugins */ | ||
| 164 | .defaultSkin span.mce_advhr {background-position:-0px -20px} | ||
| 165 | .defaultSkin span.mce_ltr {background-position:-20px -20px} | ||
| 166 | .defaultSkin span.mce_rtl {background-position:-40px -20px} | ||
| 167 | .defaultSkin span.mce_emotions {background-position:-60px -20px} | ||
| 168 | .defaultSkin span.mce_fullpage {background-position:-80px -20px} | ||
| 169 | .defaultSkin span.mce_fullscreen {background-position:-100px -20px} | ||
| 170 | .defaultSkin span.mce_iespell {background-position:-120px -20px} | ||
| 171 | .defaultSkin span.mce_insertdate {background-position:-140px -20px} | ||
| 172 | .defaultSkin span.mce_inserttime {background-position:-160px -20px} | ||
| 173 | .defaultSkin span.mce_absolute {background-position:-180px -20px} | ||
| 174 | .defaultSkin span.mce_backward {background-position:-200px -20px} | ||
| 175 | .defaultSkin span.mce_forward {background-position:-220px -20px} | ||
| 176 | .defaultSkin span.mce_insert_layer {background-position:-240px -20px} | ||
| 177 | .defaultSkin span.mce_insertlayer {background-position:-260px -20px} | ||
| 178 | .defaultSkin span.mce_movebackward {background-position:-280px -20px} | ||
| 179 | .defaultSkin span.mce_moveforward {background-position:-300px -20px} | ||
| 180 | .defaultSkin span.mce_media {background-position:-320px -20px} | ||
| 181 | .defaultSkin span.mce_nonbreaking {background-position:-340px -20px} | ||
| 182 | .defaultSkin span.mce_pastetext {background-position:-360px -20px} | ||
| 183 | .defaultSkin span.mce_pasteword {background-position:-380px -20px} | ||
| 184 | .defaultSkin span.mce_selectall {background-position:-400px -20px} | ||
| 185 | .defaultSkin span.mce_preview {background-position:-420px -20px} | ||
| 186 | .defaultSkin span.mce_print {background-position:-440px -20px} | ||
| 187 | .defaultSkin span.mce_cancel {background-position:-460px -20px} | ||
| 188 | .defaultSkin span.mce_save {background-position:-480px -20px} | ||
| 189 | .defaultSkin span.mce_replace {background-position:-500px -20px} | ||
| 190 | .defaultSkin span.mce_search {background-position:-520px -20px} | ||
| 191 | .defaultSkin span.mce_styleprops {background-position:-560px -20px} | ||
| 192 | .defaultSkin span.mce_table {background-position:-580px -20px} | ||
| 193 | .defaultSkin span.mce_cell_props {background-position:-600px -20px} | ||
| 194 | .defaultSkin span.mce_delete_table {background-position:-620px -20px} | ||
| 195 | .defaultSkin span.mce_delete_col {background-position:-640px -20px} | ||
| 196 | .defaultSkin span.mce_delete_row {background-position:-660px -20px} | ||
| 197 | .defaultSkin span.mce_col_after {background-position:-680px -20px} | ||
| 198 | .defaultSkin span.mce_col_before {background-position:-700px -20px} | ||
| 199 | .defaultSkin span.mce_row_after {background-position:-720px -20px} | ||
| 200 | .defaultSkin span.mce_row_before {background-position:-740px -20px} | ||
| 201 | .defaultSkin span.mce_merge_cells {background-position:-760px -20px} | ||
| 202 | .defaultSkin span.mce_table_props {background-position:-980px -20px} | ||
| 203 | .defaultSkin span.mce_row_props {background-position:-780px -20px} | ||
| 204 | .defaultSkin span.mce_split_cells {background-position:-800px -20px} | ||
| 205 | .defaultSkin span.mce_template {background-position:-820px -20px} | ||
| 206 | .defaultSkin span.mce_visualchars {background-position:-840px -20px} | ||
| 207 | .defaultSkin span.mce_abbr {background-position:-860px -20px} | ||
| 208 | .defaultSkin span.mce_acronym {background-position:-880px -20px} | ||
| 209 | .defaultSkin span.mce_attribs {background-position:-900px -20px} | ||
| 210 | .defaultSkin span.mce_cite {background-position:-920px -20px} | ||
| 211 | .defaultSkin span.mce_del {background-position:-940px -20px} | ||
| 212 | .defaultSkin span.mce_ins {background-position:-960px -20px} | ||
| 213 | .defaultSkin span.mce_pagebreak {background-position:0 -40px} | ||
| 214 | .defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css deleted file mode 100644 index b8431d1..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} | ||
| 2 | body {background:#FFF;} | ||
| 3 | body.mceForceColors {background:#FFF; color:#000;} | ||
| 4 | h1 {font-size: 2em} | ||
| 5 | h2 {font-size: 1.5em} | ||
| 6 | h3 {font-size: 1.17em} | ||
| 7 | h4 {font-size: 1em} | ||
| 8 | h5 {font-size: .83em} | ||
| 9 | h6 {font-size: .75em} | ||
| 10 | .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} | ||
| 11 | a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} | ||
| 12 | img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} | ||
| 13 | img {border:0;} | ||
| 14 | table {cursor:default} | ||
| 15 | table td, table th {cursor:text} | ||
| 16 | ins {border-bottom:1px solid green; text-decoration: none; color:green} | ||
| 17 | del {color:red; text-decoration:line-through} | ||
| 18 | cite {border-bottom:1px dashed blue} | ||
| 19 | acronym {border-bottom:1px dotted #CCC; cursor:help} | ||
| 20 | abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} | ||
| 21 | |||
| 22 | /* IE */ | ||
| 23 | * html body { | ||
| 24 | scrollbar-3dlight-color:#F0F0EE; | ||
| 25 | scrollbar-arrow-color:#676662; | ||
| 26 | scrollbar-base-color:#F0F0EE; | ||
| 27 | scrollbar-darkshadow-color:#DDD; | ||
| 28 | scrollbar-face-color:#E0E0DD; | ||
| 29 | scrollbar-highlight-color:#F0F0EE; | ||
| 30 | scrollbar-shadow-color:#F0F0EE; | ||
| 31 | scrollbar-track-color:#F5F5F5; | ||
| 32 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css deleted file mode 100644 index 6c37d6f..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | /* Generic */ | ||
| 2 | body { | ||
| 3 | font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; | ||
| 4 | scrollbar-3dlight-color:#F0F0EE; | ||
| 5 | scrollbar-arrow-color:#676662; | ||
| 6 | scrollbar-base-color:#F0F0EE; | ||
| 7 | scrollbar-darkshadow-color:#DDDDDD; | ||
| 8 | scrollbar-face-color:#E0E0DD; | ||
| 9 | scrollbar-highlight-color:#F0F0EE; | ||
| 10 | scrollbar-shadow-color:#F0F0EE; | ||
| 11 | scrollbar-track-color:#F5F5F5; | ||
| 12 | background:#F0F0EE; | ||
| 13 | padding:0; | ||
| 14 | margin:8px 8px 0 8px; | ||
| 15 | } | ||
| 16 | |||
| 17 | html {background:#F0F0EE;} | ||
| 18 | td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 19 | textarea {resize:none;outline:none;} | ||
| 20 | a:link, a:visited {color:black;} | ||
| 21 | a:hover {color:#2B6FB6;} | ||
| 22 | .nowrap {white-space: nowrap} | ||
| 23 | |||
| 24 | /* Forms */ | ||
| 25 | fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} | ||
| 26 | legend {color:#2B6FB6; font-weight:bold;} | ||
| 27 | label.msg {display:none;} | ||
| 28 | label.invalid {color:#EE0000; display:inline;} | ||
| 29 | input.invalid {border:1px solid #EE0000;} | ||
| 30 | input {background:#FFF; border:1px solid #CCC;} | ||
| 31 | input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 32 | input, select, textarea {border:1px solid #808080;} | ||
| 33 | input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 34 | input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} | ||
| 35 | .input_noborder {border:0;} | ||
| 36 | |||
| 37 | /* Buttons */ | ||
| 38 | #insert, #cancel, input.button, .updateButton { | ||
| 39 | border:0; margin:0; padding:0; | ||
| 40 | font-weight:bold; | ||
| 41 | width:94px; height:26px; | ||
| 42 | background:url(../default/img/buttons.png) 0 -26px; | ||
| 43 | cursor:pointer; | ||
| 44 | padding-bottom:2px; | ||
| 45 | } | ||
| 46 | |||
| 47 | #insert {background:url(../default/img/buttons.png) 0 -52px;} | ||
| 48 | #cancel {background:url(../default/img/buttons.png) 0 0;} | ||
| 49 | |||
| 50 | /* Browse */ | ||
| 51 | a.pickcolor, a.browse {text-decoration:none} | ||
| 52 | a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} | ||
| 53 | .mceOldBoxModel a.browse span {width:22px; height:20px;} | ||
| 54 | a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} | ||
| 55 | a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 56 | a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} | ||
| 57 | a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} | ||
| 58 | .mceOldBoxModel a.pickcolor span {width:21px; height:17px;} | ||
| 59 | a.pickcolor:hover span {background-color:#B2BBD0;} | ||
| 60 | a.pickcolor:hover span.disabled {} | ||
| 61 | |||
| 62 | /* Charmap */ | ||
| 63 | table.charmap {border:1px solid #AAA; text-align:center} | ||
| 64 | td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} | ||
| 65 | #charmap a {display:block; color:#000; text-decoration:none; border:0} | ||
| 66 | #charmap a:hover {background:#CCC;color:#2B6FB6} | ||
| 67 | #charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} | ||
| 68 | #charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} | ||
| 69 | |||
| 70 | /* Source */ | ||
| 71 | .wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} | ||
| 72 | .mceActionPanel {margin-top:5px;} | ||
| 73 | |||
| 74 | /* Tabs classes */ | ||
| 75 | .tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} | ||
| 76 | .tabs ul {margin:0; padding:0; list-style:none;} | ||
| 77 | .tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} | ||
| 78 | .tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} | ||
| 79 | .tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} | ||
| 80 | .tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} | ||
| 81 | .tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} | ||
| 82 | .tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} | ||
| 83 | |||
| 84 | /* Panels */ | ||
| 85 | .panel_wrapper div.panel {display:none;} | ||
| 86 | .panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} | ||
| 87 | .panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} | ||
| 88 | |||
| 89 | /* Columns */ | ||
| 90 | .column {float:left;} | ||
| 91 | .properties {width:100%;} | ||
| 92 | .properties .column1 {} | ||
| 93 | .properties .column2 {text-align:left;} | ||
| 94 | |||
| 95 | /* Titles */ | ||
| 96 | h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} | ||
| 97 | h3 {font-size:14px;} | ||
| 98 | .title {font-size:12px; font-weight:bold; color:#2B6FB6;} | ||
| 99 | |||
| 100 | /* Dialog specific */ | ||
| 101 | #link .panel_wrapper, #link div.current {height:125px;} | ||
| 102 | #image .panel_wrapper, #image div.current {height:200px;} | ||
| 103 | #plugintable thead {font-weight:bold; background:#DDD;} | ||
| 104 | #plugintable, #about #plugintable td {border:1px solid #919B9C;} | ||
| 105 | #plugintable {width:96%; margin-top:10px;} | ||
| 106 | #pluginscontainer {height:290px; overflow:auto;} | ||
| 107 | #colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} | ||
| 108 | #colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} | ||
| 109 | #colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} | ||
| 110 | #colorpicker #light div {overflow:hidden;} | ||
| 111 | #colorpicker #previewblock {float:right; padding-left:10px; height:20px;} | ||
| 112 | #colorpicker .panel_wrapper div.current {height:175px;} | ||
| 113 | #colorpicker #namedcolors {width:150px;} | ||
| 114 | #colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} | ||
| 115 | #colorpicker #colornamecontainer {margin-top:5px;} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png deleted file mode 100644 index 12cfb41..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png deleted file mode 100644 index 8996c74..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png deleted file mode 100644 index bd5d255..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css deleted file mode 100644 index c10a3f0..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ /dev/null | |||
| @@ -1,215 +0,0 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} | ||
| 3 | .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 4 | .o2k7Skin table td {vertical-align:middle} | ||
| 5 | |||
| 6 | /* Containers */ | ||
| 7 | .o2k7Skin table {background:#E5EFFD} | ||
| 8 | .o2k7Skin iframe {display:block; background:#FFF} | ||
| 9 | .o2k7Skin .mceToolbar {height:26px} | ||
| 10 | |||
| 11 | /* External */ | ||
| 12 | .o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} | ||
| 13 | .o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} | ||
| 14 | .o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} | ||
| 15 | |||
| 16 | /* Layout */ | ||
| 17 | .o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} | ||
| 18 | .o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} | ||
| 19 | .o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} | ||
| 20 | .o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} | ||
| 21 | .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} | ||
| 22 | .o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} | ||
| 23 | .o2k7Skin .mceStatusbar div {float:left; padding:2px} | ||
| 24 | .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} | ||
| 25 | .o2k7Skin .mceStatusbar a:hover {text-decoration:underline} | ||
| 26 | .o2k7Skin table.mceToolbar {margin-left:3px} | ||
| 27 | .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} | ||
| 28 | .o2k7Skin .mceToolbar td.mceFirst span {margin:0} | ||
| 29 | .o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} | ||
| 30 | .o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} | ||
| 31 | .o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} | ||
| 32 | .o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 33 | .o2k7Skin td.mceCenter {text-align:center;} | ||
| 34 | .o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} | ||
| 35 | .o2k7Skin td.mceRight table {margin:0 0 0 auto;} | ||
| 36 | |||
| 37 | /* Button */ | ||
| 38 | .o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} | ||
| 39 | .o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} | ||
| 40 | .o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} | ||
| 41 | .o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} | ||
| 42 | .o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} | ||
| 43 | .o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 44 | .o2k7Skin .mceButtonLabeled {width:auto} | ||
| 45 | .o2k7Skin .mceButtonLabeled span.mceIcon {float:left} | ||
| 46 | .o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} | ||
| 47 | .o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} | ||
| 48 | |||
| 49 | /* Separator */ | ||
| 50 | .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} | ||
| 51 | |||
| 52 | /* ListBox */ | ||
| 53 | .o2k7Skin .mceListBox {margin-left:3px} | ||
| 54 | .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} | ||
| 55 | .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} | ||
| 56 | .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} | ||
| 57 | .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} | ||
| 58 | .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} | ||
| 59 | .o2k7Skin .mceListBoxDisabled .mceText {color:gray} | ||
| 60 | .o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} | ||
| 61 | .o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} | ||
| 62 | .o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} | ||
| 63 | |||
| 64 | /* SplitButton */ | ||
| 65 | .o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px} | ||
| 66 | .o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} | ||
| 67 | .o2k7Skin .mceSplitButton a.mceAction {width:22px} | ||
| 68 | .o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px} | ||
| 69 | .o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} | ||
| 70 | .o2k7Skin .mceSplitButton span.mceOpen {display:none} | ||
| 71 | .o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} | ||
| 72 | .o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} | ||
| 73 | .o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 74 | .o2k7Skin .mceSplitButtonActive {background-position:0 -44px} | ||
| 75 | |||
| 76 | /* ColorSplitButton */ | ||
| 77 | .o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} | ||
| 78 | .o2k7Skin .mceColorSplitMenu td {padding:2px} | ||
| 79 | .o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} | ||
| 80 | .o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} | ||
| 81 | .o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} | ||
| 82 | .o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} | ||
| 83 | .o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} | ||
| 84 | .o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} | ||
| 85 | .o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} | ||
| 86 | |||
| 87 | /* Menu */ | ||
| 88 | .o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} | ||
| 89 | .o2k7Skin .mceNoIcons span.mceIcon {width:0;} | ||
| 90 | .o2k7Skin .mceNoIcons a .mceText {padding-left:10px} | ||
| 91 | .o2k7Skin .mceMenu table {background:#FFF} | ||
| 92 | .o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} | ||
| 93 | .o2k7Skin .mceMenu td {height:20px} | ||
| 94 | .o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} | ||
| 95 | .o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} | ||
| 96 | .o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} | ||
| 97 | .o2k7Skin .mceMenu pre.mceText {font-family:Monospace} | ||
| 98 | .o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} | ||
| 99 | .o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} | ||
| 100 | .o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} | ||
| 101 | .o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} | ||
| 102 | .o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} | ||
| 103 | .o2k7Skin .mceMenuItemDisabled .mceText {color:#888} | ||
| 104 | .o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} | ||
| 105 | .o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} | ||
| 106 | .o2k7Skin .mceMenu span.mceMenuLine {display:none} | ||
| 107 | .o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} | ||
| 108 | |||
| 109 | /* Progress,Resize */ | ||
| 110 | .o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} | ||
| 111 | .o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} | ||
| 112 | .o2k7Skin .mcePlaceHolder {border:1px dotted gray} | ||
| 113 | |||
| 114 | /* Formats */ | ||
| 115 | .o2k7Skin .mce_formatPreview a {font-size:10px} | ||
| 116 | .o2k7Skin .mce_p span.mceText {} | ||
| 117 | .o2k7Skin .mce_address span.mceText {font-style:italic} | ||
| 118 | .o2k7Skin .mce_pre span.mceText {font-family:monospace} | ||
| 119 | .o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} | ||
| 120 | .o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} | ||
| 121 | .o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} | ||
| 122 | .o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} | ||
| 123 | .o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} | ||
| 124 | .o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} | ||
| 125 | |||
| 126 | /* Theme */ | ||
| 127 | .o2k7Skin span.mce_bold {background-position:0 0} | ||
| 128 | .o2k7Skin span.mce_italic {background-position:-60px 0} | ||
| 129 | .o2k7Skin span.mce_underline {background-position:-140px 0} | ||
| 130 | .o2k7Skin span.mce_strikethrough {background-position:-120px 0} | ||
| 131 | .o2k7Skin span.mce_undo {background-position:-160px 0} | ||
| 132 | .o2k7Skin span.mce_redo {background-position:-100px 0} | ||
| 133 | .o2k7Skin span.mce_cleanup {background-position:-40px 0} | ||
| 134 | .o2k7Skin span.mce_bullist {background-position:-20px 0} | ||
| 135 | .o2k7Skin span.mce_numlist {background-position:-80px 0} | ||
| 136 | .o2k7Skin span.mce_justifyleft {background-position:-460px 0} | ||
| 137 | .o2k7Skin span.mce_justifyright {background-position:-480px 0} | ||
| 138 | .o2k7Skin span.mce_justifycenter {background-position:-420px 0} | ||
| 139 | .o2k7Skin span.mce_justifyfull {background-position:-440px 0} | ||
| 140 | .o2k7Skin span.mce_anchor {background-position:-200px 0} | ||
| 141 | .o2k7Skin span.mce_indent {background-position:-400px 0} | ||
| 142 | .o2k7Skin span.mce_outdent {background-position:-540px 0} | ||
| 143 | .o2k7Skin span.mce_link {background-position:-500px 0} | ||
| 144 | .o2k7Skin span.mce_unlink {background-position:-640px 0} | ||
| 145 | .o2k7Skin span.mce_sub {background-position:-600px 0} | ||
| 146 | .o2k7Skin span.mce_sup {background-position:-620px 0} | ||
| 147 | .o2k7Skin span.mce_removeformat {background-position:-580px 0} | ||
| 148 | .o2k7Skin span.mce_newdocument {background-position:-520px 0} | ||
| 149 | .o2k7Skin span.mce_image {background-position:-380px 0} | ||
| 150 | .o2k7Skin span.mce_help {background-position:-340px 0} | ||
| 151 | .o2k7Skin span.mce_code {background-position:-260px 0} | ||
| 152 | .o2k7Skin span.mce_hr {background-position:-360px 0} | ||
| 153 | .o2k7Skin span.mce_visualaid {background-position:-660px 0} | ||
| 154 | .o2k7Skin span.mce_charmap {background-position:-240px 0} | ||
| 155 | .o2k7Skin span.mce_paste {background-position:-560px 0} | ||
| 156 | .o2k7Skin span.mce_copy {background-position:-700px 0} | ||
| 157 | .o2k7Skin span.mce_cut {background-position:-680px 0} | ||
| 158 | .o2k7Skin span.mce_blockquote {background-position:-220px 0} | ||
| 159 | .o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} | ||
| 160 | .o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} | ||
| 161 | .o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} | ||
| 162 | .o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} | ||
| 163 | |||
| 164 | /* Plugins */ | ||
| 165 | .o2k7Skin span.mce_advhr {background-position:-0px -20px} | ||
| 166 | .o2k7Skin span.mce_ltr {background-position:-20px -20px} | ||
| 167 | .o2k7Skin span.mce_rtl {background-position:-40px -20px} | ||
| 168 | .o2k7Skin span.mce_emotions {background-position:-60px -20px} | ||
| 169 | .o2k7Skin span.mce_fullpage {background-position:-80px -20px} | ||
| 170 | .o2k7Skin span.mce_fullscreen {background-position:-100px -20px} | ||
| 171 | .o2k7Skin span.mce_iespell {background-position:-120px -20px} | ||
| 172 | .o2k7Skin span.mce_insertdate {background-position:-140px -20px} | ||
| 173 | .o2k7Skin span.mce_inserttime {background-position:-160px -20px} | ||
| 174 | .o2k7Skin span.mce_absolute {background-position:-180px -20px} | ||
| 175 | .o2k7Skin span.mce_backward {background-position:-200px -20px} | ||
| 176 | .o2k7Skin span.mce_forward {background-position:-220px -20px} | ||
| 177 | .o2k7Skin span.mce_insert_layer {background-position:-240px -20px} | ||
| 178 | .o2k7Skin span.mce_insertlayer {background-position:-260px -20px} | ||
| 179 | .o2k7Skin span.mce_movebackward {background-position:-280px -20px} | ||
| 180 | .o2k7Skin span.mce_moveforward {background-position:-300px -20px} | ||
| 181 | .o2k7Skin span.mce_media {background-position:-320px -20px} | ||
| 182 | .o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} | ||
| 183 | .o2k7Skin span.mce_pastetext {background-position:-360px -20px} | ||
| 184 | .o2k7Skin span.mce_pasteword {background-position:-380px -20px} | ||
| 185 | .o2k7Skin span.mce_selectall {background-position:-400px -20px} | ||
| 186 | .o2k7Skin span.mce_preview {background-position:-420px -20px} | ||
| 187 | .o2k7Skin span.mce_print {background-position:-440px -20px} | ||
| 188 | .o2k7Skin span.mce_cancel {background-position:-460px -20px} | ||
| 189 | .o2k7Skin span.mce_save {background-position:-480px -20px} | ||
| 190 | .o2k7Skin span.mce_replace {background-position:-500px -20px} | ||
| 191 | .o2k7Skin span.mce_search {background-position:-520px -20px} | ||
| 192 | .o2k7Skin span.mce_styleprops {background-position:-560px -20px} | ||
| 193 | .o2k7Skin span.mce_table {background-position:-580px -20px} | ||
| 194 | .o2k7Skin span.mce_cell_props {background-position:-600px -20px} | ||
| 195 | .o2k7Skin span.mce_delete_table {background-position:-620px -20px} | ||
| 196 | .o2k7Skin span.mce_delete_col {background-position:-640px -20px} | ||
| 197 | .o2k7Skin span.mce_delete_row {background-position:-660px -20px} | ||
| 198 | .o2k7Skin span.mce_col_after {background-position:-680px -20px} | ||
| 199 | .o2k7Skin span.mce_col_before {background-position:-700px -20px} | ||
| 200 | .o2k7Skin span.mce_row_after {background-position:-720px -20px} | ||
| 201 | .o2k7Skin span.mce_row_before {background-position:-740px -20px} | ||
| 202 | .o2k7Skin span.mce_merge_cells {background-position:-760px -20px} | ||
| 203 | .o2k7Skin span.mce_table_props {background-position:-980px -20px} | ||
| 204 | .o2k7Skin span.mce_row_props {background-position:-780px -20px} | ||
| 205 | .o2k7Skin span.mce_split_cells {background-position:-800px -20px} | ||
| 206 | .o2k7Skin span.mce_template {background-position:-820px -20px} | ||
| 207 | .o2k7Skin span.mce_visualchars {background-position:-840px -20px} | ||
| 208 | .o2k7Skin span.mce_abbr {background-position:-860px -20px} | ||
| 209 | .o2k7Skin span.mce_acronym {background-position:-880px -20px} | ||
| 210 | .o2k7Skin span.mce_attribs {background-position:-900px -20px} | ||
| 211 | .o2k7Skin span.mce_cite {background-position:-920px -20px} | ||
| 212 | .o2k7Skin span.mce_del {background-position:-940px -20px} | ||
| 213 | .o2k7Skin span.mce_ins {background-position:-960px -20px} | ||
| 214 | .o2k7Skin span.mce_pagebreak {background-position:0 -40px} | ||
| 215 | .o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css deleted file mode 100644 index 153f0c3..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | /* Black */ | ||
| 2 | .o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} | ||
| 3 | .o2k7SkinBlack table, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} | ||
| 4 | .o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} | ||
| 5 | .o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} | ||
| 6 | .o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} | ||
| 7 | .o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} | ||
| 8 | .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css deleted file mode 100644 index 7fe3b45..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | /* Silver */ | ||
| 2 | .o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} | ||
| 3 | .o2k7SkinSilver table, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} | ||
| 4 | .o2k7SkinSilver .mceListBox .mceText {background:#FFF} | ||
| 5 | .o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} | ||
diff --git a/public/javascripts/tiny_mce/themes/advanced/source_editor.htm b/public/javascripts/tiny_mce/themes/advanced/source_editor.htm deleted file mode 100644 index 553e7bb..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
| 4 | <title>{#advanced_dlg.code_title}</title> | ||
| 5 | <script type="text/javascript" src="../../tiny_mce_popup.js"></script> | ||
| 6 | <script type="text/javascript" src="js/source_editor.js"></script> | ||
| 7 | </head> | ||
| 8 | <body onresize="resizeInputs();" style="display:none; overflow:hidden;"> | ||
| 9 | <form name="source" onsubmit="saveContent();return false;" action="#"> | ||
| 10 | <div style="float: left" class="title">{#advanced_dlg.code_title}</div> | ||
| 11 | |||
| 12 | <div id="wrapline" style="float: right"> | ||
| 13 | <input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label> | ||
| 14 | </div> | ||
| 15 | |||
| 16 | <br style="clear: both" /> | ||
| 17 | |||
| 18 | <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea> | ||
| 19 | |||
| 20 | <div class="mceActionPanel"> | ||
| 21 | <div style="float: left"> | ||
| 22 | <input type="submit" name="insert" value="{#update}" id="insert" /> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div style="float: right"> | ||
| 26 | <input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" /> | ||
| 27 | </div> | ||
| 28 | </div> | ||
| 29 | </form> | ||
| 30 | </body> | ||
| 31 | </html> | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/editor_template.js b/public/javascripts/tiny_mce/themes/simple/editor_template.js deleted file mode 100644 index ed89abc..0000000 --- a/public/javascripts/tiny_mce/themes/simple/editor_template.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})});c.dom.loadCSS(d+"/skins/"+f.skin+"/content.css")});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/editor_template_src.js b/public/javascripts/tiny_mce/themes/simple/editor_template_src.js deleted file mode 100644 index fb0bd78..0000000 --- a/public/javascripts/tiny_mce/themes/simple/editor_template_src.js +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_template_src.js 920 2008-09-09 14:05:33Z spocke $ | ||
| 3 | * | ||
| 4 | * This file is meant to showcase how to create a simple theme. The advanced | ||
| 5 | * theme is more suitable for production use. | ||
| 6 | * | ||
| 7 | * @author Moxiecode | ||
| 8 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 9 | */ | ||
| 10 | |||
| 11 | (function() { | ||
| 12 | var DOM = tinymce.DOM; | ||
| 13 | |||
| 14 | // Tell it to load theme specific language pack(s) | ||
| 15 | tinymce.ThemeManager.requireLangPack('simple'); | ||
| 16 | |||
| 17 | tinymce.create('tinymce.themes.SimpleTheme', { | ||
| 18 | init : function(ed, url) { | ||
| 19 | var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; | ||
| 20 | |||
| 21 | t.editor = ed; | ||
| 22 | |||
| 23 | ed.onInit.add(function() { | ||
| 24 | ed.onNodeChange.add(function(ed, cm) { | ||
| 25 | tinymce.each(states, function(c) { | ||
| 26 | cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); | ||
| 27 | }); | ||
| 28 | }); | ||
| 29 | |||
| 30 | ed.dom.loadCSS(url + "/skins/" + s.skin + "/content.css"); | ||
| 31 | }); | ||
| 32 | |||
| 33 | DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); | ||
| 34 | }, | ||
| 35 | |||
| 36 | renderUI : function(o) { | ||
| 37 | var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; | ||
| 38 | |||
| 39 | n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); | ||
| 40 | n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); | ||
| 41 | n = tb = DOM.add(n, 'tbody'); | ||
| 42 | |||
| 43 | // Create iframe container | ||
| 44 | n = DOM.add(tb, 'tr'); | ||
| 45 | n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); | ||
| 46 | |||
| 47 | // Create toolbar container | ||
| 48 | n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); | ||
| 49 | |||
| 50 | // Create toolbar | ||
| 51 | tb = t.toolbar = cf.createToolbar("tools1"); | ||
| 52 | tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); | ||
| 53 | tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); | ||
| 54 | tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); | ||
| 55 | tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); | ||
| 56 | tb.add(cf.createSeparator()); | ||
| 57 | tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); | ||
| 58 | tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); | ||
| 59 | tb.add(cf.createSeparator()); | ||
| 60 | tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); | ||
| 61 | tb.add(cf.createSeparator()); | ||
| 62 | tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); | ||
| 63 | tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); | ||
| 64 | tb.renderTo(n); | ||
| 65 | |||
| 66 | return { | ||
| 67 | iframeContainer : ic, | ||
| 68 | editorContainer : ed.id + '_container', | ||
| 69 | sizeContainer : sc, | ||
| 70 | deltaHeight : -20 | ||
| 71 | }; | ||
| 72 | }, | ||
| 73 | |||
| 74 | getInfo : function() { | ||
| 75 | return { | ||
| 76 | longname : 'Simple theme', | ||
| 77 | author : 'Moxiecode Systems AB', | ||
| 78 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 79 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 80 | } | ||
| 81 | } | ||
| 82 | }); | ||
| 83 | |||
| 84 | tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); | ||
| 85 | })(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/img/icons.gif b/public/javascripts/tiny_mce/themes/simple/img/icons.gif deleted file mode 100644 index 16af141..0000000 --- a/public/javascripts/tiny_mce/themes/simple/img/icons.gif +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/simple/langs/en.js b/public/javascripts/tiny_mce/themes/simple/langs/en.js deleted file mode 100644 index 9f08f10..0000000 --- a/public/javascripts/tiny_mce/themes/simple/langs/en.js +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | tinyMCE.addI18n('en.simple',{ | ||
| 2 | bold_desc:"Bold (Ctrl+B)", | ||
| 3 | italic_desc:"Italic (Ctrl+I)", | ||
| 4 | underline_desc:"Underline (Ctrl+U)", | ||
| 5 | striketrough_desc:"Strikethrough", | ||
| 6 | bullist_desc:"Unordered list", | ||
| 7 | numlist_desc:"Ordered list", | ||
| 8 | undo_desc:"Undo (Ctrl+Z)", | ||
| 9 | redo_desc:"Redo (Ctrl+Y)", | ||
| 10 | cleanup_desc:"Cleanup messy code" | ||
| 11 | }); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/default/content.css b/public/javascripts/tiny_mce/themes/simple/skins/default/content.css deleted file mode 100644 index 2506c80..0000000 --- a/public/javascripts/tiny_mce/themes/simple/skins/default/content.css +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | body, td, pre { | ||
| 2 | font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 3 | font-size: 10px; | ||
| 4 | } | ||
| 5 | |||
| 6 | body { | ||
| 7 | background-color: #FFFFFF; | ||
| 8 | } | ||
| 9 | |||
| 10 | .mceVisualAid { | ||
| 11 | border: 1px dashed #BBBBBB; | ||
| 12 | } | ||
| 13 | |||
| 14 | /* MSIE specific */ | ||
| 15 | |||
| 16 | * html body { | ||
| 17 | scrollbar-3dlight-color: #F0F0EE; | ||
| 18 | scrollbar-arrow-color: #676662; | ||
| 19 | scrollbar-base-color: #F0F0EE; | ||
| 20 | scrollbar-darkshadow-color: #DDDDDD; | ||
| 21 | scrollbar-face-color: #E0E0DD; | ||
| 22 | scrollbar-highlight-color: #F0F0EE; | ||
| 23 | scrollbar-shadow-color: #F0F0EE; | ||
| 24 | scrollbar-track-color: #F5F5F5; | ||
| 25 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css b/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css deleted file mode 100644 index 076fe84..0000000 --- a/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 3 | |||
| 4 | /* Containers */ | ||
| 5 | .defaultSimpleSkin {position:relative} | ||
| 6 | .defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} | ||
| 7 | .defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} | ||
| 8 | .defaultSimpleSkin .mceToolbar {height:24px;} | ||
| 9 | |||
| 10 | /* Layout */ | ||
| 11 | .defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 12 | .defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 13 | |||
| 14 | /* Button */ | ||
| 15 | .defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} | ||
| 16 | .defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} | ||
| 17 | .defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} | ||
| 18 | .defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 19 | |||
| 20 | /* Separator */ | ||
| 21 | .defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} | ||
| 22 | |||
| 23 | /* Theme */ | ||
| 24 | .defaultSimpleSkin span.mce_bold {background-position:0 0} | ||
| 25 | .defaultSimpleSkin span.mce_italic {background-position:-60px 0} | ||
| 26 | .defaultSimpleSkin span.mce_underline {background-position:-140px 0} | ||
| 27 | .defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 28 | .defaultSimpleSkin span.mce_undo {background-position:-160px 0} | ||
| 29 | .defaultSimpleSkin span.mce_redo {background-position:-100px 0} | ||
| 30 | .defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} | ||
| 31 | .defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} | ||
| 32 | .defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css deleted file mode 100644 index 595809f..0000000 --- a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} | ||
| 2 | |||
| 3 | body {background: #FFF;} | ||
| 4 | .mceVisualAid {border: 1px dashed #BBB;} | ||
| 5 | |||
| 6 | /* IE */ | ||
| 7 | |||
| 8 | * html body { | ||
| 9 | scrollbar-3dlight-color: #F0F0EE; | ||
| 10 | scrollbar-arrow-color: #676662; | ||
| 11 | scrollbar-base-color: #F0F0EE; | ||
| 12 | scrollbar-darkshadow-color: #DDDDDD; | ||
| 13 | scrollbar-face-color: #E0E0DD; | ||
| 14 | scrollbar-highlight-color: #F0F0EE; | ||
| 15 | scrollbar-shadow-color: #F0F0EE; | ||
| 16 | scrollbar-track-color: #F5F5F5; | ||
| 17 | } | ||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png deleted file mode 100644 index 527e349..0000000 --- a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +++ /dev/null | |||
| Binary files differ | |||
diff --git a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css b/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css deleted file mode 100644 index cf6c35d..0000000 --- a/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | /* Reset */ | ||
| 2 | .o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} | ||
| 3 | |||
| 4 | /* Containers */ | ||
| 5 | .o2k7SimpleSkin {position:relative} | ||
| 6 | .o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} | ||
| 7 | .o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} | ||
| 8 | .o2k7SimpleSkin .mceToolbar {height:26px;} | ||
| 9 | |||
| 10 | /* Layout */ | ||
| 11 | .o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } | ||
| 12 | .o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} | ||
| 13 | .o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} | ||
| 14 | .o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} | ||
| 15 | |||
| 16 | /* Button */ | ||
| 17 | .o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} | ||
| 18 | .o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} | ||
| 19 | .o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} | ||
| 20 | .o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} | ||
| 21 | .o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} | ||
| 22 | |||
| 23 | /* Separator */ | ||
| 24 | .o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} | ||
| 25 | |||
| 26 | /* Theme */ | ||
| 27 | .o2k7SimpleSkin span.mce_bold {background-position:0 0} | ||
| 28 | .o2k7SimpleSkin span.mce_italic {background-position:-60px 0} | ||
| 29 | .o2k7SimpleSkin span.mce_underline {background-position:-140px 0} | ||
| 30 | .o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} | ||
| 31 | .o2k7SimpleSkin span.mce_undo {background-position:-160px 0} | ||
| 32 | .o2k7SimpleSkin span.mce_redo {background-position:-100px 0} | ||
| 33 | .o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} | ||
| 34 | .o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} | ||
| 35 | .o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} | ||
diff --git a/public/javascripts/tiny_mce/tiny_mce.js b/public/javascripts/tiny_mce/tiny_mce.js deleted file mode 100644 index 6b9393c..0000000 --- a/public/javascripts/tiny_mce/tiny_mce.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | var tinymce={majorVersion:"3",minorVersion:"2.7",releaseDate:"2009-09-22",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1&&o.baseURL.indexOf("/")!==0){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();(function(d,c){var b=c.is;if(!window.jQuery){return alert("Load jQuery first!")}c.extend=d.extend;c.extend(c,{map:d.map,grep:function(e,g){return d.grep(e,g||function(){return 1})},inArray:function(e,f){return d.inArray(f,e||[])}});var a={"tinymce.dom.DOMUtils":{select:function(g,f){var e=this;return d.find(g,e.get(f)||e.get(e.settings.root_element)||e.doc,[])},is:function(f,e){return d(this.get(f)).is(e)}}};c.onCreate=function(e,g,f){c.extend(f,a[g])}})(jQuery,tinymce);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c<e.length;c++){a+=(c>0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},getNext:function(g,f){return this._findSib(g,f,"nextSibling")},getPrev:function(g,f){return this._findSib(g,f,"previousSibling")},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+"</"+m+">"}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(j)){if(i[g.props[j]]===true&&f===""){return j}return f?j:""}if(i.nodeName==="FORM"&&i.getAttributeNode(j)){return i.getAttributeNode(j).nodeValue}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/<p ([^>]+)>|<p>/ig,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings,k=[];if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<em( [^>]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|noscript|style/i.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(h,m,l){if(!m){m=' type="text/javascript"'}m=m.replace(/src=\"([^\"]+)\"?/i,function(n,o){if(i.url_converter){o=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(o),"src","script"))}return'mce_src="'+o+'"'});if(c.trim(l)){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n// -->"}return"<mce:script"+m+">"+l+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(h,m,l){if(l){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n-->"}return"<mce:style"+m+">"+l+"</mce:style><style "+m+' mce_bogus="1">'+l+"</style>"});j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,m,l){return"<mce:noscript"+m+"><!--"+g.encode(l).replace(/--/g,"--")+"--></mce:noscript>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");j=j.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi,function(l){function h(o,m,n){if(n==="false"||n==="0"){return""}return" "+m+'="'+m+'"'}l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi,' $1="$1"$2');return l});j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,m){function l(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}p=g.encode(g.serializeStyle(g.parseStyle(p)))}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,m))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,l);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,l);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,l)});j=j.replace(/MCE_SCRIPT:([0-9]+)/g,function(l,h){return k[h]})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(j,g,k){var f=this;function i(m,l,p){var q,o;o=p.createElement("body");o.innerHTML=l;q=o.lastChild;while(q){f.insertAfter(q.cloneNode(true),m);q=q.previousSibling}f.remove(m)}return this.run(j,function(l){l=f.get(l);if(l.nodeType==1){k=k||l.ownerDocument||f.doc;if(a){try{if(a&&l.nodeType==1){l.outerHTML=g}else{i(l,g,k)}}catch(h){i(l,g,k)}}else{i(l,g,k)}}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}if(g.nodeName==="OPTION"&&this.getAttrib(g,"selected")){f.push({specified:1,nodeName:"selected"})}g.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi,"").replace(/[\w:]+/gi,function(h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_findSib:function(j,g,h){var i=this,k=g;if(j){if(b(k,"string")){k=function(f){return i.is(f,g)}}for(j=j[h];j;j=j[h]){if(k(j)){return j}}}return null},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y<u.length;y++){w=u[y];if(y>0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o=m.createTextRange();o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){o.tridentSel.destroy();if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(<script[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;F>-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){i._setActive(null);g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom}));z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(i){var h,c,a,b,g,f;h=i.dom.Event;c=i.isIE;a=i.isGecko;b=i.isOpera;g=i.each;f=i.extend;function e(k,l){var j=l.ownerDocument.createRange();j.setStart(k.endContainer,k.endOffset);j.setEndAfter(l);return j.cloneContents().textContent.length==0}function d(j){j=j.innerHTML;j=j.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");j=j.replace(/<[^>]+>/g,"");return j.replace(/[ \t\r\n]+/g,"")==""}i.create("tinymce.ForceBlocks",{ForceBlocks:function(k){var l=this,m=k.settings,n;l.editor=k;l.dom=k.dom;n=(m.forced_root_block||"p").toLowerCase();m.element=n.toUpperCase();k.onPreInit.add(l.setup,l);l.reOpera=new RegExp("(\\u00a0| | )</"+n+">","gi");l.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,n),"gi");l.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,n),"gi");function j(p,q){if(b){q.content=q.content.replace(l.reOpera,"</"+n+">")}q.content=q.content.replace(l.rePadd,"<"+n+"$1$2$3$4$5$6>\u00a0</"+n+">");if(!c&&!b&&q.set){q.content=q.content.replace(l.reNbsp2BR1,"<"+n+"$1$2><br /></"+n+">");q.content=q.content.replace(l.reNbsp2BR2,"<"+n+"$1$2><br /></"+n+">")}else{q.content=q.content.replace(l.reBR2Nbsp,"<"+n+"$1$2>\u00a0</"+n+">")}}k.onBeforeSetContent.add(j);k.onPostProcess.add(j);if(m.forced_root_block){k.onInit.add(l.forceRoots,l);k.onSetContent.add(l.forceRoots,l);k.onBeforeGetContent.add(l.forceRoots,l)}},setup:function(){var k=this,j=k.editor,l=j.settings;if(l.forced_root_block){j.onKeyUp.add(k.forceRoots,k);j.onPreProcess.add(k.forceRoots,k)}if(l.force_br_newlines){if(c){j.onKeyPress.add(function(o,q){var r,p=o.selection;if(q.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});r=o.dom.get("__");r.removeAttribute("id");p.select(r);p.collapse();return h.cancel(q)}})}return}if(!c&&l.force_p_newlines){j.onKeyPress.add(function(n,o){if(o.keyCode==13&&!o.shiftKey){if(!k.insertPara(o)){h.cancel(o)}}});if(a){j.onKeyDown.add(function(n,o){if((o.keyCode==8||o.keyCode==46)&&!o.shiftKey){k.backspaceDelete(o,o.keyCode==8)}})}}function m(o,n){var p=j.dom.create(n);g(o.attributes,function(q){if(q.specified&&q.nodeValue){p.setAttribute(q.nodeName.toLowerCase(),q.nodeValue)}});g(o.childNodes,function(q){p.appendChild(q.cloneNode(true))});o.parentNode.replaceChild(p,o);return p}j.onPreProcess.add(function(n,p){g(n.dom.select("p,h1,h2,h3,h4,h5,h6,div",p.node),function(o){if(d(o)){g(n.dom.select("span,em,strong,b,i",p.node),function(q){if(!q.hasChildNodes()){q.appendChild(n.getDoc().createTextNode("\u00a0"));return false}})}})});if(c){if(l.element!="P"){j.onKeyPress.add(function(n,o){k.lastElm=n.selection.getNode().nodeName});j.onKeyUp.add(function(p,r){var t,q=p.selection,s=q.getNode(),o=p.getBody();if(o.childNodes.length===1&&s.nodeName=="P"){s=m(s,l.element);q.select(s);q.collapse();p.nodeChanged()}else{if(r.keyCode==13&&!r.shiftKey&&k.lastElm!="P"){t=p.dom.getParent(s,"p");if(t){m(t,l.element);p.nodeChanged()}}}})}}},find:function(p,l,m){var k=this.editor,j=k.getDoc().createTreeWalker(p,4,null,false),o=-1;while(p=j.nextNode()){o++;if(l==0&&p==m){return o}if(l==1&&o==m){return p}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType===3||(!u.dom.isBlock(G)&&G.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(G.nodeName))){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!c){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(n){return n===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);G.parentNode.replaceChild(l,G);l.appendChild(G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!c){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!c&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(k){var j=this.dom;return j.getParent(k,j.isBlock)},insertPara:function(N){var B=this,p=B.editor,J=p.dom,O=p.getDoc(),S=p.settings,C=p.selection.getSel(),D=C.getRangeAt(0),R=O.body;var G,H,E,L,K,m,k,o,u,j,z,Q,l,q,F,I=J.getViewPort(p.getWin()),x,A,w;G=O.createRange();G.setStart(C.anchorNode,C.anchorOffset);G.collapse(true);H=O.createRange();H.setStart(C.focusNode,C.focusOffset);H.collapse(true);E=G.compareBoundaryPoints(G.START_TO_END,H)<0;L=E?C.anchorNode:C.focusNode;K=E?C.anchorOffset:C.focusOffset;m=E?C.focusNode:C.anchorNode;k=E?C.focusOffset:C.anchorOffset;if(L===m&&/^(TD|TH)$/.test(L.nodeName)){if(L.firstChild.nodeName=="BR"){J.remove(L.firstChild)}if(L.childNodes.length==0){p.dom.add(L,S.element,null,"<br />");Q=p.dom.add(L,S.element,null,"<br />")}else{F=L.innerHTML;L.innerHTML="";p.dom.add(L,S.element,null,F);Q=p.dom.add(L,S.element,null,"<br />")}D=O.createRange();D.selectNodeContents(Q);D.collapse(1);p.selection.setRng(D);return false}if(L==R&&m==R&&R.firstChild&&p.dom.isBlock(R.firstChild)){L=m=L.firstChild;K=k=0;G=O.createRange();G.setStart(L,0);H=O.createRange();H.setStart(m,0)}L=L.nodeName=="HTML"?O.body:L;L=L.nodeName=="BODY"?L.firstChild:L;m=m.nodeName=="HTML"?O.body:m;m=m.nodeName=="BODY"?m.firstChild:m;o=B.getParentBlock(L);u=B.getParentBlock(m);j=o?o.nodeName:S.element;if(B.dom.getParent(o,"ol,ul,pre")){return true}if(o&&(o.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;o=null}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;u=null}if(/(TD|TABLE|TH|CAPTION)/.test(j)||(o&&j=="DIV"&&/left|right/gi.test(J.getStyle(o,"float",1)))){j=S.element;o=u=null}z=(o&&o.nodeName==j)?o.cloneNode(0):p.dom.create(j);Q=(u&&u.nodeName==j)?u.cloneNode(0):p.dom.create(j);Q.removeAttribute("id");if(/^(H[1-6])$/.test(j)&&e(D,o)){Q=p.dom.create(S.element)}F=l=L;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}l=F}while((F=F.previousSibling?F.previousSibling:F.parentNode));F=q=m;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}q=F}while((F=F.nextSibling?F.nextSibling:F.parentNode));if(l.nodeName==j){G.setStart(l,0)}else{G.setStartBefore(l)}G.setEnd(L,K);z.appendChild(G.cloneContents()||O.createTextNode(""));try{H.setEndAfter(q)}catch(M){}H.setStart(m,k);Q.appendChild(H.cloneContents()||O.createTextNode(""));D=O.createRange();if(!l.previousSibling&&l.parentNode.nodeName==j){D.setStartBefore(l.parentNode)}else{if(G.startContainer.nodeName==j&&G.startOffset==0){D.setStartBefore(G.startContainer)}else{D.setStart(G.startContainer,G.startOffset)}}if(!q.nextSibling&&q.parentNode.nodeName==j){D.setEndAfter(q.parentNode)}else{D.setEnd(H.endContainer,H.endOffset)}D.deleteContents();if(b){p.getWin().scrollTo(0,I.y)}if(z.firstChild&&z.firstChild.nodeName==j){z.innerHTML=z.firstChild.innerHTML}if(Q.firstChild&&Q.firstChild.nodeName==j){Q.innerHTML=Q.firstChild.innerHTML}if(d(z)){z.innerHTML="<br />"}function P(y,s){var r=[],U,T,t;y.innerHTML="";if(S.keep_styles){T=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(T.nodeName)){U=T.cloneNode(false);J.setAttrib(U,"id","");r.push(U)}}while(T=T.parentNode)}if(r.length>0){for(t=r.length-1,U=y;t>=0;t--){U=U.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(d(Q)){w=P(Q,m)}if(b&&parseFloat(opera.version())<9.5){D.insertNode(z);D.insertNode(Q)}else{D.insertNode(Q);D.insertNode(z)}Q.normalize();z.normalize();function v(r){return O.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}D=O.createRange();D.selectNodeContents(a?v(w||Q):w||Q);D.collapse(1);C.removeAllRanges();C.addRange(D);x=p.dom.getPos(Q).y;A=Q.clientHeight;if(x<I.y||x+A>I.y+I.h){p.getWin().scrollTo(0,x<I.y?x:x-I.h+25)}return false},backspaceDelete:function(o,x){var z=this,m=z.editor,s=m.getBody(),l=m.dom,k,p=m.selection,j=p.getRng(),q=j.startContainer,k,u,v;if(q&&m.dom.isBlock(q)&&!/^(TD|TH)$/.test(q.nodeName)&&x){if(q.childNodes.length==0||(q.childNodes.length==1&&q.firstChild.nodeName=="BR")){k=q;while((k=k.previousSibling)&&!m.dom.isBlock(k)){}if(k){if(q!=s.firstChild){u=m.dom.doc.createTreeWalker(k,NodeFilter.SHOW_TEXT,null,false);while(v=u.nextNode()){k=v}j=m.getDoc().createRange();j.setStart(k,k.nodeValue?k.nodeValue.length:0);j.setEnd(k,k.nodeValue?k.nodeValue.length:0);p.setRng(j);m.dom.remove(q)}return h.cancel(o)}}}function y(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(k=z.getParentBlock(n))){r=n.previousSibling;h.remove(s,"DOMNodeInserted",y);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){m.dom.remove(n)}}}h._add(s,"DOMNodeInserted",y);window.setTimeout(function(){h._remove(s,"DOMNodeInserted",y)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandEnabled(b)){throw"Error"}}catch(d){if(a.isGecko){c.windowManager.confirm(c.getLang("clipboard_msg"),function(f){if(f){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{c.windowManager.alert(c.getLang("clipboard_no_support"))}}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/tiny_mce_popup.js b/public/javascripts/tiny_mce/tiny_mce_popup.js deleted file mode 100644 index c9bf1fe..0000000 --- a/public/javascripts/tiny_mce/tiny_mce_popup.js +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | |||
| 2 | // Uncomment and change this document.domain value if you are loading the script cross subdomains | ||
| 3 | // document.domain = 'moxiecode.com'; | ||
| 4 | |||
| 5 | var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/tiny_mce_src.js b/public/javascripts/tiny_mce/tiny_mce_src.js deleted file mode 100644 index 3fe768b..0000000 --- a/public/javascripts/tiny_mce/tiny_mce_src.js +++ /dev/null | |||
| @@ -1,12428 +0,0 @@ | |||
| 1 | var tinymce = { | ||
| 2 | majorVersion : '3', | ||
| 3 | minorVersion : '2.7', | ||
| 4 | releaseDate : '2009-09-22', | ||
| 5 | |||
| 6 | _init : function() { | ||
| 7 | var t = this, d = document, w = window, na = navigator, ua = na.userAgent, i, nl, n, base, p, v; | ||
| 8 | |||
| 9 | t.isOpera = w.opera && opera.buildNumber; | ||
| 10 | |||
| 11 | t.isWebKit = /WebKit/.test(ua); | ||
| 12 | |||
| 13 | t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(na.appName); | ||
| 14 | |||
| 15 | t.isIE6 = t.isIE && /MSIE [56]/.test(ua); | ||
| 16 | |||
| 17 | t.isGecko = !t.isWebKit && /Gecko/.test(ua); | ||
| 18 | |||
| 19 | t.isMac = ua.indexOf('Mac') != -1; | ||
| 20 | |||
| 21 | t.isAir = /adobeair/i.test(ua); | ||
| 22 | |||
| 23 | // TinyMCE .NET webcontrol might be setting the values for TinyMCE | ||
| 24 | if (w.tinyMCEPreInit) { | ||
| 25 | t.suffix = tinyMCEPreInit.suffix; | ||
| 26 | t.baseURL = tinyMCEPreInit.base; | ||
| 27 | t.query = tinyMCEPreInit.query; | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | |||
| 31 | // Get suffix and base | ||
| 32 | t.suffix = ''; | ||
| 33 | |||
| 34 | // If base element found, add that infront of baseURL | ||
| 35 | nl = d.getElementsByTagName('base'); | ||
| 36 | for (i=0; i<nl.length; i++) { | ||
| 37 | if (v = nl[i].href) { | ||
| 38 | // Host only value like http://site.com or http://site.com:8008 | ||
| 39 | if (/^https?:\/\/[^\/]+$/.test(v)) | ||
| 40 | v += '/'; | ||
| 41 | |||
| 42 | base = v ? v.match(/.*\//)[0] : ''; // Get only directory | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | function getBase(n) { | ||
| 47 | if (n.src && /tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(n.src)) { | ||
| 48 | if (/_(src|dev)\.js/g.test(n.src)) | ||
| 49 | t.suffix = '_src'; | ||
| 50 | |||
| 51 | if ((p = n.src.indexOf('?')) != -1) | ||
| 52 | t.query = n.src.substring(p + 1); | ||
| 53 | |||
| 54 | t.baseURL = n.src.substring(0, n.src.lastIndexOf('/')); | ||
| 55 | |||
| 56 | // If path to script is relative and a base href was found add that one infront | ||
| 57 | // the src property will always be an absolute one on non IE browsers and IE 8 | ||
| 58 | // so this logic will basically only be executed on older IE versions | ||
| 59 | if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0) | ||
| 60 | t.baseURL = base + t.baseURL; | ||
| 61 | |||
| 62 | return t.baseURL; | ||
| 63 | } | ||
| 64 | |||
| 65 | return null; | ||
| 66 | }; | ||
| 67 | |||
| 68 | // Check document | ||
| 69 | nl = d.getElementsByTagName('script'); | ||
| 70 | for (i=0; i<nl.length; i++) { | ||
| 71 | if (getBase(nl[i])) | ||
| 72 | return; | ||
| 73 | } | ||
| 74 | |||
| 75 | // Check head | ||
| 76 | n = d.getElementsByTagName('head')[0]; | ||
| 77 | if (n) { | ||
| 78 | nl = n.getElementsByTagName('script'); | ||
| 79 | for (i=0; i<nl.length; i++) { | ||
| 80 | if (getBase(nl[i])) | ||
| 81 | return; | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | return; | ||
| 86 | }, | ||
| 87 | |||
| 88 | is : function(o, t) { | ||
| 89 | var n = typeof(o); | ||
| 90 | |||
| 91 | if (!t) | ||
| 92 | return n != 'undefined'; | ||
| 93 | |||
| 94 | if (t == 'array' && (o.hasOwnProperty && o instanceof Array)) | ||
| 95 | return true; | ||
| 96 | |||
| 97 | return n == t; | ||
| 98 | }, | ||
| 99 | |||
| 100 | each : function(o, cb, s) { | ||
| 101 | var n, l; | ||
| 102 | |||
| 103 | if (!o) | ||
| 104 | return 0; | ||
| 105 | |||
| 106 | s = s || o; | ||
| 107 | |||
| 108 | if (typeof(o.length) != 'undefined') { | ||
| 109 | // Indexed arrays, needed for Safari | ||
| 110 | for (n=0, l = o.length; n<l; n++) { | ||
| 111 | if (cb.call(s, o[n], n, o) === false) | ||
| 112 | return 0; | ||
| 113 | } | ||
| 114 | } else { | ||
| 115 | // Hashtables | ||
| 116 | for (n in o) { | ||
| 117 | if (o.hasOwnProperty(n)) { | ||
| 118 | if (cb.call(s, o[n], n, o) === false) | ||
| 119 | return 0; | ||
| 120 | } | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | return 1; | ||
| 125 | }, | ||
| 126 | |||
| 127 | |||
| 128 | trim : function(s) { | ||
| 129 | return (s ? '' + s : '').replace(/^\s*|\s*$/g, ''); | ||
| 130 | }, | ||
| 131 | |||
| 132 | create : function(s, p) { | ||
| 133 | var t = this, sp, ns, cn, scn, c, de = 0; | ||
| 134 | |||
| 135 | // Parse : <prefix> <class>:<super class> | ||
| 136 | s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); | ||
| 137 | cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name | ||
| 138 | |||
| 139 | // Create namespace for new class | ||
| 140 | ns = t.createNS(s[3].replace(/\.\w+$/, '')); | ||
| 141 | |||
| 142 | // Class already exists | ||
| 143 | if (ns[cn]) | ||
| 144 | return; | ||
| 145 | |||
| 146 | // Make pure static class | ||
| 147 | if (s[2] == 'static') { | ||
| 148 | ns[cn] = p; | ||
| 149 | |||
| 150 | if (this.onCreate) | ||
| 151 | this.onCreate(s[2], s[3], ns[cn]); | ||
| 152 | |||
| 153 | return; | ||
| 154 | } | ||
| 155 | |||
| 156 | // Create default constructor | ||
| 157 | if (!p[cn]) { | ||
| 158 | p[cn] = function() {}; | ||
| 159 | de = 1; | ||
| 160 | } | ||
| 161 | |||
| 162 | // Add constructor and methods | ||
| 163 | ns[cn] = p[cn]; | ||
| 164 | t.extend(ns[cn].prototype, p); | ||
| 165 | |||
| 166 | // Extend | ||
| 167 | if (s[5]) { | ||
| 168 | sp = t.resolve(s[5]).prototype; | ||
| 169 | scn = s[5].match(/\.(\w+)$/i)[1]; // Class name | ||
| 170 | |||
| 171 | // Extend constructor | ||
| 172 | c = ns[cn]; | ||
| 173 | if (de) { | ||
| 174 | // Add passthrough constructor | ||
| 175 | ns[cn] = function() { | ||
| 176 | return sp[scn].apply(this, arguments); | ||
| 177 | }; | ||
| 178 | } else { | ||
| 179 | // Add inherit constructor | ||
| 180 | ns[cn] = function() { | ||
| 181 | this.parent = sp[scn]; | ||
| 182 | return c.apply(this, arguments); | ||
| 183 | }; | ||
| 184 | } | ||
| 185 | ns[cn].prototype[cn] = ns[cn]; | ||
| 186 | |||
| 187 | // Add super methods | ||
| 188 | t.each(sp, function(f, n) { | ||
| 189 | ns[cn].prototype[n] = sp[n]; | ||
| 190 | }); | ||
| 191 | |||
| 192 | // Add overridden methods | ||
| 193 | t.each(p, function(f, n) { | ||
| 194 | // Extend methods if needed | ||
| 195 | if (sp[n]) { | ||
| 196 | ns[cn].prototype[n] = function() { | ||
| 197 | this.parent = sp[n]; | ||
| 198 | return f.apply(this, arguments); | ||
| 199 | }; | ||
| 200 | } else { | ||
| 201 | if (n != cn) | ||
| 202 | ns[cn].prototype[n] = f; | ||
| 203 | } | ||
| 204 | }); | ||
| 205 | } | ||
| 206 | |||
| 207 | // Add static methods | ||
| 208 | t.each(p['static'], function(f, n) { | ||
| 209 | ns[cn][n] = f; | ||
| 210 | }); | ||
| 211 | |||
| 212 | if (this.onCreate) | ||
| 213 | this.onCreate(s[2], s[3], ns[cn].prototype); | ||
| 214 | }, | ||
| 215 | |||
| 216 | walk : function(o, f, n, s) { | ||
| 217 | s = s || this; | ||
| 218 | |||
| 219 | if (o) { | ||
| 220 | if (n) | ||
| 221 | o = o[n]; | ||
| 222 | |||
| 223 | tinymce.each(o, function(o, i) { | ||
| 224 | if (f.call(s, o, i, n) === false) | ||
| 225 | return false; | ||
| 226 | |||
| 227 | tinymce.walk(o, f, n, s); | ||
| 228 | }); | ||
| 229 | } | ||
| 230 | }, | ||
| 231 | |||
| 232 | createNS : function(n, o) { | ||
| 233 | var i, v; | ||
| 234 | |||
| 235 | o = o || window; | ||
| 236 | |||
| 237 | n = n.split('.'); | ||
| 238 | for (i=0; i<n.length; i++) { | ||
| 239 | v = n[i]; | ||
| 240 | |||
| 241 | if (!o[v]) | ||
| 242 | o[v] = {}; | ||
| 243 | |||
| 244 | o = o[v]; | ||
| 245 | } | ||
| 246 | |||
| 247 | return o; | ||
| 248 | }, | ||
| 249 | |||
| 250 | resolve : function(n, o) { | ||
| 251 | var i, l; | ||
| 252 | |||
| 253 | o = o || window; | ||
| 254 | |||
| 255 | n = n.split('.'); | ||
| 256 | for (i = 0, l = n.length; i < l; i++) { | ||
| 257 | o = o[n[i]]; | ||
| 258 | |||
| 259 | if (!o) | ||
| 260 | break; | ||
| 261 | } | ||
| 262 | |||
| 263 | return o; | ||
| 264 | }, | ||
| 265 | |||
| 266 | addUnload : function(f, s) { | ||
| 267 | var t = this, w = window; | ||
| 268 | |||
| 269 | f = {func : f, scope : s || this}; | ||
| 270 | |||
| 271 | if (!t.unloads) { | ||
| 272 | function unload() { | ||
| 273 | var li = t.unloads, o, n; | ||
| 274 | |||
| 275 | if (li) { | ||
| 276 | // Call unload handlers | ||
| 277 | for (n in li) { | ||
| 278 | o = li[n]; | ||
| 279 | |||
| 280 | if (o && o.func) | ||
| 281 | o.func.call(o.scope, 1); // Send in one arg to distinct unload and user destroy | ||
| 282 | } | ||
| 283 | |||
| 284 | // Detach unload function | ||
| 285 | if (w.detachEvent) { | ||
| 286 | w.detachEvent('onbeforeunload', fakeUnload); | ||
| 287 | w.detachEvent('onunload', unload); | ||
| 288 | } else if (w.removeEventListener) | ||
| 289 | w.removeEventListener('unload', unload, false); | ||
| 290 | |||
| 291 | // Destroy references | ||
| 292 | t.unloads = o = li = w = unload = 0; | ||
| 293 | |||
| 294 | // Run garbarge collector on IE | ||
| 295 | if (window.CollectGarbage) | ||
| 296 | window.CollectGarbage(); | ||
| 297 | } | ||
| 298 | }; | ||
| 299 | |||
| 300 | function fakeUnload() { | ||
| 301 | var d = document; | ||
| 302 | |||
| 303 | // Is there things still loading, then do some magic | ||
| 304 | if (d.readyState == 'interactive') { | ||
| 305 | function stop() { | ||
| 306 | // Prevent memory leak | ||
| 307 | d.detachEvent('onstop', stop); | ||
| 308 | |||
| 309 | // Call unload handler | ||
| 310 | if (unload) | ||
| 311 | unload(); | ||
| 312 | |||
| 313 | d = 0; | ||
| 314 | }; | ||
| 315 | |||
| 316 | // Fire unload when the currently loading page is stopped | ||
| 317 | if (d) | ||
| 318 | d.attachEvent('onstop', stop); | ||
| 319 | |||
| 320 | // Remove onstop listener after a while to prevent the unload function | ||
| 321 | // to execute if the user presses cancel in an onbeforeunload | ||
| 322 | // confirm dialog and then presses the browser stop button | ||
| 323 | window.setTimeout(function() { | ||
| 324 | if (d) | ||
| 325 | d.detachEvent('onstop', stop); | ||
| 326 | }, 0); | ||
| 327 | } | ||
| 328 | }; | ||
| 329 | |||
| 330 | // Attach unload handler | ||
| 331 | if (w.attachEvent) { | ||
| 332 | w.attachEvent('onunload', unload); | ||
| 333 | w.attachEvent('onbeforeunload', fakeUnload); | ||
| 334 | } else if (w.addEventListener) | ||
| 335 | w.addEventListener('unload', unload, false); | ||
| 336 | |||
| 337 | // Setup initial unload handler array | ||
| 338 | t.unloads = [f]; | ||
| 339 | } else | ||
| 340 | t.unloads.push(f); | ||
| 341 | |||
| 342 | return f; | ||
| 343 | }, | ||
| 344 | |||
| 345 | removeUnload : function(f) { | ||
| 346 | var u = this.unloads, r = null; | ||
| 347 | |||
| 348 | tinymce.each(u, function(o, i) { | ||
| 349 | if (o && o.func == f) { | ||
| 350 | u.splice(i, 1); | ||
| 351 | r = f; | ||
| 352 | return false; | ||
| 353 | } | ||
| 354 | }); | ||
| 355 | |||
| 356 | return r; | ||
| 357 | }, | ||
| 358 | |||
| 359 | explode : function(s, d) { | ||
| 360 | return s ? tinymce.map(s.split(d || ','), tinymce.trim) : s; | ||
| 361 | }, | ||
| 362 | |||
| 363 | _addVer : function(u) { | ||
| 364 | var v; | ||
| 365 | |||
| 366 | if (!this.query) | ||
| 367 | return u; | ||
| 368 | |||
| 369 | v = (u.indexOf('?') == -1 ? '?' : '&') + this.query; | ||
| 370 | |||
| 371 | if (u.indexOf('#') == -1) | ||
| 372 | return u + v; | ||
| 373 | |||
| 374 | return u.replace('#', v + '#'); | ||
| 375 | } | ||
| 376 | |||
| 377 | }; | ||
| 378 | |||
| 379 | // Required for GZip AJAX loading | ||
| 380 | window.tinymce = tinymce; | ||
| 381 | |||
| 382 | // Initialize the API | ||
| 383 | tinymce._init(); | ||
| 384 | |||
| 385 | (function($, tinymce) { | ||
| 386 | var is = tinymce.is; | ||
| 387 | |||
| 388 | if (!window.jQuery) | ||
| 389 | return alert("Load jQuery first!"); | ||
| 390 | |||
| 391 | // Patch in core NS functions | ||
| 392 | tinymce.extend = $.extend; | ||
| 393 | tinymce.extend(tinymce, { | ||
| 394 | map : $.map, | ||
| 395 | grep : function(a, f) {return $.grep(a, f || function(){return 1;});}, | ||
| 396 | inArray : function(a, v) {return $.inArray(v, a || []);} | ||
| 397 | |||
| 398 | /* Didn't iterate stylesheets | ||
| 399 | each : function(o, cb, s) { | ||
| 400 | if (!o) | ||
| 401 | return 0; | ||
| 402 | |||
| 403 | var r = 1; | ||
| 404 | |||
| 405 | $.each(o, function(nr, el){ | ||
| 406 | if (cb.call(s, el, nr, o) === false) { | ||
| 407 | r = 0; | ||
| 408 | return false; | ||
| 409 | } | ||
| 410 | }); | ||
| 411 | |||
| 412 | return r; | ||
| 413 | }*/ | ||
| 414 | }); | ||
| 415 | |||
| 416 | // Patch in functions in various clases | ||
| 417 | // Add a "#ifndefjquery" statement around each core API function you add below | ||
| 418 | var patches = { | ||
| 419 | 'tinymce.dom.DOMUtils' : { | ||
| 420 | /* | ||
| 421 | addClass : function(e, c) { | ||
| 422 | if (is(e, 'array') && is(e[0], 'string')) | ||
| 423 | e = e.join(',#'); | ||
| 424 | return (e && $(is(e, 'string') ? '#' + e : e) | ||
| 425 | .addClass(c) | ||
| 426 | .attr('class')) || false; | ||
| 427 | }, | ||
| 428 | |||
| 429 | hasClass : function(n, c) { | ||
| 430 | return $(is(n, 'string') ? '#' + n : n).hasClass(c); | ||
| 431 | }, | ||
| 432 | |||
| 433 | removeClass : function(e, c) { | ||
| 434 | if (!e) | ||
| 435 | return false; | ||
| 436 | |||
| 437 | var r = []; | ||
| 438 | |||
| 439 | $(is(e, 'string') ? '#' + e : e) | ||
| 440 | .removeClass(c) | ||
| 441 | .each(function(){ | ||
| 442 | r.push(this.className); | ||
| 443 | }); | ||
| 444 | |||
| 445 | return r.length == 1 ? r[0] : r; | ||
| 446 | }, | ||
| 447 | */ | ||
| 448 | |||
| 449 | select : function(pattern, scope) { | ||
| 450 | var t = this; | ||
| 451 | |||
| 452 | return $.find(pattern, t.get(scope) || t.get(t.settings.root_element) || t.doc, []); | ||
| 453 | }, | ||
| 454 | |||
| 455 | is : function(n, patt) { | ||
| 456 | return $(this.get(n)).is(patt); | ||
| 457 | } | ||
| 458 | |||
| 459 | /* | ||
| 460 | show : function(e) { | ||
| 461 | if (is(e, 'array') && is(e[0], 'string')) | ||
| 462 | e = e.join(',#'); | ||
| 463 | |||
| 464 | $(is(e, 'string') ? '#' + e : e).css('display', 'block'); | ||
| 465 | }, | ||
| 466 | |||
| 467 | hide : function(e) { | ||
| 468 | if (is(e, 'array') && is(e[0], 'string')) | ||
| 469 | e = e.join(',#'); | ||
| 470 | |||
| 471 | $(is(e, 'string') ? '#' + e : e).css('display', 'none'); | ||
| 472 | }, | ||
| 473 | |||
| 474 | isHidden : function(e) { | ||
| 475 | return $(is(e, 'string') ? '#' + e : e).is(':hidden'); | ||
| 476 | }, | ||
| 477 | |||
| 478 | insertAfter : function(n, e) { | ||
| 479 | return $(is(e, 'string') ? '#' + e : e).after(n); | ||
| 480 | }, | ||
| 481 | |||
| 482 | replace : function(o, n, k) { | ||
| 483 | n = $(is(n, 'string') ? '#' + n : n); | ||
| 484 | |||
| 485 | if (k) | ||
| 486 | n.children().appendTo(o); | ||
| 487 | |||
| 488 | n.replaceWith(o); | ||
| 489 | }, | ||
| 490 | |||
| 491 | setStyle : function(n, na, v) { | ||
| 492 | if (is(n, 'array') && is(n[0], 'string')) | ||
| 493 | n = n.join(',#'); | ||
| 494 | |||
| 495 | $(is(n, 'string') ? '#' + n : n).css(na, v); | ||
| 496 | }, | ||
| 497 | |||
| 498 | getStyle : function(n, na, c) { | ||
| 499 | return $(is(n, 'string') ? '#' + n : n).css(na); | ||
| 500 | }, | ||
| 501 | |||
| 502 | setStyles : function(e, o) { | ||
| 503 | if (is(e, 'array') && is(e[0], 'string')) | ||
| 504 | e = e.join(',#'); | ||
| 505 | $(is(e, 'string') ? '#' + e : e).css(o); | ||
| 506 | }, | ||
| 507 | |||
| 508 | setAttrib : function(e, n, v) { | ||
| 509 | var t = this, s = t.settings; | ||
| 510 | |||
| 511 | if (is(e, 'array') && is(e[0], 'string')) | ||
| 512 | e = e.join(',#'); | ||
| 513 | |||
| 514 | e = $(is(e, 'string') ? '#' + e : e); | ||
| 515 | |||
| 516 | switch (n) { | ||
| 517 | case "style": | ||
| 518 | e.each(function(i, v){ | ||
| 519 | if (s.keep_values) | ||
| 520 | $(v).attr('mce_style', v); | ||
| 521 | |||
| 522 | v.style.cssText = v; | ||
| 523 | }); | ||
| 524 | break; | ||
| 525 | |||
| 526 | case "class": | ||
| 527 | e.each(function(){ | ||
| 528 | this.className = v; | ||
| 529 | }); | ||
| 530 | break; | ||
| 531 | |||
| 532 | case "src": | ||
| 533 | case "href": | ||
| 534 | e.each(function(i, v){ | ||
| 535 | if (s.keep_values) { | ||
| 536 | if (s.url_converter) | ||
| 537 | v = s.url_converter.call(s.url_converter_scope || t, v, n, v); | ||
| 538 | |||
| 539 | t.setAttrib(v, 'mce_' + n, v); | ||
| 540 | } | ||
| 541 | }); | ||
| 542 | |||
| 543 | break; | ||
| 544 | } | ||
| 545 | |||
| 546 | if (v !== null && v.length !== 0) | ||
| 547 | e.attr(n, '' + v); | ||
| 548 | else | ||
| 549 | e.removeAttr(n); | ||
| 550 | }, | ||
| 551 | |||
| 552 | setAttribs : function(e, o) { | ||
| 553 | var t = this; | ||
| 554 | |||
| 555 | $.each(o, function(n, v){ | ||
| 556 | t.setAttrib(e,n,v); | ||
| 557 | }); | ||
| 558 | } | ||
| 559 | */ | ||
| 560 | } | ||
| 561 | |||
| 562 | /* | ||
| 563 | 'tinymce.dom.Event' : { | ||
| 564 | add : function (o, n, f, s) { | ||
| 565 | var lo, cb; | ||
| 566 | |||
| 567 | cb = function(e) { | ||
| 568 | e.target = e.target || this; | ||
| 569 | f.call(s || this, e); | ||
| 570 | }; | ||
| 571 | |||
| 572 | if (is(o, 'array') && is(o[0], 'string')) | ||
| 573 | o = o.join(',#'); | ||
| 574 | o = $(is(o, 'string') ? '#' + o : o); | ||
| 575 | if (n == 'init') { | ||
| 576 | o.ready(cb, s); | ||
| 577 | } else { | ||
| 578 | if (s) { | ||
| 579 | o.bind(n, s, cb); | ||
| 580 | } else { | ||
| 581 | o.bind(n, cb); | ||
| 582 | } | ||
| 583 | } | ||
| 584 | |||
| 585 | lo = this._jqLookup || (this._jqLookup = []); | ||
| 586 | lo.push({func : f, cfunc : cb}); | ||
| 587 | |||
| 588 | return cb; | ||
| 589 | }, | ||
| 590 | |||
| 591 | remove : function(o, n, f) { | ||
| 592 | // Find cfunc | ||
| 593 | $(this._jqLookup).each(function() { | ||
| 594 | if (this.func === f) | ||
| 595 | f = this.cfunc; | ||
| 596 | }); | ||
| 597 | |||
| 598 | if (is(o, 'array') && is(o[0], 'string')) | ||
| 599 | o = o.join(',#'); | ||
| 600 | |||
| 601 | $(is(o, 'string') ? '#' + o : o).unbind(n,f); | ||
| 602 | |||
| 603 | return true; | ||
| 604 | } | ||
| 605 | } | ||
| 606 | */ | ||
| 607 | }; | ||
| 608 | |||
| 609 | // Patch functions after a class is created | ||
| 610 | tinymce.onCreate = function(ty, c, p) { | ||
| 611 | tinymce.extend(p, patches[c]); | ||
| 612 | }; | ||
| 613 | })(jQuery, tinymce); | ||
| 614 | |||
| 615 | tinymce.create('tinymce.util.Dispatcher', { | ||
| 616 | scope : null, | ||
| 617 | listeners : null, | ||
| 618 | |||
| 619 | Dispatcher : function(s) { | ||
| 620 | this.scope = s || this; | ||
| 621 | this.listeners = []; | ||
| 622 | }, | ||
| 623 | |||
| 624 | add : function(cb, s) { | ||
| 625 | this.listeners.push({cb : cb, scope : s || this.scope}); | ||
| 626 | |||
| 627 | return cb; | ||
| 628 | }, | ||
| 629 | |||
| 630 | addToTop : function(cb, s) { | ||
| 631 | this.listeners.unshift({cb : cb, scope : s || this.scope}); | ||
| 632 | |||
| 633 | return cb; | ||
| 634 | }, | ||
| 635 | |||
| 636 | remove : function(cb) { | ||
| 637 | var l = this.listeners, o = null; | ||
| 638 | |||
| 639 | tinymce.each(l, function(c, i) { | ||
| 640 | if (cb == c.cb) { | ||
| 641 | o = cb; | ||
| 642 | l.splice(i, 1); | ||
| 643 | return false; | ||
| 644 | } | ||
| 645 | }); | ||
| 646 | |||
| 647 | return o; | ||
| 648 | }, | ||
| 649 | |||
| 650 | dispatch : function() { | ||
| 651 | var s, a = arguments, i, li = this.listeners, c; | ||
| 652 | |||
| 653 | // Needs to be a real loop since the listener count might change while looping | ||
| 654 | // And this is also more efficient | ||
| 655 | for (i = 0; i<li.length; i++) { | ||
| 656 | c = li[i]; | ||
| 657 | s = c.cb.apply(c.scope, a); | ||
| 658 | |||
| 659 | if (s === false) | ||
| 660 | break; | ||
| 661 | } | ||
| 662 | |||
| 663 | return s; | ||
| 664 | } | ||
| 665 | |||
| 666 | }); | ||
| 667 | (function() { | ||
| 668 | var each = tinymce.each; | ||
| 669 | |||
| 670 | tinymce.create('tinymce.util.URI', { | ||
| 671 | URI : function(u, s) { | ||
| 672 | var t = this, o, a, b; | ||
| 673 | |||
| 674 | // Trim whitespace | ||
| 675 | u = tinymce.trim(u); | ||
| 676 | |||
| 677 | // Default settings | ||
| 678 | s = t.settings = s || {}; | ||
| 679 | |||
| 680 | // Strange app protocol or local anchor | ||
| 681 | if (/^(mailto|tel|news|javascript|about|data):/i.test(u) || /^\s*#/.test(u)) { | ||
| 682 | t.source = u; | ||
| 683 | return; | ||
| 684 | } | ||
| 685 | |||
| 686 | // Absolute path with no host, fake host and protocol | ||
| 687 | if (u.indexOf('/') === 0 && u.indexOf('//') !== 0) | ||
| 688 | u = (s.base_uri ? s.base_uri.protocol || 'http' : 'http') + '://mce_host' + u; | ||
| 689 | |||
| 690 | // Relative path http:// or protocol relative //path | ||
| 691 | if (!/^\w*:?\/\//.test(u)) | ||
| 692 | u = (s.base_uri.protocol || 'http') + '://mce_host' + t.toAbsPath(s.base_uri.path, u); | ||
| 693 | |||
| 694 | // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) | ||
| 695 | u = u.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something | ||
| 696 | u = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(u); | ||
| 697 | each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { | ||
| 698 | var s = u[i]; | ||
| 699 | |||
| 700 | // Zope 3 workaround, they use @@something | ||
| 701 | if (s) | ||
| 702 | s = s.replace(/\(mce_at\)/g, '@@'); | ||
| 703 | |||
| 704 | t[v] = s; | ||
| 705 | }); | ||
| 706 | |||
| 707 | if (b = s.base_uri) { | ||
| 708 | if (!t.protocol) | ||
| 709 | t.protocol = b.protocol; | ||
| 710 | |||
| 711 | if (!t.userInfo) | ||
| 712 | t.userInfo = b.userInfo; | ||
| 713 | |||
| 714 | if (!t.port && t.host == 'mce_host') | ||
| 715 | t.port = b.port; | ||
| 716 | |||
| 717 | if (!t.host || t.host == 'mce_host') | ||
| 718 | t.host = b.host; | ||
| 719 | |||
| 720 | t.source = ''; | ||
| 721 | } | ||
| 722 | |||
| 723 | //t.path = t.path || '/'; | ||
| 724 | }, | ||
| 725 | |||
| 726 | setPath : function(p) { | ||
| 727 | var t = this; | ||
| 728 | |||
| 729 | p = /^(.*?)\/?(\w+)?$/.exec(p); | ||
| 730 | |||
| 731 | // Update path parts | ||
| 732 | t.path = p[0]; | ||
| 733 | t.directory = p[1]; | ||
| 734 | t.file = p[2]; | ||
| 735 | |||
| 736 | // Rebuild source | ||
| 737 | t.source = ''; | ||
| 738 | t.getURI(); | ||
| 739 | }, | ||
| 740 | |||
| 741 | toRelative : function(u) { | ||
| 742 | var t = this, o; | ||
| 743 | |||
| 744 | if (u === "./") | ||
| 745 | return u; | ||
| 746 | |||
| 747 | u = new tinymce.util.URI(u, {base_uri : t}); | ||
| 748 | |||
| 749 | // Not on same domain/port or protocol | ||
| 750 | if ((u.host != 'mce_host' && t.host != u.host && u.host) || t.port != u.port || t.protocol != u.protocol) | ||
| 751 | return u.getURI(); | ||
| 752 | |||
| 753 | o = t.toRelPath(t.path, u.path); | ||
| 754 | |||
| 755 | // Add query | ||
| 756 | if (u.query) | ||
| 757 | o += '?' + u.query; | ||
| 758 | |||
| 759 | // Add anchor | ||
| 760 | if (u.anchor) | ||
| 761 | o += '#' + u.anchor; | ||
| 762 | |||
| 763 | return o; | ||
| 764 | }, | ||
| 765 | |||
| 766 | toAbsolute : function(u, nh) { | ||
| 767 | var u = new tinymce.util.URI(u, {base_uri : this}); | ||
| 768 | |||
| 769 | return u.getURI(this.host == u.host && this.protocol == u.protocol ? nh : 0); | ||
| 770 | }, | ||
| 771 | |||
| 772 | toRelPath : function(base, path) { | ||
| 773 | var items, bp = 0, out = '', i, l; | ||
| 774 | |||
| 775 | // Split the paths | ||
| 776 | base = base.substring(0, base.lastIndexOf('/')); | ||
| 777 | base = base.split('/'); | ||
| 778 | items = path.split('/'); | ||
| 779 | |||
| 780 | if (base.length >= items.length) { | ||
| 781 | for (i = 0, l = base.length; i < l; i++) { | ||
| 782 | if (i >= items.length || base[i] != items[i]) { | ||
| 783 | bp = i + 1; | ||
| 784 | break; | ||
| 785 | } | ||
| 786 | } | ||
| 787 | } | ||
| 788 | |||
| 789 | if (base.length < items.length) { | ||
| 790 | for (i = 0, l = items.length; i < l; i++) { | ||
| 791 | if (i >= base.length || base[i] != items[i]) { | ||
| 792 | bp = i + 1; | ||
| 793 | break; | ||
| 794 | } | ||
| 795 | } | ||
| 796 | } | ||
| 797 | |||
| 798 | if (bp == 1) | ||
| 799 | return path; | ||
| 800 | |||
| 801 | for (i = 0, l = base.length - (bp - 1); i < l; i++) | ||
| 802 | out += "../"; | ||
| 803 | |||
| 804 | for (i = bp - 1, l = items.length; i < l; i++) { | ||
| 805 | if (i != bp - 1) | ||
| 806 | out += "/" + items[i]; | ||
| 807 | else | ||
| 808 | out += items[i]; | ||
| 809 | } | ||
| 810 | |||
| 811 | return out; | ||
| 812 | }, | ||
| 813 | |||
| 814 | toAbsPath : function(base, path) { | ||
| 815 | var i, nb = 0, o = [], tr, outPath; | ||
| 816 | |||
| 817 | // Split paths | ||
| 818 | tr = /\/$/.test(path) ? '/' : ''; | ||
| 819 | base = base.split('/'); | ||
| 820 | path = path.split('/'); | ||
| 821 | |||
| 822 | // Remove empty chunks | ||
| 823 | each(base, function(k) { | ||
| 824 | if (k) | ||
| 825 | o.push(k); | ||
| 826 | }); | ||
| 827 | |||
| 828 | base = o; | ||
| 829 | |||
| 830 | // Merge relURLParts chunks | ||
| 831 | for (i = path.length - 1, o = []; i >= 0; i--) { | ||
| 832 | // Ignore empty or . | ||
| 833 | if (path[i].length == 0 || path[i] == ".") | ||
| 834 | continue; | ||
| 835 | |||
| 836 | // Is parent | ||
| 837 | if (path[i] == '..') { | ||
| 838 | nb++; | ||
| 839 | continue; | ||
| 840 | } | ||
| 841 | |||
| 842 | // Move up | ||
| 843 | if (nb > 0) { | ||
| 844 | nb--; | ||
| 845 | continue; | ||
| 846 | } | ||
| 847 | |||
| 848 | o.push(path[i]); | ||
| 849 | } | ||
| 850 | |||
| 851 | i = base.length - nb; | ||
| 852 | |||
| 853 | // If /a/b/c or / | ||
| 854 | if (i <= 0) | ||
| 855 | outPath = o.reverse().join('/'); | ||
| 856 | else | ||
| 857 | outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); | ||
| 858 | |||
| 859 | // Add front / if it's needed | ||
| 860 | if (outPath.indexOf('/') !== 0) | ||
| 861 | outPath = '/' + outPath; | ||
| 862 | |||
| 863 | // Add traling / if it's needed | ||
| 864 | if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) | ||
| 865 | outPath += tr; | ||
| 866 | |||
| 867 | return outPath; | ||
| 868 | }, | ||
| 869 | |||
| 870 | getURI : function(nh) { | ||
| 871 | var s, t = this; | ||
| 872 | |||
| 873 | // Rebuild source | ||
| 874 | if (!t.source || nh) { | ||
| 875 | s = ''; | ||
| 876 | |||
| 877 | if (!nh) { | ||
| 878 | if (t.protocol) | ||
| 879 | s += t.protocol + '://'; | ||
| 880 | |||
| 881 | if (t.userInfo) | ||
| 882 | s += t.userInfo + '@'; | ||
| 883 | |||
| 884 | if (t.host) | ||
| 885 | s += t.host; | ||
| 886 | |||
| 887 | if (t.port) | ||
| 888 | s += ':' + t.port; | ||
| 889 | } | ||
| 890 | |||
| 891 | if (t.path) | ||
| 892 | s += t.path; | ||
| 893 | |||
| 894 | if (t.query) | ||
| 895 | s += '?' + t.query; | ||
| 896 | |||
| 897 | if (t.anchor) | ||
| 898 | s += '#' + t.anchor; | ||
| 899 | |||
| 900 | t.source = s; | ||
| 901 | } | ||
| 902 | |||
| 903 | return t.source; | ||
| 904 | } | ||
| 905 | }); | ||
| 906 | })(); | ||
| 907 | (function() { | ||
| 908 | var each = tinymce.each; | ||
| 909 | |||
| 910 | tinymce.create('static tinymce.util.Cookie', { | ||
| 911 | getHash : function(n) { | ||
| 912 | var v = this.get(n), h; | ||
| 913 | |||
| 914 | if (v) { | ||
| 915 | each(v.split('&'), function(v) { | ||
| 916 | v = v.split('='); | ||
| 917 | h = h || {}; | ||
| 918 | h[unescape(v[0])] = unescape(v[1]); | ||
| 919 | }); | ||
| 920 | } | ||
| 921 | |||
| 922 | return h; | ||
| 923 | }, | ||
| 924 | |||
| 925 | setHash : function(n, v, e, p, d, s) { | ||
| 926 | var o = ''; | ||
| 927 | |||
| 928 | each(v, function(v, k) { | ||
| 929 | o += (!o ? '' : '&') + escape(k) + '=' + escape(v); | ||
| 930 | }); | ||
| 931 | |||
| 932 | this.set(n, o, e, p, d, s); | ||
| 933 | }, | ||
| 934 | |||
| 935 | get : function(n) { | ||
| 936 | var c = document.cookie, e, p = n + "=", b; | ||
| 937 | |||
| 938 | // Strict mode | ||
| 939 | if (!c) | ||
| 940 | return; | ||
| 941 | |||
| 942 | b = c.indexOf("; " + p); | ||
| 943 | |||
| 944 | if (b == -1) { | ||
| 945 | b = c.indexOf(p); | ||
| 946 | |||
| 947 | if (b != 0) | ||
| 948 | return null; | ||
| 949 | } else | ||
| 950 | b += 2; | ||
| 951 | |||
| 952 | e = c.indexOf(";", b); | ||
| 953 | |||
| 954 | if (e == -1) | ||
| 955 | e = c.length; | ||
| 956 | |||
| 957 | return unescape(c.substring(b + p.length, e)); | ||
| 958 | }, | ||
| 959 | |||
| 960 | set : function(n, v, e, p, d, s) { | ||
| 961 | document.cookie = n + "=" + escape(v) + | ||
| 962 | ((e) ? "; expires=" + e.toGMTString() : "") + | ||
| 963 | ((p) ? "; path=" + escape(p) : "") + | ||
| 964 | ((d) ? "; domain=" + d : "") + | ||
| 965 | ((s) ? "; secure" : ""); | ||
| 966 | }, | ||
| 967 | |||
| 968 | remove : function(n, p) { | ||
| 969 | var d = new Date(); | ||
| 970 | |||
| 971 | d.setTime(d.getTime() - 1000); | ||
| 972 | |||
| 973 | this.set(n, '', d, p, d); | ||
| 974 | } | ||
| 975 | }); | ||
| 976 | })(); | ||
| 977 | tinymce.create('static tinymce.util.JSON', { | ||
| 978 | serialize : function(o) { | ||
| 979 | var i, v, s = tinymce.util.JSON.serialize, t; | ||
| 980 | |||
| 981 | if (o == null) | ||
| 982 | return 'null'; | ||
| 983 | |||
| 984 | t = typeof o; | ||
| 985 | |||
| 986 | if (t == 'string') { | ||
| 987 | v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; | ||
| 988 | |||
| 989 | return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) { | ||
| 990 | i = v.indexOf(b); | ||
| 991 | |||
| 992 | if (i + 1) | ||
| 993 | return '\\' + v.charAt(i + 1); | ||
| 994 | |||
| 995 | a = b.charCodeAt().toString(16); | ||
| 996 | |||
| 997 | return '\\u' + '0000'.substring(a.length) + a; | ||
| 998 | }) + '"'; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | if (t == 'object') { | ||
| 1002 | if (o.hasOwnProperty && o instanceof Array) { | ||
| 1003 | for (i=0, v = '['; i<o.length; i++) | ||
| 1004 | v += (i > 0 ? ',' : '') + s(o[i]); | ||
| 1005 | |||
| 1006 | return v + ']'; | ||
| 1007 | } | ||
| 1008 | |||
| 1009 | v = '{'; | ||
| 1010 | |||
| 1011 | for (i in o) | ||
| 1012 | v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; | ||
| 1013 | |||
| 1014 | return v + '}'; | ||
| 1015 | } | ||
| 1016 | |||
| 1017 | return '' + o; | ||
| 1018 | }, | ||
| 1019 | |||
| 1020 | parse : function(s) { | ||
| 1021 | try { | ||
| 1022 | return eval('(' + s + ')'); | ||
| 1023 | } catch (ex) { | ||
| 1024 | // Ignore | ||
| 1025 | } | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | }); | ||
| 1029 | tinymce.create('static tinymce.util.XHR', { | ||
| 1030 | send : function(o) { | ||
| 1031 | var x, t, w = window, c = 0; | ||
| 1032 | |||
| 1033 | // Default settings | ||
| 1034 | o.scope = o.scope || this; | ||
| 1035 | o.success_scope = o.success_scope || o.scope; | ||
| 1036 | o.error_scope = o.error_scope || o.scope; | ||
| 1037 | o.async = o.async === false ? false : true; | ||
| 1038 | o.data = o.data || ''; | ||
| 1039 | |||
| 1040 | function get(s) { | ||
| 1041 | x = 0; | ||
| 1042 | |||
| 1043 | try { | ||
| 1044 | x = new ActiveXObject(s); | ||
| 1045 | } catch (ex) { | ||
| 1046 | } | ||
| 1047 | |||
| 1048 | return x; | ||
| 1049 | }; | ||
| 1050 | |||
| 1051 | x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); | ||
| 1052 | |||
| 1053 | if (x) { | ||
| 1054 | if (x.overrideMimeType) | ||
| 1055 | x.overrideMimeType(o.content_type); | ||
| 1056 | |||
| 1057 | x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); | ||
| 1058 | |||
| 1059 | if (o.content_type) | ||
| 1060 | x.setRequestHeader('Content-Type', o.content_type); | ||
| 1061 | |||
| 1062 | x.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); | ||
| 1063 | |||
| 1064 | x.send(o.data); | ||
| 1065 | |||
| 1066 | function ready() { | ||
| 1067 | if (!o.async || x.readyState == 4 || c++ > 10000) { | ||
| 1068 | if (o.success && c < 10000 && x.status == 200) | ||
| 1069 | o.success.call(o.success_scope, '' + x.responseText, x, o); | ||
| 1070 | else if (o.error) | ||
| 1071 | o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); | ||
| 1072 | |||
| 1073 | x = null; | ||
| 1074 | } else | ||
| 1075 | w.setTimeout(ready, 10); | ||
| 1076 | }; | ||
| 1077 | |||
| 1078 | // Syncronous request | ||
| 1079 | if (!o.async) | ||
| 1080 | return ready(); | ||
| 1081 | |||
| 1082 | // Wait for response, onReadyStateChange can not be used since it leaks memory in IE | ||
| 1083 | t = w.setTimeout(ready, 10); | ||
| 1084 | } | ||
| 1085 | } | ||
| 1086 | }); | ||
| 1087 | (function() { | ||
| 1088 | var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; | ||
| 1089 | |||
| 1090 | tinymce.create('tinymce.util.JSONRequest', { | ||
| 1091 | JSONRequest : function(s) { | ||
| 1092 | this.settings = extend({ | ||
| 1093 | }, s); | ||
| 1094 | this.count = 0; | ||
| 1095 | }, | ||
| 1096 | |||
| 1097 | send : function(o) { | ||
| 1098 | var ecb = o.error, scb = o.success; | ||
| 1099 | |||
| 1100 | o = extend(this.settings, o); | ||
| 1101 | |||
| 1102 | o.success = function(c, x) { | ||
| 1103 | c = JSON.parse(c); | ||
| 1104 | |||
| 1105 | if (typeof(c) == 'undefined') { | ||
| 1106 | c = { | ||
| 1107 | error : 'JSON Parse error.' | ||
| 1108 | }; | ||
| 1109 | } | ||
| 1110 | |||
| 1111 | if (c.error) | ||
| 1112 | ecb.call(o.error_scope || o.scope, c.error, x); | ||
| 1113 | else | ||
| 1114 | scb.call(o.success_scope || o.scope, c.result); | ||
| 1115 | }; | ||
| 1116 | |||
| 1117 | o.error = function(ty, x) { | ||
| 1118 | ecb.call(o.error_scope || o.scope, ty, x); | ||
| 1119 | }; | ||
| 1120 | |||
| 1121 | o.data = JSON.serialize({ | ||
| 1122 | id : o.id || 'c' + (this.count++), | ||
| 1123 | method : o.method, | ||
| 1124 | params : o.params | ||
| 1125 | }); | ||
| 1126 | |||
| 1127 | // JSON content type for Ruby on rails. Bug: #1883287 | ||
| 1128 | o.content_type = 'application/json'; | ||
| 1129 | |||
| 1130 | XHR.send(o); | ||
| 1131 | }, | ||
| 1132 | |||
| 1133 | 'static' : { | ||
| 1134 | sendRPC : function(o) { | ||
| 1135 | return new tinymce.util.JSONRequest().send(o); | ||
| 1136 | } | ||
| 1137 | } | ||
| 1138 | }); | ||
| 1139 | }());(function(tinymce) { | ||
| 1140 | // Shorten names | ||
| 1141 | var each = tinymce.each, is = tinymce.is; | ||
| 1142 | var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE; | ||
| 1143 | |||
| 1144 | tinymce.create('tinymce.dom.DOMUtils', { | ||
| 1145 | doc : null, | ||
| 1146 | root : null, | ||
| 1147 | files : null, | ||
| 1148 | pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, | ||
| 1149 | props : { | ||
| 1150 | "for" : "htmlFor", | ||
| 1151 | "class" : "className", | ||
| 1152 | className : "className", | ||
| 1153 | checked : "checked", | ||
| 1154 | disabled : "disabled", | ||
| 1155 | maxlength : "maxLength", | ||
| 1156 | readonly : "readOnly", | ||
| 1157 | selected : "selected", | ||
| 1158 | value : "value", | ||
| 1159 | id : "id", | ||
| 1160 | name : "name", | ||
| 1161 | type : "type" | ||
| 1162 | }, | ||
| 1163 | |||
| 1164 | DOMUtils : function(d, s) { | ||
| 1165 | var t = this; | ||
| 1166 | |||
| 1167 | t.doc = d; | ||
| 1168 | t.win = window; | ||
| 1169 | t.files = {}; | ||
| 1170 | t.cssFlicker = false; | ||
| 1171 | t.counter = 0; | ||
| 1172 | t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; | ||
| 1173 | t.stdMode = d.documentMode === 8; | ||
| 1174 | |||
| 1175 | t.settings = s = tinymce.extend({ | ||
| 1176 | keep_values : false, | ||
| 1177 | hex_colors : 1, | ||
| 1178 | process_html : 1 | ||
| 1179 | }, s); | ||
| 1180 | |||
| 1181 | // Fix IE6SP2 flicker and check it failed for pre SP2 | ||
| 1182 | if (tinymce.isIE6) { | ||
| 1183 | try { | ||
| 1184 | d.execCommand('BackgroundImageCache', false, true); | ||
| 1185 | } catch (e) { | ||
| 1186 | t.cssFlicker = true; | ||
| 1187 | } | ||
| 1188 | } | ||
| 1189 | |||
| 1190 | tinymce.addUnload(t.destroy, t); | ||
| 1191 | }, | ||
| 1192 | |||
| 1193 | getRoot : function() { | ||
| 1194 | var t = this, s = t.settings; | ||
| 1195 | |||
| 1196 | return (s && t.get(s.root_element)) || t.doc.body; | ||
| 1197 | }, | ||
| 1198 | |||
| 1199 | getViewPort : function(w) { | ||
| 1200 | var d, b; | ||
| 1201 | |||
| 1202 | w = !w ? this.win : w; | ||
| 1203 | d = w.document; | ||
| 1204 | b = this.boxModel ? d.documentElement : d.body; | ||
| 1205 | |||
| 1206 | // Returns viewport size excluding scrollbars | ||
| 1207 | return { | ||
| 1208 | x : w.pageXOffset || b.scrollLeft, | ||
| 1209 | y : w.pageYOffset || b.scrollTop, | ||
| 1210 | w : w.innerWidth || b.clientWidth, | ||
| 1211 | h : w.innerHeight || b.clientHeight | ||
| 1212 | }; | ||
| 1213 | }, | ||
| 1214 | |||
| 1215 | getRect : function(e) { | ||
| 1216 | var p, t = this, sr; | ||
| 1217 | |||
| 1218 | e = t.get(e); | ||
| 1219 | p = t.getPos(e); | ||
| 1220 | sr = t.getSize(e); | ||
| 1221 | |||
| 1222 | return { | ||
| 1223 | x : p.x, | ||
| 1224 | y : p.y, | ||
| 1225 | w : sr.w, | ||
| 1226 | h : sr.h | ||
| 1227 | }; | ||
| 1228 | }, | ||
| 1229 | |||
| 1230 | getSize : function(e) { | ||
| 1231 | var t = this, w, h; | ||
| 1232 | |||
| 1233 | e = t.get(e); | ||
| 1234 | w = t.getStyle(e, 'width'); | ||
| 1235 | h = t.getStyle(e, 'height'); | ||
| 1236 | |||
| 1237 | // Non pixel value, then force offset/clientWidth | ||
| 1238 | if (w.indexOf('px') === -1) | ||
| 1239 | w = 0; | ||
| 1240 | |||
| 1241 | // Non pixel value, then force offset/clientWidth | ||
| 1242 | if (h.indexOf('px') === -1) | ||
| 1243 | h = 0; | ||
| 1244 | |||
| 1245 | return { | ||
| 1246 | w : parseInt(w) || e.offsetWidth || e.clientWidth, | ||
| 1247 | h : parseInt(h) || e.offsetHeight || e.clientHeight | ||
| 1248 | }; | ||
| 1249 | }, | ||
| 1250 | |||
| 1251 | getParent : function(n, f, r) { | ||
| 1252 | return this.getParents(n, f, r, false); | ||
| 1253 | }, | ||
| 1254 | |||
| 1255 | getParents : function(n, f, r, c) { | ||
| 1256 | var t = this, na, se = t.settings, o = []; | ||
| 1257 | |||
| 1258 | n = t.get(n); | ||
| 1259 | c = c === undefined; | ||
| 1260 | |||
| 1261 | if (se.strict_root) | ||
| 1262 | r = r || t.getRoot(); | ||
| 1263 | |||
| 1264 | // Wrap node name as func | ||
| 1265 | if (is(f, 'string')) { | ||
| 1266 | na = f; | ||
| 1267 | |||
| 1268 | if (f === '*') { | ||
| 1269 | f = function(n) {return n.nodeType == 1;}; | ||
| 1270 | } else { | ||
| 1271 | f = function(n) { | ||
| 1272 | return t.is(n, na); | ||
| 1273 | }; | ||
| 1274 | } | ||
| 1275 | } | ||
| 1276 | |||
| 1277 | while (n) { | ||
| 1278 | if (n == r || !n.nodeType || n.nodeType === 9) | ||
| 1279 | break; | ||
| 1280 | |||
| 1281 | if (!f || f(n)) { | ||
| 1282 | if (c) | ||
| 1283 | o.push(n); | ||
| 1284 | else | ||
| 1285 | return n; | ||
| 1286 | } | ||
| 1287 | |||
| 1288 | n = n.parentNode; | ||
| 1289 | } | ||
| 1290 | |||
| 1291 | return c ? o : null; | ||
| 1292 | }, | ||
| 1293 | |||
| 1294 | get : function(e) { | ||
| 1295 | var n; | ||
| 1296 | |||
| 1297 | if (e && this.doc && typeof(e) == 'string') { | ||
| 1298 | n = e; | ||
| 1299 | e = this.doc.getElementById(e); | ||
| 1300 | |||
| 1301 | // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick | ||
| 1302 | if (e && e.id !== n) | ||
| 1303 | return this.doc.getElementsByName(n)[1]; | ||
| 1304 | } | ||
| 1305 | |||
| 1306 | return e; | ||
| 1307 | }, | ||
| 1308 | |||
| 1309 | getNext : function(node, selector) { | ||
| 1310 | return this._findSib(node, selector, 'nextSibling'); | ||
| 1311 | }, | ||
| 1312 | |||
| 1313 | getPrev : function(node, selector) { | ||
| 1314 | return this._findSib(node, selector, 'previousSibling'); | ||
| 1315 | }, | ||
| 1316 | |||
| 1317 | |||
| 1318 | add : function(p, n, a, h, c) { | ||
| 1319 | var t = this; | ||
| 1320 | |||
| 1321 | return this.run(p, function(p) { | ||
| 1322 | var e, k; | ||
| 1323 | |||
| 1324 | e = is(n, 'string') ? t.doc.createElement(n) : n; | ||
| 1325 | t.setAttribs(e, a); | ||
| 1326 | |||
| 1327 | if (h) { | ||
| 1328 | if (h.nodeType) | ||
| 1329 | e.appendChild(h); | ||
| 1330 | else | ||
| 1331 | t.setHTML(e, h); | ||
| 1332 | } | ||
| 1333 | |||
| 1334 | return !c ? p.appendChild(e) : e; | ||
| 1335 | }); | ||
| 1336 | }, | ||
| 1337 | |||
| 1338 | create : function(n, a, h) { | ||
| 1339 | return this.add(this.doc.createElement(n), n, a, h, 1); | ||
| 1340 | }, | ||
| 1341 | |||
| 1342 | createHTML : function(n, a, h) { | ||
| 1343 | var o = '', t = this, k; | ||
| 1344 | |||
| 1345 | o += '<' + n; | ||
| 1346 | |||
| 1347 | for (k in a) { | ||
| 1348 | if (a.hasOwnProperty(k)) | ||
| 1349 | o += ' ' + k + '="' + t.encode(a[k]) + '"'; | ||
| 1350 | } | ||
| 1351 | |||
| 1352 | if (tinymce.is(h)) | ||
| 1353 | return o + '>' + h + '</' + n + '>'; | ||
| 1354 | |||
| 1355 | return o + ' />'; | ||
| 1356 | }, | ||
| 1357 | |||
| 1358 | remove : function(n, k) { | ||
| 1359 | var t = this; | ||
| 1360 | |||
| 1361 | return this.run(n, function(n) { | ||
| 1362 | var p, g, i; | ||
| 1363 | |||
| 1364 | p = n.parentNode; | ||
| 1365 | |||
| 1366 | if (!p) | ||
| 1367 | return null; | ||
| 1368 | |||
| 1369 | if (k) { | ||
| 1370 | for (i = n.childNodes.length - 1; i >= 0; i--) | ||
| 1371 | t.insertAfter(n.childNodes[i], n); | ||
| 1372 | |||
| 1373 | //each(n.childNodes, function(c) { | ||
| 1374 | // p.insertBefore(c.cloneNode(true), n); | ||
| 1375 | //}); | ||
| 1376 | } | ||
| 1377 | |||
| 1378 | // Fix IE psuedo leak | ||
| 1379 | if (t.fixPsuedoLeaks) { | ||
| 1380 | p = n.cloneNode(true); | ||
| 1381 | k = 'IELeakGarbageBin'; | ||
| 1382 | g = t.get(k) || t.add(t.doc.body, 'div', {id : k, style : 'display:none'}); | ||
| 1383 | g.appendChild(n); | ||
| 1384 | g.innerHTML = ''; | ||
| 1385 | |||
| 1386 | return p; | ||
| 1387 | } | ||
| 1388 | |||
| 1389 | return p.removeChild(n); | ||
| 1390 | }); | ||
| 1391 | }, | ||
| 1392 | |||
| 1393 | setStyle : function(n, na, v) { | ||
| 1394 | var t = this; | ||
| 1395 | |||
| 1396 | return t.run(n, function(e) { | ||
| 1397 | var s, i; | ||
| 1398 | |||
| 1399 | s = e.style; | ||
| 1400 | |||
| 1401 | // Camelcase it, if needed | ||
| 1402 | na = na.replace(/-(\D)/g, function(a, b){ | ||
| 1403 | return b.toUpperCase(); | ||
| 1404 | }); | ||
| 1405 | |||
| 1406 | // Default px suffix on these | ||
| 1407 | if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) | ||
| 1408 | v += 'px'; | ||
| 1409 | |||
| 1410 | switch (na) { | ||
| 1411 | case 'opacity': | ||
| 1412 | // IE specific opacity | ||
| 1413 | if (isIE) { | ||
| 1414 | s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; | ||
| 1415 | |||
| 1416 | if (!n.currentStyle || !n.currentStyle.hasLayout) | ||
| 1417 | s.display = 'inline-block'; | ||
| 1418 | } | ||
| 1419 | |||
| 1420 | // Fix for older browsers | ||
| 1421 | s[na] = s['-moz-opacity'] = s['-khtml-opacity'] = v || ''; | ||
| 1422 | break; | ||
| 1423 | |||
| 1424 | case 'float': | ||
| 1425 | isIE ? s.styleFloat = v : s.cssFloat = v; | ||
| 1426 | break; | ||
| 1427 | |||
| 1428 | default: | ||
| 1429 | s[na] = v || ''; | ||
| 1430 | } | ||
| 1431 | |||
| 1432 | // Force update of the style data | ||
| 1433 | if (t.settings.update_styles) | ||
| 1434 | t.setAttrib(e, 'mce_style'); | ||
| 1435 | }); | ||
| 1436 | }, | ||
| 1437 | |||
| 1438 | getStyle : function(n, na, c) { | ||
| 1439 | n = this.get(n); | ||
| 1440 | |||
| 1441 | if (!n) | ||
| 1442 | return false; | ||
| 1443 | |||
| 1444 | // Gecko | ||
| 1445 | if (this.doc.defaultView && c) { | ||
| 1446 | // Remove camelcase | ||
| 1447 | na = na.replace(/[A-Z]/g, function(a){ | ||
| 1448 | return '-' + a; | ||
| 1449 | }); | ||
| 1450 | |||
| 1451 | try { | ||
| 1452 | return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); | ||
| 1453 | } catch (ex) { | ||
| 1454 | // Old safari might fail | ||
| 1455 | return null; | ||
| 1456 | } | ||
| 1457 | } | ||
| 1458 | |||
| 1459 | // Camelcase it, if needed | ||
| 1460 | na = na.replace(/-(\D)/g, function(a, b){ | ||
| 1461 | return b.toUpperCase(); | ||
| 1462 | }); | ||
| 1463 | |||
| 1464 | if (na == 'float') | ||
| 1465 | na = isIE ? 'styleFloat' : 'cssFloat'; | ||
| 1466 | |||
| 1467 | // IE & Opera | ||
| 1468 | if (n.currentStyle && c) | ||
| 1469 | return n.currentStyle[na]; | ||
| 1470 | |||
| 1471 | return n.style[na]; | ||
| 1472 | }, | ||
| 1473 | |||
| 1474 | setStyles : function(e, o) { | ||
| 1475 | var t = this, s = t.settings, ol; | ||
| 1476 | |||
| 1477 | ol = s.update_styles; | ||
| 1478 | s.update_styles = 0; | ||
| 1479 | |||
| 1480 | each(o, function(v, n) { | ||
| 1481 | t.setStyle(e, n, v); | ||
| 1482 | }); | ||
| 1483 | |||
| 1484 | // Update style info | ||
| 1485 | s.update_styles = ol; | ||
| 1486 | if (s.update_styles) | ||
| 1487 | t.setAttrib(e, s.cssText); | ||
| 1488 | }, | ||
| 1489 | |||
| 1490 | setAttrib : function(e, n, v) { | ||
| 1491 | var t = this; | ||
| 1492 | |||
| 1493 | // Whats the point | ||
| 1494 | if (!e || !n) | ||
| 1495 | return; | ||
| 1496 | |||
| 1497 | // Strict XML mode | ||
| 1498 | if (t.settings.strict) | ||
| 1499 | n = n.toLowerCase(); | ||
| 1500 | |||
| 1501 | return this.run(e, function(e) { | ||
| 1502 | var s = t.settings; | ||
| 1503 | |||
| 1504 | switch (n) { | ||
| 1505 | case "style": | ||
| 1506 | if (!is(v, 'string')) { | ||
| 1507 | each(v, function(v, n) { | ||
| 1508 | t.setStyle(e, n, v); | ||
| 1509 | }); | ||
| 1510 | |||
| 1511 | return; | ||
| 1512 | } | ||
| 1513 | |||
| 1514 | // No mce_style for elements with these since they might get resized by the user | ||
| 1515 | if (s.keep_values) { | ||
| 1516 | if (v && !t._isRes(v)) | ||
| 1517 | e.setAttribute('mce_style', v, 2); | ||
| 1518 | else | ||
| 1519 | e.removeAttribute('mce_style', 2); | ||
| 1520 | } | ||
| 1521 | |||
| 1522 | e.style.cssText = v; | ||
| 1523 | break; | ||
| 1524 | |||
| 1525 | case "class": | ||
| 1526 | e.className = v || ''; // Fix IE null bug | ||
| 1527 | break; | ||
| 1528 | |||
| 1529 | case "src": | ||
| 1530 | case "href": | ||
| 1531 | if (s.keep_values) { | ||
| 1532 | if (s.url_converter) | ||
| 1533 | v = s.url_converter.call(s.url_converter_scope || t, v, n, e); | ||
| 1534 | |||
| 1535 | t.setAttrib(e, 'mce_' + n, v, 2); | ||
| 1536 | } | ||
| 1537 | |||
| 1538 | break; | ||
| 1539 | |||
| 1540 | case "shape": | ||
| 1541 | e.setAttribute('mce_style', v); | ||
| 1542 | break; | ||
| 1543 | } | ||
| 1544 | |||
| 1545 | if (is(v) && v !== null && v.length !== 0) | ||
| 1546 | e.setAttribute(n, '' + v, 2); | ||
| 1547 | else | ||
| 1548 | e.removeAttribute(n, 2); | ||
| 1549 | }); | ||
| 1550 | }, | ||
| 1551 | |||
| 1552 | setAttribs : function(e, o) { | ||
| 1553 | var t = this; | ||
| 1554 | |||
| 1555 | return this.run(e, function(e) { | ||
| 1556 | each(o, function(v, n) { | ||
| 1557 | t.setAttrib(e, n, v); | ||
| 1558 | }); | ||
| 1559 | }); | ||
| 1560 | }, | ||
| 1561 | |||
| 1562 | getAttrib : function(e, n, dv) { | ||
| 1563 | var v, t = this; | ||
| 1564 | |||
| 1565 | e = t.get(e); | ||
| 1566 | |||
| 1567 | if (!e || e.nodeType !== 1) | ||
| 1568 | return false; | ||
| 1569 | |||
| 1570 | if (!is(dv)) | ||
| 1571 | dv = ''; | ||
| 1572 | |||
| 1573 | // Try the mce variant for these | ||
| 1574 | if (/^(src|href|style|coords|shape)$/.test(n)) { | ||
| 1575 | v = e.getAttribute("mce_" + n); | ||
| 1576 | |||
| 1577 | if (v) | ||
| 1578 | return v; | ||
| 1579 | } | ||
| 1580 | |||
| 1581 | if (isIE && t.props[n]) { | ||
| 1582 | v = e[t.props[n]]; | ||
| 1583 | v = v && v.nodeValue ? v.nodeValue : v; | ||
| 1584 | } | ||
| 1585 | |||
| 1586 | if (!v) | ||
| 1587 | v = e.getAttribute(n, 2); | ||
| 1588 | |||
| 1589 | // Check boolean attribs | ||
| 1590 | if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(n)) { | ||
| 1591 | if (e[t.props[n]] === true && v === '') | ||
| 1592 | return n; | ||
| 1593 | |||
| 1594 | return v ? n : ''; | ||
| 1595 | } | ||
| 1596 | |||
| 1597 | // Inner input elements will override attributes on form elements | ||
| 1598 | if (e.nodeName === "FORM" && e.getAttributeNode(n)) | ||
| 1599 | return e.getAttributeNode(n).nodeValue; | ||
| 1600 | |||
| 1601 | if (n === 'style') { | ||
| 1602 | v = v || e.style.cssText; | ||
| 1603 | |||
| 1604 | if (v) { | ||
| 1605 | v = t.serializeStyle(t.parseStyle(v)); | ||
| 1606 | |||
| 1607 | if (t.settings.keep_values && !t._isRes(v)) | ||
| 1608 | e.setAttribute('mce_style', v); | ||
| 1609 | } | ||
| 1610 | } | ||
| 1611 | |||
| 1612 | // Remove Apple and WebKit stuff | ||
| 1613 | if (isWebKit && n === "class" && v) | ||
| 1614 | v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); | ||
| 1615 | |||
| 1616 | // Handle IE issues | ||
| 1617 | if (isIE) { | ||
| 1618 | switch (n) { | ||
| 1619 | case 'rowspan': | ||
| 1620 | case 'colspan': | ||
| 1621 | // IE returns 1 as default value | ||
| 1622 | if (v === 1) | ||
| 1623 | v = ''; | ||
| 1624 | |||
| 1625 | break; | ||
| 1626 | |||
| 1627 | case 'size': | ||
| 1628 | // IE returns +0 as default value for size | ||
| 1629 | if (v === '+0' || v === 20 || v === 0) | ||
| 1630 | v = ''; | ||
| 1631 | |||
| 1632 | break; | ||
| 1633 | |||
| 1634 | case 'width': | ||
| 1635 | case 'height': | ||
| 1636 | case 'vspace': | ||
| 1637 | case 'checked': | ||
| 1638 | case 'disabled': | ||
| 1639 | case 'readonly': | ||
| 1640 | if (v === 0) | ||
| 1641 | v = ''; | ||
| 1642 | |||
| 1643 | break; | ||
| 1644 | |||
| 1645 | case 'hspace': | ||
| 1646 | // IE returns -1 as default value | ||
| 1647 | if (v === -1) | ||
| 1648 | v = ''; | ||
| 1649 | |||
| 1650 | break; | ||
| 1651 | |||
| 1652 | case 'maxlength': | ||
| 1653 | case 'tabindex': | ||
| 1654 | // IE returns default value | ||
| 1655 | if (v === 32768 || v === 2147483647 || v === '32768') | ||
| 1656 | v = ''; | ||
| 1657 | |||
| 1658 | break; | ||
| 1659 | |||
| 1660 | case 'multiple': | ||
| 1661 | case 'compact': | ||
| 1662 | case 'noshade': | ||
| 1663 | case 'nowrap': | ||
| 1664 | if (v === 65535) | ||
| 1665 | return n; | ||
| 1666 | |||
| 1667 | return dv; | ||
| 1668 | |||
| 1669 | case 'shape': | ||
| 1670 | v = v.toLowerCase(); | ||
| 1671 | break; | ||
| 1672 | |||
| 1673 | default: | ||
| 1674 | // IE has odd anonymous function for event attributes | ||
| 1675 | if (n.indexOf('on') === 0 && v) | ||
| 1676 | v = ('' + v).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1'); | ||
| 1677 | } | ||
| 1678 | } | ||
| 1679 | |||
| 1680 | return (v !== undefined && v !== null && v !== '') ? '' + v : dv; | ||
| 1681 | }, | ||
| 1682 | |||
| 1683 | getPos : function(n, ro) { | ||
| 1684 | var t = this, x = 0, y = 0, e, d = t.doc, r; | ||
| 1685 | |||
| 1686 | n = t.get(n); | ||
| 1687 | ro = ro || d.body; | ||
| 1688 | |||
| 1689 | if (n) { | ||
| 1690 | // Use getBoundingClientRect on IE, Opera has it but it's not perfect | ||
| 1691 | if (isIE && !t.stdMode) { | ||
| 1692 | n = n.getBoundingClientRect(); | ||
| 1693 | e = t.boxModel ? d.documentElement : d.body; | ||
| 1694 | x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border | ||
| 1695 | x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; | ||
| 1696 | n.top += t.win.self != t.win.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset | ||
| 1697 | |||
| 1698 | return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; | ||
| 1699 | } | ||
| 1700 | |||
| 1701 | r = n; | ||
| 1702 | while (r && r != ro && r.nodeType) { | ||
| 1703 | x += r.offsetLeft || 0; | ||
| 1704 | y += r.offsetTop || 0; | ||
| 1705 | r = r.offsetParent; | ||
| 1706 | } | ||
| 1707 | |||
| 1708 | r = n.parentNode; | ||
| 1709 | while (r && r != ro && r.nodeType) { | ||
| 1710 | x -= r.scrollLeft || 0; | ||
| 1711 | y -= r.scrollTop || 0; | ||
| 1712 | r = r.parentNode; | ||
| 1713 | } | ||
| 1714 | } | ||
| 1715 | |||
| 1716 | return {x : x, y : y}; | ||
| 1717 | }, | ||
| 1718 | |||
| 1719 | parseStyle : function(st) { | ||
| 1720 | var t = this, s = t.settings, o = {}; | ||
| 1721 | |||
| 1722 | if (!st) | ||
| 1723 | return o; | ||
| 1724 | |||
| 1725 | function compress(p, s, ot) { | ||
| 1726 | var t, r, b, l; | ||
| 1727 | |||
| 1728 | // Get values and check it it needs compressing | ||
| 1729 | t = o[p + '-top' + s]; | ||
| 1730 | if (!t) | ||
| 1731 | return; | ||
| 1732 | |||
| 1733 | r = o[p + '-right' + s]; | ||
| 1734 | if (t != r) | ||
| 1735 | return; | ||
| 1736 | |||
| 1737 | b = o[p + '-bottom' + s]; | ||
| 1738 | if (r != b) | ||
| 1739 | return; | ||
| 1740 | |||
| 1741 | l = o[p + '-left' + s]; | ||
| 1742 | if (b != l) | ||
| 1743 | return; | ||
| 1744 | |||
| 1745 | // Compress | ||
| 1746 | o[ot] = l; | ||
| 1747 | delete o[p + '-top' + s]; | ||
| 1748 | delete o[p + '-right' + s]; | ||
| 1749 | delete o[p + '-bottom' + s]; | ||
| 1750 | delete o[p + '-left' + s]; | ||
| 1751 | }; | ||
| 1752 | |||
| 1753 | function compress2(ta, a, b, c) { | ||
| 1754 | var t; | ||
| 1755 | |||
| 1756 | t = o[a]; | ||
| 1757 | if (!t) | ||
| 1758 | return; | ||
| 1759 | |||
| 1760 | t = o[b]; | ||
| 1761 | if (!t) | ||
| 1762 | return; | ||
| 1763 | |||
| 1764 | t = o[c]; | ||
| 1765 | if (!t) | ||
| 1766 | return; | ||
| 1767 | |||
| 1768 | // Compress | ||
| 1769 | o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; | ||
| 1770 | delete o[a]; | ||
| 1771 | delete o[b]; | ||
| 1772 | delete o[c]; | ||
| 1773 | }; | ||
| 1774 | |||
| 1775 | st = st.replace(/&(#?[a-z0-9]+);/g, '&$1_MCE_SEMI_'); // Protect entities | ||
| 1776 | |||
| 1777 | each(st.split(';'), function(v) { | ||
| 1778 | var sv, ur = []; | ||
| 1779 | |||
| 1780 | if (v) { | ||
| 1781 | v = v.replace(/_MCE_SEMI_/g, ';'); // Restore entities | ||
| 1782 | v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); | ||
| 1783 | v = v.split(':'); | ||
| 1784 | sv = tinymce.trim(v[1]); | ||
| 1785 | sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); | ||
| 1786 | |||
| 1787 | sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { | ||
| 1788 | return t.toHex(v); | ||
| 1789 | }); | ||
| 1790 | |||
| 1791 | if (s.url_converter) { | ||
| 1792 | sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { | ||
| 1793 | return 'url(' + s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null) + ')'; | ||
| 1794 | }); | ||
| 1795 | } | ||
| 1796 | |||
| 1797 | o[tinymce.trim(v[0]).toLowerCase()] = sv; | ||
| 1798 | } | ||
| 1799 | }); | ||
| 1800 | |||
| 1801 | compress("border", "", "border"); | ||
| 1802 | compress("border", "-width", "border-width"); | ||
| 1803 | compress("border", "-color", "border-color"); | ||
| 1804 | compress("border", "-style", "border-style"); | ||
| 1805 | compress("padding", "", "padding"); | ||
| 1806 | compress("margin", "", "margin"); | ||
| 1807 | compress2('border', 'border-width', 'border-style', 'border-color'); | ||
| 1808 | |||
| 1809 | if (isIE) { | ||
| 1810 | // Remove pointless border | ||
| 1811 | if (o.border == 'medium none') | ||
| 1812 | o.border = ''; | ||
| 1813 | } | ||
| 1814 | |||
| 1815 | return o; | ||
| 1816 | }, | ||
| 1817 | |||
| 1818 | serializeStyle : function(o) { | ||
| 1819 | var s = ''; | ||
| 1820 | |||
| 1821 | each(o, function(v, k) { | ||
| 1822 | if (k && v) { | ||
| 1823 | if (tinymce.isGecko && k.indexOf('-moz-') === 0) | ||
| 1824 | return; | ||
| 1825 | |||
| 1826 | switch (k) { | ||
| 1827 | case 'color': | ||
| 1828 | case 'background-color': | ||
| 1829 | v = v.toLowerCase(); | ||
| 1830 | break; | ||
| 1831 | } | ||
| 1832 | |||
| 1833 | s += (s ? ' ' : '') + k + ': ' + v + ';'; | ||
| 1834 | } | ||
| 1835 | }); | ||
| 1836 | |||
| 1837 | return s; | ||
| 1838 | }, | ||
| 1839 | |||
| 1840 | loadCSS : function(u) { | ||
| 1841 | var t = this, d = t.doc, head; | ||
| 1842 | |||
| 1843 | if (!u) | ||
| 1844 | u = ''; | ||
| 1845 | |||
| 1846 | head = t.select('head')[0]; | ||
| 1847 | |||
| 1848 | each(u.split(','), function(u) { | ||
| 1849 | var link; | ||
| 1850 | |||
| 1851 | if (t.files[u]) | ||
| 1852 | return; | ||
| 1853 | |||
| 1854 | t.files[u] = true; | ||
| 1855 | link = t.create('link', {rel : 'stylesheet', href : tinymce._addVer(u)}); | ||
| 1856 | |||
| 1857 | // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug | ||
| 1858 | // This fix seems to resolve that issue by realcing the document ones a stylesheet finishes loading | ||
| 1859 | // It's ugly but it seems to work fine. | ||
| 1860 | if (isIE && d.documentMode) { | ||
| 1861 | link.onload = function() { | ||
| 1862 | d.recalc(); | ||
| 1863 | link.onload = null; | ||
| 1864 | }; | ||
| 1865 | } | ||
| 1866 | |||
| 1867 | head.appendChild(link); | ||
| 1868 | }); | ||
| 1869 | }, | ||
| 1870 | |||
| 1871 | addClass : function(e, c) { | ||
| 1872 | return this.run(e, function(e) { | ||
| 1873 | var o; | ||
| 1874 | |||
| 1875 | if (!c) | ||
| 1876 | return 0; | ||
| 1877 | |||
| 1878 | if (this.hasClass(e, c)) | ||
| 1879 | return e.className; | ||
| 1880 | |||
| 1881 | o = this.removeClass(e, c); | ||
| 1882 | |||
| 1883 | return e.className = (o != '' ? (o + ' ') : '') + c; | ||
| 1884 | }); | ||
| 1885 | }, | ||
| 1886 | |||
| 1887 | removeClass : function(e, c) { | ||
| 1888 | var t = this, re; | ||
| 1889 | |||
| 1890 | return t.run(e, function(e) { | ||
| 1891 | var v; | ||
| 1892 | |||
| 1893 | if (t.hasClass(e, c)) { | ||
| 1894 | if (!re) | ||
| 1895 | re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); | ||
| 1896 | |||
| 1897 | v = e.className.replace(re, ' '); | ||
| 1898 | |||
| 1899 | return e.className = tinymce.trim(v != ' ' ? v : ''); | ||
| 1900 | } | ||
| 1901 | |||
| 1902 | return e.className; | ||
| 1903 | }); | ||
| 1904 | }, | ||
| 1905 | |||
| 1906 | hasClass : function(n, c) { | ||
| 1907 | n = this.get(n); | ||
| 1908 | |||
| 1909 | if (!n || !c) | ||
| 1910 | return false; | ||
| 1911 | |||
| 1912 | return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; | ||
| 1913 | }, | ||
| 1914 | |||
| 1915 | show : function(e) { | ||
| 1916 | return this.setStyle(e, 'display', 'block'); | ||
| 1917 | }, | ||
| 1918 | |||
| 1919 | hide : function(e) { | ||
| 1920 | return this.setStyle(e, 'display', 'none'); | ||
| 1921 | }, | ||
| 1922 | |||
| 1923 | isHidden : function(e) { | ||
| 1924 | e = this.get(e); | ||
| 1925 | |||
| 1926 | return !e || e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; | ||
| 1927 | }, | ||
| 1928 | |||
| 1929 | uniqueId : function(p) { | ||
| 1930 | return (!p ? 'mce_' : p) + (this.counter++); | ||
| 1931 | }, | ||
| 1932 | |||
| 1933 | setHTML : function(e, h) { | ||
| 1934 | var t = this; | ||
| 1935 | |||
| 1936 | return this.run(e, function(e) { | ||
| 1937 | var x, i, nl, n, p, x; | ||
| 1938 | |||
| 1939 | h = t.processHTML(h); | ||
| 1940 | |||
| 1941 | if (isIE) { | ||
| 1942 | function set() { | ||
| 1943 | try { | ||
| 1944 | // IE will remove comments from the beginning | ||
| 1945 | // unless you padd the contents with something | ||
| 1946 | e.innerHTML = '<br />' + h; | ||
| 1947 | e.removeChild(e.firstChild); | ||
| 1948 | } catch (ex) { | ||
| 1949 | // IE sometimes produces an unknown runtime error on innerHTML if it's an block element within a block element for example a div inside a p | ||
| 1950 | // This seems to fix this problem | ||
| 1951 | |||
| 1952 | // Remove all child nodes | ||
| 1953 | while (e.firstChild) | ||
| 1954 | e.firstChild.removeNode(); | ||
| 1955 | |||
| 1956 | // Create new div with HTML contents and a BR infront to keep comments | ||
| 1957 | x = t.create('div'); | ||
| 1958 | x.innerHTML = '<br />' + h; | ||
| 1959 | |||
| 1960 | // Add all children from div to target | ||
| 1961 | each (x.childNodes, function(n, i) { | ||
| 1962 | // Skip br element | ||
| 1963 | if (i) | ||
| 1964 | e.appendChild(n); | ||
| 1965 | }); | ||
| 1966 | } | ||
| 1967 | }; | ||
| 1968 | |||
| 1969 | // IE has a serious bug when it comes to paragraphs it can produce an invalid | ||
| 1970 | // DOM tree if contents like this <p><ul><li>Item 1</li></ul></p> is inserted | ||
| 1971 | // It seems to be that IE doesn't like a root block element placed inside another root block element | ||
| 1972 | if (t.settings.fix_ie_paragraphs) | ||
| 1973 | h = h.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi, '<p$1 mce_keep="true"> </p>'); | ||
| 1974 | |||
| 1975 | set(); | ||
| 1976 | |||
| 1977 | if (t.settings.fix_ie_paragraphs) { | ||
| 1978 | // Check for odd paragraphs this is a sign of a broken DOM | ||
| 1979 | nl = e.getElementsByTagName("p"); | ||
| 1980 | for (i = nl.length - 1, x = 0; i >= 0; i--) { | ||
| 1981 | n = nl[i]; | ||
| 1982 | |||
| 1983 | if (!n.hasChildNodes()) { | ||
| 1984 | if (!n.mce_keep) { | ||
| 1985 | x = 1; // Is broken | ||
| 1986 | break; | ||
| 1987 | } | ||
| 1988 | |||
| 1989 | n.removeAttribute('mce_keep'); | ||
| 1990 | } | ||
| 1991 | } | ||
| 1992 | } | ||
| 1993 | |||
| 1994 | // Time to fix the madness IE left us | ||
| 1995 | if (x) { | ||
| 1996 | // So if we replace the p elements with divs and mark them and then replace them back to paragraphs | ||
| 1997 | // after we use innerHTML we can fix the DOM tree | ||
| 1998 | h = h.replace(/<p ([^>]+)>|<p>/ig, '<div $1 mce_tmp="1">'); | ||
| 1999 | h = h.replace(/<\/p>/g, '</div>'); | ||
| 2000 | |||
| 2001 | // Set the new HTML with DIVs | ||
| 2002 | set(); | ||
| 2003 | |||
| 2004 | // Replace all DIV elements with he mce_tmp attibute back to paragraphs | ||
| 2005 | // This is needed since IE has a annoying bug see above for details | ||
| 2006 | // This is a slow process but it has to be done. :( | ||
| 2007 | if (t.settings.fix_ie_paragraphs) { | ||
| 2008 | nl = e.getElementsByTagName("DIV"); | ||
| 2009 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 2010 | n = nl[i]; | ||
| 2011 | |||
| 2012 | // Is it a temp div | ||
| 2013 | if (n.mce_tmp) { | ||
| 2014 | // Create new paragraph | ||
| 2015 | p = t.doc.createElement('p'); | ||
| 2016 | |||
| 2017 | // Copy all attributes | ||
| 2018 | n.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi, function(a, b) { | ||
| 2019 | var v; | ||
| 2020 | |||
| 2021 | if (b !== 'mce_tmp') { | ||
| 2022 | v = n.getAttribute(b); | ||
| 2023 | |||
| 2024 | if (!v && b === 'class') | ||
| 2025 | v = n.className; | ||
| 2026 | |||
| 2027 | p.setAttribute(b, v); | ||
| 2028 | } | ||
| 2029 | }); | ||
| 2030 | |||
| 2031 | // Append all children to new paragraph | ||
| 2032 | for (x = 0; x<n.childNodes.length; x++) | ||
| 2033 | p.appendChild(n.childNodes[x].cloneNode(true)); | ||
| 2034 | |||
| 2035 | // Replace div with new paragraph | ||
| 2036 | n.swapNode(p); | ||
| 2037 | } | ||
| 2038 | } | ||
| 2039 | } | ||
| 2040 | } | ||
| 2041 | } else | ||
| 2042 | e.innerHTML = h; | ||
| 2043 | |||
| 2044 | return h; | ||
| 2045 | }); | ||
| 2046 | }, | ||
| 2047 | |||
| 2048 | processHTML : function(h) { | ||
| 2049 | var t = this, s = t.settings, codeBlocks = []; | ||
| 2050 | |||
| 2051 | if (!s.process_html) | ||
| 2052 | return h; | ||
| 2053 | |||
| 2054 | // Convert strong and em to b and i in FF since it can't handle them | ||
| 2055 | if (tinymce.isGecko) { | ||
| 2056 | h = h.replace(/<(\/?)strong>|<strong( [^>]+)>/gi, '<$1b$2>'); | ||
| 2057 | h = h.replace(/<(\/?)em>|<em( [^>]+)>/gi, '<$1i$2>'); | ||
| 2058 | } else if (isIE) { | ||
| 2059 | h = h.replace(/'/g, '''); // IE can't handle apos | ||
| 2060 | h = h.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi, ''); // IE doesn't handle default values correct | ||
| 2061 | } | ||
| 2062 | |||
| 2063 | // Fix some issues | ||
| 2064 | h = h.replace(/<a( )([^>]+)\/>|<a\/>/gi, '<a$1$2></a>'); // Force open | ||
| 2065 | |||
| 2066 | // Store away src and href in mce_src and mce_href since browsers mess them up | ||
| 2067 | if (s.keep_values) { | ||
| 2068 | // Wrap scripts and styles in comments for serialization purposes | ||
| 2069 | if (/<script|noscript|style/i.test(h)) { | ||
| 2070 | function trim(s) { | ||
| 2071 | // Remove prefix and suffix code for element | ||
| 2072 | s = s.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n'); | ||
| 2073 | s = s.replace(/^[\r\n]*|[\r\n]*$/g, ''); | ||
| 2074 | s = s.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g, ''); | ||
| 2075 | s = s.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g, ''); | ||
| 2076 | |||
| 2077 | return s; | ||
| 2078 | }; | ||
| 2079 | |||
| 2080 | // Wrap the script contents in CDATA and keep them from executing | ||
| 2081 | h = h.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi, function(v, attribs, text) { | ||
| 2082 | // Force type attribute | ||
| 2083 | if (!attribs) | ||
| 2084 | attribs = ' type="text/javascript"'; | ||
| 2085 | |||
| 2086 | // Convert the src attribute of the scripts | ||
| 2087 | attribs = attribs.replace(/src=\"([^\"]+)\"?/i, function(a, url) { | ||
| 2088 | if (s.url_converter) | ||
| 2089 | url = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(url), 'src', 'script')); | ||
| 2090 | |||
| 2091 | return 'mce_src="' + url + '"'; | ||
| 2092 | }); | ||
| 2093 | |||
| 2094 | // Wrap text contents | ||
| 2095 | if (tinymce.trim(text)) { | ||
| 2096 | codeBlocks.push(trim(text)); | ||
| 2097 | text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n// -->'; | ||
| 2098 | } | ||
| 2099 | |||
| 2100 | return '<mce:script' + attribs + '>' + text + '</mce:script>'; | ||
| 2101 | }); | ||
| 2102 | |||
| 2103 | // Wrap style elements | ||
| 2104 | h = h.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi, function(v, attribs, text) { | ||
| 2105 | // Wrap text contents | ||
| 2106 | if (text) { | ||
| 2107 | codeBlocks.push(trim(text)); | ||
| 2108 | text = '<!--\nMCE_SCRIPT:' + (codeBlocks.length - 1) + '\n-->'; | ||
| 2109 | } | ||
| 2110 | |||
| 2111 | return '<mce:style' + attribs + '>' + text + '</mce:style><style ' + attribs + ' mce_bogus="1">' + text + '</style>'; | ||
| 2112 | }); | ||
| 2113 | |||
| 2114 | // Wrap noscript elements | ||
| 2115 | h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { | ||
| 2116 | return '<mce:noscript' + attribs + '><!--' + t.encode(text).replace(/--/g, '--') + '--></mce:noscript>'; | ||
| 2117 | }); | ||
| 2118 | } | ||
| 2119 | |||
| 2120 | h = h.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g, '<!--[CDATA[$1]]-->'); | ||
| 2121 | |||
| 2122 | // Remove false bool attributes and force attributes into xhtml style attr="attr" | ||
| 2123 | h = h.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi, function(val) { | ||
| 2124 | function handle(val, name, value) { | ||
| 2125 | // Remove false/0 attribs | ||
| 2126 | if (value === 'false' || value === '0') | ||
| 2127 | return ''; | ||
| 2128 | |||
| 2129 | return ' ' + name + '="' + name + '"'; | ||
| 2130 | }; | ||
| 2131 | |||
| 2132 | val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi, handle); // W3C | ||
| 2133 | val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi, handle); // W3C | ||
| 2134 | val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi, handle); // IE | ||
| 2135 | val = val.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi, ' $1="$1"$2'); // Force attr="attr" | ||
| 2136 | |||
| 2137 | return val; | ||
| 2138 | }); | ||
| 2139 | |||
| 2140 | // Process all tags with src, href or style | ||
| 2141 | h = h.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi, function(a, n) { | ||
| 2142 | function handle(m, b, c) { | ||
| 2143 | var u = c; | ||
| 2144 | |||
| 2145 | // Tag already got a mce_ version | ||
| 2146 | if (a.indexOf('mce_' + b) != -1) | ||
| 2147 | return m; | ||
| 2148 | |||
| 2149 | if (b == 'style') { | ||
| 2150 | // No mce_style for elements with these since they might get resized by the user | ||
| 2151 | if (t._isRes(c)) | ||
| 2152 | return m; | ||
| 2153 | |||
| 2154 | // Parse and serialize the style to convert for example uppercase styles like "BORDER: 1px" | ||
| 2155 | u = t.encode(t.serializeStyle(t.parseStyle(u))); | ||
| 2156 | } else if (b != 'coords' && b != 'shape') { | ||
| 2157 | if (s.url_converter) | ||
| 2158 | u = t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), b, n)); | ||
| 2159 | } | ||
| 2160 | |||
| 2161 | return ' ' + b + '="' + c + '" mce_' + b + '="' + u + '"'; | ||
| 2162 | }; | ||
| 2163 | |||
| 2164 | a = a.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi, handle); // W3C | ||
| 2165 | a = a.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi, handle); // W3C | ||
| 2166 | |||
| 2167 | return a.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi, handle); // IE | ||
| 2168 | }); | ||
| 2169 | |||
| 2170 | // Restore script blocks | ||
| 2171 | h = h.replace(/MCE_SCRIPT:([0-9]+)/g, function(val, idx) { | ||
| 2172 | return codeBlocks[idx]; | ||
| 2173 | }); | ||
| 2174 | } | ||
| 2175 | |||
| 2176 | return h; | ||
| 2177 | }, | ||
| 2178 | |||
| 2179 | getOuterHTML : function(e) { | ||
| 2180 | var d; | ||
| 2181 | |||
| 2182 | e = this.get(e); | ||
| 2183 | |||
| 2184 | if (!e) | ||
| 2185 | return null; | ||
| 2186 | |||
| 2187 | if (e.outerHTML !== undefined) | ||
| 2188 | return e.outerHTML; | ||
| 2189 | |||
| 2190 | d = (e.ownerDocument || this.doc).createElement("body"); | ||
| 2191 | d.appendChild(e.cloneNode(true)); | ||
| 2192 | |||
| 2193 | return d.innerHTML; | ||
| 2194 | }, | ||
| 2195 | |||
| 2196 | setOuterHTML : function(e, h, d) { | ||
| 2197 | var t = this; | ||
| 2198 | |||
| 2199 | function setHTML(e, h, d) { | ||
| 2200 | var n, tp; | ||
| 2201 | |||
| 2202 | tp = d.createElement("body"); | ||
| 2203 | tp.innerHTML = h; | ||
| 2204 | |||
| 2205 | n = tp.lastChild; | ||
| 2206 | while (n) { | ||
| 2207 | t.insertAfter(n.cloneNode(true), e); | ||
| 2208 | n = n.previousSibling; | ||
| 2209 | } | ||
| 2210 | |||
| 2211 | t.remove(e); | ||
| 2212 | }; | ||
| 2213 | |||
| 2214 | return this.run(e, function(e) { | ||
| 2215 | e = t.get(e); | ||
| 2216 | |||
| 2217 | // Only set HTML on elements | ||
| 2218 | if (e.nodeType == 1) { | ||
| 2219 | d = d || e.ownerDocument || t.doc; | ||
| 2220 | |||
| 2221 | if (isIE) { | ||
| 2222 | try { | ||
| 2223 | // Try outerHTML for IE it sometimes produces an unknown runtime error | ||
| 2224 | if (isIE && e.nodeType == 1) | ||
| 2225 | e.outerHTML = h; | ||
| 2226 | else | ||
| 2227 | setHTML(e, h, d); | ||
| 2228 | } catch (ex) { | ||
| 2229 | // Fix for unknown runtime error | ||
| 2230 | setHTML(e, h, d); | ||
| 2231 | } | ||
| 2232 | } else | ||
| 2233 | setHTML(e, h, d); | ||
| 2234 | } | ||
| 2235 | }); | ||
| 2236 | }, | ||
| 2237 | |||
| 2238 | decode : function(s) { | ||
| 2239 | var e, n, v; | ||
| 2240 | |||
| 2241 | // Look for entities to decode | ||
| 2242 | if (/&[^;]+;/.test(s)) { | ||
| 2243 | // Decode the entities using a div element not super efficient but less code | ||
| 2244 | e = this.doc.createElement("div"); | ||
| 2245 | e.innerHTML = s; | ||
| 2246 | n = e.firstChild; | ||
| 2247 | v = ''; | ||
| 2248 | |||
| 2249 | if (n) { | ||
| 2250 | do { | ||
| 2251 | v += n.nodeValue; | ||
| 2252 | } while (n.nextSibling); | ||
| 2253 | } | ||
| 2254 | |||
| 2255 | return v || s; | ||
| 2256 | } | ||
| 2257 | |||
| 2258 | return s; | ||
| 2259 | }, | ||
| 2260 | |||
| 2261 | encode : function(s) { | ||
| 2262 | return s ? ('' + s).replace(/[<>&\"]/g, function (c, b) { | ||
| 2263 | switch (c) { | ||
| 2264 | case '&': | ||
| 2265 | return '&'; | ||
| 2266 | |||
| 2267 | case '"': | ||
| 2268 | return '"'; | ||
| 2269 | |||
| 2270 | case '<': | ||
| 2271 | return '<'; | ||
| 2272 | |||
| 2273 | case '>': | ||
| 2274 | return '>'; | ||
| 2275 | } | ||
| 2276 | |||
| 2277 | return c; | ||
| 2278 | }) : s; | ||
| 2279 | }, | ||
| 2280 | |||
| 2281 | insertAfter : function(n, r) { | ||
| 2282 | var t = this; | ||
| 2283 | |||
| 2284 | r = t.get(r); | ||
| 2285 | |||
| 2286 | return this.run(n, function(n) { | ||
| 2287 | var p, ns; | ||
| 2288 | |||
| 2289 | p = r.parentNode; | ||
| 2290 | ns = r.nextSibling; | ||
| 2291 | |||
| 2292 | if (ns) | ||
| 2293 | p.insertBefore(n, ns); | ||
| 2294 | else | ||
| 2295 | p.appendChild(n); | ||
| 2296 | |||
| 2297 | return n; | ||
| 2298 | }); | ||
| 2299 | }, | ||
| 2300 | |||
| 2301 | isBlock : function(n) { | ||
| 2302 | if (n.nodeType && n.nodeType !== 1) | ||
| 2303 | return false; | ||
| 2304 | |||
| 2305 | n = n.nodeName || n; | ||
| 2306 | |||
| 2307 | return /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(n); | ||
| 2308 | }, | ||
| 2309 | |||
| 2310 | replace : function(n, o, k) { | ||
| 2311 | var t = this; | ||
| 2312 | |||
| 2313 | if (is(o, 'array')) | ||
| 2314 | n = n.cloneNode(true); | ||
| 2315 | |||
| 2316 | return t.run(o, function(o) { | ||
| 2317 | if (k) { | ||
| 2318 | each(o.childNodes, function(c) { | ||
| 2319 | n.appendChild(c.cloneNode(true)); | ||
| 2320 | }); | ||
| 2321 | } | ||
| 2322 | |||
| 2323 | // Fix IE psuedo leak for elements since replacing elements if fairly common | ||
| 2324 | // Will break parentNode for some unknown reason | ||
| 2325 | if (t.fixPsuedoLeaks && o.nodeType === 1) { | ||
| 2326 | o.parentNode.insertBefore(n, o); | ||
| 2327 | t.remove(o); | ||
| 2328 | return n; | ||
| 2329 | } | ||
| 2330 | |||
| 2331 | return o.parentNode.replaceChild(n, o); | ||
| 2332 | }); | ||
| 2333 | }, | ||
| 2334 | |||
| 2335 | findCommonAncestor : function(a, b) { | ||
| 2336 | var ps = a, pe; | ||
| 2337 | |||
| 2338 | while (ps) { | ||
| 2339 | pe = b; | ||
| 2340 | |||
| 2341 | while (pe && ps != pe) | ||
| 2342 | pe = pe.parentNode; | ||
| 2343 | |||
| 2344 | if (ps == pe) | ||
| 2345 | break; | ||
| 2346 | |||
| 2347 | ps = ps.parentNode; | ||
| 2348 | } | ||
| 2349 | |||
| 2350 | if (!ps && a.ownerDocument) | ||
| 2351 | return a.ownerDocument.documentElement; | ||
| 2352 | |||
| 2353 | return ps; | ||
| 2354 | }, | ||
| 2355 | |||
| 2356 | toHex : function(s) { | ||
| 2357 | var c = /^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(s); | ||
| 2358 | |||
| 2359 | function hex(s) { | ||
| 2360 | s = parseInt(s).toString(16); | ||
| 2361 | |||
| 2362 | return s.length > 1 ? s : '0' + s; // 0 -> 00 | ||
| 2363 | }; | ||
| 2364 | |||
| 2365 | if (c) { | ||
| 2366 | s = '#' + hex(c[1]) + hex(c[2]) + hex(c[3]); | ||
| 2367 | |||
| 2368 | return s; | ||
| 2369 | } | ||
| 2370 | |||
| 2371 | return s; | ||
| 2372 | }, | ||
| 2373 | |||
| 2374 | getClasses : function() { | ||
| 2375 | var t = this, cl = [], i, lo = {}, f = t.settings.class_filter, ov; | ||
| 2376 | |||
| 2377 | if (t.classes) | ||
| 2378 | return t.classes; | ||
| 2379 | |||
| 2380 | function addClasses(s) { | ||
| 2381 | // IE style imports | ||
| 2382 | each(s.imports, function(r) { | ||
| 2383 | addClasses(r); | ||
| 2384 | }); | ||
| 2385 | |||
| 2386 | each(s.cssRules || s.rules, function(r) { | ||
| 2387 | // Real type or fake it on IE | ||
| 2388 | switch (r.type || 1) { | ||
| 2389 | // Rule | ||
| 2390 | case 1: | ||
| 2391 | if (r.selectorText) { | ||
| 2392 | each(r.selectorText.split(','), function(v) { | ||
| 2393 | v = v.replace(/^\s*|\s*$|^\s\./g, ""); | ||
| 2394 | |||
| 2395 | // Is internal or it doesn't contain a class | ||
| 2396 | if (/\.mce/.test(v) || !/\.[\w\-]+$/.test(v)) | ||
| 2397 | return; | ||
| 2398 | |||
| 2399 | // Remove everything but class name | ||
| 2400 | ov = v; | ||
| 2401 | v = v.replace(/.*\.([a-z0-9_\-]+).*/i, '$1'); | ||
| 2402 | |||
| 2403 | // Filter classes | ||
| 2404 | if (f && !(v = f(v, ov))) | ||
| 2405 | return; | ||
| 2406 | |||
| 2407 | if (!lo[v]) { | ||
| 2408 | cl.push({'class' : v}); | ||
| 2409 | lo[v] = 1; | ||
| 2410 | } | ||
| 2411 | }); | ||
| 2412 | } | ||
| 2413 | break; | ||
| 2414 | |||
| 2415 | // Import | ||
| 2416 | case 3: | ||
| 2417 | addClasses(r.styleSheet); | ||
| 2418 | break; | ||
| 2419 | } | ||
| 2420 | }); | ||
| 2421 | }; | ||
| 2422 | |||
| 2423 | try { | ||
| 2424 | each(t.doc.styleSheets, addClasses); | ||
| 2425 | } catch (ex) { | ||
| 2426 | // Ignore | ||
| 2427 | } | ||
| 2428 | |||
| 2429 | if (cl.length > 0) | ||
| 2430 | t.classes = cl; | ||
| 2431 | |||
| 2432 | return cl; | ||
| 2433 | }, | ||
| 2434 | |||
| 2435 | run : function(e, f, s) { | ||
| 2436 | var t = this, o; | ||
| 2437 | |||
| 2438 | if (t.doc && typeof(e) === 'string') | ||
| 2439 | e = t.get(e); | ||
| 2440 | |||
| 2441 | if (!e) | ||
| 2442 | return false; | ||
| 2443 | |||
| 2444 | s = s || this; | ||
| 2445 | if (!e.nodeType && (e.length || e.length === 0)) { | ||
| 2446 | o = []; | ||
| 2447 | |||
| 2448 | each(e, function(e, i) { | ||
| 2449 | if (e) { | ||
| 2450 | if (typeof(e) == 'string') | ||
| 2451 | e = t.doc.getElementById(e); | ||
| 2452 | |||
| 2453 | o.push(f.call(s, e, i)); | ||
| 2454 | } | ||
| 2455 | }); | ||
| 2456 | |||
| 2457 | return o; | ||
| 2458 | } | ||
| 2459 | |||
| 2460 | return f.call(s, e); | ||
| 2461 | }, | ||
| 2462 | |||
| 2463 | getAttribs : function(n) { | ||
| 2464 | var o; | ||
| 2465 | |||
| 2466 | n = this.get(n); | ||
| 2467 | |||
| 2468 | if (!n) | ||
| 2469 | return []; | ||
| 2470 | |||
| 2471 | if (isIE) { | ||
| 2472 | o = []; | ||
| 2473 | |||
| 2474 | // Object will throw exception in IE | ||
| 2475 | if (n.nodeName == 'OBJECT') | ||
| 2476 | return n.attributes; | ||
| 2477 | |||
| 2478 | // IE doesn't keep the selected attribute if you clone option elements | ||
| 2479 | if (n.nodeName === 'OPTION' && this.getAttrib(n, 'selected')) | ||
| 2480 | o.push({specified : 1, nodeName : 'selected'}); | ||
| 2481 | |||
| 2482 | // It's crazy that this is faster in IE but it's because it returns all attributes all the time | ||
| 2483 | n.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi, '').replace(/[\w:]+/gi, function(a) { | ||
| 2484 | o.push({specified : 1, nodeName : a}); | ||
| 2485 | }); | ||
| 2486 | |||
| 2487 | return o; | ||
| 2488 | } | ||
| 2489 | |||
| 2490 | return n.attributes; | ||
| 2491 | }, | ||
| 2492 | |||
| 2493 | destroy : function(s) { | ||
| 2494 | var t = this; | ||
| 2495 | |||
| 2496 | if (t.events) | ||
| 2497 | t.events.destroy(); | ||
| 2498 | |||
| 2499 | t.win = t.doc = t.root = t.events = null; | ||
| 2500 | |||
| 2501 | // Manual destroy then remove unload handler | ||
| 2502 | if (!s) | ||
| 2503 | tinymce.removeUnload(t.destroy); | ||
| 2504 | }, | ||
| 2505 | |||
| 2506 | createRng : function() { | ||
| 2507 | var d = this.doc; | ||
| 2508 | |||
| 2509 | return d.createRange ? d.createRange() : new tinymce.dom.Range(this); | ||
| 2510 | }, | ||
| 2511 | |||
| 2512 | split : function(pe, e, re) { | ||
| 2513 | var t = this, r = t.createRng(), bef, aft, pa; | ||
| 2514 | |||
| 2515 | // W3C valid browsers tend to leave empty nodes to the left/right side of the contents, this makes sence | ||
| 2516 | // but we don't want that in our code since it serves no purpose | ||
| 2517 | // For example if this is chopped: | ||
| 2518 | // <p>text 1<span><b>CHOP</b></span>text 2</p> | ||
| 2519 | // would produce: | ||
| 2520 | // <p>text 1<span></span></p><b>CHOP</b><p><span></span>text 2</p> | ||
| 2521 | // this function will then trim of empty edges and produce: | ||
| 2522 | // <p>text 1</p><b>CHOP</b><p>text 2</p> | ||
| 2523 | function trimEdge(n, na) { | ||
| 2524 | n = n[na]; | ||
| 2525 | |||
| 2526 | if (n && n[na] && n[na].nodeType == 1 && isEmpty(n[na])) | ||
| 2527 | t.remove(n[na]); | ||
| 2528 | }; | ||
| 2529 | |||
| 2530 | function isEmpty(n) { | ||
| 2531 | n = t.getOuterHTML(n); | ||
| 2532 | n = n.replace(/<(img|hr|table)/gi, '-'); // Keep these convert them to - chars | ||
| 2533 | n = n.replace(/<[^>]+>/g, ''); // Remove all tags | ||
| 2534 | |||
| 2535 | return n.replace(/[ \t\r\n]+| | /g, '') == ''; | ||
| 2536 | }; | ||
| 2537 | |||
| 2538 | // Added until Gecko can create real HTML documents using implementation.createHTMLDocument | ||
| 2539 | // this is to future proof it if Gecko decides to implement the error checking for range methods. | ||
| 2540 | function nodeIndex(n) { | ||
| 2541 | var i = 0; | ||
| 2542 | |||
| 2543 | while (n.previousSibling) { | ||
| 2544 | i++; | ||
| 2545 | n = n.previousSibling; | ||
| 2546 | } | ||
| 2547 | |||
| 2548 | return i; | ||
| 2549 | }; | ||
| 2550 | |||
| 2551 | if (pe && e) { | ||
| 2552 | // Get before chunk | ||
| 2553 | r.setStart(pe.parentNode, nodeIndex(pe)); | ||
| 2554 | r.setEnd(e.parentNode, nodeIndex(e)); | ||
| 2555 | bef = r.extractContents(); | ||
| 2556 | |||
| 2557 | // Get after chunk | ||
| 2558 | r = t.createRng(); | ||
| 2559 | r.setStart(e.parentNode, nodeIndex(e) + 1); | ||
| 2560 | r.setEnd(pe.parentNode, nodeIndex(pe) + 1); | ||
| 2561 | aft = r.extractContents(); | ||
| 2562 | |||
| 2563 | // Insert chunks and remove parent | ||
| 2564 | pa = pe.parentNode; | ||
| 2565 | |||
| 2566 | // Remove right side edge of the before contents | ||
| 2567 | trimEdge(bef, 'lastChild'); | ||
| 2568 | |||
| 2569 | if (!isEmpty(bef)) | ||
| 2570 | pa.insertBefore(bef, pe); | ||
| 2571 | |||
| 2572 | if (re) | ||
| 2573 | pa.replaceChild(re, e); | ||
| 2574 | else | ||
| 2575 | pa.insertBefore(e, pe); | ||
| 2576 | |||
| 2577 | // Remove left site edge of the after contents | ||
| 2578 | trimEdge(aft, 'firstChild'); | ||
| 2579 | |||
| 2580 | if (!isEmpty(aft)) | ||
| 2581 | pa.insertBefore(aft, pe); | ||
| 2582 | |||
| 2583 | t.remove(pe); | ||
| 2584 | |||
| 2585 | return re || e; | ||
| 2586 | } | ||
| 2587 | }, | ||
| 2588 | |||
| 2589 | bind : function(target, name, func, scope) { | ||
| 2590 | var t = this; | ||
| 2591 | |||
| 2592 | if (!t.events) | ||
| 2593 | t.events = new tinymce.dom.EventUtils(); | ||
| 2594 | |||
| 2595 | return t.events.add(target, name, func, scope || this); | ||
| 2596 | }, | ||
| 2597 | |||
| 2598 | unbind : function(target, name, func) { | ||
| 2599 | var t = this; | ||
| 2600 | |||
| 2601 | if (!t.events) | ||
| 2602 | t.events = new tinymce.dom.EventUtils(); | ||
| 2603 | |||
| 2604 | return t.events.remove(target, name, func); | ||
| 2605 | }, | ||
| 2606 | |||
| 2607 | |||
| 2608 | _findSib : function(node, selector, name) { | ||
| 2609 | var t = this, f = selector; | ||
| 2610 | |||
| 2611 | if (node) { | ||
| 2612 | // If expression make a function of it using is | ||
| 2613 | if (is(f, 'string')) { | ||
| 2614 | f = function(node) { | ||
| 2615 | return t.is(node, selector); | ||
| 2616 | }; | ||
| 2617 | } | ||
| 2618 | |||
| 2619 | // Loop all siblings | ||
| 2620 | for (node = node[name]; node; node = node[name]) { | ||
| 2621 | if (f(node)) | ||
| 2622 | return node; | ||
| 2623 | } | ||
| 2624 | } | ||
| 2625 | |||
| 2626 | return null; | ||
| 2627 | }, | ||
| 2628 | |||
| 2629 | _isRes : function(c) { | ||
| 2630 | // Is live resizble element | ||
| 2631 | return /^(top|left|bottom|right|width|height)/i.test(c) || /;\s*(top|left|bottom|right|width|height)/i.test(c); | ||
| 2632 | } | ||
| 2633 | |||
| 2634 | /* | ||
| 2635 | walk : function(n, f, s) { | ||
| 2636 | var d = this.doc, w; | ||
| 2637 | |||
| 2638 | if (d.createTreeWalker) { | ||
| 2639 | w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 2640 | |||
| 2641 | while ((n = w.nextNode()) != null) | ||
| 2642 | f.call(s || this, n); | ||
| 2643 | } else | ||
| 2644 | tinymce.walk(n, f, 'childNodes', s); | ||
| 2645 | } | ||
| 2646 | */ | ||
| 2647 | |||
| 2648 | /* | ||
| 2649 | toRGB : function(s) { | ||
| 2650 | var c = /^\s*?#([0-9A-F]{2})([0-9A-F]{1,2})([0-9A-F]{2})?\s*?$/.exec(s); | ||
| 2651 | |||
| 2652 | if (c) { | ||
| 2653 | // #FFF -> #FFFFFF | ||
| 2654 | if (!is(c[3])) | ||
| 2655 | c[3] = c[2] = c[1]; | ||
| 2656 | |||
| 2657 | return "rgb(" + parseInt(c[1], 16) + "," + parseInt(c[2], 16) + "," + parseInt(c[3], 16) + ")"; | ||
| 2658 | } | ||
| 2659 | |||
| 2660 | return s; | ||
| 2661 | } | ||
| 2662 | */ | ||
| 2663 | }); | ||
| 2664 | |||
| 2665 | tinymce.DOM = new tinymce.dom.DOMUtils(document, {process_html : 0}); | ||
| 2666 | })(tinymce); | ||
| 2667 | (function(ns) { | ||
| 2668 | // Traverse constants | ||
| 2669 | var EXTRACT = 0, CLONE = 1, DELETE = 2, extend = tinymce.extend; | ||
| 2670 | |||
| 2671 | function indexOf(child, parent) { | ||
| 2672 | var i, node; | ||
| 2673 | |||
| 2674 | if (child.parentNode != parent) | ||
| 2675 | return -1; | ||
| 2676 | |||
| 2677 | for (node = parent.firstChild, i = 0; node != child; node = node.nextSibling) | ||
| 2678 | i++; | ||
| 2679 | |||
| 2680 | return i; | ||
| 2681 | }; | ||
| 2682 | |||
| 2683 | function nodeIndex(n) { | ||
| 2684 | var i = 0; | ||
| 2685 | |||
| 2686 | while (n.previousSibling) { | ||
| 2687 | i++; | ||
| 2688 | n = n.previousSibling; | ||
| 2689 | } | ||
| 2690 | |||
| 2691 | return i; | ||
| 2692 | }; | ||
| 2693 | |||
| 2694 | function getSelectedNode(container, offset) { | ||
| 2695 | var child; | ||
| 2696 | |||
| 2697 | if (container.nodeType == 3 /* TEXT_NODE */) | ||
| 2698 | return container; | ||
| 2699 | |||
| 2700 | if (offset < 0) | ||
| 2701 | return container; | ||
| 2702 | |||
| 2703 | child = container.firstChild; | ||
| 2704 | while (child != null && offset > 0) { | ||
| 2705 | --offset; | ||
| 2706 | child = child.nextSibling; | ||
| 2707 | } | ||
| 2708 | |||
| 2709 | if (child != null) | ||
| 2710 | return child; | ||
| 2711 | |||
| 2712 | return container; | ||
| 2713 | }; | ||
| 2714 | |||
| 2715 | // Range constructor | ||
| 2716 | function Range(dom) { | ||
| 2717 | var d = dom.doc; | ||
| 2718 | |||
| 2719 | extend(this, { | ||
| 2720 | dom : dom, | ||
| 2721 | |||
| 2722 | // Inital states | ||
| 2723 | startContainer : d, | ||
| 2724 | startOffset : 0, | ||
| 2725 | endContainer : d, | ||
| 2726 | endOffset : 0, | ||
| 2727 | collapsed : true, | ||
| 2728 | commonAncestorContainer : d, | ||
| 2729 | |||
| 2730 | // Range constants | ||
| 2731 | START_TO_START : 0, | ||
| 2732 | START_TO_END : 1, | ||
| 2733 | END_TO_END : 2, | ||
| 2734 | END_TO_START : 3 | ||
| 2735 | }); | ||
| 2736 | }; | ||
| 2737 | |||
| 2738 | // Add range methods | ||
| 2739 | extend(Range.prototype, { | ||
| 2740 | setStart : function(n, o) { | ||
| 2741 | this._setEndPoint(true, n, o); | ||
| 2742 | }, | ||
| 2743 | |||
| 2744 | setEnd : function(n, o) { | ||
| 2745 | this._setEndPoint(false, n, o); | ||
| 2746 | }, | ||
| 2747 | |||
| 2748 | setStartBefore : function(n) { | ||
| 2749 | this.setStart(n.parentNode, nodeIndex(n)); | ||
| 2750 | }, | ||
| 2751 | |||
| 2752 | setStartAfter : function(n) { | ||
| 2753 | this.setStart(n.parentNode, nodeIndex(n) + 1); | ||
| 2754 | }, | ||
| 2755 | |||
| 2756 | setEndBefore : function(n) { | ||
| 2757 | this.setEnd(n.parentNode, nodeIndex(n)); | ||
| 2758 | }, | ||
| 2759 | |||
| 2760 | setEndAfter : function(n) { | ||
| 2761 | this.setEnd(n.parentNode, nodeIndex(n) + 1); | ||
| 2762 | }, | ||
| 2763 | |||
| 2764 | collapse : function(ts) { | ||
| 2765 | var t = this; | ||
| 2766 | |||
| 2767 | if (ts) { | ||
| 2768 | t.endContainer = t.startContainer; | ||
| 2769 | t.endOffset = t.startOffset; | ||
| 2770 | } else { | ||
| 2771 | t.startContainer = t.endContainer; | ||
| 2772 | t.startOffset = t.endOffset; | ||
| 2773 | } | ||
| 2774 | |||
| 2775 | t.collapsed = true; | ||
| 2776 | }, | ||
| 2777 | |||
| 2778 | selectNode : function(n) { | ||
| 2779 | this.setStartBefore(n); | ||
| 2780 | this.setEndAfter(n); | ||
| 2781 | }, | ||
| 2782 | |||
| 2783 | selectNodeContents : function(n) { | ||
| 2784 | this.setStart(n, 0); | ||
| 2785 | this.setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); | ||
| 2786 | }, | ||
| 2787 | |||
| 2788 | compareBoundaryPoints : function(h, r) { | ||
| 2789 | var t = this, sc = t.startContainer, so = t.startOffset, ec = t.endContainer, eo = t.endOffset; | ||
| 2790 | |||
| 2791 | // Check START_TO_START | ||
| 2792 | if (h === 0) | ||
| 2793 | return t._compareBoundaryPoints(sc, so, sc, so); | ||
| 2794 | |||
| 2795 | // Check START_TO_END | ||
| 2796 | if (h === 1) | ||
| 2797 | return t._compareBoundaryPoints(sc, so, ec, eo); | ||
| 2798 | |||
| 2799 | // Check END_TO_END | ||
| 2800 | if (h === 2) | ||
| 2801 | return t._compareBoundaryPoints(ec, eo, ec, eo); | ||
| 2802 | |||
| 2803 | // Check END_TO_START | ||
| 2804 | if (h === 3) | ||
| 2805 | return t._compareBoundaryPoints(ec, eo, sc, so); | ||
| 2806 | }, | ||
| 2807 | |||
| 2808 | deleteContents : function() { | ||
| 2809 | this._traverse(DELETE); | ||
| 2810 | }, | ||
| 2811 | |||
| 2812 | extractContents : function() { | ||
| 2813 | return this._traverse(EXTRACT); | ||
| 2814 | }, | ||
| 2815 | |||
| 2816 | cloneContents : function() { | ||
| 2817 | return this._traverse(CLONE); | ||
| 2818 | }, | ||
| 2819 | |||
| 2820 | insertNode : function(n) { | ||
| 2821 | var t = this, nn, o; | ||
| 2822 | |||
| 2823 | // Node is TEXT_NODE or CDATA | ||
| 2824 | if (n.nodeType === 3 || n.nodeType === 4) { | ||
| 2825 | nn = t.startContainer.splitText(t.startOffset); | ||
| 2826 | t.startContainer.parentNode.insertBefore(n, nn); | ||
| 2827 | } else { | ||
| 2828 | // Insert element node | ||
| 2829 | if (t.startContainer.childNodes.length > 0) | ||
| 2830 | o = t.startContainer.childNodes[t.startOffset]; | ||
| 2831 | |||
| 2832 | t.startContainer.insertBefore(n, o); | ||
| 2833 | } | ||
| 2834 | }, | ||
| 2835 | |||
| 2836 | surroundContents : function(n) { | ||
| 2837 | var t = this, f = t.extractContents(); | ||
| 2838 | |||
| 2839 | t.insertNode(n); | ||
| 2840 | n.appendChild(f); | ||
| 2841 | t.selectNode(n); | ||
| 2842 | }, | ||
| 2843 | |||
| 2844 | cloneRange : function() { | ||
| 2845 | var t = this; | ||
| 2846 | |||
| 2847 | return extend(new Range(t.dom), { | ||
| 2848 | startContainer : t.startContainer, | ||
| 2849 | startOffset : t.startOffset, | ||
| 2850 | endContainer : t.endContainer, | ||
| 2851 | endOffset : t.endOffset, | ||
| 2852 | collapsed : t.collapsed, | ||
| 2853 | commonAncestorContainer : t.commonAncestorContainer | ||
| 2854 | }); | ||
| 2855 | }, | ||
| 2856 | |||
| 2857 | /* | ||
| 2858 | detach : function() { | ||
| 2859 | // Not implemented | ||
| 2860 | }, | ||
| 2861 | */ | ||
| 2862 | // Internal methods | ||
| 2863 | |||
| 2864 | _isCollapsed : function() { | ||
| 2865 | return (this.startContainer == this.endContainer && this.startOffset == this.endOffset); | ||
| 2866 | }, | ||
| 2867 | |||
| 2868 | _compareBoundaryPoints : function (containerA, offsetA, containerB, offsetB) { | ||
| 2869 | var c, offsetC, n, cmnRoot, childA, childB; | ||
| 2870 | |||
| 2871 | // In the first case the boundary-points have the same container. A is before B | ||
| 2872 | // if its offset is less than the offset of B, A is equal to B if its offset is | ||
| 2873 | // equal to the offset of B, and A is after B if its offset is greater than the | ||
| 2874 | // offset of B. | ||
| 2875 | if (containerA == containerB) { | ||
| 2876 | if (offsetA == offsetB) { | ||
| 2877 | return 0; // equal | ||
| 2878 | } else if (offsetA < offsetB) { | ||
| 2879 | return -1; // before | ||
| 2880 | } else { | ||
| 2881 | return 1; // after | ||
| 2882 | } | ||
| 2883 | } | ||
| 2884 | |||
| 2885 | // In the second case a child node C of the container of A is an ancestor | ||
| 2886 | // container of B. In this case, A is before B if the offset of A is less than or | ||
| 2887 | // equal to the index of the child node C and A is after B otherwise. | ||
| 2888 | c = containerB; | ||
| 2889 | while (c && c.parentNode != containerA) { | ||
| 2890 | c = c.parentNode; | ||
| 2891 | } | ||
| 2892 | if (c) { | ||
| 2893 | offsetC = 0; | ||
| 2894 | n = containerA.firstChild; | ||
| 2895 | |||
| 2896 | while (n != c && offsetC < offsetA) { | ||
| 2897 | offsetC++; | ||
| 2898 | n = n.nextSibling; | ||
| 2899 | } | ||
| 2900 | |||
| 2901 | if (offsetA <= offsetC) { | ||
| 2902 | return -1; // before | ||
| 2903 | } else { | ||
| 2904 | return 1; // after | ||
| 2905 | } | ||
| 2906 | } | ||
| 2907 | |||
| 2908 | // In the third case a child node C of the container of B is an ancestor container | ||
| 2909 | // of A. In this case, A is before B if the index of the child node C is less than | ||
| 2910 | // the offset of B and A is after B otherwise. | ||
| 2911 | c = containerA; | ||
| 2912 | while (c && c.parentNode != containerB) { | ||
| 2913 | c = c.parentNode; | ||
| 2914 | } | ||
| 2915 | |||
| 2916 | if (c) { | ||
| 2917 | offsetC = 0; | ||
| 2918 | n = containerB.firstChild; | ||
| 2919 | |||
| 2920 | while (n != c && offsetC < offsetB) { | ||
| 2921 | offsetC++; | ||
| 2922 | n = n.nextSibling; | ||
| 2923 | } | ||
| 2924 | |||
| 2925 | if (offsetC < offsetB) { | ||
| 2926 | return -1; // before | ||
| 2927 | } else { | ||
| 2928 | return 1; // after | ||
| 2929 | } | ||
| 2930 | } | ||
| 2931 | |||
| 2932 | // In the fourth case, none of three other cases hold: the containers of A and B | ||
| 2933 | // are siblings or descendants of sibling nodes. In this case, A is before B if | ||
| 2934 | // the container of A is before the container of B in a pre-order traversal of the | ||
| 2935 | // Ranges' context tree and A is after B otherwise. | ||
| 2936 | cmnRoot = this.dom.findCommonAncestor(containerA, containerB); | ||
| 2937 | childA = containerA; | ||
| 2938 | |||
| 2939 | while (childA && childA.parentNode != cmnRoot) { | ||
| 2940 | childA = childA.parentNode; | ||
| 2941 | } | ||
| 2942 | |||
| 2943 | if (!childA) { | ||
| 2944 | childA = cmnRoot; | ||
| 2945 | } | ||
| 2946 | |||
| 2947 | childB = containerB; | ||
| 2948 | while (childB && childB.parentNode != cmnRoot) { | ||
| 2949 | childB = childB.parentNode; | ||
| 2950 | } | ||
| 2951 | |||
| 2952 | if (!childB) { | ||
| 2953 | childB = cmnRoot; | ||
| 2954 | } | ||
| 2955 | |||
| 2956 | if (childA == childB) { | ||
| 2957 | return 0; // equal | ||
| 2958 | } | ||
| 2959 | |||
| 2960 | n = cmnRoot.firstChild; | ||
| 2961 | while (n) { | ||
| 2962 | if (n == childA) { | ||
| 2963 | return -1; // before | ||
| 2964 | } | ||
| 2965 | |||
| 2966 | if (n == childB) { | ||
| 2967 | return 1; // after | ||
| 2968 | } | ||
| 2969 | |||
| 2970 | n = n.nextSibling; | ||
| 2971 | } | ||
| 2972 | }, | ||
| 2973 | |||
| 2974 | _setEndPoint : function(st, n, o) { | ||
| 2975 | var t = this, ec, sc; | ||
| 2976 | |||
| 2977 | if (st) { | ||
| 2978 | t.startContainer = n; | ||
| 2979 | t.startOffset = o; | ||
| 2980 | } else { | ||
| 2981 | t.endContainer = n; | ||
| 2982 | t.endOffset = o; | ||
| 2983 | } | ||
| 2984 | |||
| 2985 | // If one boundary-point of a Range is set to have a root container | ||
| 2986 | // other than the current one for the Range, the Range is collapsed to | ||
| 2987 | // the new position. This enforces the restriction that both boundary- | ||
| 2988 | // points of a Range must have the same root container. | ||
| 2989 | ec = t.endContainer; | ||
| 2990 | while (ec.parentNode) | ||
| 2991 | ec = ec.parentNode; | ||
| 2992 | |||
| 2993 | sc = t.startContainer; | ||
| 2994 | while (sc.parentNode) | ||
| 2995 | sc = sc.parentNode; | ||
| 2996 | |||
| 2997 | if (sc != ec) { | ||
| 2998 | t.collapse(st); | ||
| 2999 | } else { | ||
| 3000 | // The start position of a Range is guaranteed to never be after the | ||
| 3001 | // end position. To enforce this restriction, if the start is set to | ||
| 3002 | // be at a position after the end, the Range is collapsed to that | ||
| 3003 | // position. | ||
| 3004 | if (t._compareBoundaryPoints(t.startContainer, t.startOffset, t.endContainer, t.endOffset) > 0) | ||
| 3005 | t.collapse(st); | ||
| 3006 | } | ||
| 3007 | |||
| 3008 | t.collapsed = t._isCollapsed(); | ||
| 3009 | t.commonAncestorContainer = t.dom.findCommonAncestor(t.startContainer, t.endContainer); | ||
| 3010 | }, | ||
| 3011 | |||
| 3012 | // This code is heavily "inspired" by the Apache Xerces implementation. I hope they don't mind. :) | ||
| 3013 | |||
| 3014 | _traverse : function(how) { | ||
| 3015 | var t = this, c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; | ||
| 3016 | |||
| 3017 | if (t.startContainer == t.endContainer) | ||
| 3018 | return t._traverseSameContainer(how); | ||
| 3019 | |||
| 3020 | for (c = t.endContainer, p = c.parentNode; p != null; c = p, p = p.parentNode) { | ||
| 3021 | if (p == t.startContainer) | ||
| 3022 | return t._traverseCommonStartContainer(c, how); | ||
| 3023 | |||
| 3024 | ++endContainerDepth; | ||
| 3025 | } | ||
| 3026 | |||
| 3027 | for (c = t.startContainer, p = c.parentNode; p != null; c = p, p = p.parentNode) { | ||
| 3028 | if (p == t.endContainer) | ||
| 3029 | return t._traverseCommonEndContainer(c, how); | ||
| 3030 | |||
| 3031 | ++startContainerDepth; | ||
| 3032 | } | ||
| 3033 | |||
| 3034 | depthDiff = startContainerDepth - endContainerDepth; | ||
| 3035 | |||
| 3036 | startNode = t.startContainer; | ||
| 3037 | while (depthDiff > 0) { | ||
| 3038 | startNode = startNode.parentNode; | ||
| 3039 | depthDiff--; | ||
| 3040 | } | ||
| 3041 | |||
| 3042 | endNode = t.endContainer; | ||
| 3043 | while (depthDiff < 0) { | ||
| 3044 | endNode = endNode.parentNode; | ||
| 3045 | depthDiff++; | ||
| 3046 | } | ||
| 3047 | |||
| 3048 | // ascend the ancestor hierarchy until we have a common parent. | ||
| 3049 | for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { | ||
| 3050 | startNode = sp; | ||
| 3051 | endNode = ep; | ||
| 3052 | } | ||
| 3053 | |||
| 3054 | return t._traverseCommonAncestors(startNode, endNode, how); | ||
| 3055 | }, | ||
| 3056 | |||
| 3057 | _traverseSameContainer : function(how) { | ||
| 3058 | var t = this, frag, s, sub, n, cnt, sibling, xferNode; | ||
| 3059 | |||
| 3060 | if (how != DELETE) | ||
| 3061 | frag = t.dom.doc.createDocumentFragment(); | ||
| 3062 | |||
| 3063 | // If selection is empty, just return the fragment | ||
| 3064 | if (t.startOffset == t.endOffset) | ||
| 3065 | return frag; | ||
| 3066 | |||
| 3067 | // Text node needs special case handling | ||
| 3068 | if (t.startContainer.nodeType == 3 /* TEXT_NODE */) { | ||
| 3069 | // get the substring | ||
| 3070 | s = t.startContainer.nodeValue; | ||
| 3071 | sub = s.substring(t.startOffset, t.endOffset); | ||
| 3072 | |||
| 3073 | // set the original text node to its new value | ||
| 3074 | if (how != CLONE) { | ||
| 3075 | t.startContainer.deleteData(t.startOffset, t.endOffset - t.startOffset); | ||
| 3076 | |||
| 3077 | // Nothing is partially selected, so collapse to start point | ||
| 3078 | t.collapse(true); | ||
| 3079 | } | ||
| 3080 | |||
| 3081 | if (how == DELETE) | ||
| 3082 | return null; | ||
| 3083 | |||
| 3084 | frag.appendChild(t.dom.doc.createTextNode(sub)); | ||
| 3085 | return frag; | ||
| 3086 | } | ||
| 3087 | |||
| 3088 | // Copy nodes between the start/end offsets. | ||
| 3089 | n = getSelectedNode(t.startContainer, t.startOffset); | ||
| 3090 | cnt = t.endOffset - t.startOffset; | ||
| 3091 | |||
| 3092 | while (cnt > 0) { | ||
| 3093 | sibling = n.nextSibling; | ||
| 3094 | xferNode = t._traverseFullySelected(n, how); | ||
| 3095 | |||
| 3096 | if (frag) | ||
| 3097 | frag.appendChild( xferNode ); | ||
| 3098 | |||
| 3099 | --cnt; | ||
| 3100 | n = sibling; | ||
| 3101 | } | ||
| 3102 | |||
| 3103 | // Nothing is partially selected, so collapse to start point | ||
| 3104 | if (how != CLONE) | ||
| 3105 | t.collapse(true); | ||
| 3106 | |||
| 3107 | return frag; | ||
| 3108 | }, | ||
| 3109 | |||
| 3110 | _traverseCommonStartContainer : function(endAncestor, how) { | ||
| 3111 | var t = this, frag, n, endIdx, cnt, sibling, xferNode; | ||
| 3112 | |||
| 3113 | if (how != DELETE) | ||
| 3114 | frag = t.dom.doc.createDocumentFragment(); | ||
| 3115 | |||
| 3116 | n = t._traverseRightBoundary(endAncestor, how); | ||
| 3117 | |||
| 3118 | if (frag) | ||
| 3119 | frag.appendChild(n); | ||
| 3120 | |||
| 3121 | endIdx = indexOf(endAncestor, t.startContainer); | ||
| 3122 | cnt = endIdx - t.startOffset; | ||
| 3123 | |||
| 3124 | if (cnt <= 0) { | ||
| 3125 | // Collapse to just before the endAncestor, which | ||
| 3126 | // is partially selected. | ||
| 3127 | if (how != CLONE) { | ||
| 3128 | t.setEndBefore(endAncestor); | ||
| 3129 | t.collapse(false); | ||
| 3130 | } | ||
| 3131 | |||
| 3132 | return frag; | ||
| 3133 | } | ||
| 3134 | |||
| 3135 | n = endAncestor.previousSibling; | ||
| 3136 | while (cnt > 0) { | ||
| 3137 | sibling = n.previousSibling; | ||
| 3138 | xferNode = t._traverseFullySelected(n, how); | ||
| 3139 | |||
| 3140 | if (frag) | ||
| 3141 | frag.insertBefore(xferNode, frag.firstChild); | ||
| 3142 | |||
| 3143 | --cnt; | ||
| 3144 | n = sibling; | ||
| 3145 | } | ||
| 3146 | |||
| 3147 | // Collapse to just before the endAncestor, which | ||
| 3148 | // is partially selected. | ||
| 3149 | if (how != CLONE) { | ||
| 3150 | t.setEndBefore(endAncestor); | ||
| 3151 | t.collapse(false); | ||
| 3152 | } | ||
| 3153 | |||
| 3154 | return frag; | ||
| 3155 | }, | ||
| 3156 | |||
| 3157 | _traverseCommonEndContainer : function(startAncestor, how) { | ||
| 3158 | var t = this, frag, startIdx, n, cnt, sibling, xferNode; | ||
| 3159 | |||
| 3160 | if (how != DELETE) | ||
| 3161 | frag = t.dom.doc.createDocumentFragment(); | ||
| 3162 | |||
| 3163 | n = t._traverseLeftBoundary(startAncestor, how); | ||
| 3164 | if (frag) | ||
| 3165 | frag.appendChild(n); | ||
| 3166 | |||
| 3167 | startIdx = indexOf(startAncestor, t.endContainer); | ||
| 3168 | ++startIdx; // Because we already traversed it.... | ||
| 3169 | |||
| 3170 | cnt = t.endOffset - startIdx; | ||
| 3171 | n = startAncestor.nextSibling; | ||
| 3172 | while (cnt > 0) { | ||
| 3173 | sibling = n.nextSibling; | ||
| 3174 | xferNode = t._traverseFullySelected(n, how); | ||
| 3175 | |||
| 3176 | if (frag) | ||
| 3177 | frag.appendChild(xferNode); | ||
| 3178 | |||
| 3179 | --cnt; | ||
| 3180 | n = sibling; | ||
| 3181 | } | ||
| 3182 | |||
| 3183 | if (how != CLONE) { | ||
| 3184 | t.setStartAfter(startAncestor); | ||
| 3185 | t.collapse(true); | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | return frag; | ||
| 3189 | }, | ||
| 3190 | |||
| 3191 | _traverseCommonAncestors : function(startAncestor, endAncestor, how) { | ||
| 3192 | var t = this, n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; | ||
| 3193 | |||
| 3194 | if (how != DELETE) | ||
| 3195 | frag = t.dom.doc.createDocumentFragment(); | ||
| 3196 | |||
| 3197 | n = t._traverseLeftBoundary(startAncestor, how); | ||
| 3198 | if (frag) | ||
| 3199 | frag.appendChild(n); | ||
| 3200 | |||
| 3201 | commonParent = startAncestor.parentNode; | ||
| 3202 | startOffset = indexOf(startAncestor, commonParent); | ||
| 3203 | endOffset = indexOf(endAncestor, commonParent); | ||
| 3204 | ++startOffset; | ||
| 3205 | |||
| 3206 | cnt = endOffset - startOffset; | ||
| 3207 | sibling = startAncestor.nextSibling; | ||
| 3208 | |||
| 3209 | while (cnt > 0) { | ||
| 3210 | nextSibling = sibling.nextSibling; | ||
| 3211 | n = t._traverseFullySelected(sibling, how); | ||
| 3212 | |||
| 3213 | if (frag) | ||
| 3214 | frag.appendChild(n); | ||
| 3215 | |||
| 3216 | sibling = nextSibling; | ||
| 3217 | --cnt; | ||
| 3218 | } | ||
| 3219 | |||
| 3220 | n = t._traverseRightBoundary(endAncestor, how); | ||
| 3221 | |||
| 3222 | if (frag) | ||
| 3223 | frag.appendChild(n); | ||
| 3224 | |||
| 3225 | if (how != CLONE) { | ||
| 3226 | t.setStartAfter(startAncestor); | ||
| 3227 | t.collapse(true); | ||
| 3228 | } | ||
| 3229 | |||
| 3230 | return frag; | ||
| 3231 | }, | ||
| 3232 | |||
| 3233 | _traverseRightBoundary : function(root, how) { | ||
| 3234 | var t = this, next = getSelectedNode(t.endContainer, t.endOffset - 1), parent, clonedParent, prevSibling, clonedChild, clonedGrandParent; | ||
| 3235 | var isFullySelected = next != t.endContainer; | ||
| 3236 | |||
| 3237 | if (next == root) | ||
| 3238 | return t._traverseNode(next, isFullySelected, false, how); | ||
| 3239 | |||
| 3240 | parent = next.parentNode; | ||
| 3241 | clonedParent = t._traverseNode(parent, false, false, how); | ||
| 3242 | |||
| 3243 | while (parent != null) { | ||
| 3244 | while (next != null) { | ||
| 3245 | prevSibling = next.previousSibling; | ||
| 3246 | clonedChild = t._traverseNode(next, isFullySelected, false, how); | ||
| 3247 | |||
| 3248 | if (how != DELETE) | ||
| 3249 | clonedParent.insertBefore(clonedChild, clonedParent.firstChild); | ||
| 3250 | |||
| 3251 | isFullySelected = true; | ||
| 3252 | next = prevSibling; | ||
| 3253 | } | ||
| 3254 | |||
| 3255 | if (parent == root) | ||
| 3256 | return clonedParent; | ||
| 3257 | |||
| 3258 | next = parent.previousSibling; | ||
| 3259 | parent = parent.parentNode; | ||
| 3260 | |||
| 3261 | clonedGrandParent = t._traverseNode(parent, false, false, how); | ||
| 3262 | |||
| 3263 | if (how != DELETE) | ||
| 3264 | clonedGrandParent.appendChild(clonedParent); | ||
| 3265 | |||
| 3266 | clonedParent = clonedGrandParent; | ||
| 3267 | } | ||
| 3268 | |||
| 3269 | // should never occur | ||
| 3270 | return null; | ||
| 3271 | }, | ||
| 3272 | |||
| 3273 | _traverseLeftBoundary : function(root, how) { | ||
| 3274 | var t = this, next = getSelectedNode(t.startContainer, t.startOffset); | ||
| 3275 | var isFullySelected = next != t.startContainer, parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; | ||
| 3276 | |||
| 3277 | if (next == root) | ||
| 3278 | return t._traverseNode(next, isFullySelected, true, how); | ||
| 3279 | |||
| 3280 | parent = next.parentNode; | ||
| 3281 | clonedParent = t._traverseNode(parent, false, true, how); | ||
| 3282 | |||
| 3283 | while (parent != null) { | ||
| 3284 | while (next != null) { | ||
| 3285 | nextSibling = next.nextSibling; | ||
| 3286 | clonedChild = t._traverseNode(next, isFullySelected, true, how); | ||
| 3287 | |||
| 3288 | if (how != DELETE) | ||
| 3289 | clonedParent.appendChild(clonedChild); | ||
| 3290 | |||
| 3291 | isFullySelected = true; | ||
| 3292 | next = nextSibling; | ||
| 3293 | } | ||
| 3294 | |||
| 3295 | if (parent == root) | ||
| 3296 | return clonedParent; | ||
| 3297 | |||
| 3298 | next = parent.nextSibling; | ||
| 3299 | parent = parent.parentNode; | ||
| 3300 | |||
| 3301 | clonedGrandParent = t._traverseNode(parent, false, true, how); | ||
| 3302 | |||
| 3303 | if (how != DELETE) | ||
| 3304 | clonedGrandParent.appendChild(clonedParent); | ||
| 3305 | |||
| 3306 | clonedParent = clonedGrandParent; | ||
| 3307 | } | ||
| 3308 | |||
| 3309 | // should never occur | ||
| 3310 | return null; | ||
| 3311 | }, | ||
| 3312 | |||
| 3313 | _traverseNode : function(n, isFullySelected, isLeft, how) { | ||
| 3314 | var t = this, txtValue, newNodeValue, oldNodeValue, offset, newNode; | ||
| 3315 | |||
| 3316 | if (isFullySelected) | ||
| 3317 | return t._traverseFullySelected(n, how); | ||
| 3318 | |||
| 3319 | if (n.nodeType == 3 /* TEXT_NODE */) { | ||
| 3320 | txtValue = n.nodeValue; | ||
| 3321 | |||
| 3322 | if (isLeft) { | ||
| 3323 | offset = t.startOffset; | ||
| 3324 | newNodeValue = txtValue.substring(offset); | ||
| 3325 | oldNodeValue = txtValue.substring(0, offset); | ||
| 3326 | } else { | ||
| 3327 | offset = t.endOffset; | ||
| 3328 | newNodeValue = txtValue.substring(0, offset); | ||
| 3329 | oldNodeValue = txtValue.substring(offset); | ||
| 3330 | } | ||
| 3331 | |||
| 3332 | if (how != CLONE) | ||
| 3333 | n.nodeValue = oldNodeValue; | ||
| 3334 | |||
| 3335 | if (how == DELETE) | ||
| 3336 | return null; | ||
| 3337 | |||
| 3338 | newNode = n.cloneNode(false); | ||
| 3339 | newNode.nodeValue = newNodeValue; | ||
| 3340 | |||
| 3341 | return newNode; | ||
| 3342 | } | ||
| 3343 | |||
| 3344 | if (how == DELETE) | ||
| 3345 | return null; | ||
| 3346 | |||
| 3347 | return n.cloneNode(false); | ||
| 3348 | }, | ||
| 3349 | |||
| 3350 | _traverseFullySelected : function(n, how) { | ||
| 3351 | var t = this; | ||
| 3352 | |||
| 3353 | if (how != DELETE) | ||
| 3354 | return how == CLONE ? n.cloneNode(true) : n; | ||
| 3355 | |||
| 3356 | n.parentNode.removeChild(n); | ||
| 3357 | return null; | ||
| 3358 | } | ||
| 3359 | }); | ||
| 3360 | |||
| 3361 | ns.Range = Range; | ||
| 3362 | })(tinymce.dom); | ||
| 3363 | (function() { | ||
| 3364 | function Selection(selection) { | ||
| 3365 | var t = this, invisibleChar = '\uFEFF', range, lastIERng; | ||
| 3366 | |||
| 3367 | function compareRanges(rng1, rng2) { | ||
| 3368 | if (rng1 && rng2) { | ||
| 3369 | // Both are control ranges and the selected element matches | ||
| 3370 | if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) | ||
| 3371 | return 1; | ||
| 3372 | |||
| 3373 | // Both are text ranges and the range matches | ||
| 3374 | if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) | ||
| 3375 | return 1; | ||
| 3376 | } | ||
| 3377 | |||
| 3378 | return 0; | ||
| 3379 | }; | ||
| 3380 | |||
| 3381 | function getRange() { | ||
| 3382 | var dom = selection.dom, ieRange = selection.getRng(), domRange = dom.createRng(), startPos, endPos, element, sc, ec, collapsed; | ||
| 3383 | |||
| 3384 | function findIndex(element) { | ||
| 3385 | var nl = element.parentNode.childNodes, i; | ||
| 3386 | |||
| 3387 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 3388 | if (nl[i] == element) | ||
| 3389 | return i; | ||
| 3390 | } | ||
| 3391 | |||
| 3392 | return -1; | ||
| 3393 | }; | ||
| 3394 | |||
| 3395 | function findEndPoint(start) { | ||
| 3396 | var rng = ieRange.duplicate(), parent, i, nl, n, offset = 0, index = 0, pos, tmpRng; | ||
| 3397 | |||
| 3398 | // Insert marker character | ||
| 3399 | rng.collapse(start); | ||
| 3400 | parent = rng.parentElement(); | ||
| 3401 | rng.pasteHTML(invisibleChar); // Needs to be a pasteHTML instead of .text = since IE has a bug with nodeValue | ||
| 3402 | |||
| 3403 | // Find marker character | ||
| 3404 | nl = parent.childNodes; | ||
| 3405 | for (i = 0; i < nl.length; i++) { | ||
| 3406 | n = nl[i]; | ||
| 3407 | |||
| 3408 | // Calculate node index excluding text node fragmentation | ||
| 3409 | if (i > 0 && (n.nodeType !== 3 || nl[i - 1].nodeType !== 3)) | ||
| 3410 | index++; | ||
| 3411 | |||
| 3412 | // If text node then calculate offset | ||
| 3413 | if (n.nodeType === 3) { | ||
| 3414 | // Look for marker | ||
| 3415 | pos = n.nodeValue.indexOf(invisibleChar); | ||
| 3416 | if (pos !== -1) { | ||
| 3417 | offset += pos; | ||
| 3418 | break; | ||
| 3419 | } | ||
| 3420 | |||
| 3421 | offset += n.nodeValue.length; | ||
| 3422 | } else | ||
| 3423 | offset = 0; | ||
| 3424 | } | ||
| 3425 | |||
| 3426 | // Remove marker character | ||
| 3427 | rng.moveStart('character', -1); | ||
| 3428 | rng.text = ''; | ||
| 3429 | |||
| 3430 | return {index : index, offset : offset, parent : parent}; | ||
| 3431 | }; | ||
| 3432 | |||
| 3433 | // If selection is outside the current document just return an empty range | ||
| 3434 | element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); | ||
| 3435 | if (element.ownerDocument != dom.doc) | ||
| 3436 | return domRange; | ||
| 3437 | |||
| 3438 | // Handle control selection or text selection of a image | ||
| 3439 | if (ieRange.item || !element.hasChildNodes()) { | ||
| 3440 | domRange.setStart(element.parentNode, findIndex(element)); | ||
| 3441 | domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); | ||
| 3442 | |||
| 3443 | return domRange; | ||
| 3444 | } | ||
| 3445 | |||
| 3446 | // Check collapsed state | ||
| 3447 | collapsed = selection.isCollapsed(); | ||
| 3448 | |||
| 3449 | // Find start and end pos index and offset | ||
| 3450 | startPos = findEndPoint(true); | ||
| 3451 | endPos = findEndPoint(false); | ||
| 3452 | |||
| 3453 | // Normalize the elements to avoid fragmented dom | ||
| 3454 | startPos.parent.normalize(); | ||
| 3455 | endPos.parent.normalize(); | ||
| 3456 | |||
| 3457 | // Set start container and offset | ||
| 3458 | sc = startPos.parent.childNodes[Math.min(startPos.index, startPos.parent.childNodes.length - 1)]; | ||
| 3459 | |||
| 3460 | if (sc.nodeType != 3) | ||
| 3461 | domRange.setStart(startPos.parent, startPos.index); | ||
| 3462 | else | ||
| 3463 | domRange.setStart(startPos.parent.childNodes[startPos.index], startPos.offset); | ||
| 3464 | |||
| 3465 | // Set end container and offset | ||
| 3466 | ec = endPos.parent.childNodes[Math.min(endPos.index, endPos.parent.childNodes.length - 1)]; | ||
| 3467 | |||
| 3468 | if (ec.nodeType != 3) { | ||
| 3469 | if (!collapsed) | ||
| 3470 | endPos.index++; | ||
| 3471 | |||
| 3472 | domRange.setEnd(endPos.parent, endPos.index); | ||
| 3473 | } else | ||
| 3474 | domRange.setEnd(endPos.parent.childNodes[endPos.index], endPos.offset); | ||
| 3475 | |||
| 3476 | // If not collapsed then make sure offsets are valid | ||
| 3477 | if (!collapsed) { | ||
| 3478 | sc = domRange.startContainer; | ||
| 3479 | if (sc.nodeType == 1) | ||
| 3480 | domRange.setStart(sc, Math.min(domRange.startOffset, sc.childNodes.length)); | ||
| 3481 | |||
| 3482 | ec = domRange.endContainer; | ||
| 3483 | if (ec.nodeType == 1) | ||
| 3484 | domRange.setEnd(ec, Math.min(domRange.endOffset, ec.childNodes.length)); | ||
| 3485 | } | ||
| 3486 | |||
| 3487 | // Restore selection to new range | ||
| 3488 | t.addRange(domRange); | ||
| 3489 | |||
| 3490 | return domRange; | ||
| 3491 | }; | ||
| 3492 | |||
| 3493 | this.addRange = function(rng) { | ||
| 3494 | var ieRng, body = selection.dom.doc.body, startPos, endPos, sc, so, ec, eo; | ||
| 3495 | |||
| 3496 | // Setup some shorter versions | ||
| 3497 | sc = rng.startContainer; | ||
| 3498 | so = rng.startOffset; | ||
| 3499 | ec = rng.endContainer; | ||
| 3500 | eo = rng.endOffset; | ||
| 3501 | ieRng = body.createTextRange(); | ||
| 3502 | |||
| 3503 | // Find element | ||
| 3504 | sc = sc.nodeType == 1 ? sc.childNodes[Math.min(so, sc.childNodes.length - 1)] : sc; | ||
| 3505 | ec = ec.nodeType == 1 ? ec.childNodes[Math.min(so == eo ? eo : eo - 1, ec.childNodes.length - 1)] : ec; | ||
| 3506 | |||
| 3507 | // Single element selection | ||
| 3508 | if (sc == ec && sc.nodeType == 1) { | ||
| 3509 | // Make control selection for some elements | ||
| 3510 | if (/^(IMG|TABLE)$/.test(sc.nodeName) && so != eo) { | ||
| 3511 | ieRng = body.createControlRange(); | ||
| 3512 | ieRng.addElement(sc); | ||
| 3513 | } else { | ||
| 3514 | ieRng = body.createTextRange(); | ||
| 3515 | |||
| 3516 | // Padd empty elements with invisible character | ||
| 3517 | if (!sc.hasChildNodes() && sc.canHaveHTML) | ||
| 3518 | sc.innerHTML = invisibleChar; | ||
| 3519 | |||
| 3520 | // Select element contents | ||
| 3521 | ieRng.moveToElementText(sc); | ||
| 3522 | |||
| 3523 | // If it's only containing a padding remove it so the caret remains | ||
| 3524 | if (sc.innerHTML == invisibleChar) { | ||
| 3525 | ieRng.collapse(true); | ||
| 3526 | sc.removeChild(sc.firstChild); | ||
| 3527 | } | ||
| 3528 | } | ||
| 3529 | |||
| 3530 | if (so == eo) | ||
| 3531 | ieRng.collapse(eo <= rng.endContainer.childNodes.length - 1); | ||
| 3532 | |||
| 3533 | ieRng.select(); | ||
| 3534 | |||
| 3535 | return; | ||
| 3536 | } | ||
| 3537 | |||
| 3538 | function getCharPos(container, offset) { | ||
| 3539 | var nodeVal, rng, pos; | ||
| 3540 | |||
| 3541 | if (container.nodeType != 3) | ||
| 3542 | return -1; | ||
| 3543 | |||
| 3544 | nodeVal = container.nodeValue; | ||
| 3545 | rng = body.createTextRange(); | ||
| 3546 | |||
| 3547 | // Insert marker at offset position | ||
| 3548 | container.nodeValue = nodeVal.substring(0, offset) + invisibleChar + nodeVal.substring(offset); | ||
| 3549 | |||
| 3550 | // Find char pos of marker and remove it | ||
| 3551 | rng.moveToElementText(container.parentNode); | ||
| 3552 | rng.findText(invisibleChar); | ||
| 3553 | pos = Math.abs(rng.moveStart('character', -0xFFFFF)); | ||
| 3554 | container.nodeValue = nodeVal; | ||
| 3555 | |||
| 3556 | return pos; | ||
| 3557 | }; | ||
| 3558 | |||
| 3559 | // Collapsed range | ||
| 3560 | if (rng.collapsed) { | ||
| 3561 | pos = getCharPos(sc, so); | ||
| 3562 | |||
| 3563 | ieRng = body.createTextRange(); | ||
| 3564 | ieRng.move('character', pos); | ||
| 3565 | ieRng.select(); | ||
| 3566 | |||
| 3567 | return; | ||
| 3568 | } else { | ||
| 3569 | // If same text container | ||
| 3570 | if (sc == ec && sc.nodeType == 3) { | ||
| 3571 | startPos = getCharPos(sc, so); | ||
| 3572 | |||
| 3573 | ieRng = body.createTextRange(); | ||
| 3574 | ieRng.move('character', startPos); | ||
| 3575 | ieRng.moveEnd('character', eo - so); | ||
| 3576 | ieRng.select(); | ||
| 3577 | |||
| 3578 | return; | ||
| 3579 | } | ||
| 3580 | |||
| 3581 | // Get caret positions | ||
| 3582 | startPos = getCharPos(sc, so); | ||
| 3583 | endPos = getCharPos(ec, eo); | ||
| 3584 | ieRng = body.createTextRange(); | ||
| 3585 | |||
| 3586 | // Move start of range to start character position or start element | ||
| 3587 | if (startPos == -1) { | ||
| 3588 | ieRng.moveToElementText(sc); | ||
| 3589 | startPos = 0; | ||
| 3590 | } else | ||
| 3591 | ieRng.move('character', startPos); | ||
| 3592 | |||
| 3593 | // Move end of range to end character position or end element | ||
| 3594 | tmpRng = body.createTextRange(); | ||
| 3595 | |||
| 3596 | if (endPos == -1) | ||
| 3597 | tmpRng.moveToElementText(ec); | ||
| 3598 | else | ||
| 3599 | tmpRng.move('character', endPos); | ||
| 3600 | |||
| 3601 | ieRng.setEndPoint('EndToEnd', tmpRng); | ||
| 3602 | ieRng.select(); | ||
| 3603 | |||
| 3604 | return; | ||
| 3605 | } | ||
| 3606 | }; | ||
| 3607 | |||
| 3608 | this.getRangeAt = function() { | ||
| 3609 | // Setup new range if the cache is empty | ||
| 3610 | if (!range || !compareRanges(lastIERng, selection.getRng())) { | ||
| 3611 | range = getRange(); | ||
| 3612 | |||
| 3613 | // Store away text range for next call | ||
| 3614 | lastIERng = selection.getRng(); | ||
| 3615 | } | ||
| 3616 | |||
| 3617 | // Return cached range | ||
| 3618 | return range; | ||
| 3619 | }; | ||
| 3620 | |||
| 3621 | this.destroy = function() { | ||
| 3622 | // Destroy cached range and last IE range to avoid memory leaks | ||
| 3623 | lastIERng = range = null; | ||
| 3624 | }; | ||
| 3625 | }; | ||
| 3626 | |||
| 3627 | // Expose the selection object | ||
| 3628 | tinymce.dom.TridentSelection = Selection; | ||
| 3629 | })(); | ||
| 3630 | (function(tinymce) { | ||
| 3631 | // Shorten names | ||
| 3632 | var each = tinymce.each, DOM = tinymce.DOM, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit, Event; | ||
| 3633 | |||
| 3634 | tinymce.create('tinymce.dom.EventUtils', { | ||
| 3635 | EventUtils : function() { | ||
| 3636 | this.inits = []; | ||
| 3637 | this.events = []; | ||
| 3638 | }, | ||
| 3639 | |||
| 3640 | add : function(o, n, f, s) { | ||
| 3641 | var cb, t = this, el = t.events, r; | ||
| 3642 | |||
| 3643 | if (n instanceof Array) { | ||
| 3644 | r = []; | ||
| 3645 | |||
| 3646 | each(n, function(n) { | ||
| 3647 | r.push(t.add(o, n, f, s)); | ||
| 3648 | }); | ||
| 3649 | |||
| 3650 | return r; | ||
| 3651 | } | ||
| 3652 | |||
| 3653 | // Handle array | ||
| 3654 | if (o && o.hasOwnProperty && o instanceof Array) { | ||
| 3655 | r = []; | ||
| 3656 | |||
| 3657 | each(o, function(o) { | ||
| 3658 | o = DOM.get(o); | ||
| 3659 | r.push(t.add(o, n, f, s)); | ||
| 3660 | }); | ||
| 3661 | |||
| 3662 | return r; | ||
| 3663 | } | ||
| 3664 | |||
| 3665 | o = DOM.get(o); | ||
| 3666 | |||
| 3667 | if (!o) | ||
| 3668 | return; | ||
| 3669 | |||
| 3670 | // Setup event callback | ||
| 3671 | cb = function(e) { | ||
| 3672 | // Is all events disabled | ||
| 3673 | if (t.disabled) | ||
| 3674 | return; | ||
| 3675 | |||
| 3676 | e = e || window.event; | ||
| 3677 | |||
| 3678 | // Patch in target, preventDefault and stopPropagation in IE it's W3C valid | ||
| 3679 | if (e && isIE) { | ||
| 3680 | if (!e.target) | ||
| 3681 | e.target = e.srcElement; | ||
| 3682 | |||
| 3683 | // Patch in preventDefault, stopPropagation methods for W3C compatibility | ||
| 3684 | tinymce.extend(e, t._stoppers); | ||
| 3685 | } | ||
| 3686 | |||
| 3687 | if (!s) | ||
| 3688 | return f(e); | ||
| 3689 | |||
| 3690 | return f.call(s, e); | ||
| 3691 | }; | ||
| 3692 | |||
| 3693 | if (n == 'unload') { | ||
| 3694 | tinymce.unloads.unshift({func : cb}); | ||
| 3695 | return cb; | ||
| 3696 | } | ||
| 3697 | |||
| 3698 | if (n == 'init') { | ||
| 3699 | if (t.domLoaded) | ||
| 3700 | cb(); | ||
| 3701 | else | ||
| 3702 | t.inits.push(cb); | ||
| 3703 | |||
| 3704 | return cb; | ||
| 3705 | } | ||
| 3706 | |||
| 3707 | // Store away listener reference | ||
| 3708 | el.push({ | ||
| 3709 | obj : o, | ||
| 3710 | name : n, | ||
| 3711 | func : f, | ||
| 3712 | cfunc : cb, | ||
| 3713 | scope : s | ||
| 3714 | }); | ||
| 3715 | |||
| 3716 | t._add(o, n, cb); | ||
| 3717 | |||
| 3718 | return f; | ||
| 3719 | }, | ||
| 3720 | |||
| 3721 | remove : function(o, n, f) { | ||
| 3722 | var t = this, a = t.events, s = false, r; | ||
| 3723 | |||
| 3724 | // Handle array | ||
| 3725 | if (o && o.hasOwnProperty && o instanceof Array) { | ||
| 3726 | r = []; | ||
| 3727 | |||
| 3728 | each(o, function(o) { | ||
| 3729 | o = DOM.get(o); | ||
| 3730 | r.push(t.remove(o, n, f)); | ||
| 3731 | }); | ||
| 3732 | |||
| 3733 | return r; | ||
| 3734 | } | ||
| 3735 | |||
| 3736 | o = DOM.get(o); | ||
| 3737 | |||
| 3738 | each(a, function(e, i) { | ||
| 3739 | if (e.obj == o && e.name == n && (!f || (e.func == f || e.cfunc == f))) { | ||
| 3740 | a.splice(i, 1); | ||
| 3741 | t._remove(o, n, e.cfunc); | ||
| 3742 | s = true; | ||
| 3743 | return false; | ||
| 3744 | } | ||
| 3745 | }); | ||
| 3746 | |||
| 3747 | return s; | ||
| 3748 | }, | ||
| 3749 | |||
| 3750 | clear : function(o) { | ||
| 3751 | var t = this, a = t.events, i, e; | ||
| 3752 | |||
| 3753 | if (o) { | ||
| 3754 | o = DOM.get(o); | ||
| 3755 | |||
| 3756 | for (i = a.length - 1; i >= 0; i--) { | ||
| 3757 | e = a[i]; | ||
| 3758 | |||
| 3759 | if (e.obj === o) { | ||
| 3760 | t._remove(e.obj, e.name, e.cfunc); | ||
| 3761 | e.obj = e.cfunc = null; | ||
| 3762 | a.splice(i, 1); | ||
| 3763 | } | ||
| 3764 | } | ||
| 3765 | } | ||
| 3766 | }, | ||
| 3767 | |||
| 3768 | cancel : function(e) { | ||
| 3769 | if (!e) | ||
| 3770 | return false; | ||
| 3771 | |||
| 3772 | this.stop(e); | ||
| 3773 | |||
| 3774 | return this.prevent(e); | ||
| 3775 | }, | ||
| 3776 | |||
| 3777 | stop : function(e) { | ||
| 3778 | if (e.stopPropagation) | ||
| 3779 | e.stopPropagation(); | ||
| 3780 | else | ||
| 3781 | e.cancelBubble = true; | ||
| 3782 | |||
| 3783 | return false; | ||
| 3784 | }, | ||
| 3785 | |||
| 3786 | prevent : function(e) { | ||
| 3787 | if (e.preventDefault) | ||
| 3788 | e.preventDefault(); | ||
| 3789 | else | ||
| 3790 | e.returnValue = false; | ||
| 3791 | |||
| 3792 | return false; | ||
| 3793 | }, | ||
| 3794 | |||
| 3795 | destroy : function() { | ||
| 3796 | var t = this; | ||
| 3797 | |||
| 3798 | each(t.events, function(e, i) { | ||
| 3799 | t._remove(e.obj, e.name, e.cfunc); | ||
| 3800 | e.obj = e.cfunc = null; | ||
| 3801 | }); | ||
| 3802 | |||
| 3803 | t.events = []; | ||
| 3804 | t = null; | ||
| 3805 | }, | ||
| 3806 | |||
| 3807 | _add : function(o, n, f) { | ||
| 3808 | if (o.attachEvent) | ||
| 3809 | o.attachEvent('on' + n, f); | ||
| 3810 | else if (o.addEventListener) | ||
| 3811 | o.addEventListener(n, f, false); | ||
| 3812 | else | ||
| 3813 | o['on' + n] = f; | ||
| 3814 | }, | ||
| 3815 | |||
| 3816 | _remove : function(o, n, f) { | ||
| 3817 | if (o) { | ||
| 3818 | try { | ||
| 3819 | if (o.detachEvent) | ||
| 3820 | o.detachEvent('on' + n, f); | ||
| 3821 | else if (o.removeEventListener) | ||
| 3822 | o.removeEventListener(n, f, false); | ||
| 3823 | else | ||
| 3824 | o['on' + n] = null; | ||
| 3825 | } catch (ex) { | ||
| 3826 | // Might fail with permission denined on IE so we just ignore that | ||
| 3827 | } | ||
| 3828 | } | ||
| 3829 | }, | ||
| 3830 | |||
| 3831 | _pageInit : function(win) { | ||
| 3832 | var t = this; | ||
| 3833 | |||
| 3834 | // Keep it from running more than once | ||
| 3835 | if (t.domLoaded) | ||
| 3836 | return; | ||
| 3837 | |||
| 3838 | t.domLoaded = true; | ||
| 3839 | |||
| 3840 | each(t.inits, function(c) { | ||
| 3841 | c(); | ||
| 3842 | }); | ||
| 3843 | |||
| 3844 | t.inits = []; | ||
| 3845 | }, | ||
| 3846 | |||
| 3847 | _wait : function(win) { | ||
| 3848 | var t = this, doc = win.document; | ||
| 3849 | |||
| 3850 | // No need since the document is already loaded | ||
| 3851 | if (win.tinyMCE_GZ && tinyMCE_GZ.loaded) { | ||
| 3852 | t.domLoaded = 1; | ||
| 3853 | return; | ||
| 3854 | } | ||
| 3855 | |||
| 3856 | // Use IE method | ||
| 3857 | if (doc.attachEvent) { | ||
| 3858 | doc.attachEvent("onreadystatechange", function() { | ||
| 3859 | if (doc.readyState === "complete") { | ||
| 3860 | doc.detachEvent("onreadystatechange", arguments.callee); | ||
| 3861 | t._pageInit(win); | ||
| 3862 | } | ||
| 3863 | }); | ||
| 3864 | |||
| 3865 | if (doc.documentElement.doScroll && win == win.top) { | ||
| 3866 | (function() { | ||
| 3867 | if (t.domLoaded) | ||
| 3868 | return; | ||
| 3869 | |||
| 3870 | try { | ||
| 3871 | // If IE is used, use the trick by Diego Perini | ||
| 3872 | // http://javascript.nwbox.com/IEContentLoaded/ | ||
| 3873 | doc.documentElement.doScroll("left"); | ||
| 3874 | } catch (ex) { | ||
| 3875 | setTimeout(arguments.callee, 0); | ||
| 3876 | return; | ||
| 3877 | } | ||
| 3878 | |||
| 3879 | t._pageInit(win); | ||
| 3880 | })(); | ||
| 3881 | } | ||
| 3882 | } else if (doc.addEventListener) { | ||
| 3883 | t._add(win, 'DOMContentLoaded', function() { | ||
| 3884 | t._pageInit(win); | ||
| 3885 | }); | ||
| 3886 | } | ||
| 3887 | |||
| 3888 | t._add(win, 'load', function() { | ||
| 3889 | t._pageInit(win); | ||
| 3890 | }); | ||
| 3891 | }, | ||
| 3892 | |||
| 3893 | _stoppers : { | ||
| 3894 | preventDefault : function() { | ||
| 3895 | this.returnValue = false; | ||
| 3896 | }, | ||
| 3897 | |||
| 3898 | stopPropagation : function() { | ||
| 3899 | this.cancelBubble = true; | ||
| 3900 | } | ||
| 3901 | } | ||
| 3902 | }); | ||
| 3903 | |||
| 3904 | Event = tinymce.dom.Event = new tinymce.dom.EventUtils(); | ||
| 3905 | |||
| 3906 | // Dispatch DOM content loaded event for IE and Safari | ||
| 3907 | Event._wait(window); | ||
| 3908 | |||
| 3909 | tinymce.addUnload(function() { | ||
| 3910 | Event.destroy(); | ||
| 3911 | }); | ||
| 3912 | })(tinymce); | ||
| 3913 | (function(tinymce) { | ||
| 3914 | var each = tinymce.each; | ||
| 3915 | |||
| 3916 | tinymce.create('tinymce.dom.Element', { | ||
| 3917 | Element : function(id, s) { | ||
| 3918 | var t = this, dom, el; | ||
| 3919 | |||
| 3920 | s = s || {}; | ||
| 3921 | t.id = id; | ||
| 3922 | t.dom = dom = s.dom || tinymce.DOM; | ||
| 3923 | t.settings = s; | ||
| 3924 | |||
| 3925 | // Only IE leaks DOM references, this is a lot faster | ||
| 3926 | if (!tinymce.isIE) | ||
| 3927 | el = t.dom.get(t.id); | ||
| 3928 | |||
| 3929 | each([ | ||
| 3930 | 'getPos', | ||
| 3931 | 'getRect', | ||
| 3932 | 'getParent', | ||
| 3933 | 'add', | ||
| 3934 | 'setStyle', | ||
| 3935 | 'getStyle', | ||
| 3936 | 'setStyles', | ||
| 3937 | 'setAttrib', | ||
| 3938 | 'setAttribs', | ||
| 3939 | 'getAttrib', | ||
| 3940 | 'addClass', | ||
| 3941 | 'removeClass', | ||
| 3942 | 'hasClass', | ||
| 3943 | 'getOuterHTML', | ||
| 3944 | 'setOuterHTML', | ||
| 3945 | 'remove', | ||
| 3946 | 'show', | ||
| 3947 | 'hide', | ||
| 3948 | 'isHidden', | ||
| 3949 | 'setHTML', | ||
| 3950 | 'get' | ||
| 3951 | ], function(k) { | ||
| 3952 | t[k] = function() { | ||
| 3953 | var a = [id], i; | ||
| 3954 | |||
| 3955 | for (i = 0; i < arguments.length; i++) | ||
| 3956 | a.push(arguments[i]); | ||
| 3957 | |||
| 3958 | a = dom[k].apply(dom, a); | ||
| 3959 | t.update(k); | ||
| 3960 | |||
| 3961 | return a; | ||
| 3962 | }; | ||
| 3963 | }); | ||
| 3964 | }, | ||
| 3965 | |||
| 3966 | on : function(n, f, s) { | ||
| 3967 | return tinymce.dom.Event.add(this.id, n, f, s); | ||
| 3968 | }, | ||
| 3969 | |||
| 3970 | getXY : function() { | ||
| 3971 | return { | ||
| 3972 | x : parseInt(this.getStyle('left')), | ||
| 3973 | y : parseInt(this.getStyle('top')) | ||
| 3974 | }; | ||
| 3975 | }, | ||
| 3976 | |||
| 3977 | getSize : function() { | ||
| 3978 | var n = this.dom.get(this.id); | ||
| 3979 | |||
| 3980 | return { | ||
| 3981 | w : parseInt(this.getStyle('width') || n.clientWidth), | ||
| 3982 | h : parseInt(this.getStyle('height') || n.clientHeight) | ||
| 3983 | }; | ||
| 3984 | }, | ||
| 3985 | |||
| 3986 | moveTo : function(x, y) { | ||
| 3987 | this.setStyles({left : x, top : y}); | ||
| 3988 | }, | ||
| 3989 | |||
| 3990 | moveBy : function(x, y) { | ||
| 3991 | var p = this.getXY(); | ||
| 3992 | |||
| 3993 | this.moveTo(p.x + x, p.y + y); | ||
| 3994 | }, | ||
| 3995 | |||
| 3996 | resizeTo : function(w, h) { | ||
| 3997 | this.setStyles({width : w, height : h}); | ||
| 3998 | }, | ||
| 3999 | |||
| 4000 | resizeBy : function(w, h) { | ||
| 4001 | var s = this.getSize(); | ||
| 4002 | |||
| 4003 | this.resizeTo(s.w + w, s.h + h); | ||
| 4004 | }, | ||
| 4005 | |||
| 4006 | update : function(k) { | ||
| 4007 | var t = this, b, dom = t.dom; | ||
| 4008 | |||
| 4009 | if (tinymce.isIE6 && t.settings.blocker) { | ||
| 4010 | k = k || ''; | ||
| 4011 | |||
| 4012 | // Ignore getters | ||
| 4013 | if (k.indexOf('get') === 0 || k.indexOf('has') === 0 || k.indexOf('is') === 0) | ||
| 4014 | return; | ||
| 4015 | |||
| 4016 | // Remove blocker on remove | ||
| 4017 | if (k == 'remove') { | ||
| 4018 | dom.remove(t.blocker); | ||
| 4019 | return; | ||
| 4020 | } | ||
| 4021 | |||
| 4022 | if (!t.blocker) { | ||
| 4023 | t.blocker = dom.uniqueId(); | ||
| 4024 | b = dom.add(t.settings.container || dom.getRoot(), 'iframe', {id : t.blocker, style : 'position:absolute;', frameBorder : 0, src : 'javascript:""'}); | ||
| 4025 | dom.setStyle(b, 'opacity', 0); | ||
| 4026 | } else | ||
| 4027 | b = dom.get(t.blocker); | ||
| 4028 | |||
| 4029 | dom.setStyle(b, 'left', t.getStyle('left', 1)); | ||
| 4030 | dom.setStyle(b, 'top', t.getStyle('top', 1)); | ||
| 4031 | dom.setStyle(b, 'width', t.getStyle('width', 1)); | ||
| 4032 | dom.setStyle(b, 'height', t.getStyle('height', 1)); | ||
| 4033 | dom.setStyle(b, 'display', t.getStyle('display', 1)); | ||
| 4034 | dom.setStyle(b, 'zIndex', parseInt(t.getStyle('zIndex', 1) || 0) - 1); | ||
| 4035 | } | ||
| 4036 | } | ||
| 4037 | }); | ||
| 4038 | })(tinymce); | ||
| 4039 | (function(tinymce) { | ||
| 4040 | function trimNl(s) { | ||
| 4041 | return s.replace(/[\n\r]+/g, ''); | ||
| 4042 | }; | ||
| 4043 | |||
| 4044 | // Shorten names | ||
| 4045 | var is = tinymce.is, isIE = tinymce.isIE, each = tinymce.each; | ||
| 4046 | |||
| 4047 | tinymce.create('tinymce.dom.Selection', { | ||
| 4048 | Selection : function(dom, win, serializer) { | ||
| 4049 | var t = this; | ||
| 4050 | |||
| 4051 | t.dom = dom; | ||
| 4052 | t.win = win; | ||
| 4053 | t.serializer = serializer; | ||
| 4054 | |||
| 4055 | // Add events | ||
| 4056 | each([ | ||
| 4057 | 'onBeforeSetContent', | ||
| 4058 | 'onBeforeGetContent', | ||
| 4059 | 'onSetContent', | ||
| 4060 | 'onGetContent' | ||
| 4061 | ], function(e) { | ||
| 4062 | t[e] = new tinymce.util.Dispatcher(t); | ||
| 4063 | }); | ||
| 4064 | |||
| 4065 | // No W3C Range support | ||
| 4066 | if (!t.win.getSelection) | ||
| 4067 | t.tridentSel = new tinymce.dom.TridentSelection(t); | ||
| 4068 | |||
| 4069 | // Prevent leaks | ||
| 4070 | tinymce.addUnload(t.destroy, t); | ||
| 4071 | }, | ||
| 4072 | |||
| 4073 | getContent : function(s) { | ||
| 4074 | var t = this, r = t.getRng(), e = t.dom.create("body"), se = t.getSel(), wb, wa, n; | ||
| 4075 | |||
| 4076 | s = s || {}; | ||
| 4077 | wb = wa = ''; | ||
| 4078 | s.get = true; | ||
| 4079 | s.format = s.format || 'html'; | ||
| 4080 | t.onBeforeGetContent.dispatch(t, s); | ||
| 4081 | |||
| 4082 | if (s.format == 'text') | ||
| 4083 | return t.isCollapsed() ? '' : (r.text || (se.toString ? se.toString() : '')); | ||
| 4084 | |||
| 4085 | if (r.cloneContents) { | ||
| 4086 | n = r.cloneContents(); | ||
| 4087 | |||
| 4088 | if (n) | ||
| 4089 | e.appendChild(n); | ||
| 4090 | } else if (is(r.item) || is(r.htmlText)) | ||
| 4091 | e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText; | ||
| 4092 | else | ||
| 4093 | e.innerHTML = r.toString(); | ||
| 4094 | |||
| 4095 | // Keep whitespace before and after | ||
| 4096 | if (/^\s/.test(e.innerHTML)) | ||
| 4097 | wb = ' '; | ||
| 4098 | |||
| 4099 | if (/\s+$/.test(e.innerHTML)) | ||
| 4100 | wa = ' '; | ||
| 4101 | |||
| 4102 | s.getInner = true; | ||
| 4103 | |||
| 4104 | s.content = t.isCollapsed() ? '' : wb + t.serializer.serialize(e, s) + wa; | ||
| 4105 | t.onGetContent.dispatch(t, s); | ||
| 4106 | |||
| 4107 | return s.content; | ||
| 4108 | }, | ||
| 4109 | |||
| 4110 | setContent : function(h, s) { | ||
| 4111 | var t = this, r = t.getRng(), c, d = t.win.document; | ||
| 4112 | |||
| 4113 | s = s || {format : 'html'}; | ||
| 4114 | s.set = true; | ||
| 4115 | h = s.content = t.dom.processHTML(h); | ||
| 4116 | |||
| 4117 | // Dispatch before set content event | ||
| 4118 | t.onBeforeSetContent.dispatch(t, s); | ||
| 4119 | h = s.content; | ||
| 4120 | |||
| 4121 | if (r.insertNode) { | ||
| 4122 | // Make caret marker since insertNode places the caret in the beginning of text after insert | ||
| 4123 | h += '<span id="__caret">_</span>'; | ||
| 4124 | |||
| 4125 | // Delete and insert new node | ||
| 4126 | r.deleteContents(); | ||
| 4127 | r.insertNode(t.getRng().createContextualFragment(h)); | ||
| 4128 | |||
| 4129 | // Move to caret marker | ||
| 4130 | c = t.dom.get('__caret'); | ||
| 4131 | |||
| 4132 | // Make sure we wrap it compleatly, Opera fails with a simple select call | ||
| 4133 | r = d.createRange(); | ||
| 4134 | r.setStartBefore(c); | ||
| 4135 | r.setEndAfter(c); | ||
| 4136 | t.setRng(r); | ||
| 4137 | |||
| 4138 | // Delete the marker, and hopefully the caret gets placed in the right location | ||
| 4139 | // Removed this since it seems to remove in FF and simply deleting it | ||
| 4140 | // doesn't seem to affect the caret position in any browser | ||
| 4141 | //d.execCommand('Delete', false, null); | ||
| 4142 | |||
| 4143 | // Remove the caret position | ||
| 4144 | t.dom.remove('__caret'); | ||
| 4145 | } else { | ||
| 4146 | if (r.item) { | ||
| 4147 | // Delete content and get caret text selection | ||
| 4148 | d.execCommand('Delete', false, null); | ||
| 4149 | r = t.getRng(); | ||
| 4150 | } | ||
| 4151 | |||
| 4152 | r.pasteHTML(h); | ||
| 4153 | } | ||
| 4154 | |||
| 4155 | // Dispatch set content event | ||
| 4156 | t.onSetContent.dispatch(t, s); | ||
| 4157 | }, | ||
| 4158 | |||
| 4159 | getStart : function() { | ||
| 4160 | var t = this, r = t.getRng(), e; | ||
| 4161 | |||
| 4162 | if (isIE) { | ||
| 4163 | if (r.item) | ||
| 4164 | return r.item(0); | ||
| 4165 | |||
| 4166 | r = r.duplicate(); | ||
| 4167 | r.collapse(1); | ||
| 4168 | e = r.parentElement(); | ||
| 4169 | |||
| 4170 | if (e && e.nodeName == 'BODY') | ||
| 4171 | return e.firstChild; | ||
| 4172 | |||
| 4173 | return e; | ||
| 4174 | } else { | ||
| 4175 | e = r.startContainer; | ||
| 4176 | |||
| 4177 | if (e.nodeName == 'BODY') | ||
| 4178 | return e.firstChild; | ||
| 4179 | |||
| 4180 | return t.dom.getParent(e, '*'); | ||
| 4181 | } | ||
| 4182 | }, | ||
| 4183 | |||
| 4184 | getEnd : function() { | ||
| 4185 | var t = this, r = t.getRng(), e; | ||
| 4186 | |||
| 4187 | if (isIE) { | ||
| 4188 | if (r.item) | ||
| 4189 | return r.item(0); | ||
| 4190 | |||
| 4191 | r = r.duplicate(); | ||
| 4192 | r.collapse(0); | ||
| 4193 | e = r.parentElement(); | ||
| 4194 | |||
| 4195 | if (e && e.nodeName == 'BODY') | ||
| 4196 | return e.lastChild; | ||
| 4197 | |||
| 4198 | return e; | ||
| 4199 | } else { | ||
| 4200 | e = r.endContainer; | ||
| 4201 | |||
| 4202 | if (e.nodeName == 'BODY') | ||
| 4203 | return e.lastChild; | ||
| 4204 | |||
| 4205 | return t.dom.getParent(e, '*'); | ||
| 4206 | } | ||
| 4207 | }, | ||
| 4208 | |||
| 4209 | getBookmark : function(si) { | ||
| 4210 | var t = this, r = t.getRng(), tr, sx, sy, vp = t.dom.getViewPort(t.win), e, sp, bp, le, c = -0xFFFFFF, s, ro = t.dom.getRoot(), wb = 0, wa = 0, nv; | ||
| 4211 | sx = vp.x; | ||
| 4212 | sy = vp.y; | ||
| 4213 | |||
| 4214 | // Simple bookmark fast but not as persistent | ||
| 4215 | if (si) | ||
| 4216 | return {rng : r, scrollX : sx, scrollY : sy}; | ||
| 4217 | |||
| 4218 | // Handle IE | ||
| 4219 | if (isIE) { | ||
| 4220 | // Control selection | ||
| 4221 | if (r.item) { | ||
| 4222 | e = r.item(0); | ||
| 4223 | |||
| 4224 | each(t.dom.select(e.nodeName), function(n, i) { | ||
| 4225 | if (e == n) { | ||
| 4226 | sp = i; | ||
| 4227 | return false; | ||
| 4228 | } | ||
| 4229 | }); | ||
| 4230 | |||
| 4231 | return { | ||
| 4232 | tag : e.nodeName, | ||
| 4233 | index : sp, | ||
| 4234 | scrollX : sx, | ||
| 4235 | scrollY : sy | ||
| 4236 | }; | ||
| 4237 | } | ||
| 4238 | |||
| 4239 | // Text selection | ||
| 4240 | tr = t.dom.doc.body.createTextRange(); | ||
| 4241 | tr.moveToElementText(ro); | ||
| 4242 | tr.collapse(true); | ||
| 4243 | bp = Math.abs(tr.move('character', c)); | ||
| 4244 | |||
| 4245 | tr = r.duplicate(); | ||
| 4246 | tr.collapse(true); | ||
| 4247 | sp = Math.abs(tr.move('character', c)); | ||
| 4248 | |||
| 4249 | tr = r.duplicate(); | ||
| 4250 | tr.collapse(false); | ||
| 4251 | le = Math.abs(tr.move('character', c)) - sp; | ||
| 4252 | |||
| 4253 | return { | ||
| 4254 | start : sp - bp, | ||
| 4255 | length : le, | ||
| 4256 | scrollX : sx, | ||
| 4257 | scrollY : sy | ||
| 4258 | }; | ||
| 4259 | } | ||
| 4260 | |||
| 4261 | // Handle W3C | ||
| 4262 | e = t.getNode(); | ||
| 4263 | s = t.getSel(); | ||
| 4264 | |||
| 4265 | if (!s) | ||
| 4266 | return null; | ||
| 4267 | |||
| 4268 | // Image selection | ||
| 4269 | if (e && e.nodeName == 'IMG') { | ||
| 4270 | return { | ||
| 4271 | scrollX : sx, | ||
| 4272 | scrollY : sy | ||
| 4273 | }; | ||
| 4274 | } | ||
| 4275 | |||
| 4276 | // Text selection | ||
| 4277 | |||
| 4278 | function getPos(r, sn, en) { | ||
| 4279 | var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}; | ||
| 4280 | |||
| 4281 | while ((n = w.nextNode()) != null) { | ||
| 4282 | if (n == sn) | ||
| 4283 | d.start = p; | ||
| 4284 | |||
| 4285 | if (n == en) { | ||
| 4286 | d.end = p; | ||
| 4287 | return d; | ||
| 4288 | } | ||
| 4289 | |||
| 4290 | p += trimNl(n.nodeValue || '').length; | ||
| 4291 | } | ||
| 4292 | |||
| 4293 | return null; | ||
| 4294 | }; | ||
| 4295 | |||
| 4296 | // Caret or selection | ||
| 4297 | if (s.anchorNode == s.focusNode && s.anchorOffset == s.focusOffset) { | ||
| 4298 | e = getPos(ro, s.anchorNode, s.focusNode); | ||
| 4299 | |||
| 4300 | if (!e) | ||
| 4301 | return {scrollX : sx, scrollY : sy}; | ||
| 4302 | |||
| 4303 | // Count whitespace before | ||
| 4304 | trimNl(s.anchorNode.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;}); | ||
| 4305 | |||
| 4306 | return { | ||
| 4307 | start : Math.max(e.start + s.anchorOffset - wb, 0), | ||
| 4308 | end : Math.max(e.end + s.focusOffset - wb, 0), | ||
| 4309 | scrollX : sx, | ||
| 4310 | scrollY : sy, | ||
| 4311 | beg : s.anchorOffset - wb == 0 | ||
| 4312 | }; | ||
| 4313 | } else { | ||
| 4314 | e = getPos(ro, r.startContainer, r.endContainer); | ||
| 4315 | |||
| 4316 | // Count whitespace before start and end container | ||
| 4317 | //(r.startContainer.nodeValue || '').replace(/^\s+/, function(a) {wb = a.length;}); | ||
| 4318 | //(r.endContainer.nodeValue || '').replace(/^\s+/, function(a) {wa = a.length;}); | ||
| 4319 | |||
| 4320 | if (!e) | ||
| 4321 | return {scrollX : sx, scrollY : sy}; | ||
| 4322 | |||
| 4323 | return { | ||
| 4324 | start : Math.max(e.start + r.startOffset - wb, 0), | ||
| 4325 | end : Math.max(e.end + r.endOffset - wa, 0), | ||
| 4326 | scrollX : sx, | ||
| 4327 | scrollY : sy, | ||
| 4328 | beg : r.startOffset - wb == 0 | ||
| 4329 | }; | ||
| 4330 | } | ||
| 4331 | }, | ||
| 4332 | |||
| 4333 | moveToBookmark : function(b) { | ||
| 4334 | var t = this, r = t.getRng(), s = t.getSel(), ro = t.dom.getRoot(), sd, nvl, nv; | ||
| 4335 | |||
| 4336 | function getPos(r, sp, ep) { | ||
| 4337 | var w = t.dom.doc.createTreeWalker(r, NodeFilter.SHOW_TEXT, null, false), n, p = 0, d = {}, o, v, wa, wb; | ||
| 4338 | |||
| 4339 | while ((n = w.nextNode()) != null) { | ||
| 4340 | wa = wb = 0; | ||
| 4341 | |||
| 4342 | nv = n.nodeValue || ''; | ||
| 4343 | //nv.replace(/^\s+[^\s]/, function(a) {wb = a.length - 1;}); | ||
| 4344 | //nv.replace(/[^\s]\s+$/, function(a) {wa = a.length - 1;}); | ||
| 4345 | |||
| 4346 | nvl = trimNl(nv).length; | ||
| 4347 | p += nvl; | ||
| 4348 | |||
| 4349 | if (p >= sp && !d.startNode) { | ||
| 4350 | o = sp - (p - nvl); | ||
| 4351 | |||
| 4352 | // Fix for odd quirk in FF | ||
| 4353 | if (b.beg && o >= nvl) | ||
| 4354 | continue; | ||
| 4355 | |||
| 4356 | d.startNode = n; | ||
| 4357 | d.startOffset = o + wb; | ||
| 4358 | } | ||
| 4359 | |||
| 4360 | if (p >= ep) { | ||
| 4361 | d.endNode = n; | ||
| 4362 | d.endOffset = ep - (p - nvl) + wb; | ||
| 4363 | return d; | ||
| 4364 | } | ||
| 4365 | } | ||
| 4366 | |||
| 4367 | return null; | ||
| 4368 | }; | ||
| 4369 | |||
| 4370 | if (!b) | ||
| 4371 | return false; | ||
| 4372 | |||
| 4373 | t.win.scrollTo(b.scrollX, b.scrollY); | ||
| 4374 | |||
| 4375 | // Handle explorer | ||
| 4376 | if (isIE) { | ||
| 4377 | t.tridentSel.destroy(); | ||
| 4378 | |||
| 4379 | // Handle simple | ||
| 4380 | if (r = b.rng) { | ||
| 4381 | try { | ||
| 4382 | r.select(); | ||
| 4383 | } catch (ex) { | ||
| 4384 | // Ignore | ||
| 4385 | } | ||
| 4386 | |||
| 4387 | return true; | ||
| 4388 | } | ||
| 4389 | |||
| 4390 | t.win.focus(); | ||
| 4391 | |||
| 4392 | // Handle control bookmark | ||
| 4393 | if (b.tag) { | ||
| 4394 | r = ro.createControlRange(); | ||
| 4395 | |||
| 4396 | each(t.dom.select(b.tag), function(n, i) { | ||
| 4397 | if (i == b.index) | ||
| 4398 | r.addElement(n); | ||
| 4399 | }); | ||
| 4400 | } else { | ||
| 4401 | // Try/catch needed since this operation breaks when TinyMCE is placed in hidden divs/tabs | ||
| 4402 | try { | ||
| 4403 | // Incorrect bookmark | ||
| 4404 | if (b.start < 0) | ||
| 4405 | return true; | ||
| 4406 | |||
| 4407 | r = s.createRange(); | ||
| 4408 | r.moveToElementText(ro); | ||
| 4409 | r.collapse(true); | ||
| 4410 | r.moveStart('character', b.start); | ||
| 4411 | r.moveEnd('character', b.length); | ||
| 4412 | } catch (ex2) { | ||
| 4413 | return true; | ||
| 4414 | } | ||
| 4415 | } | ||
| 4416 | |||
| 4417 | try { | ||
| 4418 | r.select(); | ||
| 4419 | } catch (ex) { | ||
| 4420 | // Needed for some odd IE bug #1843306 | ||
| 4421 | } | ||
| 4422 | |||
| 4423 | return true; | ||
| 4424 | } | ||
| 4425 | |||
| 4426 | // Handle W3C | ||
| 4427 | if (!s) | ||
| 4428 | return false; | ||
| 4429 | |||
| 4430 | // Handle simple | ||
| 4431 | if (b.rng) { | ||
| 4432 | s.removeAllRanges(); | ||
| 4433 | s.addRange(b.rng); | ||
| 4434 | } else { | ||
| 4435 | if (is(b.start) && is(b.end)) { | ||
| 4436 | try { | ||
| 4437 | sd = getPos(ro, b.start, b.end); | ||
| 4438 | |||
| 4439 | if (sd) { | ||
| 4440 | r = t.dom.doc.createRange(); | ||
| 4441 | r.setStart(sd.startNode, sd.startOffset); | ||
| 4442 | r.setEnd(sd.endNode, sd.endOffset); | ||
| 4443 | s.removeAllRanges(); | ||
| 4444 | s.addRange(r); | ||
| 4445 | } | ||
| 4446 | |||
| 4447 | if (!tinymce.isOpera) | ||
| 4448 | t.win.focus(); | ||
| 4449 | } catch (ex) { | ||
| 4450 | // Ignore | ||
| 4451 | } | ||
| 4452 | } | ||
| 4453 | } | ||
| 4454 | }, | ||
| 4455 | |||
| 4456 | select : function(n, c) { | ||
| 4457 | var t = this, r = t.getRng(), s = t.getSel(), b, fn, ln, d = t.win.document; | ||
| 4458 | |||
| 4459 | function find(n, start) { | ||
| 4460 | var walker, o; | ||
| 4461 | |||
| 4462 | if (n) { | ||
| 4463 | walker = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 4464 | |||
| 4465 | // Find first/last non empty text node | ||
| 4466 | while (n = walker.nextNode()) { | ||
| 4467 | o = n; | ||
| 4468 | |||
| 4469 | if (tinymce.trim(n.nodeValue).length != 0) { | ||
| 4470 | if (start) | ||
| 4471 | return n; | ||
| 4472 | else | ||
| 4473 | o = n; | ||
| 4474 | } | ||
| 4475 | } | ||
| 4476 | } | ||
| 4477 | |||
| 4478 | return o; | ||
| 4479 | }; | ||
| 4480 | |||
| 4481 | if (isIE) { | ||
| 4482 | try { | ||
| 4483 | b = d.body; | ||
| 4484 | |||
| 4485 | if (/^(IMG|TABLE)$/.test(n.nodeName)) { | ||
| 4486 | r = b.createControlRange(); | ||
| 4487 | r.addElement(n); | ||
| 4488 | } else { | ||
| 4489 | r = b.createTextRange(); | ||
| 4490 | r.moveToElementText(n); | ||
| 4491 | } | ||
| 4492 | |||
| 4493 | r.select(); | ||
| 4494 | } catch (ex) { | ||
| 4495 | // Throws illigal agrument in IE some times | ||
| 4496 | } | ||
| 4497 | } else { | ||
| 4498 | if (c) { | ||
| 4499 | fn = find(n, 1) || t.dom.select('br:first', n)[0]; | ||
| 4500 | ln = find(n, 0) || t.dom.select('br:last', n)[0]; | ||
| 4501 | |||
| 4502 | if (fn && ln) { | ||
| 4503 | r = d.createRange(); | ||
| 4504 | |||
| 4505 | if (fn.nodeName == 'BR') | ||
| 4506 | r.setStartBefore(fn); | ||
| 4507 | else | ||
| 4508 | r.setStart(fn, 0); | ||
| 4509 | |||
| 4510 | if (ln.nodeName == 'BR') | ||
| 4511 | r.setEndBefore(ln); | ||
| 4512 | else | ||
| 4513 | r.setEnd(ln, ln.nodeValue.length); | ||
| 4514 | } else | ||
| 4515 | r.selectNode(n); | ||
| 4516 | } else | ||
| 4517 | r.selectNode(n); | ||
| 4518 | |||
| 4519 | t.setRng(r); | ||
| 4520 | } | ||
| 4521 | |||
| 4522 | return n; | ||
| 4523 | }, | ||
| 4524 | |||
| 4525 | isCollapsed : function() { | ||
| 4526 | var t = this, r = t.getRng(), s = t.getSel(); | ||
| 4527 | |||
| 4528 | if (!r || r.item) | ||
| 4529 | return false; | ||
| 4530 | |||
| 4531 | return !s || r.boundingWidth == 0 || r.collapsed; | ||
| 4532 | }, | ||
| 4533 | |||
| 4534 | collapse : function(b) { | ||
| 4535 | var t = this, r = t.getRng(), n; | ||
| 4536 | |||
| 4537 | // Control range on IE | ||
| 4538 | if (r.item) { | ||
| 4539 | n = r.item(0); | ||
| 4540 | r = this.win.document.body.createTextRange(); | ||
| 4541 | r.moveToElementText(n); | ||
| 4542 | } | ||
| 4543 | |||
| 4544 | r.collapse(!!b); | ||
| 4545 | t.setRng(r); | ||
| 4546 | }, | ||
| 4547 | |||
| 4548 | getSel : function() { | ||
| 4549 | var t = this, w = this.win; | ||
| 4550 | |||
| 4551 | return w.getSelection ? w.getSelection() : w.document.selection; | ||
| 4552 | }, | ||
| 4553 | |||
| 4554 | getRng : function(w3c) { | ||
| 4555 | var t = this, s, r; | ||
| 4556 | |||
| 4557 | // Found tridentSel object then we need to use that one | ||
| 4558 | if (w3c && t.tridentSel) | ||
| 4559 | return t.tridentSel.getRangeAt(0); | ||
| 4560 | |||
| 4561 | try { | ||
| 4562 | if (s = t.getSel()) | ||
| 4563 | r = s.rangeCount > 0 ? s.getRangeAt(0) : (s.createRange ? s.createRange() : t.win.document.createRange()); | ||
| 4564 | } catch (ex) { | ||
| 4565 | // IE throws unspecified error here if TinyMCE is placed in a frame/iframe | ||
| 4566 | } | ||
| 4567 | |||
| 4568 | // No range found then create an empty one | ||
| 4569 | // This can occur when the editor is placed in a hidden container element on Gecko | ||
| 4570 | // Or on IE when there was an exception | ||
| 4571 | if (!r) | ||
| 4572 | r = isIE ? t.win.document.body.createTextRange() : t.win.document.createRange(); | ||
| 4573 | |||
| 4574 | return r; | ||
| 4575 | }, | ||
| 4576 | |||
| 4577 | setRng : function(r) { | ||
| 4578 | var s, t = this; | ||
| 4579 | |||
| 4580 | if (!t.tridentSel) { | ||
| 4581 | s = t.getSel(); | ||
| 4582 | |||
| 4583 | if (s) { | ||
| 4584 | s.removeAllRanges(); | ||
| 4585 | s.addRange(r); | ||
| 4586 | } | ||
| 4587 | } else { | ||
| 4588 | // Is W3C Range | ||
| 4589 | if (r.cloneRange) { | ||
| 4590 | t.tridentSel.addRange(r); | ||
| 4591 | return; | ||
| 4592 | } | ||
| 4593 | |||
| 4594 | // Is IE specific range | ||
| 4595 | try { | ||
| 4596 | r.select(); | ||
| 4597 | } catch (ex) { | ||
| 4598 | // Needed for some odd IE bug #1843306 | ||
| 4599 | } | ||
| 4600 | } | ||
| 4601 | }, | ||
| 4602 | |||
| 4603 | setNode : function(n) { | ||
| 4604 | var t = this; | ||
| 4605 | |||
| 4606 | t.setContent(t.dom.getOuterHTML(n)); | ||
| 4607 | |||
| 4608 | return n; | ||
| 4609 | }, | ||
| 4610 | |||
| 4611 | getNode : function() { | ||
| 4612 | var t = this, r = t.getRng(), s = t.getSel(), e; | ||
| 4613 | |||
| 4614 | if (!isIE) { | ||
| 4615 | // Range maybe lost after the editor is made visible again | ||
| 4616 | if (!r) | ||
| 4617 | return t.dom.getRoot(); | ||
| 4618 | |||
| 4619 | e = r.commonAncestorContainer; | ||
| 4620 | |||
| 4621 | // Handle selection a image or other control like element such as anchors | ||
| 4622 | if (!r.collapsed) { | ||
| 4623 | // If the anchor node is a element instead of a text node then return this element | ||
| 4624 | if (tinymce.isWebKit && s.anchorNode && s.anchorNode.nodeType == 1) | ||
| 4625 | return s.anchorNode.childNodes[s.anchorOffset]; | ||
| 4626 | |||
| 4627 | if (r.startContainer == r.endContainer) { | ||
| 4628 | if (r.startOffset - r.endOffset < 2) { | ||
| 4629 | if (r.startContainer.hasChildNodes()) | ||
| 4630 | e = r.startContainer.childNodes[r.startOffset]; | ||
| 4631 | } | ||
| 4632 | } | ||
| 4633 | } | ||
| 4634 | |||
| 4635 | return t.dom.getParent(e, '*'); | ||
| 4636 | } | ||
| 4637 | |||
| 4638 | return r.item ? r.item(0) : r.parentElement(); | ||
| 4639 | }, | ||
| 4640 | |||
| 4641 | getSelectedBlocks : function(st, en) { | ||
| 4642 | var t = this, dom = t.dom, sb, eb, n, bl = []; | ||
| 4643 | |||
| 4644 | sb = dom.getParent(st || t.getStart(), dom.isBlock); | ||
| 4645 | eb = dom.getParent(en || t.getEnd(), dom.isBlock); | ||
| 4646 | |||
| 4647 | if (sb) | ||
| 4648 | bl.push(sb); | ||
| 4649 | |||
| 4650 | if (sb && eb && sb != eb) { | ||
| 4651 | n = sb; | ||
| 4652 | |||
| 4653 | while ((n = n.nextSibling) && n != eb) { | ||
| 4654 | if (dom.isBlock(n)) | ||
| 4655 | bl.push(n); | ||
| 4656 | } | ||
| 4657 | } | ||
| 4658 | |||
| 4659 | if (eb && sb != eb) | ||
| 4660 | bl.push(eb); | ||
| 4661 | |||
| 4662 | return bl; | ||
| 4663 | }, | ||
| 4664 | |||
| 4665 | destroy : function(s) { | ||
| 4666 | var t = this; | ||
| 4667 | |||
| 4668 | t.win = null; | ||
| 4669 | |||
| 4670 | if (t.tridentSel) | ||
| 4671 | t.tridentSel.destroy(); | ||
| 4672 | |||
| 4673 | // Manual destroy then remove unload handler | ||
| 4674 | if (!s) | ||
| 4675 | tinymce.removeUnload(t.destroy); | ||
| 4676 | } | ||
| 4677 | }); | ||
| 4678 | })(tinymce); | ||
| 4679 | (function(tinymce) { | ||
| 4680 | tinymce.create('tinymce.dom.XMLWriter', { | ||
| 4681 | node : null, | ||
| 4682 | |||
| 4683 | XMLWriter : function(s) { | ||
| 4684 | // Get XML document | ||
| 4685 | function getXML() { | ||
| 4686 | var i = document.implementation; | ||
| 4687 | |||
| 4688 | if (!i || !i.createDocument) { | ||
| 4689 | // Try IE objects | ||
| 4690 | try {return new ActiveXObject('MSXML2.DOMDocument');} catch (ex) {} | ||
| 4691 | try {return new ActiveXObject('Microsoft.XmlDom');} catch (ex) {} | ||
| 4692 | } else | ||
| 4693 | return i.createDocument('', '', null); | ||
| 4694 | }; | ||
| 4695 | |||
| 4696 | this.doc = getXML(); | ||
| 4697 | |||
| 4698 | // Since Opera and WebKit doesn't escape > into > we need to do it our self to normalize the output for all browsers | ||
| 4699 | this.valid = tinymce.isOpera || tinymce.isWebKit; | ||
| 4700 | |||
| 4701 | this.reset(); | ||
| 4702 | }, | ||
| 4703 | |||
| 4704 | reset : function() { | ||
| 4705 | var t = this, d = t.doc; | ||
| 4706 | |||
| 4707 | if (d.firstChild) | ||
| 4708 | d.removeChild(d.firstChild); | ||
| 4709 | |||
| 4710 | t.node = d.appendChild(d.createElement("html")); | ||
| 4711 | }, | ||
| 4712 | |||
| 4713 | writeStartElement : function(n) { | ||
| 4714 | var t = this; | ||
| 4715 | |||
| 4716 | t.node = t.node.appendChild(t.doc.createElement(n)); | ||
| 4717 | }, | ||
| 4718 | |||
| 4719 | writeAttribute : function(n, v) { | ||
| 4720 | if (this.valid) | ||
| 4721 | v = v.replace(/>/g, '%MCGT%'); | ||
| 4722 | |||
| 4723 | this.node.setAttribute(n, v); | ||
| 4724 | }, | ||
| 4725 | |||
| 4726 | writeEndElement : function() { | ||
| 4727 | this.node = this.node.parentNode; | ||
| 4728 | }, | ||
| 4729 | |||
| 4730 | writeFullEndElement : function() { | ||
| 4731 | var t = this, n = t.node; | ||
| 4732 | |||
| 4733 | n.appendChild(t.doc.createTextNode("")); | ||
| 4734 | t.node = n.parentNode; | ||
| 4735 | }, | ||
| 4736 | |||
| 4737 | writeText : function(v) { | ||
| 4738 | if (this.valid) | ||
| 4739 | v = v.replace(/>/g, '%MCGT%'); | ||
| 4740 | |||
| 4741 | this.node.appendChild(this.doc.createTextNode(v)); | ||
| 4742 | }, | ||
| 4743 | |||
| 4744 | writeCDATA : function(v) { | ||
| 4745 | this.node.appendChild(this.doc.createCDATASection(v)); | ||
| 4746 | }, | ||
| 4747 | |||
| 4748 | writeComment : function(v) { | ||
| 4749 | // Fix for bug #2035694 | ||
| 4750 | if (tinymce.isIE) | ||
| 4751 | v = v.replace(/^\-|\-$/g, ' '); | ||
| 4752 | |||
| 4753 | this.node.appendChild(this.doc.createComment(v.replace(/\-\-/g, ' '))); | ||
| 4754 | }, | ||
| 4755 | |||
| 4756 | getContent : function() { | ||
| 4757 | var h; | ||
| 4758 | |||
| 4759 | h = this.doc.xml || new XMLSerializer().serializeToString(this.doc); | ||
| 4760 | h = h.replace(/<\?[^?]+\?>|<html>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g, ''); | ||
| 4761 | h = h.replace(/ ?\/>/g, ' />'); | ||
| 4762 | |||
| 4763 | if (this.valid) | ||
| 4764 | h = h.replace(/\%MCGT%/g, '>'); | ||
| 4765 | |||
| 4766 | return h; | ||
| 4767 | } | ||
| 4768 | }); | ||
| 4769 | })(tinymce); | ||
| 4770 | (function(tinymce) { | ||
| 4771 | tinymce.create('tinymce.dom.StringWriter', { | ||
| 4772 | str : null, | ||
| 4773 | tags : null, | ||
| 4774 | count : 0, | ||
| 4775 | settings : null, | ||
| 4776 | indent : null, | ||
| 4777 | |||
| 4778 | StringWriter : function(s) { | ||
| 4779 | this.settings = tinymce.extend({ | ||
| 4780 | indent_char : ' ', | ||
| 4781 | indentation : 0 | ||
| 4782 | }, s); | ||
| 4783 | |||
| 4784 | this.reset(); | ||
| 4785 | }, | ||
| 4786 | |||
| 4787 | reset : function() { | ||
| 4788 | this.indent = ''; | ||
| 4789 | this.str = ""; | ||
| 4790 | this.tags = []; | ||
| 4791 | this.count = 0; | ||
| 4792 | }, | ||
| 4793 | |||
| 4794 | writeStartElement : function(n) { | ||
| 4795 | this._writeAttributesEnd(); | ||
| 4796 | this.writeRaw('<' + n); | ||
| 4797 | this.tags.push(n); | ||
| 4798 | this.inAttr = true; | ||
| 4799 | this.count++; | ||
| 4800 | this.elementCount = this.count; | ||
| 4801 | }, | ||
| 4802 | |||
| 4803 | writeAttribute : function(n, v) { | ||
| 4804 | var t = this; | ||
| 4805 | |||
| 4806 | t.writeRaw(" " + t.encode(n) + '="' + t.encode(v) + '"'); | ||
| 4807 | }, | ||
| 4808 | |||
| 4809 | writeEndElement : function() { | ||
| 4810 | var n; | ||
| 4811 | |||
| 4812 | if (this.tags.length > 0) { | ||
| 4813 | n = this.tags.pop(); | ||
| 4814 | |||
| 4815 | if (this._writeAttributesEnd(1)) | ||
| 4816 | this.writeRaw('</' + n + '>'); | ||
| 4817 | |||
| 4818 | if (this.settings.indentation > 0) | ||
| 4819 | this.writeRaw('\n'); | ||
| 4820 | } | ||
| 4821 | }, | ||
| 4822 | |||
| 4823 | writeFullEndElement : function() { | ||
| 4824 | if (this.tags.length > 0) { | ||
| 4825 | this._writeAttributesEnd(); | ||
| 4826 | this.writeRaw('</' + this.tags.pop() + '>'); | ||
| 4827 | |||
| 4828 | if (this.settings.indentation > 0) | ||
| 4829 | this.writeRaw('\n'); | ||
| 4830 | } | ||
| 4831 | }, | ||
| 4832 | |||
| 4833 | writeText : function(v) { | ||
| 4834 | this._writeAttributesEnd(); | ||
| 4835 | this.writeRaw(this.encode(v)); | ||
| 4836 | this.count++; | ||
| 4837 | }, | ||
| 4838 | |||
| 4839 | writeCDATA : function(v) { | ||
| 4840 | this._writeAttributesEnd(); | ||
| 4841 | this.writeRaw('<![CDATA[' + v + ']]>'); | ||
| 4842 | this.count++; | ||
| 4843 | }, | ||
| 4844 | |||
| 4845 | writeComment : function(v) { | ||
| 4846 | this._writeAttributesEnd(); | ||
| 4847 | this.writeRaw('<!-- ' + v + '-->'); | ||
| 4848 | this.count++; | ||
| 4849 | }, | ||
| 4850 | |||
| 4851 | writeRaw : function(v) { | ||
| 4852 | this.str += v; | ||
| 4853 | }, | ||
| 4854 | |||
| 4855 | encode : function(s) { | ||
| 4856 | return s.replace(/[<>&"]/g, function(v) { | ||
| 4857 | switch (v) { | ||
| 4858 | case '<': | ||
| 4859 | return '<'; | ||
| 4860 | |||
| 4861 | case '>': | ||
| 4862 | return '>'; | ||
| 4863 | |||
| 4864 | case '&': | ||
| 4865 | return '&'; | ||
| 4866 | |||
| 4867 | case '"': | ||
| 4868 | return '"'; | ||
| 4869 | } | ||
| 4870 | |||
| 4871 | return v; | ||
| 4872 | }); | ||
| 4873 | }, | ||
| 4874 | |||
| 4875 | getContent : function() { | ||
| 4876 | return this.str; | ||
| 4877 | }, | ||
| 4878 | |||
| 4879 | _writeAttributesEnd : function(s) { | ||
| 4880 | if (!this.inAttr) | ||
| 4881 | return; | ||
| 4882 | |||
| 4883 | this.inAttr = false; | ||
| 4884 | |||
| 4885 | if (s && this.elementCount == this.count) { | ||
| 4886 | this.writeRaw(' />'); | ||
| 4887 | return false; | ||
| 4888 | } | ||
| 4889 | |||
| 4890 | this.writeRaw('>'); | ||
| 4891 | |||
| 4892 | return true; | ||
| 4893 | } | ||
| 4894 | }); | ||
| 4895 | })(tinymce); | ||
| 4896 | (function(tinymce) { | ||
| 4897 | // Shorten names | ||
| 4898 | var extend = tinymce.extend, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher, isIE = tinymce.isIE, isGecko = tinymce.isGecko; | ||
| 4899 | |||
| 4900 | function wildcardToRE(s) { | ||
| 4901 | return s.replace(/([?+*])/g, '.$1'); | ||
| 4902 | }; | ||
| 4903 | |||
| 4904 | tinymce.create('tinymce.dom.Serializer', { | ||
| 4905 | Serializer : function(s) { | ||
| 4906 | var t = this; | ||
| 4907 | |||
| 4908 | t.key = 0; | ||
| 4909 | t.onPreProcess = new Dispatcher(t); | ||
| 4910 | t.onPostProcess = new Dispatcher(t); | ||
| 4911 | |||
| 4912 | try { | ||
| 4913 | t.writer = new tinymce.dom.XMLWriter(); | ||
| 4914 | } catch (ex) { | ||
| 4915 | // IE might throw exception if ActiveX is disabled so we then switch to the slightly slower StringWriter | ||
| 4916 | t.writer = new tinymce.dom.StringWriter(); | ||
| 4917 | } | ||
| 4918 | |||
| 4919 | // Default settings | ||
| 4920 | t.settings = s = extend({ | ||
| 4921 | dom : tinymce.DOM, | ||
| 4922 | valid_nodes : 0, | ||
| 4923 | node_filter : 0, | ||
| 4924 | attr_filter : 0, | ||
| 4925 | invalid_attrs : /^(mce_|_moz_|sizset|sizcache)/, | ||
| 4926 | closed : /^(br|hr|input|meta|img|link|param|area)$/, | ||
| 4927 | entity_encoding : 'named', | ||
| 4928 | entities : '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro', | ||
| 4929 | valid_elements : '*[*]', | ||
| 4930 | extended_valid_elements : 0, | ||
| 4931 | valid_child_elements : 0, | ||
| 4932 | invalid_elements : 0, | ||
| 4933 | fix_table_elements : 1, | ||
| 4934 | fix_list_elements : true, | ||
| 4935 | fix_content_duplication : true, | ||
| 4936 | convert_fonts_to_spans : false, | ||
| 4937 | font_size_classes : 0, | ||
| 4938 | font_size_style_values : 0, | ||
| 4939 | apply_source_formatting : 0, | ||
| 4940 | indent_mode : 'simple', | ||
| 4941 | indent_char : '\t', | ||
| 4942 | indent_levels : 1, | ||
| 4943 | remove_linebreaks : 1, | ||
| 4944 | remove_redundant_brs : 1, | ||
| 4945 | element_format : 'xhtml' | ||
| 4946 | }, s); | ||
| 4947 | |||
| 4948 | t.dom = s.dom; | ||
| 4949 | |||
| 4950 | if (s.remove_redundant_brs) { | ||
| 4951 | t.onPostProcess.add(function(se, o) { | ||
| 4952 | // Remove single BR at end of block elements since they get rendered | ||
| 4953 | o.content = o.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi, function(a, b, c) { | ||
| 4954 | // Check if it's a single element | ||
| 4955 | if (/^<br \/>\s*<\//.test(a)) | ||
| 4956 | return '</' + c + '>'; | ||
| 4957 | |||
| 4958 | return a; | ||
| 4959 | }); | ||
| 4960 | }); | ||
| 4961 | } | ||
| 4962 | |||
| 4963 | // Remove XHTML element endings i.e. produce crap :) XHTML is better | ||
| 4964 | if (s.element_format == 'html') { | ||
| 4965 | t.onPostProcess.add(function(se, o) { | ||
| 4966 | o.content = o.content.replace(/<([^>]+) \/>/g, '<$1>'); | ||
| 4967 | }); | ||
| 4968 | } | ||
| 4969 | |||
| 4970 | if (s.fix_list_elements) { | ||
| 4971 | t.onPreProcess.add(function(se, o) { | ||
| 4972 | var nl, x, a = ['ol', 'ul'], i, n, p, r = /^(OL|UL)$/, np; | ||
| 4973 | |||
| 4974 | function prevNode(e, n) { | ||
| 4975 | var a = n.split(','), i; | ||
| 4976 | |||
| 4977 | while ((e = e.previousSibling) != null) { | ||
| 4978 | for (i=0; i<a.length; i++) { | ||
| 4979 | if (e.nodeName == a[i]) | ||
| 4980 | return e; | ||
| 4981 | } | ||
| 4982 | } | ||
| 4983 | |||
| 4984 | return null; | ||
| 4985 | }; | ||
| 4986 | |||
| 4987 | for (x=0; x<a.length; x++) { | ||
| 4988 | nl = t.dom.select(a[x], o.node); | ||
| 4989 | |||
| 4990 | for (i=0; i<nl.length; i++) { | ||
| 4991 | n = nl[i]; | ||
| 4992 | p = n.parentNode; | ||
| 4993 | |||
| 4994 | if (r.test(p.nodeName)) { | ||
| 4995 | np = prevNode(n, 'LI'); | ||
| 4996 | |||
| 4997 | if (!np) { | ||
| 4998 | np = t.dom.create('li'); | ||
| 4999 | np.innerHTML = ' '; | ||
| 5000 | np.appendChild(n); | ||
| 5001 | p.insertBefore(np, p.firstChild); | ||
| 5002 | } else | ||
| 5003 | np.appendChild(n); | ||
| 5004 | } | ||
| 5005 | } | ||
| 5006 | } | ||
| 5007 | }); | ||
| 5008 | } | ||
| 5009 | |||
| 5010 | if (s.fix_table_elements) { | ||
| 5011 | t.onPreProcess.add(function(se, o) { | ||
| 5012 | // Since Opera will crash if you attach the node to a dynamic document we need to brrowser sniff a specific build | ||
| 5013 | // so Opera users with an older version will have to live with less compaible output not much we can do here | ||
| 5014 | if (!tinymce.isOpera || opera.buildNumber() >= 1767) { | ||
| 5015 | each(t.dom.select('p table', o.node).reverse(), function(n) { | ||
| 5016 | var parent = t.dom.getParent(n.parentNode, 'table,p'); | ||
| 5017 | |||
| 5018 | if (parent.nodeName != 'TABLE') { | ||
| 5019 | try { | ||
| 5020 | t.dom.split(parent, n); | ||
| 5021 | } catch (ex) { | ||
| 5022 | // IE can sometimes fire an unknown runtime error so we just ignore it | ||
| 5023 | } | ||
| 5024 | } | ||
| 5025 | }); | ||
| 5026 | } | ||
| 5027 | }); | ||
| 5028 | } | ||
| 5029 | }, | ||
| 5030 | |||
| 5031 | setEntities : function(s) { | ||
| 5032 | var t = this, a, i, l = {}, re = '', v; | ||
| 5033 | |||
| 5034 | // No need to setup more than once | ||
| 5035 | if (t.entityLookup) | ||
| 5036 | return; | ||
| 5037 | |||
| 5038 | // Build regex and lookup array | ||
| 5039 | a = s.split(','); | ||
| 5040 | for (i = 0; i < a.length; i += 2) { | ||
| 5041 | v = a[i]; | ||
| 5042 | |||
| 5043 | // Don't add default & " etc. | ||
| 5044 | if (v == 34 || v == 38 || v == 60 || v == 62) | ||
| 5045 | continue; | ||
| 5046 | |||
| 5047 | l[String.fromCharCode(a[i])] = a[i + 1]; | ||
| 5048 | |||
| 5049 | v = parseInt(a[i]).toString(16); | ||
| 5050 | re += '\\u' + '0000'.substring(v.length) + v; | ||
| 5051 | } | ||
| 5052 | |||
| 5053 | if (!re) { | ||
| 5054 | t.settings.entity_encoding = 'raw'; | ||
| 5055 | return; | ||
| 5056 | } | ||
| 5057 | |||
| 5058 | t.entitiesRE = new RegExp('[' + re + ']', 'g'); | ||
| 5059 | t.entityLookup = l; | ||
| 5060 | }, | ||
| 5061 | |||
| 5062 | setValidChildRules : function(s) { | ||
| 5063 | this.childRules = null; | ||
| 5064 | this.addValidChildRules(s); | ||
| 5065 | }, | ||
| 5066 | |||
| 5067 | addValidChildRules : function(s) { | ||
| 5068 | var t = this, inst, intr, bloc; | ||
| 5069 | |||
| 5070 | if (!s) | ||
| 5071 | return; | ||
| 5072 | |||
| 5073 | inst = 'A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment'; | ||
| 5074 | intr = 'A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment'; | ||
| 5075 | bloc = 'H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP'; | ||
| 5076 | |||
| 5077 | each(s.split(','), function(s) { | ||
| 5078 | var p = s.split(/\[|\]/), re; | ||
| 5079 | |||
| 5080 | s = ''; | ||
| 5081 | each(p[1].split('|'), function(v) { | ||
| 5082 | if (s) | ||
| 5083 | s += '|'; | ||
| 5084 | |||
| 5085 | switch (v) { | ||
| 5086 | case '%itrans': | ||
| 5087 | v = intr; | ||
| 5088 | break; | ||
| 5089 | |||
| 5090 | case '%itrans_na': | ||
| 5091 | v = intr.substring(2); | ||
| 5092 | break; | ||
| 5093 | |||
| 5094 | case '%istrict': | ||
| 5095 | v = inst; | ||
| 5096 | break; | ||
| 5097 | |||
| 5098 | case '%istrict_na': | ||
| 5099 | v = inst.substring(2); | ||
| 5100 | break; | ||
| 5101 | |||
| 5102 | case '%btrans': | ||
| 5103 | v = bloc; | ||
| 5104 | break; | ||
| 5105 | |||
| 5106 | case '%bstrict': | ||
| 5107 | v = bloc; | ||
| 5108 | break; | ||
| 5109 | } | ||
| 5110 | |||
| 5111 | s += v; | ||
| 5112 | }); | ||
| 5113 | re = new RegExp('^(' + s.toLowerCase() + ')$', 'i'); | ||
| 5114 | |||
| 5115 | each(p[0].split('/'), function(s) { | ||
| 5116 | t.childRules = t.childRules || {}; | ||
| 5117 | t.childRules[s] = re; | ||
| 5118 | }); | ||
| 5119 | }); | ||
| 5120 | |||
| 5121 | // Build regex | ||
| 5122 | s = ''; | ||
| 5123 | each(t.childRules, function(v, k) { | ||
| 5124 | if (s) | ||
| 5125 | s += '|'; | ||
| 5126 | |||
| 5127 | s += k; | ||
| 5128 | }); | ||
| 5129 | |||
| 5130 | t.parentElementsRE = new RegExp('^(' + s.toLowerCase() + ')$', 'i'); | ||
| 5131 | |||
| 5132 | /*console.debug(t.parentElementsRE.toString()); | ||
| 5133 | each(t.childRules, function(v) { | ||
| 5134 | console.debug(v.toString()); | ||
| 5135 | });*/ | ||
| 5136 | }, | ||
| 5137 | |||
| 5138 | setRules : function(s) { | ||
| 5139 | var t = this; | ||
| 5140 | |||
| 5141 | t._setup(); | ||
| 5142 | t.rules = {}; | ||
| 5143 | t.wildRules = []; | ||
| 5144 | t.validElements = {}; | ||
| 5145 | |||
| 5146 | return t.addRules(s); | ||
| 5147 | }, | ||
| 5148 | |||
| 5149 | addRules : function(s) { | ||
| 5150 | var t = this, dr; | ||
| 5151 | |||
| 5152 | if (!s) | ||
| 5153 | return; | ||
| 5154 | |||
| 5155 | t._setup(); | ||
| 5156 | |||
| 5157 | each(s.split(','), function(s) { | ||
| 5158 | var p = s.split(/\[|\]/), tn = p[0].split('/'), ra, at, wat, va = []; | ||
| 5159 | |||
| 5160 | // Extend with default rules | ||
| 5161 | if (dr) | ||
| 5162 | at = tinymce.extend([], dr.attribs); | ||
| 5163 | |||
| 5164 | // Parse attributes | ||
| 5165 | if (p.length > 1) { | ||
| 5166 | each(p[1].split('|'), function(s) { | ||
| 5167 | var ar = {}, i; | ||
| 5168 | |||
| 5169 | at = at || []; | ||
| 5170 | |||
| 5171 | // Parse attribute rule | ||
| 5172 | s = s.replace(/::/g, '~'); | ||
| 5173 | s = /^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(s); | ||
| 5174 | s[2] = s[2].replace(/~/g, ':'); | ||
| 5175 | |||
| 5176 | // Add required attributes | ||
| 5177 | if (s[1] == '!') { | ||
| 5178 | ra = ra || []; | ||
| 5179 | ra.push(s[2]); | ||
| 5180 | } | ||
| 5181 | |||
| 5182 | // Remove inherited attributes | ||
| 5183 | if (s[1] == '-') { | ||
| 5184 | for (i = 0; i <at.length; i++) { | ||
| 5185 | if (at[i].name == s[2]) { | ||
| 5186 | at.splice(i, 1); | ||
| 5187 | return; | ||
| 5188 | } | ||
| 5189 | } | ||
| 5190 | } | ||
| 5191 | |||
| 5192 | switch (s[3]) { | ||
| 5193 | // Add default attrib values | ||
| 5194 | case '=': | ||
| 5195 | ar.defaultVal = s[4] || ''; | ||
| 5196 | break; | ||
| 5197 | |||
| 5198 | // Add forced attrib values | ||
| 5199 | case ':': | ||
| 5200 | ar.forcedVal = s[4]; | ||
| 5201 | break; | ||
| 5202 | |||
| 5203 | // Add validation values | ||
| 5204 | case '<': | ||
| 5205 | ar.validVals = s[4].split('?'); | ||
| 5206 | break; | ||
| 5207 | } | ||
| 5208 | |||
| 5209 | if (/[*.?]/.test(s[2])) { | ||
| 5210 | wat = wat || []; | ||
| 5211 | ar.nameRE = new RegExp('^' + wildcardToRE(s[2]) + '$'); | ||
| 5212 | wat.push(ar); | ||
| 5213 | } else { | ||
| 5214 | ar.name = s[2]; | ||
| 5215 | at.push(ar); | ||
| 5216 | } | ||
| 5217 | |||
| 5218 | va.push(s[2]); | ||
| 5219 | }); | ||
| 5220 | } | ||
| 5221 | |||
| 5222 | // Handle element names | ||
| 5223 | each(tn, function(s, i) { | ||
| 5224 | var pr = s.charAt(0), x = 1, ru = {}; | ||
| 5225 | |||
| 5226 | // Extend with default rule data | ||
| 5227 | if (dr) { | ||
| 5228 | if (dr.noEmpty) | ||
| 5229 | ru.noEmpty = dr.noEmpty; | ||
| 5230 | |||
| 5231 | if (dr.fullEnd) | ||
| 5232 | ru.fullEnd = dr.fullEnd; | ||
| 5233 | |||
| 5234 | if (dr.padd) | ||
| 5235 | ru.padd = dr.padd; | ||
| 5236 | } | ||
| 5237 | |||
| 5238 | // Handle prefixes | ||
| 5239 | switch (pr) { | ||
| 5240 | case '-': | ||
| 5241 | ru.noEmpty = true; | ||
| 5242 | break; | ||
| 5243 | |||
| 5244 | case '+': | ||
| 5245 | ru.fullEnd = true; | ||
| 5246 | break; | ||
| 5247 | |||
| 5248 | case '#': | ||
| 5249 | ru.padd = true; | ||
| 5250 | break; | ||
| 5251 | |||
| 5252 | default: | ||
| 5253 | x = 0; | ||
| 5254 | } | ||
| 5255 | |||
| 5256 | tn[i] = s = s.substring(x); | ||
| 5257 | t.validElements[s] = 1; | ||
| 5258 | |||
| 5259 | // Add element name or element regex | ||
| 5260 | if (/[*.?]/.test(tn[0])) { | ||
| 5261 | ru.nameRE = new RegExp('^' + wildcardToRE(tn[0]) + '$'); | ||
| 5262 | t.wildRules = t.wildRules || {}; | ||
| 5263 | t.wildRules.push(ru); | ||
| 5264 | } else { | ||
| 5265 | ru.name = tn[0]; | ||
| 5266 | |||
| 5267 | // Store away default rule | ||
| 5268 | if (tn[0] == '@') | ||
| 5269 | dr = ru; | ||
| 5270 | |||
| 5271 | t.rules[s] = ru; | ||
| 5272 | } | ||
| 5273 | |||
| 5274 | ru.attribs = at; | ||
| 5275 | |||
| 5276 | if (ra) | ||
| 5277 | ru.requiredAttribs = ra; | ||
| 5278 | |||
| 5279 | if (wat) { | ||
| 5280 | // Build valid attributes regexp | ||
| 5281 | s = ''; | ||
| 5282 | each(va, function(v) { | ||
| 5283 | if (s) | ||
| 5284 | s += '|'; | ||
| 5285 | |||
| 5286 | s += '(' + wildcardToRE(v) + ')'; | ||
| 5287 | }); | ||
| 5288 | ru.validAttribsRE = new RegExp('^' + s.toLowerCase() + '$'); | ||
| 5289 | ru.wildAttribs = wat; | ||
| 5290 | } | ||
| 5291 | }); | ||
| 5292 | }); | ||
| 5293 | |||
| 5294 | // Build valid elements regexp | ||
| 5295 | s = ''; | ||
| 5296 | each(t.validElements, function(v, k) { | ||
| 5297 | if (s) | ||
| 5298 | s += '|'; | ||
| 5299 | |||
| 5300 | if (k != '@') | ||
| 5301 | s += k; | ||
| 5302 | }); | ||
| 5303 | t.validElementsRE = new RegExp('^(' + wildcardToRE(s.toLowerCase()) + ')$'); | ||
| 5304 | |||
| 5305 | //console.debug(t.validElementsRE.toString()); | ||
| 5306 | //console.dir(t.rules); | ||
| 5307 | //console.dir(t.wildRules); | ||
| 5308 | }, | ||
| 5309 | |||
| 5310 | findRule : function(n) { | ||
| 5311 | var t = this, rl = t.rules, i, r; | ||
| 5312 | |||
| 5313 | t._setup(); | ||
| 5314 | |||
| 5315 | // Exact match | ||
| 5316 | r = rl[n]; | ||
| 5317 | if (r) | ||
| 5318 | return r; | ||
| 5319 | |||
| 5320 | // Try wildcards | ||
| 5321 | rl = t.wildRules; | ||
| 5322 | for (i = 0; i < rl.length; i++) { | ||
| 5323 | if (rl[i].nameRE.test(n)) | ||
| 5324 | return rl[i]; | ||
| 5325 | } | ||
| 5326 | |||
| 5327 | return null; | ||
| 5328 | }, | ||
| 5329 | |||
| 5330 | findAttribRule : function(ru, n) { | ||
| 5331 | var i, wa = ru.wildAttribs; | ||
| 5332 | |||
| 5333 | for (i = 0; i < wa.length; i++) { | ||
| 5334 | if (wa[i].nameRE.test(n)) | ||
| 5335 | return wa[i]; | ||
| 5336 | } | ||
| 5337 | |||
| 5338 | return null; | ||
| 5339 | }, | ||
| 5340 | |||
| 5341 | serialize : function(n, o) { | ||
| 5342 | var h, t = this, doc, oldDoc, impl, selected; | ||
| 5343 | |||
| 5344 | t._setup(); | ||
| 5345 | o = o || {}; | ||
| 5346 | o.format = o.format || 'html'; | ||
| 5347 | t.processObj = o; | ||
| 5348 | |||
| 5349 | // IE looses the selected attribute on option elements so we need to store it | ||
| 5350 | // See: http://support.microsoft.com/kb/829907 | ||
| 5351 | if (isIE) { | ||
| 5352 | selected = []; | ||
| 5353 | each(n.getElementsByTagName('option'), function(n) { | ||
| 5354 | var v = t.dom.getAttrib(n, 'selected'); | ||
| 5355 | |||
| 5356 | selected.push(v ? v : null); | ||
| 5357 | }); | ||
| 5358 | } | ||
| 5359 | |||
| 5360 | n = n.cloneNode(true); | ||
| 5361 | |||
| 5362 | // IE looses the selected attribute on option elements so we need to restore it | ||
| 5363 | if (isIE) { | ||
| 5364 | each(n.getElementsByTagName('option'), function(n, i) { | ||
| 5365 | t.dom.setAttrib(n, 'selected', selected[i]); | ||
| 5366 | }); | ||
| 5367 | } | ||
| 5368 | |||
| 5369 | // Nodes needs to be attached to something in WebKit/Opera | ||
| 5370 | // Older builds of Opera crashes if you attach the node to an document created dynamically | ||
| 5371 | // and since we can't feature detect a crash we need to sniff the acutal build number | ||
| 5372 | // This fix will make DOM ranges and make Sizzle happy! | ||
| 5373 | impl = n.ownerDocument.implementation; | ||
| 5374 | if (impl.createHTMLDocument && (tinymce.isOpera && opera.buildNumber() >= 1767)) { | ||
| 5375 | // Create an empty HTML document | ||
| 5376 | doc = impl.createHTMLDocument(""); | ||
| 5377 | |||
| 5378 | // Add the element or it's children if it's a body element to the new document | ||
| 5379 | each(n.nodeName == 'BODY' ? n.childNodes : [n], function(node) { | ||
| 5380 | doc.body.appendChild(doc.importNode(node, true)); | ||
| 5381 | }); | ||
| 5382 | |||
| 5383 | // Grab first child or body element for serialization | ||
| 5384 | if (n.nodeName != 'BODY') | ||
| 5385 | n = doc.body.firstChild; | ||
| 5386 | else | ||
| 5387 | n = doc.body; | ||
| 5388 | |||
| 5389 | // set the new document in DOMUtils so createElement etc works | ||
| 5390 | oldDoc = t.dom.doc; | ||
| 5391 | t.dom.doc = doc; | ||
| 5392 | } | ||
| 5393 | |||
| 5394 | t.key = '' + (parseInt(t.key) + 1); | ||
| 5395 | |||
| 5396 | // Pre process | ||
| 5397 | if (!o.no_events) { | ||
| 5398 | o.node = n; | ||
| 5399 | t.onPreProcess.dispatch(t, o); | ||
| 5400 | } | ||
| 5401 | |||
| 5402 | // Serialize HTML DOM into a string | ||
| 5403 | t.writer.reset(); | ||
| 5404 | t._serializeNode(n, o.getInner); | ||
| 5405 | |||
| 5406 | // Post process | ||
| 5407 | o.content = t.writer.getContent(); | ||
| 5408 | |||
| 5409 | // Restore the old document if it was changed | ||
| 5410 | if (oldDoc) | ||
| 5411 | t.dom.doc = oldDoc; | ||
| 5412 | |||
| 5413 | if (!o.no_events) | ||
| 5414 | t.onPostProcess.dispatch(t, o); | ||
| 5415 | |||
| 5416 | t._postProcess(o); | ||
| 5417 | o.node = null; | ||
| 5418 | |||
| 5419 | return tinymce.trim(o.content); | ||
| 5420 | }, | ||
| 5421 | |||
| 5422 | // Internal functions | ||
| 5423 | |||
| 5424 | _postProcess : function(o) { | ||
| 5425 | var t = this, s = t.settings, h = o.content, sc = [], p; | ||
| 5426 | |||
| 5427 | if (o.format == 'html') { | ||
| 5428 | // Protect some elements | ||
| 5429 | p = t._protect({ | ||
| 5430 | content : h, | ||
| 5431 | patterns : [ | ||
| 5432 | {pattern : /(<script[^>]*>)(.*?)(<\/script>)/g}, | ||
| 5433 | {pattern : /(<noscript[^>]*>)(.*?)(<\/noscript>)/g}, | ||
| 5434 | {pattern : /(<style[^>]*>)(.*?)(<\/style>)/g}, | ||
| 5435 | {pattern : /(<pre[^>]*>)(.*?)(<\/pre>)/g, encode : 1}, | ||
| 5436 | {pattern : /(<!--\[CDATA\[)(.*?)(\]\]-->)/g} | ||
| 5437 | ] | ||
| 5438 | }); | ||
| 5439 | |||
| 5440 | h = p.content; | ||
| 5441 | |||
| 5442 | // Entity encode | ||
| 5443 | if (s.entity_encoding !== 'raw') | ||
| 5444 | h = t._encode(h); | ||
| 5445 | |||
| 5446 | // Use BR instead of padded P elements inside editor and use <p> </p> outside editor | ||
| 5447 | /* if (o.set) | ||
| 5448 | h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p><br /></p>'); | ||
| 5449 | else | ||
| 5450 | h = h.replace(/<p>\s+( | |\u00a0|<br \/>)\s+<\/p>/g, '<p>$1</p>');*/ | ||
| 5451 | |||
| 5452 | // Since Gecko and Safari keeps whitespace in the DOM we need to | ||
| 5453 | // remove it inorder to match other browsers. But I think Gecko and Safari is right. | ||
| 5454 | // This process is only done when getting contents out from the editor. | ||
| 5455 | if (!o.set) { | ||
| 5456 | // We need to replace paragraph whitespace with an nbsp before indentation to keep the \u00a0 char | ||
| 5457 | h = h.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g, s.entity_encoding == 'numeric' ? '<p$1> </p>' : '<p$1> </p>'); | ||
| 5458 | |||
| 5459 | if (s.remove_linebreaks) { | ||
| 5460 | h = h.replace(/\r?\n|\r/g, ' '); | ||
| 5461 | h = h.replace(/(<[^>]+>)\s+/g, '$1 '); | ||
| 5462 | h = h.replace(/\s+(<\/[^>]+>)/g, ' $1'); | ||
| 5463 | h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g, '<$1 $2>'); // Trim block start | ||
| 5464 | h = h.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g, '<$1>'); // Trim block start | ||
| 5465 | h = h.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g, '</$1>'); // Trim block end | ||
| 5466 | } | ||
| 5467 | |||
| 5468 | // Simple indentation | ||
| 5469 | if (s.apply_source_formatting && s.indent_mode == 'simple') { | ||
| 5470 | // Add line breaks before and after block elements | ||
| 5471 | h = h.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g, '\n<$1$2$3>\n'); | ||
| 5472 | h = h.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g, '\n<$1$2>'); | ||
| 5473 | h = h.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g, '</$1>\n'); | ||
| 5474 | h = h.replace(/\n\n/g, '\n'); | ||
| 5475 | } | ||
| 5476 | } | ||
| 5477 | |||
| 5478 | h = t._unprotect(h, p); | ||
| 5479 | |||
| 5480 | // Restore CDATA sections | ||
| 5481 | h = h.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g, '<![CDATA[$1]]>'); | ||
| 5482 | |||
| 5483 | // Restore the \u00a0 character if raw mode is enabled | ||
| 5484 | if (s.entity_encoding == 'raw') | ||
| 5485 | h = h.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g, '<p$1>\u00a0</p>'); | ||
| 5486 | |||
| 5487 | // Restore noscript elements | ||
| 5488 | h = h.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g, function(v, attribs, text) { | ||
| 5489 | return '<noscript' + attribs + '>' + t.dom.decode(text.replace(/<!--|-->/g, '')) + '</noscript>'; | ||
| 5490 | }); | ||
| 5491 | } | ||
| 5492 | |||
| 5493 | o.content = h; | ||
| 5494 | }, | ||
| 5495 | |||
| 5496 | _serializeNode : function(n, inn) { | ||
| 5497 | var t = this, s = t.settings, w = t.writer, hc, el, cn, i, l, a, at, no, v, nn, ru, ar, iv, closed; | ||
| 5498 | |||
| 5499 | if (!s.node_filter || s.node_filter(n)) { | ||
| 5500 | switch (n.nodeType) { | ||
| 5501 | case 1: // Element | ||
| 5502 | if (n.hasAttribute ? n.hasAttribute('mce_bogus') : n.getAttribute('mce_bogus')) | ||
| 5503 | return; | ||
| 5504 | |||
| 5505 | iv = false; | ||
| 5506 | hc = n.hasChildNodes(); | ||
| 5507 | nn = n.getAttribute('mce_name') || n.nodeName.toLowerCase(); | ||
| 5508 | |||
| 5509 | // Add correct prefix on IE | ||
| 5510 | if (isIE) { | ||
| 5511 | if (n.scopeName !== 'HTML' && n.scopeName !== 'html') | ||
| 5512 | nn = n.scopeName + ':' + nn; | ||
| 5513 | } | ||
| 5514 | |||
| 5515 | // Remove mce prefix on IE needed for the abbr element | ||
| 5516 | if (nn.indexOf('mce:') === 0) | ||
| 5517 | nn = nn.substring(4); | ||
| 5518 | |||
| 5519 | // Check if valid | ||
| 5520 | if (!t.validElementsRE || !t.validElementsRE.test(nn) || (t.invalidElementsRE && t.invalidElementsRE.test(nn)) || inn) { | ||
| 5521 | iv = true; | ||
| 5522 | break; | ||
| 5523 | } | ||
| 5524 | |||
| 5525 | if (isIE) { | ||
| 5526 | // Fix IE content duplication (DOM can have multiple copies of the same node) | ||
| 5527 | if (s.fix_content_duplication) { | ||
| 5528 | if (n.mce_serialized == t.key) | ||
| 5529 | return; | ||
| 5530 | |||
| 5531 | n.mce_serialized = t.key; | ||
| 5532 | } | ||
| 5533 | |||
| 5534 | // IE sometimes adds a / infront of the node name | ||
| 5535 | if (nn.charAt(0) == '/') | ||
| 5536 | nn = nn.substring(1); | ||
| 5537 | } else if (isGecko) { | ||
| 5538 | // Ignore br elements | ||
| 5539 | if (n.nodeName === 'BR' && n.getAttribute('type') == '_moz') | ||
| 5540 | return; | ||
| 5541 | } | ||
| 5542 | |||
| 5543 | // Check if valid child | ||
| 5544 | if (t.childRules) { | ||
| 5545 | if (t.parentElementsRE.test(t.elementName)) { | ||
| 5546 | if (!t.childRules[t.elementName].test(nn)) { | ||
| 5547 | iv = true; | ||
| 5548 | break; | ||
| 5549 | } | ||
| 5550 | } | ||
| 5551 | |||
| 5552 | t.elementName = nn; | ||
| 5553 | } | ||
| 5554 | |||
| 5555 | ru = t.findRule(nn); | ||
| 5556 | nn = ru.name || nn; | ||
| 5557 | closed = s.closed.test(nn); | ||
| 5558 | |||
| 5559 | // Skip empty nodes or empty node name in IE | ||
| 5560 | if ((!hc && ru.noEmpty) || (isIE && !nn)) { | ||
| 5561 | iv = true; | ||
| 5562 | break; | ||
| 5563 | } | ||
| 5564 | |||
| 5565 | // Check required | ||
| 5566 | if (ru.requiredAttribs) { | ||
| 5567 | a = ru.requiredAttribs; | ||
| 5568 | |||
| 5569 | for (i = a.length - 1; i >= 0; i--) { | ||
| 5570 | if (this.dom.getAttrib(n, a[i]) !== '') | ||
| 5571 | break; | ||
| 5572 | } | ||
| 5573 | |||
| 5574 | // None of the required was there | ||
| 5575 | if (i == -1) { | ||
| 5576 | iv = true; | ||
| 5577 | break; | ||
| 5578 | } | ||
| 5579 | } | ||
| 5580 | |||
| 5581 | w.writeStartElement(nn); | ||
| 5582 | |||
| 5583 | // Add ordered attributes | ||
| 5584 | if (ru.attribs) { | ||
| 5585 | for (i=0, at = ru.attribs, l = at.length; i<l; i++) { | ||
| 5586 | a = at[i]; | ||
| 5587 | v = t._getAttrib(n, a); | ||
| 5588 | |||
| 5589 | if (v !== null) | ||
| 5590 | w.writeAttribute(a.name, v); | ||
| 5591 | } | ||
| 5592 | } | ||
| 5593 | |||
| 5594 | // Add wild attributes | ||
| 5595 | if (ru.validAttribsRE) { | ||
| 5596 | at = t.dom.getAttribs(n); | ||
| 5597 | for (i=at.length-1; i>-1; i--) { | ||
| 5598 | no = at[i]; | ||
| 5599 | |||
| 5600 | if (no.specified) { | ||
| 5601 | a = no.nodeName.toLowerCase(); | ||
| 5602 | |||
| 5603 | if (s.invalid_attrs.test(a) || !ru.validAttribsRE.test(a)) | ||
| 5604 | continue; | ||
| 5605 | |||
| 5606 | ar = t.findAttribRule(ru, a); | ||
| 5607 | v = t._getAttrib(n, ar, a); | ||
| 5608 | |||
| 5609 | if (v !== null) | ||
| 5610 | w.writeAttribute(a, v); | ||
| 5611 | } | ||
| 5612 | } | ||
| 5613 | } | ||
| 5614 | |||
| 5615 | // Write text from script | ||
| 5616 | if (nn === 'script' && tinymce.trim(n.innerHTML)) { | ||
| 5617 | w.writeText('// '); // Padd it with a comment so it will parse on older browsers | ||
| 5618 | w.writeCDATA(n.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g, '')); // Remove comments and cdata stuctures | ||
| 5619 | hc = false; | ||
| 5620 | break; | ||
| 5621 | } | ||
| 5622 | |||
| 5623 | // Padd empty nodes with a | ||
| 5624 | if (ru.padd) { | ||
| 5625 | // If it has only one bogus child, padd it anyway workaround for <td><br /></td> bug | ||
| 5626 | if (hc && (cn = n.firstChild) && cn.nodeType === 1 && n.childNodes.length === 1) { | ||
| 5627 | if (cn.hasAttribute ? cn.hasAttribute('mce_bogus') : cn.getAttribute('mce_bogus')) | ||
| 5628 | w.writeText('\u00a0'); | ||
| 5629 | } else if (!hc) | ||
| 5630 | w.writeText('\u00a0'); // No children then padd it | ||
| 5631 | } | ||
| 5632 | |||
| 5633 | break; | ||
| 5634 | |||
| 5635 | case 3: // Text | ||
| 5636 | // Check if valid child | ||
| 5637 | if (t.childRules && t.parentElementsRE.test(t.elementName)) { | ||
| 5638 | if (!t.childRules[t.elementName].test(n.nodeName)) | ||
| 5639 | return; | ||
| 5640 | } | ||
| 5641 | |||
| 5642 | return w.writeText(n.nodeValue); | ||
| 5643 | |||
| 5644 | case 4: // CDATA | ||
| 5645 | return w.writeCDATA(n.nodeValue); | ||
| 5646 | |||
| 5647 | case 8: // Comment | ||
| 5648 | return w.writeComment(n.nodeValue); | ||
| 5649 | } | ||
| 5650 | } else if (n.nodeType == 1) | ||
| 5651 | hc = n.hasChildNodes(); | ||
| 5652 | |||
| 5653 | if (hc && !closed) { | ||
| 5654 | cn = n.firstChild; | ||
| 5655 | |||
| 5656 | while (cn) { | ||
| 5657 | t._serializeNode(cn); | ||
| 5658 | t.elementName = nn; | ||
| 5659 | cn = cn.nextSibling; | ||
| 5660 | } | ||
| 5661 | } | ||
| 5662 | |||
| 5663 | // Write element end | ||
| 5664 | if (!iv) { | ||
| 5665 | if (!closed) | ||
| 5666 | w.writeFullEndElement(); | ||
| 5667 | else | ||
| 5668 | w.writeEndElement(); | ||
| 5669 | } | ||
| 5670 | }, | ||
| 5671 | |||
| 5672 | _protect : function(o) { | ||
| 5673 | var t = this; | ||
| 5674 | |||
| 5675 | o.items = o.items || []; | ||
| 5676 | |||
| 5677 | function enc(s) { | ||
| 5678 | return s.replace(/[\r\n\\]/g, function(c) { | ||
| 5679 | if (c === '\n') | ||
| 5680 | return '\\n'; | ||
| 5681 | else if (c === '\\') | ||
| 5682 | return '\\\\'; | ||
| 5683 | |||
| 5684 | return '\\r'; | ||
| 5685 | }); | ||
| 5686 | }; | ||
| 5687 | |||
| 5688 | function dec(s) { | ||
| 5689 | return s.replace(/\\[\\rn]/g, function(c) { | ||
| 5690 | if (c === '\\n') | ||
| 5691 | return '\n'; | ||
| 5692 | else if (c === '\\\\') | ||
| 5693 | return '\\'; | ||
| 5694 | |||
| 5695 | return '\r'; | ||
| 5696 | }); | ||
| 5697 | }; | ||
| 5698 | |||
| 5699 | each(o.patterns, function(p) { | ||
| 5700 | o.content = dec(enc(o.content).replace(p.pattern, function(x, a, b, c) { | ||
| 5701 | b = dec(b); | ||
| 5702 | |||
| 5703 | if (p.encode) | ||
| 5704 | b = t._encode(b); | ||
| 5705 | |||
| 5706 | o.items.push(b); | ||
| 5707 | return a + '<!--mce:' + (o.items.length - 1) + '-->' + c; | ||
| 5708 | })); | ||
| 5709 | }); | ||
| 5710 | |||
| 5711 | return o; | ||
| 5712 | }, | ||
| 5713 | |||
| 5714 | _unprotect : function(h, o) { | ||
| 5715 | h = h.replace(/\<!--mce:([0-9]+)--\>/g, function(a, b) { | ||
| 5716 | return o.items[parseInt(b)]; | ||
| 5717 | }); | ||
| 5718 | |||
| 5719 | o.items = []; | ||
| 5720 | |||
| 5721 | return h; | ||
| 5722 | }, | ||
| 5723 | |||
| 5724 | _encode : function(h) { | ||
| 5725 | var t = this, s = t.settings, l; | ||
| 5726 | |||
| 5727 | // Entity encode | ||
| 5728 | if (s.entity_encoding !== 'raw') { | ||
| 5729 | if (s.entity_encoding.indexOf('named') != -1) { | ||
| 5730 | t.setEntities(s.entities); | ||
| 5731 | l = t.entityLookup; | ||
| 5732 | |||
| 5733 | h = h.replace(t.entitiesRE, function(a) { | ||
| 5734 | var v; | ||
| 5735 | |||
| 5736 | if (v = l[a]) | ||
| 5737 | a = '&' + v + ';'; | ||
| 5738 | |||
| 5739 | return a; | ||
| 5740 | }); | ||
| 5741 | } | ||
| 5742 | |||
| 5743 | if (s.entity_encoding.indexOf('numeric') != -1) { | ||
| 5744 | h = h.replace(/[\u007E-\uFFFF]/g, function(a) { | ||
| 5745 | return '&#' + a.charCodeAt(0) + ';'; | ||
| 5746 | }); | ||
| 5747 | } | ||
| 5748 | } | ||
| 5749 | |||
| 5750 | return h; | ||
| 5751 | }, | ||
| 5752 | |||
| 5753 | _setup : function() { | ||
| 5754 | var t = this, s = this.settings; | ||
| 5755 | |||
| 5756 | if (t.done) | ||
| 5757 | return; | ||
| 5758 | |||
| 5759 | t.done = 1; | ||
| 5760 | |||
| 5761 | t.setRules(s.valid_elements); | ||
| 5762 | t.addRules(s.extended_valid_elements); | ||
| 5763 | t.addValidChildRules(s.valid_child_elements); | ||
| 5764 | |||
| 5765 | if (s.invalid_elements) | ||
| 5766 | t.invalidElementsRE = new RegExp('^(' + wildcardToRE(s.invalid_elements.replace(/,/g, '|').toLowerCase()) + ')$'); | ||
| 5767 | |||
| 5768 | if (s.attrib_value_filter) | ||
| 5769 | t.attribValueFilter = s.attribValueFilter; | ||
| 5770 | }, | ||
| 5771 | |||
| 5772 | _getAttrib : function(n, a, na) { | ||
| 5773 | var i, v; | ||
| 5774 | |||
| 5775 | na = na || a.name; | ||
| 5776 | |||
| 5777 | if (a.forcedVal && (v = a.forcedVal)) { | ||
| 5778 | if (v === '{$uid}') | ||
| 5779 | return this.dom.uniqueId(); | ||
| 5780 | |||
| 5781 | return v; | ||
| 5782 | } | ||
| 5783 | |||
| 5784 | v = this.dom.getAttrib(n, na); | ||
| 5785 | |||
| 5786 | switch (na) { | ||
| 5787 | case 'rowspan': | ||
| 5788 | case 'colspan': | ||
| 5789 | // Whats the point? Remove usless attribute value | ||
| 5790 | if (v == '1') | ||
| 5791 | v = ''; | ||
| 5792 | |||
| 5793 | break; | ||
| 5794 | } | ||
| 5795 | |||
| 5796 | if (this.attribValueFilter) | ||
| 5797 | v = this.attribValueFilter(na, v, n); | ||
| 5798 | |||
| 5799 | if (a.validVals) { | ||
| 5800 | for (i = a.validVals.length - 1; i >= 0; i--) { | ||
| 5801 | if (v == a.validVals[i]) | ||
| 5802 | break; | ||
| 5803 | } | ||
| 5804 | |||
| 5805 | if (i == -1) | ||
| 5806 | return null; | ||
| 5807 | } | ||
| 5808 | |||
| 5809 | if (v === '' && typeof(a.defaultVal) != 'undefined') { | ||
| 5810 | v = a.defaultVal; | ||
| 5811 | |||
| 5812 | if (v === '{$uid}') | ||
| 5813 | return this.dom.uniqueId(); | ||
| 5814 | |||
| 5815 | return v; | ||
| 5816 | } else { | ||
| 5817 | // Remove internal mceItemXX classes when content is extracted from editor | ||
| 5818 | if (na == 'class' && this.processObj.get) | ||
| 5819 | v = v.replace(/\s?mceItem\w+\s?/g, ''); | ||
| 5820 | } | ||
| 5821 | |||
| 5822 | if (v === '') | ||
| 5823 | return null; | ||
| 5824 | |||
| 5825 | |||
| 5826 | return v; | ||
| 5827 | } | ||
| 5828 | }); | ||
| 5829 | })(tinymce); | ||
| 5830 | (function(tinymce) { | ||
| 5831 | var each = tinymce.each, Event = tinymce.dom.Event; | ||
| 5832 | |||
| 5833 | tinymce.create('tinymce.dom.ScriptLoader', { | ||
| 5834 | ScriptLoader : function(s) { | ||
| 5835 | this.settings = s || {}; | ||
| 5836 | this.queue = []; | ||
| 5837 | this.lookup = {}; | ||
| 5838 | }, | ||
| 5839 | |||
| 5840 | isDone : function(u) { | ||
| 5841 | return this.lookup[u] ? this.lookup[u].state == 2 : 0; | ||
| 5842 | }, | ||
| 5843 | |||
| 5844 | markDone : function(u) { | ||
| 5845 | this.lookup[u] = {state : 2, url : u}; | ||
| 5846 | }, | ||
| 5847 | |||
| 5848 | add : function(u, cb, s, pr) { | ||
| 5849 | var t = this, lo = t.lookup, o; | ||
| 5850 | |||
| 5851 | if (o = lo[u]) { | ||
| 5852 | // Is loaded fire callback | ||
| 5853 | if (cb && o.state == 2) | ||
| 5854 | cb.call(s || this); | ||
| 5855 | |||
| 5856 | return o; | ||
| 5857 | } | ||
| 5858 | |||
| 5859 | o = {state : 0, url : u, func : cb, scope : s || this}; | ||
| 5860 | |||
| 5861 | if (pr) | ||
| 5862 | t.queue.unshift(o); | ||
| 5863 | else | ||
| 5864 | t.queue.push(o); | ||
| 5865 | |||
| 5866 | lo[u] = o; | ||
| 5867 | |||
| 5868 | return o; | ||
| 5869 | }, | ||
| 5870 | |||
| 5871 | load : function(u, cb, s) { | ||
| 5872 | var t = this, o; | ||
| 5873 | |||
| 5874 | if (o = t.lookup[u]) { | ||
| 5875 | // Is loaded fire callback | ||
| 5876 | if (cb && o.state == 2) | ||
| 5877 | cb.call(s || t); | ||
| 5878 | |||
| 5879 | return o; | ||
| 5880 | } | ||
| 5881 | |||
| 5882 | function loadScript(u) { | ||
| 5883 | if (Event.domLoaded || t.settings.strict_mode) { | ||
| 5884 | tinymce.util.XHR.send({ | ||
| 5885 | url : tinymce._addVer(u), | ||
| 5886 | error : t.settings.error, | ||
| 5887 | async : false, | ||
| 5888 | success : function(co) { | ||
| 5889 | t.eval(co); | ||
| 5890 | } | ||
| 5891 | }); | ||
| 5892 | } else | ||
| 5893 | document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>'); | ||
| 5894 | }; | ||
| 5895 | |||
| 5896 | if (!tinymce.is(u, 'string')) { | ||
| 5897 | each(u, function(u) { | ||
| 5898 | loadScript(u); | ||
| 5899 | }); | ||
| 5900 | |||
| 5901 | if (cb) | ||
| 5902 | cb.call(s || t); | ||
| 5903 | } else { | ||
| 5904 | loadScript(u); | ||
| 5905 | |||
| 5906 | if (cb) | ||
| 5907 | cb.call(s || t); | ||
| 5908 | } | ||
| 5909 | }, | ||
| 5910 | |||
| 5911 | loadQueue : function(cb, s) { | ||
| 5912 | var t = this; | ||
| 5913 | |||
| 5914 | if (!t.queueLoading) { | ||
| 5915 | t.queueLoading = 1; | ||
| 5916 | t.queueCallbacks = []; | ||
| 5917 | |||
| 5918 | t.loadScripts(t.queue, function() { | ||
| 5919 | t.queueLoading = 0; | ||
| 5920 | |||
| 5921 | if (cb) | ||
| 5922 | cb.call(s || t); | ||
| 5923 | |||
| 5924 | each(t.queueCallbacks, function(o) { | ||
| 5925 | o.func.call(o.scope); | ||
| 5926 | }); | ||
| 5927 | }); | ||
| 5928 | } else if (cb) | ||
| 5929 | t.queueCallbacks.push({func : cb, scope : s || t}); | ||
| 5930 | }, | ||
| 5931 | |||
| 5932 | eval : function(co) { | ||
| 5933 | var w = window; | ||
| 5934 | |||
| 5935 | // Evaluate script | ||
| 5936 | if (!w.execScript) { | ||
| 5937 | try { | ||
| 5938 | eval.call(w, co); | ||
| 5939 | } catch (ex) { | ||
| 5940 | eval(co, w); // Firefox 3.0a8 | ||
| 5941 | } | ||
| 5942 | } else | ||
| 5943 | w.execScript(co); // IE | ||
| 5944 | }, | ||
| 5945 | |||
| 5946 | loadScripts : function(sc, cb, s) { | ||
| 5947 | var t = this, lo = t.lookup; | ||
| 5948 | |||
| 5949 | function done(o) { | ||
| 5950 | o.state = 2; // Has been loaded | ||
| 5951 | |||
| 5952 | // Run callback | ||
| 5953 | if (o.func) | ||
| 5954 | o.func.call(o.scope || t); | ||
| 5955 | }; | ||
| 5956 | |||
| 5957 | function allDone() { | ||
| 5958 | var l; | ||
| 5959 | |||
| 5960 | // Check if all files are loaded | ||
| 5961 | l = sc.length; | ||
| 5962 | each(sc, function(o) { | ||
| 5963 | o = lo[o.url]; | ||
| 5964 | |||
| 5965 | if (o.state === 2) {// It has finished loading | ||
| 5966 | done(o); | ||
| 5967 | l--; | ||
| 5968 | } else | ||
| 5969 | load(o); | ||
| 5970 | }); | ||
| 5971 | |||
| 5972 | // They are all loaded | ||
| 5973 | if (l === 0 && cb) { | ||
| 5974 | cb.call(s || t); | ||
| 5975 | cb = 0; | ||
| 5976 | } | ||
| 5977 | }; | ||
| 5978 | |||
| 5979 | function load(o) { | ||
| 5980 | if (o.state > 0) | ||
| 5981 | return; | ||
| 5982 | |||
| 5983 | o.state = 1; // Is loading | ||
| 5984 | |||
| 5985 | tinymce.dom.ScriptLoader.loadScript(o.url, function() { | ||
| 5986 | done(o); | ||
| 5987 | allDone(); | ||
| 5988 | }); | ||
| 5989 | |||
| 5990 | /* | ||
| 5991 | tinymce.util.XHR.send({ | ||
| 5992 | url : o.url, | ||
| 5993 | error : t.settings.error, | ||
| 5994 | success : function(co) { | ||
| 5995 | t.eval(co); | ||
| 5996 | done(o); | ||
| 5997 | allDone(); | ||
| 5998 | } | ||
| 5999 | }); | ||
| 6000 | */ | ||
| 6001 | }; | ||
| 6002 | |||
| 6003 | each(sc, function(o) { | ||
| 6004 | var u = o.url; | ||
| 6005 | |||
| 6006 | // Add to queue if needed | ||
| 6007 | if (!lo[u]) { | ||
| 6008 | lo[u] = o; | ||
| 6009 | t.queue.push(o); | ||
| 6010 | } else | ||
| 6011 | o = lo[u]; | ||
| 6012 | |||
| 6013 | // Is already loading or has been loaded | ||
| 6014 | if (o.state > 0) | ||
| 6015 | return; | ||
| 6016 | |||
| 6017 | if (!Event.domLoaded && !t.settings.strict_mode) { | ||
| 6018 | var ix, ol = ''; | ||
| 6019 | |||
| 6020 | // Add onload events | ||
| 6021 | if (cb || o.func) { | ||
| 6022 | o.state = 1; // Is loading | ||
| 6023 | |||
| 6024 | ix = tinymce.dom.ScriptLoader._addOnLoad(function() { | ||
| 6025 | done(o); | ||
| 6026 | allDone(); | ||
| 6027 | }); | ||
| 6028 | |||
| 6029 | if (tinymce.isIE) | ||
| 6030 | ol = ' onreadystatechange="'; | ||
| 6031 | else | ||
| 6032 | ol = ' onload="'; | ||
| 6033 | |||
| 6034 | ol += 'tinymce.dom.ScriptLoader._onLoad(this,\'' + u + '\',' + ix + ');"'; | ||
| 6035 | } | ||
| 6036 | |||
| 6037 | document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"' + ol + '></script>'); | ||
| 6038 | |||
| 6039 | if (!o.func) | ||
| 6040 | done(o); | ||
| 6041 | } else | ||
| 6042 | load(o); | ||
| 6043 | }); | ||
| 6044 | |||
| 6045 | allDone(); | ||
| 6046 | }, | ||
| 6047 | |||
| 6048 | // Static methods | ||
| 6049 | 'static' : { | ||
| 6050 | _addOnLoad : function(f) { | ||
| 6051 | var t = this; | ||
| 6052 | |||
| 6053 | t._funcs = t._funcs || []; | ||
| 6054 | t._funcs.push(f); | ||
| 6055 | |||
| 6056 | return t._funcs.length - 1; | ||
| 6057 | }, | ||
| 6058 | |||
| 6059 | _onLoad : function(e, u, ix) { | ||
| 6060 | if (!tinymce.isIE || e.readyState == 'complete') | ||
| 6061 | this._funcs[ix].call(this); | ||
| 6062 | }, | ||
| 6063 | |||
| 6064 | loadScript : function(u, cb) { | ||
| 6065 | var id = tinymce.DOM.uniqueId(), e; | ||
| 6066 | |||
| 6067 | function done() { | ||
| 6068 | Event.clear(id); | ||
| 6069 | tinymce.DOM.remove(id); | ||
| 6070 | |||
| 6071 | if (cb) { | ||
| 6072 | cb.call(document, u); | ||
| 6073 | cb = 0; | ||
| 6074 | } | ||
| 6075 | }; | ||
| 6076 | |||
| 6077 | if (tinymce.isIE) { | ||
| 6078 | /* Event.add(e, 'readystatechange', function(e) { | ||
| 6079 | if (e.target && e.target.readyState == 'complete') | ||
| 6080 | done(); | ||
| 6081 | });*/ | ||
| 6082 | |||
| 6083 | tinymce.util.XHR.send({ | ||
| 6084 | url : tinymce._addVer(u), | ||
| 6085 | async : false, | ||
| 6086 | success : function(co) { | ||
| 6087 | window.execScript(co); | ||
| 6088 | done(); | ||
| 6089 | } | ||
| 6090 | }); | ||
| 6091 | } else { | ||
| 6092 | e = tinymce.DOM.create('script', {id : id, type : 'text/javascript', src : tinymce._addVer(u)}); | ||
| 6093 | Event.add(e, 'load', done); | ||
| 6094 | |||
| 6095 | // Check for head or body | ||
| 6096 | (document.getElementsByTagName('head')[0] || document.body).appendChild(e); | ||
| 6097 | } | ||
| 6098 | } | ||
| 6099 | } | ||
| 6100 | }); | ||
| 6101 | |||
| 6102 | // Global script loader | ||
| 6103 | tinymce.ScriptLoader = new tinymce.dom.ScriptLoader(); | ||
| 6104 | })(tinymce); | ||
| 6105 | (function(tinymce) { | ||
| 6106 | // Shorten class names | ||
| 6107 | var DOM = tinymce.DOM, is = tinymce.is; | ||
| 6108 | |||
| 6109 | tinymce.create('tinymce.ui.Control', { | ||
| 6110 | Control : function(id, s) { | ||
| 6111 | this.id = id; | ||
| 6112 | this.settings = s = s || {}; | ||
| 6113 | this.rendered = false; | ||
| 6114 | this.onRender = new tinymce.util.Dispatcher(this); | ||
| 6115 | this.classPrefix = ''; | ||
| 6116 | this.scope = s.scope || this; | ||
| 6117 | this.disabled = 0; | ||
| 6118 | this.active = 0; | ||
| 6119 | }, | ||
| 6120 | |||
| 6121 | setDisabled : function(s) { | ||
| 6122 | var e; | ||
| 6123 | |||
| 6124 | if (s != this.disabled) { | ||
| 6125 | e = DOM.get(this.id); | ||
| 6126 | |||
| 6127 | // Add accessibility title for unavailable actions | ||
| 6128 | if (e && this.settings.unavailable_prefix) { | ||
| 6129 | if (s) { | ||
| 6130 | this.prevTitle = e.title; | ||
| 6131 | e.title = this.settings.unavailable_prefix + ": " + e.title; | ||
| 6132 | } else | ||
| 6133 | e.title = this.prevTitle; | ||
| 6134 | } | ||
| 6135 | |||
| 6136 | this.setState('Disabled', s); | ||
| 6137 | this.setState('Enabled', !s); | ||
| 6138 | this.disabled = s; | ||
| 6139 | } | ||
| 6140 | }, | ||
| 6141 | |||
| 6142 | isDisabled : function() { | ||
| 6143 | return this.disabled; | ||
| 6144 | }, | ||
| 6145 | |||
| 6146 | setActive : function(s) { | ||
| 6147 | if (s != this.active) { | ||
| 6148 | this.setState('Active', s); | ||
| 6149 | this.active = s; | ||
| 6150 | } | ||
| 6151 | }, | ||
| 6152 | |||
| 6153 | isActive : function() { | ||
| 6154 | return this.active; | ||
| 6155 | }, | ||
| 6156 | |||
| 6157 | setState : function(c, s) { | ||
| 6158 | var n = DOM.get(this.id); | ||
| 6159 | |||
| 6160 | c = this.classPrefix + c; | ||
| 6161 | |||
| 6162 | if (s) | ||
| 6163 | DOM.addClass(n, c); | ||
| 6164 | else | ||
| 6165 | DOM.removeClass(n, c); | ||
| 6166 | }, | ||
| 6167 | |||
| 6168 | isRendered : function() { | ||
| 6169 | return this.rendered; | ||
| 6170 | }, | ||
| 6171 | |||
| 6172 | renderHTML : function() { | ||
| 6173 | }, | ||
| 6174 | |||
| 6175 | renderTo : function(n) { | ||
| 6176 | DOM.setHTML(n, this.renderHTML()); | ||
| 6177 | }, | ||
| 6178 | |||
| 6179 | postRender : function() { | ||
| 6180 | var t = this, b; | ||
| 6181 | |||
| 6182 | // Set pending states | ||
| 6183 | if (is(t.disabled)) { | ||
| 6184 | b = t.disabled; | ||
| 6185 | t.disabled = -1; | ||
| 6186 | t.setDisabled(b); | ||
| 6187 | } | ||
| 6188 | |||
| 6189 | if (is(t.active)) { | ||
| 6190 | b = t.active; | ||
| 6191 | t.active = -1; | ||
| 6192 | t.setActive(b); | ||
| 6193 | } | ||
| 6194 | }, | ||
| 6195 | |||
| 6196 | remove : function() { | ||
| 6197 | DOM.remove(this.id); | ||
| 6198 | this.destroy(); | ||
| 6199 | }, | ||
| 6200 | |||
| 6201 | destroy : function() { | ||
| 6202 | tinymce.dom.Event.clear(this.id); | ||
| 6203 | } | ||
| 6204 | }); | ||
| 6205 | })(tinymce);tinymce.create('tinymce.ui.Container:tinymce.ui.Control', { | ||
| 6206 | Container : function(id, s) { | ||
| 6207 | this.parent(id, s); | ||
| 6208 | |||
| 6209 | this.controls = []; | ||
| 6210 | |||
| 6211 | this.lookup = {}; | ||
| 6212 | }, | ||
| 6213 | |||
| 6214 | add : function(c) { | ||
| 6215 | this.lookup[c.id] = c; | ||
| 6216 | this.controls.push(c); | ||
| 6217 | |||
| 6218 | return c; | ||
| 6219 | }, | ||
| 6220 | |||
| 6221 | get : function(n) { | ||
| 6222 | return this.lookup[n]; | ||
| 6223 | } | ||
| 6224 | }); | ||
| 6225 | |||
| 6226 | tinymce.create('tinymce.ui.Separator:tinymce.ui.Control', { | ||
| 6227 | Separator : function(id, s) { | ||
| 6228 | this.parent(id, s); | ||
| 6229 | this.classPrefix = 'mceSeparator'; | ||
| 6230 | }, | ||
| 6231 | |||
| 6232 | renderHTML : function() { | ||
| 6233 | return tinymce.DOM.createHTML('span', {'class' : this.classPrefix}); | ||
| 6234 | } | ||
| 6235 | }); | ||
| 6236 | (function(tinymce) { | ||
| 6237 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; | ||
| 6238 | |||
| 6239 | tinymce.create('tinymce.ui.MenuItem:tinymce.ui.Control', { | ||
| 6240 | MenuItem : function(id, s) { | ||
| 6241 | this.parent(id, s); | ||
| 6242 | this.classPrefix = 'mceMenuItem'; | ||
| 6243 | }, | ||
| 6244 | |||
| 6245 | setSelected : function(s) { | ||
| 6246 | this.setState('Selected', s); | ||
| 6247 | this.selected = s; | ||
| 6248 | }, | ||
| 6249 | |||
| 6250 | isSelected : function() { | ||
| 6251 | return this.selected; | ||
| 6252 | }, | ||
| 6253 | |||
| 6254 | postRender : function() { | ||
| 6255 | var t = this; | ||
| 6256 | |||
| 6257 | t.parent(); | ||
| 6258 | |||
| 6259 | // Set pending state | ||
| 6260 | if (is(t.selected)) | ||
| 6261 | t.setSelected(t.selected); | ||
| 6262 | } | ||
| 6263 | }); | ||
| 6264 | })(tinymce); | ||
| 6265 | (function(tinymce) { | ||
| 6266 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, walk = tinymce.walk; | ||
| 6267 | |||
| 6268 | tinymce.create('tinymce.ui.Menu:tinymce.ui.MenuItem', { | ||
| 6269 | Menu : function(id, s) { | ||
| 6270 | var t = this; | ||
| 6271 | |||
| 6272 | t.parent(id, s); | ||
| 6273 | t.items = {}; | ||
| 6274 | t.collapsed = false; | ||
| 6275 | t.menuCount = 0; | ||
| 6276 | t.onAddItem = new tinymce.util.Dispatcher(this); | ||
| 6277 | }, | ||
| 6278 | |||
| 6279 | expand : function(d) { | ||
| 6280 | var t = this; | ||
| 6281 | |||
| 6282 | if (d) { | ||
| 6283 | walk(t, function(o) { | ||
| 6284 | if (o.expand) | ||
| 6285 | o.expand(); | ||
| 6286 | }, 'items', t); | ||
| 6287 | } | ||
| 6288 | |||
| 6289 | t.collapsed = false; | ||
| 6290 | }, | ||
| 6291 | |||
| 6292 | collapse : function(d) { | ||
| 6293 | var t = this; | ||
| 6294 | |||
| 6295 | if (d) { | ||
| 6296 | walk(t, function(o) { | ||
| 6297 | if (o.collapse) | ||
| 6298 | o.collapse(); | ||
| 6299 | }, 'items', t); | ||
| 6300 | } | ||
| 6301 | |||
| 6302 | t.collapsed = true; | ||
| 6303 | }, | ||
| 6304 | |||
| 6305 | isCollapsed : function() { | ||
| 6306 | return this.collapsed; | ||
| 6307 | }, | ||
| 6308 | |||
| 6309 | add : function(o) { | ||
| 6310 | if (!o.settings) | ||
| 6311 | o = new tinymce.ui.MenuItem(o.id || DOM.uniqueId(), o); | ||
| 6312 | |||
| 6313 | this.onAddItem.dispatch(this, o); | ||
| 6314 | |||
| 6315 | return this.items[o.id] = o; | ||
| 6316 | }, | ||
| 6317 | |||
| 6318 | addSeparator : function() { | ||
| 6319 | return this.add({separator : true}); | ||
| 6320 | }, | ||
| 6321 | |||
| 6322 | addMenu : function(o) { | ||
| 6323 | if (!o.collapse) | ||
| 6324 | o = this.createMenu(o); | ||
| 6325 | |||
| 6326 | this.menuCount++; | ||
| 6327 | |||
| 6328 | return this.add(o); | ||
| 6329 | }, | ||
| 6330 | |||
| 6331 | hasMenus : function() { | ||
| 6332 | return this.menuCount !== 0; | ||
| 6333 | }, | ||
| 6334 | |||
| 6335 | remove : function(o) { | ||
| 6336 | delete this.items[o.id]; | ||
| 6337 | }, | ||
| 6338 | |||
| 6339 | removeAll : function() { | ||
| 6340 | var t = this; | ||
| 6341 | |||
| 6342 | walk(t, function(o) { | ||
| 6343 | if (o.removeAll) | ||
| 6344 | o.removeAll(); | ||
| 6345 | else | ||
| 6346 | o.remove(); | ||
| 6347 | |||
| 6348 | o.destroy(); | ||
| 6349 | }, 'items', t); | ||
| 6350 | |||
| 6351 | t.items = {}; | ||
| 6352 | }, | ||
| 6353 | |||
| 6354 | createMenu : function(o) { | ||
| 6355 | var m = new tinymce.ui.Menu(o.id || DOM.uniqueId(), o); | ||
| 6356 | |||
| 6357 | m.onAddItem.add(this.onAddItem.dispatch, this.onAddItem); | ||
| 6358 | |||
| 6359 | return m; | ||
| 6360 | } | ||
| 6361 | }); | ||
| 6362 | })(tinymce);(function(tinymce) { | ||
| 6363 | var is = tinymce.is, DOM = tinymce.DOM, each = tinymce.each, Event = tinymce.dom.Event, Element = tinymce.dom.Element; | ||
| 6364 | |||
| 6365 | tinymce.create('tinymce.ui.DropMenu:tinymce.ui.Menu', { | ||
| 6366 | DropMenu : function(id, s) { | ||
| 6367 | s = s || {}; | ||
| 6368 | s.container = s.container || DOM.doc.body; | ||
| 6369 | s.offset_x = s.offset_x || 0; | ||
| 6370 | s.offset_y = s.offset_y || 0; | ||
| 6371 | s.vp_offset_x = s.vp_offset_x || 0; | ||
| 6372 | s.vp_offset_y = s.vp_offset_y || 0; | ||
| 6373 | |||
| 6374 | if (is(s.icons) && !s.icons) | ||
| 6375 | s['class'] += ' mceNoIcons'; | ||
| 6376 | |||
| 6377 | this.parent(id, s); | ||
| 6378 | this.onShowMenu = new tinymce.util.Dispatcher(this); | ||
| 6379 | this.onHideMenu = new tinymce.util.Dispatcher(this); | ||
| 6380 | this.classPrefix = 'mceMenu'; | ||
| 6381 | }, | ||
| 6382 | |||
| 6383 | createMenu : function(s) { | ||
| 6384 | var t = this, cs = t.settings, m; | ||
| 6385 | |||
| 6386 | s.container = s.container || cs.container; | ||
| 6387 | s.parent = t; | ||
| 6388 | s.constrain = s.constrain || cs.constrain; | ||
| 6389 | s['class'] = s['class'] || cs['class']; | ||
| 6390 | s.vp_offset_x = s.vp_offset_x || cs.vp_offset_x; | ||
| 6391 | s.vp_offset_y = s.vp_offset_y || cs.vp_offset_y; | ||
| 6392 | m = new tinymce.ui.DropMenu(s.id || DOM.uniqueId(), s); | ||
| 6393 | |||
| 6394 | m.onAddItem.add(t.onAddItem.dispatch, t.onAddItem); | ||
| 6395 | |||
| 6396 | return m; | ||
| 6397 | }, | ||
| 6398 | |||
| 6399 | update : function() { | ||
| 6400 | var t = this, s = t.settings, tb = DOM.get('menu_' + t.id + '_tbl'), co = DOM.get('menu_' + t.id + '_co'), tw, th; | ||
| 6401 | |||
| 6402 | tw = s.max_width ? Math.min(tb.clientWidth, s.max_width) : tb.clientWidth; | ||
| 6403 | th = s.max_height ? Math.min(tb.clientHeight, s.max_height) : tb.clientHeight; | ||
| 6404 | |||
| 6405 | if (!DOM.boxModel) | ||
| 6406 | t.element.setStyles({width : tw + 2, height : th + 2}); | ||
| 6407 | else | ||
| 6408 | t.element.setStyles({width : tw, height : th}); | ||
| 6409 | |||
| 6410 | if (s.max_width) | ||
| 6411 | DOM.setStyle(co, 'width', tw); | ||
| 6412 | |||
| 6413 | if (s.max_height) { | ||
| 6414 | DOM.setStyle(co, 'height', th); | ||
| 6415 | |||
| 6416 | if (tb.clientHeight < s.max_height) | ||
| 6417 | DOM.setStyle(co, 'overflow', 'hidden'); | ||
| 6418 | } | ||
| 6419 | }, | ||
| 6420 | |||
| 6421 | showMenu : function(x, y, px) { | ||
| 6422 | var t = this, s = t.settings, co, vp = DOM.getViewPort(), w, h, mx, my, ot = 2, dm, tb, cp = t.classPrefix; | ||
| 6423 | |||
| 6424 | t.collapse(1); | ||
| 6425 | |||
| 6426 | if (t.isMenuVisible) | ||
| 6427 | return; | ||
| 6428 | |||
| 6429 | if (!t.rendered) { | ||
| 6430 | co = DOM.add(t.settings.container, t.renderNode()); | ||
| 6431 | |||
| 6432 | each(t.items, function(o) { | ||
| 6433 | o.postRender(); | ||
| 6434 | }); | ||
| 6435 | |||
| 6436 | t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); | ||
| 6437 | } else | ||
| 6438 | co = DOM.get('menu_' + t.id); | ||
| 6439 | |||
| 6440 | // Move layer out of sight unless it's Opera since it scrolls to top of page due to an bug | ||
| 6441 | if (!tinymce.isOpera) | ||
| 6442 | DOM.setStyles(co, {left : -0xFFFF , top : -0xFFFF}); | ||
| 6443 | |||
| 6444 | DOM.show(co); | ||
| 6445 | t.update(); | ||
| 6446 | |||
| 6447 | x += s.offset_x || 0; | ||
| 6448 | y += s.offset_y || 0; | ||
| 6449 | vp.w -= 4; | ||
| 6450 | vp.h -= 4; | ||
| 6451 | |||
| 6452 | // Move inside viewport if not submenu | ||
| 6453 | if (s.constrain) { | ||
| 6454 | w = co.clientWidth - ot; | ||
| 6455 | h = co.clientHeight - ot; | ||
| 6456 | mx = vp.x + vp.w; | ||
| 6457 | my = vp.y + vp.h; | ||
| 6458 | |||
| 6459 | if ((x + s.vp_offset_x + w) > mx) | ||
| 6460 | x = px ? px - w : Math.max(0, (mx - s.vp_offset_x) - w); | ||
| 6461 | |||
| 6462 | if ((y + s.vp_offset_y + h) > my) | ||
| 6463 | y = Math.max(0, (my - s.vp_offset_y) - h); | ||
| 6464 | } | ||
| 6465 | |||
| 6466 | DOM.setStyles(co, {left : x , top : y}); | ||
| 6467 | t.element.update(); | ||
| 6468 | |||
| 6469 | t.isMenuVisible = 1; | ||
| 6470 | t.mouseClickFunc = Event.add(co, 'click', function(e) { | ||
| 6471 | var m; | ||
| 6472 | |||
| 6473 | e = e.target; | ||
| 6474 | |||
| 6475 | if (e && (e = DOM.getParent(e, 'tr')) && !DOM.hasClass(e, cp + 'ItemSub')) { | ||
| 6476 | m = t.items[e.id]; | ||
| 6477 | |||
| 6478 | if (m.isDisabled()) | ||
| 6479 | return; | ||
| 6480 | |||
| 6481 | dm = t; | ||
| 6482 | |||
| 6483 | while (dm) { | ||
| 6484 | if (dm.hideMenu) | ||
| 6485 | dm.hideMenu(); | ||
| 6486 | |||
| 6487 | dm = dm.settings.parent; | ||
| 6488 | } | ||
| 6489 | |||
| 6490 | if (m.settings.onclick) | ||
| 6491 | m.settings.onclick(e); | ||
| 6492 | |||
| 6493 | return Event.cancel(e); // Cancel to fix onbeforeunload problem | ||
| 6494 | } | ||
| 6495 | }); | ||
| 6496 | |||
| 6497 | if (t.hasMenus()) { | ||
| 6498 | t.mouseOverFunc = Event.add(co, 'mouseover', function(e) { | ||
| 6499 | var m, r, mi; | ||
| 6500 | |||
| 6501 | e = e.target; | ||
| 6502 | if (e && (e = DOM.getParent(e, 'tr'))) { | ||
| 6503 | m = t.items[e.id]; | ||
| 6504 | |||
| 6505 | if (t.lastMenu) | ||
| 6506 | t.lastMenu.collapse(1); | ||
| 6507 | |||
| 6508 | if (m.isDisabled()) | ||
| 6509 | return; | ||
| 6510 | |||
| 6511 | if (e && DOM.hasClass(e, cp + 'ItemSub')) { | ||
| 6512 | //p = DOM.getPos(s.container); | ||
| 6513 | r = DOM.getRect(e); | ||
| 6514 | m.showMenu((r.x + r.w - ot), r.y - ot, r.x); | ||
| 6515 | t.lastMenu = m; | ||
| 6516 | DOM.addClass(DOM.get(m.id).firstChild, cp + 'ItemActive'); | ||
| 6517 | } | ||
| 6518 | } | ||
| 6519 | }); | ||
| 6520 | } | ||
| 6521 | |||
| 6522 | t.onShowMenu.dispatch(t); | ||
| 6523 | |||
| 6524 | if (s.keyboard_focus) { | ||
| 6525 | Event.add(co, 'keydown', t._keyHandler, t); | ||
| 6526 | DOM.select('a', 'menu_' + t.id)[0].focus(); // Select first link | ||
| 6527 | t._focusIdx = 0; | ||
| 6528 | } | ||
| 6529 | }, | ||
| 6530 | |||
| 6531 | hideMenu : function(c) { | ||
| 6532 | var t = this, co = DOM.get('menu_' + t.id), e; | ||
| 6533 | |||
| 6534 | if (!t.isMenuVisible) | ||
| 6535 | return; | ||
| 6536 | |||
| 6537 | Event.remove(co, 'mouseover', t.mouseOverFunc); | ||
| 6538 | Event.remove(co, 'click', t.mouseClickFunc); | ||
| 6539 | Event.remove(co, 'keydown', t._keyHandler); | ||
| 6540 | DOM.hide(co); | ||
| 6541 | t.isMenuVisible = 0; | ||
| 6542 | |||
| 6543 | if (!c) | ||
| 6544 | t.collapse(1); | ||
| 6545 | |||
| 6546 | if (t.element) | ||
| 6547 | t.element.hide(); | ||
| 6548 | |||
| 6549 | if (e = DOM.get(t.id)) | ||
| 6550 | DOM.removeClass(e.firstChild, t.classPrefix + 'ItemActive'); | ||
| 6551 | |||
| 6552 | t.onHideMenu.dispatch(t); | ||
| 6553 | }, | ||
| 6554 | |||
| 6555 | add : function(o) { | ||
| 6556 | var t = this, co; | ||
| 6557 | |||
| 6558 | o = t.parent(o); | ||
| 6559 | |||
| 6560 | if (t.isRendered && (co = DOM.get('menu_' + t.id))) | ||
| 6561 | t._add(DOM.select('tbody', co)[0], o); | ||
| 6562 | |||
| 6563 | return o; | ||
| 6564 | }, | ||
| 6565 | |||
| 6566 | collapse : function(d) { | ||
| 6567 | this.parent(d); | ||
| 6568 | this.hideMenu(1); | ||
| 6569 | }, | ||
| 6570 | |||
| 6571 | remove : function(o) { | ||
| 6572 | DOM.remove(o.id); | ||
| 6573 | this.destroy(); | ||
| 6574 | |||
| 6575 | return this.parent(o); | ||
| 6576 | }, | ||
| 6577 | |||
| 6578 | destroy : function() { | ||
| 6579 | var t = this, co = DOM.get('menu_' + t.id); | ||
| 6580 | |||
| 6581 | Event.remove(co, 'mouseover', t.mouseOverFunc); | ||
| 6582 | Event.remove(co, 'click', t.mouseClickFunc); | ||
| 6583 | |||
| 6584 | if (t.element) | ||
| 6585 | t.element.remove(); | ||
| 6586 | |||
| 6587 | DOM.remove(co); | ||
| 6588 | }, | ||
| 6589 | |||
| 6590 | renderNode : function() { | ||
| 6591 | var t = this, s = t.settings, n, tb, co, w; | ||
| 6592 | |||
| 6593 | w = DOM.create('div', {id : 'menu_' + t.id, 'class' : s['class'], 'style' : 'position:absolute;left:0;top:0;z-index:200000'}); | ||
| 6594 | co = DOM.add(w, 'div', {id : 'menu_' + t.id + '_co', 'class' : t.classPrefix + (s['class'] ? ' ' + s['class'] : '')}); | ||
| 6595 | t.element = new Element('menu_' + t.id, {blocker : 1, container : s.container}); | ||
| 6596 | |||
| 6597 | if (s.menu_line) | ||
| 6598 | DOM.add(co, 'span', {'class' : t.classPrefix + 'Line'}); | ||
| 6599 | |||
| 6600 | // n = DOM.add(co, 'div', {id : 'menu_' + t.id + '_co', 'class' : 'mceMenuContainer'}); | ||
| 6601 | n = DOM.add(co, 'table', {id : 'menu_' + t.id + '_tbl', border : 0, cellPadding : 0, cellSpacing : 0}); | ||
| 6602 | tb = DOM.add(n, 'tbody'); | ||
| 6603 | |||
| 6604 | each(t.items, function(o) { | ||
| 6605 | t._add(tb, o); | ||
| 6606 | }); | ||
| 6607 | |||
| 6608 | t.rendered = true; | ||
| 6609 | |||
| 6610 | return w; | ||
| 6611 | }, | ||
| 6612 | |||
| 6613 | // Internal functions | ||
| 6614 | |||
| 6615 | _keyHandler : function(e) { | ||
| 6616 | var t = this, kc = e.keyCode; | ||
| 6617 | |||
| 6618 | function focus(d) { | ||
| 6619 | var i = t._focusIdx + d, e = DOM.select('a', 'menu_' + t.id)[i]; | ||
| 6620 | |||
| 6621 | if (e) { | ||
| 6622 | t._focusIdx = i; | ||
| 6623 | e.focus(); | ||
| 6624 | } | ||
| 6625 | }; | ||
| 6626 | |||
| 6627 | switch (kc) { | ||
| 6628 | case 38: | ||
| 6629 | focus(-1); // Select first link | ||
| 6630 | return; | ||
| 6631 | |||
| 6632 | case 40: | ||
| 6633 | focus(1); | ||
| 6634 | return; | ||
| 6635 | |||
| 6636 | case 13: | ||
| 6637 | return; | ||
| 6638 | |||
| 6639 | case 27: | ||
| 6640 | return this.hideMenu(); | ||
| 6641 | } | ||
| 6642 | }, | ||
| 6643 | |||
| 6644 | _add : function(tb, o) { | ||
| 6645 | var n, s = o.settings, a, ro, it, cp = this.classPrefix, ic; | ||
| 6646 | |||
| 6647 | if (s.separator) { | ||
| 6648 | ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'ItemSeparator'}); | ||
| 6649 | DOM.add(ro, 'td', {'class' : cp + 'ItemSeparator'}); | ||
| 6650 | |||
| 6651 | if (n = ro.previousSibling) | ||
| 6652 | DOM.addClass(n, 'mceLast'); | ||
| 6653 | |||
| 6654 | return; | ||
| 6655 | } | ||
| 6656 | |||
| 6657 | n = ro = DOM.add(tb, 'tr', {id : o.id, 'class' : cp + 'Item ' + cp + 'ItemEnabled'}); | ||
| 6658 | n = it = DOM.add(n, 'td'); | ||
| 6659 | n = a = DOM.add(n, 'a', {href : 'javascript:;', onclick : "return false;", onmousedown : 'return false;'}); | ||
| 6660 | |||
| 6661 | DOM.addClass(it, s['class']); | ||
| 6662 | // n = DOM.add(n, 'span', {'class' : 'item'}); | ||
| 6663 | |||
| 6664 | ic = DOM.add(n, 'span', {'class' : 'mceIcon' + (s.icon ? ' mce_' + s.icon : '')}); | ||
| 6665 | |||
| 6666 | if (s.icon_src) | ||
| 6667 | DOM.add(ic, 'img', {src : s.icon_src}); | ||
| 6668 | |||
| 6669 | n = DOM.add(n, s.element || 'span', {'class' : 'mceText', title : o.settings.title}, o.settings.title); | ||
| 6670 | |||
| 6671 | if (o.settings.style) | ||
| 6672 | DOM.setAttrib(n, 'style', o.settings.style); | ||
| 6673 | |||
| 6674 | if (tb.childNodes.length == 1) | ||
| 6675 | DOM.addClass(ro, 'mceFirst'); | ||
| 6676 | |||
| 6677 | if ((n = ro.previousSibling) && DOM.hasClass(n, cp + 'ItemSeparator')) | ||
| 6678 | DOM.addClass(ro, 'mceFirst'); | ||
| 6679 | |||
| 6680 | if (o.collapse) | ||
| 6681 | DOM.addClass(ro, cp + 'ItemSub'); | ||
| 6682 | |||
| 6683 | if (n = ro.previousSibling) | ||
| 6684 | DOM.removeClass(n, 'mceLast'); | ||
| 6685 | |||
| 6686 | DOM.addClass(ro, 'mceLast'); | ||
| 6687 | } | ||
| 6688 | }); | ||
| 6689 | })(tinymce);(function(tinymce) { | ||
| 6690 | var DOM = tinymce.DOM; | ||
| 6691 | |||
| 6692 | tinymce.create('tinymce.ui.Button:tinymce.ui.Control', { | ||
| 6693 | Button : function(id, s) { | ||
| 6694 | this.parent(id, s); | ||
| 6695 | this.classPrefix = 'mceButton'; | ||
| 6696 | }, | ||
| 6697 | |||
| 6698 | renderHTML : function() { | ||
| 6699 | var cp = this.classPrefix, s = this.settings, h, l; | ||
| 6700 | |||
| 6701 | l = DOM.encode(s.label || ''); | ||
| 6702 | h = '<a id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" title="' + DOM.encode(s.title) + '">'; | ||
| 6703 | |||
| 6704 | if (s.image) | ||
| 6705 | h += '<img class="mceIcon" src="' + s.image + '" />' + l + '</a>'; | ||
| 6706 | else | ||
| 6707 | h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '') + '</a>'; | ||
| 6708 | |||
| 6709 | return h; | ||
| 6710 | }, | ||
| 6711 | |||
| 6712 | postRender : function() { | ||
| 6713 | var t = this, s = t.settings; | ||
| 6714 | |||
| 6715 | tinymce.dom.Event.add(t.id, 'click', function(e) { | ||
| 6716 | if (!t.isDisabled()) | ||
| 6717 | return s.onclick.call(s.scope, e); | ||
| 6718 | }); | ||
| 6719 | } | ||
| 6720 | }); | ||
| 6721 | })(tinymce); | ||
| 6722 | (function(tinymce) { | ||
| 6723 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; | ||
| 6724 | |||
| 6725 | tinymce.create('tinymce.ui.ListBox:tinymce.ui.Control', { | ||
| 6726 | ListBox : function(id, s) { | ||
| 6727 | var t = this; | ||
| 6728 | |||
| 6729 | t.parent(id, s); | ||
| 6730 | |||
| 6731 | t.items = []; | ||
| 6732 | |||
| 6733 | t.onChange = new Dispatcher(t); | ||
| 6734 | |||
| 6735 | t.onPostRender = new Dispatcher(t); | ||
| 6736 | |||
| 6737 | t.onAdd = new Dispatcher(t); | ||
| 6738 | |||
| 6739 | t.onRenderMenu = new tinymce.util.Dispatcher(this); | ||
| 6740 | |||
| 6741 | t.classPrefix = 'mceListBox'; | ||
| 6742 | }, | ||
| 6743 | |||
| 6744 | select : function(va) { | ||
| 6745 | var t = this, fv, f; | ||
| 6746 | |||
| 6747 | if (va == undefined) | ||
| 6748 | return t.selectByIndex(-1); | ||
| 6749 | |||
| 6750 | // Is string or number make function selector | ||
| 6751 | if (va && va.call) | ||
| 6752 | f = va; | ||
| 6753 | else { | ||
| 6754 | f = function(v) { | ||
| 6755 | return v == va; | ||
| 6756 | }; | ||
| 6757 | } | ||
| 6758 | |||
| 6759 | // Do we need to do something? | ||
| 6760 | if (va != t.selectedValue) { | ||
| 6761 | // Find item | ||
| 6762 | each(t.items, function(o, i) { | ||
| 6763 | if (f(o.value)) { | ||
| 6764 | fv = 1; | ||
| 6765 | t.selectByIndex(i); | ||
| 6766 | return false; | ||
| 6767 | } | ||
| 6768 | }); | ||
| 6769 | |||
| 6770 | if (!fv) | ||
| 6771 | t.selectByIndex(-1); | ||
| 6772 | } | ||
| 6773 | }, | ||
| 6774 | |||
| 6775 | selectByIndex : function(idx) { | ||
| 6776 | var t = this, e, o; | ||
| 6777 | |||
| 6778 | if (idx != t.selectedIndex) { | ||
| 6779 | e = DOM.get(t.id + '_text'); | ||
| 6780 | o = t.items[idx]; | ||
| 6781 | |||
| 6782 | if (o) { | ||
| 6783 | t.selectedValue = o.value; | ||
| 6784 | t.selectedIndex = idx; | ||
| 6785 | DOM.setHTML(e, DOM.encode(o.title)); | ||
| 6786 | DOM.removeClass(e, 'mceTitle'); | ||
| 6787 | } else { | ||
| 6788 | DOM.setHTML(e, DOM.encode(t.settings.title)); | ||
| 6789 | DOM.addClass(e, 'mceTitle'); | ||
| 6790 | t.selectedValue = t.selectedIndex = null; | ||
| 6791 | } | ||
| 6792 | |||
| 6793 | e = 0; | ||
| 6794 | } | ||
| 6795 | }, | ||
| 6796 | |||
| 6797 | add : function(n, v, o) { | ||
| 6798 | var t = this; | ||
| 6799 | |||
| 6800 | o = o || {}; | ||
| 6801 | o = tinymce.extend(o, { | ||
| 6802 | title : n, | ||
| 6803 | value : v | ||
| 6804 | }); | ||
| 6805 | |||
| 6806 | t.items.push(o); | ||
| 6807 | t.onAdd.dispatch(t, o); | ||
| 6808 | }, | ||
| 6809 | |||
| 6810 | getLength : function() { | ||
| 6811 | return this.items.length; | ||
| 6812 | }, | ||
| 6813 | |||
| 6814 | renderHTML : function() { | ||
| 6815 | var h = '', t = this, s = t.settings, cp = t.classPrefix; | ||
| 6816 | |||
| 6817 | h = '<table id="' + t.id + '" cellpadding="0" cellspacing="0" class="' + cp + ' ' + cp + 'Enabled' + (s['class'] ? (' ' + s['class']) : '') + '"><tbody><tr>'; | ||
| 6818 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_text', href : 'javascript:;', 'class' : 'mceText', onclick : "return false;", onmousedown : 'return false;'}, DOM.encode(t.settings.title)) + '</td>'; | ||
| 6819 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', tabindex : -1, href : 'javascript:;', 'class' : 'mceOpen', onclick : "return false;", onmousedown : 'return false;'}, '<span></span>') + '</td>'; | ||
| 6820 | h += '</tr></tbody></table>'; | ||
| 6821 | |||
| 6822 | return h; | ||
| 6823 | }, | ||
| 6824 | |||
| 6825 | showMenu : function() { | ||
| 6826 | var t = this, p1, p2, e = DOM.get(this.id), m; | ||
| 6827 | |||
| 6828 | if (t.isDisabled() || t.items.length == 0) | ||
| 6829 | return; | ||
| 6830 | |||
| 6831 | if (t.menu && t.menu.isMenuVisible) | ||
| 6832 | return t.hideMenu(); | ||
| 6833 | |||
| 6834 | if (!t.isMenuRendered) { | ||
| 6835 | t.renderMenu(); | ||
| 6836 | t.isMenuRendered = true; | ||
| 6837 | } | ||
| 6838 | |||
| 6839 | p1 = DOM.getPos(this.settings.menu_container); | ||
| 6840 | p2 = DOM.getPos(e); | ||
| 6841 | |||
| 6842 | m = t.menu; | ||
| 6843 | m.settings.offset_x = p2.x; | ||
| 6844 | m.settings.offset_y = p2.y; | ||
| 6845 | m.settings.keyboard_focus = !tinymce.isOpera; // Opera is buggy when it comes to auto focus | ||
| 6846 | |||
| 6847 | // Select in menu | ||
| 6848 | if (t.oldID) | ||
| 6849 | m.items[t.oldID].setSelected(0); | ||
| 6850 | |||
| 6851 | each(t.items, function(o) { | ||
| 6852 | if (o.value === t.selectedValue) { | ||
| 6853 | m.items[o.id].setSelected(1); | ||
| 6854 | t.oldID = o.id; | ||
| 6855 | } | ||
| 6856 | }); | ||
| 6857 | |||
| 6858 | m.showMenu(0, e.clientHeight); | ||
| 6859 | |||
| 6860 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 6861 | DOM.addClass(t.id, t.classPrefix + 'Selected'); | ||
| 6862 | |||
| 6863 | //DOM.get(t.id + '_text').focus(); | ||
| 6864 | }, | ||
| 6865 | |||
| 6866 | hideMenu : function(e) { | ||
| 6867 | var t = this; | ||
| 6868 | |||
| 6869 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 6870 | if (e && e.type == "mousedown" && (e.target.id == t.id + '_text' || e.target.id == t.id + '_open')) | ||
| 6871 | return; | ||
| 6872 | |||
| 6873 | if (!e || !DOM.getParent(e.target, '.mceMenu')) { | ||
| 6874 | DOM.removeClass(t.id, t.classPrefix + 'Selected'); | ||
| 6875 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 6876 | |||
| 6877 | if (t.menu) | ||
| 6878 | t.menu.hideMenu(); | ||
| 6879 | } | ||
| 6880 | }, | ||
| 6881 | |||
| 6882 | renderMenu : function() { | ||
| 6883 | var t = this, m; | ||
| 6884 | |||
| 6885 | m = t.settings.control_manager.createDropMenu(t.id + '_menu', { | ||
| 6886 | menu_line : 1, | ||
| 6887 | 'class' : t.classPrefix + 'Menu mceNoIcons', | ||
| 6888 | max_width : 150, | ||
| 6889 | max_height : 150 | ||
| 6890 | }); | ||
| 6891 | |||
| 6892 | m.onHideMenu.add(t.hideMenu, t); | ||
| 6893 | |||
| 6894 | m.add({ | ||
| 6895 | title : t.settings.title, | ||
| 6896 | 'class' : 'mceMenuItemTitle', | ||
| 6897 | onclick : function() { | ||
| 6898 | if (t.settings.onselect('') !== false) | ||
| 6899 | t.select(''); // Must be runned after | ||
| 6900 | } | ||
| 6901 | }); | ||
| 6902 | |||
| 6903 | each(t.items, function(o) { | ||
| 6904 | o.id = DOM.uniqueId(); | ||
| 6905 | o.onclick = function() { | ||
| 6906 | if (t.settings.onselect(o.value) !== false) | ||
| 6907 | t.select(o.value); // Must be runned after | ||
| 6908 | }; | ||
| 6909 | |||
| 6910 | m.add(o); | ||
| 6911 | }); | ||
| 6912 | |||
| 6913 | t.onRenderMenu.dispatch(t, m); | ||
| 6914 | t.menu = m; | ||
| 6915 | }, | ||
| 6916 | |||
| 6917 | postRender : function() { | ||
| 6918 | var t = this, cp = t.classPrefix; | ||
| 6919 | |||
| 6920 | Event.add(t.id, 'click', t.showMenu, t); | ||
| 6921 | Event.add(t.id + '_text', 'focus', function(e) { | ||
| 6922 | if (!t._focused) { | ||
| 6923 | t.keyDownHandler = Event.add(t.id + '_text', 'keydown', function(e) { | ||
| 6924 | var idx = -1, v, kc = e.keyCode; | ||
| 6925 | |||
| 6926 | // Find current index | ||
| 6927 | each(t.items, function(v, i) { | ||
| 6928 | if (t.selectedValue == v.value) | ||
| 6929 | idx = i; | ||
| 6930 | }); | ||
| 6931 | |||
| 6932 | // Move up/down | ||
| 6933 | if (kc == 38) | ||
| 6934 | v = t.items[idx - 1]; | ||
| 6935 | else if (kc == 40) | ||
| 6936 | v = t.items[idx + 1]; | ||
| 6937 | else if (kc == 13) { | ||
| 6938 | // Fake select on enter | ||
| 6939 | v = t.selectedValue; | ||
| 6940 | t.selectedValue = null; // Needs to be null to fake change | ||
| 6941 | t.settings.onselect(v); | ||
| 6942 | return Event.cancel(e); | ||
| 6943 | } | ||
| 6944 | |||
| 6945 | if (v) { | ||
| 6946 | t.hideMenu(); | ||
| 6947 | t.select(v.value); | ||
| 6948 | } | ||
| 6949 | }); | ||
| 6950 | } | ||
| 6951 | |||
| 6952 | t._focused = 1; | ||
| 6953 | }); | ||
| 6954 | Event.add(t.id + '_text', 'blur', function() {Event.remove(t.id + '_text', 'keydown', t.keyDownHandler); t._focused = 0;}); | ||
| 6955 | |||
| 6956 | // Old IE doesn't have hover on all elements | ||
| 6957 | if (tinymce.isIE6 || !DOM.boxModel) { | ||
| 6958 | Event.add(t.id, 'mouseover', function() { | ||
| 6959 | if (!DOM.hasClass(t.id, cp + 'Disabled')) | ||
| 6960 | DOM.addClass(t.id, cp + 'Hover'); | ||
| 6961 | }); | ||
| 6962 | |||
| 6963 | Event.add(t.id, 'mouseout', function() { | ||
| 6964 | if (!DOM.hasClass(t.id, cp + 'Disabled')) | ||
| 6965 | DOM.removeClass(t.id, cp + 'Hover'); | ||
| 6966 | }); | ||
| 6967 | } | ||
| 6968 | |||
| 6969 | t.onPostRender.dispatch(t, DOM.get(t.id)); | ||
| 6970 | }, | ||
| 6971 | |||
| 6972 | destroy : function() { | ||
| 6973 | this.parent(); | ||
| 6974 | |||
| 6975 | Event.clear(this.id + '_text'); | ||
| 6976 | Event.clear(this.id + '_open'); | ||
| 6977 | } | ||
| 6978 | }); | ||
| 6979 | })(tinymce);(function(tinymce) { | ||
| 6980 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, Dispatcher = tinymce.util.Dispatcher; | ||
| 6981 | |||
| 6982 | tinymce.create('tinymce.ui.NativeListBox:tinymce.ui.ListBox', { | ||
| 6983 | NativeListBox : function(id, s) { | ||
| 6984 | this.parent(id, s); | ||
| 6985 | this.classPrefix = 'mceNativeListBox'; | ||
| 6986 | }, | ||
| 6987 | |||
| 6988 | setDisabled : function(s) { | ||
| 6989 | DOM.get(this.id).disabled = s; | ||
| 6990 | }, | ||
| 6991 | |||
| 6992 | isDisabled : function() { | ||
| 6993 | return DOM.get(this.id).disabled; | ||
| 6994 | }, | ||
| 6995 | |||
| 6996 | select : function(va) { | ||
| 6997 | var t = this, fv, f; | ||
| 6998 | |||
| 6999 | if (va == undefined) | ||
| 7000 | return t.selectByIndex(-1); | ||
| 7001 | |||
| 7002 | // Is string or number make function selector | ||
| 7003 | if (va && va.call) | ||
| 7004 | f = va; | ||
| 7005 | else { | ||
| 7006 | f = function(v) { | ||
| 7007 | return v == va; | ||
| 7008 | }; | ||
| 7009 | } | ||
| 7010 | |||
| 7011 | // Do we need to do something? | ||
| 7012 | if (va != t.selectedValue) { | ||
| 7013 | // Find item | ||
| 7014 | each(t.items, function(o, i) { | ||
| 7015 | if (f(o.value)) { | ||
| 7016 | fv = 1; | ||
| 7017 | t.selectByIndex(i); | ||
| 7018 | return false; | ||
| 7019 | } | ||
| 7020 | }); | ||
| 7021 | |||
| 7022 | if (!fv) | ||
| 7023 | t.selectByIndex(-1); | ||
| 7024 | } | ||
| 7025 | }, | ||
| 7026 | |||
| 7027 | selectByIndex : function(idx) { | ||
| 7028 | DOM.get(this.id).selectedIndex = idx + 1; | ||
| 7029 | this.selectedValue = this.items[idx] ? this.items[idx].value : null; | ||
| 7030 | }, | ||
| 7031 | |||
| 7032 | add : function(n, v, a) { | ||
| 7033 | var o, t = this; | ||
| 7034 | |||
| 7035 | a = a || {}; | ||
| 7036 | a.value = v; | ||
| 7037 | |||
| 7038 | if (t.isRendered()) | ||
| 7039 | DOM.add(DOM.get(this.id), 'option', a, n); | ||
| 7040 | |||
| 7041 | o = { | ||
| 7042 | title : n, | ||
| 7043 | value : v, | ||
| 7044 | attribs : a | ||
| 7045 | }; | ||
| 7046 | |||
| 7047 | t.items.push(o); | ||
| 7048 | t.onAdd.dispatch(t, o); | ||
| 7049 | }, | ||
| 7050 | |||
| 7051 | getLength : function() { | ||
| 7052 | return DOM.get(this.id).options.length - 1; | ||
| 7053 | }, | ||
| 7054 | |||
| 7055 | renderHTML : function() { | ||
| 7056 | var h, t = this; | ||
| 7057 | |||
| 7058 | h = DOM.createHTML('option', {value : ''}, '-- ' + t.settings.title + ' --'); | ||
| 7059 | |||
| 7060 | each(t.items, function(it) { | ||
| 7061 | h += DOM.createHTML('option', {value : it.value}, it.title); | ||
| 7062 | }); | ||
| 7063 | |||
| 7064 | h = DOM.createHTML('select', {id : t.id, 'class' : 'mceNativeListBox'}, h); | ||
| 7065 | |||
| 7066 | return h; | ||
| 7067 | }, | ||
| 7068 | |||
| 7069 | postRender : function() { | ||
| 7070 | var t = this, ch; | ||
| 7071 | |||
| 7072 | t.rendered = true; | ||
| 7073 | |||
| 7074 | function onChange(e) { | ||
| 7075 | var v = t.items[e.target.selectedIndex - 1]; | ||
| 7076 | |||
| 7077 | if (v && (v = v.value)) { | ||
| 7078 | t.onChange.dispatch(t, v); | ||
| 7079 | |||
| 7080 | if (t.settings.onselect) | ||
| 7081 | t.settings.onselect(v); | ||
| 7082 | } | ||
| 7083 | }; | ||
| 7084 | |||
| 7085 | Event.add(t.id, 'change', onChange); | ||
| 7086 | |||
| 7087 | // Accessibility keyhandler | ||
| 7088 | Event.add(t.id, 'keydown', function(e) { | ||
| 7089 | var bf; | ||
| 7090 | |||
| 7091 | Event.remove(t.id, 'change', ch); | ||
| 7092 | |||
| 7093 | bf = Event.add(t.id, 'blur', function() { | ||
| 7094 | Event.add(t.id, 'change', onChange); | ||
| 7095 | Event.remove(t.id, 'blur', bf); | ||
| 7096 | }); | ||
| 7097 | |||
| 7098 | if (e.keyCode == 13 || e.keyCode == 32) { | ||
| 7099 | onChange(e); | ||
| 7100 | return Event.cancel(e); | ||
| 7101 | } | ||
| 7102 | }); | ||
| 7103 | |||
| 7104 | t.onPostRender.dispatch(t, DOM.get(t.id)); | ||
| 7105 | } | ||
| 7106 | }); | ||
| 7107 | })(tinymce);(function(tinymce) { | ||
| 7108 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; | ||
| 7109 | |||
| 7110 | tinymce.create('tinymce.ui.MenuButton:tinymce.ui.Button', { | ||
| 7111 | MenuButton : function(id, s) { | ||
| 7112 | this.parent(id, s); | ||
| 7113 | |||
| 7114 | this.onRenderMenu = new tinymce.util.Dispatcher(this); | ||
| 7115 | |||
| 7116 | s.menu_container = s.menu_container || DOM.doc.body; | ||
| 7117 | }, | ||
| 7118 | |||
| 7119 | showMenu : function() { | ||
| 7120 | var t = this, p1, p2, e = DOM.get(t.id), m; | ||
| 7121 | |||
| 7122 | if (t.isDisabled()) | ||
| 7123 | return; | ||
| 7124 | |||
| 7125 | if (!t.isMenuRendered) { | ||
| 7126 | t.renderMenu(); | ||
| 7127 | t.isMenuRendered = true; | ||
| 7128 | } | ||
| 7129 | |||
| 7130 | if (t.isMenuVisible) | ||
| 7131 | return t.hideMenu(); | ||
| 7132 | |||
| 7133 | p1 = DOM.getPos(t.settings.menu_container); | ||
| 7134 | p2 = DOM.getPos(e); | ||
| 7135 | |||
| 7136 | m = t.menu; | ||
| 7137 | m.settings.offset_x = p2.x; | ||
| 7138 | m.settings.offset_y = p2.y; | ||
| 7139 | m.settings.vp_offset_x = p2.x; | ||
| 7140 | m.settings.vp_offset_y = p2.y; | ||
| 7141 | m.settings.keyboard_focus = t._focused; | ||
| 7142 | m.showMenu(0, e.clientHeight); | ||
| 7143 | |||
| 7144 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 7145 | t.setState('Selected', 1); | ||
| 7146 | |||
| 7147 | t.isMenuVisible = 1; | ||
| 7148 | }, | ||
| 7149 | |||
| 7150 | renderMenu : function() { | ||
| 7151 | var t = this, m; | ||
| 7152 | |||
| 7153 | m = t.settings.control_manager.createDropMenu(t.id + '_menu', { | ||
| 7154 | menu_line : 1, | ||
| 7155 | 'class' : this.classPrefix + 'Menu', | ||
| 7156 | icons : t.settings.icons | ||
| 7157 | }); | ||
| 7158 | |||
| 7159 | m.onHideMenu.add(t.hideMenu, t); | ||
| 7160 | |||
| 7161 | t.onRenderMenu.dispatch(t, m); | ||
| 7162 | t.menu = m; | ||
| 7163 | }, | ||
| 7164 | |||
| 7165 | hideMenu : function(e) { | ||
| 7166 | var t = this; | ||
| 7167 | |||
| 7168 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 7169 | if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id || e.id === t.id + '_open';})) | ||
| 7170 | return; | ||
| 7171 | |||
| 7172 | if (!e || !DOM.getParent(e.target, '.mceMenu')) { | ||
| 7173 | t.setState('Selected', 0); | ||
| 7174 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 7175 | if (t.menu) | ||
| 7176 | t.menu.hideMenu(); | ||
| 7177 | } | ||
| 7178 | |||
| 7179 | t.isMenuVisible = 0; | ||
| 7180 | }, | ||
| 7181 | |||
| 7182 | postRender : function() { | ||
| 7183 | var t = this, s = t.settings; | ||
| 7184 | |||
| 7185 | Event.add(t.id, 'click', function() { | ||
| 7186 | if (!t.isDisabled()) { | ||
| 7187 | if (s.onclick) | ||
| 7188 | s.onclick(t.value); | ||
| 7189 | |||
| 7190 | t.showMenu(); | ||
| 7191 | } | ||
| 7192 | }); | ||
| 7193 | } | ||
| 7194 | }); | ||
| 7195 | })(tinymce); | ||
| 7196 | (function(tinymce) { | ||
| 7197 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each; | ||
| 7198 | |||
| 7199 | tinymce.create('tinymce.ui.SplitButton:tinymce.ui.MenuButton', { | ||
| 7200 | SplitButton : function(id, s) { | ||
| 7201 | this.parent(id, s); | ||
| 7202 | this.classPrefix = 'mceSplitButton'; | ||
| 7203 | }, | ||
| 7204 | |||
| 7205 | renderHTML : function() { | ||
| 7206 | var h, t = this, s = t.settings, h1; | ||
| 7207 | |||
| 7208 | h = '<tbody><tr>'; | ||
| 7209 | |||
| 7210 | if (s.image) | ||
| 7211 | h1 = DOM.createHTML('img ', {src : s.image, 'class' : 'mceAction ' + s['class']}); | ||
| 7212 | else | ||
| 7213 | h1 = DOM.createHTML('span', {'class' : 'mceAction ' + s['class']}, ''); | ||
| 7214 | |||
| 7215 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_action', href : 'javascript:;', 'class' : 'mceAction ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; | ||
| 7216 | |||
| 7217 | h1 = DOM.createHTML('span', {'class' : 'mceOpen ' + s['class']}); | ||
| 7218 | h += '<td>' + DOM.createHTML('a', {id : t.id + '_open', href : 'javascript:;', 'class' : 'mceOpen ' + s['class'], onclick : "return false;", onmousedown : 'return false;', title : s.title}, h1) + '</td>'; | ||
| 7219 | |||
| 7220 | h += '</tr></tbody>'; | ||
| 7221 | |||
| 7222 | return DOM.createHTML('table', {id : t.id, 'class' : 'mceSplitButton mceSplitButtonEnabled ' + s['class'], cellpadding : '0', cellspacing : '0', onmousedown : 'return false;', title : s.title}, h); | ||
| 7223 | }, | ||
| 7224 | |||
| 7225 | postRender : function() { | ||
| 7226 | var t = this, s = t.settings; | ||
| 7227 | |||
| 7228 | if (s.onclick) { | ||
| 7229 | Event.add(t.id + '_action', 'click', function() { | ||
| 7230 | if (!t.isDisabled()) | ||
| 7231 | s.onclick(t.value); | ||
| 7232 | }); | ||
| 7233 | } | ||
| 7234 | |||
| 7235 | Event.add(t.id + '_open', 'click', t.showMenu, t); | ||
| 7236 | Event.add(t.id + '_open', 'focus', function() {t._focused = 1;}); | ||
| 7237 | Event.add(t.id + '_open', 'blur', function() {t._focused = 0;}); | ||
| 7238 | |||
| 7239 | // Old IE doesn't have hover on all elements | ||
| 7240 | if (tinymce.isIE6 || !DOM.boxModel) { | ||
| 7241 | Event.add(t.id, 'mouseover', function() { | ||
| 7242 | if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) | ||
| 7243 | DOM.addClass(t.id, 'mceSplitButtonHover'); | ||
| 7244 | }); | ||
| 7245 | |||
| 7246 | Event.add(t.id, 'mouseout', function() { | ||
| 7247 | if (!DOM.hasClass(t.id, 'mceSplitButtonDisabled')) | ||
| 7248 | DOM.removeClass(t.id, 'mceSplitButtonHover'); | ||
| 7249 | }); | ||
| 7250 | } | ||
| 7251 | }, | ||
| 7252 | |||
| 7253 | destroy : function() { | ||
| 7254 | this.parent(); | ||
| 7255 | |||
| 7256 | Event.clear(this.id + '_action'); | ||
| 7257 | Event.clear(this.id + '_open'); | ||
| 7258 | } | ||
| 7259 | }); | ||
| 7260 | })(tinymce); | ||
| 7261 | (function(tinymce) { | ||
| 7262 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, is = tinymce.is, each = tinymce.each; | ||
| 7263 | |||
| 7264 | tinymce.create('tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton', { | ||
| 7265 | ColorSplitButton : function(id, s) { | ||
| 7266 | var t = this; | ||
| 7267 | |||
| 7268 | t.parent(id, s); | ||
| 7269 | |||
| 7270 | t.settings = s = tinymce.extend({ | ||
| 7271 | colors : '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF', | ||
| 7272 | grid_width : 8, | ||
| 7273 | default_color : '#888888' | ||
| 7274 | }, t.settings); | ||
| 7275 | |||
| 7276 | t.onShowMenu = new tinymce.util.Dispatcher(t); | ||
| 7277 | |||
| 7278 | t.onHideMenu = new tinymce.util.Dispatcher(t); | ||
| 7279 | |||
| 7280 | t.value = s.default_color; | ||
| 7281 | }, | ||
| 7282 | |||
| 7283 | showMenu : function() { | ||
| 7284 | var t = this, r, p, e, p2; | ||
| 7285 | |||
| 7286 | if (t.isDisabled()) | ||
| 7287 | return; | ||
| 7288 | |||
| 7289 | if (!t.isMenuRendered) { | ||
| 7290 | t.renderMenu(); | ||
| 7291 | t.isMenuRendered = true; | ||
| 7292 | } | ||
| 7293 | |||
| 7294 | if (t.isMenuVisible) | ||
| 7295 | return t.hideMenu(); | ||
| 7296 | |||
| 7297 | e = DOM.get(t.id); | ||
| 7298 | DOM.show(t.id + '_menu'); | ||
| 7299 | DOM.addClass(e, 'mceSplitButtonSelected'); | ||
| 7300 | p2 = DOM.getPos(e); | ||
| 7301 | DOM.setStyles(t.id + '_menu', { | ||
| 7302 | left : p2.x, | ||
| 7303 | top : p2.y + e.clientHeight, | ||
| 7304 | zIndex : 200000 | ||
| 7305 | }); | ||
| 7306 | e = 0; | ||
| 7307 | |||
| 7308 | Event.add(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 7309 | t.onShowMenu.dispatch(t); | ||
| 7310 | |||
| 7311 | if (t._focused) { | ||
| 7312 | t._keyHandler = Event.add(t.id + '_menu', 'keydown', function(e) { | ||
| 7313 | if (e.keyCode == 27) | ||
| 7314 | t.hideMenu(); | ||
| 7315 | }); | ||
| 7316 | |||
| 7317 | DOM.select('a', t.id + '_menu')[0].focus(); // Select first link | ||
| 7318 | } | ||
| 7319 | |||
| 7320 | t.isMenuVisible = 1; | ||
| 7321 | }, | ||
| 7322 | |||
| 7323 | hideMenu : function(e) { | ||
| 7324 | var t = this; | ||
| 7325 | |||
| 7326 | // Prevent double toogles by canceling the mouse click event to the button | ||
| 7327 | if (e && e.type == "mousedown" && DOM.getParent(e.target, function(e) {return e.id === t.id + '_open';})) | ||
| 7328 | return; | ||
| 7329 | |||
| 7330 | if (!e || !DOM.getParent(e.target, '.mceSplitButtonMenu')) { | ||
| 7331 | DOM.removeClass(t.id, 'mceSplitButtonSelected'); | ||
| 7332 | Event.remove(DOM.doc, 'mousedown', t.hideMenu, t); | ||
| 7333 | Event.remove(t.id + '_menu', 'keydown', t._keyHandler); | ||
| 7334 | DOM.hide(t.id + '_menu'); | ||
| 7335 | } | ||
| 7336 | |||
| 7337 | t.onHideMenu.dispatch(t); | ||
| 7338 | |||
| 7339 | t.isMenuVisible = 0; | ||
| 7340 | }, | ||
| 7341 | |||
| 7342 | renderMenu : function() { | ||
| 7343 | var t = this, m, i = 0, s = t.settings, n, tb, tr, w; | ||
| 7344 | |||
| 7345 | w = DOM.add(s.menu_container, 'div', {id : t.id + '_menu', 'class' : s['menu_class'] + ' ' + s['class'], style : 'position:absolute;left:0;top:-1000px;'}); | ||
| 7346 | m = DOM.add(w, 'div', {'class' : s['class'] + ' mceSplitButtonMenu'}); | ||
| 7347 | DOM.add(m, 'span', {'class' : 'mceMenuLine'}); | ||
| 7348 | |||
| 7349 | n = DOM.add(m, 'table', {'class' : 'mceColorSplitMenu'}); | ||
| 7350 | tb = DOM.add(n, 'tbody'); | ||
| 7351 | |||
| 7352 | // Generate color grid | ||
| 7353 | i = 0; | ||
| 7354 | each(is(s.colors, 'array') ? s.colors : s.colors.split(','), function(c) { | ||
| 7355 | c = c.replace(/^#/, ''); | ||
| 7356 | |||
| 7357 | if (!i--) { | ||
| 7358 | tr = DOM.add(tb, 'tr'); | ||
| 7359 | i = s.grid_width - 1; | ||
| 7360 | } | ||
| 7361 | |||
| 7362 | n = DOM.add(tr, 'td'); | ||
| 7363 | |||
| 7364 | n = DOM.add(n, 'a', { | ||
| 7365 | href : 'javascript:;', | ||
| 7366 | style : { | ||
| 7367 | backgroundColor : '#' + c | ||
| 7368 | }, | ||
| 7369 | mce_color : '#' + c | ||
| 7370 | }); | ||
| 7371 | }); | ||
| 7372 | |||
| 7373 | if (s.more_colors_func) { | ||
| 7374 | n = DOM.add(tb, 'tr'); | ||
| 7375 | n = DOM.add(n, 'td', {colspan : s.grid_width, 'class' : 'mceMoreColors'}); | ||
| 7376 | n = DOM.add(n, 'a', {id : t.id + '_more', href : 'javascript:;', onclick : 'return false;', 'class' : 'mceMoreColors'}, s.more_colors_title); | ||
| 7377 | |||
| 7378 | Event.add(n, 'click', function(e) { | ||
| 7379 | s.more_colors_func.call(s.more_colors_scope || this); | ||
| 7380 | return Event.cancel(e); // Cancel to fix onbeforeunload problem | ||
| 7381 | }); | ||
| 7382 | } | ||
| 7383 | |||
| 7384 | DOM.addClass(m, 'mceColorSplitMenu'); | ||
| 7385 | |||
| 7386 | Event.add(t.id + '_menu', 'click', function(e) { | ||
| 7387 | var c; | ||
| 7388 | |||
| 7389 | e = e.target; | ||
| 7390 | |||
| 7391 | if (e.nodeName == 'A' && (c = e.getAttribute('mce_color'))) | ||
| 7392 | t.setColor(c); | ||
| 7393 | |||
| 7394 | return Event.cancel(e); // Prevent IE auto save warning | ||
| 7395 | }); | ||
| 7396 | |||
| 7397 | return w; | ||
| 7398 | }, | ||
| 7399 | |||
| 7400 | setColor : function(c) { | ||
| 7401 | var t = this; | ||
| 7402 | |||
| 7403 | DOM.setStyle(t.id + '_preview', 'backgroundColor', c); | ||
| 7404 | |||
| 7405 | t.value = c; | ||
| 7406 | t.hideMenu(); | ||
| 7407 | t.settings.onselect(c); | ||
| 7408 | }, | ||
| 7409 | |||
| 7410 | postRender : function() { | ||
| 7411 | var t = this, id = t.id; | ||
| 7412 | |||
| 7413 | t.parent(); | ||
| 7414 | DOM.add(id + '_action', 'div', {id : id + '_preview', 'class' : 'mceColorPreview'}); | ||
| 7415 | DOM.setStyle(t.id + '_preview', 'backgroundColor', t.value); | ||
| 7416 | }, | ||
| 7417 | |||
| 7418 | destroy : function() { | ||
| 7419 | this.parent(); | ||
| 7420 | |||
| 7421 | Event.clear(this.id + '_menu'); | ||
| 7422 | Event.clear(this.id + '_more'); | ||
| 7423 | DOM.remove(this.id + '_menu'); | ||
| 7424 | } | ||
| 7425 | }); | ||
| 7426 | })(tinymce); | ||
| 7427 | tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { | ||
| 7428 | renderHTML : function() { | ||
| 7429 | var t = this, h = '', c, co, dom = tinymce.DOM, s = t.settings, i, pr, nx, cl; | ||
| 7430 | |||
| 7431 | cl = t.controls; | ||
| 7432 | for (i=0; i<cl.length; i++) { | ||
| 7433 | // Get current control, prev control, next control and if the control is a list box or not | ||
| 7434 | co = cl[i]; | ||
| 7435 | pr = cl[i - 1]; | ||
| 7436 | nx = cl[i + 1]; | ||
| 7437 | |||
| 7438 | // Add toolbar start | ||
| 7439 | if (i === 0) { | ||
| 7440 | c = 'mceToolbarStart'; | ||
| 7441 | |||
| 7442 | if (co.Button) | ||
| 7443 | c += ' mceToolbarStartButton'; | ||
| 7444 | else if (co.SplitButton) | ||
| 7445 | c += ' mceToolbarStartSplitButton'; | ||
| 7446 | else if (co.ListBox) | ||
| 7447 | c += ' mceToolbarStartListBox'; | ||
| 7448 | |||
| 7449 | h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 7450 | } | ||
| 7451 | |||
| 7452 | // Add toolbar end before list box and after the previous button | ||
| 7453 | // This is to fix the o2k7 editor skins | ||
| 7454 | if (pr && co.ListBox) { | ||
| 7455 | if (pr.Button || pr.SplitButton) | ||
| 7456 | h += dom.createHTML('td', {'class' : 'mceToolbarEnd'}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 7457 | } | ||
| 7458 | |||
| 7459 | // Render control HTML | ||
| 7460 | |||
| 7461 | // IE 8 quick fix, needed to propertly generate a hit area for anchors | ||
| 7462 | if (dom.stdMode) | ||
| 7463 | h += '<td style="position: relative">' + co.renderHTML() + '</td>'; | ||
| 7464 | else | ||
| 7465 | h += '<td>' + co.renderHTML() + '</td>'; | ||
| 7466 | |||
| 7467 | // Add toolbar start after list box and before the next button | ||
| 7468 | // This is to fix the o2k7 editor skins | ||
| 7469 | if (nx && co.ListBox) { | ||
| 7470 | if (nx.Button || nx.SplitButton) | ||
| 7471 | h += dom.createHTML('td', {'class' : 'mceToolbarStart'}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 7472 | } | ||
| 7473 | } | ||
| 7474 | |||
| 7475 | c = 'mceToolbarEnd'; | ||
| 7476 | |||
| 7477 | if (co.Button) | ||
| 7478 | c += ' mceToolbarEndButton'; | ||
| 7479 | else if (co.SplitButton) | ||
| 7480 | c += ' mceToolbarEndSplitButton'; | ||
| 7481 | else if (co.ListBox) | ||
| 7482 | c += ' mceToolbarEndListBox'; | ||
| 7483 | |||
| 7484 | h += dom.createHTML('td', {'class' : c}, dom.createHTML('span', null, '<!-- IE -->')); | ||
| 7485 | |||
| 7486 | return dom.createHTML('table', {id : t.id, 'class' : 'mceToolbar' + (s['class'] ? ' ' + s['class'] : ''), cellpadding : '0', cellspacing : '0', align : t.settings.align || ''}, '<tbody><tr>' + h + '</tr></tbody>'); | ||
| 7487 | } | ||
| 7488 | }); | ||
| 7489 | (function(tinymce) { | ||
| 7490 | var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each; | ||
| 7491 | |||
| 7492 | tinymce.create('tinymce.AddOnManager', { | ||
| 7493 | items : [], | ||
| 7494 | urls : {}, | ||
| 7495 | lookup : {}, | ||
| 7496 | |||
| 7497 | onAdd : new Dispatcher(this), | ||
| 7498 | |||
| 7499 | get : function(n) { | ||
| 7500 | return this.lookup[n]; | ||
| 7501 | }, | ||
| 7502 | |||
| 7503 | requireLangPack : function(n) { | ||
| 7504 | var u, s = tinymce.EditorManager.settings; | ||
| 7505 | |||
| 7506 | if (s && s.language) { | ||
| 7507 | u = this.urls[n] + '/langs/' + s.language + '.js'; | ||
| 7508 | |||
| 7509 | if (!tinymce.dom.Event.domLoaded && !s.strict_mode) | ||
| 7510 | tinymce.ScriptLoader.load(u); | ||
| 7511 | else | ||
| 7512 | tinymce.ScriptLoader.add(u); | ||
| 7513 | } | ||
| 7514 | }, | ||
| 7515 | |||
| 7516 | add : function(id, o) { | ||
| 7517 | this.items.push(o); | ||
| 7518 | this.lookup[id] = o; | ||
| 7519 | this.onAdd.dispatch(this, id, o); | ||
| 7520 | |||
| 7521 | return o; | ||
| 7522 | }, | ||
| 7523 | |||
| 7524 | load : function(n, u, cb, s) { | ||
| 7525 | var t = this; | ||
| 7526 | |||
| 7527 | if (t.urls[n]) | ||
| 7528 | return; | ||
| 7529 | |||
| 7530 | if (u.indexOf('/') != 0 && u.indexOf('://') == -1) | ||
| 7531 | u = tinymce.baseURL + '/' + u; | ||
| 7532 | |||
| 7533 | t.urls[n] = u.substring(0, u.lastIndexOf('/')); | ||
| 7534 | tinymce.ScriptLoader.add(u, cb, s); | ||
| 7535 | } | ||
| 7536 | }); | ||
| 7537 | |||
| 7538 | // Create plugin and theme managers | ||
| 7539 | tinymce.PluginManager = new tinymce.AddOnManager(); | ||
| 7540 | tinymce.ThemeManager = new tinymce.AddOnManager(); | ||
| 7541 | }(tinymce)); | ||
| 7542 | |||
| 7543 | (function(tinymce) { | ||
| 7544 | // Shorten names | ||
| 7545 | var each = tinymce.each, extend = tinymce.extend, DOM = tinymce.DOM, Event = tinymce.dom.Event, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, explode = tinymce.explode; | ||
| 7546 | |||
| 7547 | tinymce.create('static tinymce.EditorManager', { | ||
| 7548 | editors : {}, | ||
| 7549 | |||
| 7550 | i18n : {}, | ||
| 7551 | |||
| 7552 | activeEditor : null, | ||
| 7553 | |||
| 7554 | preInit : function() { | ||
| 7555 | var t = this, lo = window.location; | ||
| 7556 | |||
| 7557 | // Setup some URLs where the editor API is located and where the document is | ||
| 7558 | tinymce.documentBaseURL = lo.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); | ||
| 7559 | if (!/[\/\\]$/.test(tinymce.documentBaseURL)) | ||
| 7560 | tinymce.documentBaseURL += '/'; | ||
| 7561 | |||
| 7562 | tinymce.baseURL = new tinymce.util.URI(tinymce.documentBaseURL).toAbsolute(tinymce.baseURL); | ||
| 7563 | tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL); | ||
| 7564 | |||
| 7565 | // Add before unload listener | ||
| 7566 | // This was required since IE was leaking memory if you added and removed beforeunload listeners | ||
| 7567 | // with attachEvent/detatchEvent so this only adds one listener and instances can the attach to the onBeforeUnload event | ||
| 7568 | t.onBeforeUnload = new tinymce.util.Dispatcher(t); | ||
| 7569 | |||
| 7570 | // Must be on window or IE will leak if the editor is placed in frame or iframe | ||
| 7571 | Event.add(window, 'beforeunload', function(e) { | ||
| 7572 | t.onBeforeUnload.dispatch(t, e); | ||
| 7573 | }); | ||
| 7574 | }, | ||
| 7575 | |||
| 7576 | init : function(s) { | ||
| 7577 | var t = this, pl, sl = tinymce.ScriptLoader, c, e, el = [], ed; | ||
| 7578 | |||
| 7579 | function execCallback(se, n, s) { | ||
| 7580 | var f = se[n]; | ||
| 7581 | |||
| 7582 | if (!f) | ||
| 7583 | return; | ||
| 7584 | |||
| 7585 | if (tinymce.is(f, 'string')) { | ||
| 7586 | s = f.replace(/\.\w+$/, ''); | ||
| 7587 | s = s ? tinymce.resolve(s) : 0; | ||
| 7588 | f = tinymce.resolve(f); | ||
| 7589 | } | ||
| 7590 | |||
| 7591 | return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); | ||
| 7592 | }; | ||
| 7593 | |||
| 7594 | s = extend({ | ||
| 7595 | theme : "simple", | ||
| 7596 | language : "en", | ||
| 7597 | strict_loading_mode : document.contentType == 'application/xhtml+xml' | ||
| 7598 | }, s); | ||
| 7599 | |||
| 7600 | t.settings = s; | ||
| 7601 | |||
| 7602 | // If page not loaded and strict mode isn't enabled then load them | ||
| 7603 | if (!Event.domLoaded && !s.strict_loading_mode) { | ||
| 7604 | // Load language | ||
| 7605 | if (s.language) | ||
| 7606 | sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); | ||
| 7607 | |||
| 7608 | // Load theme | ||
| 7609 | if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) | ||
| 7610 | ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); | ||
| 7611 | |||
| 7612 | // Load plugins | ||
| 7613 | if (s.plugins) { | ||
| 7614 | pl = explode(s.plugins); | ||
| 7615 | |||
| 7616 | // Load rest if plugins | ||
| 7617 | each(pl, function(v) { | ||
| 7618 | if (v && v.charAt(0) != '-' && !PluginManager.urls[v]) { | ||
| 7619 | // Skip safari plugin for other browsers | ||
| 7620 | if (!tinymce.isWebKit && v == 'safari') | ||
| 7621 | return; | ||
| 7622 | |||
| 7623 | PluginManager.load(v, 'plugins/' + v + '/editor_plugin' + tinymce.suffix + '.js'); | ||
| 7624 | } | ||
| 7625 | }); | ||
| 7626 | } | ||
| 7627 | |||
| 7628 | sl.loadQueue(); | ||
| 7629 | } | ||
| 7630 | |||
| 7631 | // Legacy call | ||
| 7632 | Event.add(document, 'init', function() { | ||
| 7633 | var l, co; | ||
| 7634 | |||
| 7635 | execCallback(s, 'onpageload'); | ||
| 7636 | |||
| 7637 | // Verify that it's a valid browser | ||
| 7638 | if (s.browsers) { | ||
| 7639 | l = false; | ||
| 7640 | |||
| 7641 | each(explode(s.browsers), function(v) { | ||
| 7642 | switch (v) { | ||
| 7643 | case 'ie': | ||
| 7644 | case 'msie': | ||
| 7645 | if (tinymce.isIE) | ||
| 7646 | l = true; | ||
| 7647 | break; | ||
| 7648 | |||
| 7649 | case 'gecko': | ||
| 7650 | if (tinymce.isGecko) | ||
| 7651 | l = true; | ||
| 7652 | break; | ||
| 7653 | |||
| 7654 | case 'safari': | ||
| 7655 | case 'webkit': | ||
| 7656 | if (tinymce.isWebKit) | ||
| 7657 | l = true; | ||
| 7658 | break; | ||
| 7659 | |||
| 7660 | case 'opera': | ||
| 7661 | if (tinymce.isOpera) | ||
| 7662 | l = true; | ||
| 7663 | |||
| 7664 | break; | ||
| 7665 | } | ||
| 7666 | }); | ||
| 7667 | |||
| 7668 | // Not a valid one | ||
| 7669 | if (!l) | ||
| 7670 | return; | ||
| 7671 | } | ||
| 7672 | |||
| 7673 | switch (s.mode) { | ||
| 7674 | case "exact": | ||
| 7675 | l = s.elements || ''; | ||
| 7676 | |||
| 7677 | if(l.length > 0) { | ||
| 7678 | each(explode(l), function(v) { | ||
| 7679 | if (DOM.get(v)) { | ||
| 7680 | ed = new tinymce.Editor(v, s); | ||
| 7681 | el.push(ed); | ||
| 7682 | ed.render(1); | ||
| 7683 | } else { | ||
| 7684 | c = 0; | ||
| 7685 | |||
| 7686 | each(document.forms, function(f) { | ||
| 7687 | each(f.elements, function(e) { | ||
| 7688 | if (e.name === v) { | ||
| 7689 | v = 'mce_editor_' + c; | ||
| 7690 | DOM.setAttrib(e, 'id', v); | ||
| 7691 | |||
| 7692 | ed = new tinymce.Editor(v, s); | ||
| 7693 | el.push(ed); | ||
| 7694 | ed.render(1); | ||
| 7695 | } | ||
| 7696 | }); | ||
| 7697 | }); | ||
| 7698 | } | ||
| 7699 | }); | ||
| 7700 | } | ||
| 7701 | break; | ||
| 7702 | |||
| 7703 | case "textareas": | ||
| 7704 | case "specific_textareas": | ||
| 7705 | function hasClass(n, c) { | ||
| 7706 | return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); | ||
| 7707 | }; | ||
| 7708 | |||
| 7709 | each(DOM.select('textarea'), function(v) { | ||
| 7710 | if (s.editor_deselector && hasClass(v, s.editor_deselector)) | ||
| 7711 | return; | ||
| 7712 | |||
| 7713 | if (!s.editor_selector || hasClass(v, s.editor_selector)) { | ||
| 7714 | // Can we use the name | ||
| 7715 | e = DOM.get(v.name); | ||
| 7716 | if (!v.id && !e) | ||
| 7717 | v.id = v.name; | ||
| 7718 | |||
| 7719 | // Generate unique name if missing or already exists | ||
| 7720 | if (!v.id || t.get(v.id)) | ||
| 7721 | v.id = DOM.uniqueId(); | ||
| 7722 | |||
| 7723 | ed = new tinymce.Editor(v.id, s); | ||
| 7724 | el.push(ed); | ||
| 7725 | ed.render(1); | ||
| 7726 | } | ||
| 7727 | }); | ||
| 7728 | break; | ||
| 7729 | } | ||
| 7730 | |||
| 7731 | // Call onInit when all editors are initialized | ||
| 7732 | if (s.oninit) { | ||
| 7733 | l = co = 0; | ||
| 7734 | |||
| 7735 | each (el, function(ed) { | ||
| 7736 | co++; | ||
| 7737 | |||
| 7738 | if (!ed.initialized) { | ||
| 7739 | // Wait for it | ||
| 7740 | ed.onInit.add(function() { | ||
| 7741 | l++; | ||
| 7742 | |||
| 7743 | // All done | ||
| 7744 | if (l == co) | ||
| 7745 | execCallback(s, 'oninit'); | ||
| 7746 | }); | ||
| 7747 | } else | ||
| 7748 | l++; | ||
| 7749 | |||
| 7750 | // All done | ||
| 7751 | if (l == co) | ||
| 7752 | execCallback(s, 'oninit'); | ||
| 7753 | }); | ||
| 7754 | } | ||
| 7755 | }); | ||
| 7756 | }, | ||
| 7757 | |||
| 7758 | get : function(id) { | ||
| 7759 | return this.editors[id]; | ||
| 7760 | }, | ||
| 7761 | |||
| 7762 | getInstanceById : function(id) { | ||
| 7763 | return this.get(id); | ||
| 7764 | }, | ||
| 7765 | |||
| 7766 | add : function(e) { | ||
| 7767 | this.editors[e.id] = e; | ||
| 7768 | this._setActive(e); | ||
| 7769 | |||
| 7770 | return e; | ||
| 7771 | }, | ||
| 7772 | |||
| 7773 | remove : function(e) { | ||
| 7774 | var t = this; | ||
| 7775 | |||
| 7776 | // Not in the collection | ||
| 7777 | if (!t.editors[e.id]) | ||
| 7778 | return null; | ||
| 7779 | |||
| 7780 | delete t.editors[e.id]; | ||
| 7781 | |||
| 7782 | // Select another editor since the active one was removed | ||
| 7783 | if (t.activeEditor == e) { | ||
| 7784 | t._setActive(null); | ||
| 7785 | |||
| 7786 | each(t.editors, function(e) { | ||
| 7787 | t._setActive(e); | ||
| 7788 | return false; // Break | ||
| 7789 | }); | ||
| 7790 | } | ||
| 7791 | |||
| 7792 | e.destroy(); | ||
| 7793 | |||
| 7794 | return e; | ||
| 7795 | }, | ||
| 7796 | |||
| 7797 | execCommand : function(c, u, v) { | ||
| 7798 | var t = this, ed = t.get(v), w; | ||
| 7799 | |||
| 7800 | // Manager commands | ||
| 7801 | switch (c) { | ||
| 7802 | case "mceFocus": | ||
| 7803 | ed.focus(); | ||
| 7804 | return true; | ||
| 7805 | |||
| 7806 | case "mceAddEditor": | ||
| 7807 | case "mceAddControl": | ||
| 7808 | if (!t.get(v)) | ||
| 7809 | new tinymce.Editor(v, t.settings).render(); | ||
| 7810 | |||
| 7811 | return true; | ||
| 7812 | |||
| 7813 | case "mceAddFrameControl": | ||
| 7814 | w = v.window; | ||
| 7815 | |||
| 7816 | // Add tinyMCE global instance and tinymce namespace to specified window | ||
| 7817 | w.tinyMCE = tinyMCE; | ||
| 7818 | w.tinymce = tinymce; | ||
| 7819 | |||
| 7820 | tinymce.DOM.doc = w.document; | ||
| 7821 | tinymce.DOM.win = w; | ||
| 7822 | |||
| 7823 | ed = new tinymce.Editor(v.element_id, v); | ||
| 7824 | ed.render(); | ||
| 7825 | |||
| 7826 | // Fix IE memory leaks | ||
| 7827 | if (tinymce.isIE) { | ||
| 7828 | function clr() { | ||
| 7829 | ed.destroy(); | ||
| 7830 | w.detachEvent('onunload', clr); | ||
| 7831 | w = w.tinyMCE = w.tinymce = null; // IE leak | ||
| 7832 | }; | ||
| 7833 | |||
| 7834 | w.attachEvent('onunload', clr); | ||
| 7835 | } | ||
| 7836 | |||
| 7837 | v.page_window = null; | ||
| 7838 | |||
| 7839 | return true; | ||
| 7840 | |||
| 7841 | case "mceRemoveEditor": | ||
| 7842 | case "mceRemoveControl": | ||
| 7843 | if (ed) | ||
| 7844 | ed.remove(); | ||
| 7845 | |||
| 7846 | return true; | ||
| 7847 | |||
| 7848 | case 'mceToggleEditor': | ||
| 7849 | if (!ed) { | ||
| 7850 | t.execCommand('mceAddControl', 0, v); | ||
| 7851 | return true; | ||
| 7852 | } | ||
| 7853 | |||
| 7854 | if (ed.isHidden()) | ||
| 7855 | ed.show(); | ||
| 7856 | else | ||
| 7857 | ed.hide(); | ||
| 7858 | |||
| 7859 | return true; | ||
| 7860 | } | ||
| 7861 | |||
| 7862 | // Run command on active editor | ||
| 7863 | if (t.activeEditor) | ||
| 7864 | return t.activeEditor.execCommand(c, u, v); | ||
| 7865 | |||
| 7866 | return false; | ||
| 7867 | }, | ||
| 7868 | |||
| 7869 | execInstanceCommand : function(id, c, u, v) { | ||
| 7870 | var ed = this.get(id); | ||
| 7871 | |||
| 7872 | if (ed) | ||
| 7873 | return ed.execCommand(c, u, v); | ||
| 7874 | |||
| 7875 | return false; | ||
| 7876 | }, | ||
| 7877 | |||
| 7878 | triggerSave : function() { | ||
| 7879 | each(this.editors, function(e) { | ||
| 7880 | e.save(); | ||
| 7881 | }); | ||
| 7882 | }, | ||
| 7883 | |||
| 7884 | addI18n : function(p, o) { | ||
| 7885 | var lo, i18n = this.i18n; | ||
| 7886 | |||
| 7887 | if (!tinymce.is(p, 'string')) { | ||
| 7888 | each(p, function(o, lc) { | ||
| 7889 | each(o, function(o, g) { | ||
| 7890 | each(o, function(o, k) { | ||
| 7891 | if (g === 'common') | ||
| 7892 | i18n[lc + '.' + k] = o; | ||
| 7893 | else | ||
| 7894 | i18n[lc + '.' + g + '.' + k] = o; | ||
| 7895 | }); | ||
| 7896 | }); | ||
| 7897 | }); | ||
| 7898 | } else { | ||
| 7899 | each(o, function(o, k) { | ||
| 7900 | i18n[p + '.' + k] = o; | ||
| 7901 | }); | ||
| 7902 | } | ||
| 7903 | }, | ||
| 7904 | |||
| 7905 | // Private methods | ||
| 7906 | |||
| 7907 | _setActive : function(e) { | ||
| 7908 | this.selectedInstance = this.activeEditor = e; | ||
| 7909 | } | ||
| 7910 | }); | ||
| 7911 | |||
| 7912 | tinymce.EditorManager.preInit(); | ||
| 7913 | })(tinymce); | ||
| 7914 | |||
| 7915 | var tinyMCE = window.tinyMCE = tinymce.EditorManager; | ||
| 7916 | (function(tinymce) { | ||
| 7917 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, Dispatcher = tinymce.util.Dispatcher; | ||
| 7918 | var each = tinymce.each, isGecko = tinymce.isGecko, isIE = tinymce.isIE, isWebKit = tinymce.isWebKit; | ||
| 7919 | var is = tinymce.is, ThemeManager = tinymce.ThemeManager, PluginManager = tinymce.PluginManager, EditorManager = tinymce.EditorManager; | ||
| 7920 | var inArray = tinymce.inArray, grep = tinymce.grep, explode = tinymce.explode; | ||
| 7921 | |||
| 7922 | tinymce.create('tinymce.Editor', { | ||
| 7923 | Editor : function(id, s) { | ||
| 7924 | var t = this; | ||
| 7925 | |||
| 7926 | t.id = t.editorId = id; | ||
| 7927 | |||
| 7928 | t.execCommands = {}; | ||
| 7929 | t.queryStateCommands = {}; | ||
| 7930 | t.queryValueCommands = {}; | ||
| 7931 | |||
| 7932 | t.isNotDirty = false; | ||
| 7933 | |||
| 7934 | t.plugins = {}; | ||
| 7935 | |||
| 7936 | // Add events to the editor | ||
| 7937 | each([ | ||
| 7938 | 'onPreInit', | ||
| 7939 | |||
| 7940 | 'onBeforeRenderUI', | ||
| 7941 | |||
| 7942 | 'onPostRender', | ||
| 7943 | |||
| 7944 | 'onInit', | ||
| 7945 | |||
| 7946 | 'onRemove', | ||
| 7947 | |||
| 7948 | 'onActivate', | ||
| 7949 | |||
| 7950 | 'onDeactivate', | ||
| 7951 | |||
| 7952 | 'onClick', | ||
| 7953 | |||
| 7954 | 'onEvent', | ||
| 7955 | |||
| 7956 | 'onMouseUp', | ||
| 7957 | |||
| 7958 | 'onMouseDown', | ||
| 7959 | |||
| 7960 | 'onDblClick', | ||
| 7961 | |||
| 7962 | 'onKeyDown', | ||
| 7963 | |||
| 7964 | 'onKeyUp', | ||
| 7965 | |||
| 7966 | 'onKeyPress', | ||
| 7967 | |||
| 7968 | 'onContextMenu', | ||
| 7969 | |||
| 7970 | 'onSubmit', | ||
| 7971 | |||
| 7972 | 'onReset', | ||
| 7973 | |||
| 7974 | 'onPaste', | ||
| 7975 | |||
| 7976 | 'onPreProcess', | ||
| 7977 | |||
| 7978 | 'onPostProcess', | ||
| 7979 | |||
| 7980 | 'onBeforeSetContent', | ||
| 7981 | |||
| 7982 | 'onBeforeGetContent', | ||
| 7983 | |||
| 7984 | 'onSetContent', | ||
| 7985 | |||
| 7986 | 'onGetContent', | ||
| 7987 | |||
| 7988 | 'onLoadContent', | ||
| 7989 | |||
| 7990 | 'onSaveContent', | ||
| 7991 | |||
| 7992 | 'onNodeChange', | ||
| 7993 | |||
| 7994 | 'onChange', | ||
| 7995 | |||
| 7996 | 'onBeforeExecCommand', | ||
| 7997 | |||
| 7998 | 'onExecCommand', | ||
| 7999 | |||
| 8000 | 'onUndo', | ||
| 8001 | |||
| 8002 | 'onRedo', | ||
| 8003 | |||
| 8004 | 'onVisualAid', | ||
| 8005 | |||
| 8006 | 'onSetProgressState' | ||
| 8007 | ], function(e) { | ||
| 8008 | t[e] = new Dispatcher(t); | ||
| 8009 | }); | ||
| 8010 | |||
| 8011 | t.settings = s = extend({ | ||
| 8012 | id : id, | ||
| 8013 | language : 'en', | ||
| 8014 | docs_language : 'en', | ||
| 8015 | theme : 'simple', | ||
| 8016 | skin : 'default', | ||
| 8017 | delta_width : 0, | ||
| 8018 | delta_height : 0, | ||
| 8019 | popup_css : '', | ||
| 8020 | plugins : '', | ||
| 8021 | document_base_url : tinymce.documentBaseURL, | ||
| 8022 | add_form_submit_trigger : 1, | ||
| 8023 | submit_patch : 1, | ||
| 8024 | add_unload_trigger : 1, | ||
| 8025 | convert_urls : 1, | ||
| 8026 | relative_urls : 1, | ||
| 8027 | remove_script_host : 1, | ||
| 8028 | table_inline_editing : 0, | ||
| 8029 | object_resizing : 1, | ||
| 8030 | cleanup : 1, | ||
| 8031 | accessibility_focus : 1, | ||
| 8032 | custom_shortcuts : 1, | ||
| 8033 | custom_undo_redo_keyboard_shortcuts : 1, | ||
| 8034 | custom_undo_redo_restore_selection : 1, | ||
| 8035 | custom_undo_redo : 1, | ||
| 8036 | doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', | ||
| 8037 | visual_table_class : 'mceItemTable', | ||
| 8038 | visual : 1, | ||
| 8039 | inline_styles : true, | ||
| 8040 | convert_fonts_to_spans : true, | ||
| 8041 | font_size_style_values : 'xx-small,x-small,small,medium,large,x-large,xx-large', | ||
| 8042 | apply_source_formatting : 1, | ||
| 8043 | directionality : 'ltr', | ||
| 8044 | forced_root_block : 'p', | ||
| 8045 | valid_elements : '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big', | ||
| 8046 | hidden_input : 1, | ||
| 8047 | padd_empty_editor : 1, | ||
| 8048 | render_ui : 1, | ||
| 8049 | init_theme : 1, | ||
| 8050 | force_p_newlines : 1, | ||
| 8051 | indentation : '30px', | ||
| 8052 | keep_styles : 1, | ||
| 8053 | fix_table_elements : 1, | ||
| 8054 | removeformat_selector : 'span,b,strong,em,i,font,u,strike' | ||
| 8055 | }, s); | ||
| 8056 | |||
| 8057 | t.documentBaseURI = new tinymce.util.URI(s.document_base_url || tinymce.documentBaseURL, { | ||
| 8058 | base_uri : tinyMCE.baseURI | ||
| 8059 | }); | ||
| 8060 | |||
| 8061 | t.baseURI = EditorManager.baseURI; | ||
| 8062 | |||
| 8063 | // Call setup | ||
| 8064 | t.execCallback('setup', t); | ||
| 8065 | }, | ||
| 8066 | |||
| 8067 | render : function(nst) { | ||
| 8068 | var t = this, s = t.settings, id = t.id, sl = tinymce.ScriptLoader; | ||
| 8069 | |||
| 8070 | // Page is not loaded yet, wait for it | ||
| 8071 | if (!Event.domLoaded) { | ||
| 8072 | Event.add(document, 'init', function() { | ||
| 8073 | t.render(); | ||
| 8074 | }); | ||
| 8075 | return; | ||
| 8076 | } | ||
| 8077 | |||
| 8078 | // Force strict loading mode if render us called by user and not internally | ||
| 8079 | if (!nst) { | ||
| 8080 | s.strict_loading_mode = 1; | ||
| 8081 | tinyMCE.settings = s; | ||
| 8082 | } | ||
| 8083 | |||
| 8084 | // Element not found, then skip initialization | ||
| 8085 | if (!t.getElement()) | ||
| 8086 | return; | ||
| 8087 | |||
| 8088 | if (s.strict_loading_mode) { | ||
| 8089 | sl.settings.strict_mode = s.strict_loading_mode; | ||
| 8090 | tinymce.DOM.settings.strict = 1; | ||
| 8091 | } | ||
| 8092 | |||
| 8093 | // Add hidden input for non input elements inside form elements | ||
| 8094 | if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) | ||
| 8095 | DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); | ||
| 8096 | |||
| 8097 | if (tinymce.WindowManager) | ||
| 8098 | t.windowManager = new tinymce.WindowManager(t); | ||
| 8099 | |||
| 8100 | if (s.encoding == 'xml') { | ||
| 8101 | t.onGetContent.add(function(ed, o) { | ||
| 8102 | if (o.save) | ||
| 8103 | o.content = DOM.encode(o.content); | ||
| 8104 | }); | ||
| 8105 | } | ||
| 8106 | |||
| 8107 | if (s.add_form_submit_trigger) { | ||
| 8108 | t.onSubmit.addToTop(function() { | ||
| 8109 | if (t.initialized) { | ||
| 8110 | t.save(); | ||
| 8111 | t.isNotDirty = 1; | ||
| 8112 | } | ||
| 8113 | }); | ||
| 8114 | } | ||
| 8115 | |||
| 8116 | if (s.add_unload_trigger) { | ||
| 8117 | t._beforeUnload = tinyMCE.onBeforeUnload.add(function() { | ||
| 8118 | if (t.initialized && !t.destroyed && !t.isHidden()) | ||
| 8119 | t.save({format : 'raw', no_events : true}); | ||
| 8120 | }); | ||
| 8121 | } | ||
| 8122 | |||
| 8123 | tinymce.addUnload(t.destroy, t); | ||
| 8124 | |||
| 8125 | if (s.submit_patch) { | ||
| 8126 | t.onBeforeRenderUI.add(function() { | ||
| 8127 | var n = t.getElement().form; | ||
| 8128 | |||
| 8129 | if (!n) | ||
| 8130 | return; | ||
| 8131 | |||
| 8132 | // Already patched | ||
| 8133 | if (n._mceOldSubmit) | ||
| 8134 | return; | ||
| 8135 | |||
| 8136 | // Check page uses id="submit" or name="submit" for it's submit button | ||
| 8137 | if (!n.submit.nodeType && !n.submit.length) { | ||
| 8138 | t.formElement = n; | ||
| 8139 | n._mceOldSubmit = n.submit; | ||
| 8140 | n.submit = function() { | ||
| 8141 | // Save all instances | ||
| 8142 | EditorManager.triggerSave(); | ||
| 8143 | t.isNotDirty = 1; | ||
| 8144 | |||
| 8145 | return t.formElement._mceOldSubmit(t.formElement); | ||
| 8146 | }; | ||
| 8147 | } | ||
| 8148 | |||
| 8149 | n = null; | ||
| 8150 | }); | ||
| 8151 | } | ||
| 8152 | |||
| 8153 | // Load scripts | ||
| 8154 | function loadScripts() { | ||
| 8155 | if (s.language) | ||
| 8156 | sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); | ||
| 8157 | |||
| 8158 | if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) | ||
| 8159 | ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); | ||
| 8160 | |||
| 8161 | each(explode(s.plugins), function(p) { | ||
| 8162 | if (p && p.charAt(0) != '-' && !PluginManager.urls[p]) { | ||
| 8163 | // Skip safari plugin for other browsers | ||
| 8164 | if (!isWebKit && p == 'safari') | ||
| 8165 | return; | ||
| 8166 | |||
| 8167 | PluginManager.load(p, 'plugins/' + p + '/editor_plugin' + tinymce.suffix + '.js'); | ||
| 8168 | } | ||
| 8169 | }); | ||
| 8170 | |||
| 8171 | // Init when que is loaded | ||
| 8172 | sl.loadQueue(function() { | ||
| 8173 | if (!t.removed) | ||
| 8174 | t.init(); | ||
| 8175 | }); | ||
| 8176 | }; | ||
| 8177 | |||
| 8178 | loadScripts(); | ||
| 8179 | }, | ||
| 8180 | |||
| 8181 | init : function() { | ||
| 8182 | var n, t = this, s = t.settings, w, h, e = t.getElement(), o, ti, u, bi, bc, re; | ||
| 8183 | |||
| 8184 | EditorManager.add(t); | ||
| 8185 | |||
| 8186 | if (s.theme) { | ||
| 8187 | s.theme = s.theme.replace(/-/, ''); | ||
| 8188 | o = ThemeManager.get(s.theme); | ||
| 8189 | t.theme = new o(); | ||
| 8190 | |||
| 8191 | if (t.theme.init && s.init_theme) | ||
| 8192 | t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); | ||
| 8193 | } | ||
| 8194 | |||
| 8195 | // Create all plugins | ||
| 8196 | each(explode(s.plugins.replace(/\-/g, '')), function(p) { | ||
| 8197 | var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; | ||
| 8198 | |||
| 8199 | if (c) { | ||
| 8200 | po = new c(t, u); | ||
| 8201 | |||
| 8202 | t.plugins[p] = po; | ||
| 8203 | |||
| 8204 | if (po.init) | ||
| 8205 | po.init(t, u); | ||
| 8206 | } | ||
| 8207 | }); | ||
| 8208 | |||
| 8209 | // Setup popup CSS path(s) | ||
| 8210 | if (s.popup_css !== false) { | ||
| 8211 | if (s.popup_css) | ||
| 8212 | s.popup_css = t.documentBaseURI.toAbsolute(s.popup_css); | ||
| 8213 | else | ||
| 8214 | s.popup_css = t.baseURI.toAbsolute("themes/" + s.theme + "/skins/" + s.skin + "/dialog.css"); | ||
| 8215 | } | ||
| 8216 | |||
| 8217 | if (s.popup_css_add) | ||
| 8218 | s.popup_css += ',' + t.documentBaseURI.toAbsolute(s.popup_css_add); | ||
| 8219 | |||
| 8220 | t.controlManager = new tinymce.ControlManager(t); | ||
| 8221 | |||
| 8222 | t.undoManager = new tinymce.UndoManager(t); | ||
| 8223 | |||
| 8224 | // Pass through | ||
| 8225 | t.undoManager.onAdd.add(function(um, l) { | ||
| 8226 | if (!l.initial) | ||
| 8227 | return t.onChange.dispatch(t, l, um); | ||
| 8228 | }); | ||
| 8229 | |||
| 8230 | t.undoManager.onUndo.add(function(um, l) { | ||
| 8231 | return t.onUndo.dispatch(t, l, um); | ||
| 8232 | }); | ||
| 8233 | |||
| 8234 | t.undoManager.onRedo.add(function(um, l) { | ||
| 8235 | return t.onRedo.dispatch(t, l, um); | ||
| 8236 | }); | ||
| 8237 | |||
| 8238 | if (s.custom_undo_redo) { | ||
| 8239 | t.onExecCommand.add(function(ed, cmd, ui, val, a) { | ||
| 8240 | if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint' && (!a || !a.skip_undo)) | ||
| 8241 | t.undoManager.add(); | ||
| 8242 | }); | ||
| 8243 | } | ||
| 8244 | |||
| 8245 | t.onExecCommand.add(function(ed, c) { | ||
| 8246 | // Don't refresh the select lists until caret move | ||
| 8247 | if (!/^(FontName|FontSize)$/.test(c)) | ||
| 8248 | t.nodeChanged(); | ||
| 8249 | }); | ||
| 8250 | |||
| 8251 | // Remove ghost selections on images and tables in Gecko | ||
| 8252 | if (isGecko) { | ||
| 8253 | function repaint(a, o) { | ||
| 8254 | if (!o || !o.initial) | ||
| 8255 | t.execCommand('mceRepaint'); | ||
| 8256 | }; | ||
| 8257 | |||
| 8258 | t.onUndo.add(repaint); | ||
| 8259 | t.onRedo.add(repaint); | ||
| 8260 | t.onSetContent.add(repaint); | ||
| 8261 | } | ||
| 8262 | |||
| 8263 | // Enables users to override the control factory | ||
| 8264 | t.onBeforeRenderUI.dispatch(t, t.controlManager); | ||
| 8265 | |||
| 8266 | // Measure box | ||
| 8267 | if (s.render_ui) { | ||
| 8268 | w = s.width || e.style.width || e.offsetWidth; | ||
| 8269 | h = s.height || e.style.height || e.offsetHeight; | ||
| 8270 | t.orgDisplay = e.style.display; | ||
| 8271 | re = /^[0-9\.]+(|px)$/i; | ||
| 8272 | |||
| 8273 | if (re.test('' + w)) | ||
| 8274 | w = Math.max(parseInt(w) + (o.deltaWidth || 0), 100); | ||
| 8275 | |||
| 8276 | if (re.test('' + h)) | ||
| 8277 | h = Math.max(parseInt(h) + (o.deltaHeight || 0), 100); | ||
| 8278 | |||
| 8279 | // Render UI | ||
| 8280 | o = t.theme.renderUI({ | ||
| 8281 | targetNode : e, | ||
| 8282 | width : w, | ||
| 8283 | height : h, | ||
| 8284 | deltaWidth : s.delta_width, | ||
| 8285 | deltaHeight : s.delta_height | ||
| 8286 | }); | ||
| 8287 | |||
| 8288 | t.editorContainer = o.editorContainer; | ||
| 8289 | } | ||
| 8290 | |||
| 8291 | |||
| 8292 | // User specified a document.domain value | ||
| 8293 | if (document.domain && location.hostname != document.domain) | ||
| 8294 | tinymce.relaxedDomain = document.domain; | ||
| 8295 | |||
| 8296 | // Resize editor | ||
| 8297 | DOM.setStyles(o.sizeContainer || o.editorContainer, { | ||
| 8298 | width : w, | ||
| 8299 | height : h | ||
| 8300 | }); | ||
| 8301 | |||
| 8302 | h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); | ||
| 8303 | if (h < 100) | ||
| 8304 | h = 100; | ||
| 8305 | |||
| 8306 | t.iframeHTML = s.doctype + '<html><head xmlns="http://www.w3.org/1999/xhtml">'; | ||
| 8307 | |||
| 8308 | // We only need to override paths if we have to | ||
| 8309 | // IE has a bug where it remove site absolute urls to relative ones if this is specified | ||
| 8310 | if (s.document_base_url != tinymce.documentBaseURL) | ||
| 8311 | t.iframeHTML += '<base href="' + t.documentBaseURI.getURI() + '" />'; | ||
| 8312 | |||
| 8313 | t.iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; | ||
| 8314 | |||
| 8315 | if (tinymce.relaxedDomain) | ||
| 8316 | t.iframeHTML += '<script type="text/javascript">document.domain = "' + tinymce.relaxedDomain + '";</script>'; | ||
| 8317 | |||
| 8318 | bi = s.body_id || 'tinymce'; | ||
| 8319 | if (bi.indexOf('=') != -1) { | ||
| 8320 | bi = t.getParam('body_id', '', 'hash'); | ||
| 8321 | bi = bi[t.id] || bi; | ||
| 8322 | } | ||
| 8323 | |||
| 8324 | bc = s.body_class || ''; | ||
| 8325 | if (bc.indexOf('=') != -1) { | ||
| 8326 | bc = t.getParam('body_class', '', 'hash'); | ||
| 8327 | bc = bc[t.id] || ''; | ||
| 8328 | } | ||
| 8329 | |||
| 8330 | t.iframeHTML += '</head><body id="' + bi + '" class="mceContentBody ' + bc + '"></body></html>'; | ||
| 8331 | |||
| 8332 | // Domain relaxing enabled, then set document domain | ||
| 8333 | if (tinymce.relaxedDomain) { | ||
| 8334 | // We need to write the contents here in IE since multiple writes messes up refresh button and back button | ||
| 8335 | if (isIE || (tinymce.isOpera && parseFloat(opera.version()) >= 9.5)) | ||
| 8336 | u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";var ed = window.parent.tinyMCE.get("' + t.id + '");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'; | ||
| 8337 | else if (tinymce.isOpera) | ||
| 8338 | u = 'javascript:(function(){document.open();document.domain="' + document.domain + '";document.close();ed.setupIframe();})()'; | ||
| 8339 | } | ||
| 8340 | |||
| 8341 | // Create iframe | ||
| 8342 | n = DOM.add(o.iframeContainer, 'iframe', { | ||
| 8343 | id : t.id + "_ifr", | ||
| 8344 | src : u || 'javascript:""', // Workaround for HTTPS warning in IE6/7 | ||
| 8345 | frameBorder : '0', | ||
| 8346 | style : { | ||
| 8347 | width : '100%', | ||
| 8348 | height : h | ||
| 8349 | } | ||
| 8350 | }); | ||
| 8351 | |||
| 8352 | t.contentAreaContainer = o.iframeContainer; | ||
| 8353 | DOM.get(o.editorContainer).style.display = t.orgDisplay; | ||
| 8354 | DOM.get(t.id).style.display = 'none'; | ||
| 8355 | |||
| 8356 | if (!isIE || !tinymce.relaxedDomain) | ||
| 8357 | t.setupIframe(); | ||
| 8358 | |||
| 8359 | e = n = o = null; // Cleanup | ||
| 8360 | }, | ||
| 8361 | |||
| 8362 | setupIframe : function() { | ||
| 8363 | var t = this, s = t.settings, e = DOM.get(t.id), d = t.getDoc(), h, b; | ||
| 8364 | |||
| 8365 | // Setup iframe body | ||
| 8366 | if (!isIE || !tinymce.relaxedDomain) { | ||
| 8367 | d.open(); | ||
| 8368 | d.write(t.iframeHTML); | ||
| 8369 | d.close(); | ||
| 8370 | } | ||
| 8371 | |||
| 8372 | // Design mode needs to be added here Ctrl+A will fail otherwise | ||
| 8373 | if (!isIE) { | ||
| 8374 | try { | ||
| 8375 | if (!s.readonly) | ||
| 8376 | d.designMode = 'On'; | ||
| 8377 | } catch (ex) { | ||
| 8378 | // Will fail on Gecko if the editor is placed in an hidden container element | ||
| 8379 | // The design mode will be set ones the editor is focused | ||
| 8380 | } | ||
| 8381 | } | ||
| 8382 | |||
| 8383 | // IE needs to use contentEditable or it will display non secure items for HTTPS | ||
| 8384 | if (isIE) { | ||
| 8385 | // It will not steal focus if we hide it while setting contentEditable | ||
| 8386 | b = t.getBody(); | ||
| 8387 | DOM.hide(b); | ||
| 8388 | |||
| 8389 | if (!s.readonly) | ||
| 8390 | b.contentEditable = true; | ||
| 8391 | |||
| 8392 | DOM.show(b); | ||
| 8393 | } | ||
| 8394 | |||
| 8395 | t.dom = new tinymce.dom.DOMUtils(t.getDoc(), { | ||
| 8396 | keep_values : true, | ||
| 8397 | url_converter : t.convertURL, | ||
| 8398 | url_converter_scope : t, | ||
| 8399 | hex_colors : s.force_hex_style_colors, | ||
| 8400 | class_filter : s.class_filter, | ||
| 8401 | update_styles : 1, | ||
| 8402 | fix_ie_paragraphs : 1 | ||
| 8403 | }); | ||
| 8404 | |||
| 8405 | t.serializer = new tinymce.dom.Serializer(extend(s, { | ||
| 8406 | valid_elements : s.verify_html === false ? '*[*]' : s.valid_elements, | ||
| 8407 | dom : t.dom | ||
| 8408 | })); | ||
| 8409 | |||
| 8410 | t.selection = new tinymce.dom.Selection(t.dom, t.getWin(), t.serializer); | ||
| 8411 | |||
| 8412 | t.forceBlocks = new tinymce.ForceBlocks(t, { | ||
| 8413 | forced_root_block : s.forced_root_block | ||
| 8414 | }); | ||
| 8415 | t.editorCommands = new tinymce.EditorCommands(t); | ||
| 8416 | |||
| 8417 | // Pass through | ||
| 8418 | t.serializer.onPreProcess.add(function(se, o) { | ||
| 8419 | return t.onPreProcess.dispatch(t, o, se); | ||
| 8420 | }); | ||
| 8421 | |||
| 8422 | t.serializer.onPostProcess.add(function(se, o) { | ||
| 8423 | return t.onPostProcess.dispatch(t, o, se); | ||
| 8424 | }); | ||
| 8425 | |||
| 8426 | t.onPreInit.dispatch(t); | ||
| 8427 | |||
| 8428 | if (!s.gecko_spellcheck) | ||
| 8429 | t.getBody().spellcheck = 0; | ||
| 8430 | |||
| 8431 | if (!s.readonly) | ||
| 8432 | t._addEvents(); | ||
| 8433 | |||
| 8434 | t.controlManager.onPostRender.dispatch(t, t.controlManager); | ||
| 8435 | t.onPostRender.dispatch(t); | ||
| 8436 | |||
| 8437 | if (s.directionality) | ||
| 8438 | t.getBody().dir = s.directionality; | ||
| 8439 | |||
| 8440 | if (s.nowrap) | ||
| 8441 | t.getBody().style.whiteSpace = "nowrap"; | ||
| 8442 | |||
| 8443 | if (s.custom_elements) { | ||
| 8444 | function handleCustom(ed, o) { | ||
| 8445 | each(explode(s.custom_elements), function(v) { | ||
| 8446 | var n; | ||
| 8447 | |||
| 8448 | if (v.indexOf('~') === 0) { | ||
| 8449 | v = v.substring(1); | ||
| 8450 | n = 'span'; | ||
| 8451 | } else | ||
| 8452 | n = 'div'; | ||
| 8453 | |||
| 8454 | o.content = o.content.replace(new RegExp('<(' + v + ')([^>]*)>', 'g'), '<' + n + ' mce_name="$1"$2>'); | ||
| 8455 | o.content = o.content.replace(new RegExp('</(' + v + ')>', 'g'), '</' + n + '>'); | ||
| 8456 | }); | ||
| 8457 | }; | ||
| 8458 | |||
| 8459 | t.onBeforeSetContent.add(handleCustom); | ||
| 8460 | t.onPostProcess.add(function(ed, o) { | ||
| 8461 | if (o.set) | ||
| 8462 | handleCustom(ed, o); | ||
| 8463 | }); | ||
| 8464 | } | ||
| 8465 | |||
| 8466 | if (s.handle_node_change_callback) { | ||
| 8467 | t.onNodeChange.add(function(ed, cm, n) { | ||
| 8468 | t.execCallback('handle_node_change_callback', t.id, n, -1, -1, true, t.selection.isCollapsed()); | ||
| 8469 | }); | ||
| 8470 | } | ||
| 8471 | |||
| 8472 | if (s.save_callback) { | ||
| 8473 | t.onSaveContent.add(function(ed, o) { | ||
| 8474 | var h = t.execCallback('save_callback', t.id, o.content, t.getBody()); | ||
| 8475 | |||
| 8476 | if (h) | ||
| 8477 | o.content = h; | ||
| 8478 | }); | ||
| 8479 | } | ||
| 8480 | |||
| 8481 | if (s.onchange_callback) { | ||
| 8482 | t.onChange.add(function(ed, l) { | ||
| 8483 | t.execCallback('onchange_callback', t, l); | ||
| 8484 | }); | ||
| 8485 | } | ||
| 8486 | |||
| 8487 | if (s.convert_newlines_to_brs) { | ||
| 8488 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 8489 | if (o.initial) | ||
| 8490 | o.content = o.content.replace(/\r?\n/g, '<br />'); | ||
| 8491 | }); | ||
| 8492 | } | ||
| 8493 | |||
| 8494 | if (s.fix_nesting && isIE) { | ||
| 8495 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 8496 | o.content = t._fixNesting(o.content); | ||
| 8497 | }); | ||
| 8498 | } | ||
| 8499 | |||
| 8500 | if (s.preformatted) { | ||
| 8501 | t.onPostProcess.add(function(ed, o) { | ||
| 8502 | o.content = o.content.replace(/^\s*<pre.*?>/, ''); | ||
| 8503 | o.content = o.content.replace(/<\/pre>\s*$/, ''); | ||
| 8504 | |||
| 8505 | if (o.set) | ||
| 8506 | o.content = '<pre class="mceItemHidden">' + o.content + '</pre>'; | ||
| 8507 | }); | ||
| 8508 | } | ||
| 8509 | |||
| 8510 | if (s.verify_css_classes) { | ||
| 8511 | t.serializer.attribValueFilter = function(n, v) { | ||
| 8512 | var s, cl; | ||
| 8513 | |||
| 8514 | if (n == 'class') { | ||
| 8515 | // Build regexp for classes | ||
| 8516 | if (!t.classesRE) { | ||
| 8517 | cl = t.dom.getClasses(); | ||
| 8518 | |||
| 8519 | if (cl.length > 0) { | ||
| 8520 | s = ''; | ||
| 8521 | |||
| 8522 | each (cl, function(o) { | ||
| 8523 | s += (s ? '|' : '') + o['class']; | ||
| 8524 | }); | ||
| 8525 | |||
| 8526 | t.classesRE = new RegExp('(' + s + ')', 'gi'); | ||
| 8527 | } | ||
| 8528 | } | ||
| 8529 | |||
| 8530 | return !t.classesRE || /(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(v) || t.classesRE.test(v) ? v : ''; | ||
| 8531 | } | ||
| 8532 | |||
| 8533 | return v; | ||
| 8534 | }; | ||
| 8535 | } | ||
| 8536 | |||
| 8537 | if (s.convert_fonts_to_spans) | ||
| 8538 | t._convertFonts(); | ||
| 8539 | |||
| 8540 | if (s.inline_styles) | ||
| 8541 | t._convertInlineElements(); | ||
| 8542 | |||
| 8543 | if (s.cleanup_callback) { | ||
| 8544 | t.onBeforeSetContent.add(function(ed, o) { | ||
| 8545 | o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); | ||
| 8546 | }); | ||
| 8547 | |||
| 8548 | t.onPreProcess.add(function(ed, o) { | ||
| 8549 | if (o.set) | ||
| 8550 | t.execCallback('cleanup_callback', 'insert_to_editor_dom', o.node, o); | ||
| 8551 | |||
| 8552 | if (o.get) | ||
| 8553 | t.execCallback('cleanup_callback', 'get_from_editor_dom', o.node, o); | ||
| 8554 | }); | ||
| 8555 | |||
| 8556 | t.onPostProcess.add(function(ed, o) { | ||
| 8557 | if (o.set) | ||
| 8558 | o.content = t.execCallback('cleanup_callback', 'insert_to_editor', o.content, o); | ||
| 8559 | |||
| 8560 | if (o.get) | ||
| 8561 | o.content = t.execCallback('cleanup_callback', 'get_from_editor', o.content, o); | ||
| 8562 | }); | ||
| 8563 | } | ||
| 8564 | |||
| 8565 | if (s.save_callback) { | ||
| 8566 | t.onGetContent.add(function(ed, o) { | ||
| 8567 | if (o.save) | ||
| 8568 | o.content = t.execCallback('save_callback', t.id, o.content, t.getBody()); | ||
| 8569 | }); | ||
| 8570 | } | ||
| 8571 | |||
| 8572 | if (s.handle_event_callback) { | ||
| 8573 | t.onEvent.add(function(ed, e, o) { | ||
| 8574 | if (t.execCallback('handle_event_callback', e, ed, o) === false) | ||
| 8575 | Event.cancel(e); | ||
| 8576 | }); | ||
| 8577 | } | ||
| 8578 | |||
| 8579 | // Add visual aids when new contents is added | ||
| 8580 | t.onSetContent.add(function() { | ||
| 8581 | t.addVisual(t.getBody()); | ||
| 8582 | }); | ||
| 8583 | |||
| 8584 | // Remove empty contents | ||
| 8585 | if (s.padd_empty_editor) { | ||
| 8586 | t.onPostProcess.add(function(ed, o) { | ||
| 8587 | o.content = o.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/, ''); | ||
| 8588 | }); | ||
| 8589 | } | ||
| 8590 | |||
| 8591 | if (isGecko) { | ||
| 8592 | // Fix gecko link bug, when a link is placed at the end of block elements there is | ||
| 8593 | // no way to move the caret behind the link. This fix adds a bogus br element after the link | ||
| 8594 | function fixLinks(ed, o) { | ||
| 8595 | each(ed.dom.select('a'), function(n) { | ||
| 8596 | var pn = n.parentNode; | ||
| 8597 | |||
| 8598 | if (ed.dom.isBlock(pn) && pn.lastChild === n) | ||
| 8599 | ed.dom.add(pn, 'br', {'mce_bogus' : 1}); | ||
| 8600 | }); | ||
| 8601 | }; | ||
| 8602 | |||
| 8603 | t.onExecCommand.add(function(ed, cmd) { | ||
| 8604 | if (cmd === 'CreateLink') | ||
| 8605 | fixLinks(ed); | ||
| 8606 | }); | ||
| 8607 | |||
| 8608 | t.onSetContent.add(t.selection.onSetContent.add(fixLinks)); | ||
| 8609 | |||
| 8610 | if (!s.readonly) { | ||
| 8611 | try { | ||
| 8612 | // Design mode must be set here once again to fix a bug where | ||
| 8613 | // Ctrl+A/Delete/Backspace didn't work if the editor was added using mceAddControl then removed then added again | ||
| 8614 | d.designMode = 'Off'; | ||
| 8615 | d.designMode = 'On'; | ||
| 8616 | } catch (ex) { | ||
| 8617 | // Will fail on Gecko if the editor is placed in an hidden container element | ||
| 8618 | // The design mode will be set ones the editor is focused | ||
| 8619 | } | ||
| 8620 | } | ||
| 8621 | } | ||
| 8622 | |||
| 8623 | // A small timeout was needed since firefox will remove. Bug: #1838304 | ||
| 8624 | setTimeout(function () { | ||
| 8625 | if (t.removed) | ||
| 8626 | return; | ||
| 8627 | |||
| 8628 | t.load({initial : true, format : (s.cleanup_on_startup ? 'html' : 'raw')}); | ||
| 8629 | t.startContent = t.getContent({format : 'raw'}); | ||
| 8630 | t.undoManager.add({initial : true}); | ||
| 8631 | t.initialized = true; | ||
| 8632 | |||
| 8633 | t.onInit.dispatch(t); | ||
| 8634 | t.execCallback('setupcontent_callback', t.id, t.getBody(), t.getDoc()); | ||
| 8635 | t.execCallback('init_instance_callback', t); | ||
| 8636 | t.focus(true); | ||
| 8637 | t.nodeChanged({initial : 1}); | ||
| 8638 | |||
| 8639 | // Load specified content CSS last | ||
| 8640 | if (s.content_css) { | ||
| 8641 | tinymce.each(explode(s.content_css), function(u) { | ||
| 8642 | t.dom.loadCSS(t.documentBaseURI.toAbsolute(u)); | ||
| 8643 | }); | ||
| 8644 | } | ||
| 8645 | |||
| 8646 | // Handle auto focus | ||
| 8647 | if (s.auto_focus) { | ||
| 8648 | setTimeout(function () { | ||
| 8649 | var ed = EditorManager.get(s.auto_focus); | ||
| 8650 | |||
| 8651 | ed.selection.select(ed.getBody(), 1); | ||
| 8652 | ed.selection.collapse(1); | ||
| 8653 | ed.getWin().focus(); | ||
| 8654 | }, 100); | ||
| 8655 | } | ||
| 8656 | }, 1); | ||
| 8657 | |||
| 8658 | e = null; | ||
| 8659 | }, | ||
| 8660 | |||
| 8661 | |||
| 8662 | focus : function(sf) { | ||
| 8663 | var oed, t = this, ce = t.settings.content_editable; | ||
| 8664 | |||
| 8665 | if (!sf) { | ||
| 8666 | // Is not content editable or the selection is outside the area in IE | ||
| 8667 | // the IE statement is needed to avoid bluring if element selections inside layers since | ||
| 8668 | // the layer is like it's own document in IE | ||
| 8669 | if (!ce && (!isIE || t.selection.getNode().ownerDocument != t.getDoc())) | ||
| 8670 | t.getWin().focus(); | ||
| 8671 | |||
| 8672 | } | ||
| 8673 | |||
| 8674 | if (EditorManager.activeEditor != t) { | ||
| 8675 | if ((oed = EditorManager.activeEditor) != null) | ||
| 8676 | oed.onDeactivate.dispatch(oed, t); | ||
| 8677 | |||
| 8678 | t.onActivate.dispatch(t, oed); | ||
| 8679 | } | ||
| 8680 | |||
| 8681 | EditorManager._setActive(t); | ||
| 8682 | }, | ||
| 8683 | |||
| 8684 | execCallback : function(n) { | ||
| 8685 | var t = this, f = t.settings[n], s; | ||
| 8686 | |||
| 8687 | if (!f) | ||
| 8688 | return; | ||
| 8689 | |||
| 8690 | // Look through lookup | ||
| 8691 | if (t.callbackLookup && (s = t.callbackLookup[n])) { | ||
| 8692 | f = s.func; | ||
| 8693 | s = s.scope; | ||
| 8694 | } | ||
| 8695 | |||
| 8696 | if (is(f, 'string')) { | ||
| 8697 | s = f.replace(/\.\w+$/, ''); | ||
| 8698 | s = s ? tinymce.resolve(s) : 0; | ||
| 8699 | f = tinymce.resolve(f); | ||
| 8700 | t.callbackLookup = t.callbackLookup || {}; | ||
| 8701 | t.callbackLookup[n] = {func : f, scope : s}; | ||
| 8702 | } | ||
| 8703 | |||
| 8704 | return f.apply(s || t, Array.prototype.slice.call(arguments, 1)); | ||
| 8705 | }, | ||
| 8706 | |||
| 8707 | translate : function(s) { | ||
| 8708 | var c = this.settings.language || 'en', i18n = EditorManager.i18n; | ||
| 8709 | |||
| 8710 | if (!s) | ||
| 8711 | return ''; | ||
| 8712 | |||
| 8713 | return i18n[c + '.' + s] || s.replace(/{\#([^}]+)\}/g, function(a, b) { | ||
| 8714 | return i18n[c + '.' + b] || '{#' + b + '}'; | ||
| 8715 | }); | ||
| 8716 | }, | ||
| 8717 | |||
| 8718 | getLang : function(n, dv) { | ||
| 8719 | return EditorManager.i18n[(this.settings.language || 'en') + '.' + n] || (is(dv) ? dv : '{#' + n + '}'); | ||
| 8720 | }, | ||
| 8721 | |||
| 8722 | getParam : function(n, dv, ty) { | ||
| 8723 | var tr = tinymce.trim, v = is(this.settings[n]) ? this.settings[n] : dv, o; | ||
| 8724 | |||
| 8725 | if (ty === 'hash') { | ||
| 8726 | o = {}; | ||
| 8727 | |||
| 8728 | if (is(v, 'string')) { | ||
| 8729 | each(v.indexOf('=') > 0 ? v.split(/[;,](?![^=;,]*(?:[;,]|$))/) : v.split(','), function(v) { | ||
| 8730 | v = v.split('='); | ||
| 8731 | |||
| 8732 | if (v.length > 1) | ||
| 8733 | o[tr(v[0])] = tr(v[1]); | ||
| 8734 | else | ||
| 8735 | o[tr(v[0])] = tr(v); | ||
| 8736 | }); | ||
| 8737 | } else | ||
| 8738 | o = v; | ||
| 8739 | |||
| 8740 | return o; | ||
| 8741 | } | ||
| 8742 | |||
| 8743 | return v; | ||
| 8744 | }, | ||
| 8745 | |||
| 8746 | nodeChanged : function(o) { | ||
| 8747 | var t = this, s = t.selection, n = s.getNode() || t.getBody(); | ||
| 8748 | |||
| 8749 | // Fix for bug #1896577 it seems that this can not be fired while the editor is loading | ||
| 8750 | if (t.initialized) { | ||
| 8751 | t.onNodeChange.dispatch( | ||
| 8752 | t, | ||
| 8753 | o ? o.controlManager || t.controlManager : t.controlManager, | ||
| 8754 | isIE && n.ownerDocument != t.getDoc() ? t.getBody() : n, // Fix for IE initial state | ||
| 8755 | s.isCollapsed(), | ||
| 8756 | o | ||
| 8757 | ); | ||
| 8758 | } | ||
| 8759 | }, | ||
| 8760 | |||
| 8761 | addButton : function(n, s) { | ||
| 8762 | var t = this; | ||
| 8763 | |||
| 8764 | t.buttons = t.buttons || {}; | ||
| 8765 | t.buttons[n] = s; | ||
| 8766 | }, | ||
| 8767 | |||
| 8768 | addCommand : function(n, f, s) { | ||
| 8769 | this.execCommands[n] = {func : f, scope : s || this}; | ||
| 8770 | }, | ||
| 8771 | |||
| 8772 | addQueryStateHandler : function(n, f, s) { | ||
| 8773 | this.queryStateCommands[n] = {func : f, scope : s || this}; | ||
| 8774 | }, | ||
| 8775 | |||
| 8776 | addQueryValueHandler : function(n, f, s) { | ||
| 8777 | this.queryValueCommands[n] = {func : f, scope : s || this}; | ||
| 8778 | }, | ||
| 8779 | |||
| 8780 | addShortcut : function(pa, desc, cmd_func, sc) { | ||
| 8781 | var t = this, c; | ||
| 8782 | |||
| 8783 | if (!t.settings.custom_shortcuts) | ||
| 8784 | return false; | ||
| 8785 | |||
| 8786 | t.shortcuts = t.shortcuts || {}; | ||
| 8787 | |||
| 8788 | if (is(cmd_func, 'string')) { | ||
| 8789 | c = cmd_func; | ||
| 8790 | |||
| 8791 | cmd_func = function() { | ||
| 8792 | t.execCommand(c, false, null); | ||
| 8793 | }; | ||
| 8794 | } | ||
| 8795 | |||
| 8796 | if (is(cmd_func, 'object')) { | ||
| 8797 | c = cmd_func; | ||
| 8798 | |||
| 8799 | cmd_func = function() { | ||
| 8800 | t.execCommand(c[0], c[1], c[2]); | ||
| 8801 | }; | ||
| 8802 | } | ||
| 8803 | |||
| 8804 | each(explode(pa), function(pa) { | ||
| 8805 | var o = { | ||
| 8806 | func : cmd_func, | ||
| 8807 | scope : sc || this, | ||
| 8808 | desc : desc, | ||
| 8809 | alt : false, | ||
| 8810 | ctrl : false, | ||
| 8811 | shift : false | ||
| 8812 | }; | ||
| 8813 | |||
| 8814 | each(explode(pa, '+'), function(v) { | ||
| 8815 | switch (v) { | ||
| 8816 | case 'alt': | ||
| 8817 | case 'ctrl': | ||
| 8818 | case 'shift': | ||
| 8819 | o[v] = true; | ||
| 8820 | break; | ||
| 8821 | |||
| 8822 | default: | ||
| 8823 | o.charCode = v.charCodeAt(0); | ||
| 8824 | o.keyCode = v.toUpperCase().charCodeAt(0); | ||
| 8825 | } | ||
| 8826 | }); | ||
| 8827 | |||
| 8828 | t.shortcuts[(o.ctrl ? 'ctrl' : '') + ',' + (o.alt ? 'alt' : '') + ',' + (o.shift ? 'shift' : '') + ',' + o.keyCode] = o; | ||
| 8829 | }); | ||
| 8830 | |||
| 8831 | return true; | ||
| 8832 | }, | ||
| 8833 | |||
| 8834 | execCommand : function(cmd, ui, val, a) { | ||
| 8835 | var t = this, s = 0, o, st; | ||
| 8836 | |||
| 8837 | if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(cmd) && (!a || !a.skip_focus)) | ||
| 8838 | t.focus(); | ||
| 8839 | |||
| 8840 | o = {}; | ||
| 8841 | t.onBeforeExecCommand.dispatch(t, cmd, ui, val, o); | ||
| 8842 | if (o.terminate) | ||
| 8843 | return false; | ||
| 8844 | |||
| 8845 | // Command callback | ||
| 8846 | if (t.execCallback('execcommand_callback', t.id, t.selection.getNode(), cmd, ui, val)) { | ||
| 8847 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8848 | return true; | ||
| 8849 | } | ||
| 8850 | |||
| 8851 | // Registred commands | ||
| 8852 | if (o = t.execCommands[cmd]) { | ||
| 8853 | st = o.func.call(o.scope, ui, val); | ||
| 8854 | |||
| 8855 | // Fall through on true | ||
| 8856 | if (st !== true) { | ||
| 8857 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8858 | return st; | ||
| 8859 | } | ||
| 8860 | } | ||
| 8861 | |||
| 8862 | // Plugin commands | ||
| 8863 | each(t.plugins, function(p) { | ||
| 8864 | if (p.execCommand && p.execCommand(cmd, ui, val)) { | ||
| 8865 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8866 | s = 1; | ||
| 8867 | return false; | ||
| 8868 | } | ||
| 8869 | }); | ||
| 8870 | |||
| 8871 | if (s) | ||
| 8872 | return true; | ||
| 8873 | |||
| 8874 | // Theme commands | ||
| 8875 | if (t.theme && t.theme.execCommand && t.theme.execCommand(cmd, ui, val)) { | ||
| 8876 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8877 | return true; | ||
| 8878 | } | ||
| 8879 | |||
| 8880 | // Execute global commands | ||
| 8881 | if (tinymce.GlobalCommands.execCommand(t, cmd, ui, val)) { | ||
| 8882 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8883 | return true; | ||
| 8884 | } | ||
| 8885 | |||
| 8886 | // Editor commands | ||
| 8887 | if (t.editorCommands.execCommand(cmd, ui, val)) { | ||
| 8888 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8889 | return true; | ||
| 8890 | } | ||
| 8891 | |||
| 8892 | // Browser commands | ||
| 8893 | t.getDoc().execCommand(cmd, ui, val); | ||
| 8894 | t.onExecCommand.dispatch(t, cmd, ui, val, a); | ||
| 8895 | }, | ||
| 8896 | |||
| 8897 | queryCommandState : function(c) { | ||
| 8898 | var t = this, o, s; | ||
| 8899 | |||
| 8900 | // Is hidden then return undefined | ||
| 8901 | if (t._isHidden()) | ||
| 8902 | return; | ||
| 8903 | |||
| 8904 | // Registred commands | ||
| 8905 | if (o = t.queryStateCommands[c]) { | ||
| 8906 | s = o.func.call(o.scope); | ||
| 8907 | |||
| 8908 | // Fall though on true | ||
| 8909 | if (s !== true) | ||
| 8910 | return s; | ||
| 8911 | } | ||
| 8912 | |||
| 8913 | // Registred commands | ||
| 8914 | o = t.editorCommands.queryCommandState(c); | ||
| 8915 | if (o !== -1) | ||
| 8916 | return o; | ||
| 8917 | |||
| 8918 | // Browser commands | ||
| 8919 | try { | ||
| 8920 | return this.getDoc().queryCommandState(c); | ||
| 8921 | } catch (ex) { | ||
| 8922 | // Fails sometimes see bug: 1896577 | ||
| 8923 | } | ||
| 8924 | }, | ||
| 8925 | |||
| 8926 | queryCommandValue : function(c) { | ||
| 8927 | var t = this, o, s; | ||
| 8928 | |||
| 8929 | // Is hidden then return undefined | ||
| 8930 | if (t._isHidden()) | ||
| 8931 | return; | ||
| 8932 | |||
| 8933 | // Registred commands | ||
| 8934 | if (o = t.queryValueCommands[c]) { | ||
| 8935 | s = o.func.call(o.scope); | ||
| 8936 | |||
| 8937 | // Fall though on true | ||
| 8938 | if (s !== true) | ||
| 8939 | return s; | ||
| 8940 | } | ||
| 8941 | |||
| 8942 | // Registred commands | ||
| 8943 | o = t.editorCommands.queryCommandValue(c); | ||
| 8944 | if (is(o)) | ||
| 8945 | return o; | ||
| 8946 | |||
| 8947 | // Browser commands | ||
| 8948 | try { | ||
| 8949 | return this.getDoc().queryCommandValue(c); | ||
| 8950 | } catch (ex) { | ||
| 8951 | // Fails sometimes see bug: 1896577 | ||
| 8952 | } | ||
| 8953 | }, | ||
| 8954 | |||
| 8955 | show : function() { | ||
| 8956 | var t = this; | ||
| 8957 | |||
| 8958 | DOM.show(t.getContainer()); | ||
| 8959 | DOM.hide(t.id); | ||
| 8960 | t.load(); | ||
| 8961 | }, | ||
| 8962 | |||
| 8963 | hide : function() { | ||
| 8964 | var t = this, d = t.getDoc(); | ||
| 8965 | |||
| 8966 | // Fixed bug where IE has a blinking cursor left from the editor | ||
| 8967 | if (isIE && d) | ||
| 8968 | d.execCommand('SelectAll'); | ||
| 8969 | |||
| 8970 | // We must save before we hide so Safari doesn't crash | ||
| 8971 | t.save(); | ||
| 8972 | DOM.hide(t.getContainer()); | ||
| 8973 | DOM.setStyle(t.id, 'display', t.orgDisplay); | ||
| 8974 | }, | ||
| 8975 | |||
| 8976 | isHidden : function() { | ||
| 8977 | return !DOM.isHidden(this.id); | ||
| 8978 | }, | ||
| 8979 | |||
| 8980 | setProgressState : function(b, ti, o) { | ||
| 8981 | this.onSetProgressState.dispatch(this, b, ti, o); | ||
| 8982 | |||
| 8983 | return b; | ||
| 8984 | }, | ||
| 8985 | |||
| 8986 | load : function(o) { | ||
| 8987 | var t = this, e = t.getElement(), h; | ||
| 8988 | |||
| 8989 | if (e) { | ||
| 8990 | o = o || {}; | ||
| 8991 | o.load = true; | ||
| 8992 | |||
| 8993 | // Double encode existing entities in the value | ||
| 8994 | h = t.setContent(is(e.value) ? e.value : e.innerHTML, o); | ||
| 8995 | o.element = e; | ||
| 8996 | |||
| 8997 | if (!o.no_events) | ||
| 8998 | t.onLoadContent.dispatch(t, o); | ||
| 8999 | |||
| 9000 | o.element = e = null; | ||
| 9001 | |||
| 9002 | return h; | ||
| 9003 | } | ||
| 9004 | }, | ||
| 9005 | |||
| 9006 | save : function(o) { | ||
| 9007 | var t = this, e = t.getElement(), h, f; | ||
| 9008 | |||
| 9009 | if (!e || !t.initialized) | ||
| 9010 | return; | ||
| 9011 | |||
| 9012 | o = o || {}; | ||
| 9013 | o.save = true; | ||
| 9014 | |||
| 9015 | // Add undo level will trigger onchange event | ||
| 9016 | if (!o.no_events) { | ||
| 9017 | t.undoManager.typing = 0; | ||
| 9018 | t.undoManager.add(); | ||
| 9019 | } | ||
| 9020 | |||
| 9021 | o.element = e; | ||
| 9022 | h = o.content = t.getContent(o); | ||
| 9023 | |||
| 9024 | if (!o.no_events) | ||
| 9025 | t.onSaveContent.dispatch(t, o); | ||
| 9026 | |||
| 9027 | h = o.content; | ||
| 9028 | |||
| 9029 | if (!/TEXTAREA|INPUT/i.test(e.nodeName)) { | ||
| 9030 | e.innerHTML = h; | ||
| 9031 | |||
| 9032 | // Update hidden form element | ||
| 9033 | if (f = DOM.getParent(t.id, 'form')) { | ||
| 9034 | each(f.elements, function(e) { | ||
| 9035 | if (e.name == t.id) { | ||
| 9036 | e.value = h; | ||
| 9037 | return false; | ||
| 9038 | } | ||
| 9039 | }); | ||
| 9040 | } | ||
| 9041 | } else | ||
| 9042 | e.value = h; | ||
| 9043 | |||
| 9044 | o.element = e = null; | ||
| 9045 | |||
| 9046 | return h; | ||
| 9047 | }, | ||
| 9048 | |||
| 9049 | setContent : function(h, o) { | ||
| 9050 | var t = this; | ||
| 9051 | |||
| 9052 | o = o || {}; | ||
| 9053 | o.format = o.format || 'html'; | ||
| 9054 | o.set = true; | ||
| 9055 | o.content = h; | ||
| 9056 | |||
| 9057 | if (!o.no_events) | ||
| 9058 | t.onBeforeSetContent.dispatch(t, o); | ||
| 9059 | |||
| 9060 | // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content | ||
| 9061 | // It will also be impossible to place the caret in the editor unless there is a BR element present | ||
| 9062 | if (!tinymce.isIE && (h.length === 0 || /^\s+$/.test(h))) { | ||
| 9063 | o.content = t.dom.setHTML(t.getBody(), '<br mce_bogus="1" />'); | ||
| 9064 | o.format = 'raw'; | ||
| 9065 | } | ||
| 9066 | |||
| 9067 | o.content = t.dom.setHTML(t.getBody(), tinymce.trim(o.content)); | ||
| 9068 | |||
| 9069 | if (o.format != 'raw' && t.settings.cleanup) { | ||
| 9070 | o.getInner = true; | ||
| 9071 | o.content = t.dom.setHTML(t.getBody(), t.serializer.serialize(t.getBody(), o)); | ||
| 9072 | } | ||
| 9073 | |||
| 9074 | if (!o.no_events) | ||
| 9075 | t.onSetContent.dispatch(t, o); | ||
| 9076 | |||
| 9077 | return o.content; | ||
| 9078 | }, | ||
| 9079 | |||
| 9080 | getContent : function(o) { | ||
| 9081 | var t = this, h; | ||
| 9082 | |||
| 9083 | o = o || {}; | ||
| 9084 | o.format = o.format || 'html'; | ||
| 9085 | o.get = true; | ||
| 9086 | |||
| 9087 | if (!o.no_events) | ||
| 9088 | t.onBeforeGetContent.dispatch(t, o); | ||
| 9089 | |||
| 9090 | if (o.format != 'raw' && t.settings.cleanup) { | ||
| 9091 | o.getInner = true; | ||
| 9092 | h = t.serializer.serialize(t.getBody(), o); | ||
| 9093 | } else | ||
| 9094 | h = t.getBody().innerHTML; | ||
| 9095 | |||
| 9096 | h = h.replace(/^\s*|\s*$/g, ''); | ||
| 9097 | o.content = h; | ||
| 9098 | |||
| 9099 | if (!o.no_events) | ||
| 9100 | t.onGetContent.dispatch(t, o); | ||
| 9101 | |||
| 9102 | return o.content; | ||
| 9103 | }, | ||
| 9104 | |||
| 9105 | isDirty : function() { | ||
| 9106 | var t = this; | ||
| 9107 | |||
| 9108 | return tinymce.trim(t.startContent) != tinymce.trim(t.getContent({format : 'raw', no_events : 1})) && !t.isNotDirty; | ||
| 9109 | }, | ||
| 9110 | |||
| 9111 | getContainer : function() { | ||
| 9112 | var t = this; | ||
| 9113 | |||
| 9114 | if (!t.container) | ||
| 9115 | t.container = DOM.get(t.editorContainer || t.id + '_parent'); | ||
| 9116 | |||
| 9117 | return t.container; | ||
| 9118 | }, | ||
| 9119 | |||
| 9120 | getContentAreaContainer : function() { | ||
| 9121 | return this.contentAreaContainer; | ||
| 9122 | }, | ||
| 9123 | |||
| 9124 | getElement : function() { | ||
| 9125 | return DOM.get(this.settings.content_element || this.id); | ||
| 9126 | }, | ||
| 9127 | |||
| 9128 | getWin : function() { | ||
| 9129 | var t = this, e; | ||
| 9130 | |||
| 9131 | if (!t.contentWindow) { | ||
| 9132 | e = DOM.get(t.id + "_ifr"); | ||
| 9133 | |||
| 9134 | if (e) | ||
| 9135 | t.contentWindow = e.contentWindow; | ||
| 9136 | } | ||
| 9137 | |||
| 9138 | return t.contentWindow; | ||
| 9139 | }, | ||
| 9140 | |||
| 9141 | getDoc : function() { | ||
| 9142 | var t = this, w; | ||
| 9143 | |||
| 9144 | if (!t.contentDocument) { | ||
| 9145 | w = t.getWin(); | ||
| 9146 | |||
| 9147 | if (w) | ||
| 9148 | t.contentDocument = w.document; | ||
| 9149 | } | ||
| 9150 | |||
| 9151 | return t.contentDocument; | ||
| 9152 | }, | ||
| 9153 | |||
| 9154 | getBody : function() { | ||
| 9155 | return this.bodyElement || this.getDoc().body; | ||
| 9156 | }, | ||
| 9157 | |||
| 9158 | convertURL : function(u, n, e) { | ||
| 9159 | var t = this, s = t.settings; | ||
| 9160 | |||
| 9161 | // Use callback instead | ||
| 9162 | if (s.urlconverter_callback) | ||
| 9163 | return t.execCallback('urlconverter_callback', u, e, true, n); | ||
| 9164 | |||
| 9165 | // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs | ||
| 9166 | if (!s.convert_urls || (e && e.nodeName == 'LINK') || u.indexOf('file:') === 0) | ||
| 9167 | return u; | ||
| 9168 | |||
| 9169 | // Convert to relative | ||
| 9170 | if (s.relative_urls) | ||
| 9171 | return t.documentBaseURI.toRelative(u); | ||
| 9172 | |||
| 9173 | // Convert to absolute | ||
| 9174 | u = t.documentBaseURI.toAbsolute(u, s.remove_script_host); | ||
| 9175 | |||
| 9176 | return u; | ||
| 9177 | }, | ||
| 9178 | |||
| 9179 | addVisual : function(e) { | ||
| 9180 | var t = this, s = t.settings; | ||
| 9181 | |||
| 9182 | e = e || t.getBody(); | ||
| 9183 | |||
| 9184 | if (!is(t.hasVisual)) | ||
| 9185 | t.hasVisual = s.visual; | ||
| 9186 | |||
| 9187 | each(t.dom.select('table,a', e), function(e) { | ||
| 9188 | var v; | ||
| 9189 | |||
| 9190 | switch (e.nodeName) { | ||
| 9191 | case 'TABLE': | ||
| 9192 | v = t.dom.getAttrib(e, 'border'); | ||
| 9193 | |||
| 9194 | if (!v || v == '0') { | ||
| 9195 | if (t.hasVisual) | ||
| 9196 | t.dom.addClass(e, s.visual_table_class); | ||
| 9197 | else | ||
| 9198 | t.dom.removeClass(e, s.visual_table_class); | ||
| 9199 | } | ||
| 9200 | |||
| 9201 | return; | ||
| 9202 | |||
| 9203 | case 'A': | ||
| 9204 | v = t.dom.getAttrib(e, 'name'); | ||
| 9205 | |||
| 9206 | if (v) { | ||
| 9207 | if (t.hasVisual) | ||
| 9208 | t.dom.addClass(e, 'mceItemAnchor'); | ||
| 9209 | else | ||
| 9210 | t.dom.removeClass(e, 'mceItemAnchor'); | ||
| 9211 | } | ||
| 9212 | |||
| 9213 | return; | ||
| 9214 | } | ||
| 9215 | }); | ||
| 9216 | |||
| 9217 | t.onVisualAid.dispatch(t, e, t.hasVisual); | ||
| 9218 | }, | ||
| 9219 | |||
| 9220 | remove : function() { | ||
| 9221 | var t = this, e = t.getContainer(); | ||
| 9222 | |||
| 9223 | t.removed = 1; // Cancels post remove event execution | ||
| 9224 | t.hide(); | ||
| 9225 | |||
| 9226 | t.execCallback('remove_instance_callback', t); | ||
| 9227 | t.onRemove.dispatch(t); | ||
| 9228 | |||
| 9229 | // Clear all execCommand listeners this is required to avoid errors if the editor was removed inside another command | ||
| 9230 | t.onExecCommand.listeners = []; | ||
| 9231 | |||
| 9232 | EditorManager.remove(t); | ||
| 9233 | DOM.remove(e); | ||
| 9234 | }, | ||
| 9235 | |||
| 9236 | destroy : function(s) { | ||
| 9237 | var t = this; | ||
| 9238 | |||
| 9239 | // One time is enough | ||
| 9240 | if (t.destroyed) | ||
| 9241 | return; | ||
| 9242 | |||
| 9243 | if (!s) { | ||
| 9244 | tinymce.removeUnload(t.destroy); | ||
| 9245 | tinyMCE.onBeforeUnload.remove(t._beforeUnload); | ||
| 9246 | |||
| 9247 | // Manual destroy | ||
| 9248 | if (t.theme && t.theme.destroy) | ||
| 9249 | t.theme.destroy(); | ||
| 9250 | |||
| 9251 | // Destroy controls, selection and dom | ||
| 9252 | t.controlManager.destroy(); | ||
| 9253 | t.selection.destroy(); | ||
| 9254 | t.dom.destroy(); | ||
| 9255 | |||
| 9256 | // Remove all events | ||
| 9257 | |||
| 9258 | // Don't clear the window or document if content editable | ||
| 9259 | // is enabled since other instances might still be present | ||
| 9260 | if (!t.settings.content_editable) { | ||
| 9261 | Event.clear(t.getWin()); | ||
| 9262 | Event.clear(t.getDoc()); | ||
| 9263 | } | ||
| 9264 | |||
| 9265 | Event.clear(t.getBody()); | ||
| 9266 | Event.clear(t.formElement); | ||
| 9267 | } | ||
| 9268 | |||
| 9269 | if (t.formElement) { | ||
| 9270 | t.formElement.submit = t.formElement._mceOldSubmit; | ||
| 9271 | t.formElement._mceOldSubmit = null; | ||
| 9272 | } | ||
| 9273 | |||
| 9274 | t.contentAreaContainer = t.formElement = t.container = t.settings.content_element = t.bodyElement = t.contentDocument = t.contentWindow = null; | ||
| 9275 | |||
| 9276 | if (t.selection) | ||
| 9277 | t.selection = t.selection.win = t.selection.dom = t.selection.dom.doc = null; | ||
| 9278 | |||
| 9279 | t.destroyed = 1; | ||
| 9280 | }, | ||
| 9281 | |||
| 9282 | // Internal functions | ||
| 9283 | |||
| 9284 | _addEvents : function() { | ||
| 9285 | // 'focus', 'blur', 'dblclick', 'beforedeactivate', submit, reset | ||
| 9286 | var t = this, i, s = t.settings, lo = { | ||
| 9287 | mouseup : 'onMouseUp', | ||
| 9288 | mousedown : 'onMouseDown', | ||
| 9289 | click : 'onClick', | ||
| 9290 | keyup : 'onKeyUp', | ||
| 9291 | keydown : 'onKeyDown', | ||
| 9292 | keypress : 'onKeyPress', | ||
| 9293 | submit : 'onSubmit', | ||
| 9294 | reset : 'onReset', | ||
| 9295 | contextmenu : 'onContextMenu', | ||
| 9296 | dblclick : 'onDblClick', | ||
| 9297 | paste : 'onPaste' // Doesn't work in all browsers yet | ||
| 9298 | }; | ||
| 9299 | |||
| 9300 | function eventHandler(e, o) { | ||
| 9301 | var ty = e.type; | ||
| 9302 | |||
| 9303 | // Don't fire events when it's removed | ||
| 9304 | if (t.removed) | ||
| 9305 | return; | ||
| 9306 | |||
| 9307 | // Generic event handler | ||
| 9308 | if (t.onEvent.dispatch(t, e, o) !== false) { | ||
| 9309 | // Specific event handler | ||
| 9310 | t[lo[e.fakeType || e.type]].dispatch(t, e, o); | ||
| 9311 | } | ||
| 9312 | }; | ||
| 9313 | |||
| 9314 | // Add DOM events | ||
| 9315 | each(lo, function(v, k) { | ||
| 9316 | switch (k) { | ||
| 9317 | case 'contextmenu': | ||
| 9318 | if (tinymce.isOpera) { | ||
| 9319 | // Fake contextmenu on Opera | ||
| 9320 | t.dom.bind(t.getBody(), 'mousedown', function(e) { | ||
| 9321 | if (e.ctrlKey) { | ||
| 9322 | e.fakeType = 'contextmenu'; | ||
| 9323 | eventHandler(e); | ||
| 9324 | } | ||
| 9325 | }); | ||
| 9326 | } else | ||
| 9327 | t.dom.bind(t.getBody(), k, eventHandler); | ||
| 9328 | break; | ||
| 9329 | |||
| 9330 | case 'paste': | ||
| 9331 | t.dom.bind(t.getBody(), k, function(e) { | ||
| 9332 | eventHandler(e); | ||
| 9333 | }); | ||
| 9334 | break; | ||
| 9335 | |||
| 9336 | case 'submit': | ||
| 9337 | case 'reset': | ||
| 9338 | t.dom.bind(t.getElement().form || DOM.getParent(t.id, 'form'), k, eventHandler); | ||
| 9339 | break; | ||
| 9340 | |||
| 9341 | default: | ||
| 9342 | t.dom.bind(s.content_editable ? t.getBody() : t.getDoc(), k, eventHandler); | ||
| 9343 | } | ||
| 9344 | }); | ||
| 9345 | |||
| 9346 | t.dom.bind(s.content_editable ? t.getBody() : (isGecko ? t.getDoc() : t.getWin()), 'focus', function(e) { | ||
| 9347 | t.focus(true); | ||
| 9348 | }); | ||
| 9349 | |||
| 9350 | |||
| 9351 | // Fixes bug where a specified document_base_uri could result in broken images | ||
| 9352 | // This will also fix drag drop of images in Gecko | ||
| 9353 | if (tinymce.isGecko) { | ||
| 9354 | // Convert all images to absolute URLs | ||
| 9355 | /* t.onSetContent.add(function(ed, o) { | ||
| 9356 | each(ed.dom.select('img'), function(e) { | ||
| 9357 | var v; | ||
| 9358 | |||
| 9359 | if (v = e.getAttribute('mce_src')) | ||
| 9360 | e.src = t.documentBaseURI.toAbsolute(v); | ||
| 9361 | }) | ||
| 9362 | });*/ | ||
| 9363 | |||
| 9364 | t.dom.bind(t.getDoc(), 'DOMNodeInserted', function(e) { | ||
| 9365 | var v; | ||
| 9366 | |||
| 9367 | e = e.target; | ||
| 9368 | |||
| 9369 | if (e.nodeType === 1 && e.nodeName === 'IMG' && (v = e.getAttribute('mce_src'))) | ||
| 9370 | e.src = t.documentBaseURI.toAbsolute(v); | ||
| 9371 | }); | ||
| 9372 | } | ||
| 9373 | |||
| 9374 | // Set various midas options in Gecko | ||
| 9375 | if (isGecko) { | ||
| 9376 | function setOpts() { | ||
| 9377 | var t = this, d = t.getDoc(), s = t.settings; | ||
| 9378 | |||
| 9379 | if (isGecko && !s.readonly) { | ||
| 9380 | if (t._isHidden()) { | ||
| 9381 | try { | ||
| 9382 | if (!s.content_editable) | ||
| 9383 | d.designMode = 'On'; | ||
| 9384 | } catch (ex) { | ||
| 9385 | // Fails if it's hidden | ||
| 9386 | } | ||
| 9387 | } | ||
| 9388 | |||
| 9389 | try { | ||
| 9390 | // Try new Gecko method | ||
| 9391 | d.execCommand("styleWithCSS", 0, false); | ||
| 9392 | } catch (ex) { | ||
| 9393 | // Use old method | ||
| 9394 | if (!t._isHidden()) | ||
| 9395 | try {d.execCommand("useCSS", 0, true);} catch (ex) {} | ||
| 9396 | } | ||
| 9397 | |||
| 9398 | if (!s.table_inline_editing) | ||
| 9399 | try {d.execCommand('enableInlineTableEditing', false, false);} catch (ex) {} | ||
| 9400 | |||
| 9401 | if (!s.object_resizing) | ||
| 9402 | try {d.execCommand('enableObjectResizing', false, false);} catch (ex) {} | ||
| 9403 | } | ||
| 9404 | }; | ||
| 9405 | |||
| 9406 | t.onBeforeExecCommand.add(setOpts); | ||
| 9407 | t.onMouseDown.add(setOpts); | ||
| 9408 | } | ||
| 9409 | |||
| 9410 | // Add node change handlers | ||
| 9411 | t.onMouseUp.add(t.nodeChanged); | ||
| 9412 | t.onClick.add(t.nodeChanged); | ||
| 9413 | t.onKeyUp.add(function(ed, e) { | ||
| 9414 | var c = e.keyCode; | ||
| 9415 | |||
| 9416 | if ((c >= 33 && c <= 36) || (c >= 37 && c <= 40) || c == 13 || c == 45 || c == 46 || c == 8 || (tinymce.isMac && (c == 91 || c == 93)) || e.ctrlKey) | ||
| 9417 | t.nodeChanged(); | ||
| 9418 | }); | ||
| 9419 | |||
| 9420 | // Add reset handler | ||
| 9421 | t.onReset.add(function() { | ||
| 9422 | t.setContent(t.startContent, {format : 'raw'}); | ||
| 9423 | }); | ||
| 9424 | |||
| 9425 | // Add shortcuts | ||
| 9426 | if (s.custom_shortcuts) { | ||
| 9427 | if (s.custom_undo_redo_keyboard_shortcuts) { | ||
| 9428 | t.addShortcut('ctrl+z', t.getLang('undo_desc'), 'Undo'); | ||
| 9429 | t.addShortcut('ctrl+y', t.getLang('redo_desc'), 'Redo'); | ||
| 9430 | } | ||
| 9431 | |||
| 9432 | // Add default shortcuts for gecko | ||
| 9433 | if (isGecko) { | ||
| 9434 | t.addShortcut('ctrl+b', t.getLang('bold_desc'), 'Bold'); | ||
| 9435 | t.addShortcut('ctrl+i', t.getLang('italic_desc'), 'Italic'); | ||
| 9436 | t.addShortcut('ctrl+u', t.getLang('underline_desc'), 'Underline'); | ||
| 9437 | } | ||
| 9438 | |||
| 9439 | // BlockFormat shortcuts keys | ||
| 9440 | for (i=1; i<=6; i++) | ||
| 9441 | t.addShortcut('ctrl+' + i, '', ['FormatBlock', false, '<h' + i + '>']); | ||
| 9442 | |||
| 9443 | t.addShortcut('ctrl+7', '', ['FormatBlock', false, '<p>']); | ||
| 9444 | t.addShortcut('ctrl+8', '', ['FormatBlock', false, '<div>']); | ||
| 9445 | t.addShortcut('ctrl+9', '', ['FormatBlock', false, '<address>']); | ||
| 9446 | |||
| 9447 | function find(e) { | ||
| 9448 | var v = null; | ||
| 9449 | |||
| 9450 | if (!e.altKey && !e.ctrlKey && !e.metaKey) | ||
| 9451 | return v; | ||
| 9452 | |||
| 9453 | each(t.shortcuts, function(o) { | ||
| 9454 | if (tinymce.isMac && o.ctrl != e.metaKey) | ||
| 9455 | return; | ||
| 9456 | else if (!tinymce.isMac && o.ctrl != e.ctrlKey) | ||
| 9457 | return; | ||
| 9458 | |||
| 9459 | if (o.alt != e.altKey) | ||
| 9460 | return; | ||
| 9461 | |||
| 9462 | if (o.shift != e.shiftKey) | ||
| 9463 | return; | ||
| 9464 | |||
| 9465 | if (e.keyCode == o.keyCode || (e.charCode && e.charCode == o.charCode)) { | ||
| 9466 | v = o; | ||
| 9467 | return false; | ||
| 9468 | } | ||
| 9469 | }); | ||
| 9470 | |||
| 9471 | return v; | ||
| 9472 | }; | ||
| 9473 | |||
| 9474 | t.onKeyUp.add(function(ed, e) { | ||
| 9475 | var o = find(e); | ||
| 9476 | |||
| 9477 | if (o) | ||
| 9478 | return Event.cancel(e); | ||
| 9479 | }); | ||
| 9480 | |||
| 9481 | t.onKeyPress.add(function(ed, e) { | ||
| 9482 | var o = find(e); | ||
| 9483 | |||
| 9484 | if (o) | ||
| 9485 | return Event.cancel(e); | ||
| 9486 | }); | ||
| 9487 | |||
| 9488 | t.onKeyDown.add(function(ed, e) { | ||
| 9489 | var o = find(e); | ||
| 9490 | |||
| 9491 | if (o) { | ||
| 9492 | o.func.call(o.scope); | ||
| 9493 | return Event.cancel(e); | ||
| 9494 | } | ||
| 9495 | }); | ||
| 9496 | } | ||
| 9497 | |||
| 9498 | if (tinymce.isIE) { | ||
| 9499 | // Fix so resize will only update the width and height attributes not the styles of an image | ||
| 9500 | // It will also block mceItemNoResize items | ||
| 9501 | t.dom.bind(t.getDoc(), 'controlselect', function(e) { | ||
| 9502 | var re = t.resizeInfo, cb; | ||
| 9503 | |||
| 9504 | e = e.target; | ||
| 9505 | |||
| 9506 | // Don't do this action for non image elements | ||
| 9507 | if (e.nodeName !== 'IMG') | ||
| 9508 | return; | ||
| 9509 | |||
| 9510 | if (re) | ||
| 9511 | t.dom.unbind(re.node, re.ev, re.cb); | ||
| 9512 | |||
| 9513 | if (!t.dom.hasClass(e, 'mceItemNoResize')) { | ||
| 9514 | ev = 'resizeend'; | ||
| 9515 | cb = t.dom.bind(e, ev, function(e) { | ||
| 9516 | var v; | ||
| 9517 | |||
| 9518 | e = e.target; | ||
| 9519 | |||
| 9520 | if (v = t.dom.getStyle(e, 'width')) { | ||
| 9521 | t.dom.setAttrib(e, 'width', v.replace(/[^0-9%]+/g, '')); | ||
| 9522 | t.dom.setStyle(e, 'width', ''); | ||
| 9523 | } | ||
| 9524 | |||
| 9525 | if (v = t.dom.getStyle(e, 'height')) { | ||
| 9526 | t.dom.setAttrib(e, 'height', v.replace(/[^0-9%]+/g, '')); | ||
| 9527 | t.dom.setStyle(e, 'height', ''); | ||
| 9528 | } | ||
| 9529 | }); | ||
| 9530 | } else { | ||
| 9531 | ev = 'resizestart'; | ||
| 9532 | cb = t.dom.bind(e, 'resizestart', Event.cancel, Event); | ||
| 9533 | } | ||
| 9534 | |||
| 9535 | re = t.resizeInfo = { | ||
| 9536 | node : e, | ||
| 9537 | ev : ev, | ||
| 9538 | cb : cb | ||
| 9539 | }; | ||
| 9540 | }); | ||
| 9541 | |||
| 9542 | t.onKeyDown.add(function(ed, e) { | ||
| 9543 | switch (e.keyCode) { | ||
| 9544 | case 8: | ||
| 9545 | // Fix IE control + backspace browser bug | ||
| 9546 | if (t.selection.getRng().item) { | ||
| 9547 | t.selection.getRng().item(0).removeNode(); | ||
| 9548 | return Event.cancel(e); | ||
| 9549 | } | ||
| 9550 | } | ||
| 9551 | }); | ||
| 9552 | |||
| 9553 | /*if (t.dom.boxModel) { | ||
| 9554 | t.getBody().style.height = '100%'; | ||
| 9555 | |||
| 9556 | Event.add(t.getWin(), 'resize', function(e) { | ||
| 9557 | var docElm = t.getDoc().documentElement; | ||
| 9558 | |||
| 9559 | docElm.style.height = (docElm.offsetHeight - 10) + 'px'; | ||
| 9560 | }); | ||
| 9561 | }*/ | ||
| 9562 | } | ||
| 9563 | |||
| 9564 | if (tinymce.isOpera) { | ||
| 9565 | t.onClick.add(function(ed, e) { | ||
| 9566 | Event.prevent(e); | ||
| 9567 | }); | ||
| 9568 | } | ||
| 9569 | |||
| 9570 | // Add custom undo/redo handlers | ||
| 9571 | if (s.custom_undo_redo) { | ||
| 9572 | function addUndo() { | ||
| 9573 | t.undoManager.typing = 0; | ||
| 9574 | t.undoManager.add(); | ||
| 9575 | }; | ||
| 9576 | |||
| 9577 | // Add undo level on editor blur | ||
| 9578 | if (tinymce.isIE) { | ||
| 9579 | t.dom.bind(t.getWin(), 'blur', function(e) { | ||
| 9580 | var n; | ||
| 9581 | |||
| 9582 | // Check added for fullscreen bug | ||
| 9583 | if (t.selection) { | ||
| 9584 | n = t.selection.getNode(); | ||
| 9585 | |||
| 9586 | // Add undo level is selection was lost to another document | ||
| 9587 | if (!t.removed && n.ownerDocument && n.ownerDocument != t.getDoc()) | ||
| 9588 | addUndo(); | ||
| 9589 | } | ||
| 9590 | }); | ||
| 9591 | } else { | ||
| 9592 | t.dom.bind(t.getDoc(), 'blur', function() { | ||
| 9593 | if (t.selection && !t.removed) | ||
| 9594 | addUndo(); | ||
| 9595 | }); | ||
| 9596 | } | ||
| 9597 | |||
| 9598 | t.onMouseDown.add(addUndo); | ||
| 9599 | |||
| 9600 | t.onKeyUp.add(function(ed, e) { | ||
| 9601 | if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45 || e.ctrlKey) { | ||
| 9602 | t.undoManager.typing = 0; | ||
| 9603 | t.undoManager.add(); | ||
| 9604 | } | ||
| 9605 | }); | ||
| 9606 | |||
| 9607 | t.onKeyDown.add(function(ed, e) { | ||
| 9608 | // Is caracter positon keys | ||
| 9609 | if ((e.keyCode >= 33 && e.keyCode <= 36) || (e.keyCode >= 37 && e.keyCode <= 40) || e.keyCode == 13 || e.keyCode == 45) { | ||
| 9610 | if (t.undoManager.typing) { | ||
| 9611 | t.undoManager.add(); | ||
| 9612 | t.undoManager.typing = 0; | ||
| 9613 | } | ||
| 9614 | |||
| 9615 | return; | ||
| 9616 | } | ||
| 9617 | |||
| 9618 | if (!t.undoManager.typing) { | ||
| 9619 | t.undoManager.add(); | ||
| 9620 | t.undoManager.typing = 1; | ||
| 9621 | } | ||
| 9622 | }); | ||
| 9623 | } | ||
| 9624 | }, | ||
| 9625 | |||
| 9626 | _convertInlineElements : function() { | ||
| 9627 | var t = this, s = t.settings, dom = t.dom, v, e, na, st, sp; | ||
| 9628 | |||
| 9629 | function convert(ed, o) { | ||
| 9630 | if (!s.inline_styles) | ||
| 9631 | return; | ||
| 9632 | |||
| 9633 | if (o.get) { | ||
| 9634 | each(t.dom.select('table,u,strike', o.node), function(n) { | ||
| 9635 | switch (n.nodeName) { | ||
| 9636 | case 'TABLE': | ||
| 9637 | if (v = dom.getAttrib(n, 'height')) { | ||
| 9638 | dom.setStyle(n, 'height', v); | ||
| 9639 | dom.setAttrib(n, 'height', ''); | ||
| 9640 | } | ||
| 9641 | break; | ||
| 9642 | |||
| 9643 | case 'U': | ||
| 9644 | case 'STRIKE': | ||
| 9645 | //sp = dom.create('span', {style : dom.getAttrib(n, 'style')}); | ||
| 9646 | n.style.textDecoration = n.nodeName == 'U' ? 'underline' : 'line-through'; | ||
| 9647 | dom.setAttrib(n, 'mce_style', ''); | ||
| 9648 | dom.setAttrib(n, 'mce_name', 'span'); | ||
| 9649 | break; | ||
| 9650 | } | ||
| 9651 | }); | ||
| 9652 | } else if (o.set) { | ||
| 9653 | each(t.dom.select('table,span', o.node).reverse(), function(n) { | ||
| 9654 | if (n.nodeName == 'TABLE') { | ||
| 9655 | if (v = dom.getStyle(n, 'height')) | ||
| 9656 | dom.setAttrib(n, 'height', v.replace(/[^0-9%]+/g, '')); | ||
| 9657 | } else { | ||
| 9658 | // Convert spans to elements | ||
| 9659 | if (n.style.textDecoration == 'underline') | ||
| 9660 | na = 'u'; | ||
| 9661 | else if (n.style.textDecoration == 'line-through') | ||
| 9662 | na = 'strike'; | ||
| 9663 | else | ||
| 9664 | na = ''; | ||
| 9665 | |||
| 9666 | if (na) { | ||
| 9667 | n.style.textDecoration = ''; | ||
| 9668 | dom.setAttrib(n, 'mce_style', ''); | ||
| 9669 | |||
| 9670 | e = dom.create(na, { | ||
| 9671 | style : dom.getAttrib(n, 'style') | ||
| 9672 | }); | ||
| 9673 | |||
| 9674 | dom.replace(e, n, 1); | ||
| 9675 | } | ||
| 9676 | } | ||
| 9677 | }); | ||
| 9678 | } | ||
| 9679 | }; | ||
| 9680 | |||
| 9681 | t.onPreProcess.add(convert); | ||
| 9682 | |||
| 9683 | if (!s.cleanup_on_startup) { | ||
| 9684 | t.onSetContent.add(function(ed, o) { | ||
| 9685 | if (o.initial) | ||
| 9686 | convert(t, {node : t.getBody(), set : 1}); | ||
| 9687 | }); | ||
| 9688 | } | ||
| 9689 | }, | ||
| 9690 | |||
| 9691 | _convertFonts : function() { | ||
| 9692 | var t = this, s = t.settings, dom = t.dom, fz, fzn, sl, cl; | ||
| 9693 | |||
| 9694 | // No need | ||
| 9695 | if (!s.inline_styles) | ||
| 9696 | return; | ||
| 9697 | |||
| 9698 | // Font pt values and font size names | ||
| 9699 | fz = [8, 10, 12, 14, 18, 24, 36]; | ||
| 9700 | fzn = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; | ||
| 9701 | |||
| 9702 | if (sl = s.font_size_style_values) | ||
| 9703 | sl = explode(sl); | ||
| 9704 | |||
| 9705 | if (cl = s.font_size_classes) | ||
| 9706 | cl = explode(cl); | ||
| 9707 | |||
| 9708 | function process(no) { | ||
| 9709 | var n, sp, nl, x; | ||
| 9710 | |||
| 9711 | // Keep unit tests happy | ||
| 9712 | if (!s.inline_styles) | ||
| 9713 | return; | ||
| 9714 | |||
| 9715 | nl = t.dom.select('font', no); | ||
| 9716 | for (x = nl.length - 1; x >= 0; x--) { | ||
| 9717 | n = nl[x]; | ||
| 9718 | |||
| 9719 | sp = dom.create('span', { | ||
| 9720 | style : dom.getAttrib(n, 'style'), | ||
| 9721 | 'class' : dom.getAttrib(n, 'class') | ||
| 9722 | }); | ||
| 9723 | |||
| 9724 | dom.setStyles(sp, { | ||
| 9725 | fontFamily : dom.getAttrib(n, 'face'), | ||
| 9726 | color : dom.getAttrib(n, 'color'), | ||
| 9727 | backgroundColor : n.style.backgroundColor | ||
| 9728 | }); | ||
| 9729 | |||
| 9730 | if (n.size) { | ||
| 9731 | if (sl) | ||
| 9732 | dom.setStyle(sp, 'fontSize', sl[parseInt(n.size) - 1]); | ||
| 9733 | else | ||
| 9734 | dom.setAttrib(sp, 'class', cl[parseInt(n.size) - 1]); | ||
| 9735 | } | ||
| 9736 | |||
| 9737 | dom.setAttrib(sp, 'mce_style', ''); | ||
| 9738 | dom.replace(sp, n, 1); | ||
| 9739 | } | ||
| 9740 | }; | ||
| 9741 | |||
| 9742 | // Run on cleanup | ||
| 9743 | t.onPreProcess.add(function(ed, o) { | ||
| 9744 | if (o.get) | ||
| 9745 | process(o.node); | ||
| 9746 | }); | ||
| 9747 | |||
| 9748 | t.onSetContent.add(function(ed, o) { | ||
| 9749 | if (o.initial) | ||
| 9750 | process(o.node); | ||
| 9751 | }); | ||
| 9752 | }, | ||
| 9753 | |||
| 9754 | _isHidden : function() { | ||
| 9755 | var s; | ||
| 9756 | |||
| 9757 | if (!isGecko) | ||
| 9758 | return 0; | ||
| 9759 | |||
| 9760 | // Weird, wheres that cursor selection? | ||
| 9761 | s = this.selection.getSel(); | ||
| 9762 | return (!s || !s.rangeCount || s.rangeCount == 0); | ||
| 9763 | }, | ||
| 9764 | |||
| 9765 | // Fix for bug #1867292 | ||
| 9766 | _fixNesting : function(s) { | ||
| 9767 | var d = [], i; | ||
| 9768 | |||
| 9769 | s = s.replace(/<(\/)?([^\s>]+)[^>]*?>/g, function(a, b, c) { | ||
| 9770 | var e; | ||
| 9771 | |||
| 9772 | // Handle end element | ||
| 9773 | if (b === '/') { | ||
| 9774 | if (!d.length) | ||
| 9775 | return ''; | ||
| 9776 | |||
| 9777 | if (c !== d[d.length - 1].tag) { | ||
| 9778 | for (i=d.length - 1; i>=0; i--) { | ||
| 9779 | if (d[i].tag === c) { | ||
| 9780 | d[i].close = 1; | ||
| 9781 | break; | ||
| 9782 | } | ||
| 9783 | } | ||
| 9784 | |||
| 9785 | return ''; | ||
| 9786 | } else { | ||
| 9787 | d.pop(); | ||
| 9788 | |||
| 9789 | if (d.length && d[d.length - 1].close) { | ||
| 9790 | a = a + '</' + d[d.length - 1].tag + '>'; | ||
| 9791 | d.pop(); | ||
| 9792 | } | ||
| 9793 | } | ||
| 9794 | } else { | ||
| 9795 | // Ignore these | ||
| 9796 | if (/^(br|hr|input|meta|img|link|param)$/i.test(c)) | ||
| 9797 | return a; | ||
| 9798 | |||
| 9799 | // Ignore closed ones | ||
| 9800 | if (/\/>$/.test(a)) | ||
| 9801 | return a; | ||
| 9802 | |||
| 9803 | d.push({tag : c}); // Push start element | ||
| 9804 | } | ||
| 9805 | |||
| 9806 | return a; | ||
| 9807 | }); | ||
| 9808 | |||
| 9809 | // End all open tags | ||
| 9810 | for (i=d.length - 1; i>=0; i--) | ||
| 9811 | s += '</' + d[i].tag + '>'; | ||
| 9812 | |||
| 9813 | return s; | ||
| 9814 | } | ||
| 9815 | }); | ||
| 9816 | })(tinymce); | ||
| 9817 | (function(tinymce) { | ||
| 9818 | var each = tinymce.each, isIE = tinymce.isIE, isGecko = tinymce.isGecko, isOpera = tinymce.isOpera, isWebKit = tinymce.isWebKit; | ||
| 9819 | |||
| 9820 | tinymce.create('tinymce.EditorCommands', { | ||
| 9821 | EditorCommands : function(ed) { | ||
| 9822 | this.editor = ed; | ||
| 9823 | }, | ||
| 9824 | |||
| 9825 | execCommand : function(cmd, ui, val) { | ||
| 9826 | var t = this, ed = t.editor, f; | ||
| 9827 | |||
| 9828 | switch (cmd) { | ||
| 9829 | // Ignore these | ||
| 9830 | case 'mceResetDesignMode': | ||
| 9831 | case 'mceBeginUndoLevel': | ||
| 9832 | return true; | ||
| 9833 | |||
| 9834 | // Ignore these | ||
| 9835 | case 'unlink': | ||
| 9836 | t.UnLink(); | ||
| 9837 | return true; | ||
| 9838 | |||
| 9839 | // Bundle these together | ||
| 9840 | case 'JustifyLeft': | ||
| 9841 | case 'JustifyCenter': | ||
| 9842 | case 'JustifyRight': | ||
| 9843 | case 'JustifyFull': | ||
| 9844 | t.mceJustify(cmd, cmd.substring(7).toLowerCase()); | ||
| 9845 | return true; | ||
| 9846 | |||
| 9847 | default: | ||
| 9848 | f = this[cmd]; | ||
| 9849 | |||
| 9850 | if (f) { | ||
| 9851 | f.call(this, ui, val); | ||
| 9852 | return true; | ||
| 9853 | } | ||
| 9854 | } | ||
| 9855 | |||
| 9856 | return false; | ||
| 9857 | }, | ||
| 9858 | |||
| 9859 | Indent : function() { | ||
| 9860 | var ed = this.editor, d = ed.dom, s = ed.selection, e, iv, iu; | ||
| 9861 | |||
| 9862 | // Setup indent level | ||
| 9863 | iv = ed.settings.indentation; | ||
| 9864 | iu = /[a-z%]+$/i.exec(iv); | ||
| 9865 | iv = parseInt(iv); | ||
| 9866 | |||
| 9867 | if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { | ||
| 9868 | each(s.getSelectedBlocks(), function(e) { | ||
| 9869 | d.setStyle(e, 'paddingLeft', (parseInt(e.style.paddingLeft || 0) + iv) + iu); | ||
| 9870 | }); | ||
| 9871 | |||
| 9872 | return; | ||
| 9873 | } | ||
| 9874 | |||
| 9875 | ed.getDoc().execCommand('Indent', false, null); | ||
| 9876 | |||
| 9877 | if (isIE) { | ||
| 9878 | d.getParent(s.getNode(), function(n) { | ||
| 9879 | if (n.nodeName == 'BLOCKQUOTE') { | ||
| 9880 | n.dir = n.style.cssText = ''; | ||
| 9881 | } | ||
| 9882 | }); | ||
| 9883 | } | ||
| 9884 | }, | ||
| 9885 | |||
| 9886 | Outdent : function() { | ||
| 9887 | var ed = this.editor, d = ed.dom, s = ed.selection, e, v, iv, iu; | ||
| 9888 | |||
| 9889 | // Setup indent level | ||
| 9890 | iv = ed.settings.indentation; | ||
| 9891 | iu = /[a-z%]+$/i.exec(iv); | ||
| 9892 | iv = parseInt(iv); | ||
| 9893 | |||
| 9894 | if (ed.settings.inline_styles && (!this.queryStateInsertUnorderedList() && !this.queryStateInsertOrderedList())) { | ||
| 9895 | each(s.getSelectedBlocks(), function(e) { | ||
| 9896 | v = Math.max(0, parseInt(e.style.paddingLeft || 0) - iv); | ||
| 9897 | d.setStyle(e, 'paddingLeft', v ? v + iu : ''); | ||
| 9898 | }); | ||
| 9899 | |||
| 9900 | return; | ||
| 9901 | } | ||
| 9902 | |||
| 9903 | ed.getDoc().execCommand('Outdent', false, null); | ||
| 9904 | }, | ||
| 9905 | |||
| 9906 | /* | ||
| 9907 | mceSetAttribute : function(u, v) { | ||
| 9908 | var ed = this.editor, d = ed.dom, e; | ||
| 9909 | |||
| 9910 | if (e = d.getParent(ed.selection.getNode(), d.isBlock)) | ||
| 9911 | d.setAttrib(e, v.name, v.value); | ||
| 9912 | }, | ||
| 9913 | */ | ||
| 9914 | mceSetContent : function(u, v) { | ||
| 9915 | this.editor.setContent(v); | ||
| 9916 | }, | ||
| 9917 | |||
| 9918 | mceToggleVisualAid : function() { | ||
| 9919 | var ed = this.editor; | ||
| 9920 | |||
| 9921 | ed.hasVisual = !ed.hasVisual; | ||
| 9922 | ed.addVisual(); | ||
| 9923 | }, | ||
| 9924 | |||
| 9925 | mceReplaceContent : function(u, v) { | ||
| 9926 | var s = this.editor.selection; | ||
| 9927 | |||
| 9928 | s.setContent(v.replace(/\{\$selection\}/g, s.getContent({format : 'text'}))); | ||
| 9929 | }, | ||
| 9930 | |||
| 9931 | mceInsertLink : function(u, v) { | ||
| 9932 | var ed = this.editor, s = ed.selection, e = ed.dom.getParent(s.getNode(), 'a'); | ||
| 9933 | |||
| 9934 | if (tinymce.is(v, 'string')) | ||
| 9935 | v = {href : v}; | ||
| 9936 | |||
| 9937 | function set(e) { | ||
| 9938 | each(v, function(v, k) { | ||
| 9939 | ed.dom.setAttrib(e, k, v); | ||
| 9940 | }); | ||
| 9941 | }; | ||
| 9942 | |||
| 9943 | if (!e) { | ||
| 9944 | ed.execCommand('CreateLink', false, 'javascript:mctmp(0);'); | ||
| 9945 | each(ed.dom.select('a[href=javascript:mctmp(0);]'), function(e) { | ||
| 9946 | set(e); | ||
| 9947 | }); | ||
| 9948 | } else { | ||
| 9949 | if (v.href) | ||
| 9950 | set(e); | ||
| 9951 | else | ||
| 9952 | ed.dom.remove(e, 1); | ||
| 9953 | } | ||
| 9954 | }, | ||
| 9955 | |||
| 9956 | UnLink : function() { | ||
| 9957 | var ed = this.editor, s = ed.selection; | ||
| 9958 | |||
| 9959 | if (s.isCollapsed()) | ||
| 9960 | s.select(s.getNode()); | ||
| 9961 | |||
| 9962 | ed.getDoc().execCommand('unlink', false, null); | ||
| 9963 | s.collapse(0); | ||
| 9964 | }, | ||
| 9965 | |||
| 9966 | FontName : function(u, v) { | ||
| 9967 | var t = this, ed = t.editor, s = ed.selection, e; | ||
| 9968 | |||
| 9969 | if (!v) { | ||
| 9970 | if (s.isCollapsed()) | ||
| 9971 | s.select(s.getNode()); | ||
| 9972 | } else { | ||
| 9973 | if (ed.settings.convert_fonts_to_spans) | ||
| 9974 | t._applyInlineStyle('span', {style : {fontFamily : v}}); | ||
| 9975 | else | ||
| 9976 | ed.getDoc().execCommand('FontName', false, v); | ||
| 9977 | } | ||
| 9978 | }, | ||
| 9979 | |||
| 9980 | FontSize : function(u, v) { | ||
| 9981 | var ed = this.editor, s = ed.settings, fc, fs; | ||
| 9982 | |||
| 9983 | // Use style options instead | ||
| 9984 | if (s.convert_fonts_to_spans && v >= 1 && v <= 7) { | ||
| 9985 | fs = tinymce.explode(s.font_size_style_values); | ||
| 9986 | fc = tinymce.explode(s.font_size_classes); | ||
| 9987 | |||
| 9988 | if (fc) | ||
| 9989 | v = fc[v - 1] || v; | ||
| 9990 | else | ||
| 9991 | v = fs[v - 1] || v; | ||
| 9992 | } | ||
| 9993 | |||
| 9994 | if (v >= 1 && v <= 7) | ||
| 9995 | ed.getDoc().execCommand('FontSize', false, v); | ||
| 9996 | else | ||
| 9997 | this._applyInlineStyle('span', {style : {fontSize : v}}); | ||
| 9998 | }, | ||
| 9999 | |||
| 10000 | queryCommandValue : function(c) { | ||
| 10001 | var f = this['queryValue' + c]; | ||
| 10002 | |||
| 10003 | if (f) | ||
| 10004 | return f.call(this, c); | ||
| 10005 | |||
| 10006 | return false; | ||
| 10007 | }, | ||
| 10008 | |||
| 10009 | queryCommandState : function(cmd) { | ||
| 10010 | var f; | ||
| 10011 | |||
| 10012 | switch (cmd) { | ||
| 10013 | // Bundle these together | ||
| 10014 | case 'JustifyLeft': | ||
| 10015 | case 'JustifyCenter': | ||
| 10016 | case 'JustifyRight': | ||
| 10017 | case 'JustifyFull': | ||
| 10018 | return this.queryStateJustify(cmd, cmd.substring(7).toLowerCase()); | ||
| 10019 | |||
| 10020 | default: | ||
| 10021 | if (f = this['queryState' + cmd]) | ||
| 10022 | return f.call(this, cmd); | ||
| 10023 | } | ||
| 10024 | |||
| 10025 | return -1; | ||
| 10026 | }, | ||
| 10027 | |||
| 10028 | _queryState : function(c) { | ||
| 10029 | try { | ||
| 10030 | return this.editor.getDoc().queryCommandState(c); | ||
| 10031 | } catch (ex) { | ||
| 10032 | // Ignore exception | ||
| 10033 | } | ||
| 10034 | }, | ||
| 10035 | |||
| 10036 | _queryVal : function(c) { | ||
| 10037 | try { | ||
| 10038 | return this.editor.getDoc().queryCommandValue(c); | ||
| 10039 | } catch (ex) { | ||
| 10040 | // Ignore exception | ||
| 10041 | } | ||
| 10042 | }, | ||
| 10043 | |||
| 10044 | queryValueFontSize : function() { | ||
| 10045 | var ed = this.editor, v = 0, p; | ||
| 10046 | |||
| 10047 | if (p = ed.dom.getParent(ed.selection.getNode(), 'span')) | ||
| 10048 | v = p.style.fontSize; | ||
| 10049 | |||
| 10050 | if (!v && (isOpera || isWebKit)) { | ||
| 10051 | if (p = ed.dom.getParent(ed.selection.getNode(), 'font')) | ||
| 10052 | v = p.size; | ||
| 10053 | |||
| 10054 | return v; | ||
| 10055 | } | ||
| 10056 | |||
| 10057 | return v || this._queryVal('FontSize'); | ||
| 10058 | }, | ||
| 10059 | |||
| 10060 | queryValueFontName : function() { | ||
| 10061 | var ed = this.editor, v = 0, p; | ||
| 10062 | |||
| 10063 | if (p = ed.dom.getParent(ed.selection.getNode(), 'font')) | ||
| 10064 | v = p.face; | ||
| 10065 | |||
| 10066 | if (p = ed.dom.getParent(ed.selection.getNode(), 'span')) | ||
| 10067 | v = p.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); | ||
| 10068 | |||
| 10069 | if (!v) | ||
| 10070 | v = this._queryVal('FontName'); | ||
| 10071 | |||
| 10072 | return v; | ||
| 10073 | }, | ||
| 10074 | |||
| 10075 | mceJustify : function(c, v) { | ||
| 10076 | var ed = this.editor, se = ed.selection, n = se.getNode(), nn = n.nodeName, bl, nb, dom = ed.dom, rm; | ||
| 10077 | |||
| 10078 | if (ed.settings.inline_styles && this.queryStateJustify(c, v)) | ||
| 10079 | rm = 1; | ||
| 10080 | |||
| 10081 | bl = dom.getParent(n, ed.dom.isBlock); | ||
| 10082 | |||
| 10083 | if (nn == 'IMG') { | ||
| 10084 | if (v == 'full') | ||
| 10085 | return; | ||
| 10086 | |||
| 10087 | if (rm) { | ||
| 10088 | if (v == 'center') | ||
| 10089 | dom.setStyle(bl || n.parentNode, 'textAlign', ''); | ||
| 10090 | |||
| 10091 | dom.setStyle(n, 'float', ''); | ||
| 10092 | this.mceRepaint(); | ||
| 10093 | return; | ||
| 10094 | } | ||
| 10095 | |||
| 10096 | if (v == 'center') { | ||
| 10097 | // Do not change table elements | ||
| 10098 | if (bl && /^(TD|TH)$/.test(bl.nodeName)) | ||
| 10099 | bl = 0; | ||
| 10100 | |||
| 10101 | if (!bl || bl.childNodes.length > 1) { | ||
| 10102 | nb = dom.create('p'); | ||
| 10103 | nb.appendChild(n.cloneNode(false)); | ||
| 10104 | |||
| 10105 | if (bl) | ||
| 10106 | dom.insertAfter(nb, bl); | ||
| 10107 | else | ||
| 10108 | dom.insertAfter(nb, n); | ||
| 10109 | |||
| 10110 | dom.remove(n); | ||
| 10111 | n = nb.firstChild; | ||
| 10112 | bl = nb; | ||
| 10113 | } | ||
| 10114 | |||
| 10115 | dom.setStyle(bl, 'textAlign', v); | ||
| 10116 | dom.setStyle(n, 'float', ''); | ||
| 10117 | } else { | ||
| 10118 | dom.setStyle(n, 'float', v); | ||
| 10119 | dom.setStyle(bl || n.parentNode, 'textAlign', ''); | ||
| 10120 | } | ||
| 10121 | |||
| 10122 | this.mceRepaint(); | ||
| 10123 | return; | ||
| 10124 | } | ||
| 10125 | |||
| 10126 | // Handle the alignment outselfs, less quirks in all browsers | ||
| 10127 | if (ed.settings.inline_styles && ed.settings.forced_root_block) { | ||
| 10128 | if (rm) | ||
| 10129 | v = ''; | ||
| 10130 | |||
| 10131 | each(se.getSelectedBlocks(dom.getParent(se.getStart(), dom.isBlock), dom.getParent(se.getEnd(), dom.isBlock)), function(e) { | ||
| 10132 | dom.setAttrib(e, 'align', ''); | ||
| 10133 | dom.setStyle(e, 'textAlign', v == 'full' ? 'justify' : v); | ||
| 10134 | }); | ||
| 10135 | |||
| 10136 | return; | ||
| 10137 | } else if (!rm) | ||
| 10138 | ed.getDoc().execCommand(c, false, null); | ||
| 10139 | |||
| 10140 | if (ed.settings.inline_styles) { | ||
| 10141 | if (rm) { | ||
| 10142 | dom.getParent(ed.selection.getNode(), function(n) { | ||
| 10143 | if (n.style && n.style.textAlign) | ||
| 10144 | dom.setStyle(n, 'textAlign', ''); | ||
| 10145 | }); | ||
| 10146 | |||
| 10147 | return; | ||
| 10148 | } | ||
| 10149 | |||
| 10150 | each(dom.select('*'), function(n) { | ||
| 10151 | var v = n.align; | ||
| 10152 | |||
| 10153 | if (v) { | ||
| 10154 | if (v == 'full') | ||
| 10155 | v = 'justify'; | ||
| 10156 | |||
| 10157 | dom.setStyle(n, 'textAlign', v); | ||
| 10158 | dom.setAttrib(n, 'align', ''); | ||
| 10159 | } | ||
| 10160 | }); | ||
| 10161 | } | ||
| 10162 | }, | ||
| 10163 | |||
| 10164 | mceSetCSSClass : function(u, v) { | ||
| 10165 | this.mceSetStyleInfo(0, {command : 'setattrib', name : 'class', value : v}); | ||
| 10166 | }, | ||
| 10167 | |||
| 10168 | getSelectedElement : function() { | ||
| 10169 | var t = this, ed = t.editor, dom = ed.dom, se = ed.selection, r = se.getRng(), r1, r2, sc, ec, so, eo, e, sp, ep, re; | ||
| 10170 | |||
| 10171 | if (se.isCollapsed() || r.item) | ||
| 10172 | return se.getNode(); | ||
| 10173 | |||
| 10174 | // Setup regexp | ||
| 10175 | re = ed.settings.merge_styles_invalid_parents; | ||
| 10176 | if (tinymce.is(re, 'string')) | ||
| 10177 | re = new RegExp(re, 'i'); | ||
| 10178 | |||
| 10179 | if (isIE) { | ||
| 10180 | r1 = r.duplicate(); | ||
| 10181 | r1.collapse(true); | ||
| 10182 | sc = r1.parentElement(); | ||
| 10183 | |||
| 10184 | r2 = r.duplicate(); | ||
| 10185 | r2.collapse(false); | ||
| 10186 | ec = r2.parentElement(); | ||
| 10187 | |||
| 10188 | if (sc != ec) { | ||
| 10189 | r1.move('character', 1); | ||
| 10190 | sc = r1.parentElement(); | ||
| 10191 | } | ||
| 10192 | |||
| 10193 | if (sc == ec) { | ||
| 10194 | r1 = r.duplicate(); | ||
| 10195 | r1.moveToElementText(sc); | ||
| 10196 | |||
| 10197 | if (r1.compareEndPoints('StartToStart', r) == 0 && r1.compareEndPoints('EndToEnd', r) == 0) | ||
| 10198 | return re && re.test(sc.nodeName) ? null : sc; | ||
| 10199 | } | ||
| 10200 | } else { | ||
| 10201 | function getParent(n) { | ||
| 10202 | return dom.getParent(n, '*'); | ||
| 10203 | }; | ||
| 10204 | |||
| 10205 | sc = r.startContainer; | ||
| 10206 | ec = r.endContainer; | ||
| 10207 | so = r.startOffset; | ||
| 10208 | eo = r.endOffset; | ||
| 10209 | |||
| 10210 | if (!r.collapsed) { | ||
| 10211 | if (sc == ec) { | ||
| 10212 | if (so - eo < 2) { | ||
| 10213 | if (sc.hasChildNodes()) { | ||
| 10214 | sp = sc.childNodes[so]; | ||
| 10215 | return re && re.test(sp.nodeName) ? null : sp; | ||
| 10216 | } | ||
| 10217 | } | ||
| 10218 | } | ||
| 10219 | } | ||
| 10220 | |||
| 10221 | if (sc.nodeType != 3 || ec.nodeType != 3) | ||
| 10222 | return null; | ||
| 10223 | |||
| 10224 | if (so == 0) { | ||
| 10225 | sp = getParent(sc); | ||
| 10226 | |||
| 10227 | if (sp && sp.firstChild != sc) | ||
| 10228 | sp = null; | ||
| 10229 | } | ||
| 10230 | |||
| 10231 | if (so == sc.nodeValue.length) { | ||
| 10232 | e = sc.nextSibling; | ||
| 10233 | |||
| 10234 | if (e && e.nodeType == 1) | ||
| 10235 | sp = sc.nextSibling; | ||
| 10236 | } | ||
| 10237 | |||
| 10238 | if (eo == 0) { | ||
| 10239 | e = ec.previousSibling; | ||
| 10240 | |||
| 10241 | if (e && e.nodeType == 1) | ||
| 10242 | ep = e; | ||
| 10243 | } | ||
| 10244 | |||
| 10245 | if (eo == ec.nodeValue.length) { | ||
| 10246 | ep = getParent(ec); | ||
| 10247 | |||
| 10248 | if (ep && ep.lastChild != ec) | ||
| 10249 | ep = null; | ||
| 10250 | } | ||
| 10251 | |||
| 10252 | // Same element | ||
| 10253 | if (sp == ep) | ||
| 10254 | return re && sp && re.test(sp.nodeName) ? null : sp; | ||
| 10255 | } | ||
| 10256 | |||
| 10257 | return null; | ||
| 10258 | }, | ||
| 10259 | |||
| 10260 | mceSetStyleInfo : function(u, v) { | ||
| 10261 | var t = this, ed = t.editor, d = ed.getDoc(), dom = ed.dom, e, b, s = ed.selection, nn = v.wrapper || 'span', b = s.getBookmark(), re; | ||
| 10262 | |||
| 10263 | function set(n, e) { | ||
| 10264 | if (n.nodeType == 1) { | ||
| 10265 | switch (v.command) { | ||
| 10266 | case 'setattrib': | ||
| 10267 | return dom.setAttrib(n, v.name, v.value); | ||
| 10268 | |||
| 10269 | case 'setstyle': | ||
| 10270 | return dom.setStyle(n, v.name, v.value); | ||
| 10271 | |||
| 10272 | case 'removeformat': | ||
| 10273 | return dom.setAttrib(n, 'class', ''); | ||
| 10274 | } | ||
| 10275 | } | ||
| 10276 | }; | ||
| 10277 | |||
| 10278 | // Setup regexp | ||
| 10279 | re = ed.settings.merge_styles_invalid_parents; | ||
| 10280 | if (tinymce.is(re, 'string')) | ||
| 10281 | re = new RegExp(re, 'i'); | ||
| 10282 | |||
| 10283 | // Set style info on selected element | ||
| 10284 | if ((e = t.getSelectedElement()) && !ed.settings.force_span_wrappers) | ||
| 10285 | set(e, 1); | ||
| 10286 | else { | ||
| 10287 | // Generate wrappers and set styles on them | ||
| 10288 | d.execCommand('FontName', false, '__'); | ||
| 10289 | each(dom.select('span,font'), function(n) { | ||
| 10290 | var sp, e; | ||
| 10291 | |||
| 10292 | if (dom.getAttrib(n, 'face') == '__' || n.style.fontFamily === '__') { | ||
| 10293 | sp = dom.create(nn, {mce_new : '1'}); | ||
| 10294 | |||
| 10295 | set(sp); | ||
| 10296 | |||
| 10297 | each (n.childNodes, function(n) { | ||
| 10298 | sp.appendChild(n.cloneNode(true)); | ||
| 10299 | }); | ||
| 10300 | |||
| 10301 | dom.replace(sp, n); | ||
| 10302 | } | ||
| 10303 | }); | ||
| 10304 | } | ||
| 10305 | |||
| 10306 | // Remove wrappers inside new ones | ||
| 10307 | each(dom.select(nn).reverse(), function(n) { | ||
| 10308 | var p = n.parentNode; | ||
| 10309 | |||
| 10310 | // Check if it's an old span in a new wrapper | ||
| 10311 | if (!dom.getAttrib(n, 'mce_new')) { | ||
| 10312 | // Find new wrapper | ||
| 10313 | p = dom.getParent(n, '*[mce_new]'); | ||
| 10314 | |||
| 10315 | if (p) | ||
| 10316 | dom.remove(n, 1); | ||
| 10317 | } | ||
| 10318 | }); | ||
| 10319 | |||
| 10320 | // Merge wrappers with parent wrappers | ||
| 10321 | each(dom.select(nn).reverse(), function(n) { | ||
| 10322 | var p = n.parentNode; | ||
| 10323 | |||
| 10324 | if (!p || !dom.getAttrib(n, 'mce_new')) | ||
| 10325 | return; | ||
| 10326 | |||
| 10327 | if (ed.settings.force_span_wrappers && p.nodeName != 'SPAN') | ||
| 10328 | return; | ||
| 10329 | |||
| 10330 | // Has parent of the same type and only child | ||
| 10331 | if (p.nodeName == nn.toUpperCase() && p.childNodes.length == 1) | ||
| 10332 | return dom.remove(p, 1); | ||
| 10333 | |||
| 10334 | // Has parent that is more suitable to have the class and only child | ||
| 10335 | if (n.nodeType == 1 && (!re || !re.test(p.nodeName)) && p.childNodes.length == 1) { | ||
| 10336 | set(p); // Set style info on parent instead | ||
| 10337 | dom.setAttrib(n, 'class', ''); | ||
| 10338 | } | ||
| 10339 | }); | ||
| 10340 | |||
| 10341 | // Remove empty wrappers | ||
| 10342 | each(dom.select(nn).reverse(), function(n) { | ||
| 10343 | if (dom.getAttrib(n, 'mce_new') || (dom.getAttribs(n).length <= 1 && n.className === '')) { | ||
| 10344 | if (!dom.getAttrib(n, 'class') && !dom.getAttrib(n, 'style')) | ||
| 10345 | return dom.remove(n, 1); | ||
| 10346 | |||
| 10347 | dom.setAttrib(n, 'mce_new', ''); // Remove mce_new marker | ||
| 10348 | } | ||
| 10349 | }); | ||
| 10350 | |||
| 10351 | s.moveToBookmark(b); | ||
| 10352 | }, | ||
| 10353 | |||
| 10354 | queryStateJustify : function(c, v) { | ||
| 10355 | var ed = this.editor, n = ed.selection.getNode(), dom = ed.dom; | ||
| 10356 | |||
| 10357 | if (n && n.nodeName == 'IMG') { | ||
| 10358 | if (dom.getStyle(n, 'float') == v) | ||
| 10359 | return 1; | ||
| 10360 | |||
| 10361 | return n.parentNode.style.textAlign == v; | ||
| 10362 | } | ||
| 10363 | |||
| 10364 | n = dom.getParent(ed.selection.getStart(), function(n) { | ||
| 10365 | return n.nodeType == 1 && n.style.textAlign; | ||
| 10366 | }); | ||
| 10367 | |||
| 10368 | if (v == 'full') | ||
| 10369 | v = 'justify'; | ||
| 10370 | |||
| 10371 | if (ed.settings.inline_styles) | ||
| 10372 | return (n && n.style.textAlign == v); | ||
| 10373 | |||
| 10374 | return this._queryState(c); | ||
| 10375 | }, | ||
| 10376 | |||
| 10377 | ForeColor : function(ui, v) { | ||
| 10378 | var ed = this.editor; | ||
| 10379 | |||
| 10380 | if (ed.settings.convert_fonts_to_spans) { | ||
| 10381 | this._applyInlineStyle('span', {style : {color : v}}); | ||
| 10382 | return; | ||
| 10383 | } else | ||
| 10384 | ed.getDoc().execCommand('ForeColor', false, v); | ||
| 10385 | }, | ||
| 10386 | |||
| 10387 | HiliteColor : function(ui, val) { | ||
| 10388 | var t = this, ed = t.editor, d = ed.getDoc(); | ||
| 10389 | |||
| 10390 | if (ed.settings.convert_fonts_to_spans) { | ||
| 10391 | this._applyInlineStyle('span', {style : {backgroundColor : val}}); | ||
| 10392 | return; | ||
| 10393 | } | ||
| 10394 | |||
| 10395 | function set(s) { | ||
| 10396 | if (!isGecko) | ||
| 10397 | return; | ||
| 10398 | |||
| 10399 | try { | ||
| 10400 | // Try new Gecko method | ||
| 10401 | d.execCommand("styleWithCSS", 0, s); | ||
| 10402 | } catch (ex) { | ||
| 10403 | // Use old | ||
| 10404 | d.execCommand("useCSS", 0, !s); | ||
| 10405 | } | ||
| 10406 | }; | ||
| 10407 | |||
| 10408 | if (isGecko || isOpera) { | ||
| 10409 | set(true); | ||
| 10410 | d.execCommand('hilitecolor', false, val); | ||
| 10411 | set(false); | ||
| 10412 | } else | ||
| 10413 | d.execCommand('BackColor', false, val); | ||
| 10414 | }, | ||
| 10415 | |||
| 10416 | FormatBlock : function(ui, val) { | ||
| 10417 | var t = this, ed = t.editor, s = ed.selection, dom = ed.dom, bl, nb, b; | ||
| 10418 | |||
| 10419 | function isBlock(n) { | ||
| 10420 | return /^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(n.nodeName); | ||
| 10421 | }; | ||
| 10422 | |||
| 10423 | bl = dom.getParent(s.getNode(), function(n) { | ||
| 10424 | return isBlock(n); | ||
| 10425 | }); | ||
| 10426 | |||
| 10427 | // IE has an issue where it removes the parent div if you change format on the paragrah in <div><p>Content</p></div> | ||
| 10428 | // FF and Opera doesn't change parent DIV elements if you switch format | ||
| 10429 | if (bl) { | ||
| 10430 | if ((isIE && isBlock(bl.parentNode)) || bl.nodeName == 'DIV') { | ||
| 10431 | // Rename block element | ||
| 10432 | nb = ed.dom.create(val); | ||
| 10433 | |||
| 10434 | each(dom.getAttribs(bl), function(v) { | ||
| 10435 | dom.setAttrib(nb, v.nodeName, dom.getAttrib(bl, v.nodeName)); | ||
| 10436 | }); | ||
| 10437 | |||
| 10438 | b = s.getBookmark(); | ||
| 10439 | dom.replace(nb, bl, 1); | ||
| 10440 | s.moveToBookmark(b); | ||
| 10441 | ed.nodeChanged(); | ||
| 10442 | return; | ||
| 10443 | } | ||
| 10444 | } | ||
| 10445 | |||
| 10446 | val = ed.settings.forced_root_block ? (val || '<p>') : val; | ||
| 10447 | |||
| 10448 | if (val.indexOf('<') == -1) | ||
| 10449 | val = '<' + val + '>'; | ||
| 10450 | |||
| 10451 | if (tinymce.isGecko) | ||
| 10452 | val = val.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi, '$1'); | ||
| 10453 | |||
| 10454 | ed.getDoc().execCommand('FormatBlock', false, val); | ||
| 10455 | }, | ||
| 10456 | |||
| 10457 | mceCleanup : function() { | ||
| 10458 | var ed = this.editor, s = ed.selection, b = s.getBookmark(); | ||
| 10459 | ed.setContent(ed.getContent()); | ||
| 10460 | s.moveToBookmark(b); | ||
| 10461 | }, | ||
| 10462 | |||
| 10463 | mceRemoveNode : function(ui, val) { | ||
| 10464 | var ed = this.editor, s = ed.selection, b, n = val || s.getNode(); | ||
| 10465 | |||
| 10466 | // Make sure that the body node isn't removed | ||
| 10467 | if (n == ed.getBody()) | ||
| 10468 | return; | ||
| 10469 | |||
| 10470 | b = s.getBookmark(); | ||
| 10471 | ed.dom.remove(n, 1); | ||
| 10472 | s.moveToBookmark(b); | ||
| 10473 | ed.nodeChanged(); | ||
| 10474 | }, | ||
| 10475 | |||
| 10476 | mceSelectNodeDepth : function(ui, val) { | ||
| 10477 | var ed = this.editor, s = ed.selection, c = 0; | ||
| 10478 | |||
| 10479 | ed.dom.getParent(s.getNode(), function(n) { | ||
| 10480 | if (n.nodeType == 1 && c++ == val) { | ||
| 10481 | s.select(n); | ||
| 10482 | ed.nodeChanged(); | ||
| 10483 | return false; | ||
| 10484 | } | ||
| 10485 | }, ed.getBody()); | ||
| 10486 | }, | ||
| 10487 | |||
| 10488 | mceSelectNode : function(u, v) { | ||
| 10489 | this.editor.selection.select(v); | ||
| 10490 | }, | ||
| 10491 | |||
| 10492 | mceInsertContent : function(ui, val) { | ||
| 10493 | this.editor.selection.setContent(val); | ||
| 10494 | }, | ||
| 10495 | |||
| 10496 | mceInsertRawHTML : function(ui, val) { | ||
| 10497 | var ed = this.editor; | ||
| 10498 | |||
| 10499 | ed.selection.setContent('tiny_mce_marker'); | ||
| 10500 | ed.setContent(ed.getContent().replace(/tiny_mce_marker/g, val)); | ||
| 10501 | }, | ||
| 10502 | |||
| 10503 | mceRepaint : function() { | ||
| 10504 | var s, b, e = this.editor; | ||
| 10505 | |||
| 10506 | if (tinymce.isGecko) { | ||
| 10507 | try { | ||
| 10508 | s = e.selection; | ||
| 10509 | b = s.getBookmark(true); | ||
| 10510 | |||
| 10511 | if (s.getSel()) | ||
| 10512 | s.getSel().selectAllChildren(e.getBody()); | ||
| 10513 | |||
| 10514 | s.collapse(true); | ||
| 10515 | s.moveToBookmark(b); | ||
| 10516 | } catch (ex) { | ||
| 10517 | // Ignore | ||
| 10518 | } | ||
| 10519 | } | ||
| 10520 | }, | ||
| 10521 | |||
| 10522 | queryStateUnderline : function() { | ||
| 10523 | var ed = this.editor, n = ed.selection.getNode(); | ||
| 10524 | |||
| 10525 | if (n && n.nodeName == 'A') | ||
| 10526 | return false; | ||
| 10527 | |||
| 10528 | return this._queryState('Underline'); | ||
| 10529 | }, | ||
| 10530 | |||
| 10531 | queryStateOutdent : function() { | ||
| 10532 | var ed = this.editor, n; | ||
| 10533 | |||
| 10534 | if (ed.settings.inline_styles) { | ||
| 10535 | if ((n = ed.dom.getParent(ed.selection.getStart(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) | ||
| 10536 | return true; | ||
| 10537 | |||
| 10538 | if ((n = ed.dom.getParent(ed.selection.getEnd(), ed.dom.isBlock)) && parseInt(n.style.paddingLeft) > 0) | ||
| 10539 | return true; | ||
| 10540 | } | ||
| 10541 | |||
| 10542 | return this.queryStateInsertUnorderedList() || this.queryStateInsertOrderedList() || (!ed.settings.inline_styles && !!ed.dom.getParent(ed.selection.getNode(), 'BLOCKQUOTE')); | ||
| 10543 | }, | ||
| 10544 | |||
| 10545 | queryStateInsertUnorderedList : function() { | ||
| 10546 | return this.editor.dom.getParent(this.editor.selection.getNode(), 'UL'); | ||
| 10547 | }, | ||
| 10548 | |||
| 10549 | queryStateInsertOrderedList : function() { | ||
| 10550 | return this.editor.dom.getParent(this.editor.selection.getNode(), 'OL'); | ||
| 10551 | }, | ||
| 10552 | |||
| 10553 | queryStatemceBlockQuote : function() { | ||
| 10554 | return !!this.editor.dom.getParent(this.editor.selection.getStart(), function(n) {return n.nodeName === 'BLOCKQUOTE';}); | ||
| 10555 | }, | ||
| 10556 | |||
| 10557 | _applyInlineStyle : function(na, at, op) { | ||
| 10558 | var t = this, ed = t.editor, dom = ed.dom, bm, lo = {}, kh, found; | ||
| 10559 | |||
| 10560 | na = na.toUpperCase(); | ||
| 10561 | |||
| 10562 | if (op && op.check_classes && at['class']) | ||
| 10563 | op.check_classes.push(at['class']); | ||
| 10564 | |||
| 10565 | function removeEmpty() { | ||
| 10566 | each(dom.select(na).reverse(), function(n) { | ||
| 10567 | var c = 0; | ||
| 10568 | |||
| 10569 | // Check if there is any attributes | ||
| 10570 | each(dom.getAttribs(n), function(an) { | ||
| 10571 | if (an.nodeName.substring(0, 1) != '_' && dom.getAttrib(n, an.nodeName) != '') { | ||
| 10572 | //console.log(dom.getOuterHTML(n), dom.getAttrib(n, an.nodeName)); | ||
| 10573 | c++; | ||
| 10574 | } | ||
| 10575 | }); | ||
| 10576 | |||
| 10577 | // No attributes then remove the element and keep the children | ||
| 10578 | if (c == 0) | ||
| 10579 | dom.remove(n, 1); | ||
| 10580 | }); | ||
| 10581 | }; | ||
| 10582 | |||
| 10583 | function replaceFonts() { | ||
| 10584 | var bm; | ||
| 10585 | |||
| 10586 | each(dom.select('span,font'), function(n) { | ||
| 10587 | if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') { | ||
| 10588 | if (!bm) | ||
| 10589 | bm = ed.selection.getBookmark(); | ||
| 10590 | |||
| 10591 | at._mce_new = '1'; | ||
| 10592 | dom.replace(dom.create(na, at), n, 1); | ||
| 10593 | } | ||
| 10594 | }); | ||
| 10595 | |||
| 10596 | // Remove redundant elements | ||
| 10597 | each(dom.select(na + '[_mce_new]'), function(n) { | ||
| 10598 | function removeStyle(n) { | ||
| 10599 | if (n.nodeType == 1) { | ||
| 10600 | each(at.style, function(v, k) { | ||
| 10601 | dom.setStyle(n, k, ''); | ||
| 10602 | }); | ||
| 10603 | |||
| 10604 | // Remove spans with the same class or marked classes | ||
| 10605 | if (at['class'] && n.className && op) { | ||
| 10606 | each(op.check_classes, function(c) { | ||
| 10607 | if (dom.hasClass(n, c)) | ||
| 10608 | dom.removeClass(n, c); | ||
| 10609 | }); | ||
| 10610 | } | ||
| 10611 | } | ||
| 10612 | }; | ||
| 10613 | |||
| 10614 | // Remove specified style information from child elements | ||
| 10615 | each(dom.select(na, n), removeStyle); | ||
| 10616 | |||
| 10617 | // Remove the specified style information on parent if current node is only child (IE) | ||
| 10618 | if (n.parentNode && n.parentNode.nodeType == 1 && n.parentNode.childNodes.length == 1) | ||
| 10619 | removeStyle(n.parentNode); | ||
| 10620 | |||
| 10621 | // Remove the child elements style info if a parent already has it | ||
| 10622 | dom.getParent(n.parentNode, function(pn) { | ||
| 10623 | if (pn.nodeType == 1) { | ||
| 10624 | if (at.style) { | ||
| 10625 | each(at.style, function(v, k) { | ||
| 10626 | var sv; | ||
| 10627 | |||
| 10628 | if (!lo[k] && (sv = dom.getStyle(pn, k))) { | ||
| 10629 | if (sv === v) | ||
| 10630 | dom.setStyle(n, k, ''); | ||
| 10631 | |||
| 10632 | lo[k] = 1; | ||
| 10633 | } | ||
| 10634 | }); | ||
| 10635 | } | ||
| 10636 | |||
| 10637 | // Remove spans with the same class or marked classes | ||
| 10638 | if (at['class'] && pn.className && op) { | ||
| 10639 | each(op.check_classes, function(c) { | ||
| 10640 | if (dom.hasClass(pn, c)) | ||
| 10641 | dom.removeClass(n, c); | ||
| 10642 | }); | ||
| 10643 | } | ||
| 10644 | } | ||
| 10645 | |||
| 10646 | return false; | ||
| 10647 | }); | ||
| 10648 | |||
| 10649 | n.removeAttribute('_mce_new'); | ||
| 10650 | }); | ||
| 10651 | |||
| 10652 | removeEmpty(); | ||
| 10653 | ed.selection.moveToBookmark(bm); | ||
| 10654 | |||
| 10655 | return !!bm; | ||
| 10656 | }; | ||
| 10657 | |||
| 10658 | // Create inline elements | ||
| 10659 | ed.focus(); | ||
| 10660 | ed.getDoc().execCommand('FontName', false, 'mceinline'); | ||
| 10661 | replaceFonts(); | ||
| 10662 | |||
| 10663 | if (kh = t._applyInlineStyle.keyhandler) { | ||
| 10664 | ed.onKeyUp.remove(kh); | ||
| 10665 | ed.onKeyPress.remove(kh); | ||
| 10666 | ed.onKeyDown.remove(kh); | ||
| 10667 | ed.onSetContent.remove(t._applyInlineStyle.chandler); | ||
| 10668 | } | ||
| 10669 | |||
| 10670 | if (ed.selection.isCollapsed()) { | ||
| 10671 | // IE will format the current word so this code can't be executed on that browser | ||
| 10672 | if (!isIE) { | ||
| 10673 | each(dom.getParents(ed.selection.getNode(), 'span'), function(n) { | ||
| 10674 | each(at.style, function(v, k) { | ||
| 10675 | var kv; | ||
| 10676 | |||
| 10677 | if (kv = dom.getStyle(n, k)) { | ||
| 10678 | if (kv == v) { | ||
| 10679 | dom.setStyle(n, k, ''); | ||
| 10680 | found = 2; | ||
| 10681 | return false; | ||
| 10682 | } | ||
| 10683 | |||
| 10684 | found = 1; | ||
| 10685 | return false; | ||
| 10686 | } | ||
| 10687 | }); | ||
| 10688 | |||
| 10689 | if (found) | ||
| 10690 | return false; | ||
| 10691 | }); | ||
| 10692 | |||
| 10693 | if (found == 2) { | ||
| 10694 | bm = ed.selection.getBookmark(); | ||
| 10695 | |||
| 10696 | removeEmpty(); | ||
| 10697 | |||
| 10698 | ed.selection.moveToBookmark(bm); | ||
| 10699 | |||
| 10700 | // Node change needs to be detached since the onselect event | ||
| 10701 | // for the select box will run the onclick handler after onselect call. Todo: Add a nicer fix! | ||
| 10702 | window.setTimeout(function() { | ||
| 10703 | ed.nodeChanged(); | ||
| 10704 | }, 1); | ||
| 10705 | |||
| 10706 | return; | ||
| 10707 | } | ||
| 10708 | } | ||
| 10709 | |||
| 10710 | // Start collecting styles | ||
| 10711 | t._pendingStyles = tinymce.extend(t._pendingStyles || {}, at.style); | ||
| 10712 | |||
| 10713 | t._applyInlineStyle.chandler = ed.onSetContent.add(function() { | ||
| 10714 | delete t._pendingStyles; | ||
| 10715 | }); | ||
| 10716 | |||
| 10717 | t._applyInlineStyle.keyhandler = kh = function(e) { | ||
| 10718 | // Use pending styles | ||
| 10719 | if (t._pendingStyles) { | ||
| 10720 | at.style = t._pendingStyles; | ||
| 10721 | delete t._pendingStyles; | ||
| 10722 | } | ||
| 10723 | |||
| 10724 | if (replaceFonts()) { | ||
| 10725 | ed.onKeyDown.remove(t._applyInlineStyle.keyhandler); | ||
| 10726 | ed.onKeyPress.remove(t._applyInlineStyle.keyhandler); | ||
| 10727 | } | ||
| 10728 | |||
| 10729 | if (e.type == 'keyup') | ||
| 10730 | ed.onKeyUp.remove(t._applyInlineStyle.keyhandler); | ||
| 10731 | }; | ||
| 10732 | |||
| 10733 | ed.onKeyDown.add(kh); | ||
| 10734 | ed.onKeyPress.add(kh); | ||
| 10735 | ed.onKeyUp.add(kh); | ||
| 10736 | } else | ||
| 10737 | t._pendingStyles = 0; | ||
| 10738 | } | ||
| 10739 | }); | ||
| 10740 | })(tinymce);(function(tinymce) { | ||
| 10741 | tinymce.create('tinymce.UndoManager', { | ||
| 10742 | index : 0, | ||
| 10743 | data : null, | ||
| 10744 | typing : 0, | ||
| 10745 | |||
| 10746 | UndoManager : function(ed) { | ||
| 10747 | var t = this, Dispatcher = tinymce.util.Dispatcher; | ||
| 10748 | |||
| 10749 | t.editor = ed; | ||
| 10750 | t.data = []; | ||
| 10751 | t.onAdd = new Dispatcher(this); | ||
| 10752 | t.onUndo = new Dispatcher(this); | ||
| 10753 | t.onRedo = new Dispatcher(this); | ||
| 10754 | }, | ||
| 10755 | |||
| 10756 | add : function(l) { | ||
| 10757 | var t = this, i, ed = t.editor, b, s = ed.settings, la; | ||
| 10758 | |||
| 10759 | l = l || {}; | ||
| 10760 | l.content = l.content || ed.getContent({format : 'raw', no_events : 1}); | ||
| 10761 | |||
| 10762 | // Add undo level if needed | ||
| 10763 | l.content = l.content.replace(/^\s*|\s*$/g, ''); | ||
| 10764 | la = t.data[t.index > 0 && (t.index == 0 || t.index == t.data.length) ? t.index - 1 : t.index]; | ||
| 10765 | if (!l.initial && la && l.content == la.content) | ||
| 10766 | return null; | ||
| 10767 | |||
| 10768 | // Time to compress | ||
| 10769 | if (s.custom_undo_redo_levels) { | ||
| 10770 | if (t.data.length > s.custom_undo_redo_levels) { | ||
| 10771 | for (i = 0; i < t.data.length - 1; i++) | ||
| 10772 | t.data[i] = t.data[i + 1]; | ||
| 10773 | |||
| 10774 | t.data.length--; | ||
| 10775 | t.index = t.data.length; | ||
| 10776 | } | ||
| 10777 | } | ||
| 10778 | |||
| 10779 | if (s.custom_undo_redo_restore_selection && !l.initial) | ||
| 10780 | l.bookmark = b = l.bookmark || ed.selection.getBookmark(); | ||
| 10781 | |||
| 10782 | if (t.index < t.data.length) | ||
| 10783 | t.index++; | ||
| 10784 | |||
| 10785 | // Only initial marked undo levels should be allowed as first item | ||
| 10786 | // This to workaround a bug with Firefox and the blur event | ||
| 10787 | if (t.data.length === 0 && !l.initial) | ||
| 10788 | return null; | ||
| 10789 | |||
| 10790 | // Add level | ||
| 10791 | t.data.length = t.index + 1; | ||
| 10792 | t.data[t.index++] = l; | ||
| 10793 | |||
| 10794 | if (l.initial) | ||
| 10795 | t.index = 0; | ||
| 10796 | |||
| 10797 | // Set initial bookmark use first real undo level | ||
| 10798 | if (t.data.length == 2 && t.data[0].initial) | ||
| 10799 | t.data[0].bookmark = b; | ||
| 10800 | |||
| 10801 | t.onAdd.dispatch(t, l); | ||
| 10802 | ed.isNotDirty = 0; | ||
| 10803 | |||
| 10804 | //console.dir(t.data); | ||
| 10805 | |||
| 10806 | return l; | ||
| 10807 | }, | ||
| 10808 | |||
| 10809 | undo : function() { | ||
| 10810 | var t = this, ed = t.editor, l = l, i; | ||
| 10811 | |||
| 10812 | if (t.typing) { | ||
| 10813 | t.add(); | ||
| 10814 | t.typing = 0; | ||
| 10815 | } | ||
| 10816 | |||
| 10817 | if (t.index > 0) { | ||
| 10818 | // If undo on last index then take snapshot | ||
| 10819 | if (t.index == t.data.length && t.index > 1) { | ||
| 10820 | i = t.index; | ||
| 10821 | t.typing = 0; | ||
| 10822 | |||
| 10823 | if (!t.add()) | ||
| 10824 | t.index = i; | ||
| 10825 | |||
| 10826 | --t.index; | ||
| 10827 | } | ||
| 10828 | |||
| 10829 | l = t.data[--t.index]; | ||
| 10830 | ed.setContent(l.content, {format : 'raw'}); | ||
| 10831 | ed.selection.moveToBookmark(l.bookmark); | ||
| 10832 | |||
| 10833 | t.onUndo.dispatch(t, l); | ||
| 10834 | } | ||
| 10835 | |||
| 10836 | return l; | ||
| 10837 | }, | ||
| 10838 | |||
| 10839 | redo : function() { | ||
| 10840 | var t = this, ed = t.editor, l = null; | ||
| 10841 | |||
| 10842 | if (t.index < t.data.length - 1) { | ||
| 10843 | l = t.data[++t.index]; | ||
| 10844 | ed.setContent(l.content, {format : 'raw'}); | ||
| 10845 | ed.selection.moveToBookmark(l.bookmark); | ||
| 10846 | |||
| 10847 | t.onRedo.dispatch(t, l); | ||
| 10848 | } | ||
| 10849 | |||
| 10850 | return l; | ||
| 10851 | }, | ||
| 10852 | |||
| 10853 | clear : function() { | ||
| 10854 | var t = this; | ||
| 10855 | |||
| 10856 | t.data = []; | ||
| 10857 | t.index = 0; | ||
| 10858 | t.typing = 0; | ||
| 10859 | t.add({initial : true}); | ||
| 10860 | }, | ||
| 10861 | |||
| 10862 | hasUndo : function() { | ||
| 10863 | return this.index != 0 || this.typing; | ||
| 10864 | }, | ||
| 10865 | |||
| 10866 | hasRedo : function() { | ||
| 10867 | return this.index < this.data.length - 1; | ||
| 10868 | } | ||
| 10869 | }); | ||
| 10870 | })(tinymce); | ||
| 10871 | (function(tinymce) { | ||
| 10872 | // Shorten names | ||
| 10873 | var Event, isIE, isGecko, isOpera, each, extend; | ||
| 10874 | |||
| 10875 | Event = tinymce.dom.Event; | ||
| 10876 | isIE = tinymce.isIE; | ||
| 10877 | isGecko = tinymce.isGecko; | ||
| 10878 | isOpera = tinymce.isOpera; | ||
| 10879 | each = tinymce.each; | ||
| 10880 | extend = tinymce.extend; | ||
| 10881 | |||
| 10882 | // Checks if the selection/caret is at the end of the specified block element | ||
| 10883 | function isAtEnd(rng, par) { | ||
| 10884 | var rng2 = par.ownerDocument.createRange(); | ||
| 10885 | |||
| 10886 | rng2.setStart(rng.endContainer, rng.endOffset); | ||
| 10887 | rng2.setEndAfter(par); | ||
| 10888 | |||
| 10889 | // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element | ||
| 10890 | return rng2.cloneContents().textContent.length == 0; | ||
| 10891 | }; | ||
| 10892 | |||
| 10893 | function isEmpty(n) { | ||
| 10894 | n = n.innerHTML; | ||
| 10895 | |||
| 10896 | n = n.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi, '-'); // Keep these convert them to - chars | ||
| 10897 | n = n.replace(/<[^>]+>/g, ''); // Remove all tags | ||
| 10898 | |||
| 10899 | return n.replace(/[ \t\r\n]+/g, '') == ''; | ||
| 10900 | }; | ||
| 10901 | |||
| 10902 | tinymce.create('tinymce.ForceBlocks', { | ||
| 10903 | ForceBlocks : function(ed) { | ||
| 10904 | var t = this, s = ed.settings, elm; | ||
| 10905 | |||
| 10906 | t.editor = ed; | ||
| 10907 | t.dom = ed.dom; | ||
| 10908 | elm = (s.forced_root_block || 'p').toLowerCase(); | ||
| 10909 | s.element = elm.toUpperCase(); | ||
| 10910 | |||
| 10911 | ed.onPreInit.add(t.setup, t); | ||
| 10912 | |||
| 10913 | t.reOpera = new RegExp('(\\u00a0| | )<\/' + elm + '>', 'gi'); | ||
| 10914 | t.rePadd = new RegExp('<p( )([^>]+)><\\\/p>|<p( )([^>]+)\\\/>|<p( )([^>]+)>\\s+<\\\/p>|<p><\\\/p>|<p\\\/>|<p>\\s+<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10915 | t.reNbsp2BR1 = new RegExp('<p( )([^>]+)>[\\s\\u00a0]+<\\\/p>|<p>[\\s\\u00a0]+<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10916 | t.reNbsp2BR2 = new RegExp('<%p()([^>]+)>( | )<\\\/%p>|<%p>( | )<\\\/%p>'.replace(/%p/g, elm), 'gi'); | ||
| 10917 | t.reBR2Nbsp = new RegExp('<p( )([^>]+)>\\s*<br \\\/>\\s*<\\\/p>|<p>\\s*<br \\\/>\\s*<\\\/p>'.replace(/p/g, elm), 'gi'); | ||
| 10918 | |||
| 10919 | function padd(ed, o) { | ||
| 10920 | if (isOpera) | ||
| 10921 | o.content = o.content.replace(t.reOpera, '</' + elm + '>'); | ||
| 10922 | |||
| 10923 | o.content = o.content.replace(t.rePadd, '<' + elm + '$1$2$3$4$5$6>\u00a0</' + elm + '>'); | ||
| 10924 | |||
| 10925 | if (!isIE && !isOpera && o.set) { | ||
| 10926 | // Use instead of BR in padded paragraphs | ||
| 10927 | o.content = o.content.replace(t.reNbsp2BR1, '<' + elm + '$1$2><br /></' + elm + '>'); | ||
| 10928 | o.content = o.content.replace(t.reNbsp2BR2, '<' + elm + '$1$2><br /></' + elm + '>'); | ||
| 10929 | } else | ||
| 10930 | o.content = o.content.replace(t.reBR2Nbsp, '<' + elm + '$1$2>\u00a0</' + elm + '>'); | ||
| 10931 | }; | ||
| 10932 | |||
| 10933 | ed.onBeforeSetContent.add(padd); | ||
| 10934 | ed.onPostProcess.add(padd); | ||
| 10935 | |||
| 10936 | if (s.forced_root_block) { | ||
| 10937 | ed.onInit.add(t.forceRoots, t); | ||
| 10938 | ed.onSetContent.add(t.forceRoots, t); | ||
| 10939 | ed.onBeforeGetContent.add(t.forceRoots, t); | ||
| 10940 | } | ||
| 10941 | }, | ||
| 10942 | |||
| 10943 | setup : function() { | ||
| 10944 | var t = this, ed = t.editor, s = ed.settings; | ||
| 10945 | |||
| 10946 | // Force root blocks when typing and when getting output | ||
| 10947 | if (s.forced_root_block) { | ||
| 10948 | ed.onKeyUp.add(t.forceRoots, t); | ||
| 10949 | ed.onPreProcess.add(t.forceRoots, t); | ||
| 10950 | } | ||
| 10951 | |||
| 10952 | if (s.force_br_newlines) { | ||
| 10953 | // Force IE to produce BRs on enter | ||
| 10954 | if (isIE) { | ||
| 10955 | ed.onKeyPress.add(function(ed, e) { | ||
| 10956 | var n, s = ed.selection; | ||
| 10957 | |||
| 10958 | if (e.keyCode == 13 && s.getNode().nodeName != 'LI') { | ||
| 10959 | s.setContent('<br id="__" /> ', {format : 'raw'}); | ||
| 10960 | n = ed.dom.get('__'); | ||
| 10961 | n.removeAttribute('id'); | ||
| 10962 | s.select(n); | ||
| 10963 | s.collapse(); | ||
| 10964 | return Event.cancel(e); | ||
| 10965 | } | ||
| 10966 | }); | ||
| 10967 | } | ||
| 10968 | |||
| 10969 | return; | ||
| 10970 | } | ||
| 10971 | |||
| 10972 | if (!isIE && s.force_p_newlines) { | ||
| 10973 | /* ed.onPreProcess.add(function(ed, o) { | ||
| 10974 | each(ed.dom.select('br', o.node), function(n) { | ||
| 10975 | var p = n.parentNode; | ||
| 10976 | |||
| 10977 | // Replace <p><br /></p> with <p> </p> | ||
| 10978 | if (p && p.nodeName == 'p' && (p.childNodes.length == 1 || p.lastChild == n)) { | ||
| 10979 | p.replaceChild(ed.getDoc().createTextNode('\u00a0'), n); | ||
| 10980 | } | ||
| 10981 | }); | ||
| 10982 | });*/ | ||
| 10983 | |||
| 10984 | ed.onKeyPress.add(function(ed, e) { | ||
| 10985 | if (e.keyCode == 13 && !e.shiftKey) { | ||
| 10986 | if (!t.insertPara(e)) | ||
| 10987 | Event.cancel(e); | ||
| 10988 | } | ||
| 10989 | }); | ||
| 10990 | |||
| 10991 | if (isGecko) { | ||
| 10992 | ed.onKeyDown.add(function(ed, e) { | ||
| 10993 | if ((e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) | ||
| 10994 | t.backspaceDelete(e, e.keyCode == 8); | ||
| 10995 | }); | ||
| 10996 | } | ||
| 10997 | } | ||
| 10998 | |||
| 10999 | function ren(rn, na) { | ||
| 11000 | var ne = ed.dom.create(na); | ||
| 11001 | |||
| 11002 | each(rn.attributes, function(a) { | ||
| 11003 | if (a.specified && a.nodeValue) | ||
| 11004 | ne.setAttribute(a.nodeName.toLowerCase(), a.nodeValue); | ||
| 11005 | }); | ||
| 11006 | |||
| 11007 | each(rn.childNodes, function(n) { | ||
| 11008 | ne.appendChild(n.cloneNode(true)); | ||
| 11009 | }); | ||
| 11010 | |||
| 11011 | rn.parentNode.replaceChild(ne, rn); | ||
| 11012 | |||
| 11013 | return ne; | ||
| 11014 | }; | ||
| 11015 | |||
| 11016 | // Padd empty inline elements within block elements | ||
| 11017 | // For example: <p><strong><em></em></strong></p> becomes <p><strong><em> </em></strong></p> | ||
| 11018 | ed.onPreProcess.add(function(ed, o) { | ||
| 11019 | each(ed.dom.select('p,h1,h2,h3,h4,h5,h6,div', o.node), function(p) { | ||
| 11020 | if (isEmpty(p)) { | ||
| 11021 | each(ed.dom.select('span,em,strong,b,i', o.node), function(n) { | ||
| 11022 | if (!n.hasChildNodes()) { | ||
| 11023 | n.appendChild(ed.getDoc().createTextNode('\u00a0')); | ||
| 11024 | return false; // Break the loop one padding is enough | ||
| 11025 | } | ||
| 11026 | }); | ||
| 11027 | } | ||
| 11028 | }); | ||
| 11029 | }); | ||
| 11030 | |||
| 11031 | // IE specific fixes | ||
| 11032 | if (isIE) { | ||
| 11033 | // Replaces IE:s auto generated paragraphs with the specified element name | ||
| 11034 | if (s.element != 'P') { | ||
| 11035 | ed.onKeyPress.add(function(ed, e) { | ||
| 11036 | t.lastElm = ed.selection.getNode().nodeName; | ||
| 11037 | }); | ||
| 11038 | |||
| 11039 | ed.onKeyUp.add(function(ed, e) { | ||
| 11040 | var bl, sel = ed.selection, n = sel.getNode(), b = ed.getBody(); | ||
| 11041 | |||
| 11042 | if (b.childNodes.length === 1 && n.nodeName == 'P') { | ||
| 11043 | n = ren(n, s.element); | ||
| 11044 | sel.select(n); | ||
| 11045 | sel.collapse(); | ||
| 11046 | ed.nodeChanged(); | ||
| 11047 | } else if (e.keyCode == 13 && !e.shiftKey && t.lastElm != 'P') { | ||
| 11048 | bl = ed.dom.getParent(n, 'p'); | ||
| 11049 | |||
| 11050 | if (bl) { | ||
| 11051 | ren(bl, s.element); | ||
| 11052 | ed.nodeChanged(); | ||
| 11053 | } | ||
| 11054 | } | ||
| 11055 | }); | ||
| 11056 | } | ||
| 11057 | } | ||
| 11058 | }, | ||
| 11059 | |||
| 11060 | find : function(n, t, s) { | ||
| 11061 | var ed = this.editor, w = ed.getDoc().createTreeWalker(n, 4, null, false), c = -1; | ||
| 11062 | |||
| 11063 | while (n = w.nextNode()) { | ||
| 11064 | c++; | ||
| 11065 | |||
| 11066 | // Index by node | ||
| 11067 | if (t == 0 && n == s) | ||
| 11068 | return c; | ||
| 11069 | |||
| 11070 | // Node by index | ||
| 11071 | if (t == 1 && c == s) | ||
| 11072 | return n; | ||
| 11073 | } | ||
| 11074 | |||
| 11075 | return -1; | ||
| 11076 | }, | ||
| 11077 | |||
| 11078 | forceRoots : function(ed, e) { | ||
| 11079 | var t = this, ed = t.editor, b = ed.getBody(), d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng(), si = -2, ei, so, eo, tr, c = -0xFFFFFF; | ||
| 11080 | var nx, bl, bp, sp, le, nl = b.childNodes, i, n, eid; | ||
| 11081 | |||
| 11082 | // Fix for bug #1863847 | ||
| 11083 | //if (e && e.keyCode == 13) | ||
| 11084 | // return true; | ||
| 11085 | |||
| 11086 | // Wrap non blocks into blocks | ||
| 11087 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 11088 | nx = nl[i]; | ||
| 11089 | |||
| 11090 | // Is text or non block element | ||
| 11091 | if (nx.nodeType === 3 || (!t.dom.isBlock(nx) && nx.nodeType !== 8 && !/^(script|mce:script|style|mce:style)$/i.test(nx.nodeName))) { | ||
| 11092 | if (!bl) { | ||
| 11093 | // Create new block but ignore whitespace | ||
| 11094 | if (nx.nodeType != 3 || /[^\s]/g.test(nx.nodeValue)) { | ||
| 11095 | // Store selection | ||
| 11096 | if (si == -2 && r) { | ||
| 11097 | if (!isIE) { | ||
| 11098 | // If selection is element then mark it | ||
| 11099 | if (r.startContainer.nodeType == 1 && (n = r.startContainer.childNodes[r.startOffset]) && n.nodeType == 1) { | ||
| 11100 | // Save the id of the selected element | ||
| 11101 | eid = n.getAttribute("id"); | ||
| 11102 | n.setAttribute("id", "__mce"); | ||
| 11103 | } else { | ||
| 11104 | // If element is inside body, might not be the case in contentEdiable mode | ||
| 11105 | if (ed.dom.getParent(r.startContainer, function(e) {return e === b;})) { | ||
| 11106 | so = r.startOffset; | ||
| 11107 | eo = r.endOffset; | ||
| 11108 | si = t.find(b, 0, r.startContainer); | ||
| 11109 | ei = t.find(b, 0, r.endContainer); | ||
| 11110 | } | ||
| 11111 | } | ||
| 11112 | } else { | ||
| 11113 | tr = d.body.createTextRange(); | ||
| 11114 | tr.moveToElementText(b); | ||
| 11115 | tr.collapse(1); | ||
| 11116 | bp = tr.move('character', c) * -1; | ||
| 11117 | |||
| 11118 | tr = r.duplicate(); | ||
| 11119 | tr.collapse(1); | ||
| 11120 | sp = tr.move('character', c) * -1; | ||
| 11121 | |||
| 11122 | tr = r.duplicate(); | ||
| 11123 | tr.collapse(0); | ||
| 11124 | le = (tr.move('character', c) * -1) - sp; | ||
| 11125 | |||
| 11126 | si = sp - bp; | ||
| 11127 | ei = le; | ||
| 11128 | } | ||
| 11129 | } | ||
| 11130 | |||
| 11131 | // Uses replaceChild instead of cloneNode since it removes selected attribute from option elements on IE | ||
| 11132 | // See: http://support.microsoft.com/kb/829907 | ||
| 11133 | bl = ed.dom.create(ed.settings.forced_root_block); | ||
| 11134 | nx.parentNode.replaceChild(bl, nx); | ||
| 11135 | bl.appendChild(nx); | ||
| 11136 | } | ||
| 11137 | } else { | ||
| 11138 | if (bl.hasChildNodes()) | ||
| 11139 | bl.insertBefore(nx, bl.firstChild); | ||
| 11140 | else | ||
| 11141 | bl.appendChild(nx); | ||
| 11142 | } | ||
| 11143 | } else | ||
| 11144 | bl = null; // Time to create new block | ||
| 11145 | } | ||
| 11146 | |||
| 11147 | // Restore selection | ||
| 11148 | if (si != -2) { | ||
| 11149 | if (!isIE) { | ||
| 11150 | bl = b.getElementsByTagName(ed.settings.element)[0]; | ||
| 11151 | r = d.createRange(); | ||
| 11152 | |||
| 11153 | // Select last location or generated block | ||
| 11154 | if (si != -1) | ||
| 11155 | r.setStart(t.find(b, 1, si), so); | ||
| 11156 | else | ||
| 11157 | r.setStart(bl, 0); | ||
| 11158 | |||
| 11159 | // Select last location or generated block | ||
| 11160 | if (ei != -1) | ||
| 11161 | r.setEnd(t.find(b, 1, ei), eo); | ||
| 11162 | else | ||
| 11163 | r.setEnd(bl, 0); | ||
| 11164 | |||
| 11165 | if (s) { | ||
| 11166 | s.removeAllRanges(); | ||
| 11167 | s.addRange(r); | ||
| 11168 | } | ||
| 11169 | } else { | ||
| 11170 | try { | ||
| 11171 | r = s.createRange(); | ||
| 11172 | r.moveToElementText(b); | ||
| 11173 | r.collapse(1); | ||
| 11174 | r.moveStart('character', si); | ||
| 11175 | r.moveEnd('character', ei); | ||
| 11176 | r.select(); | ||
| 11177 | } catch (ex) { | ||
| 11178 | // Ignore | ||
| 11179 | } | ||
| 11180 | } | ||
| 11181 | } else if (!isIE && (n = ed.dom.get('__mce'))) { | ||
| 11182 | // Restore the id of the selected element | ||
| 11183 | if (eid) | ||
| 11184 | n.setAttribute('id', eid); | ||
| 11185 | else | ||
| 11186 | n.removeAttribute('id'); | ||
| 11187 | |||
| 11188 | // Move caret before selected element | ||
| 11189 | r = d.createRange(); | ||
| 11190 | r.setStartBefore(n); | ||
| 11191 | r.setEndBefore(n); | ||
| 11192 | se.setRng(r); | ||
| 11193 | } | ||
| 11194 | }, | ||
| 11195 | |||
| 11196 | getParentBlock : function(n) { | ||
| 11197 | var d = this.dom; | ||
| 11198 | |||
| 11199 | return d.getParent(n, d.isBlock); | ||
| 11200 | }, | ||
| 11201 | |||
| 11202 | insertPara : function(e) { | ||
| 11203 | var t = this, ed = t.editor, dom = ed.dom, d = ed.getDoc(), se = ed.settings, s = ed.selection.getSel(), r = s.getRangeAt(0), b = d.body; | ||
| 11204 | var rb, ra, dir, sn, so, en, eo, sb, eb, bn, bef, aft, sc, ec, n, vp = dom.getViewPort(ed.getWin()), y, ch, car; | ||
| 11205 | |||
| 11206 | // If root blocks are forced then use Operas default behavior since it's really good | ||
| 11207 | // Removed due to bug: #1853816 | ||
| 11208 | // if (se.forced_root_block && isOpera) | ||
| 11209 | // return true; | ||
| 11210 | |||
| 11211 | // Setup before range | ||
| 11212 | rb = d.createRange(); | ||
| 11213 | |||
| 11214 | // If is before the first block element and in body, then move it into first block element | ||
| 11215 | rb.setStart(s.anchorNode, s.anchorOffset); | ||
| 11216 | rb.collapse(true); | ||
| 11217 | |||
| 11218 | // Setup after range | ||
| 11219 | ra = d.createRange(); | ||
| 11220 | |||
| 11221 | // If is before the first block element and in body, then move it into first block element | ||
| 11222 | ra.setStart(s.focusNode, s.focusOffset); | ||
| 11223 | ra.collapse(true); | ||
| 11224 | |||
| 11225 | // Setup start/end points | ||
| 11226 | dir = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; | ||
| 11227 | sn = dir ? s.anchorNode : s.focusNode; | ||
| 11228 | so = dir ? s.anchorOffset : s.focusOffset; | ||
| 11229 | en = dir ? s.focusNode : s.anchorNode; | ||
| 11230 | eo = dir ? s.focusOffset : s.anchorOffset; | ||
| 11231 | |||
| 11232 | // If selection is in empty table cell | ||
| 11233 | if (sn === en && /^(TD|TH)$/.test(sn.nodeName)) { | ||
| 11234 | if (sn.firstChild.nodeName == 'BR') | ||
| 11235 | dom.remove(sn.firstChild); // Remove BR | ||
| 11236 | |||
| 11237 | // Create two new block elements | ||
| 11238 | if (sn.childNodes.length == 0) { | ||
| 11239 | ed.dom.add(sn, se.element, null, '<br />'); | ||
| 11240 | aft = ed.dom.add(sn, se.element, null, '<br />'); | ||
| 11241 | } else { | ||
| 11242 | n = sn.innerHTML; | ||
| 11243 | sn.innerHTML = ''; | ||
| 11244 | ed.dom.add(sn, se.element, null, n); | ||
| 11245 | aft = ed.dom.add(sn, se.element, null, '<br />'); | ||
| 11246 | } | ||
| 11247 | |||
| 11248 | // Move caret into the last one | ||
| 11249 | r = d.createRange(); | ||
| 11250 | r.selectNodeContents(aft); | ||
| 11251 | r.collapse(1); | ||
| 11252 | ed.selection.setRng(r); | ||
| 11253 | |||
| 11254 | return false; | ||
| 11255 | } | ||
| 11256 | |||
| 11257 | // If the caret is in an invalid location in FF we need to move it into the first block | ||
| 11258 | if (sn == b && en == b && b.firstChild && ed.dom.isBlock(b.firstChild)) { | ||
| 11259 | sn = en = sn.firstChild; | ||
| 11260 | so = eo = 0; | ||
| 11261 | rb = d.createRange(); | ||
| 11262 | rb.setStart(sn, 0); | ||
| 11263 | ra = d.createRange(); | ||
| 11264 | ra.setStart(en, 0); | ||
| 11265 | } | ||
| 11266 | |||
| 11267 | // Never use body as start or end node | ||
| 11268 | sn = sn.nodeName == "HTML" ? d.body : sn; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes | ||
| 11269 | sn = sn.nodeName == "BODY" ? sn.firstChild : sn; | ||
| 11270 | en = en.nodeName == "HTML" ? d.body : en; // Fix for Opera bug: https://bugs.opera.com/show_bug.cgi?id=273224&comments=yes | ||
| 11271 | en = en.nodeName == "BODY" ? en.firstChild : en; | ||
| 11272 | |||
| 11273 | // Get start and end blocks | ||
| 11274 | sb = t.getParentBlock(sn); | ||
| 11275 | eb = t.getParentBlock(en); | ||
| 11276 | bn = sb ? sb.nodeName : se.element; // Get block name to create | ||
| 11277 | |||
| 11278 | // Return inside list use default browser behavior | ||
| 11279 | if (t.dom.getParent(sb, 'ol,ul,pre')) | ||
| 11280 | return true; | ||
| 11281 | |||
| 11282 | // If caption or absolute layers then always generate new blocks within | ||
| 11283 | if (sb && (sb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { | ||
| 11284 | bn = se.element; | ||
| 11285 | sb = null; | ||
| 11286 | } | ||
| 11287 | |||
| 11288 | // If caption or absolute layers then always generate new blocks within | ||
| 11289 | if (eb && (eb.nodeName == 'CAPTION' || /absolute|relative|fixed/gi.test(dom.getStyle(sb, 'position', 1)))) { | ||
| 11290 | bn = se.element; | ||
| 11291 | eb = null; | ||
| 11292 | } | ||
| 11293 | |||
| 11294 | // Use P instead | ||
| 11295 | if (/(TD|TABLE|TH|CAPTION)/.test(bn) || (sb && bn == "DIV" && /left|right/gi.test(dom.getStyle(sb, 'float', 1)))) { | ||
| 11296 | bn = se.element; | ||
| 11297 | sb = eb = null; | ||
| 11298 | } | ||
| 11299 | |||
| 11300 | // Setup new before and after blocks | ||
| 11301 | bef = (sb && sb.nodeName == bn) ? sb.cloneNode(0) : ed.dom.create(bn); | ||
| 11302 | aft = (eb && eb.nodeName == bn) ? eb.cloneNode(0) : ed.dom.create(bn); | ||
| 11303 | |||
| 11304 | // Remove id from after clone | ||
| 11305 | aft.removeAttribute('id'); | ||
| 11306 | |||
| 11307 | // Is header and cursor is at the end, then force paragraph under | ||
| 11308 | if (/^(H[1-6])$/.test(bn) && isAtEnd(r, sb)) | ||
| 11309 | aft = ed.dom.create(se.element); | ||
| 11310 | |||
| 11311 | // Find start chop node | ||
| 11312 | n = sc = sn; | ||
| 11313 | do { | ||
| 11314 | if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) | ||
| 11315 | break; | ||
| 11316 | |||
| 11317 | sc = n; | ||
| 11318 | } while ((n = n.previousSibling ? n.previousSibling : n.parentNode)); | ||
| 11319 | |||
| 11320 | // Find end chop node | ||
| 11321 | n = ec = en; | ||
| 11322 | do { | ||
| 11323 | if (n == b || n.nodeType == 9 || t.dom.isBlock(n) || /(TD|TABLE|TH|CAPTION)/.test(n.nodeName)) | ||
| 11324 | break; | ||
| 11325 | |||
| 11326 | ec = n; | ||
| 11327 | } while ((n = n.nextSibling ? n.nextSibling : n.parentNode)); | ||
| 11328 | |||
| 11329 | // Place first chop part into before block element | ||
| 11330 | if (sc.nodeName == bn) | ||
| 11331 | rb.setStart(sc, 0); | ||
| 11332 | else | ||
| 11333 | rb.setStartBefore(sc); | ||
| 11334 | |||
| 11335 | rb.setEnd(sn, so); | ||
| 11336 | bef.appendChild(rb.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari | ||
| 11337 | |||
| 11338 | // Place secnd chop part within new block element | ||
| 11339 | try { | ||
| 11340 | ra.setEndAfter(ec); | ||
| 11341 | } catch(ex) { | ||
| 11342 | //console.debug(s.focusNode, s.focusOffset); | ||
| 11343 | } | ||
| 11344 | |||
| 11345 | ra.setStart(en, eo); | ||
| 11346 | aft.appendChild(ra.cloneContents() || d.createTextNode('')); // Empty text node needed for Safari | ||
| 11347 | |||
| 11348 | // Create range around everything | ||
| 11349 | r = d.createRange(); | ||
| 11350 | if (!sc.previousSibling && sc.parentNode.nodeName == bn) { | ||
| 11351 | r.setStartBefore(sc.parentNode); | ||
| 11352 | } else { | ||
| 11353 | if (rb.startContainer.nodeName == bn && rb.startOffset == 0) | ||
| 11354 | r.setStartBefore(rb.startContainer); | ||
| 11355 | else | ||
| 11356 | r.setStart(rb.startContainer, rb.startOffset); | ||
| 11357 | } | ||
| 11358 | |||
| 11359 | if (!ec.nextSibling && ec.parentNode.nodeName == bn) | ||
| 11360 | r.setEndAfter(ec.parentNode); | ||
| 11361 | else | ||
| 11362 | r.setEnd(ra.endContainer, ra.endOffset); | ||
| 11363 | |||
| 11364 | // Delete and replace it with new block elements | ||
| 11365 | r.deleteContents(); | ||
| 11366 | |||
| 11367 | if (isOpera) | ||
| 11368 | ed.getWin().scrollTo(0, vp.y); | ||
| 11369 | |||
| 11370 | // Never wrap blocks in blocks | ||
| 11371 | if (bef.firstChild && bef.firstChild.nodeName == bn) | ||
| 11372 | bef.innerHTML = bef.firstChild.innerHTML; | ||
| 11373 | |||
| 11374 | if (aft.firstChild && aft.firstChild.nodeName == bn) | ||
| 11375 | aft.innerHTML = aft.firstChild.innerHTML; | ||
| 11376 | |||
| 11377 | // Padd empty blocks | ||
| 11378 | if (isEmpty(bef)) | ||
| 11379 | bef.innerHTML = '<br />'; | ||
| 11380 | |||
| 11381 | function appendStyles(e, en) { | ||
| 11382 | var nl = [], nn, n, i; | ||
| 11383 | |||
| 11384 | e.innerHTML = ''; | ||
| 11385 | |||
| 11386 | // Make clones of style elements | ||
| 11387 | if (se.keep_styles) { | ||
| 11388 | n = en; | ||
| 11389 | do { | ||
| 11390 | // We only want style specific elements | ||
| 11391 | if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(n.nodeName)) { | ||
| 11392 | nn = n.cloneNode(false); | ||
| 11393 | dom.setAttrib(nn, 'id', ''); // Remove ID since it needs to be unique | ||
| 11394 | nl.push(nn); | ||
| 11395 | } | ||
| 11396 | } while (n = n.parentNode); | ||
| 11397 | } | ||
| 11398 | |||
| 11399 | // Append style elements to aft | ||
| 11400 | if (nl.length > 0) { | ||
| 11401 | for (i = nl.length - 1, nn = e; i >= 0; i--) | ||
| 11402 | nn = nn.appendChild(nl[i]); | ||
| 11403 | |||
| 11404 | // Padd most inner style element | ||
| 11405 | nl[0].innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there | ||
| 11406 | return nl[0]; // Move caret to most inner element | ||
| 11407 | } else | ||
| 11408 | e.innerHTML = isOpera ? ' ' : '<br />'; // Extra space for Opera so that the caret can move there | ||
| 11409 | }; | ||
| 11410 | |||
| 11411 | // Fill empty afterblook with current style | ||
| 11412 | if (isEmpty(aft)) | ||
| 11413 | car = appendStyles(aft, en); | ||
| 11414 | |||
| 11415 | // Opera needs this one backwards for older versions | ||
| 11416 | if (isOpera && parseFloat(opera.version()) < 9.5) { | ||
| 11417 | r.insertNode(bef); | ||
| 11418 | r.insertNode(aft); | ||
| 11419 | } else { | ||
| 11420 | r.insertNode(aft); | ||
| 11421 | r.insertNode(bef); | ||
| 11422 | } | ||
| 11423 | |||
| 11424 | // Normalize | ||
| 11425 | aft.normalize(); | ||
| 11426 | bef.normalize(); | ||
| 11427 | |||
| 11428 | function first(n) { | ||
| 11429 | return d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false).nextNode() || n; | ||
| 11430 | }; | ||
| 11431 | |||
| 11432 | // Move cursor and scroll into view | ||
| 11433 | r = d.createRange(); | ||
| 11434 | r.selectNodeContents(isGecko ? first(car || aft) : car || aft); | ||
| 11435 | r.collapse(1); | ||
| 11436 | s.removeAllRanges(); | ||
| 11437 | s.addRange(r); | ||
| 11438 | |||
| 11439 | // scrollIntoView seems to scroll the parent window in most browsers now including FF 3.0b4 so it's time to stop using it and do it our selfs | ||
| 11440 | y = ed.dom.getPos(aft).y; | ||
| 11441 | ch = aft.clientHeight; | ||
| 11442 | |||
| 11443 | // Is element within viewport | ||
| 11444 | if (y < vp.y || y + ch > vp.y + vp.h) { | ||
| 11445 | ed.getWin().scrollTo(0, y < vp.y ? y : y - vp.h + 25); // Needs to be hardcoded to roughly one line of text if a huge text block is broken into two blocks | ||
| 11446 | //console.debug('SCROLL!', 'vp.y: ' + vp.y, 'y' + y, 'vp.h' + vp.h, 'clientHeight' + aft.clientHeight, 'yyy: ' + (y < vp.y ? y : y - vp.h + aft.clientHeight)); | ||
| 11447 | } | ||
| 11448 | |||
| 11449 | return false; | ||
| 11450 | }, | ||
| 11451 | |||
| 11452 | backspaceDelete : function(e, bs) { | ||
| 11453 | var t = this, ed = t.editor, b = ed.getBody(), dom = ed.dom, n, se = ed.selection, r = se.getRng(), sc = r.startContainer, n, w, tn; | ||
| 11454 | |||
| 11455 | /* | ||
| 11456 | var par, rng, nextBlock; | ||
| 11457 | |||
| 11458 | // Delete key will not merge paragraphs on Gecko so we need to do this manually | ||
| 11459 | // Hitting the delete key at the following caret position doesn't merge the elements <p>A|</p><p>B</p> | ||
| 11460 | // This logic will merge them into this: <p>A|B</p> | ||
| 11461 | if (e.keyCode == 46) { | ||
| 11462 | if (r.collapsed) { | ||
| 11463 | par = dom.getParent(sc, 'p,h1,h2,h3,h4,h5,h6,div'); | ||
| 11464 | |||
| 11465 | if (par) { | ||
| 11466 | rng = dom.createRng(); | ||
| 11467 | |||
| 11468 | rng.setStart(sc, r.startOffset); | ||
| 11469 | rng.setEndAfter(par); | ||
| 11470 | |||
| 11471 | // Get number of characters to the right of the cursor if it's zero then we are at the end and need to merge the next block element | ||
| 11472 | if (dom.getOuterHTML(rng.cloneContents()).replace(/<[^>]+>/g, '').length == 0) { | ||
| 11473 | nextBlock = dom.getNext(par, 'p,h1,h2,h3,h4,h5,h6,div'); | ||
| 11474 | |||
| 11475 | // Copy all children from next sibling block and remove it | ||
| 11476 | if (nextBlock) { | ||
| 11477 | each(nextBlock.childNodes, function(node) { | ||
| 11478 | par.appendChild(node.cloneNode(true)); | ||
| 11479 | }); | ||
| 11480 | |||
| 11481 | dom.remove(nextBlock); | ||
| 11482 | } | ||
| 11483 | |||
| 11484 | // Block the default even since the Gecko team might eventually fix this | ||
| 11485 | // We will remove this logic once they do we can't feature detect this one | ||
| 11486 | e.preventDefault(); | ||
| 11487 | return; | ||
| 11488 | } | ||
| 11489 | } | ||
| 11490 | } | ||
| 11491 | } | ||
| 11492 | */ | ||
| 11493 | |||
| 11494 | // The caret sometimes gets stuck in Gecko if you delete empty paragraphs | ||
| 11495 | // This workaround removes the element by hand and moves the caret to the previous element | ||
| 11496 | if (sc && ed.dom.isBlock(sc) && !/^(TD|TH)$/.test(sc.nodeName) && bs) { | ||
| 11497 | if (sc.childNodes.length == 0 || (sc.childNodes.length == 1 && sc.firstChild.nodeName == 'BR')) { | ||
| 11498 | // Find previous block element | ||
| 11499 | n = sc; | ||
| 11500 | while ((n = n.previousSibling) && !ed.dom.isBlock(n)) ; | ||
| 11501 | |||
| 11502 | if (n) { | ||
| 11503 | if (sc != b.firstChild) { | ||
| 11504 | // Find last text node | ||
| 11505 | w = ed.dom.doc.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); | ||
| 11506 | while (tn = w.nextNode()) | ||
| 11507 | n = tn; | ||
| 11508 | |||
| 11509 | // Place caret at the end of last text node | ||
| 11510 | r = ed.getDoc().createRange(); | ||
| 11511 | r.setStart(n, n.nodeValue ? n.nodeValue.length : 0); | ||
| 11512 | r.setEnd(n, n.nodeValue ? n.nodeValue.length : 0); | ||
| 11513 | se.setRng(r); | ||
| 11514 | |||
| 11515 | // Remove the target container | ||
| 11516 | ed.dom.remove(sc); | ||
| 11517 | } | ||
| 11518 | |||
| 11519 | return Event.cancel(e); | ||
| 11520 | } | ||
| 11521 | } | ||
| 11522 | } | ||
| 11523 | |||
| 11524 | // Gecko generates BR elements here and there, we don't like those so lets remove them | ||
| 11525 | function handler(e) { | ||
| 11526 | var pr; | ||
| 11527 | |||
| 11528 | e = e.target; | ||
| 11529 | |||
| 11530 | // A new BR was created in a block element, remove it | ||
| 11531 | if (e && e.parentNode && e.nodeName == 'BR' && (n = t.getParentBlock(e))) { | ||
| 11532 | pr = e.previousSibling; | ||
| 11533 | |||
| 11534 | Event.remove(b, 'DOMNodeInserted', handler); | ||
| 11535 | |||
| 11536 | // Is there whitespace at the end of the node before then we might need the pesky BR | ||
| 11537 | // to place the caret at a correct location see bug: #2013943 | ||
| 11538 | if (pr && pr.nodeType == 3 && /\s+$/.test(pr.nodeValue)) | ||
| 11539 | return; | ||
| 11540 | |||
| 11541 | // Only remove BR elements that got inserted in the middle of the text | ||
| 11542 | if (e.previousSibling || e.nextSibling) | ||
| 11543 | ed.dom.remove(e); | ||
| 11544 | } | ||
| 11545 | }; | ||
| 11546 | |||
| 11547 | // Listen for new nodes | ||
| 11548 | Event._add(b, 'DOMNodeInserted', handler); | ||
| 11549 | |||
| 11550 | // Remove listener | ||
| 11551 | window.setTimeout(function() { | ||
| 11552 | Event._remove(b, 'DOMNodeInserted', handler); | ||
| 11553 | }, 1); | ||
| 11554 | } | ||
| 11555 | }); | ||
| 11556 | })(tinymce); | ||
| 11557 | (function(tinymce) { | ||
| 11558 | // Shorten names | ||
| 11559 | var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, extend = tinymce.extend; | ||
| 11560 | |||
| 11561 | tinymce.create('tinymce.ControlManager', { | ||
| 11562 | ControlManager : function(ed, s) { | ||
| 11563 | var t = this, i; | ||
| 11564 | |||
| 11565 | s = s || {}; | ||
| 11566 | t.editor = ed; | ||
| 11567 | t.controls = {}; | ||
| 11568 | t.onAdd = new tinymce.util.Dispatcher(t); | ||
| 11569 | t.onPostRender = new tinymce.util.Dispatcher(t); | ||
| 11570 | t.prefix = s.prefix || ed.id + '_'; | ||
| 11571 | t._cls = {}; | ||
| 11572 | |||
| 11573 | t.onPostRender.add(function() { | ||
| 11574 | each(t.controls, function(c) { | ||
| 11575 | c.postRender(); | ||
| 11576 | }); | ||
| 11577 | }); | ||
| 11578 | }, | ||
| 11579 | |||
| 11580 | get : function(id) { | ||
| 11581 | return this.controls[this.prefix + id] || this.controls[id]; | ||
| 11582 | }, | ||
| 11583 | |||
| 11584 | setActive : function(id, s) { | ||
| 11585 | var c = null; | ||
| 11586 | |||
| 11587 | if (c = this.get(id)) | ||
| 11588 | c.setActive(s); | ||
| 11589 | |||
| 11590 | return c; | ||
| 11591 | }, | ||
| 11592 | |||
| 11593 | setDisabled : function(id, s) { | ||
| 11594 | var c = null; | ||
| 11595 | |||
| 11596 | if (c = this.get(id)) | ||
| 11597 | c.setDisabled(s); | ||
| 11598 | |||
| 11599 | return c; | ||
| 11600 | }, | ||
| 11601 | |||
| 11602 | add : function(c) { | ||
| 11603 | var t = this; | ||
| 11604 | |||
| 11605 | if (c) { | ||
| 11606 | t.controls[c.id] = c; | ||
| 11607 | t.onAdd.dispatch(c, t); | ||
| 11608 | } | ||
| 11609 | |||
| 11610 | return c; | ||
| 11611 | }, | ||
| 11612 | |||
| 11613 | createControl : function(n) { | ||
| 11614 | var c, t = this, ed = t.editor; | ||
| 11615 | |||
| 11616 | each(ed.plugins, function(p) { | ||
| 11617 | if (p.createControl) { | ||
| 11618 | c = p.createControl(n, t); | ||
| 11619 | |||
| 11620 | if (c) | ||
| 11621 | return false; | ||
| 11622 | } | ||
| 11623 | }); | ||
| 11624 | |||
| 11625 | switch (n) { | ||
| 11626 | case "|": | ||
| 11627 | case "separator": | ||
| 11628 | return t.createSeparator(); | ||
| 11629 | } | ||
| 11630 | |||
| 11631 | if (!c && ed.buttons && (c = ed.buttons[n])) | ||
| 11632 | return t.createButton(n, c); | ||
| 11633 | |||
| 11634 | return t.add(c); | ||
| 11635 | }, | ||
| 11636 | |||
| 11637 | createDropMenu : function(id, s, cc) { | ||
| 11638 | var t = this, ed = t.editor, c, bm, v, cls; | ||
| 11639 | |||
| 11640 | s = extend({ | ||
| 11641 | 'class' : 'mceDropDown', | ||
| 11642 | constrain : ed.settings.constrain_menus | ||
| 11643 | }, s); | ||
| 11644 | |||
| 11645 | s['class'] = s['class'] + ' ' + ed.getParam('skin') + 'Skin'; | ||
| 11646 | if (v = ed.getParam('skin_variant')) | ||
| 11647 | s['class'] += ' ' + ed.getParam('skin') + 'Skin' + v.substring(0, 1).toUpperCase() + v.substring(1); | ||
| 11648 | |||
| 11649 | id = t.prefix + id; | ||
| 11650 | cls = cc || t._cls.dropmenu || tinymce.ui.DropMenu; | ||
| 11651 | c = t.controls[id] = new cls(id, s); | ||
| 11652 | c.onAddItem.add(function(c, o) { | ||
| 11653 | var s = o.settings; | ||
| 11654 | |||
| 11655 | s.title = ed.getLang(s.title, s.title); | ||
| 11656 | |||
| 11657 | if (!s.onclick) { | ||
| 11658 | s.onclick = function(v) { | ||
| 11659 | ed.execCommand(s.cmd, s.ui || false, s.value); | ||
| 11660 | }; | ||
| 11661 | } | ||
| 11662 | }); | ||
| 11663 | |||
| 11664 | ed.onRemove.add(function() { | ||
| 11665 | c.destroy(); | ||
| 11666 | }); | ||
| 11667 | |||
| 11668 | // Fix for bug #1897785, #1898007 | ||
| 11669 | if (tinymce.isIE) { | ||
| 11670 | c.onShowMenu.add(function() { | ||
| 11671 | // IE 8 needs focus in order to store away a range with the current collapsed caret location | ||
| 11672 | ed.focus(); | ||
| 11673 | |||
| 11674 | bm = ed.selection.getBookmark(1); | ||
| 11675 | }); | ||
| 11676 | |||
| 11677 | c.onHideMenu.add(function() { | ||
| 11678 | if (bm) { | ||
| 11679 | ed.selection.moveToBookmark(bm); | ||
| 11680 | bm = 0; | ||
| 11681 | } | ||
| 11682 | }); | ||
| 11683 | } | ||
| 11684 | |||
| 11685 | return t.add(c); | ||
| 11686 | }, | ||
| 11687 | |||
| 11688 | createListBox : function(id, s, cc) { | ||
| 11689 | var t = this, ed = t.editor, cmd, c, cls; | ||
| 11690 | |||
| 11691 | if (t.get(id)) | ||
| 11692 | return null; | ||
| 11693 | |||
| 11694 | s.title = ed.translate(s.title); | ||
| 11695 | s.scope = s.scope || ed; | ||
| 11696 | |||
| 11697 | if (!s.onselect) { | ||
| 11698 | s.onselect = function(v) { | ||
| 11699 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 11700 | }; | ||
| 11701 | } | ||
| 11702 | |||
| 11703 | s = extend({ | ||
| 11704 | title : s.title, | ||
| 11705 | 'class' : 'mce_' + id, | ||
| 11706 | scope : s.scope, | ||
| 11707 | control_manager : t | ||
| 11708 | }, s); | ||
| 11709 | |||
| 11710 | id = t.prefix + id; | ||
| 11711 | |||
| 11712 | if (ed.settings.use_native_selects) | ||
| 11713 | c = new tinymce.ui.NativeListBox(id, s); | ||
| 11714 | else { | ||
| 11715 | cls = cc || t._cls.listbox || tinymce.ui.ListBox; | ||
| 11716 | c = new cls(id, s); | ||
| 11717 | } | ||
| 11718 | |||
| 11719 | t.controls[id] = c; | ||
| 11720 | |||
| 11721 | // Fix focus problem in Safari | ||
| 11722 | if (tinymce.isWebKit) { | ||
| 11723 | c.onPostRender.add(function(c, n) { | ||
| 11724 | // Store bookmark on mousedown | ||
| 11725 | Event.add(n, 'mousedown', function() { | ||
| 11726 | ed.bookmark = ed.selection.getBookmark(1); | ||
| 11727 | }); | ||
| 11728 | |||
| 11729 | // Restore on focus, since it might be lost | ||
| 11730 | Event.add(n, 'focus', function() { | ||
| 11731 | ed.selection.moveToBookmark(ed.bookmark); | ||
| 11732 | ed.bookmark = null; | ||
| 11733 | }); | ||
| 11734 | }); | ||
| 11735 | } | ||
| 11736 | |||
| 11737 | if (c.hideMenu) | ||
| 11738 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 11739 | |||
| 11740 | return t.add(c); | ||
| 11741 | }, | ||
| 11742 | |||
| 11743 | createButton : function(id, s, cc) { | ||
| 11744 | var t = this, ed = t.editor, o, c, cls; | ||
| 11745 | |||
| 11746 | if (t.get(id)) | ||
| 11747 | return null; | ||
| 11748 | |||
| 11749 | s.title = ed.translate(s.title); | ||
| 11750 | s.label = ed.translate(s.label); | ||
| 11751 | s.scope = s.scope || ed; | ||
| 11752 | |||
| 11753 | if (!s.onclick && !s.menu_button) { | ||
| 11754 | s.onclick = function() { | ||
| 11755 | ed.execCommand(s.cmd, s.ui || false, s.value); | ||
| 11756 | }; | ||
| 11757 | } | ||
| 11758 | |||
| 11759 | s = extend({ | ||
| 11760 | title : s.title, | ||
| 11761 | 'class' : 'mce_' + id, | ||
| 11762 | unavailable_prefix : ed.getLang('unavailable', ''), | ||
| 11763 | scope : s.scope, | ||
| 11764 | control_manager : t | ||
| 11765 | }, s); | ||
| 11766 | |||
| 11767 | id = t.prefix + id; | ||
| 11768 | |||
| 11769 | if (s.menu_button) { | ||
| 11770 | cls = cc || t._cls.menubutton || tinymce.ui.MenuButton; | ||
| 11771 | c = new cls(id, s); | ||
| 11772 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 11773 | } else { | ||
| 11774 | cls = t._cls.button || tinymce.ui.Button; | ||
| 11775 | c = new cls(id, s); | ||
| 11776 | } | ||
| 11777 | |||
| 11778 | return t.add(c); | ||
| 11779 | }, | ||
| 11780 | |||
| 11781 | createMenuButton : function(id, s, cc) { | ||
| 11782 | s = s || {}; | ||
| 11783 | s.menu_button = 1; | ||
| 11784 | |||
| 11785 | return this.createButton(id, s, cc); | ||
| 11786 | }, | ||
| 11787 | |||
| 11788 | createSplitButton : function(id, s, cc) { | ||
| 11789 | var t = this, ed = t.editor, cmd, c, cls; | ||
| 11790 | |||
| 11791 | if (t.get(id)) | ||
| 11792 | return null; | ||
| 11793 | |||
| 11794 | s.title = ed.translate(s.title); | ||
| 11795 | s.scope = s.scope || ed; | ||
| 11796 | |||
| 11797 | if (!s.onclick) { | ||
| 11798 | s.onclick = function(v) { | ||
| 11799 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 11800 | }; | ||
| 11801 | } | ||
| 11802 | |||
| 11803 | if (!s.onselect) { | ||
| 11804 | s.onselect = function(v) { | ||
| 11805 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 11806 | }; | ||
| 11807 | } | ||
| 11808 | |||
| 11809 | s = extend({ | ||
| 11810 | title : s.title, | ||
| 11811 | 'class' : 'mce_' + id, | ||
| 11812 | scope : s.scope, | ||
| 11813 | control_manager : t | ||
| 11814 | }, s); | ||
| 11815 | |||
| 11816 | id = t.prefix + id; | ||
| 11817 | cls = cc || t._cls.splitbutton || tinymce.ui.SplitButton; | ||
| 11818 | c = t.add(new cls(id, s)); | ||
| 11819 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 11820 | |||
| 11821 | return c; | ||
| 11822 | }, | ||
| 11823 | |||
| 11824 | createColorSplitButton : function(id, s, cc) { | ||
| 11825 | var t = this, ed = t.editor, cmd, c, cls, bm; | ||
| 11826 | |||
| 11827 | if (t.get(id)) | ||
| 11828 | return null; | ||
| 11829 | |||
| 11830 | s.title = ed.translate(s.title); | ||
| 11831 | s.scope = s.scope || ed; | ||
| 11832 | |||
| 11833 | if (!s.onclick) { | ||
| 11834 | s.onclick = function(v) { | ||
| 11835 | if (tinymce.isIE) | ||
| 11836 | bm = ed.selection.getBookmark(1); | ||
| 11837 | |||
| 11838 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 11839 | }; | ||
| 11840 | } | ||
| 11841 | |||
| 11842 | if (!s.onselect) { | ||
| 11843 | s.onselect = function(v) { | ||
| 11844 | ed.execCommand(s.cmd, s.ui || false, v || s.value); | ||
| 11845 | }; | ||
| 11846 | } | ||
| 11847 | |||
| 11848 | s = extend({ | ||
| 11849 | title : s.title, | ||
| 11850 | 'class' : 'mce_' + id, | ||
| 11851 | 'menu_class' : ed.getParam('skin') + 'Skin', | ||
| 11852 | scope : s.scope, | ||
| 11853 | more_colors_title : ed.getLang('more_colors') | ||
| 11854 | }, s); | ||
| 11855 | |||
| 11856 | id = t.prefix + id; | ||
| 11857 | cls = cc || t._cls.colorsplitbutton || tinymce.ui.ColorSplitButton; | ||
| 11858 | c = new cls(id, s); | ||
| 11859 | ed.onMouseDown.add(c.hideMenu, c); | ||
| 11860 | |||
| 11861 | // Remove the menu element when the editor is removed | ||
| 11862 | ed.onRemove.add(function() { | ||
| 11863 | c.destroy(); | ||
| 11864 | }); | ||
| 11865 | |||
| 11866 | // Fix for bug #1897785, #1898007 | ||
| 11867 | if (tinymce.isIE) { | ||
| 11868 | c.onShowMenu.add(function() { | ||
| 11869 | // IE 8 needs focus in order to store away a range with the current collapsed caret location | ||
| 11870 | ed.focus(); | ||
| 11871 | bm = ed.selection.getBookmark(1); | ||
| 11872 | }); | ||
| 11873 | |||
| 11874 | c.onHideMenu.add(function() { | ||
| 11875 | if (bm) { | ||
| 11876 | ed.selection.moveToBookmark(bm); | ||
| 11877 | bm = 0; | ||
| 11878 | } | ||
| 11879 | }); | ||
| 11880 | } | ||
| 11881 | |||
| 11882 | return t.add(c); | ||
| 11883 | }, | ||
| 11884 | |||
| 11885 | createToolbar : function(id, s, cc) { | ||
| 11886 | var c, t = this, cls; | ||
| 11887 | |||
| 11888 | id = t.prefix + id; | ||
| 11889 | cls = cc || t._cls.toolbar || tinymce.ui.Toolbar; | ||
| 11890 | c = new cls(id, s); | ||
| 11891 | |||
| 11892 | if (t.get(id)) | ||
| 11893 | return null; | ||
| 11894 | |||
| 11895 | return t.add(c); | ||
| 11896 | }, | ||
| 11897 | |||
| 11898 | createSeparator : function(cc) { | ||
| 11899 | var cls = cc || this._cls.separator || tinymce.ui.Separator; | ||
| 11900 | |||
| 11901 | return new cls(); | ||
| 11902 | }, | ||
| 11903 | |||
| 11904 | setControlType : function(n, c) { | ||
| 11905 | return this._cls[n.toLowerCase()] = c; | ||
| 11906 | }, | ||
| 11907 | |||
| 11908 | destroy : function() { | ||
| 11909 | each(this.controls, function(c) { | ||
| 11910 | c.destroy(); | ||
| 11911 | }); | ||
| 11912 | |||
| 11913 | this.controls = null; | ||
| 11914 | } | ||
| 11915 | }); | ||
| 11916 | })(tinymce); | ||
| 11917 | (function(tinymce) { | ||
| 11918 | var Dispatcher = tinymce.util.Dispatcher, each = tinymce.each, isIE = tinymce.isIE, isOpera = tinymce.isOpera; | ||
| 11919 | |||
| 11920 | tinymce.create('tinymce.WindowManager', { | ||
| 11921 | WindowManager : function(ed) { | ||
| 11922 | var t = this; | ||
| 11923 | |||
| 11924 | t.editor = ed; | ||
| 11925 | t.onOpen = new Dispatcher(t); | ||
| 11926 | t.onClose = new Dispatcher(t); | ||
| 11927 | t.params = {}; | ||
| 11928 | t.features = {}; | ||
| 11929 | }, | ||
| 11930 | |||
| 11931 | open : function(s, p) { | ||
| 11932 | var t = this, f = '', x, y, mo = t.editor.settings.dialog_type == 'modal', w, sw, sh, vp = tinymce.DOM.getViewPort(), u; | ||
| 11933 | |||
| 11934 | // Default some options | ||
| 11935 | s = s || {}; | ||
| 11936 | p = p || {}; | ||
| 11937 | sw = isOpera ? vp.w : screen.width; // Opera uses windows inside the Opera window | ||
| 11938 | sh = isOpera ? vp.h : screen.height; | ||
| 11939 | s.name = s.name || 'mc_' + new Date().getTime(); | ||
| 11940 | s.width = parseInt(s.width || 320); | ||
| 11941 | s.height = parseInt(s.height || 240); | ||
| 11942 | s.resizable = true; | ||
| 11943 | s.left = s.left || parseInt(sw / 2.0) - (s.width / 2.0); | ||
| 11944 | s.top = s.top || parseInt(sh / 2.0) - (s.height / 2.0); | ||
| 11945 | p.inline = false; | ||
| 11946 | p.mce_width = s.width; | ||
| 11947 | p.mce_height = s.height; | ||
| 11948 | p.mce_auto_focus = s.auto_focus; | ||
| 11949 | |||
| 11950 | if (mo) { | ||
| 11951 | if (isIE) { | ||
| 11952 | s.center = true; | ||
| 11953 | s.help = false; | ||
| 11954 | s.dialogWidth = s.width + 'px'; | ||
| 11955 | s.dialogHeight = s.height + 'px'; | ||
| 11956 | s.scroll = s.scrollbars || false; | ||
| 11957 | } | ||
| 11958 | } | ||
| 11959 | |||
| 11960 | // Build features string | ||
| 11961 | each(s, function(v, k) { | ||
| 11962 | if (tinymce.is(v, 'boolean')) | ||
| 11963 | v = v ? 'yes' : 'no'; | ||
| 11964 | |||
| 11965 | if (!/^(name|url)$/.test(k)) { | ||
| 11966 | if (isIE && mo) | ||
| 11967 | f += (f ? ';' : '') + k + ':' + v; | ||
| 11968 | else | ||
| 11969 | f += (f ? ',' : '') + k + '=' + v; | ||
| 11970 | } | ||
| 11971 | }); | ||
| 11972 | |||
| 11973 | t.features = s; | ||
| 11974 | t.params = p; | ||
| 11975 | t.onOpen.dispatch(t, s, p); | ||
| 11976 | |||
| 11977 | u = s.url || s.file; | ||
| 11978 | u = tinymce._addVer(u); | ||
| 11979 | |||
| 11980 | try { | ||
| 11981 | if (isIE && mo) { | ||
| 11982 | w = 1; | ||
| 11983 | window.showModalDialog(u, window, f); | ||
| 11984 | } else | ||
| 11985 | w = window.open(u, s.name, f); | ||
| 11986 | } catch (ex) { | ||
| 11987 | // Ignore | ||
| 11988 | } | ||
| 11989 | |||
| 11990 | if (!w) | ||
| 11991 | alert(t.editor.getLang('popup_blocked')); | ||
| 11992 | }, | ||
| 11993 | |||
| 11994 | close : function(w) { | ||
| 11995 | w.close(); | ||
| 11996 | this.onClose.dispatch(this); | ||
| 11997 | }, | ||
| 11998 | |||
| 11999 | createInstance : function(cl, a, b, c, d, e) { | ||
| 12000 | var f = tinymce.resolve(cl); | ||
| 12001 | |||
| 12002 | return new f(a, b, c, d, e); | ||
| 12003 | }, | ||
| 12004 | |||
| 12005 | confirm : function(t, cb, s, w) { | ||
| 12006 | w = w || window; | ||
| 12007 | |||
| 12008 | cb.call(s || this, w.confirm(this._decode(this.editor.getLang(t, t)))); | ||
| 12009 | }, | ||
| 12010 | |||
| 12011 | alert : function(tx, cb, s, w) { | ||
| 12012 | var t = this; | ||
| 12013 | |||
| 12014 | w = w || window; | ||
| 12015 | w.alert(t._decode(t.editor.getLang(tx, tx))); | ||
| 12016 | |||
| 12017 | if (cb) | ||
| 12018 | cb.call(s || t); | ||
| 12019 | }, | ||
| 12020 | |||
| 12021 | // Internal functions | ||
| 12022 | |||
| 12023 | _decode : function(s) { | ||
| 12024 | return tinymce.DOM.decode(s).replace(/\\n/g, '\n'); | ||
| 12025 | } | ||
| 12026 | }); | ||
| 12027 | }(tinymce));(function(tinymce) { | ||
| 12028 | tinymce.CommandManager = function() { | ||
| 12029 | var execCommands = {}, queryStateCommands = {}, queryValueCommands = {}; | ||
| 12030 | |||
| 12031 | function add(collection, cmd, func, scope) { | ||
| 12032 | if (typeof(cmd) == 'string') | ||
| 12033 | cmd = [cmd]; | ||
| 12034 | |||
| 12035 | tinymce.each(cmd, function(cmd) { | ||
| 12036 | collection[cmd.toLowerCase()] = {func : func, scope : scope}; | ||
| 12037 | }); | ||
| 12038 | }; | ||
| 12039 | |||
| 12040 | tinymce.extend(this, { | ||
| 12041 | add : function(cmd, func, scope) { | ||
| 12042 | add(execCommands, cmd, func, scope); | ||
| 12043 | }, | ||
| 12044 | |||
| 12045 | addQueryStateHandler : function(cmd, func, scope) { | ||
| 12046 | add(queryStateCommands, cmd, func, scope); | ||
| 12047 | }, | ||
| 12048 | |||
| 12049 | addQueryValueHandler : function(cmd, func, scope) { | ||
| 12050 | add(queryValueCommands, cmd, func, scope); | ||
| 12051 | }, | ||
| 12052 | |||
| 12053 | execCommand : function(scope, cmd, ui, value, args) { | ||
| 12054 | if (cmd = execCommands[cmd.toLowerCase()]) { | ||
| 12055 | if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false) | ||
| 12056 | return true; | ||
| 12057 | } | ||
| 12058 | }, | ||
| 12059 | |||
| 12060 | queryCommandValue : function() { | ||
| 12061 | if (cmd = queryValueCommands[cmd.toLowerCase()]) | ||
| 12062 | return cmd.func.call(scope || cmd.scope, ui, value, args); | ||
| 12063 | }, | ||
| 12064 | |||
| 12065 | queryCommandState : function() { | ||
| 12066 | if (cmd = queryStateCommands[cmd.toLowerCase()]) | ||
| 12067 | return cmd.func.call(scope || cmd.scope, ui, value, args); | ||
| 12068 | } | ||
| 12069 | }); | ||
| 12070 | }; | ||
| 12071 | |||
| 12072 | tinymce.GlobalCommands = new tinymce.CommandManager(); | ||
| 12073 | })(tinymce);(function(tinymce) { | ||
| 12074 | function processRange(dom, start, end, callback) { | ||
| 12075 | var ancestor, n, startPoint, endPoint, sib; | ||
| 12076 | |||
| 12077 | function findEndPoint(n, c) { | ||
| 12078 | do { | ||
| 12079 | if (n.parentNode == c) | ||
| 12080 | return n; | ||
| 12081 | |||
| 12082 | n = n.parentNode; | ||
| 12083 | } while(n); | ||
| 12084 | }; | ||
| 12085 | |||
| 12086 | function process(n) { | ||
| 12087 | callback(n); | ||
| 12088 | tinymce.walk(n, callback, 'childNodes'); | ||
| 12089 | }; | ||
| 12090 | |||
| 12091 | // Find common ancestor and end points | ||
| 12092 | ancestor = dom.findCommonAncestor(start, end); | ||
| 12093 | startPoint = findEndPoint(start, ancestor) || start; | ||
| 12094 | endPoint = findEndPoint(end, ancestor) || end; | ||
| 12095 | |||
| 12096 | // Process left leaf | ||
| 12097 | for (n = start; n && n != startPoint; n = n.parentNode) { | ||
| 12098 | for (sib = n.nextSibling; sib; sib = sib.nextSibling) | ||
| 12099 | process(sib); | ||
| 12100 | } | ||
| 12101 | |||
| 12102 | // Process middle from start to end point | ||
| 12103 | if (startPoint != endPoint) { | ||
| 12104 | for (n = startPoint.nextSibling; n && n != endPoint; n = n.nextSibling) | ||
| 12105 | process(n); | ||
| 12106 | } else | ||
| 12107 | process(startPoint); | ||
| 12108 | |||
| 12109 | // Process right leaf | ||
| 12110 | for (n = end; n && n != endPoint; n = n.parentNode) { | ||
| 12111 | for (sib = n.previousSibling; sib; sib = sib.previousSibling) | ||
| 12112 | process(sib); | ||
| 12113 | } | ||
| 12114 | }; | ||
| 12115 | |||
| 12116 | tinymce.GlobalCommands.add('RemoveFormat', function() { | ||
| 12117 | var ed = this, dom = ed.dom, s = ed.selection, r = s.getRng(1), nodes = [], bm, start, end, sc, so, ec, eo, n; | ||
| 12118 | |||
| 12119 | function findFormatRoot(n) { | ||
| 12120 | var sp; | ||
| 12121 | |||
| 12122 | dom.getParent(n, function(n) { | ||
| 12123 | if (dom.is(n, ed.getParam('removeformat_selector'))) | ||
| 12124 | sp = n; | ||
| 12125 | |||
| 12126 | return dom.isBlock(n); | ||
| 12127 | }, ed.getBody()); | ||
| 12128 | |||
| 12129 | return sp; | ||
| 12130 | }; | ||
| 12131 | |||
| 12132 | function collect(n) { | ||
| 12133 | if (dom.is(n, ed.getParam('removeformat_selector'))) | ||
| 12134 | nodes.push(n); | ||
| 12135 | }; | ||
| 12136 | |||
| 12137 | function walk(n) { | ||
| 12138 | collect(n); | ||
| 12139 | tinymce.walk(n, collect, 'childNodes'); | ||
| 12140 | }; | ||
| 12141 | |||
| 12142 | bm = s.getBookmark(); | ||
| 12143 | sc = r.startContainer; | ||
| 12144 | ec = r.endContainer; | ||
| 12145 | so = r.startOffset; | ||
| 12146 | eo = r.endOffset; | ||
| 12147 | sc = sc.nodeType == 1 ? sc.childNodes[Math.min(so, sc.childNodes.length - 1)] : sc; | ||
| 12148 | ec = ec.nodeType == 1 ? ec.childNodes[Math.min(so == eo ? eo : eo - 1, ec.childNodes.length - 1)] : ec; | ||
| 12149 | |||
| 12150 | // Same container | ||
| 12151 | if (sc == ec) { // TEXT_NODE | ||
| 12152 | start = findFormatRoot(sc); | ||
| 12153 | |||
| 12154 | // Handle single text node | ||
| 12155 | if (sc.nodeType == 3) { | ||
| 12156 | if (start && start.nodeType == 1) { // ELEMENT | ||
| 12157 | n = sc.splitText(so); | ||
| 12158 | n.splitText(eo - so); | ||
| 12159 | dom.split(start, n); | ||
| 12160 | |||
| 12161 | s.moveToBookmark(bm); | ||
| 12162 | } | ||
| 12163 | |||
| 12164 | return; | ||
| 12165 | } | ||
| 12166 | |||
| 12167 | // Handle single element | ||
| 12168 | walk(dom.split(start, sc) || sc); | ||
| 12169 | } else { | ||
| 12170 | // Find start/end format root | ||
| 12171 | start = findFormatRoot(sc); | ||
| 12172 | end = findFormatRoot(ec); | ||
| 12173 | |||
| 12174 | // Split start text node | ||
| 12175 | if (start) { | ||
| 12176 | if (sc.nodeType == 3) { // TEXT | ||
| 12177 | // Since IE doesn't support white space nodes in the DOM we need to | ||
| 12178 | // add this invisible character so that the splitText function can split the contents | ||
| 12179 | if (so == sc.nodeValue.length) | ||
| 12180 | sc.nodeValue += '\uFEFF'; // Yet another pesky IE fix | ||
| 12181 | |||
| 12182 | sc = sc.splitText(so); | ||
| 12183 | } | ||
| 12184 | } | ||
| 12185 | |||
| 12186 | // Split end text node | ||
| 12187 | if (end) { | ||
| 12188 | if (ec.nodeType == 3) // TEXT | ||
| 12189 | ec.splitText(eo); | ||
| 12190 | } | ||
| 12191 | |||
| 12192 | // If the start and end format root is the same then we need to wrap | ||
| 12193 | // the end node in a span since the split calls might change the reference | ||
| 12194 | // Example: <p><b><em>x[yz<span>---</span>12]3</em></b></p> | ||
| 12195 | if (start && start == end) | ||
| 12196 | dom.replace(dom.create('span', {id : '__end'}, ec.cloneNode(true)), ec); | ||
| 12197 | |||
| 12198 | // Split all start containers down to the format root | ||
| 12199 | if (start) | ||
| 12200 | start = dom.split(start, sc); | ||
| 12201 | else | ||
| 12202 | start = sc; | ||
| 12203 | |||
| 12204 | // If there is a span wrapper use that one instead | ||
| 12205 | if (n = dom.get('__end')) { | ||
| 12206 | ec = n; | ||
| 12207 | end = findFormatRoot(ec); | ||
| 12208 | } | ||
| 12209 | |||
| 12210 | // Split all end containers down to the format root | ||
| 12211 | if (end) | ||
| 12212 | end = dom.split(end, ec); | ||
| 12213 | else | ||
| 12214 | end = ec; | ||
| 12215 | |||
| 12216 | // Collect nodes in between | ||
| 12217 | processRange(dom, start, end, collect); | ||
| 12218 | |||
| 12219 | // Remove invisible character for IE workaround if we find it | ||
| 12220 | if (sc.nodeValue == '\uFEFF') | ||
| 12221 | sc.nodeValue = ''; | ||
| 12222 | |||
| 12223 | // Process start/end container elements | ||
| 12224 | walk(ec); | ||
| 12225 | walk(sc); | ||
| 12226 | } | ||
| 12227 | |||
| 12228 | // Remove all collected nodes | ||
| 12229 | tinymce.each(nodes, function(n) { | ||
| 12230 | dom.remove(n, 1); | ||
| 12231 | }); | ||
| 12232 | |||
| 12233 | // Remove leftover wrapper | ||
| 12234 | dom.remove('__end', 1); | ||
| 12235 | |||
| 12236 | s.moveToBookmark(bm); | ||
| 12237 | }); | ||
| 12238 | })(tinymce); | ||
| 12239 | (function(tinymce) { | ||
| 12240 | tinymce.GlobalCommands.add('mceBlockQuote', function() { | ||
| 12241 | var ed = this, s = ed.selection, dom = ed.dom, sb, eb, n, bm, bq, r, bq2, i, nl; | ||
| 12242 | |||
| 12243 | function getBQ(e) { | ||
| 12244 | return dom.getParent(e, function(n) {return n.nodeName === 'BLOCKQUOTE';}); | ||
| 12245 | }; | ||
| 12246 | |||
| 12247 | // Get start/end block | ||
| 12248 | sb = dom.getParent(s.getStart(), dom.isBlock); | ||
| 12249 | eb = dom.getParent(s.getEnd(), dom.isBlock); | ||
| 12250 | |||
| 12251 | // Remove blockquote(s) | ||
| 12252 | if (bq = getBQ(sb)) { | ||
| 12253 | if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) | ||
| 12254 | bm = s.getBookmark(); | ||
| 12255 | |||
| 12256 | // Move all elements after the end block into new bq | ||
| 12257 | if (getBQ(eb)) { | ||
| 12258 | bq2 = bq.cloneNode(false); | ||
| 12259 | |||
| 12260 | while (n = eb.nextSibling) | ||
| 12261 | bq2.appendChild(n.parentNode.removeChild(n)); | ||
| 12262 | } | ||
| 12263 | |||
| 12264 | // Add new bq after | ||
| 12265 | if (bq2) | ||
| 12266 | dom.insertAfter(bq2, bq); | ||
| 12267 | |||
| 12268 | // Move all selected blocks after the current bq | ||
| 12269 | nl = s.getSelectedBlocks(sb, eb); | ||
| 12270 | for (i = nl.length - 1; i >= 0; i--) { | ||
| 12271 | dom.insertAfter(nl[i], bq); | ||
| 12272 | } | ||
| 12273 | |||
| 12274 | // Empty bq, then remove it | ||
| 12275 | if (/^\s*$/.test(bq.innerHTML)) | ||
| 12276 | dom.remove(bq, 1); // Keep children so boomark restoration works correctly | ||
| 12277 | |||
| 12278 | // Empty bq, then remote it | ||
| 12279 | if (bq2 && /^\s*$/.test(bq2.innerHTML)) | ||
| 12280 | dom.remove(bq2, 1); // Keep children so boomark restoration works correctly | ||
| 12281 | |||
| 12282 | if (!bm) { | ||
| 12283 | // Move caret inside empty block element | ||
| 12284 | if (!tinymce.isIE) { | ||
| 12285 | r = ed.getDoc().createRange(); | ||
| 12286 | r.setStart(sb, 0); | ||
| 12287 | r.setEnd(sb, 0); | ||
| 12288 | s.setRng(r); | ||
| 12289 | } else { | ||
| 12290 | s.select(sb); | ||
| 12291 | s.collapse(0); | ||
| 12292 | |||
| 12293 | // IE misses the empty block some times element so we must move back the caret | ||
| 12294 | if (dom.getParent(s.getStart(), dom.isBlock) != sb) { | ||
| 12295 | r = s.getRng(); | ||
| 12296 | r.move('character', -1); | ||
| 12297 | r.select(); | ||
| 12298 | } | ||
| 12299 | } | ||
| 12300 | } else | ||
| 12301 | ed.selection.moveToBookmark(bm); | ||
| 12302 | |||
| 12303 | return; | ||
| 12304 | } | ||
| 12305 | |||
| 12306 | // Since IE can start with a totally empty document we need to add the first bq and paragraph | ||
| 12307 | if (tinymce.isIE && !sb && !eb) { | ||
| 12308 | ed.getDoc().execCommand('Indent'); | ||
| 12309 | n = getBQ(s.getNode()); | ||
| 12310 | n.style.margin = n.dir = ''; // IE adds margin and dir to bq | ||
| 12311 | return; | ||
| 12312 | } | ||
| 12313 | |||
| 12314 | if (!sb || !eb) | ||
| 12315 | return; | ||
| 12316 | |||
| 12317 | // If empty paragraph node then do not use bookmark | ||
| 12318 | if (sb != eb || sb.childNodes.length > 1 || (sb.childNodes.length == 1 && sb.firstChild.nodeName != 'BR')) | ||
| 12319 | bm = s.getBookmark(); | ||
| 12320 | |||
| 12321 | // Move selected block elements into a bq | ||
| 12322 | tinymce.each(s.getSelectedBlocks(getBQ(s.getStart()), getBQ(s.getEnd())), function(e) { | ||
| 12323 | // Found existing BQ add to this one | ||
| 12324 | if (e.nodeName == 'BLOCKQUOTE' && !bq) { | ||
| 12325 | bq = e; | ||
| 12326 | return; | ||
| 12327 | } | ||
| 12328 | |||
| 12329 | // No BQ found, create one | ||
| 12330 | if (!bq) { | ||
| 12331 | bq = dom.create('blockquote'); | ||
| 12332 | e.parentNode.insertBefore(bq, e); | ||
| 12333 | } | ||
| 12334 | |||
| 12335 | // Add children from existing BQ | ||
| 12336 | if (e.nodeName == 'BLOCKQUOTE' && bq) { | ||
| 12337 | n = e.firstChild; | ||
| 12338 | |||
| 12339 | while (n) { | ||
| 12340 | bq.appendChild(n.cloneNode(true)); | ||
| 12341 | n = n.nextSibling; | ||
| 12342 | } | ||
| 12343 | |||
| 12344 | dom.remove(e); | ||
| 12345 | return; | ||
| 12346 | } | ||
| 12347 | |||
| 12348 | // Add non BQ element to BQ | ||
| 12349 | bq.appendChild(dom.remove(e)); | ||
| 12350 | }); | ||
| 12351 | |||
| 12352 | if (!bm) { | ||
| 12353 | // Move caret inside empty block element | ||
| 12354 | if (!tinymce.isIE) { | ||
| 12355 | r = ed.getDoc().createRange(); | ||
| 12356 | r.setStart(sb, 0); | ||
| 12357 | r.setEnd(sb, 0); | ||
| 12358 | s.setRng(r); | ||
| 12359 | } else { | ||
| 12360 | s.select(sb); | ||
| 12361 | s.collapse(1); | ||
| 12362 | } | ||
| 12363 | } else | ||
| 12364 | s.moveToBookmark(bm); | ||
| 12365 | }); | ||
| 12366 | })(tinymce); | ||
| 12367 | (function(tinymce) { | ||
| 12368 | tinymce.each(['Cut', 'Copy', 'Paste'], function(cmd) { | ||
| 12369 | tinymce.GlobalCommands.add(cmd, function() { | ||
| 12370 | var ed = this, doc = ed.getDoc(); | ||
| 12371 | |||
| 12372 | try { | ||
| 12373 | doc.execCommand(cmd, false, null); | ||
| 12374 | |||
| 12375 | // On WebKit the command will just be ignored if it's not enabled | ||
| 12376 | if (!doc.queryCommandEnabled(cmd)) | ||
| 12377 | throw 'Error'; | ||
| 12378 | } catch (ex) { | ||
| 12379 | if (tinymce.isGecko) { | ||
| 12380 | ed.windowManager.confirm(ed.getLang('clipboard_msg'), function(s) { | ||
| 12381 | if (s) | ||
| 12382 | open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); | ||
| 12383 | }); | ||
| 12384 | } else | ||
| 12385 | ed.windowManager.alert(ed.getLang('clipboard_no_support')); | ||
| 12386 | } | ||
| 12387 | }); | ||
| 12388 | }); | ||
| 12389 | })(tinymce); | ||
| 12390 | (function(tinymce) { | ||
| 12391 | tinymce.GlobalCommands.add('InsertHorizontalRule', function() { | ||
| 12392 | if (tinymce.isOpera) | ||
| 12393 | return this.getDoc().execCommand('InsertHorizontalRule', false, ''); | ||
| 12394 | |||
| 12395 | this.selection.setContent('<hr />'); | ||
| 12396 | }); | ||
| 12397 | })(tinymce); | ||
| 12398 | (function() { | ||
| 12399 | var cmds = tinymce.GlobalCommands; | ||
| 12400 | |||
| 12401 | cmds.add(['mceEndUndoLevel', 'mceAddUndoLevel'], function() { | ||
| 12402 | this.undoManager.add(); | ||
| 12403 | }); | ||
| 12404 | |||
| 12405 | cmds.add('Undo', function() { | ||
| 12406 | var ed = this; | ||
| 12407 | |||
| 12408 | if (ed.settings.custom_undo_redo) { | ||
| 12409 | ed.undoManager.undo(); | ||
| 12410 | ed.nodeChanged(); | ||
| 12411 | return true; | ||
| 12412 | } | ||
| 12413 | |||
| 12414 | return false; // Run browser command | ||
| 12415 | }); | ||
| 12416 | |||
| 12417 | cmds.add('Redo', function() { | ||
| 12418 | var ed = this; | ||
| 12419 | |||
| 12420 | if (ed.settings.custom_undo_redo) { | ||
| 12421 | ed.undoManager.redo(); | ||
| 12422 | ed.nodeChanged(); | ||
| 12423 | return true; | ||
| 12424 | } | ||
| 12425 | |||
| 12426 | return false; // Run browser command | ||
| 12427 | }); | ||
| 12428 | })(); | ||
diff --git a/public/javascripts/tiny_mce/utils/editable_selects.js b/public/javascripts/tiny_mce/utils/editable_selects.js deleted file mode 100644 index fff4963..0000000 --- a/public/javascripts/tiny_mce/utils/editable_selects.js +++ /dev/null | |||
| @@ -1,69 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $ | ||
| 3 | * | ||
| 4 | * Makes select boxes editable. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | var TinyMCE_EditableSelects = { | ||
| 11 | editSelectElm : null, | ||
| 12 | |||
| 13 | init : function() { | ||
| 14 | var nl = document.getElementsByTagName("select"), i, d = document, o; | ||
| 15 | |||
| 16 | for (i=0; i<nl.length; i++) { | ||
| 17 | if (nl[i].className.indexOf('mceEditableSelect') != -1) { | ||
| 18 | o = new Option('(value)', '__mce_add_custom__'); | ||
| 19 | |||
| 20 | o.className = 'mceAddSelectValue'; | ||
| 21 | |||
| 22 | nl[i].options[nl[i].options.length] = o; | ||
| 23 | nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect; | ||
| 24 | } | ||
| 25 | } | ||
| 26 | }, | ||
| 27 | |||
| 28 | onChangeEditableSelect : function(e) { | ||
| 29 | var d = document, ne, se = window.event ? window.event.srcElement : e.target; | ||
| 30 | |||
| 31 | if (se.options[se.selectedIndex].value == '__mce_add_custom__') { | ||
| 32 | ne = d.createElement("input"); | ||
| 33 | ne.id = se.id + "_custom"; | ||
| 34 | ne.name = se.name + "_custom"; | ||
| 35 | ne.type = "text"; | ||
| 36 | |||
| 37 | ne.style.width = se.offsetWidth + 'px'; | ||
| 38 | se.parentNode.insertBefore(ne, se); | ||
| 39 | se.style.display = 'none'; | ||
| 40 | ne.focus(); | ||
| 41 | ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput; | ||
| 42 | ne.onkeydown = TinyMCE_EditableSelects.onKeyDown; | ||
| 43 | TinyMCE_EditableSelects.editSelectElm = se; | ||
| 44 | } | ||
| 45 | }, | ||
| 46 | |||
| 47 | onBlurEditableSelectInput : function() { | ||
| 48 | var se = TinyMCE_EditableSelects.editSelectElm; | ||
| 49 | |||
| 50 | if (se) { | ||
| 51 | if (se.previousSibling.value != '') { | ||
| 52 | addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value); | ||
| 53 | selectByValue(document.forms[0], se.id, se.previousSibling.value); | ||
| 54 | } else | ||
| 55 | selectByValue(document.forms[0], se.id, ''); | ||
| 56 | |||
| 57 | se.style.display = 'inline'; | ||
| 58 | se.parentNode.removeChild(se.previousSibling); | ||
| 59 | TinyMCE_EditableSelects.editSelectElm = null; | ||
| 60 | } | ||
| 61 | }, | ||
| 62 | |||
| 63 | onKeyDown : function(e) { | ||
| 64 | e = e || window.event; | ||
| 65 | |||
| 66 | if (e.keyCode == 13) | ||
| 67 | TinyMCE_EditableSelects.onBlurEditableSelectInput(); | ||
| 68 | } | ||
| 69 | }; | ||
diff --git a/public/javascripts/tiny_mce/utils/form_utils.js b/public/javascripts/tiny_mce/utils/form_utils.js deleted file mode 100644 index 9bc2bad..0000000 --- a/public/javascripts/tiny_mce/utils/form_utils.js +++ /dev/null | |||
| @@ -1,199 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: form_utils.js 1184 2009-08-11 11:47:27Z spocke $ | ||
| 3 | * | ||
| 4 | * Various form utilitiy functions. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); | ||
| 11 | |||
| 12 | function getColorPickerHTML(id, target_form_element) { | ||
| 13 | var h = ""; | ||
| 14 | |||
| 15 | h += '<a id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">'; | ||
| 16 | h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>'; | ||
| 17 | |||
| 18 | return h; | ||
| 19 | } | ||
| 20 | |||
| 21 | function updateColor(img_id, form_element_id) { | ||
| 22 | document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; | ||
| 23 | } | ||
| 24 | |||
| 25 | function setBrowserDisabled(id, state) { | ||
| 26 | var img = document.getElementById(id); | ||
| 27 | var lnk = document.getElementById(id + "_link"); | ||
| 28 | |||
| 29 | if (lnk) { | ||
| 30 | if (state) { | ||
| 31 | lnk.setAttribute("realhref", lnk.getAttribute("href")); | ||
| 32 | lnk.removeAttribute("href"); | ||
| 33 | tinyMCEPopup.dom.addClass(img, 'disabled'); | ||
| 34 | } else { | ||
| 35 | if (lnk.getAttribute("realhref")) | ||
| 36 | lnk.setAttribute("href", lnk.getAttribute("realhref")); | ||
| 37 | |||
| 38 | tinyMCEPopup.dom.removeClass(img, 'disabled'); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | function getBrowserHTML(id, target_form_element, type, prefix) { | ||
| 44 | var option = prefix + "_" + type + "_browser_callback", cb, html; | ||
| 45 | |||
| 46 | cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); | ||
| 47 | |||
| 48 | if (!cb) | ||
| 49 | return ""; | ||
| 50 | |||
| 51 | html = ""; | ||
| 52 | html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">'; | ||
| 53 | html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '"> </span></a>'; | ||
| 54 | |||
| 55 | return html; | ||
| 56 | } | ||
| 57 | |||
| 58 | function openBrowser(img_id, target_form_element, type, option) { | ||
| 59 | var img = document.getElementById(img_id); | ||
| 60 | |||
| 61 | if (img.className != "mceButtonDisabled") | ||
| 62 | tinyMCEPopup.openBrowser(target_form_element, type, option); | ||
| 63 | } | ||
| 64 | |||
| 65 | function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { | ||
| 66 | if (!form_obj || !form_obj.elements[field_name]) | ||
| 67 | return; | ||
| 68 | |||
| 69 | var sel = form_obj.elements[field_name]; | ||
| 70 | |||
| 71 | var found = false; | ||
| 72 | for (var i=0; i<sel.options.length; i++) { | ||
| 73 | var option = sel.options[i]; | ||
| 74 | |||
| 75 | if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) { | ||
| 76 | option.selected = true; | ||
| 77 | found = true; | ||
| 78 | } else | ||
| 79 | option.selected = false; | ||
| 80 | } | ||
| 81 | |||
| 82 | if (!found && add_custom && value != '') { | ||
| 83 | var option = new Option(value, value); | ||
| 84 | option.selected = true; | ||
| 85 | sel.options[sel.options.length] = option; | ||
| 86 | sel.selectedIndex = sel.options.length - 1; | ||
| 87 | } | ||
| 88 | |||
| 89 | return found; | ||
| 90 | } | ||
| 91 | |||
| 92 | function getSelectValue(form_obj, field_name) { | ||
| 93 | var elm = form_obj.elements[field_name]; | ||
| 94 | |||
| 95 | if (elm == null || elm.options == null || elm.selectedIndex === -1) | ||
| 96 | return ""; | ||
| 97 | |||
| 98 | return elm.options[elm.selectedIndex].value; | ||
| 99 | } | ||
| 100 | |||
| 101 | function addSelectValue(form_obj, field_name, name, value) { | ||
| 102 | var s = form_obj.elements[field_name]; | ||
| 103 | var o = new Option(name, value); | ||
| 104 | s.options[s.options.length] = o; | ||
| 105 | } | ||
| 106 | |||
| 107 | function addClassesToList(list_id, specific_option) { | ||
| 108 | // Setup class droplist | ||
| 109 | var styleSelectElm = document.getElementById(list_id); | ||
| 110 | var styles = tinyMCEPopup.getParam('theme_advanced_styles', false); | ||
| 111 | styles = tinyMCEPopup.getParam(specific_option, styles); | ||
| 112 | |||
| 113 | if (styles) { | ||
| 114 | var stylesAr = styles.split(';'); | ||
| 115 | |||
| 116 | for (var i=0; i<stylesAr.length; i++) { | ||
| 117 | if (stylesAr != "") { | ||
| 118 | var key, value; | ||
| 119 | |||
| 120 | key = stylesAr[i].split('=')[0]; | ||
| 121 | value = stylesAr[i].split('=')[1]; | ||
| 122 | |||
| 123 | styleSelectElm.options[styleSelectElm.length] = new Option(key, value); | ||
| 124 | } | ||
| 125 | } | ||
| 126 | } else { | ||
| 127 | tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) { | ||
| 128 | styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']); | ||
| 129 | }); | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | function isVisible(element_id) { | ||
| 134 | var elm = document.getElementById(element_id); | ||
| 135 | |||
| 136 | return elm && elm.style.display != "none"; | ||
| 137 | } | ||
| 138 | |||
| 139 | function convertRGBToHex(col) { | ||
| 140 | var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); | ||
| 141 | |||
| 142 | var rgb = col.replace(re, "$1,$2,$3").split(','); | ||
| 143 | if (rgb.length == 3) { | ||
| 144 | r = parseInt(rgb[0]).toString(16); | ||
| 145 | g = parseInt(rgb[1]).toString(16); | ||
| 146 | b = parseInt(rgb[2]).toString(16); | ||
| 147 | |||
| 148 | r = r.length == 1 ? '0' + r : r; | ||
| 149 | g = g.length == 1 ? '0' + g : g; | ||
| 150 | b = b.length == 1 ? '0' + b : b; | ||
| 151 | |||
| 152 | return "#" + r + g + b; | ||
| 153 | } | ||
| 154 | |||
| 155 | return col; | ||
| 156 | } | ||
| 157 | |||
| 158 | function convertHexToRGB(col) { | ||
| 159 | if (col.indexOf('#') != -1) { | ||
| 160 | col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); | ||
| 161 | |||
| 162 | r = parseInt(col.substring(0, 2), 16); | ||
| 163 | g = parseInt(col.substring(2, 4), 16); | ||
| 164 | b = parseInt(col.substring(4, 6), 16); | ||
| 165 | |||
| 166 | return "rgb(" + r + "," + g + "," + b + ")"; | ||
| 167 | } | ||
| 168 | |||
| 169 | return col; | ||
| 170 | } | ||
| 171 | |||
| 172 | function trimSize(size) { | ||
| 173 | return size.replace(/([0-9\.]+)px|(%|in|cm|mm|em|ex|pt|pc)/, '$1$2'); | ||
| 174 | } | ||
| 175 | |||
| 176 | function getCSSSize(size) { | ||
| 177 | size = trimSize(size); | ||
| 178 | |||
| 179 | if (size == "") | ||
| 180 | return ""; | ||
| 181 | |||
| 182 | // Add px | ||
| 183 | if (/^[0-9]+$/.test(size)) | ||
| 184 | size += 'px'; | ||
| 185 | |||
| 186 | return size; | ||
| 187 | } | ||
| 188 | |||
| 189 | function getStyle(elm, attrib, style) { | ||
| 190 | var val = tinyMCEPopup.dom.getAttrib(elm, attrib); | ||
| 191 | |||
| 192 | if (val != '') | ||
| 193 | return '' + val; | ||
| 194 | |||
| 195 | if (typeof(style) == 'undefined') | ||
| 196 | style = attrib; | ||
| 197 | |||
| 198 | return tinyMCEPopup.dom.getStyle(elm, style); | ||
| 199 | } | ||
diff --git a/public/javascripts/tiny_mce/utils/mctabs.js b/public/javascripts/tiny_mce/utils/mctabs.js deleted file mode 100644 index 284501e..0000000 --- a/public/javascripts/tiny_mce/utils/mctabs.js +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $ | ||
| 3 | * | ||
| 4 | * Moxiecode DHTML Tabs script. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | function MCTabs() { | ||
| 11 | this.settings = []; | ||
| 12 | }; | ||
| 13 | |||
| 14 | MCTabs.prototype.init = function(settings) { | ||
| 15 | this.settings = settings; | ||
| 16 | }; | ||
| 17 | |||
| 18 | MCTabs.prototype.getParam = function(name, default_value) { | ||
| 19 | var value = null; | ||
| 20 | |||
| 21 | value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name]; | ||
| 22 | |||
| 23 | // Fix bool values | ||
| 24 | if (value == "true" || value == "false") | ||
| 25 | return (value == "true"); | ||
| 26 | |||
| 27 | return value; | ||
| 28 | }; | ||
| 29 | |||
| 30 | MCTabs.prototype.displayTab = function(tab_id, panel_id) { | ||
| 31 | var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i; | ||
| 32 | |||
| 33 | panelElm= document.getElementById(panel_id); | ||
| 34 | panelContainerElm = panelElm ? panelElm.parentNode : null; | ||
| 35 | tabElm = document.getElementById(tab_id); | ||
| 36 | tabContainerElm = tabElm ? tabElm.parentNode : null; | ||
| 37 | selectionClass = this.getParam('selection_class', 'current'); | ||
| 38 | |||
| 39 | if (tabElm && tabContainerElm) { | ||
| 40 | nodes = tabContainerElm.childNodes; | ||
| 41 | |||
| 42 | // Hide all other tabs | ||
| 43 | for (i = 0; i < nodes.length; i++) { | ||
| 44 | if (nodes[i].nodeName == "LI") | ||
| 45 | nodes[i].className = ''; | ||
| 46 | } | ||
| 47 | |||
| 48 | // Show selected tab | ||
| 49 | tabElm.className = 'current'; | ||
| 50 | } | ||
| 51 | |||
| 52 | if (panelElm && panelContainerElm) { | ||
| 53 | nodes = panelContainerElm.childNodes; | ||
| 54 | |||
| 55 | // Hide all other panels | ||
| 56 | for (i = 0; i < nodes.length; i++) { | ||
| 57 | if (nodes[i].nodeName == "DIV") | ||
| 58 | nodes[i].className = 'panel'; | ||
| 59 | } | ||
| 60 | |||
| 61 | // Show selected panel | ||
| 62 | panelElm.className = 'current'; | ||
| 63 | } | ||
| 64 | }; | ||
| 65 | |||
| 66 | MCTabs.prototype.getAnchor = function() { | ||
| 67 | var pos, url = document.location.href; | ||
| 68 | |||
| 69 | if ((pos = url.lastIndexOf('#')) != -1) | ||
| 70 | return url.substring(pos + 1); | ||
| 71 | |||
| 72 | return ""; | ||
| 73 | }; | ||
| 74 | |||
| 75 | // Global instance | ||
| 76 | var mcTabs = new MCTabs(); | ||
diff --git a/public/javascripts/tiny_mce/utils/validate.js b/public/javascripts/tiny_mce/utils/validate.js deleted file mode 100644 index cde4c97..0000000 --- a/public/javascripts/tiny_mce/utils/validate.js +++ /dev/null | |||
| @@ -1,219 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $ | ||
| 3 | * | ||
| 4 | * Various form validation methods. | ||
| 5 | * | ||
| 6 | * @author Moxiecode | ||
| 7 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 8 | */ | ||
| 9 | |||
| 10 | /** | ||
| 11 | // String validation: | ||
| 12 | |||
| 13 | if (!Validator.isEmail('myemail')) | ||
| 14 | alert('Invalid email.'); | ||
| 15 | |||
| 16 | // Form validation: | ||
| 17 | |||
| 18 | var f = document.forms['myform']; | ||
| 19 | |||
| 20 | if (!Validator.isEmail(f.myemail)) | ||
| 21 | alert('Invalid email.'); | ||
| 22 | */ | ||
| 23 | |||
| 24 | var Validator = { | ||
| 25 | isEmail : function(s) { | ||
| 26 | return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); | ||
| 27 | }, | ||
| 28 | |||
| 29 | isAbsUrl : function(s) { | ||
| 30 | return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); | ||
| 31 | }, | ||
| 32 | |||
| 33 | isSize : function(s) { | ||
| 34 | return this.test(s, '^[0-9]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); | ||
| 35 | }, | ||
| 36 | |||
| 37 | isId : function(s) { | ||
| 38 | return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); | ||
| 39 | }, | ||
| 40 | |||
| 41 | isEmpty : function(s) { | ||
| 42 | var nl, i; | ||
| 43 | |||
| 44 | if (s.nodeName == 'SELECT' && s.selectedIndex < 1) | ||
| 45 | return true; | ||
| 46 | |||
| 47 | if (s.type == 'checkbox' && !s.checked) | ||
| 48 | return true; | ||
| 49 | |||
| 50 | if (s.type == 'radio') { | ||
| 51 | for (i=0, nl = s.form.elements; i<nl.length; i++) { | ||
| 52 | if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked) | ||
| 53 | return false; | ||
| 54 | } | ||
| 55 | |||
| 56 | return true; | ||
| 57 | } | ||
| 58 | |||
| 59 | return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s); | ||
| 60 | }, | ||
| 61 | |||
| 62 | isNumber : function(s, d) { | ||
| 63 | return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$')); | ||
| 64 | }, | ||
| 65 | |||
| 66 | test : function(s, p) { | ||
| 67 | s = s.nodeType == 1 ? s.value : s; | ||
| 68 | |||
| 69 | return s == '' || new RegExp(p).test(s); | ||
| 70 | } | ||
| 71 | }; | ||
| 72 | |||
| 73 | var AutoValidator = { | ||
| 74 | settings : { | ||
| 75 | id_cls : 'id', | ||
| 76 | int_cls : 'int', | ||
| 77 | url_cls : 'url', | ||
| 78 | number_cls : 'number', | ||
| 79 | email_cls : 'email', | ||
| 80 | size_cls : 'size', | ||
| 81 | required_cls : 'required', | ||
| 82 | invalid_cls : 'invalid', | ||
| 83 | min_cls : 'min', | ||
| 84 | max_cls : 'max' | ||
| 85 | }, | ||
| 86 | |||
| 87 | init : function(s) { | ||
| 88 | var n; | ||
| 89 | |||
| 90 | for (n in s) | ||
| 91 | this.settings[n] = s[n]; | ||
| 92 | }, | ||
| 93 | |||
| 94 | validate : function(f) { | ||
| 95 | var i, nl, s = this.settings, c = 0; | ||
| 96 | |||
| 97 | nl = this.tags(f, 'label'); | ||
| 98 | for (i=0; i<nl.length; i++) | ||
| 99 | this.removeClass(nl[i], s.invalid_cls); | ||
| 100 | |||
| 101 | c += this.validateElms(f, 'input'); | ||
| 102 | c += this.validateElms(f, 'select'); | ||
| 103 | c += this.validateElms(f, 'textarea'); | ||
| 104 | |||
| 105 | return c == 3; | ||
| 106 | }, | ||
| 107 | |||
| 108 | invalidate : function(n) { | ||
| 109 | this.mark(n.form, n); | ||
| 110 | }, | ||
| 111 | |||
| 112 | reset : function(e) { | ||
| 113 | var t = ['label', 'input', 'select', 'textarea']; | ||
| 114 | var i, j, nl, s = this.settings; | ||
| 115 | |||
| 116 | if (e == null) | ||
| 117 | return; | ||
| 118 | |||
| 119 | for (i=0; i<t.length; i++) { | ||
| 120 | nl = this.tags(e.form ? e.form : e, t[i]); | ||
| 121 | for (j=0; j<nl.length; j++) | ||
| 122 | this.removeClass(nl[j], s.invalid_cls); | ||
| 123 | } | ||
| 124 | }, | ||
| 125 | |||
| 126 | validateElms : function(f, e) { | ||
| 127 | var nl, i, n, s = this.settings, st = true, va = Validator, v; | ||
| 128 | |||
| 129 | nl = this.tags(f, e); | ||
| 130 | for (i=0; i<nl.length; i++) { | ||
| 131 | n = nl[i]; | ||
| 132 | |||
| 133 | this.removeClass(n, s.invalid_cls); | ||
| 134 | |||
| 135 | if (this.hasClass(n, s.required_cls) && va.isEmpty(n)) | ||
| 136 | st = this.mark(f, n); | ||
| 137 | |||
| 138 | if (this.hasClass(n, s.number_cls) && !va.isNumber(n)) | ||
| 139 | st = this.mark(f, n); | ||
| 140 | |||
| 141 | if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true)) | ||
| 142 | st = this.mark(f, n); | ||
| 143 | |||
| 144 | if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n)) | ||
| 145 | st = this.mark(f, n); | ||
| 146 | |||
| 147 | if (this.hasClass(n, s.email_cls) && !va.isEmail(n)) | ||
| 148 | st = this.mark(f, n); | ||
| 149 | |||
| 150 | if (this.hasClass(n, s.size_cls) && !va.isSize(n)) | ||
| 151 | st = this.mark(f, n); | ||
| 152 | |||
| 153 | if (this.hasClass(n, s.id_cls) && !va.isId(n)) | ||
| 154 | st = this.mark(f, n); | ||
| 155 | |||
| 156 | if (this.hasClass(n, s.min_cls, true)) { | ||
| 157 | v = this.getNum(n, s.min_cls); | ||
| 158 | |||
| 159 | if (isNaN(v) || parseInt(n.value) < parseInt(v)) | ||
| 160 | st = this.mark(f, n); | ||
| 161 | } | ||
| 162 | |||
| 163 | if (this.hasClass(n, s.max_cls, true)) { | ||
| 164 | v = this.getNum(n, s.max_cls); | ||
| 165 | |||
| 166 | if (isNaN(v) || parseInt(n.value) > parseInt(v)) | ||
| 167 | st = this.mark(f, n); | ||
| 168 | } | ||
| 169 | } | ||
| 170 | |||
| 171 | return st; | ||
| 172 | }, | ||
| 173 | |||
| 174 | hasClass : function(n, c, d) { | ||
| 175 | return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); | ||
| 176 | }, | ||
| 177 | |||
| 178 | getNum : function(n, c) { | ||
| 179 | c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; | ||
| 180 | c = c.replace(/[^0-9]/g, ''); | ||
| 181 | |||
| 182 | return c; | ||
| 183 | }, | ||
| 184 | |||
| 185 | addClass : function(n, c, b) { | ||
| 186 | var o = this.removeClass(n, c); | ||
| 187 | n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; | ||
| 188 | }, | ||
| 189 | |||
| 190 | removeClass : function(n, c) { | ||
| 191 | c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); | ||
| 192 | return n.className = c != ' ' ? c : ''; | ||
| 193 | }, | ||
| 194 | |||
| 195 | tags : function(f, s) { | ||
| 196 | return f.getElementsByTagName(s); | ||
| 197 | }, | ||
| 198 | |||
| 199 | mark : function(f, n) { | ||
| 200 | var s = this.settings; | ||
| 201 | |||
| 202 | this.addClass(n, s.invalid_cls); | ||
| 203 | this.markLabels(f, n, s.invalid_cls); | ||
| 204 | |||
| 205 | return false; | ||
| 206 | }, | ||
| 207 | |||
| 208 | markLabels : function(f, n, ic) { | ||
| 209 | var nl, i; | ||
| 210 | |||
| 211 | nl = this.tags(f, "label"); | ||
| 212 | for (i=0; i<nl.length; i++) { | ||
| 213 | if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id) | ||
| 214 | this.addClass(nl[i], ic); | ||
| 215 | } | ||
| 216 | |||
| 217 | return null; | ||
| 218 | } | ||
| 219 | }; | ||
