Browse Source

Add protected css to the code viewer

pull/36/head
Artur Arseniev 10 years ago
parent
commit
e65cd055e0
  1. 13
      src/commands/view/ExportTemplate.js
  2. 2
      src/editor/config/config.js
  3. 5
      src/editor/main.js

13
src/commands/view/ExportTemplate.js

@ -6,11 +6,12 @@ define(function() {
return {
run: function(editor, sender){
this.sender = sender;
this.components = editor.Canvas.getWrapper().get('components');
this.modal = editor.Dialog || null;
this.cm = editor.CodeManager || null;
this.sender = sender;
this.components = editor.DomComponents.getComponents();
this.modal = editor.Dialog || null;
this.cm = editor.CodeManager || null;
this.cssc = editor.CssComposer || null;
this.protCss = editor.Config.protectedCss;
this.enable();
},
@ -63,9 +64,9 @@ define(function() {
this.modal.setContent(this.$editors);
this.modal.show();
}
var addCss = this.protCss || '';
this.htmlEditor.setContent( this.cm.getCode(this.components, 'html') );
this.cssEditor.setContent( this.cm.getCode(this.components, 'css', this.cssc));
this.cssEditor.setContent( addCss + this.cm.getCode(this.components, 'css', this.cssc));
if(this.sender)
this.sender.set('active',false);

2
src/editor/config/config.js

@ -38,7 +38,7 @@ define(function () {
storageType: 'local',
// The css that could only be seen (for instance, inside the code viewer)
protectedCss: 'body{margin:0}',
protectedCss: 'body{margin:0;}',
//Configurations for Asset Manager
assetManager : {},

5
src/editor/main.js

@ -138,6 +138,11 @@ define(function (require){
*/
Utils: em.get('Utils'),
/**
* @property {Utils}
*/
Config: em.get('Config'),
/**
* Initialize editor model
* @return {this}

Loading…
Cancel
Save