diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 16:58:53 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 16:58:53 +0200 |
| commit | 420506e58fdfc84f1a5bede0a01dedf0af3bb4f3 (patch) | |
| tree | 57726b40e8aa9ccf80f874f39d3facefc0331420 /public/javascripts/tiny_mce/plugins/wordcount | |
| parent | 241d5e91b2b6716e2861cc77d319c3d3568343a8 (diff) | |
Stage 7: Rails 7.2 → 8.1 on Ruby 3.2.11
- Bump Rails to 8.1.3 (Ruby unchanged at 3.2.11, new gemset rails8-upgrade)
- config.load_defaults 8.1; merge app:update diffs for all environment files
- Remove routing-filter 0.7.0; replace with native scope '(:locale)' in
routes.rb and default_url_options in ApplicationController
- Delete config/initializers/routing_filter_rails71_patch.rb
- Replace vendored TinyMCE 3.x (~200 files) with tinymce-rails ~> 8.3;
migrate admin_interface.js from jQuery .tinymce()/advanced theme to
tinymce.init(); add config/tinymce.yml; note: TinyMCE 7+ is GPL
- rails-i18n ~> 8.0 added explicitly (previously indirect dependency)
- awesome_nested_set, acts-as-taggable-on pinned to git main/master
(gemspec activerecord < 8.1 ceiling; no functional incompatibility;
repin to version once upstream releases updated gemspecs)
- globalize ~> 7.0, libxml-ruby ~> 5.0, nokogiri ~> 1.18, pg ~> 1.5
- sass-rails, coffee-rails, uglifier moved from :assets group to main
(Sprockets 4 convention; :assets group no longer meaningful)
- Node: head, draft, lock_owner marked belongs_to optional: true
- Page: node, user, editor marked belongs_to optional: true
- Static assets in public/images/ and public/javascripts/ referenced via
plain HTML tags; Rails 8 load_defaults raises on pipeline helpers for
undeclared assets
- sessions_controller_test.rb: remove stale require and dead rescue_action
- users_controller_test.rb: assert button[type=submit] not input[type=submit]
(Rails 8 button_to renders <button> not <input>)
- test_helper.rb: node.reload after children.create! (awesome_nested_set
3.9.0 does not refresh parent in memory after callback)
- 129 runs, 339 assertions, 3 failures, 0 errors — identical baseline to 7.2
Diffstat (limited to 'public/javascripts/tiny_mce/plugins/wordcount')
| -rw-r--r-- | public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js | 1 | ||||
| -rw-r--r-- | public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js | 95 |
2 files changed, 0 insertions, 96 deletions
diff --git a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js b/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js deleted file mode 100644 index f192835..0000000 --- a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | (function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/\S\s+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$¿'"_+=\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'<span id="'+c.id+'">0</span>')}}else{tinymce.DOM.add(h,"span",{},'<span id="'+c.id+'">0</span>')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_count:function(b){var c=this,a=0;if(c.block){return}c.block=1;setTimeout(function(){var d=b.getContent({format:"raw"});if(d){d=d.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");d=d.replace(c.cleanre,"");d.replace(c.countre,function(){a++})}tinymce.DOM.setHTML(c.id,a.toString());setTimeout(function(){c.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file | ||
diff --git a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js deleted file mode 100644 index 41b78a9..0000000 --- a/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | /** | ||
| 2 | * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $ | ||
| 3 | * | ||
| 4 | * @author Moxiecode | ||
| 5 | * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. | ||
| 6 | */ | ||
| 7 | |||
| 8 | (function() { | ||
| 9 | tinymce.create('tinymce.plugins.WordCount', { | ||
| 10 | block : 0, | ||
| 11 | id : null, | ||
| 12 | countre : null, | ||
| 13 | cleanre : null, | ||
| 14 | |||
| 15 | init : function(ed, url) { | ||
| 16 | var t = this, last = 0; | ||
| 17 | |||
| 18 | t.countre = ed.getParam('wordcount_countregex', /\S\s+/g); | ||
| 19 | t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g); | ||
| 20 | t.id = ed.id + '-word-count'; | ||
| 21 | |||
| 22 | ed.onPostRender.add(function(ed, cm) { | ||
| 23 | var row, id; | ||
| 24 | |||
| 25 | // Add it to the specified id or the theme advanced path | ||
| 26 | id = ed.getParam('wordcount_target_id'); | ||
| 27 | if (!id) { | ||
| 28 | row = tinymce.DOM.get(ed.id + '_path_row'); | ||
| 29 | |||
| 30 | if (row) | ||
| 31 | tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>'); | ||
| 32 | } else | ||
| 33 | tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>'); | ||
| 34 | }); | ||
| 35 | |||
| 36 | ed.onInit.add(function(ed) { | ||
| 37 | ed.selection.onSetContent.add(function() { | ||
| 38 | t._count(ed); | ||
| 39 | }); | ||
| 40 | |||
| 41 | t._count(ed); | ||
| 42 | }); | ||
| 43 | |||
| 44 | ed.onSetContent.add(function(ed) { | ||
| 45 | t._count(ed); | ||
| 46 | }); | ||
| 47 | |||
| 48 | ed.onKeyUp.add(function(ed, e) { | ||
| 49 | if (e.keyCode == last) | ||
| 50 | return; | ||
| 51 | |||
| 52 | if (13 == e.keyCode || 8 == last || 46 == last) | ||
| 53 | t._count(ed); | ||
| 54 | |||
| 55 | last = e.keyCode; | ||
| 56 | }); | ||
| 57 | }, | ||
| 58 | |||
| 59 | _count : function(ed) { | ||
| 60 | var t = this, tc = 0; | ||
| 61 | |||
| 62 | // Keep multiple calls from happening at the same time | ||
| 63 | if (t.block) | ||
| 64 | return; | ||
| 65 | |||
| 66 | t.block = 1; | ||
| 67 | |||
| 68 | setTimeout(function() { | ||
| 69 | var tx = ed.getContent({format : 'raw'}); | ||
| 70 | |||
| 71 | if (tx) { | ||
| 72 | tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars | ||
| 73 | tx = tx.replace(t.cleanre, ''); // remove numbers and punctuation | ||
| 74 | tx.replace(t.countre, function() {tc++;}); // count the words | ||
| 75 | } | ||
| 76 | |||
| 77 | tinymce.DOM.setHTML(t.id, tc.toString()); | ||
| 78 | |||
| 79 | setTimeout(function() {t.block = 0;}, 2000); | ||
| 80 | }, 1); | ||
| 81 | }, | ||
| 82 | |||
| 83 | getInfo: function() { | ||
| 84 | return { | ||
| 85 | longname : 'Word Count plugin', | ||
| 86 | author : 'Moxiecode Systems AB', | ||
| 87 | authorurl : 'http://tinymce.moxiecode.com', | ||
| 88 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', | ||
| 89 | version : tinymce.majorVersion + "." + tinymce.minorVersion | ||
| 90 | }; | ||
| 91 | } | ||
| 92 | }); | ||
| 93 | |||
| 94 | tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); | ||
| 95 | })(); | ||
