mirror of https://github.com/artf/grapesjs.git
13 changed files with 320 additions and 312 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,18 +1,14 @@ |
|||
define(['backbone'], |
|||
function (Backbone) { |
|||
/** |
|||
* @class AssetView |
|||
* */ |
|||
return Backbone.View.extend({ |
|||
define(['backbone'], function (Backbone) { |
|||
|
|||
initialize: function(o) { |
|||
this.options = o; |
|||
this.config = o.config || {}; |
|||
this.pfx = this.config.stylePrefix || ''; |
|||
this.ppfx = this.config.pStylePrefix || ''; |
|||
this.className = this.pfx + 'asset'; |
|||
this.listenTo( this.model, 'destroy remove', this.remove ); |
|||
}, |
|||
return Backbone.View.extend({ |
|||
initialize: function(o) { |
|||
this.options = o; |
|||
this.config = o.config || {}; |
|||
this.pfx = this.config.stylePrefix || ''; |
|||
this.ppfx = this.config.pStylePrefix || ''; |
|||
this.className = this.pfx + 'asset'; |
|||
this.listenTo( this.model, 'destroy remove', this.remove); |
|||
}, |
|||
}); |
|||
|
|||
}); |
|||
}); |
|||
|
|||
@ -1,25 +1,24 @@ |
|||
define(function() { |
|||
return { |
|||
|
|||
run: function(editor, sender, opts) { |
|||
var opt = opts || {}; |
|||
var config = editor.getConfig(); |
|||
var modal = editor.Modal; |
|||
var assetManager = editor.AssetManager; |
|||
assetManager.onClick(opt.onClick); |
|||
assetManager.onDblClick(opt.onDblClick); |
|||
return { |
|||
|
|||
// old API
|
|||
assetManager.setTarget(opt.target); |
|||
assetManager.onSelect(opt.onSelect); |
|||
run: function(editor, sender, opts) { |
|||
var opt = opts || {}; |
|||
var config = editor.getConfig(); |
|||
var modal = editor.Modal; |
|||
var assetManager = editor.AssetManager; |
|||
|
|||
if (modal) { |
|||
modal.setTitle(opt.modalTitle || 'Select image'); |
|||
modal.setContent(''); |
|||
modal.setContent(assetManager.render(1)); |
|||
modal.open(); |
|||
} |
|||
}, |
|||
assetManager.onClick(opt.onClick); |
|||
assetManager.onDblClick(opt.onDblClick); |
|||
|
|||
}; |
|||
// old API
|
|||
assetManager.setTarget(opt.target); |
|||
assetManager.onSelect(opt.onSelect); |
|||
|
|||
modal.setTitle(opt.modalTitle || 'Select image'); |
|||
modal.setContent(assetManager.render()); |
|||
modal.open(); |
|||
}, |
|||
|
|||
}; |
|||
}); |
|||
|
|||
@ -1,12 +1,9 @@ |
|||
define(['backbone'], |
|||
function(Backbone) { |
|||
return Backbone.Model.extend({ |
|||
|
|||
defaults: { |
|||
title: '', |
|||
content: '', |
|||
open: false, |
|||
} |
|||
|
|||
define(['backbone'], function(Backbone) { |
|||
return Backbone.Model.extend({ |
|||
defaults: { |
|||
title: '', |
|||
content: '', |
|||
open: false, |
|||
} |
|||
}); |
|||
}); |
|||
}); |
|||
|
|||
@ -1,11 +1,12 @@ |
|||
<div class="<%= pfx %>dialog"> |
|||
<div class="<%= pfx %>header"> |
|||
<div class="<%= pfx %>title"><%= title %></div> |
|||
<div class="<%= pfx %>btn-close">⨯</div> |
|||
</div> |
|||
<div class="<%= pfx %>content"> |
|||
<div id="<%= pfx %>c"> <%= content %> </div> |
|||
<div style="clear:both"></div> |
|||
</div> |
|||
<div class="<%= pfx %>header"> |
|||
<div class="<%= pfx %>title"><%= title %></div> |
|||
<div class="<%= pfx %>btn-close">⨯</div> |
|||
</div> |
|||
<div class="<%= pfx %>content"> |
|||
<div id="<%= pfx %>c"> <%= content %> </div> |
|||
<div style="clear:both"></div> |
|||
</div> |
|||
</div> |
|||
<div class="<%= pfx %>backlayer"></div> |
|||
<div class="<%= pfx %>backlayer"></div> |
|||
<div class="<%= pfx %>collector" style="display: none"></div> |
|||
|
|||
Loading…
Reference in new issue