mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
ToDo List HTML.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4767 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ac24ac91cb
commit
cfe72f0d74
1 changed files with 195 additions and 194 deletions
|
|
@ -1,194 +1,195 @@
|
||||||
function planetTab(){
|
function planetTab(){
|
||||||
if($('planet_tab')) $('planet_tab').innerHTML += '<ul id="planetex_Tab" class="exTab"><li><a id="aa" href="#" onclick="planet_showTodoList(this); return false;">ToDo<sup><span id="planet_todo_count">'+ planet_todo_count.todo + '</span>/<span id="planet_done_count">' + planet_todo_count.done + '</span></sup></a></li>';
|
if($('planet_tab')) $('planet_tab').innerHTML += '<ul id="planetex_Tab" class="exTab"><li><a id="aa" href="#" onclick="planet_showTodoList(this); return false;">ToDo<sup><span id="planet_todo_count">'+ planet_todo_count.todo + '</span>/<span id="planet_done_count">' + planet_todo_count.done + '</span></sup></a></li>';
|
||||||
}
|
}
|
||||||
xAddEventListener(window,'load',planetTab);
|
xAddEventListener(window,'load',planetTab);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function planetTabOff(){
|
function planetTabOff(){
|
||||||
$Element('planetex_Tab').leave();
|
$Element('planetex_Tab').leave();
|
||||||
}
|
}
|
||||||
|
|
||||||
function planet_showTodoList(o){
|
function planet_showTodoList(o){
|
||||||
$ElementList('#planetex_Tab li').removeClass('active');
|
$ElementList('#planetex_Tab li').removeClass('active');
|
||||||
$Element(o).parent().addClass('active');
|
$Element(o).parent().addClass('active');
|
||||||
$ElementList('#planet_myTab li').removeClass('active');
|
$ElementList('#planet_myTab li').removeClass('active');
|
||||||
|
|
||||||
planet_reload_todo();
|
planet_reload_todo();
|
||||||
}
|
}
|
||||||
|
|
||||||
function planet_reload_todo(){
|
function planet_reload_todo(){
|
||||||
$('commentList').innerHTML = '<h3>todo</h3><div id="todoList"></div>\n<div id="todoList_page"></div>\n<h3>done</h3>\n<div id="doneList"></div>\n<div id="doneList_page"></div>\n';
|
$('commentList').innerHTML = '<div class="commentHeader"><h3 class="exTitle">TODO</h3></div>\n<div id="todoList" class="commentBody taskManager"></div>\n<div id="todoList_page" class="pagination a1"></div>\n<div class="commentHeader"><h3 class="exTitle">DONE</h3></div>\n<div id="doneList" class="commentBody taskManager"></div>\n<div id="doneList_page" class="pagination a1"></div>\n<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>\n';
|
||||||
planet_getTodo();
|
planet_getTodo();
|
||||||
planet_getDone();
|
planet_getDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
function planet_getTodo(page){
|
function planet_getTodo(page){
|
||||||
$('todoList').innerHTML ='';
|
$('todoList').innerHTML ='';
|
||||||
_getPlanetTagSeachResult('todo',page,result_planet_getTodo);
|
_getPlanetTagSeachResult('todo',page,result_planet_getTodo);
|
||||||
}
|
}
|
||||||
|
|
||||||
function planet_getDone(page){
|
function planet_getDone(page){
|
||||||
$('doneList').innerHTML ='';
|
$('doneList').innerHTML ='';
|
||||||
_getPlanetTagSeachResult('done',page,result_planet_getDone);
|
_getPlanetTagSeachResult('done',page,result_planet_getDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getPlanetTagSeachResult(tag,page,func){
|
function _getPlanetTagSeachResult(tag,page,func){
|
||||||
var response_tags = new Array('error','message','contentList','pageNavigation');
|
var response_tags = new Array('error','message','contentList','pageNavigation');
|
||||||
exec_xml('planet','dispPlanetContentTagSearch',{keyword:tag,page:page,mid:current_mid},func,response_tags);
|
exec_xml('planet','dispPlanetContentTagSearch',{keyword:tag,page:page,mid:current_mid},func,response_tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
function result_planet_getTodo(ret_obj,response_tags, params, fo_obj) {
|
function result_planet_getTodo(ret_obj,response_tags, params, fo_obj) {
|
||||||
|
|
||||||
if(ret_obj['error'] == 0 && ret_obj.contentList){
|
if(ret_obj['error'] == 0 && ret_obj.contentList){
|
||||||
var o = new Array();
|
var o = new Array();
|
||||||
var it = new Array();
|
var it = new Array();
|
||||||
var items = ret_obj['contentList']['item'];
|
var items = ret_obj['contentList']['item'];
|
||||||
|
|
||||||
if(typeof(items[0]) == 'undefined'){
|
if(typeof(items[0]) == 'undefined'){
|
||||||
it[0] = items;
|
it[0] = items;
|
||||||
}else{
|
}else{
|
||||||
it = items;
|
it = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
o.push('<ul>');
|
o.push('<ul>');
|
||||||
for(var i=0,c=it.length;i<c;i++){
|
for(var i=0,c=it.length;i<c;i++){
|
||||||
|
|
||||||
it[i]['regdate'] += '';
|
it[i]['regdate'] += '';
|
||||||
it[i]['regdate'] = it[i]['regdate'].substr(0,4) + '/' + it[i]['regdate'].substr(4,2) + '/' + it[i]['regdate'].substr(6,2);
|
it[i]['regdate'] = it[i]['regdate'].substr(0,4) + '/' + it[i]['regdate'].substr(4,2) + '/' + it[i]['regdate'].substr(6,2);
|
||||||
|
|
||||||
var tag = $A();
|
var tag = $A();
|
||||||
if(typeof(it[i]['tag_list']['item'])=='string'){
|
if(typeof(it[i]['tag_list']['item'])=='string'){
|
||||||
tag.push(it[i]['tag_list']['item']);
|
tag.push(it[i]['tag_list']['item']);
|
||||||
}else{
|
}else{
|
||||||
tag = $A(it[i]['tag_list']['item']);
|
tag = $A(it[i]['tag_list']['item']);
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = tag.refuse('todo');
|
tag = tag.refuse('todo');
|
||||||
tag.push('done');
|
tag.push('done');
|
||||||
tag = tag.$value().join(',');
|
tag = tag.$value().join(',');
|
||||||
|
|
||||||
o.push('<li><input type="checkbox" id="document_srl:'+it[i]['document_srl']+'" value="'+tag+'" onclick="planet_todo_setDone(this)"/>');
|
o.push('<li>');
|
||||||
o.push('<em>');
|
o.push(it[i]['content']);
|
||||||
o.push(it[i]['content']);
|
o.push('<span class="button small"><button type="button" id="document_srl:'+it[i]['document_srl']+'" value="'+tag+'" onclick="planet_todo_setDone(this)">√ DONE</button></span>');
|
||||||
o.push('</em><span>');
|
o.push('<span class="time">');
|
||||||
o.push(it[i]['regdate']);
|
o.push(it[i]['regdate']);
|
||||||
o.push('</span>');
|
o.push('</span>');
|
||||||
o.push("</li>\n");
|
o.push("</li>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
o.push('</ul>');
|
o.push('</ul>');
|
||||||
|
o.push('<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>');
|
||||||
$('todoList').innerHTML = o.join('');
|
|
||||||
|
$('todoList').innerHTML = o.join('');
|
||||||
|
|
||||||
var pageNavigation = ret_obj['pageNavigation'];
|
|
||||||
|
var pageNavigation = ret_obj['pageNavigation'];
|
||||||
$('planet_todo_count').innerHTML = pageNavigation.total_count;
|
|
||||||
var str = "";
|
$('planet_todo_count').innerHTML = pageNavigation.total_count;
|
||||||
for(var i=pageNavigation.first_page;i<=pageNavigation.page_count;i++){
|
var str = "";
|
||||||
str += "|";
|
for(var i=pageNavigation.first_page;i<=pageNavigation.page_count;i++){
|
||||||
if(i== pageNavigation.cur_page){
|
if(i== pageNavigation.cur_page){
|
||||||
str += "<strong>"+i+"</strong>";
|
str += "<strong>"+i+"</strong>";
|
||||||
}else{
|
}else{
|
||||||
str += '<a href="#" onclick="planet_getTodo('+i+');return false;">'+ i +'</a>';
|
str += '<a href="#" onclick="planet_getTodo('+i+');return false;">'+ i +'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('todoList_page').innerHTML = str + '|';
|
$('todoList_page').innerHTML = str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function result_planet_getDone(ret_obj,response_tags, params, fo_obj) {
|
function result_planet_getDone(ret_obj,response_tags, params, fo_obj) {
|
||||||
|
|
||||||
if(ret_obj['error'] == 0 && ret_obj.contentList){
|
if(ret_obj['error'] == 0 && ret_obj.contentList){
|
||||||
var o = new Array();
|
var o = new Array();
|
||||||
var it = new Array();
|
var it = new Array();
|
||||||
var items = ret_obj['contentList']['item'];
|
var items = ret_obj['contentList']['item'];
|
||||||
|
|
||||||
|
|
||||||
if(typeof(items[0]) == 'undefined'){
|
if(typeof(items[0]) == 'undefined'){
|
||||||
it[0] = items;
|
it[0] = items;
|
||||||
}else{
|
}else{
|
||||||
it = items;
|
it = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
o.push('<ul>');
|
o.push('<ul>');
|
||||||
for(var i=0,c=it.length;i<c;i++){
|
for(var i=0,c=it.length;i<c;i++){
|
||||||
|
|
||||||
it[i]['regdate'] += '';
|
it[i]['regdate'] += '';
|
||||||
it[i]['regdate'] = it[i]['regdate'].substr(0,4) + '/' + it[i]['regdate'].substr(4,2) + '/' + it[i]['regdate'].substr(6,2);
|
it[i]['regdate'] = it[i]['regdate'].substr(0,4) + '/' + it[i]['regdate'].substr(4,2) + '/' + it[i]['regdate'].substr(6,2);
|
||||||
|
|
||||||
var tag = $A();
|
var tag = $A();
|
||||||
if(typeof(it[i]['tag_list']['item'])=='string'){
|
if(typeof(it[i]['tag_list']['item'])=='string'){
|
||||||
tag.push(it[i]['tag_list']['item']);
|
tag.push(it[i]['tag_list']['item']);
|
||||||
}else{
|
}else{
|
||||||
tag = $A(it[i]['tag_list']['item']);
|
tag = $A(it[i]['tag_list']['item']);
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = tag.refuse('done');
|
tag = tag.refuse('done');
|
||||||
tag.push('todo');
|
tag.push('todo');
|
||||||
tag = tag.$value().join(',');
|
tag = tag.$value().join(',');
|
||||||
|
|
||||||
o.push('<li><input type="checkbox" id="document_srl:'+it[i]['document_srl']+'" value="'+tag+'" onclick="planet_todo_setDone(this)" checked="checked=" />');
|
o.push('<li>');
|
||||||
o.push('<em>');
|
o.push(it[i]['content']);
|
||||||
o.push(it[i]['content']);
|
o.push('<span class="button small"><button type="button" id="document_srl:'+it[i]['document_srl']+'" value="'+tag+'" onclick="planet_todo_setDone(this)">REDO</button></span>');
|
||||||
o.push('</em><button type="button" onclick="planet_todo_setDel('+it[i]['document_srl']+')">삭제</button>');
|
o.push('<span class="button small"><button type="button" onclick="planet_todo_setDel('+it[i]['document_srl']+')">Delete</button></span>');
|
||||||
o.push("</li>\n");
|
o.push("</li>\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
o.push('</ul>');
|
o.push('</ul>');
|
||||||
$('doneList').innerHTML = o.join('');
|
o.push('<span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span>');
|
||||||
|
|
||||||
var pageNavigation = ret_obj['pageNavigation'];
|
$('doneList').innerHTML = o.join('');
|
||||||
$('planet_done_count').innerHTML = pageNavigation.total_count;
|
|
||||||
var str = "";
|
var pageNavigation = ret_obj['pageNavigation'];
|
||||||
for(var i=pageNavigation.first_page;i<=pageNavigation.page_count;i++){
|
$('planet_done_count').innerHTML = pageNavigation.total_count;
|
||||||
str += "|";
|
var str = "";
|
||||||
if(i== pageNavigation.cur_page){
|
for(var i=pageNavigation.first_page;i<=pageNavigation.page_count;i++){
|
||||||
str += "<strong>"+i+"</strong>";
|
if(i== pageNavigation.cur_page){
|
||||||
}else{
|
str += "<strong>"+i+"</strong>";
|
||||||
str += '<a href="#" onclick="planet_getDone('+i+');return false;">'+ i +'</a>';
|
}else{
|
||||||
}
|
str += '<a href="#" onclick="planet_getDone('+i+');return false;">'+ i +'</a>';
|
||||||
}
|
}
|
||||||
$('doneList_page').innerHTML = str + '|';
|
}
|
||||||
}
|
$('doneList_page').innerHTML = str;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function planet_todo_setDone(o){
|
|
||||||
var document_srl = o.id.replace(/.*:/,'');
|
function planet_todo_setDone(o){
|
||||||
var tag = o.value;
|
var document_srl = o.id.replace(/.*:/,'');
|
||||||
var params = {};
|
var tag = o.value;
|
||||||
params['document_srl'] = document_srl;
|
var params = {};
|
||||||
params['planet_content_tag'] = tag;
|
params['document_srl'] = document_srl;
|
||||||
|
params['planet_content_tag'] = tag;
|
||||||
exec_xml('planet','procPlanetContentTagModify',params,planet_reload_todo);
|
|
||||||
return false;
|
exec_xml('planet','procPlanetContentTagModify',params,planet_reload_todo);
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
function planet_todo_setDel(document_srl){
|
|
||||||
var tag = $A($('document_srl:'+document_srl).value.split(','));
|
function planet_todo_setDel(document_srl){
|
||||||
tag = tag.refuse('todo');
|
var tag = $A($('document_srl:'+document_srl).value.split(','));
|
||||||
tag.push('hide');
|
tag = tag.refuse('todo');
|
||||||
tag = tag.$value().join(',');
|
tag.push('hide');
|
||||||
|
tag = tag.$value().join(',');
|
||||||
var params = {};
|
|
||||||
params['document_srl'] = document_srl;
|
var params = {};
|
||||||
params['planet_content_tag'] = tag;
|
params['document_srl'] = document_srl;
|
||||||
|
params['planet_content_tag'] = tag;
|
||||||
exec_xml('planet','procPlanetContentTagModify',params,planet_reload_todo);
|
|
||||||
return false;
|
exec_xml('planet','procPlanetContentTagModify',params,planet_reload_todo);
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
function showWritePostTodo(tag){
|
|
||||||
tag = tag||'todo';
|
function showWritePostTodo(tag){
|
||||||
$Element($('writePostForm').about_tag).hide();
|
tag = tag||'todo';
|
||||||
$Element($('writePostForm').content_tag).show();
|
$Element($('writePostForm').about_tag).hide();
|
||||||
$('writePostForm').content_tag.value = tag;
|
$Element($('writePostForm').content_tag).show();
|
||||||
showWritePost();
|
$('writePostForm').content_tag.value = tag;
|
||||||
}
|
showWritePost();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue