ImportSongs: Implement Google Drive beta testing
Instances that wish to enable Google Drive support should first enable it to only a small subset of users (100 maximum) to allow the OAuth screen to be verified by Google without hitting the user limit. Minimum level in the config can be set to enable beta testing of this feature and then disabled by setting it to None. - Add user level assignment screen to the administration panel - Add privacy policy and links to it in various places - Add switch accounts link near the Google Drive picker
This commit is contained in:
@@ -93,6 +93,11 @@ class Account{
|
||||
this.inputForms.push(this.accountDel.password)
|
||||
this.accountDelDiv = this.getElement("accountdel-div")
|
||||
|
||||
this.linkPrivacy = this.getElement("privacy-btn")
|
||||
this.setAltText(this.linkPrivacy, strings.account.privacy)
|
||||
pageEvents.add(this.linkPrivacy, ["mousedown", "touchstart"], this.openPrivacy.bind(this))
|
||||
this.items.push(this.linkPrivacy)
|
||||
|
||||
this.logoutButton = this.getElement("logout-btn")
|
||||
this.setAltText(this.logoutButton, strings.account.logout)
|
||||
pageEvents.add(this.logoutButton, ["mousedown", "touchstart"], this.onLogout.bind(this))
|
||||
@@ -245,6 +250,12 @@ class Account{
|
||||
|
||||
pageEvents.add(this.registerButton, ["mousedown", "touchstart"], this.onSwitchMode.bind(this))
|
||||
this.items.push(this.registerButton)
|
||||
|
||||
this.linkPrivacy = this.getElement("privacy-btn")
|
||||
this.setAltText(this.linkPrivacy, strings.account.privacy)
|
||||
pageEvents.add(this.linkPrivacy, ["mousedown", "touchstart"], this.openPrivacy.bind(this))
|
||||
this.items.push(this.linkPrivacy)
|
||||
|
||||
if(!register){
|
||||
this.items.push(this.loginButton)
|
||||
}
|
||||
@@ -282,11 +293,17 @@ class Account{
|
||||
this.onSwitchMode()
|
||||
}else if(selected === this.loginButton){
|
||||
this.onLogin()
|
||||
}else if(selected === this.linkPrivacy){
|
||||
assets.sounds["se_don"].play()
|
||||
this.openPrivacy()
|
||||
}
|
||||
}else if(name === "previous" || name === "next"){
|
||||
selected.classList.remove("selected")
|
||||
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
|
||||
this.items[this.selected].classList.add("selected")
|
||||
if(this.items[this.selected] === this.linkPrivacy){
|
||||
this.items[this.selected].scrollIntoView()
|
||||
}
|
||||
assets.sounds["se_ka"].play()
|
||||
}else if(name === "back"){
|
||||
this.onEnd()
|
||||
@@ -380,6 +397,19 @@ class Account{
|
||||
}
|
||||
})
|
||||
}
|
||||
openPrivacy(event){
|
||||
if(event){
|
||||
if(event.type === "touchstart"){
|
||||
event.preventDefault()
|
||||
}else if(event.which !== 1){
|
||||
return
|
||||
}
|
||||
}
|
||||
if(this.locked){
|
||||
return
|
||||
}
|
||||
open("privacy")
|
||||
}
|
||||
onLogout(){
|
||||
if(event){
|
||||
if(event.type === "touchstart"){
|
||||
@@ -583,6 +613,7 @@ class Account{
|
||||
pageEvents.remove(this.customdonResetBtn, ["click", "touchstart"])
|
||||
pageEvents.remove(this.accounPassButton, ["click", "touchstart"])
|
||||
pageEvents.remove(this.accountDelButton, ["click", "touchstart"])
|
||||
pageEvents.remove(this.linkPrivacy, ["mousedown", "touchstart"])
|
||||
pageEvents.remove(this.logoutButton, ["mousedown", "touchstart"])
|
||||
pageEvents.remove(this.saveButton, ["mousedown", "touchstart"])
|
||||
for(var i = 0; i < this.inputForms.length; i++){
|
||||
@@ -602,6 +633,7 @@ class Account{
|
||||
delete this.accountDelButton
|
||||
delete this.accountDel
|
||||
delete this.accountDelDiv
|
||||
delete this.linkPrivacy
|
||||
delete this.logoutButton
|
||||
delete this.saveButton
|
||||
delete this.inputForms
|
||||
@@ -615,12 +647,14 @@ class Account{
|
||||
for(var i = 0; i < this.form.length; i++){
|
||||
pageEvents.remove(this.registerButton, ["keydown", "keyup", "keypress"])
|
||||
}
|
||||
pageEvents.remove(this.linkPrivacy, ["mousedown", "touchstart"])
|
||||
delete this.errorDiv
|
||||
delete this.form
|
||||
delete this.password2
|
||||
delete this.remember
|
||||
delete this.loginButton
|
||||
delete this.registerButton
|
||||
delete this.linkPrivacy
|
||||
}
|
||||
pageEvents.remove(this.endButton, ["mousedown", "touchstart"])
|
||||
delete this.endButton
|
||||
|
||||
Reference in New Issue
Block a user