本文整理汇总了C#中Bloom.Book.HtmlDom.AddJavascriptFile方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlDom.AddJavascriptFile方法的具体用法?C# HtmlDom.AddJavascriptFile怎么用?C# HtmlDom.AddJavascriptFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bloom.Book.HtmlDom
的用法示例。
在下文中一共展示了HtmlDom.AddJavascriptFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddJavaScriptForEditing
private void AddJavaScriptForEditing(HtmlDom dom)
{
// BL-117, PH: With the newer xulrunner, javascript code with parenthesis in the URL is not working correctly.
//dom.AddJavascriptFile("lib/ckeditor/ckeditor.js".ToLocalhost());
//reviewslog: added this to get the "WebFXTabPane()" working in StyleEditor. Previously tried adding "export" to the function and then importing it
dom.AddJavascriptFile("lib/tabpane.js".ToLocalhost());
//reviewslog: four lines are prompted by the qtip "too much recursion" error, which I got on certain pages. The qtip
//code in question says it is for when jquery-ui is not found. I "solved" this by loading jquery, jquery-ui,
//and finally qtip into the global space here
dom.AddJavascriptFile("jquery.min.js".ToLocalhost());
dom.AddJavascriptFile("modified_libraries/jquery-ui/jquery-ui-1.10.3.custom.min.js".ToLocalhost());
// dom.AddJavascriptFile("lib/jquery.qtip.js".ToLocalhost());
// dom.AddJavascriptFile("lib/jquery.qtipSecondary.js".ToLocalhost());
// first tried this as import 'jquery.hotkeys' in bloomEditing, but that didn't work
//dom.AddJavascriptFile("jquery.hotkeys.js".ToLocalhost());
dom.AddJavascriptFile("commonBundle.js".ToLocalhost());
dom.AddJavascriptFile("editablePageBundle.js".ToLocalhost());
// Add this last because currently its document ready function has to execute AFTER the bootstrap call in bloomEditing.ts,
// which is compiled into editablePageIFrame.js. The bootstrap function sets CKEDITOR.disableAutoInline = true,
// which suppresses a document ready function in CKEditor iself from calling inline() on all content editable
// elements, which we don't want (a) because some content editable elements shouldn't have CKEditor functions, and
// (b) because it causes crashes when we intentionally do our own inline() calls on the elements where we DO
// want CKEditor.
// ReviewSlog: It would be much more robust not to depend on the order in which document ready functions
// execute, especially if the only control over that is the order of loading files. But I don't know
// where we can put the CKEDITOR.disableAutoInline = true so that it will reliably execute AFTER CKEDITOR is
// defined and BEFORE its document ready function.
dom.AddJavascriptFile("lib/ckeditor/ckeditor.js".ToLocalhost());
}
示例2: AddPreviewJScript
/// <summary>
/// Make stuff readonly, which isn't doable via css, surprisingly
/// </summary>
/// <param name="dom"></param>
private void AddPreviewJScript(HtmlDom dom)
{
// XmlElement header = (XmlElement)dom.SelectSingleNodeHonoringDefaultNS("//head");
// AddJavascriptFile(dom, header, _storage.GetFileLocator().LocateFileWithThrow("jquery.js"));
// AddJavascriptFile(dom, header, _storage.GetFileLocator().LocateFileWithThrow("jquery.myimgscale.js"));
//
// XmlElement script = dom.CreateElement("script");
// script.SetAttribute("type", "text/javascript");
// script.InnerText = @"jQuery(function() {
// $('textarea').focus(function() {$(this).attr('readonly','readonly');});
//
// //make images scale up to their container without distorting their proportions, while being centered within it.
// $('img').scaleImage({ scale: 'fit' }); //uses jquery.myimgscale.js
// })";
// header.AppendChild(script);
var pathToJavascript = _storage.GetFileLocator().LocateFileWithThrow("bloomPreviewBootstrap.js");
if(string.IsNullOrEmpty(pathToJavascript))
{
throw new ApplicationException("Could not locate " +"bloomPreviewBootstrap.js");
}
dom.AddJavascriptFile(pathToJavascript);
}
示例3: AddPreviewJavascript
/// <summary>
/// Make stuff readonly, which isn't doable via css, surprisingly
/// </summary>
/// <param name="dom"></param>
internal void AddPreviewJavascript(HtmlDom dom)
{
dom.AddJavascriptFile("commonBundle.js".ToLocalhost());
dom.AddJavascriptFile("bookPreviewBundle.js".ToLocalhost());
}
示例4: AddJavaScriptForEditing
private void AddJavaScriptForEditing(HtmlDom dom)
{
dom.AddJavascriptFile(_storage.GetFileLocator().LocateFileWithThrow("bloomBootstrap.js"));
}