Commit 14cebc93 authored by Sven Franck's avatar Sven Franck

added deferred callback to all modules

parent 75741309
......@@ -8,8 +8,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -26,5 +26,100 @@
}'>
</div>
<!-- content -->
<div data-role="content" class="ui-content">
<!-- teaser -->
<div id="teaser" data-gadget="modules/teaser/teaser.html" data-gadget-module="teaser"></div>
<!-- quicksearch -->
<div id="quicksearch"
class="searchbar_wrap"
data-gadget="modules/searchbar/searchbar.html"
data-gadget-module="searchbar"
data-gadget-property='{
"state": [
{
"quicksearch": {
"_elements": [
["ui-filter", "attr", "data-i18n", "[placeholder]quicksearch.browse"],
["ui-filter", "attr", "data-i18n-target", "input"]
],
"_config": {
"datasource": {"module": "storage"}
},
"_links": {
"self": {"href": ""},
"datasource": {"href": "modules/storage/storage.html#queryStorage?method=default"},
"show": {"href": "search.html#queryStorage?method=default"}
}
}
}
]
}'>
</div>
<!-- gallery widget -->
<div id="gallery" data-gadget="modules/gallery/gallery.html" data-gadget-module="gallery"></div>
<!-- top sellers -->
<div id="topsellers"
data-gadget="modules/items/items.html"
data-gadget-module="items"
data-gadget-property='{
"state": [
{
"topsellers": {
"_elements": [
["items_title", "attr", "data-i18n", "topsellers.info"],
["items_show", "attr", "data-i18n", "topsellers.show"],
["items_show", "attr", "href", "search.html?show=topsellers"]
],
"_config": {
"datasource": {"module": "storage", "pointer": "topsellers"}
},
"_links": {
"self": {"href": ""},
"datasource": {"href": "modules/storage/storage.html#queryStorage?method=topsellers"},
"show": {"href": "search.html#queryStorage?method=topsellers"}
}
}
}
]
}'>
</div>
<!-- top brands
<div id="topbrands"
data-gadget="modules/items/items.html"
data-gadget-module="items"
data-gadget-property='{
"state": [
{
"topbrands": {
"_elements": [
["items_title", "attr", "data-i18n", "topbrands.info"],
["items_show", "attr", "data-i18n", "topbrands.show"],
["items_show", "attr", "href", "search.html?show=topbrands"]
],
"_config": {
"datasource": {"module": "storage", "pointer": "topbrands"}
},
"_links": {
"self": {"href": ""},
"datasource": {"href": "modules/storage/storage.html#queryStorage?method=topbrands"},
"show": {"href": "search.html#queryStorage?method=topsellers"}
}
}
}
]
}'
></div>-->
<!-- seo story -->
<div id="seo" data-gadget="modules/seo/seo.html" data-gadget-module="seo"></div>
</div>
<!-- footer -->
<div id="footer" data-role="footer" data-position="fixed" data-gadget="modules/footer/footer.html" data-gadget-module="footer"></div>
</body>
</html>
\ No newline at end of file
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -60,8 +60,20 @@ define([
};
response.callback = function (self) {
// renderGadget
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -8,8 +8,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -73,8 +73,8 @@ define([
//);
};
response.callback = function (gadget) {
var filter = gadget.dom.find(".searchbar_filter");
response.callback = function (self) {
var filter = self.dom.find(".searchbar_filter");
filter.on("filterbarbeforefilter", function (e, data) {
var value = data.input.value;
......@@ -96,16 +96,23 @@ define([
// question will be how to store information...
// if we follow the DC scheme, we have some core metadata and the
// rest must be stored in an attachment.
}
});
// renderGadget
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
......@@ -7,8 +7,20 @@ define([
response.data = source;
response.callback = function (self) {
if (window.App === undefined) {
def = new $.Deferred;
def.done(function(gadget) {
// prefix instance-ids, pass JSON
window.App.renderGadgets(gadget);
});
window.fallbackLoader.deferreds.push(def);
window.fallbackLoader.args.push(self);
} else {
// prefix instance-ids, pass JSON
window.App.renderGadgets(self);
}
};
// return response object
......
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