Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 6 commits
  • 8 files changed
  • 0 comments
  • 1 contributor
89  index.html
@@ -8,6 +8,8 @@
8 8
     <link rel="stylesheet" href="shared/style_unstable/lists.css">
9 9
     <link rel="stylesheet" href="shared/style_unstable/tabs.css">
10 10
     <link rel="stylesheet" href="shared/style/input_areas.css">
  11
+    <link rel="stylesheet" href="shared/style_unstable/progress_activity.css">
  12
+    <link rel="stylesheet" href="shared/style/buttons.css"> 
11 13
 		<link rel="stylesheet" href="style/fonts.css">
12 14
 		<link rel="stylesheet" href="style/icons.css">
13 15
     <link rel="stylesheet" href="style/app.css">
@@ -78,14 +80,23 @@
78 80
               <article class="body full padding">
79 81
                <div class="inner">
80 82
                  <form id="event-form" action="#" class="full">
81  
-                   <p>
82  
-                     <input data-cancelable placeholder="Event Name" name="name" class="textfield" type="text" x-inputmode="latin-prose" value="" id="name" required="required">
83  
-            	       <button type="reset">Clear</button>
84  
-                   </p>
85  
-                   <p>
86  
-            	       <textarea placeholder="Description" required="required"></textarea>
87  
-                     <button type="reset">Clear</button>
88  
-                   </p>
  83
+                  <p>
  84
+                    <input data-cancelable placeholder="Event Name" name="name" class="textfield" type="text" x-inputmode="latin-prose" value="" id="name" required="required">
  85
+                    <button type="reset">Clear</button>
  86
+                  </p>
  87
+                  <p>
  88
+                    <textarea placeholder="Description" required="required"></textarea>
  89
+                    <button type="reset">Clear</button>
  90
+                  </p> 
  91
+                  <p>
  92
+                    <button class="icon icon-view" id="location-name">Venue Name</button>
  93
+                    <input type="hidden" name="venueid" id="venueid">
  94
+                    <input type="hidden" name="venuename" id="venuename">
  95
+                    <input type="hidden" name="venueaddress" id="venueaddress">
  96
+                    <input type="hidden" name="venuelatitude" id="venuelatitude">
  97
+                    <input type="hidden" name="venuelongitude" id="venuelongitude">
  98
+                  <button type="reset">Clear</button>
  99
+                  </p>
89 100
                    <fieldset>
90 101
             	       <legend>Start</legend>
91 102
             	       <section>
@@ -111,21 +122,7 @@
111 122
             			        <button type="reset">Clear</button>
112 123
             		        </p>
113 124
                       </section>
114  
-                    </fieldset>
115  
-
116  
-                    <fieldset>
117  
-            	        <legend>Place</legend>
118  
-            	        <section>
119  
-                    		<p>
120  
-            			        <input data-cancelable placeholder="Name or Address" name="location-name" class="textfield" type="text" x-inputmode="latin-prose" value="" id="location-name" required="required">
121  
-            			        <button type="reset">Clear</button>
122  
-            		        </p>
123  
-            		        <p>
124  
-            			        <input data-cancelable placeholder="Latitude and Longitude" name="location-latlong" class="textfield" type="text" x-inputmode="latin-prose" value="" id="location-latlong" required="required">
125  
-            			        <button type="reset">Clear</button>
126  
-            		        </p>
127  
-                      </section>
128  
-                    </fieldset>
  125
+                    </fieldset> 
129 126
                     <input type="submit" style="display:none" id="submit-event-button"> 
130 127
                  </form>
131 128
                </div>
@@ -138,7 +135,7 @@
138 135
 				         <button id="cancel-search-location" class="cancel-navigation negative"><span class="icon icon-close">Exit</span></button>
139 136
 				         <menu type="toolbar">
140 137
 				         </menu>
141  
-				         <h1>Place</h1>
  138
+				         <h1>Venue</h1>
142 139
 				       </header> 
143 140
 
144 141
 							<article class="body full">
@@ -149,16 +146,51 @@
149 146
 						      </p>
150 147
 						    </form>
151 148
 								<section data-type="list" id="search-location-result">
  149
+									<p role="status" class="loading">
  150
+						        <progress class="small"></progress>
  151
+						         <span>Searching...</span>
  152
+						      </p>
  153
+									<p role="status" class="no-result">
  154
+						         <span>No results</span>
  155
+						      </p>
152 156
                   <ul>
153 157
                     <li data-template>
154 158
                       <a href="#">
155  
-                        <p>#name#</p>
156  
-                        <p>#location#</p>
  159
+                        <p class="name">#name#</p>
  160
+                        <p class="location">#location#</p>
157 161
                       </a>
158 162
                     </li>
