aboutsummaryrefslogtreecommitdiff
path: root/shared/Dashboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'shared/Dashboard.js')
-rw-r--r--shared/Dashboard.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/shared/Dashboard.js b/shared/Dashboard.js
index 84b8f7e..6bad7a0 100644
--- a/shared/Dashboard.js
+++ b/shared/Dashboard.js
@@ -21,4 +21,37 @@ $(document).ready(function(){
window.location.replace('../')
}
});
+ // var url = window.location.href;
+ //
+
+ var url = window.location.href;
+ if( url.search( 'productid' ) > 0 ) {
+ option = url.match(/productid=(.*)/)[1];
+ $.getJSON("../products.json", function(result){
+ var size = (Object.keys(result).length)
+ if(option > -1 && option < size) {
+ loadProduct(option);
+ }
+ else {
+ showErrorDiv()
+ }
+ })
+ } else {
+ loadAllProducts()
+ }
+ function loadProduct (productid) {
+
+ }
+ function showErrorDiv() {
+
+ }
+ function loadAllProducts() {
+ $.getJSON("../products.json", function(result){
+ var size = (Object.keys(result).length)
+ for(i = 0; i < size ; i++)
+ {
+ // $('#loader')
+ }
+ });
+ }
}) \ No newline at end of file