mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge branch '1.8.x' into 1.x
This commit is contained in:
@@ -63,7 +63,7 @@ namespace Orchard.Azure.Services.FileSystems {
|
||||
_publicHostName = publicHostName;
|
||||
}
|
||||
|
||||
private void EnsureInitialized() {
|
||||
protected void EnsureInitialized() {
|
||||
if (_storageAccount != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
@@ -64,6 +64,7 @@ namespace Orchard.Azure.Services.FileSystems.Media {
|
||||
/// <param name="url">The public URL of the media.</param>
|
||||
/// <returns>The corresponding local path.</returns>
|
||||
public string GetStoragePath(string url) {
|
||||
EnsureInitialized();
|
||||
if (url.StartsWith(_absoluteRoot)) {
|
||||
return HttpUtility.UrlDecode(url.Substring(Combine(_absoluteRoot, "/").Length));
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@T("Media Folders") @foreach (var folder in Model.FolderPath.Split(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries)) {<text> > </text>@folder}
|
||||
|
||||
|
||||
@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>
|
||||
}
|
||||
+3
-3
@@ -214,7 +214,7 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
var settings = GetSettings();
|
||||
if (settings == null) return path;
|
||||
var insecureHostName = settings.InsecureHostName;
|
||||
var builder = new UriBuilder(insecureHostName.Trim('/') + path) {
|
||||
var builder = new UriBuilder(insecureHostName.Split(':').First().Trim('/') + path) {
|
||||
Scheme = Uri.UriSchemeHttp,
|
||||
Port = 80
|
||||
};
|
||||
@@ -226,7 +226,7 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
var settings = GetSettings();
|
||||
if (settings == null) return path;
|
||||
var secureHostName = settings.SecureHostName;
|
||||
var builder = new UriBuilder(secureHostName.Trim('/') + path) {
|
||||
var builder = new UriBuilder(secureHostName.Split(':').First().Trim('/') + path) {
|
||||
Scheme = Uri.UriSchemeHttps,
|
||||
Port = 443
|
||||
};
|
||||
@@ -246,4 +246,4 @@ namespace Orchard.SecureSocketsLayer.Services {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user