radiant-forum-extension 2.1.6 → 3.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/README.md +20 -16
  2. data/Rakefile +0 -16
  3. data/app/controllers/forum_base_controller.rb +32 -10
  4. data/app/controllers/posts_controller.rb +37 -14
  5. data/app/helpers/forum_helper.rb +23 -16
  6. data/app/models/forum.rb +11 -7
  7. data/app/models/post.rb +53 -14
  8. data/app/models/post_attachment.rb +1 -1
  9. data/app/models/topic.rb +21 -8
  10. data/app/views/admin/dashboard/_forum_dashboard.html.haml +51 -0
  11. data/app/views/admin/forums/_form.html.haml +12 -0
  12. data/app/views/admin/forums/edit.html.haml +1 -1
  13. data/app/views/admin/forums/index.html.haml +16 -20
  14. data/app/views/admin/posts/_form.html.haml +2 -2
  15. data/app/views/admin/posts/edit.html.haml +1 -1
  16. data/app/views/admin/posts/index.html.haml +5 -5
  17. data/app/views/admin/reader_configuration/_edit_forum.html.haml +6 -0
  18. data/app/views/admin/reader_configuration/_forum.html.haml +5 -1
  19. data/app/views/admin/topics/_form.html.haml +3 -5
  20. data/app/views/admin/topics/edit.html.haml +1 -1
  21. data/app/views/admin/topics/index.html.haml +5 -5
  22. data/app/views/forums/_forum.html.haml +6 -5
  23. data/app/views/forums/_latest.html.haml +14 -12
  24. data/app/views/forums/_statistics.html.haml +4 -4
  25. data/app/views/forums/index.html.haml +8 -10
  26. data/app/views/forums/index.rss.builder +2 -2
  27. data/app/views/forums/show.html.haml +12 -15
  28. data/app/views/pages/_add_comment.html.haml +9 -8
  29. data/app/views/pages/_comments.html.haml +3 -3
  30. data/app/views/posts/_attachments.html.haml +1 -1
  31. data/app/views/posts/_confirm_delete.html.haml +7 -2
  32. data/app/views/posts/_context.html.haml +5 -5
  33. data/app/views/posts/_edit_links.html.haml +4 -4
  34. data/app/views/posts/_form.html.haml +15 -12
  35. data/app/views/posts/_ineditable.html.haml +7 -0
  36. data/app/views/posts/_latest.html.haml +3 -8
  37. data/app/views/posts/_minimal.html.haml +7 -0
  38. data/app/views/posts/_post.html.haml +20 -17
  39. data/app/views/posts/_post.rss.builder +2 -2
  40. data/app/views/posts/_search_form.html.haml +13 -13
  41. data/app/views/posts/_search_results.html.haml +15 -0
  42. data/app/views/posts/_search_summary.html.haml +13 -0
  43. data/app/views/posts/_uploader.html.haml +1 -1
  44. data/app/views/posts/edit.html.haml +22 -21
  45. data/app/views/posts/index.html.haml +12 -19
  46. data/app/views/posts/index.rss.builder +6 -6
  47. data/app/views/posts/new.html.haml +19 -22
  48. data/app/views/posts/remove.html.haml +15 -15
  49. data/app/views/posts/show.html.haml +16 -10
  50. data/app/views/readers/_forum_messages.html.haml +9 -6
  51. data/app/views/readers/_messages_summary.html.haml +1 -1
  52. data/app/views/shared/_standard_forum_parts.html.haml +41 -0
  53. data/app/views/topics/_busiest.html.haml +9 -8
  54. data/app/views/topics/_context.html.haml +11 -8
  55. data/app/views/topics/_latest.html.haml +2 -2
  56. data/app/views/topics/_locked.html.haml +1 -1
  57. data/app/views/topics/_minimal.html.haml +2 -2
  58. data/app/views/topics/_replies.html.haml +4 -3
  59. data/app/views/topics/_reply.html.haml +13 -8
  60. data/app/views/topics/_topic.html.haml +5 -9
  61. data/app/views/topics/_topic.rss.builder +1 -1
  62. data/app/views/topics/index.html.haml +14 -10
  63. data/app/views/topics/index.rss.builder +2 -2
  64. data/app/views/topics/show.html.haml +20 -19
  65. data/app/views/topics/show.rss.builder +3 -3
  66. data/config/initializers/radiant_config.rb +4 -1
  67. data/config/locales/en.yml +202 -178
  68. data/db/migrate/002_pages_commentable.rb +1 -2
  69. data/db/migrate/004_sample_layout.rb +38 -15
  70. data/db/migrate/20110111080550_detach_observer.rb +4 -4
  71. data/db/migrate/20110613112823_search_text.rb +9 -0
  72. data/db/migrate/20110613130230_tidy_up.rb +27 -0
  73. data/db/migrate/20110630083446_page_replied_at.rb +11 -0
  74. data/forum_extension.rb +13 -11
  75. data/lib/commentable_model.rb +13 -9
  76. data/lib/forum_admin_ui.rb +6 -6
  77. data/lib/forum_page.rb +5 -3
  78. data/lib/forum_reader.rb +7 -1
  79. data/lib/forum_reader_sessions_controller.rb +2 -3
  80. data/lib/forum_tags.rb +126 -11
  81. data/lib/radiant-forum-extension.rb +8 -0
  82. data/public/cleditor/images/buttons.gif +0 -0
  83. data/public/cleditor/images/icons/1.gif +0 -0
  84. data/public/cleditor/images/icons/10.gif +0 -0
  85. data/public/cleditor/images/icons/11.gif +0 -0
  86. data/public/cleditor/images/icons/12.gif +0 -0
  87. data/public/cleditor/images/icons/2.gif +0 -0
  88. data/public/cleditor/images/icons/3.gif +0 -0
  89. data/public/cleditor/images/icons/4.gif +0 -0
  90. data/public/cleditor/images/icons/5.gif +0 -0
  91. data/public/cleditor/images/icons/6.gif +0 -0
  92. data/public/cleditor/images/icons/7.gif +0 -0
  93. data/public/cleditor/images/icons/8.gif +0 -0
  94. data/public/cleditor/images/icons/9.gif +0 -0
  95. data/public/cleditor/images/icons/icons.gif +0 -0
  96. data/public/cleditor/images/toolbar.gif +0 -0
  97. data/public/cleditor/jquery.cleditor.css +24 -0
  98. data/public/cleditor/jquery.cleditor.icon.js +65 -0
  99. data/public/cleditor/jquery.cleditor.js +1132 -0
  100. data/public/cleditor/jquery.cleditor.xhtml.js +230 -0
  101. data/public/javascripts/forum.js +146 -107
  102. data/public/stylesheets/sass/forum.sass +94 -58
  103. data/radiant-forum-extension.gemspec +25 -276
  104. data/spec/controllers/forums_controller_spec.rb +0 -7
  105. data/spec/controllers/posts_controller_spec.rb +20 -37
  106. data/spec/controllers/topics_controller_spec.rb +1 -7
  107. data/spec/datasets/forums_dataset.rb +38 -40
  108. data/spec/lib/commentable_model_spec.rb +26 -38
  109. data/spec/lib/forum_reader_spec.rb +0 -4
  110. data/spec/models/forum_spec.rb +46 -16
  111. data/spec/models/post_spec.rb +10 -6
  112. data/spec/models/topic_spec.rb +26 -17
  113. data/spec/spec_helper.rb +1 -0
  114. metadata +66 -99
  115. data/VERSION +0 -1
  116. data/app/views/forums/_standard_parts.html.haml +0 -59
  117. data/lib/sanitize/config/forum.rb +0 -49
  118. data/public/javascripts/gallery.js +0 -275
  119. data/public/punymce/blank.htm +0 -1
  120. data/public/punymce/css/content.css +0 -4
  121. data/public/punymce/css/editor.css +0 -58
  122. data/public/punymce/i18n/sv.js +0 -28
  123. data/public/punymce/img/icons.gif +0 -0
  124. data/public/punymce/img/icons_uncompressed.png +0 -0
  125. data/public/punymce/plugins/bbcode.js +0 -1
  126. data/public/punymce/plugins/bbcode_src.js +0 -50
  127. data/public/punymce/plugins/editsource/css/editor.css +0 -3
  128. data/public/punymce/plugins/editsource/editsource.js +0 -1
  129. data/public/punymce/plugins/editsource/editsource_src.js +0 -81
  130. data/public/punymce/plugins/editsource/img/icons.gif +0 -0
  131. data/public/punymce/plugins/emoticons/css/content.css +0 -13
  132. data/public/punymce/plugins/emoticons/css/editor.css +0 -17
  133. data/public/punymce/plugins/emoticons/emoticons.js +0 -1
  134. data/public/punymce/plugins/emoticons/emoticons_src.js +0 -303
  135. data/public/punymce/plugins/emoticons/img/emoticons.gif +0 -0
  136. data/public/punymce/plugins/emoticons/img/emoticons.png +0 -0
  137. data/public/punymce/plugins/emoticons/img/trans.gif +0 -0
  138. data/public/punymce/plugins/entities.js +0 -1
  139. data/public/punymce/plugins/entities_src.js +0 -37
  140. data/public/punymce/plugins/forceblocks.js +0 -1
  141. data/public/punymce/plugins/forceblocks_src.js +0 -465
  142. data/public/punymce/plugins/forcenl.js +0 -1
  143. data/public/punymce/plugins/forcenl_src.js +0 -26
  144. data/public/punymce/plugins/image/css/editor.css +0 -1
  145. data/public/punymce/plugins/image/image.js +0 -1
  146. data/public/punymce/plugins/image/image_src.js +0 -30
  147. data/public/punymce/plugins/image/img/icons.gif +0 -0
  148. data/public/punymce/plugins/link/css/editor.css +0 -2
  149. data/public/punymce/plugins/link/img/icons.gif +0 -0
  150. data/public/punymce/plugins/link/link.js +0 -1
  151. data/public/punymce/plugins/link/link_src.js +0 -36
  152. data/public/punymce/plugins/paste.js +0 -1
  153. data/public/punymce/plugins/paste_src.js +0 -169
  154. data/public/punymce/plugins/protect.js +0 -1
  155. data/public/punymce/plugins/protect_src.js +0 -30
  156. data/public/punymce/plugins/safari2x.js +0 -1
  157. data/public/punymce/plugins/safari2x_src.js +0 -284
  158. data/public/punymce/plugins/tabfocus.js +0 -1
  159. data/public/punymce/plugins/tabfocus_src.js +0 -45
  160. data/public/punymce/plugins/textcolor/css/editor.css +0 -7
  161. data/public/punymce/plugins/textcolor/img/icons.gif +0 -0
  162. data/public/punymce/plugins/textcolor/textcolor.js +0 -1
  163. data/public/punymce/plugins/textcolor/textcolor_src.js +0 -73
  164. data/public/punymce/puny_mce.js +0 -1
  165. data/public/punymce/puny_mce_full.js +0 -1
  166. data/public/punymce/puny_mce_src.js +0 -1460
