OSDN Git Service

Update app/screentime and app/ytplayer [0.2.1] update/app-screentime
authormtsgi <oq@live.jp>
Sun, 16 Feb 2020 21:07:55 +0000 (06:07 +0900)
committermtsgi <oq@live.jp>
Sun, 16 Feb 2020 21:07:55 +0000 (06:07 +0900)
app/screentime/define.json
app/screentime/screentime.js
app/ytplayer/default.html
app/ytplayer/define.json
app/ytplayer/usage.html
app/ytplayer/ytplayer.js

index 8e59d4b..66f9e62 100644 (file)
@@ -2,7 +2,7 @@
     "id": "screentime",
     "name": "スクリーンタイム",
     "icon": "icon.png",
-    "version": "1.0.0",
+    "version": "1.1.0",
     "author": "kit",
     "support": {
         "darkmode": true,
index 293cdb5..7db4b02 100644 (file)
@@ -5,9 +5,13 @@
         let _sorted = Object.entries(KWS.screenTime).sort(([a1,a2],[b1,b2]) => b2-a2);
         let _rank = 1;
         for(let i of _sorted){
-            let _min = Math.floor(i[1]/60000);
+            let _hour = Math.floor(i[1]/3600000);
+            let _min = Math.floor(i[1]/60000%60);
             let _sec = Math.floor(i[1]/1000%60);
-            let _insert = `<kit-box><code class='m-r'>${_rank}</code><strong class='kit-left p-0'>${i[0]}</strong>${_min}分 ${_sec}秒</kit-box>`;
+            let _text = '';
+            if(_hour) _text = _hour + "時間 ";
+            _text += `${_min}分 ${_sec}秒`;
+            let _insert = `<kit-box><code class='m-r'>${_rank}</code><strong class='kit-left p-0'>${i[0]}</strong>${_text}</kit-box>`;
             _list.insertAdjacentHTML('beforeend', _insert);
             _rank ++;
         }
index 9c6ac44..5c49288 100644 (file)
@@ -1,5 +1,6 @@
-<input class="textbox" id="ytplayer-src" placeholder="動画ID" style="width:200px;">
-<a class="kit-button ytplayer-play">YouTube</a>
-<a class="kit-button ytplayer-nico">niconico</a>
-<br>
-<iframe kit-src="usage.html" frameborder="0" class="ytplayer-area" style="width:480px;height:320px;margin:5px 0px;"></iframe>
\ No newline at end of file
+<div class="kit-formgroup kit-fit">
+    <input class="textbox kit-flex-grow" id="ytplayer-src" placeholder="動画ID" style="width:200px;">
+    <a class="kit-button -crimson ytplayer-play">YouTube</a>
+    <a class="kit-button -black ytplayer-nico">niconico</a>
+</div>
+<iframe kit-src="usage.html" frameborder="0" class="ytplayer-area" style="width:480px;height:320px;margin:5px 0px;"></iframe>
index 10cc070..34e0283 100644 (file)
@@ -2,7 +2,7 @@
     "id": "ytplayer",
     "name": "YouTubePlayer",
     "icon": "icon.png",
-    "version": "1.1.1",
+    "version": "1.2.0",
     "author": "kit",
 
     "support": {
index 718c027..10637c7 100644 (file)
@@ -8,4 +8,4 @@
         <h3>使い方</h3>
         YouYubeまたはniconicoの再生したい動画のIDを入力し、再生したいサービスのボタンを押すと動画を再生できます(外部プレイヤーでの再生が許可されている動画のみ)。
     </body>
-</html>
\ No newline at end of file
+</html>
index 3a1f56c..e609bb5 100644 (file)
@@ -1,12 +1,12 @@
 ((_pid, _app) => {
     $("#w" + _pid).resizable({
-        alsoResize: ".ytplayer-area",
+        alsoResize: `#w${_pid} .ytplayer-area`,
         minWidth: "200"
     });
 
     _app.dom().delegate(".ytplayer-play", "click", () => {
-        _app.dom(".ytplayer-area").attr("src", "https://www.youtube.com/embed/"+ _app.dom("#ytplayer-src").val() +"?&showinfo=0&iv_load_policy=3&fs=0&modestbranding=1");
+        _app.dom(".ytplayer-area").attr("src", `https://www.youtube.com/embed/${_app.dom("#ytplayer-src").val()}?&showinfo=0&iv_load_policy=3&fs=0&modestbranding=1`);
     }).delegate(".ytplayer-nico", "click", () => {
-        _app.dom(".ytplayer-area").attr("src", "https://embed.nicovideo.jp/watch/"+ _app.dom("#ytplayer-src").val() +"?&showinfo=0&iv_load_policy=3&fs=0&modestbranding=1");
+        _app.dom(".ytplayer-area").attr("src", `https://embed.nicovideo.jp/watch/${_app.dom("#ytplayer-src").val()}?&showinfo=0&iv_load_policy=3&fs=0&modestbranding=1`);
     });
 })(pid, app);