瀏覽代碼

added 3rd alert style

causefx 8 年之前
父節點
當前提交
73abba89e9

+ 4 - 0
api/functions/option-functions.php

@@ -52,6 +52,10 @@ function optionNotificationTypes()
 			'name' => 'Style 2',
 			'value' => 'izi'
 		),
+		array(
+			'name' => 'Style 3',
+			'value' => 'alertify'
+		),
 	);
 }
 

+ 20 - 1
css/organizr.css

@@ -940,6 +940,8 @@ i.fa.fa-life-ring.fa-fw {
 }
 .iziToast.success-notify.iziToast-layout2 {
     background: #1b1a1a;
+    border: 1px solid #232323;
+    border-bottom: transparent;
 }
 .iziToast.info-notify>.iziToast-body .iziToast-icon {
     color: #3A83F0;
@@ -953,6 +955,8 @@ i.fa.fa-life-ring.fa-fw {
 }
 .iziToast.info-notify.iziToast-layout2 {
     background: #1b1a1a;
+    border: 1px solid #232323;
+    border-bottom: transparent;
 }
 .iziToast.warning-notify>.iziToast-body .iziToast-icon {
     color: #FFEB3B;
@@ -966,6 +970,8 @@ i.fa.fa-life-ring.fa-fw {
 }
 .iziToast.warning-notify.iziToast-layout2 {
     background: #1b1a1a;
+    border: 1px solid #232323;
+    border-bottom: transparent;
 }
 .iziToast.error-notify>.iziToast-body .iziToast-icon {
     color: #F44336;
@@ -979,4 +985,17 @@ i.fa.fa-life-ring.fa-fw {
 }
 .iziToast.error-notify.iziToast-layout2 {
     background: #1b1a1a;
-}
+    border: 1px solid #232323;
+    border-bottom: transparent;
+}
+.iziToast.success-notify.iziToast-balloon:before,
+.iziToast.info-notify.iziToast-balloon:before,
+.iziToast.warning-notify.iziToast-balloon:before,
+.iziToast.error-notify.iziToast-balloon:before {
+    border-top-color: #1b1a1a;
+}
+/* ALERTIFY ALERTS */
+.ajs-message.ajs-success-alertify { color: rgb(0, 255, 184);  background-color: #1b1a1a;  border-color: rgb(0, 255, 184); }
+.ajs-message.ajs-info-alertify { color: #3A83F0;  background-color: #1b1a1a;  border-color: #3A83F0; }
+.ajs-message.ajs-warning-alertify { color: #FFEB3B;  background-color: #1b1a1a;  border-color: #FFEB3B; }
+.ajs-message.ajs-error-alertify { color: #F44336;  background-color: #1b1a1a;  border-color: #F44336; }

File diff suppressed because it is too large
+ 0 - 0
css/organizr.min.css


+ 1 - 0
index.php

@@ -30,6 +30,7 @@
     <link href="plugins/bower_components/owl.carousel/owl.carousel.min.css" rel="stylesheet" type="text/css"/>
     <link href="plugins/bower_components/owl.carousel/owl.theme.default.css" rel="stylesheet" type="text/css"/>
     <link href="plugins/bower_components/hover/hover-min.css" rel="stylesheet" type="text/css"/>
+
     <link href="css/animate.css" rel="stylesheet">
     <link href="css/simplebar.css" rel="stylesheet">
     <link href="css/plyr.css" rel="stylesheet">

+ 36 - 68
js/functions.js

@@ -3928,8 +3928,8 @@ function pingUpdate(pingList,timeout){
                 var status = (v == false) ? 'down' : 'up';
                 var ms = (v == false) ? 'down' : v+'ms';
                 var sendMessage = (previousState !== status && previousState !== '' && activeInfo.user.groupID <= activeInfo.settings.ping.authMessage) ? true : false;
-                var audioDown = new Audio(activeInfo.settings.ping.offlineSound);
-                var audioUp = new Audio(activeInfo.settings.ping.onlineSound);
+                var audioDown = (sendMessage) ? new Audio(activeInfo.settings.ping.offlineSound) : '';
+                var audioUp = (sendMessage) ? new Audio(activeInfo.settings.ping.onlineSound) : '';
                 elm.attr('data-previous-state', status);
                 if(activeInfo.user.groupID <= activeInfo.settings.ping.authMs && activeInfo.settings.ping.ms){ elmMs.removeClass('hidden').html(ms); }
                 switch (status){
@@ -3992,40 +3992,52 @@ function defineNotification(){
             include('plugins/bower_components/iziToast/js/iziToast.min.js');
             window.notificationFunction = 'iziToast';
             break;
+        case 'alertify':
+            include('plugins/bower_components/alertify/alertify.min.css');
+            include('plugins/bower_components/alertify/default.min.css');
+            include('plugins/bower_components/alertify/alertify.min.js');
+            window.notificationFunction = 'alertify';
+            break;
         default:
             return false
     }
     window.notificationsReady = true;
-    return false;
 }
 function messagePositions(){
     return {
         "br":{
             "toastr":"bottom-right",
+            "alertify":"bottom-right",
             "izi":"bottomRight",
         },
         "bl":{
             "toastr":"bottom-left",
+            "alertify":"bottom-left",
             "izi":"bottomLeft",
         },
         "bc":{
             "toastr":"bottom-center",
+            "alertify":"bottom-center",
             "izi":"bottomCenter",
         },
         "tr":{
             "toastr":"top-right",
+            "alertify":"top-right",
             "izi":"topRight",
         },
         "tl":{
             "toastr":"top-left",
+            "alertify":"top-left",
             "izi":"topLeft",
         },
         "tc":{
             "toastr":"top-center",
+            "alertify":"top-center",
             "izi":"topCenter",
         },
         "c":{
             "toastr":"center",
+            "alertify":"bottom-center",
             "izi":"center",
         }
     };
@@ -4037,6 +4049,7 @@ function message(heading,text,position,color,icon,timeout){
             var ready = (eval( notificationFunction) !== undefined) ? true :false;
             break;
         case 'izi':
+        case 'alertify':
             try {
                 var ready = (typeof eval(notificationFunction) !== undefined) ? true :false;
             } catch (e) {
@@ -4049,7 +4062,6 @@ function message(heading,text,position,color,icon,timeout){
             var ready = false;
     }
     if(notificationsReady && ready){
-
         position = messagePositions()[position][bb];
         switch (bb) {
             case 'toastr':
@@ -4066,101 +4078,53 @@ function message(heading,text,position,color,icon,timeout){
                 break;
             case 'izi':
                 iziToast.settings({
-                    timeout: 4000,
-                    // closeOnClick: true,
-                    // closeOnEscape: true,
                     close: true,
                     progressBar: true,
                     progressBarEasing: 'ease',
-                    // pauseOnHover: false,
-                    // zindex: 900,
-                    // maxWidth: 400,
-                    // rtl: true,
-                    // layout: 2,
-                    // resetOnHover: true,
-                    // imageWidth: 50,
-                    // balloon: true,
-                    // target: '.target',
-                    // icon: 'material-icons',
-                    // iconText: 'face',
-                    // animateInside: false,
-                    // transitionIn: 'flipInX',
-                    // transitionOut: 'fadeOutLeft',
-                    // titleSize: 20,
-                    // titleLineHeight: 20,
-                    // messageSize: 20,
-                    // messageLineHeight: 20,
+                    class: icon+'-notify',
+                    title: heading,
+                    message: text,
+                    position: position,
+                    timeout: timeout,
+                    layout: 2,
+                    transitionIn: 'flipInX',
+                    transitionOut: 'flipOutX',
+                    balloon: false,
                 });
                 switch (icon){
                     case 'success':
                         var msg = {
-                            class: icon+'-notify',
-                            title: heading,
-                            message: text,
-                            position: position,
-                            timeout: timeout,
                             icon: 'mdi mdi-check-circle-outline',
-                            layout: 2,
-                            transitionIn: 'flipInX',
-                            transitionOut: 'flipOutX',
                         };
                         break;
                     case 'info':
                         var msg ={
-                            class: icon+'-notify',
-                            title: heading,
-                            message: text,
-                            position: position,
-                            timeout: timeout,
                             icon: 'mdi mdi-information-outline',
-                            layout: 2,
-                            transitionIn: 'flipInX',
-                            transitionOut: 'flipOutX',
                         };
                         break;
                     case 'error':
                         var msg ={
-                            class: icon+'-notify',
-                            title: heading,
-                            message: text,
-                            position: position,
-                            timeout: timeout,
-                            theme: 'dark',
                             icon: 'mdi mdi-close-circle-outline',
-                            layout: 2,
-                            iconColor: 'rgb(171, 11, 11)',
-                            transitionIn: 'flipInX',
-                            transitionOut: 'flipOutX',
-                            progressBarColor: 'rgb(171, 11, 11)',
                         };
                         break;
                     case 'warning':
                         var msg ={
-                            class: icon+'-notify',
-                            title: heading,
-                            message: text,
-                            position: position,
-                            timeout: timeout,
-                            backgroundColor: '#24292e',
                             icon: 'mdi mdi-alert-circle-outline',
-                            layout: 2,
-                            iconColor: '#FFEB3B',
-                            transitionIn: 'flipInX',
-                            transitionOut: 'flipOutX',
-                            progressBarColor: '#FFEB3B',
                         };
                         break;
                     default:
                         var msg ={
-                            class: icon+'-notify',
-                            title: heading,
-                            message: text,
-                            position: position,
-                            timeout: timeout
+                            icon: 'mdi mdi-alert-circle-outline',
                         };
                 }
                 iziToast.show(msg);
                 break;
+            case 'alertify':
+                console.log(heading,text,position,color,icon,timeout);
+                var msgFull = (heading !== '') ? heading + '<br/>' + text : text;
+                timeout = timeout / 1000;
+                alertify.notify(msgFull, icon+'-alertify', timeout);
+                break;
             default:
                 console.log('msg not setup')
         }
@@ -4177,6 +4141,7 @@ function messageSingle(heading,text,position,color,icon,timeout){
             var ready = (eval( notificationFunction) !== undefined) ? true :false;
             break;
         case 'izi':
+        case 'alertify':
             try {
                 var ready = (typeof eval(notificationFunction) !== undefined) ? true :false;
             } catch (e) {
@@ -4196,6 +4161,9 @@ function messageSingle(heading,text,position,color,icon,timeout){
             case 'izi':
                 iziToast.destroy();
                 break;
+            case 'alertify':
+                alertify.dismissAll();
+                break;
             default:
                 return false;
         }

File diff suppressed because it is too large
+ 5 - 0
plugins/bower_components/alertify/alertify.min.css


File diff suppressed because it is too large
+ 1 - 0
plugins/bower_components/alertify/alertify.min.js


+ 6 - 0
plugins/bower_components/alertify/default.min.css

@@ -0,0 +1,6 @@
+/**
+ * alertifyjs 1.11.1 http://alertifyjs.com
+ * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
+ * Copyright 2018 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) 
+ * Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
+.alertify .ajs-dialog{background-color:#fff;-webkit-box-shadow:0 15px 20px 0 rgba(0,0,0,.25);box-shadow:0 15px 20px 0 rgba(0,0,0,.25);border-radius:2px}.alertify .ajs-header{color:#000;font-weight:700;background:#fafafa;border-bottom:#eee 1px solid;border-radius:2px 2px 0 0}.alertify .ajs-body{color:#000}.alertify .ajs-body .ajs-content .ajs-input{display:block;width:100%;padding:8px;margin:4px;border-radius:2px;border:1px solid #ccc}.alertify .ajs-body .ajs-content p{margin:0}.alertify .ajs-footer{background:#fbfbfb;border-top:#eee 1px solid;border-radius:0 0 2px 2px}.alertify .ajs-footer .ajs-buttons .ajs-button{background-color:transparent;color:#000;border:0;font-size:14px;font-weight:700;text-transform:uppercase}.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok{color:#3593d2}.alertify-notifier .ajs-message{background:rgba(255,255,255,.95);color:#000;text-align:center;border:solid 1px #ddd;border-radius:2px}.alertify-notifier .ajs-message.ajs-success{color:#fff;background:rgba(91,189,114,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-error{color:#fff;background:rgba(217,92,92,.95);text-shadow:-1px -1px 0 rgba(0,0,0,.5)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95);border-color:#999}

Some files were not shown because too many files changed in this diff