add vonig modal on load to create client object from user input
authorOwen Smith <owen@omsmith.ca>
Mon, 19 Nov 2012 05:52:13 +0000 (00:52 -0500)
committerOwen Smith <owen@omsmith.ca>
Mon, 19 Nov 2012 05:52:13 +0000 (00:52 -0500)
www/assets/js/client.js
www/assets/js/ui.js
www/index.html

index c0cd448..bbdc4db 100644 (file)
@@ -1,5 +1,3 @@
-var client = new PosClientWrapper('', '');
-
 PosClientWrapper = function (authKey, serverLocation) {
        this._authKey = authKey;
 
index 8be73f0..ded8c8d 100644 (file)
@@ -1,4 +1,12 @@
-$('input[name=upc]').focus();
+var client = {};
+
+$('#config-modal').modal().find('#save-config').click(function (e) {
+       var authKey = $('input[name=auth-key]').val();
+       var serverLocation = $('input[name=server-location]').val();
+
+       client = new PosClientWrapper( authKey, serverLocation );
+});
+
 
 var total = 0;
 var entries = {};
index 14c6518..83ec782 100644 (file)
                        </div>
                </div>
 
+               <div id="config-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="config-modal-label" aria-hidden="true" data-backdrop="static" data-keyboard="false" data-show="true">
+                       <div class="modal-header">
+                               <h3 id="config-modal-label">Configuration</h3>
+                       </div>
+                       <div class="modal-body">
+                               <input type="password" class="span6" name="auth-key" placeholder="Authorization key" title="Authorization key" />
+                               <input type="text" class="span6" name="sever-location" placeholder="Server location" title="Server location" />
+                       </div>
+                       <div class="modal-footer">
+                               <a href="#" id="save-config" class="btn btn-primary" data-dismiss="modal">Save</a>
+                       </div>
+               </div>
+
                <!-- js included here -->
                <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
                <script src="assets/js/jquery.formatCurrency-1.4.0.min.js"></script>