Changeset 25394 for trunk/tools


Ignore:
Timestamp:
Nov 8, 2013, 1:16:14 PM (10 years ago)
Author:
mistic100
Message:

Improve display on ws.htm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/ws.htm

    r25077 r25394  
    11<!DOCTYPE html>
    2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">
     2<html lang="en" dir="ltr">
    33<head>
    4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     4  <meta charset="utf-8">
    55  <title>Piwigo web API (web-services) explorer</title>
    66 
    7   <link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/tiptip/1.3/tipTip.css">
    8  
    9   <style type="text/css">
     7  <link rel="stylesheet" href="http://cdn.jsdelivr.net/tiptip/1.3/tipTip.css">
     8 
     9  <style>
    1010  /* BEGIN CSS RESET
    1111    http://meyerweb.com/eric/tools/css/reset
     
    6161  #the_content {padding:10px;}
    6262
    63   #methodParams {display:inline-block;}
     63  #methodParams {margin-right:230px;}
    6464  #methodParams thead td {background:#DEE3E9;font-weight:bold;padding:2px 5px;}
    6565  #methodParams td {padding:2px;border:1px solid #cdcdcd;vertical-align:middle;}
     
    7474  #methodParams .subtype {vertical-align:super;}
    7575
    76   #testForm {display:inline-block;margin-left:15px;}
     76  #testForm {float:right;}
    7777  #testForm td {padding:2px 0;}
    7878  #testForm tr:last-child td {padding:8px 0 5px 0;}
     
    9494  #iframeWrapper {width:100%;height:300px;padding:3px 3px 20px 3px;background:#F9F9F9;border:1px solid #cdcdcd;overflow:hidden;position:relative;}
    9595  iframe {width:100%;height:100%;background:#fff;}
     96 
     97  div.onlys {background:#faa;color:#fff;border:1px solid #f22;padding:.25em .5em;display:table;border-radius:4px;margin-bottom:0.5em;}
    9698  </style>
    9799 
     
    99101
    100102<body>
     103<a name="top"></a>
    101104
    102105<div id="the_header">
     
    151154        <br>
    152155      </div> <!-- methodDescription -->
     156     
     157      <div id="testForm">
     158        <h3>Test</h3>
     159        <blockquote>
     160          <table>
     161            <tr>
     162              <td>Request format :</td>
     163              <td>
     164                <select id="requestFormat">
     165                  <option value="get" selected>GET</option>
     166                  <option value="post">POST</option>
     167                </select>
     168              </td>
     169            </tr>
     170            <tr>
     171              <td>Response format :</td>
     172              <td>
     173                <select id="responseFormat">
     174                  <option value="rest" selected>REST (xml)</option>
     175                  <option value="json">JSON</option>
     176                  <option value="php">PHP serial</option>
     177                  <option value="xmlrpc">XML RPC</option>
     178                </select>
     179              </td>
     180            </tr>
     181            <tr>
     182              <td colspan="2">
     183                <a href="#" class="button" id="invokeMethod">INVOKE</a>
     184                <a href="#" class="button" id="invokeMethodBlank">INVOKE (new window)</a>
     185              </td>
     186            </tr>
     187          </table>
     188        </blockquote>
     189      </div> <!-- testForm -->
    153190     
    154191      <div id="methodParams">
     
    179216      </div> <!-- methodParams -->
    180217     
    181       <div id="testForm">
    182         <h3>Test</h3>
    183         <blockquote>
    184           <table>
    185             <tr>
    186               <td>Request format :</td>
    187               <td>
    188                 <select id="requestFormat">
    189                   <option value="get" selected="selected">GET</option>
    190                   <option value="post">POST</option>
    191                 </select>
    192               </td>
    193             </tr>
    194             <tr>
    195               <td>Response format :</td>
    196               <td>
    197                 <select id="responseFormat">
    198                   <option value="rest" selected="selected">REST (xml)</option>
    199                   <option value="json">JSON</option>
    200                   <option value="php">PHP serial</option>
    201                   <option value="xmlrpc">XML RPC</option>
    202                 </select>
    203               </td>
    204             </tr>
    205             <tr>
    206               <td colspan="2">
    207                 <a href="#" class="button" id="invokeMethod">INVOKE</a>
    208                 <a href="#" class="button" id="invokeMethodBlank">INVOKE (new window)</a>
    209               </td>
    210             </tr>
    211           </table>
    212         </blockquote>
    213       </div> <!-- testForm -->
    214      
    215218      <br><br>
    216219     
     
    218221      <div id="iframeWrapper">
    219222        <iframe src="" id="invokeFrame" name="invokeFrame"></iframe>
    220         <a href="#bottom" id="increaseIframe"><b>&darr;</b> increase height</a> &#8226; <a href="#bottom" id="decreaseIframe"><b>&uarr;</b> decrease height</a>
    221         <a name="bottom"></a>
     223        <a href="#iframe-bottom" id="increaseIframe"><b>&darr;</b> increase height</a> &#8226;
     224        <a href="#iframe-bottom" id="decreaseIframe"><b>&uarr;</b> decrease height</a>
     225        <a name="iframe-bottom"></a>
    222226      </div>
    223227    </form> <!-- iframeWrapper -->
     
    234238</div> <!-- the_footer -->
    235239
    236 <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    237 <script type="text/javascript" src="https://cdn.jsdelivr.net/tiptip/1.3/jquery.tipTip.minified.js"></script>
    238 
    239 <script type="text/javascript"
     240<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
     241<script src="https://cdn.jsdelivr.net/tiptip/1.3/jquery.tipTip.minified.js"></script>
     242
     243<script
    240244// global vars
    241245var cachedMethods = new Array;
     
    287291  $("#methodName").hide();
    288292  $("#urlForm").hide();
     293  $("#methodDescription blockquote").empty();
    289294  $("#methodDescription").hide();
    290295  $("#invokeFrame").attr('src','');
     
    353358      for (var i=0; i<methods.length; i++)
    354359      {
    355         ml += '<li><a href="#">'+ methods[i]+'</a></li>';
     360        ml += '<li><a href="#top">'+ methods[i]+'</a></li>';
    356361      }
    357362      $("#methodsList").html(ml).show();
     
    362367      $("#methodsList li a").click(function() {
    363368        selectMethod($(this).html());
    364         return false;
    365369      });
    366370    }
     
    404408  $("#methodName").html(method.name).show();
    405409 
     410  if (method.options.post_only || method.options.admin_only) {
     411    var onlys = '<div class="onlys">';
     412    if (method.options.post_only) {
     413      onlys+= 'POST only. ';
     414    }
     415    if (method.options.admin_only) {
     416      onlys+= 'Admin only. ';
     417    }
     418    onlys+= '</div>';
     419   
     420    method.description = onlys + method.description;
     421  }
     422 
    406423  if (method.description != "") {
    407424    $("#methodDescription blockquote").html(method.description);
    408425    $("#methodDescription").show();
    409426  }
     427 
     428  $("#requestFormat").val(method.options.post_only ? 'post' : 'get');
    410429 
    411430  var methodParams = '';
Note: See TracChangeset for help on using the changeset viewer.