Files
SIG/Scripts/AjaxControlToolkit/Release/HtmlEditor.ToolbarButtons.FontName.js
JORGE LUIS CAUDILLO ESPARZA c35cf91883 Commit inicial Ventas Productivo
2019-08-14 16:40:54 -07:00

1 line
1.6 KiB
JavaScript

Type.registerNamespace("Sys.Extended.UI.HtmlEditor.ToolbarButtons");Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName=function(n){Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.initializeBase(this,[n])};Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.prototype={initialize:function(){Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this,"initialize")},callMethod:function(n){if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this,"callMethod"))return!1;try{var t=this._designPanel;t._execCommand("fontname",!1,n.options.item(n.selectedIndex).value)}catch(i){}},checkState:function(){var u,n,i,t,f,e,r;if(!Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.callBaseMethod(this,"checkState"))return!1;u=this._designPanel;n=null;try{n=Function.createDelegate(u,Sys.Extended.UI.HtmlEditor._queryCommandValue)("fontname")}catch(o){}if(u._FontNotSet||n&&n.length!=0||(n=Sys.Extended.UI.HtmlEditor.getStyle(u._doc.body,"font-family")),i=this._select,t=0,n&&n.length>0){for(f=n.toLowerCase().split(",")[0].replace(/^(['"])/,"").replace(/(['"])$/,""),t=0;t<i.options.length;t++)if(e=i.options.item(t).value.toLowerCase().split(",")[0],e==f)break;if(t==i.options.length)try{r=document.createElement("OPTION");r.value=n.replace(/^(['"])/,"").replace(/(['"])$/,"");r.text=n.split(",")[0].replace(/^(['"])/,"").replace(/(['"])$/,"");i.add(r,Sys.Extended.UI.HtmlEditor.isIE?t:null);$addHandler(r,"click",this._onclick_option$delegate)}catch(o){t=0}}i.selectedIndex=t}};Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName.registerClass("Sys.Extended.UI.HtmlEditor.ToolbarButtons.FontName",Sys.Extended.UI.HtmlEditor.ToolbarButtons.DesignModeSelectButton);