mirador_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +13 -0
- data/README.md +97 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mirador_rails.rb +16 -0
- data/lib/mirador_rails/version.rb +3 -0
- data/lib/mirador_rails/view_helpers.rb +30 -0
- data/mirador_rails.gemspec +30 -0
- data/vendor/assets/images/border_type_1.png +0 -0
- data/vendor/assets/images/border_type_2.png +0 -0
- data/vendor/assets/images/border_type_3.png +0 -0
- data/vendor/assets/images/debut_dark.png +0 -0
- data/vendor/assets/javascripts/mirador.js +1 -0
- data/vendor/assets/javascripts/mirador.min.js +88 -0
- data/vendor/assets/javascripts/mirador.min.js.map +1 -0
- data/vendor/assets/locales/ar/translation.json +42 -0
- data/vendor/assets/locales/de/translation.json +77 -0
- data/vendor/assets/locales/en/translation.json +82 -0
- data/vendor/assets/locales/es/translation.json +35 -0
- data/vendor/assets/locales/fr/translation.json +77 -0
- data/vendor/assets/locales/ga/translation.json +39 -0
- data/vendor/assets/locales/ja/translation.json +82 -0
- data/vendor/assets/locales/ko/translation.json +74 -0
- data/vendor/assets/locales/nl/translation.json +39 -0
- data/vendor/assets/locales/zh-CN/translation.json +74 -0
- data/vendor/assets/locales/zh-TW/translation.json +74 -0
- data/vendor/assets/locales/zh/translation.json +74 -0
- data/vendor/assets/plugins/plugins/advlist/plugin.js +97 -0
- data/vendor/assets/plugins/plugins/advlist/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/anchor/plugin.js +45 -0
- data/vendor/assets/plugins/plugins/anchor/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/autolink/plugin.js +194 -0
- data/vendor/assets/plugins/plugins/autolink/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/autoresize/plugin.js +152 -0
- data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/autosave/plugin.js +165 -0
- data/vendor/assets/plugins/plugins/autosave/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/bbcode/plugin.js +123 -0
- data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/charmap/plugin.js +370 -0
- data/vendor/assets/plugins/plugins/charmap/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/code/plugin.js +60 -0
- data/vendor/assets/plugins/plugins/code/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/colorpicker/plugin.js +112 -0
- data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +118 -0
- 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 +297 -0
- data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +542 -0
- data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +70 -0
- data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +210 -0
- data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +164 -0
- data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +252 -0
- data/vendor/assets/plugins/plugins/contextmenu/plugin.js +87 -0
- data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/directionality/plugin.js +64 -0
- data/vendor/assets/plugins/plugins/directionality/plugin.min.js +1 -0
- 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 +65 -0
- data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/example/dialog.html +8 -0
- data/vendor/assets/plugins/plugins/example/plugin.js +68 -0
- data/vendor/assets/plugins/plugins/example/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/example_dependency/plugin.js +22 -0
- data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/fullpage/plugin.js +490 -0
- data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/fullscreen/plugin.js +136 -0
- data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/hr/plugin.js +30 -0
- data/vendor/assets/plugins/plugins/hr/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/image/plugin.js +439 -0
- data/vendor/assets/plugins/plugins/image/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/importcss/plugin.js +195 -0
- data/vendor/assets/plugins/plugins/importcss/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +121 -0
- data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/layer/plugin.js +225 -0
- data/vendor/assets/plugins/plugins/layer/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +211 -0
- data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/link/plugin.js +400 -0
- data/vendor/assets/plugins/plugins/link/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/lists/plugin.js +791 -0
- data/vendor/assets/plugins/plugins/lists/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
- data/vendor/assets/plugins/plugins/media/plugin.js +774 -0
- data/vendor/assets/plugins/plugins/media/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +53 -0
- data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/noneditable/plugin.js +540 -0
- data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/pagebreak/plugin.js +88 -0
- data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +634 -0
- data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +110 -0
- data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +159 -0
- data/vendor/assets/plugins/plugins/paste/classes/Utils.js +130 -0
- data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +493 -0
- data/vendor/assets/plugins/plugins/paste/plugin.dev.js +120 -0
- data/vendor/assets/plugins/plugins/paste/plugin.js +1625 -0
- data/vendor/assets/plugins/plugins/paste/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/preview/plugin.js +88 -0
- data/vendor/assets/plugins/plugins/preview/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/print/plugin.js +32 -0
- data/vendor/assets/plugins/plugins/print/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/save/plugin.js +94 -0
- data/vendor/assets/plugins/plugins/save/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/searchreplace/plugin.js +594 -0
- data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +470 -0
- data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +436 -0
- data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +117 -0
- data/vendor/assets/plugins/plugins/spellchecker/plugin.js +996 -0
- data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/tabfocus/plugin.js +120 -0
- data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +176 -0
- data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +749 -0
- data/vendor/assets/plugins/plugins/table/classes/Plugin.js +422 -0
- data/vendor/assets/plugins/plugins/table/classes/Quirks.js +372 -0
- data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +864 -0
- data/vendor/assets/plugins/plugins/table/plugin.dev.js +118 -0
- data/vendor/assets/plugins/plugins/table/plugin.js +2680 -0
- data/vendor/assets/plugins/plugins/table/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/template/plugin.js +262 -0
- data/vendor/assets/plugins/plugins/template/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/textcolor/plugin.js +272 -0
- data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/textpattern/plugin.js +268 -0
- data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +135 -0
- 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 +86 -0
- data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/visualchars/plugin.js +88 -0
- data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +1 -0
- data/vendor/assets/plugins/plugins/wordcount/plugin.js +69 -0
- data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +1 -0
- data/vendor/assets/skins/skins/lightgray/content.inline.min.css +1 -0
- data/vendor/assets/skins/skins/lightgray/content.min.css +1 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +62 -0
- 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 +63 -0
- 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 +1 -0
- data/vendor/assets/skins/skins/lightgray/skin.min.css +1 -0
- data/vendor/assets/stylesheets/mirador-combined.css +3969 -0
- data/vendor/assets/stylesheets/mirador.css +11 -0
- data/vendor/assets/themes/themes/modern/theme.js +617 -0
- data/vendor/assets/themes/themes/modern/theme.min.js +1 -0
- metadata +318 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a){var b=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.on("beforeSetContent",function(a){a.content=b["_"+c+"_bbcode2html"](a.content)}),a.on("postProcess",function(a){a.set&&(a.content=b["_"+c+"_bbcode2html"](a.content)),a.get&&(a.content=b["_"+c+"_html2bbcode"](a.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),b(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),b(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),b(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),b(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),b(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),b(/<font>(.*?)<\/font>/gi,"$1"),b(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),b(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),b(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),b(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),b(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),b(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),b(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),b(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),b(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),b(/<\/(strong|b)>/gi,"[/b]"),b(/<(strong|b)>/gi,"[b]"),b(/<\/(em|i)>/gi,"[/i]"),b(/<(em|i)>/gi,"[i]"),b(/<\/u>/gi,"[/u]"),b(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),b(/<u>/gi,"[u]"),b(/<blockquote[^>]*>/gi,"[quote]"),b(/<\/blockquote>/gi,"[/quote]"),b(/<br \/>/gi,"\n"),b(/<br\/>/gi,"\n"),b(/<br>/gi,"\n"),b(/<p>/gi,""),b(/<\/p>/gi,"\n"),b(/ |\u00a0/gi," "),b(/"/gi,'"'),b(/</gi,"<"),b(/>/gi,">"),b(/&/gi,"&"),a},_punbb_bbcode2html:function(a){function b(b,c){a=a.replace(b,c)}return a=tinymce.trim(a),b(/\n/gi,"<br />"),b(/\[b\]/gi,"<strong>"),b(/\[\/b\]/gi,"</strong>"),b(/\[i\]/gi,"<em>"),b(/\[\/i\]/gi,"</em>"),b(/\[u\]/gi,"<u>"),b(/\[\/u\]/gi,"</u>"),b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),b(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),b(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),b(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),b(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),a}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();
|
@@ -0,0 +1,370 @@
|
|
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('charmap', function(editor) {
|
14
|
+
var charmap = [
|
15
|
+
['160', 'no-break space'],
|
16
|
+
['38', 'ampersand'],
|
17
|
+
['34', 'quotation mark'],
|
18
|
+
// finance
|
19
|
+
['162', 'cent sign'],
|
20
|
+
['8364', 'euro sign'],
|
21
|
+
['163', 'pound sign'],
|
22
|
+
['165', 'yen sign'],
|
23
|
+
// signs
|
24
|
+
['169', 'copyright sign'],
|
25
|
+
['174', 'registered sign'],
|
26
|
+
['8482', 'trade mark sign'],
|
27
|
+
['8240', 'per mille sign'],
|
28
|
+
['181', 'micro sign'],
|
29
|
+
['183', 'middle dot'],
|
30
|
+
['8226', 'bullet'],
|
31
|
+
['8230', 'three dot leader'],
|
32
|
+
['8242', 'minutes / feet'],
|
33
|
+
['8243', 'seconds / inches'],
|
34
|
+
['167', 'section sign'],
|
35
|
+
['182', 'paragraph sign'],
|
36
|
+
['223', 'sharp s / ess-zed'],
|
37
|
+
// quotations
|
38
|
+
['8249', 'single left-pointing angle quotation mark'],
|
39
|
+
['8250', 'single right-pointing angle quotation mark'],
|
40
|
+
['171', 'left pointing guillemet'],
|
41
|
+
['187', 'right pointing guillemet'],
|
42
|
+
['8216', 'left single quotation mark'],
|
43
|
+
['8217', 'right single quotation mark'],
|
44
|
+
['8220', 'left double quotation mark'],
|
45
|
+
['8221', 'right double quotation mark'],
|
46
|
+
['8218', 'single low-9 quotation mark'],
|
47
|
+
['8222', 'double low-9 quotation mark'],
|
48
|
+
['60', 'less-than sign'],
|
49
|
+
['62', 'greater-than sign'],
|
50
|
+
['8804', 'less-than or equal to'],
|
51
|
+
['8805', 'greater-than or equal to'],
|
52
|
+
['8211', 'en dash'],
|
53
|
+
['8212', 'em dash'],
|
54
|
+
['175', 'macron'],
|
55
|
+
['8254', 'overline'],
|
56
|
+
['164', 'currency sign'],
|
57
|
+
['166', 'broken bar'],
|
58
|
+
['168', 'diaeresis'],
|
59
|
+
['161', 'inverted exclamation mark'],
|
60
|
+
['191', 'turned question mark'],
|
61
|
+
['710', 'circumflex accent'],
|
62
|
+
['732', 'small tilde'],
|
63
|
+
['176', 'degree sign'],
|
64
|
+
['8722', 'minus sign'],
|
65
|
+
['177', 'plus-minus sign'],
|
66
|
+
['247', 'division sign'],
|
67
|
+
['8260', 'fraction slash'],
|
68
|
+
['215', 'multiplication sign'],
|
69
|
+
['185', 'superscript one'],
|
70
|
+
['178', 'superscript two'],
|
71
|
+
['179', 'superscript three'],
|
72
|
+
['188', 'fraction one quarter'],
|
73
|
+
['189', 'fraction one half'],
|
74
|
+
['190', 'fraction three quarters'],
|
75
|
+
// math / logical
|
76
|
+
['402', 'function / florin'],
|
77
|
+
['8747', 'integral'],
|
78
|
+
['8721', 'n-ary sumation'],
|
79
|
+
['8734', 'infinity'],
|
80
|
+
['8730', 'square root'],
|
81
|
+
['8764', 'similar to'],
|
82
|
+
['8773', 'approximately equal to'],
|
83
|
+
['8776', 'almost equal to'],
|
84
|
+
['8800', 'not equal to'],
|
85
|
+
['8801', 'identical to'],
|
86
|
+
['8712', 'element of'],
|
87
|
+
['8713', 'not an element of'],
|
88
|
+
['8715', 'contains as member'],
|
89
|
+
['8719', 'n-ary product'],
|
90
|
+
['8743', 'logical and'],
|
91
|
+
['8744', 'logical or'],
|
92
|
+
['172', 'not sign'],
|
93
|
+
['8745', 'intersection'],
|
94
|
+
['8746', 'union'],
|
95
|
+
['8706', 'partial differential'],
|
96
|
+
['8704', 'for all'],
|
97
|
+
['8707', 'there exists'],
|
98
|
+
['8709', 'diameter'],
|
99
|
+
['8711', 'backward difference'],
|
100
|
+
['8727', 'asterisk operator'],
|
101
|
+
['8733', 'proportional to'],
|
102
|
+
['8736', 'angle'],
|
103
|
+
// undefined
|
104
|
+
['180', 'acute accent'],
|
105
|
+
['184', 'cedilla'],
|
106
|
+
['170', 'feminine ordinal indicator'],
|
107
|
+
['186', 'masculine ordinal indicator'],
|
108
|
+
['8224', 'dagger'],
|
109
|
+
['8225', 'double dagger'],
|
110
|
+
// alphabetical special chars
|
111
|
+
['192', 'A - grave'],
|
112
|
+
['193', 'A - acute'],
|
113
|
+
['194', 'A - circumflex'],
|
114
|
+
['195', 'A - tilde'],
|
115
|
+
['196', 'A - diaeresis'],
|
116
|
+
['197', 'A - ring above'],
|
117
|
+
['198', 'ligature AE'],
|
118
|
+
['199', 'C - cedilla'],
|
119
|
+
['200', 'E - grave'],
|
120
|
+
['201', 'E - acute'],
|
121
|
+
['202', 'E - circumflex'],
|
122
|
+
['203', 'E - diaeresis'],
|
123
|
+
['204', 'I - grave'],
|
124
|
+
['205', 'I - acute'],
|
125
|
+
['206', 'I - circumflex'],
|
126
|
+
['207', 'I - diaeresis'],
|
127
|
+
['208', 'ETH'],
|
128
|
+
['209', 'N - tilde'],
|
129
|
+
['210', 'O - grave'],
|
130
|
+
['211', 'O - acute'],
|
131
|
+
['212', 'O - circumflex'],
|
132
|
+
['213', 'O - tilde'],
|
133
|
+
['214', 'O - diaeresis'],
|
134
|
+
['216', 'O - slash'],
|
135
|
+
['338', 'ligature OE'],
|
136
|
+
['352', 'S - caron'],
|
137
|
+
['217', 'U - grave'],
|
138
|
+
['218', 'U - acute'],
|
139
|
+
['219', 'U - circumflex'],
|
140
|
+
['220', 'U - diaeresis'],
|
141
|
+
['221', 'Y - acute'],
|
142
|
+
['376', 'Y - diaeresis'],
|
143
|
+
['222', 'THORN'],
|
144
|
+
['224', 'a - grave'],
|
145
|
+
['225', 'a - acute'],
|
146
|
+
['226', 'a - circumflex'],
|
147
|
+
['227', 'a - tilde'],
|
148
|
+
['228', 'a - diaeresis'],
|
149
|
+
['229', 'a - ring above'],
|
150
|
+
['230', 'ligature ae'],
|
151
|
+
['231', 'c - cedilla'],
|
152
|
+
['232', 'e - grave'],
|
153
|
+
['233', 'e - acute'],
|
154
|
+
['234', 'e - circumflex'],
|
155
|
+
['235', 'e - diaeresis'],
|
156
|
+
['236', 'i - grave'],
|
157
|
+
['237', 'i - acute'],
|
158
|
+
['238', 'i - circumflex'],
|
159
|
+
['239', 'i - diaeresis'],
|
160
|
+
['240', 'eth'],
|
161
|
+
['241', 'n - tilde'],
|
162
|
+
['242', 'o - grave'],
|
163
|
+
['243', 'o - acute'],
|
164
|
+
['244', 'o - circumflex'],
|
165
|
+
['245', 'o - tilde'],
|
166
|
+
['246', 'o - diaeresis'],
|
167
|
+
['248', 'o slash'],
|
168
|
+
['339', 'ligature oe'],
|
169
|
+
['353', 's - caron'],
|
170
|
+
['249', 'u - grave'],
|
171
|
+
['250', 'u - acute'],
|
172
|
+
['251', 'u - circumflex'],
|
173
|
+
['252', 'u - diaeresis'],
|
174
|
+
['253', 'y - acute'],
|
175
|
+
['254', 'thorn'],
|
176
|
+
['255', 'y - diaeresis'],
|
177
|
+
['913', 'Alpha'],
|
178
|
+
['914', 'Beta'],
|
179
|
+
['915', 'Gamma'],
|
180
|
+
['916', 'Delta'],
|
181
|
+
['917', 'Epsilon'],
|
182
|
+
['918', 'Zeta'],
|
183
|
+
['919', 'Eta'],
|
184
|
+
['920', 'Theta'],
|
185
|
+
['921', 'Iota'],
|
186
|
+
['922', 'Kappa'],
|
187
|
+
['923', 'Lambda'],
|
188
|
+
['924', 'Mu'],
|
189
|
+
['925', 'Nu'],
|
190
|
+
['926', 'Xi'],
|
191
|
+
['927', 'Omicron'],
|
192
|
+
['928', 'Pi'],
|
193
|
+
['929', 'Rho'],
|
194
|
+
['931', 'Sigma'],
|
195
|
+
['932', 'Tau'],
|
196
|
+
['933', 'Upsilon'],
|
197
|
+
['934', 'Phi'],
|
198
|
+
['935', 'Chi'],
|
199
|
+
['936', 'Psi'],
|
200
|
+
['937', 'Omega'],
|
201
|
+
['945', 'alpha'],
|
202
|
+
['946', 'beta'],
|
203
|
+
['947', 'gamma'],
|
204
|
+
['948', 'delta'],
|
205
|
+
['949', 'epsilon'],
|
206
|
+
['950', 'zeta'],
|
207
|
+
['951', 'eta'],
|
208
|
+
['952', 'theta'],
|
209
|
+
['953', 'iota'],
|
210
|
+
['954', 'kappa'],
|
211
|
+
['955', 'lambda'],
|
212
|
+
['956', 'mu'],
|
213
|
+
['957', 'nu'],
|
214
|
+
['958', 'xi'],
|
215
|
+
['959', 'omicron'],
|
216
|
+
['960', 'pi'],
|
217
|
+
['961', 'rho'],
|
218
|
+
['962', 'final sigma'],
|
219
|
+
['963', 'sigma'],
|
220
|
+
['964', 'tau'],
|
221
|
+
['965', 'upsilon'],
|
222
|
+
['966', 'phi'],
|
223
|
+
['967', 'chi'],
|
224
|
+
['968', 'psi'],
|
225
|
+
['969', 'omega'],
|
226
|
+
// symbols
|
227
|
+
['8501', 'alef symbol'],
|
228
|
+
['982', 'pi symbol'],
|
229
|
+
['8476', 'real part symbol'],
|
230
|
+
['978', 'upsilon - hook symbol'],
|
231
|
+
['8472', 'Weierstrass p'],
|
232
|
+
['8465', 'imaginary part'],
|
233
|
+
// arrows
|
234
|
+
['8592', 'leftwards arrow'],
|
235
|
+
['8593', 'upwards arrow'],
|
236
|
+
['8594', 'rightwards arrow'],
|
237
|
+
['8595', 'downwards arrow'],
|
238
|
+
['8596', 'left right arrow'],
|
239
|
+
['8629', 'carriage return'],
|
240
|
+
['8656', 'leftwards double arrow'],
|
241
|
+
['8657', 'upwards double arrow'],
|
242
|
+
['8658', 'rightwards double arrow'],
|
243
|
+
['8659', 'downwards double arrow'],
|
244
|
+
['8660', 'left right double arrow'],
|
245
|
+
['8756', 'therefore'],
|
246
|
+
['8834', 'subset of'],
|
247
|
+
['8835', 'superset of'],
|
248
|
+
['8836', 'not a subset of'],
|
249
|
+
['8838', 'subset of or equal to'],
|
250
|
+
['8839', 'superset of or equal to'],
|
251
|
+
['8853', 'circled plus'],
|
252
|
+
['8855', 'circled times'],
|
253
|
+
['8869', 'perpendicular'],
|
254
|
+
['8901', 'dot operator'],
|
255
|
+
['8968', 'left ceiling'],
|
256
|
+
['8969', 'right ceiling'],
|
257
|
+
['8970', 'left floor'],
|
258
|
+
['8971', 'right floor'],
|
259
|
+
['9001', 'left-pointing angle bracket'],
|
260
|
+
['9002', 'right-pointing angle bracket'],
|
261
|
+
['9674', 'lozenge'],
|
262
|
+
['9824', 'black spade suit'],
|
263
|
+
['9827', 'black club suit'],
|
264
|
+
['9829', 'black heart suit'],
|
265
|
+
['9830', 'black diamond suit'],
|
266
|
+
['8194', 'en space'],
|
267
|
+
['8195', 'em space'],
|
268
|
+
['8201', 'thin space'],
|
269
|
+
['8204', 'zero width non-joiner'],
|
270
|
+
['8205', 'zero width joiner'],
|
271
|
+
['8206', 'left-to-right mark'],
|
272
|
+
['8207', 'right-to-left mark'],
|
273
|
+
['173', 'soft hyphen']
|
274
|
+
];
|
275
|
+
|
276
|
+
function showDialog() {
|
277
|
+
var gridHtml, x, y, win;
|
278
|
+
|
279
|
+
function getParentTd(elm) {
|
280
|
+
while (elm) {
|
281
|
+
if (elm.nodeName == 'TD') {
|
282
|
+
return elm;
|
283
|
+
}
|
284
|
+
|
285
|
+
elm = elm.parentNode;
|
286
|
+
}
|
287
|
+
}
|
288
|
+
|
289
|
+
gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
|
290
|
+
|
291
|
+
var width = 25;
|
292
|
+
for (y = 0; y < 10; y++) {
|
293
|
+
gridHtml += '<tr>';
|
294
|
+
|
295
|
+
for (x = 0; x < width; x++) {
|
296
|
+
var chr = charmap[y * width + x];
|
297
|
+
|
298
|
+
gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
|
299
|
+
(chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' ') + '</div></td>';
|
300
|
+
}
|
301
|
+
|
302
|
+
gridHtml += '</tr>';
|
303
|
+
}
|
304
|
+
|
305
|
+
gridHtml += '</tbody></table>';
|
306
|
+
|
307
|
+
var charMapPanel = {
|
308
|
+
type: 'container',
|
309
|
+
html: gridHtml,
|
310
|
+
onclick: function(e) {
|
311
|
+
var target = e.target;
|
312
|
+
|
313
|
+
if (target.tagName == 'TD') {
|
314
|
+
target = target.firstChild;
|
315
|
+
}
|
316
|
+
|
317
|
+
if (target.tagName == 'DIV') {
|
318
|
+
editor.execCommand('mceInsertContent', false, target.firstChild.data);
|
319
|
+
|
320
|
+
if (!e.ctrlKey) {
|
321
|
+
win.close();
|
322
|
+
}
|
323
|
+
}
|
324
|
+
},
|
325
|
+
onmouseover: function(e) {
|
326
|
+
var td = getParentTd(e.target);
|
327
|
+
|
328
|
+
if (td) {
|
329
|
+
win.find('#preview').text(td.firstChild.firstChild.data);
|
330
|
+
}
|
331
|
+
}
|
332
|
+
};
|
333
|
+
|
334
|
+
win = editor.windowManager.open({
|
335
|
+
title: "Special character",
|
336
|
+
spacing: 10,
|
337
|
+
padding: 10,
|
338
|
+
items: [
|
339
|
+
charMapPanel,
|
340
|
+
{
|
341
|
+
type: 'label',
|
342
|
+
name: 'preview',
|
343
|
+
text: ' ',
|
344
|
+
style: 'font-size: 40px; text-align: center',
|
345
|
+
border: 1,
|
346
|
+
minWidth: 100,
|
347
|
+
minHeight: 80
|
348
|
+
}
|
349
|
+
],
|
350
|
+
buttons: [
|
351
|
+
{text: "Close", onclick: function() {
|
352
|
+
win.close();
|
353
|
+
}}
|
354
|
+
]
|
355
|
+
});
|
356
|
+
}
|
357
|
+
|
358
|
+
editor.addButton('charmap', {
|
359
|
+
icon: 'charmap',
|
360
|
+
tooltip: 'Special character',
|
361
|
+
onclick: showDialog
|
362
|
+
});
|
363
|
+
|
364
|
+
editor.addMenuItem('charmap', {
|
365
|
+
icon: 'charmap',
|
366
|
+
text: 'Special character',
|
367
|
+
onclick: showDialog,
|
368
|
+
context: 'insert'
|
369
|
+
});
|
370
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("charmap",function(a){function b(){function b(a){for(;a;){if("TD"==a.nodeName)return a;a=a.parentNode}}var d,e,f,g;d='<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';var h=25;for(f=0;10>f;f++){for(d+="<tr>",e=0;h>e;e++){var i=c[f*h+e];d+='<td title="'+i[1]+'"><div tabindex="-1" title="'+i[1]+'" role="button">'+(i?String.fromCharCode(parseInt(i[0],10)):" ")+"</div></td>"}d+="</tr>"}d+="</tbody></table>";var j={type:"container",html:d,onclick:function(b){var c=b.target;"TD"==c.tagName&&(c=c.firstChild),"DIV"==c.tagName&&(a.execCommand("mceInsertContent",!1,c.firstChild.data),b.ctrlKey||g.close())},onmouseover:function(a){var c=b(a.target);c&&g.find("#preview").text(c.firstChild.firstChild.data)}};g=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[j,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){g.close()}}]})}var c=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];a.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:b}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:b,context:"insert"})});
|
@@ -0,0 +1,60 @@
|
|
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('code', function(editor) {
|
14
|
+
function showDialog() {
|
15
|
+
var win = editor.windowManager.open({
|
16
|
+
title: "Source code",
|
17
|
+
body: {
|
18
|
+
type: 'textbox',
|
19
|
+
name: 'code',
|
20
|
+
multiline: true,
|
21
|
+
minWidth: editor.getParam("code_dialog_width", 600),
|
22
|
+
minHeight: editor.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)),
|
23
|
+
spellcheck: false,
|
24
|
+
style: 'direction: ltr; text-align: left'
|
25
|
+
},
|
26
|
+
onSubmit: function(e) {
|
27
|
+
// We get a lovely "Wrong document" error in IE 11 if we
|
28
|
+
// don't move the focus to the editor before creating an undo
|
29
|
+
// transation since it tries to make a bookmark for the current selection
|
30
|
+
editor.focus();
|
31
|
+
|
32
|
+
editor.undoManager.transact(function() {
|
33
|
+
editor.setContent(e.data.code);
|
34
|
+
});
|
35
|
+
|
36
|
+
editor.selection.setCursorLocation();
|
37
|
+
editor.nodeChanged();
|
38
|
+
}
|
39
|
+
});
|
40
|
+
|
41
|
+
// Gecko has a major performance issue with textarea
|
42
|
+
// contents so we need to set it when all reflows are done
|
43
|
+
win.find('#code').value(editor.getContent({source_view: true}));
|
44
|
+
}
|
45
|
+
|
46
|
+
editor.addCommand("mceCodeEditor", showDialog);
|
47
|
+
|
48
|
+
editor.addButton('code', {
|
49
|
+
icon: 'code',
|
50
|
+
tooltip: 'Source code',
|
51
|
+
onclick: showDialog
|
52
|
+
});
|
53
|
+
|
54
|
+
editor.addMenuItem('code', {
|
55
|
+
icon: 'code',
|
56
|
+
text: 'Source code',
|
57
|
+
context: 'tools',
|
58
|
+
onclick: showDialog
|
59
|
+
});
|
60
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})});
|
@@ -0,0 +1,112 @@
|
|
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('colorpicker', function(editor) {
|
14
|
+
function colorPickerCallback(callback, value) {
|
15
|
+
function setColor(value) {
|
16
|
+
var color = new tinymce.util.Color(value), rgb = color.toRgb();
|
17
|
+
|
18
|
+
win.fromJSON({
|
19
|
+
r: rgb.r,
|
20
|
+
g: rgb.g,
|
21
|
+
b: rgb.b,
|
22
|
+
hex: color.toHex().substr(1)
|
23
|
+
});
|
24
|
+
|
25
|
+
showPreview(color.toHex());
|
26
|
+
}
|
27
|
+
|
28
|
+
function showPreview(hexColor) {
|
29
|
+
win.find('#preview')[0].getEl().style.background = hexColor;
|
30
|
+
}
|
31
|
+
|
32
|
+
var win = editor.windowManager.open({
|
33
|
+
title: 'Color',
|
34
|
+
items: {
|
35
|
+
type: 'container',
|
36
|
+
layout: 'flex',
|
37
|
+
direction: 'row',
|
38
|
+
align: 'stretch',
|
39
|
+
padding: 5,
|
40
|
+
spacing: 10,
|
41
|
+
items: [
|
42
|
+
{
|
43
|
+
type: 'colorpicker',
|
44
|
+
value: value,
|
45
|
+
onchange: function() {
|
46
|
+
var rgb = this.rgb();
|
47
|
+
|
48
|
+
if (win) {
|
49
|
+
win.find('#r').value(rgb.r);
|
50
|
+
win.find('#g').value(rgb.g);
|
51
|
+
win.find('#b').value(rgb.b);
|
52
|
+
win.find('#hex').value(this.value().substr(1));
|
53
|
+
showPreview(this.value());
|
54
|
+
}
|
55
|
+
}
|
56
|
+
},
|
57
|
+
{
|
58
|
+
type: 'form',
|
59
|
+
padding: 0,
|
60
|
+
labelGap: 5,
|
61
|
+
defaults: {
|
62
|
+
type: 'textbox',
|
63
|
+
size: 7,
|
64
|
+
value: '0',
|
65
|
+
flex: 1,
|
66
|
+
spellcheck: false,
|
67
|
+
onchange: function() {
|
68
|
+
var colorPickerCtrl = win.find('colorpicker')[0];
|
69
|
+
var name, value;
|
70
|
+
|
71
|
+
name = this.name();
|
72
|
+
value = this.value();
|
73
|
+
|
74
|
+
if (name == "hex") {
|
75
|
+
value = '#' + value;
|
76
|
+
setColor(value);
|
77
|
+
colorPickerCtrl.value(value);
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
|
81
|
+
value = {
|
82
|
+
r: win.find('#r').value(),
|
83
|
+
g: win.find('#g').value(),
|
84
|
+
b: win.find('#b').value()
|
85
|
+
};
|
86
|
+
|
87
|
+
colorPickerCtrl.value(value);
|
88
|
+
setColor(value);
|
89
|
+
}
|
90
|
+
},
|
91
|
+
items: [
|
92
|
+
{name: 'r', label: 'R', autofocus: 1},
|
93
|
+
{name: 'g', label: 'G'},
|
94
|
+
{name: 'b', label: 'B'},
|
95
|
+
{name: 'hex', label: '#', value: '000000'},
|
96
|
+
{name: 'preview', type: 'container', border: 1}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
]
|
100
|
+
},
|
101
|
+
onSubmit: function() {
|
102
|
+
callback('#' + this.toJSON().hex);
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
setColor(value);
|
107
|
+
}
|
108
|
+
|
109
|
+
if (!editor.settings.color_picker_callback) {
|
110
|
+
editor.settings.color_picker_callback = colorPickerCallback;
|
111
|
+
}
|
112
|
+
});
|