firefox: compatibility fixes
This commit is contained in:
parent
fbccde5df1
commit
91b5db7e39
5 changed files with 17 additions and 17 deletions
|
|
@ -16,9 +16,10 @@ module.exports = {
|
|||
stateSave: function() {
|
||||
state = JSON.stringify(module.exports.stateGet(),null,' ')
|
||||
var down = $('<a download="'+new Date().toJSON().slice(0,10)+'_'+new Date().toJSON().slice(11,16)+'.preset"></a>')
|
||||
var blob = new Blob([state],{type : 'text/plain'});
|
||||
var blob = new Blob([state],{type : 'application/x-javascript'});
|
||||
down.attr('href', window.URL.createObjectURL(blob))
|
||||
down[0].click()
|
||||
var event = new MouseEvent("click");
|
||||
down[0].dispatchEvent(event);
|
||||
},
|
||||
|
||||
stateGet: function (){
|
||||
|
|
@ -72,12 +73,14 @@ module.exports = {
|
|||
|
||||
toggleFullscreen: function(){
|
||||
|
||||
var isInFullScreen = document.webkitIsFullScreen
|
||||
var isInFullScreen = document.webkitFullScreenElement || document.mozFullScreenElement
|
||||
|
||||
if (isInFullScreen) {
|
||||
document.webkitExitFullscreen()
|
||||
if (document.webkitExitFullscreen) document.webkitExitFullscreen()
|
||||
if (document.mozCancelFullScreen) document.mozCancelFullScreen()
|
||||
} else {
|
||||
document.documentElement.webkitRequestFullScreen()
|
||||
if (document.documentElement.webkitRequestFullScreen) document.documentElement.webkitRequestFullScreen()
|
||||
if (document.documentElement.mozRequestFullScreen) document.documentElement.mozRequestFullScreen(true)
|
||||
}
|
||||
|
||||
},
|
||||
|
|
@ -102,10 +105,10 @@ module.exports = {
|
|||
sessionSave: function() {
|
||||
var sessionfile = JSON.stringify(SESSION,null,' ')
|
||||
var down = $('<a download="'+new Date().toJSON().slice(0,10)+'_'+new Date().toJSON().slice(11,16)+'.js"></a>')
|
||||
var blob = new Blob([sessionfile],{type : 'text/plain'});
|
||||
var blob = new Blob([sessionfile],{type : 'application/x-javascript'});
|
||||
down.attr('href', window.URL.createObjectURL(blob))
|
||||
down[0].click()
|
||||
|
||||
var event = new MouseEvent("click");
|
||||
down[0].dispatchEvent(event);
|
||||
},
|
||||
|
||||
editorEnable: function(){
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@
|
|||
|
||||
ctx.clearRect(0,0,self.width,self.height)
|
||||
ctx.font = PXSCALE * 2 * 13 + 'px Droid Sans'
|
||||
ctx.textBaseline = "top"
|
||||
ctx.textBaseline = "middle"
|
||||
ctx.fillStyle = self.color
|
||||
|
||||
if (self.center) {
|
||||
ctx.textAlign = settings.align
|
||||
ctx.fillText(newVal,self.width/2,0)
|
||||
ctx.fillText(newVal,self.width/2,this.height/2)
|
||||
} else {
|
||||
ctx.fillText(newVal,0,0)
|
||||
ctx.fillText(newVal,0,this.height/2)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,5 @@
|
|||
cursor: inherit;
|
||||
-webkit-tap-highlight-color:transparent;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,12 @@
|
|||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex:1;
|
||||
display: flex;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
canvas {
|
||||
flex:1;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,14 +20,12 @@
|
|||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex:1;
|
||||
display: flex;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
canvas {
|
||||
flex:1;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue