X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Flink%2Fplugin.js;h=7cf714432953b72999139b2835eb78e88ff8b4ee;hb=HEAD;hp=10eeed53b8a77c14ec4ebe8fbc8ca6543935e3f0;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/plugins/link/plugin.js b/plugins/link/plugin.js deleted file mode 100644 index 10eeed5..0000000 --- a/plugins/link/plugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -CKEDITOR.plugins.add('link',{init:function(a){a.addCommand('link',new CKEDITOR.dialogCommand('link'));a.addCommand('anchor',new CKEDITOR.dialogCommand('anchor'));a.addCommand('unlink',new CKEDITOR.unlinkCommand());a.ui.addButton('Link',{label:a.lang.link.toolbar,command:'link'});a.ui.addButton('Unlink',{label:a.lang.unlink,command:'unlink'});a.ui.addButton('Anchor',{label:a.lang.anchor.toolbar,command:'anchor'});CKEDITOR.dialog.add('link',this.path+'dialogs/link.js');CKEDITOR.dialog.add('anchor',this.path+'dialogs/anchor.js');a.addCss('img.cke_anchor{background-image: url('+CKEDITOR.getUrl(this.path+'images/anchor.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 18px;'+'height: 18px;'+'}\n'+'a.cke_anchor'+'{'+'background-image: url('+CKEDITOR.getUrl(this.path+'images/anchor.gif')+');'+'background-position: 0 center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'padding-left: 18px;'+'}');a.on('selectionChange',function(b){var c=a.getCommand('unlink'),d=b.data.path.lastElement.getAscendant('a',true);if(d&&d.getName()=='a'&&d.getAttribute('href'))c.setState(CKEDITOR.TRISTATE_OFF);else c.setState(CKEDITOR.TRISTATE_DISABLED);});if(a.addMenuItems)a.addMenuItems({anchor:{label:a.lang.anchor.menu,command:'anchor',group:'anchor'},link:{label:a.lang.link.menu,command:'link',group:'link',order:1},unlink:{label:a.lang.unlink,command:'unlink',group:'link',order:5}});if(a.contextMenu)a.contextMenu.addListener(function(b,c){if(!b)return null;var d=b.is('img')&&b.getAttribute('_cke_real_element_type')=='anchor';if(!d){if(!(b=b.getAscendant('a',true)))return null;d=b.getAttribute('name')&&!b.getAttribute('href');}return d?{anchor:CKEDITOR.TRISTATE_OFF}:{link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF};});},afterInit:function(a){var b=a.dataProcessor,c=b&&b.dataFilter;if(c)c.addRules({elements:{a:function(d){var e=d.attributes;if(e.name&&!e.href)return a.createFakeParserElement(d,'cke_anchor','anchor');}}});},requires:['fakeobjects']});CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype={exec:function(a){var b=a.getSelection(),c=b.createBookmarks(),d=b.getRanges(),e,f;for(var g=0;g