@@ -1,58 +0,0 @@
1
- /* Reset */
2
- iframe.punymce, ul.punymce, ul.punymce li, .punymce a {border:0; padding:0; margin:0; display:inline; background:transparent}
3
-
4
- /* Basic UI */
5
- .punymce table {}
6
- .punymce .mceToolbar td {height:16px}
7
- .punymce tr.mceBody td {height:auto}
8
- .punymce ul {display:block; height:16px; position:relative}
9
- .punymce tr.mceBody td div.mceBody {border:1px solid #CCC; position:relative}
10
- .punymce iframe {clear:both; display:block; padding: 6px;}
11
- .punymce table .mceToolbar a {border:1px solid #F0F0EE; display:block; width:16px; height:16px; margin-right:1px; float:left; overflow:hidden}
12
- .punymce .mcePlaceholder {border:1px dotted #000; display:none}
13
-
14
- /* Style menu */
15
- div.punymce_style {position:absolute; display:none; background:#FFF; border:1px solid #808080; font-family:Verdana, Arial; font-size:11px}
16
- .punymce_style a:hover {border:0; background:#CCC}
17
- .punymce_style a {display:block; text-decoration:none; color:#000; padding:2px}
18
-
19
- /* Style previews */
20
- .punymce .h1 {font-size:xx-large}
21
- .punymce .h2 {font-size:x-large}
22
- .punymce .h3 {font-size:large}
23
- .punymce .pre {font-family:pre}
24
- .punymce .times {font-family:Times}
25
- .punymce .arial {font-family:Arial}
26
- .punymce .courier {font-family:Courier}
27
-
28
- /* Resize */
29
- .punymce .mceResize {position:absolute; right:1px; bottom:1px; width:7px; height:7px; background:url('../img/icons.gif') -217px -9px; overflow:hidden}
30
-
31
- /* Buttons */
32
- .punymce li.disabled a {filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); -moz-opacity:0.3; opacity:0.3; cursor:default}
33
- .punymce li.disabled a:hover {border:1px solid #F0F0EE}
34
- .punymce .mceToolbar a:hover, .punymce .mceToolbar li.active a:hover {border:1px solid gray}
35
- .punymce .mceToolbar li.active a {border:1px solid #BBB}
36
- .punymce a.bold {background:url('../img/icons.gif') 0 0}
37
- .punymce a.italic {background:url('../img/icons.gif') -16px 0}
38
- .punymce a.underline {background:url('../img/icons.gif') -32px 0}
39
- .punymce a.strike {background:url('../img/icons.gif') -48px 0}
40
- .punymce a.ol {background:url('../img/icons.gif') -80px 0}
41
- .punymce a.ul {background:url('../img/icons.gif') -64px 0}
42
- .punymce a.indent {background:url('../img/icons.gif') -96px 0}
43
- .punymce a.outdent {background:url('../img/icons.gif') -112px 0}
44
- .punymce a.left {background:url('../img/icons.gif') -128px 0}
45
- .punymce a.center {background:url('../img/icons.gif') -144px 0}
46
- .punymce a.right {background:url('../img/icons.gif') -160px 0}
47
- .punymce a.style {background:url('../img/icons.gif') -176px 0}
48
- .punymce a.removeformat {background:url('../img/icons.gif') -192px 0}
49
- .punymce a.increasefontsize {background:url('../img/icons.gif') -224px 0}
50
- .punymce a.decreasefontsize {background:url('../img/icons.gif') -240px 0}
51
-
52
- /* MSIE 6 */
53
-
54
- * html .punymce .mceResize {right:2px; bottom:4px}
55
-
56
- /* MSIE 7 */
57
-
58
- *:first-child+html .punymce .mceResize {right:1px; bottom:1px}
@@ -1,28 +0,0 @@
1
- punymce.extend(punymce.I18n, {
2
- // Core
3
- bold : 'Fet stil (Ctrl+B)',
4
- italic : 'Kursiv stil (Ctrl+I)',
5
- underline : 'Understruken (Ctrl+U)',
6
- strike : 'Genomstruken',
7
- ul : 'Punktlista',
8
- ol : 'Nummerlista',
9
- indent : '�ka indrag',
10
- outdent : 'Minska indrag',
11
- left : 'V�nsterjustera',
12
- center : 'Centerjustera',
13
- right : 'H�gerjustera',
14
- style : 'Textstil',
15
- removeformat : 'Ta bort formatering',
16
-
17
- // Image plugin
18
- insertimage : 'Infoga bild',
19
- entersrc : 'Skriv in URL:en till bilden',
20
-
21
- // Link plugin
22
- link : 'Skapa l�nk',
23
- unlink : 'Ta bort l�nk',
24
- enterhref : 'Skriv in URL:en till l�nken',
25
-
26
- // Textcolor plugin
27
- textcolor : 'Textf�rg'
28
- });
Binary file
@@ -1 +0,0 @@
1
- (function(a){a.plugins.BBCode=function(b){b.onGetContent.add(function(c,d){if(d.format=="bbcode"||d.save){a.each([[/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],[/<font.*?color=\"([^\"]+)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"],[/<img.*?src=\"([^\"]+)\".*?\/>/gi,"[img]$1[/img]"],[/<(br\s*\/)>/gi,"\n"],[/<(\/?)(strong|b)[^>]*>/gi,"[$1b]"],[/<(\/?)(em|i)[^>]*>/gi,"[$1i]"],[/<(\/?)u[^>]*>/gi,"[$1u]"],[/<(\/?)(code|pre)[^>]*>/gi,"[$1code]"],[/<(\/?)(span.*?class=\"quote\")[^>]*>(.*?)<\/span>/gi,"[$1quote]$3[/quote]"],[/<p>/gi,""],[/<\/p>/gi,"\n"],[/&quot;/gi,'"'],[/&lt;/gi,"<"],[/&gt;/gi,">"],[/&amp;/gi,"&"],[/<[^>]+>/gi,""]],function(e){d.content=d.content.replace(e[0],e[1])})}});b.onSetContent.add(function(c,d){if(d.format=="bbcode"||d.load){a.each([[/\n/gi,"<br />"],[/\[(\/?)b\]/gi,"<$1strong>"],[/\[(\/?)i\]/gi,"<$1em>"],[/\[(\/?)u\]/gi,"<$1u>"],[/\[(\/?)code\]/gi,"<$1pre>"],[/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'],[/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'],[/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'],[/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'],[/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quote">$1</span>']],function(e){d.content=d.content.replace(e[0],e[1])})}})}})(punymce);
@@ -1,50 +0,0 @@
1
- (function(punymce) {
2
- punymce.plugins.BBCode = function(ed) {
3
- // Convert XML into BBCode
4
- ed.onGetContent.add(function(ed, o) {
5
- if (o.format == 'bbcode' || o.save) {
6
- // example: <strong> to [b]
7
- punymce.each([
8
- [/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"],
9
- [/<font.*?color=\"([^\"]+)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"],
10
- [/<img.*?src=\"([^\"]+)\".*?\/>/gi,"[img]$1[/img]"],
11
- [/<(br\s*\/)>/gi, "\n"],
12
- [/<(\/?)(strong|b)[^>]*>/gi, "[$1b]"],
13
- [/<(\/?)(em|i)[^>]*>/gi, "[$1i]"],
14
- [/<(\/?)u[^>]*>/gi, "[$1u]"],
15
- [/<(\/?)(code|pre)[^>]*>/gi, "[$1code]"],
16
- [/<(\/?)(span.*?class=\"quote\")[^>]*>(.*?)<\/span>/gi, "[$1quote]$3[/quote]"],
17
- [/<p>/gi, ""],
18
- [/<\/p>/gi, "\n"],
19
- [/&quot;/gi, "\""],
20
- [/&lt;/gi, "<"],
21
- [/&gt;/gi, ">"],
22
- [/&amp;/gi, "&"],
23
- [/<[^>]+>/gi, ""]
24
- ], function (v) {
25
- o.content = o.content.replace(v[0], v[1]);
26
- });
27
- }
28
- });
29
-
30
- ed.onSetContent.add(function(ed, o) {
31
- if (o.format == 'bbcode' || o.load) {
32
- // example: [b] to <strong>
33
- punymce.each([
34
- [/\n/gi,"<br />"],
35
- [/\[(\/?)b\]/gi,"<$1strong>"],
36
- [/\[(\/?)i\]/gi,"<$1em>"],
37
- [/\[(\/?)u\]/gi,"<$1u>"],
38
- [/\[(\/?)code\]/gi,"<$1pre>"],
39
- [/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>"],
40
- [/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"<a href=\"$1\">$2</a>"],
41
- [/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"],
42
- [/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'],
43
- [/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quote">$1</span>']
44
- ], function (v) {
45
- o.content = o.content.replace(v[0], v[1]);
46
- });
47
- }
48
- });
49
- };
50
- })(punymce);
@@ -1,3 +0,0 @@
1
- .punymce a.editsource { background: url('../img/icons.gif') 0 0; }
2
- .punymce textarea.editsource { position: absolute; z-index: 10; left:0; top: 0; border: 0; padding: 0; margin: 0; resize: none; }
3
- .punymce textarea.editsource:focus { outline: none; }
@@ -1 +0,0 @@
1
- (function(a){a.plugins.EditSource=function(c){var d=a.DOM,g=a.extend,f=a.each,e=a.isWebKit;var b=0;if(!c.settings.editsource||c.settings.editsource.skip_css){d.loadCSS(a.baseURL+"/plugins/editsource/css/editor.css")}c.onBeforeGetContent.add(function(h,i){if(i.save&&b){h.setContent(d.get(h.settings.id+"_editsourcearea").value,{load:true})}});g(c.commands,{mceEditSource:function(r,q,o){var k,j=c.getIfr(),i=c.settings.id,p=c.width,l=c.height,n,m=d.get(i+"_editsource");if(!b){d.addClass(m,"active");f(d.select("li",i+"_c"),function(h){if(h!=m){d.addClass(h,"disabled")}});k=d.add(j.parentNode,"textarea",{id:i+"_editsourcearea","class":"editsource",style:"width:"+p+"px;height:"+l+"px;"});k.value=c.getContent({save:true});k.focus();if(!e){d.add(j.parentNode,"div",{id:i+"_edspacer","class":"spacer",style:"width:"+p+"px;height:"+l+"px;"});j.style.display="none"}b=1;return false}b=0;d.removeClass(m,"active");if(!e){j.style.display="block";k=d.get(i+"_edspacer");k.parentNode.removeChild(k)}k=d.get(i+"_editsourcearea");c.setContent(k.value,{load:true});k.parentNode.removeChild(k);f(d.select("li",i+"_c"),function(h){d.removeClass(h,"disabled")});return false}});g(c.tools,{editsource:{cmd:"mceEditSource",title:a.I18n.editsource}})};a.extend(a.I18n,{editsource:"Edit HTML source"})})(punymce);
@@ -1,81 +0,0 @@
1
- (function(punymce) {
2
- punymce.plugins.EditSource = function(ed) {
3
- var DOM = punymce.DOM, extend = punymce.extend, each = punymce.each, isWebKit = punymce.isWebKit;
4
- var sourceView = 0;
5
-
6
- if (!ed.settings.editsource || ed.settings.editsource.skip_css)
7
- DOM.loadCSS(punymce.baseURL + '/plugins/editsource/css/editor.css');
8
-
9
- ed.onBeforeGetContent.add(function(ed, o) {
10
- if (o.save && sourceView)
11
- ed.setContent(DOM.get(ed.settings.id + '_editsourcearea').value, {load : true});
12
- });
13
-
14
- // Add commands
15
- extend(ed.commands, {
16
- mceEditSource : function(u, v, e) {
17
- var ta, ifr = ed.getIfr(), id = ed.settings.id, w = ed.width, h = ed.height, f, but = DOM.get(id + '_editsource');
18
-
19
- // Enable source view
20
- if (!sourceView) {
21
- DOM.addClass(but, 'active');
22
-
23
- // Disable all buttons
24
- each(DOM.select('li', id + '_c'), function(n) {
25
- if (n != but)
26
- DOM.addClass(n, 'disabled');
27
- });
28
-
29
- // Hide iframe and view textarea
30
- ta = DOM.add(ifr.parentNode, 'textarea', {id : id + '_editsourcearea', 'class' : 'editsource', style : 'width:' + w + 'px;height:' + h + 'px;'});
31
- ta.value = ed.getContent({save : true});
32
- ta.focus();
33
-
34
- // A spacer element was need since IE 6/7 produces bugs if the container is sized
35
- // Iframe needs to be hidden IE and FF so that the designMode caret doesn't get shown
36
- // And on Safari 2.x hiding an iframe will break the iframe
37
- if (!isWebKit) {
38
- DOM.add(ifr.parentNode, 'div', {id : id + '_edspacer', 'class' : 'spacer', style : 'width:' + w + 'px;height:' + h + 'px;'});
39
- ifr.style.display = 'none';
40
- }
41
-
42
- sourceView = 1;
43
- return false;
44
- }
45
-
46
- // Disable source view
47
- sourceView = 0;
48
- DOM.removeClass(but, 'active');
49
-
50
- // Show iframe and remove spacer
51
- if (!isWebKit) {
52
- ifr.style.display = 'block';
53
- ta = DOM.get(id + '_edspacer');
54
- ta.parentNode.removeChild(ta);
55
- }
56
-
57
- // Remove textarea and set contents
58
- ta = DOM.get(id + '_editsourcearea');
59
- ed.setContent(ta.value, {load : true});
60
- ta.parentNode.removeChild(ta);
61
-
62
- // Enable all buttons
63
- each(DOM.select('li', id + '_c'), function(n) {
64
- DOM.removeClass(n, 'disabled');
65
- });
66
-
67
- return false;
68
- }
69
- });
70
-
71
- // Add tools
72
- extend(ed.tools, {
73
- editsource : {cmd : 'mceEditSource', title : punymce.I18n.editsource}
74
- });
75
- };
76
-
77
- // English i18n strings
78
- punymce.extend(punymce.I18n, {
79
- editsource : 'Edit HTML source'
80
- });
81
- })(punymce);
@@ -1,13 +0,0 @@
1
- .emoticon { margin: 0; padding: 0; border: 0; width: 16px; height: 16px; }
2
- .happy { background: url('../img/emoticons.png') no-repeat 0 0; }
3
- .unhappy { background: url('../img/emoticons.png') no-repeat -16px 0; }
4
- .sad { background: url('../img/emoticons.png') no-repeat -32px 0; }
5
- .grin { background: url('../img/emoticons.png') no-repeat -48px 0; }
6
- .surprised { background: url('../img/emoticons.png') no-repeat -64px 0; }
7
- .wink { background: url('../img/emoticons.png') no-repeat -80px 0; }
8
- .halfhappy { background: url('../img/emoticons.png') no-repeat -96px 0; }
9
- .tongue { background: url('../img/emoticons.png') no-repeat -112px 0; }
10
- .lol { background: url('../img/emoticons.png') no-repeat -128px 0; }
11
- .mad { background: url('../img/emoticons.png') no-repeat -144px 0; }
12
- .shocked { background: url('../img/emoticons.png') no-repeat -160px 0; }
13
- .cool { background: url('../img/emoticons.png') no-repeat -176px 0; }
@@ -1,17 +0,0 @@
1
- .punymce a.emoticons { background: url('../img/emoticons.png') 0 0; }
2
-
3
- /* Menu */
4
- div.punymce_emoticons { position: absolute; display: none; background-color: white; border: 1px solid #F0F0EE;}
5
- .punymce a.emoticon { display: block; width: 16px; height: 16px; }
6
- .punymce a.happy { background: url('../img/emoticons.png') no-repeat 0 0; }
7
- .punymce a.unhappy { background: url('../img/emoticons.png') no-repeat -16px 0; }
8
- .punymce a.sad { background: url('../img/emoticons.png') no-repeat -32px 0; }
9
- .punymce a.grin { background: url('../img/emoticons.png') no-repeat -48px 0; }
10
- .punymce a.surprised { background: url('../img/emoticons.png') no-repeat -64px 0; }
11
- .punymce a.wink { background: url('../img/emoticons.png') no-repeat -80px 0; }
12
- .punymce a.halfhappy { background: url('../img/emoticons.png') no-repeat -96px 0; }
13
- .punymce a.tongue { background: url('../img/emoticons.png') no-repeat -112px 0; }
14
- .punymce a.lol { background: url('../img/emoticons.png') no-repeat -128px 0; }
15
- .punymce a.mad { background: url('../img/emoticons.png') no-repeat -144px 0; }
16
- .punymce a.shocked { background: url('../img/emoticons.png') no-repeat -160px 0; }
17
- .punymce a.cool { background: url('../img/emoticons.png') no-repeat -176px 0; }
@@ -1 +0,0 @@
1
- (function(a){a.plugins.Emoticons=function(e){var k=a.Event,i,g,c,b,m,j,l,d;i=a.each;g=a.extend;c=a.isIE;b=a.isGecko;l=a.DOM;this.settings=m=g({emoticons:{happy:[":)"],neutral:[":|"],sad:[":("],grin:[":D"],surprised:[":O"],wink:[";)"],devil:["}:)"],tongue:[":P"],lol:[':@'],mad:[':['],shocked:['8|'],cool:['B]']},row_length:4,trans_img:a.baseURL+"plugins/emoticons/img/trans.gif",skip_css:0,auto_convert:1},e.settings.emoticons);if(!m.skip_css){l.loadCSS(a.baseURL+"/plugins/emoticons/css/editor.css")}j="";i(m.emoticons,function(h){i(h,function(n){if(j.length!=0){j+="|"}j+=n.replace(/([^a-zA-Z0-9])/g,"\\$1")})});j=new RegExp(j,"g");g(e.commands,{mceEmoticons:function(B,A,y){var q,C=this,h=e.settings.id,o=l.getPos(y.target),z,w;if(e.hideMenu){return e.hideMenu()}function x(n){e.hideMenu=null;k.remove(document,"click",x);k.remove(e.getDoc(),"click",x);l.get(h+"_memoticons").style.display="none";return 1}q=l.get(h+"_memoticons");if(!q){q=l.get(h+"_t");q=l.add(document.body,"div",{id:h+"_memoticons","class":"punymce_emoticons punymce"});q=l.add(q,"table",{"class":"punymce"});q=l.add(q,"tbody");z=m.row_length;i(m.emoticons,function(p,n){if(z==m.row_length){r=l.add(q,"tr");z=0}z++;k.add(l.add(l.add(r,"td"),"a",{href:"#","class":"emoticon "+n}),"mousedown",function(t){x.call(C);e.selection.setNode(e.dom.create("img",{title:p[0]||n,src:m.trans_img,"class":"emoticon "+n}));return k.cancel(t)})})}k.add(document,"click",x,C);k.add(e.getDoc(),"click",x,C);e.hideMenu=x;s=l.get(h+"_memoticons").style;s.left=o.x+"px";s.top=(o.y+y.target.clientHeight+2)+"px";s.display="block"}});function f(h){var n;i(m.emoticons,function(p,o){i(p,function(q){if(q==h){n=o;return false}});return !n});return n}e.onPreProcess.add(function(p,q){var n=q.node.getElementsByTagName("img"),h=[];i(n,function(o){h.push(o)});i(h,function(t){var o=e.dom.getAttr(t,"class");if(o&&o.indexOf("emoticon")!=-1){t.parentNode.replaceChild(e.getDoc().createTextNode(t.getAttribute("title")),t)}})});e.onSetContent.add(function(n,p){var h=[];d=p.content.replace(/(<\/?[^>]+>|:\/\/)/g,function(o){return o.replace(j,function(q){var t=f(q);if(t){h.push(q);return"�"+h.length+"�"}return q})});d=d.replace(j,function(o){return'<img src="'+m.trans_img+'" title="'+o+'" class="emoticon '+f(o)+'" />'});d=d.replace(/�([^�]+)�/g,function(q,o){return h[parseInt(o)-1]});p.content=d});e.onInit.add(function(){var h=e.dom;if(!m.skip_css){h.loadCSS(a.baseURL+"/plugins/emoticons/css/content.css")}k.add(e.getDoc(),"controlselect",function(n){if(h.getAttr(n.target,"class").indexOf("emoticon")!=-1){return k.cancel(n)}});if(b){k.add(e.getDoc(),"mousedown",function(n){if(h.getAttr(n.target,"class").indexOf("emoticon")!=-1){e.getDoc().execCommand("enableObjectResizing",false,false);return k.cancel(n)}else{e.getDoc().execCommand("enableObjectResizing",false,true)}});k.add(e.getDoc(),"keydown",function(u){var y=e.selection,v=y.getSel(),w=e.getDoc(),o=y.getRng(),x,p,q,t;x=o.startContainer;p=o.startOffset;if(x.nodeType==1){return}if(x){if(u.keyCode==39&&p==x.nodeValue.length){q=x.nextSibling;if(q&&q.nodeName=="IMG"){q=q.nextSibling;o=w.createRange();o.setStart(q,0);o.setEnd(q,0);v.removeAllRanges();v.addRange(o);return k.cancel(u)}}if(u.keyCode==37&&p==0){q=x.previousSibling;if(q&&q.nodeName=="IMG"){q=q.previousSibling;t=q.nodeValue.length;o=w.createRange();o.setStart(q,t);o.setEnd(q,t);v.removeAllRanges();v.addRange(o);return k.cancel(u)}}}})}k.add(e.getDoc(),"keypress",function(t){var p,x,o,w,v=e.getDoc(),u=e.selection,y=u.getSel(),n=u.getRng();function q(C){var B,A,z;if(!c){B=n.startContainer;A=n.startOffset;z=n.endOffset;if(A>0&&B.nodeType==3){return B.nodeValue.substring(Math.max(0,A+C),z)}}else{n=n.duplicate();n.moveStart("character",C);return n.text}}if(a.isOldWebKit||!m.auto_convert){return true}if(/(ttp|ftp):/i.test(q(-4))){return}o=q(-1);p=o+String.fromCharCode(t.charCode||t.keyCode);j.lastIndex=0;if(!o||!j.test(p)||w=="/"){return}if(x=f(p)){if(!c){n.setStart(n.startContainer,n.startOffset-1);y.removeAllRanges();y.addRange(n)}else{n=e.selection.getRng();n.moveStart("character",-1);n.select()}e.selection.setNode(h.create("img",{id:"emoticon",title:p,src:m.trans_img,"class":"emoticon "+x}));p=h.get("emoticon");h.setAttr(p,"id","");e.selection.select(p);e.selection.collapse(0);return k.cancel(t)}})});g(e.tools,{emoticons:{cmd:"mceEmoticons",title:a.I18n.emoticons}})};a.extend(a.I18n,{emoticons:"Insert emoticon"})})(punymce);
@@ -1,303 +0,0 @@
1
- (function(punymce) {
2
- punymce.plugins.Emoticons = function(ed) {
3
- var Event = punymce.Event, each, extend, isIE, isGecko, st, emoReg, DOM, h;
4
-
5
- each = punymce.each;
6
- extend = punymce.extend;
7
- isIE = punymce.isIE;
8
- isGecko = punymce.isGecko;
9
- DOM = punymce.DOM;
10
-
11
- // Default settings
12
- this.settings = st = extend({
13
- emoticons : {
14
- happy : [':)', '=)'],
15
- unhappy : [':|', '=|'],
16
- sad : [':(','=('],
17
- grin : [':D', '=D'],
18
- surprised : [':o',':O','=o', '=O'],
19
- wink : [';)'],
20
- halfhappy : [':/', '=/'],
21
- tongue : [':P', ':p', '=P', '=p'],
22
- lol : [':0'],
23
- mad : [':['],
24
- shocked : ['8|'],
25
- cool : ['B]']
26
- },
27
- row_length : 4,
28
- trans_img : punymce.baseURL + 'plugins/emoticons/img/trans.gif',
29
- skip_css : 0,
30
- auto_convert : 1
31
- }, ed.settings.emoticons);
32
-
33
- if (!st.skip_css)
34
- DOM.loadCSS(punymce.baseURL + '/plugins/emoticons/css/editor.css');
35
-
36
- // Build regexp from emoticons
37
- emoReg = '';
38
- each(st.emoticons, function(v) {
39
- each(v, function(v) {
40
- if (emoReg.length != 0)
41
- emoReg += '|';
42
-
43
- emoReg += v.replace(/([^a-zA-Z0-9])/g, '\\$1');
44
- });
45
- });
46
- emoReg = new RegExp(emoReg, 'g');
47
-
48
- // Add commands
49
- extend(ed.commands, {
50
- mceEmoticons : function(u, v, e) {
51
- var n, t = this, id = ed.settings.id, p = DOM.getPos(e.target), co, cb;
52
-
53
- if (ed.hideMenu)
54
- return ed.hideMenu();
55
-
56
- function hide(e) {
57
- ed.hideMenu = null;
58
- Event.remove(document, 'click', hide);
59
- Event.remove(ed.getDoc(), 'click', hide);
60
- DOM.get(id + '_memoticons').style.display = 'none';
61
- return 1;
62
- };
63
-
64
- n = DOM.get(id + '_memoticons');
65
- if (!n) {
66
- n = DOM.get(id + '_t');
67
- n = DOM.add(document.body, 'div', {id : id + '_memoticons', 'class' : 'punymce_emoticons punymce'});
68
- n = DOM.add(n, 'table', {'class' : 'punymce'});
69
- n = DOM.add(n, 'tbody');
70
- co = st.row_length;
71
- each(st.emoticons, function(c, k) {
72
- if (co == st.row_length) {
73
- r = DOM.add(n, 'tr');
74
- co = 0;
75
- }
76
-
77
- co++;
78
-
79
- Event.add(DOM.add(DOM.add(r, 'td'), 'a', {href : '#', 'class' : 'emoticon ' + k}), 'mousedown', function(e) {
80
- hide.call(t);
81
-
82
- ed.selection.setNode(ed.dom.create('img', { title : c[0] || k, src : st.trans_img, 'class' : 'emoticon ' + k }));
83
-
84
- return Event.cancel(e);
85
- });
86
- });
87
- }
88
-
89
- Event.add(document, 'click', hide, t);
90
- Event.add(ed.getDoc(), 'click', hide, t);
91
- ed.hideMenu = hide;
92
-
93
- s = DOM.get(id + '_memoticons').style;
94
- s.left = p.x + 'px';
95
- s.top = (p.y + e.target.clientHeight + 2) + 'px';
96
- s.display = 'block';
97
- }
98
- });
99
-
100
- function find(e) {
101
- var c;
102
-
103
- each(st.emoticons, function(v, k) {
104
- each(v, function(v) {
105
- if (v == e) {
106
- c = k;
107
- return false;
108
- }
109
- });
110
-
111
- return !c;
112
- });
113
-
114
- return c;
115
- };
116
-
117
- ed.onPreProcess.add(function(se, o) {
118
- var nl = o.node.getElementsByTagName('img'), a = [];
119
-
120
- each(nl, function(n) {
121
- a.push(n);
122
- });
123
-
124
- each(a, function(n) {
125
- var c = ed.dom.getAttr(n, 'class');
126
-
127
- if (c && c.indexOf('emoticon') != -1) {
128
- n.parentNode.replaceChild(ed.getDoc().createTextNode(n.getAttribute('title')), n);
129
- }
130
- });
131
- });
132
-
133
- ed.onSetContent.add(function(ed, o) {
134
- var ar = [];
135
-
136
- // Store away all tags and URL parts (://)
137
- h = o.content.replace(/(<\/?[^>]+>|:\/\/)/g, function(a) {
138
- return a.replace(emoReg, function(a) {
139
- var c = find(a);
140
-
141
- if (c) {
142
- ar.push(a);
143
- return '�' + ar.length + '�';
144
- }
145
-
146
- return a;
147
- });
148
- });
149
-
150
- // Replace emoticons in remaining text nodes
151
- h = h.replace(emoReg, function(a) {
152
- return '<img src="' + st.trans_img + '" title="' + a + '" class="emoticon ' + find(a) + '" />';
153
- });
154
-
155
- // Restore attribs
156
- h = h.replace(/�([^�]+)�/g, function(a, b) {
157
- return ar[parseInt(b) - 1];
158
- });
159
-
160
- o.content = h;
161
- });
162
-
163
- ed.onInit.add(function() {
164
- var DOM = ed.dom;
165
-
166
- if (!st.skip_css)
167
- DOM.loadCSS(punymce.baseURL + '/plugins/emoticons/css/content.css');
168
-
169
- // Disable selection on emoticons in IE
170
- Event.add(ed.getDoc(), 'controlselect', function(e) {
171
- if (DOM.getAttr(e.target, 'class').indexOf('emoticon') != -1)
172
- return Event.cancel(e);
173
- });
174
-
175
- if (isGecko) {
176
- // Disable selection of emoticons in Gecko
177
- Event.add(ed.getDoc(), 'mousedown', function(e) {
178
- if (DOM.getAttr(e.target, 'class').indexOf('emoticon') != -1) {
179
- ed.getDoc().execCommand('enableObjectResizing', false, false);
180
- return Event.cancel(e);
181
- } else
182
- ed.getDoc().execCommand('enableObjectResizing', false, true);
183
- });
184
-
185
- // Fix for bug: https://bugzilla.mozilla.org/show_bug.cgi?id=392569
186
- Event.add(ed.getDoc(), 'keydown', function(e) {
187
- var s = ed.selection, se = s.getSel(), d = ed.getDoc(), r = s.getRng(), sc, so, n, l;
188
-
189
- sc = r.startContainer;
190
- so = r.startOffset;
191
-
192
- // Element instead of text just pass it though
193
- if (sc.nodeType == 1)
194
- return;
195
-
196
- if (sc) {
197
- // Right key
198
- if (e.keyCode == 39 && so == sc.nodeValue.length) {
199
- n = sc.nextSibling;
200
- if (n && n.nodeName == 'IMG') {
201
- n = n.nextSibling;
202
-
203
- r = d.createRange();
204
- r.setStart(n, 0);
205
- r.setEnd(n, 0);
206
-
207
- se.removeAllRanges();
208
- se.addRange(r);
209
-
210
- return Event.cancel(e);
211
- }
212
- }
213
-
214
- // Left key
215
- if (e.keyCode == 37 && so == 0) {
216
- n = sc.previousSibling;
217
- if (n && n.nodeName == 'IMG') {
218
- n = n.previousSibling;
219
- l = n.nodeValue.length;
220
-
221
- r = d.createRange();
222
- r.setStart(n, l);
223
- r.setEnd(n, l);
224
-
225
- se.removeAllRanges();
226
- se.addRange(r);
227
-
228
- return Event.cancel(e);
229
- }
230
- }
231
- }
232
- });
233
- }
234
-
235
- Event.add(ed.getDoc(), 'keypress', function(e) {
236
- var em, cls, lc, lc2, d = ed.getDoc(), se = ed.selection, s = se.getSel(), r = se.getRng();
237
-
238
- function getStr(pos) {
239
- var sn, so, eo;
240
-
241
- if (!isIE) {
242
- sn = r.startContainer;
243
- so = r.startOffset;
244
- eo = r.endOffset;
245
-
246
- if (so > 0 && sn.nodeType == 3)
247
- return sn.nodeValue.substring(Math.max(0, so + pos), eo);
248
- } else {
249
- r = r.duplicate();
250
- r.moveStart('character', pos);
251
-
252
- return r.text;
253
- }
254
- };
255
-
256
- // Check if Safari 2.x
257
- if (punymce.isOldWebKit || !st.auto_convert)
258
- return true;
259
-
260
- // If http/ftp
261
- if (/(ttp|ftp):/i.test(getStr(-4)))
262
- return;
263
-
264
- lc = getStr(-1);
265
- em = lc + String.fromCharCode(e.charCode || e.keyCode);
266
- emoReg.lastIndex = 0;
267
-
268
- if (!lc || !emoReg.test(em) || lc2 == '/')
269
- return;
270
-
271
- if (cls = find(em)) {
272
- if (!isIE) {
273
- r.setStart(r.startContainer, r.startOffset - 1);
274
- s.removeAllRanges();
275
- s.addRange(r);
276
- } else {
277
- r = ed.selection.getRng();
278
- r.moveStart('character', -1);
279
- r.select();
280
- }
281
-
282
- ed.selection.setNode(DOM.create('img', { id : 'emoticon', title : em, src : st.trans_img, 'class' : 'emoticon ' + cls }));
283
-
284
- em = DOM.get('emoticon');
285
- DOM.setAttr(em, 'id', '');
286
- ed.selection.select(em);
287
- ed.selection.collapse(0);
288
-
289
- return Event.cancel(e);
290
- }
291
- });
292
- });
293
-
294
- extend(ed.tools, {
295
- emoticons : {cmd : 'mceEmoticons', title : punymce.I18n.emoticons}
296
- });
297
- };
298
-
299
- // English i18n strings
300
- punymce.extend(punymce.I18n, {
301
- emoticons : 'Insert emoticon'
302
- });
303
- })(punymce);
@@ -1 +0,0 @@
1
- (function(a){a.plugins.Entities=function(e){var j,c,h="",b={},f,d,g;j=e.settings;j.entities="named";g=j.entity_list;if(!g){g="160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro"}c=g.split(",");for(f=0;f<c.length;f+=2){b[String.fromCharCode(c[f])]=c[f+1];d=parseInt(c[f]).toString(16);h+="\\u"+"0000".substring(d.length)+d}h=new RegExp("["+h+"]","g");e.onGetContent.add(function(i,k){if(k.format=="html"){k.content=k.content.replace(h,function(l){var m;if(m=b[l]){l="&"+m+";"}return l})}})}})(punymce);
@@ -1,37 +0,0 @@
1
- (function(punymce) {
2
- punymce.plugins.Entities = function(ed) {
3
- var s, a, re = '', l = {}, i, v, el;
4
-
5
- s = ed.settings;
6
-
7
- // Force named
8
- s.entities = 'named';
9
- el = s.entity_list;
10
-
11
- if (!el)
12
- el = '160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,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,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro';
13
-
14
- // Build regex and lookup array
15
- a = el.split(',');
16
- for (i=0; i<a.length; i+=2) {
17
- l[String.fromCharCode(a[i])] = a[i + 1];
18
-
19
- v = parseInt(a[i]).toString(16);
20
- re += '\\u' + '0000'.substring(v.length) + v;
21
- }
22
- re = new RegExp('[' + re + ']', 'g');
23
-
24
- ed.onGetContent.add(function(ed, o) {
25
- if (o.format == 'html') {
26
- o.content = o.content.replace(re, function(a) {
27
- var v;
28
-
29
- if (v = l[a])
30
- a = '&' + v + ';';
31
-
32
- return a;
33
- });
34
- }
35
- });
36
- };
37
- })(punymce);