Commit bf3bb35a authored by Romain Courteaud's avatar Romain Courteaud

Release version 0.7.4

parent 689c76ae
This diff is collapsed.
This diff is collapsed.
...@@ -657,6 +657,14 @@ ...@@ -657,6 +657,14 @@
}; };
}(DOMParser)); }(DOMParser));
;// IE does not support have Document.prototype.contains.
if (typeof document.contains !== 'function') {
Document.prototype.contains = function(node) {
if (node === this || node.parentNode === this)
return true;
return this.documentElement.contains(node);
}
}
;/*! RenderJs */ ;/*! RenderJs */
/*jslint nomen: true*/ /*jslint nomen: true*/
...@@ -1164,21 +1172,25 @@ ...@@ -1164,21 +1172,25 @@
gadget_instance.__chan.bind("declareMethod", gadget_instance.__chan.bind("declareMethod",
function (trans, method_name) { function (trans, method_name) {
gadget_instance[method_name] = function () { gadget_instance[method_name] = function () {
var argument_list = arguments; var argument_list = arguments,
return new RSVP.Promise(function (resolve, reject) { wait_promise = new RSVP.Promise(function (resolve, reject) {
gadget_instance.__chan.call({ gadget_instance.__chan.call({
method: "methodCall", method: "methodCall",
params: [ params: [
method_name, method_name,
Array.prototype.slice.call(argument_list, 0)], Array.prototype.slice.call(argument_list, 0)],
success: function (s) { success: function (s) {
resolve(s); resolve(s);
}, },
error: function (e) { error: function (e) {
reject(e); reject(e);
} }
});
});
return new RSVP.Queue()
.push(function () {
return wait_promise;
}); });
});
}; };
return "OK"; return "OK";
}); });
...@@ -1564,25 +1576,28 @@ ...@@ -1564,25 +1576,28 @@
if (document_element.nodeType === 9) { if (document_element.nodeType === 9) {
settings.title = document_element.title; settings.title = document_element.title;
for (i = 0; i < document_element.head.children.length; i += 1) { if (document_element.head !== null) {
element = document_element.head.children[i]; for (i = 0; i < document_element.head.children.length; i += 1) {
if (element.href !== null) { element = document_element.head.children[i];
// XXX Manage relative URL during extraction of URLs if (element.href !== null) {
// element.href returns absolute URL in firefox but "" in chrome; // XXX Manage relative URL during extraction of URLs
if (element.rel === "stylesheet") { // element.href returns absolute URL in firefox but "" in chrome;
settings.required_css_list.push( if (element.rel === "stylesheet") {
renderJS.getAbsoluteURL(element.getAttribute("href"), url) settings.required_css_list.push(
); renderJS.getAbsoluteURL(element.getAttribute("href"), url)
} else if (element.nodeName === "SCRIPT" && );
(element.type === "text/javascript" || } else if (element.nodeName === "SCRIPT" &&
!element.type)) { (element.type === "text/javascript" ||
settings.required_js_list.push( !element.type)) {
renderJS.getAbsoluteURL(element.getAttribute("src"), url) settings.required_js_list.push(
); renderJS.getAbsoluteURL(element.getAttribute("src"), url)
} else if (element.rel === "http://www.renderjs.org/rel/interface") { );
settings.interface_list.push( } else if (element.rel ===
renderJS.getAbsoluteURL(element.getAttribute("href"), url) "http://www.renderjs.org/rel/interface") {
); settings.interface_list.push(
renderJS.getAbsoluteURL(element.getAttribute("href"), url)
);
}
} }
} }
} }
......
This diff is collapsed.
{ {
"name": "renderjs", "name": "renderjs",
"version": "0.7.3", "version": "0.7.4",
"description": "RenderJs provides HTML5 gadgets", "description": "RenderJs provides HTML5 gadgets",
"main": "dist/renderjs-latest.js", "main": "dist/renderjs-latest.js",
"dependencies": { "dependencies": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment