update PHP Excel
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
function getInfo(action, fOnSuccess, vars, fOnError, bProcessIcon)
|
||||
function getInfo(action, fOnSuccess, vars, fOnError, $ProcessButton)
|
||||
{
|
||||
if(!vars) vars = {};
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
//if(bProcessIcon) self.addBufferIcon();
|
||||
if($ProcessButton) $ProcessButton.startProcess();
|
||||
|
||||
vars['a'] = action;
|
||||
$.ajax(
|
||||
@@ -13,16 +12,13 @@ function getInfo(action, fOnSuccess, vars, fOnError, bProcessIcon)
|
||||
})
|
||||
.done(function(oData)
|
||||
{
|
||||
if($ProcessButton) $ProcessButton.stopProcess();
|
||||
if(oData.result==oPedidor.consts.error) fOnError(oData.desc);
|
||||
else
|
||||
{
|
||||
//if(bProcessIcon) self.resetIcon();
|
||||
fOnSuccess(oData);
|
||||
}
|
||||
else fOnSuccess(oData.data);
|
||||
})
|
||||
.fail(function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
//if(bProcessIcon) self.resetIcon();
|
||||
if($ProcessButton) $ProcessButton.stopProcess();
|
||||
if(!fOnError) console.log(textStatus+' '+errorThrown);
|
||||
else fOnError(textStatus);
|
||||
});
|
||||
@@ -52,11 +48,12 @@ function copyArray(asArray)
|
||||
return asArray.slice(0); //trick to copy array
|
||||
}
|
||||
|
||||
$.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, bPrepend)
|
||||
$.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, bPrepend, bProcessIcon)
|
||||
{
|
||||
bPrepend = bPrepend || false;
|
||||
$This = $(this);
|
||||
sButtonClass = sButtonClass || '';
|
||||
bProcessIcon = bProcessIcon || false;
|
||||
var asAttributes = {id:(sId || ''),
|
||||
'class':'button'+(typeof sButtonClass != 'undefined'?' '+sButtonClass:''),
|
||||
title:sTitle};
|
||||
@@ -78,11 +75,25 @@ $.prototype.addButton = function(sType, sTitle, oClickLink, sButtonClass, sId, b
|
||||
else $Button.appendTo($This);
|
||||
|
||||
//Function
|
||||
if(!bLink) $Button.click(function(e){e.preventDefault(); oClickLink($(this));});
|
||||
if(!bLink) $Button.click(function(e){
|
||||
e.preventDefault();
|
||||
var $This = $(this);
|
||||
if(bProcessIcon) $This.startProcess();
|
||||
oClickLink($This);
|
||||
});
|
||||
|
||||
return $This;
|
||||
};
|
||||
|
||||
$.prototype.startProcess = function()
|
||||
{
|
||||
$(this).find('.fa').addClass('spinner fa-spin');
|
||||
}
|
||||
|
||||
$.prototype.stopProcess = function()
|
||||
{
|
||||
$(this).find('.fa').removeClass('spinner fa-spin');
|
||||
}
|
||||
|
||||
$.prototype.addDefaultValue = function(sDefaultValue, sInitValue)
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,7 +4,7 @@ function Pedidor(asGlobals)
|
||||
this.consts = asGlobals.consts;
|
||||
this.consts.hash_sep = '-';
|
||||
this.consts.default_page = 'orders';
|
||||
this.consts.title = 'Pedidor';
|
||||
this.consts.title = 'Micro Negrin';
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
@@ -69,9 +69,9 @@ function Pedidor(asGlobals)
|
||||
this.onHashChange = function()
|
||||
{
|
||||
var asHash = self.getHash();
|
||||
var sDefaultPage = self.vars('log_in')?self.consts.default_page:'logon';
|
||||
if(asHash.hash !='' && asHash.page != '') self.switchPage(asHash); //page switching
|
||||
else if(self.vars('page')=='') self.setHash(sDefaultPage); //first page
|
||||
if(!self.vars('log_in') && asHash.page != 'logon') self.setHash('logon');
|
||||
else if(asHash.hash !='' && asHash.page != '') self.switchPage(asHash); //page switching
|
||||
else if(self.vars('page')=='') self.setHash(self.consts.default_page); //first page
|
||||
};
|
||||
|
||||
this.resetTmpFunctions = function()
|
||||
@@ -154,6 +154,13 @@ function Pedidor(asGlobals)
|
||||
|
||||
/* Page Switching */
|
||||
|
||||
this.loadHome = function()
|
||||
{
|
||||
self.vars('log_in', true);
|
||||
$('#header, #menu, #footer').fadeIn('slow');
|
||||
oPedidor.setHash(oPedidor.consts.default_page);
|
||||
}
|
||||
|
||||
this.getActionLink = function(sAction, oVars)
|
||||
{
|
||||
if(!oVars) oVars = {};
|
||||
@@ -184,7 +191,7 @@ function Pedidor(asGlobals)
|
||||
|
||||
//Update Page Title
|
||||
var sDetail = asHash.items[0] || '';
|
||||
document.title = self.consts.title+' - '+sPageName+' '+sDetail;
|
||||
document.title = self.consts.title+' - '+self.consts.page_to_hash[sPageName].replace('_', ' ')+' '+sDetail;
|
||||
|
||||
//Replacing DOM
|
||||
var $Dom = $(self.consts.pages[sPageName]);
|
||||
|
||||
Reference in New Issue
Block a user