summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/index.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/index.js142
1 files changed, 0 insertions, 142 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js
deleted file mode 100755
index a28faabf..00000000
--- a/StoneIsland/platforms/android/assets/www/js/index.js
+++ /dev/null
@@ -1,142 +0,0 @@
-var app = (function(){
- var app = {}
-
- app.init = function(){
- console.log("init")
-
- if (window.location.hostname === 'lvh.me' || window.location.hostname === 'stone.giraffe.life' || window.location.hostname === 'dev.stone.giraffe.life') {
- console.log('launching in test mode')
- sdk.init({ env: "test" })
- }
- else {
- sdk.init({ env: "production" })
- }
-
- app.bind()
- app.build()
-
- app.iscroll_options = {
- mouseWheel: true,
- scrollbars: true,
- }
-
- if (window.cordova) {
- document.addEventListener('deviceready', app.ready, false)
- }
- else {
- app.ready()
- }
- }
-
- app.bind = function(){
- document.addEventListener('touchmove', function(e){ e.preventDefault() })
- FastClick.attach(document.body)
- }
-
- app.build = function(){
- app.blog = new BlogView ()
- app.archive = new ArchiveView ()
- app.hub = new HubView ()
- app.story = new StoryView ()
- app.cart = new CartView ()
-
- app.intro = new IntroView ()
- app.header = new HeaderView ()
- app.footer = new FooterView ()
- app.curtain = new CurtainView ()
- app.nav = new NavView ()
-
- app.account = new AccountView ()
- app.login = new LoginView ()
- app.logout = new LogoutView ()
- app.signup = new SignupView ()
- app.profile = new ProfileView ()
- app.payment = new PaymentView ()
- app.shipping = new ShippingView ()
- app.settings = new SettingsView ()
- app.orders = new OrdersView ()
-
- app.terms = new PageView ({ page: "terms" })
- app.privacy = new PageView ({ page: "privacy" })
- app.returns = new PageView ({ page: "returns" })
- app.care = new PageView ({ page: "care" })
-
- app.collection = new CollectionView ()
- app.product = new ProductView ()
- app.closed = new ClosedStoreView ()
- app.search = new SearchView ()
-
- app.selector = new Selector ()
- }
-
- app.ready = function(){
- console.log(">> READY")
- if (window.cordova) {
- document.addEventListener('pause', app.paused, false)
- document.addEventListener('resume', app.resumed, false)
- document.addEventListener('online', app.online, false)
- document.addEventListener('offline', app.offline, false)
- cordova.plugins.Keyboard.disableScroll(true)
- cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false)
- geo.fetch()
- var image = new Image
- image.src = "./img/compass-logo.png"
- }
-
- app.view = null
- app.router = new SiteRouter ()
-
-// if (sdk.env == "test") {
-// app.router.launch()
-// }
-// else {
-// }
-
- if (navigator.onLine) {
- app.account.connect()
- app.blog.fetch(function(){
- app.router.initial_route = "/intro"
- app.router.launch()
- })
- }
- else {
- console.log(">> LAUNCHED WHILE OFFLINE")
- app.router.go("intro")
- app.finished_launching()
- }
-
- push.init()
- }
-
- app.finished_launching = function(){
- console.log(">> FINISHED LAUNCHING")
- if (window.cordova) {
- navigator.splashscreen.hide()
- }
- $("body").removeClass("loading")
- }
-
- var refresh_time = +Date.now()
- app.paused = function(){}
- app.resumed = function(){
- console.log( "app is ready?", app.is_ready )
-
- geo.fetch()
- var now = +Date.now()
- if (now - refresh_time > 60 * 60 * 1000) {
- refresh_time = now
- app.blog.refresh()
- }
- }
-
- app.online = function(){
- console.log(">> ONLINE")
- }
- app.offline = function(){
- console.log(">> OFFLINE")
- }
-
- return app
-})()
-
-app.init()