Browse Source

added notify tester

causefx 8 years ago
parent
commit
6e655f4766
4 changed files with 26 additions and 141 deletions
  1. 20 0
      api/functions/organizr-functions.php
  2. 5 141
      js/custom.js
  3. 0 0
      js/custom.min.js
  4. 1 0
      js/functions.js

+ 20 - 0
api/functions/organizr-functions.php

@@ -808,6 +808,7 @@ function getCustomizeAppearance()
 				array(
 				array(
 					'type' => 'select',
 					'type' => 'select',
 					'name' => 'notificationBackbone',
 					'name' => 'notificationBackbone',
+					'class' => 'notifyChanger',
 					'label' => 'Type',
 					'label' => 'Type',
 					'value' => $GLOBALS['notificationBackbone'],
 					'value' => $GLOBALS['notificationBackbone'],
 					'options' => optionNotificationTypes()
 					'options' => optionNotificationTypes()
@@ -815,10 +816,29 @@ function getCustomizeAppearance()
 				array(
 				array(
 					'type' => 'select',
 					'type' => 'select',
 					'name' => 'notificationPosition',
 					'name' => 'notificationPosition',
+					'class' => 'notifyPositionChanger',
 					'label' => 'Position',
 					'label' => 'Position',
 					'value' => $GLOBALS['notificationPosition'],
 					'value' => $GLOBALS['notificationPosition'],
 					'options' => optionNotificationPositions()
 					'options' => optionNotificationPositions()
 				),
 				),
+				array(
+					'type' => 'html',
+					'label' => 'Test Message',
+					'html' => '
+					<div class="btn-group m-r-10 dropup">
+						<button aria-expanded="false" data-toggle="dropdown" class="btn btn-default btn-outline dropdown-toggle waves-effect waves-light" type="button">
+							<i class="fa fa-comment m-r-5"></i>
+							<span>Test </span>
+						</button>
+						<ul role="menu" class="dropdown-menu">
+							<li><a onclick="message(\'Test Message\',\'This is a success Message\',activeInfo.settings.notifications.position,\'#FFF\',\'success\',\'5000\');">Sucess</a></li>
+							<li><a onclick="message(\'Test Message\',\'This is a info Message\',activeInfo.settings.notifications.position,\'#FFF\',\'info\',\'5000\');">Info</a></li>
+							<li><a onclick="message(\'Test Message\',\'This is a warning Message\',activeInfo.settings.notifications.position,\'#FFF\',\'warning\',\'5000\');">Warning</a></li>
+							<li><a onclick="message(\'Test Message\',\'This is a error Message\',activeInfo.settings.notifications.position,\'#FFF\',\'error\',\'5000\');">Error</a></li>
+						</ul>
+					</div>
+					'
+				)
 			),
 			),
 			'FavIcon' => array(
 			'FavIcon' => array(
 				array(
 				array(

+ 5 - 141
js/custom.js

@@ -1013,7 +1013,6 @@ $(document).on('change keydown', '.addFormTick :input', function(e) {
     $(this).closest('.form-group').addClass('has-success');
     $(this).closest('.form-group').addClass('has-success');
     var formID = $(this).closest('form').attr('id');
     var formID = $(this).closest('form').attr('id');
     $('#'+formID+'-save').removeClass('hidden');
     $('#'+formID+'-save').removeClass('hidden');
-    console.log(formID);
     switch ($(this).attr('type')) {
     switch ($(this).attr('type')) {
         case 'switch':
         case 'switch':
         case 'checkbox':
         case 'checkbox':
@@ -1028,48 +1027,13 @@ $(document).on('change keydown', '.addFormTick :input', function(e) {
     if($(this).hasClass('styleChanger')){
     if($(this).hasClass('styleChanger')){
         changeStyle(value);
         changeStyle(value);
     }
     }
-});
-// Added 1 while testing as we are getting rid of this
-$(document).on('change', '#customize-appearance-form1 :input', function(e) {
-    $(this).attr('data-changed', true);
-    //$(this).addClass('has-success');
-    switch ($(this).attr('type')) {
-        case 'switch':
-        case 'checkbox':
-            var value = $(this).prop("checked") ? true : false;
-            break;
-        default:
-            var value = $(this).val();
-    }
-    var post = {
-        action:'editCustomizeAppearance',
-        api:'api/?v1/settings/customize/appearance',
-        name:$(this).attr("name"),
-        value:value,
-        messageTitle:'',
-        messageBody:'Updated Value for '+$(this).attr("name"),
-        error:'Organizr Function: API Connection Failed'
-    };
-    $('#customize-appearance-reload').removeClass('hidden');
-    var callbacks = $.Callbacks();
-    //callbacks.add( buildCustomizeAppearance );
-    settingsAPI(post,callbacks);
-    if($(this).hasClass('themeChanger')){
-        changeTheme(value);
+    if($(this).hasClass('notifyChanger')){
+        activeInfo.settings.notifications.backbone = value;
+        defineNotification();
     }
     }
-    if($(this).hasClass('styleChanger')){
-        changeStyle(value);
+    if($(this).hasClass('notifyPositionChanger')){
+        activeInfo.settings.notifications.position = value;
     }
     }
-    //disable button then renable
-    $('#customize-appearance-form:input').prop('disabled', 'true');
-    setTimeout(
-        function(){
-            $('#customize-appearance-form :input').prop('disabled', null);
-            //input.emulateTab();
-        },
-        2000
-    );
-
 });
 });
 //DELETE IMAGE
 //DELETE IMAGE
 $(document).on("click", ".deleteImage", function () {
 $(document).on("click", ".deleteImage", function () {
@@ -1158,72 +1122,6 @@ $(document).on('click', '.disablePlugin', function() {
     });
     });
 
 
 });
 });
-// SSO Option change
-$(document).on('change', '#sso-form1 :input', function(e) {
-    var input = $(this);
-    switch ($(this).attr('type')) {
-        case 'switch':
-        case 'checkbox':
-            var value = $(this).prop("checked") ? true : false;
-            break;
-        default:
-            var value = $(this).val();
-    }
-    var post = {
-        api:'api/?v1/update/config',
-        name:$(this).attr("name"),
-        type:$(this).attr("data-type"),
-        value:value,
-        messageTitle:'',
-        messageBody:'Updated Value for '+$(this).parent().parent().find('label').text(),
-        error:'Organizr Function: API Connection Failed'
-    };
-    var callbacks = $.Callbacks();
-    //callbacks.add( buildCustomizeAppearance );
-    settingsAPI(post,callbacks);
-    //disable button then renable
-    $('#sso-form :input').prop('disabled', 'true');
-    setTimeout(
-        function(){
-            $('#sso-form :input').prop('disabled', null);
-            input.emulateTab();
-        },
-        2000
-    );
-});
-// MAIN SETTINGS PAGE
-$(document).on('change', '#settings-main-form1 :input', function(e) {
-    var input = $(this);
-    switch ($(this).attr('type')) {
-        case 'switch':
-        case 'checkbox':
-            var value = $(this).prop("checked") ? true : false;
-            break;
-        default:
-            var value = $(this).val();
-    }
-    var post = {
-        api:'api/?v1/update/config',
-        name:$(this).attr("name"),
-        type:$(this).attr("data-type"),
-        value:value,
-        messageTitle:'',
-        messageBody:'Updated Value for '+$(this).parent().parent().find('label').text(),
-        error:'Organizr Function: API Connection Failed'
-    };
-    var callbacks = $.Callbacks();
-    //callbacks.add( buildCustomizeAppearance );
-    settingsAPI(post,callbacks);
-    //disable button then renable
-    $('#settings-main-form :input').prop('disabled', 'true');
-    setTimeout(
-        function(){
-            $('#settings-main-form :input').prop('disabled', null);
-            input.emulateTab();
-        },
-        2000
-    );
-});
 // AUTH BACKEND HIDE SHOW
 // AUTH BACKEND HIDE SHOW
 $(document).on('change', '#authSelect, #authBackendSelect', function(e) {
 $(document).on('change', '#authSelect, #authBackendSelect', function(e) {
     changeAuth();
     changeAuth();
@@ -1421,40 +1319,6 @@ $(document).on("click", ".testPath", function () {
         });
         });
     }
     }
 });
 });
