/// <summary> /// Gives your widget an opertunity to populate media object. /// </summary> /// <remarks> /// This method is not called until the media property is accessed. This lets /// your widget be provided with additional information regarding which CSS/JS /// files your widget wishes to use. For example selecting weather to load /// JavaScript libraries off your local server or the Google Javascript hosting /// service. /// </remarks> public override void PopulateMedia() { Media .AddJS(ScriptSource.GetLibraryPath(JavaScriptLibrary.JQuery)) .AddJS(ScriptSource.GetLibraryPath(JavaScriptLibrary.JQueryUI)) .AddJS("~/Scripts/jquery-ui.mvcforms-contrib.js"); }
public void AppendTest() { Media_Accessor target = new Media_Accessor(); target.AddJS("http://example.com/myfile.js"); target.AddJS("local.js"); Media source = new Media(); source.AddJS("local.js"); source.AddJS("local2.js"); source.AddCss("http://example.com/myfile.css"); target.Append(source); Assert.AreEqual(3, target._js.Count); Assert.AreEqual(1, target._css.Count); }
/// <summary> /// Gives your widget an opertunity to populate media object. /// </summary> /// <remarks> /// This method is not called until the media property is accessed. This lets /// your widget be provided with additional information regarding which CSS/JS /// files your widget wishes to use. For example selecting weather to load /// JavaScript libraries off your local server or the Google Javascript hosting /// service. /// </remarks> public override void PopulateMedia() { Media .AddJS(ScriptSource.GetLibraryPath(JavaScriptLibrary.JQuery)) .AddJS(ScriptSource.GetLibraryPath(JavaScriptLibrary.JQueryUI)); }