From b1a6a5a3991cec5cd08873b01376e45d0b247f18 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 09:05:33 -0500
Subject: [PATCH] Cleaning up code to match coding guidelines

---
 interface/web/js/scrigo.js.php |   97 ++++++++++++++++++++++++------------------------
 1 files changed, 48 insertions(+), 49 deletions(-)

diff --git a/interface/web/js/scrigo.js.php b/interface/web/js/scrigo.js.php
index 33be65e..3927b80 100644
--- a/interface/web/js/scrigo.js.php
+++ b/interface/web/js/scrigo.js.php
@@ -1,13 +1,13 @@
 <?php
-	session_start();
-	include('../../lib/config.inc.php');
-    header('Content-Type: text/javascript; charset=utf-8'); // the config file sets the content type header so we have to override it here!
-	require_once('../../lib/app.inc.php');
-	$lang = (isset($_SESSION['s']['language']) && $_SESSION['s']['language'] != '')?$_SESSION['s']['language']:'en';
-	include_once(ISPC_ROOT_PATH.'/web/strengthmeter/lib/lang/'.$lang.'_strengthmeter.lng');
-	
-	$app->uses('ini_parser,getconf');
-	$server_config_array = $app->getconf->get_global_config();
+session_start();
+include '../../lib/config.inc.php';
+header('Content-Type: text/javascript; charset=utf-8'); // the config file sets the content type header so we have to override it here!
+require_once '../../lib/app.inc.php';
+$lang = (isset($_SESSION['s']['language']) && $_SESSION['s']['language'] != '')?$_SESSION['s']['language']:'en';
+include_once ISPC_ROOT_PATH.'/web/strengthmeter/lib/lang/'.$lang.'_strengthmeter.lng';
+
+$app->uses('ini_parser,getconf');
+$server_config_array = $app->getconf->get_global_config();
 ?>
 var pageFormChanged = false;
 var tabChangeWarningTxt = '';
@@ -22,10 +22,10 @@
 redirect = '';
 
 function reportError(request) {
-	/* Error reporting is disabled by default as some browsers like safari 
-	   sometimes throw errors when a ajax request is delayed even if the 
+	/* Error reporting is disabled by default as some browsers like safari
+	   sometimes throw errors when a ajax request is delayed even if the
 	   ajax request worked. */
-	   
+
 	/*alert(request);*/
 }
 
