Changeset 293

Show
Ignore:
Timestamp:
04/04/08 11:25:30 (6 months ago)
Author:
justin
Message:

removing unused tabs, adding docs, fixing request params

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • incubator/vasco/files/css/style.css

    r288 r293  
    267267        padding: 0; 
    268268} 
     269 
     270 
     271/**** Documentation ***/ 
     272.docs { 
     273  border: solid 1px gray; 
     274  background-color: khaki; 
     275  font-size: 1.5em; 
     276} 
  • incubator/vasco/files/index.html

    r288 r293  
    3838<ul> 
    3939<li><a href="#" id="routes" class="tab current">routes</a></li> 
    40 <li><a href="#" id="controllers" class="tab">controllers</a></li> 
    4140<li><a href="#" id="docs" class="tab">docs</a></li> 
    42 <li><a href="#" id="contact" class="tab">contact</a></li> 
    4341</ul> 
    4442</div> 
     
    5957  </div> 
    6058</div> 
    61 <div id="controllers_content" style="display:none;"  class="content_panel"> 
    62   <h1>CONTROLLERS</h1> 
    63 </div> 
    6459<div id="docs_content" style="display:none;"  class="content_panel"> 
    6560  <h1>DOCS</h1> 
    66 </div> 
    67 <div id="contact_content" style="display:none;"  class="content_panel"> 
    68   <h1>CONTACT</h1> 
     61  <div class="docs"> 
     62    <pre> 
     63  Vasco 
     64  ===== 
     65 
     66  Vasco is a simple UI for exploring the RESTful routes configured for your application.   
     67  To install the plugin: 
     68 
     69  > script/plugin install http://XXX.XXX.XXX/XXX/XXX 
     70 
     71  After installation, the plugin will create a folder in your  
     72  application's /public directory called vasco.  Before you can use  
     73  the UI, you have to seed it with your application's current data.  
     74  (It helps if you run rake db:fixtures:load first so that Vasco can suggest IDs for you.) 
     75 
     76  > rake vasco:explore 
     77 
     78  To use the route explorer, start up your application and point  
     79  your browser to: 
     80 
     81  http://localhost:3000/vasco 
     82 
     83  From here, you will be provided with links to all registered  
     84  RESTful routes.  You can perform GETs, POSTs, PUTs and DELETEs.   
     85  The UI will know not only the routes, but the schema for each  
     86  model in your application.  If there is a standard Rails configuration  
     87  linking a controller to a model, the UI will present you with a  
     88  form you can use to fill out model details for POSTs and PUTs,  
     89  and will even provide default IDs if you have seeded the database  
     90  with fixture data already. 
     91 
     92 
     93 
     94  Copyright (c) 2008 Relevance, Inc., released under the MIT license 
     95  </pre> 
     96  </div> 
    6997</div> 
    7098 
  • incubator/vasco/files/js/extensions.js

    r288 r293  
    5555Rest.Request = Class.create({ 
    5656  initialize: function(url, options) { 
    57     default_options = Rest.Request.defaultOptions
     57    default_options = Object.extend({}, Rest.Request.defaultOptions)
    5858    final_options = Object.extend(default_options, options);                         
    5959    console.log(url); 
  • incubator/vasco/files/js/vasco.js

    r288 r293  
    11Event.observe(window, 'load', function() { 
    22  new Vasco.RoutesTable(); 
    3   new Vasco.ControllerList();   
    43  new Vasco.Tabs(".tab", ".content_panel"); 
    54}); 
    65 
    7 Object.extend(Rest.Request, { 
    8   defaultOptions: {method: "GET",  
     6Object.extend(Rest.Request.defaultOptions, {method: "GET",  
    97                     onComplete: function(xhr) { 
    108                          $('request').innerHTML = createXhrRequestString(xhr.request); 
     
    1614                     onFailure: function(xhr) { 
    1715                          $('response').innerHTML = "<h2>FAILURE</h2>" + xhr.responseText.escapeHTML(); 
    18                      }} 
     16                     } 
    1917}); 
    2018 
     
    5048}); 
    5149 
    52  
    53 Vasco.ControllerList = Class.create({ 
    54   initialize: function() { 
    55     results = "<ul>"; 
    56       vascoControllers.each(function(controller) { 
    57         results += "<li>" + controller + "</li>"; 
    58       }); 
    59     results += "</ul>"; 
    60     $('controllers_content').innerHTML = results;     
    61   } 
    62 }); 
    6350 
    6451Vasco.RouteLink = Class.create({ 
     
    127114  form += "</table></form>"; 
    128115  Dialog.confirm("Update with: " + form,  
    129                   {className: "alphacube", width:500, height:500, okLabel: "close",  
     116                  {className: "alphacube", width:500, height:500, okLabel: "commit",  
    130117                          ok:function(win) { 
    131118                              new Rest.Create("http://localhost:3000" + $('url_from_win').value + ".xml", {postBody: formToXML('form_from_window', $('type_from_window').value)}); 
     
    145132  });  
    146133  form += "</table></form>"; 
    147   Dialog.confirm("Update with: " + form, {className: "alphacube", width:500, height:500, okLabel: "close", ok:function(win) { 
     134  Dialog.confirm("Update with: " + form, {className: "alphacube", width:500, height:500, okLabel: "commit", ok:function(win) { 
    148135      new Rest.Update("http://localhost:3000" + $('url_from_win').value.replace(":id", $('id').value) + ".xml", {postBody: formToXML('form_from_window', $('type_from_window').value)}); 
    149136      return true;  
     
    153140 
    154141function getIdFromWindow(route_url, suggested_match) { 
    155   Dialog.confirm("ID to try: <input type='text' id='id_from_win' value='" + suggested_match + "'/><input type='hidden' id='url_from_win' value='" + route_url + "'/>", {className: "alphacube", width:300, height:100, okLabel: "close", ok:function(win) { 
     142  Dialog.confirm("ID to try: <input type='text' id='id_from_win' value='" + suggested_match + "'/><input type='hidden' id='url_from_win' value='" + route_url + "'/>", {className: "alphacube", width:300, height:100, okLabel: "commit", ok:function(win) { 
    156143      new Rest.Request("http://localhost:3000" + $('url_from_win').value.replace(":id", $('id_from_win').value) + ".xml"); 
    157144      return true; 
     
    160147 
    161148function deleteIdFromWindow(route_url, suggested_match) { 
    162     Dialog.confirm("ID to try: <input type='text' id='id_from_win' value='" + suggested_match + "'/><input type='hidden' id='url_from_win' value='" + route_url + "'/>", {className: "alphacube", width:300, height:100, okLabel: "close", ok:function(win) { 
     149    Dialog.confirm("ID to try: <input type='text' id='id_from_win' value='" + suggested_match + "'/><input type='hidden' id='url_from_win' value='" + route_url + "'/>", {className: "alphacube", width:300, height:100, okLabel: "commit", ok:function(win) { 
    163150      new Rest.Delete("http://localhost:3000" + $('url_from_win').value.replace(":id", $('id_from_win').value) + ".xml"); 
    164151      return true;