Commit 2428aa3e authored by Sven Franck's avatar Sven Franck

app: add terrible url-crop to allow multiple gadgets to digest same URL

parent 6b37e9d1
...@@ -6020,7 +6020,7 @@ ...@@ -6020,7 +6020,7 @@
* @return {object} field defintions and pass through * @return {object} field defintions and pass through
*/ */
app.content.fields = function (reply) { app.content.fields = function (reply) {
var pass = reply.pass; var pass = reply.pass, query, crop;
if (!pass.skip) { if (!pass.skip) {
...@@ -6033,10 +6033,18 @@ ...@@ -6033,10 +6033,18 @@
// update initial query with urlQuery if one was passed // update initial query with urlQuery if one was passed
if (pass.url_dict.url_query) { if (pass.url_dict.url_query) {
pass.config_dict.initial_query = util.mergeObject( crop = pass.config_dict.property_dict.url_crop;
query = util.mergeObject(
pass.url_dict.url_query, pass.url_dict.url_query,
pass.config_dict.initial_query || {} pass.config_dict.initial_query || {}
); );
// TODO: TOTALLY UGLY hack to allow 2 gadgets who require different urls
// to share... remove ASAP
if (crop) {
query.query = query.query.replace(crop, "");
}
pass.config_dict.initial_query = query;
} }
// fetch field definitions - why make a query without fieldlist? // fetch field definitions - why make a query without fieldlist?
......
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