Commit eebfc455 authored by Ivan Tyagov's avatar Ivan Tyagov

Remove logging. Add back tabbular gadget test.

parent 264ca7e3
...@@ -63,13 +63,11 @@ var RenderJs = (function () { ...@@ -63,13 +63,11 @@ var RenderJs = (function () {
app_cache = RenderJs.Cache.get(cache_id, undefined); app_cache = RenderJs.Cache.get(cache_id, undefined);
if(app_cache===undefined || app_cache===null){ if(app_cache===undefined || app_cache===null){
// not in cache so we pull from network and cache // not in cache so we pull from network and cache
//console.log("not in cache: " + cache_id + " " + url);
$.ajax({url:url, $.ajax({url:url,
yourCustomData: {"gadget_id": gadget_id, "cache_id": cache_id}, yourCustomData: {"gadget_id": gadget_id, "cache_id": cache_id},
success: function (data) { success: function (data) {
cache_id = this.yourCustomData.cache_id; cache_id = this.yourCustomData.cache_id;
gadget_id = this.yourCustomData.gadget_id; gadget_id = this.yourCustomData.gadget_id;
//console.log("set in cache: " + cache_id);
RenderJs.Cache.set(cache_id, data); RenderJs.Cache.set(cache_id, data);
RenderJs.GadgetIndex.getGadgetById(gadget_id).setReady(); RenderJs.GadgetIndex.getGadgetById(gadget_id).setReady();
RenderJs.updateAndRecurse(gadget, data); RenderJs.updateAndRecurse(gadget, data);
...@@ -86,7 +84,6 @@ var RenderJs = (function () { ...@@ -86,7 +84,6 @@ var RenderJs = (function () {
} }
else { else {
// not to be cached // not to be cached
//console.log("Not to be cached " + url + gadget_id);
$.ajax({url:url, $.ajax({url:url,
yourCustomData: {"gadget_id": gadget_id}, yourCustomData: {"gadget_id": gadget_id},
success: function (data) { success: function (data) {
...@@ -125,9 +122,7 @@ var RenderJs = (function () { ...@@ -125,9 +122,7 @@ var RenderJs = (function () {
var is_gadget_list_loaded; var is_gadget_list_loaded;
is_gadget_list_loaded = RenderJs.GadgetIndex.isGadgetListLoaded(); is_gadget_list_loaded = RenderJs.GadgetIndex.isGadgetListLoaded();
if (is_gadget_list_loaded){ if (is_gadget_list_loaded){
//console.log("to trigger ");
if (!RenderJs.isReady()) { if (!RenderJs.isReady()) {
//console.log("trigger ", RenderJs.GadgetIndex.getGadgetList());
RenderJs.GadgetIndex.getRootGadget().getDom().trigger("ready"); RenderJs.GadgetIndex.getRootGadget().getDom().trigger("ready");
RenderJs.setReady(true); RenderJs.setReady(true);
} }
...@@ -445,7 +440,6 @@ var RenderJs = (function () { ...@@ -445,7 +440,6 @@ var RenderJs = (function () {
func = new Function(func_body); func = new Function(func_body);
source_gadget.dom.bind(source_method_id, func); source_gadget.dom.bind(source_method_id, func);
} }
console.log(source_gadget_id, '.', source_method_id, '-->', destination_gadget_id, '.', destination_method_id);
} }
); );
} }
......
function setupRenderJSTest(){ function setupRenderJSTest(){
/* /*
* Main RenderJS test entry point * Main RenderJS test entry point
...@@ -11,13 +13,12 @@ function setupRenderJSTest(){ ...@@ -11,13 +13,12 @@ function setupRenderJSTest(){
}); });
// module("TabularGadget"); module("TabularGadget");
// test('addNewTabGadget', function(){ test('addNewTabGadget', function(){
// RenderJs.TabbularGadget.addNewTabGadget("qunit-fixture", "Person_view/Form_asRenderJSGadget", "ERP5Form.update", "Form_asJSON?form_id=Person_view"); RenderJs.TabbularGadget.addNewTabGadget("qunit-fixture", "test-gadget.xhtml");
// equal($("#qunit-fixture").children(".gadget").length, 1); equal($("#qunit-fixture").children(".gadget").length, 1);
// equal(RenderJs.GadgetIndex.getGadgetList().length, 1); equal(RenderJs.GadgetIndex.getGadgetList().length, 1);
// });
// });
module("GadgetIndex"); module("GadgetIndex");
test('GadgetIndex', function(){ test('GadgetIndex', function(){
...@@ -26,7 +27,7 @@ function setupRenderJSTest(){ ...@@ -26,7 +27,7 @@ function setupRenderJSTest(){
RenderJs.GadgetIndex.unregisterGadget(this); RenderJs.GadgetIndex.unregisterGadget(this);
}); });
$("#qunit-fixture").append('<div gadget="" id="new">XXXXXXXXXXXX</div>'); $("#qunit-fixture").append('<div data-gadget="" id="new">XXXXXXXXXXXX</div>');
RenderJs.bootstrap($("#qunit-fixture")); RenderJs.bootstrap($("#qunit-fixture"));
RenderJs.GadgetIndex.getRootGadget().getDom().one("ready", function (){ RenderJs.GadgetIndex.getRootGadget().getDom().one("ready", function (){
RenderJs.update($("#qunit-fixture")); RenderJs.update($("#qunit-fixture"));
......
test!!!
<div id="test-container">
</div>
\ No newline at end of file
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