Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Editor");
Telerik.Web.UI.Editor.Utils =
{
getInvisibleParent : function(parent)
{
while(parent != document)
{
if ("none" == TelerikCommonScripts.getCurrentStyle(parent, "display", ""))
{
return parent;
}
parent = parent.parentNode;
}
return null;
},
evalScriptCode : function(scriptCode)
{
var isSafari = Telerik.Web.Browser.isSafari;
if (isSafari)
{
scriptCode = scriptCode.replace(/^\s*<!--((.|\n)*)-->\s*$/mi, "$1");
}
var newScript = document.createElement("script");
newScript.setAttribute("type", "text/javascript");
if (isSafari)
{
newScript.appendChild(document.createTextNode(scriptCode));
}
else
{
newScript.text = scriptCode;
}
var scriptContainer = document.getElementsByTagName("head")[0];
scriptContainer.appendChild(newScript);
if (isSafari)
{
newScript.innerHTML = "";
}
else
{
newScript.parentNode.removeChild(newScript);
}
},
//Function that returns cleaned content according to supplied [editor] settings
cleanPastedContent : function(dirtyText, stripOptions, questionMessage)
{
var cleanedText = dirtyText;
if (stripOptions == Telerik.Web.UI.StripFormattingOptions.None)
{
if ((dirtyText.match(/style="[^"]*?mso[^"]*?"/ig) || dirtyText.match(/class="?[^"]*?mso[^"]*?"?/ig)) && confirm(questionMessage))
{
cleanedText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText , "WORD");
}//else do nothing
}
else if (stripOptions & Telerik.Web.UI.StripFormattingOptions.All)
{
cleanedText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText , "ALL");
}
else
{
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.MSWordRemoveAll)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "WORD_ALL");
}
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.MSWordNoFonts)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "WORD_NO_FONTS");
}
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.MSWord)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "WORD");
}
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.Css)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "CSS");
}
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.Font)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "FONT");
}
if (stripOptions & Telerik.Web.UI.StripFormattingOptions.Span)
{
dirtyText = Telerik.Web.UI.Editor.Utils.stripFormatting(dirtyText, "SPAN");
}
cleanedText = dirtyText;
}
return cleanedText;
},
isCursorMovingKey : function(keyCode)
{
if (keyCode >= 33 && keyCode <= 40) return true;//up, down, end, home, left, up, right, down
return false;
},
isSystemKey : function (keyCode)
{
if (keyCode >=112 && keyCode <=123)return true;//F1 - F12
if (keyCode >=8 && keyCode <=27) return true;//BACK (8) -> ESC (27)
if (keyCode >=32 && keyCode <=46) return true;//SPACE (32) -> DELETE (46)
if (keyCode == 93) return true;//Context menu
return false;
},
storeBrowserPosition : function()
{
var oBody = document.body;
var oDoc = document.documentElement;
this._browserTop = oBody.scrollTop > oDoc.scrollTop ? oBody.scrollTop : oDoc.scrollTop;
this._browserLeft = oBody.scrollLeft > oDoc.scrollLeft ? oBody.scrollTop : oDoc.scrollLeft;
},
restoreBrowserPosition : function(left, top)
{
try
{
if (null == left) left = this._browserLeft;
if (null == top) top = this._browserTop;
var oBody = document.body;
var oDoc = document.documentElement;
oBody.scrollTop = top;
oBody.scrollLeft = left;
oDoc.scrollTop = top;
oDoc.scrollLeft = left;
}
catch(ex){};
},
_getPasteIframe : function()
{
if (!this._pasteIframe)
{
this._pasteIframe = document.createElement("IFRAME");
var style = this._pasteIframe.style;
style.width = "1px";
style.height = "1px";
style.border = "0px solid red";
style.overflow = "hidden";
style.position = "absolute";
//It MUST be added to the document immediately, or there are problems
document.body.appendChild(this._pasteIframe);
var doc = this._pasteIframe.contentWindow.document;
//Must use document.open - or else under IE the iframe does not have a body object immediately to access - needs a timeout and this causes many problems.
var oNewDoc = doc.open("text/html", "replace");
var sMarkup = "<html><head><title>New Document</title></head>" +
"<body contentEditable='true' style='overflow:hidden;margin:0px;padding:0px;height:100%'>" +
"</html>";
oNewDoc.write(sMarkup);
oNewDoc.close();
}
return this._pasteIframe;
},
getPasteContainer : function()
{
var area = this._getPasteIframe();
return area.contentWindow.document.body;
},
getClipboardAsHtml : function()
{
var div = this.getPasteContainer();
div.innerHTML = "";
div.setActive();
document.execCommand('Paste', null);//RE5-4357 - Causes the page to scroll down if scrollers exist!
//TEKI: New - keeps the scroll position, but strips automatically some of the Word formatting, e.g. the margin=0 of P tags.
//This is not very good. So, the old approach was restored
//document.selection.createRange().execCommand('Paste', null);
var oPaste = div.innerHTML;
div.innerHTML = "";
return oPaste;
},
//==================== Format stripping and paste modification functions ===========================================//
stripFormatting : function(textHtml, clearValue)
{
switch (clearValue)
{
case "ALL":
textHtml = textHtml.replace(/<\/?[^>]*>/ig, "");
break;
case "WORD":
case "WORD_ALL":
case "WORD_NO_FONTS":
textHtml = this.stripWordFormatting(textHtml, clearValue);
break;
case "CSS":
textHtml = textHtml.replace(new RegExp("(<[^>]+) class=[^ |^>]*([^>]*>)", "ig"), "$1 $2");
textHtml = textHtml.replace(/(<[^>]+) style="[^"]*"([^>]*>)/ig, "$1 $2");
break;
case "FONT":
textHtml = textHtml.replace(/<\/?font[^>]*>/ig, "");
break;
case "SPAN":
textHtml = textHtml.replace(/<\/?span[^>]*>/ig, "");
break;
default://TO DO: Perhaps add an array to allow people to add their own format strippers
break;
}
return textHtml;
},
replaceNewLineWithBr : function(textData)
{
try
{
textData = textData.replace(/\n/g, "<br>");
return textData;
}
catch (exc) {}
},
convertText2Html : function(text)
{
try
{
text = text.replace(/</g, "<");
text = text.replace(/>/g, ">");
text = text.replace(/\n/g, "<br>");
return text;
}
catch (exc) {}
},
clearWordAttributesInElement : function(domObject, clearValue)
{
var allChilds = document.all ? domObject.all : domOb
没有合适的资源?快使用搜索试试~ 我知道了~
Telerik RadControls for ASP.NET AJAX Q1 2009 SP2 Source (2009年5月...
共4048个文件
cs:1585个
gif:1290个
png:489个
需积分: 3 83 下载量 140 浏览量
2009-05-30
22:01:28
上传
评论
收藏 13.76MB 7Z 举报
温馨提示
Telerik RadControls for ASP.NET AJAX Q1 2009 SP2 Source (2009年5月27日的版本)
资源推荐
资源详情
资源评论
收起资源包目录
Telerik RadControls for ASP.NET AJAX Q1 2009 SP2 Source (2009年5月27日的版本) (4048个子文件)
StyleBuilder.ascx 94KB
ImageMap.ascx 63KB
FormatCodeBlock.ascx 47KB
MediaManager.ascx 43KB
ImageEditor.ascx 42KB
TableBorder.ascx 39KB
FindAndReplace.ascx 25KB
SetImageProperties.ascx 24KB
TableWizard.ascx 22KB
LinkManager.ascx 21KB
Help.ascx 20KB
PageProperties.ascx 19KB
TableDesign.ascx 19KB
FlashManager.ascx 17KB
AccessibleTable.ascx 16KB
CellProperties.ascx 15KB
TableProperties.ascx 15KB
ImageManager.ascx 12KB
SilverlightManager.ascx 11KB
MozillaPasteHtmlDialog.ascx 4KB
TrackChangesDialog.ascx 4KB
XhtmlValidator.ascx 3KB
MozillaPasteTextDialog.ascx 3KB
FileBrowser.ascx 3KB
DocumentManager.ascx 2KB
TemplateManager.ascx 2KB
About.ascx 2KB
ControlBuildAll.bat 327B
ControlBuildMergeModule.bat 127B
ControlBuild.bat 100B
PackSource.bat 100B
Telerik.Web.UI.ToolBar.bmp 824B
Telerik.Web.UI.MultiPage.bmp 824B
Telerik.Web.UI.PageView.bmp 824B
Telerik.Web.UI.Rotator.bmp 824B
Telerik.Web.UI.PanelBar.bmp 824B
Telerik.Web.UI.FormDecorator.bmp 824B
Telerik.Web.UI.TabStrip.bmp 824B
Telerik.Web.UI.FileExplorer.bmp 822B
Telerik.Web.UI.Editor.bmp 568B
Telerik.Web.UI.Calendar.bmp 568B
Telerik.Web.UI.ComboBox.bmp 568B
Telerik.Web.UI.Upload.bmp 568B
Telerik.Web.UI.ColorPicker.bmp 568B
Telerik.Web.UI.Slider.bmp 568B
Telerik.Web.UI.Spell.bmp 568B
Telerik.Web.UI.ScriptManager.bmp 568B
Telerik.Web.UI.Scheduler.bmp 568B
Telerik.Web.UI.ToolTip.bmp 568B
Telerik.Web.UI.Splitter.bmp 568B
Telerik.Web.UI.DialogOpener.bmp 568B
Telerik.Web.UI.Menu.bmp 568B
Telerik.Web.UI.Dock.bmp 568B
Telerik.Web.UI.Chart.bmp 568B
Telerik.Web.UI.StyleSheetManager.bmp 568B
Telerik.Web.UI.Input.bmp 568B
Telerik.Web.UI.Window.bmp 568B
Telerik.Web.UI.Grid.bmp 568B
Telerik.Web.UI.TreeView.bmp 568B
Telerik.Web.UI.Ajax.bmp 568B
Control.build 7KB
default.build 6KB
MergeInputControls.build 3KB
MergeToolBarScripts.build 3KB
MergeCalendarControls.build 3KB
MergeSplitterScripts.build 2KB
PackSource.build 2KB
MergeSchedulerScripts.build 2KB
MergeContextMenuScripts.build 1KB
MergeMultiPageScripts.build 1KB
MergeNavigationScripts.build 1KB
MergeScrollingScripts.build 1KB
MergeAnimationScripts.build 1KB
MergeTabStripScripts.build 1KB
MergeComboBoxScripts.build 1KB
MergePanelBarScripts.build 1KB
MergeTreeViewScripts.build 1KB
MergePopupScripts.build 1KB
MergeGridScripts.build 1KB
MergeMenuScripts.build 1KB
MergeAjaxManager.build 1KB
MergeEditorScripts.build 869B
Config.build 857B
StyleClassDiagram.cd 29KB
ChartingClassDiagram.cd 15KB
DbSchedulerProviderBase.cd 848B
FiguresDiagramm.cd 745B
RadGrid.cs 414KB
GridTableView.cs 303KB
RadCalendar.cs 222KB
ChartGraphics.cs 206KB
RadScheduler.Public.cs 158KB
RadInputControl.cs 143KB
RenderEngineSeries.cs 135KB
GridDataTableFromEnumerable.cs 133KB
Wizard.cs 130KB
Wizard.Designer.cs 128KB
DialogsStrings.cs 102KB
RenderEngine.cs 96KB
RadComboBox.Public.cs 92KB
共 4048 条
- 1
- 2
- 3
- 4
- 5
- 6
- 41
资源评论
fosoyo
- 粉丝: 156
- 资源: 1582
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功