OSDN Git Service

Expand System Class and Add an App(dialog)/ Bug Fix[0.1.1] 0.1.1
authormtsgi <oq@live.jp>
Sat, 9 Mar 2019 05:42:57 +0000 (14:42 +0900)
committermtsgi <oq@live.jp>
Sat, 9 Mar 2019 05:42:57 +0000 (14:42 +0900)
app/dialog/default.html [new file with mode: 0644]
app/dialog/define.json [new file with mode: 0644]
app/dialog/dialog.js [new file with mode: 0644]
app/dialog/icon.png [new file with mode: 0644]
system.js
system/theme/theme-ringo.css

diff --git a/app/dialog/default.html b/app/dialog/default.html
new file mode 100644 (file)
index 0000000..1fb3003
--- /dev/null
@@ -0,0 +1,6 @@
+<div style="max-width: 500px">
+    <h3 class='dialog-title'></h3>
+    <div class='dialog-content'></div>
+    <a class="kit-button dialog-cancel">キャンセル</a>
+    <a class="kit-button dialog-ok">OK</a>
+</div>
\ No newline at end of file
diff --git a/app/dialog/define.json b/app/dialog/define.json
new file mode 100644 (file)
index 0000000..fd1bb8e
--- /dev/null
@@ -0,0 +1,11 @@
+{
+    "id": "dialog",
+    "name": " ダイアログ",
+    "icon": "icon.png",
+    "version": "1.0.!",
+    "author": "kit",
+
+    "view": "default.html",
+    "script": "dialog.js",
+    "css": ""
+}
\ No newline at end of file
diff --git a/app/dialog/dialog.js b/app/dialog/dialog.js
new file mode 100644 (file)
index 0000000..a8d39d0
--- /dev/null
@@ -0,0 +1,15 @@
+app_dialog(pid);
+
+function app_dialog(_pid) {
+    S.dom(_pid).css("min-width", "400px").css("text-align", "center");
+    if( System.args[pid] ){
+        $("#winc" + _pid + " .dialog-title").text(System.args[_pid].title);
+        $("#winc" + _pid + " .dialog-content").html(System.args[_pid].content);
+    }
+    $("#winc" + _pid + " .dialog-cancel").on("click", function(){
+        close(_pid);
+    });
+    $("#winc" + _pid + " .dialog-ok").on("click", function(){
+        System.args[_pid].func();
+    });
+}
\ No newline at end of file
diff --git a/app/dialog/icon.png b/app/dialog/icon.png
new file mode 100644 (file)
index 0000000..5c2da44
Binary files /dev/null and b/app/dialog/icon.png differ
index a403958..cad3251 100644 (file)
--- a/system.js
+++ b/system.js
@@ -442,6 +442,14 @@ const System = new function() {
         launch( "alert", [title, content, winname] );
     }
 
+    this.dialog = function( title, content, func ){
+        launch("dialog", {
+            "title": title,
+            "content": content,
+            "func": func
+        })
+    }
+
     this.min = function( str ) {
         var _pid = String( str );
         if( $( "#w" + _pid ).is( ":visible" ) ) {
@@ -481,9 +489,9 @@ const System = new function() {
         S.time.obj = DD;
         let Year = DD.getFullYear();
         S.time.y = Year;
-        let Month = DD.getMonth();
+        let Month = ( "00" + Number(DD.getMonth()+1) ).slice( -2 );
         S.time.m = Month;
-        let DateN = DD.getDate();
+        let DateN = ( "00" + DD.getDate() ).slice( -2 );
         S.time.d = DateN;
         let Hour = ( "00" + DD.getHours() ).slice( -2 );
         S.time.h = Hour;
index e255476..ec14ab7 100644 (file)
@@ -53,7 +53,7 @@ section {
 }
 #desktop-l{
        padding: 20px 0;
-       padding-top: 20%;
+       padding-top: 15%;
        font-weight: 100;
        font-size: 18px;
        color: white;