Sha256: da87fe2c704fd4b440d92e99287e36fbe0ca0bf340a07d0e39944047dc3d252e

Contents?: true

Size: 772 Bytes

Versions: 1

Compression:

Stored size: 772 Bytes

Contents

$(document).ready(function(){
  $('input#newparam').click( function() {
    addParam($('table.parameters'));
  });

  // activate the current tab  
  $('a[href="'+window.location.pathname+'"]').parent().addClass("ui-tabs-selected ui-state-active");
});

function addParam(table) {
  param = prompt('Enter the name of the new parameter','ParamName');
  if (param != null && param != "") {
    if ($('input#param_' + param).length == 0) {
      label='<label for="param_' + param +'">' + param + '</label>'
      input='<input type="text" class="value" size="100" name="param_' + param + '" id="param_' + param + '" value="">'
      table.append('<tr class="unsaved"><td>' + label + '</td><td>' + input + '</td></tr>');
      $('input#param_' + param).focus();
    }
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arnold-0.0.1 public/scripts.js