Ver Fonte

Kitchen-sink: Notification

soyjavi há 14 anos atrás
pai
commit
ce4dade48a

+ 52 - 0
examples/test/app/events.notification.js

@@ -0,0 +1,52 @@
+
+Lungo.Events.init({
+    'tap section#notification a[data-action=normal]': function() {
+        Lungo.Notification.show('Title', 'Description', 'message', false, 2);
+    },
+
+    'tap section#notification a[data-action=animate]': function() {
+        Lungo.Notification.show('Title', 'Description', 'message', true, 2);
+    },
+
+    'tap section#notification a[data-action=loading]': function() {
+        Lungo.Notification.loading();
+        setTimeout(Lungo.Notification.hide, 2000);
+    },
+
+    'tap section#notification a[data-action=success]': function() {
+        Lungo.Notification.success('Title', 'Description', 'message', 2);
+    },
+
+    'tap section#notification a[data-action=error]': function() {
+        Lungo.Notification.error('Title', 'Description', 'message', 2);
+    },
+
+    'tap section#notification a[data-action=alert]': function() {
+        Lungo.Notification.alert('Title', 'Description', 'message', 2);
+    },
+
+    'tap section#notification a[data-action=confirm]': function() {
+        Lungo.Notification.confirm({
+            title: 'Title',
+            description: 'Description',
+            icon: 'message',
+            accept: {
+                color: 'blue',
+                icon: 'checkmark',
+                label: 'Yes',
+                callback: function(){ alert("Yes!"); }
+            },
+            cancel: {
+                icon: 'close',
+                label: 'No',
+                callback: function(){ alert("No!"); }
+            }
+        });
+    },
+
+    'tap section#notification a[data-action=html]': function() {
+        Lungo.Notification.html('<h1>Hello World</h1>', true);
+    }
+
+});
+

+ 7 - 0
examples/test/app/sections/aside-mini.html

@@ -0,0 +1,7 @@
+<aside id="kitchen-sink-scroll" class="small -scroll left">
+    <nav>
+        <a href="#nav-1" data-target="article" class="current" data-icon="clock"></a>
+        <a href="#nav-2" data-target="article" data-icon="user" data-count="14"></a>
+        <a href="#test-2" data-target="section" data-icon="pushpin"></a>
+    </nav>
+</aside>

+ 17 - 0
examples/test/app/sections/notification.html

@@ -0,0 +1,17 @@
+<section id="notification" data-transition="slide">
+    <header data-title="Notifications" data-back="home"></header>
+
+    <article class="list scroll indented">
+        <div>
+            <a href="#" class="button big" data-label="Normal" data-action="normal"></a>
+            <a href="#" class="button big" data-label="Normal + Animation" data-action="animate"></a>
+            <a href="#" class="button big" data-label="Loading" data-label="Loading" data-action="loading"></a>
+            <a href="#" class="button big" data-label="Confirm" data-action="confirm"></a>
+            <a href="#" class="button big" data-label="Html" data-action="html"></a>
+
+            <a href="#" class="button big green" data-label="Success" data-action="success"></a>
+            <a href="#" class="button big red" data-label="Error" data-action="error"></a>
+            <a href="#" class="button big yellow" data-label="Alert" data-action="alert"></a>
+        </div>
+    </article>
+</section>