Skip to content

Commit

Permalink
Minor formatting and comment modifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasmolleja committed Jan 16, 2018
1 parent e3265dd commit 5dcfe51
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 48 deletions.
47 changes: 18 additions & 29 deletions hlcreate.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <script src="js/tpxLocalize.js"></script> -->
<!-- <script src="js/tpxHighLevelBasketAPIKO.js"></script> -->
<script src="js/tpxHighLevelBasketAPI.js"></script>
<link rel="stylesheet" href="css/basicModal.min.css">
<script src="js/basicModal.min.js"></script>
<script>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

/**********************************************************************************/
/************* POSSIBLE FIX TO THE BACK BUTTON LOOP ISSUE *******************/
/**********************************************************************************/

<script src="js/tpxHighLevelBasketAPI.js"></script>

<link rel="stylesheet" href="css/basicModal.min.css">
<script src="js/basicModal.min.js"></script>

<script>
// The only reason to override this function is to fix an issue
// that creates unwanted dummy projects each time the user clicks the back button
// in the designer instead of getting back to the previous page.
function tpxHighLevelCreateProjectView(pJsonResponseObject) {
if ((pJsonResponseObject.result == 0) || (pJsonResponseObject.result == -2)) {
onlineDesignURL = pJsonResponseObject.designurl;

if (pJsonResponseObject.result == -2) {
onlineDesignURL = onlineDesignURL;
}
/**********************************************************************************/
/************* FIX START *******************/
/**********************************************************************************/

// commented: window.location = onlineDesignURL;
// Fix: Instead of "window.location = onlineDesignURL;" we use:
window.location.replace(onlineDesignURL);

/**********************************************************************************/
/************* FIX END *******************/
/**********************************************************************************/
}
else {
var resultAlert = {
Expand All @@ -49,16 +40,14 @@
}
}
}

basicModal.show(resultAlert);
}

return false;
}
</script>
</head>

<body onLoad="tpxHighLevelBasketInitialise()">
</body>

</script>
</head>
<body onLoad="tpxHighLevelBasketInitialise()">
</body>
</html>
</html>
22 changes: 4 additions & 18 deletions js/tpxBasketAPICustomize.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
// CUSTOMIZATION FOR TPXHIGHLEVELBASKETAPI
// The purpose of this file is to separate original taopix provided file from the customization we need to do.
// This will make easier future upgrades and maintenance.On each new taopix release we can simply overwrite tpxHighLevelBasketAPI.js and be sure that
// all modifications are in this file and others that can be loaded after this one.
// The way we customize functions and variables in original is by overriding them here.
// So it is critical that this file is loaded after tpxHighLevelBasketAPI.js


// External Dependencies:
// tpxBasketAPIViewModel


// It is critical that this file is loaded after tpxHighLevelBasketAPI.js

var kServerURL = "";
// fixing a translation issue. When this is fixed by taopix, we can remove this line.
var kStr_LabelSignIn = "en Sign In<p>cs Přihlásit<p>da Log på<p>de Anmelden<p>es Iniciar Sesión<p>fi Kirjaudu<p>fr Connectez-vous<p>it Accedere<p>ja サインイン<p>ko 로그인<p>nl Aanmelden<p>no Logg inn<p>pl Zaloguj<p>pt Entre<p>ru Вход<p>sv Logga in<p>th เข้าสู่ระบบ<p>zh_cn 登录<p>zh_tw 登入";

// fixing an spanish translation issue. When this is fixed by Taopix, we can remove this line.
var kStr_LabelSignIn = "en Sign In<p>cs Přihlásit<p>da Log på<p>de Anmelden<p>es Iniciar Sesión<p>fi Kirjaudu<p>fr Connectez-vous<p>it Accedere<p>ja サインイン<p>ko 로그인<p>nl Aanmelden<p>no Logg inn<p>pl Zaloguj<p>pt Entre<p>ru Вход<p>sv Logga in<p>th เข้าสู่ระบบ<p>zh_cn 登录<p>zh_tw 登入";


// GET PROJECT LIST CUSTOMIZATION
Expand All @@ -29,7 +18,7 @@ function tpxHighLevelGetProjectListView(pJsonResponseObject)
// RENAME PROJECT CUSTOMIZATION
// As an exception we need to override the control function too. Explained why below.

// MATIAS: added a new parameter pProjectName.
// Added a new parameter pProjectName.
// That is what is already done by Taopix for duplicateProjectControl and deleteProjectControl.
// Not sure why here it is different
// The parameter is to avoid having to extract the projectname from an element in the html.
Expand Down Expand Up @@ -180,7 +169,6 @@ function tpxHighLevelGetBasketContentsView(pJsonResponseObject)


// REMOVE ITEM FROM BASKET CUSTOMIZATION

function tpxHighLevelRemoveItemFromBasketView(pJsonResponseObject)
{
if (pJsonResponseObject.result == 32)
Expand Down Expand Up @@ -230,7 +218,6 @@ function tpxHighLevelRemoveItemFromBasketView(pJsonResponseObject)


// EMPTY BASKET CUSTOMIZATION

function tpxHighLevelEmptyBasketView(pJsonResponseObject)
{
if (pJsonResponseObject.result == 32)
Expand Down Expand Up @@ -284,6 +271,5 @@ function tpxHighLevelLoggedInStatusCallBack(pIsSignedIn)
tpxBasketAPIViewModel.isSignedIn(pIsSignedIn);
}


// DISABLING TAOPIX INITIAL UI LOCALIZATION BECAUSE IT IS NOT NEEDED WITH KNOCKOUT
function tpxHighLevelBasketLocalise() { }
2 changes: 1 addition & 1 deletion js/tpxBasketAPIViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

self.localize = function (key) {
var translated = tpxGetLocaleString(key); // tpxLocalize.localize(key);
var translated = tpxGetLocaleString(key);

if (!translated) {
console.error('unable to translate string: ' + key);
Expand Down

0 comments on commit 5dcfe51

Please sign in to comment.