159 163
                   </ul>  
160 164
                 </section>
161 165
 							</article>
  166
+						</section>
  167
+						
  168
+						<!-- Add Location Section -->
  169
+						<section id="view-event-add-location" role="region" class="view transition transition-bottom" data-mirror="mirror-event-add-location">
  170
+						   <header>
  171
+				         <button id="cancel-add-location" class="cancel-navigation negative"><span class="icon icon-close">Exit</span></button>
  172
+				         <menu type="toolbar">
  173
+				         </menu>
  174
+				         <h1>Add Venue</h1>
  175
+				       </header> 
  176
+
  177
+							<article class="body full">
  178
+		            <form id="add-location-form" action="#" class="full">
  179
+		              <p>
  180
+		               	<input data-cancelable placeholder="Venue Name" name="addvenuename" class="textfield" type="text" x-inputmode="latin-prose" value="" id="add-location-name" required="required">
  181
+		       	       	<button type="reset">Clear</button>
  182
+		              </p>
  183
+		              <p>
  184
+		               	<input data-cancelable placeholder="Address" name="addvenueaddress" class="textfield" type="text" x-inputmode="latin-prose" value="" id="add-location-address" required="required">
  185
+		       	       	<button type="reset">Clear</button>
  186
+		              </p>
  187
+		              <p>
  188
+		               	<input data-cancelable placeholder="Latitude and Longitude" name="addvenuealatlong" class="textfield" type="text" x-inputmode="latin-prose" value="" id="add-location-latlong" required="required">
  189
+		       	       	<button type="reset">Clear</button>
  190
+		              </p>
  191
+		              <input type="submit" style="display:none" id="submit-add-location-button"> 
  192
+		            </form>
  193
+							</article>
162 194
 						</section> 
163 195
 
164 196
 						<!-- Add LatLong Section -->
@@ -168,7 +200,7 @@
168 200
 				         <menu type="toolbar">
169 201
 				           <button id="submit-latlong-event" role="menuitem" disabled>Done</button>
170 202
 				         </menu>
171  
-				         <h1>Place</h1>
  203
+				         <h1>Venue Map</h1>
172 204
 				       </header> 
173 205
 
174 206
 							<article class="body full">
@@ -282,7 +314,8 @@
282 314
 			<div id="mirror-profile" class="view" style="background-image: -moz-element(#view-profile);"></div> 
283 315
 			<div id="mirror-login" class="view" style="background-image: -moz-element(#view-login);"></div>
284 316
 			<div id="mirror-register" class="view" style="background-image: -moz-element(#view-register);"></div>
285  
-			<div id="mirror-event-search-location" class="view" style="background-image: -moz-element(#view-event-search-location);"></div> 
  317
+			<div id="mirror-event-search-location" class="view" style="background-image: -moz-element(#view-event-search-location);"></div>
  318
+			<div id="mirror-event-add-location" class="view" style="background-image: -moz-element(#view-event-add-location);"></div> 
286 319
 	  </div>
287 320
 
288 321
   </body>
22  js/api.js
@@ -50,7 +50,7 @@ this.api = (function() {
50 50
         ret = resp.results;
51 51
       }
52 52
       
53  
-      if(callback && typeof callback === "function") {
  53
+      if($.isFunction(callback)) {
54 54
         callback(ret);
55 55
       }
56 56
     })
