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/themes/advanced/js/link.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/themes/advanced/js/link.js')
| -rw-r--r-- | public/javascripts/tiny_mce/themes/advanced/js/link.js | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/public/javascripts/tiny_mce/themes/advanced/js/link.js b/public/javascripts/tiny_mce/themes/advanced/js/link.js deleted file mode 100644 index f67a5bc..0000000 --- a/public/javascripts/tiny_mce/themes/advanced/js/link.js +++ /dev/null | |||
| @@ -1,156 +0,0 @@ | |||
| 1 | tinyMCEPopup.requireLangPack(); | ||
| 2 | |||
| 3 | var LinkDialog = { | ||
| 4 | preInit : function() { | ||
| 5 | var url; | ||
| 6 | |||
| 7 | if (url = tinyMCEPopup.getParam("external_link_list_url")) | ||
| 8 | document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>'); | ||
| 9 | }, | ||
| 10 | |||
| 11 | init : function() { | ||
| 12 | var f = document.forms[0], ed = tinyMCEPopup.editor; | ||
| 13 | |||
| 14 | // Setup browse button | ||
| 15 | document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); | ||
| 16 | if (isVisible('hrefbrowser')) | ||
| 17 | document.getElementById('href').style.width = '180px'; | ||
| 18 | |||
| 19 | this.fillClassList('class_list'); | ||
| 20 | this.fillFileList('link_list', 'tinyMCELinkList'); | ||
| 21 | this.fillTargetList('target_list'); | ||
| 22 | |||
| 23 | if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { | ||
| 24 | f.href.value = ed.dom.getAttrib(e, 'href'); | ||
| 25 | f.linktitle.value = ed.dom.getAttrib(e, 'title'); | ||
| 26 | f.insert.value = ed.getLang('update'); | ||
| 27 | selectByValue(f, 'link_list', f.href.value); | ||
| 28 | selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); | ||
| 29 | selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); | ||
| 30 | } | ||
| 31 | }, | ||
| 32 | |||
| 33 | update : function() { | ||
| 34 | var f = document.forms[0], ed = tinyMCEPopup.editor, e, b; | ||
| 35 | |||
| 36 | tinyMCEPopup.restoreSelection(); | ||
| 37 | e = ed.dom.getParent(ed.selection.getNode(), 'A'); | ||
| 38 | |||
| 39 | // Remove element if there is no href | ||
| 40 | if (!f.href.value) { | ||
| 41 | if (e) { | ||
| 42 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 43 | b = ed.selection.getBookmark(); | ||
| 44 | ed.dom.remove(e, 1); | ||
| 45 | ed.selection.moveToBookmark(b); | ||
| 46 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 47 | tinyMCEPopup.close(); | ||
| 48 | return; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | |||
| 52 | tinyMCEPopup.execCommand("mceBeginUndoLevel"); | ||
| 53 | |||
| 54 | // Create new anchor elements | ||
| 55 | if (e == null) { | ||
| 56 | ed.getDoc().execCommand("unlink", false, null); | ||
| 57 | tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1}); | ||
| 58 | |||
| 59 | tinymce.each(ed.dom.select("a"), function(n) { | ||
| 60 | if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { | ||
| 61 | e = n; | ||
| 62 | |||
| 63 | ed.dom.setAttribs(e, { | ||
| 64 | href : f.href.value, | ||
| 65 | title : f.linktitle.value, | ||
| 66 | target : f.target_list ? getSelectValue(f, "target_list") : null, | ||
| 67 | 'class' : f.class_list ? getSelectValue(f, "class_list") : null | ||
| 68 | }); | ||
| 69 | } | ||
| 70 | }); | ||
| 71 | } else { | ||
| 72 | ed.dom.setAttribs(e, { | ||
| 73 | href : f.href.value, | ||
| 74 | title : f.linktitle.value, | ||
| 75 | target : f.target_list ? getSelectValue(f, "target_list") : null, | ||
| 76 | 'class' : f.class_list ? getSelectValue(f, "class_list") : null | ||
| 77 | }); | ||
| 78 | } | ||
| 79 | |||
| 80 | // Don't move caret if selection was image | ||
| 81 | if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { | ||
| 82 | ed.focus(); | ||
| 83 | ed.selection.select(e); | ||
| 84 | ed.selection.collapse(0); | ||
| 85 | tinyMCEPopup.storeSelection(); | ||
| 86 | } | ||
| 87 | |||
| 88 | tinyMCEPopup.execCommand("mceEndUndoLevel"); | ||
| 89 | tinyMCEPopup.close(); | ||
| 90 | }, | ||
| 91 | |||
| 92 | checkPrefix : function(n) { | ||
| 93 | if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) | ||
| 94 | n.value = 'mailto:' + n.value; | ||
| 95 | |||
| 96 | if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) | ||
| 97 | n.value = 'http://' + n.value; | ||
| 98 | }, | ||
| 99 | |||
| 100 | fillFileList : function(id, l) { | ||
| 101 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 102 | |||
| 103 | l = window[l]; | ||
| 104 | |||
| 105 | if (l && l.length > 0) { | ||
| 106 | lst.options[lst.options.length] = new Option('', ''); | ||
| 107 | |||
| 108 | tinymce.each(l, function(o) { | ||
| 109 | lst.options[lst.options.length] = new Option(o[0], o[1]); | ||
| 110 | }); | ||
| 111 | } else | ||
| 112 | dom.remove(dom.getParent(id, 'tr')); | ||
| 113 | }, | ||
| 114 | |||
| 115 | fillClassList : function(id) { | ||
| 116 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; | ||
| 117 | |||
| 118 | if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { | ||
| 119 | cl = []; | ||
| 120 | |||
| 121 | tinymce.each(v.split(';'), function(v) { | ||
| 122 | var p = v.split('='); | ||
| 123 | |||
| 124 | cl.push({'title' : p[0], 'class' : p[1]}); | ||
| 125 | }); | ||
| 126 | } else | ||
| 127 | cl = tinyMCEPopup.editor.dom.getClasses(); | ||
| 128 | |||
| 129 | if (cl.length > 0) { | ||
| 130 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 131 | |||
| 132 | tinymce.each(cl, function(o) { | ||
| 133 | lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); | ||
| 134 | }); | ||
| 135 | } else | ||
| 136 | dom.remove(dom.getParent(id, 'tr')); | ||
| 137 | }, | ||
| 138 | |||
| 139 | fillTargetList : function(id) { | ||
| 140 | var dom = tinyMCEPopup.dom, lst = dom.get(id), v; | ||
| 141 | |||
| 142 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); | ||
| 143 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); | ||
| 144 | lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); | ||
| 145 | |||
| 146 | if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { | ||
| 147 | tinymce.each(v.split(','), function(v) { | ||
| 148 | v = v.split('='); | ||
| 149 | lst.options[lst.options.length] = new Option(v[0], v[1]); | ||
| 150 | }); | ||
| 151 | } | ||
| 152 | } | ||
| 153 | }; | ||
| 154 | |||
| 155 | LinkDialog.preInit(); | ||
| 156 | tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); | ||
