| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634 |
- meeting_parameter = {
- first : '(0)',
- last : '(0)',
- count : 20
- };
- function meeting_list_next(id) {
- $('#result').html('');
- var id = (id ? id : meeting_parameter.last);
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/' + id + '/next/' + meeting_parameter.count,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- if (json.type == 'success') {
- if (json.data.length > 0) {
- meeting_parameter.first = json.data[0].id;
- meeting_parameter.last = json.data[json.data.length - 1].id;
- } else {
- meeting_parameter.first = '(0)';
- }
- meeting_grid(json.data);
- } else {
- failure(data);
- }
- });
- }
- function meeting_list_prev(id) {
- $('#result').html('');
- var id = (id ? id : meeting_parameter.first);
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/' + id + '/prev/' + meeting_parameter.count,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- if (json.type == 'success') {
- if (json.data.length > 0) {
- meeting_parameter.first = json.data[0].id;
- meeting_parameter.last = json.data[json.data.length - 1].id;
- } else {
- meeting_parameter.last = '(0)';
- }
- meeting_grid(json.data);
- } else {
- failure(data);
- }
- });
- }
- function meeting_grid(items) {
- var str = '<table border="1" width="100%"><tobdy>';
- str += '<tr><th>rank</th><th>id</th><th>subject</th><th>confirmStatus</th><th>manualCompleted</th></tr>';
- if (items) {
- $.each(items, function(index, item) {
- str += '<tr>';
- str += '<td>' + item.rank + '</td>';
- str += '<td>' + item.id + '</td>';
- str += '<td>' + item.subject + '</td>';
- str += '<td>' + item.confirmStatus + '</td>';
- str += '<td>' + item.manualCompleted + '</td>';
- str += '</tr>';
- });
- }
- str += '</tobdy></table>';
- $('#content').html(str);
- }
- function meeting_list_waitConfirm() {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/wait/confirm',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_listOnMonth_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="list">list</a></td></tr>';
- str += '<tr><td>year:</td><td><input type="text" id="year" style="width:95%"/></td></tr>';
- str += '<tr><td>month:</td><td><input type="text" id="month" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#list').click(function() {
- meeting_listOnMonth($('#year').val(), $('#month').val());
- });
- }
- function meeting_listOnMonth(year, month) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/year/' + year + '/month/' + month,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_listOnDay_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="list">list</a></td></tr>';
- str += '<tr><td>year:</td><td><input type="text" id="year" style="width:95%"/></td></tr>';
- str += '<tr><td>month:</td><td><input type="text" id="month" style="width:95%"/></td></tr>';
- str += '<tr><td>day:</td><td><input type="text" id="day" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#list').click(function() {
- meeting_listOnDay($('#year').val(), $('#month').val(), $('#day').val());
- });
- }
- function meeting_listOnDay(year, month, day) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/year/' + year + '/month/' + month + '/day/' + day,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_get_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="get">get</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#get').click(function() {
- meeting_get($('#id').val());
- });
- }
- function meeting_get(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_post_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"><a href="#" id="post">post</a></td></tr>';
- str += '<tr><td>room:</td><td><input type="text" id="room" style="width:95%"/></td></tr>';
- str += '<tr><td>subject:</td><td><input type="text" id="subject" style="width:95%"/></td></tr>';
- str += '<tr><td>description:</td><td><input type="text" id="description" style="width:95%"/></td></tr>';
- str += '<tr><td>startTime:</td><td><input type="text" id="startTime" style="width:95%"/></td></tr>';
- str += '<tr><td>completedTime:</td><td><input type="text" id="completedTime" style="width:95%"/></td></tr>';
- str += '<tr><td>invitePersonList:</td><td><textarea id="invitePersonList" style="width:95%"/></td></tr>';
- str += '<tr><td>memo:</td><td><textarea id="memo" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#post').click(function() {
- meeting_post();
- });
- }
- function meeting_post() {
- $('#result').html('');
- $.ajax({
- type : 'post',
- dataType : 'json',
- url : '../jaxrs/meeting',
- contentType : 'application/json; charset=utf-8',
- data : JSON.stringify({
- room : $('#room').val(),
- subject : $('#subject').val(),
- description : $('#description').val(),
- startTime : $('#startTime').val(),
- completedTime : $('#completedTime').val(),
- memo : $('#memo').val(),
- invitePersonList : splitValue($('#invitePersonList').val())
- }),
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_put_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="put">put</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#put').click(function() {
- meeting_put_init($('#id').val());
- });
- }
- function meeting_put_init(id) {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"><a href="#" id="put">put</a></td></tr>';
- str += '<tr><td>id:</td><td id="id"></td></tr>';
- str += '<tr><td>applicant:</td><td id="applicant"></td></tr>';
- str += '<tr><td>room:</td><td><input type="text" id="room" style="width:95%"/></td></tr>';
- str += '<tr><td>subject:</td><td><input type="text" id="subject" style="width:95%"/></td></tr>';
- str += '<tr><td>description:</td><td><input type="text" id="description" style="width:95%"/></td></tr>';
- str += '<tr><td>startTime:</td><td><input type="text" id="startTime" style="width:95%"/></td></tr>';
- str += '<tr><td>completedTime:</td><td><input type="text" id="completedTime" style="width:95%"/></td></tr>';
- str += '<tr><td>invitePersonList:</td><td><textarea id="invitePersonList" style="width:95%"/></td></tr>';
- str += '<tr><td>acceptPersonList:</td><td><textarea id="acceptPersonList" style="width:95%"/></td></tr>';
- str += '<tr><td>rejectPersonList:</td><td><textarea id="rejectPersonList" style="width:95%"/></td></tr>';
- str += '<tr><td>memo:</td><td><textarea id="memo" style="width:95%"/></td></tr>';
- str += '<tr><td>confirmStatus:</td><td><select id="confirmStatus"><option value="wait">wait</option><option value="allow">allow</option><option value="deny">deny</option></select></td></tr>';
- str += '<tr><td>manualCompleted:</td><td><select id="manualCompleted"><option value="true">true</option><option value="false">false</option></select></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#put').click(function() {
- meeting_put(id);
- });
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- if (json.type == 'success') {
- $('#id').html(json.data.id);
- $('#applicant').html(json.data.applicant);
- $('#room').val(json.data.room);
- $('#subject').val(json.data.subject);
- $('#description').val(json.data.description);
- $('#startTime').val(json.data.startTime);
- $('#completedTime').val(json.data.completedTime);
- $('#invitePersonList').val(joinValue(json.data.invitePersonList));
- $('#acceptPersonList').val(joinValue(json.data.acceptPersonList));
- $('#rejectPersonList').val(joinValue(json.data.rejectPersonList));
- $('#memo').val(joinValue(json.data.memo));
- $('#confirmStatus').val(json.data.confirmStatus);
- $('#manualCompleted').val(json.data.manualCompleted + '');
- }
- });
- }
- function meeting_put(id) {
- $('#result').html('');
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/room/' + id,
- contentType : 'application/json; charset=utf-8',
- data : JSON.stringify({
- room : $('#room').val(),
- subject : $('#subject').val(),
- description : $('#description').val(),
- startTime : $('#startTime').val(),
- completedTime : $('#completedTime').val(),
- invitePersonList : splitValue($('#invitePersonList').val()),
- acceptPersonList : splitValue($('#acceptPersonList').val()),
- rejectPersonList : splitValue($('#rejectPersonList').val()),
- memo : $('#memo').val(),
- confirmStatus : $('#confirmStatus').val(),
- manualCompleted : $('#manualCompleted').val()
- }),
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_delete_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="delete">delete</a></td></tr>';
- str += '<tr><td>delete id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#delete').click(function() {
- meeting_delete($('#id').val());
- });
- }
- function meeting_delete(id) {
- $('#result').html('');
- $.ajax({
- type : 'delete',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_confirm_allow_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="allow">allow</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#allow').click(function() {
- meeting_confirm_allow($('#id').val());
- });
- }
- function meeting_confirm_allow(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/confirm/allow',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_confirm_deny_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="deny">deny</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#deny').click(function() {
- meeting_confirm_deny($('#id').val());
- });
- }
- function meeting_confirm_deny(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/confirm/deny',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_accept_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="accept">accept</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#accept').click(function() {
- meeting_accept($('#id').val());
- });
- }
- function meeting_accept(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/accept',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_reject_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="reject">reject</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#reject').click(function() {
- meeting_reject($('#id').val());
- });
- }
- function meeting_reject(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/reject',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_manualCompleted_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="completed">completed</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#completed').click(function() {
- meeting_manualCompleted($('#id').val());
- });
- }
- function meeting_manualCompleted(id) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/manual/completed',
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_addInvite_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="add">add</a></td></tr>';
- str += '<tr><td>id:</td><td><input type="text" id="id" style="width:95%"/></td></tr>';
- str += '<tr><td>invitePersonList:</td><td><textarea type="text" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#add').click(function() {
- meeting_addInvite($('#id').val());
- });
- }
- function meeting_addInvite(id) {
- $('#result').html('');
- $.ajax({
- type : 'put',
- dataType : 'json',
- url : '../jaxrs/meeting/' + id + '/add/invite',
- xhrFields : {
- 'withCredentials' : true
- },
- data : JSON.stringify({
- invitePersonList : splitValue($('#invitePersonList').val())
- }),
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- });
- }
- function meeting_listComingMonth_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="list">list</a></td></tr>';
- str += '<tr><td>count:</td><td><input type="count" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#list').click(function() {
- meeting_listComingMonth($('#count').val());
- });
- }
- function meeting_listComingMonth(count) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/coming/month/' + count,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_listComingDay_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2"> <a href="#" id="list">list</a></td></tr>';
- str += '<tr><td>count:</td><td><input type="count" id="id" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#list').click(function() {
- meeting_listComingDay($('#count').val());
- });
- }
- function meeting_listComingDay(count) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/coming/day/' + count,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_search_select() {
- $('#result').html('');
- var str = '<table border="1" width="100%">';
- str += '<tr><td colspan="2">';
- str += '<a href="#" id="listPinyinInitial">listPinyinInitial</a>';
- str += ' ';
- str += '<a href="#" id="listLike">listLike</a>';
- str += ' ';
- str += '<a href="#" id="listLikePinyin">listLikePinyin</a>';
- str += '</td></tr>';
- str += '<tr><td>key:</td><td><input type="text" id="key" style="width:95%"/></td></tr>';
- str += '</table>';
- $('#content').html(str);
- $('#listPinyinInitial').click(function() {
- meeting_listPinyinInitial($('#key').val());
- });
- $('#listLike').click(function() {
- meeting_listLike($('#key').val());
- });
- $('#listLikePinyin').click(function() {
- meeting_listLikePinyin($('#key').val());
- });
- }
- function meeting_listPinyinInitial(key) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/pinyininitial/' + key,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_listLike(key) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/like/' + key,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
- function meeting_listLikePinyin(key) {
- $('#result').html('');
- $.ajax({
- type : 'get',
- dataType : 'json',
- url : '../jaxrs/meeting/list/like/pinyin/' + key,
- xhrFields : {
- 'withCredentials' : true
- },
- crossDomain : true
- }).done(function(json) {
- $('#result').html(JSON.stringify(json, null, 4));
- meeting_grid(json.data);
- });
- }
|