mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +08:00
Plugins: Fix browse button on iOS
This commit is contained in:
parent
a7aee747a8
commit
b9d990a643
@ -452,3 +452,20 @@ kbd{
|
|||||||
#dropzone.dragover{
|
#dropzone.dragover{
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
.plugin-browse-button{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#plugin-browse{
|
||||||
|
position: absolute;
|
||||||
|
font-size: inherit;
|
||||||
|
top: -0.1em;
|
||||||
|
left: -0.1em;
|
||||||
|
right: -0.1em;
|
||||||
|
bottom: -0.1em;
|
||||||
|
border-radius: 0.5em;
|
||||||
|
opacity: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
#plugin-browse::-webkit-file-upload-button{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@ -97,7 +97,7 @@ var plugins
|
|||||||
var noResizeRoot = false
|
var noResizeRoot = false
|
||||||
|
|
||||||
pageEvents.add(root, ["touchstart", "touchmove", "touchend"], event => {
|
pageEvents.add(root, ["touchstart", "touchmove", "touchend"], event => {
|
||||||
if(event.cancelable && cancelTouch && event.target.tagName !== "SELECT"){
|
if(event.cancelable && cancelTouch && event.target.tagName !== "SELECT" && (event.target.tagName !== "INPUT" || event.target.type !== "file")){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -384,24 +384,22 @@ class SettingsView{
|
|||||||
if(this.customSettings){
|
if(this.customSettings){
|
||||||
var form = document.createElement("form")
|
var form = document.createElement("form")
|
||||||
this.browse = document.createElement("input")
|
this.browse = document.createElement("input")
|
||||||
this.browse.id = "browse"
|
this.browse.id = "plugin-browse"
|
||||||
this.browse.type = "file"
|
this.browse.type = "file"
|
||||||
this.browse.multiple = true
|
this.browse.multiple = true
|
||||||
this.browse.accept = ".taikoweb.js"
|
this.browse.accept = ".taikoweb.js"
|
||||||
pageEvents.add(this.browse, "change", this.browseChange.bind(this))
|
pageEvents.add(this.browse, "change", this.browseChange.bind(this))
|
||||||
form.appendChild(this.browse)
|
form.appendChild(this.browse)
|
||||||
loader.screen.appendChild(form)
|
|
||||||
this.browseButton = document.createElement("div")
|
this.browseButton = document.createElement("div")
|
||||||
this.browseButton.classList.add("taibtn", "stroke-sub")
|
this.browseButton.classList.add("taibtn", "stroke-sub", "plugin-browse-button")
|
||||||
|
this.browseText = document.createTextNode("")
|
||||||
|
this.browseButton.appendChild(this.browseText)
|
||||||
|
this.browseButton.appendChild(form)
|
||||||
this.defaultButton.parentNode.insertBefore(this.browseButton, this.defaultButton)
|
this.defaultButton.parentNode.insertBefore(this.browseButton, this.defaultButton)
|
||||||
this.items.push({
|
this.items.push({
|
||||||
id: "browse",
|
id: "browse",
|
||||||
settingBox: this.browseButton
|
settingBox: this.browseButton
|
||||||
})
|
})
|
||||||
this.addTouch(this.browseButton, () => {
|
|
||||||
this.playSound("se_don")
|
|
||||||
this.browse.click()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
this.showDefault = !this.customSettings || plugins.allPlugins.filter(obj => obj.plugin.imported).length
|
this.showDefault = !this.customSettings || plugins.allPlugins.filter(obj => obj.plugin.imported).length
|
||||||
if(this.showDefault){
|
if(this.showDefault){
|
||||||
@ -1189,7 +1187,8 @@ class SettingsView{
|
|||||||
this.setAltText(this.viewTitle, this.customSettings ? strings.plugins.title : strings.gameSettings)
|
this.setAltText(this.viewTitle, this.customSettings ? strings.plugins.title : strings.gameSettings)
|
||||||
this.setAltText(this.endButton, strings.settings.ok)
|
this.setAltText(this.endButton, strings.settings.ok)
|
||||||
if(this.customSettings){
|
if(this.customSettings){
|
||||||
this.setAltText(this.browseButton, strings.plugins.browse)
|
this.browseText.data = strings.plugins.browse
|
||||||
|
this.browseButton.setAttribute("alt", strings.plugins.browse)
|
||||||
}else{
|
}else{
|
||||||
this.setAltText(this.gamepadTitle, strings.settings.gamepadLayout.name)
|
this.setAltText(this.gamepadTitle, strings.settings.gamepadLayout.name)
|
||||||
this.setAltText(this.gamepadEndButton, strings.settings.ok)
|
this.setAltText(this.gamepadEndButton, strings.settings.ok)
|
||||||
@ -1263,9 +1262,9 @@ class SettingsView{
|
|||||||
}
|
}
|
||||||
if(this.customSettings){
|
if(this.customSettings){
|
||||||
pageEvents.remove(this.browse, "change")
|
pageEvents.remove(this.browse, "change")
|
||||||
this.removeTouch(this.browseButton)
|
|
||||||
delete this.browse
|
delete this.browse
|
||||||
delete this.browseButton
|
delete this.browseButton
|
||||||
|
delete this.browseText
|
||||||
}else{
|
}else{
|
||||||
this.removeTouch(this.gamepadSettings)
|
this.removeTouch(this.gamepadSettings)
|
||||||
this.removeTouch(this.gamepadEndButton)
|
this.removeTouch(this.gamepadEndButton)
|
||||||
|
Loading…
Reference in New Issue
Block a user