diff --git a/index.html b/index.html index 5ee30c738..a5f8dfffa 100755 --- a/index.html +++ b/index.html @@ -6,7 +6,6 @@ - ', - attributes: {class:'gjs-fonts gjs-f-b1'} - },{ - id: 'b2', - label: '2 Blocks', - content: '
', - attributes: {class:'gjs-fonts gjs-f-b2'} - },{ - id: 'b3', - label: '3 Blocks', - content: '
', - attributes: {class:'gjs-fonts gjs-f-b3'} - },{ - id: 'b4', - label: '3/7 Block', - content: '
', - attributes: {class:'gjs-fonts gjs-f-b37'} - },{ - id: 'hero', - label: 'Hero section', - content: '
'+ - '
'+ - '
'+ - '
Build your templates without coding
'+ - '
Try it now
', - attributes: {class:'gjs-fonts gjs-f-hero'} - },{ - id: 'h1p', - label: 'Text section', - content: '

Insert title here

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

', - attributes: {class:'gjs-fonts gjs-f-h1p'} - },{ - id: '3ba', - label: 'Badges', - content: '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '
Adam Smith
CEO
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ - '
'+ - '
ftln
'+ - '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '
John Black
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ - '
'+ - '
ftln
'+ - '
'+ - '
'+ - '
'+ - ''+ - '
'+ - '
Jessica White
Web Designer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ - '
'+ - '
ftln'+ - '
'+ - '
', - attributes: {class:'gjs-fonts gjs-f-3ba'} - },{ - id: 'text', - label: 'Text', - attributes: {class:'gjs-fonts gjs-f-text'}, - content: { - type:'text', - content:'Insert your text here', - style: {padding: '10px' }, - activeOnRender: 1 - }, - },{ - id: 'image', - label: 'Image', - attributes: {class:'gjs-fonts gjs-f-image'}, - content: { - style: {color: 'black'}, - type:'image', - activeOnRender: 1 - }, - },{ - id: 'quo', - label: 'Quote', - content: '
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
', - attributes: {class:'fa fa-quote-right'} - },{ - id: 'link', - label: 'Link', - attributes: {class:'fa fa-link'}, - content: { - type:'link', - content:'Link', - style:{color: '#d983a6'} - }, - },{ - id: 'map', - label: 'Map', - attributes: {class:'fa fa-map-o'}, - content: { - type: 'map', - style: {height: '350px'} - }, - },{ - id: 'video', - label: 'Video', - attributes: {class:'fa fa-youtube-play'}, - content: { - type: 'video', - src: 'img/video2.webm', - style: { - height: '350px', - width: '615px', - } - }, - }/*,{ - id: 'table', - label: 'Table', - attributes: {class:'fa fa-table'}, - content: { - type: 'table', - columns: 3, - rows: 5, - style: {height: '150px', width: '100%'} - }, - }*/], - }, - - }; + //Configurations for Device Manager + deviceManager: { + 'devices': [{ + name: 'Desktop', + width: '', + },{ + name: 'Tablet', + width: '992px', + },{ + name: 'Mobile landscape', + width: '768px', + },{ + name: 'Mobile portrait', + width: '480px', + }], + }, + + //Configurations for Style Manager + styleManager: { + + sectors: [{ + name: 'General', + open: false, + buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'], + },{ + name: 'Dimension', + open: false, + buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'], + },{ + name: 'Typography', + open: false, + buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-align', 'text-shadow'], + properties: [{ + property: 'text-align', + list : [ + {value: 'left', className: 'fa fa-align-left'}, + {value: 'center', className: 'fa fa-align-center' }, + {value: 'right', className: 'fa fa-align-right'}, + {value: 'justify', className: 'fa fa-align-justify'} + ], + }] + },{ + name: 'Decorations', + open: false, + buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'], + },{ + name: 'Extra', + open: false, + buildProps: ['transition', 'perspective', 'transform'], + }], + + }, + + //Configurations for Block Manager + blockManager: { + 'blocks': [{ + id: 'b1', + label: '1 Block', + content: '
', + attributes: {class:'gjs-fonts gjs-f-b1'} + },{ + id: 'b2', + label: '2 Blocks', + content: '
', + attributes: {class:'gjs-fonts gjs-f-b2'} + },{ + id: 'b3', + label: '3 Blocks', + content: '
', + attributes: {class:'gjs-fonts gjs-f-b3'} + },{ + id: 'b4', + label: '3/7 Block', + content: '
', + attributes: {class:'gjs-fonts gjs-f-b37'} + },{ + id: 'hero', + label: 'Hero section', + content: '
'+ + '
'+ + '
'+ + '
Build your templates without coding
'+ + '
Try it now
', + attributes: {class:'gjs-fonts gjs-f-hero'} + },{ + id: 'h1p', + label: 'Text section', + content: '

Insert title here

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

