aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js
diff options
context:
space:
mode:
Diffstat (limited to '97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js')
-rw-r--r--97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js b/97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js
new file mode 100644
index 0000000..36f410f
--- /dev/null
+++ b/97suifangqa/staticfiles/tinymce/js/tinymce/plugins/link/plugin.min.js
@@ -0,0 +1 @@
+tinymce.PluginManager.add("link",function(e){function t(){function t(){var t=[{text:"None",value:""}];return tinymce.each(e.settings.link_list,function(e){t.push({text:e.text||e.title,value:e.value||e.url,menu:e.menu})}),t}function n(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[{text:"None",value:""}];return e.settings.target_list||n.push({text:"New window",value:"_blank"}),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function i(){s||0!==f.text.length||this.parent().parent().find("#text")[0].value(this.value())}var o,a,s,l,c,u,d,f={},p=e.selection,h=e.dom;o=p.getNode(),a=h.getParent(o,"a[href]"),a&&p.select(a),f.text=s=p.getContent({format:"text"}),f.href=a?h.getAttrib(a,"href"):"",f.target=a?h.getAttrib(a,"target"):"",f.rel=a?h.getAttrib(a,"rel"):"","IMG"==o.nodeName&&(f.text=s=" "),e.settings.link_list&&(c={type:"listbox",label:"Link list",values:t(),onselect:function(e){var t=l.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),l.find("#href").value(e.control.value())}}),e.settings.target_list!==!1&&(d={name:"target",type:"listbox",label:"Target",values:r(f.target)}),e.settings.rel_list&&(u={name:"rel",type:"listbox",label:"Rel",values:n(f.rel)}),l=e.windowManager.open({title:"Insert link",data:f,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:i,onkeyup:i},{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){f.text=this.value()}},c,u,d],onSubmit:function(t){var n=t.data;return n.href?(n.text!=s?a?(e.focus(),a.innerHTML=n.text,h.setAttribs(a,{href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null}),p.select(a)):e.insertContent(h.createHTML("a",{href:n.href,target:n.target?n.target:null,rel:n.rel?n.rel:null},n.text)):e.execCommand("mceInsertLink",!1,{href:n.href,target:n.target,rel:n.rel?n.rel:null}),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t,stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link(s)",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t),this.showDialog=t,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t,stateSelector:"a[href]",context:"insert",prependToContext:!0})}); \ No newline at end of file