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

2
src/editor/config/config.js

@ -38,7 +38,7 @@ define(function () {
storageType: 'local', storageType: 'local',
// The css that could only be seen (for instance, inside the code viewer) // 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 //Configurations for Asset Manager
assetManager : {}, assetManager : {},

5
src/editor/main.js

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

Loading…
Cancel
Save