summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-31 22:37:03 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-31 22:37:03 +0200
commitd22d51a1ae49680015326857360eb699f31efced (patch)
tree43ac5007de26848f516b37b863daeb77f86d97d2 /StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
parenta81d20bc18d002623fc24cdcea8df7eed6d85bc9 (diff)
NO MORE ANDROID BUILD
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js')
-rw-r--r--StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js b/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
deleted file mode 100644
index c9235498..00000000
--- a/StoneIsland/platforms/android/assets/www/js/lib/account/ConsentModal.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var ConsentModal = View.extend({
-
- el: "#consent_modal",
-
- events: {
- "change [name=AccountTermsConsent]": "changeConsent",
- "click #consent_proceed": "proceed",
- "click #consent_logout": "logout",
- "click a": "navigate",
- },
-
- initialize: function(){
- this.$form = this.$(".form")
- this.$msg = this.$(".msg")
- this.$checkbox = this.$("[name=AccountTermsConsent]")
- this.$consentError = this.$("#consent_error")
- },
-
- check: function(){
- var status = localStorage.getItem('account_terms.consent')
- console.log('account_terms.consent', status)
- if (status !== 'true') {
- console.log('we demand consent!')
- app.demand_consent = true
- this.show()
- return true
- } else {
- console.log('already received consent!')
- this.hide()
- app.demand_consent = false
- return false
- }
- },
-
- show: function(){
- app.demand_consent = true
- this.$el.show()
- setTimeout(function(){
- this.$el.addClass('visible')
- }.bind(this), 20)
- app.curtain.show('opaque')
- setTimeout(function(){
- app.curtain.show('opaque')
- }, 300)
- },
-
- hide: function(){
- app.curtain.hide()
- this.$el.removeClass('visible')
- setTimeout(function(){
- this.$el.hide()
- app.curtain.$el.removeClass('opaque')
- }.bind(this), 300)
- },
-
- navigate: function(e){
- var href = $(e.currentTarget).attr('href').replace('#', '')
- console.log(href)
- this.hide()
- app.router.go(href)
- },
-
- changeConsent: function(){
- var state = this.$checkbox.prop("checked")
- if (state) {
- this.$consentError.removeClass('visible')
- } else {
- this.$consentError.addClass('visible')
- }
- },
-
- proceed: function(){
- var state = this.$checkbox.prop("checked")
- if (!state) {
- this.$consentError.addClass('visible')
- return
- }
- app.demand_consent = false
- this.hide()
- localStorage.setItem('account_terms.consent', 'true')
- },
-
- logout: function(){
- app.demand_consent = false
- this.hide()
- localStorage.setItem('account_terms.consent', 'false')
- app.router.go("account/logout")
- },
-
-}) \ No newline at end of file