mirador_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +13 -0
  7. data/README.md +97 -0
  8. data/Rakefile +6 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/lib/mirador_rails.rb +16 -0
  12. data/lib/mirador_rails/version.rb +3 -0
  13. data/lib/mirador_rails/view_helpers.rb +30 -0
  14. data/mirador_rails.gemspec +30 -0
  15. data/vendor/assets/images/border_type_1.png +0 -0
  16. data/vendor/assets/images/border_type_2.png +0 -0
  17. data/vendor/assets/images/border_type_3.png +0 -0
  18. data/vendor/assets/images/debut_dark.png +0 -0
  19. data/vendor/assets/javascripts/mirador.js +1 -0
  20. data/vendor/assets/javascripts/mirador.min.js +88 -0
  21. data/vendor/assets/javascripts/mirador.min.js.map +1 -0
  22. data/vendor/assets/locales/ar/translation.json +42 -0
  23. data/vendor/assets/locales/de/translation.json +77 -0
  24. data/vendor/assets/locales/en/translation.json +82 -0
  25. data/vendor/assets/locales/es/translation.json +35 -0
  26. data/vendor/assets/locales/fr/translation.json +77 -0
  27. data/vendor/assets/locales/ga/translation.json +39 -0
  28. data/vendor/assets/locales/ja/translation.json +82 -0
  29. data/vendor/assets/locales/ko/translation.json +74 -0
  30. data/vendor/assets/locales/nl/translation.json +39 -0
  31. data/vendor/assets/locales/zh-CN/translation.json +74 -0
  32. data/vendor/assets/locales/zh-TW/translation.json +74 -0
  33. data/vendor/assets/locales/zh/translation.json +74 -0
  34. data/vendor/assets/plugins/plugins/advlist/plugin.js +97 -0
  35. data/vendor/assets/plugins/plugins/advlist/plugin.min.js +1 -0
  36. data/vendor/assets/plugins/plugins/anchor/plugin.js +45 -0
  37. data/vendor/assets/plugins/plugins/anchor/plugin.min.js +1 -0
  38. data/vendor/assets/plugins/plugins/autolink/plugin.js +194 -0
  39. data/vendor/assets/plugins/plugins/autolink/plugin.min.js +1 -0
  40. data/vendor/assets/plugins/plugins/autoresize/plugin.js +152 -0
  41. data/vendor/assets/plugins/plugins/autoresize/plugin.min.js +1 -0
  42. data/vendor/assets/plugins/plugins/autosave/plugin.js +165 -0
  43. data/vendor/assets/plugins/plugins/autosave/plugin.min.js +1 -0
  44. data/vendor/assets/plugins/plugins/bbcode/plugin.js +123 -0
  45. data/vendor/assets/plugins/plugins/bbcode/plugin.min.js +1 -0
  46. data/vendor/assets/plugins/plugins/charmap/plugin.js +370 -0
  47. data/vendor/assets/plugins/plugins/charmap/plugin.min.js +1 -0
  48. data/vendor/assets/plugins/plugins/code/plugin.js +60 -0
  49. data/vendor/assets/plugins/plugins/code/plugin.min.js +1 -0
  50. data/vendor/assets/plugins/plugins/colorpicker/plugin.js +112 -0
  51. data/vendor/assets/plugins/plugins/colorpicker/plugin.min.js +1 -0
  52. data/vendor/assets/plugins/plugins/compat3x/css/dialog.css +118 -0
  53. data/vendor/assets/plugins/plugins/compat3x/img/buttons.png +0 -0
  54. data/vendor/assets/plugins/plugins/compat3x/img/icons.gif +0 -0
  55. data/vendor/assets/plugins/plugins/compat3x/img/items.gif +0 -0
  56. data/vendor/assets/plugins/plugins/compat3x/img/menu_arrow.gif +0 -0
  57. data/vendor/assets/plugins/plugins/compat3x/img/menu_check.gif +0 -0
  58. data/vendor/assets/plugins/plugins/compat3x/img/progress.gif +0 -0
  59. data/vendor/assets/plugins/plugins/compat3x/img/tabs.gif +0 -0
  60. data/vendor/assets/plugins/plugins/compat3x/plugin.js +297 -0
  61. data/vendor/assets/plugins/plugins/compat3x/plugin.min.js +1 -0
  62. data/vendor/assets/plugins/plugins/compat3x/tiny_mce_popup.js +542 -0
  63. data/vendor/assets/plugins/plugins/compat3x/utils/editable_selects.js +70 -0
  64. data/vendor/assets/plugins/plugins/compat3x/utils/form_utils.js +210 -0
  65. data/vendor/assets/plugins/plugins/compat3x/utils/mctabs.js +164 -0
  66. data/vendor/assets/plugins/plugins/compat3x/utils/validate.js +252 -0
  67. data/vendor/assets/plugins/plugins/contextmenu/plugin.js +87 -0
  68. data/vendor/assets/plugins/plugins/contextmenu/plugin.min.js +1 -0
  69. data/vendor/assets/plugins/plugins/directionality/plugin.js +64 -0
  70. data/vendor/assets/plugins/plugins/directionality/plugin.min.js +1 -0
  71. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cool.gif +0 -0
  72. data/vendor/assets/plugins/plugins/emoticons/img/smiley-cry.gif +0 -0
  73. data/vendor/assets/plugins/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  74. data/vendor/assets/plugins/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  75. data/vendor/assets/plugins/plugins/emoticons/img/smiley-frown.gif +0 -0
  76. data/vendor/assets/plugins/plugins/emoticons/img/smiley-innocent.gif +0 -0
  77. data/vendor/assets/plugins/plugins/emoticons/img/smiley-kiss.gif +0 -0
  78. data/vendor/assets/plugins/plugins/emoticons/img/smiley-laughing.gif +0 -0
  79. data/vendor/assets/plugins/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  80. data/vendor/assets/plugins/plugins/emoticons/img/smiley-sealed.gif +0 -0
  81. data/vendor/assets/plugins/plugins/emoticons/img/smiley-smile.gif +0 -0
  82. data/vendor/assets/plugins/plugins/emoticons/img/smiley-surprised.gif +0 -0
  83. data/vendor/assets/plugins/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  84. data/vendor/assets/plugins/plugins/emoticons/img/smiley-undecided.gif +0 -0
  85. data/vendor/assets/plugins/plugins/emoticons/img/smiley-wink.gif +0 -0
  86. data/vendor/assets/plugins/plugins/emoticons/img/smiley-yell.gif +0 -0
  87. data/vendor/assets/plugins/plugins/emoticons/plugin.js +65 -0
  88. data/vendor/assets/plugins/plugins/emoticons/plugin.min.js +1 -0
  89. data/vendor/assets/plugins/plugins/example/dialog.html +8 -0
  90. data/vendor/assets/plugins/plugins/example/plugin.js +68 -0
  91. data/vendor/assets/plugins/plugins/example/plugin.min.js +1 -0
  92. data/vendor/assets/plugins/plugins/example_dependency/plugin.js +22 -0
  93. data/vendor/assets/plugins/plugins/example_dependency/plugin.min.js +1 -0
  94. data/vendor/assets/plugins/plugins/fullpage/plugin.js +490 -0
  95. data/vendor/assets/plugins/plugins/fullpage/plugin.min.js +1 -0
  96. data/vendor/assets/plugins/plugins/fullscreen/plugin.js +136 -0
  97. data/vendor/assets/plugins/plugins/fullscreen/plugin.min.js +1 -0
  98. data/vendor/assets/plugins/plugins/hr/plugin.js +30 -0
  99. data/vendor/assets/plugins/plugins/hr/plugin.min.js +1 -0
  100. data/vendor/assets/plugins/plugins/image/plugin.js +439 -0
  101. data/vendor/assets/plugins/plugins/image/plugin.min.js +1 -0
  102. data/vendor/assets/plugins/plugins/importcss/plugin.js +195 -0
  103. data/vendor/assets/plugins/plugins/importcss/plugin.min.js +1 -0
  104. data/vendor/assets/plugins/plugins/insertdatetime/plugin.js +121 -0
  105. data/vendor/assets/plugins/plugins/insertdatetime/plugin.min.js +1 -0
  106. data/vendor/assets/plugins/plugins/layer/plugin.js +225 -0
  107. data/vendor/assets/plugins/plugins/layer/plugin.min.js +1 -0
  108. data/vendor/assets/plugins/plugins/legacyoutput/plugin.js +211 -0
  109. data/vendor/assets/plugins/plugins/legacyoutput/plugin.min.js +1 -0
  110. data/vendor/assets/plugins/plugins/link/plugin.js +400 -0
  111. data/vendor/assets/plugins/plugins/link/plugin.min.js +1 -0
  112. data/vendor/assets/plugins/plugins/lists/plugin.js +791 -0
  113. data/vendor/assets/plugins/plugins/lists/plugin.min.js +1 -0
  114. data/vendor/assets/plugins/plugins/media/moxieplayer.swf +0 -0
  115. data/vendor/assets/plugins/plugins/media/plugin.js +774 -0
  116. data/vendor/assets/plugins/plugins/media/plugin.min.js +1 -0
  117. data/vendor/assets/plugins/plugins/nonbreaking/plugin.js +53 -0
  118. data/vendor/assets/plugins/plugins/nonbreaking/plugin.min.js +1 -0
  119. data/vendor/assets/plugins/plugins/noneditable/plugin.js +540 -0
  120. data/vendor/assets/plugins/plugins/noneditable/plugin.min.js +1 -0
  121. data/vendor/assets/plugins/plugins/pagebreak/plugin.js +88 -0
  122. data/vendor/assets/plugins/plugins/pagebreak/plugin.min.js +1 -0
  123. data/vendor/assets/plugins/plugins/paste/classes/Clipboard.js +634 -0
  124. data/vendor/assets/plugins/plugins/paste/classes/Plugin.js +110 -0
  125. data/vendor/assets/plugins/plugins/paste/classes/Quirks.js +159 -0
  126. data/vendor/assets/plugins/plugins/paste/classes/Utils.js +130 -0
  127. data/vendor/assets/plugins/plugins/paste/classes/WordFilter.js +493 -0
  128. data/vendor/assets/plugins/plugins/paste/plugin.dev.js +120 -0
  129. data/vendor/assets/plugins/plugins/paste/plugin.js +1625 -0
  130. data/vendor/assets/plugins/plugins/paste/plugin.min.js +1 -0
  131. data/vendor/assets/plugins/plugins/preview/plugin.js +88 -0
  132. data/vendor/assets/plugins/plugins/preview/plugin.min.js +1 -0
  133. data/vendor/assets/plugins/plugins/print/plugin.js +32 -0
  134. data/vendor/assets/plugins/plugins/print/plugin.min.js +1 -0
  135. data/vendor/assets/plugins/plugins/save/plugin.js +94 -0
  136. data/vendor/assets/plugins/plugins/save/plugin.min.js +1 -0
  137. data/vendor/assets/plugins/plugins/searchreplace/plugin.js +594 -0
  138. data/vendor/assets/plugins/plugins/searchreplace/plugin.min.js +1 -0
  139. data/vendor/assets/plugins/plugins/spellchecker/classes/DomTextMatcher.js +470 -0
  140. data/vendor/assets/plugins/plugins/spellchecker/classes/Plugin.js +436 -0
  141. data/vendor/assets/plugins/plugins/spellchecker/plugin.dev.js +117 -0
  142. data/vendor/assets/plugins/plugins/spellchecker/plugin.js +996 -0
  143. data/vendor/assets/plugins/plugins/spellchecker/plugin.min.js +1 -0
  144. data/vendor/assets/plugins/plugins/tabfocus/plugin.js +120 -0
  145. data/vendor/assets/plugins/plugins/tabfocus/plugin.min.js +1 -0
  146. data/vendor/assets/plugins/plugins/table/classes/CellSelection.js +176 -0
  147. data/vendor/assets/plugins/plugins/table/classes/Dialogs.js +749 -0
  148. data/vendor/assets/plugins/plugins/table/classes/Plugin.js +422 -0
  149. data/vendor/assets/plugins/plugins/table/classes/Quirks.js +372 -0
  150. data/vendor/assets/plugins/plugins/table/classes/TableGrid.js +864 -0
  151. data/vendor/assets/plugins/plugins/table/plugin.dev.js +118 -0
  152. data/vendor/assets/plugins/plugins/table/plugin.js +2680 -0
  153. data/vendor/assets/plugins/plugins/table/plugin.min.js +1 -0
  154. data/vendor/assets/plugins/plugins/template/plugin.js +262 -0
  155. data/vendor/assets/plugins/plugins/template/plugin.min.js +1 -0
  156. data/vendor/assets/plugins/plugins/textcolor/plugin.js +272 -0
  157. data/vendor/assets/plugins/plugins/textcolor/plugin.min.js +1 -0
  158. data/vendor/assets/plugins/plugins/textpattern/plugin.js +268 -0
  159. data/vendor/assets/plugins/plugins/textpattern/plugin.min.js +1 -0
  160. data/vendor/assets/plugins/plugins/visualblocks/css/visualblocks.css +135 -0
  161. data/vendor/assets/plugins/plugins/visualblocks/img/address.gif +0 -0
  162. data/vendor/assets/plugins/plugins/visualblocks/img/article.gif +0 -0
  163. data/vendor/assets/plugins/plugins/visualblocks/img/aside.gif +0 -0
  164. data/vendor/assets/plugins/plugins/visualblocks/img/blockquote.gif +0 -0
  165. data/vendor/assets/plugins/plugins/visualblocks/img/div.gif +0 -0
  166. data/vendor/assets/plugins/plugins/visualblocks/img/dl.gif +0 -0
  167. data/vendor/assets/plugins/plugins/visualblocks/img/figure.gif +0 -0
  168. data/vendor/assets/plugins/plugins/visualblocks/img/h1.gif +0 -0
  169. data/vendor/assets/plugins/plugins/visualblocks/img/h2.gif +0 -0
  170. data/vendor/assets/plugins/plugins/visualblocks/img/h3.gif +0 -0
  171. data/vendor/assets/plugins/plugins/visualblocks/img/h4.gif +0 -0
  172. data/vendor/assets/plugins/plugins/visualblocks/img/h5.gif +0 -0
  173. data/vendor/assets/plugins/plugins/visualblocks/img/h6.gif +0 -0
  174. data/vendor/assets/plugins/plugins/visualblocks/img/hgroup.gif +0 -0
  175. data/vendor/assets/plugins/plugins/visualblocks/img/ol.gif +0 -0
  176. data/vendor/assets/plugins/plugins/visualblocks/img/p.gif +0 -0
  177. data/vendor/assets/plugins/plugins/visualblocks/img/pre.gif +0 -0
  178. data/vendor/assets/plugins/plugins/visualblocks/img/section.gif +0 -0
  179. data/vendor/assets/plugins/plugins/visualblocks/img/ul.gif +0 -0
  180. data/vendor/assets/plugins/plugins/visualblocks/plugin.js +86 -0
  181. data/vendor/assets/plugins/plugins/visualblocks/plugin.min.js +1 -0
  182. data/vendor/assets/plugins/plugins/visualchars/plugin.js +88 -0
  183. data/vendor/assets/plugins/plugins/visualchars/plugin.min.js +1 -0
  184. data/vendor/assets/plugins/plugins/wordcount/plugin.js +69 -0
  185. data/vendor/assets/plugins/plugins/wordcount/plugin.min.js +1 -0
  186. data/vendor/assets/skins/skins/lightgray/content.inline.min.css +1 -0
  187. data/vendor/assets/skins/skins/lightgray/content.min.css +1 -0
  188. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.eot +0 -0
  189. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.svg +62 -0
  190. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  191. data/vendor/assets/skins/skins/lightgray/fonts/tinymce-small.woff +0 -0
  192. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.eot +0 -0
  193. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.svg +63 -0
  194. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.ttf +0 -0
  195. data/vendor/assets/skins/skins/lightgray/fonts/tinymce.woff +0 -0
  196. data/vendor/assets/skins/skins/lightgray/img/anchor.gif +0 -0
  197. data/vendor/assets/skins/skins/lightgray/img/loader.gif +0 -0
  198. data/vendor/assets/skins/skins/lightgray/img/object.gif +0 -0
  199. data/vendor/assets/skins/skins/lightgray/img/trans.gif +0 -0
  200. data/vendor/assets/skins/skins/lightgray/skin.ie7.min.css +1 -0
  201. data/vendor/assets/skins/skins/lightgray/skin.min.css +1 -0
  202. data/vendor/assets/stylesheets/mirador-combined.css +3969 -0
  203. data/vendor/assets/stylesheets/mirador.css +11 -0
  204. data/vendor/assets/themes/themes/modern/theme.js +617 -0
  205. data/vendor/assets/themes/themes/modern/theme.min.js +1 -0
  206. metadata +318 -0