@@ -58,19 +58,27 @@ this.api = (function() {
58 58
   
59 59
   function updateProfile(data, callback) {
60 60
     $.post(APIURL+'user/update', data, function(resp) {
61  
-      if(callback && typeof callback === "function") {
  61
+      if($.isFunction(callback)) {
62 62
         callback(resp.status);
63 63
       }
64 64
     })
65 65
   }
66 66
   
67 67
   function venuesearch(query,callback) {
68  
-    $.get(APIURL+'venue/search?q='+query, function(resp) {
69  
-      if(resp.status == true) {
70  
-        if(callback && typeof callback === "function") {
71  
-          callback(resp.results);
  68
+    $.ajax({
  69
+      url: APIURL+'venue/search?q='+query,
  70
+      success: function(resp) {
  71
+        if(resp.status == true) {
  72
+          if($.isFunction(callback)) {
  73
+            callback(resp.results);
  74
+          }
72 75
         }
73  
-      }
  76
+      },
  77
+      error: function() {
  78
+        if($.isFunction(callback)) {
  79
+          callback(false);
  80
+        }
  81
+      }  
74 82
     })
75 83
   }
76 84
   
44  js/form.js
@@ -34,13 +34,15 @@ $(function() {
34 34
     }
35 35
   });
36 36
   
37  
-  $('#location-name').focus(function() {
  37
+  $('#location-name').click(function(e) {
38 38
     navigation.go('view-event-search-location','popup');
  39
+    e.preventDefault();
39 40
   }); 
40 41
   
41 42
   $('#location-latlong').focus(function() {
42 43
     navigation.go('view-event-latlong-add','popup');
43  
-    map.openMap($('#location-name').val());
  44
+    var q = $('#location-latlong').val() ? $('#location-latlong').val() : $('#location-name').val();
  45
+    map.openMap(q);
44 46
     $('#submit-latlong-event').removeAttr('disabled'); 
45 47
   });
46 48
   
@@ -69,22 +71,50 @@ $(function() {
69 71
   });
70 72
   
71 73
   $('#search-location-text').keyup($.debounce( function() {
  74
+    if($(this).val() == '') return false;
  75
+     
  76
+    $('#search-location-result').find('p.no-result').hide();       
  77
+    $('#search-location-result').find('p.loading').show();
  78
+         
72 79
     api.venuesearch($(this).val(), function(data) {
73 80
       $('#search-location-result li:not([data-template])').each(function() {
74 81
         $(this).remove();
75 82
       });
76 83
       
  84
+      $('#search-location-result').find('p.loading').hide();
  85
+      
  86
+      if(data == false) {
  87
+        $('#search-location-result').find('p.no-result').show();
  88
+        return false;
  89
+      } 
  90
+            
77 91
       var template = $('#search-location-result').find('[data-template]');
  92
+
78 93
       $.each(data, function() {
79  
-        template.clone()
  94
+        template.clone().appendTo('#search-location-result')
80 95
         .removeAttr('data-template')
81  
-        .find('a').attr('data-id',this.id).attr('data-latitude',this.latitude).attr('data-longitude',this.longitude)
82  
-        .find("p:contains('#name#')").text(this.name)
83  
-        .find("p:contains('#location#')").text(this.location)
  96
+        .find('a').attr('data-id',this.id).attr('data-name',this.name).attr('data-latitude',this.latitude).attr('data-longitude',this.longitude).addClass('select-venue')
  97
+        .find("p.name").text(this.name)
  98
+        .siblings("p.location").text(this.location)
84 99
       })
85 100
     });
86  
-  }, 300));
  101
+  }, 500));
  102
+  
  103
+  $(document).on('click','.select-venue',function(e) {
  104
+    $('#venueid').val($(this).attr('data-id'));
  105
+    $('#location-name').text($(this).attr('data-name'));
  106
+    navigation.back();
  107
+    e.preventDefault();
  108
+  });
87 109
   
  110
+  $('#add-location-link').click(function() {
  111
+    navigation.back();
  112
+    navigation.popup('view-event-add-location');
  113
+  })
  114
+  
  115
+  $('#add-location-form').submit(function(e) {
  116
+    e.preventDefault();
  117
+  })
88 118
   
89 119
   /* Profile */
90 120
   $('#firstname, #lastname').keyup(function() {
8  js/map.js
@@ -75,6 +75,14 @@ var map = {
75 75
     });
76 76
   },
77 77
   
  78
+  getLatitude: function() {
  79
+    return this.markerlat;
  80
+  },
  81
+  
  82
+  getLongitude: function() {
  83
+    return this.markerlng;
  84
+  },
  85
+  
78 86
   getMarker: function() {
79 87
     if(this.markerlat && this.markerlng)
80 88
       return this.markerlat+','+this.markerlng;
114  js/plugins.js
@@ -9,63 +9,63 @@
9 9
  * Porting to Zepto by Fikri (2012)
10 10
  */
11 11
 (function($) {
12  
-
13  
-  $.extend({
14  
-
15  
-  	debounce : function(fn, timeout, invokeAsap, ctx) {
16  
-
17  
-  		if(arguments.length == 3 && typeof invokeAsap != 'boolean') {
18  
-  			ctx = invokeAsap;
19  
-  			invokeAsap = false;
20  
-  		}
21  
-
22  
-  		var timer;
23  
-
24  
-  		return function() {
25  
-
26  
-  			var args = arguments;
  12
+  
  13
+  $.extend($, {
  14
+  
  15
+   debounce : function(fn, timeout, invokeAsap, ctx) {
  16
+  
  17
+     if(arguments.length == 3 && typeof invokeAsap != 'boolean') {
  18
+       ctx = invokeAsap;
  19
+       invokeAsap = false;
  20
+     }
  21
+  
  22
+     var timer;
  23
+  
  24
+     return function() {
  25
+  
  26
+       var args = arguments;
27 27
              ctx = ctx || this;
28  
-
29  
-  			invokeAsap && !timer && fn.apply(ctx, args);
30  
-
31  
-  			clearTimeout(timer);
32  
-
33  
-  			timer = setTimeout(function() {
34  
-  				!invokeAsap && fn.apply(ctx, args);
35  
-  				timer = null;
36  
-  			}, timeout);
37  
-
38  
-  		};
39  
-
40  
-  	},
41  
-
42  
-  	throttle : function(fn, timeout, ctx) {
43  
-
44  
-  		var timer, args, needInvoke;
45  
-
46  
-  		return function() {
47  
-
48  
-  			args = arguments;
49  
-  			needInvoke = true;
50  
-  			ctx = ctx || this;
51  
-
52  
-  			if(!timer) {
53  
-  				(function() {
54  
-  					if(needInvoke) {
55  
-  						fn.apply(ctx, args);
56  
-  						needInvoke = false;
57  
-  						timer = setTimeout(arguments.callee, timeout);
58  
-  					}
59  
-  					else {
60  
-  						timer = null;
61  
-  					}
62  
-  				})();
63  
-  			}
64  
-
65  
-  		};
66  
-
67  
-  	}
68  
-
  28
+  
  29
+       invokeAsap && !timer && fn.apply(ctx, args);
  30
+  
  31
+       clearTimeout(timer);
  32
+  
  33
+       timer = setTimeout(function() {
  34
+         !invokeAsap && fn.apply(ctx, args);
  35
+         timer = null;
  36
+       }, timeout);
  37
+  
  38
+     };
  39
+  
  40
+   },
  41
+  
  42
+   throttle : function(fn, timeout, ctx) {
  43
+  
  44
+     var timer, args, needInvoke;
  45
+  
  46
+     return function() {
  47
+  
  48
+       args = arguments;
  49
+       needInvoke = true;
  50
+       ctx = ctx || this;
  51
+  
  52
+       if(!timer) {
  53
+         (function() {
  54
+           if(needInvoke) {
  55
+             fn.apply(ctx, args);
  56
+             needInvoke = false;
  57
+             timer = setTimeout(arguments.callee, timeout);
  58
+           }
  59
+           else {
  60
+             timer = null;
  61
+           }
  62
+         })();
  63
+       }
  64
+  
  65
+     };
  66
+  
  67
+   }
  68
+  
69 69
   });
70  
-
  70
+             
71 71
 })(Zepto);                    
10  js/user.js
@@ -32,7 +32,7 @@ this.user = (function() {
32 32
         status = 'no_user'
33 33
       }
34 34
       
35  
-      if(callback && typeof callback === "function") {
  35
+      if($.isFunction(callback)) {
36 36
         callback(status);
37 37
       }
38 38
     })
@@ -88,7 +88,7 @@ this.user = (function() {
88 88
     $.extend(insert,data);
89 89
     
90 90
     model.set(insert,'user',function() {
91  
-      if(callback && typeof callback === "function") {
  91
+      if($.isFunction(callback)) {
92 92
         callback();
93 93
       }
94 94
     }) 
@@ -102,14 +102,14 @@ this.user = (function() {
102 102
         model.get(1,'user',function(datadb) {
103 103
           $.extend(datadb,resp);
104 104
           model.set(datadb,'user',function() {
105  
-            if(callback && typeof callback === "function") {
  105
+            if($.isFunction(callback)) {
106 106
               callback(true);
107 107
             }            
108 108
           })
109 109
         });
110 110
       }
111 111
       else {
112  
-        if(callback && typeof callback === "function") {
  112
+        if($.isFunction(callback)) {
113 113
           callback(false);
114 114
         }        
115 115
       }
@@ -136,7 +136,7 @@ this.user = (function() {
136 136
         model.get(1,'user',function(datadb) {
137 137
           $.extend(datadb,option);
138 138
           model.set(datadb,'user', function() {
139  
-            if(callback && typeof callback === "function") {
  139
+            if($.isFunction(callback)) {
140 140
               callback(resp);
141 141
             }          
142 142
           })          
5  style/app.css
@@ -24,6 +24,11 @@ img[alt="placeholder"] {
24 24
   background-size: 100% 100%;
25 25
   font-size: 0; }
26 26
 
  27
+/* Progress Bar */
  28
+p[role="status"] {
  29
+  text-align: center;
  30
+  display: none; }
  31
+
27 32
 /* View */
28 33
 .view, .cache {
29 34
   position: fixed;
6  style/app.scss
@@ -34,6 +34,12 @@ img {
34 34
   }
35 35
 }
36 36
 
  37
+/* Progress Bar */
  38
+p[role="status"] {
  39
+  text-align: center;
  40
+  display: none;
  41
+}
  42
+
37 43
 /* View */
38 44
 .view,.cache {
39 45
   position: fixed;

No commit comments for this range

Something went wrong with that request. Please try again.