Lines Matching refs:panel

179 Event.stopEvent(ev);},_setupAfterElement:function(){if(!this.afterElement){this.afterElement=document.createElement('h2');this.afterElement.className='yui-editor-skipheader';this.afterElement.tabIndex='-1';this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get('element_cont').get('firstChild').appendChild(this.afterElement);}},EDITOR_PANEL_ID:'yui-editor-panel',SEP_DOMPATH:'<',STR_LEAVE_EDITOR:'You have left the Rich Text Editor.',STR_BEFORE_EDITOR:'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names. <h4>Common formatting keyboard shortcuts:</h4><ul><li>Control Shift B sets text to bold</li> <li>Control Shift I sets text to italic</li> <li>Control Shift U underlines text</li> <li>Control Shift [ aligns text left</li> <li>Control Shift | centers text</li> <li>Control Shift ] aligns text right</li> <li>Control Shift L adds an HTML link</li> <li>To exit this text editor use the keyboard shortcut Control Shift ESC.</li></ul>',STR_CLOSE_WINDOW:'Close Window',STR_CLOSE_WINDOW_NOTE:'To close this window use the Escape key',STR_TITLE:'Rich Text Area.',STR_IMAGE_HERE:'Image Url Here',STR_IMAGE_PROP_TITLE:'Image Options',STR_IMAGE_URL:'Image Url',STR_IMAGE_TITLE:'Description',STR_IMAGE_SIZE:'Size',STR_IMAGE_ORIG_SIZE:'Original Size',STR_IMAGE_COPY:'<span class="tip"><span class="icon icon-info"></span><strong>Note:</strong>To move this image just highlight it, cut, and paste where ever you\'d like.</span>',STR_IMAGE_PADDING:'Padding',STR_IMAGE_BORDER:'Border',STR_IMAGE_TEXTFLOW:'Text Flow',STR_LOCAL_FILE_WARNING:'<span class="tip"><span class="icon icon-warn"></span><strong>Note:</strong>This image/link points to a file on your computer and will not be accessible to others on the internet.</span>',STR_LINK_PROP_TITLE:'Link Options',STR_LINK_PROP_REMOVE:'Remove link from text',STR_LINK_URL:'Link URL',STR_LINK_NEW_WINDOW:'Open in a new window.',STR_LINK_TITLE:'Description',STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_HIDDEN:'hidden',CLASS_LOCAL_FILE:'warning-localfile',CLASS_CONTAINER:'yui-editor-container',CLASS_EDITABLE:'yui-editor-editable',CLASS_EDITABLE_CONT:'yui-editor-editable-container',CLASS_PREFIX:'yui-editor',browser:YAHOO.env.ua,init:function(p_oElement,p_oAttributes){YAHOO.widget.Editor.superclass.init.call(this,p_oElement,p_oAttributes);this.get('element_cont').addClass(this.CLASS_CONTAINER);Dom.addClass(this.get('iframe').get('parentNode'),this.CLASS_EDITABLE_CONT);this.get('iframe').addClass(this.CLASS_EDITABLE);},initAttributes:function(attr){YAHOO.widget.Editor.superclass.initAttributes.call(this,attr);var self=this;this.setAttributeConfig('textarea',{value:attr.textarea,writeOnce:true});this.setAttributeConfig('height',{value:attr.height||Dom.getStyle(self.get('textarea'),'height'),writeOnce:true});this.setAttributeConfig('width',{value:attr.width||Dom.getStyle(this.get('textarea'),'width'),writeOnce:true});this.setAttributeConfig('blankimage',{value:attr.blankimage||this._getBlankImage()});this.setAttributeConfig('hiddencss',{value:attr.hiddencss||'.hidden div,.hidden p,.hidden span,.hidden img { border: 1px dotted #ccc; } .hidden .yui-non { border: none; } .hidden img { padding: 2px; }',writeOnce:true});this.setAttributeConfig('css',{value:attr.css||'body { padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } span.yui-tag-a { color: blue; text-decoration: underline; } span.yui-tag-blockquote { margin: 1em; display: block; } span.yui-tag-indent { margin-left: 1em; display: block; } .warning-localfile { border-bottom: 1px dashed red !important; }',writeOnce:true});this.setAttributeConfig('html',{value:attr.html||'<!DOCTYPE HTML PUBLIC "-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN" "http:/'+'/www.w3.org/TR/html4/strict.dtd"><html><head><title>{TITLE}</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>{CSS}</style><style>{HIDDEN_CSS}</style></head><body onload="document.body._rteLoaded = true;">{CONTENT}</body></html>',writeOnce:true});this.setAttributeConfig('handleSubmit',{value:false,writeOnce:true,method:function(exec){if(exec){var ta=this.get('textarea');if(ta.form){Event.addListener(ta.form,'submit',function(){this.saveHTML();},this,true);}}}});this.setAttributeConfig('iframe',{value:null,writeOnce:true});this.setAttributeConfig('disabled',{value:false,method:function(disabled){if(disabled){if(!this._mask){this._setDesignMode('off');this.toolbar.set('disabled',true);this._mask=document.createElement('DIV');Dom.setStyle(this._mask,'height','100%');Dom.setStyle(this._mask,'width','100%');Dom.setStyle(this._mask,'position','absolute');Dom.setStyle(this._mask,'top','0');Dom.setStyle(this._mask,'left','0');Dom.setStyle(this._mask,'opacity','.5');Dom.addClass(this._mask,'yui-editor-masked');this.get('iframe').get('parentNode').appendChild(this._mask);}}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;this.toolbar.set('disabled',false);this._setDesignMode('on');this._focusWindow();}}}});this.setAttributeConfig('element_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar_cont',{value:null,writeOnce:true});this.setAttributeConfig('toolbar',{value:attr.toolbar||{collapse:true,titlebar:'Text Editing Tools',draggable:false,buttons:[{group:'fontstyle',label:'Font Name and Size',buttons:[{type:'select',label:'Arial',value:'fontname',disabled:true,menu:[{text:'Arial',checked:true},{text:'Arial Black'},{text:'Comic Sans MS'},{text:'Courier New'},{text:'Lucida Console'},{text:'Tahoma'},{text:'Times New Roman'},{text:'Trebuchet MS'},{text:'Verdana'}]},{type:'spin',label:'13',value:'fontsize',range:[9,75],disabled:true}]},{type:'separator'},{group:'textstyle',label:'Font Style',buttons:[{type:'push',label:'Bold CTRL + SHIFT + B',value:'bold'},{type:'push',label:'Italic CTRL + SHIFT + I',value:'italic'},{type:'push',label:'Underline CTRL + SHIFT + U',value:'underline'},{type:'separator'},{type:'push',label:'Subscript',value:'subscript',disabled:true},{type:'push',label:'Superscript',value:'superscript',disabled:true},{type:'separator'},{type:'color',label:'Font Color',value:'forecolor',disabled:true},{type:'color',label:'Background Color',value:'backcolor',disabled:true},{type:'separator'},{type:'push',label:'Remove Formatting',value:'removeformat',disabled:true},{type:'push',label:'Hidden Elements',value:'hiddenelements'}]},{type:'separator'},{group:'alignment',label:'Alignment',buttons:[{type:'push',label:'Align Left CTRL + SHIFT + [',value:'justifyleft'},{type:'push',label:'Align Center CTRL + SHIFT + |',value:'justifycenter'},{type:'push',label:'Align Right CTRL + SHIFT + ]',value:'justifyright'},{type:'push',label:'Justify',value:'justifyfull'}]},{type:'separator'},{group:'parastyle',label:'Paragraph Style',buttons:[{type:'select',label:'Normal',value:'heading',disabled:true,menu:[{text:'Normal',value:'none',checked:true},{text:'Header 1',value:'h1'},{text:'Header 2',value:'h2'},{text:'Header 3',value:'h3'},{text:'Header 4',value:'h4'},{text:'Header 5',value:'h5'},{text:'Header 6',value:'h6'}]}]},{type:'separator'},{group:'indentlist',label:'Indenting and Lists',buttons:[{type:'push',label:'Indent',value:'indent',disabled:true},{type:'push',label:'Outdent',value:'outdent',disabled:true},{type:'push',label:'Create an Unordered List',value:'insertunorderedlist'},{type:'push',label:'Create an Ordered List',value:'insertorderedlist'}]},{type:'separator'},{group:'insertitem',label:'Insert Item',buttons:[{type:'push',label:'HTML Link CTRL + SHIFT + L',value:'createlink',disabled:true},{type:'push',label:'Insert Image',value:'insertimage'}]}]},writeOnce:true,method:function(toolbar){}});this.setAttributeConfig('animate',{value:false,validator:function(value){var ret=true;if(!YAHOO.util.Anim){ret=false;}
180 return ret;}});this.setAttributeConfig('panel',{value:null,writeOnce:true,validator:function(value){var ret=true;if(!YAHOO.widget.Panel){ret=false;}
222 this.openWindow(win);Event.onAvailable('insertimage_url',function(){window.setTimeout(function(){YAHOO.util.Dom.get('insertimage_url').focus();if(blankimage){YAHOO.util.Dom.get('insertimage_url').select();}},50);if(this.get('localFileWarning')){Event.on('insertimage_url','blur',function(){var url=Dom.get('insertimage_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');if((this.browser.webkit&&!this.browser.webkit3)||this.browser.opera){var str=this.STR_IMAGE_COPY;this.get('panel').setFooter(str);}
228 var str='<label for="createlink_url"><strong>'+this.STR_LINK_URL+':</strong> <input type="text" name="createlink_url" id="createlink_url" value="'+url+'"'+((localFile)?' class="warning"':'')+'></label>';str+='<label for="createlink_target"><strong>&nbsp;</strong><input type="checkbox" name="createlink_target_" id="createlink_target" value="_blank"'+((target)?' checked':'')+'> '+this.STR_LINK_NEW_WINDOW+'</label>';str+='<label for="createlink_title"><strong>'+this.STR_LINK_TITLE+':</strong> <input type="text" name="createlink_title" id="createlink_title" value="'+title+'"></label>';var body=document.createElement('div');body.innerHTML=str;var unlinkCont=document.createElement('div');unlinkCont.className='removeLink';var unlink=document.createElement('a');unlink.href='#';unlink.innerHTML=this.STR_LINK_PROP_REMOVE;unlink.title=this.STR_LINK_PROP_REMOVE;Event.on(unlink,'click',function(ev){Event.stopEvent(ev);this.execCommand('unlink');this.closeWindow();},this,true);unlinkCont.appendChild(unlink);body.appendChild(unlinkCont);win.setHeader(this.STR_LINK_PROP_TITLE);win.setBody(body);Event.onAvailable('createlink_url',function(){window.setTimeout(function(){try{YAHOO.util.Dom.get('createlink_url').focus();}catch(e){}},50);Event.on('createlink_url','blur',function(){var url=Dom.get('createlink_url');if((url.value!='')&&((url.value.indexOf('file:/')!=-1)||(url.value.indexOf(':\\')!=-1))){Dom.addClass(url,'warning');var str=this.STR_LOCAL_FILE_WARNING;this.get('panel').setFooter(str);}else{Dom.removeClass(url,'warning');this.get('panel').setFooter(' ');}},this,true);},this,true);this.openWindow(win);});},_handleCreateLinkWindowClose:function(){var url=Dom.get('createlink_url');var target=Dom.get('createlink_target');var title=Dom.get('createlink_title');var el=this.currentElement[0];if(url&&url.value){var urlValue=url.value;if((urlValue.indexOf(':/'+'/')==-1)&&(urlValue.substring(0,1)!='/')&&(urlValue.substring(0,6).toLowerCase()!='mailto')){if((urlValue.indexOf('@')!=-1)&&(urlValue.substring(0,6).toLowerCase()!='mailto')){urlValue='mailto:'+urlValue;}else{urlValue='http:/'+'/'+urlValue;}}
281 html=html.replace(/yui-tag-a/gi,'');html=html.replace(/yui-tag-span/gi,'');html=html.replace(/yui-tag/gi,'');html=html.replace(/yui-non/gi,'');html=html.replace(/yui-img/gi,'');html=html.replace(/ tag="span"/gi,'');html=html.replace(/ class=""/gi,'');html=html.replace(/ class=" "/gi,'');html=html.replace(/ class=" "/gi,'');html=html.replace(/ target=""/gi,'');html=html.replace(/ title=""/gi,'');html=html.replace(/<br><li/gi,'<li');html=html.replace(/<YUI_BR>/g,'<br>');html=html.replace(/<YUI_IMG([^>]*)>/g,'<img$1>');html=html.replace(/<YUI_UL([^>]*)>/g,'<ul$1>');html=html.replace(/<\/YUI_UL>/g,'<\/ul>');return html;},clearEditorDoc:function(){this._getDoc().body.innerHTML='&nbsp;';},_renderPanel:function(){if(!YAHOO.widget.EditorInfo.panel){var panel=new YAHOO.widget.Panel(this.EDITOR_PANEL_ID,{width:'300px',iframe:true,visible:false,underlay:'none',draggable:false,close:false});YAHOO.widget.EditorInfo.panel=panel;}else{var panel=YAHOO.widget.EditorInfo.panel;}
282 this.set('panel',panel);this.get('panel').setBody('---');this.get('panel').setHeader(' ');this.get('panel').setFooter(' ');if(this.DOMReady){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');}else{Event.onDOMReady(function(){this.get('panel').render(document.body);Dom.addClass(this.get('panel').element,'yui-editor-panel');},this,true);}
283 this.get('panel').showEvent.subscribe(function(){YAHOO.util.Dom.setStyle(this.element,'display','block');});return this.get('panel');},openWindow:function(win){this.toolbar.set('disabled',true);Event.addListener(document,'keypress',this._closeWindow,this,true);if(YAHOO.widget.EditorInfo.window.win&&YAHOO.widget.EditorInfo.window.scope){YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);}
284 YAHOO.widget.EditorInfo.window.win=win;YAHOO.widget.EditorInfo.window.scope=this;var self=this,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]-20),(xy[1]+elXY[1]+10)],wWidth=(parseInt(win.attrs.width)/2),align='center';this.fireEvent('beforeOpenWindow',{type:'beforeOpenWindow',win:win,panel:panel});body=document.createElement('div');body.className=this.CLASS_PREFIX+'-body-cont';var _note=document.createElement('h3');_note.className='yui-editor-skipheader';_note.innerHTML=this.STR_CLOSE_WINDOW_NOTE;body.appendChild(_note);form=document.createElement('form');form.setAttribute('method','GET');var windowName=win.name;Event.addListener(form,'submit',function(ev){var evName='window'+windowName+'Submit';self.fireEvent(evName,{type:evName,target:this});Event.stopEvent(ev);},this,true);body.appendChild(form);Dom.setStyle(panel.element.firstChild,'width',win.attrs.width);if(Lang.isObject(win.body)){form.appendChild(win.body);}else{var _tmp=document.createElement('div');_tmp.innerHTML=win.body;form.appendChild(_tmp);}
285 var _close=document.createElement('span');_close.innerHTML='X';_close.title=this.STR_CLOSE_WINDOW;_close.className='close';Event.addListener(_close,'click',function(){this.closeWindow();},this,true);var _knob=document.createElement('span');_knob.innerHTML='^';_knob.className='knob';win._knob=_knob;var _header=document.createElement('h3');_header.innerHTML=win.header;panel.cfg.setProperty('width',win.attrs.width);panel.setHeader(' ');panel.appendToHeader(_header);_header.appendChild(_close);_header.appendChild(_knob);panel.setBody(' ');panel.setFooter(' ');if(win.footer!=null){panel.setFooter(win.footer);}
286 panel.appendToBody(body);panel.showEvent.subscribe(function(){Event.addListener(panel.element,'click',function(ev){Event.stopPropagation(ev);});},this,true);panel.hideEvent.subscribe(function(){this.currentWindow=null;var evName='window'+windowName+'Close';this.fireEvent(evName,{type:evName,target:this});},this,true);this.currentWindow=win;this.moveWindow(true);panel.show();this.fireEvent('afterOpenWindow',{type:'afterOpenWindow',win:win,panel:panel});},moveWindow:function(force){if(!this.currentWindow){return false;}
287 var win=this.currentWindow,xy=Dom.getXY(this.currentElement[0]),elXY=Dom.getXY(this.get('iframe').get('element')),panel=this.get('panel'),newXY=[(xy[0]+elXY[0]),(xy[1]+elXY[1])],wWidth=(parseInt(win.attrs.width)/2),align='center',orgXY=panel.cfg.getProperty('xy'),_knob=win._knob;newXY[0]=((newXY[0]-wWidth)+20);newXY[0]=newXY[0]-Dom.getDocumentScrollLeft(this._getDoc());newXY[1]=newXY[1]-Dom.getDocumentScrollTop(this._getDoc());if(this.currentElement[0].tagName&&(this.currentElement[0].tagName.toLowerCase()=='img')){if(this.currentElement[0].src.indexOf(this.get('blankimage'))!=-1){newXY[0]=(newXY[0]+(75/2));newXY[1]=(newXY[1]+75);}else{var w=parseInt(this.currentElement[0].width);var h=parseInt(this.currentElement[0].height);newXY[0]=(newXY[0]+(w/2));newXY[1]=(newXY[1]+h);}
296 if(this.get('animate')){Dom.setStyle(panel.element,'opacity','0');var anim=new YAHOO.util.Anim(panel.element,{opacity:{from:0,to:1}},.1,YAHOO.util.Easing.easeOut);panel.cfg.setProperty('xy',newXY);anim.onComplete.subscribe(function(){if(this.browser.ie){panel.element.style.filter='none';}},this,true);anim.animate();}else{panel.cfg.setProperty('xy',newXY);}}else{if(this.get('animate')){var anim=new YAHOO.util.Anim(panel.element,{},.5,YAHOO.util.Easing.easeOut);anim.attributes={top:{to:newXY[1]},left:{to:newXY[0]}}
297 anim.onComplete.subscribe(function(){panel.cfg.setProperty('xy',newXY);});var iframeAnim=new YAHOO.util.Anim(panel.iframe,anim.attributes,.5,YAHOO.util.Easing.easeOut)
298 var _knobAnim=new YAHOO.util.Anim(_knob,{left:{to:_knobLeft}},.75,YAHOO.util.Easing.easeOut);anim.animate();iframeAnim.animate();_knobAnim.animate();}else{_knob.style.left=_knobLeft+'px';panel.cfg.setProperty('xy',newXY);}}}},_closeWindow:function(ev){if(ev.keyCode==27){if(this.currentWindow){this.closeWindow();}}},closeWindow:function(){YAHOO.widget.EditorInfo.window={};this.fireEvent('closeWindow',{type:'closeWindow',win:this.currentWindow});this.currentWindow=null;this.get('panel').hide();this.get('panel').cfg.setProperty('xy',[-900,-900]);this.get('panel').syncIframe();this.unsubscribeAll('afterExecCommand');this.toolbar.set('disabled',false);this._focusWindow();Event.removeListener(document,'keypress',this._closeWindow);},destroy:function(){this.saveHTML();this.toolbar.destroy();Dom.setStyle(this.get('textarea'),'display','block');var textArea=this.get('textarea');this.get('element_cont').get('parentNode').replaceChild(textArea,this.get('element_cont').get('element'));this.get('element_cont').get('element').innerHTML='';for(var i in this){if(Lang.hasOwnProperty(this,i)){this[i]=null;}}
300 return str;}});YAHOO.widget.EditorInfo={window:{},panel:null}