From 6d78f2291f6bfd87c58195afa2a970f16ef46911 Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 8 Oct 2024 20:19:32 -0300 Subject: [PATCH 1/7] v2.2 --- core/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index dd70d55..4bff866 100644 --- a/core/core.php +++ b/core/core.php @@ -1,6 +1,6 @@ Date: Tue, 8 Oct 2024 20:28:28 -0300 Subject: [PATCH 2/7] Pequenas limpezas em index.php --- index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index db9271c..505a7ed 100644 --- a/index.php +++ b/index.php @@ -33,10 +33,10 @@
-

+

-

+

@@ -115,7 +115,10 @@ + + +
From 1ecfd5f0742612b3607921ed913d0afd61b468d9 Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 8 Oct 2024 20:54:50 -0300 Subject: [PATCH 3/7] =?UTF-8?q?Nova=20barra=20de=20ferramentas;=20bot?= =?UTF-8?q?=C3=A3o=20de=20tela=20inteira=20reposicionada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 20 +++++++++++++------- media/default.css | 24 +++++++++++++++++++++++- media/fullscreen.png | Bin 0 -> 5912 bytes 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 media/fullscreen.png diff --git a/index.php b/index.php index 505a7ed..5311a46 100644 --- a/index.php +++ b/index.php @@ -43,6 +43,11 @@ +
+ + + +

@@ -103,22 +108,23 @@ 15:00 -
+
- -
- - - + + + + - + +
diff --git a/media/default.css b/media/default.css index e2c9dbe..bbdf596 100644 --- a/media/default.css +++ b/media/default.css @@ -133,11 +133,33 @@ body.user #qrcode { .container-debug { position: fixed; - top: 0.02em; + top: .5em; left: .5em; } #debug { color: #ffffff1a; text-shadow: 1px 1px #00000021; + margin: 0; +} +.container-toolbar{ + position: fixed; + top: .5em; + right: .5em; +} + +i.icon { + background-repeat: no-repeat; + background-size: contain; + width: 24px; + height: 24px; + display: inline-block; + filter: invert(); + opacity: .5; +} +i.icon:hover{ + opacity: 1; +} +i.icon.full-screen{ + background-image: url(fullscreen.png); } \ No newline at end of file diff --git a/media/fullscreen.png b/media/fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..a33aba10f8da77b8241f11312ca9a46f145cbfcc GIT binary patch literal 5912 zcmeHLdpK014AHR8?wZ88=@Av)Q*5`en@AsP< z6yQxI8}vnj0B|c`ZEhO@ zThj^h3-wA*Pv5j@)9Tf$?d z4I79=A`XXJvu4fi-Mh84wBq98{QUet5L~fhg^P=etE(%Q%Y`6l%a$z*7A(-#*7o%D z)YsS7)zuXU1n%zct5&UIFc@??T~AL>U0t0*p{S^+P^r{Kix%3Ub+uLhsXn1&dq@<)cI5;>tIT;!ns;a8eXtbc9pykV#uU)&=*VmWLX2-|JCnhF( zd3l+eo12-L#l*zu=;$z+Ow9MKjf)r$H?j1o< zcIV4_r}l~4ljFZ{&iwr9=g8ra-df3#dZ&{yKV5tMLvF1s|nhPX`p8h-Y0A^i)??B1h$Za)NehZLOF0QLa;EY6v3(+M&qUf&% zAD6nXLnmV$z2MZzq?k^q9*QKgu&qmW`OGt4%rRS%R}>*LnvFfP53)ZmmPINyoAM>Z((V zt9&0#>G@@xl0$RFCki?4F+DfNbm{CL8m*R3Gmd0J2c8go?6V$;&vh*pYY+IaO6{l3 zx#R+w$|wJy9wJA9%bNZkUkn^CCvAZPRV`NEQ&?SzhukgBW`C^oqlOV$+EI%5b-U^o zO(b?rVTb$93EMC{_NPVz?o;o+pW(S5ee?q@NNj`_U8G=B&OKx!g+N^~1t>}s(&!?{ ziKZ8+=cb1+)2s{*wV#)Jz;lYeD=hSqI0^hBLsdQuQP2pWG~npLeoaKJ)cG&ytIrYXV>(BUg2fpY!`hOVx44Q?5UR6`%F*ETd zR#^?LK6-O!yL2?dLIf5q>jjoS?_2tChjY{9#t?P{f|P3)`|nMi$uO~Exs2drLVC9P z%R9j#i%a5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C&SS!L=);N`3c|vKAA_>ri%P(YF_`c`SS)*snT}<| zJtSH>x{k;@iwSSjfQCG&qGFP!Te7ylQ_gByBj<>7mIodf|^I`>tVPOqIdv9#PWrSY_aA3p=->u9iCM-Hhx zt(blGIm5k>x380M(jx7CiLt!!T9Nwf;%h!{UJ_bT!G#UcC8q#s+LE+me`!m5VwSba zPXVcEH@_eMpglBK*x;1!0@XeKK;mT$7=J1ehZ%t}jg#vOgrAJCS$ZkJ6!>}#6bqtn zS|t#Q=Qbau_5~FRcYb~=Z5KY!MRa>h9>;%U*qv8Q_ZdVc5{kc~Fts+-Ki6B4`-{aN z_Xhl6m$am%f}Rxf3I3&n6;>17if{W+TOc z`tm=3?|TuB{r983ko#a0!yRoMG_oVrD2mS&A>zHxaGH(aMKMNw9Mvk7S2DWUk21e0=LIw?e zCJgIha*PXEsM%Om6?R8jWnG zMb#?`M~kYy7rRQglWVfrY^~u^74)xS*)2kNwcxpfPo+DmKs}d$Z$?vHtwsta9S64E z0gMP1D679wH_@T2Ne5eM{~DW<+>CMsio;kt(P)(r>nEzXr=9C!6cOG{?N{8bQF}O7 z(okXV4LkPo{d@-so09|;XasoIU5@mlnQ1adx1yr2UE>c#8M6%`pUyX=%TbA*yPqh! SV1$?{$)>L^!9r{l$)HYB6 literal 0 HcmV?d00001 From 03be3ef9a6209d304019be4e656f069a51ad2186 Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 8 Oct 2024 21:34:28 -0300 Subject: [PATCH 4/7] QRCode na barra de ferramentas --- index.php | 54 ++++++++++++--------------------------------- media/admin.css | 3 --- media/default.css | 10 ++++----- media/qrcode.png | Bin 0 -> 6482 bytes scripts/default.js | 20 ++++++++++++++++- 5 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 media/qrcode.png diff --git a/index.php b/index.php index 5311a46..413c93f 100644 --- a/index.php +++ b/index.php @@ -18,10 +18,7 @@ - - -
@@ -30,6 +27,16 @@
+
+ +
+ +
+ +
+ +
+
@@ -43,11 +50,7 @@ -
- - - -
+

