glebtv-ckeditor 4.4.3.4 → 4.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ckeditor/override.js.erb +1 -1
  3. data/lib/ckeditor/version.rb +1 -1
  4. data/vendor/assets/javascripts/ckeditor/build-config.js +12 -8
  5. data/vendor/assets/javascripts/ckeditor/ckeditor.js +674 -658
  6. data/vendor/assets/javascripts/ckeditor/config.js +2 -2
  7. data/vendor/assets/javascripts/ckeditor/lang/en.js +2 -2
  8. data/vendor/assets/javascripts/ckeditor/lang/ru.js +2 -2
  9. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +1 -1
  10. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
  11. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
  12. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
  13. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
  14. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
  15. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
  16. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
  17. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +142 -94
  18. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +5 -1
  19. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +3 -0
  20. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +4 -1
  21. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +4 -2
  22. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +2 -0
  23. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +2 -0
  24. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +2 -0
  25. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +2 -0
  26. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +2 -0
  27. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +13 -15
  28. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +1 -1
  29. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +2 -0
  30. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +2 -0
  31. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +3 -0
  32. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +2 -0
  33. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +2 -0
  34. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +2 -0
  35. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +2 -0
  36. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +2 -0
  37. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +3 -5
  38. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +2 -0
  39. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +2 -0
  40. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +2 -0
  41. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +2 -0
  42. data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +2 -0
  43. data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  44. data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  45. data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  46. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +31 -31
  47. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
  48. data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
  49. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
  50. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png +0 -0
  51. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon-rtl.png +0 -0
  52. data/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png +0 -0
  53. data/vendor/assets/javascripts/ckeditor/plugins/map/plugin.js +0 -0
  54. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +7 -7
  55. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +16 -16
  56. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  57. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  58. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  59. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  60. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  61. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  62. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  63. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  64. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  65. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  66. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  67. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  68. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png +0 -0
  69. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  70. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png +0 -0
  71. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  72. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png +0 -0
  73. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  74. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png +0 -0
  75. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png +0 -0
  76. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png +0 -0
  77. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  78. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
  79. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png +0 -0
  80. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  81. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png +0 -0
  82. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
  83. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png +0 -0
  84. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  85. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png +0 -0
  86. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  87. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png +0 -0
  88. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  89. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png +0 -0
  90. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  91. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png +0 -0
  92. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  93. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png +0 -0
  94. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  95. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png +0 -0
  96. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  97. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png +0 -0
  98. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  99. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png +0 -0
  100. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  101. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png +0 -0
  102. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
  103. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png +0 -0
  104. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  105. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  106. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png +0 -0
  107. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  108. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png +0 -0
  109. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +152 -163
  110. data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +1 -1
  111. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +68 -68
  112. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +5 -4
  113. data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +2 -1
  114. data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +34 -10
  115. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +5 -0
  116. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +5 -0
  117. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +5 -0
  118. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +5 -0
  119. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -0
  120. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +5 -0
  121. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +5 -0
  122. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +5 -0
  123. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +5 -0
  124. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +5 -0
  125. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +5 -0
  126. data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
  127. data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
  128. data/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png +0 -0
  129. data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
  130. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
  131. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
  132. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
  133. data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
  134. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
  135. data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
  136. data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
  137. metadata +16 -96
  138. data/test/dummy/log/test.log +0 -301
  139. data/test/dummy/tmp/cache/assets/test/sprockets/0ff571a66f03f4c98305b82fbc097934 +0 -0
  140. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  141. data/test/dummy/tmp/cache/assets/test/sprockets/1c2a2034cd1d6490a47e1f2b22a328f3 +0 -0
  142. data/test/dummy/tmp/cache/assets/test/sprockets/233a499dd1009ab5b2a8040346715629 +0 -0
  143. data/test/dummy/tmp/cache/assets/test/sprockets/2a79c1fcf4595c4bfb3a1e77a732b9e9 +0 -0
  144. data/test/dummy/tmp/cache/assets/test/sprockets/2bb1e656d1d1c20542dd47020608ce4b +0 -0
  145. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  146. data/test/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  147. data/test/dummy/tmp/cache/assets/test/sprockets/3c088129885aa2261da0ab21707aa851 +0 -0
  148. data/test/dummy/tmp/cache/assets/test/sprockets/5296ab0e7196335ed50f33e398de0470 +0 -0
  149. data/test/dummy/tmp/cache/assets/test/sprockets/62133d9323b94de8b0cd2a3e490e0374 +0 -0
  150. data/test/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  151. data/test/dummy/tmp/cache/assets/test/sprockets/70f2d021b0f59639252116032aa12a5d +0 -0
  152. data/test/dummy/tmp/cache/assets/test/sprockets/73eff3be45044b7438486d533547c02c +0 -0
  153. data/test/dummy/tmp/cache/assets/test/sprockets/7869bf4c6f26bcd697a78ffd20655de5 +0 -0
  154. data/test/dummy/tmp/cache/assets/test/sprockets/88d81ff5585179f4acb7ba76bdcb1244 +0 -0
  155. data/test/dummy/tmp/cache/assets/test/sprockets/990c65e42e2a681340e62644dd07782b +0 -0
  156. data/test/dummy/tmp/cache/assets/test/sprockets/aaf14684bcb6dafb17154d27c3d5a5de +0 -0
  157. data/test/dummy/tmp/cache/assets/test/sprockets/b2141ea733727ae31693b5129d431629 +0 -0
  158. data/test/dummy/tmp/cache/assets/test/sprockets/c1469bfe5d5645440961cc1e8fd48120 +0 -0
  159. data/test/dummy/tmp/cache/assets/test/sprockets/c479f0465142b7c9c5a9c58a256335d7 +0 -0
  160. data/test/dummy/tmp/cache/assets/test/sprockets/c73d53992216d52410b542dce76742ad +0 -0
  161. data/test/dummy/tmp/cache/assets/test/sprockets/c7476f60577593bf79ca5b6334b86903 +0 -0
  162. data/test/dummy/tmp/cache/assets/test/sprockets/cb4a5e7fc592c6023ed2acc5953b4685 +0 -0
  163. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  164. data/test/dummy/tmp/cache/assets/test/sprockets/d7e7d3b3729ff516f81682711ea8a53a +0 -0
  165. data/test/dummy/tmp/cache/assets/test/sprockets/d9b8613a01ff7c7d9fe1a6b7cd5497ff +0 -0
  166. data/test/dummy/tmp/cache/assets/test/sprockets/e4513c04c145290b038978a8f471d244 +0 -0
  167. data/test/dummy/tmp/cache/assets/test/sprockets/e65823156ac3891c4779224e828d4877 +0 -0
  168. data/test/dummy/tmp/cache/assets/test/sprockets/f20469686afebc55828d93a978e5ff20 +0 -0
  169. data/test/dummy/tmp/cache/assets/test/sprockets/f24d6c64fd96102c27c1f10e82ebf864 +0 -0
  170. data/test/dummy/tmp/cache/assets/test/sprockets/f33022711bcfc1cae3955a1de79fe280 +0 -0
  171. data/test/dummy/tmp/cache/assets/test/sprockets/f69b1a9a1323d97109283e5bd378c23d +0 -0
  172. data/test/tmp/app/models/ckeditor/asset.rb +0 -5
  173. data/test/tmp/app/models/ckeditor/attachment_file.rb +0 -12
  174. data/test/tmp/app/models/ckeditor/picture.rb +0 -13
  175. data/test/tmp/config/initializers/ckeditor.rb +0 -26
  176. data/test/tmp/config/routes.rb +0 -5
  177. data/vendor/assets/javascripts/ckeditor/README.md +0 -39
  178. data/vendor/assets/javascripts/ckeditor/plugins/scayt/README.md +0 -25
  179. data/vendor/assets/javascripts/ckeditor/plugins/wsc/README.md +0 -25
  180. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css.scss +0 -771
  181. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css.scss +0 -812
  182. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css.scss +0 -844
  183. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css.scss +0 -825
  184. data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css.scss +0 -816
  185. data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css.scss +0 -2133
  186. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css.scss +0 -2142
  187. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css.scss +0 -2191
  188. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css.scss +0 -2359
  189. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css.scss +0 -2203
  190. data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css.scss +0 -2251
  191. data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +0 -51
