mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge branch '1.9.x' into dev
Conflicts: src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/EditPlacement.cshtml src/Orchard.Web/Modules/Orchard.Layouts/Assets/JavaScript/Models/Element.js src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.js src/Orchard.Web/Modules/Orchard.Layouts/Scripts/LayoutEditor.min.js src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Models.js src/Orchard.Web/Modules/Orchard.Layouts/Scripts/Models.min.js src/Orchard.Web/Modules/Orchard.Layouts/Views/LayoutEditor.Template.Toolbox.cshtml src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/ClientStorageController.cs src/Orchard.Web/Modules/Orchard.Search/Drivers/SearchSettingsPartDriver.cs src/Orchard.Web/Modules/Orchard.Search/ViewModels/SearchSettingsIndexViewModel.cs src/Orchard.Web/Modules/Orchard.Search/Views/EditorTemplates/Parts/Search.SiteSettings.cshtml src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs src/Orchard/Orchard.Framework.csproj
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -73,6 +74,10 @@
|
||||
<Name>Orchard.Core</Name>
|
||||
<Private>false</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.MediaLibrary\Orchard.MediaLibrary.csproj">
|
||||
<Project>{73a7688a-5bd3-4f7e-adfa-ce36c5a10e3b}</Project>
|
||||
<Name>Orchard.MediaLibrary</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\Images\grippie.png" />
|
||||
|
||||
@@ -5,70 +5,72 @@
|
||||
editors.each(function() {
|
||||
|
||||
var idPostfix = $(this).attr('id').substr('wmd-input'.length);
|
||||
|
||||
|
||||
var editor = new Markdown.Editor(converter, idPostfix, {
|
||||
handler: function() { window.open("http://daringfireball.net/projects/markdown/syntax"); }
|
||||
});
|
||||
|
||||
editor.hooks.set("insertImageDialog", function(callback) {
|
||||
// see if there's an image selected that they intend on editing
|
||||
var wmd = $('#wmd-input' + idPostfix);
|
||||
if (Boolean($(this).data("manage-media"))) {
|
||||
editor.hooks.set("insertImageDialog", function (callback) {
|
||||
// see if there's an image selected that they intend on editing
|
||||
var wmd = $('#wmd-input' + idPostfix);
|
||||
|
||||
var editImage, content = wmd.selection ? wmd.selection.createRange().text : null;
|
||||
var adminIndex = location.href.toLowerCase().indexOf("/admin/");
|
||||
if (adminIndex === -1) return;
|
||||
var url = location.href.substr(0, adminIndex) + "/Admin/Orchard.MediaLibrary?dialog=true";
|
||||
$.colorbox({
|
||||
href: url,
|
||||
iframe: true,
|
||||
reposition: true,
|
||||
width: "90%",
|
||||
height: "90%",
|
||||
onLoad: function () {
|
||||
// hide the scrollbars from the main window
|
||||
$('html, body').css('overflow', 'hidden');
|
||||
},
|
||||
onClosed: function () {
|
||||
$('html, body').css('overflow', '');
|
||||
var editImage, content = wmd.selection ? wmd.selection.createRange().text : null;
|
||||
var adminIndex = location.href.toLowerCase().indexOf("/admin/");
|
||||
if (adminIndex === -1) return;
|
||||
var url = location.href.substr(0, adminIndex) + "/Admin/Orchard.MediaLibrary?dialog=true";
|
||||
$.colorbox({
|
||||
href: url,
|
||||
iframe: true,
|
||||
reposition: true,
|
||||
width: "90%",
|
||||
height: "90%",
|
||||
onLoad: function () {
|
||||
// hide the scrollbars from the main window
|
||||
$('html, body').css('overflow', 'hidden');
|
||||
},
|
||||
onClosed: function () {
|
||||
$('html, body').css('overflow', '');
|
||||
|
||||
var selectedData = $.colorbox.selectedData;
|
||||
var selectedData = $.colorbox.selectedData;
|
||||
|
||||
if (selectedData == null) // Dialog cancelled, do nothing
|
||||
return;
|
||||
if (selectedData == null) // Dialog cancelled, do nothing
|
||||
return;
|
||||
|
||||
var newContent = '';
|
||||
for (var i = 0; i < selectedData.length; i++) {
|
||||
var renderMedia = location.href.substr(0, adminIndex) + "/Admin/Orchard.MediaLibrary/MediaItem/" + selectedData[i].id + "?displayType=Raw";
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: 'GET',
|
||||
url: renderMedia,
|
||||
success: function (data) {
|
||||
newContent += data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var result = $.parseHTML(newContent);
|
||||
var img = $(result).filter('img');
|
||||
// if this is an image, use the callback which will format it in markdown
|
||||
if (img.length > 0 && img.attr('src')) {
|
||||
callback(img.attr('src'));
|
||||
}
|
||||
|
||||
// otherwise, insert the raw HTML
|
||||
else {
|
||||
if (wmd.selection) {
|
||||
wmd.selection.replace('.*', newContent);
|
||||
} else {
|
||||
wmd.text(newContent);
|
||||
var newContent = '';
|
||||
for (var i = 0; i < selectedData.length; i++) {
|
||||
var renderMedia = location.href.substr(0, adminIndex) + "/Admin/Orchard.MediaLibrary/MediaItem/" + selectedData[i].id + "?displayType=Raw";
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: 'GET',
|
||||
url: renderMedia,
|
||||
success: function (data) {
|
||||
newContent += data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var result = $.parseHTML(newContent);
|
||||
var img = $(result).filter('img');
|
||||
// if this is an image, use the callback which will format it in markdown
|
||||
if (img.length > 0 && img.attr('src')) {
|
||||
callback(img.attr('src'));
|
||||
}
|
||||
|
||||
// otherwise, insert the raw HTML
|
||||
else {
|
||||
if (wmd.selection) {
|
||||
wmd.selection.replace('.*', newContent);
|
||||
} else {
|
||||
wmd.text(newContent);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
editor.run();
|
||||
});
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
{"id", "wmd-input" + "-" + idPostfix},
|
||||
{"class", "wmd-input"},
|
||||
{"data-mediapicker-uploadpath", Model.AddMediaPath},
|
||||
{"data-mediapicker-title", T("Insert/Update Media")}
|
||||
{"data-mediapicker-title", T("Insert/Update Media")},
|
||||
{"data-manage-media", AuthorizedFor(Orchard.MediaLibrary.Permissions.ManageMediaContent) ? "true" : "false" }
|
||||
};
|
||||
|
||||
// The markdown editor itself doesn't seem to (yet) support autofocus, but we'll set it on the textarea nonetheless.
|
||||
|
||||
Reference in New Issue
Block a user