Commit 0ced97f2 authored by Ivan Tyagov's avatar Ivan Tyagov

Sanitize code to follow jslint rules.

parent 08a05c06
/*global console, require, $, localStorage, document */
// by default RenderJs will render all gadgets when page is loaded // by default RenderJs will render all gadgets when page is loaded
// still it's possible to override this and use explicit gadget rendering // still it's possible to override this and use explicit gadget rendering
var RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING = true; var RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING = true;
// Add required by RenderJs jstorage library only if used HTML application // Add required by RenderJs jstorage library only if used HTML application
// uses requirejs // uses requirejs
if (typeof require!=='undefined') { if (typeof require !== 'undefined') {
require(["../../../../lib/jstorage/jstorage.js"], function (util) { require(["../../../../lib/jstorage/jstorage.js"], function (util) {
}); });
} }
// fallback for IE // fallback for IE
if (typeof console==="undefined" || typeof console.log==="undefined") { if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {}; console = {};
console.log = function () {}; console.log = function () {};
} }
...@@ -49,7 +51,7 @@ var RenderJs = (function () { ...@@ -49,7 +51,7 @@ var RenderJs = (function () {
loadGadgetFromUrl: function (gadget) { loadGadgetFromUrl: function (gadget) {
/* Load gadget's SPECs from URL */ /* Load gadget's SPECs from URL */
var url, gadget_id, gadget_property, cacheable, cache_id, var url, gadget_id, gadget_property, cacheable, cache_id,
app_cache, data, gadget_js; app_cache, data, gadget_js;
url = gadget.attr("data-gadget"); url = gadget.attr("data-gadget");
gadget_id = gadget.attr("id"); gadget_id = gadget.attr("id");
...@@ -63,7 +65,7 @@ var RenderJs = (function () { ...@@ -63,7 +65,7 @@ var RenderJs = (function () {
cacheable = gadget.attr("data-gadget-cacheable"); cacheable = gadget.attr("data-gadget-cacheable");
cache_id = gadget.attr("data-gadget-cache-id"); cache_id = gadget.attr("data-gadget-cache-id");
if (cacheable !== undefined && cache_id !== undefined) { if (cacheable !== undefined && cache_id !== undefined) {
cacheable = Boolean(parseInt(cacheable)); cacheable = Boolean(parseInt(cacheable, 10));
} }
//cacheable = false ; // to develop faster //cacheable = false ; // to develop faster
if (cacheable) { if (cacheable) {
...@@ -200,7 +202,8 @@ var RenderJs = (function () { ...@@ -200,7 +202,8 @@ var RenderJs = (function () {
RenderJs.loadGadgetFromUrl(tab_gadget); RenderJs.loadGadgetFromUrl(tab_gadget);
// clear previous events // clear previous events
RenderJs.GadgetIndex.getRootGadget().getDom().bind( RenderJs.GadgetIndex.getRootGadget().getDom().bind(
"ready", function () { "ready",
function () {
if (!is_ready) { if (!is_ready) {
RenderJs.updateGadgetData(tab_gadget); RenderJs.updateGadgetData(tab_gadget);
is_ready = true; is_ready = true;
...@@ -278,7 +281,7 @@ var RenderJs = (function () { ...@@ -278,7 +281,7 @@ var RenderJs = (function () {
/* Set cache key value */ /* Set cache key value */
$.jStorage.set(cache_id, data); $.jStorage.set(cache_id, data);
} }
} };
}()), }()),
NameSpaceStorageCachePlugin: (function () { NameSpaceStorageCachePlugin: (function () {
...@@ -297,10 +300,10 @@ var RenderJs = (function () { ...@@ -297,10 +300,10 @@ var RenderJs = (function () {
/* Set cache key value */ /* Set cache key value */
namespace[cache_id] = data; namespace[cache_id] = data;
} }
};
}}()) }())
};
}}()), }()),
Gadget: (function (gadget_id, dom) { Gadget: (function (gadget_id, dom) {
/* /*
...@@ -359,7 +362,7 @@ var RenderJs = (function () { ...@@ -359,7 +362,7 @@ var RenderJs = (function () {
); );
// XXX: we should unregister all gadgets (if any we replace now in DOM) // XXX: we should unregister all gadgets (if any we replace now in DOM)
} }
} };
}()), }()),
GadgetIndex: (function () { GadgetIndex: (function () {
...@@ -439,7 +442,7 @@ var RenderJs = (function () { ...@@ -439,7 +442,7 @@ var RenderJs = (function () {
*/ */
// XXX: // XXX:
} }
} };
}()), }()),
InteractionGadget : (function () { InteractionGadget : (function () {
...@@ -520,14 +523,14 @@ var RenderJs = (function () { ...@@ -520,14 +523,14 @@ var RenderJs = (function () {
} }
}); });
} }
} };
}()) }())
} };
}()); }());
// impliticly call RenderJs bootstrap // impliticly call RenderJs bootstrap
$(document).ready(function () { $(document).ready(function () {
if (RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING){ if (RENDERJS_ENABLE_IMPLICIT_GADGET_RENDERING) {
RenderJs.bootstrap($('body')); RenderJs.bootstrap($('body'));
} }
}); });
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