| 2 |
|
|
| 3 |
//Merged and minified: bue.popup.js, bue.html.js, bue.preview.js, bue.imce.js, bue.misc.js |
//Merged and minified: bue.popup.js, bue.html.js, bue.preview.js, bue.imce.js, bue.misc.js |
| 4 |
(function(E,$){BUE.popups=BUE.popups||{};BUE.popHtml='<table class="bue-popup" style="display: none;"><tbody class="bue-zero"><tr class="bue-zero"><td class="bue-zero"><div class="bue-popup-head clear-block"><div class="bue-popup-title"></div><div class="bue-popup-close">x</div></div><div class="bue-popup-body clear-block"><div class="bue-popup-content"></div></div></td></tr></tbody></table>';BUE.openPopup=function(id,title,content,effect){return BUE.createPopup(id).open(title,content,effect);};BUE.createPopup=function(id,title,content){if(BUE.popups[id]){return BUE.popups[id];} |
(function(E,$){BUE.popups=BUE.popups||{};BUE.popHtml='<table class="bue-popup" style="display: none;"><tbody class="bue-zero"><tr class="bue-zero"><td class="bue-zero"><div class="bue-popup-head clear-block"><div class="bue-popup-title"></div><div class="bue-popup-close">x</div></div><div class="bue-popup-body clear-block"><div class="bue-popup-content"></div></div></td></tr></tbody></table>';BUE.openPopup=function(id,title,content,effect){return BUE.createPopup(id).open(title,content,effect);};BUE.createPopup=function(id,title,content){if(BUE.popups[id]){return BUE.popups[id];} |
| 5 |
var P=BUE.popups[id]=$html(BUE.popHtml).appendTo('body').attr('id',id).find('.bue-popup-title').html(title||'').end().find('.bue-popup-content').html(content||'').end().get(0);P.open=function(title,content,effect){var E=P.bue=BUE.active,B=E.buttons[E.bindex],pos=$(B).offset();$(P).css({left:pos.left-20,top:pos.top+10});if(typeof title!='undefined'&&title!=null){$('.bue-popup-title',P).html(title);} |
var $P=$html(BUE.popHtml).appendTo('body').attr('id',id);var $title=$P.find('.bue-popup-title').html(title||'');var $content=$P.find('.bue-popup-content').html(content||'');var P=BUE.popups[id]=$P[0];P.open=function(title,content,effect){var E=P.bue=BUE.active,B=E.buttons[E.bindex],pos=$(B).offset();if(typeof title!='undefined'&&title!=null){$title.html(title);} |
| 6 |
if(typeof content!='undefined'&&content!=null){$('.bue-popup-content',P).html(content);} |
if(typeof content!='undefined'&&content!=null){$content.html(content);} |
| 7 |
$(P)[effect||'show']();B.pops=true;P.focus&&P.focus();return P;};P.close=function(effect){return $(P)[effect||'hide']()[0]};$('.bue-popup-close',P).click(function(){P.close()});$('.bue-popup-head',P).mousedown(function(e){var pos={X:parseInt($(P).css('left'))-e.pageX,Y:parseInt($(P).css('top'))-e.pageY};var drag=function(e){$(P).css({left:pos.X+e.pageX,top:pos.Y+e.pageY});return false;};var undrag=function(e){$(document).unbind('mousemove',drag).unbind('mouseup',undrag)};$(document).mousemove(drag).mouseup(undrag);});return P;};BUE.postprocess.unshift(function(Ed,$){if(Ed.index)return;var D=E.dialog=BUE.dialog=BUE.createPopup('bue-dialog');var foc=function(){this.blur()};var Do=D.open,Dc=D.close;D.open=function(title,content,effect){D.esp&&D.close();var E=BUE.active;E.buttonsDisabled(true).stayClicked(true);D.esp=E.posSelection();$(E.textArea).focus(foc);return Do(title,content,effect);};D.close=function(effect){if(!D.esp)return D;var E=D.bue;$(E.textArea).unbind('focus',foc);E.buttonsDisabled(false).stayClicked(false);E==BUE.active&&E.makeSelection(D.esp.start,D.esp.end).focus();D.esp=null;return Dc(effect);};var Q=E.quickPop=BUE.quickPop=BUE.createPopup('bue-quick-pop');var Qo=Q.open,Qc=Q.close;Q.open=function(content,effect){$(document).mouseup(Q.close);return Qo(null,content,effect);};Q.close=function(){$(document).unbind('mouseup',Q.close);return Qc();};$('.bue-popup-head',Q).css({display:'none'});});var $html=BUE.$html;})(BUE.instance.prototype,jQuery);(function($){BUE.html=function(tag,ihtml,attr){var A=attr||{},I=ihtml||'';var H='<'+tag;for(var i in A){H+=A[i]==null?'':' '+i+'="'+A[i]+'"';} |
$P.css({left:Math.max(10,pos.left-$P.width()/2+20),top:pos.top+10})[effect||'show']();B.pops=true;P.focus&&P.focus();return P;};P.close=function(effect){return $(P)[effect||'hide']()[0]};$P.find('.bue-popup-close').click(function(){P.close()});$P.find('.bue-popup-head').mousedown(function(e){var pos={X:parseInt($P.css('left'))-e.pageX,Y:parseInt($P.css('top'))-e.pageY};var drag=function(e){$P.css({left:pos.X+e.pageX,top:pos.Y+e.pageY});return false;};var undrag=function(e){$(document).unbind('mousemove',drag).unbind('mouseup',undrag)};$(document).mousemove(drag).mouseup(undrag);});return P;};BUE.postprocess.unshift(function(Ed,$){if(Ed.index)return;var D=E.dialog=BUE.dialog=BUE.createPopup('bue-dialog');var foc=function(){this.blur()};var Do=D.open,Dc=D.close;D.open=function(title,content,effect){D.esp&&D.close();var E=BUE.active;E.buttonsDisabled(true).stayClicked(true);D.esp=E.posSelection();$(E.textArea).focus(foc);return Do(title,content,effect);};D.close=function(effect){if(!D.esp)return D;var E=D.bue;$(E.textArea).unbind('focus',foc);E.buttonsDisabled(false).stayClicked(false);E==BUE.active&&E.makeSelection(D.esp.start,D.esp.end);D.esp=null;return Dc(effect);};var Q=E.quickPop=BUE.quickPop=BUE.createPopup('bue-quick-pop');var Qo=Q.open,Qc=Q.close;Q.open=function(content,effect){$(document).mouseup(Q.close);return Qo(null,content,effect);};Q.close=function(){$(document).unbind('mouseup',Q.close);return Qc();};$('.bue-popup-head',Q).css({display:'none'});});var $html=BUE.$html;})(BUE.instance.prototype,jQuery);(function(E,$){BUE.html=function(tag,ihtml,attr){var A=attr||{},I=ihtml||'';var H='<'+tag;for(var i in A){H+=A[i]==null?'':' '+i+'="'+A[i]+'"';} |
| 8 |
H+=Nc(tag)?(' />'+I):('>'+I+'</'+tag+'>');return tag?H:I;};BUE.input=function(t,n,v,a){return Html('input','',$.extend({'type':t,'name':n,'value':v||null},a));};BUE.selectbox=function(n,v,opt,attr){var opt=opt||{},H='';for(var i in opt){H+=Html('option',opt[i],{'value':i,'selected':i==v?'selected':null});} |
H+=Nc(tag)?(' />'+I):('>'+I+'</'+tag+'>');return tag?H:I;};BUE.objHtml=function(obj){return Html(obj.tag,obj.html,obj.attributes);};BUE.input=function(t,n,v,a){return Html('input','',$.extend({'type':t,'name':n,'value':v||null},a));};BUE.selectbox=function(n,v,opt,attr){var opt=opt||{},H='';for(var i in opt){H+=Html('option',opt[i],{'value':i,'selected':i==v?'selected':null});} |
| 9 |
return Html('select',H,$.extend({},attr,{'name':n}));};BUE.table=function(rows,attr){for(var R,H='',i=0;R=rows[i];i++){H+=typeof R['data']=='undefined'?BUE.trow(R):BUE.trow(R['data'],R['attr']);} |
return Html('select',H,$.extend({},attr,{'name':n}));};BUE.table=function(rows,attr){for(var R,H='',i=0;R=rows[i];i++){H+=typeof R['data']=='undefined'?BUE.trow(R):BUE.trow(R['data'],R['attr']);} |
| 10 |
return Html('table',H,attr);};BUE.trow=function(cells,attr){for(var C,H='',i=0;C=cells[i];i++){H+=typeof C['data']=='undefined'?Html('td',C):Html('td',C['data'],C['attr']);} |
return Html('table',H,attr);};BUE.trow=function(cells,attr){for(var C,H='',i=0;C=cells[i];i++){H+=typeof C['data']=='undefined'?Html('td',C):Html('td',C['data'],C['attr']);} |
| 11 |
return Html('tr',H,attr);};BUE.regesc=function(s){return s.replace(/([\\\^\$\*\+\?\.\(\)\[\]\{\}\|\:])/g,'\\$1');};BUE.nctag=function(s){return!s||s.search(/^(img|input|hr|br|embed)$/)>-1;};BUE.parseHtml=function(s,tag){var r=new RegExp('^<('+(tag||'[a-z][a-z0-9]*')+')([^>]*)>($|((?:.|[\r\n])*)</\\1>$)');if(!(match=s.match(r))||(!match[3]&&!Nc(match[1]))){return null;} |
return Html('tr',H,attr);};BUE.regesc=function(s){return s.replace(/([\\\^\$\*\+\?\.\(\)\[\]\{\}\|\:])/g,'\\$1');};BUE.nctag=function(s){return!s||s.search(/^(img|input|hr|br|embed)$/)>-1;};BUE.parseHtml=function(s,tag){var r=new RegExp('^<('+(tag||'[a-z][a-z0-9]*')+')([^>]*)>($|((?:.|[\r\n])*)</\\1>$)');if(!(match=s.match(r))||(!match[3]&&!Nc(match[1]))){return null;} |
| 12 |
var tag=match[1],arr=[],attr={},match;if((arr=match[2].split('"')).length>1){for(var i=0;typeof(arr[i+1])!='undefined';i+=2){attr[arr[i].replace(/\s|\=/g,'')]=arr[i+1];}} |
var tag=match[1],arr=[],attr={},match;if((arr=match[2].split('"')).length>1){for(var i=0;typeof(arr[i+1])!='undefined';i+=2){attr[arr[i].replace(/\s|\=/g,'')]=arr[i+1];}} |
| 13 |
return{tag:tag,attributes:attr,html:match[4]};};var Html=BUE.html;var Nc=BUE.nctag;})(jQuery);eDefHTML=BUE.html;eDefInput=BUE.input;eDefSelectBox=BUE.selectbox;eDefTable=BUE.table;eDefRow=BUE.trow;eDefNoEnd=BUE.nctag;eDefRegEsc=BUE.regesc;eDefParseTag=BUE.parseHtml;eDefInputText=function(n,v,s){return BUE.input('text',n,v,{'size':s||null})};eDefInputSubmit=function(n,v){return BUE.input('submit',n,v)};(function(E,$){E.prv=function(safecheck){var E=this;if(E.prvOn){return E.prvHide();} |
return{tag:tag,attributes:attr,html:match[4]};};E.insertObj=function(obj,opt){if(!obj||!obj.tag){return this;} |
| 14 |
|
var E=this,tag=obj.tag,opt=$.extend({cursor:null,extend:true,toggle:false},opt);var sametag,sel=E.getSelection(),selobj=sel&&opt.extend&&BUE.parseHtml(sel);if(sametag=selobj&&selobj.tag==tag){if(opt.toggle)return E.replaceSelection(selobj.html,opt.cursor);(typeof obj.html!='string'||obj.html==sel)&&(obj.html=selobj.html);obj.attributes=$.extend(selobj.attributes,obj.attributes);} |
| 15 |
|
if(sametag||Nc(tag)||obj.html){return E.replaceSelection(BUE.objHtml(obj),opt.cursor);} |
| 16 |
|
var html=Html(tag,'',obj.attributes);return E.tagSelection(html.substr(0,html.length-tag.length-3),'</'+tag+'>',opt.cursor);};var Html=BUE.html;var Nc=BUE.nctag;})(BUE.instance.prototype,jQuery);eDefHTML=BUE.html;eDefInput=BUE.input;eDefSelectBox=BUE.selectbox;eDefTable=BUE.table;eDefRow=BUE.trow;eDefNoEnd=BUE.nctag;eDefRegEsc=BUE.regesc;eDefParseTag=BUE.parseHtml;eDefInputText=function(n,v,s){return BUE.input('text',n,v,{'size':s||null})};eDefInputSubmit=function(n,v){return BUE.input('submit',n,v)};(function(E,$){E.prv=function(safecheck){var E=this;if(E.prvOn){return E.prvHide();} |
| 17 |
var safecheck=typeof safecheck=='undefined'?true:safecheck;var content=E.getContent();if(safecheck&&!(E.safeToPreview=E.safeToPreview||content.indexOf('<')==-1)){content='<div class="warning">'+Drupal.t('The preview is disabled due to previously inserted HTML code in the content. This aims to protect you from any potentially harmful code inserted by other editors or users. If you own the content, just preview an empty text to re-enable the preview.')+'</div>';} |
var safecheck=typeof safecheck=='undefined'?true:safecheck;var content=E.getContent();if(safecheck&&!(E.safeToPreview=E.safeToPreview||content.indexOf('<')==-1)){content='<div class="warning">'+Drupal.t('The preview is disabled due to previously inserted HTML code in the content. This aims to protect you from any potentially harmful code inserted by other editors or users. If you own the content, just preview an empty text to re-enable the preview.')+'</div>';} |
| 18 |
return E.prvShow(BUE.autop(content));};E.prvShow=function(html,wrap){var E=this;var $T=$(E.textArea);var $P=$(E.preview=E.preview||BUE.$html('<div class="preview" style="display:none; overflow:auto"></div>').insertBefore($T)[0]);if(typeof wrap=='undefined'||wrap){html='<div class="'+(E.textArea.name=='comment'?'comment':'node')+'"><div class="content">'+html+'</div></div>';} |
return E.prvShow(BUE.autop(content));};E.prvShow=function(html,wrap){var E=this;var $T=$(E.textArea);var $P=$(E.preview=E.preview||BUE.$html('<div class="preview" style="display:none; overflow:auto"></div>').insertBefore($T)[0]);if(typeof wrap=='undefined'||wrap){html='<div class="'+(E.textArea.name=='comment'?'comment':'node')+'"><div class="content">'+html+'</div></div>';} |
| 19 |
if(E.prvOn){$P.html(html);return E;} |
if(E.prvOn){$P.html(html);return E;} |
| 28 |
var $p=$(I.pop),$w=$(window),o=$.browser.opera;var h=(o?$w[0].innerHeight:$w.height())-$p.height(),w=$w.width()-$p.width();$p.css({'top':$w.scrollTop()+Math.max(0,h/2),'left':Math.max(0,w/2)});};I.finish=function(file,win){I.sendto(file,win,I.pop);};I.fillTarget=function(file,win,pop){var target=I.target,el=target.form.elements,val={'alt':file.name,'width':file.width,'height':file.height};target.value=file.url;for(var i in val){if(el['attr_'+i])el['attr_'+i].value=val[i];} |
var $p=$(I.pop),$w=$(window),o=$.browser.opera;var h=(o?$w[0].innerHeight:$w.height())-$p.height(),w=$w.width()-$p.width();$p.css({'top':$w.scrollTop()+Math.max(0,h/2),'left':Math.max(0,w/2)});};I.finish=function(file,win){I.sendto(file,win,I.pop);};I.fillTarget=function(file,win,pop){var target=I.target,el=target.form.elements,val={'alt':file.name,'width':file.width,'height':file.height};target.value=file.url;for(var i in val){if(el['attr_'+i])el['attr_'+i].value=val[i];} |
| 29 |
pop.close();target.focus();};I.highlightTarget=function(win,pop){I.win.imce.highlight(I.target.value.substr(I.target.value.lastIndexOf('/')+1));};window.bueImceLoad=function(win){(I.win=win).imce.setSendTo(Drupal.t('Send to editor'),I.finish);I.ready(win,I.pop);};})(BUE.instance.prototype,jQuery);eDefBrowseButton=function(l,f,t){return BUE.imce.button(f,t)};(function(E,$){E.wrapLines=function(a1,b1,b2,a2){var E=this,str=E.getSelection().replace(/\r\n|\r/g,'\n'),Esc=BUE.regesc;if(!str){return E.tagSelection(a1+b1,b2+a2);} |
pop.close();target.focus();};I.highlightTarget=function(win,pop){I.win.imce.highlight(I.target.value.substr(I.target.value.lastIndexOf('/')+1));};window.bueImceLoad=function(win){(I.win=win).imce.setSendTo(Drupal.t('Send to editor'),I.finish);I.ready(win,I.pop);};})(BUE.instance.prototype,jQuery);eDefBrowseButton=function(l,f,t){return BUE.imce.button(f,t)};(function(E,$){E.wrapLines=function(a1,b1,b2,a2){var E=this,str=E.getSelection().replace(/\r\n|\r/g,'\n'),Esc=BUE.regesc;if(!str){return E.tagSelection(a1+b1,b2+a2);} |
| 30 |
var M,R=new RegExp('^'+Esc(a1+b1)+'((.|\n)*)'+Esc(b2+a2)+'$');if(M=str.match(R)){R=new RegExp(Esc(b2)+'\n'+Esc(b1),'g');return E.replaceSelection(M[1].replace(R,'\n'));} |
var M,R=new RegExp('^'+Esc(a1+b1)+'((.|\n)*)'+Esc(b2+a2)+'$');if(M=str.match(R)){R=new RegExp(Esc(b2)+'\n'+Esc(b1),'g');return E.replaceSelection(M[1].replace(R,'\n'));} |
| 31 |
return E.replaceSelection(a1+b1+str.replace(/\n/g,b2+'\n'+b1)+b2+a2);};E.toggleTag=function(tag,attributes,cursor){var E=this,S=E.getSelection(),O=BUE.parseHtml(S,tag);if(O){return E.replaceSelection(O.html,cursor);} |
return E.replaceSelection(a1+b1+str.replace(/\n/g,b2+'\n'+b1)+b2+a2);};E.toggleTag=function(tag,attributes,cursor){var E=this,obj={tag:tag,html:E.getSelection(),attributes:attributes};return E.insertObj(obj,{cursor:cursor,toggle:true});};E.help=function(effect){var E=this;if(!E.helpHTML){var akey=E.ctrlKeys?'Ctrl':($.browser.mozilla?'Shift + Alt':($.browser.msie?'Alt':''));for(var B,rows=[],i=0;B=E.buttons[i];i++){rows[i]=[BUE.input(B.type,null,B.value||null,{'class':B.className,src:B.src||null,style:$(B).attr('style')}),B.title];if(B.accessKey&&akey){rows[i][1]+=' ('+akey+' + '+B.accessKey+')';}} |
|
E.replaceSelection(BUE.html(tag,S,attributes),cursor);if(!S&&!BUE.nctag(tag)){var pos=E.posSelection().end-tag.length-3;E.makeSelection(pos,pos);} |
|
|
return E;};E.help=function(effect){var E=this;if(!E.helpHTML){var akey=E.ctrlKeys?'Ctrl':($.browser.mozilla?'Shift + Alt':($.browser.msie?'Alt':''));for(var B,rows=[],i=0;B=E.buttons[i];i++){rows[i]=[BUE.input(B.type,null,B.value||null,{'class':B.className,src:B.src||null,style:$(B).attr('style')}),B.title];if(B.accessKey&&akey){rows[i][1]+=' ('+akey+' + '+B.accessKey+')';}} |
|
| 32 |
E.helpHTML=BUE.table(rows,{id:'bue-help','class':'bue-'+E.tplid});} |
E.helpHTML=BUE.table(rows,{id:'bue-help','class':'bue-'+E.tplid});} |
| 33 |
E.quickPop.open(E.helpHTML,effect);return E;};E.tagChooser=function(tags,opt){var E=this,opt=$.extend({wrapEach:'li',wrapAll:'ul',applyTag:true,effect:'slideDown'},opt);var wa=BUE.html(opt.wrapAll||'div','',{'class':'tag-chooser'}),$wa=$html(wa);var we=BUE.html(opt.wrapEach,'',{'class':'choice'});var lnk=BUE.html('a','',{href:'#','class':'choice-link'});for(var i in tags){var data={nc:BUE.nctag(tags[i][0]),html:BUE.html(tags[i][0],tags[i][1],tags[i][2])},$lnk=$html(lnk);$lnk.html(opt.applyTag?data.html:tags[i][1]).bind('click',data,function(e){var h=e.data.html,p1=h.substr(0,h.indexOf('>')+1);e.data.nc?E.replaceSelection(p1).focus():E.tagSelection(p1,h.substr(h.lastIndexOf('<'))).focus();return false;}).appendTo($wa)[we?'wrap':'end'](we);} |
E.quickPop.open(E.helpHTML,effect);return E;};E.tagChooser=function(tags,opt){var E=this,opt=$.extend({wrapEach:'li',wrapAll:'ul',applyTag:true,effect:'slideDown'},opt);var wa=BUE.html(opt.wrapAll||'div','',{'class':'tag-chooser'}),$wa=$html(wa);var we=BUE.html(opt.wrapEach,'',{'class':'choice'});var lnk=BUE.html('a','',{href:'#','class':'choice-link'});$.each(tags,function(i,inf){var obj={tag:inf[0],html:inf[1],attributes:inf[2]};$html(lnk).html(opt.applyTag?BUE.objHtml(obj):obj.html).click(function(){E.insertObj($.extend(obj,{html:null}));return false;}).appendTo($wa)[we?'wrap':'end'](we);});E.quickPop.open($wa,opt.effect);return E;};E.tagDialog=function(tag,fields,opt){var E=this,S=E.getSelection(),O=BUE.parseHtml(S,tag)||{'attributes':{}};for(var field,hidden='',rows=[],i=0,n=0;field=fields[i];i++,n++){field=fproc(field,O,S);if(field.type=='hidden'){hidden+=fhtml(field);n--;continue;} |
| 34 |
E.quickPop.open($wa,opt.effect);return E;};E.tagDialog=function(tag,fields,opt){var E=this,S=E.getSelection(),O=BUE.parseHtml(S,tag)||{'attributes':{}};for(var field,rows=[],i=0,n=0;field=fields[i];i++,n++){field=fproc(field,O,S);rows[n]=[field.title,fhtml(field)];while(field.getnext&&(field=fields[++i])){rows[n][1]+=fhtml(fproc(field,O,S));}} |
rows[n]=[field.title,fhtml(field)];while(field.getnext&&(field=fields[++i])){rows[n][1]+=fhtml(fproc(field,O,S));}} |
| 35 |
var opt=$.extend({title:Drupal.t('Tag editor - @tag',{'@tag':tag.toUpperCase()}),stitle:Drupal.t('OK'),validate:false,submit:function(a,b){return E.tgdSubmit(a,b)},effect:'show'},opt);var table=BUE.table(rows,{'class':'bue-tgd-table'}) |
var opt=$.extend({title:Drupal.t('Tag editor - @tag',{'@tag':tag.toUpperCase()}),stitle:Drupal.t('OK'),validate:false,submit:function(a,b){return E.tgdSubmit(a,b)},effect:'show'},opt);var table=BUE.table(rows,{'class':'bue-tgd-table'}) |
| 36 |
var sbm=BUE.html('div',BUE.input('submit','bue_tgd_submit',opt.stitle));var $form=$html(BUE.html('form',table+sbm,{name:'bue_tgd_form',id:'bue-tgd-form'}));E.dialog.open(opt.title,$form,opt.effect);$form.submit(function(){return fsubmit(tag,this,E,opt)})[0].elements[0].focus();return E;};E.tgdSubmit=function(tag,form){var E=this,O=BUE.parseHtml(E.getSelection(),tag)||{'attributes':{}};for(var name,el,i=0;el=form.elements[i];i++){if(el.name.substr(0,5)=='attr_'){name=el.name.substr(5);if(name=='html')O.html=el.value;else O.attributes[name]=el.value.replace(/\x22/g,'"').replace(/>/g,'>').replace(/</g,'<')||null;}} |
var sbm=BUE.html('div',BUE.input('submit','bue_tgd_submit',opt.stitle));var $form=$html(BUE.html('form',table+sbm+hidden,{name:'bue_tgd_form',id:'bue-tgd-form'}));E.dialog.open(opt.title,$form,opt.effect);$form.submit(function(){return fsubmit(tag,this,opt,E)})[0].elements[0].focus();return E;};E.tgdSubmit=function(tag,form){var E=this,obj={tag:tag,html:null,attributes:{}};for(var name,el,i=0;el=form.elements[i];i++){if(el.name.substr(0,5)=='attr_'){name=el.name.substr(5);if(name=='html')obj.html=el.value;else obj.attributes[name]=el.value.replace(/\x22/g,'"').replace(/>/g,'>').replace(/</g,'<')||null;}} |
| 37 |
if(typeof O.html=='string'||BUE.nctag(tag)){E.replaceSelection(BUE.html(tag,O.html,O.attributes));} |
return E.insertObj(obj);};var $html=BUE.$html;var fhtml=function(f){var h=f.prefix||'';switch(f.type){case'select':h+=BUE.selectbox(f.fname,f.value,f.options||{},f.attributes);break;case'textarea':h+=BUE.html('textarea','\n'+f.value,f.attributes);break;default:h+=BUE.input(f.type,f.fname,f.value,f.attributes);break;} |
|
else{var h=BUE.html(tag,'',O.attributes);E.tagSelection(h.substr(0,h.length-tag.length-3),'</'+tag+'>');} |
|
|
return E;};var $html=BUE.$html;var fhtml=function(f){var h=f.prefix||'';switch(f.type){case'select':h+=BUE.selectbox(f.fname,f.value,f.options||{},f.attributes);break;case'textarea':h+=BUE.html('textarea','\n'+f.value,f.attributes);break;default:h+=BUE.input('text',f.fname,f.value,f.attributes);break;} |
|
| 38 |
return h+(f.suffix||'');};var fproc=function(f,O,S){f=typeof(f)=='string'?{'name':f}:f;if(f.name=='html'){f.value=typeof O.html=='string'?O.html:(S||f.value||'');} |
return h+(f.suffix||'');};var fproc=function(f,O,S){f=typeof(f)=='string'?{'name':f}:f;if(f.name=='html'){f.value=typeof O.html=='string'?O.html:(S||f.value||'');} |
| 39 |
f.value=Drupal.checkPlain(typeof O.attributes[f.name]=='string'?O.attributes[f.name]:(f.value||''));f.title=typeof f.title=='string'?f.title:f.name.substr(0,1).toUpperCase()+f.name.substr(1);f.fname='attr_'+f.name;f.attributes=$.extend({name:f.fname,id:f.fname},f.attributes);f.attributes['class']=f.required?(f.attributes['class']||'')+' required':(f.attributes['class']||null);f.type=f.value.indexOf('\n')>-1?'textarea':(f.type||'text');return f;};var fsubmit=function(tag,form,E,opt){for(var el,i=0;el=form.elements[i];i++)if($(el).is('.required')&&!el.value){$(el).fadeOut('fast').fadeIn('fast',function(){$(this).focus()});return false;} |
f.value=Drupal.checkPlain(typeof O.attributes[f.name]=='string'?O.attributes[f.name]:(f.value||''));f.title=typeof f.title=='string'?f.title:f.name.substr(0,1).toUpperCase()+f.name.substr(1);f.fname='attr_'+f.name;f.attributes=$.extend({name:f.fname,id:f.fname},f.attributes);f.attributes['class']=f.required?(f.attributes['class']||'')+' required':(f.attributes['class']||null);f.type=f.value.indexOf('\n')>-1?'textarea':(f.type||'text');return f;};var fsubmit=function(tag,form,opt,E){for(var el,i=0;el=form.elements[i];i++)if($(el).is('.required')&&!el.value){$(el).fadeOut('fast').fadeIn('fast',function(){$(this).focus()});return false;} |
| 40 |
var V=opt.validate;if(V&&$.isFunction(V)){try{if(!V(tag,form))return false}catch(e){alert(e.name+': '+e.message)};} |
var V=opt.validate;if(V&&$.isFunction(V)){try{if(!V(tag,form,opt,E))return false}catch(e){alert(e.name+': '+e.message)};} |
| 41 |
E.dialog.close();var S=opt.submit;S=typeof S=='string'?window[S]:S;if(S&&$.isFunction(S)){try{S(tag,form)}catch(e){alert(e.name+': '+e.message)};} |
E.dialog.close();var S=opt.submit;S=typeof S=='string'?window[S]:S;if(S&&$.isFunction(S)){try{S(tag,form,opt,E)}catch(e){alert(e.name+': '+e.message)};} |
| 42 |
return false;};})(BUE.instance.prototype,jQuery);eDefSelProcessLines=eDefTagLines=function(a,b,c,d){BUE.active.wrapLines(a,b,c,d)};eDefTagger=function(a,b,c){BUE.active.toggleTag(a,b,c)};eDefHelp=function(fx){BUE.active.help(fx)};eDefTagDialog=function(a,b,c,d,e,f){BUE.active.tagDialog(a,b,{title:c,stitle:d,submit:e,effect:f})};eDefTagInsert=function(a,b){BUE.active.tgdSubmit(a,b)};eDefTagChooser=function(a,b,c,d,e){BUE.active.tagChooser(a,{applyTag:b,wrapEach:c,wrapAll:d,effect:e})}; |
return false;};})(BUE.instance.prototype,jQuery);eDefSelProcessLines=eDefTagLines=function(a,b,c,d){BUE.active.wrapLines(a,b,c,d)};eDefTagger=function(a,b,c){BUE.active.toggleTag(a,b,c)};eDefHelp=function(fx){BUE.active.help(fx)};eDefTagDialog=function(a,b,c,d,e,f){BUE.active.tagDialog(a,b,{title:c,stitle:d,submit:e,effect:f})};eDefTagInsert=function(a,b){BUE.active.tgdSubmit(a,b)};eDefTagChooser=function(a,b,c,d,e){BUE.active.tagChooser(a,{applyTag:b,wrapEach:c,wrapAll:d,effect:e})}; |