Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
137a1e46
Commit
137a1e46
authored
Jul 24, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced window.App with dependency on App module in all gadgets
parent
4632b319
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
236 additions
and
160 deletions
+236
-160
js/main.js
js/main.js
+2
-5
modules/address/address.js
modules/address/address.js
+6
-5
modules/basket/basket.js
modules/basket/basket.js
+6
-5
modules/browser/browser.js
modules/browser/browser.js
+6
-5
modules/config/config.js
modules/config/config.js
+5
-6
modules/confirm/confirm.js
modules/confirm/confirm.js
+6
-5
modules/description/description.js
modules/description/description.js
+6
-5
modules/details/details.js
modules/details/details.js
+6
-5
modules/footer/footer.js
modules/footer/footer.js
+6
-5
modules/gallery/gallery.js
modules/gallery/gallery.js
+6
-5
modules/index/index.js
modules/index/index.js
+6
-5
modules/item/item.js
modules/item/item.js
+6
-5
modules/items/items.js
modules/items/items.js
+82
-24
modules/login/login.js
modules/login/login.js
+6
-5
modules/media/media.js
modules/media/media.js
+6
-5
modules/payment/payment.js
modules/payment/payment.js
+6
-5
modules/refine/refine.js
modules/refine/refine.js
+6
-5
modules/search/search.js
modules/search/search.js
+6
-5
modules/searchbar/searchbar.js
modules/searchbar/searchbar.js
+8
-9
modules/seo/seo.js
modules/seo/seo.js
+6
-5
modules/shipment/shipment.js
modules/shipment/shipment.js
+6
-5
modules/sorting/sorting.js
modules/sorting/sorting.js
+6
-5
modules/summary/summary.js
modules/summary/summary.js
+6
-5
modules/teaser/teaser.js
modules/teaser/teaser.js
+6
-5
modules/terms/terms.js
modules/terms/terms.js
+6
-5
modules/translate/translate.js
modules/translate/translate.js
+13
-11
No files found.
js/main.js
View file @
137a1e46
...
...
@@ -67,7 +67,6 @@
,
shim
:
{
'
jqm
'
:
{
deps
:
[
'
jquery
'
],
exports
:
'
mobile
'
}
,
'
jio
'
:
{
deps
:
[
'
md5
'
]
}
,
'
complex_queries
'
:
{
exports
:
'
complex_queries
'
}
,
'
localstorage
'
:
{
deps
:
[
'
jio
'
,
'
complex_queries
'
]
}
,
'
indexstorage
'
:
{
deps
:
[
'
jio
'
]
}
,
'
renderjs
'
:
{
deps
:
[
'
jquery
'
],
exports
:
'
RenderJs
'
}
...
...
@@ -102,12 +101,10 @@
// expose App once everything is loaded
spec
.
setup
.
done
(
function
(
App
,
Config
)
{
window
.
App
=
App
;
// expose configuration - settings
window
.
App
.
settings
=
Config
.
settings
;
App
.
settings
=
Config
.
settings
;
// expose configuration - storages
window
.
App
.
storage
=
Config
.
storage
;
App
.
storage
=
Config
.
storage
;
for
(
i
=
0
;
i
<
window
.
fallbackLoader
.
deferreds
.
length
;
i
+=
1
)
{
window
.
fallbackLoader
.
deferreds
[
i
]
...
...
modules/address/address.js
View file @
137a1e46
define
([
'
text!address.html!strip
'
'
app
'
,
'
text!address.html!strip
'
,
'
validval
'
,
'
css!address
'
],
function
(
source
,
validator
)
{
function
(
App
,
source
,
validator
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/basket/basket.js
View file @
137a1e46
define
([
'
text!basket.html!strip
'
'
app
'
,
'
text!basket.html!strip
'
,
'
css!basket
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/browser/browser.js
View file @
137a1e46
define
([
'
text!browser.html!strip
'
'
app
'
,
'
text!browser.html!strip
'
,
'
css!browser
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/config/config.js
View file @
137a1e46
define
([
'
storage
'
'
app
'
,
'
storage
'
,
'
async
'
],
function
(
storage
)
{
function
(
App
,
storage
)
{
"
use strict
"
;
var
priv
=
{};
...
...
@@ -36,13 +37,10 @@ define([
spec
.
config
.
settings
.
language_default
=
"
en-EN
"
;
spec
.
config
.
settings
.
language_current
=
spec
.
config
.
settings
.
language_default
;
spec
.
config
.
settings
.
language_selector
=
"
translate
"
;
spec
.
config
.
settings
.
language_set
=
false
;
}
else
{
// create application settings
spec
.
config
.
settings
.
language_default
=
spec
.
response
.
default_language
||
"
en-EN
"
;
spec
.
config
.
settings
.
language_current
=
spec
.
response
.
language_current
||
spec
.
config
.
settings
.
language_default
;
spec
.
config
.
settings
.
language_selector
=
spec
.
response
.
selector
||
"
translate
"
;
spec
.
config
.
settings
.
language_set
=
spec
.
response
.
language_set
||
false
;
}
spec
.
config
.
settings
.
screen_format
=
priv
.
setScreenDimensions
();
...
...
@@ -75,7 +73,7 @@ define([
function
(
data
)
{
priv
.
config_call
(
data
);
}
)
)
;
// require(
// ["async!http://www.franckreich.de/members/export/x/configuration.json"],
// config_call
...
...
@@ -98,6 +96,7 @@ define([
}
storage
.
queryStorage
(
spec
);
}
// return config
return
that
;
}
...
...
modules/confirm/confirm.js
View file @
137a1e46
define
([
'
text!confirm.html!strip
'
'
app
'
,
'
text!confirm.html!strip
'
,
'
css!confirm
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/description/description.js
View file @
137a1e46
define
([
'
text!description.html!strip
'
'
app
'
,
'
text!description.html!strip
'
,
'
css!description
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/details/details.js
View file @
137a1e46
define
([
'
text!details.html!strip
'
'
app
'
,
'
text!details.html!strip
'
,
'
css!details
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/footer/footer.js
View file @
137a1e46
define
([
'
text!footer.html!strip
'
'
app
'
,
'
text!footer.html!strip
'
,
'
css!footer
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/gallery/gallery.js
View file @
137a1e46
define
([
'
text!gallery.html!strip
'
'
app
'
,
'
text!gallery.html!strip
'
,
'
css!gallery
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/index/index.js
View file @
137a1e46
define
([
'
text!index.html!strip
'
'
app
'
,
'
text!index.html!strip
'
,
'
css!index
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{},
def
;
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/item/item.js
View file @
137a1e46
define
([
'
text!item.html!strip
'
'
app
'
,
'
text!item.html!strip
'
,
'
css!item
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/items/items.js
View file @
137a1e46
define
([
'
text!items.html!strip
'
'
app
'
,
'
text!items.html!strip
'
,
'
css!items
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
// TODO: the method to query and display items should be set be
// either the searchbar or the storage?
response
.
mockup
=
function
(
source
,
callback_mockup
)
{
var
markup
,
spec
,
gadget
=
RenderJs
.
getSelfGadget
(),
id
=
gadget
.
dom
.
attr
(
'
id
'
).
split
(
"
__
"
).
splice
(
-
1
)[
0
],
config
=
gadget
.
state
[
0
][
id
].
_config
,
module
=
config
.
datasource
.
module
,
screen
=
window
.
App
.
settings
.
screen_format
,
// settable options
screen
=
App
.
settings
.
screen_format
,
size
=
screen
===
"
small
"
?
"
small
"
:
"
medium
"
,
shortcut
=
size
.
substring
(
0
,
1
);
shortcut
=
size
.
substring
(
0
,
1
),
identifier
=
App
.
settings
.
identifier
||
"
item_id
"
;
spec
=
{};
...
...
@@ -27,9 +32,29 @@ define([
"
select_list
"
:
config
.
datasource
.
fields
||
undefined
};
// if we have a search tag being passed, run a search
if
(
location
.
search
!==
""
)
{
spec
.
query
=
true
;
spec
.
query_string
=
location
.
search
.
split
(
"
=
"
)[
1
].
replace
(
"
+
"
,
"
"
);
}
spec
.
callback
=
function
(
err
,
response
)
{
var
item
,
i
,
str
=
""
,
price
;
// cleanup
// no results
// TODO: show something for users like most-searched/sold...
// TODO: this is optionable
if
(
response
.
total_rows
===
0
)
{
str
+=
"
<li data-icon='false' class='empty_results'>
"
+
"
<h3 class='translate' data-i18n='items.results_zero'></h3>
"
+
"
<p class='translate' data-i18n='items.results_modify'></p>
"
+
"
</li>
"
;
}
else
{
// generate results
for
(
i
=
0
;
i
<
response
.
total_rows
;
i
+=
1
)
{
item
=
response
.
rows
[
i
].
value
;
...
...
@@ -41,7 +66,8 @@ define([
}
str
+=
"
<li data-icon='false'>
"
+
"
<a href='details.html?product=
"
+
item
.
_id
+
"
<a href='details.html?
"
+
identifier
+
"
=
"
+
encodeURI
(
item
[
identifier
])
+
"
' title='
"
+
item
.
brand
+
"
,
"
+
item
.
title
+
"
'>
"
+
"
<span class='img_container_items'>
"
+
"
<img alt='
"
+
item
.
title
+
"
' src='
"
+
...
...
@@ -49,6 +75,7 @@ define([
size
+
"
' /></span><span class='description_items'>
"
+
item
.
brand
+
"
"
+
item
.
title
+
"
"
+
price
+
"
</span></a></li>
"
;
}
}
// add to data
markup
=
source
.
replace
(
/<!-- items -->/g
,
str
);
...
...
@@ -57,23 +84,54 @@ define([
}
// query for items
window
.
App
[
module
].
switchboard
(
spec
);
App
[
module
].
switchboard
(
spec
);
};
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
var
closest
=
function
(
elem
,
selector
)
{
var
matchesSelector
=
elem
.
matches
||
elem
.
webkitMatchesSelector
||
elem
.
mozMatchesSelector
||
elem
.
msMatchesSelector
;
while
(
elem
)
{
if
(
matchesSelector
.
bind
(
elem
)(
selector
))
{
return
elem
;
}
else
{
elem
=
elem
.
parentNode
;
}
}
return
false
;
};
// set binding for opening a detailed view
// TODO: this should also be a link-method call
self
.
dom
.
find
(
"
ul
"
).
on
(
"
click
"
,
"
a
"
,
function
(
e
)
{
var
key
;
e
.
preventDefault
();
key
=
closest
(
e
.
target
,
"
a
"
).
getAttribute
(
"
href
"
).
split
(
"
?
"
)[
1
];
// show this item
$
.
mobile
.
changePage
(
"
details.html
"
,
{
"
transition
"
:
"
slide
"
,
"
data
"
:
{
"
product
"
:
key
}
});
});
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/login/login.js
View file @
137a1e46
define
([
'
text!login.html!strip
'
'
app
'
,
'
text!login.html!strip
'
,
'
validval
'
,
'
css!login
'
],
function
(
source
)
{
function
(
App
,
source
,
validator
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/media/media.js
View file @
137a1e46
define
([
'
text!media.html!strip
'
'
app
'
,
'
text!media.html!strip
'
,
'
css!media
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/payment/payment.js
View file @
137a1e46
define
([
'
text!payment.html!strip
'
'
app
'
,
'
text!payment.html!strip
'
,
'
css!payment
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/refine/refine.js
View file @
137a1e46
define
([
'
text!refine.html!strip
'
'
app
'
,
'
text!refine.html!strip
'
,
'
css!refine
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/search/search.js
View file @
137a1e46
define
([
'
text!search.html!strip
'
'
app
'
,
'
text!search.html!strip
'
,
'
css!search
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/searchbar/searchbar.js
View file @
137a1e46
define
([
'
text!searchbar.html!strip
'
'
app
'
,
'
text!searchbar.html!strip
'
,
'
css!searchbar
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
var
filter
=
self
.
dom
.
find
(
"
.searchbar_filter
"
);
filter
.
on
(
"
filterbarbeforefilter
"
,
function
(
e
,
data
)
{
var
value
=
data
.
input
.
value
;
if
(
value
)
{
// now we can autocomplete...
...
...
@@ -34,19 +31,21 @@ define([
}
});
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/seo/seo.js
View file @
137a1e46
define
([
'
text!seo.html!strip
'
'
app
'
,
'
text!seo.html!strip
'
,
'
css!seo
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/shipment/shipment.js
View file @
137a1e46
define
([
'
text!shipment.html!strip
'
'
app
'
,
'
text!shipment.html!strip
'
,
'
css!shipment
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/sorting/sorting.js
View file @
137a1e46
define
([
'
text!sorting.html!strip
'
'
app
'
,
'
text!sorting.html!strip
'
,
'
css!sorting
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/summary/summary.js
View file @
137a1e46
define
([
'
text!summary.html!strip
'
'
app
'
,
'
text!summary.html!strip
'
,
'
css!summary
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/teaser/teaser.js
View file @
137a1e46
define
([
'
text!teaser.html!strip
'
'
app
'
,
'
text!teaser.html!strip
'
,
'
css!teaser
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/terms/terms.js
View file @
137a1e46
define
([
'
text!terms.html!strip
'
'
app
'
,
'
text!terms.html!strip
'
,
'
css!terms
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
response
.
callback
=
function
(
self
)
{
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
});
window
.
fallbackLoader
.
deferreds
.
push
(
def
);
window
.
fallbackLoader
.
args
.
push
(
self
);
}
else
{
// prefix instance-ids, pass JSON
window
.
App
.
renderGadgets
(
self
);
App
.
renderGadgets
(
self
);
}
};
...
...
modules/translate/translate.js
View file @
137a1e46
define
([
'
text!translate.html!strip
'
'
app
'
,
'
text!translate.html!strip
'
,
'
css!translate
'
],
function
(
source
)
{
function
(
App
,
source
)
{
var
response
=
{};
response
.
data
=
source
;
...
...
@@ -59,7 +60,7 @@ define([
//
priv
.
translate
=
function
(
language
,
target
)
{
var
collection
=
target
||
$
(
'
body
'
);
collection
.
find
(
"
.
"
+
window
.
App
.
settings
.
language_selector
).
i18n
();
collection
.
find
(
"
.
"
+
App
.
settings
.
language_selector
).
i18n
();
};
//
...
...
@@ -68,7 +69,7 @@ define([
// @param {string} language > default language to set
//
priv
.
setTranslations
=
function
(
language
)
{
if
(
window
.
App
.
settings
.
language_set
===
"
false
"
)
{
if
(
App
.
settings
.
language_set
===
"
false
"
)
{
$
.
i18n
.
init
({
"
lng
"
:
language
,
"
load
"
:
'
current
'
,
...
...
@@ -79,7 +80,7 @@ define([
},
function
()
{
priv
.
translate
(
language
);
});
window
.
App
.
settings
.
language_set
=
"
true
"
;
App
.
settings
.
language_set
=
"
true
"
;
}
else
{
priv
.
translate
(
language
);
}
...
...
@@ -118,9 +119,9 @@ define([
$
(
"
.popup_all
"
).
popup
(
'
close
'
);
if
(
window
.
App
.
settings
.
language_current
!==
language
)
{
if
(
App
.
settings
.
language_current
!==
language
)
{
// update language
window
.
App
.
settings
.
language_current
=
language
;
App
.
settings
.
language_current
=
language
;
// update icon
priv
.
setIcon
(
language
);
...
...
@@ -138,18 +139,19 @@ define([
// PUBLISH METHODS
// ====================================================================
// TODO: remove once callable via link
window
.
App
.
translate
=
priv
.
translate
;
// TODO: can I add methods to a module, when accessing the module from another module???
App
.
translate
=
priv
.
translate
;
// prefix instance-ids, pass JSON, trigger("create")
window
.
App
.
renderGadgets
(
gadget
);
App
.
renderGadgets
(
gadget
);
// ====================================================================
// INITIALIZE
// ====================================================================
priv
.
initialize
(
window
.
App
.
settings
.
language_current
);
priv
.
initialize
(
App
.
settings
.
language_current
);
};
if
(
window
.
App
===
undefined
)
{
if
(
App
===
undefined
)
{
def
=
new
$
.
Deferred
;
def
.
done
(
function
(
gadget
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment