canvasdesigner.*.js added to ignore file
Conflicts: .gitignore
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -122,4 +122,8 @@ src/Umbraco.Web.UI.Client/bower_components/*
|
||||
#Ignore Rule for output of generated documentation files from Grunt docserve
|
||||
src/Umbraco.Web.UI.Client/docs/api
|
||||
src/*.boltdata/
|
||||
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.loader.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.palettes.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.panel.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.config.js
|
||||
/src/Umbraco.Web.UI/Umbraco/Js/canvasdesigner.front.js
|
||||
|
||||
@@ -1,318 +0,0 @@
|
||||
|
||||
/*********************************************************************************************************/
|
||||
/* Tuning setting panel config */
|
||||
/*********************************************************************************************************/
|
||||
|
||||
var tuningConfig = {
|
||||
configs: [{
|
||||
name: "Body",
|
||||
schema: "body",
|
||||
selector: "body",
|
||||
editors: [
|
||||
{
|
||||
type: "wide",
|
||||
category: "Dimension",
|
||||
name: "Layout"
|
||||
},
|
||||
{
|
||||
type: "background",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font Color (main)",
|
||||
css: "color",
|
||||
schema: "body, h1, h2, h3, h4, h5, h6, h7, #nav li a"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font Color (secondary)",
|
||||
css: "color",
|
||||
schema: "ul.meta, .byline"
|
||||
},
|
||||
{
|
||||
type: "googlefontpicker",
|
||||
category: "Font",
|
||||
name: "Font Family",
|
||||
css: "color",
|
||||
schema: "body, h1, h2, h3, h4, h5, h6, h7, .byline, #nav, .button"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Nav",
|
||||
schema: "#nav",
|
||||
selector: "nav",
|
||||
editors: [
|
||||
{
|
||||
type: "background",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
},
|
||||
{
|
||||
type: "border",
|
||||
category: "Color",
|
||||
name: "Border",
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Nav",
|
||||
name: "Font Color",
|
||||
css: "color",
|
||||
schema: "#nav li a"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Nav",
|
||||
name: "Font Color (hover / selected)",
|
||||
css: "color",
|
||||
schema: "#nav li:hover a"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Nav",
|
||||
name: "Background Color (hover)",
|
||||
css: "background-color",
|
||||
schema: "#nav li:hover a"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Nav",
|
||||
name: "Background Color (selected)",
|
||||
css: "background-color",
|
||||
schema: "#nav li.current_page_item a"
|
||||
},
|
||||
{
|
||||
type: "googlefontpicker",
|
||||
category: "Font",
|
||||
name: "Font familly",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Logo",
|
||||
schema: "#header .logo div",
|
||||
selector: "#header .logo div",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Border color",
|
||||
css: "border-top-color",
|
||||
schema: "#header .logo"
|
||||
},
|
||||
{
|
||||
type: "padding",
|
||||
category: "Position",
|
||||
name: "Margin",
|
||||
enable: ["top", "bottom"],
|
||||
schema: "#header"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "h2",
|
||||
schema: "h2",
|
||||
selector: "h2 span",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Border color",
|
||||
css: "border-top-color",
|
||||
schema: "h2.major"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font color",
|
||||
css: "color",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "h3",
|
||||
schema: "h3",
|
||||
selector: "h3",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font color",
|
||||
css: "color",
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Banner Title",
|
||||
schema: "#banner h2",
|
||||
selector: "#banner h2",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font color",
|
||||
css: "color",
|
||||
},
|
||||
{
|
||||
type: "slider",
|
||||
category: "Font",
|
||||
name: "Font size",
|
||||
css: "font-size",
|
||||
min: 18,
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
type: "margin",
|
||||
category: "Position",
|
||||
name: "Margin",
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Banner Sub-title",
|
||||
schema: "#banner .byline",
|
||||
selector: "#banner .byline",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Font",
|
||||
name: "Font color",
|
||||
css: "color",
|
||||
},
|
||||
{
|
||||
type: "slider",
|
||||
category: "Font",
|
||||
name: "Font size",
|
||||
css: "font-size",
|
||||
min: 18,
|
||||
max: 100
|
||||
},
|
||||
{
|
||||
type: "margin",
|
||||
category: "Position",
|
||||
name: "Margin",
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Banner",
|
||||
schema: "#banner",
|
||||
selector: "#banner",
|
||||
editors: [
|
||||
{
|
||||
type: "background",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
css: "color"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Banner-wrapper",
|
||||
schema: "#banner-wrapper",
|
||||
selector: "#banner-wrapper",
|
||||
editors: [
|
||||
{
|
||||
type: "background",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
},
|
||||
{
|
||||
type: "padding",
|
||||
category: "Position",
|
||||
name: "Padding",
|
||||
enable: ["top", "bottom"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "#main-wrapper",
|
||||
schema: "#main-wrapper",
|
||||
selector: "#main-wrapper",
|
||||
editors: [
|
||||
{
|
||||
type: "border",
|
||||
category: "Styling",
|
||||
name: "Border",
|
||||
enable: ["top", "bottom"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Image",
|
||||
schema: ".image,.image img,.image:before",
|
||||
selector: ".image",
|
||||
editors: [
|
||||
{
|
||||
type: "radius",
|
||||
category: "Styling",
|
||||
name: "Radius"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Button",
|
||||
schema: ".button",
|
||||
selector: ".button",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Color",
|
||||
css: "color"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
css: "background"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Background Hover",
|
||||
css: "background",
|
||||
schema: ".button:hover"
|
||||
},
|
||||
{
|
||||
type: "radius",
|
||||
category: "Styling",
|
||||
name: "Radius"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Button Alt",
|
||||
schema: ".button-alt",
|
||||
selector: ".button-alt",
|
||||
editors: [
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Color",
|
||||
css: "color"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Background",
|
||||
css: "background"
|
||||
},
|
||||
{
|
||||
type: "color",
|
||||
category: "Color",
|
||||
name: "Background Hover",
|
||||
css: "background",
|
||||
schema: ".button-alt:hover"
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1,280 +0,0 @@
|
||||
/*********************************************************************************************************/
|
||||
/* Global function and variable for panel/page com */
|
||||
/*********************************************************************************************************/
|
||||
|
||||
var currentTarget = undefined;
|
||||
|
||||
var refrechLayout = function (parameters) {
|
||||
|
||||
// hide preview badget
|
||||
$("#umbracoPreviewBadge").hide();
|
||||
|
||||
var string = "less.modifyVars({" + parameters.join(",") + "})";
|
||||
eval(string);
|
||||
}
|
||||
|
||||
/* Fonts loaded in the tuning panel need to be loaded independently in
|
||||
* the content iframe to allow live previewing.
|
||||
*/
|
||||
var webFontScriptLoaded = false;
|
||||
var getFont = function (font) {
|
||||
if (!webFontScriptLoaded) {
|
||||
$.getScript('http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js')
|
||||
.done(function () {
|
||||
webFontScriptLoaded = true;
|
||||
// Recursively call once webfont script is available.
|
||||
getFont(font);
|
||||
})
|
||||
.fail(function () {
|
||||
console.log('error loading webfont');
|
||||
});
|
||||
}
|
||||
else {
|
||||
WebFont.load({
|
||||
google: {
|
||||
families: [font]
|
||||
},
|
||||
loading: function () {
|
||||
//console.log('loading font' + font + ' in iframe');
|
||||
},
|
||||
active: function () {
|
||||
//console.log('loaded font ' + font + ' in iframe');
|
||||
},
|
||||
inactive: function () {
|
||||
//console.log('error loading font ' + font + ' in iframe');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var closeIntelTuning = function (tuningModel) {
|
||||
|
||||
if (tuningModel) {
|
||||
|
||||
$.each(tuningModel.configs, function (indexConfig, config) {
|
||||
if (config.schema) {
|
||||
$(config.schema).unbind();
|
||||
$(config.schema).removeAttr("tuning-over");
|
||||
}
|
||||
});
|
||||
|
||||
initBodyClickEvent();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var initBodyClickEvent = function () {
|
||||
$("body").on("click", function () {
|
||||
if (parent.iframeBodyClick) {
|
||||
parent.iframeBodyClick();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var initIntelTuning = function (tuningModel) {
|
||||
|
||||
if (tuningModel) {
|
||||
|
||||
// Add tuning-over attr for each schema from config
|
||||
$.each(tuningModel.configs, function (indexConfig, config) {
|
||||
var schema = config.selector ? config.selector : config.schema;
|
||||
if (schema) {
|
||||
$(schema).attr("tuning-over", config.name);
|
||||
$(schema).css("cursor", "default");
|
||||
}
|
||||
});
|
||||
|
||||
// Outline tuning-over
|
||||
$(document).mousemove(function (e) {
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
var target = $(e.target);
|
||||
while (target.length > 0 && (target.attr('tuning-over') == undefined || target.attr('tuning-over') == '')) {
|
||||
target = target.parent();
|
||||
}
|
||||
|
||||
if (target.attr('tuning-over') != undefined && target.attr('tuning-over') != '') {
|
||||
target.unbind();
|
||||
outlinePosition(target);
|
||||
target.click(function (e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
//console.info(target.attr('tuning-over'));
|
||||
|
||||
currentTarget = target;
|
||||
outlineSelected();
|
||||
|
||||
parent.refrechIntelTuning(target.attr('tuning-over'), target);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
else {
|
||||
outlinePositionHide();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var outlinePosition = function (target) {
|
||||
|
||||
if (target.length > 0 && target.attr('tuning-over') != undefined && target.attr('tuning-over') != '') {
|
||||
|
||||
var localname = target[0].localName;
|
||||
var height = $(target).outerHeight();
|
||||
var width = $(target).outerWidth();
|
||||
var position = $(target).offset();
|
||||
var posY = position.top ;
|
||||
//$(window).scrollTop();
|
||||
var posX = position.left;
|
||||
//+ $(window).scrollLeft();
|
||||
|
||||
$(".tuning-overlay").css('display', 'block');
|
||||
$(".tuning-overlay").css('left', posX);
|
||||
$(".tuning-overlay").css('top', posY);
|
||||
$(".tuning-overlay").css('width', width + "px");
|
||||
$(".tuning-overlay").css('height', height + "px");
|
||||
|
||||
//console.info("element select " + localname);
|
||||
$(".tuning-overlay span").html(target.attr('tuning-over'));
|
||||
|
||||
}
|
||||
else {
|
||||
outlinePositionHide();
|
||||
//console.info("element not found select");
|
||||
}
|
||||
}
|
||||
|
||||
var outlineSelected = function () {
|
||||
|
||||
var target = currentTarget;
|
||||
|
||||
if (target && target.length > 0 && target.attr('tuning-over') != undefined && target.attr('tuning-over') != '') {
|
||||
|
||||
var localname = target[0].localName;
|
||||
var height = $(target).outerHeight();
|
||||
var width = $(target).outerWidth();
|
||||
var position = $(target).offset();
|
||||
var posY = position.top;
|
||||
//$(window).scrollTop();
|
||||
var posX = position.left;
|
||||
//+ $(window).scrollLeft();
|
||||
|
||||
$(".tuning-overlay-selected").css('display', 'block');
|
||||
$(".tuning-overlay-selected").css('left', posX);
|
||||
$(".tuning-overlay-selected").css('top', posY);
|
||||
$(".tuning-overlay-selected").css('width', width + "px");
|
||||
$(".tuning-overlay-selected").css('height', height + "px");
|
||||
|
||||
//console.info("element select " + localname);
|
||||
$(".tuning-overlay-selected span").html(target.attr('tuning-over'));
|
||||
|
||||
}
|
||||
else {
|
||||
outlinePositionHide();
|
||||
//console.info("element not found select");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var outlinePositionHide = function () {
|
||||
$(".tuning-overlay").css('display', "none");
|
||||
}
|
||||
|
||||
var outlineSelectedHide = function () {
|
||||
currentTarget = undefined;
|
||||
$(".tuning-overlay-selected").css('display', "none");
|
||||
}
|
||||
|
||||
var initTuningPanel = function () {
|
||||
|
||||
// First load the tuning config from file
|
||||
if (tuningConfig) {
|
||||
//console.info("Tuning config from file is loaded");
|
||||
}
|
||||
else {
|
||||
//console.info("tuning config not found");
|
||||
}
|
||||
|
||||
// Add tuning from HTML 5 data tags
|
||||
$("[data-tuning]").each(function (index, value) {
|
||||
var tagName = $(value).data("tuning") ? $(value).data("tuning") : $(value)[0].nodeName.toLowerCase();
|
||||
var tagSchema = $(value).data("schema") ? $(value).data("schema") : $(value)[0].nodeName.toLowerCase();
|
||||
var tagSelector = $(value).data("selector") ? $(value).data("selector") : tagSchema;
|
||||
var tagEditors = $(value).data("editors"); //JSON.parse(...);
|
||||
|
||||
tuningConfig.configs.splice(tuningConfig.configs.length, 0, {
|
||||
name: tagName,
|
||||
schema: tagSchema,
|
||||
selector: tagSelector,
|
||||
editors: tagEditors
|
||||
});
|
||||
});
|
||||
//console.info("HTML5 tags");
|
||||
|
||||
// For each editor config create a composite alias
|
||||
$.each(tuningConfig.configs, function (configIndex, config) {
|
||||
$.each(config.editors, function (editorIndex, editor) {
|
||||
var clearSchema = config.schema.replace(/[^a-zA-Z0-9]+/g, '').toLowerCase();
|
||||
var clearEditor = JSON.stringify(editor).replace(/[^a-zA-Z0-9]+/g, '').toLowerCase();
|
||||
editor.alias = clearSchema + clearEditor;
|
||||
});
|
||||
});
|
||||
//console.info("Alias tags");
|
||||
|
||||
// Create or update the less file
|
||||
$.ajax({
|
||||
url: "/Umbraco/Api/CanvasDesigner/Init",
|
||||
type: 'POST',
|
||||
dataType: "json",
|
||||
error: function (err) {
|
||||
alert(err.responseText)
|
||||
},
|
||||
data: {
|
||||
config: JSON.stringify(tuningConfig),
|
||||
pageId: pageId
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
// Add Less link in head
|
||||
$("head").append("<link>");
|
||||
css = $("head").children(":last");
|
||||
css.attr({
|
||||
rel: "stylesheet/less",
|
||||
type: "text/css",
|
||||
href: data
|
||||
});
|
||||
//console.info("Less styles are loaded");
|
||||
|
||||
// Init Less.js
|
||||
$.getScript("/Umbraco/lib/Less/less-1.7.0.min.js", function (data, textStatus, jqxhr) {
|
||||
|
||||
// Init panel
|
||||
if (parent.setFrameIsLoaded) {
|
||||
parent.setFrameIsLoaded(tuningConfig, tuningPalette);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
if (parent.setFrameIsLoaded) {
|
||||
|
||||
// Overlay background-color: rgba(28, 203, 255, 0.05);
|
||||
$("body").append("<div class=\"tuning-overlay\" style=\"display:none; pointer-events: none; position: absolute; z-index: 9999; border: 1px solid #2ebdff; border-radius: 3px; \"><span style=\"position:absolute;background: #2ebdff; font-family: Helvetica, Arial, sans-serif; color: #fff; padding: 0 5px; font-size: 10px; line-height: 16px; display: inline-block; border-radius: 0 0 3px 0;\"></span></div>");
|
||||
$("body").append("<div class=\"tuning-overlay-selected\" style=\"display:none; pointer-events: none; position: absolute; z-index: 9998; border: 2px solid #2ebdff; border-radius: 3px;\"><span style=\"position:absolute;background: #2ebdff; font-family: Helvetica, Arial, sans-serif; color: #fff; padding: 0 5px; font-size: 10px; line-height: 16px; display: inline-block; border-radius: 0 0 3px 0;\"></span></div>");
|
||||
|
||||
// Set event for any body click
|
||||
initBodyClickEvent()
|
||||
|
||||
// Init tuning panel
|
||||
initTuningPanel();
|
||||
}
|
||||
|
||||
});
|
||||
@@ -1,19 +0,0 @@
|
||||
LazyLoad.js([
|
||||
'/Umbraco/lib/jquery/jquery-2.0.3.min.js',
|
||||
'/Umbraco/lib/jquery/jquery-ui-1.10.4.custom.min.js',
|
||||
'/Umbraco/lib/angular/1.1.5/angular.min.js',
|
||||
'/Umbraco/lib/underscore/underscore.js',
|
||||
'/Umbraco/js/app.js',
|
||||
'/Umbraco/js/umbraco.resources.js',
|
||||
'/Umbraco/js/umbraco.services.js',
|
||||
'/Umbraco/js/umbraco.security.js',
|
||||
'/Umbraco/ServerVariables',
|
||||
'/Umbraco/lib/spectrum/spectrum.js',
|
||||
'http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js',
|
||||
'/umbraco/js/canvasdesigner.panel.js',
|
||||
], function () {
|
||||
jQuery(document).ready(function () {
|
||||
angular.bootstrap(document, ['Umbraco.canvasdesigner']);
|
||||
});
|
||||
}
|
||||
);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user