summaryrefslogtreecommitdiff
path: root/public/javascripts/tiny_mce/plugins/fullpage
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
committerhukl <contact@smyck.org>2009-02-17 21:54:39 +0100
commitf61b5b0597e0c25f084ee67d402f12a43a7a9947 (patch)
tree3b4c3f9f38637f1a7ecf703ece4fd3bc4c6e2934 /public/javascripts/tiny_mce/plugins/fullpage
parent3d3b786cc43266f6292f5edd25733dbb9bd6ed06 (diff)
added tinymce editor for body area of pages
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/fullpage')
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css182
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js1
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js142
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/fullpage.htm577
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js461
-rwxr-xr-xpublic/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js85
6 files changed, 1448 insertions, 0 deletions
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
new file mode 100755
index 0000000..7a3334f
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
@@ -0,0 +1,182 @@
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
178textarea {
179 height: 55px;
180}
181
182.panel_wrapper div.current {height:420px;} \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
new file mode 100755
index 0000000..727beb5
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
@@ -0,0 +1 @@
(function(){tinymce.create('tinymce.plugins.FullPagePlugin',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceFullPageProperties',function(){ed.windowManager.open({file:url+'/fullpage.htm',width:430+parseInt(ed.getLang('fullpage.delta_width',0)),height:495+parseInt(ed.getLang('fullpage.delta_height',0)),inline:1},{plugin_url:url,head_html:t.head});});ed.addButton('fullpage',{title:'fullpage.desc',cmd:'mceFullPageProperties'});ed.onBeforeSetContent.add(t._setContent,t);ed.onSetContent.add(t._setBodyAttribs,t);ed.onGetContent.add(t._getContent,t);},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(ed,o){var bdattr,i,len,kv,k,v,t,attr=this.head.match(/body(.*?)>/i);if(attr&&attr[1]){bdattr=attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(bdattr){for(i=0,len=bdattr.length;i<len;i++){kv=bdattr[i].split('=');k=kv[0].replace(/\s/,'');v=kv[1];if(v){v=v.replace(/^\s+/,'').replace(/\s+$/,'');t=v.match(/^["'](.*)["']$/);if(t)v=t[1];}else v=k;ed.dom.setAttrib(ed.getBody(),'style',v);}}}},_createSerializer:function(){return new tinymce.dom.Serializer({dom:this.editor.dom,apply_source_formatting:true});},_setContent:function(ed,o){var t=this,sp,ep,c=o.content,v,st='';c=c.replace(/<(\/?)BODY/gi,'<$1body');sp=c.indexOf('<body');if(sp!=-1){sp=c.indexOf('>',sp);t.head=c.substring(0,sp+1);ep=c.indexOf('</body',sp);if(ep==-1)ep=c.indexOf('</body',ep);o.content=c.substring(sp+1,ep);t.foot=c.substring(ep);function low(s){return s.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase();})};t.head=low(t.head);t.foot=low(t.foot);}else{t.head='';if(ed.getParam('fullpage_default_xml_pi'))t.head+='<?xml version="1.0" encoding="'+ed.getParam('fullpage_default_encoding','ISO-8859-1')+'" ?>\n';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">');t.head+='\n<html>\n<head>\n<title>'+ed.getParam('fullpage_default_title','Untitled document')+'</title>\n';if(v=ed.getParam('fullpage_default_encoding'))t.head+='<meta http-equiv="Content-Type" content="'+v+'" />\n';if(v=ed.getParam('fullpage_default_font_family'))st+='font-family: '+v+';';if(v=ed.getParam('fullpage_default_font_size'))st+='font-size: '+v+';';if(v=ed.getParam('fullpage_default_text_color'))st+='color: '+v+';';t.head+='</head>\n<body'+(st?' style="'+st+'"':'')+'>\n';t.foot='\n</body>\n</html>';}},_getContent:function(ed,o){var t=this;o.content=tinymce.trim(t.head)+'\n'+tinymce.trim(o.content)+'\n'+tinymce.trim(t.foot);}});tinymce.PluginManager.add('fullpage',tinymce.plugins.FullPagePlugin);})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
new file mode 100755
index 0000000..019682d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js
@@ -0,0 +1,142 @@
1/**
2 * $Id: editor_plugin_src.js 920 2008-09-09 14:05:33Z spocke $
3 *
4 * @author Moxiecode
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
6 */
7
8(function() {
9 tinymce.create('tinymce.plugins.FullPagePlugin', {
10 init : function(ed, url) {
11 var t = this;
12
13 t.editor = ed;
14
15 // Register commands
16 ed.addCommand('mceFullPageProperties', function() {
17 ed.windowManager.open({
18 file : url + '/fullpage.htm',
19 width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)),
20 height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)),
21 inline : 1
22 }, {
23 plugin_url : url,
24 head_html : t.head
25 });
26 });
27
28 // Register buttons
29 ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'});
30
31 ed.onBeforeSetContent.add(t._setContent, t);
32 ed.onSetContent.add(t._setBodyAttribs, t);
33 ed.onGetContent.add(t._getContent, t);
34 },
35
36 getInfo : function() {
37 return {
38 longname : 'Fullpage',
39 author : 'Moxiecode Systems AB',
40 authorurl : 'http://tinymce.moxiecode.com',
41 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage',
42 version : tinymce.majorVersion + "." + tinymce.minorVersion
43 };
44 },
45
46 // Private plugin internal methods
47
48 _setBodyAttribs : function(ed, o) {
49 var bdattr, i, len, kv, k, v, t, attr = this.head.match(/body(.*?)>/i);
50
51 if (attr && attr[1]) {
52 bdattr = attr[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);
53
54 if (bdattr) {
55 for(i = 0, len = bdattr.length; i < len; i++) {
56 kv = bdattr[i].split('=');
57 k = kv[0].replace(/\s/,'');
58 v = kv[1];
59
60 if (v) {
61 v = v.replace(/^\s+/,'').replace(/\s+$/,'');
62 t = v.match(/^["'](.*)["']$/);
63
64 if (t)
65 v = t[1];
66 } else
67 v = k;
68
69 ed.dom.setAttrib(ed.getBody(), 'style', v);
70 }
71 }
72 }
73 },
74
75 _createSerializer : function() {
76 return new tinymce.dom.Serializer({
77 dom : this.editor.dom,
78 apply_source_formatting : true
79 });
80 },
81
82 _setContent : function(ed, o) {
83 var t = this, sp, ep, c = o.content, v, st = '';
84
85 // Parse out head, body and footer
86 c = c.replace(/<(\/?)BODY/gi, '<$1body');
87 sp = c.indexOf('<body');
88
89 if (sp != -1) {
90 sp = c.indexOf('>', sp);
91 t.head = c.substring(0, sp + 1);
92
93 ep = c.indexOf('</body', sp);
94 if (ep == -1)
95 ep = c.indexOf('</body', ep);
96
97 o.content = c.substring(sp + 1, ep);
98 t.foot = c.substring(ep);
99
100 function low(s) {
101 return s.replace(/<\/?[A-Z]+/g, function(a) {
102 return a.toLowerCase();
103 })
104 };
105
106 t.head = low(t.head);
107 t.foot = low(t.foot);
108 } else {
109 t.head = '';
110 if (ed.getParam('fullpage_default_xml_pi'))
111 t.head += '<?xml version="1.0" encoding="' + ed.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
112
113 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">');
114 t.head += '\n<html>\n<head>\n<title>' + ed.getParam('fullpage_default_title', 'Untitled document') + '</title>\n';
115
116 if (v = ed.getParam('fullpage_default_encoding'))
117 t.head += '<meta http-equiv="Content-Type" content="' + v + '" />\n';
118
119 if (v = ed.getParam('fullpage_default_font_family'))
120 st += 'font-family: ' + v + ';';
121
122 if (v = ed.getParam('fullpage_default_font_size'))
123 st += 'font-size: ' + v + ';';
124
125 if (v = ed.getParam('fullpage_default_text_color'))
126 st += 'color: ' + v + ';';
127
128 t.head += '</head>\n<body' + (st ? ' style="' + st + '"' : '') + '>\n';
129 t.foot = '\n</body>\n</html>';
130 }
131 },
132
133 _getContent : function(ed, o) {
134 var t = this;
135
136 o.content = tinymce.trim(t.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(t.foot);
137 }
138 });
139
140 // Register plugin
141 tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin);
142})(); \ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm
new file mode 100755
index 0000000..d74da0d
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm
@@ -0,0 +1,577 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4 <title>{#fullpage_dlg.title}</title>
5 <script type="text/javascript" src="../../tiny_mce_popup.js"></script>
6 <script type="text/javascript" src="../../utils/mctabs.js"></script>
7 <script type="text/javascript" src="../../utils/form_utils.js"></script>
8 <script type="text/javascript" src="js/fullpage.js"></script>
9 <link href="css/fullpage.css" rel="stylesheet" type="text/css" />
10 <base target="_self" />
11</head>
12<body id="advlink" style="display: none">
13 <form onsubmit="updateAction();return false;" name="fullpage" action="#">
14 <div class="tabs">
15 <ul>
16 <li id="meta_tab" class="current"><span><a href="javascript:mcTabs.displayTab('meta_tab','meta_panel');" onmousedown="return false;">{#fullpage_dlg.meta_tab}</a></span></li>
17 <li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{#fullpage_dlg.appearance_tab}</a></span></li>
18 <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_tab}</a></span></li>
19 </ul>
20 </div>
21
22 <div class="panel_wrapper">
23 <div id="meta_panel" class="panel current">
24 <fieldset>
25 <legend>{#fullpage_dlg.meta_props}</legend>
26
27 <table border="0" cellpadding="4" cellspacing="0">
28 <tr>
29 <td nowrap="nowrap"><label for="metatitle">{#fullpage_dlg.meta_title}</label>&nbsp;</td>
30 <td><input type="text" id="metatitle" name="metatitle" value="" class="mceFocus" /></td>
31 </tr>
32 <tr>
33 <td nowrap="nowrap"><label for="metakeywords">{#fullpage_dlg.meta_keywords}</label>&nbsp;</td>
34 <td><textarea id="metakeywords" name="metakeywords" rows="4"></textarea></td>
35 </tr>
36 <tr>
37 <td nowrap="nowrap"><label for="metadescription">{#fullpage_dlg.meta_description}</label>&nbsp;</td>
38 <td><textarea id="metadescription" name="metadescription" rows="4"></textarea></td>
39 </tr>
40 <tr>
41 <td nowrap="nowrap"><label for="metaauthor">{#fullpage_dlg.author}</label>&nbsp;</td>
42 <td><input type="text" id="metaauthor" name="metaauthor" value="" /></td>
43 </tr>
44 <tr>
45 <td nowrap="nowrap"><label for="metacopyright">{#fullpage_dlg.copyright}</label>&nbsp;</td>
46 <td><input type="text" id="metacopyright" name="metacopyright" value="" /></td>
47 </tr>
48 <tr>
49 <td nowrap="nowrap"><label for="metarobots">{#fullpage_dlg.meta_robots}</label>&nbsp;</td>
50 <td>
51 <select id="metarobots" name="metarobots">
52 <option value="">{#not_set}</option>
53 <option value="index,follow">{#fullpage_dlg.meta_index_follow}</option>
54 <option value="index,nofollow">{#fullpage_dlg.meta_index_nofollow}</option>
55 <option value="noindex,follow">{#fullpage_dlg.meta_noindex_follow}</option>
56 <option value="noindex,nofollow">{#fullpage_dlg.meta_noindex_nofollow}</option>
57 </select>
58 </td>
59 </tr>
60 </table>
61 </fieldset>
62
63 <fieldset>
64 <legend>{#fullpage_dlg.langprops}</legend>
65
66 <table border="0" cellpadding="4" cellspacing="0">
67 <tr>
68 <td class="column1"><label for="docencoding">{#fullpage_dlg.encoding}</label></td>
69 <td>
70 <select id="docencoding" name="docencoding">
71 <option value="">{#not_set}</option>
72 </select>
73 </td>
74 </tr>
75 <tr>
76 <td nowrap="nowrap"><label for="doctypes">{#fullpage_dlg.doctypes}</label>&nbsp;</td>
77 <td>
78 <select id="doctypes" name="doctypes">
79 <option value="">{#not_set}</option>
80 </select>
81 </td>
82 </tr>
83 <tr>
84 <td nowrap="nowrap"><label for="langcode">{#fullpage_dlg.langcode}</label>&nbsp;</td>
85 <td><input type="text" id="langcode" name="langcode" value="" /></td>
86 </tr>
87 <tr>
88 <td class="column1"><label for="langdir">{#fullpage_dlg.langdir}</label></td>
89 <td>
90 <select id="langdir" name="langdir">
91 <option value="">{#not_set}</option>
92 <option value="ltr">{#fullpage_dlg.ltr}</option>
93 <option value="rtl">{#fullpage_dlg.rtl}</option>
94 </select>
95 </td>
96 </tr>
97 <tr>
98 <td nowrap="nowrap"><label for="xml_pi">{#fullpage_dlg.xml_pi}</label>&nbsp;</td>
99 <td><input type="checkbox" id="xml_pi" name="xml_pi" class="checkbox" /></td>
100 </tr>
101 </table>
102 </fieldset>
103 </div>
104
105 <div id="appearance_panel" class="panel">
106 <fieldset>
107 <legend>{#fullpage_dlg.appearance_textprops}</legend>
108
109 <table border="0" cellpadding="4" cellspacing="0">
110 <tr>
111 <td class="column1"><label for="fontface">{#fullpage_dlg.fontface}</label></td>
112 <td>
113 <select id="fontface" name="fontface" onchange="changedStyleField(this);">
114 <option value="">{#not_set}</option>
115 </select>
116 </td>
117 </tr>
118
119 <tr>
120 <td class="column1"><label for="fontsize">{#fullpage_dlg.fontsize}</label></td>
121 <td>
122 <select id="fontsize" name="fontsize" onchange="changedStyleField(this);">
123 <option value="">{#not_set}</option>
124 </select>
125 </td>
126 </tr>
127
128 <tr>
129 <td class="column1"><label for="textcolor">{#fullpage_dlg.textcolor}</label></td>
130 <td>
131 <table border="0" cellpadding="0" cellspacing="0">
132 <tr>
133 <td><input id="textcolor" name="textcolor" type="text" value="" size="9" onchange="updateColor('textcolor_pick','textcolor');changedStyleField(this);" /></td>
134 <td id="textcolor_pickcontainer">&nbsp;</td>
135 </tr>
136 </table>
137 </td>
138 </tr>
139 </table>
140 </fieldset>
141
142 <fieldset>
143 <legend>{#fullpage_dlg.appearance_bgprops}</legend>
144
145 <table border="0" cellpadding="4" cellspacing="0">
146 <tr>
147 <td class="column1"><label for="bgimage">{#fullpage_dlg.bgimage}</label></td>
148 <td>
149 <table border="0" cellpadding="0" cellspacing="0">
150 <tr>
151 <td><input id="bgimage" name="bgimage" type="text" value="" onchange="changedStyleField(this);" /></td>
152 <td id="bgimage_pickcontainer">&nbsp;</td>
153 </tr>
154 </table>
155 </td>
156 </tr>
157 <tr>
158 <td class="column1"><label for="bgcolor">{#fullpage_dlg.bgcolor}</label></td>
159 <td>
160 <table border="0" cellpadding="0" cellspacing="0">
161 <tr>
162 <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedStyleField(this);" /></td>
163 <td id="bgcolor_pickcontainer">&nbsp;</td>
164 </tr>
165 </table>
166 </td>
167 </tr>
168 </table>
169 </fieldset>
170
171 <fieldset>
172 <legend>{#fullpage_dlg.appearance_marginprops}</legend>
173
174 <table border="0" cellpadding="4" cellspacing="0">
175 <tr>
176 <td class="column1"><label for="leftmargin">{#fullpage_dlg.left_margin}</label></td>
177 <td><input id="leftmargin" name="leftmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
178 <td class="column1"><label for="rightmargin">{#fullpage_dlg.right_margin}</label></td>
179 <td><input id="rightmargin" name="rightmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
180 </tr>
181 <tr>
182 <td class="column1"><label for="topmargin">{#fullpage_dlg.top_margin}</label></td>
183 <td><input id="topmargin" name="topmargin" type="text" value="" onchange="changedStyleField(this);" /></td>
184 <td class="column1"><label for="bottommargin">{#fullpage_dlg.bottom_margin}</label></td>
185 <td><input id="bottommargin" name="bottommargin" type="text" value="" onchange="changedStyleField(this);" /></td>
186 </tr>
187 </table>
188 </fieldset>
189
190 <fieldset>
191 <legend>{#fullpage_dlg.appearance_linkprops}</legend>
192
193 <table border="0" cellpadding="4" cellspacing="0">
194 <tr>
195 <td class="column1"><label for="link_color">{#fullpage_dlg.link_color}</label></td>
196 <td>
197 <table border="0" cellpadding="0" cellspacing="0">
198 <tr>
199 <td><input id="link_color" name="link_color" type="text" value="" size="9" onchange="updateColor('link_color_pick','link_color');changedStyleField(this);" /></td>
200 <td id="link_color_pickcontainer">&nbsp;</td>
201 </tr>
202 </table>
203 </td>
204
205 <td class="column1"><label for="visited_color">{#fullpage_dlg.visited_color}</label></td>
206 <td>
207 <table border="0" cellpadding="0" cellspacing="0">
208 <tr>
209 <td><input id="visited_color" name="visited_color" type="text" value="" size="9" onchange="updateColor('visited_color_pick','visited_color');changedStyleField(this);" /></td>
210 <td id="visited_color_pickcontainer">&nbsp;</td>
211 </tr>
212 </table>
213 </td>
214 </tr>
215
216 <tr>
217 <td class="column1"><label for="active_color">{#fullpage_dlg.active_color}</label></td>
218 <td>
219 <table border="0" cellpadding="0" cellspacing="0">
220 <tr>
221 <td><input id="active_color" name="active_color" type="text" value="" size="9" onchange="updateColor('active_color_pick','active_color');changedStyleField(this);" /></td>
222 <td id="active_color_pickcontainer">&nbsp;</td>
223 </tr>
224 </table>
225 </td>
226
227 <td>&nbsp;</td>
228 <td>&nbsp;</td>
229
230<!-- <td class="column1"><label for="hover_color">{#fullpage_dlg.hover_color}</label></td>
231 <td>
232 <table border="0" cellpadding="0" cellspacing="0">
233 <tr>
234 <td><input id="hover_color" name="hover_color" type="text" value="" size="9" onchange="changedStyleField(this);" /></td>
235 <td id="hover_color_pickcontainer">&nbsp;</td>
236 </tr>
237 </table>
238 </td> -->
239 </tr>
240 </table>
241 </fieldset>
242
243 <fieldset>
244 <legend>{#fullpage_dlg.appearance_style}</legend>
245
246 <table border="0" cellpadding="4" cellspacing="0">
247 <tr>
248 <td class="column1"><label for="stylesheet">{#fullpage_dlg.stylesheet}</label></td>
249 <td><table border="0" cellpadding="0" cellspacing="0">
250 <tr>
251 <td><input id="stylesheet" name="stylesheet" type="text" value="" /></td>
252 <td id="stylesheet_browsercontainer">&nbsp;</td>
253 </tr>
254 </table></td>
255 </tr>
256 <tr>
257 <td class="column1"><label for="style">{#fullpage_dlg.style}</label></td>
258 <td><input id="style" name="style" type="text" value="" onchange="changedStyleField(this);" /></td>
259 </tr>
260 </table>
261 </fieldset>
262 </div>
263
264 <div id="advanced_panel" class="panel">
265 <div id="addmenu">
266 <table border="0" cellpadding="0" cellspacing="0">
267 <tr><td><a href="javascript:addHeadElm('title');" onmousedown="return false;"><span>{#fullpage_dlg.add_title}</span></a></td></tr>
268 <tr><td><a href="javascript:addHeadElm('meta');" onmousedown="return false;"><span>{#fullpage_dlg.add_meta}</span></a></td></tr>
269 <tr><td><a href="javascript:addHeadElm('script');" onmousedown="return false;"><span>{#fullpage_dlg.add_script}</span></a></td></tr>
270 <tr><td><a href="javascript:addHeadElm('style');" onmousedown="return false;"><span>{#fullpage_dlg.add_style}</span></a></td></tr>
271 <tr><td><a href="javascript:addHeadElm('link');" onmousedown="return false;"><span>{#fullpage_dlg.add_link}</span></a></td></tr>
272 <tr><td><a href="javascript:addHeadElm('base');" onmousedown="return false;"><span>{#fullpage_dlg.add_base}</span></a></td></tr>
273 <tr><td><a href="javascript:addHeadElm('comment');" onmousedown="return false;"><span>{#fullpage_dlg.add_comment}</span></a></td></tr>
274 </table>
275 </div>
276
277 <fieldset>
278 <legend>{#fullpage_dlg.head_elements}</legend>
279
280 <div class="headlistwrapper">
281 <div class="toolbar">
282 <div style="float: left">
283 <a id="addbutton" href="javascript:showAddMenu();" onmousedown="return false;" class="addbutton" title="{#fullpage_dlg.add}"></a>
284 <a href="#" onmousedown="return false;" class="removebutton" title="{#fullpage_dlg.remove}"></a>
285 </div>
286 <div style="float: right">
287 <a href="#" onmousedown="return false;" class="moveupbutton" title="{#fullpage_dlg.moveup}"></a>
288 <a href="#" onmousedown="return false;" class="movedownbutton" title="{#fullpage_dlg.movedown}"></a>
289 </div>
290 <br style="clear: both" />
291 </div>
292 <select id="headlist" size="26" onchange="updateHeadElm(this.options[this.selectedIndex].value);">
293 <option value="title_0">&lt;title&gt;Some title bla bla bla&lt;/title&gt;</option>
294 <option value="meta_1">&lt;meta name="keywords"&gt;Some bla bla bla&lt;/meta&gt;</option>
295 <option value="meta_2">&lt;meta name="description"&gt;Some bla bla bla bla bla bla bla bla bla&lt;/meta&gt;</option>
296 <option value="script_3">&lt;script language=&quot;javascript&quot;&gt;...&lt;/script&gt;</option>
297 <option value="style_4">&lt;style&gt;...&lt;/style&gt;</option>
298 <option value="base_5">&lt;base href="." /&gt;</option>
299 <option value="comment_6">&lt;!-- ... --&gt;</option>
300 <option value="link_7">&lt;link href="." /&gt;</option>
301 </select>
302 </div>
303 </fieldset>
304
305 <fieldset id="meta_element">
306 <legend>{#fullpage_dlg.meta_element}</legend>
307
308 <table border="0" cellpadding="4" cellspacing="0">
309 <tr>
310 <td class="column1"><label for="element_meta_type">{#fullpage_dlg.type}</label></td>
311 <td><select id="element_meta_type">
312 <option value="name">name</option>
313 <option value="http-equiv">http-equiv</option>
314 </select></td>
315 </tr>
316 <tr>
317 <td class="column1"><label for="element_meta_name">{#fullpage_dlg.name}</label></td>
318 <td><input id="element_meta_name" name="element_meta_name" type="text" value="" /></td>
319 </tr>
320 <tr>
321 <td class="column1"><label for="element_meta_content">{#fullpage_dlg.content}</label></td>
322 <td><input id="element_meta_content" name="element_meta_content" type="text" value="" /></td>
323 </tr>
324 </table>
325
326 <input type="button" id="meta_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
327 </fieldset>
328
329 <fieldset id="title_element">
330 <legend>{#fullpage_dlg.title_element}</legend>
331
332 <table border="0" cellpadding="4" cellspacing="0">
333 <tr>
334 <td class="column1"><label for="element_title">{#fullpage_dlg.meta_title}</label></td>
335 <td><input id="element_title" name="element_title" type="text" value="" /></td>
336 </tr>
337 </table>
338
339 <input type="button" id="title_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
340 </fieldset>
341
342 <fieldset id="script_element">
343 <legend>{#fullpage_dlg.script_element}</legend>
344
345 <div class="tabs">
346 <ul>
347 <li id="script_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('script_props_tab','script_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
348 <li id="script_value_tab"><span><a href="javascript:mcTabs.displayTab('script_value_tab','script_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
349 </ul>
350 </div>
351
352 <br style="clear: both" />
353
354 <div class="panel_wrapper">
355 <div id="script_props_panel" class="panel current">
356 <table border="0" cellpadding="4" cellspacing="0">
357 <tr>
358 <td class="column1"><label for="element_script_type">{#fullpage_dlg.type}</label></td>
359 <td><select id="element_script_type">
360 <option value="text/javascript">text/javascript</option>
361 <option value="text/jscript">text/jscript</option>
362 <option value="text/vbscript">text/vbscript</option>
363 <option value="text/vbs">text/vbs</option>
364 <option value="text/ecmascript">text/ecmascript</option>
365 <option value="text/xml">text/xml</option>
366 </select></td>
367 </tr>
368 <tr>
369 <td class="column1"><label for="element_script_src">{#fullpage_dlg.src}</label></td>
370 <td><table border="0" cellpadding="0" cellspacing="0">
371 <tr>
372 <td><input id="element_script_src" name="element_script_src" type="text" value="" /></td>
373 <td id="script_src_pickcontainer">&nbsp;</td>
374 </tr>
375 </table></td>
376 </tr>
377 <tr>
378 <td class="column1"><label for="element_script_charset">{#fullpage_dlg.charset}</label></td>
379 <td><select id="element_script_charset"><option value="">{#not_set}</option></select></td>
380 </tr>
381 <tr>
382 <td class="column1"><label for="element_script_defer">{#fullpage_dlg.defer}</label></td>
383 <td><input type="checkbox" id="element_script_defer" name="element_script_defer" class="checkbox" /></td>
384 </tr>
385 </table>
386 </div>
387
388 <div id="script_value_panel" class="panel">
389 <textarea id="element_script_value"></textarea>
390 </div>
391 </div>
392
393 <input type="button" id="script_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
394 </fieldset>
395
396 <fieldset id="style_element">
397 <legend>{#fullpage_dlg.style_element}</legend>
398
399 <div class="tabs">
400 <ul>
401 <li id="style_props_tab" class="current"><span><a href="javascript:mcTabs.displayTab('style_props_tab','style_props_panel');" onmousedown="return false;">{#fullpage_dlg.properties}</a></span></li>
402 <li id="style_value_tab"><span><a href="javascript:mcTabs.displayTab('style_value_tab','style_value_panel');" onmousedown="return false;">{#fullpage_dlg.value}</a></span></li>
403 </ul>
404 </div>
405
406 <br style="clear: both" />
407
408 <div class="panel_wrapper">
409 <div id="style_props_panel" class="panel current">
410 <table border="0" cellpadding="4" cellspacing="0">
411 <tr>
412 <td class="column1"><label for="element_style_type">{#fullpage_dlg.type}</label></td>
413 <td><select id="element_style_type">
414 <option value="text/css">text/css</option>
415 </select></td>
416 </tr>
417 <tr>
418 <td class="column1"><label for="element_style_media">{#fullpage_dlg.media}</label></td>
419 <td><select id="element_style_media"></select></td>
420 </tr>
421 </table>
422 </div>
423
424 <div id="style_value_panel" class="panel">
425 <textarea id="element_style_value"></textarea>
426 </div>
427 </div>
428
429 <input type="button" id="style_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
430 </fieldset>
431
432 <fieldset id="base_element">
433 <legend>{#fullpage_dlg.base_element}</legend>
434
435 <table border="0" cellpadding="4" cellspacing="0">
436 <tr>
437 <td class="column1"><label for="element_base_href">{#fullpage_dlg.href}</label></td>
438 <td><input id="element_base_href" name="element_base_href" type="text" value="" /></td>
439 </tr>
440 <tr>
441 <td class="column1"><label for="element_base_target">{#fullpage_dlg.target}</label></td>
442 <td><input id="element_base_target" name="element_base_target" type="text" value="" /></td>
443 </tr>
444 </table>
445
446 <input type="button" id="base_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
447 </fieldset>
448
449 <fieldset id="link_element">
450 <legend>{#fullpage_dlg.link_element}</legend>
451
452 <div class="tabs">
453 <ul>
454 <li id="link_general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('link_general_tab','link_general_panel');" onmousedown="return false;">{#fullpage_dlg.general_props}</a></span></li>
455 <li id="link_advanced_tab"><span><a href="javascript:mcTabs.displayTab('link_advanced_tab','link_advanced_panel');" onmousedown="return false;">{#fullpage_dlg.advanced_props}</a></span></li>
456 </ul>
457 </div>
458
459 <br style="clear: both" />
460
461 <div class="panel_wrapper">
462 <div id="link_general_panel" class="panel current">
463 <table border="0" cellpadding="4" cellspacing="0">
464 <tr>
465 <td class="column1"><label for="element_link_href">{#fullpage_dlg.href}</label></td>
466 <td><table border="0" cellpadding="0" cellspacing="0">
467 <tr>
468 <td><input id="element_link_href" name="element_link_href" type="text" value="" /></td>
469 <td id="link_href_pickcontainer">&nbsp;</td>
470 </tr>
471 </table></td>
472 </tr>
473 <tr>
474 <td class="column1"><label for="element_link_title">{#fullpage_dlg.meta_title}</label></td>
475 <td><input id="element_link_title" name="element_link_title" type="text" value="" /></td>
476 </tr>
477 <tr>
478 <td class="column1"><label for="element_link_type">{#fullpage_dlg.type}</label></td>
479 <td><select id="element_link_type" name="element_link_type">
480 <option value="text/css">text/css</option>
481 <option value="text/javascript">text/javascript</option>
482 </select></td>
483 </tr>
484 <tr>
485 <td class="column1"><label for="element_link_media">{#fullpage_dlg.media}</label></td>
486 <td><select id="element_link_media" name="element_link_media"></select></td>
487 </tr>
488 <tr>
489 <td><label for="element_style_rel">{#fullpage_dlg.rel}</label></td>
490 <td><select id="element_style_rel" name="element_style_rel">
491 <option value="">{#not_set}</option>
492 <option value="stylesheet">Stylesheet</option>
493 <option value="alternate">Alternate</option>
494 <option value="designates">Designates</option>
495 <option value="start">Start</option>
496 <option value="next">Next</option>
497 <option value="prev">Prev</option>
498 <option value="contents">Contents</option>
499 <option value="index">Index</option>
500 <option value="glossary">Glossary</option>
501 <option value="copyright">Copyright</option>
502 <option value="chapter">Chapter</option>
503 <option value="subsection">Subsection</option>
504 <option value="appendix">Appendix</option>
505 <option value="help">Help</option>
506 <option value="bookmark">Bookmark</option>
507 </select>
508 </td>
509 </tr>
510 </table>
511 </div>
512
513 <div id="link_advanced_panel" class="panel">
514 <table border="0" cellpadding="4" cellspacing="0">
515 <tr>
516 <td class="column1"><label for="element_link_charset">{#fullpage_dlg.charset}</label></td>
517 <td><select id="element_link_charset"><option value="">{#not_set}</option></select></td>
518 </tr>
519 <tr>
520 <td class="column1"><label for="element_link_hreflang">{#fullpage_dlg.hreflang}</label></td>
521 <td><input id="element_link_hreflang" name="element_link_hreflang" type="text" value="" /></td>
522 </tr>
523 <tr>
524 <td class="column1"><label for="element_link_target">{#fullpage_dlg.target}</label></td>
525 <td><input id="element_link_target" name="element_link_target" type="text" value="" /></td>
526 </tr>
527 <tr>
528 <td><label for="element_style_rev">{#fullpage_dlg.rev}</label></td>
529 <td><select id="element_style_rev" name="element_style_rev">
530 <option value="">{#not_set}</option>
531 <option value="alternate">Alternate</option>
532 <option value="designates">Designates</option>
533 <option value="stylesheet">Stylesheet</option>
534 <option value="start">Start</option>
535 <option value="next">Next</option>
536 <option value="prev">Prev</option>
537 <option value="contents">Contents</option>
538 <option value="index">Index</option>
539 <option value="glossary">Glossary</option>
540 <option value="copyright">Copyright</option>
541 <option value="chapter">Chapter</option>
542 <option value="subsection">Subsection</option>
543 <option value="appendix">Appendix</option>
544 <option value="help">Help</option>
545 <option value="bookmark">Bookmark</option>
546 </select>
547 </td>
548 </tr>
549 </table>
550 </div>
551 </div>
552
553 <input type="button" id="link_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
554 </fieldset>
555
556 <fieldset id="comment_element">
557 <legend>{#fullpage_dlg.comment_element}</legend>
558
559 <textarea id="element_comment_value"></textarea>
560
561 <input type="button" id="comment_updateelement" class="updateElementButton" name="update" value="{#update}" onclick="updateElement();" />
562 </fieldset>
563 </div>
564 </div>
565
566 <div class="mceActionPanel">
567 <div style="float: left">
568 <input type="submit" id="insert" name="update" value="{#update}" />
569 </div>
570
571 <div style="float: right">
572 <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
573 </div>
574 </div>
575 </form>
576</body>
577</html>
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js
new file mode 100755
index 0000000..89059ef
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js
@@ -0,0 +1,461 @@
1tinyMCEPopup.requireLangPack();
2
3var doc;
4
5var defaultDocTypes =
6 'XHTML 1.0 Transitional=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,' +
7 'XHTML 1.0 Frameset=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">,' +
8 'XHTML 1.0 Strict=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">,' +
9 'XHTML 1.1=<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">,' +
10 'HTML 4.01 Transitional=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">,' +
11 'HTML 4.01 Strict=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">,' +
12 'HTML 4.01 Frameset=<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
13
14var defaultEncodings =
15 'Western european (iso-8859-1)=iso-8859-1,' +
16 'Central European (iso-8859-2)=iso-8859-2,' +
17 'Unicode (UTF-8)=utf-8,' +
18 'Chinese traditional (Big5)=big5,' +
19 'Cyrillic (iso-8859-5)=iso-8859-5,' +
20 'Japanese (iso-2022-jp)=iso-2022-jp,' +
21 'Greek (iso-8859-7)=iso-8859-7,' +
22 'Korean (iso-2022-kr)=iso-2022-kr,' +
23 'ASCII (us-ascii)=us-ascii';
24
25var defaultMediaTypes =
26 'all=all,' +
27 'screen=screen,' +
28 'print=print,' +
29 'tty=tty,' +
30 'tv=tv,' +
31 'projection=projection,' +
32 'handheld=handheld,' +
33 'braille=braille,' +
34 'aural=aural';
35
36var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
37var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px';
38
39function init() {
40 var f = document.forms['fullpage'], el = f.elements, e, i, p, doctypes, encodings, mediaTypes, fonts, ed = tinyMCEPopup.editor, dom = tinyMCEPopup.dom, style;
41
42 // Setup doctype select box
43 doctypes = ed.getParam("fullpage_doctypes", defaultDocTypes).split(',');
44 for (i=0; i<doctypes.length; i++) {
45 p = doctypes[i].split('=');
46
47 if (p.length > 1)
48 addSelectValue(f, 'doctypes', p[0], p[1]);
49 }
50
51 // Setup fonts select box
52 fonts = ed.getParam("fullpage_fonts", defaultFontNames).split(';');
53 for (i=0; i<fonts.length; i++) {
54 p = fonts[i].split('=');
55
56 if (p.length > 1)
57 addSelectValue(f, 'fontface', p[0], p[1]);
58 }
59
60 // Setup fontsize select box
61 fonts = ed.getParam("fullpage_fontsizes", defaultFontSizes).split(',');
62 for (i=0; i<fonts.length; i++)
63 addSelectValue(f, 'fontsize', fonts[i], fonts[i]);
64
65 // Setup mediatype select boxs
66 mediaTypes = ed.getParam("fullpage_media_types", defaultMediaTypes).split(',');
67 for (i=0; i<mediaTypes.length; i++) {
68 p = mediaTypes[i].split('=');
69
70 if (p.length > 1) {
71 addSelectValue(f, 'element_style_media', p[0], p[1]);
72 addSelectValue(f, 'element_link_media', p[0], p[1]);
73 }
74 }
75
76 // Setup encodings select box
77 encodings = ed.getParam("fullpage_encodings", defaultEncodings).split(',');
78 for (i=0; i<encodings.length; i++) {
79 p = encodings[i].split('=');
80
81 if (p.length > 1) {
82 addSelectValue(f, 'docencoding', p[0], p[1]);
83 addSelectValue(f, 'element_script_charset', p[0], p[1]);
84 addSelectValue(f, 'element_link_charset', p[0], p[1]);
85 }
86 }
87
88 document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
89 document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color');
90 //document.getElementById('hover_color_pickcontainer').innerHTML = getColorPickerHTML('hover_color_pick','hover_color');
91 document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color');
92 document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color');
93 document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor');
94 document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage');
95 document.getElementById('link_href_pickcontainer').innerHTML = getBrowserHTML('link_href_browser','element_link_href','file','fullpage');
96 document.getElementById('script_src_pickcontainer').innerHTML = getBrowserHTML('script_src_browser','element_script_src','file','fullpage');
97 document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage');
98
99 // Resize some elements
100 if (isVisible('stylesheetbrowser'))
101 document.getElementById('stylesheet').style.width = '220px';
102
103 if (isVisible('link_href_browser'))
104 document.getElementById('element_link_href').style.width = '230px';
105
106 if (isVisible('bgimage_browser'))
107 document.getElementById('bgimage').style.width = '210px';
108
109 // Add iframe
110 dom.add(document.body, 'iframe', {id : 'documentIframe', src : 'javascript:""', style : {display : 'none'}});
111 doc = dom.get('documentIframe').contentWindow.document;
112 h = tinyMCEPopup.getWindowArg('head_html');
113
114 // Preprocess the HTML disable scripts and urls
115 h = h.replace(/<script>/gi, '<script type="text/javascript">');
116 h = h.replace(/type=([\"\'])?/gi, 'type=$1-mce-');
117 h = h.replace(/(src=|href=)/g, 'mce_$1');
118
119 // Write in the content in the iframe
120 doc.write(h + '</body></html>');
121 doc.close();
122
123 // Parse xml and doctype
124 xmlVer = getReItem(/<\?\s*?xml.*?version\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
125 xmlEnc = getReItem(/<\?\s*?xml.*?encoding\s*?=\s*?"(.*?)".*?\?>/gi, h, 1);
126 docType = getReItem(/<\!DOCTYPE.*?>/gi, h, 0);
127 f.langcode.value = getReItem(/lang="(.*?)"/gi, h, 1);
128
129 // Parse title
130 if (e = doc.getElementsByTagName('title')[0])
131 el.metatitle.value = e.textContent || e.text;
132
133 // Parse meta
134 tinymce.each(doc.getElementsByTagName('meta'), function(n) {
135 var na = (n.getAttribute('name', 2) || '').toLowerCase(), va = n.getAttribute('content', 2), eq = n.getAttribute('httpEquiv', 2) || '';
136
137 e = el['meta' + na];
138
139 if (na == 'robots') {
140 selectByValue(f, 'metarobots', tinymce.trim(va), true, true);
141 return;
142 }
143
144 switch (eq.toLowerCase()) {
145 case "content-type":
146 tmp = getReItem(/charset\s*=\s*(.*)\s*/gi, va, 1);
147
148 // Override XML encoding
149 if (tmp != "")
150 xmlEnc = tmp;
151
152 return;
153 }
154
155 if (e)
156 e.value = va;
157 });
158
159 selectByValue(f, 'doctypes', docType, true, true);
160 selectByValue(f, 'docencoding', xmlEnc, true, true);
161 selectByValue(f, 'langdir', doc.body.getAttribute('dir', 2) || '', true, true);
162
163 if (xmlVer != '')
164 el.xml_pi.checked = true;
165
166 // Parse appearance
167
168 // Parse primary stylesheet
169 tinymce.each(doc.getElementsByTagName("link"), function(l) {
170 var m = l.getAttribute('media', 2) || '', t = l.getAttribute('type', 2) || '';
171
172 if (t == "-mce-text/css" && (m == "" || m == "screen" || m == "all") && (l.getAttribute('rel', 2) || '') == "stylesheet") {
173 f.stylesheet.value = l.getAttribute('mce_href', 2) || '';
174 return false;
175 }
176 });
177
178 // Get from style elements
179 tinymce.each(doc.getElementsByTagName("style"), function(st) {
180 var tmp = parseStyleElement(st);
181
182 for (x=0; x<tmp.length; x++) {
183 if (tmp[x].rule.indexOf('a:visited') != -1 && tmp[x].data['color'])
184 f.visited_color.value = tmp[x].data['color'];
185
186 if (tmp[x].rule.indexOf('a:link') != -1 && tmp[x].data['color'])
187 f.link_color.value = tmp[x].data['color'];
188
189 if (tmp[x].rule.indexOf('a:active') != -1 && tmp[x].data['color'])
190 f.active_color.value = tmp[x].data['color'];
191 }
192 });
193
194 f.textcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "text");
195 f.active_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "alink");
196 f.link_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "link");
197 f.visited_color.value = tinyMCEPopup.dom.getAttrib(doc.body, "vlink");
198 f.bgcolor.value = tinyMCEPopup.dom.getAttrib(doc.body, "bgcolor");
199 f.bgimage.value = tinyMCEPopup.dom.getAttrib(doc.body, "background");
200
201 // Get from style info
202 style = tinyMCEPopup.dom.parseStyle(tinyMCEPopup.dom.getAttrib(doc.body, 'style'));
203
204 if (style['font-family'])
205 selectByValue(f, 'fontface', style['font-family'], true, true);
206 else
207 selectByValue(f, 'fontface', ed.getParam("fullpage_default_fontface", ""), true, true);
208
209 if (style['font-size'])
210 selectByValue(f, 'fontsize', style['font-size'], true, true);
211 else
212 selectByValue(f, 'fontsize', ed.getParam("fullpage_default_fontsize", ""), true, true);
213
214 if (style['color'])
215 f.textcolor.value = convertRGBToHex(style['color']);
216
217 if (style['background-image'])
218 f.bgimage.value = style['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
219
220 if (style['background-color'])
221 f.bgcolor.value = style['background-color'];
222
223 if (style['margin']) {
224 tmp = style['margin'].replace(/[^0-9 ]/g, '');
225 tmp = tmp.split(/ +/);
226 f.topmargin.value = tmp.length > 0 ? tmp[0] : '';
227 f.rightmargin.value = tmp.length > 1 ? tmp[1] : tmp[0];
228 f.bottommargin.value = tmp.length > 2 ? tmp[2] : tmp[0];
229 f.leftmargin.value = tmp.length > 3 ? tmp[3] : tmp[0];
230 }
231
232 if (style['margin-left'])
233 f.leftmargin.value = style['margin-left'].replace(/[^0-9]/g, '');
234
235 if (style['margin-right'])
236 f.rightmargin.value = style['margin-right'].replace(/[^0-9]/g, '');
237
238 if (style['margin-top'])
239 f.topmargin.value = style['margin-top'].replace(/[^0-9]/g, '');
240
241 if (style['margin-bottom'])
242 f.bottommargin.value = style['margin-bottom'].replace(/[^0-9]/g, '');
243
244 f.style.value = tinyMCEPopup.dom.serializeStyle(style);
245
246 // Update colors
247 updateColor('textcolor_pick', 'textcolor');
248 updateColor('bgcolor_pick', 'bgcolor');
249 updateColor('visited_color_pick', 'visited_color');
250 updateColor('active_color_pick', 'active_color');
251 updateColor('link_color_pick', 'link_color');
252}
253
254function getReItem(r, s, i) {
255 var c = r.exec(s);
256
257 if (c && c.length > i)
258 return c[i];
259
260 return '';
261}
262
263function updateAction() {
264 var f = document.forms[0], nl, i, h, v, s, head, html, l, tmp, addlink = true, ser;
265
266 head = doc.getElementsByTagName('head')[0];
267
268 // Fix scripts without a type
269 nl = doc.getElementsByTagName('script');
270 for (i=0; i<nl.length; i++) {
271 if (tinyMCEPopup.dom.getAttrib(nl[i], 'mce_type') == '')
272 nl[i].setAttribute('mce_type', 'text/javascript');
273 }
274
275 // Get primary stylesheet
276 nl = doc.getElementsByTagName("link");
277 for (i=0; i<nl.length; i++) {
278 l = nl[i];
279
280 tmp = tinyMCEPopup.dom.getAttrib(l, 'media');
281
282 if (tinyMCEPopup.dom.getAttrib(l, 'mce_type') == "text/css" && (tmp == "" || tmp == "screen" || tmp == "all") && tinyMCEPopup.dom.getAttrib(l, 'rel') == "stylesheet") {
283 addlink = false;
284
285 if (f.stylesheet.value == '')
286 l.parentNode.removeChild(l);
287 else
288 l.setAttribute('mce_href', f.stylesheet.value);
289
290 break;
291 }
292 }
293
294 // Add new link
295 if (f.stylesheet.value != '') {
296 l = doc.createElement('link');
297
298 l.setAttribute('type', 'text/css');
299 l.setAttribute('mce_href', f.stylesheet.value);
300 l.setAttribute('rel', 'stylesheet');
301
302 head.appendChild(l);
303 }
304
305 setMeta(head, 'keywords', f.metakeywords.value);
306 setMeta(head, 'description', f.metadescription.value);
307 setMeta(head, 'author', f.metaauthor.value);
308 setMeta(head, 'copyright', f.metacopyright.value);
309 setMeta(head, 'robots', getSelectValue(f, 'metarobots'));
310 setMeta(head, 'Content-Type', getSelectValue(f, 'docencoding'));
311
312 doc.body.dir = getSelectValue(f, 'langdir');
313 doc.body.style.cssText = f.style.value;
314
315 doc.body.setAttribute('vLink', f.visited_color.value);
316 doc.body.setAttribute('link', f.link_color.value);
317 doc.body.setAttribute('text', f.textcolor.value);
318 doc.body.setAttribute('aLink', f.active_color.value);
319
320 doc.body.style.fontFamily = getSelectValue(f, 'fontface');
321 doc.body.style.fontSize = getSelectValue(f, 'fontsize');
322 doc.body.style.backgroundColor = f.bgcolor.value;
323
324 if (f.leftmargin.value != '')
325 doc.body.style.marginLeft = f.leftmargin.value + 'px';
326
327 if (f.rightmargin.value != '')
328 doc.body.style.marginRight = f.rightmargin.value + 'px';
329
330 if (f.bottommargin.value != '')
331 doc.body.style.marginBottom = f.bottommargin.value + 'px';
332
333 if (f.topmargin.value != '')
334 doc.body.style.marginTop = f.topmargin.value + 'px';
335
336 html = doc.getElementsByTagName('html')[0];
337 html.setAttribute('lang', f.langcode.value);
338 html.setAttribute('xml:lang', f.langcode.value);
339
340 if (f.bgimage.value != '')
341 doc.body.style.backgroundImage = "url('" + f.bgimage.value + "')";
342 else
343 doc.body.style.backgroundImage = '';
344
345 ser = tinyMCEPopup.editor.plugins.fullpage._createSerializer();
346 ser.setRules('-title,meta[http-equiv|name|content],base[href|target],link[href|rel|type|title|media],style[type],script[type|language|src],html[lang|xml::lang|xmlns],body[style|dir|vlink|link|text|alink],head');
347
348 h = ser.serialize(doc.documentElement);
349 h = h.substring(0, h.lastIndexOf('</body>'));
350
351 if (h.indexOf('<title>') == -1)
352 h = h.replace(/<head.*?>/, '$&\n' + '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
353 else
354 h = h.replace(/<title>(.*?)<\/title>/, '<title>' + tinyMCEPopup.dom.encode(f.metatitle.value) + '</title>');
355
356 if ((v = getSelectValue(f, 'doctypes')) != '')
357 h = v + '\n' + h;
358
359 if (f.xml_pi.checked) {
360 s = '<?xml version="1.0"';
361
362 if ((v = getSelectValue(f, 'docencoding')) != '')
363 s += ' encoding="' + v + '"';
364
365 s += '?>\n';
366 h = s + h;
367 }
368
369 h = h.replace(/type=\"\-mce\-/gi, 'type="');
370
371 tinyMCEPopup.editor.plugins.fullpage.head = h;
372 tinyMCEPopup.editor.plugins.fullpage._setBodyAttribs(tinyMCEPopup.editor, {});
373 tinyMCEPopup.close();
374}
375
376function changedStyleField(field) {
377}
378
379function setMeta(he, k, v) {
380 var nl, i, m;
381
382 nl = he.getElementsByTagName('meta');
383 for (i=0; i<nl.length; i++) {
384 if (k == 'Content-Type' && tinyMCEPopup.dom.getAttrib(nl[i], 'http-equiv') == k) {
385 if (v == '')
386 nl[i].parentNode.removeChild(nl[i]);
387 else
388 nl[i].setAttribute('content', "text/html; charset=" + v);
389
390 return;
391 }
392
393 if (tinyMCEPopup.dom.getAttrib(nl[i], 'name') == k) {
394 if (v == '')
395 nl[i].parentNode.removeChild(nl[i]);
396 else
397 nl[i].setAttribute('content', v);
398 return;
399 }
400 }
401
402 if (v == '')
403 return;
404
405 m = doc.createElement('meta');
406
407 if (k == 'Content-Type')
408 m.httpEquiv = k;
409 else
410 m.setAttribute('name', k);
411
412 m.setAttribute('content', v);
413 he.appendChild(m);
414}
415
416function parseStyleElement(e) {
417 var v = e.innerHTML;
418 var p, i, r;
419
420 v = v.replace(/<!--/gi, '');
421 v = v.replace(/-->/gi, '');
422 v = v.replace(/[\n\r]/gi, '');
423 v = v.replace(/\s+/gi, ' ');
424
425 r = [];
426 p = v.split(/{|}/);
427
428 for (i=0; i<p.length; i+=2) {
429 if (p[i] != "")
430 r[r.length] = {rule : tinymce.trim(p[i]), data : tinyMCEPopup.dom.parseStyle(p[i+1])};
431 }
432
433 return r;
434}
435
436function serializeStyleElement(d) {
437 var i, s, st;
438
439 s = '<!--\n';
440
441 for (i=0; i<d.length; i++) {
442 s += d[i].rule + ' {\n';
443
444 st = tinyMCE.serializeStyle(d[i].data);
445
446 if (st != '')
447 st += ';';
448
449 s += st.replace(/;/g, ';\n');
450 s += '}\n';
451
452 if (i != d.length - 1)
453 s += '\n';
454 }
455
456 s += '\n-->';
457
458 return s;
459}
460
461tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
new file mode 100755
index 0000000..f5801b8
--- /dev/null
+++ b/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js
@@ -0,0 +1,85 @@
1tinyMCE.addI18n('en.fullpage_dlg',{
2title:"Document properties",
3meta_tab:"General",
4appearance_tab:"Appearance",
5advanced_tab:"Advanced",
6meta_props:"Meta information",
7langprops:"Language and encoding",
8meta_title:"Title",
9meta_keywords:"Keywords",
10meta_description:"Description",
11meta_robots:"Robots",
12doctypes:"Doctype",
13langcode:"Language code",
14langdir:"Language direction",
15ltr:"Left to right",
16rtl:"Right to left",
17xml_pi:"XML declaration",
18encoding:"Character encoding",
19appearance_bgprops:"Background properties",
20appearance_marginprops:"Body margins",
21appearance_linkprops:"Link colors",
22appearance_textprops:"Text properties",
23bgcolor:"Background color",
24bgimage:"Background image",
25left_margin:"Left margin",
26right_margin:"Right margin",
27top_margin:"Top margin",
28bottom_margin:"Bottom margin",
29text_color:"Text color",
30font_size:"Font size",
31font_face:"Font face",
32link_color:"Link color",
33hover_color:"Hover color",
34visited_color:"Visited color",
35active_color:"Active color",
36textcolor:"Color",
37fontsize:"Font size",
38fontface:"Font family",
39meta_index_follow:"Index and follow the links",
40meta_index_nofollow:"Index and don't follow the links",
41meta_noindex_follow:"Do not index but follow the links",
42meta_noindex_nofollow:"Do not index and don\'t follow the links",
43appearance_style:"Stylesheet and style properties",
44stylesheet:"Stylesheet",
45style:"Style",
46author:"Author",
47copyright:"Copyright",
48add:"Add new element",
49remove:"Remove selected element",
50moveup:"Move selected element up",
51movedown:"Move selected element down",
52head_elements:"Head elements",
53info:"Information",
54add_title:"Title element",
55add_meta:"Meta element",
56add_script:"Script element",
57add_style:"Style element",
58add_link:"Link element",
59add_base:"Base element",
60add_comment:"Comment node",
61title_element:"Title element",
62script_element:"Script element",
63style_element:"Style element",
64base_element:"Base element",
65link_element:"Link element",
66meta_element:"Meta element",
67comment_element:"Comment",
68src:"Src",
69language:"Language",
70href:"Href",
71target:"Target",
72type:"Type",
73charset:"Charset",
74defer:"Defer",
75media:"Media",
76properties:"Properties",
77name:"Name",
78value:"Value",
79content:"Content",
80rel:"Rel",
81rev:"Rev",
82hreflang:"Href lang",
83general_props:"General",
84advanced_props:"Advanced"
85}); \ No newline at end of file