mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Removed unused scripts.
This commit is contained in:
@@ -85,8 +85,6 @@
|
||||
<Content Include="Images\illustration.jpg" />
|
||||
<Content Include="Images\logo.svg" />
|
||||
<Content Include="Placement.info" />
|
||||
<Content Include="Scripts\DemoConfig.js" />
|
||||
<Content Include="Scripts\DemoData.js" />
|
||||
<Content Include="Scripts\placeable-widget-editor.js" />
|
||||
<Content Include="Scripts\element-browser.js" />
|
||||
<Content Include="Scripts\AutoFocus.js" />
|
||||
@@ -133,7 +131,6 @@
|
||||
<Content Include="Assets\JavaScript\Models\Row.js" />
|
||||
<Content Include="Scripts\LayoutDecoder.js" />
|
||||
<Content Include="Scripts\dialog.js" />
|
||||
<Content Include="Scripts\designer.canvas.js" />
|
||||
<Content Include="Data\Canvas.json" />
|
||||
<Content Include="Data\ContentTypes.json" />
|
||||
<Content Include="Images\Web.config">
|
||||
|
@@ -1,50 +0,0 @@
|
||||
var demoConfig = {
|
||||
"createContentUrl": "/Modules/Orchard.Layouts/Controller/Create/{contentTypeId}",
|
||||
"editContentUrl": "/Modules/Orchard.Layouts/Controller/Edit/{contentTypeId}",
|
||||
"categories": [
|
||||
{
|
||||
"name": "Content",
|
||||
"contentTypes": [
|
||||
{ "label": "Content Item", "id": "Orchard.Layouts.Elements.ContentItem" },
|
||||
{ "label": "Html", "id": "Orchard.Layouts.Elements.Html" },
|
||||
{ "label": "Paragraph", "id": "Orchard.Layouts.Elements.Paragraph" },
|
||||
{ "label": "Text", "id": "Orchard.Layouts.Elements.Text" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Media",
|
||||
"contentTypes": [
|
||||
{ "label": "Image", "id": "Orchard.Layouts.Elements.Image" },
|
||||
{ "label": "Media Item", "id": "Orchard.Layouts.Elements.MediaItem" },
|
||||
{ "label": "Vector Image", "id": "Orchard.Layouts.Elements.VectorImage" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Parts",
|
||||
"contentTypes": [
|
||||
{ "label": "CommonPart", "id": "CommonPart" },
|
||||
{ "label": "TitlePart", "id": "TitlePart" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Forms",
|
||||
"contentTypes": [
|
||||
{ "label": "Button", "id": "Orchard.DynamicForms.Elements.Button" },
|
||||
{ "label": "Check Box", "id": "Orchard.DynamicForms.Elements.CheckBox" },
|
||||
{ "label": "Email Field", "id": "Orchard.DynamicForms.Elements.EmailField" },
|
||||
{ "label": "Enumeration", "id": "Orchard.DynamicForms.Elements.Enumeration" },
|
||||
{ "label": "Form", "id": "Orchard.DynamicForms.Elements.Form" },
|
||||
{ "label": "Hidden Field", "id": "Orchard.DynamicForms.Elements.HiddenField" },
|
||||
{ "label": "Ip Address Field", "id": "Orchard.DynamicForms.Elements.IpAddressField" },
|
||||
{ "label": "Label", "id": "Orchard.DynamicForms.Elements.Label" },
|
||||
{ "label": "Password Field", "id": "Orchard.DynamicForms.Elements.PasswordField" },
|
||||
{ "label": "Radio Button", "id": "Orchard.DynamicForms.Elements.RadioButton" },
|
||||
{ "label": "Text Area", "id": "Orchard.DynamicForms.Elements.TextArea" },
|
||||
{ "label": "Text Field", "id": "Orchard.DynamicForms.Elements.TextField" },
|
||||
{ "label": "User Name Field", "id": "Orchard.DynamicForms.Elements.UserNameField" },
|
||||
{ "label": "Validation Message", "id": "Orchard.DynamicForms.Elements.ValidationMessage" },
|
||||
{ "label": "Validation Summary", "id": "Orchard.DynamicForms.Elements.ValidationSummary" }
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
@@ -1,261 +0,0 @@
|
||||
var demoData = {
|
||||
"type": "Canvas",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Grid",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Row",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "Image",
|
||||
"html": "<img class='img-responsive' src='/OrchardLocal/Modules/Orchard.Layouts/Images/illustration.jpg' />"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 8,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<h2>Who are we?</h2>"
|
||||
},
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "Vector Image",
|
||||
"html": "<img class='img-responsive' src='/OrchardLocal/Modules/Orchard.Layouts/Images/logo.svg' style='width: 400px;' />"
|
||||
},
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<p>IDeliverable is a company of like-minded individuals with a true passion for .NET based software development and cloud computing.</p>"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Row",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 12,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<h2>What do we do?</h2><p>We provide software development, consulting and training within our three areas of focus.</p>"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Row",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<h3>.NET software development</h3><p>Microsoft .NET is at the core of everything we do. We have worked with .NET since its inception back in 2000 and are exceptionally proficient in all aspects of the platform, including its languages, frameworks, services and tools. Whether it’s the latest ASP.NET technologies with HTML5, CSS3 and modern JavaScript frameworks, Windows Phone and Windows Store apps with XAML, or more enterprise oriented Windows Forms or WPF rich client apps with WCF based service back ends, we’ve done it all for years and feel right at home.</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<h3>Microsoft Azure</h3><p>We are true believers in cloud computing, and as far as hosting goes, we believe there’s no better home for .NET based applications than Microsoft Azure. And so we have worked hard in the past few years to become experts in every nook and cranny of this platform. Our expertise includes architecting and designing applications for Microsoft Azure, adapting and migrating existing applications to Microsoft Azure, automating Microsoft Azure deployment and building hybrid solutions involving both on-premises components and Microsoft Azure.</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<h3>Orchard CMS</h3>"
|
||||
},
|
||||
{
|
||||
"type": "Grid",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Row",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"children": [
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<p>When it comes to web site development, the Orchard CMS is our framework of choice.</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<p>We have worked with Orchard for almost three years and have built a wide array of web sites, large and small, using it. We have two developers who participate actively in the development of Orchard and who have commit rights in the official Orchard source code repository.</p>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "Column",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"width": 4,
|
||||
"offset": 0,
|
||||
"children": [
|
||||
{
|
||||
"type": "Content",
|
||||
"data": null,
|
||||
"htmlId": null,
|
||||
"htmlClass": null,
|
||||
"htmlStyle": null,
|
||||
"contentType": "HTML",
|
||||
"html": "<p>One of them is even on the Orchard steering committee, so it’s fair to say we have our ears to the ground when it comes to what’s happening in the Orchard community.</p>"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,162 +0,0 @@
|
||||
(function ($) {
|
||||
var LayoutDesigner = function (element) {
|
||||
var self = this;
|
||||
this.element = element;
|
||||
this.canvas = element.find(".canvas");
|
||||
this.toolbar = new window.Orchard.Layouts.CanvasToolbar(element.find(".canvas-toolbar"));
|
||||
this.element.data("layout-designer", this);
|
||||
this.settings = {
|
||||
antiForgeryToken: self.element.data("anti-forgery-token"),
|
||||
editorDialogTitleFormat: self.element.data("editor-dialog-title-format"),
|
||||
editorDialogName: self.element.data("editor-dialog-name"),
|
||||
confirmDeletePrompt: self.element.data("confirm-delete-prompt"),
|
||||
displayType: self.element.data("display-type"),
|
||||
endpoints: {
|
||||
render: self.element.data("render-url"),
|
||||
edit: self.element.data("edit-url"),
|
||||
settings: self.element.data("settings-url"),
|
||||
browse: self.element.data("element-browser-url"),
|
||||
applyTemplate: self.element.data("apply-template-url")
|
||||
},
|
||||
domOperations: {
|
||||
append: function (container, element) { container.append(element); },
|
||||
replace: function (currentElement, newElement) { currentElement.replaceWith(newElement); }
|
||||
}
|
||||
};
|
||||
|
||||
this.browse = function (targetContainer) {
|
||||
var href = self.settings.endpoints.browse;
|
||||
var w = window.parent || window;
|
||||
var dialog = new w.Orchard.Layouts.Dialog(".dialog-template." + self.settings.editorDialogName);
|
||||
|
||||
dialog.show();
|
||||
dialog.load(href);
|
||||
|
||||
dialog.element.on("command", function (e, data) {
|
||||
if (data.command == "add" || data.command == "save") {
|
||||
var graph = {
|
||||
elements: [
|
||||
{
|
||||
typeName: data.element.typeName,
|
||||
data: data.element.data
|
||||
}
|
||||
]
|
||||
}
|
||||
self.renderGraph(targetContainer, graph, self.settings.domOperations.append);
|
||||
self.element.find("a.add.start").removeClass("start").hide();
|
||||
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
this.refreshElement = function (elementUI, elementData) {
|
||||
// Serialize the element UI into an object graph.
|
||||
var graph = {};
|
||||
var data = elementData;
|
||||
var stateFormValues = data ? $.deserialize(data) : null;
|
||||
var formData = $.extend({}, stateFormValues);
|
||||
window.Orchard.Layouts.Serializer.serialize(graph, elementUI);
|
||||
|
||||
if (data) {
|
||||
// Update the element with the new Data.
|
||||
graph.elements[0].state = data;
|
||||
}
|
||||
|
||||
// Special case for columns - we need to refresh the row, as changes to the column will have an effect to its silbings.
|
||||
if (elementUI.is(".x-column")) {
|
||||
// Serialize the parent UI into an object graph.
|
||||
var containerUI = elementUI.parents(".x-container:first");
|
||||
var containerGraph = {};
|
||||
window.Orchard.Layouts.Serializer.serialize(containerGraph, containerUI);
|
||||
containerGraph.elements[0].elements.splice(graph.elements[0].index, 1, graph.elements[0]);
|
||||
|
||||
// Render the graph.
|
||||
this.renderGraph(containerUI, containerGraph, self.settings.domOperations.replace, formData);
|
||||
} else {
|
||||
// Render the graph.
|
||||
this.renderGraph(elementUI, graph, self.settings.domOperations.replace, formData);
|
||||
}
|
||||
};
|
||||
|
||||
this.serialize = window.Orchard.Layouts.Serializer.serialize;
|
||||
|
||||
this.applyTemplate = function (templateId) {
|
||||
var graph = this.serialize({}, this.canvas);
|
||||
|
||||
$.ajax({
|
||||
url: self.settings.endpoints.applyTemplate,
|
||||
data: {
|
||||
templateId: templateId,
|
||||
layoutstate: JSON.stringify(graph),
|
||||
__RequestVerificationToken: self.settings.antiForgeryToken
|
||||
},
|
||||
dataType: "html",
|
||||
type: "post"
|
||||
}).then(function (html) {
|
||||
self.canvas.find(".x-root > .x-holder").html(html);
|
||||
|
||||
// Trigger event.
|
||||
self.element.trigger("elementupdated", { elementUI: self.canvas });
|
||||
});
|
||||
};
|
||||
|
||||
this.toolbar.element.on("templateselected", function (e, data) {
|
||||
var templateId = data.templateId;
|
||||
self.applyTemplate(templateId);
|
||||
});
|
||||
|
||||
var onEditElement = function (e) {
|
||||
var sender = $(e.sender);
|
||||
var elementUI = sender.closest(".x-element");
|
||||
var elementData = elementUI.data("element");
|
||||
var data = elementData.data;
|
||||
var dialog = new window.Orchard.Layouts.Dialog(".dialog-template");
|
||||
|
||||
dialog.show();
|
||||
dialog.load(self.settings.endpoints.edit, {
|
||||
typeName: elementData.typeName,
|
||||
elementData: data,
|
||||
__RequestVerificationToken: self.settings.antiForgeryToken
|
||||
}, "post");
|
||||
|
||||
dialog.element.on("command", function (e, args) {
|
||||
if (args.command == "save") {
|
||||
self.refreshElement(elementUI, args.element.data);
|
||||
dialog.close();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var onRemoveElement = function (e) {
|
||||
var sender = $(e.sender);
|
||||
var elementUI = sender.closest(".x-element");
|
||||
|
||||
if (confirm(self.settings.confirmDeletePrompt)) {
|
||||
removeElement(elementUI);
|
||||
}
|
||||
};
|
||||
|
||||
var initElementActions = function () {
|
||||
self.canvas.on("click", "a.edit", function (e) {
|
||||
e.preventDefault();
|
||||
onEditElement({ sender: this });
|
||||
});
|
||||
self.canvas.on("click", "a.remove", function (e) {
|
||||
e.preventDefault();
|
||||
onRemoveElement({ sender: this });
|
||||
});
|
||||
};
|
||||
|
||||
var init = function () {
|
||||
initElementActions();
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$(function () {
|
||||
//window.layoutDesigner = new LayoutDesigner($(".layout-designer"));;
|
||||
});
|
||||
})(jQuery);
|
Reference in New Issue
Block a user