@@ -0,0 +1 @@
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)});
@@ -0,0 +1,211 @@
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);
@@ -0,0 +1 @@
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);
@@ -0,0 +1,400 @@
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('link', function(editor) {
14
+ function createLinkList(callback) {
15
+ return function() {
16
+ var linkList = editor.settings.link_list;
17
+
18
+ if (typeof(linkList) == "string") {
19
+ tinymce.util.XHR.send({
20
+ url: linkList,
21
+ success: function(text) {
22
+ callback(tinymce.util.JSON.parse(text));
23
+ }
24
+ });
25
+ } else if (typeof(linkList) == "function") {
26
+ linkList(callback);
27
+ } else {
28
+ callback(linkList);
29
+ }
30
+ };
31
+ }
32
+
33
+ function buildListItems(inputList, itemCallback, startItems) {
34
+ function appendItems(values, output) {
35
+ output = output || [];
36
+
37
+ tinymce.each(values, function(item) {
38
+ var menuItem = {text: item.text || item.title};
39
+
40
+ if (item.menu) {
41
+ menuItem.menu = appendItems(item.menu);
42
+ } else {
43
+ menuItem.value = item.value;
44
+
45
+ if (itemCallback) {
46
+ itemCallback(menuItem);
47
+ }
48
+ }
49
+
50
+ output.push(menuItem);
51
+ });
52
+
53
+ return output;
54
+ }
55
+
56
+ return appendItems(inputList, startItems || []);
57
+ }
58
+
59
+ function showDialog(linkList) {
60
+ var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText;
61
+ var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
62
+
63
+ function linkListChangeHandler(e) {
64
+ var textCtrl = win.find('#text');
65
+
66
+ if (!textCtrl.value() || (e.lastControl && textCtrl.value() == e.lastControl.text())) {
67
+ textCtrl.value(e.control.text());
68
+ }
69
+
70
+ win.find('#href').value(e.control.value());
71
+ }
72
+
73
+ function buildAnchorListControl(url) {
74
+ var anchorList = [];
75
+
76
+ tinymce.each(editor.dom.select('a:not([href])'), function(anchor) {
77
+ var id = anchor.name || anchor.id;
78
+
79
+ if (id) {
80
+ anchorList.push({
81
+ text: id,
82
+ value: '#' + id,
83
+ selected: url.indexOf('#' + id) != -1
84
+ });
85
+ }
86
+ });
87
+
88
+ if (anchorList.length) {
89
+ anchorList.unshift({text: 'None', value: ''});
90
+
91
+ return {
92
+ name: 'anchor',
93
+ type: 'listbox',
94
+ label: 'Anchors',
95
+ values: anchorList,
96
+ onselect: linkListChangeHandler
97
+ };
98
+ }
99
+ }
100
+
101
+ function updateText() {
102
+ if (!initialText && data.text.length === 0 && onlyText) {
103
+ this.parent().parent().find('#text')[0].value(this.value());
104
+ }
105
+ }
106
+
107
+ function urlChange(e) {
108
+ var meta = e.meta || {};
109
+
110
+ if (linkListCtrl) {
111
+ linkListCtrl.value(editor.convertURL(this.value(), 'href'));
112
+ }
113
+
114
+ tinymce.each(e.meta, function(value, key) {
115
+ win.find('#' + key).value(value);
116
+ });
117
+
118
+ if (!meta.text) {
119
+ updateText.call(this);
120
+ }
121
+ }
122
+
123
+ function isOnlyTextSelected(anchorElm) {
124
+ var html = selection.getContent();
125
+
126
+ // Partial html and not a fully selected anchor element
127
+ if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') == -1)) {
128
+ return false;
129
+ }
130
+
131
+ if (anchorElm) {
132
+ var nodes = anchorElm.childNodes, i;
133
+
134
+ if (nodes.length === 0) {
135
+ return false;
136
+ }
137
+
138
+ for (i = nodes.length - 1; i >= 0; i--) {
139
+ if (nodes[i].nodeType != 3) {
140
+ return false;
141
+ }
142
+ }
143
+ }
144
+
145
+ return true;
146
+ }
147
+
148
+ selectedElm = selection.getNode();
149
+ anchorElm = dom.getParent(selectedElm, 'a[href]');
150
+ onlyText = isOnlyTextSelected();
151
+
152
+ data.text = initialText = anchorElm ? (anchorElm.innerText || anchorElm.textContent) : selection.getContent({format: 'text'});
153
+ data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
154
+
155
+ if ((value = dom.getAttrib(anchorElm, 'target'))) {
156
+ data.target = value;
157
+ } else if (editor.settings.default_link_target) {
158
+ data.target = editor.settings.default_link_target;
159
+ }
160
+
161
+ if ((value = dom.getAttrib(anchorElm, 'rel'))) {
162
+ data.rel = value;
163
+ }
164
+
165
+ if ((value = dom.getAttrib(anchorElm, 'class'))) {
166
+ data['class'] = value;
167
+ }
168
+
169
+ if ((value = dom.getAttrib(anchorElm, 'title'))) {
170
+ data.title = value;
171
+ }
172
+
173
+ if (onlyText) {
174
+ textListCtrl = {
175
+ name: 'text',
176
+ type: 'textbox',
177
+ size: 40,
178
+ label: 'Text to display',
179
+ onchange: function() {
180
+ data.text = this.value();
181
+ }
182
+ };
183
+ }
184
+
185
+ if (linkList) {
186
+ linkListCtrl = {
187
+ type: 'listbox',
188
+ label: 'Link list',
189
+ values: buildListItems(
190
+ linkList,
191
+ function(item) {
192
+ item.value = editor.convertURL(item.value || item.url, 'href');
193
+ },
194
+ [{text: 'None', value: ''}]
195
+ ),
196
+ onselect: linkListChangeHandler,
197
+ value: editor.convertURL(data.href, 'href'),
198
+ onPostRender: function() {
199
+ linkListCtrl = this;
200
+ }
201
+ };
202
+ }
203
+
204
+ if (editor.settings.target_list !== false) {
205
+ if (!editor.settings.target_list) {
206
+ editor.settings.target_list = [
207
+ {text: 'None', value: ''},
208
+ {text: 'New window', value: '_blank'}
209
+ ];
210
+ }
211
+
212
+ targetListCtrl = {
213
+ name: 'target',
214
+ type: 'listbox',
215
+ label: 'Target',
216
+ values: buildListItems(editor.settings.target_list)
217
+ };
218
+ }
219
+
220
+ if (editor.settings.rel_list) {
221
+ relListCtrl = {
222
+ name: 'rel',
223
+ type: 'listbox',
224
+ label: 'Rel',
225
+ values: buildListItems(editor.settings.rel_list)
226
+ };
227
+ }
228
+
229
+ if (editor.settings.link_class_list) {
230
+ classListCtrl = {
231
+ name: 'class',
232
+ type: 'listbox',
233
+ label: 'Class',
234
+ values: buildListItems(
235
+ editor.settings.link_class_list,
236
+ function(item) {
237
+ if (item.value) {
238
+ item.textStyle = function() {
239
+ return editor.formatter.getCssText({inline: 'a', classes: [item.value]});
240
+ };
241
+ }
242
+ }
243
+ )
244
+ };
245
+ }
246
+
247
+ if (editor.settings.link_title !== false) {
248
+ linkTitleCtrl = {
249
+ name: 'title',
250
+ type: 'textbox',
251
+ label: 'Title',
252
+ value: data.title
253
+ };
254
+ }
255
+
256
+ win = editor.windowManager.open({
257
+ title: 'Insert link',
258
+ data: data,
259
+ body: [
260
+ {
261
+ name: 'href',
262
+ type: 'filepicker',
263
+ filetype: 'file',
264
+ size: 40,
265
+ autofocus: true,
266
+ label: 'Url',
267
+ onchange: urlChange,
268
+ onkeyup: updateText
269
+ },
270
+ textListCtrl,
271
+ linkTitleCtrl,
272
+ buildAnchorListControl(data.href),
273
+ linkListCtrl,
274
+ relListCtrl,
275
+ targetListCtrl,
276
+ classListCtrl
277
+ ],
278
+ onSubmit: function(e) {
279
+ var href;
280
+
281
+ data = tinymce.extend(data, e.data);
282
+ href = data.href;
283
+
284
+ // Delay confirm since onSubmit will move focus
285
+ function delayedConfirm(message, callback) {
286
+ var rng = editor.selection.getRng();
287
+
288
+ window.setTimeout(function() {
289
+ editor.windowManager.confirm(message, function(state) {
290
+ editor.selection.setRng(rng);
291
+ callback(state);
292
+ });
293
+ }, 0);
294
+ }
295
+
296
+ function insertLink() {
297
+ var linkAttrs = {
298
+ href: href,
299
+ target: data.target ? data.target : null,
300
+ rel: data.rel ? data.rel : null,
301
+ "class": data["class"] ? data["class"] : null,
302
+ title: data.title ? data.title : null
303
+ };
304
+
305
+ if (anchorElm) {
306
+ editor.focus();
307
+
308
+ if (onlyText && data.text != initialText) {
309
+ if ("innerText" in anchorElm) {
310
+ anchorElm.innerText = data.text;
311
+ } else {
312
+ anchorElm.textContent = data.text;
313
+ }
314
+ }
315
+
316
+ dom.setAttribs(anchorElm, linkAttrs);
317
+
318
+ selection.select(anchorElm);
319
+ editor.undoManager.add();
320
+ } else {
321
+ if (onlyText) {
322
+ editor.insertContent(dom.createHTML('a', linkAttrs, dom.encode(data.text)));
323
+ } else {
324
+ editor.execCommand('mceInsertLink', false, linkAttrs);
325
+ }
326
+ }
327
+ }
328
+
329
+ if (!href) {
330
+ editor.execCommand('unlink');
331
+ return;
332
+ }
333
+
334
+ // Is email and not //user@domain.com
335
+ if (href.indexOf('@') > 0 && href.indexOf('//') == -1 && href.indexOf('mailto:') == -1) {
336
+ delayedConfirm(
337
+ 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?',
338
+ function(state) {
339
+ if (state) {
340
+ href = 'mailto:' + href;
341
+ }
342
+
343
+ insertLink();
344
+ }
345
+ );
346
+
347
+ return;
348
+ }
349
+
350
+ // Is www. prefixed
351
+ if (/^\s*www\./i.test(href)) {
352
+ delayedConfirm(
353
+ 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?',
354
+ function(state) {
355
+ if (state) {
356
+ href = 'http://' + href;
357
+ }
358
+
359
+ insertLink();
360
+ }
361
+ );
362
+
363
+ return;
364
+ }
365
+
366
+ insertLink();
367
+ }
368
+ });
369
+ }
370
+
371
+ editor.addButton('link', {
372
+ icon: 'link',
373
+ tooltip: 'Insert/edit link',
374
+ shortcut: 'Ctrl+K',
375
+ onclick: createLinkList(showDialog),
376
+ stateSelector: 'a[href]'
377
+ });
378
+
379
+ editor.addButton('unlink', {
380
+ icon: 'unlink',
381
+ tooltip: 'Remove link',
382
+ cmd: 'unlink',
383
+ stateSelector: 'a[href]'
384
+ });
385
+
386
+ editor.addShortcut('Ctrl+K', '', createLinkList(showDialog));
387
+ editor.addCommand('mceLink', createLinkList(showDialog));
388
+
389
+ this.showDialog = showDialog;
390
+
391
+ editor.addMenuItem('link', {
392
+ icon: 'link',
393
+ text: 'Insert link',
394
+ shortcut: 'Ctrl+K',
395
+ onclick: createLinkList(showDialog),
396
+ stateSelector: 'a[href]',
397
+ context: 'insert',
398
+ prependToContext: true
399
+ });
400
+ });