public void BuildManifests(ResourceManifestBuilder builder) { Orchard.UI.Resources.ResourceManifest manifest = builder.Add(); manifest.DefineScript("myscript").SetUrl("myjqueryscript.js").SetDependencies("jQuery"); manifest.DefineStyle("mystyle").SetUrl("mystyle.css"); }
public void DefineScripts(ResourceManifest manifest, string key, string currentVersion, params string[] previousVersions) { var versions = new List<string>(previousVersions) { currentVersion }; foreach (var ver in versions) { string webKey = string.Format("{0}.{1}", key, "web"); string dataViz = string.Format("{0}.{1}", key, "data"); string mobile = string.Format("{0}.{1}", key, "mobile"); string all = string.Format("{0}.{1}", key, "all"); manifest.DefineScript(webKey).SetUrl(VersionPath(ver, "kendo.web.min.js")) .SetDependencies("jQuery") .SetVersion(ver); manifest.DefineScript(dataViz).SetUrl(VersionPath(ver, "kendo.web.min.js")) .SetDependencies("jQuery") .SetVersion(ver); manifest.DefineScript(mobile).SetUrl(VersionPath(ver, "kendo.mobile.min.js")) .SetDependencies("jQuery") .SetVersion(ver); } manifest.DefineScript("kendo.datasource") .SetUrl("custom/datasource.js") .SetDependencies(key); }
public ResourceManifest Add() { var manifest = new ResourceManifest { Feature = Feature }; ResourceManifests.Add(manifest); return(manifest); }
private void DefineSiteStyle(Orchard.UI.Resources.ResourceManifest manifest, string area) { var formatted = area.Replace('-', '_'); manifest.DefineStyle("site_" + formatted) .SetUrl("site-" + area + ".min.css", "site-" + area + ".css") .SetDependencies("nyroModal"); manifest.DefineStyle("site_" + formatted + "_rtl") .SetUrl("site-" + area + "-rtl.min.css", "site-" + area + "-rtl.css") .SetDependencies("site_" + formatted); }
public ResourceDefinition(ResourceManifest manifest, string type, string name) { Manifest = manifest; Type = type; Name = name; TagBuilder = new TagBuilder(_resourceTypeTagNames.ContainsKey(type) ? _resourceTypeTagNames[type] : "meta"); TagRenderMode = _fileTagRenderModes.ContainsKey(TagBuilder.TagName) ? _fileTagRenderModes[TagBuilder.TagName] : TagRenderMode.Normal; Dictionary<string, string> attributes; if (_resourceAttributes.TryGetValue(type, out attributes)) { foreach(var pair in attributes) { TagBuilder.Attributes[pair.Key] = pair.Value; } } FilePathAttributeName = _filePathAttributes.ContainsKey(TagBuilder.TagName) ? _filePathAttributes[TagBuilder.TagName] : null; }
public void BuildManifests(ResourceManifestBuilder builder) { Orchard.UI.Resources.ResourceManifest manifest = builder.Add(); manifest.DefineScript("DataTables").SetUrl("jquery.dataTables.min.js").SetCdn("http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js").SetDependencies("jQuery"); manifest.DefineStyle("DataTables").SetUrl("jquery.dataTables.css").SetCdn("http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css"); manifest.DefineScript("jquerymin").SetUrl("jquery.min.js"); manifest.DefineScript("jqplot").SetUrl("jquery.jqplot.min.js").SetDependencies("jQuery"); manifest.DefineScript("excanvas").SetUrl("excanvas.js").SetDependencies("jQuery"); manifest.DefineStyle("jqplot").SetUrl("jquery.jqplot.css"); manifest.DefineScript("jqplotpointlabels").SetUrl("jqplot.pointLabels.min.js").SetDependencies("jQuery"); manifest.DefineScript("jqplotcursor").SetUrl("jqplot.cursor.min.js").SetDependencies("jQuery"); manifest.DefineScript("jqplothighlighter").SetUrl("jqplot.highlighter.min.js").SetDependencies("jQuery"); manifest.DefineScript("jqplotcanvasoverlay").SetUrl("jqplot.canvasOverlay.min.js").SetDependencies("jQuery"); }
public void DefineStyles(ResourceManifest manifest, string key, string currentVersion, params string[] previousVersions) { var versions = new List<string>(previousVersions) { currentVersion }; //versions.AddRange(previousVersions); Func<string, string, string> format = (a,b) => { return string.Format(keyFormat, a, b); }; string commonDependency = format(key, "common"); foreach (var version in versions) { manifest.DefineStyle(format(key, "common")) .SetUrl(VersionPath(version, "kendo.common.min.css")) .SetVersion(version); manifest.DefineStyle(format(key, "default")) .SetUrl(VersionPath(version, "kendo.default.min.css")) .SetDependencies(commonDependency) .SetVersion(version); manifest.DefineStyle(format(key, "black")) .SetUrl(VersionPath(version, "kendo.black.min.css")) .SetDependencies(commonDependency) .SetVersion(version); manifest.DefineStyle(format(key, "blueopal")) .SetUrl(VersionPath(version, "kendo.blueopal.min.css")) .SetDependencies(commonDependency) .SetVersion(version); manifest.DefineStyle(format(key, "metro")) .SetUrl(VersionPath(version, "kendo.metro.min.css")) .SetDependencies(commonDependency) .SetVersion(version); manifest.DefineStyle(format(key, "silver")) .SetUrl(VersionPath(version, "kendo.silver.min.css")) .SetDependencies(commonDependency) .SetVersion(version); } }
public ResourceDefinition(ResourceManifest manifest, string type, string name) { Manifest = manifest; Type = type; Name = name; TagBuilder = new TagBuilder(_resourceTypeTagNames.ContainsKey(type) ? _resourceTypeTagNames[type] : "meta"); TagRenderMode = _fileTagRenderModes.ContainsKey(TagBuilder.TagName) ? _fileTagRenderModes[TagBuilder.TagName] : TagRenderMode.Normal; Dictionary <string, string> attributes; if (_resourceAttributes.TryGetValue(type, out attributes)) { foreach (var pair in attributes) { TagBuilder.Attributes[pair.Key] = pair.Value; } } FilePathAttributeName = _filePathAttributes.ContainsKey(TagBuilder.TagName) ? _filePathAttributes[TagBuilder.TagName] : null; }
public void DeserializeSettings(string serialization, CombinatorResource resource) { if (String.IsNullOrEmpty(serialization)) return; var settings = _serializer.XmlDeserialize<SerializableSettings>(serialization); if (settings.Url != null) { var resourceManifest = new ResourceManifest(); resource.RequiredContext.Resource = resourceManifest.DefineResource(resource.Type.ToStringType(), settings.Url.ToString()); resource.RequiredContext.Resource.SetUrlWithoutScheme(settings.Url); resource.IsOriginal = true; } if (resource.RequiredContext.Settings == null) resource.RequiredContext.Settings = new RequireSettings(); var resourceSettings = resource.RequiredContext.Settings; resourceSettings.Culture = settings.Culture; resourceSettings.Condition = settings.Condition; resourceSettings.Attributes = settings.Attributes; }
public ResourceManifest Add() { var manifest = new ResourceManifest { Feature = Feature }; ResourceManifests.Add(manifest); return manifest; }
public void FillRequiredContext(string name, string url, string culture = "", string condition = "", Dictionary<string, string> attributes = null) { var requiredContext = new ResourceRequiredContext(); var resourceManifest = new ResourceManifest(); requiredContext.Resource = resourceManifest.DefineResource(Type.ToStringType(), name); requiredContext.Resource.SetUrl(url); requiredContext.Settings = new RequireSettings(); requiredContext.Settings.Culture = culture; requiredContext.Settings.Condition = condition; requiredContext.Settings.Attributes = attributes != null ? new Dictionary<string, string>(attributes) : new Dictionary<string, string>(); RequiredContext = requiredContext; }
public void FillRequiredContext(string name, string url, string culture = "", string condition = "", Dictionary<string, string> attributes = null, IDictionary<string, string> tagAttributes = null) { var requiredContext = new ResourceRequiredContext(); var resourceManifest = new ResourceManifest(); requiredContext.Resource = resourceManifest.DefineResource(Type.ToStringType(), name); if (!string.IsNullOrEmpty(url)) requiredContext.Resource.SetUrl(url); requiredContext.Settings = new RequireSettings { Name = name, Culture = culture, Condition = condition, Attributes = attributes != null ? new Dictionary<string, string>(attributes) : new Dictionary<string, string>() }; RequiredContext = requiredContext; if (tagAttributes != null) requiredContext.Resource.TagBuilder.MergeAttributes(tagAttributes); }
public void DefineCultureSet(ResourceManifest manifest, string key, string currentVersion, params string[] previousVersions) { manifest.DefineScript("kendo.culture.en-gb") .SetUrl("culture/kendo.culture.en-gb.js") .SetDependencies(MainScript); }