', + attributes: {class:'gjs-fonts gjs-f-h1p'} + },{ + id: '3ba', + label: 'Badges', + content: '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
Adam Smith
CEO
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ + '
'+ + '
ftln
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
John Black
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ + '
'+ + '
ftln
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
Jessica White
Web Designer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
'+ + '
'+ + '
ftln'+ + '
'+ + '
', + attributes: {class:'gjs-fonts gjs-f-3ba'} + },{ + id: 'text', + label: 'Text', + attributes: {class:'gjs-fonts gjs-f-text'}, + content: { + type:'text', + content:'Insert your text here', + style: {padding: '10px' }, + activeOnRender: 1 + }, + },{ + id: 'image', + label: 'Image', + attributes: {class:'gjs-fonts gjs-f-image'}, + content: { + style: {color: 'black'}, + type:'image', + activeOnRender: 1 + }, + },{ + id: 'quo', + label: 'Quote', + content: '
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
', + attributes: {class:'fa fa-quote-right'} + },{ + id: 'link', + label: 'Link', + attributes: {class:'fa fa-link'}, + content: { + type:'link', + content:'Link', + style:{color: '#d983a6'} + }, + },{ + id: 'map', + label: 'Map', + attributes: {class:'fa fa-map-o'}, + content: { + type: 'map', + style: {height: '350px'} + }, + },{ + id: 'video', + label: 'Video', + attributes: {class:'fa fa-youtube-play'}, + content: { + type: 'video', + src: 'img/video2.webm', + style: { + height: '350px', + width: '615px', + } + }, + }/*,{ + id: 'table', + label: 'Table', + attributes: {class:'fa fa-table'}, + content: { + type: 'table', + columns: 3, + rows: 5, + style: {height: '150px', width: '100%'} + }, + }*/], + }, + + }; }); diff --git a/src/editor/main.js b/src/editor/main.js index dbf042f4a..7c106f1a6 100644 --- a/src/editor/main.js +++ b/src/editor/main.js @@ -28,6 +28,8 @@ * ``` * Available events * #add:component - Triggered when a new component is added to the editor, the model is passed as an argument to the callback + * #component:update - Triggered when a component is, generally, updated (moved, styled, etc.) + * #component:styleUpdate - Triggered when the style of the component is updated * #canvasScroll - Triggered when the canvas is scrolled * #run:{commandName} - Triggered when some command is called to run (eg. editor.runCommand('preview')) * #stop:{commandName} - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) diff --git a/src/style_manager/view/PropertyView.js b/src/style_manager/view/PropertyView.js index a9fdb1787..0fc10bdb8 100644 --- a/src/style_manager/view/PropertyView.js +++ b/src/style_manager/view/PropertyView.js @@ -144,7 +144,7 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat * @param {Mixed} val Value * @param {Object} opt Options * */ - valueChanged: function(e, val, opt){ + valueChanged: function(e, val, opt) { var mVal = this.getValueForTarget(); if(this.$input) @@ -170,6 +170,11 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat onChange(target, this, opt); }else this.updateTargetStyle(value, null, opt); + + var model = this.model; + this.config.em.trigger('component:update', model); + this.config.em.trigger('component:styleUpdate', model); + this.config.em.trigger('component:styleUpdate:' + model.get('property'), model); }, /** diff --git a/styles/css/main.css b/styles/css/main.css index 0a73d9dd7..e41bf7fb4 100644 --- a/styles/css/main.css +++ b/styles/css/main.css @@ -2647,7 +2647,10 @@ $fontColorActive: #4f8ef7; -o-user-select: none; user-select: none; } -.gjs-no-pointer-events, .gjs-resizer-c { +.gjs-no-pointer-events, .gjs-resizer-c, .gjs-margin-v-el, +.gjs-padding-v-el, +.gjs-fixedmargin-v-el, +.gjs-fixedpadding-v-el { pointer-events: none; } .gjs-bg-main, .gjs-off-prv, .gjs-select option, @@ -2859,6 +2862,24 @@ div.gjs-select { position: absolute; z-index: 9; } +.gjs-margin-v-el, +.gjs-padding-v-el, +.gjs-fixedmargin-v-el, +.gjs-fixedpadding-v-el { + opacity: 0.1; + filter: alpha(opacity=10); + position: absolute; + background-color: yellow; } + +.gjs-fixedmargin-v-el, +.gjs-fixedpadding-v-el { + opacity: 0.2; + filter: alpha(opacity=20); } + +.gjs-padding-v-el, +.gjs-fixedpadding-v-el { + background-color: navy; } + .gjs-resizer-h { pointer-events: all; position: absolute; diff --git a/styles/scss/_gjs_canvas.scss b/styles/scss/_gjs_canvas.scss index 976a73ff6..7391da2e7 100644 --- a/styles/scss/_gjs_canvas.scss +++ b/styles/scss/_gjs_canvas.scss @@ -91,6 +91,32 @@ z-index: 9; } +.#{$app-prefix}margin-v { + +} + +.#{$app-prefix}margin-v-el, +.#{$app-prefix}padding-v-el, +.#{$app-prefix}fixedmargin-v-el, +.#{$app-prefix}fixedpadding-v-el { + @extend .#{$app-prefix}no-pointer-events; + + @include opacity(0.1); + + position: absolute; + background-color: yellow; +} + +.#{$app-prefix}fixedmargin-v-el, +.#{$app-prefix}fixedpadding-v-el { + @include opacity(0.2); +} + +.#{$app-prefix}padding-v-el, +.#{$app-prefix}fixedpadding-v-el { + background-color: navy; +} + $hndlMargin: -5px; .#{$app-prefix}resizer-h {