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,121 +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('insertdatetime', function(editor) {
|
14
|
-
var daysShort = "Sun Mon Tue Wed Thu Fri Sat Sun".split(' ');
|
15
|
-
var daysLong = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(' ');
|
16
|
-
var monthsShort = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(' ');
|
17
|
-
var monthsLong = "January February March April May June July August September October November December".split(' ');
|
18
|
-
var menuItems = [], lastFormat, defaultButtonTimeFormat;
|
19
|
-
|
20
|
-
function getDateTime(fmt, date) {
|
21
|
-
function addZeros(value, len) {
|
22
|
-
value = "" + value;
|
23
|
-
|
24
|
-
if (value.length < len) {
|
25
|
-
for (var i = 0; i < (len - value.length); i++) {
|
26
|
-
value = "0" + value;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
return value;
|
31
|
-
}
|
32
|
-
|
33
|
-
date = date || new Date();
|
34
|
-
|
35
|
-
fmt = fmt.replace("%D", "%m/%d/%Y");
|
36
|
-
fmt = fmt.replace("%r", "%I:%M:%S %p");
|
37
|
-
fmt = fmt.replace("%Y", "" + date.getFullYear());
|
38
|
-
fmt = fmt.replace("%y", "" + date.getYear());
|
39
|
-
fmt = fmt.replace("%m", addZeros(date.getMonth() + 1, 2));
|
40
|
-
fmt = fmt.replace("%d", addZeros(date.getDate(), 2));
|
41
|
-
fmt = fmt.replace("%H", "" + addZeros(date.getHours(), 2));
|
42
|
-
fmt = fmt.replace("%M", "" + addZeros(date.getMinutes(), 2));
|
43
|
-
fmt = fmt.replace("%S", "" + addZeros(date.getSeconds(), 2));
|
44
|
-
fmt = fmt.replace("%I", "" + ((date.getHours() + 11) % 12 + 1));
|
45
|
-
fmt = fmt.replace("%p", "" + (date.getHours() < 12 ? "AM" : "PM"));
|
46
|
-
fmt = fmt.replace("%B", "" + editor.translate(monthsLong[date.getMonth()]));
|
47
|
-
fmt = fmt.replace("%b", "" + editor.translate(monthsShort[date.getMonth()]));
|
48
|
-
fmt = fmt.replace("%A", "" + editor.translate(daysLong[date.getDay()]));
|
49
|
-
fmt = fmt.replace("%a", "" + editor.translate(daysShort[date.getDay()]));
|
50
|
-
fmt = fmt.replace("%%", "%");
|
51
|
-
|
52
|
-
return fmt;
|
53
|
-
}
|
54
|
-
|
55
|
-
function insertDateTime(format) {
|
56
|
-
var html = getDateTime(format);
|
57
|
-
|
58
|
-
if (editor.settings.insertdatetime_element) {
|
59
|
-
var computerTime;
|
60
|
-
|
61
|
-
if (/%[HMSIp]/.test(format)) {
|
62
|
-
computerTime = getDateTime("%Y-%m-%dT%H:%M");
|
63
|
-
} else {
|
64
|
-
computerTime = getDateTime("%Y-%m-%d");
|
65
|
-
}
|
66
|
-
|
67
|
-
html = '<time datetime="' + computerTime + '">' + html + '</time>';
|
68
|
-
|
69
|
-
var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time');
|
70
|
-
if (timeElm) {
|
71
|
-
editor.dom.setOuterHTML(timeElm, html);
|
72
|
-
return;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
|
76
|
-
editor.insertContent(html);
|
77
|
-
}
|
78
|
-
|
79
|
-
editor.addCommand('mceInsertDate', function() {
|
80
|
-
insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d")));
|
81
|
-
});
|
82
|
-
|
83
|
-
editor.addCommand('mceInsertTime', function() {
|
84
|
-
insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S')));
|
85
|
-
});
|
86
|
-
|
87
|
-
editor.addButton('insertdatetime', {
|
88
|
-
type: 'splitbutton',
|
89
|
-
title: 'Insert date/time',
|
90
|
-
onclick: function() {
|
91
|
-
insertDateTime(lastFormat || defaultButtonTimeFormat);
|
92
|
-
},
|
93
|
-
menu: menuItems
|
94
|
-
});
|
95
|
-
|
96
|
-
tinymce.each(editor.settings.insertdatetime_formats || [
|
97
|
-
"%H:%M:%S",
|
98
|
-
"%Y-%m-%d",
|
99
|
-
"%I:%M:%S %p",
|
100
|
-
"%D"
|
101
|
-
], function(fmt) {
|
102
|
-
if (!defaultButtonTimeFormat) {
|
103
|
-
defaultButtonTimeFormat = fmt;
|
104
|
-
}
|
105
|
-
|
106
|
-
menuItems.push({
|
107
|
-
text: getDateTime(fmt),
|
108
|
-
onclick: function() {
|
109
|
-
lastFormat = fmt;
|
110
|
-
insertDateTime(fmt);
|
111
|
-
}
|
112
|
-
});
|
113
|
-
});
|
114
|
-
|
115
|
-
editor.addMenuItem('insertdatetime', {
|
116
|
-
icon: 'date',
|
117
|
-
text: 'Insert date/time',
|
118
|
-
menu: menuItems,
|
119
|
-
context: 'insert'
|
120
|
-
});
|
121
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
tinymce.PluginManager.add("insertdatetime",function(a){function b(b,c){function d(a,b){if(a=""+a,a.length<b)for(var c=0;c<b-a.length;c++)a="0"+a;return a}return c=c||new Date,b=b.replace("%D","%m/%d/%Y"),b=b.replace("%r","%I:%M:%S %p"),b=b.replace("%Y",""+c.getFullYear()),b=b.replace("%y",""+c.getYear()),b=b.replace("%m",d(c.getMonth()+1,2)),b=b.replace("%d",d(c.getDate(),2)),b=b.replace("%H",""+d(c.getHours(),2)),b=b.replace("%M",""+d(c.getMinutes(),2)),b=b.replace("%S",""+d(c.getSeconds(),2)),b=b.replace("%I",""+((c.getHours()+11)%12+1)),b=b.replace("%p",""+(c.getHours()<12?"AM":"PM")),b=b.replace("%B",""+a.translate(i[c.getMonth()])),b=b.replace("%b",""+a.translate(h[c.getMonth()])),b=b.replace("%A",""+a.translate(g[c.getDay()])),b=b.replace("%a",""+a.translate(f[c.getDay()])),b=b.replace("%%","%")}function c(c){var d=b(c);if(a.settings.insertdatetime_element){var e;e=b(/%[HMSIp]/.test(c)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),d='<time datetime="'+e+'">'+d+"</time>";var f=a.dom.getParent(a.selection.getStart(),"time");if(f)return void a.dom.setOuterHTML(f,d)}a.insertContent(d)}var d,e,f="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),g="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),h="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),i="January February March April May June July August September October November December".split(" "),j=[];a.addCommand("mceInsertDate",function(){c(a.getParam("insertdatetime_dateformat",a.translate("%Y-%m-%d")))}),a.addCommand("mceInsertTime",function(){c(a.getParam("insertdatetime_timeformat",a.translate("%H:%M:%S")))}),a.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){c(d||e)},menu:j}),tinymce.each(a.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(a){e||(e=a),j.push({text:b(a),onclick:function(){d=a,c(a)}})}),a.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:j,context:"insert"})});
|
@@ -1,225 +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('layer', function(editor) {
|
14
|
-
function getParentLayer(node) {
|
15
|
-
do {
|
16
|
-
if (node.className && node.className.indexOf('mceItemLayer') != -1) {
|
17
|
-
return node;
|
18
|
-
}
|
19
|
-
} while ((node = node.parentNode));
|
20
|
-
}
|
21
|
-
|
22
|
-
function visualAid(e) {
|
23
|
-
var dom = editor.dom;
|
24
|
-
|
25
|
-
tinymce.each(dom.select('div,p', e), function(e) {
|
26
|
-
if (/^(absolute|relative|fixed)$/i.test(e.style.position)) {
|
27
|
-
if (e.hasVisual) {
|
28
|
-
dom.addClass(e, 'mceItemVisualAid');
|
29
|
-
} else {
|
30
|
-
dom.removeClass(e, 'mceItemVisualAid');
|
31
|
-
}
|
32
|
-
|
33
|
-
dom.addClass(e, 'mceItemLayer');
|
34
|
-
}
|
35
|
-
});
|
36
|
-
}
|
37
|
-
|
38
|
-
function move(d) {
|
39
|
-
var i, z = [], le = getParentLayer(editor.selection.getNode()), ci = -1, fi = -1, nl;
|
40
|
-
|
41
|
-
nl = [];
|
42
|
-
tinymce.walk(editor.getBody(), function(n) {
|
43
|
-
if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) {
|
44
|
-
nl.push(n);
|
45
|
-
}
|
46
|
-
}, 'childNodes');
|
47
|
-
|
48
|
-
// Find z-indexes
|
49
|
-
for (i = 0; i < nl.length; i++) {
|
50
|
-
z[i] = nl[i].style.zIndex ? parseInt(nl[i].style.zIndex, 10) : 0;
|
51
|
-
|
52
|
-
if (ci < 0 && nl[i] == le) {
|
53
|
-
ci = i;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
if (d < 0) {
|
58
|
-
// Move back
|
59
|
-
|
60
|
-
// Try find a lower one
|
61
|
-
for (i = 0; i < z.length; i++) {
|
62
|
-
if (z[i] < z[ci]) {
|
63
|
-
fi = i;
|
64
|
-
break;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
if (fi > -1) {
|
69
|
-
nl[ci].style.zIndex = z[fi];
|
70
|
-
nl[fi].style.zIndex = z[ci];
|
71
|
-
} else {
|
72
|
-
if (z[ci] > 0) {
|
73
|
-
nl[ci].style.zIndex = z[ci] - 1;
|
74
|
-
}
|
75
|
-
}
|
76
|
-
} else {
|
77
|
-
// Move forward
|
78
|
-
|
79
|
-
// Try find a higher one
|
80
|
-
for (i = 0; i < z.length; i++) {
|
81
|
-
if (z[i] > z[ci]) {
|
82
|
-
fi = i;
|
83
|
-
break;
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
if (fi > -1) {
|
88
|
-
nl[ci].style.zIndex = z[fi];
|
89
|
-
nl[fi].style.zIndex = z[ci];
|
90
|
-
} else {
|
91
|
-
nl[ci].style.zIndex = z[ci] + 1;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
editor.execCommand('mceRepaint');
|
96
|
-
}
|
97
|
-
|
98
|
-
function insertLayer() {
|
99
|
-
var dom = editor.dom, p = dom.getPos(dom.getParent(editor.selection.getNode(), '*'));
|
100
|
-
var body = editor.getBody();
|
101
|
-
|
102
|
-
editor.dom.add(body, 'div', {
|
103
|
-
style: {
|
104
|
-
position: 'absolute',
|
105
|
-
left: p.x,
|
106
|
-
top: (p.y > 20 ? p.y : 20),
|
107
|
-
width: 100,
|
108
|
-
height: 100
|
109
|
-
},
|
110
|
-
'class': 'mceItemVisualAid mceItemLayer'
|
111
|
-
}, editor.selection.getContent() || editor.getLang('layer.content'));
|
112
|
-
|
113
|
-
// Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7
|
114
|
-
if (tinymce.Env.ie) {
|
115
|
-
dom.setHTML(body, body.innerHTML);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
function toggleAbsolute() {
|
120
|
-
var le = getParentLayer(editor.selection.getNode());
|
121
|
-
|
122
|
-
if (!le) {
|
123
|
-
le = editor.dom.getParent(editor.selection.getNode(), 'DIV,P,IMG');
|
124
|
-
}
|
125
|
-
|
126
|
-
if (le) {
|
127
|
-
if (le.style.position.toLowerCase() == "absolute") {
|
128
|
-
editor.dom.setStyles(le, {
|
129
|
-
position: '',
|
130
|
-
left: '',
|
131
|
-
top: '',
|
132
|
-
width: '',
|
133
|
-
height: ''
|
134
|
-
});
|
135
|
-
|
136
|
-
editor.dom.removeClass(le, 'mceItemVisualAid');
|
137
|
-
editor.dom.removeClass(le, 'mceItemLayer');
|
138
|
-
} else {
|
139
|
-
if (!le.style.left) {
|
140
|
-
le.style.left = 20 + 'px';
|
141
|
-
}
|
142
|
-
|
143
|
-
if (!le.style.top) {
|
144
|
-
le.style.top = 20 + 'px';
|
145
|
-
}
|
146
|
-
|
147
|
-
if (!le.style.width) {
|
148
|
-
le.style.width = le.width ? (le.width + 'px') : '100px';
|
149
|
-
}
|
150
|
-
|
151
|
-
if (!le.style.height) {
|
152
|
-
le.style.height = le.height ? (le.height + 'px') : '100px';
|
153
|
-
}
|
154
|
-
|
155
|
-
le.style.position = "absolute";
|
156
|
-
|
157
|
-
editor.dom.setAttrib(le, 'data-mce-style', '');
|
158
|
-
editor.addVisual(editor.getBody());
|
159
|
-
}
|
160
|
-
|
161
|
-
editor.execCommand('mceRepaint');
|
162
|
-
editor.nodeChanged();
|
163
|
-
}
|
164
|
-
}
|
165
|
-
|
166
|
-
// Register commands
|
167
|
-
editor.addCommand('mceInsertLayer', insertLayer);
|
168
|
-
|
169
|
-
editor.addCommand('mceMoveForward', function() {
|
170
|
-
move(1);
|
171
|
-
});
|
172
|
-
|
173
|
-
editor.addCommand('mceMoveBackward', function() {
|
174
|
-
move(-1);
|
175
|
-
});
|
176
|
-
|
177
|
-
editor.addCommand('mceMakeAbsolute', function() {
|
178
|
-
toggleAbsolute();
|
179
|
-
});
|
180
|
-
|
181
|
-
// Register buttons
|
182
|
-
editor.addButton('moveforward', {title: 'layer.forward_desc', cmd: 'mceMoveForward'});
|
183
|
-
editor.addButton('movebackward', {title: 'layer.backward_desc', cmd: 'mceMoveBackward'});
|
184
|
-
editor.addButton('absolute', {title: 'layer.absolute_desc', cmd: 'mceMakeAbsolute'});
|
185
|
-
editor.addButton('insertlayer', {title: 'layer.insertlayer_desc', cmd: 'mceInsertLayer'});
|
186
|
-
|
187
|
-
editor.on('init', function() {
|
188
|
-
if (tinymce.Env.ie) {
|
189
|
-
editor.getDoc().execCommand('2D-Position', false, true);
|
190
|
-
}
|
191
|
-
});
|
192
|
-
|
193
|
-
// Remove serialized styles when selecting a layer since it might be changed by a drag operation
|
194
|
-
editor.on('mouseup', function(e) {
|
195
|
-
var layer = getParentLayer(e.target);
|
196
|
-
|
197
|
-
if (layer) {
|
198
|
-
editor.dom.setAttrib(layer, 'data-mce-style', '');
|
199
|
-
}
|
200
|
-
});
|
201
|
-
|
202
|
-
// Fixes edit focus issues with layers on Gecko
|
203
|
-
// This will enable designMode while inside a layer and disable it when outside
|
204
|
-
editor.on('mousedown', function(e) {
|
205
|
-
var node = e.target, doc = editor.getDoc(), parent;
|
206
|
-
|
207
|
-
if (tinymce.Env.gecko) {
|
208
|
-
if (getParentLayer(node)) {
|
209
|
-
if (doc.designMode !== 'on') {
|
210
|
-
doc.designMode = 'on';
|
211
|
-
|
212
|
-
// Repaint caret
|
213
|
-
node = doc.body;
|
214
|
-
parent = node.parentNode;
|
215
|
-
parent.removeChild(node);
|
216
|
-
parent.appendChild(node);
|
217
|
-
}
|
218
|
-
} else if (doc.designMode == 'on') {
|
219
|
-
doc.designMode = 'off';
|
220
|
-
}
|
221
|
-
}
|
222
|
-
});
|
223
|
-
|
224
|
-
editor.on('NodeChange', visualAid);
|
225
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
tinymce.PluginManager.add("layer",function(a){function b(a){do if(a.className&&-1!=a.className.indexOf("mceItemLayer"))return a;while(a=a.parentNode)}function c(b){var c=a.dom;tinymce.each(c.select("div,p",b),function(a){/^(absolute|relative|fixed)$/i.test(a.style.position)&&(a.hasVisual?c.addClass(a,"mceItemVisualAid"):c.removeClass(a,"mceItemVisualAid"),c.addClass(a,"mceItemLayer"))})}function d(c){var d,e,f=[],g=b(a.selection.getNode()),h=-1,i=-1;for(e=[],tinymce.walk(a.getBody(),function(a){1==a.nodeType&&/^(absolute|relative|static)$/i.test(a.style.position)&&e.push(a)},"childNodes"),d=0;d<e.length;d++)f[d]=e[d].style.zIndex?parseInt(e[d].style.zIndex,10):0,0>h&&e[d]==g&&(h=d);if(0>c){for(d=0;d<f.length;d++)if(f[d]<f[h]){i=d;break}i>-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):f[h]>0&&(e[h].style.zIndex=f[h]-1)}else{for(d=0;d<f.length;d++)if(f[d]>f[h]){i=d;break}i>-1?(e[h].style.zIndex=f[i],e[i].style.zIndex=f[h]):e[h].style.zIndex=f[h]+1}a.execCommand("mceRepaint")}function e(){var b=a.dom,c=b.getPos(b.getParent(a.selection.getNode(),"*")),d=a.getBody();a.dom.add(d,"div",{style:{position:"absolute",left:c.x,top:c.y>20?c.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},a.selection.getContent()||a.getLang("layer.content")),tinymce.Env.ie&&b.setHTML(d,d.innerHTML)}function f(){var c=b(a.selection.getNode());c||(c=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")),c&&("absolute"==c.style.position.toLowerCase()?(a.dom.setStyles(c,{position:"",left:"",top:"",width:"",height:""}),a.dom.removeClass(c,"mceItemVisualAid"),a.dom.removeClass(c,"mceItemLayer")):(c.style.left||(c.style.left="20px"),c.style.top||(c.style.top="20px"),c.style.width||(c.style.width=c.width?c.width+"px":"100px"),c.style.height||(c.style.height=c.height?c.height+"px":"100px"),c.style.position="absolute",a.dom.setAttrib(c,"data-mce-style",""),a.addVisual(a.getBody())),a.execCommand("mceRepaint"),a.nodeChanged())}a.addCommand("mceInsertLayer",e),a.addCommand("mceMoveForward",function(){d(1)}),a.addCommand("mceMoveBackward",function(){d(-1)}),a.addCommand("mceMakeAbsolute",function(){f()}),a.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),a.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),a.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),a.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),a.on("init",function(){tinymce.Env.ie&&a.getDoc().execCommand("2D-Position",!1,!0)}),a.on("mouseup",function(c){var d=b(c.target);d&&a.dom.setAttrib(d,"data-mce-style","")}),a.on("mousedown",function(c){var d,e=c.target,f=a.getDoc();tinymce.Env.gecko&&(b(e)?"on"!==f.designMode&&(f.designMode="on",e=f.body,d=e.parentNode,d.removeChild(e),d.appendChild(e)):"on"==f.designMode&&(f.designMode="off"))}),a.on("NodeChange",c)});
|
@@ -1,211 +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
|
-
* This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align
|
11
|
-
* attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash
|
12
|
-
*
|
13
|
-
* However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are
|
14
|
-
* not apart of the newer specifications for HTML and XHTML.
|
15
|
-
*/
|
16
|
-
|
17
|
-
/*global tinymce:true */
|
18
|
-
|
19
|
-
(function(tinymce) {
|
20
|
-
// Override inline_styles setting to force TinyMCE to produce deprecated contents
|
21
|
-
tinymce.on('AddEditor', function(e) {
|
22
|
-
e.editor.settings.inline_styles = false;
|
23
|
-
});
|
24
|
-
|
25
|
-
tinymce.PluginManager.add('legacyoutput', function(editor, url, $) {
|
26
|
-
editor.on('init', function() {
|
27
|
-
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img',
|
28
|
-
fontSizes = tinymce.explode(editor.settings.font_size_style_values),
|
29
|
-
schema = editor.schema;
|
30
|
-
|
31
|
-
// Override some internal formats to produce legacy elements and attributes
|
32
|
-
editor.formatter.register({
|
33
|
-
// Change alignment formats to use the deprecated align attribute
|
34
|
-
alignleft: {selector: alignElements, attributes: {align: 'left'}},
|
35
|
-
aligncenter: {selector: alignElements, attributes: {align: 'center'}},
|
36
|
-
alignright: {selector: alignElements, attributes: {align: 'right'}},
|
37
|
-
alignjustify: {selector: alignElements, attributes: {align: 'justify'}},
|
38
|
-
|
39
|
-
// Change the basic formatting elements to use deprecated element types
|
40
|
-
bold: [
|
41
|
-
{inline: 'b', remove: 'all'},
|
42
|
-
{inline: 'strong', remove: 'all'},
|
43
|
-
{inline: 'span', styles: {fontWeight: 'bold'}}
|
44
|
-
],
|
45
|
-
italic: [
|
46
|
-
{inline: 'i', remove: 'all'},
|
47
|
-
{inline: 'em', remove: 'all'},
|
48
|
-
{inline: 'span', styles: {fontStyle: 'italic'}}
|
49
|
-
],
|
50
|
-
underline: [
|
51
|
-
{inline: 'u', remove: 'all'},
|
52
|
-
{inline: 'span', styles: {textDecoration: 'underline'}, exact: true}
|
53
|
-
],
|
54
|
-
strikethrough: [
|
55
|
-
{inline: 'strike', remove: 'all'},
|
56
|
-
{inline: 'span', styles: {textDecoration: 'line-through'}, exact: true}
|
57
|
-
],
|
58
|
-
|
59
|
-
// Change font size and font family to use the deprecated font element
|
60
|
-
fontname: {inline: 'font', attributes: {face: '%value'}},
|
61
|
-
fontsize: {
|
62
|
-
inline: 'font',
|
63
|
-
attributes: {
|
64
|
-
size: function(vars) {
|
65
|
-
return tinymce.inArray(fontSizes, vars.value) + 1;
|
66
|
-
}
|
67
|
-
}
|
68
|
-
},
|
69
|
-
|
70
|
-
// Setup font elements for colors as well
|
71
|
-
forecolor: {inline: 'font', attributes: {color: '%value'}},
|
72
|
-
hilitecolor: {inline: 'font', styles: {backgroundColor: '%value'}}
|
73
|
-
});
|
74
|
-
|
75
|
-
// Check that deprecated elements are allowed if not add them
|
76
|
-
tinymce.each('b,i,u,strike'.split(','), function(name) {
|
77
|
-
schema.addValidElements(name + '[*]');
|
78
|
-
});
|
79
|
-
|
80
|
-
// Add font element if it's missing
|
81
|
-
if (!schema.getElementRule("font")) {
|
82
|
-
schema.addValidElements("font[face|size|color|style]");
|
83
|
-
}
|
84
|
-
|
85
|
-
// Add the missing and depreacted align attribute for the serialization engine
|
86
|
-
tinymce.each(alignElements.split(','), function(name) {
|
87
|
-
var rule = schema.getElementRule(name);
|
88
|
-
|
89
|
-
if (rule) {
|
90
|
-
if (!rule.attributes.align) {
|
91
|
-
rule.attributes.align = {};
|
92
|
-
rule.attributesOrder.push('align');
|
93
|
-
}
|
94
|
-
}
|
95
|
-
});
|
96
|
-
});
|
97
|
-
|
98
|
-
editor.addButton('fontsizeselect', function() {
|
99
|
-
var items = [], defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7';
|
100
|
-
var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats;
|
101
|
-
|
102
|
-
editor.$.each(fontsize_formats.split(' '), function(i, item) {
|
103
|
-
var text = item, value = item;
|
104
|
-
var values = item.split('=');
|
105
|
-
|
106
|
-
if (values.length > 1) {
|
107
|
-
text = values[0];
|
108
|
-
value = values[1];
|
109
|
-
}
|
110
|
-
|
111
|
-
items.push({text: text, value: value});
|
112
|
-
});
|
113
|
-
|
114
|
-
return {
|
115
|
-
type: 'listbox',
|
116
|
-
text: 'Font Sizes',
|
117
|
-
tooltip: 'Font Sizes',
|
118
|
-
values: items,
|
119
|
-
fixedWidth: true,
|
120
|
-
onPostRender: function() {
|
121
|
-
var self = this;
|
122
|
-
|
123
|
-
editor.on('NodeChange', function() {
|
124
|
-
var fontElm;
|
125
|
-
|
126
|
-
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
|
127
|
-
if (fontElm) {
|
128
|
-
self.value(fontElm.size);
|
129
|
-
} else {
|
130
|
-
self.value('');
|
131
|
-
}
|
132
|
-
});
|
133
|
-
},
|
134
|
-
onclick: function(e) {
|
135
|
-
if (e.control.settings.value) {
|
136
|
-
editor.execCommand('FontSize', false, e.control.settings.value);
|
137
|
-
}
|
138
|
-
}
|
139
|
-
};
|
140
|
-
});
|
141
|
-
|
142
|
-
editor.addButton('fontselect', function() {
|
143
|
-
function createFormats(formats) {
|
144
|
-
formats = formats.replace(/;$/, '').split(';');
|
145
|
-
|
146
|
-
var i = formats.length;
|
147
|
-
while (i--) {
|
148
|
-
formats[i] = formats[i].split('=');
|
149
|
-
}
|
150
|
-
|
151
|
-
return formats;
|
152
|
-
}
|
153
|
-
|
154
|
-
var defaultFontsFormats =
|
155
|
-
'Andale Mono=andale mono,times;' +
|
156
|
-
'Arial=arial,helvetica,sans-serif;' +
|
157
|
-
'Arial Black=arial black,avant garde;' +
|
158
|
-
'Book Antiqua=book antiqua,palatino;' +
|
159
|
-
'Comic Sans MS=comic sans ms,sans-serif;' +
|
160
|
-
'Courier New=courier new,courier;' +
|
161
|
-
'Georgia=georgia,palatino;' +
|
162
|
-
'Helvetica=helvetica;' +
|
163
|
-
'Impact=impact,chicago;' +
|
164
|
-
'Symbol=symbol;' +
|
165
|
-
'Tahoma=tahoma,arial,helvetica,sans-serif;' +
|
166
|
-
'Terminal=terminal,monaco;' +
|
167
|
-
'Times New Roman=times new roman,times;' +
|
168
|
-
'Trebuchet MS=trebuchet ms,geneva;' +
|
169
|
-
'Verdana=verdana,geneva;' +
|
170
|
-
'Webdings=webdings;' +
|
171
|
-
'Wingdings=wingdings,zapf dingbats';
|
172
|
-
|
173
|
-
var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
|
174
|
-
|
175
|
-
$.each(fonts, function(i, font) {
|
176
|
-
items.push({
|
177
|
-
text: {raw: font[0]},
|
178
|
-
value: font[1],
|
179
|
-
textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : ''
|
180
|
-
});
|
181
|
-
});
|
182
|
-
|
183
|
-
return {
|
184
|
-
type: 'listbox',
|
185
|
-
text: 'Font Family',
|
186
|
-
tooltip: 'Font Family',
|
187
|
-
values: items,
|
188
|
-
fixedWidth: true,
|
189
|
-
onPostRender: function() {
|
190
|
-
var self = this;
|
191
|
-
|
192
|
-
editor.on('NodeChange', function() {
|
193
|
-
var fontElm;
|
194
|
-
|
195
|
-
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font');
|
196
|
-
if (fontElm) {
|
197
|
-
self.value(fontElm.face);
|
198
|
-
} else {
|
199
|
-
self.value('');
|
200
|
-
}
|
201
|
-
});
|
202
|
-
},
|
203
|
-
onselect: function(e) {
|
204
|
-
if (e.control.settings.value) {
|
205
|
-
editor.execCommand('FontName', false, e.control.settings.value);
|
206
|
-
}
|
207
|
-
}
|
208
|
-
};
|
209
|
-
});
|
210
|
-
});
|
211
|
-
})(tinymce);
|
@@ -1 +0,0 @@
|
|
1
|
-
!function(a){a.on("AddEditor",function(a){a.editor.settings.inline_styles=!1}),a.PluginManager.add("legacyoutput",function(b,c,d){b.on("init",function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",d=a.explode(b.settings.font_size_style_values),e=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignjustify:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(b){return a.inArray(d,b.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),a.each("b,i,u,strike".split(","),function(a){e.addValidElements(a+"[*]")}),e.getElementRule("font")||e.addValidElements("font[face|size|color|style]"),a.each(c.split(","),function(a){var b=e.getElementRule(a);b&&(b.attributes.align||(b.attributes.align={},b.attributesOrder.push("align")))})}),b.addButton("fontsizeselect",function(){var a=[],c="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",d=b.settings.fontsize_formats||c;return b.$.each(d.split(" "),function(b,c){var d=c,e=c,f=c.split("=");f.length>1&&(d=f[0],e=f[1]),a.push({text:d,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:a,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.size:"")})},onclick:function(a){a.control.settings.value&&b.execCommand("FontSize",!1,a.control.settings.value)}}}),b.addButton("fontselect",function(){function a(a){a=a.replace(/;$/,"").split(";");for(var b=a.length;b--;)a[b]=a[b].split("=");return a}var c="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e=[],f=a(b.settings.font_formats||c);return d.each(f,function(a,b){e.push({text:{raw:b[0]},value:b[1],textStyle:-1==b[1].indexOf("dings")?"font-family:"+b[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:function(){var a=this;b.on("NodeChange",function(){var c;c=b.dom.getParent(b.selection.getNode(),"font"),a.value(c?c.face:"")})},onselect:function(a){a.control.settings.value&&b.execCommand("FontName",!1,a.control.settings.value)}}})})}(tinymce);
|