Commits

Anonymous committed 51100ff

demo fixes for HTSQL 1.0

  • Participants
  • Parent commits e0178be

Comments (0)

Files changed (3)

htraf/examples10/basic/htsql_files.html

     <select id="school" data-htsql="school.htsql"></select>
     <h3>Departments</h3>
     <p>Filter By Name <input id="department_name"/></p>
-    <table id="department" data-htsql="department.htsql?
-                        school=$school&department_name=$department_name">
+    <table id="department" data-htsql="department.htsql"
+           data-ref="school department_name">
     </table>
     <p>
         Selected Department: 
-        <em data-htsql="department_name.htsql?department=$department"></em> 
+        <em data-htsql="department_name.htsql" data-ref="department"></em> 
         <br/>
 
         Count of Courses in Selected Department: 
-        <strong data-htsql="count_course.htsql?department=$department">
+        <strong data-htsql="count_course.htsql" data-ref="department">
         </strong>
     </p>
-    <table id="course" data-htsql="course.htsql?department=$department">
+    <table id="course" data-htsql="course.htsql" data-ref="department">
     </table>
 </body>
 </html>

htraf/examples10/basic/index.html

     <p>Filter By Name <input id="department_name"/></p>
     <table id="department"
         data-htsql="/department{code, name, school.name}
-                     ?school=$school&name~$department_name">
+                   ?school=$school&name~$department_name"
+        data-ref="school department_name">
     </table>
     <p>
         <span>Selected Department: </span>
-        <em data-htsql="/department{name}?code=$department"></em> <br/>
+        <em data-htsql="/department{name}?code=$department"
+            data-ref="department"></em> <br/>
 
         <span>Count of Courses in Selected Department: </span>
-        <strong data-htsql="/department{count(course)}?code=$department">
+        <strong data-htsql="/department{count(course)}?code=$department"
+                data-ref="department">
         </strong>
     </p>
-    <table id="course" data-htsql="/course?department=$department">
+    <table id="course" data-htsql="/course?department=$department"
+           data-ref="department">
     </table>
 </body>
 </html>

htraf/js/htraf.widgets.js

 }
 
 function isHtsqlResource(url) {
-    return url.match(/\.htsql$/);
+    return url.match(/\.htsql$/) ? true:false;
 }
 
 var $hidden = null;
         this.assert(url, "Cannot load: URL is undefined");
 
         var vars = this.getVars(), h;
-        if(h = isHtsqlResource(url))
-            url = h[1] + '?' + (formatter ? 'format=' + formatter + '&':'') 
+        if(isHtsqlResource(url))
+            url = url + '?' + (formatter ? 'format=' + formatter + '&':'') 
                    + varsToQS(vars);
         else {
             if(url.substr(url.length - 1, 1) != '/' && formatter