4a6e546c by Kevin Burton

adding tinymce and phpmailer

1 parent 8763dba9
Showing 308 changed files with 2856 additions and 0 deletions
...@@ -477,3 +477,9 @@ input.dp-applied { ...@@ -477,3 +477,9 @@ input.dp-applied {
477 .cbv-report-list tbody td { border-bottom:1px solid #e8e8e8; min-width: 120px;} 477 .cbv-report-list tbody td { border-bottom:1px solid #e8e8e8; min-width: 120px;}
478 478
479 #user-list-from { display: block; } 479 #user-list-from { display: block; }
480
481 .edit-option-table { border-collapse: collapse; margin:0;padding:0;}
482 .edit-option-table tbody th { padding: 5px 5px 3px 5px; text-align: left; font-weight: bold; font-size: 11px; vertical-align: top; }
483 .edit-option-table tbody td { padding: 3px 5px; text-align: left; font-weight: bold; font-size: 11px; }
484 .edit-option-table tbody td textarea,
485 .edit-option-table tbody td input { font-size:11px; width: 99% }
......
This diff could not be displayed because it is too large.
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>Full featured example using jQuery plugin</title>
5
6 <!-- Load jQuery -->
7 <script type="text/javascript" src="http://www.google.com/jsapi"></script>
8 <script type="text/javascript">
9 google.load("jquery", "1");
10 </script>
11
12 <!-- Load TinyMCE -->
13 <script type="text/javascript" src="../jscripts/tiny_mce/jquery.tinymce.js"></script>
14 <script type="text/javascript">
15 $().ready(function() {
16 $('textarea.tinymce').tinymce({
17 // Location of TinyMCE script
18 script_url : '../jscripts/tiny_mce/tiny_mce.js',
19
20 // General options
21 theme : "advanced",
22 plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
23
24 // Theme options
25 theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
26 theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
27 theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
28 theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
29 theme_advanced_toolbar_location : "top",
30 theme_advanced_toolbar_align : "left",
31 theme_advanced_statusbar_location : "bottom",
32 theme_advanced_resizing : true,
33
34 // Example content CSS (should be your site CSS)
35 content_css : "css/content.css",
36
37 // Drop lists for link/image/media/template dialogs
38 template_external_list_url : "lists/template_list.js",
39 external_link_list_url : "lists/link_list.js",
40 external_image_list_url : "lists/image_list.js",
41 media_external_list_url : "lists/media_list.js",
42
43 // Replace values for the template plugin
44 template_replace_values : {
45 username : "Some User",
46 staffid : "991234"
47 }
48 });
49 });
50 </script>
51 <!-- /TinyMCE -->
52
53 </head>
54 <body>
55
56 <form method="post" action="http://tinymce.moxiecode.com/dump.php?example=true">
57 <div>
58 <h3>Full featured example using jQuery plugin</h3>
59
60 <p>
61 This example shows how TinyMCE can be lazy loaded using jQuery. The jQuery plugin will also attach it's self to various jQuery methods to make it more easy to get/set editor contents etc.
62 </p>
63
64 <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
65 <div>
66 <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%" class="tinymce">
67 &lt;p&gt;
68 This is some example text that you can edit inside the &lt;strong&gt;TinyMCE editor&lt;/strong&gt;.
69 &lt;/p&gt;
70 &lt;p&gt;
71 Nam nisi elit, cursus in rhoncus sit amet, pulvinar laoreet leo. Nam sed lectus quam, ut sagittis tellus. Quisque dignissim mauris a augue rutrum tempor. Donec vitae purus nec massa vestibulum ornare sit amet id tellus. Nunc quam mauris, fermentum nec lacinia eget, sollicitudin nec ante. Aliquam molestie volutpat dapibus. Nunc interdum viverra sodales. Morbi laoreet pulvinar gravida. Quisque ut turpis sagittis nunc accumsan vehicula. Duis elementum congue ultrices. Cras faucibus feugiat arcu quis lacinia. In hac habitasse platea dictumst. Pellentesque fermentum magna sit amet tellus varius ullamcorper. Vestibulum at urna augue, eget varius neque. Fusce facilisis venenatis dapibus. Integer non sem at arcu euismod tempor nec sed nisl. Morbi ultricies, mauris ut ultricies adipiscing, felis odio condimentum massa, et luctus est nunc nec eros.
72 &lt;/p&gt;
73 </textarea>
74 </div>
75
76 <!-- Some integration calls -->
77 <a href="javascript:;" onmousedown="$('#elm1').tinymce().show();">[Show]</a>
78 <a href="javascript:;" onmousedown="$('#elm1').tinymce().hide();">[Hide]</a>
79 <a href="javascript:;" onmousedown="$('#elm1').tinymce().execCommand('Bold');">[Bold]</a>
80 <a href="javascript:;" onmousedown="alert($('#elm1').html());">[Get contents]</a>
81 <a href="javascript:;" onmousedown="alert($('#elm1').tinymce().selection.getContent());">[Get selected HTML]</a>
82 <a href="javascript:;" onmousedown="alert($('#elm1').tinymce().selection.getContent({format : 'text'}));">[Get selected text]</a>
83 <a href="javascript:;" onmousedown="alert($('#elm1').tinymce().selection.getNode().nodeName);">[Get selected element]</a>
84 <a href="javascript:;" onmousedown="$('#elm1').tinymce().execCommand('mceInsertContent',false,'<b>Hello world!!</b>');">[Insert HTML]</a>
85 <a href="javascript:;" onmousedown="$('#elm1').tinymce().execCommand('mceReplaceContent',false,'<b>{$selection}</b>');">[Replace selection]</a>
86
87 <br />
88 <input type="submit" name="save" value="Submit" />
89 <input type="reset" name="reset" value="Reset" />
90 </div>
91 </form>
92 <script type="text/javascript">
93 if (document.location.protocol == 'file:') {
94 alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
95 }
96 </script>
97 </body>
98 </html>
1 (function(b){var e,d,a=[],c=window;b.fn.tinymce=function(j){var p=this,g,k,h,m,i,l="",n="";if(!p.length){return p}if(!j){return tinyMCE.get(p[0].id)}function o(){var r=[],q=0;if(f){f();f=null}p.each(function(t,u){var s,w=u.id,v=j.oninit;if(!w){u.id=w=tinymce.DOM.uniqueId()}s=new tinymce.Editor(w,j);r.push(s);if(v){s.onInit.add(function(){var x,y=v;if(++q==r.length){if(tinymce.is(y,"string")){x=(y.indexOf(".")===-1)?null:tinymce.resolve(y.replace(/\.\w+$/,""));y=tinymce.resolve(y)}y.apply(x||tinymce,r)}})}});b.each(r,function(t,s){s.render()})}if(!c.tinymce&&!d&&(g=j.script_url)){d=1;h=g.substring(0,g.lastIndexOf("/"));if(/_(src|dev)\.js/g.test(g)){n="_src"}m=g.lastIndexOf("?");if(m!=-1){l=g.substring(m+1)}c.tinyMCEPreInit=c.tinyMCEPreInit||{base:h,suffix:n,query:l};if(g.indexOf("gzip")!=-1){i=j.language||"en";g=g+(/\?/.test(g)?"&":"?")+"js=true&core=true&suffix="+escape(n)+"&themes="+escape(j.theme)+"&plugins="+escape(j.plugins)+"&languages="+i;if(!c.tinyMCE_GZ){tinyMCE_GZ={start:function(){tinymce.suffix=n;function q(r){tinymce.ScriptLoader.markDone(tinyMCE.baseURI.toAbsolute(r))}q("langs/"+i+".js");q("themes/"+j.theme+"/editor_template"+n+".js");q("themes/"+j.theme+"/langs/"+i+".js");b.each(j.plugins.split(","),function(s,r){if(r){q("plugins/"+r+"/editor_plugin"+n+".js");q("plugins/"+r+"/langs/"+i+".js")}})},end:function(){}}}}b.ajax({type:"GET",url:g,dataType:"script",cache:true,success:function(){tinymce.dom.Event.domLoaded=1;d=2;if(j.script_loaded){j.script_loaded()}o();b.each(a,function(q,r){r()})}})}else{if(d===1){a.push(o)}else{o()}}return p};b.extend(b.expr[":"],{tinymce:function(g){return g.id&&!!tinyMCE.get(g.id)}});function f(){function i(l){if(l==="remove"){this.each(function(n,o){var m=h(o);if(m){m.remove()}})}this.find("span.mceEditor,div.mceEditor").each(function(n,o){var m=tinyMCE.get(o.id.replace(/_parent$/,""));if(m){m.remove()}})}function k(n){var m=this,l;if(n!==e){i.call(m);m.each(function(p,q){var o;if(o=tinyMCE.get(q.id)){o.setContent(n)}})}else{if(m.length>0){if(l=tinyMCE.get(m[0].id)){return l.getContent()}}}}function h(m){var l=null;(m)&&(m.id)&&(c.tinymce)&&(l=tinyMCE.get(m.id));return l}function g(l){return !!((l)&&(l.length)&&(c.tinymce)&&(l.is(":tinymce")))}var j={};b.each(["text","html","val"],function(n,l){var o=j[l]=b.fn[l],m=(l==="text");b.fn[l]=function(s){var p=this;if(!g(p)){return o.apply(p,arguments)}if(s!==e){k.call(p.filter(":tinymce"),s);o.apply(p.not(":tinymce"),arguments);return p}else{var r="";var q=arguments;(m?p:p.eq(0)).each(function(u,v){var t=h(v);r+=t?(m?t.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):t.getContent()):o.apply(b(v),q)});return r}}});b.each(["append","prepend"],function(n,m){var o=j[m]=b.fn[m],l=(m==="prepend");b.fn[m]=function(q){var p=this;if(!g(p)){return o.apply(p,arguments)}if(q!==e){p.filter(":tinymce").each(function(s,t){var r=h(t);r&&r.setContent(l?q+r.getContent():r.getContent()+q)});o.apply(p.not(":tinymce"),arguments);return p}}});b.each(["remove","replaceWith","replaceAll","empty"],function(m,l){var n=j[l]=b.fn[l];b.fn[l]=function(){i.call(this,l);return n.apply(this,arguments)}});j.attr=b.fn.attr;b.fn.attr=function(n,q,o){var m=this;if((!n)||(n!=="value")||(!g(m))){return j.attr.call(m,n,q,o)}if(q!==e){k.call(m.filter(":tinymce"),q);j.attr.call(m.not(":tinymce"),n,q,o);return m}else{var p=m[0],l=h(p);return l?l.getContent():j.attr.call(b(p),n,q,o)}}}})(jQuery);
...\ No newline at end of file ...\ No newline at end of file
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 plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
95 plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."
96 },
97 paste_dlg:{
98 text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
99 text_linebreaks:"Keep linebreaks",
100 word_title:"Use CTRL+V on your keyboard to paste the text into the window."
101 },
102 table:{
103 desc:"Inserts a new table",
104 row_before_desc:"Insert row before",
105 row_after_desc:"Insert row after",
106 delete_row_desc:"Delete row",
107 col_before_desc:"Insert column before",
108 col_after_desc:"Insert column after",
109 delete_col_desc:"Remove column",
110 split_cells_desc:"Split merged table cells",
111 merge_cells_desc:"Merge table cells",
112 row_desc:"Table row properties",
113 cell_desc:"Table cell properties",
114 props_desc:"Table properties",
115 paste_row_before_desc:"Paste table row before",
116 paste_row_after_desc:"Paste table row after",
117 cut_row_desc:"Cut table row",
118 copy_row_desc:"Copy table row",
119 del:"Delete table",
120 row:"Row",
121 col:"Column",
122 cell:"Cell"
123 },
124 autosave:{
125 unload_msg:"The changes you made will be lost if you navigate away from this page.",
126 restore_content:"Restore auto-saved content.",
127 warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."
128 },
129 fullscreen:{
130 desc:"Toggle fullscreen mode"
131 },
132 media:{
133 desc:"Insert / edit embedded media",
134 edit:"Edit embedded media"
135 },
136 fullpage:{
137 desc:"Document properties"
138 },
139 template:{
140 desc:"Insert predefined template content"
141 },
142 visualchars:{
143 desc:"Visual control characters on/off."
144 },
145 spellchecker:{
146 desc:"Toggle spellchecker",
147 menu:"Spellchecker settings",
148 ignore_word:"Ignore word",
149 ignore_words:"Ignore all",
150 langs:"Languages",
151 wait:"Please wait...",
152 sug:"Suggestions",
153 no_sug:"No suggestions",
154 no_mpell:"No misspellings found."
155 },
156 pagebreak:{
157 desc:"Insert page break."
158 },
159 advlist:{
160 types:"Types",
161 def:"Default",
162 lower_alpha:"Lower alpha",
163 lower_greek:"Lower greek",
164 lower_roman:"Lower roman",
165 upper_alpha:"Upper alpha",
166 upper_roman:"Upper roman",
167 circle:"Circle",
168 disc:"Disc",
169 square:"Square"
170 }}});
...\ No newline at end of file ...\ No newline at end of file
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;}
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
13 init : function(ed, url) {
14 // Register commands
15 ed.addCommand('mceAdvancedHr', function() {
16 ed.windowManager.open({
17 file : url + '/rule.htm',
18 width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
19 height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
20 inline : 1
21 }, {
22 plugin_url : url
23 });
24 });
25
26 // Register buttons
27 ed.addButton('advhr', {
28 title : 'advhr.advhr_desc',
29 cmd : 'mceAdvancedHr'
30 });
31
32 ed.onNodeChange.add(function(ed, cm, n) {
33 cm.setActive('advhr', n.nodeName == 'HR');
34 });
35
36 ed.onClick.add(function(ed, e) {
37 e = e.target;
38
39 if (e.nodeName === 'HR')
40 ed.selection.select(e);
41 });
42 },
43
44 getInfo : function() {
45 return {
46 longname : 'Advanced HR',
47 author : 'Moxiecode Systems AB',
48 authorurl : 'http://tinymce.moxiecode.com',
49 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
50 version : tinymce.majorVersion + "." + tinymce.minorVersion
51 };
52 }
53 });
54
55 // Register plugin
56 tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
57 })();
...\ No newline at end of file ...\ No newline at end of file
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);
1 tinyMCE.addI18n('en.advhr_dlg',{
2 width:"Width",
3 size:"Height",
4 noshade:"No shadow"
5 });
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
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 <input type="submit" id="insert" name="insert" value="{#insert}" />
53 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
54 </div>
55 </form>
56 </body>
57 </html>
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;}
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
13 init : function(ed, url) {
14 // Register commands
15 ed.addCommand('mceAdvImage', function() {
16 // Internal image object like a flash placeholder
17 if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
18 return;
19
20 ed.windowManager.open({
21 file : url + '/image.htm',
22 width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
23 height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
24 inline : 1
25 }, {
26 plugin_url : url
27 });
28 });
29
30 // Register buttons
31 ed.addButton('image', {
32 title : 'advimage.image_desc',
33 cmd : 'mceAdvImage'
34 });
35 },
36
37 getInfo : function() {
38 return {
39 longname : 'Advanced image',
40 author : 'Moxiecode Systems AB',
41 authorurl : 'http://tinymce.moxiecode.com',
42 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
43 version : tinymce.majorVersion + "." + tinymce.minorVersion
44 };
45 }
46 });
47
48 // Register plugin
49 tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
50 })();
...\ No newline at end of file ...\ No newline at end of file
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 ...\ No newline at end of file
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;}
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
13 init : function(ed, url) {
14 this.editor = ed;
15
16 // Register commands
17 ed.addCommand('mceAdvLink', function() {
18 var se = ed.selection;
19
20 // No selection and not in link
21 if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
22 return;
23
24 ed.windowManager.open({
25 file : url + '/link.htm',
26 width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
27 height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
28 inline : 1
29 }, {
30 plugin_url : url
31 });
32 });
33
34 // Register buttons
35 ed.addButton('link', {
36 title : 'advlink.link_desc',
37 cmd : 'mceAdvLink'
38 });
39
40 ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
41
42 ed.onNodeChange.add(function(ed, cm, n, co) {
43 cm.setDisabled('link', co && n.nodeName != 'A');
44 cm.setActive('link', n.nodeName == 'A' && !n.name);
45 });
46 },
47
48 getInfo : function() {
49 return {
50 longname : 'Advanced link',
51 author : 'Moxiecode Systems AB',
52 authorurl : 'http://tinymce.moxiecode.com',
53 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
54 version : tinymce.majorVersion + "." + tinymce.minorVersion
55 };
56 }
57 });
58
59 // Register plugin
60 tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
61 })();
...\ No newline at end of file ...\ No newline at end of file
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 ...\ No newline at end of file
1 (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 var each = tinymce.each;
13
14 tinymce.create('tinymce.plugins.AdvListPlugin', {
15 init : function(ed, url) {
16 var t = this;
17
18 t.editor = ed;
19
20 function buildFormats(str) {
21 var formats = [];
22
23 each(str.split(/,/), function(type) {
24 formats.push({
25 title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')),
26 styles : {
27 listStyleType : type == 'default' ? '' : type
28 }
29 });
30 });
31
32 return formats;
33 };
34
35 // Setup number formats from config or default
36 t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");
37 t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square");
38 },
39
40 createControl: function(name, cm) {
41 var t = this, btn, format;
42
43 if (name == 'numlist' || name == 'bullist') {
44 // Default to first item if it's a default item
45 if (t[name][0].title == 'advlist.def')
46 format = t[name][0];
47
48 function hasFormat(node, format) {
49 var state = true;
50
51 each(format.styles, function(value, name) {
52 // Format doesn't match
53 if (t.editor.dom.getStyle(node, name) != value) {
54 state = false;
55 return false;
56 }
57 });
58
59 return state;
60 };
61
62 function applyListFormat() {
63 var list, ed = t.editor, dom = ed.dom, sel = ed.selection;
64
65 // Check for existing list element
66 list = dom.getParent(sel.getNode(), 'ol,ul');
67
68 // Switch/add list type if needed
69 if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format))
70 ed.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList');
71
72 // Append styles to new list element
73 if (format) {
74 list = dom.getParent(sel.getNode(), 'ol,ul');
75
76 if (list) {
77 dom.setStyles(list, format.styles);
78 list.removeAttribute('_mce_style');
79 }
80 }
81 };
82
83 btn = cm.createSplitButton(name, {
84 title : 'advanced.' + name + '_desc',
85 'class' : 'mce_' + name,
86 onclick : function() {
87 applyListFormat();
88 }
89 });
90
91 btn.onRenderMenu.add(function(btn, menu) {
92 menu.onShowMenu.add(function() {
93 var dom = t.editor.dom, list = dom.getParent(t.editor.selection.getNode(), 'ol,ul'), fmtList;
94
95 if (list || format) {
96 fmtList = t[name];
97
98 // Unselect existing items
99 each(menu.items, function(item) {
100 var state = true;
101
102 item.setSelected(0);
103
104 if (list && !item.isDisabled()) {
105 each(fmtList, function(fmt) {
106 if (fmt.id == item.id) {
107 if (!hasFormat(list, fmt)) {
108 state = false;
109 return false;
110 }
111 }
112 });
113
114 if (state)
115 item.setSelected(1);
116 }
117 });
118
119 // Select the current format
120 if (!list)
121 menu.items[format.id].setSelected(1);
122 }
123 });
124
125 menu.add({id : t.editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
126
127 each(t[name], function(item) {
128 item.id = t.editor.dom.uniqueId();
129
130 menu.add({id : item.id, title : item.title, onclick : function() {
131 format = item;
132 applyListFormat();
133 }});
134 });
135 });
136
137 return btn;
138 }
139 },
140
141 getInfo : function() {
142 return {
143 longname : 'Advanced lists',
144 author : 'Moxiecode Systems AB',
145 authorurl : 'http://tinymce.moxiecode.com',
146 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
147 version : tinymce.majorVersion + "." + tinymce.minorVersion
148 };
149 }
150 });
151
152 // Register plugin
153 tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin);
154 })();
...\ No newline at end of file ...\ No newline at end of file
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.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 /**
13 * Auto Resize
14 *
15 * This plugin automatically resizes the content area to fit its content height.
16 * It will retain a minimum height, which is the height of the content area when
17 * it's initialized.
18 */
19 tinymce.create('tinymce.plugins.AutoResizePlugin', {
20 /**
21 * Initializes the plugin, this will be executed after the plugin has been created.
22 * This call is done before the editor instance has finished it's initialization so use the onInit event
23 * of the editor instance to intercept that event.
24 *
25 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
26 * @param {string} url Absolute URL to where the plugin is located.
27 */
28 init : function(ed, url) {
29 var t = this;
30
31 if (ed.getParam('fullscreen_is_enabled'))
32 return;
33
34 /**
35 * This method gets executed each time the editor needs to resize.
36 */
37 function resize() {
38 var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
39
40 // Get height differently depending on the browser used
41 myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
42
43 // Don't make it smaller than the minimum height
44 if (myHeight > t.autoresize_min_height)
45 resizeHeight = myHeight;
46
47 // Resize content element
48 DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
49
50 // if we're throbbing, we'll re-throb to match the new size
51 if (t.throbbing) {
52 ed.setProgressState(false);
53 ed.setProgressState(true);
54 }
55 };
56
57 t.editor = ed;
58
59 // Define minimum height
60 t.autoresize_min_height = ed.getElement().offsetHeight;
61
62 // Add appropriate listeners for resizing content area
63 ed.onChange.add(resize);
64 ed.onSetContent.add(resize);
65 ed.onPaste.add(resize);
66 ed.onKeyUp.add(resize);
67 ed.onPostRender.add(resize);
68
69 if (ed.getParam('autoresize_on_init', true)) {
70 // Things to do when the editor is ready
71 ed.onInit.add(function(ed, l) {
72 // Show throbber until content area is resized properly
73 ed.setProgressState(true);
74 t.throbbing = true;
75
76 // Hide scrollbars
77 ed.getBody().style.overflowY = "hidden";
78 });
79
80 ed.onLoadContent.add(function(ed, l) {
81 resize();
82
83 // Because the content area resizes when its content CSS loads,
84 // and we can't easily add a listener to its onload event,
85 // we'll just trigger a resize after a short loading period
86 setTimeout(function() {
87 resize();
88
89 // Disable throbber
90 ed.setProgressState(false);
91 t.throbbing = false;
92 }, 1250);
93 });
94 }
95
96 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
97 ed.addCommand('mceAutoResize', resize);
98 },
99
100 /**
101 * Returns information about the plugin as a name/value array.
102 * The current keys are longname, author, authorurl, infourl and version.
103 *
104 * @return {Object} Name/value array containing information about the plugin.
105 */
106 getInfo : function() {
107 return {
108 longname : 'Auto Resize',
109 author : 'Moxiecode Systems AB',
110 authorurl : 'http://tinymce.moxiecode.com',
111 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
112 version : tinymce.majorVersion + "." + tinymce.minorVersion
113 };
114 }
115 });
116
117 // Register plugin
118 tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
119 })();
...\ No newline at end of file ...\ No newline at end of file
1 (function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s|&nbsp;|<\/?p[^>]*>|<br[^>]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},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:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()<i.getTime()){return b}h.removeDraft()}else{return b}}}return false},removeDraft:function(){var h=this,k=h.storage,i=h.key,j;if(k){j=k.getItem(i);k.removeItem(i);k.removeItem(i+"_expires");if(j){h.onRemoveDraft.dispatch(h,{content:j})}}},"static":{_beforeUnloadHandler:function(h){var i;e.each(tinyMCE.editors,function(j){if(j.plugins.autosave){j.plugins.autosave.storeDraft()}if(j.getParam("fullscreen_is_enabled")){return}if(!i&&j.isDirty()&&j.getParam("autosave_ask_before_unload")){i=j.getLang("autosave.unload_msg")}});return i}}});e.PluginManager.add("autosave",e.plugins.AutoSave)})(tinymce);
...\ No newline at end of file ...\ No newline at end of file
1 tinyMCE.addI18n('en.autosave',{
2 restore_content: "Restore auto-saved content",
3 warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
4 });
...\ No newline at end of file ...\ No newline at end of file
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(/&nbsp;/gi," ");b(/&quot;/gi,'"');b(/&lt;/gi,"<");b(/&gt;/gi,">");b(/&amp;/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>&nbsp;');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.BBCodePlugin', {
13 init : function(ed, url) {
14 var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
15
16 ed.onBeforeSetContent.add(function(ed, o) {
17 o.content = t['_' + dialect + '_bbcode2html'](o.content);
18 });
19
20 ed.onPostProcess.add(function(ed, o) {
21 if (o.set)
22 o.content = t['_' + dialect + '_bbcode2html'](o.content);
23
24 if (o.get)
25 o.content = t['_' + dialect + '_html2bbcode'](o.content);
26 });
27 },
28
29 getInfo : function() {
30 return {
31 longname : 'BBCode Plugin',
32 author : 'Moxiecode Systems AB',
33 authorurl : 'http://tinymce.moxiecode.com',
34 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
35 version : tinymce.majorVersion + "." + tinymce.minorVersion
36 };
37 },
38
39 // Private methods
40
41 // HTML -> BBCode in PunBB dialect
42 _punbb_html2bbcode : function(s) {
43 s = tinymce.trim(s);
44
45 function rep(re, str) {
46 s = s.replace(re, str);
47 };
48
49 // example: <strong> to [b]
50 rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]");
51 rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
52 rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
53 rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
54 rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
55 rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]");
56 rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
57 rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]");
58 rep(/<font>(.*?)<\/font>/gi,"$1");
59 rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
60 rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
61 rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
62 rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
63 rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
64 rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
65 rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
66 rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
67 rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
68 rep(/<\/(strong|b)>/gi,"[/b]");
69 rep(/<(strong|b)>/gi,"[b]");
70 rep(/<\/(em|i)>/gi,"[/i]");
71 rep(/<(em|i)>/gi,"[i]");
72 rep(/<\/u>/gi,"[/u]");
73 rep(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]");
74 rep(/<u>/gi,"[u]");
75 rep(/<blockquote[^>]*>/gi,"[quote]");
76 rep(/<\/blockquote>/gi,"[/quote]");
77 rep(/<br \/>/gi,"\n");
78 rep(/<br\/>/gi,"\n");
79 rep(/<br>/gi,"\n");
80 rep(/<p>/gi,"");
81 rep(/<\/p>/gi,"\n");
82 rep(/&nbsp;/gi," ");
83 rep(/&quot;/gi,"\"");
84 rep(/&lt;/gi,"<");
85 rep(/&gt;/gi,">");
86 rep(/&amp;/gi,"&");
87
88 return s;
89 },
90
91 // BBCode -> HTML from PunBB dialect
92 _punbb_bbcode2html : function(s) {
93 s = tinymce.trim(s);
94
95 function rep(re, str) {
96 s = s.replace(re, str);
97 };
98
99 // example: [b] to <strong>
100 rep(/\n/gi,"<br />");
101 rep(/\[b\]/gi,"<strong>");
102 rep(/\[\/b\]/gi,"</strong>");
103 rep(/\[i\]/gi,"<em>");
104 rep(/\[\/i\]/gi,"</em>");
105 rep(/\[u\]/gi,"<u>");
106 rep(/\[\/u\]/gi,"</u>");
107 rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>");
108 rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
109 rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
110 rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
111 rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
112 rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");
113
114 return s;
115 }
116 });
117
118 // Register plugin
119 tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
120 })();
...\ No newline at end of file ...\ No newline at end of file
1 (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this,g;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(h,i){if(!i.ctrlKey){if(g){h.selection.setRng(g)}f._getMenu(h).showMenu(i.clientX,i.clientY);a.add(h.getDoc(),"click",function(j){e(h,j)});a.cancel(i)}});d.onRemove.add(function(){if(f._menu){f._menu.removeAll()}});function e(h,i){g=null;if(i&&i.button==2){g=h.selection.getRng();return}if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(h.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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
13
14 /**
15 * This plugin a context menu to TinyMCE editor instances.
16 *
17 * @class tinymce.plugins.ContextMenu
18 */
19 tinymce.create('tinymce.plugins.ContextMenu', {
20 /**
21 * Initializes the plugin, this will be executed after the plugin has been created.
22 * This call is done before the editor instance has finished it's initialization so use the onInit event
23 * of the editor instance to intercept that event.
24 *
25 * @method init
26 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
27 * @param {string} url Absolute URL to where the plugin is located.
28 */
29 init : function(ed) {
30 var t = this, lastRng;
31
32 t.editor = ed;
33
34 /**
35 * This event gets fired when the context menu is shown.
36 *
37 * @event onContextMenu
38 * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
39 * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
40 */
41 t.onContextMenu = new tinymce.util.Dispatcher(this);
42
43 ed.onContextMenu.add(function(ed, e) {
44 if (!e.ctrlKey) {
45 // Restore the last selection since it was removed
46 if (lastRng)
47 ed.selection.setRng(lastRng);
48
49 t._getMenu(ed).showMenu(e.clientX, e.clientY);
50 Event.add(ed.getDoc(), 'click', function(e) {
51 hide(ed, e);
52 });
53 Event.cancel(e);
54 }
55 });
56
57 ed.onRemove.add(function() {
58 if (t._menu)
59 t._menu.removeAll();
60 });
61
62 function hide(ed, e) {
63 lastRng = null;
64
65 // Since the contextmenu event moves
66 // the selection we need to store it away
67 if (e && e.button == 2) {
68 lastRng = ed.selection.getRng();
69 return;
70 }
71
72 if (t._menu) {
73 t._menu.removeAll();
74 t._menu.destroy();
75 Event.remove(ed.getDoc(), 'click', hide);
76 }
77 };
78
79 ed.onMouseDown.add(hide);
80 ed.onKeyDown.add(hide);
81 },
82
83 /**
84 * Returns information about the plugin as a name/value array.
85 * The current keys are longname, author, authorurl, infourl and version.
86 *
87 * @method getInfo
88 * @return {Object} Name/value array containing information about the plugin.
89 */
90 getInfo : function() {
91 return {
92 longname : 'Contextmenu',
93 author : 'Moxiecode Systems AB',
94 authorurl : 'http://tinymce.moxiecode.com',
95 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
96 version : tinymce.majorVersion + "." + tinymce.minorVersion
97 };
98 },
99
100 _getMenu : function(ed) {
101 var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;
102
103 if (m) {
104 m.removeAll();
105 m.destroy();
106 }
107
108 p1 = DOM.getPos(ed.getContentAreaContainer());
109 p2 = DOM.getPos(ed.getContainer());
110
111 m = ed.controlManager.createDropMenu('contextmenu', {
112 offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),
113 offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),
114 constrain : 1
115 });
116
117 t._menu = m;
118
119 m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
120 m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
121 m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
122
123 if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
124 m.addSeparator();
125 m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
126 m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
127 }
128
129 m.addSeparator();
130 m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
131
132 m.addSeparator();
133 am = m.addMenu({title : 'contextmenu.align'});
134 am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
135 am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
136 am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
137 am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
138
139 t.onContextMenu.dispatch(t, m, el, col);
140
141 return m;
142 }
143 });
144
145 // Register plugin
146 tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
147 })();
...\ No newline at end of file ...\ No newline at end of file
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.Directionality', {
13 init : function(ed, url) {
14 var t = this;
15
16 t.editor = ed;
17
18 ed.addCommand('mceDirectionLTR', function() {
19 var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
20
21 if (e) {
22 if (ed.dom.getAttrib(e, "dir") != "ltr")
23 ed.dom.setAttrib(e, "dir", "ltr");
24 else
25 ed.dom.setAttrib(e, "dir", "");
26 }
27
28 ed.nodeChanged();
29 });
30
31 ed.addCommand('mceDirectionRTL', function() {
32 var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
33
34 if (e) {
35 if (ed.dom.getAttrib(e, "dir") != "rtl")
36 ed.dom.setAttrib(e, "dir", "rtl");
37 else
38 ed.dom.setAttrib(e, "dir", "");
39 }
40
41 ed.nodeChanged();
42 });
43
44 ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
45 ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
46
47 ed.onNodeChange.add(t._nodeChange, t);
48 },
49
50 getInfo : function() {
51 return {
52 longname : 'Directionality',
53 author : 'Moxiecode Systems AB',
54 authorurl : 'http://tinymce.moxiecode.com',
55 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
56 version : tinymce.majorVersion + "." + tinymce.minorVersion
57 };
58 },
59
60 // Private methods
61
62 _nodeChange : function(ed, cm, n) {
63 var dom = ed.dom, dir;
64
65 n = dom.getParent(n, dom.isBlock);
66 if (!n) {
67 cm.setDisabled('ltr', 1);
68 cm.setDisabled('rtl', 1);
69 return;
70 }
71
72 dir = dom.getAttrib(n, 'dir');
73 cm.setActive('ltr', dir == "ltr");
74 cm.setDisabled('ltr', 0);
75 cm.setActive('rtl', dir == "rtl");
76 cm.setDisabled('rtl', 0);
77 }
78 });
79
80 // Register plugin
81 tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
82 })();
...\ No newline at end of file ...\ No newline at end of file
1 (function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.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:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function(tinymce) {
12 tinymce.create('tinymce.plugins.EmotionsPlugin', {
13 init : function(ed, url) {
14 // Register commands
15 ed.addCommand('mceEmotion', function() {
16 ed.windowManager.open({
17 file : url + '/emotions.htm',
18 width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
19 height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
20 inline : 1
21 }, {
22 plugin_url : url
23 });
24 });
25
26 // Register buttons
27 ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
28 },
29
30 getInfo : function() {
31 return {
32 longname : 'Emotions',
33 author : 'Moxiecode Systems AB',
34 authorurl : 'http://tinymce.moxiecode.com',
35 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
36 version : tinymce.majorVersion + "." + tinymce.minorVersion
37 };
38 }
39 });
40
41 // Register plugin
42 tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
43 })(tinymce);
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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>
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);
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 ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
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 <input type="button" id="insert" name="insert" value="{#insert}" onclick="ExampleDialog.insert();" />
17 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
18 </div>
19 </form>
20
21 </body>
22 </html>
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 // Load plugin specific language pack
13 tinymce.PluginManager.requireLangPack('example');
14
15 tinymce.create('tinymce.plugins.ExamplePlugin', {
16 /**
17 * Initializes the plugin, this will be executed after the plugin has been created.
18 * This call is done before the editor instance has finished it's initialization so use the onInit event
19 * of the editor instance to intercept that event.
20 *
21 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
22 * @param {string} url Absolute URL to where the plugin is located.
23 */
24 init : function(ed, url) {
25 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
26 ed.addCommand('mceExample', function() {
27 ed.windowManager.open({
28 file : url + '/dialog.htm',
29 width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
30 height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
31 inline : 1
32 }, {
33 plugin_url : url, // Plugin absolute URL
34 some_custom_arg : 'custom arg' // Custom argument
35 });
36 });
37
38 // Register example button
39 ed.addButton('example', {
40 title : 'example.desc',
41 cmd : 'mceExample',
42 image : url + '/img/example.gif'
43 });
44
45 // Add a node change handler, selects the button in the UI when a image is selected
46 ed.onNodeChange.add(function(ed, cm, n) {
47 cm.setActive('example', n.nodeName == 'IMG');
48 });
49 },
50
51 /**
52 * Creates control instances based in the incomming name. This method is normally not
53 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
54 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
55 * method can be used to create those.
56 *
57 * @param {String} n Name of the control to create.
58 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
59 * @return {tinymce.ui.Control} New control instance or null if no control was created.
60 */
61 createControl : function(n, cm) {
62 return null;
63 },
64
65 /**
66 * Returns information about the plugin as a name/value array.
67 * The current keys are longname, author, authorurl, infourl and version.
68 *
69 * @return {Object} Name/value array containing information about the plugin.
70 */
71 getInfo : function() {
72 return {
73 longname : 'Example plugin',
74 author : 'Some author',
75 authorurl : 'http://tinymce.moxiecode.com',
76 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
77 version : "1.0"
78 };
79 }
80 });
81
82 // Register plugin
83 tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
84 })();
...\ No newline at end of file ...\ No newline at end of file
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);
1 tinyMCE.addI18n('en.example',{
2 desc : 'This is just a template button'
3 });
1 tinyMCE.addI18n('en.example_dlg',{
2 title : 'This is just a example title'
3 });
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 ...\ No newline at end of file
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.format=="raw"&&h.head){return}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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.FullPagePlugin', {
13 init : function(ed, url) {
14 var t = this;
15
16 t.editor = ed;
17
18 // Register commands
19 ed.addCommand('mceFullPageProperties', function() {
20 ed.windowManager.open({
21 file : url + '/fullpage.htm',
22 width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
23 height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
24 inline : 1
25 }, {
26 plugin_url : url,
27 head_html : t.head
28 });
29 });
30
31 // Register buttons
32 ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
33
34 ed.onBeforeSetContent.add(t._setContent, t);
35 ed.onSetContent.add(t._setBodyAttribs, t);
36 ed.onGetContent.add(t._getContent, t);
37 },
38
39 getInfo : function() {
40 return {
41 longname : 'Fullpage',
42 author : 'Moxiecode Systems AB',
43 authorurl : 'http://tinymce.moxiecode.com',
44 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
45 version : tinymce.majorVersion + "." + tinymce.minorVersion
46 };
47 },
48
49 // Private plugin internal methods
50
51 _setBodyAttribs : function(ed, o) {
52 var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);
53
54 if (attr && attr[1]) {
55 bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);
56
57 if (bdattr) {
58 for(i = 0, len = bdattr.length; i < len; i++) {
59 kv = bdattr[i].split('=');
60 k = kv[0].replace(/\s/,'');
61 v = kv[1];
62
63 if (v) {
64 v = v.replace(/^\s+/,'').replace(/\s+$/,'');
65 t = v.match(/^["'](.*)["']$/);
66
67 if (t)
68 v = t[1];
69 } else
70 v = k;
71
72 ed.dom.setAttrib(ed.getBody(), 'style', v);
73 }
74 }
75 }
76 },
77
78 _createSerializer : function() {
79 return new tinymce.dom.Serializer({
80 dom : this.editor.dom,
81 apply_source_formatting : true
82 });
83 },
84
85 _setContent : function(ed, o) {
86 var t = this, sp, ep, c = o.content, v, st = '';
87
88 // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
89 if (o.format == 'raw' && t.head)
90 return;
91
92 if (o.source_view && ed.getParam('fullpage_hide_in_source_view'))
93 return;
94
95 // Parse out head, body and footer
96 c = c.replace(/<(\/?)BODY/gi, '<$1body');
97 sp = c.indexOf('<body');
98
99 if (sp != -1) {
100 sp = c.indexOf('>', sp);
101 t.head = c.substring(0, sp + 1);
102
103 ep = c.indexOf('</body', sp);
104 if (ep == -1)
105 ep = c.indexOf('</body', ep);
106
107 o.content = c.substring(sp + 1, ep);
108 t.foot = c.substring(ep);
109
110 function low(s) {
111 return s.replace(/<\/?[A-Z]+/g, function(a) {
112 return a.toLowerCase();
113 })
114 };
115
116 t.head = low(t.head);
117 t.foot = low(t.foot);
118 } else {
119 t.head = '';
120 if (ed.getParam('fullpage_default_xml_pi'))
121 t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
122
123 t.head += ed.getParam('fullpage_default_doctype', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
124 t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
125
126 if (v = ed.getParam('fullpage_default_encoding'))
127 t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
128
129 if (v = ed.getParam('fullpage_default_font_family'))
130 st += 'font-family: ' + v + ';';
131
132 if (v = ed.getParam('fullpage_default_font_size'))
133 st += 'font-size: ' + v + ';';
134
135 if (v = ed.getParam('fullpage_default_text_color'))
136 st += 'color: ' + v + ';';
137
138 t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
139 t.foot = '\n</body>\n</html>';
140 }
141 },
142
143 _getContent : function(ed, o) {
144 var t = this;
145
146 if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view'))
147 o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
148 }
149 });
150
151 // Register plugin
152 tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
153 })();
...\ No newline at end of file ...\ No newline at end of file
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 ...\ No newline at end of file
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();e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var m=tinymce.DOM.getViewPort(),k=e.fullscreenEditor,j,l;j=k.dom.getSize(k.getContainer().firstChild);l=k.dom.getSize(k.getContainer().getElementsByTagName("iframe")[0]);k.theme.resizeTo(m.w-j.w+l.w,m.h-j.h+l.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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 var DOM = tinymce.DOM;
13
14 tinymce.create('tinymce.plugins.FullScreenPlugin', {
15 init : function(ed, url) {
16 var t = this, s = {}, vp;
17
18 t.editor = ed;
19
20 // Register commands
21 ed.addCommand('mceFullScreen', function() {
22 var win, de = DOM.doc.documentElement;
23
24 if (ed.getParam('fullscreen_is_enabled')) {
25 if (ed.getParam('fullscreen_new_window'))
26 closeFullscreen(); // Call to close in new window
27 else {
28 DOM.win.setTimeout(function() {
29 tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
30 tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
31 tinyMCE.remove(ed);
32 DOM.remove('mce_fullscreen_container');
33 de.style.overflow = ed.getParam('fullscreen_html_overflow');
34 DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
35 DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
36 tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
37 }, 10);
38 }
39
40 return;
41 }
42
43 if (ed.getParam('fullscreen_new_window')) {
44 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);
45 try {
46 win.resizeTo(screen.availWidth, screen.availHeight);
47 } catch (e) {
48 // Ignore
49 }
50 } else {
51 tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
52 s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
53 s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
54 vp = DOM.getViewPort();
55 s.fullscreen_scrollx = vp.x;
56 s.fullscreen_scrolly = vp.y;
57
58 // Fixes an Opera bug where the scrollbars doesn't reappear
59 if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
60 s.fullscreen_overflow = 'auto';
61
62 // Fixes an IE bug where horizontal scrollbars would appear
63 if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
64 s.fullscreen_overflow = 'auto';
65
66 // Fixes an IE bug where the scrollbars doesn't reappear
67 if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
68 s.fullscreen_html_overflow = 'auto';
69
70 if (s.fullscreen_overflow == '0px')
71 s.fullscreen_overflow = '';
72
73 DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
74 de.style.overflow = 'hidden'; //Fix for IE6/7
75 vp = DOM.getViewPort();
76 DOM.win.scrollTo(0, 0);
77
78 if (tinymce.isIE)
79 vp.h -= 1;
80
81 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;'});
82 DOM.add(n, 'div', {id : 'mce_fullscreen'});
83
84 tinymce.each(ed.settings, function(v, n) {
85 s[n] = v;
86 });
87
88 s.id = 'mce_fullscreen';
89 s.width = n.clientWidth;
90 s.height = n.clientHeight - 15;
91 s.fullscreen_is_enabled = true;
92 s.fullscreen_editor_id = ed.id;
93 s.theme_advanced_resizing = false;
94 s.save_onsavecallback = function() {
95 ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});
96 ed.execCommand('mceSave');
97 };
98
99 tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
100 s[k] = v;
101 });
102
103 if (s.theme_advanced_toolbar_location === 'external')
104 s.theme_advanced_toolbar_location = 'top';
105
106 t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
107 t.fullscreenEditor.onInit.add(function() {
108 t.fullscreenEditor.setContent(ed.getContent());
109 t.fullscreenEditor.focus();
110 });
111
112 t.fullscreenEditor.render();
113
114 t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
115 t.fullscreenElement.update();
116 //document.body.overflow = 'hidden';
117
118 t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
119 var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
120
121 // Get outer/inner size to get a delta size that can be used to calc the new iframe size
122 outerSize = fed.dom.getSize(fed.getContainer().firstChild);
123 innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
124
125 fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
126 });
127 }
128 });
129
130 // Register buttons
131 ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
132
133 ed.onNodeChange.add(function(ed, cm) {
134 cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
135 });
136 },
137
138 getInfo : function() {
139 return {
140 longname : 'Fullscreen',
141 author : 'Moxiecode Systems AB',
142 authorurl : 'http://tinymce.moxiecode.com',
143 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
144 version : tinymce.majorVersion + "." + tinymce.minorVersion
145 };
146 }
147 });
148
149 // Register plugin
150 tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
151 })();
...\ No newline at end of file ...\ No newline at end of file
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <title></title>
5 <script type="text/javascript" src="../../tiny_mce.js"></script>
6 <script type="text/javascript">
7 function patchCallback(settings, key) {
8 if (settings[key])
9 settings[key] = "window.opener." + settings[key];
10 }
11
12 var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
13
14 // Clone array
15 for (var n in paSe)
16 settings[n] = paSe[n];
17
18 // Override options for fullscreen
19 for (var n in paSe.fullscreen_settings)
20 settings[n] = paSe.fullscreen_settings[n];
21
22 // Patch callbacks, make them point to window.opener
23 patchCallback(settings, 'urlconverter_callback');
24 patchCallback(settings, 'insertlink_callback');
25 patchCallback(settings, 'insertimage_callback');
26 patchCallback(settings, 'setupcontent_callback');
27 patchCallback(settings, 'save_callback');
28 patchCallback(settings, 'onchange_callback');
29 patchCallback(settings, 'init_instance_callback');
30 patchCallback(settings, 'file_browser_callback');
31 patchCallback(settings, 'cleanup_callback');
32 patchCallback(settings, 'execcommand_callback');
33 patchCallback(settings, 'oninit');
34
35 // Set options
36 delete settings.id;
37 settings['mode'] = 'exact';
38 settings['elements'] = 'fullscreenarea';
39 settings['add_unload_trigger'] = false;
40 settings['ask'] = false;
41 settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
42 settings['fullscreen_is_enabled'] = true;
43 settings['fullscreen_editor_id'] = oeID;
44 settings['theme_advanced_resizing'] = false;
45 settings['strict_loading_mode'] = true;
46
47 settings.save_onsavecallback = function() {
48 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
49 window.opener.tinyMCE.get(oeID).execCommand('mceSave');
50 window.close();
51 };
52
53 function unloadHandler(e) {
54 moveContent();
55 }
56
57 function moveContent() {
58 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
59 }
60
61 function closeFullscreen() {
62 moveContent();
63 window.close();
64 }
65
66 function doParentSubmit() {
67 moveContent();
68
69 if (window.opener.tinyMCE.selectedInstance.formElement.form)
70 window.opener.tinyMCE.selectedInstance.formElement.form.submit();
71
72 window.close();
73
74 return false;
75 }
76
77 function render() {
78 var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
79
80 e.value = window.opener.tinyMCE.get(oeID).getContent();
81
82 vp = dom.getViewPort();
83 settings.width = vp.w;
84 settings.height = vp.h - 15;
85
86 tinymce.dom.Event.add(window, 'resize', function() {
87 var vp = dom.getViewPort();
88
89 tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
90 });
91
92 tinyMCE.init(settings);
93 }
94
95 // Add onunload
96 tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
97 </script>
98 </head>
99 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
100 <form onsubmit="doParentSubmit();">
101 <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
102 </form>
103
104 <script type="text/javascript">
105 render();
106 </script>
107
108 </body>
109 </html>
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.IESpell', {
13 init : function(ed, url) {
14 var t = this, sp;
15
16 if (!tinymce.isIE)
17 return;
18
19 t.editor = ed;
20
21 // Register commands
22 ed.addCommand('mceIESpell', function() {
23 try {
24 sp = new ActiveXObject("ieSpell.ieSpellExtension");
25 sp.CheckDocumentNode(ed.getDoc().documentElement);
26 } catch (e) {
27 if (e.number == -2146827859) {
28 ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
29 if (s)
30 window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
31 });
32 } else
33 ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
34 }
35 });
36
37 // Register buttons
38 ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
39 },
40
41 getInfo : function() {
42 return {
43 longname : 'IESpell (IE Only)',
44 author : 'Moxiecode Systems AB',
45 authorurl : 'http://tinymce.moxiecode.com',
46 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
47 version : tinymce.majorVersion + "." + tinymce.minorVersion
48 };
49 }
50 });
51
52 // Register plugin
53 tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
54 })();
...\ No newline at end of file ...\ No newline at end of file
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)}
91
92 /* IE9 fixes */
93 .clearlooks2.ie9 .mceTop .mceCenter {clip:auto;}
94 .clearlooks2.ie9 .mceMiddle {clip:auto;}
95 .clearlooks2.ie9 .mceMiddle .mceLeft, .clearlooks2.ie9 .mceMiddle .mceRight {top: 23px;}
96 .clearlooks2.ie9 .mceAlert .mceMiddle span, .clearlooks2.ie9 .mceConfirm .mceMiddle span {top:13px;}
97 .clearlooks2.ie9 .mceModal .mceMiddle {top:23px}
98 .clearlooks2.ie9 .mceModal .mceMiddle .mceLeft, .clearlooks2.ie9 .mceModal .mceMiddle .mceRight {top: 0}
99 .clearlooks2.ie9 .mceMiddle .mceIcon {top:13px}
100 .clearlooks2.ie9 .mceTop .mceCenter {top:0; right:auto; left:6px; width:calc(100%-12px)}
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.InsertDateTime', {
13 init : function(ed, url) {
14 var t = this;
15
16 t.editor = ed;
17
18 ed.addCommand('mceInsertDate', function() {
19 var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_dateFormat", ed.getLang('insertdatetime.date_fmt')));
20
21 ed.execCommand('mceInsertContent', false, str);
22 });
23
24 ed.addCommand('mceInsertTime', function() {
25 var str = t._getDateTime(new Date(), ed.getParam("plugin_insertdate_timeFormat", ed.getLang('insertdatetime.time_fmt')));
26
27 ed.execCommand('mceInsertContent', false, str);
28 });
29
30 ed.addButton('insertdate', {title : 'insertdatetime.insertdate_desc', cmd : 'mceInsertDate'});
31 ed.addButton('inserttime', {title : 'insertdatetime.inserttime_desc', cmd : 'mceInsertTime'});
32 },
33
34 getInfo : function() {
35 return {
36 longname : 'Insert date/time',
37 author : 'Moxiecode Systems AB',
38 authorurl : 'http://tinymce.moxiecode.com',
39 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime',
40 version : tinymce.majorVersion + "." + tinymce.minorVersion
41 };
42 },
43
44 // Private methods
45
46 _getDateTime : function(d, fmt) {
47 var ed = this.editor;
48
49 function addZeros(value, len) {
50 value = "" + value;
51
52 if (value.length < len) {
53 for (var i=0; i<(len-value.length); i++)
54 value = "0" + value;
55 }
56
57 return value;
58 };
59
60 fmt = fmt.replace("%D", "%m/%d/%y");
61 fmt = fmt.replace("%r", "%I:%M:%S %p");
62 fmt = fmt.replace("%Y", "" + d.getFullYear());
63 fmt = fmt.replace("%y", "" + d.getYear());
64 fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
65 fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
66 fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
67 fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
68 fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
69 fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
70 fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
71 fmt = fmt.replace("%B", "" + ed.getLang("insertdatetime.months_long").split(',')[d.getMonth()]);
72 fmt = fmt.replace("%b", "" + ed.getLang("insertdatetime.months_short").split(',')[d.getMonth()]);
73 fmt = fmt.replace("%A", "" + ed.getLang("insertdatetime.day_long").split(',')[d.getDay()]);
74 fmt = fmt.replace("%a", "" + ed.getLang("insertdatetime.day_short").split(',')[d.getDay()]);
75 fmt = fmt.replace("%%", "%");
76
77 return fmt;
78 }
79 });
80
81 // Register plugin
82 tinymce.PluginManager.add('insertdatetime', tinymce.plugins.InsertDateTime);
83 })();
...\ No newline at end of file ...\ No newline at end of file
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 ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 */
10
11 (function() {
12 tinymce.create('tinymce.plugins.Layer', {
13 init : function(ed, url) {
14 var t = this;
15
16 t.editor = ed;
17
18 // Register commands
19 ed.addCommand('mceInsertLayer', t._insertLayer, t);
20
21 ed.addCommand('mceMoveForward', function() {
22 t._move(1);
23 });
24
25 ed.addCommand('mceMoveBackward', function() {
26 t._move(-1);
27 });
28
29 ed.addCommand('mceMakeAbsolute', function() {
30 t._toggleAbsolute();
31 });
32
33 // Register buttons
34 ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'});
35 ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'});
36 ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'});
37 ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'});
38
39 ed.onInit.add(function() {
40 if (tinymce.isIE)
41 ed.getDoc().execCommand('2D-Position', false, true);
42 });
43
44 ed.onNodeChange.add(t._nodeChange, t);
45 ed.onVisualAid.add(t._visualAid, t);
46 },
47
48 getInfo : function() {
49 return {
50 longname : 'Layer',
51 author : 'Moxiecode Systems AB',
52 authorurl : 'http://tinymce.moxiecode.com',
53 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer',
54 version : tinymce.majorVersion + "." + tinymce.minorVersion
55 };
56 },
57
58 // Private methods
59
60 _nodeChange : function(ed, cm, n) {
61 var le, p;
62
63 le = this._getParentLayer(n);
64 p = ed.dom.getParent(n, 'DIV,P,IMG');
65
66 if (!p) {
67 cm.setDisabled('absolute', 1);
68 cm.setDisabled('moveforward', 1);
69 cm.setDisabled('movebackward', 1);
70 } else {
71 cm.setDisabled('absolute', 0);
72 cm.setDisabled('moveforward', !le);
73 cm.setDisabled('movebackward', !le);
74 cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute");
75 }
76 },
77
78 // Private methods
79
80 _visualAid : function(ed, e, s) {
81 var dom = ed.dom;
82
83 tinymce.each(dom.select('div,p', e), function(e) {
84 if (/^(absolute|relative|static)$/i.test(e.style.position)) {
85 if (s)
86 dom.addClass(e, 'mceItemVisualAid');
87 else
88 dom.removeClass(e, 'mceItemVisualAid');
89 }
90 });
91 },
92
93 _move : function(d) {
94 var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl;
95
96 nl = [];
97 tinymce.walk(ed.getBody(), function(n) {
98 if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position))
99 nl.push(n);
100 }, 'childNodes');
101
102 // Find z-indexes
103 for (i=0; i<nl.length; i++) {
104 z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex) : 0;
105
106 if (ci < 0 && nl[i] == le)
107 ci = i;
108 }
109
110 if (d < 0) {
111 // Move back
112
113 // Try find a lower one
114 for (i=0; i<z.length; i++) {
115 if (z[i] < z[ci]) {
116 fi = i;
117 break;
118 }
119 }
120
121 if (fi > -1) {
122 nl[ci].style.zIndex = z[fi];
123 nl[fi].style.zIndex = z[ci];
124 } else {
125 if (z[ci] > 0)
126 nl[ci].style.zIndex = z[ci] - 1;
127 }
128 } else {
129 // Move forward
130
131 // Try find a higher one
132 for (i=0; i<z.length; i++) {
133 if (z[i] > z[ci]) {
134 fi = i;
135 break;
136 }
137 }
138
139 if (fi > -1) {
140 nl[ci].style.zIndex = z[fi];
141 nl[fi].style.zIndex = z[ci];
142 } else
143 nl[ci].style.zIndex = z[ci] + 1;
144 }
145
146 ed.execCommand('mceRepaint');
147 },
148
149 _getParentLayer : function(n) {
150 return this.editor.dom.getParent(n, function(n) {
151 return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position);
152 });
153 },
154
155 _insertLayer : function() {
156 var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*'));
157
158 ed.dom.add(ed.getBody(), 'div', {
159 style : {
160 position : 'absolute',
161 left : p.x,
162 top : (p.y > 20 ? p.y : 20),
163 width : 100,
164 height : 100
165 },
166 'class' : 'mceItemVisualAid'
167 }, ed.selection.getContent() || ed.getLang('layer.content'));
168 },
169
170 _toggleAbsolute : function() {
171 var ed = this.editor, le = this._getParentLayer(ed.selection.getNode());
172
173 if (!le)
174 le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG');
175
176 if (le) {
177 if (le.style.position.toLowerCase() == "absolute") {
178 ed.dom.setStyles(le, {
179 position : '',
180 left : '',
181 top : '',
182 width : '',
183 height : ''
184 });
185
186 ed.dom.removeClass(le, 'mceItemVisualAid');
187 } else {
188 if (le.style.left == "")
189 le.style.left = 20 + 'px';
190
191 if (le.style.top == "")
192 le.style.top = 20 + 'px';
193
194 if (le.style.width == "")
195 le.style.width = le.width ? (le.width + 'px') : '100px';
196
197 if (le.style.height == "")
198 le.style.height = le.height ? (le.height + 'px') : '100px';
199
200 le.style.position = "absolute";
201 ed.addVisual(ed.getBody());
202 }
203
204 ed.execCommand('mceRepaint');
205 ed.nodeChanged();
206 }
207 }
208 });
209
210 // Register plugin
211 tinymce.PluginManager.add('layer', tinymce.plugins.Layer);
212 })();
...\ No newline at end of file ...\ No newline at end of file
1 (function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.serializer;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"full"}},bold:{inline:"b"},italic:{inline:"i"},underline:{inline:"u"},strikethrough:{inline:"strike"},fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});d._setup();a.each("b,i,u,strike".split(","),function(f){var g=d.rules[f];if(!g){d.addRules(f)}});if(!d.rules.font){d.addRules("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.rules[f],g;if(h){a.each(h.attribs,function(j,i){if(i.name=="align"){g=true;return false}});if(!g){h.attribs.push({name:"align"})}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce);
...\ No newline at end of file ...\ No newline at end of file
1 /**
2 * editor_plugin_src.js
3 *
4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
9 *
10 * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
11 * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
12 *
13 * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
14 * not apart of the newer specifications for HTML and XHTML.
15 */
16
17 (function(tinymce) {
18 // Override inline_styles setting to force TinyMCE to produce deprecated contents
19 tinymce.onAddEditor.addToTop(function(tinymce, editor) {
20 editor.settings.inline_styles = false;
21 });
22
23 // Create the legacy ouput plugin
24 tinymce.create('tinymce.plugins.LegacyOutput', {
25 init : function(editor) {
26 editor.onInit.add(function() {
27 var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
28 fontSizes = tinymce.explode(editor.settings.font_size_style_values),
29 serializer = editor.serializer;
30
31 // Override some internal formats to produce legacy elements and attributes
32 editor.formatter.register({
33 // Change alignment formats to use the deprecated align attribute
34 alignleft : {selector : alignElements, attributes : {align : 'left'}},
35 aligncenter : {selector : alignElements, attributes : {align : 'center'}},
36 alignright : {selector : alignElements, attributes : {align : 'right'}},
37 alignfull : {selector : alignElements, attributes : {align : 'full'}},
38
39 // Change the basic formatting elements to use deprecated element types
40 bold : {inline : 'b'},
41 italic : {inline : 'i'},
42 underline : {inline : 'u'},
43 strikethrough : {inline : 'strike'},
44
45 // Change font size and font family to use the deprecated font element
46 fontname : {inline : 'font', attributes : {face : '%value'}},
47 fontsize : {
48 inline : 'font',
49 attributes : {
50 size : function(vars) {
51 return tinymce.inArray(fontSizes, vars.value) + 1;
52 }
53 }
54 },
55
56 // Setup font elements for colors as well
57 forecolor : {inline : 'font', styles : {color : '%value'}},
58 hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}}
59 });
60
61 // Force parsing of the serializer rules
62 serializer._setup();
63
64 // Check that deprecated elements are allowed if not add them
65 tinymce.each('b,i,u,strike'.split(','), function(name) {
66 var rule = serializer.rules[name];
67
68 if (!rule)
69 serializer.addRules(name);
70 });
71
72 // Add font element if it's missing
73 if (!serializer.rules["font"])
74 serializer.addRules("font[face|size|color|style]");
75
76 // Add the missing and depreacted align attribute for the serialization engine
77 tinymce.each(alignElements.split(','), function(name) {
78 var rule = serializer.rules[name], found;
79
80 if (rule) {
81 tinymce.each(rule.attribs, function(name, attr) {
82 if (attr.name == 'align') {
83 found = true;
84 return false;
85 }
86 });
87
88 if (!found)
89 rule.attribs.push({name : 'align'});
90 }
91 });
92
93 // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes
94 editor.onNodeChange.add(function(editor, control_manager) {
95 var control, fontElm, fontName, fontSize;
96
97 // Find font element get it's name and size
98 fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
99 if (fontElm) {
100 fontName = fontElm.face;
101 fontSize = fontElm.size;
102 }
103
104 // Select/unselect the font name in droplist
105 if (control = control_manager.get('fontselect')) {
106 control.select(function(value) {
107 return value == fontName;
108 });
109 }
110
111 // Select/unselect the font size in droplist
112 if (control = control_manager.get('fontsizeselect')) {
113 control.select(function(value) {
114 var index = tinymce.inArray(fontSizes, value.fontSize);
115
116 return index + 1 == fontSize;
117 });
118 }
119 });
120 });
121 },
122
123 getInfo : function() {
124 return {
125 longname : 'LegacyOutput',
126 author : 'Moxiecode Systems AB',
127 authorurl : 'http://tinymce.moxiecode.com',
128 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput',
129 version : tinymce.majorVersion + "." + tinymce.minorVersion
130 };
131 }
132 });
133
134 // Register plugin
135 tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput);
136 })(tinymce);
...\ No newline at end of file ...\ No newline at end of file
1 .mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}
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);}
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 }
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 ...\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.