mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-15 01:09:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4968 201d5d3c-b55e-5fd7-737f-ddc643e51545
36 lines
No EOL
852 B
JavaScript
36 lines
No EOL
852 B
JavaScript
/**
|
|
* @requires macro/Base.js
|
|
*/
|
|
xq.macro.IFrameMacro = xq.Class(xq.macro.Base,
|
|
/**
|
|
* IFrame macro
|
|
*
|
|
* @name xq.macro.IFrameMacro
|
|
* @lends xq.macro.IFrameMacro.prototype
|
|
* @extends xq.macro.Base
|
|
* @constructor
|
|
*/
|
|
{
|
|
initFromHtml: function() {
|
|
this.params.html = this.html;
|
|
},
|
|
initFromParams: function() {
|
|
if(this.params.html) return;
|
|
|
|
var sb = [];
|
|
sb.push('<iframe');
|
|
for(var attrName in this.params) {
|
|
var attrValue = this.params[attrName];
|
|
if(attrValue) sb.push(' ' + attrName.substring("p_".length) + '="' + attrValue + '"');
|
|
}
|
|
sb.push('></iframe>');
|
|
this.params = {html:sb.join("")};
|
|
},
|
|
createHtml: function() {
|
|
return this.params.html;
|
|
}
|
|
});
|
|
xq.macro.IFrameMacro.recognize = function(html) {
|
|
var p = xq.compilePattern("<IFRAME\\s+[^>]+(?:/>|>.*?</(?:IFRAME)>)", "img");
|
|
return !!html.match(p);
|
|
} |