mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Minor code file cleanup.
This commit is contained in:
@@ -14,12 +14,11 @@
|
||||
Style.Require("FontAwesome");
|
||||
}
|
||||
|
||||
|
||||
<div id="media-library-import">
|
||||
<div id="media-library-toolbar">
|
||||
|
||||
|
||||
<div id="media-library-toolbar-actions">
|
||||
|
||||
|
||||
<label for="filterMediaType">@T("Create")</label>
|
||||
<select id="filterMediaType" name="FilteredMediaType">
|
||||
@Html.SelectOption("", true, T("Any").ToString())
|
||||
@@ -30,67 +29,66 @@
|
||||
|
||||
<a href="@Url.Action("Index", "Admin", new { folderPath = Model.FolderPath})" class="button">@T("Close")</a>
|
||||
</div>
|
||||
|
||||
|
||||
@Html.ActionLink(T("Media Library").ToString(), "Index", "Admin", new { area = "Orchard.MediaLibrary" }, null)
|
||||
@foreach (var folder in Model.FolderPath.Split(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)) {<text> > </text>@folder}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="media-library-main">
|
||||
<div id="media-library-main-navigation">
|
||||
@foreach (var menuItem in Model.Menu) {
|
||||
string sectionHeaderTextHint = menuItem.Text.TextHint;
|
||||
var itemClassName = "navicon-" + sectionHeaderTextHint.HtmlClassify();
|
||||
|
||||
<div class="import-provider"><a class="navicon @itemClassName" href="@menuItem.Href/Index?folderPath=@HttpUtility.UrlEncode(Model.FolderPath)">@menuItem.Text</a></div>
|
||||
}
|
||||
@foreach (var menuItem in Model.Menu) {
|
||||
string sectionHeaderTextHint = menuItem.Text.TextHint;
|
||||
var itemClassName = "navicon-" + sectionHeaderTextHint.HtmlClassify();
|
||||
|
||||
<div class="import-provider"><a class="navicon @itemClassName" href="@menuItem.Href/Index?folderPath=@HttpUtility.UrlEncode(Model.FolderPath)">@menuItem.Text</a></div>
|
||||
}
|
||||
</div>
|
||||
<div id="media-library-main-list-wrapper">
|
||||
<div id="media-library-main-list">
|
||||
<iframe id="media-library-main-list-frame">
|
||||
</iframe>
|
||||
<iframe id="media-library-main-list-frame"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@using (Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(function() {
|
||||
$("#media-library-main-navigation a").click(function() {
|
||||
var self = $(this);
|
||||
var href = replaceQueryString(self.attr("href"), "type", getMediaType());
|
||||
$("#media-library-main-list-frame").attr("src", href);
|
||||
return false;
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(function () {
|
||||
$("#media-library-main-navigation a").click(function () {
|
||||
var self = $(this);
|
||||
var href = replaceQueryString(self.attr("href"), "type", getMediaType());
|
||||
$("#media-library-main-list-frame").attr("src", href);
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#filterMediaType").change(function () {
|
||||
var href = $("#media-library-main-list-frame").attr("src");
|
||||
href = replaceQueryString(href, 'type', getMediaType());
|
||||
$("#media-library-main-list-frame").attr("src", href);
|
||||
});
|
||||
|
||||
// loads the first available link
|
||||
$("#media-library-main-navigation a").first().click();
|
||||
});
|
||||
|
||||
$("#filterMediaType").change(function() {
|
||||
var href = $("#media-library-main-list-frame").attr("src");
|
||||
href = replaceQueryString(href, 'type', getMediaType());
|
||||
$("#media-library-main-list-frame").attr("src", href);
|
||||
});
|
||||
|
||||
// loads the first available link
|
||||
$("#media-library-main-navigation a").first().click();
|
||||
});
|
||||
|
||||
// returns the currently selected preferred media type
|
||||
function getMediaType() {
|
||||
return $('#filterMediaType').find("option:selected").attr('value');
|
||||
}
|
||||
|
||||
// returns the currently selected preferred media type
|
||||
function getMediaType() {
|
||||
return $('#filterMediaType').find("option:selected").attr('value');
|
||||
}
|
||||
|
||||
// replaces a specific query parameter in the given url
|
||||
function replaceQueryString(url, param, value) {
|
||||
value = encodeURIComponent(value);
|
||||
var re = new RegExp("([?|&])" + param + "=.*?(&|$)", "i");
|
||||
if (url.match(re))
|
||||
return url.replace(re, '$1' + param + "=" + value + '$2');
|
||||
else
|
||||
return url + '&' + param + "=" + value;
|
||||
}
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
// replaces a specific query parameter in the given url
|
||||
function replaceQueryString(url, param, value) {
|
||||
value = encodeURIComponent(value);
|
||||
var re = new RegExp("([?|&])" + param + "=.*?(&|$)", "i");
|
||||
if (url.match(re))
|
||||
return url.replace(re, '$1' + param + "=" + value + '$2');
|
||||
else
|
||||
return url + '&' + param + "=" + value;
|
||||
}
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
}
|
||||
Reference in New Issue
Block a user