@@ -54,7 +54,7 @@
 if($server_config_array['misc']['use_loadindicator'] == 'y'){
 ?>
     requestsRunning += 1;
-    
+
     if(requestsRunning < 2) {
         var indicator = jQuery('#ajaxloader');
         if(indicator.length < 1) {
@@ -64,7 +64,7 @@
         var parent = jQuery('#content');
         if(parent.length < 1) return;
         indicatorCompleted = false;
-        
+
         var atx = parent.offset().left + 150; //((parent.outerWidth(true) - indicator.outerWidth(true)) / 2);
         var aty = parent.offset().top + 150;
         indicator.css( {'left': atx, 'top': aty } ).fadeIn('fast', function() {
@@ -102,9 +102,9 @@
 }
 
 function loadContentRefresh(pagename) {
-	
+
   if(document.getElementById('refreshinterval').value > 0) {
-	var pageContentObject2 = jQuery.ajax({	type: "GET", 
+	var pageContentObject2 = jQuery.ajax({	type: "GET",
 											url: pagename,
 											data: "refresh="+document.getElementById('refreshinterval').value,
 											dataType: "html",
@@ -127,8 +127,8 @@
 }
 
 function capp(module, redirect) {
-	var submitFormObj = jQuery.ajax({		type: "GET", 
-											url: "capp.php", 
+	var submitFormObj = jQuery.ajax({		type: "GET",
+											url: "capp.php",
 											data: "mod="+module+((redirect != undefined) ? '&redirect='+redirect : ''),
 											dataType: "html",
 											beforeSend: function() {
@@ -169,12 +169,12 @@
         passwordObj.focus();
         return;
     }
-	
+
 	$('#dummy_username').val(userNameObj.value);
 	$('#dummy_passwort').val(passwordObj.value);
 	$('#dummy_login_form').submit();
 
-	var submitFormObj = jQuery.ajax({		type: "POST", 
+	var submitFormObj = jQuery.ajax({		type: "POST",
 											url: "content.php",
 											data: jQuery('#'+formname).serialize(),
 											dataType: "html",
@@ -211,11 +211,11 @@
 	}
 	document.getElementById('footer').innerHTML = 'Powered by <a href="http://www.ispconfig.org" target="_blank">ISPConfig</a>';
 	*/
-	
+
 }
 
 function submitForm(formname,target) {
-	var submitFormObj = jQuery.ajax({		type: "POST", 
+	var submitFormObj = jQuery.ajax({		type: "POST",
 											url: target,
 											data: jQuery('#'+formname).serialize(),
 											dataType: "html",
@@ -253,7 +253,7 @@
 function submitFormConfirm(formname,target,confirmation) {
 	var successMessage = arguments[3];
 	if(window.confirm(confirmation)) {
-		var submitFormObj = jQuery.ajax({	type: "POST", 
+		var submitFormObj = jQuery.ajax({	type: "POST",
 											url: target,
 											data: jQuery('#'+formname).serialize(),
 											dataType: "html",
@@ -284,10 +284,10 @@
 	}
 }
 
-function submitUploadForm(formname,target) {		
+function submitUploadForm(formname,target) {
 	var handleResponse = function(loadedFrame) {
 		var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML;
-		
+
 		try {
 			response = JSON.parse(responseStr);
 		} catch(e) {
@@ -303,9 +303,9 @@
 			msg = msg+'<div id="errorMsg">'+errormsg+'</div>';
 		}
 		return msg;
-		
+
     };
-	
+
 	var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000);
 	jQuery('body').after('<iframe width="0" height="0" style="display:none;" name="'+frame_id+'" id="'+frame_id+'"/>');
 	jQuery('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit();
@@ -327,7 +327,7 @@
 
 function loadContent(pagename) {
   var params = arguments[1];
-  var pageContentObject2 = jQuery.ajax({	type: "GET", 
+  var pageContentObject2 = jQuery.ajax({	type: "GET",
 											url: pagename,
                                             data: (params ? params : null),
 											dataType: "html",
@@ -346,7 +346,7 @@
 													//var reponse = jQuery(jqXHR.responseText);
 													//var reponseScript = reponse.filter("script");
 													//jQuery.each(reponseScript, function(idx, val) { eval(val.text); } );
-													
+
 													jQuery('#pageContent').html(jqXHR.responseText);
                                                     onAfterContentLoad(pagename, (params ? params : null));
                                                     pageFormChanged = false;
@@ -362,7 +362,7 @@
 
 
 function loadInitContent() {
-	var pageContentObject = jQuery.ajax({	type: "GET", 
+	var pageContentObject = jQuery.ajax({	type: "GET",
 											url: "content.php",
 											data: "s_mod=login&s_pg=index",
 											dataType: "html",
@@ -385,7 +385,7 @@
 												reportError('Ajax Request was not successful. 114');
 											}
 										});
-  
+
   loadMenus();
   keepalive();
   setTimeout("setFocus()",1000);
@@ -401,7 +401,7 @@
 
 
 function loadMenus() {
-  var sideNavObject = jQuery.ajax({			type: "GET", 
+  var sideNavObject = jQuery.ajax({			type: "GET",
 											url: "nav.php",
 											data: "nav=side",
 											dataType: "html",
@@ -417,8 +417,8 @@
 												reportError('Ajax Request was not successful. 115');
 											}
 									});
-	
-  var topNavObject = jQuery.ajax({			type: "GET", 
+
+  var topNavObject = jQuery.ajax({			type: "GET",
 											url: "nav.php",
 											data: "nav=top",
 											dataType: "html",
@@ -440,7 +440,7 @@
 function changeTab(tab,target,force) {
 	//document.forms[0].next_tab.value = tab;
 	document.pageForm.next_tab.value = tab;
-    
+
     var idel = jQuery('form#pageForm').find('[name="id"]');
     var id = null;
     if(idel.length > 0) id = idel.val();
@@ -466,7 +466,7 @@
         }
     }
 }
-	
+
 function del_record(link,confirmation) {
   if(window.confirm(confirmation)) {
           loadContent(link);
@@ -480,7 +480,7 @@
 }
 
 function loadContentInto(elementid,pagename) {
-  var pageContentObject2 = jQuery.ajax({	type: "GET", 
+  var pageContentObject2 = jQuery.ajax({	type: "GET",
 											url: pagename,
 											dataType: "html",
 											beforeSend: function() {
@@ -498,7 +498,7 @@
 }
 
 function loadOptionInto(elementid,pagename) {
-	var pageContentObject2 = jQuery.ajax({	type: "GET", 
+	var pageContentObject2 = jQuery.ajax({	type: "GET",
 											url: pagename,
 											dataType: "html",
 											beforeSend: function() {
@@ -526,7 +526,7 @@
 }
 
 function keepalive() {
-	var pageContentObject3 = jQuery.ajax({	type: "GET", 
+	var pageContentObject3 = jQuery.ajax({	type: "GET",
 											url: "keepalive.php",
 											dataType: "html",
 											success: function(data, textStatus, jqXHR) {
@@ -581,24 +581,24 @@
 		pass_result(0);
 		return;
 	}
-	
+
 	if (length < 5) {
 		pass_result(1);
 		return;
 	}
-	
+
 	if (pass_contains(password, "ABCDEFGHIJKLNMOPQRSTUVWXYZ")) {
 		points += 1;
 	}
-	
+
 	if (pass_contains(password, "0123456789")) {
 		points += 1;
 	}
-	
+
 	if (pass_contains(password, "`~!@#$%^&*()_+|\=-[]}{';:/?.>,<\" ")) {
 		points += 1;
 	}
-	
+
 	if (points == 0) {
 		if (length >= 5 && length <=6) {
 			pass_result(1);
@@ -689,7 +689,7 @@
 		var $el = jQuery('#template_additional_list ul').find('li[rel="' + tpl_id + '"]').eq(0); // only the first
         var addTplText = $el.text();
         $el.remove();
-        
+
 		var oldVal = tpl_add.split('/');
 		var newVal = new Array();
         for(var i = 0; i < oldVal.length; i++) {
@@ -713,7 +713,7 @@
             }
             return this;
         });
-        
+
 		var newVal = tpl_add;
         var repl = new RegExp('(^|\/)' + addTplId + '(\/|$)');
 		newVal = newVal.replace(repl, '');
@@ -723,7 +723,7 @@
   } else {
   	alert('no additional template selcted');
   }
-  
+
 }
 
 function getInternetExplorerVersion() {
@@ -814,7 +814,7 @@
 	var template2 = jQuery(this).siblings(':input');
 	template2.insertAtCaret(placeholderContentText);
 });
-		
+
 jQuery.fn.extend({
 	insertAtCaret: function(myValue){
 		return this.each(function(i) {
@@ -841,4 +841,3 @@
 		})
 	}
 });
-

--
Gitblit v1.9.1