script_parameter = { root : '../jaxrs/script', list_action : null, list_action_parameter : null, first : '(0)', last : '(0)', count : 20, application : null }; function script_list_reload() { if (script_parameter.list_action) { script_parameter.list_action.call(window, script_parameter.list_action_parameter); } else { script_list_next('(0)'); } } function script_list_next(id) { var id = (id ? id : script_parameter.last); script_parameter.list_action = script_list_next; script_parameter.list_action_parameter = id; $.ajax({ type : 'get', dataType : 'json', url : script_parameter.root + '/list/' + id + '/next/' + script_parameter.count, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { if (data.data.length > 0) { script_parameter.first = data.data[0].id; script_parameter.last = data.data[data.data.length - 1].id; } else { script_parameter.first = '(0)'; } $('#content').html(script_list_grid(data.data)); $('#total', '#content').html(data.count); script_list_init(); } else { failure(data); } }); } function script_list_prev(id) { var id = (id ? id : script_parameter.first); script_parameter.list_action = script_list_prev; script_parameter.list_action_parameter = id; $.ajax({ type : 'get', dataType : 'json', url : script_parameter.root + '/list/' + id + '/prev/' + script_parameter.count, xhrFields : { 'withCredentials' : true }, crossDomain : true }).done(function(data) { if (data.type == 'success') { if (data.data.length > 0) { script_parameter.first = data.data[0].id; script_parameter.last = data.data[data.data.length - 1].id; } else { script_parameter.last = '(0)'; } $('#content').html(script_list_grid(data.data)); $('#total', '#content').html(data.count); script_list_init(); } else { failure(data); } }); } function script_list_grid(items) { var str = ''; str += ''; str += ''; $.each(items, function(index, item) { str += ''; str += ''; str += ''; str += ''; str += ''; str += ''; }); str += '
  0
idnameapplicationoperate
' + item.id + '' + item.name + '' + item.application + ''; str += 'edit '; str += 'delete'; str += '
'; return str; } function script_list_init() { $('#next', '#content').click(function() { script_list_next(); }); $('#prev', '#content').click(function() { script_list_prev(); }); } function script_query() { var str = ''; str += ''; str += ''; str += ''; str += '
application id:
script name:
 
'; $('#content').html(str); $('#listWithApplication', '#content').click(function() { script_parameter.application = $('#application', '#content').val(); script_listWithApplication($('#application', '#content').val()); }); $('#getWithName', '#content').click(function() { script_parameter.application = $('#application', '#content').val(); script_getWithName($('#application', '#content').val(), $('#name', '#content').val()); }); } function script_create() { str = ''; str += ''; str += ''; str += ''; str += ''; str += '
post
application:
name:
alias:
description: