mirador_rails 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/app/controllers/mirador_rails/locales_controller.rb +10 -0
- data/config/routes.rb +7 -0
- data/lib/mirador_rails/exceptions.rb +6 -0
- data/lib/mirador_rails/locale.rb +24 -0
- data/lib/mirador_rails/version.rb +1 -1
- data/lib/mirador_rails.rb +9 -2
- data/mirador_rails.gemspec +3 -0
- data/tasks/mirador_rails.rake +44 -10
- data/vendor/assets/images/border_type_4.png +0 -0
- data/vendor/assets/images/border_type_5.png +0 -0
- data/vendor/assets/javascripts/mirador/mirador.js.erb +20105 -0
- data/vendor/assets/javascripts/mirador.js +4 -1
- data/vendor/assets/locales/de/translation.json +3 -0
- data/vendor/assets/locales/en/translation.json +11 -7
- data/vendor/assets/locales/ko/translation.json +18 -9
- data/vendor/assets/stylesheets/enhancements.scss +36 -0
- data/vendor/assets/stylesheets/mirador-combined.css +1488 -1642
- data/vendor/assets/stylesheets/mirador.css +1 -0
- metadata +52 -174
- data/vendor/assets/javascripts/mirador.min.js +0 -89
- data/vendor/assets/javascripts/mirador.min.js.map +0 -1
- data/vendor/assets/plugins/plugins/advlist/plugin.js +0 -97
- data/vendor/assets/plugins/plugins/advlist/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/anchor/plugin.js +0 -45
- data/vendor/assets/plugins/plugins/anchor/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/autolink/plugin.js +0 -194
- data/vendor/assets/plugins/plugins/autolink/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/autoresize/plugin.js +0 -152
- data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/autosave/plugin.js +0 -165
- data/vendor/assets/plugins/plugins/autosave/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/bbcode/plugin.js +0 -123
- data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/charmap/plugin.js +0 -370
- data/vendor/assets/plugins/plugins/charmap/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/code/plugin.js +0 -60
- data/vendor/assets/plugins/plugins/code/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/colorpicker/plugin.js +0 -112
- data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +0 -118
- data/vendor/assets/plugins/plugins/compat3x/img/buttons.png +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/icons.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/items.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/menu_arrow.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/menu_check.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/progress.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/img/tabs.gif +0 -0
- data/vendor/assets/plugins/plugins/compat3x/plugin.js +0 -297
- data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +0 -542
- data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +0 -70
- data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +0 -210
- data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +0 -164
- data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +0 -252
- data/vendor/assets/plugins/plugins/contextmenu/plugin.js +0 -87
- data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/directionality/plugin.js +0 -64
- data/vendor/assets/plugins/plugins/directionality/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/vendor/assets/plugins/plugins/emoticons/plugin.js +0 -65
- data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/example/dialog.html +0 -8
- data/vendor/assets/plugins/plugins/example/plugin.js +0 -68
- data/vendor/assets/plugins/plugins/example/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/example_dependency/plugin.js +0 -22
- data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/fullpage/plugin.js +0 -490
- data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/fullscreen/plugin.js +0 -136
- data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/hr/plugin.js +0 -30
- data/vendor/assets/plugins/plugins/hr/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/image/plugin.js +0 -439
- data/vendor/assets/plugins/plugins/image/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/importcss/plugin.js +0 -195
- data/vendor/assets/plugins/plugins/importcss/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +0 -121
- data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/layer/plugin.js +0 -225
- data/vendor/assets/plugins/plugins/layer/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +0 -211
- data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/link/plugin.js +0 -400
- data/vendor/assets/plugins/plugins/link/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/lists/plugin.js +0 -791
- data/vendor/assets/plugins/plugins/lists/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
- data/vendor/assets/plugins/plugins/media/plugin.js +0 -774
- data/vendor/assets/plugins/plugins/media/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +0 -53
- data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/noneditable/plugin.js +0 -540
- data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/pagebreak/plugin.js +0 -88
- data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +0 -634
- data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +0 -110
- data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +0 -159
- data/vendor/assets/plugins/plugins/paste/classes/Utils.js +0 -130
- data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +0 -493
- data/vendor/assets/plugins/plugins/paste/plugin.dev.js +0 -120
- data/vendor/assets/plugins/plugins/paste/plugin.js +0 -1625
- data/vendor/assets/plugins/plugins/paste/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/preview/plugin.js +0 -88
- data/vendor/assets/plugins/plugins/preview/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/print/plugin.js +0 -32
- data/vendor/assets/plugins/plugins/print/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/save/plugin.js +0 -94
- data/vendor/assets/plugins/plugins/save/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/searchreplace/plugin.js +0 -594
- data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +0 -470
- data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +0 -436
- data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +0 -117
- data/vendor/assets/plugins/plugins/spellchecker/plugin.js +0 -996
- data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/tabfocus/plugin.js +0 -120
- data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +0 -176
- data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +0 -749
- data/vendor/assets/plugins/plugins/table/classes/Plugin.js +0 -422
- data/vendor/assets/plugins/plugins/table/classes/Quirks.js +0 -372
- data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +0 -864
- data/vendor/assets/plugins/plugins/table/plugin.dev.js +0 -118
- data/vendor/assets/plugins/plugins/table/plugin.js +0 -2680
- data/vendor/assets/plugins/plugins/table/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/template/plugin.js +0 -262
- data/vendor/assets/plugins/plugins/template/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/textcolor/plugin.js +0 -272
- data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/textpattern/plugin.js +0 -268
- data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +0 -135
- data/vendor/assets/plugins/plugins/visualblocks/img/address.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/article.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/aside.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/blockquote.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/div.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/dl.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/figure.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h1.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h2.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h3.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h4.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h5.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/h6.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/hgroup.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/ol.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/p.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/pre.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/section.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/img/ul.gif +0 -0
- data/vendor/assets/plugins/plugins/visualblocks/plugin.js +0 -86
- data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/visualchars/plugin.js +0 -88
- data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +0 -1
- data/vendor/assets/plugins/plugins/wordcount/plugin.js +0 -69
- data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +0 -1
- data/vendor/assets/skins/skins/lightgray/content.inline.min.css +0 -1
- data/vendor/assets/skins/skins/lightgray/content.min.css +0 -1
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +0 -62
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce.eot +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce.svg +0 -63
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce.woff +0 -0
- data/vendor/assets/skins/skins/lightgray/img/anchor.gif +0 -0
- data/vendor/assets/skins/skins/lightgray/img/loader.gif +0 -0
- data/vendor/assets/skins/skins/lightgray/img/object.gif +0 -0
- data/vendor/assets/skins/skins/lightgray/img/trans.gif +0 -0
- data/vendor/assets/skins/skins/lightgray/skin.ie7.min.css +0 -1
- data/vendor/assets/skins/skins/lightgray/skin.min.css +0 -1
- data/vendor/assets/themes/themes/modern/theme.js +0 -617
- data/vendor/assets/themes/themes/modern/theme.min.js +0 -1
@@ -1,490 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* plugin.js
|
3
|
-
*
|
4
|
-
* Copyright, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://www.tinymce.com/license
|
8
|
-
* Contributing: http://www.tinymce.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
/*global tinymce:true */
|
12
|
-
|
13
|
-
tinymce.PluginManager.add('fullpage', function(editor) {
|
14
|
-
var each = tinymce.each, Node = tinymce.html.Node;
|
15
|
-
var head, foot;
|
16
|
-
|
17
|
-
function showDialog() {
|
18
|
-
var data = htmlToData();
|
19
|
-
|
20
|
-
editor.windowManager.open({
|
21
|
-
title: 'Document properties',
|
22
|
-
data: data,
|
23
|
-
defaults: {type: 'textbox', size: 40},
|
24
|
-
body: [
|
25
|
-
{name: 'title', label: 'Title'},
|
26
|
-
{name: 'keywords', label: 'Keywords'},
|
27
|
-
{name: 'description', label: 'Description'},
|
28
|
-
{name: 'robots', label: 'Robots'},
|
29
|
-
{name: 'author', label: 'Author'},
|
30
|
-
{name: 'docencoding', label: 'Encoding'}
|
31
|
-
],
|
32
|
-
onSubmit: function(e) {
|
33
|
-
dataToHtml(tinymce.extend(data, e.data));
|
34
|
-
}
|
35
|
-
});
|
36
|
-
}
|
37
|
-
|
38
|
-
function htmlToData() {
|
39
|
-
var headerFragment = parseHeader(), data = {}, elm, matches;
|
40
|
-
|
41
|
-
function getAttr(elm, name) {
|
42
|
-
var value = elm.attr(name);
|
43
|
-
|
44
|
-
return value || '';
|
45
|
-
}
|
46
|
-
|
47
|
-
// Default some values
|
48
|
-
data.fontface = editor.getParam("fullpage_default_fontface", "");
|
49
|
-
data.fontsize = editor.getParam("fullpage_default_fontsize", "");
|
50
|
-
|
51
|
-
// Parse XML PI
|
52
|
-
elm = headerFragment.firstChild;
|
53
|
-
if (elm.type == 7) {
|
54
|
-
data.xml_pi = true;
|
55
|
-
matches = /encoding="([^"]+)"/.exec(elm.value);
|
56
|
-
if (matches) {
|
57
|
-
data.docencoding = matches[1];
|
58
|
-
}
|
59
|
-
}
|
60
|
-
|
61
|
-
// Parse doctype
|
62
|
-
elm = headerFragment.getAll('#doctype')[0];
|
63
|
-
if (elm) {
|
64
|
-
data.doctype = '<!DOCTYPE' + elm.value + ">";
|
65
|
-
}
|
66
|
-
|
67
|
-
// Parse title element
|
68
|
-
elm = headerFragment.getAll('title')[0];
|
69
|
-
if (elm && elm.firstChild) {
|
70
|
-
data.title = elm.firstChild.value;
|
71
|
-
}
|
72
|
-
|
73
|
-
// Parse meta elements
|
74
|
-
each(headerFragment.getAll('meta'), function(meta) {
|
75
|
-
var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;
|
76
|
-
|
77
|
-
if (name) {
|
78
|
-
data[name.toLowerCase()] = meta.attr('content');
|
79
|
-
} else if (httpEquiv == "Content-Type") {
|
80
|
-
matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));
|
81
|
-
|
82
|
-
if (matches) {
|
83
|
-
data.docencoding = matches[1];
|
84
|
-
}
|
85
|
-
}
|
86
|
-
});
|
87
|
-
|
88
|
-
// Parse html attribs
|
89
|
-
elm = headerFragment.getAll('html')[0];
|
90
|
-
if (elm) {
|
91
|
-
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');
|
92
|
-
}
|
93
|
-
|
94
|
-
// Parse stylesheets
|
95
|
-
data.stylesheets = [];
|
96
|
-
tinymce.each(headerFragment.getAll('link'), function(link) {
|
97
|
-
if (link.attr('rel') == 'stylesheet') {
|
98
|
-
data.stylesheets.push(link.attr('href'));
|
99
|
-
}
|
100
|
-
});
|
101
|
-
|
102
|
-
// Parse body parts
|
103
|
-
elm = headerFragment.getAll('body')[0];
|
104
|
-
if (elm) {
|
105
|
-
data.langdir = getAttr(elm, 'dir');
|
106
|
-
data.style = getAttr(elm, 'style');
|
107
|
-
data.visited_color = getAttr(elm, 'vlink');
|
108
|
-
data.link_color = getAttr(elm, 'link');
|
109
|
-
data.active_color = getAttr(elm, 'alink');
|
110
|
-
}
|
111
|
-
|
112
|
-
return data;
|
113
|
-
}
|
114
|
-
|
115
|
-
function dataToHtml(data) {
|
116
|
-
var headerFragment, headElement, html, elm, value, dom = editor.dom;
|
117
|
-
|
118
|
-
function setAttr(elm, name, value) {
|
119
|
-
elm.attr(name, value ? value : undefined);
|
120
|
-
}
|
121
|
-
|
122
|
-
function addHeadNode(node) {
|
123
|
-
if (headElement.firstChild) {
|
124
|
-
headElement.insert(node, headElement.firstChild);
|
125
|
-
} else {
|
126
|
-
headElement.append(node);
|
127
|
-
}
|
128
|
-
}
|
129
|
-
|
130
|
-
headerFragment = parseHeader();
|
131
|
-
headElement = headerFragment.getAll('head')[0];
|
132
|
-
if (!headElement) {
|
133
|
-
elm = headerFragment.getAll('html')[0];
|
134
|
-
headElement = new Node('head', 1);
|
135
|
-
|
136
|
-
if (elm.firstChild) {
|
137
|
-
elm.insert(headElement, elm.firstChild, true);
|
138
|
-
} else {
|
139
|
-
elm.append(headElement);
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
// Add/update/remove XML-PI
|
144
|
-
elm = headerFragment.firstChild;
|
145
|
-
if (data.xml_pi) {
|
146
|
-
value = 'version="1.0"';
|
147
|
-
|
148
|
-
if (data.docencoding) {
|
149
|
-
value += ' encoding="' + data.docencoding + '"';
|
150
|
-
}
|
151
|
-
|
152
|
-
if (elm.type != 7) {
|
153
|
-
elm = new Node('xml', 7);
|
154
|
-
headerFragment.insert(elm, headerFragment.firstChild, true);
|
155
|
-
}
|
156
|
-
|
157
|
-
elm.value = value;
|
158
|
-
} else if (elm && elm.type == 7) {
|
159
|
-
elm.remove();
|
160
|
-
}
|
161
|
-
|
162
|
-
// Add/update/remove doctype
|
163
|
-
elm = headerFragment.getAll('#doctype')[0];
|
164
|
-
if (data.doctype) {
|
165
|
-
if (!elm) {
|
166
|
-
elm = new Node('#doctype', 10);
|
167
|
-
|
168
|
-
if (data.xml_pi) {
|
169
|
-
headerFragment.insert(elm, headerFragment.firstChild);
|
170
|
-
} else {
|
171
|
-
addHeadNode(elm);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
elm.value = data.doctype.substring(9, data.doctype.length - 1);
|
176
|
-
} else if (elm) {
|
177
|
-
elm.remove();
|
178
|
-
}
|
179
|
-
|
180
|
-
// Add meta encoding
|
181
|
-
elm = null;
|
182
|
-
each(headerFragment.getAll('meta'), function(meta) {
|
183
|
-
if (meta.attr('http-equiv') == 'Content-Type') {
|
184
|
-
elm = meta;
|
185
|
-
}
|
186
|
-
});
|
187
|
-
|
188
|
-
if (data.docencoding) {
|
189
|
-
if (!elm) {
|
190
|
-
elm = new Node('meta', 1);
|
191
|
-
elm.attr('http-equiv', 'Content-Type');
|
192
|
-
elm.shortEnded = true;
|
193
|
-
addHeadNode(elm);
|
194
|
-
}
|
195
|
-
|
196
|
-
elm.attr('content', 'text/html; charset=' + data.docencoding);
|
197
|
-
} else if (elm) {
|
198
|
-
elm.remove();
|
199
|
-
}
|
200
|
-
|
201
|
-
// Add/update/remove title
|
202
|
-
elm = headerFragment.getAll('title')[0];
|
203
|
-
if (data.title) {
|
204
|
-
if (!elm) {
|
205
|
-
elm = new Node('title', 1);
|
206
|
-
addHeadNode(elm);
|
207
|
-
} else {
|
208
|
-
elm.empty();
|
209
|
-
}
|
210
|
-
|
211
|
-
elm.append(new Node('#text', 3)).value = data.title;
|
212
|
-
} else if (elm) {
|
213
|
-
elm.remove();
|
214
|
-
}
|
215
|
-
|
216
|
-
// Add/update/remove meta
|
217
|
-
each('keywords,description,author,copyright,robots'.split(','), function(name) {
|
218
|
-
var nodes = headerFragment.getAll('meta'), i, meta, value = data[name];
|
219
|
-
|
220
|
-
for (i = 0; i < nodes.length; i++) {
|
221
|
-
meta = nodes[i];
|
222
|
-
|
223
|
-
if (meta.attr('name') == name) {
|
224
|
-
if (value) {
|
225
|
-
meta.attr('content', value);
|
226
|
-
} else {
|
227
|
-
meta.remove();
|
228
|
-
}
|
229
|
-
|
230
|
-
return;
|
231
|
-
}
|
232
|
-
}
|
233
|
-
|
234
|
-
if (value) {
|
235
|
-
elm = new Node('meta', 1);
|
236
|
-
elm.attr('name', name);
|
237
|
-
elm.attr('content', value);
|
238
|
-
elm.shortEnded = true;
|
239
|
-
|
240
|
-
addHeadNode(elm);
|
241
|
-
}
|
242
|
-
});
|
243
|
-
|
244
|
-
var currentStyleSheetsMap = {};
|
245
|
-
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
246
|
-
if (stylesheet.attr('rel') == 'stylesheet') {
|
247
|
-
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet;
|
248
|
-
}
|
249
|
-
});
|
250
|
-
|
251
|
-
// Add new
|
252
|
-
tinymce.each(data.stylesheets, function(stylesheet) {
|
253
|
-
if (!currentStyleSheetsMap[stylesheet]) {
|
254
|
-
elm = new Node('link', 1);
|
255
|
-
elm.attr({
|
256
|
-
rel: 'stylesheet',
|
257
|
-
text: 'text/css',
|
258
|
-
href: stylesheet
|
259
|
-
});
|
260
|
-
elm.shortEnded = true;
|
261
|
-
addHeadNode(elm);
|
262
|
-
}
|
263
|
-
|
264
|
-
delete currentStyleSheetsMap[stylesheet];
|
265
|
-
});
|
266
|
-
|
267
|
-
// Delete old
|
268
|
-
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
269
|
-
stylesheet.remove();
|
270
|
-
});
|
271
|
-
|
272
|
-
// Update body attributes
|
273
|
-
elm = headerFragment.getAll('body')[0];
|
274
|
-
if (elm) {
|
275
|
-
setAttr(elm, 'dir', data.langdir);
|
276
|
-
setAttr(elm, 'style', data.style);
|
277
|
-
setAttr(elm, 'vlink', data.visited_color);
|
278
|
-
setAttr(elm, 'link', data.link_color);
|
279
|
-
setAttr(elm, 'alink', data.active_color);
|
280
|
-
|
281
|
-
// Update iframe body as well
|
282
|
-
dom.setAttribs(editor.getBody(), {
|
283
|
-
style : data.style,
|
284
|
-
dir : data.dir,
|
285
|
-
vLink : data.visited_color,
|
286
|
-
link : data.link_color,
|
287
|
-
aLink : data.active_color
|
288
|
-
});
|
289
|
-
}
|
290
|
-
|
291
|
-
// Set html attributes
|
292
|
-
elm = headerFragment.getAll('html')[0];
|
293
|
-
if (elm) {
|
294
|
-
setAttr(elm, 'lang', data.langcode);
|
295
|
-
setAttr(elm, 'xml:lang', data.langcode);
|
296
|
-
}
|
297
|
-
|
298
|
-
// No need for a head element
|
299
|
-
if (!headElement.firstChild) {
|
300
|
-
headElement.remove();
|
301
|
-
}
|
302
|
-
|
303
|
-
// Serialize header fragment and crop away body part
|
304
|
-
html = new tinymce.html.Serializer({
|
305
|
-
validate: false,
|
306
|
-
indent: true,
|
307
|
-
apply_source_formatting : true,
|
308
|
-
indent_before: 'head,html,body,meta,title,script,link,style',
|
309
|
-
indent_after: 'head,html,body,meta,title,script,link,style'
|
310
|
-
}).serialize(headerFragment);
|
311
|
-
|
312
|
-
head = html.substring(0, html.indexOf('</body>'));
|
313
|
-
}
|
314
|
-
|
315
|
-
function parseHeader() {
|
316
|
-
// Parse the contents with a DOM parser
|
317
|
-
return new tinymce.html.DomParser({
|
318
|
-
validate: false,
|
319
|
-
root_name: '#document'
|
320
|
-
}).parse(head);
|
321
|
-
}
|
322
|
-
|
323
|
-
function setContent(evt) {
|
324
|
-
var startPos, endPos, content = evt.content, headerFragment, styles = '', dom = editor.dom, elm;
|
325
|
-
|
326
|
-
if (evt.selection) {
|
327
|
-
return;
|
328
|
-
}
|
329
|
-
|
330
|
-
function low(s) {
|
331
|
-
return s.replace(/<\/?[A-Z]+/g, function(a) {
|
332
|
-
return a.toLowerCase();
|
333
|
-
});
|
334
|
-
}
|
335
|
-
|
336
|
-
// Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate
|
337
|
-
if (evt.format == 'raw' && head) {
|
338
|
-
return;
|
339
|
-
}
|
340
|
-
|
341
|
-
if (evt.source_view && editor.getParam('fullpage_hide_in_source_view')) {
|
342
|
-
return;
|
343
|
-
}
|
344
|
-
|
345
|
-
// Fixed so new document/setContent('') doesn't remove existing header/footer except when it's in source code view
|
346
|
-
if (content.length === 0 && !evt.source_view) {
|
347
|
-
content = tinymce.trim(head) + '\n' + tinymce.trim(content) + '\n' + tinymce.trim(foot);
|
348
|
-
}
|
349
|
-
|
350
|
-
// Parse out head, body and footer
|
351
|
-
content = content.replace(/<(\/?)BODY/gi, '<$1body');
|
352
|
-
startPos = content.indexOf('<body');
|
353
|
-
|
354
|
-
if (startPos != -1) {
|
355
|
-
startPos = content.indexOf('>', startPos);
|
356
|
-
head = low(content.substring(0, startPos + 1));
|
357
|
-
|
358
|
-
endPos = content.indexOf('</body', startPos);
|
359
|
-
if (endPos == -1) {
|
360
|
-
endPos = content.length;
|
361
|
-
}
|
362
|
-
|
363
|
-
evt.content = content.substring(startPos + 1, endPos);
|
364
|
-
foot = low(content.substring(endPos));
|
365
|
-
} else {
|
366
|
-
head = getDefaultHeader();
|
367
|
-
foot = '\n</body>\n</html>';
|
368
|
-
}
|
369
|
-
|
370
|
-
// Parse header and update iframe
|
371
|
-
headerFragment = parseHeader();
|
372
|
-
each(headerFragment.getAll('style'), function(node) {
|
373
|
-
if (node.firstChild) {
|
374
|
-
styles += node.firstChild.value;
|
375
|
-
}
|
376
|
-
});
|
377
|
-
|
378
|
-
elm = headerFragment.getAll('body')[0];
|
379
|
-
if (elm) {
|
380
|
-
dom.setAttribs(editor.getBody(), {
|
381
|
-
style: elm.attr('style') || '',
|
382
|
-
dir: elm.attr('dir') || '',
|
383
|
-
vLink: elm.attr('vlink') || '',
|
384
|
-
link: elm.attr('link') || '',
|
385
|
-
aLink: elm.attr('alink') || ''
|
386
|
-
});
|
387
|
-
}
|
388
|
-
|
389
|
-
dom.remove('fullpage_styles');
|
390
|
-
|
391
|
-
var headElm = editor.getDoc().getElementsByTagName('head')[0];
|
392
|
-
|
393
|
-
if (styles) {
|
394
|
-
dom.add(headElm, 'style', {
|
395
|
-
id : 'fullpage_styles'
|
396
|
-
}, styles);
|
397
|
-
|
398
|
-
// Needed for IE 6/7
|
399
|
-
elm = dom.get('fullpage_styles');
|
400
|
-
if (elm.styleSheet) {
|
401
|
-
elm.styleSheet.cssText = styles;
|
402
|
-
}
|
403
|
-
}
|
404
|
-
|
405
|
-
var currentStyleSheetsMap = {};
|
406
|
-
tinymce.each(headElm.getElementsByTagName('link'), function(stylesheet) {
|
407
|
-
if (stylesheet.rel == 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) {
|
408
|
-
currentStyleSheetsMap[stylesheet.href] = stylesheet;
|
409
|
-
}
|
410
|
-
});
|
411
|
-
|
412
|
-
// Add new
|
413
|
-
tinymce.each(headerFragment.getAll('link'), function(stylesheet) {
|
414
|
-
var href = stylesheet.attr('href');
|
415
|
-
|
416
|
-
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') == 'stylesheet') {
|
417
|
-
dom.add(headElm, 'link', {
|
418
|
-
rel: 'stylesheet',
|
419
|
-
text: 'text/css',
|
420
|
-
href: href,
|
421
|
-
'data-mce-fullpage': '1'
|
422
|
-
});
|
423
|
-
}
|
424
|
-
|
425
|
-
delete currentStyleSheetsMap[href];
|
426
|
-
});
|
427
|
-
|
428
|
-
// Delete old
|
429
|
-
tinymce.each(currentStyleSheetsMap, function(stylesheet) {
|
430
|
-
stylesheet.parentNode.removeChild(stylesheet);
|
431
|
-
});
|
432
|
-
}
|
433
|
-
|
434
|
-
function getDefaultHeader() {
|
435
|
-
var header = '', value, styles = '';
|
436
|
-
|
437
|
-
if (editor.getParam('fullpage_default_xml_pi')) {
|
438
|
-
header += '<?xml version="1.0" encoding="' + editor.getParam('fullpage_default_encoding', 'ISO-8859-1') + '" ?>\n';
|
439
|
-
}
|
440
|
-
|
441
|
-
header += editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>');
|
442
|
-
header += '\n<html>\n<head>\n';
|
443
|
-
|
444
|
-
if ((value = editor.getParam('fullpage_default_title'))) {
|
445
|
-
header += '<title>' + value + '</title>\n';
|
446
|
-
}
|
447
|
-
|
448
|
-
if ((value = editor.getParam('fullpage_default_encoding'))) {
|
449
|
-
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n';
|
450
|
-
}
|
451
|
-
|
452
|
-
if ((value = editor.getParam('fullpage_default_font_family'))) {
|
453
|
-
styles += 'font-family: ' + value + ';';
|
454
|
-
}
|
455
|
-
|
456
|
-
if ((value = editor.getParam('fullpage_default_font_size'))) {
|
457
|
-
styles += 'font-size: ' + value + ';';
|
458
|
-
}
|
459
|
-
|
460
|
-
if ((value = editor.getParam('fullpage_default_text_color'))) {
|
461
|
-
styles += 'color: ' + value + ';';
|
462
|
-
}
|
463
|
-
|
464
|
-
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n';
|
465
|
-
|
466
|
-
return header;
|
467
|
-
}
|
468
|
-
|
469
|
-
function getContent(evt) {
|
470
|
-
if (!evt.selection && (!evt.source_view || !editor.getParam('fullpage_hide_in_source_view'))) {
|
471
|
-
evt.content = tinymce.trim(head) + '\n' + tinymce.trim(evt.content) + '\n' + tinymce.trim(foot);
|
472
|
-
}
|
473
|
-
}
|
474
|
-
|
475
|
-
editor.addCommand('mceFullPageProperties', showDialog);
|
476
|
-
|
477
|
-
editor.addButton('fullpage', {
|
478
|
-
title: 'Document properties',
|
479
|
-
cmd : 'mceFullPageProperties'
|
480
|
-
});
|
481
|
-
|
482
|
-
editor.addMenuItem('fullpage', {
|
483
|
-
text: 'Document properties',
|
484
|
-
cmd : 'mceFullPageProperties',
|
485
|
-
context: 'file'
|
486
|
-
});
|
487
|
-
|
488
|
-
editor.on('BeforeSetContent', setContent);
|
489
|
-
editor.on('GetContent', getContent);
|
490
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
tinymce.PluginManager.add("fullpage",function(a){function b(){var b=c();a.windowManager.open({title:"Document properties",data:b,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(a){d(tinymce.extend(b,a.data))}})}function c(){function b(a,b){var c=a.attr(b);return c||""}var c,d,f=e(),g={};return g.fontface=a.getParam("fullpage_default_fontface",""),g.fontsize=a.getParam("fullpage_default_fontsize",""),c=f.firstChild,7==c.type&&(g.xml_pi=!0,d=/encoding="([^"]+)"/.exec(c.value),d&&(g.docencoding=d[1])),c=f.getAll("#doctype")[0],c&&(g.doctype="<!DOCTYPE"+c.value+">"),c=f.getAll("title")[0],c&&c.firstChild&&(g.title=c.firstChild.value),k(f.getAll("meta"),function(a){var b,c=a.attr("name"),d=a.attr("http-equiv");c?g[c.toLowerCase()]=a.attr("content"):"Content-Type"==d&&(b=/charset\s*=\s*(.*)\s*/gi.exec(a.attr("content")),b&&(g.docencoding=b[1]))}),c=f.getAll("html")[0],c&&(g.langcode=b(c,"lang")||b(c,"xml:lang")),g.stylesheets=[],tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&g.stylesheets.push(a.attr("href"))}),c=f.getAll("body")[0],c&&(g.langdir=b(c,"dir"),g.style=b(c,"style"),g.visited_color=b(c,"vlink"),g.link_color=b(c,"link"),g.active_color=b(c,"alink")),g}function d(b){function c(a,b,c){a.attr(b,c?c:void 0)}function d(a){g.firstChild?g.insert(a,g.firstChild):g.append(a)}var f,g,h,j,m,n=a.dom;f=e(),g=f.getAll("head")[0],g||(j=f.getAll("html")[0],g=new l("head",1),j.firstChild?j.insert(g,j.firstChild,!0):j.append(g)),j=f.firstChild,b.xml_pi?(m='version="1.0"',b.docencoding&&(m+=' encoding="'+b.docencoding+'"'),7!=j.type&&(j=new l("xml",7),f.insert(j,f.firstChild,!0)),j.value=m):j&&7==j.type&&j.remove(),j=f.getAll("#doctype")[0],b.doctype?(j||(j=new l("#doctype",10),b.xml_pi?f.insert(j,f.firstChild):d(j)),j.value=b.doctype.substring(9,b.doctype.length-1)):j&&j.remove(),j=null,k(f.getAll("meta"),function(a){"Content-Type"==a.attr("http-equiv")&&(j=a)}),b.docencoding?(j||(j=new l("meta",1),j.attr("http-equiv","Content-Type"),j.shortEnded=!0,d(j)),j.attr("content","text/html; charset="+b.docencoding)):j&&j.remove(),j=f.getAll("title")[0],b.title?(j?j.empty():(j=new l("title",1),d(j)),j.append(new l("#text",3)).value=b.title):j&&j.remove(),k("keywords,description,author,copyright,robots".split(","),function(a){var c,e,g=f.getAll("meta"),h=b[a];for(c=0;c<g.length;c++)if(e=g[c],e.attr("name")==a)return void(h?e.attr("content",h):e.remove());h&&(j=new l("meta",1),j.attr("name",a),j.attr("content",h),j.shortEnded=!0,d(j))});var o={};tinymce.each(f.getAll("link"),function(a){"stylesheet"==a.attr("rel")&&(o[a.attr("href")]=a)}),tinymce.each(b.stylesheets,function(a){o[a]||(j=new l("link",1),j.attr({rel:"stylesheet",text:"text/css",href:a}),j.shortEnded=!0,d(j)),delete o[a]}),tinymce.each(o,function(a){a.remove()}),j=f.getAll("body")[0],j&&(c(j,"dir",b.langdir),c(j,"style",b.style),c(j,"vlink",b.visited_color),c(j,"link",b.link_color),c(j,"alink",b.active_color),n.setAttribs(a.getBody(),{style:b.style,dir:b.dir,vLink:b.visited_color,link:b.link_color,aLink:b.active_color})),j=f.getAll("html")[0],j&&(c(j,"lang",b.langcode),c(j,"xml:lang",b.langcode)),g.firstChild||g.remove(),h=new tinymce.html.Serializer({validate:!1,indent:!0,apply_source_formatting:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(f),i=h.substring(0,h.indexOf("</body>"))}function e(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(i)}function f(b){function c(a){return a.replace(/<\/?[A-Z]+/g,function(a){return a.toLowerCase()})}var d,f,h,l,m=b.content,n="",o=a.dom;if(!b.selection&&!("raw"==b.format&&i||b.source_view&&a.getParam("fullpage_hide_in_source_view"))){0!==m.length||b.source_view||(m=tinymce.trim(i)+"\n"+tinymce.trim(m)+"\n"+tinymce.trim(j)),m=m.replace(/<(\/?)BODY/gi,"<$1body"),d=m.indexOf("<body"),-1!=d?(d=m.indexOf(">",d),i=c(m.substring(0,d+1)),f=m.indexOf("</body",d),-1==f&&(f=m.length),b.content=m.substring(d+1,f),j=c(m.substring(f))):(i=g(),j="\n</body>\n</html>"),h=e(),k(h.getAll("style"),function(a){a.firstChild&&(n+=a.firstChild.value)}),l=h.getAll("body")[0],l&&o.setAttribs(a.getBody(),{style:l.attr("style")||"",dir:l.attr("dir")||"",vLink:l.attr("vlink")||"",link:l.attr("link")||"",aLink:l.attr("alink")||""}),o.remove("fullpage_styles");var p=a.getDoc().getElementsByTagName("head")[0];n&&(o.add(p,"style",{id:"fullpage_styles"},n),l=o.get("fullpage_styles"),l.styleSheet&&(l.styleSheet.cssText=n));var q={};tinymce.each(p.getElementsByTagName("link"),function(a){"stylesheet"==a.rel&&a.getAttribute("data-mce-fullpage")&&(q[a.href]=a)}),tinymce.each(h.getAll("link"),function(a){var b=a.attr("href");q[b]||"stylesheet"!=a.attr("rel")||o.add(p,"link",{rel:"stylesheet",text:"text/css",href:b,"data-mce-fullpage":"1"}),delete q[b]}),tinymce.each(q,function(a){a.parentNode.removeChild(a)})}}function g(){var b,c="",d="";return a.getParam("fullpage_default_xml_pi")&&(c+='<?xml version="1.0" encoding="'+a.getParam("fullpage_default_encoding","ISO-8859-1")+'" ?>\n'),c+=a.getParam("fullpage_default_doctype","<!DOCTYPE html>"),c+="\n<html>\n<head>\n",(b=a.getParam("fullpage_default_title"))&&(c+="<title>"+b+"</title>\n"),(b=a.getParam("fullpage_default_encoding"))&&(c+='<meta http-equiv="Content-Type" content="text/html; charset='+b+'" />\n'),(b=a.getParam("fullpage_default_font_family"))&&(d+="font-family: "+b+";"),(b=a.getParam("fullpage_default_font_size"))&&(d+="font-size: "+b+";"),(b=a.getParam("fullpage_default_text_color"))&&(d+="color: "+b+";"),c+="</head>\n<body"+(d?' style="'+d+'"':"")+">\n"}function h(b){b.selection||b.source_view&&a.getParam("fullpage_hide_in_source_view")||(b.content=tinymce.trim(i)+"\n"+tinymce.trim(b.content)+"\n"+tinymce.trim(j))}var i,j,k=tinymce.each,l=tinymce.html.Node;a.addCommand("mceFullPageProperties",b),a.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),a.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),a.on("BeforeSetContent",f),a.on("GetContent",h)});
|
@@ -1,136 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* plugin.js
|
3
|
-
*
|
4
|
-
* Copyright, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://www.tinymce.com/license
|
8
|
-
* Contributing: http://www.tinymce.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
/*global tinymce:true */
|
12
|
-
|
13
|
-
tinymce.PluginManager.add('fullscreen', function(editor) {
|
14
|
-
var fullscreenState = false, DOM = tinymce.DOM, iframeWidth, iframeHeight, resizeHandler;
|
15
|
-
var containerWidth, containerHeight;
|
16
|
-
|
17
|
-
if (editor.settings.inline) {
|
18
|
-
return;
|
19
|
-
}
|
20
|
-
|
21
|
-
function getWindowSize() {
|
22
|
-
var w, h, win = window, doc = document;
|
23
|
-
var body = doc.body;
|
24
|
-
|
25
|
-
// Old IE
|
26
|
-
if (body.offsetWidth) {
|
27
|
-
w = body.offsetWidth;
|
28
|
-
h = body.offsetHeight;
|
29
|
-
}
|
30
|
-
|
31
|
-
// Modern browsers
|
32
|
-
if (win.innerWidth && win.innerHeight) {
|
33
|
-
w = win.innerWidth;
|
34
|
-
h = win.innerHeight;
|
35
|
-
}
|
36
|
-
|
37
|
-
return {w: w, h: h};
|
38
|
-
}
|
39
|
-
|
40
|
-
function toggleFullscreen() {
|
41
|
-
var body = document.body, documentElement = document.documentElement, editorContainerStyle;
|
42
|
-
var editorContainer, iframe, iframeStyle;
|
43
|
-
|
44
|
-
function resize() {
|
45
|
-
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
46
|
-
}
|
47
|
-
|
48
|
-
fullscreenState = !fullscreenState;
|
49
|
-
|
50
|
-
editorContainer = editor.getContainer();
|
51
|
-
editorContainerStyle = editorContainer.style;
|
52
|
-
iframe = editor.getContentAreaContainer().firstChild;
|
53
|
-
iframeStyle = iframe.style;
|
54
|
-
|
55
|
-
if (fullscreenState) {
|
56
|
-
iframeWidth = iframeStyle.width;
|
57
|
-
iframeHeight = iframeStyle.height;
|
58
|
-
iframeStyle.width = iframeStyle.height = '100%';
|
59
|
-
containerWidth = editorContainerStyle.width;
|
60
|
-
containerHeight = editorContainerStyle.height;
|
61
|
-
editorContainerStyle.width = editorContainerStyle.height = '';
|
62
|
-
|
63
|
-
DOM.addClass(body, 'mce-fullscreen');
|
64
|
-
DOM.addClass(documentElement, 'mce-fullscreen');
|
65
|
-
DOM.addClass(editorContainer, 'mce-fullscreen');
|
66
|
-
|
67
|
-
DOM.bind(window, 'resize', resize);
|
68
|
-
resize();
|
69
|
-
resizeHandler = resize;
|
70
|
-
} else {
|
71
|
-
iframeStyle.width = iframeWidth;
|
72
|
-
iframeStyle.height = iframeHeight;
|
73
|
-
|
74
|
-
if (containerWidth) {
|
75
|
-
editorContainerStyle.width = containerWidth;
|
76
|
-
}
|
77
|
-
|
78
|
-
if (containerHeight) {
|
79
|
-
editorContainerStyle.height = containerHeight;
|
80
|
-
}
|
81
|
-
|
82
|
-
DOM.removeClass(body, 'mce-fullscreen');
|
83
|
-
DOM.removeClass(documentElement, 'mce-fullscreen');
|
84
|
-
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
85
|
-
DOM.unbind(window, 'resize', resizeHandler);
|
86
|
-
}
|
87
|
-
|
88
|
-
editor.fire('FullscreenStateChanged', {state: fullscreenState});
|
89
|
-
}
|
90
|
-
|
91
|
-
editor.on('init', function() {
|
92
|
-
editor.addShortcut('Ctrl+Alt+F', '', toggleFullscreen);
|
93
|
-
});
|
94
|
-
|
95
|
-
editor.on('remove', function() {
|
96
|
-
if (resizeHandler) {
|
97
|
-
DOM.unbind(window, 'resize', resizeHandler);
|
98
|
-
}
|
99
|
-
});
|
100
|
-
|
101
|
-
editor.addCommand('mceFullScreen', toggleFullscreen);
|
102
|
-
|
103
|
-
editor.addMenuItem('fullscreen', {
|
104
|
-
text: 'Fullscreen',
|
105
|
-
shortcut: 'Ctrl+Alt+F',
|
106
|
-
selectable: true,
|
107
|
-
onClick: toggleFullscreen,
|
108
|
-
onPostRender: function() {
|
109
|
-
var self = this;
|
110
|
-
|
111
|
-
editor.on('FullscreenStateChanged', function(e) {
|
112
|
-
self.active(e.state);
|
113
|
-
});
|
114
|
-
},
|
115
|
-
context: 'view'
|
116
|
-
});
|
117
|
-
|
118
|
-
editor.addButton('fullscreen', {
|
119
|
-
tooltip: 'Fullscreen',
|
120
|
-
shortcut: 'Ctrl+Alt+F',
|
121
|
-
onClick: toggleFullscreen,
|
122
|
-
onPostRender: function() {
|
123
|
-
var self = this;
|
124
|
-
|
125
|
-
editor.on('FullscreenStateChanged', function(e) {
|
126
|
-
self.active(e.state);
|
127
|
-
});
|
128
|
-
}
|
129
|
-
});
|
130
|
-
|
131
|
-
return {
|
132
|
-
isFullscreen: function() {
|
133
|
-
return fullscreenState;
|
134
|
-
}
|
135
|
-
};
|
136
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
tinymce.PluginManager.add("fullscreen",function(a){function b(){var a,b,c=window,d=document,e=d.body;return e.offsetWidth&&(a=e.offsetWidth,b=e.offsetHeight),c.innerWidth&&c.innerHeight&&(a=c.innerWidth,b=c.innerHeight),{w:a,h:b}}function c(){function c(){j.setStyle(m,"height",b().h-(l.clientHeight-m.clientHeight))}var k,l,m,n,o=document.body,p=document.documentElement;i=!i,l=a.getContainer(),k=l.style,m=a.getContentAreaContainer().firstChild,n=m.style,i?(d=n.width,e=n.height,n.width=n.height="100%",g=k.width,h=k.height,k.width=k.height="",j.addClass(o,"mce-fullscreen"),j.addClass(p,"mce-fullscreen"),j.addClass(l,"mce-fullscreen"),j.bind(window,"resize",c),c(),f=c):(n.width=d,n.height=e,g&&(k.width=g),h&&(k.height=h),j.removeClass(o,"mce-fullscreen"),j.removeClass(p,"mce-fullscreen"),j.removeClass(l,"mce-fullscreen"),j.unbind(window,"resize",f)),a.fire("FullscreenStateChanged",{state:i})}var d,e,f,g,h,i=!1,j=tinymce.DOM;return a.settings.inline?void 0:(a.on("init",function(){a.addShortcut("Ctrl+Alt+F","",c)}),a.on("remove",function(){f&&j.unbind(window,"resize",f)}),a.addCommand("mceFullScreen",c),a.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})},context:"view"}),a.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:c,onPostRender:function(){var b=this;a.on("FullscreenStateChanged",function(a){b.active(a.state)})}}),{isFullscreen:function(){return i}})});
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* plugin.js
|
3
|
-
*
|
4
|
-
* Copyright, Moxiecode Systems AB
|
5
|
-
* Released under LGPL License.
|
6
|
-
*
|
7
|
-
* License: http://www.tinymce.com/license
|
8
|
-
* Contributing: http://www.tinymce.com/contributing
|
9
|
-
*/
|
10
|
-
|
11
|
-
/*global tinymce:true */
|
12
|
-
|
13
|
-
tinymce.PluginManager.add('hr', function(editor) {
|
14
|
-
editor.addCommand('InsertHorizontalRule', function() {
|
15
|
-
editor.execCommand('mceInsertContent', false, '<hr />');
|
16
|
-
});
|
17
|
-
|
18
|
-
editor.addButton('hr', {
|
19
|
-
icon: 'hr',
|
20
|
-
tooltip: 'Horizontal line',
|
21
|
-
cmd: 'InsertHorizontalRule'
|
22
|
-
});
|
23
|
-
|
24
|
-
editor.addMenuItem('hr', {
|
25
|
-
icon: 'hr',
|
26
|
-
text: 'Horizontal line',
|
27
|
-
cmd: 'InsertHorizontalRule',
|
28
|
-
context: 'insert'
|
29
|
-
});
|
30
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});
|