⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fckeditorcode_ie_2.js

📁 动易SiteFactory网上商店系统正式版动易SiteFactory网上商店系统正式版
💻 JS
📖 第 1 页 / 共 5 页
字号:
var FCKToolbarFontSizeCombo=function(tooltip,style){this.CommandName='FontSize';this.Label=this.GetLabel();this.Tooltip=tooltip?tooltip:this.Label;this.Style=style?style:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarFontSizeCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontSizeCombo.prototype.GetLabel=function(){return FCKLang.FontSize;};FCKToolbarFontSizeCombo.prototype.CreateItems=function(targetSpecialCombo){targetSpecialCombo.FieldWidth=70;var aSizes=FCKConfig.FontSizes.split(';');for (var i=0;i<aSizes.length;i++){var aSizeParts=aSizes[i].split('/');this._Combo.AddItem(aSizeParts[0],'<font size="'+aSizeParts[0]+'">'+aSizeParts[1]+'</font>',aSizeParts[1]);};}
var FCKToolbarFontFormatCombo=function(tooltip,style){this.CommandName='FontFormat';this.Label=this.GetLabel();this.Tooltip=tooltip?tooltip:this.Label;this.Style=style?style:FCK_TOOLBARITEM_ICONTEXT;this.NormalLabel='Normal';this.PanelWidth=190;};FCKToolbarFontFormatCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarFontFormatCombo.prototype.GetLabel=function(){return FCKLang.FontFormat;};FCKToolbarFontFormatCombo.prototype.CreateItems=function(targetSpecialCombo){var aNames=FCKLang['FontFormats'].split(';');var oNames={p:aNames[0],pre:aNames[1],address:aNames[2],h1:aNames[3],h2:aNames[4],h3:aNames[5],h4:aNames[6],h5:aNames[7],h6:aNames[8],div:aNames[9]};var aTags=FCKConfig.FontFormats.split(';');for (var i=0;i<aTags.length;i++){var sTag=aTags[i];var sLabel=oNames[sTag];if (sTag=='p') this.NormalLabel=sLabel;this._Combo.AddItem(sTag,'<div class="BaseFont"><'+sTag+'>'+sLabel+'</'+sTag+'></div>',sLabel);};};if (FCKBrowserInfo.IsIE){FCKToolbarFontFormatCombo.prototype.RefreshActiveItems=function(combo,value){if (value==this.NormalLabel){if (combo.Label!='&nbsp;') combo.DeselectAll(true);}else{if (this._LastValue==value) return;combo.SelectItemByLabel(value,true);};this._LastValue=value;};}
var FCKToolbarStyleCombo=function(tooltip,style){this.CommandName='Style';this.Label=this.GetLabel();this.Tooltip=tooltip?tooltip:this.Label;this.Style=style?style:FCK_TOOLBARITEM_ICONTEXT;};FCKToolbarStyleCombo.prototype=new FCKToolbarSpecialCombo;FCKToolbarStyleCombo.prototype.GetLabel=function(){return FCKLang.Style;};FCKToolbarStyleCombo.prototype.CreateItems=function(targetSpecialCombo){var oTargetDoc=targetSpecialCombo._Panel.Document;var aCSSs=FCKConfig.EditorAreaCSS;for (var i=0;i<aCSSs.length;i++) FCKTools.AppendStyleSheet(oTargetDoc,aCSSs[i]);oTargetDoc.body.className+=' ForceBaseFont';if (!FCKBrowserInfo.IsGecko) targetSpecialCombo.OnBeforeClick=this.RefreshVisibleItems;var aCommandStyles=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).Styles;for (var s in aCommandStyles){var oStyle=aCommandStyles[s];var oItem;if (oStyle.IsObjectElement) oItem=targetSpecialCombo.AddItem(s,s);else oItem=targetSpecialCombo.AddItem(s,oStyle.GetOpenerTag()+s+oStyle.GetCloserTag());oItem.Style=oStyle;};};FCKToolbarStyleCombo.prototype.RefreshActiveItems=function(targetSpecialCombo){targetSpecialCombo.DeselectAll();var aStyles=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName).GetActiveStyles();if (aStyles.length>0){for (var i=0;i<aStyles.length;i++) targetSpecialCombo.SelectItem(aStyles[i].Name);targetSpecialCombo.SetLabelById(aStyles[0].Name);}else targetSpecialCombo.SetLabel('');};FCKToolbarStyleCombo.prototype.RefreshVisibleItems=function(targetSpecialCombo){if (FCKSelection.GetType()=='Control') var sTagName=FCKSelection.GetSelectedElement().tagName;for (var i in targetSpecialCombo.Items){var oItem=targetSpecialCombo.Items[i];if ((sTagName&&oItem.Style.Element==sTagName)||(!sTagName&&!oItem.Style.IsObjectElement)) oItem.style.display='';else oItem.style.display='none';};}
var FCKToolbarPanelButton=function(commandName,label,tooltip,style,icon){this.CommandName=commandName;var oIcon;if (icon==null) oIcon=FCKConfig.SkinPath+'toolbar/'+commandName.toLowerCase()+'.gif';else if (typeof(icon)=='number') oIcon=[FCKConfig.SkinPath+'fck_strip.gif',16,icon];var oUIButton=this._UIButton=new FCKToolbarButtonUI(commandName,label,tooltip,oIcon,style);oUIButton._FCKToolbarPanelButton=this;oUIButton.ShowArrow=true;oUIButton.OnClick=FCKToolbarPanelButton_OnButtonClick;};FCKToolbarPanelButton.prototype.TypeName='FCKToolbarPanelButton';FCKToolbarPanelButton.prototype.Create=function(parentElement){parentElement.className+='Menu';this._UIButton.Create(parentElement);var oPanel=FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(this.CommandName)._Panel;oPanel._FCKToolbarPanelButton=this;var eLineDiv=oPanel.Document.body.appendChild(oPanel.Document.createElement('div'));eLineDiv.style.position='absolute';eLineDiv.style.top='0px';var eLine=this.LineImg=eLineDiv.appendChild(oPanel.Document.createElement('IMG'));eLine.className='TB_ConnectionLine';eLine.src=FCK_SPACER_PATH;oPanel.OnHide=FCKToolbarPanelButton_OnPanelHide;};function FCKToolbarPanelButton_OnButtonClick(toolbarButton){var oButton=this._FCKToolbarPanelButton;var e=oButton._UIButton.MainElement;oButton._UIButton.ChangeState(FCK_TRISTATE_ON);oButton.LineImg.style.width=(e.offsetWidth-2)+'px';FCK.ToolbarSet.CurrentInstance.Commands.GetCommand(oButton.CommandName).Execute(0,e.offsetHeight-1,e);};function FCKToolbarPanelButton_OnPanelHide(){var oMenuButton=this._FCKToolbarPanelButton;oMenuButton._UIButton.ChangeState(FCK_TRISTATE_OFF);};FCKToolbarPanelButton.prototype.RefreshState=FCKToolbarButton.prototype.RefreshState;FCKToolbarPanelButton.prototype.Enable=FCKToolbarButton.prototype.Enable;FCKToolbarPanelButton.prototype.Disable=FCKToolbarButton.prototype.Disable;
var FCKToolbarItems=new Object();FCKToolbarItems.LoadedItems=new Object();FCKToolbarItems.RegisterItem=function(itemName,item){this.LoadedItems[itemName]=item;};FCKToolbarItems.GetItem=function(itemName){var oItem=FCKToolbarItems.LoadedItems[itemName];if (oItem) return oItem;switch (itemName){case 'Source':oItem=new FCKToolbarButton('Source',FCKLang.Source,null,FCK_TOOLBARITEM_ICONTEXT,true,true,1);break;case 'DocProps':oItem=new FCKToolbarButton('DocProps',FCKLang.DocProps,null,null,null,null,2);break;case 'Save':oItem=new FCKToolbarButton('Save',FCKLang.Save,null,null,true,null,3);break;case 'NewPage':oItem=new FCKToolbarButton('NewPage',FCKLang.NewPage,null,null,true,null,4);break;case 'Preview':oItem=new FCKToolbarButton('Preview',FCKLang.Preview,null,null,true,null,5);break;case 'Templates':oItem=new FCKToolbarButton('Templates',FCKLang.Templates,null,null,null,null,6);break;case 'About':oItem=new FCKToolbarButton('About',FCKLang.About,null,null,true,null,47);break;case 'Cut':oItem=new FCKToolbarButton('Cut',FCKLang.Cut,null,null,false,true,7);break;case 'Copy':oItem=new FCKToolbarButton('Copy',FCKLang.Copy,null,null,false,true,8);break;case 'Paste':oItem=new FCKToolbarButton('Paste',FCKLang.Paste,null,null,false,true,9);break;case 'PasteText':oItem=new FCKToolbarButton('PasteText',FCKLang.PasteText,null,null,false,true,10);break;case 'PasteWord':oItem=new FCKToolbarButton('PasteWord',FCKLang.PasteWord,null,null,false,true,11);break;case 'Print':oItem=new FCKToolbarButton('Print',FCKLang.Print,null,null,false,true,12);break;case 'SpellCheck':oItem=new FCKToolbarButton('SpellCheck',FCKLang.SpellCheck,null,null,null,null,13);break;case 'Undo':oItem=new FCKToolbarButton('Undo',FCKLang.Undo,null,null,false,true,14);break;case 'Redo':oItem=new FCKToolbarButton('Redo',FCKLang.Redo,null,null,false,true,15);break;case 'SelectAll':oItem=new FCKToolbarButton('SelectAll',FCKLang.SelectAll,null,null,null,null,18);break;case 'RemoveFormat':oItem=new FCKToolbarButton('RemoveFormat',FCKLang.RemoveFormat,null,null,false,true,19);break;case 'FitWindow':oItem=new FCKToolbarButton('FitWindow',FCKLang.FitWindow,null,null,true,true,66);break;case 'Bold':oItem=new FCKToolbarButton('Bold',FCKLang.Bold,null,null,false,true,20);break;case 'Italic':oItem=new FCKToolbarButton('Italic',FCKLang.Italic,null,null,false,true,21);break;case 'Underline':oItem=new FCKToolbarButton('Underline',FCKLang.Underline,null,null,false,true,22);break;case 'StrikeThrough':oItem=new FCKToolbarButton('StrikeThrough',FCKLang.StrikeThrough,null,null,false,true,23);break;case 'Subscript':oItem=new FCKToolbarButton('Subscript',FCKLang.Subscript,null,null,false,true,24);break;case 'Superscript':oItem=new FCKToolbarButton('Superscript',FCKLang.Superscript,null,null,false,true,25);break;case 'OrderedList':oItem=new FCKToolbarButton('InsertOrderedList',FCKLang.NumberedListLbl,FCKLang.NumberedList,null,false,true,26);break;case 'UnorderedList':oItem=new FCKToolbarButton('InsertUnorderedList',FCKLang.BulletedListLbl,FCKLang.BulletedList,null,false,true,27);break;case 'Outdent':oItem=new FCKToolbarButton('Outdent',FCKLang.DecreaseIndent,null,null,false,true,28);break;case 'Indent':oItem=new FCKToolbarButton('Indent',FCKLang.IncreaseIndent,null,null,false,true,29);break;case 'Link':oItem=new FCKToolbarButton('Link',FCKLang.InsertLinkLbl,FCKLang.InsertLink,null,false,true,34);break;case 'Unlink':oItem=new FCKToolbarButton('Unlink',FCKLang.RemoveLink,null,null,false,true,35);break;case 'Anchor':oItem=new FCKToolbarButton('Anchor',FCKLang.Anchor,null,null,null,null,36);break;case 'Image':oItem=new FCKToolbarButton('Image',FCKLang.InsertImageLbl,FCKLang.InsertImage,null,false,true,37);break;case 'Flash':oItem=new FCKToolbarButton('Flash',FCKLang.InsertFlashLbl,FCKLang.InsertFlash,null,false,true,38);break;case 'Table':oItem=new FCKToolbarButton('Table',FCKLang.InsertTableLbl,FCKLang.InsertTable,null,false,true,39);break;case 'SpecialChar':oItem=new FCKToolbarButton('SpecialChar',FCKLang.InsertSpecialCharLbl,FCKLang.InsertSpecialChar,null,false,true,42);break;case 'Smiley':oItem=new FCKToolbarButton('Smiley',FCKLang.InsertSmileyLbl,FCKLang.InsertSmiley,null,false,true,41);break;case 'PageBreak':oItem=new FCKToolbarButton('PageBreak',FCKLang.PageBreakLbl,FCKLang.PageBreak,null,false,true,43);break;case 'UniversalKey':oItem=new FCKToolbarButton('UniversalKey',FCKLang.UniversalKeyboard,null,null,false,true,44);break;case 'Rule':oItem=new FCKToolbarButton('InsertHorizontalRule',FCKLang.InsertLineLbl,FCKLang.InsertLine,null,false,true,40);break;case 'JustifyLeft':oItem=new FCKToolbarButton('JustifyLeft',FCKLang.LeftJustify,null,null,false,true,30);break;case 'JustifyCenter':oItem=new FCKToolbarButton('JustifyCenter',FCKLang.CenterJustify,null,null,false,true,31);break;case 'JustifyRight':oItem=new FCKToolbarButton('JustifyRight',FCKLang.RightJustify,null,null,false,true,32);break;case 'JustifyFull':oItem=new FCKToolbarButton('JustifyFull',FCKLang.BlockJustify,null,null,false,true,33);break;case 'Style':oItem=new FCKToolbarStyleCombo();break;case 'FontName':oItem=new FCKToolbarFontsCombo();break;case 'FontSize':oItem=new FCKToolbarFontSizeCombo();break;case 'FontFormat':oItem=new FCKToolbarFontFormatCombo();break;case 'TextColor':oItem=new FCKToolbarPanelButton('TextColor',FCKLang.TextColor,null,null,45);break;case 'BGColor':oItem=new FCKToolbarPanelButton('BGColor',FCKLang.BGColor,null,null,46);break;case 'Find':oItem=new FCKToolbarButton('Find',FCKLang.Find,null,null,null,null,16);break;case 'Replace':oItem=new FCKToolbarButton('Replace',FCKLang.Replace,null,null,null,null,17);break;case 'Form':oItem=new FCKToolbarButton('Form',FCKLang.Form,null,null,null,null,48);break;case 'Checkbox':oItem=new FCKToolbarButton('Checkbox',FCKLang.Checkbox,null,null,null,null,49);break;case 'Radio':oItem=new FCKToolbarButton('Radio',FCKLang.RadioButton,null,null,null,null,50);break;case 'TextField':oItem=new FCKToolbarButton('TextField',FCKLang.TextField,null,null,null,null,51);break;case 'Textarea':oItem=new FCKToolbarButton('Textarea',FCKLang.Textarea,null,null,null,null,52);break;case 'HiddenField':oItem=new FCKToolbarButton('HiddenField',FCKLang.HiddenField,null,null,null,null,56);break;case 'Button':oItem=new FCKToolbarButton('Button',FCKLang.Button,null,null,null,null,54);break;case 'Select':oItem=new FCKToolbarButton('Select',FCKLang.SelectionField,null,null,null,null,53);break;case 'ImageButton':oItem=new FCKToolbarButton('ImageButton',FCKLang.ImageButton,null,null,null,null,55);break;case 'InsertCode':oItem=new FCKToolbarButton('InsertCode',FCKLang.InsertCode,null,null,null,null,67);break;default:alert(FCKLang.UnknownToolbarItem.replace(/%1/g,itemName));return null;};FCKToolbarItems.LoadedItems[itemName]=oItem;return oItem;}
var FCKToolbar=function(){this.Items=new Array();if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbar_Cleanup);};FCKToolbar.prototype.AddItem=function(item){return this.Items[this.Items.length]=item;};FCKToolbar.prototype.AddButton=function(name,label,tooltip,iconPathOrStripInfoArrayOrIndex,style,state){if (typeof(iconPathOrStripInfoArrayOrIndex)=='number') iconPathOrStripInfoArrayOrIndex=[this.DefaultIconsStrip,this.DefaultIconSize,iconPathOrStripInfoArrayOrIndex];var oButton=new FCKToolbarButtonUI(name,label,tooltip,iconPathOrStripInfoArrayOrIndex,style,state);oButton._FCKToolbar=this;oButton.OnClick=FCKToolbar_OnItemClick;return this.AddItem(oButton);};function FCKToolbar_OnItemClick(item){var oToolbar=item._FCKToolbar;if (oToolbar.OnItemClick) oToolbar.OnItemClick(oToolbar,item);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(parentElement){if (this.MainElement){if (this.MainElement.parentNode) this.MainElement.parentNode.removeChild(this.MainElement);this.MainElement=null;};var oDoc=parentElement.ownerDocument;var e=this.MainElement=oDoc.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;this.RowElement=e.insertRow(-1);var eCell;if (!this.HideStart){eCell=this.RowElement.insertCell(-1);eCell.appendChild(oDoc.createElement('div')).className='TB_Start';};for (var i=0;i<this.Items.length;i++){this.Items[i].Create(this.RowElement.insertCell(-1));};if (!this.HideEnd){eCell=this.RowElement.insertCell(-1);eCell.appendChild(oDoc.createElement('div')).className='TB_End';};parentElement.appendChild(e);};function FCKToolbar_Cleanup(){this.MainElement=null;this.RowElement=null;};var FCKToolbarSeparator=function(){};FCKToolbarSeparator.prototype.Create=function(parentElement){parentElement.appendChild(parentElement.ownerDocument.createElement('div')).className='TB_Separator';}
var FCKToolbarBreak=function(){};FCKToolbarBreak.prototype.Create=function(targetElement){var oBreakDiv=targetElement.ownerDocument.createElement('div');oBreakDiv.className='TB_Break';oBreakDiv.style.clear=FCKLang.Dir=='rtl'?'left':'right';targetElement.appendChild(oBreakDiv);}
function FCKToolbarSet_Create(overhideLocation){var oToolbarSet;var sLocation=overhideLocation||FCKConfig.ToolbarLocation;switch (sLocation){case 'In':document.getElementById('xToolbarRow').style.display='';oToolbarSet=new FCKToolbarSet(document);break;default:FCK.Events.AttachEvent('OnBlur',FCK_OnBlur);FCK.Events.AttachEvent('OnFocus',FCK_OnFocus);var eToolbarTarget;var oOutMatch=sLocation.match(/^Out:(.+)\((\w+)\)$/);if (oOutMatch){eToolbarTarget=eval('parent.'+oOutMatch[1]).document.getElementById(oOutMatch[2]);}else{oOutMatch=sLocation.match(/^Out:(\w+)$/);if (oOutMatch) eToolbarTarget=parent.document.getElementById(oOutMatch[1]);};if (!eToolbarTarget){alert('Invalid value for "ToolbarLocation"');return this._Init('In');};if (oToolbarSet=eToolbarTarget.__FCKToolbarSet) break;var eToolbarIFrame=eToolbarTarget.ownerDocument.createElement('IFRAME');eToolbarIFrame.frameBorder=0;eToolbarIFrame.width='100%';eToolbarIFrame.height='10';eToolbarTarget.appendChild(eToolbarIFrame);eToolbarIFrame.unselectable='on';var eTargetDocument=eToolbarIFrame.contentWindow.document;eTargetDocument.open();eTargetDocument.write('<html><head><script type="text/javascript"> window.onload = window.onresize = function() { window.frameElement.height = document.body.scrollHeight ; } </script></head><body style="overflow: hidden">'+document.getElementById('xToolbarSpace').innerHTML+'</body></html>');eTargetDocument.close();eTargetDocument.oncontextmenu=FCKTools.CancelEvent;FCKTools.AppendStyleSheet(eTargetDocument,FCKConfig.SkinPath+'fck_editor.css');oToolbarSet=eToolbarTarget.__FCKToolbarSet=new FCKToolbarSet(eTargetDocument);oToolbarSet._IFrame=eToolbarIFrame;if (FCK.IECleanup) FCK.IECleanup.AddItem(eToolbarTarget,FCKToolbarSet_Target_Cleanup);};oToolbarSet.CurrentInstance=FCK;FCK.AttachToOnSelectionChange(oToolbarSet.RefreshItemsState);return oToolbarSet;};function FCK_OnBlur(editorInstance){var eToolbarSet=editorInstance.ToolbarSet;if (eToolbarSet.CurrentInstance==editorInstance){eToolbarSet.Disable();};};function FCK_OnFocus(editorInstance){var oToolbarset=editorInstance.ToolbarSet;var oInstance=editorInstance||FCK;oToolbarset.CurrentInstance.FocusManager.RemoveWindow(oToolbarset._IFrame.contentWindow);oToolbarset.CurrentInstance=oInstance;oInstance.FocusManager.AddWindow(oToolbarset._IFrame.contentWindow,true);oToolbarset.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(targetDocument){this._Document=targetDocument;this._TargetElement=targetDocument.getElementById('xToolbar');var eExpandHandle=targetDocument.getElementById('xExpandHandle');var eCollapseHandle=targetDocument.getElementById('xCollapseHandle');eExpandHandle.title=FCKLang.ToolbarExpand;eExpandHandle.onclick=FCKToolbarSet_Expand_OnClick;eCollapseHandle.title=FCKLang.ToolbarCollapse;eCollapseHandle.onclick=FCKToolbarSet_Collapse_OnClick;if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();eCollapseHandle.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) eCollapseHandle.style.display='';else targetDocument.getElementById('xTBLeftBorder').style.display='';this.Toolbars=new Array();this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(collapse){this._Document.getElementById('xCollapsed').style.display=collapse?'':'none';this._Document.getElementById('xExpanded').style.display=collapse?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);};};FCKToolbarSet.prototype.Load=function(toolbarSetName){this.Name=toolbarSetName;this.Items=new Array();this.ItemsWysiwygOnly=new Array();this.ItemsContextSensitive=new Array();this._TargetElement.innerHTML='';var ToolbarSet=FCKConfig.ToolbarSets[toolbarSetName];if (!ToolbarSet){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,toolbarSetName));return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -