Sha256: 563e038207ac6f08a65b16ec4a58ee221f2054bc79dea7fe8d7733b63f1e90dc

Contents?: true

Size: 1.87 KB

Versions: 4

Compression:

Stored size: 1.87 KB

Contents

<script type="text/javascript" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/" py:strip="">
$(document).ready(function() {
    var reportMethod = $('td.ticket'); //used in Trac reports
    var queryMethod = $('td.id');      //used in custom queries
    var xmlrpcPath = null;
    var elements   = null;
    if ( reportMethod.length != 0 ) {
      elements   = reportMethod;
      xmlrpcPath = '../xmlrpc';
    } else if ( queryMethod.length != 0 ) {
      elements   = queryMethod;
      xmlrpcPath = 'xmlrpc';
    }
    if ( elements != null ) {
      ids = elements.each(function(i) {
        var id = jQuery.trim($(this).text()).substr(1);
       	var estimationField = '$data.field';

	   	var estimationCell = $('td.' + estimationField).eq(i);

	   	estimationCell.editable(function(value, settings) {
        var currentElement = this;
        $.ajax({
        	type: 'POST',
        	url: xmlrpcPath,
          	data: '<methodCall><methodName>ticket.update</methodName>' +
       	 	'<params><param><value><int>' + id + '</int></value></param>' +
       	   	'<param><value><string></string></value></param>' +
       	   	'<param><value><struct><member><name>' + estimationField + '</name>' +
       	   	'<value><string>' + value + '</string></value></member></struct></value></param>' +
       	   	'</params></methodCall>',
          	contentType: 'text/xml',
          	success: function(){
            	$(currentElement).text(value);
          }
         });
         return('Saving...');
       }, {
    	 data : jQuery.trim(estimationCell.text()),
         tooltip   : 'Click to edit...',
         placeholder: '',
         onblur : 'submit',
         select : 'true',
         style : 'inherit',
         width     : 60
       }); 
    });
    }
 });
 </script>
 

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keithsalisbury-subtrac-0.1.1 lib/subtrac/trac-plugins/estimationtoolsplugin/estimationtools/templates/edithours.html
keithsalisbury-subtrac-0.1.2 lib/subtrac/trac-plugins/estimationtoolsplugin/estimationtools/templates/edithours.html
keithsalisbury-subtrac-0.1.3 lib/subtrac/trac-plugins/estimationtoolsplugin/estimationtools/templates/edithours.html
keithsalisbury-subtrac-0.1.4 lib/subtrac/trac-plugins/estimationtoolsplugin/estimationtools/templates/edithours.html