当前位置: 首页>>代码示例>>C#>>正文


C# HtmlDom.AddJavascriptFile方法代码示例

本文整理汇总了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());
        }
开发者ID:BloomBooks,项目名称:BloomDesktop,代码行数:34,代码来源:Book.cs

示例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);
        }
开发者ID:jorik041,项目名称:BloomDesktop,代码行数:27,代码来源:Book.cs

示例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());
 }
开发者ID:BloomBooks,项目名称:BloomDesktop,代码行数:9,代码来源:Book.cs

示例4: AddJavaScriptForEditing

 private void AddJavaScriptForEditing(HtmlDom dom)
 {
     dom.AddJavascriptFile(_storage.GetFileLocator().LocateFileWithThrow("bloomBootstrap.js"));
 }
开发者ID:jorik041,项目名称:BloomDesktop,代码行数:4,代码来源:Book.cs


注:本文中的Bloom.Book.HtmlDom.AddJavascriptFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。