mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-20 19:59:54 +09:00
17223554 : xquared upgrade to 0.7
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4968 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5956e254e7
commit
7c3b336e41
59 changed files with 34562 additions and 8454 deletions
55
modules/editor/skins/xquared/javascripts/macro/Base.js
Normal file
55
modules/editor/skins/xquared/javascripts/macro/Base.js
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* @namespace
|
||||
*/
|
||||
xq.macro = {};
|
||||
|
||||
/**
|
||||
* @requires Xquared.js
|
||||
*/
|
||||
xq.macro.Base = xq.Class(/** @lends xq.macro.Base.prototype */{
|
||||
/**
|
||||
* @constructs
|
||||
*
|
||||
* @param {Object} Parameters or HTML fragment.
|
||||
* @param {String} URL to place holder image.
|
||||
*/
|
||||
initialize: function(id, paramsOrHtml, placeHolderImgSrc) {
|
||||
this.id = id;
|
||||
this.placeHolderImgSrc = placeHolderImgSrc;
|
||||
|
||||
if(typeof paramsOrHtml === "string") {
|
||||
this.html = paramsOrHtml;
|
||||
this.params = {};
|
||||
|
||||
this.initFromHtml();
|
||||
} else {
|
||||
this.html = null;
|
||||
this.params = paramsOrHtml;
|
||||
|
||||
this.initFromParams();
|
||||
}
|
||||
},
|
||||
|
||||
initFromHtml: function() {},
|
||||
initFromParams: function() {},
|
||||
createHtml: function() {throw "Not implemented";},
|
||||
onLayerInitialzied: function(layer) {},
|
||||
|
||||
createPlaceHolderHtml: function() {
|
||||
var size = {width: 5, height: 5};
|
||||
var def = {};
|
||||
def.id = this.id;
|
||||
def.params = this.params;
|
||||
|
||||
sb = [];
|
||||
sb.push('<img ');
|
||||
sb.push( 'class="xqlayer" ');
|
||||
sb.push( 'src="' + this.placeHolderImgSrc + '" ');
|
||||
sb.push( 'width="' + (size.width + 4) + '" height="' + (size.height + 4) + '" ');
|
||||
sb.push( 'longdesc="' + escape(JSON.stringify(def)) + '" ');
|
||||
sb.push( 'style="border: 1px solid #ccc" ');
|
||||
sb.push('/>');
|
||||
|
||||
return sb.join('');
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue