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/searchreplace/js/searchreplace.js | |
| 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/searchreplace/js/searchreplace.js')
| -rw-r--r-- | public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js | 126 |
1 files changed, 0 insertions, 126 deletions
diff --git a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js deleted file mode 100644 index a8585cc..0000000 --- a/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ /dev/null | |||
| @@ -1,126 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var SearchReplaceDialog = { | ||
| 4 | init : function(ed) { | ||
| 5 | var f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); | ||
| 6 | |||
| 7 | this.switchMode(m); | ||
| 8 | |||
| 9 | f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); | ||
| 10 | |||
| 11 | // Focus input field | ||
| 12 | f[m + '_panel_searchstring'].focus(); | ||
| 13 | }, | ||
| 14 | |||
| 15 | switchMode : function(m) { | ||
| 16 | var f, lm = this.lastMode; | ||
| 17 | |||
| 18 | if (lm != m) { | ||
| 19 | f = document.forms[0]; | ||
| 20 | |||
| 21 | if (lm) { | ||
| 22 | f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; | ||
| 23 | f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; | ||
| 24 | f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; | ||
| 25 | f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; | ||
| 26 | } | ||
| 27 | |||
| 28 | mcTabs.displayTab(m + '_tab', m + '_panel'); | ||
| 29 | document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 30 | document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; | ||
| 31 | this.lastMode = m; | ||
| 32 | } | ||
| 33 | }, | ||
| 34 | |||
| 35 | searchNext : function(a) { | ||
| 36 | var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; | ||
| 37 | |||
| 38 | // Get input | ||
| 39 | f = document.forms[0]; | ||
| 40 | s = f[m + '_panel_searchstring'].value; | ||
| 41 | b = f[m + '_panel_backwardsu'].checked; | ||
| 42 | ca = f[m + '_panel_casesensitivebox'].checked; | ||
| 43 | rs = f['replace_panel_replacestring'].value; | ||
| 44 | |||
| 45 | if (s == '') | ||
| 46 | return; | ||
| 47 | |||
| 48 | function fix() { | ||
| 49 | // Correct Firefox graphics glitches | ||
| 50 | r = se.getRng().cloneRange(); | ||
| 51 | ed.getDoc().execCommand('SelectAll', false, null); | ||
| 52 | se.setRng(r); | ||
| 53 | }; | ||
| 54 | |||
| 55 | function replace() { | ||
| 56 | if (tinymce.isIE) | ||
| 57 | ed.selection.getRng().duplicate().pasteHTML(rs); // Needs to be duplicated due to selection bug in IE | ||
| 58 | else | ||
| 59 | ed.getDoc().execCommand('InsertHTML', false, rs); | ||
| 60 | }; | ||
| 61 | |||
| 62 | // IE flags | ||
| 63 | if (ca) | ||
| 64 | fl = fl | 4; | ||
| 65 | |||
| 66 | switch (a) { | ||
| 67 | case 'all': | ||
| 68 | // Move caret to beginning of text | ||
| 69 | ed.execCommand('SelectAll'); | ||
| 70 | ed.selection.collapse(true); | ||
| 71 | |||
| 72 | if (tinymce.isIE) { | ||
| 73 | while (r.findText(s, b ? -1 : 1, fl)) { | ||
| 74 | r.scrollIntoView(); | ||
| 75 | r.select(); | ||
| 76 | replace(); | ||
| 77 | fo = 1; | ||
| 78 | } | ||
| 79 | |||
| 80 | tinyMCEPopup.storeSelection(); | ||
| 81 | } else { | ||
| 82 | while (w.find(s, ca, b, false, false, false, false)) { | ||
| 83 | replace(); | ||
| 84 | fo = 1; | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | if (fo) | ||
| 89 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); | ||
| 90 | else | ||
| 91 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 92 | |||
| 93 | return; | ||
| 94 | |||
| 95 | case 'current': | ||
| 96 | if (!ed.selection.isCollapsed()) | ||
| 97 | replace(); | ||
| 98 | |||
| 99 | break; | ||
| 100 | } | ||
| 101 | |||
| 102 | se.collapse(b); | ||
| 103 | r = se.getRng(); | ||
| 104 | |||
| 105 | // Whats the point | ||
| 106 | if (!s) | ||
| 107 | return; | ||
| 108 | |||
| 109 | if (tinymce.isIE) { | ||
| 110 | if (r.findText(s, b ? -1 : 1, fl)) { | ||
| 111 | r.scrollIntoView(); | ||
| 112 | r.select(); | ||
| 113 | } else | ||
| 114 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 115 | |||
| 116 | tinyMCEPopup.storeSelection(); | ||
| 117 | } else { | ||
| 118 | if (!w.find(s, ca, b, false, false, false, false)) | ||
| 119 | tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); | ||
| 120 | else | ||
| 121 | fix(); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | }; | ||
| 125 | |||
| 126 | tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); | ||