-// Save Homepage Form
-$(document).on('change', '.homepageForm1 :input', function(e) {
-    var input = $(this);
-    switch ($(this).attr('type')) {
-        case 'switch':
-        case 'checkbox':
-            var value = $(this).prop("checked") ? true : false;
-            break;
-        default:
-            var value = $(this).val();
-    }
-    var post = {
-        api:'api/?v1/update/config',
-        name:$(this).attr("name"),
-        type:$(this).attr("data-type"),
-        value:value,
-        messageTitle:'',
-        messageBody:'Updated Value for '+$(this).parent().parent().find('label').text(),
-        error:'Organizr Function: API Connection Failed'
-    };
-    var callbacks = $.Callbacks();
-    //callbacks.add( buildCustomizeAppearance );
-    settingsAPI(post,callbacks);
-    //disable button then renable
-    $('.homepageForm :input').prop('disabled', 'true');
-    setTimeout(
-        function(){
-            $('.homepageForm :input').prop('disabled', null);
-            input.emulateTab();
-        },
-        2000
-    );
-
-});
 $(document).on({
 $(document).on({
     mouseenter: function () {
     mouseenter: function () {
         $(this).find('.progress').toggleClass('progress-lg');
         $(this).find('.progress').toggleClass('progress-lg');

File diff suppressed because it is too large
+ 0 - 0
js/custom.min.js


+ 1 - 0
js/functions.js

@@ -4123,6 +4123,7 @@ function message(heading,text,position,color,icon,timeout){
                 console.log(heading,text,position,color,icon,timeout);
                 console.log(heading,text,position,color,icon,timeout);
                 var msgFull = (heading !== '') ? heading + '<br/>' + text : text;
                 var msgFull = (heading !== '') ? heading + '<br/>' + text : text;
                 timeout = timeout / 1000;
                 timeout = timeout / 1000;
+                alertify.set('notifier','position', position);
                 alertify.notify(msgFull, icon+'-alertify', timeout);
                 alertify.notify(msgFull, icon+'-alertify', timeout);
                 break;
                 break;
             default:
             default:

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