@@ -1,17 +1,17 @@
1
1
  CKEDITOR.dialog.add("scaytDialog",function(f){var g=f.scayt,k='<p><img src="'+g.getLogo()+'" /></p><p>'+g.getLocal("version")+g.getVersion()+"</p><p>"+g.getLocal("text_copyrights")+"</p>",l=CKEDITOR.document,i={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:g.getLang(),newLang:null,reset:function(){this.currentLang=g.getLang();this.newLang=null},id:"lang"},k=[{id:"options",label:g.getLocal("tab_options"),onShow:function(){},elements:[{type:"vbox",
2
- id:"scaytOptions",children:function(){var a=g.getApplicationConfig(),e=[],b={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},d;for(d in a){var c={type:"checkbox"};c.id=d;c.label=g.getLocal(b[d]);e.push(c)}return e}(),onShow:function(){this.getChild();for(var a=f.scayt,e=0;e<this.getChild().length;e++)this.getChild()[e].setValue(a.getApplicationConfig()[this.getChild()[e].id])}}]},
3
- {id:"langs",label:g.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;",html:'<form><div style="float:left;width:45%;margin-left:5px;" id="left-col-'+f.name+'"></div><div style="float:left;width:45%;margin-left:15px;" id="right-col-'+f.name+'"></div></form>',onShow:function(){var a=f.scayt.getLang();l.getById("scaytLang_"+a).$.checked=!0}}]}]},{id:"dictionaries",label:g.getLocal("tab_dictionaries"),
4
- elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:g.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(a){var e=a.sender,b=f.scayt;setTimeout(function(){e.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=b.getUserDictionaryName()&&""!=b.getUserDictionaryName()&&e.getContentElement("dictionaries","dictionaryName").setValue(b.getUserDictionaryName())},0)}},{type:"hbox",
5
- id:"notExistDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"createDic",label:g.getLocal("btn_createDic"),title:g.getLocal("btn_createDic"),onClick:function(){var a=this.getDialog(),e=j,b=f.scayt,d=a.getContentElement("dictionaries","dictionaryName").getValue();b.createUserDictionary(d,function(c){c.error||e.toggleDictionaryButtons.call(a,!0);c.dialog=a;c.command="create";c.name=d;f.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="create";
6
- c.name=d;f.fire("scaytUserDictionaryActionError",c)})}},{type:"button",id:"restoreDic",label:g.getLocal("btn_restoreDic"),title:g.getLocal("btn_restoreDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=j,d=a.getContentElement("dictionaries","dictionaryName").getValue();e.restoreUserDictionary(d,function(c){c.dialog=a;c.error||b.toggleDictionaryButtons.call(a,!0);c.command="restore";c.name=d;f.fire("scaytUserDictionaryAction",c)},function(c){c.dialog=a;c.command="restore";c.name=d;f.fire("scaytUserDictionaryActionError",
7
- c)})}}]},{type:"hbox",id:"existDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"removeDic",label:g.getLocal("btn_deleteDic"),title:g.getLocal("btn_deleteDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=j,d=a.getContentElement("dictionaries","dictionaryName"),c=d.getValue();e.removeUserDictionary(c,function(e){d.setValue("");e.error||b.toggleDictionaryButtons.call(a,!1);e.dialog=a;e.command="remove";e.name=c;f.fire("scaytUserDictionaryAction",e)},function(b){b.dialog=
8
- a;b.command="remove";b.name=c;f.fire("scaytUserDictionaryActionError",b)})}},{type:"button",id:"renameDic",label:g.getLocal("btn_renameDic"),title:g.getLocal("btn_renameDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,b=a.getContentElement("dictionaries","dictionaryName").getValue();e.renameUserDictionary(b,function(d){d.dialog=a;d.command="rename";d.name=b;f.fire("scaytUserDictionaryAction",d)},function(d){d.dialog=a;d.command="rename";d.name=b;f.fire("scaytUserDictionaryActionError",d)})}}]},
9
- {type:"html",id:"dicInfo",html:'<div id="dic_info_editor1" style="margin:5px auto; width:95%;white-space:normal;">'+g.getLocal("text_descriptionDic")+"</div>"}]}]},{id:"about",label:g.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'<div><div id="scayt_about_">'+k+"</div></div>"}]}];f.on("scaytUserDictionaryAction",function(a){var e=a.data.dialog,b=e.getContentElement("dictionaries","dictionaryNote").getElement(),d=a.editor.scayt,c;void 0===a.data.error?(c=d.getLocal("message_success_"+
10
- a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c),SCAYT.$(b.$).css({color:"blue"})):(""===a.data.name?b.setText(d.getLocal("message_info_emptyDic")):(c=d.getLocal("message_error_"+a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c)),SCAYT.$(b.$).css({color:"red"}),null!=d.getUserDictionaryName()&&""!=d.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(d.getUserDictionaryName()):e.getContentElement("dictionaries","dictionaryName").setValue(""))});
11
- f.on("scaytUserDictionaryActionError",function(a){var e=a.data.dialog,b=e.getContentElement("dictionaries","dictionaryNote").getElement(),d=a.editor.scayt,c;""===a.data.name?b.setText(d.getLocal("message_info_emptyDic")):(c=d.getLocal("message_error_"+a.data.command+"Dic"),c=c.replace("%s",a.data.name),b.setText(c));SCAYT.$(b.$).css({color:"red"});null!=d.getUserDictionaryName()&&""!=d.getUserDictionaryName()?e.getContentElement("dictionaries","dictionaryName").setValue(d.getUserDictionaryName()):
12
- e.getContentElement("dictionaries","dictionaryName").setValue("")});var j={title:g.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:340,minHeight:260,onLoad:function(){if(0!=f.config.scayt_uiTabs[1]){var a=j,e=a.getLangBoxes.call(this);e.getParent().setStyle("white-space","normal");a.renderLangList(e);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){i.reset()},onHide:function(){f.unlockSelection()},
13
- onShow:function(){f.fire("scaytDialogShown",this);if(0!=f.config.scayt_uiTabs[2]){var a=f.scayt,e=this.getContentElement("dictionaries","dictionaryName"),b=this.getContentElement("dictionaries","existDic").getElement().getParent(),d=this.getContentElement("dictionaries","notExistDic").getElement().getParent();b.hide();d.hide();null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?(this.getContentElement("dictionaries","dictionaryName").setValue(a.getUserDictionaryName()),b.show()):(e.setValue(""),
14
- d.show())}},onOk:function(){var a=j,e=f.scayt;this.getContentElement("options","scaytOptions");a=a.getChangedOption.call(this);e.commitOption({changedOptions:a})},toggleDictionaryButtons:function(a){var e=this.getContentElement("dictionaries","existDic").getElement().getParent(),b=this.getContentElement("dictionaries","notExistDic").getElement().getParent();a?(e.show(),b.hide()):(e.hide(),b.show())},getChangedOption:function(){var a={};if(1==f.config.scayt_uiTabs[0])for(var e=this.getContentElement("options",
15
- "scaytOptions").getChild(),b=0;b<e.length;b++)e[b].isChanged()&&(a[e[b].id]=e[b].getValue());i.isChanged()&&(a[i.id]=f.config.scayt_sLang=i.currentLang=i.newLang);return a},buildRadioInputs:function(a,e){var b=new CKEDITOR.dom.element("div");CKEDITOR.document.createElement("div");var d="scaytLang_"+e,c=CKEDITOR.dom.element.createFromHtml('<input id="'+d+'" type="radio" value="'+e+'" name="scayt_lang" />'),g=new CKEDITOR.dom.element("label"),h=f.scayt;b.setStyles({"white-space":"normal",position:"relative"});
16
- c.on("click",function(a){i.newLang=a.sender.getValue()});g.appendText(a);g.setAttribute("for",d);b.append(c);b.append(g);e===h.getLang()&&(c.setAttribute("checked",!0),c.setAttribute("defaultChecked","defaultChecked"));return b},renderLangList:function(a){var e=a.find("#left-col-"+f.name).getItem(0),a=a.find("#right-col-"+f.name).getItem(0),b=g.getLangList(),d={},c=[],i=0,h;for(h in b.ltr)d[h]=b.ltr[h];for(h in b.rtl)d[h]=b.rtl[h];for(h in d)c.push([h,d[h]]);c.sort(function(a,b){var c=0;a[1]>b[1]?
17
- c=1:a[1]<b[1]&&(c=-1);return c});d={};for(b=0;b<c.length;b++)d[c[b][0]]=c[b][1];c=Math.round(c.length/2);for(h in d)i++,this.buildRadioInputs(d[h],h).appendTo(i<=c?e:a)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},contents:function(a,e){var b=[],d=e.config.scayt_uiTabs;if(d){for(var c in d)1==d[c]&&b.push(a[c]);b.push(a[a.length-1])}else return a;return b}(k,f)};return j});
2
+ id:"scaytOptions",children:function(){var a=g.getApplicationConfig(),e=[],c={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},d;for(d in a){var b={type:"checkbox"};b.id=d;b.label=g.getLocal(c[d]);e.push(b)}return e}(),onShow:function(){this.getChild();for(var a=f.scayt,e=0;e<this.getChild().length;e++)this.getChild()[e].setValue(a.getApplicationConfig()[this.getChild()[e].id])}}]},
3
+ {id:"langs",label:g.getLocal("tab_languages"),elements:[{id:"leftLangColumn",type:"vbox",align:"left",widths:["100"],children:[{type:"html",id:"langBox",style:"overflow: hidden; white-space: normal;",html:'<div><div style="float:left;width:45%;margin-left:5px;" id="left-col-'+f.name+'"></div><div style="float:left;width:45%;margin-left:15px;" id="right-col-'+f.name+'"></div></div>',onShow:function(){var a=f.scayt.getLang();l.getById("scaytLang_"+a).$.checked=!0}}]}]},{id:"dictionaries",label:g.getLocal("tab_dictionaries"),
4
+ elements:[{type:"vbox",id:"rightCol_col__left",children:[{type:"html",id:"dictionaryNote",html:""},{type:"text",id:"dictionaryName",label:g.getLocal("label_fieldNameDic")||"Dictionary name",onShow:function(a){var e=a.sender,c=f.scayt;setTimeout(function(){e.getContentElement("dictionaries","dictionaryNote").getElement().setText("");null!=c.getUserDictionaryName()&&""!=c.getUserDictionaryName()&&e.getContentElement("dictionaries","dictionaryName").setValue(c.getUserDictionaryName())},0)}},{type:"hbox",
5
+ id:"notExistDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"createDic",label:g.getLocal("btn_createDic"),title:g.getLocal("btn_createDic"),onClick:function(){var a=this.getDialog(),e=j,c=f.scayt,d=a.getContentElement("dictionaries","dictionaryName").getValue();c.createUserDictionary(d,function(b){b.error||e.toggleDictionaryButtons.call(a,!0);b.dialog=a;b.command="create";b.name=d;f.fire("scaytUserDictionaryAction",b)},function(b){b.dialog=a;b.command="create";
6
+ b.name=d;f.fire("scaytUserDictionaryActionError",b)})}},{type:"button",id:"restoreDic",label:g.getLocal("btn_restoreDic"),title:g.getLocal("btn_restoreDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,c=j,d=a.getContentElement("dictionaries","dictionaryName").getValue();e.restoreUserDictionary(d,function(b){b.dialog=a;b.error||c.toggleDictionaryButtons.call(a,!0);b.command="restore";b.name=d;f.fire("scaytUserDictionaryAction",b)},function(b){b.dialog=a;b.command="restore";b.name=d;f.fire("scaytUserDictionaryActionError",
7
+ b)})}}]},{type:"hbox",id:"existDic",align:"left",style:"width:auto;",widths:["50%","50%"],children:[{type:"button",id:"removeDic",label:g.getLocal("btn_deleteDic"),title:g.getLocal("btn_deleteDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,c=j,d=a.getContentElement("dictionaries","dictionaryName"),b=d.getValue();e.removeUserDictionary(b,function(e){d.setValue("");e.error||c.toggleDictionaryButtons.call(a,!1);e.dialog=a;e.command="remove";e.name=b;f.fire("scaytUserDictionaryAction",e)},function(c){c.dialog=
8
+ a;c.command="remove";c.name=b;f.fire("scaytUserDictionaryActionError",c)})}},{type:"button",id:"renameDic",label:g.getLocal("btn_renameDic"),title:g.getLocal("btn_renameDic"),onClick:function(){var a=this.getDialog(),e=f.scayt,c=a.getContentElement("dictionaries","dictionaryName").getValue();e.renameUserDictionary(c,function(d){d.dialog=a;d.command="rename";d.name=c;f.fire("scaytUserDictionaryAction",d)},function(d){d.dialog=a;d.command="rename";d.name=c;f.fire("scaytUserDictionaryActionError",d)})}}]},
9
+ {type:"html",id:"dicInfo",html:'<div id="dic_info_editor1" style="margin:5px auto; width:95%;white-space:normal;">'+g.getLocal("text_descriptionDic")+"</div>"}]}]},{id:"about",label:g.getLocal("tab_about"),elements:[{type:"html",id:"about",style:"margin: 5px 5px;",html:'<div><div id="scayt_about_">'+k+"</div></div>"}]}];f.on("scaytUserDictionaryAction",function(a){var e=SCAYT.prototype.UILib,c=a.data.dialog,d=c.getContentElement("dictionaries","dictionaryNote").getElement(),b=a.editor.scayt,f;void 0===
10
+ a.data.error?(f=b.getLocal("message_success_"+a.data.command+"Dic"),f=f.replace("%s",a.data.name),d.setText(f),e.css(d.$,{color:"blue"})):(""===a.data.name?d.setText(b.getLocal("message_info_emptyDic")):(f=b.getLocal("message_error_"+a.data.command+"Dic"),f=f.replace("%s",a.data.name),d.setText(f)),e.css(d.$,{color:"red"}),null!=b.getUserDictionaryName()&&""!=b.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(b.getUserDictionaryName()):c.getContentElement("dictionaries",
11
+ "dictionaryName").setValue(""))});f.on("scaytUserDictionaryActionError",function(a){var e=SCAYT.prototype.UILib,c=a.data.dialog,d=c.getContentElement("dictionaries","dictionaryNote").getElement(),b=a.editor.scayt,f;""===a.data.name?d.setText(b.getLocal("message_info_emptyDic")):(f=b.getLocal("message_error_"+a.data.command+"Dic"),f=f.replace("%s",a.data.name),d.setText(f));e.css(d.$,{color:"red"});null!=b.getUserDictionaryName()&&""!=b.getUserDictionaryName()?c.getContentElement("dictionaries","dictionaryName").setValue(b.getUserDictionaryName()):
12
+ c.getContentElement("dictionaries","dictionaryName").setValue("")});var j={title:g.getLocal("text_title"),resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:340,minHeight:260,onLoad:function(){if(0!=f.config.scayt_uiTabs[1]){var a=j,e=a.getLangBoxes.call(this);e.getParent().setStyle("white-space","normal");a.renderLangList(e);this.definition.minWidth=this.getSize().width;this.resize(this.definition.minWidth,this.definition.minHeight)}},onCancel:function(){i.reset()},onHide:function(){f.unlockSelection()},
13
+ onShow:function(){f.fire("scaytDialogShown",this);if(0!=f.config.scayt_uiTabs[2]){var a=f.scayt,e=this.getContentElement("dictionaries","dictionaryName"),c=this.getContentElement("dictionaries","existDic").getElement().getParent(),d=this.getContentElement("dictionaries","notExistDic").getElement().getParent();c.hide();d.hide();null!=a.getUserDictionaryName()&&""!=a.getUserDictionaryName()?(this.getContentElement("dictionaries","dictionaryName").setValue(a.getUserDictionaryName()),c.show()):(e.setValue(""),
14
+ d.show())}},onOk:function(){var a=j,e=f.scayt;this.getContentElement("options","scaytOptions");a=a.getChangedOption.call(this);e.commitOption({changedOptions:a})},toggleDictionaryButtons:function(a){var e=this.getContentElement("dictionaries","existDic").getElement().getParent(),c=this.getContentElement("dictionaries","notExistDic").getElement().getParent();a?(e.show(),c.hide()):(e.hide(),c.show())},getChangedOption:function(){var a={};if(1==f.config.scayt_uiTabs[0])for(var e=this.getContentElement("options",
15
+ "scaytOptions").getChild(),c=0;c<e.length;c++)e[c].isChanged()&&(a[e[c].id]=e[c].getValue());i.isChanged()&&(a[i.id]=f.config.scayt_sLang=i.currentLang=i.newLang);return a},buildRadioInputs:function(a,e){var c=new CKEDITOR.dom.element("div");CKEDITOR.document.createElement("div");var d="scaytLang_"+e,b=CKEDITOR.dom.element.createFromHtml('<input id="'+d+'" type="radio" value="'+e+'" name="scayt_lang" />'),g=new CKEDITOR.dom.element("label"),h=f.scayt;c.setStyles({"white-space":"normal",position:"relative",
16
+ "padding-bottom":"2px"});b.on("click",function(a){i.newLang=a.sender.getValue()});g.appendText(a);g.setAttribute("for",d);c.append(b);c.append(g);e===h.getLang()&&(b.setAttribute("checked",!0),b.setAttribute("defaultChecked","defaultChecked"));return c},renderLangList:function(a){var e=a.find("#left-col-"+f.name).getItem(0),a=a.find("#right-col-"+f.name).getItem(0),c=g.getLangList(),d={},b=[],i=0,h;for(h in c.ltr)d[h]=c.ltr[h];for(h in c.rtl)d[h]=c.rtl[h];for(h in d)b.push([h,d[h]]);b.sort(function(a,
17
+ c){var b=0;a[1]>c[1]?b=1:a[1]<c[1]&&(b=-1);return b});d={};for(c=0;c<b.length;c++)d[b[c][0]]=b[c][1];b=Math.round(b.length/2);for(h in d)i++,this.buildRadioInputs(d[h],h).appendTo(i<=b?e:a)},getLangBoxes:function(){return this.getContentElement("langs","langBox").getElement()},contents:function(a,e){var c=[],d=e.config.scayt_uiTabs;if(d){for(var b in d)1==d[b]&&c.push(a[b]);c.push(a[a.length-1])}else return a;return c}(k,f)};return j});
@@ -1,163 +1,152 @@
1
- /**
2
- * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or http://ckeditor.com/license
4
- */
5
-
6
- /**
7
- * @fileOverview stylesheetParser plugin.
8
- */
9
-
10
- ( function() {
11
- // We want to extract only the elements with classes defined in the stylesheets:
12
- function parseClasses( aRules, skipSelectors, validSelectors ) {
13
- // aRules are just the different rules in the style sheets
14
- // We want to merge them and them split them by commas, so we end up with only
15
- // the selectors
16
- var s = aRules.join( ' ' );
17
- // Remove selectors splitting the elements, leave only the class selector (.)
18
- s = s.replace( /(,|>|\+|~)/g, ' ' );
19
- // Remove attribute selectors: table[border="0"]
20
- s = s.replace( /\[[^\]]*/g, '' );
21
- // Remove Ids: div#main
22
- s = s.replace( /#[^\s]*/g, '' );
23
- // Remove pseudo-selectors and pseudo-elements: :hover :nth-child(2n+1) ::before
24
- s = s.replace( /\:{1,2}[^\s]*/g, '' );
25
-
26
- s = s.replace( /\s+/g, ' ' );
27
-
28
- var aSelectors = s.split( ' ' ),
29
- aClasses = [];
30
-
31
- for ( var i = 0; i < aSelectors.length; i++ ) {
32
- var selector = aSelectors[ i ];
33
-
34
- if ( validSelectors.test( selector ) && !skipSelectors.test( selector ) ) {
35
- // If we still don't know about this one, add it
36
- if ( CKEDITOR.tools.indexOf( aClasses, selector ) == -1 )
37
- aClasses.push( selector );
38
- }
39
- }
40
-
41
- return aClasses;
42
- }
43
-
44
- function LoadStylesCSS( theDoc, skipSelectors, validSelectors ) {
45
- var styles = [],
46
- // It will hold all the rules of the applied stylesheets (except those internal to CKEditor)
47
- aRules = [],
48
- i;
49
-
50
- for ( i = 0; i < theDoc.styleSheets.length; i++ ) {
51
- var sheet = theDoc.styleSheets[ i ],
52
- node = sheet.ownerNode || sheet.owningElement;
53
-
54
- // Skip the internal stylesheets
55
- if ( node.getAttribute( 'data-cke-temp' ) )
56
- continue;
57
-
58
- // Exclude stylesheets injected by extensions
59
- if ( sheet.href && sheet.href.substr( 0, 9 ) == 'chrome://' )
60
- continue;
61
-
62
- // Bulletproof with x-domain content stylesheet.
63
- try {
64
- var sheetRules = sheet.cssRules || sheet.rules;
65
- for ( var j = 0; j < sheetRules.length; j++ )
66
- aRules.push( sheetRules[ j ].selectorText );
67
- } catch ( e ) {
68
- if (window.console)
69
- console.log(e);
70
- }
71
- }
72
-
73
- var aClasses = parseClasses( aRules, skipSelectors, validSelectors );
74
-
75
- // Add each style to our "Styles" collection.
76
- for ( i = 0; i < aClasses.length; i++ ) {
77
- var oElement = aClasses[ i ].split( '.' ),
78
- element = oElement[ 0 ].toLowerCase(),
79
- sClassName = oElement[ 1 ];
80
-
81
- styles.push( {
82
- name: element + '.' + sClassName,
83
- element: element,
84
- attributes: { 'class': sClassName }
85
- } );
86
- }
87
-
88
- return styles;
89
- }
90
-
91
- // Register a plugin named "stylesheetparser".
92
- CKEDITOR.plugins.add( 'stylesheetparser', {
93
- init: function( editor ) {
94
- // Stylesheet parser is incompatible with filter (#10136).
95
- editor.filter.disable();
96
-
97
- var timer;
98
-
99
- editor.on( 'mode', function( e )
100
- {
101
- // If there was a timeout pending, cancel it
102
- if ( timer )
103
- window.clearTimeout( timer );
104
- timer = null;
105
-
106
- if ( editor.mode != 'wysiwyg' )
107
- return;
108
-
109
- // Use a delay before parsing the stylesheet to avoid errors with Firefox 4. #7784
110
- // Safari requires even greater delay
111
- timer = window.setTimeout( function() {
112
- editor.getStylesSet( function( definitions )
113
- {
114
- // Rules that must be skipped
115
- var skipSelectors = editor.config.stylesheetParser_skipSelectors || ( /(^body\.|^\.)/i ),
116
- // Rules that are valid
117
- validSelectors = editor.config.stylesheetParser_validSelectors || ( /\w+\.\w+/ );
118
-
119
- // Add the styles found in the document
120
- editor._.stylesDefinitions = definitions.concat( LoadStylesCSS( editor.document.$, skipSelectors, validSelectors ) );
121
-
122
- // Refresh the styles combo
123
- var combo = editor.ui.items.Styles;
124
- combo && combo.reset();
125
-
126
- editor.fire( 'stylesSet', { styles: editor._.stylesDefinitions } );
127
- } );
128
- }, 1000 );
129
- });
130
-
131
- }
132
- } );
133
- } )();
134
-
135
-
136
- /**
137
- * A regular expression that defines whether a CSS rule will be
138
- * skipped by the Stylesheet Parser plugin. A CSS rule matching
139
- * the regular expression will be ignored and will not be available
140
- * in the Styles drop-down list.
141
- *
142
- * // Ignore rules for body and caption elements, classes starting with "high", and any class defined for no specific element.
143
- * config.stylesheetParser_skipSelectors = /(^body\.|^caption\.|\.high|^\.)/i;
144
- *
145
- * @since 3.6
146
- * @cfg {RegExp} [stylesheetParser_skipSelectors=/(^body\.|^\.)/i]
147
- * @member CKEDITOR.config
148
- * @see CKEDITOR.config#stylesheetParser_validSelectors
149
- */
150
-
151
- /**
152
- * A regular expression that defines which CSS rules will be used
153
- * by the Stylesheet Parser plugin. A CSS rule matching the regular
154
- * expression will be available in the Styles drop-down list.
155
- *
156
- * // Only add rules for p and span elements.
157
- * config.stylesheetParser_validSelectors = /\^(p|span)\.\w+/;
158
- *
159
- * @since 3.6
160
- * @cfg {RegExp} [stylesheetParser_validSelectors=/\w+\.\w+/]
161
- * @member CKEDITOR.config
162
- * @see CKEDITOR.config#stylesheetParser_skipSelectors
163
- */
1
+ /**
2
+ * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview stylesheetParser plugin.
8
+ */
9
+
10
+ ( function() {
11
+ // We want to extract only the elements with classes defined in the stylesheets:
12
+ function parseClasses( aRules, skipSelectors, validSelectors ) {
13
+ // aRules are just the different rules in the style sheets
14
+ // We want to merge them and them split them by commas, so we end up with only
15
+ // the selectors
16
+ var s = aRules.join( ' ' );
17
+ // Remove selectors splitting the elements, leave only the class selector (.)
18
+ s = s.replace( /(,|>|\+|~)/g, ' ' );
19
+ // Remove attribute selectors: table[border="0"]
20
+ s = s.replace( /\[[^\]]*/g, '' );
21
+ // Remove Ids: div#main
22
+ s = s.replace( /#[^\s]*/g, '' );
23
+ // Remove pseudo-selectors and pseudo-elements: :hover :nth-child(2n+1) ::before
24
+ s = s.replace( /\:{1,2}[^\s]*/g, '' );
25
+
26
+ s = s.replace( /\s+/g, ' ' );
27
+
28
+ var aSelectors = s.split( ' ' ),
29
+ aClasses = [];
30
+
31
+ for ( var i = 0; i < aSelectors.length; i++ ) {
32
+ var selector = aSelectors[ i ];
33
+
34
+ if ( validSelectors.test( selector ) && !skipSelectors.test( selector ) ) {
35
+ // If we still don't know about this one, add it
36
+ if ( CKEDITOR.tools.indexOf( aClasses, selector ) == -1 )
37
+ aClasses.push( selector );
38
+ }
39
+ }
40
+
41
+ return aClasses;
42
+ }
43
+
44
+ function LoadStylesCSS( theDoc, skipSelectors, validSelectors ) {
45
+ var styles = [],
46
+ // It will hold all the rules of the applied stylesheets (except those internal to CKEditor)
47
+ aRules = [],
48
+ i;
49
+
50
+ for ( i = 0; i < theDoc.styleSheets.length; i++ ) {
51
+ var sheet = theDoc.styleSheets[ i ],
52
+ node = sheet.ownerNode || sheet.owningElement;
53
+
54
+ // Skip the internal stylesheets
55
+ if ( node.getAttribute( 'data-cke-temp' ) )
56
+ continue;
57
+
58
+ // Exclude stylesheets injected by extensions
59
+ if ( sheet.href && sheet.href.substr( 0, 9 ) == 'chrome://' )
60
+ continue;
61
+
62
+ // Bulletproof with x-domain content stylesheet.
63
+ try {
64
+ var sheetRules = sheet.cssRules || sheet.rules;
65
+ for ( var j = 0; j < sheetRules.length; j++ )
66
+ aRules.push( sheetRules[ j ].selectorText );
67
+ } catch ( e ) {}
68
+ }
69
+
70
+ var aClasses = parseClasses( aRules, skipSelectors, validSelectors );
71
+
72
+ // Add each style to our "Styles" collection.
73
+ for ( i = 0; i < aClasses.length; i++ ) {
74
+ var oElement = aClasses[ i ].split( '.' ),
75
+ element = oElement[ 0 ].toLowerCase(),
76
+ sClassName = oElement[ 1 ];
77
+
78
+ styles.push( {
79
+ name: element + '.' + sClassName,
80
+ element: element,
81
+ attributes: { 'class': sClassName }
82
+ } );
83
+ }
84
+
85
+ return styles;
86
+ }
87
+
88
+ // Register a plugin named "stylesheetparser".
89
+ CKEDITOR.plugins.add( 'stylesheetparser', {
90
+ init: function( editor ) {
91
+ // Stylesheet parser is incompatible with filter (#10136).
92
+ editor.filter.disable();
93
+
94
+ var cachedDefinitions;
95
+
96
+ editor.once( 'stylesSet', function( evt ) {
97
+ // Cancel event and fire it again when styles are ready.
98
+ evt.cancel();
99
+
100
+ // Overwrite editor#getStylesSet asap (contentDom is the first moment
101
+ // when editor.document is ready), but before stylescombo reads styles set (priority 5).
102
+ editor.once( 'contentDom', function() {
103
+ editor.getStylesSet( function( definitions ) {
104
+ // Rules that must be skipped
105
+ var skipSelectors = editor.config.stylesheetParser_skipSelectors || ( /(^body\.|^\.)/i ),
106
+ // Rules that are valid
107
+ validSelectors = editor.config.stylesheetParser_validSelectors || ( /\w+\.\w+/ );
108
+
109
+ cachedDefinitions = definitions.concat( LoadStylesCSS( editor.document.$, skipSelectors, validSelectors ) );
110
+
111
+ editor.getStylesSet = function( callback ) {
112
+ if ( cachedDefinitions )
113
+ return callback( cachedDefinitions );
114
+ };
115
+
116
+ editor.fire( 'stylesSet', { styles: cachedDefinitions } );
117
+ } );
118
+ } );
119
+ }, null, null, 1 );
120
+ }
121
+ } );
122
+ } )();
123
+
124
+
125
+ /**
126
+ * A regular expression that defines whether a CSS rule will be
127
+ * skipped by the Stylesheet Parser plugin. A CSS rule matching
128
+ * the regular expression will be ignored and will not be available
129
+ * in the Styles drop-down list.
130
+ *
131
+ * // Ignore rules for body and caption elements, classes starting with "high", and any class defined for no specific element.
132
+ * config.stylesheetParser_skipSelectors = /(^body\.|^caption\.|\.high|^\.)/i;
133
+ *
134
+ * @since 3.6
135
+ * @cfg {RegExp} [stylesheetParser_skipSelectors=/(^body\.|^\.)/i]
136
+ * @member CKEDITOR.config
137
+ * @see CKEDITOR.config#stylesheetParser_validSelectors
138
+ */
139
+
140
+ /**
141
+ * A regular expression that defines which CSS rules will be used
142
+ * by the Stylesheet Parser plugin. A CSS rule matching the regular
143
+ * expression will be available in the Styles drop-down list.
144
+ *
145
+ * // Only add rules for p and span elements.
146
+ * config.stylesheetParser_validSelectors = /\^(p|span)\.\w+/;
147
+ *
148
+ * @since 3.6
149
+ * @cfg {RegExp} [stylesheetParser_validSelectors=/\w+\.\w+/]
150
+ * @member CKEDITOR.config
151
+ * @see CKEDITOR.config#stylesheetParser_skipSelectors
152
+ */