@@ -127,7 +130,7 @@
-
+
@@ -135,36 +138,7 @@
-
- -
- - - - - - +
+
\ No newline at end of file diff --git a/media/admin.css b/media/admin.css index c950f4c..02494c4 100644 --- a/media/admin.css +++ b/media/admin.css @@ -14,6 +14,3 @@ body.admin.timer-ready button.pause { visibility: hidden; } -body.admin #qrcode { - filter: blur(4px); -} \ No newline at end of file diff --git a/media/default.css b/media/default.css index bbdf596..de5ba45 100644 --- a/media/default.css +++ b/media/default.css @@ -109,15 +109,12 @@ body .container-title h1 { padding: 0 5px 0 15px; } -body.admin #qrcode { - bottom: 4em; -} #qrcode { position: fixed; margin: 2px; - right: 2px; - + right: 40px; + top: 1px; } body.user #qrcode { @@ -162,4 +159,7 @@ i.icon:hover{ } i.icon.full-screen{ background-image: url(fullscreen.png); +} +i.icon.qrcode{ + background-image: url(qrcode.png); } \ No newline at end of file diff --git a/media/qrcode.png b/media/qrcode.png new file mode 100644 index 0000000000000000000000000000000000000000..5d8bf9f1f6958fc2ddf2bb54f5e1ab16636cfc2c GIT binary patch literal 6482 zcmdUTXHXPfxAo~}fFX|(CCC7hC8&dBXUI7tl7k>Hk|islC4(dpksKu`Q5_J80|rz; zl7ff`MuHLql_1C+e7^eXz5nj5_x*Fbs;hhLvro;O(|fPI_DME1)?uROrUw8p>FH{k z0{~NAVSuKhJRVjZc}jUef#y2upy37Y0tKKv)Qr>sxRb%K<3dgG)G#%))Vg!$j+d90 zx3_m-U|?Zkp^=dh1VI#MEEenT?tb&;O=)Rq4h{|s26OP>L0Vc`Dk>^88cjn(bL!M7 z1VJucx+EbXAt@#MG=E-Wm}&dyFpM|b-4>H7M5e}8`*4ks!qYHDg)S63%1D|_hBAqxwO+qZAm*4Caq zdsaX|z}VQhq@={k%8HYd)4;$WGcz+cHrhbai#LwY9ahwDR)u;^N}e)YOPXqMMsr zVq#)^e7v5Xo{o-=f`Y=WTeq^avrSA)&YwRoA|fIsC6$wtV`yl2;lhP$*RBZ)3OYGC z+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(wB9_VR(E$I>^|4+~>srxhQRPpC220yEpsMM6^c z>?Gd2*TxJ2M-T`p`sytB_nhWm>h=HpOhH$bM`rTJVYsRBj$HJ!yB}_y6|J&Log4Li zi2(0p&Andd%)FzUDAZS$c*jpN zN(00QmbLR`HEM1q)3Z=!zka$nGxA<{?Gg2xdnJ@4y?uISWaR1E${~^$UI3U~;@F8z z*Urh{7;e~&1DZ<@e(?w4?ozT(AJw#tU+{EO1HCWNvo=cHHW);f9nS5L+Tw?{S(QB} zqSQh88hzBJj1sS6)TE6;`!7})Gag~P7@t%U83gcjY?Ydz=y3_<*8}e0FaA1!a0$an zseg_J#22eh)Q}f+z)4N@H#ACzH~#Dl9%47f!%Z3tL}C0NdA=;=y}%BkHu*P=jTl5h zig)q$R@=6nk{D-HxZE}i@>()=HxYcBPYp`Yce>TR(H&&Zyz^7-=WhI@-0i|>lym1O{PDm$rKt7ot!q5;?n+JH4Yj7e`DSBI z?Wjr}hcTbmK8Xh|duTdVQjV;El2xX0t>kOXD|Ht@MNlhtdM%#x#B7nq-@HEbC5`R` zpX~>(V5;H1>tQ^n0pD^dd%7C<=IP2pjCW;Yc5XjwQWSgEgidM|7f&^;L%)!zCRo3N zs$aofrxLUJsslj*tv7N)6P`nLQhoQpR@J+*&qZYyKx4_xlCl_0swXqvw|S92HDOGA za!-$Id;R9Aq~cn1(obZ{ijx_6^GACD{LrYrJx^An@p0JMI->$2M;5e|Li|m5Hj~GL zb3Q=xd-tO<&UYIaxz>7~o- Date: Tue, 8 Oct 2024 22:40:08 -0300 Subject: [PATCH 5/7] Full Screen --- core/init.php | 12 +++++++++++- index.php | 6 ++---- media/default.css | 8 +++++--- scripts/default.js | 8 ++++++++ 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/core/init.php b/core/init.php index 4e35e2a..a8774ff 100644 --- a/core/init.php +++ b/core/init.php @@ -25,4 +25,14 @@ require_once 'core/info.php'; } -$flag_access = AccessCheck::isValidAdminPage() ? 'admin' : 'user'; \ No newline at end of file +$flag_access = AccessCheck::isValidAdminPage() ? 'admin' : 'user'; + +if (AccessCheck::isValidAdminPage()) { + $flag_access = 'admin'; + $full_screen_url = '?i=' . $_GET['i']; + $target_full_screen = ''; +} else { + $flag_access = 'user'; + $full_screen_url = 'javascript:fullScreen();'; + $target_full_screen = ''; +} \ No newline at end of file diff --git a/index.php b/index.php index 413c93f..2193ab8 100644 --- a/index.php +++ b/index.php @@ -28,11 +28,9 @@
-
- +
-
@@ -139,6 +137,6 @@
-
+ \ No newline at end of file diff --git a/media/default.css b/media/default.css index de5ba45..4e50972 100644 --- a/media/default.css +++ b/media/default.css @@ -17,14 +17,16 @@ a { body { font-family: Arial, Helvetica, sans-serif; padding: 0; - margin: 0; + margin: 0; } - body.user, body .container-timer { background-color: var(--timer-default-color); + width: 100%; +} +body.user{ + overflow: hidden; } - body .container-timer { padding: .1em; font-size: 6em; diff --git a/scripts/default.js b/scripts/default.js index e7900f4..ddc4ae6 100644 --- a/scripts/default.js +++ b/scripts/default.js @@ -30,4 +30,12 @@ function alternarQRCode(){ qrcode.style.display = alternarQRCodeStatus ? 'block': 'none'; } +function fullScreen(){ + if (document.fullscreenElement != null){ + document.exitFullscreen(); + } else { + document.getElementById('main').requestFullscreen(); + } +} + window.addEventListener("load", main); \ No newline at end of file From cae9b3fa0a9f990d2e7d4d6bde647c0316537c85 Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 8 Oct 2024 22:42:48 -0300 Subject: [PATCH 6/7] Ocultando barra de rolagem no admin --- media/default.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/default.css b/media/default.css index 4e50972..a5fb48e 100644 --- a/media/default.css +++ b/media/default.css @@ -24,8 +24,8 @@ body .container-timer { background-color: var(--timer-default-color); width: 100%; } -body.user{ - overflow: hidden; +body{ + overflow-x: hidden; } body .container-timer { padding: .1em; From e4551633067d186ddfff046acfbc385153a1f851 Mon Sep 17 00:00:00 2001 From: Tiago Date: Tue, 8 Oct 2024 23:13:38 -0300 Subject: [PATCH 7/7] =?UTF-8?q?Formata=C3=A7=C3=A3o=20de=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media/admin.css | 3 +- media/default.css | 19 ++++--- media/obs.css | 15 +++--- scripts/classes.js | 74 ++++++++++++++-------------- scripts/default.js | 26 +++++----- scripts/qrcode.js | 120 ++++++++++++++++++++++----------------------- 6 files changed, 132 insertions(+), 125 deletions(-) diff --git a/media/admin.css b/media/admin.css index 02494c4..c4269d9 100644 --- a/media/admin.css +++ b/media/admin.css @@ -12,5 +12,4 @@ body.admin.timer-sync .timer-buttons, body.admin.timer-zero button.pause, body.admin.timer-ready button.pause { visibility: hidden; -} - +} \ No newline at end of file diff --git a/media/default.css b/media/default.css index a5fb48e..7d037fd 100644 --- a/media/default.css +++ b/media/default.css @@ -17,16 +17,19 @@ a { body { font-family: Arial, Helvetica, sans-serif; padding: 0; - margin: 0; + margin: 0; } + body.user, body .container-timer { background-color: var(--timer-default-color); width: 100%; } -body{ + +body { overflow-x: hidden; } + body .container-timer { padding: .1em; font-size: 6em; @@ -141,7 +144,8 @@ body.user #qrcode { text-shadow: 1px 1px #00000021; margin: 0; } -.container-toolbar{ + +.container-toolbar { position: fixed; top: .5em; right: .5em; @@ -156,12 +160,15 @@ i.icon { filter: invert(); opacity: .5; } -i.icon:hover{ + +i.icon:hover { opacity: 1; } -i.icon.full-screen{ + +i.icon.full-screen { background-image: url(fullscreen.png); } -i.icon.qrcode{ + +i.icon.qrcode { background-image: url(qrcode.png); } \ No newline at end of file diff --git a/media/obs.css b/media/obs.css index dd9950f..7380d7d 100644 --- a/media/obs.css +++ b/media/obs.css @@ -1,16 +1,17 @@ - -body.obs{ +body.obs { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; background-color: black; - color:white; + color: white; } -.obs button{ + +.obs button { background-color: rgb(49, 49, 49); - color:white; + color: white; border-radius: 6px; - padding: 6px; + padding: 6px; } -.obs button:hover{ + +.obs button:hover { background-color: rgb(100, 99, 99); } diff --git a/scripts/classes.js b/scripts/classes.js index 033e11f..8968929 100644 --- a/scripts/classes.js +++ b/scripts/classes.js @@ -9,10 +9,10 @@ var Timer = { endTime: null, preparedTime: null, updateFailed: false, - isSyncing: function() { + isSyncing: function () { return Timer._syncing; }, - setSyncing: function(s) { + setSyncing: function (s) { if (s) { Status.setMessage("Sincronizando..."); } else { @@ -20,15 +20,15 @@ var Timer = { } Timer._syncing = s; }, - prepareTime: function(time_value) { + prepareTime: function (time_value) { Timer.preparedTime = time_value; - Property.set('timer-prepared', (time_value), function(data) { + Property.set('timer-prepared', (time_value), function (data) { document.body.classList.add('timer-ready'); Timer.preparedTime = data['timer-prepared']; Timer.refreshInterface(); }); }, - syncTicTac: function(callback_func) { + syncTicTac: function (callback_func) { clearInterval(Timer._interval1s); clearInterval(Timer._interval1sUpdate); Timer.setSyncing(true); @@ -46,12 +46,12 @@ var Timer = { Timer._diffServer = 0; Timer._diffSum = 0; Timer.setText(''); - Timer._syncTicTacLoop(function() { + Timer._syncTicTacLoop(function () { }); }, - _syncTicTacLoop: function(callback_sync) { - HTTPRequest.getJSON('?timer=1&syncCount=' + Timer._syncCount + "&localTime=" + Timer.localTime, function(data) { + _syncTicTacLoop: function (callback_sync) { + HTTPRequest.getJSON('?timer=1&syncCount=' + Timer._syncCount + "&localTime=" + Timer.localTime, function (data) { var diff = data['diff']; Timer.serverTimeMillis = data['serverTimeMillis']; if (diff != Timer.serverTimeMillis) { @@ -62,12 +62,12 @@ var Timer = { Timer._syncCount++; var nextTimeout = 1000 - diffToZero; console.log("Timer._syncCount,diff, diffToZero, nextTimeout", Timer._syncCount, diff, diffToZero, nextTimeout); - setTimeout(function() { + setTimeout(function () { if (Timer._syncCount >= Timer.pingCount) { var avgDiff = Timer._diffSum / Timer._syncCount; var miliRounded = Math.floor(avgDiff / 1000) * 1000; Timer.localTime += miliRounded; - setTimeout(function() { + setTimeout(function () { Timer.initTicTac(); try { callback_sync(); @@ -81,7 +81,7 @@ var Timer = { }, nextTimeout); }); }, - initTicTac: function() { + initTicTac: function () { console.log('Timer.initTicTac'); Timer.setSyncing(false); delete Timer._syncCount; @@ -89,10 +89,10 @@ var Timer = { delete Timer._diffSum; delete Timer.serverTimeMillis; Timer.localTime = Math.round(Timer.localTime / 1000); - Timer._interval1s = setInterval(function() { + Timer._interval1s = setInterval(function () { Timer.localTime += 1; }, 1000); - Timer._interval1sUpdate = setInterval(function() { + Timer._interval1sUpdate = setInterval(function () { Timer.updateData(); Timer.refreshInterface(); Status.setDebugMessage('L: ' + Timer.localTime + '\nS: ' + Timer.serverTime); @@ -104,8 +104,8 @@ var Timer = { }, 500); Timer.updateData(Timer.refreshInterface); }, - updateData: function(callback) { - Property.getAll(function(data) { + updateData: function (callback) { + Property.getAll(function (data) { if (data) { Timer.preparedTime = data['timer-prepared']; Timer.startTime = data['timer-start']; @@ -122,7 +122,7 @@ var Timer = { if (callback) callback(); }); }, - refreshInterface: function() { + refreshInterface: function () { var seconds = 0; document.body.classList.remove('timer-sync-error'); document.body.classList.remove('timer-ignored'); @@ -206,42 +206,42 @@ var Timer = { } } }, - setContent: function(content) { + setContent: function (content) { document.getElementById('timer').innerHTML = content; }, - setText: function(content) { + setText: function (content) { Timer.setContent(content); document.title = content; }, - getRemainingSeconds: function() { + getRemainingSeconds: function () { seconds = Timer.getRemainingSecondsDiff(); if (seconds < 0) { return 0; } return seconds; }, - getRemainingSecondsDiff: function() { + getRemainingSecondsDiff: function () { return Timer.endTime - Timer.localTime }, - isSemaphored: function() { + isSemaphored: function () { return Timer.startTime > Timer.localTime; }, - isPaused: function() { + isPaused: function () { return Timer.preparedTime && Timer.endTime == 0; }, - isEnding: function() { + isEnding: function () { seconds = Timer.getRemainingSecondsDiff(); return seconds >= 0 && seconds < 10; }, - isRunning: function() { + isRunning: function () { seconds = Timer.getRemainingSeconds(); return seconds > 0 && seconds < 86400; }, - isPrepared: function() { + isPrepared: function () { return Timer.endTime <= 0; }, - start: function() { - Property.set('timer-start', Timer.localTime + 3, function(data) { + start: function () { + Property.set('timer-start', Timer.localTime + 3, function (data) { Timer.preparedTime = data['timer-prepared']; Timer.startTime = data['timer-start']; Timer.endTime = data['timer-end']; @@ -249,7 +249,7 @@ var Timer = { console.log('Timer.start set', data); }); }, - updateButtonStartLabel: function(seconds) { + updateButtonStartLabel: function (seconds) { try { m = Math.floor(seconds / 60); s = seconds % 60; @@ -262,8 +262,8 @@ var Timer = { } var Property = { - getAll: function(callbackdata) { - HTTPRequest.getJSON('?up=1', function(data) { + getAll: function (callbackdata) { + HTTPRequest.getJSON('?up=1', function (data) { if (data) { Status.setMessageError(''); } else { @@ -272,31 +272,31 @@ var Property = { callbackdata(data); }); }, - set: function(prop_name, prop_value, func) { + set: function (prop_name, prop_value, func) { HTTPRequest.getJSON("?set=1&prop_name=" + prop_name + "&prop_value=" + prop_value, func); } } var Status = { - setMessage: function(message) { + setMessage: function (message) { document.getElementById("status").innerHTML = message; }, - setMessageError: function(message) { + setMessageError: function (message) { document.getElementById("status-error").innerHTML = message; }, - setDebugMessage: function(message) { + setDebugMessage: function (message) { document.getElementById("debug").innerHTML = message; } } var HTTPRequest = { - getJSON: function(url, callback_func) { + getJSON: function (url, callback_func) { HTTPRequest._send(url + '&json=1&_=' + (Math.floor(Math.random() * 1000000)) + "&i=" + GLOBAL_ID, callback_func); }, - _send: function(url, callback_func) { + _send: function (url, callback_func) { var xhr = new XMLHttpRequest(); if (callback_func) { - xhr.onreadystatechange = function() { + xhr.onreadystatechange = function () { if (xhr.readyState === 4) { try { var r = JSON.parse(xhr.responseText); diff --git a/scripts/default.js b/scripts/default.js index ddc4ae6..5f07b24 100644 --- a/scripts/default.js +++ b/scripts/default.js @@ -1,13 +1,13 @@ var alternarQRCodeStatus = false; -function main(){ +function main() { document.getElementById("visible").style.display = ''; Status.setMessageError(''); Timer.syncTicTac(); if (window.obsstudio) { document.body.classList.add('obs'); - window.obsstudio.getStatus(function(status) { + window.obsstudio.getStatus(function (status) { document.getElementById('debug').innerHTML = (status); }) } @@ -15,27 +15,27 @@ function main(){ text: CURRENT_URL, width: 128, height: 128, - colorDark : "#000000", - colorLight : "#ffffff", - correctLevel : QRCode.CorrectLevel.H - }); + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); var qrcode_elem = document.getElementById("qrcode"); - qrcode_elem.title=""; + qrcode_elem.title = ""; } -function alternarQRCode(){ +function alternarQRCode() { var qrcode = document.getElementById('qrcode'); - alternarQRCodeStatus = ! alternarQRCodeStatus; - qrcode.style.display = alternarQRCodeStatus ? 'block': 'none'; + alternarQRCodeStatus = !alternarQRCodeStatus; + qrcode.style.display = alternarQRCodeStatus ? 'block' : 'none'; } -function fullScreen(){ - if (document.fullscreenElement != null){ +function fullScreen() { + if (document.fullscreenElement != null) { document.exitFullscreen(); } else { document.getElementById('main').requestFullscreen(); - } + } } window.addEventListener("load", main); \ No newline at end of file diff --git a/scripts/qrcode.js b/scripts/qrcode.js index b9bf726..cf15d28 100644 --- a/scripts/qrcode.js +++ b/scripts/qrcode.js @@ -10,7 +10,7 @@ */ var QRCode; -(function() { +(function () { //--------------------------------------------------------------------- // QRCode for JavaScript // @@ -65,10 +65,10 @@ var QRCode; } QR8bitByte.prototype = { - getLength: function(buffer) { + getLength: function (buffer) { return this.parsedData.length; }, - write: function(buffer) { + write: function (buffer) { for (var i = 0, l = this.parsedData.length; i < l; i++) { buffer.put(this.parsedData[i], 8); } @@ -85,24 +85,24 @@ var QRCode; } QRCodeModel.prototype = { - addData: function(data) { + addData: function (data) { var newData = new QR8bitByte(data); this.dataList.push(newData); this.dataCache = null; }, - isDark: function(row, col) { + isDark: function (row, col) { if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { throw new Error(row + "," + col); } return this.modules[row][col]; }, - getModuleCount: function() { + getModuleCount: function () { return this.moduleCount; }, - make: function() { + make: function () { this.makeImpl(false, this.getBestMaskPattern()); }, - makeImpl: function(test, maskPattern) { + makeImpl: function (test, maskPattern) { this.moduleCount = this.typeNumber * 4 + 17; this.modules = new Array(this.moduleCount); for (var row = 0; row < this.moduleCount; row++) { @@ -125,7 +125,7 @@ var QRCode; } this.mapData(this.dataCache, maskPattern); }, - setupPositionProbePattern: function(row, col) { + setupPositionProbePattern: function (row, col) { for (var r = -1; r <= 7; r++) { if (row + r <= -1 || this.moduleCount <= row + r) continue; for (var c = -1; c <= 7; c++) { @@ -138,7 +138,7 @@ var QRCode; } } }, - getBestMaskPattern: function() { + getBestMaskPattern: function () { var minLostPoint = 0; var pattern = 0; for (var i = 0; i < 8; i++) { @@ -151,7 +151,7 @@ var QRCode; } return pattern; }, - createMovieClip: function(target_mc, instance_name, depth) { + createMovieClip: function (target_mc, instance_name, depth) { var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); var cs = 1; this.make(); @@ -172,7 +172,7 @@ var QRCode; } return qr_mc; }, - setupTimingPattern: function() { + setupTimingPattern: function () { for (var r = 8; r < this.moduleCount - 8; r++) { if (this.modules[r][6] != null) { continue; @@ -186,7 +186,7 @@ var QRCode; this.modules[6][c] = (c % 2 == 0); } }, - setupPositionAdjustPattern: function() { + setupPositionAdjustPattern: function () { var pos = QRUtil.getPatternPosition(this.typeNumber); for (var i = 0; i < pos.length; i++) { for (var j = 0; j < pos.length; j++) { @@ -207,7 +207,7 @@ var QRCode; } } }, - setupTypeNumber: function(test) { + setupTypeNumber: function (test) { var bits = QRUtil.getBCHTypeNumber(this.typeNumber); for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); @@ -218,7 +218,7 @@ var QRCode; this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; } }, - setupTypeInfo: function(test, maskPattern) { + setupTypeInfo: function (test, maskPattern) { var data = (this.errorCorrectLevel << 3) | maskPattern; var bits = QRUtil.getBCHTypeInfo(data); for (var i = 0; i < 15; i++) { @@ -243,7 +243,7 @@ var QRCode; } this.modules[this.moduleCount - 8][8] = (!test); }, - mapData: function(data, maskPattern) { + mapData: function (data, maskPattern) { var inc = -1; var row = this.moduleCount - 1; var bitIndex = 7; @@ -281,7 +281,7 @@ var QRCode; }; QRCodeModel.PAD0 = 0xEC; QRCodeModel.PAD1 = 0x11; - QRCodeModel.createData = function(typeNumber, errorCorrectLevel, dataList) { + QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) { var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); var buffer = new QRBitBuffer(); for (var i = 0; i < dataList.length; i++) { @@ -319,7 +319,7 @@ var QRCode; } return QRCodeModel.createBytes(buffer, rsBlocks); }; - QRCodeModel.createBytes = function(buffer, rsBlocks) { + QRCodeModel.createBytes = function (buffer, rsBlocks) { var offset = 0; var maxDcCount = 0; var maxEcCount = 0; @@ -434,21 +434,21 @@ var QRCode; G15: (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0), G18: (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0), G15_MASK: (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1), - getBCHTypeInfo: function(data) { + getBCHTypeInfo: function (data) { var d = data << 10; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); } return ((data << 10) | d) ^ QRUtil.G15_MASK; }, - getBCHTypeNumber: function(data) { + getBCHTypeNumber: function (data) { var d = data << 12; while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); } return (data << 12) | d; }, - getBCHDigit: function(data) { + getBCHDigit: function (data) { var digit = 0; while (data != 0) { digit++; @@ -456,10 +456,10 @@ var QRCode; } return digit; }, - getPatternPosition: function(typeNumber) { + getPatternPosition: function (typeNumber) { return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; }, - getMask: function(maskPattern, i, j) { + getMask: function (maskPattern, i, j) { switch (maskPattern) { case QRMaskPattern.PATTERN000: return (i + j) % 2 == 0; @@ -481,14 +481,14 @@ var QRCode; throw new Error("bad maskPattern:" + maskPattern); } }, - getErrorCorrectPolynomial: function(errorCorrectLength) { + getErrorCorrectPolynomial: function (errorCorrectLength) { var a = new QRPolynomial([1], 0); for (var i = 0; i < errorCorrectLength; i++) { a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); } return a; }, - getLengthInBits: function(mode, type) { + getLengthInBits: function (mode, type) { if (1 <= type && type < 10) { switch (mode) { case QRMode.MODE_NUMBER: @@ -532,7 +532,7 @@ var QRCode; throw new Error("type:" + type); } }, - getLostPoint: function(qrCode) { + getLostPoint: function (qrCode) { var moduleCount = qrCode.getModuleCount(); var lostPoint = 0; for (var row = 0; row < moduleCount; row++) { @@ -600,13 +600,13 @@ var QRCode; } }; var QRMath = { - glog: function(n) { + glog: function (n) { if (n < 1) { throw new Error("glog(" + n + ")"); } return QRMath.LOG_TABLE[n]; }, - gexp: function(n) { + gexp: function (n) { while (n < 0) { n += 255; } @@ -642,13 +642,13 @@ var QRCode; } } QRPolynomial.prototype = { - get: function(index) { + get: function (index) { return this.num[index]; }, - getLength: function() { + getLength: function () { return this.num.length; }, - multiply: function(e) { + multiply: function (e) { var num = new Array(this.getLength() + e.getLength() - 1); for (var i = 0; i < this.getLength(); i++) { for (var j = 0; j < e.getLength(); j++) { @@ -657,7 +657,7 @@ var QRCode; } return new QRPolynomial(num, 0); }, - mod: function(e) { + mod: function (e) { if (this.getLength() - e.getLength() < 0) { return this; } @@ -839,7 +839,7 @@ var QRCode; [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16] ]; - QRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) { + QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) { var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == undefined) { throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); @@ -856,7 +856,7 @@ var QRCode; } return list; }; - QRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) { + QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRErrorCorrectLevel.L: return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; @@ -876,19 +876,19 @@ var QRCode; this.length = 0; } QRBitBuffer.prototype = { - get: function(index) { + get: function (index) { var bufIndex = Math.floor(index / 8); return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) == 1; }, - put: function(num, length) { + put: function (num, length) { for (var i = 0; i < length; i++) { this.putBit(((num >>> (length - i - 1)) & 1) == 1); } }, - getLengthInBits: function() { + getLengthInBits: function () { return this.length; }, - putBit: function(bit) { + putBit: function (bit) { var bufIndex = Math.floor(this.length / 8); if (this.buffer.length <= bufIndex) { this.buffer.push(0); @@ -963,14 +963,14 @@ var QRCode; return android; } - var svgDrawer = (function() { + var svgDrawer = (function () { - var Drawing = function(el, htOption) { + var Drawing = function (el, htOption) { this._el = el; this._htOption = htOption; }; - Drawing.prototype.draw = function(oQRCode) { + Drawing.prototype.draw = function (oQRCode) { var _htOption = this._htOption; var _el = this._el; var nCount = oQRCode.getModuleCount(); @@ -1020,7 +1020,7 @@ var QRCode; } } }; - Drawing.prototype.clear = function() { + Drawing.prototype.clear = function () { while (this._el.hasChildNodes()) this._el.removeChild(this._el.lastChild); }; @@ -1030,8 +1030,8 @@ var QRCode; var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; // Drawing in DOM by using Table tag - var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function() { - var Drawing = function(el, htOption) { + var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () { + var Drawing = function (el, htOption) { this._el = el; this._htOption = htOption; }; @@ -1041,7 +1041,7 @@ var QRCode; * * @param {QRCode} oQRCode */ - Drawing.prototype.draw = function(oQRCode) { + Drawing.prototype.draw = function (oQRCode) { var _htOption = this._htOption; var _el = this._el; var nCount = oQRCode.getModuleCount(); @@ -1075,12 +1075,12 @@ var QRCode; /** * Clear the QRCode */ - Drawing.prototype.clear = function() { + Drawing.prototype.clear = function () { this._el.innerHTML = ''; }; return Drawing; - })() : (function() { // Drawing in Canvas + })() : (function () { // Drawing in Canvas function _onMakeImage() { this._elImage.src = this._elCanvas.toDataURL("image/png"); this._elImage.style.display = "block"; @@ -1092,7 +1092,7 @@ var QRCode; if (this._android && this._android <= 2.1) { var factor = 1 / window.devicePixelRatio; var drawImage = CanvasRenderingContext2D.prototype.drawImage; - CanvasRenderingContext2D.prototype.drawImage = function(image, sx, sy, sw, sh, dx, dy, dw, dh) { + CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { if (("nodeName" in image) && /img/i.test(image.nodeName)) { for (var i = arguments.length - 1; i >= 1; i--) { arguments[i] = arguments[i] * factor; @@ -1123,14 +1123,14 @@ var QRCode; // Check it just once if (self._bSupportDataURI === null) { var el = document.createElement("img"); - var fOnError = function() { + var fOnError = function () { self._bSupportDataURI = false; if (self._fFail) { self._fFail.call(self); } }; - var fOnSuccess = function() { + var fOnSuccess = function () { self._bSupportDataURI = true; if (self._fSuccess) { @@ -1157,7 +1157,7 @@ var QRCode; * @param {HTMLElement} el * @param {Object} htOption QRCode Options */ - var Drawing = function(el, htOption) { + var Drawing = function (el, htOption) { this._bIsPainted = false; this._android = _getAndroid(); @@ -1181,7 +1181,7 @@ var QRCode; * * @param {QRCode} oQRCode */ - Drawing.prototype.draw = function(oQRCode) { + Drawing.prototype.draw = function (oQRCode) { var _elImage = this._elImage; var _oContext = this._oContext; var _htOption = this._htOption; @@ -1228,7 +1228,7 @@ var QRCode; /** * Make the image from Canvas if the browser supports Data URI. */ - Drawing.prototype.makeImage = function() { + Drawing.prototype.makeImage = function () { if (this._bIsPainted) { _safeSetDataURI.call(this, _onMakeImage); } @@ -1239,14 +1239,14 @@ var QRCode; * * @return {Boolean} */ - Drawing.prototype.isPainted = function() { + Drawing.prototype.isPainted = function () { return this._bIsPainted; }; /** * Clear the QRCode */ - Drawing.prototype.clear = function() { + Drawing.prototype.clear = function () { this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); this._bIsPainted = false; }; @@ -1255,7 +1255,7 @@ var QRCode; * @private * @param {Number} nNumber */ - Drawing.prototype.round = function(nNumber) { + Drawing.prototype.round = function (nNumber) { if (!nNumber) { return nNumber; } @@ -1340,7 +1340,7 @@ var QRCode; * @param {String} [vOption.colorLight="#ffffff"] * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] */ - QRCode = function(el, vOption) { + QRCode = function (el, vOption) { this._htOption = { width: 256, height: 256, @@ -1386,7 +1386,7 @@ var QRCode; * * @param {String} sText link data */ - QRCode.prototype.makeCode = function(sText) { + QRCode.prototype.makeCode = function (sText) { this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); this._oQRCode.addData(sText); this._oQRCode.make(); @@ -1402,7 +1402,7 @@ var QRCode; * * @private */ - QRCode.prototype.makeImage = function() { + QRCode.prototype.makeImage = function () { if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { this._oDrawing.makeImage(); } @@ -1411,7 +1411,7 @@ var QRCode; /** * Clear the QRCode */ - QRCode.prototype.clear = function() { + QRCode.prototype.clear = function () { this._oDrawing.clear(); };