Mr P!nk Posted September 7, 2007 Share Posted September 7, 2007 CreateLink._pluginInfo={name:"CreateLink",origin:"Xinha Core",version:"$LastChangedRevision: 694 $".replace(/^[^:]*: (.*) \$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.python-hosting.com/trunk/modules/CreateLink/link.js $".replace(/^[^:]*: (.*) \$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"}; function CreateLink(_1){ } Xinha.prototype._createLink=function(_2){ var _3=this; var _4=null; if(typeof _2=="undefined"){ _2=this.getParentElement(); if(_2){ while(_2&&!/^a$/i.test(_2.tagName)){ _2=_2.parentNode; } } } if(!_2){ var _5=_3.getSelection(); var _6=_3.createRange(_5); var _7=0; if(Xinha.is_ie){ if(_5.type=="Control"){ _7=_6.length; }else{ _7=_6.compareEndPoints("StartToEnd",_6); } }else{ _7=_6.compareBoundaryPoints(_6.START_TO_END,_6); } if(_7===0){ alert(Xinha._lc("You need to select some text before creating a link")); return; } _4={f_href:"\\",f_title:"",f_target:"",f_usetarget:_3.config.makeLinkShowsTarget}; // added "\\" to href by jove i think i have it XD }else{ _4={f_href:Xinha.is_ie?_3.stripBaseURL(_2.href):_2.getAttribute("href"),f_title:_2.title,f_target:_2.target,f_usetarget:_3.config.makeLinkShowsTarget}; } Dialog(_3.config.URIs.link,function(_{ if(!_{ return false; } var a=_2; if(!a){ try{ var _a=Xinha.uniq("http://www.example.com/Link"); _3._doc.execCommand("createlink",false,_a); var _b=_3._doc.getElementsByTagName("a"); for(var i=0;i<_b.length;i++){ var _d=_b[i]; if(_d.href==_a){ if(!a){ a=_d; } _d.href=_8.f_href; if(_8.f_target){ _d.target=_8.f_target; } if(_8.f_title){ _d.title=_8.f_title; } } } } catch(ex){ } }else{ var _e=_8.f_href.trim(); _3.selectNodeContents(a); if(_e===""){ _3._doc.execCommand("unlink",false,null); _3.updateToolbar(); return false; }else{ a.href=_e; } } if(!(a&&a.tagName.toLowerCase()=="a")){ return false; } a.target=_8.f_target.trim(); a.title=_8.f_title.trim(); _3.selectNodeContents(a); _3.updateToolbar(); },_4); }; this is an automatic linker from Xinha rte, waht i need to know (as ive been trying for a few days) is, is there a way i can modify this .js so when i enter a url in the RTE its just appears as <a href=somelink.com>link</a> no quotes surrounding it at all ? im not to good with .js so it could be very obvious to someone who is thanks AA Quote Link to comment Share on other sites More sharing options...
Mr P!nk Posted September 10, 2007 Author Share Posted September 10, 2007 bump Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.