Changeset 20750


Ignore:
Timestamp:
02/13/13 20:26:34 (7 years ago)
Author:
mistic100
Message:

feature:2847 Display additional info for API methods fields

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_core.inc.php

    r19703 r20750  
    573573        $param_data['defaultValue'] = $options['default']; 
    574574      } 
     575      if (isset($options['info'])) 
     576      { 
     577        $param_data['info'] = $options['info']; 
     578      } 
    575579      $res['params'][] = $param_data; 
    576580    } 
  • trunk/tools/ws.htm

    r20192 r20750  
    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"> 
    78  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> 
     9  <script type="text/javascript" src="https://cdn.jsdelivr.net/tiptip/1.3/jquery.tipTip.minified.js"></script> 
    810   
    911  <style type="text/css"> 
     
    9294  } 
    9395  a.button:hover {color:#E5FF00;} 
     96   
     97  .methodInfo {float:right;display:inline-block;width:16px;height:16px;font-size:12px;line-height:16px;background:#555;border-radius:8px;font-family:"Times New Roman",sans-serif;font-style:italic;font-weight:bold;text-align:center;color:#fff;} 
     98  .methodInfo:hover {border:none;text-shadow:none;background:#888;cursor:pointer;color:#fff;} 
    9499   
    95100  #iframeWrapper {width:100%;height:300px;padding:3px 3px 20px 3px;background:#F9F9F9;border:1px solid #cdcdcd;overflow:hidden;position:relative;} 
     
    409414      var acceptArray = method.params[i].acceptArray; 
    410415      var defaultValue = method.params[i].defaultValue == null ? '' : method.params[i].defaultValue; 
     416      var info = method.params[i].info == null ? '' : '<a class="methodInfo" title="'+ method.params[i].info + '">i</a>'; 
    411417       
    412418      // if an array is direclty printed, the delimiter is a comma where we use a pipe 
     
    416422 
    417423      methodParams+= '<tr>'+ 
    418         '<td>'+ method.params[i].name +'</td>'+ 
     424        '<td>'+ method.params[i].name + info +'</td>'+ 
    419425        '<td class="mini">'+ (isOptional ? '?':'*') + (acceptArray ? ' []':'') +'</td>'+ 
    420426        '<td class="input"><input type="text" class="methodParameterValue" data-id="'+ i +'" value="'+ defaultValue +'"></td>'+ 
     
    435441  $("input.methodParameterValue").change(function() { 
    436442    $("input.methodParameterSend[data-id='"+ $(this).data('id') +"']").attr('checked', 'checked'); 
     443  }); 
     444   
     445  // tiptip 
     446  $(".methodInfo").tipTip({ 
     447    activation:"click", 
     448    maxWidth:"300px", 
     449    defaultPosition:"right", 
     450    delay:0 
    437451  }); 
    438452} 
Note: See TracChangeset for help on using the changeset viewer.