windhamdavid 5 years ago
parent
commit
833367d715
4 changed files with 59 additions and 206 deletions
  1. 1 2
      gruntfile.js
  2. 8 147
      inc/tweaks.php
  3. 50 56
      js/chat_func.js
  4. 0 1
      js/chat_func.min.js

+ 1 - 2
gruntfile.js

@@ -53,8 +53,7 @@ module.exports = function(grunt) {
 				'js/init-o.min.js': ['js/init-o.js'],
 				'js/init.min.js': ['js/init.js'],
 				'js/front.min.js' : ['js/front-page.min.js'], 
-				'js/chat.min.js' : ['js/chat.js'],
-				'js/chat_func.min.js' : ['js/chat_func.js'],  
+				'js/chat.min.js' : ['js/chat.js'], 
 		      }
 		    }
 		  }

File diff suppressed because it is too large
+ 8 - 147
inc/tweaks.php


+ 50 - 56
js/chat_func.js

@@ -1,8 +1,51 @@
-/*! Chat Page Stuff */
+/*! Front Page */
+$(function() {
+	var i;i = 0;
+	Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
+	var msg; msg = Messenger().post({
+		message: 'I am currently online', type: 'success',
+		actions: {retry: {label: 'Connect', delay: 30,
+				action: function(){
+					txt_dave();
+					var msg_return; msg_return = Messenger().run({
+					  	errorMessage: 'Please wait a moment while I am texted a message to get connected with you.', 
+						successMessage: 'Connecting Now!',
+					  	action: function(opts) {
+						  msg.hide();		  
+							if (++i < 2) {
+								return opts.error({status: 500,readyState: 0,responseText: 0});	
+							} 
+							else {
+								window.location.href = 'contact/chat';		
+								return msg.update({message: 'Redirect to Chat', hideAfter: 20, type: 'success', actions: false});
+								
+							}
+						}
+					});
+				}
+			},
+			cancel: {
+				label: 'No Thanks',
+				action: function() {
+					return msg.update({message: 'Maybe Next Time', hideAfter: 1, type: 'error', actions: false});
+				}
+			}
+		}
+	});
+});
+function txt_dave() {
+	$.ajax({
+		url: 'https://davidawindham.com/wha/phony/sms',
+		dataType: 'json',
+		success: function(data){},
+	});
+}
+
+/*! Chat Page */
 
+Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
 var i;i = 0;
 $(function(){
-    Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
 	var msg_return; msg_return = Messenger().run({
 		id: 'one',
 		errorMessage: 'Looking for David...', 
@@ -29,11 +72,11 @@ function get_dave() {
 					cache: false, 
 					success: function (data) {
 						online = data.online;
-						if(online=='yes'){
+						if (online=='yes') {
 							$('.chat').modal('show');
 							x = x+5;
 						};
-						if(online=='no'){
+						if (online=='no') {
 							dave_connecting();
 						};
 					},
@@ -51,7 +94,6 @@ function get_dave() {
 }
 
 function dave_connecting(){
-	Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
 	var y;y = 0;
 	var msg_waiting; msg_waiting = Messenger().run({
 		id: 'one',
@@ -67,7 +109,6 @@ function dave_connecting(){
 }		
 
 function dave_not_available(){
-	Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
 	var msg_error; msg_error = Messenger().post({
 		message: 'Sorry, but I am busy.',
 		type: 'error',
@@ -75,7 +116,7 @@ function dave_not_available(){
 		showCloseButton: true,
 		actions:{
 			cancel: {
-				label: '<a href="../">Leave me a message</a>',
+				label: 'Leave me a message',
 				action: function(){
 					window.location.href = '../';	
 				}
@@ -85,7 +126,6 @@ function dave_not_available(){
 }
 
 function dave_error(){
-	Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
 	var msg_error; msg_error = Messenger().post({
 		message: 'Oops. Something has gone wrong.',
 		type: 'error',
@@ -93,7 +133,7 @@ function dave_error(){
 		showCloseButton: true,
 		actions:{
 			cancel: {
-				label: '<a href="../">Leave me a message</a>',
+				label: 'Leave me a message',
 				action: function(){
 					window.location.href = '../';	
 				}
@@ -105,50 +145,4 @@ $(function() {
     if (window.location.hash.indexOf("chat") !== -1) {
         $('.chat').modal('show');
     }
-});
-
-
-
-/*! Front Page Stuff */
-
-var i;i = 0;
-$(function(){
-    Messenger.options = {extraClasses: "messenger-fixed messenger-on-bottom messenger-on-left",theme: "flat"};
-	var msg; msg = Messenger().post({
-		message: 'I am currently online', type: 'success',
-		actions: {retry: {label: 'Connect', delay: 30,
-				action: function(){
-					txt_dave();
-					var msg_return; msg_return = Messenger().run({
-					  	errorMessage: 'Please wait a moment while I am texted a message to get connected with you.', 
-						successMessage: 'Connecting Now!',
-					  	action: function(opts) {
-						  msg.hide();		  
-							if (++i < 2) {
-								return opts.error({status: 500,readyState: 0,responseText: 0});	
-							} 
-							else {
-								window.location.href = 'contact/chat';		
-								return msg.update({message: 'Redirect to Chat', hideAfter: 20, type: 'success', actions: false});
-								
-							}
-						}
-					});
-				}
-			},
-			cancel: {
-				label: 'No Thanks',
-				action: function() {
-					return msg.update({message: 'Maybe Next Time', hideAfter: 1, type: 'error', actions: false});
-				}
-			}
-		}
-	});
-});
-function txt_dave() {
-	$.ajax({
-		url: 'https://davidawindham.com/wha/phony/sms',
-		dataType: 'json',
-		success: function(data){},
-	});
-}
+});

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