init
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
uploader
|
||||||
|
base64upload/files
|
||||||
|
|
28
.project
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>leguwork</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>com.aptana.ide.core.unifiedBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.aptana.projects.webnature</nature>
|
||||||
|
</natures>
|
||||||
|
<filteredResources>
|
||||||
|
<filter>
|
||||||
|
<id>1524281140389</id>
|
||||||
|
<name></name>
|
||||||
|
<type>26</type>
|
||||||
|
<matcher>
|
||||||
|
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||||
|
<arguments>1.0-name-matches-false-false-node_modules</arguments>
|
||||||
|
</matcher>
|
||||||
|
</filter>
|
||||||
|
</filteredResources>
|
||||||
|
</projectDescription>
|
126
autologin.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$user = $_SESSION['leguworkUser'];
|
||||||
|
$username = $user['pinyin'].$user['userid'];
|
||||||
|
|
||||||
|
|
||||||
|
// 测试用start
|
||||||
|
//$username = $_REQUEST['name'];
|
||||||
|
//$username = 'wu2194';
|
||||||
|
//$user['avatar'] = '';
|
||||||
|
//$user['legugroup'] = array('服务端');
|
||||||
|
|
||||||
|
//测试用end
|
||||||
|
|
||||||
|
|
||||||
|
$hasMember = $wekan->users->find( array(
|
||||||
|
"username" =>$username
|
||||||
|
));
|
||||||
|
|
||||||
|
//记录最后IP
|
||||||
|
$wekan->usersip->update(array(
|
||||||
|
'username'=>$username
|
||||||
|
),array(
|
||||||
|
'$set'=>array(
|
||||||
|
'username'=>$username,
|
||||||
|
'fullname'=> $user['name'],
|
||||||
|
'lastime'=>time(),
|
||||||
|
),
|
||||||
|
'$addToSet'=>array(
|
||||||
|
'ip'=>getip()
|
||||||
|
)
|
||||||
|
),array(
|
||||||
|
'upsert'=>true
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
if (count( iterator_to_array($hasMember) ) == 0){
|
||||||
|
//看板里没有这个用户,则自动增加
|
||||||
|
$id = 'w'.uniqid();
|
||||||
|
$_SESSION['leguworkUID'] = $id;
|
||||||
|
|
||||||
|
$wekan->users->insert(array(
|
||||||
|
"_id" => $id,
|
||||||
|
"createdAt" => new MongoDate(time()),
|
||||||
|
"username" => $username,
|
||||||
|
"emails" => array(
|
||||||
|
array(
|
||||||
|
"address" => "{$user['pinyin']}@leguwork.cc",
|
||||||
|
"verified" => false
|
||||||
|
)
|
||||||
|
),
|
||||||
|
"isAdmin" => false,
|
||||||
|
"profile" => array(
|
||||||
|
"fullname" => $user['name'],
|
||||||
|
"avatarUrl" => $user['avatar'],
|
||||||
|
"hiddenSystemMessages" => true,
|
||||||
|
"tags" => array(
|
||||||
|
"notify-participate",
|
||||||
|
"notify-watch"
|
||||||
|
),
|
||||||
|
"starredBoards" => array(),
|
||||||
|
|
||||||
|
"language" => "zh-CN",
|
||||||
|
"boardView" => "board-view-lists"
|
||||||
|
),
|
||||||
|
"org"=>$user['org'],
|
||||||
|
"orgname"=>$user['orgname'],
|
||||||
|
"group"=>$user['legugroup'][0],
|
||||||
|
'dduserid'=>$user['userid']
|
||||||
|
));
|
||||||
|
|
||||||
|
$hasMember = $wekan->users->find( array(
|
||||||
|
"username" =>$username
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新登录时间 用于筛选用户
|
||||||
|
$wekan->users->update(array(
|
||||||
|
'username'=>$username
|
||||||
|
),array(
|
||||||
|
'$set' => array(
|
||||||
|
'lastlogin'=> time(),
|
||||||
|
'group'=>$user['legugroup'][0],
|
||||||
|
'dduserid'=>$user['userid']
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
// 更新legulabel
|
||||||
|
/*
|
||||||
|
if (isset($user)){
|
||||||
|
|
||||||
|
$legulabel = $wekan->users->find(array(
|
||||||
|
'username'=>$username,
|
||||||
|
'legulabel' => array('$in' => array($user['legugroup'][0])),
|
||||||
|
));
|
||||||
|
|
||||||
|
$res = iterator_to_array($legulabel);
|
||||||
|
// 没有设置 legulabel
|
||||||
|
if (!$res){
|
||||||
|
$legulabel = $wekan->users->update(array(
|
||||||
|
'username'=>$username,
|
||||||
|
),array(
|
||||||
|
'$push' => array('legulabel' => $user['legugroup'][0]),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
$uinfo = iterator_to_array($hasMember);
|
||||||
|
$uinfo = array_keys($uinfo);
|
||||||
|
|
||||||
|
$_SESSION['leguworkUID'] = $uinfo[0];
|
||||||
|
|
||||||
|
header("Location:./?app=board");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//$tBoardId = getTemplateBoardIdForUserGroupName('服务端');
|
||||||
|
//
|
||||||
|
//insertGuideBoardForTemplateBoard($_SESSION['leguworkUID'],$tBoardId);
|
13
base64upload/index.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
header('Access-Control-Allow-Origin:*');
|
||||||
|
$imgstr = $_POST['data'];
|
||||||
|
|
||||||
|
$filename = uniqid();
|
||||||
|
$filename = "files/{$filename}.png";
|
||||||
|
|
||||||
|
$imgdata = substr($imgstr,strpos($imgstr,",") + 1);
|
||||||
|
$decodedData = base64_decode($imgdata);
|
||||||
|
file_put_contents($filename,$decodedData );
|
||||||
|
|
||||||
|
echo $filename;
|
||||||
|
?>
|
426
board.php
Normal file
@ -0,0 +1,426 @@
|
|||||||
|
<?php
|
||||||
|
$userinfo = getUserInfo($MYID);
|
||||||
|
$rqorgid = r('orgid');
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
<script type="text/javascript" src="scripts/colpick.js?_<?=filemtime('scripts/colpick.js')?>"></script>
|
||||||
|
<!-- <script src="https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js"></script>-->
|
||||||
|
<link type="text/css" href="css/colpick.css?_<?=filemtime('css/colpick.css')?>" rel="stylesheet" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<!-- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">-->
|
||||||
|
<link type="text/css" href="css/bootstrap.min.css?_<?=filemtime('css/bootstrap.min.css')?>" rel="stylesheet" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.h1_title{
|
||||||
|
font-size: 25px;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
a.star_top{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.right_ico{
|
||||||
|
margin: 0px 3px;
|
||||||
|
}
|
||||||
|
.board_star_num{
|
||||||
|
font-size: 13px;
|
||||||
|
/*margin-right: 10px;*/
|
||||||
|
/*margin-top: 5px;*/
|
||||||
|
display: inline-block;
|
||||||
|
width: 77px;
|
||||||
|
}
|
||||||
|
.main_board_act{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.star_board_boardmain{
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.main_board_progress{
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<script type="text/tmpl" id="tmpl-board" >
|
||||||
|
<div class="boardtmpl canchangesort">
|
||||||
|
<%
|
||||||
|
var bgcolor = "";
|
||||||
|
var scolor = localStorage['boardColor1_'+ data['_id']];
|
||||||
|
if(scolor){
|
||||||
|
if(scolor.indexOf('base64')!=-1){
|
||||||
|
bgcolor = "background-image:url("+scolor+");background-size:100%";
|
||||||
|
}else{
|
||||||
|
bgcolor = "background-color:"+scolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var star_icon = 'fa-star-o';
|
||||||
|
|
||||||
|
%>
|
||||||
|
<div class="boardmain" data-id="<%=data['_id']%>" data-title="<%=data['title']%>" style="position: relative;<%=bgcolor%>">
|
||||||
|
<a href="./?app=list&boardid=<%=data['_id']%>"><%=data['title']%></a>
|
||||||
|
<%if(MYINFO && MYINFO.extData && MYINFO.extData.admin=='all'){%>
|
||||||
|
<span style="font-size:12px;font-weight: normal;"><%=(MYINFO&&MYINFO.extData&&MYINFO.extData.admin?data['orgname']:"")%></span>
|
||||||
|
<%}%>
|
||||||
|
<!--div style="float:right"><a class="fa <%=star_icon%> js_star_board" href="javascript:;;;" title="星标看板"></a></div-->
|
||||||
|
<div class="main_board_act" style="position: absolute; bottom: 0; text-align: right; width: 94%; font-weight: normal;">
|
||||||
|
<a class="fa fa-trash-o archivedBoard" href="javascript:;;;" title="归档该看板"></a>
|
||||||
|
<a class="fa fa-adjust colorbox" href="javascript:;;;" title="修改背景色"></a>
|
||||||
|
<a class="fa fa-sign-out jsQuitBoard" href="javascript:;;;" title="退出看板"></a>
|
||||||
|
|
||||||
|
<!--<img src="img/getcolor.png" class="colorbox" style="width: 15px;" />-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 星标看板 -->
|
||||||
|
<script type="text/tmpl" id="tmpl-board_star" >
|
||||||
|
<div class="boardtmpl star_canchangesort board_star">
|
||||||
|
<%
|
||||||
|
var bgcolor = "";
|
||||||
|
var scolor = localStorage['boardColor1_'+ data['_id']];
|
||||||
|
if(scolor){
|
||||||
|
if(scolor.indexOf('base64')!=-1){
|
||||||
|
bgcolor = "background-image:url("+scolor+");background-size:100%";
|
||||||
|
}else{
|
||||||
|
bgcolor = "background-color:"+scolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var star_icon = 'fa-star';
|
||||||
|
|
||||||
|
var progress_class = 'progress-bar-danger';
|
||||||
|
|
||||||
|
var progress_num = (data['complete_card_num'] / data['all_card_num'] * 100).toFixed(2);
|
||||||
|
if(data['remain_card_num'] <= 0 || data['all_card_num'] <= 0){
|
||||||
|
progress_num = 0;
|
||||||
|
}
|
||||||
|
if (progress_num >= 80){
|
||||||
|
progress_class = 'progress-bar-success';
|
||||||
|
}else if(progress_num >= 50){
|
||||||
|
progress_class = 'progress-bar-warning';
|
||||||
|
}
|
||||||
|
|
||||||
|
var showTopbtnClass = '';
|
||||||
|
var flagClass = '';
|
||||||
|
if (data['showTopbtn']){
|
||||||
|
flagClass = 'fa-flag';
|
||||||
|
showTopbtnClass = 'fa-caret-square-o-up';
|
||||||
|
}
|
||||||
|
var boardRightHtml = '';
|
||||||
|
if(data['showTopbtn']){
|
||||||
|
boardRightHtml += '<a class="right_ico fa fa-caret-square-o-up jsTopBoard top_board_hide" href="javascript:;;;" title="置顶"> </a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(data['isTop']){
|
||||||
|
boardRightHtml += '<a class="right_ico fa fa-flag star_top" href="javascript:;;;" title="重要看板"> </a>';
|
||||||
|
bgcolor = "background-color: #0a009fa3";
|
||||||
|
}else{
|
||||||
|
if(data['isStar']){
|
||||||
|
boardRightHtml += '<a class="right_ico fa fa-star js_star_board" href="javascript:;;;" title="星标看板"> </a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
%>
|
||||||
|
<div class="boardmain star_board_boardmain" data-id="<%=data['_id']%>" data-title="<%=data['title']%>" style="position: relative;<%=bgcolor%>">
|
||||||
|
<a href="./?app=list&boardid=<%=data['_id']%>"><%=data['title']%></a>
|
||||||
|
<div style="float:right">
|
||||||
|
<!-- <a class="fa <%=showTopbtnClass%> jsTopBoard top_board_hide" href="javascript:;;;" title="置顶"></a>-->
|
||||||
|
<!-- <a class="fa <%=star_icon%> js_star_board" href="javascript:;;;" title="星标看板"></a>-->
|
||||||
|
<%=boardRightHtml%>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="">
|
||||||
|
<span class='board_star_num'>已完成: <%=data['complete_card_num']%></span>
|
||||||
|
<span class='board_star_num'>剩余单: <%=data['remain_card_num']%></span>
|
||||||
|
<span class='board_star_num'>总单数: <%=data['all_card_num']%></span>
|
||||||
|
</div>
|
||||||
|
<div class="main_board_progress">
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar <%=progress_class%> progress-bar-striped active" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="min-width: 3em; width: <%=progress_num%>%;">
|
||||||
|
<%=progress_num%>%
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="main_board_act" style="position: absolute; bottom: 0; text-align: right; width: 94%; font-weight: normal;">
|
||||||
|
<a class="fa fa-trash-o archivedBoard" href="javascript:;;;" title="归档该看板"></a>
|
||||||
|
<!-- <a class="fa fa-adjust colorbox" href="javascript:;;;" title="修改背景色"></a>-->
|
||||||
|
<a class="fa fa-sign-out jsQuitBoard" href="javascript:;;;" title="退出看板"></a>
|
||||||
|
|
||||||
|
<!--<img src="img/getcolor.png" class="colorbox" style="width: 15px;" />-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-createproject" >
|
||||||
|
<? require_once "createproject.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
|
||||||
|
<!-- <div class="" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
<h1 class="h1_title boards-page-board-section-header-name"> 重要看板</h1>
|
||||||
|
</div>
|
||||||
|
<div id="main_top" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
|
||||||
|
</div>-->
|
||||||
|
|
||||||
|
<!-- <div class="" style="max-width: 1200px; padding-top: 5px;; margin:auto;clear: both"></div>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--div class="" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
<h1 class="h1_title boards-page-board-section-header-name"> 星标看板</h1>
|
||||||
|
</div>
|
||||||
|
<div id="main_star_1" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
<div id="main_star_top" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div id="main_star" style="max-width: 1200px; margin:auto">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div-->
|
||||||
|
|
||||||
|
<div class="" style="max-width: 1200px; padding-top: 5px;; margin:auto;clear: both"></div>
|
||||||
|
|
||||||
|
<div class="" style="max-width: 1200px; padding-top: 5px;; margin:auto">
|
||||||
|
<h1 class="h1_title boards-page-board-section-header-name" style=";width:120px;display:inline-block"> 项目看板</h1>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if($userinfo && $userinfo['extData'] && $userinfo['extData']['admin']==='all'){
|
||||||
|
$orgs = getorgs();
|
||||||
|
?>
|
||||||
|
<span>
|
||||||
|
<select style="padding:5px;" id="selectorg">
|
||||||
|
<option value="">切换组织</option>
|
||||||
|
<? foreach($orgs as $orgid=>$orgname){?>
|
||||||
|
<option value="<?=$orgid?>"><?=$orgname?></option>
|
||||||
|
<? } ?>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div id="main" style="max-width: 1200px; padding-top: 5px;; margin:auto"></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var rqorgid="<?=$rqorgid?>";
|
||||||
|
var sortData = {};
|
||||||
|
if(localStorage.boardSortData){
|
||||||
|
try{
|
||||||
|
sortData = JSON.parse(localStorage.boardSortData);
|
||||||
|
}catch(e){}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initBoard(){
|
||||||
|
getboards(function(json){
|
||||||
|
DATA.boards = json;
|
||||||
|
fmtBoards();
|
||||||
|
|
||||||
|
},rqorgid);
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindBoardSort(){
|
||||||
|
try{
|
||||||
|
$('#main').sortable('destory');
|
||||||
|
}catch(e){}
|
||||||
|
|
||||||
|
var lastSortCard;
|
||||||
|
$('#main').sortable({
|
||||||
|
connectWith: [".canchangesort"],
|
||||||
|
|
||||||
|
distance: 15,
|
||||||
|
tolerance:'pointer',
|
||||||
|
opacity:0.8,
|
||||||
|
revert:100,
|
||||||
|
helper:'clone',
|
||||||
|
appendTo:'body',
|
||||||
|
start : function(event, ui){
|
||||||
|
|
||||||
|
},
|
||||||
|
stop: function(event, ui){
|
||||||
|
sortData = {};
|
||||||
|
$('.canchangesort').each(function(index){
|
||||||
|
var boardid = $(this).find('.boardmain').data('id');
|
||||||
|
sortData[boardid] = index;
|
||||||
|
});
|
||||||
|
localStorage.boardSortData = JSON.stringify(sortData);
|
||||||
|
},
|
||||||
|
|
||||||
|
}).disableSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fmtBoards(){
|
||||||
|
boards = [];
|
||||||
|
for(var bid in DATA.boards){
|
||||||
|
DATA.boards[bid].sort = sortData[bid] || 0;
|
||||||
|
boards.push( DATA.boards[bid] );
|
||||||
|
}
|
||||||
|
boards.sort(function(a,b){
|
||||||
|
return a.sort - b.sort;
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('fmtBoards',boards);
|
||||||
|
|
||||||
|
fill('#tmpl-board', boards ,'#main');
|
||||||
|
$('#main').prepend('<div class="boardtmpl">\
|
||||||
|
<div class="boardmain" style="background-color:#999;text-align: center;line-height: 50px;">\
|
||||||
|
<a href="javascript:;" class="addprojecthref">新建看板</a>\
|
||||||
|
</div>\
|
||||||
|
</div><div class="boardtmpl">\
|
||||||
|
<div class="boardmain" style="text-align: center;line-height: 50px;">\
|
||||||
|
<a href="./?app=mylists" class="tomylists">与我相关</a>\
|
||||||
|
</div>\
|
||||||
|
</div>');
|
||||||
|
|
||||||
|
bindBoardSort();
|
||||||
|
//选色器
|
||||||
|
$('.colorbox').colpick({
|
||||||
|
onChange:function(hsb,hex,rgb,el,bySetColor) {
|
||||||
|
//$(el).css('border-color','#'+hex);
|
||||||
|
var b = $(el).parents('.boardmain');
|
||||||
|
var id = b.data('id');
|
||||||
|
|
||||||
|
b.css('background-color','#'+hex);
|
||||||
|
localStorage['boardColor_'+ id] = '#'+hex;
|
||||||
|
//console.log(hex);
|
||||||
|
},
|
||||||
|
onSubmit:function(hsb,hex,rgb,el) {
|
||||||
|
$(el).colpickHide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//粘贴背景图片
|
||||||
|
$('.boardmain').pasteImageReader(function(results){
|
||||||
|
var id = $(this).data('id');
|
||||||
|
console.log(id);
|
||||||
|
localStorage['boardColor_'+ id] = results.dataURL;
|
||||||
|
fmtBoards();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//创建看板
|
||||||
|
$('body').on('click','.addprojecthref',function(e){
|
||||||
|
|
||||||
|
$('#createproject').remove();
|
||||||
|
var html = T( $('#tmpl-createproject').html() , {} );
|
||||||
|
$('body').append( html );
|
||||||
|
$('#createproject').css({
|
||||||
|
'left':e.clientX+5,
|
||||||
|
'top':e.clientY+10
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
//创建submit
|
||||||
|
$('body').on('click','.addboard_btnsubmit',function(e){
|
||||||
|
var val = $('.addboard_text').val();
|
||||||
|
if(val.length == 0)return;
|
||||||
|
doSubmitAddboard(val,function(json){
|
||||||
|
$('.close_createproject').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#selectorg').on('change',function(e){
|
||||||
|
var orgid = $(this).val();
|
||||||
|
console.log(orgid);
|
||||||
|
location.href="./?app=board&orgid="+orgid;
|
||||||
|
});
|
||||||
|
$('#selectorg').val("<?=$rqorgid?>");
|
||||||
|
|
||||||
|
|
||||||
|
//创建界面X
|
||||||
|
$('body').on('click','.close_createproject',function(e){
|
||||||
|
$('#createproject').remove();
|
||||||
|
});
|
||||||
|
$('#main').click(function(){
|
||||||
|
$('#createproject').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
//归档看板
|
||||||
|
$('body').on('click','.archivedBoard',function(e){
|
||||||
|
var title = $(this).parents('.boardmain').data('title');
|
||||||
|
var id = $(this).parents('.boardmain').data('id');
|
||||||
|
var code = prompt('输入口令归档看板['+ title +']');
|
||||||
|
if(code==null)return;
|
||||||
|
|
||||||
|
if(code == 'legucc'){
|
||||||
|
doArchivedboard(id);
|
||||||
|
}else{
|
||||||
|
alert('口令错误');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 退出看板
|
||||||
|
$('body').on('click','.jsQuitBoard',function(e){
|
||||||
|
var title = $(this).parents('.boardmain').data('title');
|
||||||
|
var boardid = $(this).parents('.boardmain').data('id');
|
||||||
|
if(confirm('你确定退出该项目吗?')){
|
||||||
|
$.get('./?app=api&apiact=quit_board&boardid='+ boardid , function(text){
|
||||||
|
initBoard();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 置顶看板
|
||||||
|
$('body').on('click','.jsTopBoard',function(e){
|
||||||
|
var title = $(this).parents('.boardmain').data('title');
|
||||||
|
var id = $(this).parents('.boardmain').data('id');
|
||||||
|
var isTop = confirm('你确定置顶该项目吗?');
|
||||||
|
|
||||||
|
if(isTop){
|
||||||
|
// doArchivedboard(id);
|
||||||
|
var bid = $(this).parents('.boardmain').data('id');
|
||||||
|
var url = pyapi_host + '/v2/main_board/toggle_top_board?uid=' + MYID + '&bid=' + bid;
|
||||||
|
console.log('quit_board uid',MYID, ' bid ', bid );
|
||||||
|
$.get(url,function (data) {
|
||||||
|
initBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 星标看板
|
||||||
|
$('body').on('click','.js_star_board',function(e){
|
||||||
|
// var title = $(this).parents('.boardmain').data('title');
|
||||||
|
var bid = $(this).parents('.boardmain').data('id');
|
||||||
|
var url = pyapi_host + '/v2/main_board/toggle_star?uid=' + MYID + '&bid=' + bid;
|
||||||
|
$.get(url,function (data) {
|
||||||
|
initBoard();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('body').on('mouseenter','.boardmain',function (e) {
|
||||||
|
$(this).find('.main_board_act').show();
|
||||||
|
});
|
||||||
|
$('body').on('mouseleave','.boardmain',function (e) {
|
||||||
|
$(this).find('.main_board_act').hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
EVENT.on('addboard',function(data){
|
||||||
|
initBoard();
|
||||||
|
});
|
||||||
|
EVENT.on('archivedboard',function(data){
|
||||||
|
initBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
initBoard();
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
42
card_list_timeline.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<div id="cardListTimelineMask" class="rightfixedMask" style="display:none;"></div>
|
||||||
|
<div id="cardListTimeline" class="rightfixed cardtimeline" style="overflow-y:auto;">
|
||||||
|
<div class="card-details-header">
|
||||||
|
<h2 class="card-details-title">
|
||||||
|
列表日程
|
||||||
|
</h2>
|
||||||
|
<div class="card-details-ctrl" style="float:right">
|
||||||
|
<a id="cardTimelineClose" class="fa fa-close" href="javascript:;;;"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="card-details-items" id="cardListTimelineData" >
|
||||||
|
<!--<h3 class="card-details-item-title">总完成情况</h3>
|
||||||
|
<div id="report1" style="height: 200px;;"></div>
|
||||||
|
<hr/>
|
||||||
|
<h3 class="card-details-item-title">总标签数分布</h3>
|
||||||
|
<div id="report2" style="height: 300px;;"></div>
|
||||||
|
<hr/>-->
|
||||||
|
<!--<div style="clear:both"></div>-->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!--<script src='timeline/popper.min.js'></script>-->
|
||||||
|
<!--<script src='https://unpkg.com/popper.js/dist/umd/popper.min.js'></script>-->
|
||||||
|
<!--<script src="https://unpkg.com/tooltip.js/dist/umd/tooltip.min.js"></script>-->
|
||||||
|
<style>
|
||||||
|
.cardtimeline {
|
||||||
|
width:80%
|
||||||
|
}
|
||||||
|
.fc-sun{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.fc-sat{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
</style>
|
164
cardinfo.html
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<div id="cardinfoMask" style="display:none;"></div>
|
||||||
|
<div id="cardinfo" style="overflow-y:auto;" data-id='<%=DATA.lastShowCardID%>'>
|
||||||
|
<div class="card-details-header">
|
||||||
|
<h2 class="card-details-title">
|
||||||
|
<div class="viewer" style="width: 100%;">
|
||||||
|
<span class="cardinfo_title_qalabel_name"></span>
|
||||||
|
<div class="cardinfo_title" style="display: inline-block;margin-right:10px;"></div>
|
||||||
|
<span style="font-size:10px;font-weight:normal;color:#666;" class="cardinfo_ctime">2015-213-123</span>
|
||||||
|
|
||||||
|
<div class="cardinfo_title_editor_div" style="display: none;">
|
||||||
|
<textarea class="cardinfo_title_editor js-new-comment-input" data-autosize-on="true" style=" word-wrap: break-word; height: 65px;width: 100%;"></textarea>
|
||||||
|
<div class="add-controls">
|
||||||
|
<button class="button cardinfo_title_btnsubmit" type="button">确定</button>
|
||||||
|
<button class="button cardinfo_title_btncannel" type="button">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="card-details-ctrl" style="float:right">
|
||||||
|
<a id="cardinfoDelete" class="fa fa-trash-o" href="javascript:;;;"></a>
|
||||||
|
<a id="cardinfoOverd" class="fa fa-check-square-o" href="javascript:;;;"></a>
|
||||||
|
<a id="cardinfoClose" class="fa fa-close" href="javascript:;;;"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="card-details-items">
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="card-details-item-title" id="qalabels-h3">问题类型<span style="font-size: 12px; font-weight: normal;"></span></h3>
|
||||||
|
<div class="minicard-labels" id="qalabels-div">
|
||||||
|
<div id="cardinfoQALabels"></div>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<h3 class="card-details-item-title">描述 <span style="font-size: 12px; font-weight: normal;">(支持 MD语法,快捷插入模板:<a href="javascript:modal(1)" style="font-size: 12px; font-weight: normal;">需求</a> / <a href="javascript:modal(2)" style="font-size: 12px; font-weight: normal;">BUG</a> / <a href="javascript:modal(3)" style="font-size: 12px; font-weight: normal;">优化</a> )</span></h3>
|
||||||
|
|
||||||
|
<div class="viewer" style="width: 100%;word-break: break-all;">
|
||||||
|
|
||||||
|
<div class="cardinfo_description">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cardinfo_description_editor_div" style=" display: none;">
|
||||||
|
<textarea class="cardinfo_description_editor js-new-comment-input" placeholder="编辑内容(Ctrl+Enter发送)" data-autosize-on="true" style=" word-wrap: break-word; height: 105px; width: 100%;" data-bindbtn='.cardinfo_description_btnsubmit'></textarea>
|
||||||
|
<div class="add-controls">
|
||||||
|
<button class="button cardinfo_description_btnsubmit" type="button">确定</button>
|
||||||
|
<button class="button cardinfo_description_btncannel" type="button">取消</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<h3 class="card-details-item-title">标签<span style="font-size: 12px; font-weight: normal;">(双击取消)</span></h3>
|
||||||
|
<div class="minicard-labels">
|
||||||
|
<div id="cardinfoLabels"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<!--h3 class="card-details-item-title" id="fengxianbiaoqian_title"><span style='color:#cb1a44' class="fengxianbiaoqian">风险标签</span><span style="font-size: 12px; font-weight: normal;">(双击取消)</span></h3>
|
||||||
|
<div class="minicard-labels">
|
||||||
|
<div id="cardinfoRiskLabels"></div>
|
||||||
|
<ol id="cardinfoIssueTags"></ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/-->
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="card-details-item-title">成员<span style="font-size: 12px; font-weight: normal;">(双击取消)</span></h3>
|
||||||
|
|
||||||
|
<div class="minicard-members js-minicard-members" style="float:none">
|
||||||
|
<div id="cardinfoMembers"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<!--h3 class="card-details-item-title" id="yanqimembers-h3">延期的成员<span style="font-size: 12px; font-weight: normal;">(双击取消)</span></h3>
|
||||||
|
|
||||||
|
<div class="minicard-members js-minicard-members" style="float:none" id="yanqimembers-div">
|
||||||
|
<div id="cardinfoYanQiMembers"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <h3 class="card-details-item-title">
|
||||||
|
检查项
|
||||||
|
<span style="font-size: 12px; font-weight: normal;">
|
||||||
|
(快捷插入模板:
|
||||||
|
<a href="javascript:autochecklist(1)" style="font-size: 12px; font-weight: normal;">大功能</a> /
|
||||||
|
<a href="javascript:autochecklist(2)" style="font-size: 12px; font-weight: normal;">更新流程</a>
|
||||||
|
)
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="viewer" style="width: 100%;">
|
||||||
|
<div class="cardinfo_checklists">
|
||||||
|
<ol style="margin-left: 24px;;" id="checklistsol">
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="" style=" margin-top: 10px;;">
|
||||||
|
<input class="js-new-comment-input addchecklist_input" data-bindbtn='.addchecklist_btnsubmit' placeholder="输入检查项内容(Ctrl+Enter提交)" style="float: left; height: 35px;width: 250px;"></textarea><button class="button addchecklist_btnsubmit" type="button" style=" float: left; margin-top: 4px;">新增</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>-->
|
||||||
|
|
||||||
|
<!--form class="inlined-form js-inlined-form card-description js-card-description"><textarea class="editor" autofocus="true" placeholder="添加评论" data-autosize-on="true" style="overflow-y: visible; overflow-x: hidden; word-wrap: break-word; height: 99.8182px;"></textarea><div class="edit-controls clearfix"><button class="primary" type="submit">保存</button>
|
||||||
|
<a class="fa fa-times-thin js-close-inlined-form" href="#"></a></div></form-->
|
||||||
|
|
||||||
|
<h3 class="card-details-item-title">附件</h3>
|
||||||
|
|
||||||
|
<div class="attachments-galery">
|
||||||
|
<div class="fujianlist" style="display: block; width:100%;clear: both;">
|
||||||
|
<!--span><a class="fa fa-close" href="javascript:;;;"></a> <a href="#">添加附件</a></span>
|
||||||
|
<span><a class="fa fa-close" href="javascript:;;;"></a> <a href="#">添加附件</a></span>
|
||||||
|
<span><a class="fa fa-close" href="javascript:;;;"></a> <a href="#">添加附件</a></span-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<iframe id="_hideiframe" name="_hideiframe" style="display: none;"></iframe>
|
||||||
|
<form method="post" id="uploader" style="display: block; clear: both; margin-top: 10px;;" target="_hideiframe" action="./?app=uploader" enctype="multipart/form-data"><input name="cid" type="hidden" value="<%=DATA.lastShowCardID%>" /><input type="file" id="fujian" name="fujian[]" multiple onchange="document.getElementById('uploader').submit()"></form>
|
||||||
|
|
||||||
|
<!--li class="attachment-item add-attachment"><a class="js-add-attachment" href="#">添加附件</a></li>
|
||||||
|
<li class="attachment-item add-attachment"><a class="js-add-attachment" href="#">添加附件</a></li>
|
||||||
|
<li class="attachment-item add-attachment"><a class="js-add-attachment" href="#">添加附件</a></li-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<!--发表评论-->
|
||||||
|
<h3 class="card-details-item-title">评论</h3>
|
||||||
|
<textarea class="editor cardinfo_addcommets_editor js-new-comment-input" placeholder="添加评论(Ctrl+Enter发送)" data-autosize-on="true" style="word-wrap: break-word; height: 65px;" data-bindbtn='.cardinfo_addcommets_btnsubmit'></textarea>
|
||||||
|
<div class="add-controls"><button class="button cardinfo_addcommets_btnsubmit" type="button">评论</button></div>
|
||||||
|
|
||||||
|
<div style="clear:both"></div>
|
||||||
|
<!--评论列表-->
|
||||||
|
<ul id="detail_lis">
|
||||||
|
<li class="tag detail_lis detail_lis_dongtai" style="margin-left: 10px;;">动态</li>
|
||||||
|
<li class="tag detail_lis detail_lis_shijian">事件</li>
|
||||||
|
<li class="tag detail_lis detail_lis_all">全部</li>
|
||||||
|
</ul>
|
||||||
|
<div id="cardinfo_comments_panel" class="activities js-sidebar-activities" style="clear:both">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="clear:both"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#detail_lis{ list-style: none; margin: 0; padding: 0; margin-top: 10px;; border-bottom: 1px solid #dbdbdb;}
|
||||||
|
#detail_lis .tag{ font-size: 10px; padding:1px 20px;; background:#aaa;border-top-left-radius:5px;border-top-right-radius:5px; display: inline-block; color: #eee; text-align: right; margin-left: 5px; line-height: 25px;; }
|
||||||
|
#detail_lis .tag.on{ background:#fff; color: #000; border: 1px solid #dbdbdb; position: relative; top: 1px; z-index: 2; border-bottom: #fff 1px solid;}
|
||||||
|
</style>
|
12
cardinfo_comments.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<%
|
||||||
|
var uinfo = getUserInfo( data.userId );
|
||||||
|
%>
|
||||||
|
<div style="margin:15px 0 25px 0;clear:both">
|
||||||
|
|
||||||
|
<div style="font-size: 0.8em; margin:8px 0; color:#666">
|
||||||
|
<%=(uinfo?uinfo.profile.fullname:data.userId)%> <%=formatDate(data.createdAt.sec)%> <!--a class="js-open-inlined-form" href="#">编辑</a> - <a class="js-delete-comment" href="#">删除</a-->
|
||||||
|
</div>
|
||||||
|
<div class="activity-comment">
|
||||||
|
<div class="viewer"><%=replaceImgURL(marked(data.text)) %></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
11
cardmenu.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<ul id="cardmenu" class="listmenu ui-menu ui-widget ui-widget-content" style="position: absolute; z-index: 999;">
|
||||||
|
<li class="ui-menu-item ui-menu-item-wrapper">
|
||||||
|
<div class="moveto" id="movecardto">移动到 <select id="cardmovetoselect"style="border:1px solid #888;width:100%;padding:3px;"></select></div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!--li class="ui-menu-item">
|
||||||
|
<a class="delcard list_timeline ui-menu-item-wrapper">删除单子</a>
|
||||||
|
</li-->
|
||||||
|
|
||||||
|
<!--li></li-->
|
||||||
|
</ul>
|
24
cardpopover.html
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<div id="cardPopoverMask" class="rightfixedMask" style="display:none;"></div>
|
||||||
|
<div id="cardPopover" class="rightfixed" style="overflow-y:auto;">
|
||||||
|
<div class="card-details-header">
|
||||||
|
<h2 class="card-details-title">
|
||||||
|
项目报表
|
||||||
|
</h2>
|
||||||
|
<div class="card-details-ctrl" style="float:right">
|
||||||
|
<a id="cardPopoverClose" class="fa fa-close" href="javascript:;;;"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="card-details-items" id="cardpopoverdata" >
|
||||||
|
<!--<h3 class="card-details-item-title">总完成情况</h3>
|
||||||
|
<div id="report1" style="height: 200px;;"></div>
|
||||||
|
<hr/>
|
||||||
|
<h3 class="card-details-item-title">总标签数分布</h3>
|
||||||
|
<div id="report2" style="height: 300px;;"></div>
|
||||||
|
<hr/>-->
|
||||||
|
<!--<div style="clear:both"></div>-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
674
chart.php
Normal file
@ -0,0 +1,674 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
|
||||||
|
<link href='timeline/core.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/resource-timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<script src='timeline/core.main.min.js'></script>
|
||||||
|
<script src='timeline/locales-all.min.js'></script>
|
||||||
|
<script src='timeline/interaction.main.min.js'></script>
|
||||||
|
<script src='timeline/timeline.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-common.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-timeline.main.min.js'></script>
|
||||||
|
<script type="text/javascript" src="scripts/echarts.min.js?_<?php filemtime('scripts/echarts.min.js') ?>"></script>
|
||||||
|
<style>
|
||||||
|
a.fc-timeline-event {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="maina" style="margin:15px;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="" style="margin:15px; height: 100%;">
|
||||||
|
<div class="center" style="margin: 0 auto;width: 173px;">
|
||||||
|
<input type="text" name="daterange" readonly style="text-align: center">
|
||||||
|
</div>
|
||||||
|
<button type="button" id="export-wtlx1">导出</button>
|
||||||
|
<div id="wtlx1" style="margin:15px; height: 100%;">
|
||||||
|
</div>
|
||||||
|
<button type="button" id="export-finish">导出</button>
|
||||||
|
<div id="wtlx_finish" style="margin:15px; height: 100%;">
|
||||||
|
</div>
|
||||||
|
<button type="button" id="export-wtlx2">导出</button>
|
||||||
|
<div id="wtlx2" style="margin:15px; height: 100%;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div id="wtlx_all" style="margin:15px; height: 100%;">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
// var pyapi = 'http://10.0.0.5:5000';
|
||||||
|
var pyapi = pyapi_host;
|
||||||
|
|
||||||
|
document.getElementById('export-wtlx1').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/chart/wtlx1?st=' + st + '&et=' + et + '&export=1';
|
||||||
|
window.location.href= url
|
||||||
|
})
|
||||||
|
|
||||||
|
document.getElementById('export-wtlx2').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/chart/wtlx2?st=' + st + '&et=' + et + '&export=1';
|
||||||
|
window.location.href= url
|
||||||
|
})
|
||||||
|
|
||||||
|
document.getElementById('export-finish').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/chart/wtlx_finish?st=' + st + '&et=' + et + '&export=1';
|
||||||
|
window.location.href= url
|
||||||
|
})
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
|
var myChart = echarts.init(document.getElementById('wtlx1'));
|
||||||
|
var myChartFinish = echarts.init(document.getElementById('wtlx_finish'));
|
||||||
|
var myChart2 = echarts.init(document.getElementById('wtlx2'));
|
||||||
|
|
||||||
|
|
||||||
|
$('input[name="daterange"]').dateRangePicker({
|
||||||
|
showShortcuts: false ,
|
||||||
|
separator:"~",
|
||||||
|
autoClose:true,
|
||||||
|
// ranges:{
|
||||||
|
// 'Today':[moment(),moment()]
|
||||||
|
// },
|
||||||
|
//getValue: function(){
|
||||||
|
// return $('#'+_id).data('timestr');
|
||||||
|
//},
|
||||||
|
setValue: function(s){
|
||||||
|
console.log(s);
|
||||||
|
if ($('input[name="daterange"]').val() != s){
|
||||||
|
var arr = s.split('~');
|
||||||
|
st = arr[0];
|
||||||
|
et = arr[1];
|
||||||
|
getMyChart(myChart,st,et);
|
||||||
|
getMyChartFinish(myChartFinish,st,et);
|
||||||
|
getMyChart2(myChart2,st,et);
|
||||||
|
$('input[name="daterange"]').val(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
getMyChart(myChart);
|
||||||
|
|
||||||
|
/* myChart.showLoading();
|
||||||
|
$.get(pyapi + '/v2/chart/wtlx1', function (data) {
|
||||||
|
myChart.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var series_data_list = [];
|
||||||
|
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i].label_name);
|
||||||
|
var series_data = {
|
||||||
|
name: d.data[i].label_name,
|
||||||
|
type: 'bar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color:d.data[i].data[0].itemStyle.color,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
color: 'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: d.data[i].data,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
series_data_list.push(series_data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: '各项目验收标签分类统计',
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || 'x月份',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.games,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
|
||||||
|
},
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
myChart.setOption(option);
|
||||||
|
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
getMyChartFinish(myChartFinish);
|
||||||
|
|
||||||
|
getMyChart2(myChart2);
|
||||||
|
|
||||||
|
/*myChart2.showLoading();
|
||||||
|
$.get(pyapi + '/v2/chart/wtlx2', function (data) {
|
||||||
|
myChart2.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var series_data_list = [];
|
||||||
|
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i].label_name);
|
||||||
|
var series_data = {
|
||||||
|
name: d.data[i].label_name,
|
||||||
|
type: 'bar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color:d.data[i].data[0].itemStyle.color,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
color: 'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label:{
|
||||||
|
normal:{
|
||||||
|
formatter:'{c}%'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: d.data[i].data,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
series_data_list.push(series_data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: '各项目验收标签top3占比',
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || 'x月份',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true,
|
||||||
|
formatter: '{c}%'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.games,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel:{
|
||||||
|
formatter:'{value}%'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
myChart2.setOption(option);
|
||||||
|
|
||||||
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function getMyChart(ecahrtEle, st, et) {
|
||||||
|
st = st || '';
|
||||||
|
et = et || '';
|
||||||
|
ecahrtEle.showLoading();
|
||||||
|
var url = pyapi + '/v2/chart/wtlx1' + '?st=' + st + '&et=' + et;
|
||||||
|
$.get(url, function (data) {
|
||||||
|
ecahrtEle.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var series_data_list = [];
|
||||||
|
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i].label_name);
|
||||||
|
var series_data = {
|
||||||
|
name: d.data[i].label_name,
|
||||||
|
type: 'bar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color:d.data[i].data[0].itemStyle.color,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
color: 'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: d.data[i].data,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
series_data_list.push(series_data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: d.title.text || '各项目验收标签分类统计',
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || 'x月份',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.games,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
|
||||||
|
},
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
type: 'slider',
|
||||||
|
show: true,
|
||||||
|
xAxisIndex: [0],
|
||||||
|
start: 0,
|
||||||
|
end: 100
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
// myChart.setOption(option);
|
||||||
|
$('input[name="daterange"]').val(d.data_range);
|
||||||
|
ecahrtEle.setOption(option);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMyChartFinish(ecahrtEle, st, et) {
|
||||||
|
st = st || '';
|
||||||
|
et = et || '';
|
||||||
|
ecahrtEle.showLoading();
|
||||||
|
var url = pyapi + '/v2/chart/wtlx_finish' + '?st=' + st + '&et=' + et;
|
||||||
|
$.get(url, function (data) {
|
||||||
|
ecahrtEle.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var series_data_list = [];
|
||||||
|
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i].label_name);
|
||||||
|
var series_data = {
|
||||||
|
name: d.data[i].label_name,
|
||||||
|
type: 'bar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color:d.data[i].data[0].itemStyle.color,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
color: 'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: d.data[i].data,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
series_data_list.push(series_data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: d.title.text || '各项目验收标签分类统计',
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || 'x月份',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.games,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
|
||||||
|
},
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
type: 'slider',
|
||||||
|
show: true,
|
||||||
|
xAxisIndex: [0],
|
||||||
|
start: 0,
|
||||||
|
end: 100
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
// myChart.setOption(option);
|
||||||
|
// $('input[name="daterange"]').val(d.data_range);
|
||||||
|
ecahrtEle.setOption(option);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMyChart2(ecahrtEle, st, et) {
|
||||||
|
st = st || '';
|
||||||
|
et = et || '';
|
||||||
|
ecahrtEle.showLoading();
|
||||||
|
var url = pyapi + '/v2/chart/wtlx2' + '?st=' + st + '&et=' + et;
|
||||||
|
$.get(url, function (data) {
|
||||||
|
ecahrtEle.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var series_data_list = [];
|
||||||
|
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i].label_name);
|
||||||
|
var series_data = {
|
||||||
|
name: d.data[i].label_name,
|
||||||
|
type: 'bar',
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color:d.data[i].data[0].itemStyle.color,
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
color: 'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label:{
|
||||||
|
normal:{
|
||||||
|
formatter:'{c}%'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: d.data[i].data,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
series_data_list.push(series_data);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: d.title.text || '各项目验收标签top3占比',
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || 'x月份',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true},
|
||||||
|
pixelRatio:3
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true,
|
||||||
|
formatter: '{c}%'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.games,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel:{
|
||||||
|
formatter:'{value}%'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
dataZoom: [
|
||||||
|
{
|
||||||
|
type: 'slider',
|
||||||
|
show: true,
|
||||||
|
xAxisIndex: [0],
|
||||||
|
start: 0,
|
||||||
|
end: 100
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
ecahrtEle.setOption(option);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 时间转字符串 天 小时 分钟
|
||||||
|
function rtime2txt(rt) {
|
||||||
|
var txt = '';
|
||||||
|
// 天
|
||||||
|
if (rt > 24 * 3600) {
|
||||||
|
txt = parseInt(rt / (24 * 3600)) + '天';
|
||||||
|
// 小时
|
||||||
|
} else if (rt > 3600) {
|
||||||
|
txt = parseInt(rt / 3600) + '小时'
|
||||||
|
// 分钟
|
||||||
|
} else if (rt > 60) {
|
||||||
|
txt = parseInt(rt / 60) + '分钟'
|
||||||
|
} else {
|
||||||
|
txt = rt + '秒'
|
||||||
|
}
|
||||||
|
|
||||||
|
return txt
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.fc-sun {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-sat {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
414
chart2.php
Normal file
@ -0,0 +1,414 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
|
||||||
|
<link href='timeline/core.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/resource-timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<script src='timeline/core.main.min.js'></script>
|
||||||
|
<script src='timeline/locales-all.min.js'></script>
|
||||||
|
<script src='timeline/interaction.main.min.js'></script>
|
||||||
|
<script src='timeline/timeline.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-common.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-timeline.main.min.js'></script>
|
||||||
|
<script type="text/javascript" src="scripts/echarts.min.js?_<?php filemtime('scripts/echarts.min.js') ?>"></script>
|
||||||
|
<style>
|
||||||
|
a.fc-timeline-event {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="maina" style="margin:15px;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="" style="margin:15px; height: 100%;">
|
||||||
|
<div class="center" style="margin: 0 auto;width: 260px;">
|
||||||
|
<input type="text" name="daterange" readonly style="text-align: center">
|
||||||
|
<button type="button" id="export-workload">导出单量</button>
|
||||||
|
</div>
|
||||||
|
<button type="button" id="export-wtlx_all">导出</button>
|
||||||
|
<div id="wtlx_all" style="margin:15px; height: 100%;">
|
||||||
|
</div>
|
||||||
|
<button type="button" id="export-wtlx1">导出</button>
|
||||||
|
<div id="wtlx1" style="margin:15px; height: 100%;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// var pyapi = 'http://127.0.0.1:5000';
|
||||||
|
// var pyapi = 'http://10.0.0.5:5000';
|
||||||
|
var pyapi = pyapi_host;
|
||||||
|
|
||||||
|
document.getElementById('export-wtlx_all').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/chart/wtlx_all?st=' + st + '&et=' + et + '&export=1';
|
||||||
|
window.location.href= url
|
||||||
|
})
|
||||||
|
|
||||||
|
document.getElementById('export-wtlx1').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/chart2/qa?st=' + st + '&et=' + et + '&export=1';
|
||||||
|
window.location.href= url
|
||||||
|
})
|
||||||
|
|
||||||
|
document.getElementById('export-workload').addEventListener('click',function () {
|
||||||
|
var date = $('input[name="daterange"]').val().split('~')
|
||||||
|
var st = date[0]+'T00:00:00'
|
||||||
|
var et = date[1]+'T23:59:59'
|
||||||
|
|
||||||
|
var url = pyapi + '/v2/export_workload?st=' + st + '&et=' + et;
|
||||||
|
window.location.href= url
|
||||||
|
// $.get(url, function (data) {
|
||||||
|
// debugger
|
||||||
|
// alert('导出完成')
|
||||||
|
// })
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
|
var myChart = echarts.init(document.getElementById('wtlx1'));
|
||||||
|
var myChart_all = echarts.init(document.getElementById('wtlx_all'));
|
||||||
|
getQAChart2(myChart);
|
||||||
|
|
||||||
|
$('input[name="daterange"]').dateRangePicker({
|
||||||
|
showShortcuts: false ,
|
||||||
|
separator:"~",
|
||||||
|
autoClose:true,
|
||||||
|
// ranges:{
|
||||||
|
// 'Today':[moment(),moment()]
|
||||||
|
// },
|
||||||
|
//getValue: function(){
|
||||||
|
// return $('#'+_id).data('timestr');
|
||||||
|
//},
|
||||||
|
setValue: function(s){
|
||||||
|
console.log(s);
|
||||||
|
if ($('input[name="daterange"]').val() != s){
|
||||||
|
var arr = s.split('~');
|
||||||
|
st = arr[0];
|
||||||
|
et = arr[1];
|
||||||
|
getQAChart2(myChart,st,et);
|
||||||
|
getChart_all(myChart_all,st,et);
|
||||||
|
$('input[name="daterange"]').val(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
getChart_all(myChart_all);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function getQAChart2(ecahrtEle, st, et) {
|
||||||
|
st = st || '';
|
||||||
|
et = et || '';
|
||||||
|
ecahrtEle.showLoading();
|
||||||
|
var url = pyapi + '/v2/chart2/qa' + '?st=' + st + '&et=' + et;
|
||||||
|
$.get(url, function (data) {
|
||||||
|
ecahrtEle.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var create_data = [];
|
||||||
|
var finish_data = [];
|
||||||
|
for (var i in d.data) {
|
||||||
|
console.log(d.data[i]);
|
||||||
|
create_data.push({
|
||||||
|
'name':d.data[i].name,
|
||||||
|
'value':d.data[i].create,
|
||||||
|
});
|
||||||
|
finish_data.push({
|
||||||
|
'name':d.data[i].name,
|
||||||
|
'value':d.data[i].finish,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var series_data_list = [
|
||||||
|
{
|
||||||
|
'name':'已验收',
|
||||||
|
'type': 'bar',
|
||||||
|
'itemStyle':{
|
||||||
|
normal:{
|
||||||
|
color:'#334b5c',
|
||||||
|
label:{
|
||||||
|
show:true,
|
||||||
|
position:'top',
|
||||||
|
textStyle:{
|
||||||
|
color:'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'data':finish_data
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name':'新提交',
|
||||||
|
'type': 'bar',
|
||||||
|
'itemStyle':{
|
||||||
|
normal:{
|
||||||
|
color:'#c23531',
|
||||||
|
label:{
|
||||||
|
show:true,
|
||||||
|
position:'top',
|
||||||
|
textStyle:{
|
||||||
|
color:'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'data':create_data
|
||||||
|
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: d.title.text,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || '',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: d.name,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
|
||||||
|
},
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
$('input[name="daterange"]').val(d.data_range);
|
||||||
|
ecahrtEle.setOption(option);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getChart_all(ecahrtEle, st, et) {
|
||||||
|
// var myChart_all = echarts.init(document.getElementById('wtlx_all'));
|
||||||
|
st = st || '';
|
||||||
|
et = et || '';
|
||||||
|
ecahrtEle.showLoading();
|
||||||
|
var url = pyapi + '/v2/chart/wtlx_all' + '?st=' + st + '&et=' + et;
|
||||||
|
$.get(url, function (data) {
|
||||||
|
ecahrtEle.hideLoading();
|
||||||
|
|
||||||
|
// var d = JSON.parse(data);
|
||||||
|
var d = data;
|
||||||
|
|
||||||
|
console.log(d.data);
|
||||||
|
|
||||||
|
var create_data = [];
|
||||||
|
var finish_data = [];
|
||||||
|
var xdata_name = [];
|
||||||
|
for (var i in d.data) {
|
||||||
|
xdata_name.push(d.data[i].name);
|
||||||
|
console.log(d.data[i]);
|
||||||
|
create_data.push({
|
||||||
|
'name':d.data[i].name,
|
||||||
|
'value':d.data[i].create,
|
||||||
|
});
|
||||||
|
finish_data.push({
|
||||||
|
'name':d.data[i].name,
|
||||||
|
'value':d.data[i].finish,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var series_data_list = [
|
||||||
|
{
|
||||||
|
'name':'新提交',
|
||||||
|
'type': 'bar',
|
||||||
|
'itemStyle':{
|
||||||
|
normal:{
|
||||||
|
color:'#c23531',
|
||||||
|
label:{
|
||||||
|
show:true,
|
||||||
|
position:'top',
|
||||||
|
textStyle:{
|
||||||
|
color:'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'data':create_data
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name':'已验收',
|
||||||
|
'type': 'bar',
|
||||||
|
'itemStyle':{
|
||||||
|
normal:{
|
||||||
|
color:'#334b5c',
|
||||||
|
label:{
|
||||||
|
show:true,
|
||||||
|
position:'top',
|
||||||
|
textStyle:{
|
||||||
|
color:'black'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'data':finish_data
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 指定图表的配置项和数据
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: d.title.text,
|
||||||
|
textStyle:{
|
||||||
|
fontSize:25
|
||||||
|
},
|
||||||
|
subtext: d.title.subtext || '',
|
||||||
|
subtextStyle:{
|
||||||
|
fontSize:18
|
||||||
|
},
|
||||||
|
left:'center'
|
||||||
|
},
|
||||||
|
toolbox:{
|
||||||
|
feature: {
|
||||||
|
saveAsImage: {show: true}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid:{
|
||||||
|
top:100,
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
show: true,
|
||||||
|
formatter: '{c}'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: d.legend,
|
||||||
|
top: 60
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
// data: d.games,
|
||||||
|
data: xdata_name,
|
||||||
|
show: true,
|
||||||
|
axisLabel:{
|
||||||
|
interval:0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel:{
|
||||||
|
formatter:'{value}'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
series: series_data_list,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(option);
|
||||||
|
ecahrtEle.setOption(option);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 时间转字符串 天 小时 分钟
|
||||||
|
function rtime2txt(rt) {
|
||||||
|
var txt = '';
|
||||||
|
// 天
|
||||||
|
if (rt > 24 * 3600) {
|
||||||
|
txt = parseInt(rt / (24 * 3600)) + '天';
|
||||||
|
// 小时
|
||||||
|
} else if (rt > 3600) {
|
||||||
|
txt = parseInt(rt / 3600) + '小时'
|
||||||
|
// 分钟
|
||||||
|
} else if (rt > 60) {
|
||||||
|
txt = parseInt(rt / 60) + '分钟'
|
||||||
|
} else {
|
||||||
|
txt = rt + '秒'
|
||||||
|
}
|
||||||
|
|
||||||
|
return txt
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.fc-sun {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-sat {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
5
chkYanQiEverDay.cmd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
curl "http://10.0.0.5/leguwork/?app=api&apiact=chkYanQiEverDay"
|
||||||
|
timeout /T 10
|
||||||
|
curl "http://10.0.0.5/leguwork/?app=api&apiact=get_yqrank"
|
||||||
|
timeout /T 10
|
||||||
|
curl "http://10.0.0.5/leguwork/?app=api&apiact=get_yqrank&act=month"
|
10
createproject.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<div class="pop-over" id="createproject">
|
||||||
|
<div class="header">
|
||||||
|
<span class="header-title">新建看板</span>
|
||||||
|
<a class="headbtn_right close_createproject"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<input type="text" class="addboard_text" placeholder="输入看板名"></input>
|
||||||
|
<button class="button addboard_btnsubmit" type="button" style=" margin: 4px 0 15px 0;">添加</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
BIN
css/arrow-down.gif
Normal file
After Width: | Height: | Size: 49 B |
34
css/base.css
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* CSS Reset
|
||||||
|
----------------------------------------------------------*/
|
||||||
|
html, body, div, span, applet, object, iframe,
|
||||||
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||||
|
a, abbr, acronym, address, big, cite, code,
|
||||||
|
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||||
|
small, strike, strong, sub, sup, tt, var,
|
||||||
|
b, u, i, center,
|
||||||
|
dl, dt, dd, ol, ul, li,
|
||||||
|
fieldset, form, label, legend,
|
||||||
|
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
font-size: 100%;
|
||||||
|
vertical-align: baseline;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
body{
|
||||||
|
font-family: "微软雅黑";
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
a,a:visited{
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #006699;
|
||||||
|
}
|
||||||
|
a:hover{
|
||||||
|
color: #000;
|
||||||
|
}
|
6
css/bootstrap.min.css
vendored
Normal file
423
css/colpick.css
Normal file
@ -0,0 +1,423 @@
|
|||||||
|
/*
|
||||||
|
colpick Color Picker / colpick.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*Main container*/
|
||||||
|
.colpick {
|
||||||
|
position: absolute;
|
||||||
|
width: 346px;
|
||||||
|
height: 170px;
|
||||||
|
overflow: hidden;
|
||||||
|
display: none;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
background:#ebebeb;
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
/*Prevents selecting text when dragging the selectors*/
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
-o-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
.colpick,
|
||||||
|
.colpick * {
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
/*Color selection box*/
|
||||||
|
.colpick_color {
|
||||||
|
position: absolute;
|
||||||
|
left: 7px;
|
||||||
|
top: 7px;
|
||||||
|
width: 156px;
|
||||||
|
height: 156px;
|
||||||
|
overflow: hidden;
|
||||||
|
outline: 1px solid #aaa;
|
||||||
|
cursor: crosshair;
|
||||||
|
}
|
||||||
|
.colpick_color_overlay1 {
|
||||||
|
position: absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
width: 156px;
|
||||||
|
height: 156px;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff'); /* IE6 & IE7 */
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')"; /* IE8 */
|
||||||
|
background: linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0));
|
||||||
|
}
|
||||||
|
.colpick_color_overlay2 {
|
||||||
|
position: absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
width: 156px;
|
||||||
|
height: 156px;
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000'); /* IE6 & IE7 */
|
||||||
|
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')"; /* IE8 */
|
||||||
|
background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,1));
|
||||||
|
}
|
||||||
|
/*HSL gradients are different*/
|
||||||
|
.colpick_hsl .colpick_color_overlay1 {
|
||||||
|
background: linear-gradient(to right, rgba(128,128,128,1) 0%, rgba(128,128,128,0) 100%);
|
||||||
|
}
|
||||||
|
.colpick_hsl .colpick_color_overlay2 {
|
||||||
|
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0) 50%, rgba(0,0,0,1) 100%);
|
||||||
|
}
|
||||||
|
/*Circular color selector*/
|
||||||
|
.colpick_selector_outer {
|
||||||
|
background:none;
|
||||||
|
position: absolute;
|
||||||
|
width: 11px;
|
||||||
|
height: 11px;
|
||||||
|
margin: -6px 0 0 -6px;
|
||||||
|
border: 1px solid black;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.colpick_selector_inner{
|
||||||
|
position: absolute;
|
||||||
|
width: 9px;
|
||||||
|
height: 9px;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
/*Vertical hue bar*/
|
||||||
|
.colpick_hue {
|
||||||
|
position: absolute;
|
||||||
|
top: 6px;
|
||||||
|
left: 175px;
|
||||||
|
width: 19px;
|
||||||
|
height: 156px;
|
||||||
|
border: 1px solid #aaa;
|
||||||
|
cursor: n-resize;
|
||||||
|
}
|
||||||
|
/*Hue bar sliding indicator*/
|
||||||
|
.colpick_hue_arrs {
|
||||||
|
position: absolute;
|
||||||
|
left: -8px;
|
||||||
|
width: 35px;
|
||||||
|
height: 7px;
|
||||||
|
margin: -7px 0 0 0;
|
||||||
|
}
|
||||||
|
.colpick_hue_larr {
|
||||||
|
position:absolute;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-top: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid transparent;
|
||||||
|
border-left: 7px solid #858585;
|
||||||
|
}
|
||||||
|
.colpick_hue_rarr {
|
||||||
|
position:absolute;
|
||||||
|
right:0;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-top: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid transparent;
|
||||||
|
border-right: 7px solid #858585;
|
||||||
|
}
|
||||||
|
/*New color box*/
|
||||||
|
.colpick_new_color {
|
||||||
|
position: absolute;
|
||||||
|
left: 207px;
|
||||||
|
top: 6px;
|
||||||
|
width: 60px;
|
||||||
|
height: 27px;
|
||||||
|
background: #f00;
|
||||||
|
border: 1px solid #8f8f8f;
|
||||||
|
}
|
||||||
|
/*Current color box*/
|
||||||
|
.colpick_current_color {
|
||||||
|
position: absolute;
|
||||||
|
left: 277px;
|
||||||
|
top: 6px;
|
||||||
|
width: 60px;
|
||||||
|
height: 27px;
|
||||||
|
background: #f00;
|
||||||
|
border: 1px solid #8f8f8f;
|
||||||
|
}
|
||||||
|
/*Input field containers*/
|
||||||
|
.colpick_field, .colpick_hex_field {
|
||||||
|
position: absolute;
|
||||||
|
height: 20px;
|
||||||
|
width: 60px;
|
||||||
|
overflow:hidden;
|
||||||
|
background:#f3f3f3;
|
||||||
|
color:#b8b8b8;
|
||||||
|
font-size:12px;
|
||||||
|
border:1px solid #bdbdbd;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.colpick_rgb_r {
|
||||||
|
top: 40px;
|
||||||
|
left: 207px;
|
||||||
|
}
|
||||||
|
.colpick_rgb_g {
|
||||||
|
top: 67px;
|
||||||
|
left: 207px;
|
||||||
|
}
|
||||||
|
.colpick_rgb_b {
|
||||||
|
top: 94px;
|
||||||
|
left: 207px;
|
||||||
|
}
|
||||||
|
.colpick_hsx_h {
|
||||||
|
top: 40px;
|
||||||
|
left: 277px;
|
||||||
|
}
|
||||||
|
.colpick_hsx_s {
|
||||||
|
top: 67px;
|
||||||
|
left: 277px;
|
||||||
|
}
|
||||||
|
.colpick_hsx_x {
|
||||||
|
top: 94px;
|
||||||
|
left: 277px;
|
||||||
|
}
|
||||||
|
.colpick_hex_field {
|
||||||
|
width: 68px;
|
||||||
|
left: 207px;
|
||||||
|
top: 121px;
|
||||||
|
}
|
||||||
|
/*Text field container on focus*/
|
||||||
|
.colpick_focus {
|
||||||
|
border-color: #999;
|
||||||
|
}
|
||||||
|
/*Field label container*/
|
||||||
|
.colpick_field_letter {
|
||||||
|
position: absolute;
|
||||||
|
width: 12px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
padding-left: 4px;
|
||||||
|
background: #efefef;
|
||||||
|
border-right: 1px solid #bdbdbd;
|
||||||
|
font-weight: bold;
|
||||||
|
color:#777;
|
||||||
|
}
|
||||||
|
/*Text inputs*/
|
||||||
|
.colpick_field input, .colpick_hex_field input {
|
||||||
|
position: absolute;
|
||||||
|
right: 11px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
color: #555;
|
||||||
|
text-align: right;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
.colpick_hex_field input {
|
||||||
|
right: 4px;
|
||||||
|
}
|
||||||
|
/*Field up/down arrows*/
|
||||||
|
.colpick_field_arrs {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 9px;
|
||||||
|
height: 21px;
|
||||||
|
cursor: n-resize;
|
||||||
|
}
|
||||||
|
.colpick_field_uarr {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 4px solid transparent;
|
||||||
|
border-right: 4px solid transparent;
|
||||||
|
border-bottom: 4px solid #959595;
|
||||||
|
}
|
||||||
|
.colpick_field_darr {
|
||||||
|
position: absolute;
|
||||||
|
bottom:5px;
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 4px solid transparent;
|
||||||
|
border-right: 4px solid transparent;
|
||||||
|
border-top: 4px solid #959595;
|
||||||
|
}
|
||||||
|
/*Submit/Select button*/
|
||||||
|
.colpick_submit {
|
||||||
|
position: absolute;
|
||||||
|
left: 207px;
|
||||||
|
top: 149px;
|
||||||
|
width: 130px;
|
||||||
|
height: 22px;
|
||||||
|
line-height:22px;
|
||||||
|
background: #efefef;
|
||||||
|
text-align: center;
|
||||||
|
color: #555;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight:bold;
|
||||||
|
border: 1px solid #bdbdbd;
|
||||||
|
-webkit-border-radius: 3px;
|
||||||
|
-moz-border-radius: 3px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.colpick_submit:hover {
|
||||||
|
background:#f3f3f3;
|
||||||
|
border-color:#999;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*full layout with no submit button*/
|
||||||
|
.colpick_full_ns .colpick_submit, .colpick_full_ns .colpick_current_color{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.colpick_full_ns .colpick_new_color {
|
||||||
|
width: 130px;
|
||||||
|
height: 25px;
|
||||||
|
}
|
||||||
|
.colpick_full_ns .colpick_rgb_r, .colpick_full_ns .colpick_hsx_h {
|
||||||
|
top: 42px;
|
||||||
|
}
|
||||||
|
.colpick_full_ns .colpick_rgb_g, .colpick_full_ns .colpick_hsx_s {
|
||||||
|
top: 73px;
|
||||||
|
}
|
||||||
|
.colpick_full_ns .colpick_rgb_b, .colpick_full_ns .colpick_hsx_x {
|
||||||
|
top: 104px;
|
||||||
|
}
|
||||||
|
.colpick_full_ns .colpick_hex_field {
|
||||||
|
top: 135px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*rgbhex layout*/
|
||||||
|
.colpick_rgbhex .colpick_hsx_h, .colpick_rgbhex .colpick_hsx_s, .colpick_rgbhex .colpick_hsx_x {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex {
|
||||||
|
width:282px;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex .colpick_field, .colpick_rgbhex .colpick_submit {
|
||||||
|
width:68px;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex .colpick_new_color {
|
||||||
|
width:34px;
|
||||||
|
border-right:none;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex .colpick_current_color {
|
||||||
|
width:34px;
|
||||||
|
left:240px;
|
||||||
|
border-left:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*rgbhex layout, no submit button*/
|
||||||
|
.colpick_rgbhex_ns .colpick_submit, .colpick_rgbhex_ns .colpick_current_color{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex_ns .colpick_new_color{
|
||||||
|
width:68px;
|
||||||
|
border: 1px solid #8f8f8f;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex_ns .colpick_rgb_r {
|
||||||
|
top: 42px;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex_ns .colpick_rgb_g {
|
||||||
|
top: 73px;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex_ns .colpick_rgb_b {
|
||||||
|
top: 104px;
|
||||||
|
}
|
||||||
|
.colpick_rgbhex_ns .colpick_hex_field {
|
||||||
|
top: 135px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*hex layout*/
|
||||||
|
.colpick_hex .colpick_hsx_h, .colpick_hex .colpick_hsx_s, .colpick_hex .colpick_hsx_x, .colpick_hex .colpick_rgb_r, .colpick_hex .colpick_rgb_g, .colpick_hex .colpick_rgb_b {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.colpick_hex {
|
||||||
|
width:206px;
|
||||||
|
height:201px;
|
||||||
|
}
|
||||||
|
.colpick_hex .colpick_hex_field {
|
||||||
|
width:72px;
|
||||||
|
height:25px;
|
||||||
|
top:168px;
|
||||||
|
left:80px;
|
||||||
|
}
|
||||||
|
.colpick_hex .colpick_hex_field div, .colpick_hex .colpick_hex_field input {
|
||||||
|
height: 25px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
.colpick_hex .colpick_new_color {
|
||||||
|
left:9px;
|
||||||
|
top:168px;
|
||||||
|
width:30px;
|
||||||
|
border-right:none;
|
||||||
|
}
|
||||||
|
.colpick_hex .colpick_current_color {
|
||||||
|
left:39px;
|
||||||
|
top:168px;
|
||||||
|
width:30px;
|
||||||
|
border-left:none;
|
||||||
|
}
|
||||||
|
.colpick_hex .colpick_submit {
|
||||||
|
left:164px;
|
||||||
|
top: 168px;
|
||||||
|
width:30px;
|
||||||
|
height:25px;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*hex layout, no submit button*/
|
||||||
|
.colpick_hex_ns .colpick_submit, .colpick_hex_ns .colpick_current_color {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.colpick_hex_ns .colpick_hex_field {
|
||||||
|
width:80px;
|
||||||
|
}
|
||||||
|
.colpick_hex_ns .colpick_new_color{
|
||||||
|
width:60px;
|
||||||
|
border: 1px solid #8f8f8f;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Dark color scheme*/
|
||||||
|
.colpick_dark {
|
||||||
|
background: #161616;
|
||||||
|
border-color: #2a2a2a;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_color {
|
||||||
|
outline-color: #333;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_hue {
|
||||||
|
border-color: #555;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_field, .colpick_dark .colpick_hex_field {
|
||||||
|
background: #101010;
|
||||||
|
border-color: #2d2d2d;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_field_letter {
|
||||||
|
background: #131313;
|
||||||
|
border-color: #2d2d2d;
|
||||||
|
color: #696969;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_field input, .colpick_dark .colpick_hex_field input {
|
||||||
|
color: #7a7a7a;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_field_uarr {
|
||||||
|
border-bottom-color:#696969;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_field_darr {
|
||||||
|
border-top-color:#696969;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_focus {
|
||||||
|
border-color:#444;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_submit {
|
||||||
|
background: #131313;
|
||||||
|
border-color:#2d2d2d;
|
||||||
|
color:#7a7a7a;
|
||||||
|
}
|
||||||
|
.colpick_dark .colpick_submit:hover {
|
||||||
|
background-color:#101010;
|
||||||
|
border-color:#444;
|
||||||
|
}
|
232
css/daterangepicker.css
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
.date-picker
|
||||||
|
{
|
||||||
|
width:170px;
|
||||||
|
height:25px;
|
||||||
|
padding:0;
|
||||||
|
border:0;
|
||||||
|
line-height:25px;
|
||||||
|
padding-left:10px;
|
||||||
|
font-size:12px;
|
||||||
|
font-family:Arial;
|
||||||
|
font-weight:bold;
|
||||||
|
cursor:pointer;
|
||||||
|
color:#303030;
|
||||||
|
position:relative;
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper
|
||||||
|
{
|
||||||
|
position:absolute;
|
||||||
|
z-index:30;
|
||||||
|
border:1px solid #bfbfbf;
|
||||||
|
background-color:#efefef;
|
||||||
|
width:428px;
|
||||||
|
padding: 5px 12px;
|
||||||
|
font-size:12px;
|
||||||
|
line-height:20px;
|
||||||
|
color:#aaa;
|
||||||
|
font-family:Arial;
|
||||||
|
box-shadow:3px 3px 10px rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
.date-picker-wrapper.single-date {
|
||||||
|
width:auto;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper.no-shortcuts { padding-bottom:12px;}
|
||||||
|
.date-picker-wrapper .footer
|
||||||
|
{
|
||||||
|
font-size:11px;
|
||||||
|
padding-top: 3px;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper b
|
||||||
|
{
|
||||||
|
color:#666;
|
||||||
|
font-weight:700;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper a
|
||||||
|
{
|
||||||
|
color: rgb(107, 180, 214);
|
||||||
|
text-decoration:underline;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-name
|
||||||
|
{
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper
|
||||||
|
{
|
||||||
|
border:1px solid #bfbfbf;
|
||||||
|
border-radius:3px;
|
||||||
|
background-color:#fff;
|
||||||
|
padding:5px;
|
||||||
|
cursor:default;
|
||||||
|
position:relative;
|
||||||
|
_overflow:hidden;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table
|
||||||
|
{
|
||||||
|
width:190px;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table.month2
|
||||||
|
{
|
||||||
|
width:190px;
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table th,
|
||||||
|
.date-picker-wrapper .month-wrapper table td
|
||||||
|
{
|
||||||
|
vertical-align:middle;
|
||||||
|
text-align:center;
|
||||||
|
line-height:14px;
|
||||||
|
margin : 0px;
|
||||||
|
padding : 0px;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table .day
|
||||||
|
{
|
||||||
|
height:19px;
|
||||||
|
line-height:19px;
|
||||||
|
font-size:12px;
|
||||||
|
margin-bottom:1px;
|
||||||
|
color:#999;
|
||||||
|
cursor:default;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table div.day.lastMonth,
|
||||||
|
.date-picker-wrapper .month-wrapper table div.day.nextMonth
|
||||||
|
{
|
||||||
|
color:#999;
|
||||||
|
cursor:default;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table .day.checked
|
||||||
|
{
|
||||||
|
background-color: rgba(156, 219, 247, 0.5);
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .month-wrapper table .week-name
|
||||||
|
{
|
||||||
|
height:20px;
|
||||||
|
line-height:20px;
|
||||||
|
font-weight:100;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker-wrapper .month-wrapper table .day.has-tooltip { cursor:help !important;}
|
||||||
|
|
||||||
|
.date-picker-wrapper .month-wrapper table .day.toMonth.valid
|
||||||
|
{
|
||||||
|
color:#333;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker-wrapper .month-wrapper table .day.real-today { background-color: rgb(255, 230, 132); }
|
||||||
|
.date-picker-wrapper .month-wrapper table .day.real-today.checked { background-color: rgb(112, 204, 213); }
|
||||||
|
|
||||||
|
|
||||||
|
.date-picker-wrapper table .caption
|
||||||
|
{
|
||||||
|
height:40px;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper table .caption .next,
|
||||||
|
.date-picker-wrapper table .caption .prev
|
||||||
|
{
|
||||||
|
padding:0 5px;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper table .caption .next:hover,
|
||||||
|
.date-picker-wrapper table .caption .prev:hover
|
||||||
|
{
|
||||||
|
background-color:#ccc;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .gap
|
||||||
|
{
|
||||||
|
position:absolute;
|
||||||
|
display:none;
|
||||||
|
top:0px;
|
||||||
|
left:204px;
|
||||||
|
z-index: 1;
|
||||||
|
width:15px;
|
||||||
|
height: 100%;
|
||||||
|
background-color:red;
|
||||||
|
font-size:0;
|
||||||
|
line-height:0;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .gap .gap-lines { height: 100%; overflow:hidden; }
|
||||||
|
.date-picker-wrapper .gap .gap-line { height:15px;width:15px; position:relative; }
|
||||||
|
.date-picker-wrapper .gap .gap-line .gap-1 { z-index:1; height:0; border-left:8px solid white; border-top:8px solid #eee;border-bottom:8px solid #eee; }
|
||||||
|
.date-picker-wrapper .gap .gap-line .gap-2 { position:absolute; right:0; top:0px; z-index:2; height:0; border-left:8px solid transparent; border-top:8px solid white; }
|
||||||
|
.date-picker-wrapper .gap .gap-line .gap-3 { position:absolute; right:0; top:8px; z-index:2; height:0; border-left:8px solid transparent; border-bottom:8px solid white; }
|
||||||
|
.date-picker-wrapper .gap .gap-top-mask { width: 6px; height:1px; position:absolute; top: -1px; left: 1px; background-color: #eee; z-index:3; }
|
||||||
|
.date-picker-wrapper .gap .gap-bottom-mask { width: 6px; height:1px; position:absolute; bottom: -1px; left: 7px; background-color: #eee; z-index:3; }
|
||||||
|
|
||||||
|
.date-picker-wrapper .selected-days
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .drp_top-bar
|
||||||
|
{
|
||||||
|
line-height:40px;
|
||||||
|
height:40px;
|
||||||
|
position:relative;
|
||||||
|
}
|
||||||
|
.date-picker-wrapper .drp_top-bar .error-top { display:none; }
|
||||||
|
.date-picker-wrapper .drp_top-bar .normal-top { display:none; }
|
||||||
|
.date-picker-wrapper .drp_top-bar .default-top { display:block; }
|
||||||
|
|
||||||
|
.date-picker-wrapper .drp_top-bar.error .default-top { display:none; }
|
||||||
|
.date-picker-wrapper .drp_top-bar.error .error-top { display:block; color:red; }
|
||||||
|
|
||||||
|
.date-picker-wrapper .drp_top-bar.normal .default-top { display:none; }
|
||||||
|
.date-picker-wrapper .drp_top-bar.normal .normal-top { display:block; }
|
||||||
|
|
||||||
|
.date-picker-wrapper .drp_top-bar .apply-btn
|
||||||
|
{
|
||||||
|
position:absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: 6px;
|
||||||
|
padding:3px 5px;
|
||||||
|
margin:0;
|
||||||
|
font-size:12px;
|
||||||
|
border-radius:4px;
|
||||||
|
cursor:pointer;
|
||||||
|
|
||||||
|
color: #d9eef7;
|
||||||
|
border: solid 1px #0076a3;
|
||||||
|
background: #0095cd;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
|
||||||
|
background: -moz-linear-gradient(top, #00adee, #0078a5);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-picker-wrapper .drp_top-bar .apply-btn.disabled
|
||||||
|
{
|
||||||
|
cursor: pointer;
|
||||||
|
color: #606060;
|
||||||
|
border: solid 1px #b7b7b7;
|
||||||
|
background: #fff;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
|
||||||
|
background: -moz-linear-gradient(top, #fff, #ededed);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed');
|
||||||
|
}
|
||||||
|
/*time styling*/
|
||||||
|
.time {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.time input[type=range] {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.time1, .time2 {
|
||||||
|
width: 180px;
|
||||||
|
padding: 0 5px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.time1 {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.time2 {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.hour, .minute {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
2337
css/font-awesome.css
vendored
Normal file
4
css/font-awesome.min.css
vendored
Normal file
587
css/fullcalendar.css
Normal file
@ -0,0 +1,587 @@
|
|||||||
|
/*!
|
||||||
|
* FullCalendar v1.6.0 Stylesheet
|
||||||
|
* Docs & License: http://arshaw.com/fullcalendar/
|
||||||
|
* (c) 2013 Adam Shaw
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
.fc {
|
||||||
|
direction: ltr;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html .fc,
|
||||||
|
.fc table {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc td,
|
||||||
|
.fc th {
|
||||||
|
padding: 0;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Header
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-header td {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header-left {
|
||||||
|
width: 25%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header-right {
|
||||||
|
width: 25%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header-title {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header-title h2 {
|
||||||
|
margin-top: 0; font-size:16px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .fc-header-space {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header .fc-button {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* buttons edges butting together */
|
||||||
|
|
||||||
|
.fc-header .fc-button {
|
||||||
|
margin-right: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header .fc-corner-right, /* non-theme */
|
||||||
|
.fc-header .ui-corner-right { /* theme */
|
||||||
|
margin-right: 0; /* back to normal */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* button layering (for border precedence) */
|
||||||
|
|
||||||
|
.fc-header .fc-state-hover,
|
||||||
|
.fc-header .ui-state-hover {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header .fc-state-down {
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-header .fc-state-active,
|
||||||
|
.fc-header .ui-state-active {
|
||||||
|
z-index: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Content
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-content {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-view {
|
||||||
|
width: 100%; /* needed for view switching (when view is absolute) */
|
||||||
|
overflow: hidden;
|
||||||
|
background:#fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Cell Styles
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-widget-header, /* <th>, usually */
|
||||||
|
.fc-widget-content { /* <td>, usually */
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-widget-header{background:#f7f7f7}
|
||||||
|
|
||||||
|
.fc-state-highlight { /* <td> today cell */ /* TODO: add .fc-today to <th> */
|
||||||
|
background: #fcf8e3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-cell-overlay { /* semi-transparent rectangle while dragging */
|
||||||
|
background: #bce8f1;
|
||||||
|
opacity: .3;
|
||||||
|
filter: alpha(opacity=30); /* for IE */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Buttons
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-button {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 .6em;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 1.9em;
|
||||||
|
line-height: 1.9em;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-default { /* non-theme */
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-default.fc-corner-left { /* non-theme */
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-default.fc-corner-right { /* non-theme */
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Our default prev/next buttons use HTML entities like ‹ › « »
|
||||||
|
and we'll try to make them look good cross-browser.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fc-text-arrow {
|
||||||
|
margin: 0 .1em;
|
||||||
|
font-size: 2em;
|
||||||
|
font-family: "Courier New", Courier, monospace;
|
||||||
|
vertical-align: baseline; /* for IE7 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-button-prev .fc-text-arrow,
|
||||||
|
.fc-button-next .fc-text-arrow { /* for ‹ › */
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* icon (for jquery ui) */
|
||||||
|
|
||||||
|
.fc-button .fc-icon-wrap {
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-button .ui-icon {
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
margin-top: -50%;
|
||||||
|
*margin-top: 0;
|
||||||
|
*top: -50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
button states
|
||||||
|
borrowed from twitter bootstrap (http://twitter.github.com/bootstrap/)
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fc-state-default {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
||||||
|
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
||||||
|
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
||||||
|
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
||||||
|
color: #333;
|
||||||
|
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||||
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-hover,
|
||||||
|
.fc-state-down,
|
||||||
|
.fc-state-active,
|
||||||
|
.fc-state-disabled {
|
||||||
|
color: #333333;
|
||||||
|
background-color: #e6e6e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-hover {
|
||||||
|
color: #333333;
|
||||||
|
text-decoration: none;
|
||||||
|
background-position: 0 -15px;
|
||||||
|
-webkit-transition: background-position 0.1s linear;
|
||||||
|
-moz-transition: background-position 0.1s linear;
|
||||||
|
-o-transition: background-position 0.1s linear;
|
||||||
|
transition: background-position 0.1s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-down,
|
||||||
|
.fc-state-active {
|
||||||
|
background-color: #cccccc;
|
||||||
|
background-image: none;
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-state-disabled {
|
||||||
|
cursor: default;
|
||||||
|
background-image: none;
|
||||||
|
opacity: 0.65;
|
||||||
|
filter: alpha(opacity=65);
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Global Event Styles
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-event {
|
||||||
|
/* default BORDER color */
|
||||||
|
background-color: #3a87ad; /* default BACKGROUND color */
|
||||||
|
color: #fff; /* default TEXT color */
|
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||||
|
font-size: .85em;
|
||||||
|
padding:2px;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
a.fc-event{color:#fff}
|
||||||
|
|
||||||
|
.eventboardtitle{font-size:8px !important;color:#ddd;transform: scale(0.5)}
|
||||||
|
|
||||||
|
a.fc-event {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.fc-event,
|
||||||
|
.fc-event-draggable {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-rtl .fc-event {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-inner {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-time,
|
||||||
|
.fc-event-title {
|
||||||
|
padding: 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .ui-resizable-handle {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 99999;
|
||||||
|
overflow: hidden; /* hacky spaces (IE6/7) */
|
||||||
|
font-size: 300%; /* */
|
||||||
|
line-height: 50%; /* */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fc-view-month td.fc-last{background: url(../img/calendar-rest-bg.png);}
|
||||||
|
|
||||||
|
/* Horizontal Events
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-event-hori {
|
||||||
|
border-width: 1px 0;
|
||||||
|
margin-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-ltr .fc-event-hori.fc-event-start,
|
||||||
|
.fc-rtl .fc-event-hori.fc-event-end {
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-ltr .fc-event-hori.fc-event-end,
|
||||||
|
.fc-rtl .fc-event-hori.fc-event-start {
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* resizable */
|
||||||
|
|
||||||
|
.fc-event-hori .ui-resizable-e {
|
||||||
|
top: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||||
|
right: -3px !important;
|
||||||
|
width: 7px !important;
|
||||||
|
height: 100% !important;
|
||||||
|
cursor: e-resize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-hori .ui-resizable-w {
|
||||||
|
top: 0 !important;
|
||||||
|
left: -3px !important;
|
||||||
|
width: 7px !important;
|
||||||
|
height: 100% !important;
|
||||||
|
cursor: w-resize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-hori .ui-resizable-handle {
|
||||||
|
_padding-bottom: 14px; /* IE6 had 0 height */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Reusable Separate-border Table
|
||||||
|
------------------------------------------------------------*/
|
||||||
|
|
||||||
|
table.fc-border-separate {
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-border-separate th,
|
||||||
|
.fc-border-separate td {
|
||||||
|
border-width: 1px 0 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-border-separate th.fc-last,
|
||||||
|
.fc-border-separate td.fc-last {
|
||||||
|
border-right-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-border-separate tr.fc-last th,
|
||||||
|
.fc-border-separate tr.fc-last td {
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-border-separate tbody tr.fc-first td,
|
||||||
|
.fc-border-separate tbody tr.fc-first th {
|
||||||
|
border-top-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Month View, Basic Week View, Basic Day View
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-grid th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .fc-week-number {
|
||||||
|
width: 22px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .fc-week-number div {
|
||||||
|
padding: 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-grid .fc-day-number {
|
||||||
|
float: right;
|
||||||
|
padding: 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-grid .fc-other-month .fc-day-number {
|
||||||
|
opacity: 0.3;
|
||||||
|
filter: alpha(opacity=30); /* for IE */
|
||||||
|
/* opacity with small font can sometimes look too faded
|
||||||
|
might want to set the 'color' property instead
|
||||||
|
making day-numbers bold also fixes the problem */
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-grid .fc-day-content {
|
||||||
|
clear: both;
|
||||||
|
padding: 2px 2px 1px; /* distance between events and day edges */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* event styles */
|
||||||
|
|
||||||
|
.fc-grid .fc-event-time {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* right-to-left */
|
||||||
|
|
||||||
|
.fc-rtl .fc-grid .fc-day-number {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-rtl .fc-grid .fc-event-time {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Agenda Week View, Agenda Day View
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-agenda table {
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-days th {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda .fc-agenda-axis {
|
||||||
|
width: 50px;
|
||||||
|
padding: 0 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-align: right;
|
||||||
|
white-space: nowrap;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda .fc-week-number {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda .fc-day-content {
|
||||||
|
padding: 2px 2px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* make axis border take precedence */
|
||||||
|
|
||||||
|
.fc-agenda-days .fc-agenda-axis {
|
||||||
|
border-right-width: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-days .fc-col0 {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* all-day area */
|
||||||
|
|
||||||
|
.fc-agenda-allday th {
|
||||||
|
border-width: 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-allday .fc-day-content {
|
||||||
|
min-height: 34px; /* TODO: doesnt work well in quirksmode */
|
||||||
|
_height: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* divider (between all-day and slots) */
|
||||||
|
|
||||||
|
.fc-agenda-divider-inner {
|
||||||
|
height: 2px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-widget-header .fc-agenda-divider-inner {
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* slot rows */
|
||||||
|
|
||||||
|
.fc-agenda-slots th {
|
||||||
|
border-width: 1px 1px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-slots td {
|
||||||
|
border-width: 1px 0 0;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-slots td div {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-slots tr.fc-slot0 th,
|
||||||
|
.fc-agenda-slots tr.fc-slot0 td {
|
||||||
|
border-top-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-slots tr.fc-minor th,
|
||||||
|
.fc-agenda-slots tr.fc-minor td {
|
||||||
|
border-top-style: dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda-slots tr.fc-minor th.ui-widget-header {
|
||||||
|
*border-top-style: solid; /* doesn't work with background in IE6/7 */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Vertical Events
|
||||||
|
------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
.fc-event-vert {
|
||||||
|
border-width: 0 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-vert.fc-event-start {
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-top-left-radius: 3px;
|
||||||
|
border-top-right-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-vert.fc-event-end {
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-vert .fc-event-time {
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-vert .fc-event-inner {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #fff;
|
||||||
|
opacity: .3;
|
||||||
|
filter: alpha(opacity=30);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
|
||||||
|
.fc-select-helper .fc-event-bg {
|
||||||
|
display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* resizable */
|
||||||
|
|
||||||
|
.fc-event-vert .ui-resizable-s {
|
||||||
|
bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
|
||||||
|
width: 100% !important;
|
||||||
|
height: 8px !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
line-height: 8px !important;
|
||||||
|
font-size: 11px !important;
|
||||||
|
font-family: monospace;
|
||||||
|
text-align: center;
|
||||||
|
cursor: s-resize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fc-agenda .ui-resizable-resizing { /* TODO: better selector */
|
||||||
|
_overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
BIN
css/images/ui-icons_444444_256x240.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
css/images/ui-icons_555555_256x240.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
css/images/ui-icons_777777_256x240.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
css/images/ui-icons_ffffff_256x240.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
1311
css/jquery-ui.css
vendored
Normal file
72
css/jquery.atwho.css
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
.atwho-view {
|
||||||
|
position:absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: none;
|
||||||
|
margin-top: 18px;
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 0 5px rgba(0,0,0,0.1);
|
||||||
|
min-width: 120px;
|
||||||
|
z-index: 11110 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-view .atwho-header {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: solid 1px #eaeff1;
|
||||||
|
color: #6f8092;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-view .atwho-header .small {
|
||||||
|
color: #6f8092;
|
||||||
|
float: right;
|
||||||
|
padding-top: 2px;
|
||||||
|
margin-right: -5px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-view .atwho-header:hover {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-view .cur {
|
||||||
|
background: #3366FF;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.atwho-view .cur small {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.atwho-view strong {
|
||||||
|
color: #3366FF;
|
||||||
|
}
|
||||||
|
.atwho-view .cur strong {
|
||||||
|
color: white;
|
||||||
|
font:bold;
|
||||||
|
}
|
||||||
|
.atwho-view ul {
|
||||||
|
/* width: 100px; */
|
||||||
|
list-style:none;
|
||||||
|
padding:0;
|
||||||
|
margin:auto;
|
||||||
|
max-height: 200px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.atwho-view ul li {
|
||||||
|
display: block;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-bottom: 1px solid #DDD;
|
||||||
|
cursor: pointer;
|
||||||
|
/* border-top: 1px solid #C8C8C8; */
|
||||||
|
}
|
||||||
|
.atwho-view small {
|
||||||
|
font-size: smaller;
|
||||||
|
color: #777;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
559
css/jquery.mCustomScrollbar.css
Normal file
@ -0,0 +1,559 @@
|
|||||||
|
/* basic scrollbar styling */
|
||||||
|
/* vertical scrollbar */
|
||||||
|
.mCSB_container{
|
||||||
|
width:auto;
|
||||||
|
margin-right:0px;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
.mCSB_container.mCS_no_scrollbar{
|
||||||
|
margin-right:0;
|
||||||
|
}
|
||||||
|
.mCS_disabled>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar,
|
||||||
|
.mCS_destroyed>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar{
|
||||||
|
margin-right:30px;
|
||||||
|
}
|
||||||
|
.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
width:16px;
|
||||||
|
height:100%;
|
||||||
|
top:0;
|
||||||
|
right:0;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_draggerContainer{
|
||||||
|
position:absolute;
|
||||||
|
top:0;
|
||||||
|
left:0;
|
||||||
|
bottom:0;
|
||||||
|
right:0;
|
||||||
|
height:auto;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||||
|
margin:20px 0;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:2px;
|
||||||
|
height:100%;
|
||||||
|
margin:0 auto;
|
||||||
|
-webkit-border-radius:10px;
|
||||||
|
-moz-border-radius:10px;
|
||||||
|
border-radius:10px;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_dragger{
|
||||||
|
cursor:pointer;
|
||||||
|
width:100%;
|
||||||
|
height:30px;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:4px;
|
||||||
|
height:100%;
|
||||||
|
margin:0 auto;
|
||||||
|
-webkit-border-radius:10px;
|
||||||
|
-moz-border-radius:10px;
|
||||||
|
border-radius:10px;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonUp,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
display:block;
|
||||||
|
position:relative;
|
||||||
|
height:20px;
|
||||||
|
overflow:hidden;
|
||||||
|
margin:0 auto;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
top:100%;
|
||||||
|
margin-top:-40px;
|
||||||
|
}
|
||||||
|
/* horizontal scrollbar */
|
||||||
|
.mCSB_horizontal>.mCSB_container{
|
||||||
|
height:100%;
|
||||||
|
margin-right:0;
|
||||||
|
margin-bottom:30px;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||||
|
margin-bottom:0;
|
||||||
|
}
|
||||||
|
.mCS_disabled>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar,
|
||||||
|
.mCS_destroyed>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||||
|
margin-right:0;
|
||||||
|
margin-bottom:30px;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
width:100%;
|
||||||
|
height:16px;
|
||||||
|
top:auto;
|
||||||
|
right:auto;
|
||||||
|
bottom:0;
|
||||||
|
left:0;
|
||||||
|
overflow:hidden;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||||
|
margin:0 20px;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
height:2px;
|
||||||
|
margin:7px 0;
|
||||||
|
-webkit-border-radius:10px;
|
||||||
|
-moz-border-radius:10px;
|
||||||
|
border-radius:10px;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger{
|
||||||
|
width:30px;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px auto;
|
||||||
|
-webkit-border-radius:10px;
|
||||||
|
-moz-border-radius:10px;
|
||||||
|
border-radius:10px;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonLeft,
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
display:block;
|
||||||
|
position:relative;
|
||||||
|
width:20px;
|
||||||
|
height:100%;
|
||||||
|
overflow:hidden;
|
||||||
|
margin:0 auto;
|
||||||
|
cursor:pointer;
|
||||||
|
float:left;
|
||||||
|
}
|
||||||
|
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
margin-left:-40px;
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
.mCustomScrollBox{
|
||||||
|
-ms-touch-action:none; /*MSPointer events - direct all pointer events to js*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* default scrollbar colors and backgrounds (default theme) */
|
||||||
|
.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
opacity:0.75;
|
||||||
|
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCustomScrollBox:hover>.mCSB_scrollTools{
|
||||||
|
opacity:1;
|
||||||
|
filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.4);
|
||||||
|
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.75);
|
||||||
|
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.85);
|
||||||
|
filter:"alpha(opacity=85)"; -ms-filter:"alpha(opacity=85)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.9);
|
||||||
|
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonUp,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonLeft,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-image:url(../mCSB_buttons.png);
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
opacity:0.4;
|
||||||
|
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:0 0;
|
||||||
|
/*
|
||||||
|
sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:0 -20px;
|
||||||
|
/*
|
||||||
|
sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:0 -40px;
|
||||||
|
/*
|
||||||
|
sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:0 -56px;
|
||||||
|
/*
|
||||||
|
sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonUp:hover,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown:hover,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonLeft:hover,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonRight:hover{
|
||||||
|
opacity:0.75;
|
||||||
|
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||||
|
}
|
||||||
|
.mCSB_scrollTools .mCSB_buttonUp:active,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonDown:active,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonLeft:active,
|
||||||
|
.mCSB_scrollTools .mCSB_buttonRight:active{
|
||||||
|
opacity:0.9;
|
||||||
|
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*scrollbar themes*/
|
||||||
|
/*dark (dark colored scrollbar)*/
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.15);
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.35);
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.85);
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.9);
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-80px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-80px -20px;
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-80px -40px;
|
||||||
|
}
|
||||||
|
.mCS-dark>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-80px -56px;
|
||||||
|
}
|
||||||
|
/*light-2*/
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:4px;
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.1);
|
||||||
|
-webkit-border-radius:1px;
|
||||||
|
-moz-border-radius:1px;
|
||||||
|
border-radius:1px;
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:4px;
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.75);
|
||||||
|
-webkit-border-radius:1px;
|
||||||
|
-moz-border-radius:1px;
|
||||||
|
border-radius:1px;
|
||||||
|
}
|
||||||
|
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px 0;
|
||||||
|
}
|
||||||
|
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px auto;
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.85);
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.9);
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-32px 0;
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-32px -20px;
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-40px -40px;
|
||||||
|
}
|
||||||
|
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-40px -56px;
|
||||||
|
}
|
||||||
|
/*dark-2*/
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:4px;
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.1);
|
||||||
|
-webkit-border-radius:1px;
|
||||||
|
-moz-border-radius:1px;
|
||||||
|
border-radius:1px;
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:4px;
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.75);
|
||||||
|
-webkit-border-radius:1px;
|
||||||
|
-moz-border-radius:1px;
|
||||||
|
border-radius:1px;
|
||||||
|
}
|
||||||
|
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px auto;
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.85);
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.9);
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-112px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-112px -20px;
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-120px -40px;
|
||||||
|
}
|
||||||
|
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-120px -56px;
|
||||||
|
}
|
||||||
|
/*light-thick*/
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:4px;
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.1);
|
||||||
|
-webkit-border-radius:2px;
|
||||||
|
-moz-border-radius:2px;
|
||||||
|
border-radius:2px;
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:6px;
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.75);
|
||||||
|
-webkit-border-radius:2px;
|
||||||
|
-moz-border-radius:2px;
|
||||||
|
border-radius:2px;
|
||||||
|
}
|
||||||
|
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px 0;
|
||||||
|
}
|
||||||
|
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:6px;
|
||||||
|
margin:5px auto;
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.85);
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.9);
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-16px 0;
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-16px -20px;
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-20px -40px;
|
||||||
|
}
|
||||||
|
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-20px -56px;
|
||||||
|
}
|
||||||
|
/*dark-thick*/
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:4px;
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.1);
|
||||||
|
-webkit-border-radius:2px;
|
||||||
|
-moz-border-radius:2px;
|
||||||
|
border-radius:2px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:6px;
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.75);
|
||||||
|
-webkit-border-radius:2px;
|
||||||
|
-moz-border-radius:2px;
|
||||||
|
border-radius:2px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
height:4px;
|
||||||
|
margin:6px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:6px;
|
||||||
|
margin:5px auto;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.85);
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.9);
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-96px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-96px -20px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-100px -40px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-100px -56px;
|
||||||
|
}
|
||||||
|
/*light-thin*/
|
||||||
|
.mCS-light-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
background:#fff; /* rgba fallback */
|
||||||
|
background:rgba(255,255,255,0.1);
|
||||||
|
}
|
||||||
|
.mCS-light-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:2px;
|
||||||
|
}
|
||||||
|
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:2px;
|
||||||
|
margin:7px auto;
|
||||||
|
}
|
||||||
|
/*dark-thin*/
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.15);
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:2px;
|
||||||
|
background:#000; /* rgba fallback */
|
||||||
|
background:rgba(0,0,0,0.35);
|
||||||
|
}
|
||||||
|
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:100%;
|
||||||
|
height:2px;
|
||||||
|
margin:7px auto;
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.85);
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(0,0,0,0.9);
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonUp{
|
||||||
|
background-position:-80px 0;
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonDown{
|
||||||
|
background-position:-80px -20px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||||
|
background-position:-80px -40px;
|
||||||
|
}
|
||||||
|
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonRight{
|
||||||
|
background-position:-80px -56px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* custom styling */
|
||||||
|
/* content_1 scrollbar */
|
||||||
|
.content_1>.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
height:96%;
|
||||||
|
top:2%;
|
||||||
|
}
|
||||||
|
/* content_2 scrollbar */
|
||||||
|
.content_2 .mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:6px;
|
||||||
|
box-shadow:1px 1px 1px rgba(255,255,255,0.1);
|
||||||
|
}
|
||||||
|
.content_2 .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.4);
|
||||||
|
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||||
|
}
|
||||||
|
.content_2 .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.5);
|
||||||
|
filter:"alpha(opacity=50)"; -ms-filter:"alpha(opacity=50)"; /* old ie */
|
||||||
|
}
|
||||||
|
.content_2 .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.content_2 .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:rgba(255,255,255,0.6);
|
||||||
|
filter:"alpha(opacity=60)"; -ms-filter:"alpha(opacity=60)"; /* old ie */
|
||||||
|
}
|
||||||
|
/* content_3 scrollbar */
|
||||||
|
.content_3>.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
height:94%;
|
||||||
|
top:3%;
|
||||||
|
}
|
||||||
|
.content_3 .mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:0;
|
||||||
|
border-right:1px dashed #09C;
|
||||||
|
}
|
||||||
|
.content_3 .mCSB_scrollTools .mCSB_dragger{
|
||||||
|
height:11px;
|
||||||
|
}
|
||||||
|
.content_3 .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:11px;
|
||||||
|
-webkit-border-radius:11px;
|
||||||
|
-moz-border-radius:11px;
|
||||||
|
border-radius:11px;
|
||||||
|
background:#09C;
|
||||||
|
}
|
||||||
|
/* content_4 scrollbar */
|
||||||
|
.content_4>.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
height:94%;
|
||||||
|
top:3%;
|
||||||
|
}
|
||||||
|
.content_4 .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||||
|
width:8px;
|
||||||
|
-webkit-border-radius:2px;
|
||||||
|
-moz-border-radius:2px;
|
||||||
|
border-radius:2px;
|
||||||
|
background:#d0b9a0;
|
||||||
|
-webkit-box-shadow:1px 1px 5px rgba(0,0,0,0.5);
|
||||||
|
-moz-box-shadow:1px 1px 5px rgba(0,0,0,0.5);
|
||||||
|
box-shadow:1px 1px 5px rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
.content_4 .mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar,
|
||||||
|
.content_4 .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
background:#dfcdb9;
|
||||||
|
}
|
||||||
|
.content_4 .mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||||
|
.content_4 .mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||||
|
-webkit-box-shadow:0 0 3px rgba(0,0,0,0.5);
|
||||||
|
-moz-box-shadow:0 0 3px rgba(0,0,0,0.5);
|
||||||
|
box-shadow:0 0 3px rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
/* content_5 scrollbar */
|
||||||
|
.content_5>.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
width: 98%;
|
||||||
|
margin: 0 1%;
|
||||||
|
}
|
||||||
|
/* content_6 scrollbar */
|
||||||
|
.content_6>.mCustomScrollBox>.mCSB_scrollTools{
|
||||||
|
width:88%;
|
||||||
|
margin: 0 6%;
|
||||||
|
}
|
||||||
|
/* content_8 scrollbar */
|
||||||
|
.content_8 .mCSB_scrollTools .mCSB_draggerRail{
|
||||||
|
width:0px;
|
||||||
|
border-left:1px solid rgba(0,0,0,0.8);
|
||||||
|
border-right:1px solid rgba(255,255,255,0.2);
|
||||||
|
}
|
765
css/tasks.css
Normal file
@ -0,0 +1,765 @@
|
|||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 5px;
|
||||||
|
height: 15px;
|
||||||
|
/*background-color: #ddd;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*滑块*/
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #bbb;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*滑道*/
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
box-shadow: inset 0 0 6px #ccc;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
code{
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
background: #f6f6f6;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.leftbar {
|
||||||
|
width: 60px;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 20;
|
||||||
|
display: block;
|
||||||
|
background: #2573a7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.projectheader {
|
||||||
|
background: #fff;
|
||||||
|
border-bottom: solid 1px #eeece8;
|
||||||
|
color: #4d4d4d;
|
||||||
|
height: 50px;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 17;
|
||||||
|
left: 60px;
|
||||||
|
width: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
.boardtmpl {
|
||||||
|
width: 25%;
|
||||||
|
float: left;
|
||||||
|
min-width: 284px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boardmain {
|
||||||
|
background-color: #2980b9;
|
||||||
|
overflow: hidden;
|
||||||
|
color: #f6f6f6;
|
||||||
|
height: 70px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 22px;
|
||||||
|
border-radius: 3px;
|
||||||
|
display: block;
|
||||||
|
font-weight: 700;
|
||||||
|
min-height: 18px;
|
||||||
|
padding: 8px;
|
||||||
|
margin: 8px;
|
||||||
|
position: relative;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boardmain a {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drop-area {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
min-height: 46px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wrap {
|
||||||
|
position: absolute;
|
||||||
|
top: 50px;
|
||||||
|
left: 60px;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#main {
|
||||||
|
height: 100%
|
||||||
|
}
|
||||||
|
|
||||||
|
#centerpanel {
|
||||||
|
height: 100%;
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
min-height: 60px;
|
||||||
|
width: 300px;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
vertical-align: top;
|
||||||
|
display: inline-block;
|
||||||
|
zoom: 1;
|
||||||
|
min-width: 180px;
|
||||||
|
margin: 7px 10px 0 0px;
|
||||||
|
padding-bottom: 6px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #eeece8;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tasklist {
|
||||||
|
margin: 0 4px;
|
||||||
|
padding: 0 4px;
|
||||||
|
min-height: 46px;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tasktitle {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
margin: 20px 12px 4px;
|
||||||
|
position: relative;
|
||||||
|
min-height: 20px;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tasktitle h2 {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin-bottom: 9px;
|
||||||
|
border: solid 1px #e8e8ea;
|
||||||
|
padding: 3px;
|
||||||
|
position: relative;
|
||||||
|
border-bottom: solid 1px #e1e1e5;
|
||||||
|
background: #fff;
|
||||||
|
min-height: 46px;
|
||||||
|
padding: 6px 8px 2px;
|
||||||
|
line-height: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
-webkit-user-select: text;
|
||||||
|
-moz-user-select: text;
|
||||||
|
-ms-user-select: text;
|
||||||
|
user-select: text;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 2px;
|
||||||
|
color: #4d4d4d;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-corner-mark{
|
||||||
|
color: #fff;
|
||||||
|
width: 29px;
|
||||||
|
height: 32px;
|
||||||
|
position: absolute;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "黑体";
|
||||||
|
background: #cb1a44;
|
||||||
|
top: -16px;
|
||||||
|
right: -18px;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-corner-mark span{
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
display: block;
|
||||||
|
width: 30px;
|
||||||
|
top: 16px;
|
||||||
|
left: -2px;
|
||||||
|
font-size: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-composer {
|
||||||
|
border-radius: 2px;
|
||||||
|
color: #8c8c8c;
|
||||||
|
display: block;
|
||||||
|
padding: 7px 10px;
|
||||||
|
position: relative;
|
||||||
|
text-decoration: none;
|
||||||
|
animation: fadeIn 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-composer .fa {
|
||||||
|
margin: 0 10px;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover {
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card.isselect {
|
||||||
|
border-left: 3px solid #2980b9;
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badges {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 5px 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-icon {
|
||||||
|
color: #666;
|
||||||
|
font-size: 11px;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.minicard-labels {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.minicard-label {
|
||||||
|
display: inline-block;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 2px;
|
||||||
|
margin-left: 1px;
|
||||||
|
background-color: #5eac82;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 7px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legugreen {
|
||||||
|
background-color: #5eac82 !important;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legupurple {
|
||||||
|
background-color: #76428d !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-leguaqua {
|
||||||
|
background-color: #39CCCC !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legublue {
|
||||||
|
background-color: #278785 !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-leguyellow {
|
||||||
|
background-color: #ffb11b !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legured {
|
||||||
|
background-color: #cb1a44 !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
.card-label-legured2 {
|
||||||
|
background-color: #FFA500 !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legupink {
|
||||||
|
background-color: #f596aa !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-legugray {
|
||||||
|
background-color: #787878 !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-leguriskred {
|
||||||
|
background-color: #8f4ccf !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-leguriskorange {
|
||||||
|
background-color: #f7763d !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-label-leguriskpurple {
|
||||||
|
background-color: #c22b34 !important;
|
||||||
|
;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.minicard-members {
|
||||||
|
display: inline-block;
|
||||||
|
float: right;
|
||||||
|
margin: 5px 0 2px;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-member {
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 3px;
|
||||||
|
;
|
||||||
|
display: inline-block;
|
||||||
|
user-select: none;
|
||||||
|
z-index: 1;
|
||||||
|
font-size: 7px;
|
||||||
|
padding: 2px;
|
||||||
|
text-decoration: none;
|
||||||
|
background: #999;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.myuid {
|
||||||
|
background: #09F
|
||||||
|
}
|
||||||
|
|
||||||
|
#cardinfo {
|
||||||
|
position: fixed;
|
||||||
|
width: 570px;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
box-shadow: 0 0 7px 0 #b3b3b3;
|
||||||
|
background: #f7f7f7;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
z-index: 25 !important;
|
||||||
|
color: #4d4d4d;
|
||||||
|
}
|
||||||
|
.rightfixed {
|
||||||
|
position: fixed;
|
||||||
|
width: 800px;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
box-shadow: 0 0 7px 0 #b3b3b3;
|
||||||
|
background: #f7f7f7;
|
||||||
|
border-bottom-left-radius: 3px;
|
||||||
|
border-bottom-right-radius: 3px;
|
||||||
|
z-index: 25 !important;
|
||||||
|
color: #4d4d4d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-header {
|
||||||
|
padding: 7px 16px;
|
||||||
|
background: #ededed;
|
||||||
|
border-bottom: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.33em;
|
||||||
|
margin: 7px 0 0;
|
||||||
|
padding: 0;
|
||||||
|
display: inline-block;
|
||||||
|
width: 75%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-ctrl {
|
||||||
|
display: inline-block;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-ctrl a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #999;
|
||||||
|
font-size: 1.5em;
|
||||||
|
margin-left: 15px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-items {
|
||||||
|
margin: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-item {
|
||||||
|
display: inline-block;
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-details-item-title {
|
||||||
|
color: #8c8c8c;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.25em;
|
||||||
|
margin: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border: none;
|
||||||
|
width: 100%;
|
||||||
|
background: #dbdbdb;
|
||||||
|
color: #dbdbdb;
|
||||||
|
margin: 15px 0;
|
||||||
|
padding: 0;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.viewer {
|
||||||
|
min-height: 18px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea.editor {
|
||||||
|
resize: none;
|
||||||
|
padding-bottom: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-new-comment-input {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 0;
|
||||||
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.23);
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.23);
|
||||||
|
color: #8c8c8c;
|
||||||
|
height: 36px;
|
||||||
|
margin: 4px 4px 6px 0;
|
||||||
|
padding: 9px 11px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachments-galery {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -moz-box;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: box;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-lines: multiple;
|
||||||
|
-moz-box-lines: multiple;
|
||||||
|
-o-box-lines: multiple;
|
||||||
|
-webkit-flex-wrap: wrap;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.attachment-item.add-attachment {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -moz-box;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: box;
|
||||||
|
display: flex;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-moz-box-align: center;
|
||||||
|
-o-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
-webkit-align-items: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 80px;
|
||||||
|
width: 31.33%;
|
||||||
|
margin: 10px 1% 0;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #ededed;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.js-add-attachment {
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
float: left;
|
||||||
|
height: 32px;
|
||||||
|
margin-top: -2px;
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
background: #005377;
|
||||||
|
-webkit-box-shadow: 0 1px 0 #4d4d4d;
|
||||||
|
box-shadow: 0 1px 0 #4d4d4d;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 18px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 22px;
|
||||||
|
margin: 8px 4px 0 0;
|
||||||
|
padding: 7px 20px;
|
||||||
|
text-align: center;
|
||||||
|
min-height: 34px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-danger {
|
||||||
|
background: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.activity-comment {
|
||||||
|
display: block;
|
||||||
|
border-radius: 3px;
|
||||||
|
background: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
margin-top: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cardinfoMask,.rightfixedMask {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
z-index: 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#firstlabelcardinfoMask {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
z-index: 21;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.addjiahao {
|
||||||
|
box-shadow: 0 0 0 2px #bfbfbf inset;
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 22px;
|
||||||
|
width: 22px;
|
||||||
|
line-height: 22px;
|
||||||
|
text-align: center;
|
||||||
|
color: #bfbfbf;
|
||||||
|
display: inline-block;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addjiahao:hover {
|
||||||
|
color: #000;
|
||||||
|
box-shadow: 0 0 0 2px #000 inset;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid #dbdbdb;
|
||||||
|
border-bottom-color: #c2c2c2;
|
||||||
|
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
|
||||||
|
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
|
||||||
|
position: fixed;
|
||||||
|
width: 300px;
|
||||||
|
z-index: 99999;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over .header {
|
||||||
|
height: 36px;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background: #f7f7f7;
|
||||||
|
border-bottom: 1px solid #dcdcdc;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over .header .header-title {
|
||||||
|
line-height: 32px;
|
||||||
|
padding-top: 4px;
|
||||||
|
margin: 0 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over .headbtn_left {
|
||||||
|
line-height: 32px;
|
||||||
|
float: left;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over .headbtn_right {
|
||||||
|
line-height: 32px;
|
||||||
|
float: right;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over p,
|
||||||
|
.pop-over textarea,
|
||||||
|
.pop-over input[type="text"],
|
||||||
|
.pop-over input[type="email"],
|
||||||
|
.pop-over input[type="password"],
|
||||||
|
.pop-over input[type="file"] {
|
||||||
|
margin: 4px 0 12px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popcontent {
|
||||||
|
padding: 5px 10px;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over input:not([type=file]) {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
background-color: #ebebeb;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 3px;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
min-height: 34px;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop-over li {
|
||||||
|
display: list-item;
|
||||||
|
text-align: -webkit-match-parent;
|
||||||
|
line-height: 30px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-member-list li {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-member-list li:hover {
|
||||||
|
background: #2573a7;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-label-list li {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
border: 1px solid #fff;
|
||||||
|
;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 49%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.js-card-label-list li:hover {
|
||||||
|
border: 1px solid #005377;
|
||||||
|
}
|
||||||
|
.qalabel_li,
|
||||||
|
.label_li {
|
||||||
|
background-color: #5eac82;
|
||||||
|
color: #fff;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fujianlist span {
|
||||||
|
line-height: 27px;
|
||||||
|
height: 33px;
|
||||||
|
/*display: inline-block;*/
|
||||||
|
width: 170px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 3px 5px;
|
||||||
|
margin: 3px;
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list_card_title p,.list_card_title ol {
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 230px;
|
||||||
|
list-style: none
|
||||||
|
;
|
||||||
|
}
|
||||||
|
.list_card_title del{ color: #bbb;}
|
||||||
|
|
||||||
|
.cardinfo_description img,
|
||||||
|
.activity-comment img {
|
||||||
|
border: 2px solid #dbdbdb;
|
||||||
|
margin: 3px;
|
||||||
|
max-width: 50%;
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cardinfoQALabels .minicard-label,
|
||||||
|
#cardinfoLabels .minicard-label,
|
||||||
|
#cardinfoRiskLabels .minicard-label,
|
||||||
|
#cardinfoYanQiMembers .js-member,
|
||||||
|
#cardinfoMembers .js-member {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list_menu{
|
||||||
|
float: right; position: absolute; right: 0; top: 0; color: #444;
|
||||||
|
|
||||||
|
}
|
||||||
|
.ui-menu { width: 150px; box-shadow: 0 0 7px 0 #b3b3b3;
|
||||||
|
background: #f7f7f7;
|
||||||
|
|
||||||
|
color: #4d4d4d;
|
||||||
|
}
|
||||||
|
.ui-menu li{ line-height: 25px;;}
|
||||||
|
|
||||||
|
.lbmyname{ width: 45px; height: 45px; border-radius: 50%; background: #333; text-align:center; line-height: 45px; position: relative; bottom: 60px; left: 7px; display:inline-block; font-size: 15px; font-family: "微软雅黑";background-size:100%;background-repeat:no-repeat;}
|
||||||
|
|
||||||
|
.tasklistcount{
|
||||||
|
position: absolute;
|
||||||
|
top: -19px;
|
||||||
|
left: 0;
|
||||||
|
font-size: 6px;
|
||||||
|
-webkit-transform: scale(0.8) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timetospan{ display:inline-block;font-size: 8px !important;-webkit-transform: scale(0.8) !important; font-family:georgia;font-style: normal;}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes fade {
|
||||||
|
from { opacity: 1.0; }
|
||||||
|
50% { opacity: 0.4; }
|
||||||
|
to { opacity: 1.0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes fade {
|
||||||
|
from { opacity: 1.0; }
|
||||||
|
50% { opacity: 0.4; }
|
||||||
|
to { opacity: 1.0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
i.blink{ margin-left: 3px;}
|
||||||
|
.blink {
|
||||||
|
color:#fff;
|
||||||
|
-webkit-transform: scale(1) !important;
|
||||||
|
animation:fade 300ms infinite;
|
||||||
|
-webkit-animation:fade 300ms infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#cardinfoIssueTags{ margin:15px; line-height: 23px; }
|
||||||
|
#cardinfoIssueTags li{ margin-bottom: 12px; }
|
||||||
|
.risklabel_li .full-name{ max-width: 100px;
|
||||||
|
overflow: hidden;
|
||||||
|
display: inline-block;
|
||||||
|
height: 22px; }
|
2
css/ui.all.css
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
@import "ui.base.css";
|
||||||
|
@import "ui.theme.css";
|
9
css/viewer.min.css
vendored
Normal file
25
ddlogin.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
header("Content-type: text/html;charset=utf-8");
|
||||||
|
|
||||||
|
$leguorigjson = $_REQUEST['leguorigjson'];
|
||||||
|
$legusign = $_REQUEST['legusign'];
|
||||||
|
$legutime = $_REQUEST['legutime'];
|
||||||
|
|
||||||
|
if(!$leguorigjson || !$legusign || !$legutime){
|
||||||
|
exit("参数缺失 自动登录失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
if($legutime*1 + 300 < time()){
|
||||||
|
//exit("已过有效期 请重新登录");
|
||||||
|
}
|
||||||
|
|
||||||
|
if( md5($leguorigjson.$legutime.'BJCCG28qFCzRNtRDcrW8TfqhjyzbXWt5') != $legusign ){
|
||||||
|
exit("签名错误 自动登录失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
define('ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
|
||||||
|
$user = json_decode($leguorigjson,true);
|
||||||
|
$_SESSION['leguworkUser'] = $user;
|
||||||
|
|
||||||
|
header("Location:./?app=autologin");
|
348
events.php
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
<?
|
||||||
|
/*
|
||||||
|
require_once "api.php";
|
||||||
|
$boardid = r('boardid');
|
||||||
|
|
||||||
|
$boards = getboards();
|
||||||
|
$cards = getmycards();
|
||||||
|
//we($mycards);
|
||||||
|
//$lists = getlists($boardid);
|
||||||
|
//$cards = getcards($boardid,array_keys($lists));
|
||||||
|
$users = getusers();
|
||||||
|
|
||||||
|
$list = array();
|
||||||
|
foreach($cards as $cid=>$card){
|
||||||
|
$borderid = $card['boardId'];
|
||||||
|
if($list[$borderid])continue;
|
||||||
|
if(!$boards[ $borderid ]['title'])continue;
|
||||||
|
$list[ $borderid ] = array(
|
||||||
|
"archived"=>false,
|
||||||
|
"title"=> $boards[ $borderid ]['title'],
|
||||||
|
"_id"=> $borderid
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$DATA = array(
|
||||||
|
'boardid' => $boardid,
|
||||||
|
'boards' => $boards,
|
||||||
|
'lists' => $list,
|
||||||
|
'cards' => $cards,
|
||||||
|
'users'=>$users
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/fullcalendar.css">
|
||||||
|
<script src='fullcalendarjs/jquery-ui-1.10.2.custom.min.js'></script>
|
||||||
|
<script src='fullcalendarjs/fullcalendar.min.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<button id="opener">打开对话框</button>
|
||||||
|
<div id="dialog" title="事件管理">
|
||||||
|
<form class=''>
|
||||||
|
<label>输入事件内容 (<span id="dialog_date"></span>)</label><br/><br/>
|
||||||
|
<input class='form-control' id='title' autocomplete=off type=text value='' style="line-height:25px;width:450px" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$( "#dialog" ).dialog({ autoOpen: false,modal: true,
|
||||||
|
minWidth: 500,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: "保存",
|
||||||
|
click: function() {
|
||||||
|
//$( this ).dialog( "close" );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "关闭",
|
||||||
|
click: function() {
|
||||||
|
$( this ).dialog( "close" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="calendar" style="margin:15px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var canEdit = (MYINFO && MYINFO.extData && MYINFO.extData.admin)?true:false;
|
||||||
|
var ORGID = "";
|
||||||
|
$(function () {
|
||||||
|
$('.projectheader h1').html('公共事件');
|
||||||
|
|
||||||
|
var date = new Date();
|
||||||
|
var d = date.getDate();
|
||||||
|
var m = date.getMonth();
|
||||||
|
var y = date.getFullYear();
|
||||||
|
calendar = $('#calendar');
|
||||||
|
$('#calendar').fullCalendar({
|
||||||
|
header: {
|
||||||
|
left: 'prev,next today',
|
||||||
|
center: 'title',
|
||||||
|
right: 'month,agendaWeek,agendaDay'
|
||||||
|
},
|
||||||
|
firstDay: 1,
|
||||||
|
aspectRatio: 2.4,
|
||||||
|
editable: false,
|
||||||
|
timeFormat: 'H:mm',
|
||||||
|
axisFormat: 'H:mm',
|
||||||
|
|
||||||
|
events: function (start, end, callback) {
|
||||||
|
var _start = Math.round(start.getTime() / 1000);
|
||||||
|
var _end = Math.round(end.getTime() / 1000);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: './?app=api&apiact=getEvents&orgid='+(ORGID||""),
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
start: _start,
|
||||||
|
end: _end,
|
||||||
|
},
|
||||||
|
success: function (doc) {
|
||||||
|
callback(doc);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
eventRender: function (event, element) {
|
||||||
|
//element.html('<i class="eventboardtitle">' + event.boardtitle + "</i> " + event.title.substr(0, 40)).css('background', //fmtColorByBID(event.boardid));
|
||||||
|
element.html(event.title);
|
||||||
|
},
|
||||||
|
editable: canEdit, //canEdit?
|
||||||
|
|
||||||
|
eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
|
||||||
|
|
||||||
|
dict={id:event._id};
|
||||||
|
dict.start = $.fullCalendar.formatDate(event.start,'yyyy-MM-dd');
|
||||||
|
dict.end = $.fullCalendar.formatDate(event.end,'yyyy-MM-dd');
|
||||||
|
console.log(dict);
|
||||||
|
//return;
|
||||||
|
//loading.show();
|
||||||
|
$.post('./?app=api&apiact=movepmcalendar',dict,function(txt){
|
||||||
|
//loading.hide();
|
||||||
|
if(txt=='1'){
|
||||||
|
calendar.fullCalendar('refetchEvents');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
selectable: true,
|
||||||
|
selectHelper: true,
|
||||||
|
select: function(start, end, allDay) {
|
||||||
|
if(!canEdit)return;
|
||||||
|
|
||||||
|
dict = {};
|
||||||
|
console.log('select',start, end, allDay);
|
||||||
|
|
||||||
|
dict.start = $.fullCalendar.formatDate(start,'yyyy-MM-dd');
|
||||||
|
dict.end = $.fullCalendar.formatDate(end,'yyyy-MM-dd');
|
||||||
|
|
||||||
|
showEventInfo(dict.start,{
|
||||||
|
"save" : {
|
||||||
|
"label" : "保存",
|
||||||
|
"className" : "btn-sm btn-success",
|
||||||
|
"callback": function() {
|
||||||
|
dict.game = $('#game').val();
|
||||||
|
dict.allday = 1;
|
||||||
|
|
||||||
|
dict.title = $('#title').val();
|
||||||
|
dict.event = $('#event').val();
|
||||||
|
|
||||||
|
if(dict.game=='' || dict.title=='')return;
|
||||||
|
|
||||||
|
$.post('./?app=api&apiact=newcalendar',dict,function(txt){
|
||||||
|
if(txt=='1'){
|
||||||
|
calendar.fullCalendar('refetchEvents');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#dialog').dialog( "close" );
|
||||||
|
}
|
||||||
|
} ,
|
||||||
|
"close" : {
|
||||||
|
"label" : "关闭",
|
||||||
|
"className" : "btn-sm",
|
||||||
|
"callback" : function(){
|
||||||
|
$('#dialog').dialog( "close" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},'new');
|
||||||
|
calendar.fullCalendar('unselect');
|
||||||
|
}
|
||||||
|
,
|
||||||
|
eventClick: function(calEvent, jsEvent, view) {
|
||||||
|
if(!canEdit)return;
|
||||||
|
|
||||||
|
console.log('calEvent',calEvent,jsEvent,view);
|
||||||
|
|
||||||
|
dict={};
|
||||||
|
|
||||||
|
/*
|
||||||
|
$.post('./?app=pmcalendar&act=getEventByid',{id:calEvent.id},function(txt){
|
||||||
|
var j = JSON.parse(txt);
|
||||||
|
dict.start = j.start;
|
||||||
|
dict.end = j.end;
|
||||||
|
dict.id = calEvent.id;
|
||||||
|
$('#game').val(j.game);
|
||||||
|
$('#hour').val(j.shour);
|
||||||
|
$('#min').val(j.smin);
|
||||||
|
$('#event').val(j.event);
|
||||||
|
$('#title').val(j.title);
|
||||||
|
hourChange($('#hour'));
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
var dstr = $.fullCalendar.formatDate(calEvent.start,'yyyy-MM-dd');
|
||||||
|
|
||||||
|
dict.start = dstr;
|
||||||
|
dict.end = dstr;
|
||||||
|
dict.id = calEvent._id;
|
||||||
|
$('#title').val(calEvent.title);
|
||||||
|
|
||||||
|
console.log('dict',dict);
|
||||||
|
|
||||||
|
|
||||||
|
showEventInfo(dstr,{
|
||||||
|
"save" : {
|
||||||
|
"label" : "保存",
|
||||||
|
"className" : "btn-sm btn-success",
|
||||||
|
"callback": function() {
|
||||||
|
|
||||||
|
//dict.game = $('#game').val();
|
||||||
|
//dict.allday = 1;
|
||||||
|
|
||||||
|
//dict.event = $('#event').val();
|
||||||
|
dict.title = $('#title').val();
|
||||||
|
|
||||||
|
//if(dict.game=='' || dict.event=='')return;
|
||||||
|
|
||||||
|
//loading.show();
|
||||||
|
$.post('./?app=api&apiact=modipmcalendar',dict,function(txt){
|
||||||
|
//loading.hide();
|
||||||
|
if(txt=='1'){
|
||||||
|
calendar.fullCalendar('refetchEvents');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#dialog').dialog( "close" );
|
||||||
|
}
|
||||||
|
} ,
|
||||||
|
"delete" : {
|
||||||
|
"label" : "删除事件",
|
||||||
|
"className" : "btn-sm btn-danger",
|
||||||
|
"callback": function() {
|
||||||
|
if(confirm('确认要【删除】这个事件吗?')){
|
||||||
|
//loading.show();
|
||||||
|
$.post('./?app=api&apiact=delpmcalendar',{id:calEvent._id},function(txt){
|
||||||
|
//loading.hide();
|
||||||
|
if(txt=='1'){
|
||||||
|
calendar.fullCalendar('refetchEvents');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('#dialog').dialog( "close" );
|
||||||
|
}
|
||||||
|
} ,
|
||||||
|
|
||||||
|
"close" : {
|
||||||
|
"label" : "关闭",
|
||||||
|
"className" : "btn-sm",
|
||||||
|
"callback" : function(){
|
||||||
|
$('#dialog').dialog( "close" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},'modify');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
var bid2color = {};
|
||||||
|
|
||||||
|
function fmtColorByBID(bid) {
|
||||||
|
if (!bid2color[bid]) bid2color[bid] = getRandomSafeColor();
|
||||||
|
return bid2color[bid];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRandomSafeColor() {
|
||||||
|
var base = ['00', '11', '22', '33', '44', '55', '66', '77', '88', '99', 'aa', 'bb', 'cc'];//基础色代码
|
||||||
|
var res = '#';
|
||||||
|
for (var i = 0; i < 3; i++) {
|
||||||
|
res += base[Math.floor(Math.random() * base.length)];
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function showEventInfo(start,btns,stype){
|
||||||
|
$('#dialog_date').html(start);
|
||||||
|
|
||||||
|
var nbtns = {};
|
||||||
|
for(var id in btns){
|
||||||
|
nbtns[ btns[id].label ] = btns[id].callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#dialog').dialog('option', 'buttons', nbtns);
|
||||||
|
$( "#dialog" ).dialog( "open" );
|
||||||
|
/*
|
||||||
|
var form = $("<form class=''><label>选择游戏和事件类型 ("+ start +")</label><div class='space-1'></div></form>");
|
||||||
|
form.append(' <select id="event"><option value="打包">打包</option><option value="版本更新">版本更新</option><option value="修复外网">修复外网</option><option value="上线">上线</option><option value="节点">节点</option></select>');
|
||||||
|
form.append("<div class='space-5'></div><label for='form-field-mask-1'>事件内容</label><input class='form-control' id='title' autocomplete=off type=text value='' /> ");
|
||||||
|
|
||||||
|
var div = bootbox.dialog({
|
||||||
|
message: form,
|
||||||
|
buttons: btns
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
form.on('submit', function(){
|
||||||
|
//calEvent.title = form.find("input[type=text]").val();
|
||||||
|
//calendar.fullCalendar('updateEvent', calEvent);
|
||||||
|
div.modal("hide");
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#selectorg').on('change',function(){
|
||||||
|
ORGID = $(this).val();
|
||||||
|
console.log(ORGID);
|
||||||
|
calendar.fullCalendar('refetchEvents');
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.fc-week .fc-sun{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.fc-week .fc-sat{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
61
firstAddQaLabels.html
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<%
|
||||||
|
var card = DATA.cards[ DATA.lastShowCardID ];
|
||||||
|
var board = DATA.boards[ card.boardId ];
|
||||||
|
if(!board.qalabels){
|
||||||
|
board.qalabels = [];
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<div class="pop-over" id="firstAddQaLabels">
|
||||||
|
<div class="header">
|
||||||
|
<a class="back-btn js-back-view headbtn_left qalabelback" style="display: none;"><i class="fa fa-chevron-left"></i></a>
|
||||||
|
<span class="header-title">问题类型</span>
|
||||||
|
<a class="headbtn_right close_first_addQAlabels">
|
||||||
|
<!-- <i class="fa fa-close"></i>-->
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<ul class="pop-over-list js-card-label-list chooseLabelUL" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
for(var i=0;i<board.qalabels.length;i++){
|
||||||
|
var label = board.qalabels[i];
|
||||||
|
var _isSelect = false;
|
||||||
|
if(card.qalabelIds && card.qalabelIds.indexOf(label._id) != -1){
|
||||||
|
_isSelect = true;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<li class="first_qalabel_li card-label-<%=label.color%> card-labelid-<%=label._id%>" data-labelname="<%=label.name%>" data-labelcolor="<%=label.color%>" data-id="<%=label._id%>">
|
||||||
|
<span class="full-name"><%=label.name%></span>
|
||||||
|
<%= (_isSelect?'<i class="fa fa-check"></i>':'')%>
|
||||||
|
|
||||||
|
<span class="fa fa-edit labelEdit" style="float: right; opacity: 0.5;" ></span>
|
||||||
|
<!--span class="fa fa-clock-o labelSetTimer" id="labelTimer_<%=label._id%>" style="float: right; opacity: 0.6; margin-right: 10px;" ></span-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
<li class="qalabel_li add_qalabel_li2">
|
||||||
|
<span class="full-name">增加标签</span>
|
||||||
|
<i class="fa fa-plus" style="float: right; opacity: 0.5;"></i>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="addLabelUL" style=" display: none;">
|
||||||
|
<input type="hidden" placeholder="id" maxlength="4" class="addLabelID">
|
||||||
|
<input type="text" placeholder="标签内容" maxlength="4" class="addLabelName">
|
||||||
|
<ul class="pop-over-list js-card-label-list" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
var colors = ['legugreen','legupurple','legublue','leguyellow','legured','legupink','legugray','leguaqua'];
|
||||||
|
for(var i=0;i<colors.length;i++){
|
||||||
|
%>
|
||||||
|
<li class="add_qalabel_li card-label-<%=colors[i]%>" data-labelcolor="<%=colors[i]%>">
|
||||||
|
|
||||||
|
<!--<i class="fa fa-check"></i>-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
<button class="button addQAlabelbtn" type="button" style="margin: 10px 0;">确定</button>
|
||||||
|
<button class="button btn-danger delQAlabelbtn" type="button" style="margin: 10px 0;float: right;">删除</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
BIN
fonts/FontAwesome.otf
Normal file
BIN
fonts/fontawesome-webfont.eot
Normal file
2671
fonts/fontawesome-webfont.svg
Normal file
After Width: | Height: | Size: 434 KiB |
BIN
fonts/fontawesome-webfont.ttf
Normal file
BIN
fonts/fontawesome-webfont.woff
Normal file
BIN
fonts/fontawesome-webfont.woff2
Normal file
7
fullcalendarjs/fullcalendar.min.js
vendored
Normal file
5
fullcalendarjs/jquery-1.9.1.min.js
vendored
Normal file
6
fullcalendarjs/jquery-ui-1.10.2.custom.min.js
vendored
Normal file
52
header.html
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
?>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Work内部协作</title>
|
||||||
|
<link type="text/css" href="css/base.css?_=<?=filemtime('css/base.css')?>" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="scripts/event.js?_=<?=filemtime('scripts/event.js')?>"></script>
|
||||||
|
<script>
|
||||||
|
DATA = {};
|
||||||
|
var DTALK_APPID = "<?=$DTALK_APPID?>";
|
||||||
|
var GET = <?php echo json_encode($_GET)?>;
|
||||||
|
var MYID = "<?=$MYID;?>",MYINFO=<?=json_encode(getUserInfo($MYID))?>;
|
||||||
|
var EVENT = new EventEmitter(2000);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--<link type="text/css" href="scripts/jquery-ui/themes/base/ui.all.css" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="scripts/jquery-ui/themes/ui-lightness/ui.all.css" rel="stylesheet" />-->
|
||||||
|
<link rel="stylesheet" href="css/jquery-ui.css?_=<?=filemtime('css/jquery-ui.css')?>">
|
||||||
|
|
||||||
|
<link type="text/css" href="css/font-awesome.css?_=<?=filemtime('css/font-awesome.css')?>" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="css/tasks.css?_=<?=filemtime('css/tasks.css')?>" rel="stylesheet" />
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript" src="scripts/jquery-1.9.1.min.js?_=<?=filemtime('scripts/jquery-1.9.1.min.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jquery-ui.min.js?_=<?=filemtime('scripts/jquery-ui.min.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jquery.color.js?_=<?=filemtime('scripts/jquery.color.js')?>"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="scripts/tmpl.js?_=<?=filemtime('scripts/tmpl.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/tasks.js?_=<?=filemtime('scripts/tasks.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/cardinfo.js?_=<?=filemtime('scripts/cardinfo.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/memberlist.js?_=<?=filemtime('scripts/memberlist.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/labels.js?_=<?=filemtime('scripts/labels.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/qalabels.js?_=<?=filemtime('scripts/qalabels.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/risklabels.js?_=<?=filemtime('scripts/risklabels.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/pasteImage.js?_=<?=filemtime('scripts/pasteImage.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/marked.js?_=<?=filemtime('scripts/marked.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/websocket.js?_=<?=filemtime('scripts/websocket.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/watermark.js?_=<?=filemtime('scripts/watermark.js')?>"></script>
|
||||||
|
|
||||||
|
<link type="text/css" href="css/viewer.min.css?_=<?=filemtime('css/viewer.min.css')?>" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="scripts/viewer-jquery.min.js?_=<?=filemtime('scripts/viewer-jquery.min.js')?>"></script>
|
||||||
|
|
||||||
|
<script src="scripts/moment.min.js?_<?=filemtime('scripts/moment.min.js')?>"></script>
|
||||||
|
<script src="scripts/jquery.daterangepicker.js?_<?=filemtime('scripts/jquery.daterangepicker.js')?>"></script>
|
||||||
|
<link rel="stylesheet" href="css/daterangepicker.css?_<?=filemtime('css/daterangepicker.css')?>" />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// var pyapi_host = 'http://127.0.0.1:5000';
|
||||||
|
var pyapi_host = 'http://' + HOST + ':5000';
|
||||||
|
// var pyapi_host = 'http://10.0.0.5:5000';
|
||||||
|
|
||||||
|
</script>
|
BIN
img/cad.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
img/calendar-rest-bg.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
img/getcolor.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
img/wekan-logo1.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
5
inc/appin.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
if(!defined('APPIN')) {
|
||||||
|
exit('Access Denied');
|
||||||
|
}
|
||||||
|
?>
|
473
inc/bll.php
Normal file
@ -0,0 +1,473 @@
|
|||||||
|
<?php
|
||||||
|
require_once(ROOT."./inc/common.php");
|
||||||
|
require_once(ROOT.'./inc/filedb.php');
|
||||||
|
require_once(ROOT.'./inc/guide.php');
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// 乐谷work管理看板
|
||||||
|
$LEGUWORK_BOARDID = 'XNt2hy8Q89tEfmwC7';
|
||||||
|
// 设置的列表id 【设置】
|
||||||
|
$LEGUWORK_SETTING_LISTID = '5ce68ddfa5ebb';
|
||||||
|
$LEGUWORK_SETTING_LIST_NAME = '【设置】';
|
||||||
|
|
||||||
|
// 延期分组列表
|
||||||
|
$LEGUWORK_YANQI_LISTID = '5ce68e49bd298';
|
||||||
|
$LEGUWORK_YANQI_LIST_NAME = '【设置】延期分组';
|
||||||
|
|
||||||
|
|
||||||
|
$mongo = new MongoClient( $_CONFIG['mongo'] );
|
||||||
|
$wekan = $mongo->selectDB('wekan');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取看板列表
|
||||||
|
function getboards($userid=null,$archived=false){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
if(isn($userid))$userid = $MYID;
|
||||||
|
$docs = $wekan->boards->find(array('members.userId'=>$MYID,'archived'=>$archived));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getboardsByAdmin($admin){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
if($admin=='all'){
|
||||||
|
$docs = $wekan->boards->find(array('archived'=>false));
|
||||||
|
}else{
|
||||||
|
$docs = $wekan->boards->find(array('org'=>$admin,'archived'=>false));
|
||||||
|
}
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getorgs(){
|
||||||
|
global $wekan;
|
||||||
|
$docs = $wekan->users->find(array(),array('org'=>1,'orgname'=>1));
|
||||||
|
$res = array();
|
||||||
|
$rss = iterator_to_array($docs);
|
||||||
|
foreach($rss as $rs){
|
||||||
|
$res[ $rs['org'] ] = $rs['orgname'];
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getcards($boardid,$lists=null){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
|
||||||
|
if($lists==null){
|
||||||
|
$docs = $wekan->cards->find(array('boardId'=>$boardid,'archived'=>false)); //'listId'=>$listid,
|
||||||
|
}else{
|
||||||
|
$docs = $wekan->cards->find(array('boardId'=>$boardid,'listId'=>array('$in'=>$lists),'archived'=>false));
|
||||||
|
}
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getmycards(){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->cards->find(array('members'=>$MYID,'archived'=>false)); //'listId'=>array('$in'=>$lists),
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUserCards($uid, $st = null, $et = null)
|
||||||
|
{
|
||||||
|
global $MYID, $wekan;
|
||||||
|
|
||||||
|
$mongostart = new MongoDate(strtotime($st));
|
||||||
|
// $mongostart = new MongoDate(1546272000);
|
||||||
|
|
||||||
|
$mongoend = new MongoDate(strtotime($et));
|
||||||
|
// $mongoend = new MongoDate(1548950400);
|
||||||
|
|
||||||
|
|
||||||
|
$docs = $wekan->cards->find(array(
|
||||||
|
'members' => $uid,
|
||||||
|
// "createdAt" => array('$gte' => $mongostart)
|
||||||
|
// "createdAt" => array('$gte' => $mongostart, '$lte' => $mongoend)
|
||||||
|
"mem_time.{$uid}.start" => array('$gte' => strtotime($st)),
|
||||||
|
"mem_time.{$uid}.end" => array('$lte' => strtotime($et))
|
||||||
|
)
|
||||||
|
); //'listId'=>array('$in'=>$lists),
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 某个用户完成的单子
|
||||||
|
function getUserCards4Finish($uid, $st = null, $et = null)
|
||||||
|
{
|
||||||
|
global $MYID, $wekan;
|
||||||
|
|
||||||
|
$mongostart = new MongoDate(strtotime($st));
|
||||||
|
// $mongostart = new MongoDate(1546272000);
|
||||||
|
|
||||||
|
$mongoend = new MongoDate(strtotime($et));
|
||||||
|
// $mongoend = new MongoDate(1548950400);
|
||||||
|
|
||||||
|
|
||||||
|
$docs = $wekan->cards->find(array(
|
||||||
|
'members' => $uid,
|
||||||
|
'$or'=>array(
|
||||||
|
array(
|
||||||
|
//'qalabelIds'=>'gongnengyanfa',
|
||||||
|
"mem_time.{$uid}.start" => array('$gte' => strtotime($st)),
|
||||||
|
"mem_time.{$uid}.end" => array('$lte' => strtotime($et))
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
//'qalabelIds'=>array('$ne'=>'gongnengyanfa'),
|
||||||
|
"finishAt" => array('$gte' => strtotime($st),'$lte' => strtotime($et)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// "createdAt" => array('$gte' => $mongostart)
|
||||||
|
// "createdAt" => array('$gte' => $mongostart, '$lte' => $mongoend)
|
||||||
|
)
|
||||||
|
); //'listId'=>array('$in'=>$lists),
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
|
||||||
|
$arr = array();
|
||||||
|
foreach($res as $id=>$val){
|
||||||
|
$qalabelIds = array();
|
||||||
|
if($val['qalabelIds']){
|
||||||
|
$qalabelIds = $val['qalabelIds'];
|
||||||
|
}
|
||||||
|
if( in_array('gongnengyanfa',$qalabelIds) ){
|
||||||
|
//功能研发单,则判断标记时间
|
||||||
|
if( $val['mem_time'][$uid] && $val['mem_time'][$uid]['start']>=strtotime($st) && $val['mem_time'][$uid]['end']<=strtotime($et) ){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$arr[$id] = $val;
|
||||||
|
}
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUserCards4New($uid, $st = null, $et = null)
|
||||||
|
{
|
||||||
|
global $MYID, $wekan;
|
||||||
|
|
||||||
|
$mongostart = new MongoDate(strtotime($st));
|
||||||
|
$mongoend = new MongoDate(strtotime($et));
|
||||||
|
|
||||||
|
$docs = $wekan->cards->find(array(
|
||||||
|
'members' => $uid,
|
||||||
|
"createdAt" => array('$gte' => ($mongostart),'$lte' => ($mongoend))
|
||||||
|
));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getcard($cardid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
// $docs = $wekan->cards->find(array('_id'=>$cardid,'archived'=>false)); //'listId'=>$listid,
|
||||||
|
$docs = $wekan->cards->find(array('_id'=>$cardid)); //'listId'=>$listid,
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getboardsettingcard($boardid,$cardtitle){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$cardtitle = "__setting.".$cardtitle;
|
||||||
|
$docs = $wekan->cards->find(array('boardId'=>$boardid,'title'=>$cardtitle,'archived'=>false)); //'listId'=>$listid,
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getlists($boardid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->lists->find(array('boardId'=>$boardid,'archived'=>false));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
function getlist($listid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->lists->find(array('_id'=>$listid));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBoard($boardid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->boards->find(array('_id'=>$boardid));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getusers(){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
if(isn($userid))$userid = $MYID;
|
||||||
|
$docs = $wekan->users->find(array(), array(
|
||||||
|
'username' => true,
|
||||||
|
'emails' => true,
|
||||||
|
'org'=>true,
|
||||||
|
'orgname'=>true,
|
||||||
|
'dduserid'=>true,
|
||||||
|
'profile.fullname' => true,
|
||||||
|
'profile.avatarUrl' => true,
|
||||||
|
'legulabel'=>true,
|
||||||
|
'legugroup'=>true,
|
||||||
|
'lastlogin'=>true,
|
||||||
|
));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUserInfo($userid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->users->find(array("_id"=>$userid));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res[$userid];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getcard_comments($cardid){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->card_comments->find(array('cardId'=>$cardid))->sort(array('createdAt'=>-1));
|
||||||
|
$res = iterator_to_array($docs);
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function initLables(){
|
||||||
|
$labels = array(
|
||||||
|
array(
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"策"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"策配"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"策验"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"审UI"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legured",
|
||||||
|
"name" =>"前程"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legured",
|
||||||
|
"name" =>"后程"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legupurple",
|
||||||
|
"name" =>"UI"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legupurple",
|
||||||
|
"name" =>"UI验"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"leguyellow",
|
||||||
|
"name" =>"美"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legugreen",
|
||||||
|
"name" =>"美验"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"动效"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legured",
|
||||||
|
"name" =>"动验"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legupink",
|
||||||
|
"name" =>"QA"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legugray",
|
||||||
|
"name" =>"运营"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"color" =>"legugray",
|
||||||
|
"name" =>"打包"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
foreach($labels as $idx => $label){
|
||||||
|
$labels[$idx]['_id'] = uniqid().$idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
//return $labels;
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAllRiskLabels(){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$docs = $wekan->risktags->find(array(), array(
|
||||||
|
'_id' => false,
|
||||||
|
'issueId' => true,
|
||||||
|
'tagId' => true,
|
||||||
|
'tag' => true,
|
||||||
|
'reasonTag' => true,
|
||||||
|
'color' => true,
|
||||||
|
'description' => true,
|
||||||
|
'reason'=>true,
|
||||||
|
'department'=>true,
|
||||||
|
'issueColor'=>issueColor
|
||||||
|
));
|
||||||
|
|
||||||
|
$labels = iterator_to_array($docs);
|
||||||
|
|
||||||
|
$res = array();
|
||||||
|
foreach($labels as $val){
|
||||||
|
$res[ $val['tagId'] ][] = $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRiskLabels(){
|
||||||
|
global $MYID,$wekan;
|
||||||
|
$labels = $wekan->command (
|
||||||
|
array(
|
||||||
|
"aggregate" => "risktags",
|
||||||
|
"pipeline" =>
|
||||||
|
array(
|
||||||
|
array( '$group' => array( "_id" => ['_id' =>'$tagId', 'name' => '$tag', 'color' => '$color'])),
|
||||||
|
array( '$replaceRoot' => array( "newRoot" => '$_id' ))
|
||||||
|
),
|
||||||
|
"cursor" => ['batchSize' => 200]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$res = array();
|
||||||
|
|
||||||
|
foreach($labels['cursor']['firstBatch'] as $val){
|
||||||
|
$res[ $val['_id'] ] = $val;
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
function initQALables(){
|
||||||
|
$labels = array(
|
||||||
|
array(
|
||||||
|
"_id"=>"bug",
|
||||||
|
"color" =>"legured",
|
||||||
|
"name" =>"BUG"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"_id"=>"ziyuanqueshi",
|
||||||
|
"color" =>"leguyellow",
|
||||||
|
"name" =>"资源缺失"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"_id"=>"geleiyouhua",
|
||||||
|
"color" =>"legublue",
|
||||||
|
"name" =>"各类优化"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"_id"=>"gongnengyanfa",
|
||||||
|
"color" =>"leguaqua",
|
||||||
|
"name" =>"功能研发"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"_id"=>"xingnengyouhua",
|
||||||
|
"color" =>"legupurple",
|
||||||
|
"name" =>"性能问题"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"_id"=>"qita",
|
||||||
|
"color" =>"legugray",
|
||||||
|
"name" =>"其他"
|
||||||
|
),
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// foreach($labels as $idx => $label){
|
||||||
|
// $labels[$idx]['_id'] = uniqid().$idx;
|
||||||
|
// }
|
||||||
|
|
||||||
|
//return $labels;
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
function eventData($act,$data){
|
||||||
|
return json_encode(array(
|
||||||
|
"_k"=>"EVENT",
|
||||||
|
"act"=>$act,
|
||||||
|
"data" => $data,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据boardId获取看板的标签的名字数组 _id=>name
|
||||||
|
function getBoardLabelIdNames($boardId){
|
||||||
|
global $wekan;
|
||||||
|
$resBoards = $wekan->boards->find(array(
|
||||||
|
"archived" => false,
|
||||||
|
"_id" => $boardId,
|
||||||
|
));
|
||||||
|
$boardData = iterator_to_array($resBoards);
|
||||||
|
$board = $boardData[$boardId];
|
||||||
|
$boardLabels = $board['labels'];
|
||||||
|
$boardLabelArr = array();
|
||||||
|
foreach ($boardLabels as $label){
|
||||||
|
$boardLabelArr[$label['_id']] = $label['name'];
|
||||||
|
}
|
||||||
|
return $boardLabelArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取延期列表数据 部门对应用户
|
||||||
|
// 5ce68e49bd298
|
||||||
|
function getYanQiDepartmentUser(){
|
||||||
|
global $MYID,$wekan,$LEGUWORK_SETTING_LISTID,$LEGUWORK_BOARDID,$LEGUWORK_YANQI_LISTID;
|
||||||
|
|
||||||
|
$cardData = $wekan->cards->find(array('archived'=>false,'boardId'=>$LEGUWORK_BOARDID,'listId'=>$LEGUWORK_YANQI_LISTID));
|
||||||
|
$cardData = iterator_to_array($cardData);
|
||||||
|
|
||||||
|
$boardData = $wekan->boards->findOne(array(
|
||||||
|
"_id" => $LEGUWORK_BOARDID,
|
||||||
|
));
|
||||||
|
|
||||||
|
$boardLabels = $boardData['labels'];
|
||||||
|
$labelNameIdArr = array();
|
||||||
|
$labelIdNameArr = array();
|
||||||
|
foreach ($boardLabels as $k => $v) {
|
||||||
|
$labelNameIdArr[$v['name']] = $v['_id'];
|
||||||
|
$labelIdNameArr[$v['_id']] = $v['name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$labelUserArr = array();
|
||||||
|
$labelIdUserArr = array();
|
||||||
|
foreach ($cardData as $k => $v) {
|
||||||
|
// 延期成员在的部门
|
||||||
|
$labelIds = $v['labelIds'];
|
||||||
|
$members = $v['members'];
|
||||||
|
|
||||||
|
// var_dump($members);
|
||||||
|
|
||||||
|
foreach ($labelIds as $labelID) {
|
||||||
|
$labelIdUserArr[$labelID] = array(
|
||||||
|
'name'=>$labelIdNameArr[$labelID],
|
||||||
|
'user'=>$members
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $labelIdUserArr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$MYID = $_SESSION['leguworkUID']; //;// 'NNCQpGcDX9L2EexLQ';//
|
||||||
|
$LEGUWORKUSER = $_SESSION['leguworkUser'];
|
||||||
|
$DTALK_APPID = "";
|
||||||
|
if($LEGUWORKUSER){
|
||||||
|
$DTALK_APPID = $LEGUWORKUSER['appid'];
|
||||||
|
}
|
||||||
|
?>
|
175
inc/cache.inc.php
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Usage :
|
||||||
|
* # Cache active time half an hour
|
||||||
|
* # This Can Auotmatic make some none exist dirs
|
||||||
|
* # Or you can use an cache file in curent dir
|
||||||
|
* # The Usage Such as
|
||||||
|
* # $cache = new cache(string cache_name,int seconds);
|
||||||
|
*
|
||||||
|
* require ('cache.inc.php');
|
||||||
|
* $cache = new fileCache('dir1/dir2/cache_name.htm',60*30);
|
||||||
|
*
|
||||||
|
* $cache->start();
|
||||||
|
*
|
||||||
|
* # Your Page Contents With print
|
||||||
|
* phpinfo();
|
||||||
|
*
|
||||||
|
* $cache->_end();
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class fileCache {
|
||||||
|
var $_file;
|
||||||
|
var $cache_time;
|
||||||
|
|
||||||
|
function fileCache($_file='_index.htm',$cache_time=1) {
|
||||||
|
$this->_file = $_file;
|
||||||
|
$this->cache_time = $cache_time;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Start cache method without return
|
||||||
|
*/
|
||||||
|
function start() {
|
||||||
|
if($this->cache_is_active()) {
|
||||||
|
include($this->_file);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
ob_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* End of cache method without Return
|
||||||
|
*/
|
||||||
|
function _end() {
|
||||||
|
$this->make_cache();
|
||||||
|
ob_end_flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if cache file is actived
|
||||||
|
* Return true/false
|
||||||
|
*/
|
||||||
|
function cache_is_active() {
|
||||||
|
if ($this->cache_is_exist()) {
|
||||||
|
if (time() - $this->lastModified() < $this->cache_time)
|
||||||
|
return true;
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create cache file
|
||||||
|
* return true/false
|
||||||
|
*/
|
||||||
|
function make_cache() {
|
||||||
|
$content = $this->get_cache_content();
|
||||||
|
$content = str_replace(array("\r","\n","\t"),'',$content);
|
||||||
|
if($this->write_file($content)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if cache file is exists
|
||||||
|
* return true/false
|
||||||
|
*/
|
||||||
|
function cache_is_exist() {
|
||||||
|
if(file_exists($this->_file)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* return last Modified time in bollin formart
|
||||||
|
* Usage: $lastmodified = $this->lastModified();
|
||||||
|
*/
|
||||||
|
function lastModified() {
|
||||||
|
return @filemtime($this->_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* return Content of Page
|
||||||
|
* Usage: $content = $this->get_cache_content();
|
||||||
|
*/
|
||||||
|
function get_cache_content() {
|
||||||
|
$contents = ob_get_contents();
|
||||||
|
// return '<!--'.date('Y-m-d H:i:s').'-->'.$contents;
|
||||||
|
return $contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*Write content to $this->_file
|
||||||
|
* return true/false
|
||||||
|
* Usage: $this->write_file($content);
|
||||||
|
**/
|
||||||
|
function write_file($content,$mode='w+')
|
||||||
|
{
|
||||||
|
$this->mk_dir($this->_file);
|
||||||
|
if (!$fp = @fopen($this->_file,$mode)) {
|
||||||
|
$this->report_Error($this->_file." 目录或者文件属性无法写入.");
|
||||||
|
return false;
|
||||||
|
} else{
|
||||||
|
@fwrite($fp,$content);
|
||||||
|
@fclose($fp);
|
||||||
|
@umask($oldmask);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make given dir included in $this->_file
|
||||||
|
* Without return
|
||||||
|
* Usage: $this->mk_dir();
|
||||||
|
*/
|
||||||
|
function mk_dir()
|
||||||
|
{ //$this->_file = str_replace('','/');
|
||||||
|
$dir = @explode("/", $this->_file);
|
||||||
|
$num = @count($dir)-1;
|
||||||
|
$tmp = './';
|
||||||
|
for($i=0; $i<$num; $i++){
|
||||||
|
$tmp .= $dir[$i];
|
||||||
|
if(!file_exists($tmp)){
|
||||||
|
@mkdir($tmp);
|
||||||
|
@chmod($tmp, 0777);
|
||||||
|
}
|
||||||
|
$tmp .= '/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Unlink an exists cache
|
||||||
|
* return true/false
|
||||||
|
* Usage: $this->clear_cache();
|
||||||
|
*/
|
||||||
|
function clear_cache() {
|
||||||
|
if (!@unlink($this->_file)) {
|
||||||
|
$this->report_Error('Unable to remove cache');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Report Error Messages
|
||||||
|
* Usage: $this->report_Error($message);
|
||||||
|
*/
|
||||||
|
function report_Error($message=NULL) {
|
||||||
|
if($message!=NULL) {
|
||||||
|
trigger_error($message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
714
inc/common.php
Normal file
@ -0,0 +1,714 @@
|
|||||||
|
<?php
|
||||||
|
require_once(ROOT."./inc/config.php");
|
||||||
|
#set_magic_quotes_runtime(0);
|
||||||
|
ini_set("magic_quotes_runtime",0);
|
||||||
|
if(function_exists('date_default_timezone_set')) date_default_timezone_set('PRC');
|
||||||
|
|
||||||
|
DEBUG?error_reporting(7):error_reporting(0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
$magic_quote = get_magic_quotes_gpc();
|
||||||
|
if(empty($magic_quote))
|
||||||
|
{
|
||||||
|
$_GET = sqlEncode($_GET);
|
||||||
|
$_POST = sqlEncode($_POST);
|
||||||
|
$_REQUEST = sqlEncode($_REQUEST);
|
||||||
|
$_COOKIE = sqlEncode($_COOKIE);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
//SQL编码
|
||||||
|
function sqlEncode($string) {
|
||||||
|
if(is_array($string)) {
|
||||||
|
foreach($string as $key => $val) {
|
||||||
|
$string[$key] = sqlEncode($val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$string = addslashes($string);
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
//去掉SQL编码
|
||||||
|
function sqlDecode($string) {
|
||||||
|
if(is_array($string)) {
|
||||||
|
foreach($string as $key => $val) {
|
||||||
|
$string[$key] = sqlDecode($val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$string = stripslashes($string);
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
//将对象全部转换成数组
|
||||||
|
function deObject2Array($obj){
|
||||||
|
if(gettype($obj) == object)
|
||||||
|
$obj = get_object_vars($obj);
|
||||||
|
|
||||||
|
if(count($obj) > 0)
|
||||||
|
{
|
||||||
|
foreach($obj as $k=>$v){
|
||||||
|
if(gettype($v) == object){
|
||||||
|
$obj[$k] = deObject2Array($v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
//HTML代码编码
|
||||||
|
function htmlEncode($string) {
|
||||||
|
if(is_array($string)) {
|
||||||
|
foreach($string as $key => $val) {
|
||||||
|
$string[$key] = shtmlspecialchars($val);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', '&\\1',
|
||||||
|
str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string));
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function myjson_encode($code){
|
||||||
|
$code = json_encode($code);
|
||||||
|
return preg_replace("#\\\u([0-9a-f]{4,4})#ie", "iconv('UCS-2', 'UTF-8', pack('H4', '\\1'))", $code);
|
||||||
|
}
|
||||||
|
|
||||||
|
function myjson_decode($code){
|
||||||
|
$code = json_decode($code);
|
||||||
|
return preg_replace("#\\\u([0-9a-f]{4,4})#ie", "iconv('UCS-2', 'UTF-8', pack('H4', '\\1'))", $code);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取文件内容
|
||||||
|
function getFile($filename,$clearBOM=1){
|
||||||
|
$content = '';
|
||||||
|
if(function_exists('file_get_contents')) {
|
||||||
|
@$content = file_get_contents($filename);
|
||||||
|
} else {
|
||||||
|
if(@$fp = fopen($filename, 'r')) {
|
||||||
|
@$content = fread($fp, filesize($filename));
|
||||||
|
@fclose($fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//清除BOM信息
|
||||||
|
if($clearBOM==1){
|
||||||
|
$charset[1]=substr($content, 0, 1);
|
||||||
|
$charset[2]=substr($content, 1, 1);
|
||||||
|
$charset[3]=substr($content, 2, 1);
|
||||||
|
if (ord($charset[1])==239 && ord($charset[2])==187 && ord($charset[3])==191) {
|
||||||
|
$content=substr($content,3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
//写入文件
|
||||||
|
function setFile($filename, $writetext, $openmod='w') {
|
||||||
|
if(@$fp = fopen($filename, $openmod)) {
|
||||||
|
flock($fp, 2);
|
||||||
|
fwrite($fp, $writetext);
|
||||||
|
fclose($fp);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//字符串解密加密
|
||||||
|
function aen($string, $operation = 'DECODE', $key = '', $expiry = 0) {
|
||||||
|
$ckey_length = 4;
|
||||||
|
// 随机密钥长度 取值 0-32;
|
||||||
|
// 加入随机密钥,可以令密文无任何规律,即便是原文和密钥完全相同,加密结果也会每次不同,增大破解难度。
|
||||||
|
// 取值越大,密文变动规律越大,密文变化 = 16 的 $ckey_length 次方
|
||||||
|
// 当此值为 0 时,则不产生随机密钥
|
||||||
|
$key = md5($key ? $key : 'IAmCiNiao!!!');
|
||||||
|
$keya = md5(substr($key, 0, 16));
|
||||||
|
$keyb = md5(substr($key, 16, 16));
|
||||||
|
$keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : '';
|
||||||
|
|
||||||
|
$cryptkey = $keya.md5($keya.$keyc);
|
||||||
|
$key_length = strlen($cryptkey);
|
||||||
|
|
||||||
|
$string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string;
|
||||||
|
$string_length = strlen($string);
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
$box = range(0, 255);
|
||||||
|
|
||||||
|
$rndkey = array();
|
||||||
|
for($i = 0; $i <= 255; $i++) {
|
||||||
|
$rndkey[$i] = ord($cryptkey[$i % $key_length]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for($j = $i = 0; $i < 256; $i++) {
|
||||||
|
$j = ($j + $box[$i] + $rndkey[$i]) % 256;
|
||||||
|
$tmp = $box[$i];
|
||||||
|
$box[$i] = $box[$j];
|
||||||
|
$box[$j] = $tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
for($a = $j = $i = 0; $i < $string_length; $i++) {
|
||||||
|
$a = ($a + 1) % 256;
|
||||||
|
$j = ($j + $box[$a]) % 256;
|
||||||
|
$tmp = $box[$a];
|
||||||
|
$box[$a] = $box[$j];
|
||||||
|
$box[$j] = $tmp;
|
||||||
|
$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
|
||||||
|
}
|
||||||
|
|
||||||
|
if($operation == 'DECODE') {
|
||||||
|
if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {
|
||||||
|
return substr($result, 26);
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return $keyc.str_replace('=', '', base64_encode($result));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//抓取数据方法封装
|
||||||
|
/*
|
||||||
|
$url : 抓取的url路径
|
||||||
|
$postArray : POST的数据,默认为空
|
||||||
|
$con : 更多设置,array(CURLOPT_COOKIE=>'cookname=cookval&cn2=cv2')
|
||||||
|
*/
|
||||||
|
function getHttpPage($url,$postArray='',$con=''){
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
//curl_setopt($ch, CURLOPT_TIMEOUT, 10000); //超时时间(秒)
|
||||||
|
if(is_array($postArray)){
|
||||||
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS,$postArray);
|
||||||
|
}
|
||||||
|
if(is_array($con)){
|
||||||
|
foreach($con as $key => $value){
|
||||||
|
curl_setopt($ch,$key,$value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$html = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查邮箱是否有效
|
||||||
|
function isEmail($email) {
|
||||||
|
return strlen($email) > 6 && preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email);
|
||||||
|
}
|
||||||
|
|
||||||
|
//当前时间
|
||||||
|
function now(){
|
||||||
|
return date("Y-m-d H:i:s");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
取字符串左右
|
||||||
|
left('abcde',-1) = abcd
|
||||||
|
*/
|
||||||
|
function left($str,$len){
|
||||||
|
if((int)$len>0){
|
||||||
|
return mb_substr($str,0,$len,'utf8');
|
||||||
|
}else{
|
||||||
|
return mb_substr($str,0,len($str)+$len,'utf8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function right($str,$len){
|
||||||
|
if($len>0){
|
||||||
|
return mb_substr($str,len($str)-$len,len($str),'utf8');
|
||||||
|
}else{
|
||||||
|
return mb_substr($str,abs($len),len($str),'utf8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function len($str){
|
||||||
|
return mb_strlen($str,'utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
字符串查找,同JS中的indexOf
|
||||||
|
未找到返回 -1 (被查找的字符串,要查找的,从前还是后:默认前)
|
||||||
|
*/
|
||||||
|
function indexOf($str,$find,$rev=0){
|
||||||
|
if($rev==0){
|
||||||
|
$res=stripos($str,$find);
|
||||||
|
}else{
|
||||||
|
$res=strripos($str,$find);
|
||||||
|
}
|
||||||
|
if(isn($res)){
|
||||||
|
return -1;
|
||||||
|
}else{
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//跳转到指定页面
|
||||||
|
function jsgoto($url){
|
||||||
|
header("refresh:0;url=$url");
|
||||||
|
echo "<script>location.href='".$url."'</script>";
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否为空值
|
||||||
|
function isn($str){
|
||||||
|
if(is_array($str)){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(is_null($str) || strlen($str)==0){
|
||||||
|
return 1;
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取客户端IP
|
||||||
|
function getip(){
|
||||||
|
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
|
||||||
|
$onlineip = getenv('HTTP_CLIENT_IP');
|
||||||
|
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
|
||||||
|
$onlineip = getenv('HTTP_X_FORWARDED_FOR');
|
||||||
|
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
|
||||||
|
$onlineip = getenv('REMOTE_ADDR');
|
||||||
|
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
|
||||||
|
$onlineip = $_SERVER['REMOTE_ADDR'];
|
||||||
|
}
|
||||||
|
return $onlineip;
|
||||||
|
}
|
||||||
|
//是否数字简写
|
||||||
|
function isNum($str){
|
||||||
|
$isnum = 0;
|
||||||
|
if(is_numeric($str)) $isnum = 1;
|
||||||
|
return $isnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
//替代die函数
|
||||||
|
function we($str){
|
||||||
|
if(gettype($str)=='string'){
|
||||||
|
echo $str;
|
||||||
|
}else{
|
||||||
|
print_r($str);
|
||||||
|
}
|
||||||
|
global $mongo;
|
||||||
|
$mongo->close();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Request方法简写
|
||||||
|
function rq($name){
|
||||||
|
return $_GET[$name];
|
||||||
|
}
|
||||||
|
function rf($name){
|
||||||
|
return $_POST[$name];
|
||||||
|
}
|
||||||
|
function r($name){
|
||||||
|
return $_REQUEST[$name];
|
||||||
|
}
|
||||||
|
function _rq($name){
|
||||||
|
return sqlDecode(rq($name));
|
||||||
|
}
|
||||||
|
function _rf($name){
|
||||||
|
return sqlDecode(rf($name));
|
||||||
|
}
|
||||||
|
function _r($name){
|
||||||
|
return sqlDecode(r($name));
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取当前周的第一天的日期时间戳
|
||||||
|
function getWeekStartTime($date){
|
||||||
|
$ntime=strtotime($date);
|
||||||
|
$week = date('W',$ntime);
|
||||||
|
$dayNum = 0;
|
||||||
|
for($i = 1;$i<8;$i++){
|
||||||
|
$difTime = date('W',strtotime(date("Ymd",$ntime))-(60*60*24*$i));
|
||||||
|
if($week == $difTime)
|
||||||
|
$dayNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$weekStart = strtotime(date("Ymd",$ntime))-(60*60*24*$dayNum);
|
||||||
|
return $weekStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
//时间相加
|
||||||
|
function dateAdd($unit = "d",$int,$date) {
|
||||||
|
$date_time_array = getdate(strtotime($date));
|
||||||
|
$hours = $date_time_array["hours"];
|
||||||
|
$minutes = $date_time_array["minutes"];
|
||||||
|
$seconds = $date_time_array["seconds"];
|
||||||
|
$month = $date_time_array["mon"];
|
||||||
|
$day = $date_time_array["mday"] ;
|
||||||
|
$year = $date_time_array["year"] ;
|
||||||
|
switch ($unit) {
|
||||||
|
case "yyyy": $year +=$int;
|
||||||
|
break;
|
||||||
|
case "q": $month +=($int*3);
|
||||||
|
break;
|
||||||
|
case "m": $month +=$int;
|
||||||
|
break;
|
||||||
|
case "y": $day+=$int;
|
||||||
|
break;
|
||||||
|
case "d": $day+=$int;
|
||||||
|
break;
|
||||||
|
case "w": $day+=$int;
|
||||||
|
break;
|
||||||
|
case "ww": $day+=($int*7);
|
||||||
|
break;
|
||||||
|
case "h": $hours+=$int;
|
||||||
|
break;
|
||||||
|
case "n": $minutes+=$int;
|
||||||
|
break;
|
||||||
|
case "s": $seconds+=$int;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$timestamp = mktime($hours ,$minutes, $seconds,$month ,$day, $year);
|
||||||
|
return date("Y-m-d H:i:s",$timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
##SQL语句类
|
||||||
|
class DB{
|
||||||
|
public static $conns = array();
|
||||||
|
/*
|
||||||
|
取得数据库连接资源
|
||||||
|
从serverconfig中载入$_CONFIG['db']配置项
|
||||||
|
*/
|
||||||
|
public function getconnG(){
|
||||||
|
global $_CONFIG;
|
||||||
|
return self::conndb($_CONFIG['db']);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
连接数据库,配置文件格式
|
||||||
|
array(
|
||||||
|
'ip'=>'localhost', #数据库服务器IP
|
||||||
|
'username'=>'root', #用户名
|
||||||
|
'pwd'=>'root', #密码
|
||||||
|
'database'=>'game3', #数据库名
|
||||||
|
'charset'=>'utf8', #默认编码
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
public function conndb($dbconf){
|
||||||
|
$key = $dbconf['database'] .'_'. $dbconf['username'] .'_'. $dbconf['pwd'];
|
||||||
|
if(self::$conns[$key]){
|
||||||
|
return self::$conns[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
$conn = @mysql_connect($dbconf['ip'].($dbconf['port'] && $dbconf['port']!=''?':'.$dbconf['port']:''), $dbconf['username'], $dbconf['pwd']);
|
||||||
|
if(!$conn)self::error("数据库服务器连接超时");
|
||||||
|
$db = @mysql_select_db($dbconf['database'],$conn);
|
||||||
|
if(!$db)self::error("{$dbconf['database']}读取错误");
|
||||||
|
mysql_query("SET NAMES '".$dbconf['charset']."'",$conn);
|
||||||
|
self::$conns[$key]=$conn;
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*关闭数据库*/
|
||||||
|
public function closeall(){
|
||||||
|
foreach(self::$conns as $key=>$val){
|
||||||
|
@mysql_close($val);
|
||||||
|
@mysql_free_result();
|
||||||
|
self::$conns = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*返回数据库记录集*/
|
||||||
|
public function exe($sql){
|
||||||
|
if($sql=='') self::error('exe时SQL语句必须存在');
|
||||||
|
$conn = self::getconnG();
|
||||||
|
$res = @mysql_query($sql,$conn);
|
||||||
|
if(mysql_error($conn)) self::error();
|
||||||
|
return $res;
|
||||||
|
unset($res,$conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
事务方式执行SQL语句,sql可以是字符串或数组
|
||||||
|
多条SQL语句以 ; 号切分,语句中不得含有;号
|
||||||
|
*/
|
||||||
|
public function exesql($sql,$count=false){
|
||||||
|
if(isn($sql)) self::error('EXESQL时SQL语句必须存在');
|
||||||
|
|
||||||
|
global $exesqlCount;
|
||||||
|
$errnum = 0; $errorTxt = '';
|
||||||
|
$exesqlCount = array();
|
||||||
|
|
||||||
|
if(is_array($sql)){
|
||||||
|
$sql = implode($sql,';');
|
||||||
|
}
|
||||||
|
$sqlArr = split (';',$sql);
|
||||||
|
|
||||||
|
$conn = self::getconnG();
|
||||||
|
mysql_query('BEGIN',$conn); #开启事务
|
||||||
|
foreach ($sqlArr as $sqltxt) {
|
||||||
|
$sqltxt = trim($sqltxt);
|
||||||
|
if($sqltxt=='') continue;
|
||||||
|
$res = mysql_query($sqltxt,$conn);
|
||||||
|
|
||||||
|
if(mysql_error($conn)){
|
||||||
|
$errnum++; #SQL语句有误
|
||||||
|
$errorTxt .= mysql_error($conn) . "\r\n";
|
||||||
|
}else{
|
||||||
|
if(!$count) continue;
|
||||||
|
#根据SQL语句,增加记录值
|
||||||
|
if(strtoupper(left($sqltxt,6))=="SELECT"){
|
||||||
|
array_push($exesqlCount,mysql_num_rows($res));
|
||||||
|
}else if(strtoupper(left($sqltxt,6))=="INSERT"){
|
||||||
|
array_push($exesqlCount,mysql_insert_id());
|
||||||
|
}else{
|
||||||
|
array_push($exesqlCount,mysql_affected_rows());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($errnum>0){
|
||||||
|
#回滚数据
|
||||||
|
mysql_query("ROLLBACK",$conn);
|
||||||
|
self::error($errorTxt);
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
mysql_query("COMMIT",$conn);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
unset($sqlArr,$conn,$res,$errorTxt,$errnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*记录集转数组*/
|
||||||
|
public function getrow($rs,$fmttype=1){
|
||||||
|
$conf=array(MYSQL_NUM,MYSQL_ASSOC,MYSQL_BOTH);
|
||||||
|
$res = mysql_fetch_array($rs,$conf[$fmttype]);
|
||||||
|
if(is_array($res))$res = array_change_key_case($res);
|
||||||
|
return $res;
|
||||||
|
unset($res,$conf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*取sql语句第一行第一列的值*/
|
||||||
|
public function getval($sql){
|
||||||
|
$res = self::getrow(self::exe($sql),0);
|
||||||
|
if(!is_array($res)){
|
||||||
|
return '';
|
||||||
|
}else{
|
||||||
|
return $res[0];
|
||||||
|
}
|
||||||
|
unset($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
取SQL语句结果数组
|
||||||
|
indexkey为结果数组的key用数据库的哪个列
|
||||||
|
*/
|
||||||
|
public function getarray($sql,$indexkey=''){
|
||||||
|
$res = array();
|
||||||
|
$sqlres = self::exe($sql);
|
||||||
|
while($row=self::getrow($sqlres)){
|
||||||
|
if($indexkey==''){
|
||||||
|
$res[] = $row;
|
||||||
|
}else{
|
||||||
|
$res[$row[$indexkey]] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $res;
|
||||||
|
unset($res,$sqlres,$row);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
取SQL语句结果数组的第一条记录
|
||||||
|
*/
|
||||||
|
public function getone($sql){
|
||||||
|
$res = self::getarray($sql);
|
||||||
|
if(count($res)==0){
|
||||||
|
return array();
|
||||||
|
}else{
|
||||||
|
return $res[0];
|
||||||
|
}
|
||||||
|
unset($res);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
处理所有出错信息
|
||||||
|
$errMsg自定义的出错信息
|
||||||
|
*/
|
||||||
|
public function error($errMsg=''){
|
||||||
|
if ($errMsg == "") {
|
||||||
|
$m = "mysql error:\r\n<br/>";
|
||||||
|
$m .= mysql_errno() . ":" . mysql_error () . "\r\n<br/>";
|
||||||
|
$m .= 'URL:'.$_SERVER["REQUEST_URI"];
|
||||||
|
echo $m;
|
||||||
|
}else{
|
||||||
|
$m .= "mysql error:\r\n<br/>";
|
||||||
|
$m .= $errMsg . "\r\n<br/>";
|
||||||
|
$m .= 'URL:'.$_SERVER["REQUEST_URI"];
|
||||||
|
echo $m;
|
||||||
|
}
|
||||||
|
$log="=====================================\r\n<br/>";
|
||||||
|
$log .= date("Y-m-d H:i:s")."\r\n<br/>";
|
||||||
|
$log .= $m ."\r\n<br/>";
|
||||||
|
echo $log;
|
||||||
|
//@file_put_contents("game/log/database.log",$log,FILE_APPEND);
|
||||||
|
unset($m);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
更新SQL语句
|
||||||
|
$tablename 表名
|
||||||
|
$param 更新数据,字符串或array
|
||||||
|
$where 更新条件
|
||||||
|
返回SQL语句
|
||||||
|
*/
|
||||||
|
public function update($tablename,$param,$where=''){
|
||||||
|
if(!is_array($param)){
|
||||||
|
self::error("UPDATE语句错误:param类型不符");
|
||||||
|
}
|
||||||
|
$paramArr=array();
|
||||||
|
foreach($param as $key => $val){
|
||||||
|
if(is_array($val)){
|
||||||
|
array_push($paramArr,"$key=".$val[0]);
|
||||||
|
}else{
|
||||||
|
array_push($paramArr,"$key='".addslashes($val)."'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$param = implode(',',$paramArr);
|
||||||
|
unset($paramArr,$key,$val);
|
||||||
|
return 'UPDATE `'.strtolower(trim($tablename)) .'` SET '. $param . ($where ? ' WHERE ' . $where : '');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
插入SQL语句
|
||||||
|
$tablename 表名
|
||||||
|
$param 插入数据array
|
||||||
|
返回SQL语句
|
||||||
|
*/
|
||||||
|
public function insert($tablename,$param){
|
||||||
|
if(!is_array($param)){
|
||||||
|
self::error("INSERT语句错误:param类型不符");
|
||||||
|
}
|
||||||
|
$paramArr=array();
|
||||||
|
foreach($param as $key => $val){
|
||||||
|
array_push($paramArr,"$key='".addslashes($val)."'");
|
||||||
|
}
|
||||||
|
$param = implode(',',$paramArr);
|
||||||
|
unset($paramArr,$key,$val);
|
||||||
|
return 'INSERT INTO `'.strtolower(trim($tablename)) .'` SET '. $param;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
删除SQL语句
|
||||||
|
$tablename 表名
|
||||||
|
$where 删除条件
|
||||||
|
返回SQL语句
|
||||||
|
*/
|
||||||
|
public function delete($tablename,$where=''){
|
||||||
|
if (!$where) {
|
||||||
|
self::error("删除函数必须指定条件");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 'DELETE FROM `' . $tablename . '` WHERE ' . $where;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
查询SQL语句
|
||||||
|
$fields 字段
|
||||||
|
$tablename 表名
|
||||||
|
$where 条件
|
||||||
|
$orderby 排序
|
||||||
|
$limit 记录条数
|
||||||
|
返回SQL语句
|
||||||
|
*/
|
||||||
|
public function select($fields,$tablename,$where='',$orderby='',$limit=''){
|
||||||
|
$sql = 'SELECT ' . $fields . ' FROM `' . $tablename .'`' . ($where ? ' WHERE ' . $where : '') . ($orderby ? ' ORDER BY ' . $orderby . ' ':'') . ($limit ? ' limit ' . $limit : '');
|
||||||
|
return $sql;
|
||||||
|
unset($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
##MEMCACHE类
|
||||||
|
class CACHE{
|
||||||
|
public static $conns = array();
|
||||||
|
|
||||||
|
#根据配置文件,取连接资源
|
||||||
|
function getconnG(){
|
||||||
|
global $_CONFIG;
|
||||||
|
return self::connCache($_CONFIG['memcache']);
|
||||||
|
}
|
||||||
|
|
||||||
|
#连接到memcache
|
||||||
|
public function connCache($dbconf){
|
||||||
|
$key = $dbconf['ip'] .'.'. $dbconf['port'];
|
||||||
|
|
||||||
|
if(self::$conns[$key]){
|
||||||
|
return self::$conns[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
$conn = memcache_pconnect($dbconf['ip'], $dbconf['port']); //采用持久连接
|
||||||
|
//$conn = memcache_connect($dbconf['ip'], $dbconf['port']);
|
||||||
|
self::$conns[$key]=$conn;
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
|
||||||
|
#设置缓存内容
|
||||||
|
public function set($key,$val,$timeout=0){
|
||||||
|
return memcache_set(self::getconnG(),$key,$val,0,$timeout);#timeout秒后超时
|
||||||
|
}
|
||||||
|
|
||||||
|
#读取缓存内容
|
||||||
|
public function get($key){
|
||||||
|
return memcache_get(self::getconnG(),$key);
|
||||||
|
}
|
||||||
|
|
||||||
|
#删除指定key缓存
|
||||||
|
public function del($key,$delay=0){
|
||||||
|
return memcache_delete(self::getconnG(),$key,$delay); #delay秒后删除
|
||||||
|
}
|
||||||
|
|
||||||
|
#删除所有缓存
|
||||||
|
public function delall(){
|
||||||
|
memcache_flush(self::getconnG());
|
||||||
|
}
|
||||||
|
|
||||||
|
#关闭连接
|
||||||
|
public function close(){
|
||||||
|
@memcache_close(self::getconnG());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
##游戏SESSIOON类
|
||||||
|
class SESS{
|
||||||
|
public static $init = 0;
|
||||||
|
public static $preKey = 'CiNiAoSeSs';
|
||||||
|
|
||||||
|
#初始化session
|
||||||
|
public function initSession(){
|
||||||
|
if(self::$init==1) return;
|
||||||
|
global $_CONFIG; #加载配置文件,将session保存到memecahe
|
||||||
|
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
|
||||||
|
//ini_set("session.save_handler","memcache");
|
||||||
|
//ini_set("session.save_path",$_CONFIG['memcache']['ip'].":".$_CONFIG['memcache']['port']);
|
||||||
|
ini_set('session.gc_maxlifetime',172800);
|
||||||
|
/*可以修改为使用文件方式保存session
|
||||||
|
ini_set("session.save_handler","files");
|
||||||
|
session_save_path( "session/");
|
||||||
|
*/
|
||||||
|
session_start();
|
||||||
|
self::$init = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#读取session
|
||||||
|
public function get($key){
|
||||||
|
self::initSession();
|
||||||
|
return $_SESSION[self::$preKey.$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
#设置session
|
||||||
|
public function set($key,$val){
|
||||||
|
self::initSession();
|
||||||
|
$_SESSION[self::$preKey.$key] = $val;
|
||||||
|
}
|
||||||
|
|
||||||
|
#删除指定session
|
||||||
|
public function del($key){
|
||||||
|
self::initSession();
|
||||||
|
unset($_SESSION[self::$preKey.$key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#删除所有session
|
||||||
|
public function delall(){
|
||||||
|
self::initSession();
|
||||||
|
session_destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
9
inc/config.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
$_CONFIG = array(
|
||||||
|
//数据库相关
|
||||||
|
'db' =>array(
|
||||||
|
),
|
||||||
|
'mongo' => 'mongodb://root:iamciniao@127.0.0.1:27017/admin'
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
141
inc/filedb.php
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* 文件操作类
|
||||||
|
*/
|
||||||
|
class Core_Fun_File {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建目录,可以创建子目录
|
||||||
|
* @param string $dir 目录路径,绝对路径
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function makeDir( $dir ) {
|
||||||
|
mkdir( $dir , 0777 , true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向一个文件写入数据
|
||||||
|
* @param string $file 写入的文件
|
||||||
|
* @param string $data 写入的数据
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function _write( $file , $data ) {
|
||||||
|
file_put_contents( $file , $data , LOCK_EX );
|
||||||
|
@chmod( $file , 0777 );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向一个文件写入数据
|
||||||
|
* 在目录/文件不存在的时候,自动创建
|
||||||
|
* @param string $file 写入的文件
|
||||||
|
* @param string $data 写入的数据
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function write( $file , $data ) {
|
||||||
|
$_updir = dirname( $file );
|
||||||
|
if (!file_exists( $_updir ) || !is_dir( $_updir )) {
|
||||||
|
self::makeDir( $_updir );
|
||||||
|
}
|
||||||
|
self::_write( $file , $data );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取文件内容
|
||||||
|
* @param string $file 文件地址,绝对路径
|
||||||
|
* @param number $offset 起始位置
|
||||||
|
* @param number $len 读取长度,默认读取所有
|
||||||
|
* @return string
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function read( $file , $offset = 0 , $len = null) {
|
||||||
|
if ($len) {
|
||||||
|
return file_get_contents( $file , true , null , $offset , $len );
|
||||||
|
}
|
||||||
|
return file_get_contents( $file , true , null , $offset );
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除一个文件
|
||||||
|
* @param string $file 文件名,绝对地址
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function delete( $file ) {
|
||||||
|
self::remove( $file );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除一个文件
|
||||||
|
* @param string $file 文件名,绝对地址
|
||||||
|
* @author Icehu
|
||||||
|
*/
|
||||||
|
public static function remove( $file ) {
|
||||||
|
@unlink( $file );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function deleteDir($dir)
|
||||||
|
{
|
||||||
|
if (is_dir($dir) && rmdir($dir)==false ) {
|
||||||
|
if ($dp = opendir($dir)) {
|
||||||
|
while (($file=readdir($dp)) != false) {
|
||||||
|
if (is_dir($file) && $file!='.' && $file!='..') {
|
||||||
|
self::deleteDir($file);
|
||||||
|
} else {
|
||||||
|
self::remove($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dp);
|
||||||
|
} else {
|
||||||
|
exit('Not permission');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**/
|
||||||
|
$FILEDBCACHE=array();
|
||||||
|
class FILEDB{
|
||||||
|
public function getFile($uid,$table){
|
||||||
|
$uidmd5 = md5($uid);
|
||||||
|
$cacheFile = ROOT.'./usrcache/'. left($uidmd5,2) . '/'. right($uidmd5,2). '/'.$uid .'_'. $table .'.php';
|
||||||
|
return $cacheFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function var_export_min($data){
|
||||||
|
//return str_replace(array("\r","\n","\t"),'',var_export($data, true));
|
||||||
|
return var_export($data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
$uid = 保存到哪个UID
|
||||||
|
$table = 保存到哪张表
|
||||||
|
$key = 保存为PHP的变量key
|
||||||
|
$data = 要保存的数据
|
||||||
|
*/
|
||||||
|
public function writeArray($uid,$table,$key,$data){
|
||||||
|
if(!is_array($data)) we('FILEDB::writeArray的数据必须是数组');
|
||||||
|
|
||||||
|
$str = "<?php\r\nglobal \$". $key. ";\r\n\${$key}=";
|
||||||
|
$str .= self::var_export_min($data, true).";\r\n?>";
|
||||||
|
|
||||||
|
$file = self::getFile($uid,$table);
|
||||||
|
//we($file);
|
||||||
|
Core_Fun_File::write($file,$str);
|
||||||
|
global $FILEDBCACHE;
|
||||||
|
unset($FILEDBCACHE[$file]);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
获取一个缓存数据
|
||||||
|
*/
|
||||||
|
public function get($uid,$table){
|
||||||
|
$file = self::getFile($uid,$table);
|
||||||
|
if(!file_exists($file)) return false;
|
||||||
|
global $FILEDBCACHE;
|
||||||
|
if(!$FILEDBCACHE[$file]){
|
||||||
|
$FILEDBCACHE[$file] = 1;
|
||||||
|
include $file;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
120
inc/guide.php
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
// 根据用户的分组获取用户新手的模板看板
|
||||||
|
function getTemplateBoardIdForUserGroupName($groupName){
|
||||||
|
global $wekan;
|
||||||
|
$boardTitle = '@'.$groupName.'@';
|
||||||
|
$templateBoard = $wekan->boards->findOne(array(
|
||||||
|
'title' => new MongoRegex("/".$boardTitle."/$i"),
|
||||||
|
'archived' => false
|
||||||
|
));
|
||||||
|
|
||||||
|
// $res = iterator_to_array($templateBoard);
|
||||||
|
// var_dump($templateBoard);
|
||||||
|
|
||||||
|
if($templateBoard){
|
||||||
|
return $templateBoard['_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加新员工新手指导看板 标题名字 @<部门名字>@新手指导看板 @开发部@新手指导看板
|
||||||
|
function insertGuideBoardForTemplateBoard($uid,$templateBoardId){
|
||||||
|
if(!$templateBoardId){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
global $wekan;
|
||||||
|
|
||||||
|
$_boardId = uniqid();
|
||||||
|
// echo 'boardId '.$_boardId;
|
||||||
|
|
||||||
|
$resReturn = array();
|
||||||
|
|
||||||
|
$resReturn['boardId'] = $_boardId;
|
||||||
|
|
||||||
|
$_uid = $_SESSION['leguworkUID'];
|
||||||
|
|
||||||
|
$data = array(
|
||||||
|
"_id" => $_boardId ,
|
||||||
|
"title" => "新手指导" ,
|
||||||
|
"permission" =>"private",
|
||||||
|
"slug" => "board",
|
||||||
|
"archived" => false,
|
||||||
|
"view" => "board-view-lists",
|
||||||
|
"createdAt" => new MongoDate(time()),
|
||||||
|
"stars" => 0 ,
|
||||||
|
"labels" => initLables(),
|
||||||
|
"qalabels" => initQALables(),
|
||||||
|
"members" => array(
|
||||||
|
array(
|
||||||
|
"userId" => $uid,
|
||||||
|
"isAdmin" => true,
|
||||||
|
"isActive" => true,
|
||||||
|
"isCommentOnly" => false
|
||||||
|
)
|
||||||
|
),
|
||||||
|
"color" => "belize",
|
||||||
|
"modifiedAt" => new MongoDate(time()),
|
||||||
|
"watchers" => array(
|
||||||
|
array(
|
||||||
|
"userId" => $uid ,
|
||||||
|
"level" =>"tracking"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$res = $wekan->boards->insert( $data );
|
||||||
|
|
||||||
|
// 添加列表
|
||||||
|
$tplLists = $wekan->lists->find(array(
|
||||||
|
'boardId' => $templateBoardId,
|
||||||
|
'archived' => false
|
||||||
|
));
|
||||||
|
|
||||||
|
$tplLists = iterator_to_array($tplLists);
|
||||||
|
|
||||||
|
$listArr = array();
|
||||||
|
foreach($tplLists as $tplListId=>$tplListValue){
|
||||||
|
$_listId = uniqid();
|
||||||
|
|
||||||
|
// echo 'listid '.$_listId;
|
||||||
|
$tplListValue['_id'] = $_listId;
|
||||||
|
$tplListValue['boardId'] = $_boardId;
|
||||||
|
$res = $wekan->lists->insert($tplListValue);
|
||||||
|
|
||||||
|
// 该列表下的卡片
|
||||||
|
$tplCards = $wekan->cards->find(array(
|
||||||
|
'boardId' => $templateBoardId,
|
||||||
|
'listId'=>$tplListId,
|
||||||
|
'archived' => false
|
||||||
|
));
|
||||||
|
|
||||||
|
$tplCards = iterator_to_array($tplCards);
|
||||||
|
|
||||||
|
$cardArr = array();
|
||||||
|
foreach($tplCards as $tplCardId=>$tplCardValue){
|
||||||
|
$_cardId = uniqid();
|
||||||
|
// echo 'cardid '.$_cardId;
|
||||||
|
$cardArr[] = $_cardId;
|
||||||
|
$tplCardValue['_id'] = $_cardId;
|
||||||
|
$tplCardValue['boardId'] = $_boardId;
|
||||||
|
$tplCardValue['listId'] = $_listId;
|
||||||
|
$tplCardValue['members'] = array($uid);
|
||||||
|
$res = $wekan->cards->insert($tplCardValue);
|
||||||
|
}
|
||||||
|
$listArr[$_listId] = $cardArr;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
$resReturn['lists'] = $listArr;
|
||||||
|
|
||||||
|
return $resReturn;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
22
index.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
header("Content-type: text/html;charset=utf-8");
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
define('APPIN',true);
|
||||||
|
define('DEBUG',true);
|
||||||
|
define('ROOT', dirname(__FILE__).DIRECTORY_SEPARATOR);
|
||||||
|
require(ROOT."./inc/bll.php");
|
||||||
|
|
||||||
|
//统一入口模式
|
||||||
|
//使用?app=folder.file模式指定文件
|
||||||
|
$getApp = r('M');
|
||||||
|
if(isn($getApp))$getApp=rq('app');
|
||||||
|
if(strlen($getApp)==0){
|
||||||
|
$getApp='board';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($V[$getApp]))$getApp=$V[$getApp];
|
||||||
|
$file = str_replace('.',DIRECTORY_SEPARATOR,$getApp).'.php';
|
||||||
|
require(ROOT.$file);
|
||||||
|
|
||||||
|
@$mongo->close();
|
||||||
|
?>
|
56
labels.html
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<%
|
||||||
|
var card = DATA.cards[ DATA.lastShowCardID ];
|
||||||
|
var board = DATA.boards[ card.boardId ];
|
||||||
|
%>
|
||||||
|
<div class="pop-over" id="addlabels">
|
||||||
|
<div class="header">
|
||||||
|
<a class="back-btn js-back-view headbtn_left labelback" style="display: none;"><i class="fa fa-chevron-left"></i></a>
|
||||||
|
<span class="header-title">标签</span>
|
||||||
|
<a class="headbtn_right close_addlabels"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<ul class="pop-over-list js-card-label-list chooseLabelUL" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
for(var i=0;i<board.labels.length;i++){
|
||||||
|
var label = board.labels[i];
|
||||||
|
var _isSelect = false;
|
||||||
|
if(card.labelIds && card.labelIds.indexOf(label._id) != -1){
|
||||||
|
_isSelect = true;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<li class="label_li card-label-<%=label.color%> card-labelid-<%=label._id%>" data-labelname="<%=label.name%>" data-labelcolor="<%=label.color%>" data-id="<%=label._id%>">
|
||||||
|
<span class="full-name"><%=label.name%></span>
|
||||||
|
<%= (_isSelect?'<i class="fa fa-check"></i>':'')%>
|
||||||
|
|
||||||
|
<span class="fa fa-edit labelEdit" style="float: right; opacity: 0.5;" ></span>
|
||||||
|
<!--span class="fa fa-clock-o labelSetTimer" id="labelTimer_<%=label._id%>" style="float: right; opacity: 0.6; margin-right: 10px;" ></span-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
<li class="label_li add_label_li2">
|
||||||
|
<span class="full-name">增加标签</span>
|
||||||
|
<i class="fa fa-plus" style="float: right; opacity: 0.5;"></i>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="addLabelUL" style=" display: none;">
|
||||||
|
<input type="hidden" placeholder="id" maxlength="4" class="addLabelID">
|
||||||
|
<input type="text" placeholder="标签内容" maxlength="4" class="addLabelName">
|
||||||
|
<ul class="pop-over-list js-card-label-list" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
var colors = ['legugreen','legupurple','legublue','leguyellow','legured','legupink','legugray','leguaqua'];
|
||||||
|
for(var i=0;i<colors.length;i++){
|
||||||
|
%>
|
||||||
|
<li class="add_label_li card-label-<%=colors[i]%>" data-labelcolor="<%=colors[i]%>">
|
||||||
|
|
||||||
|
<!--<i class="fa fa-check"></i>-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
<button class="button addlabelbtn" type="button" style="margin: 10px 0;">确定</button>
|
||||||
|
<button class="button btn-danger dellabelbtn" type="button" style="margin: 10px 0;float: right;">删除</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
164
leftbar.html
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<div class="leftbar">
|
||||||
|
<ul style="height: 100%;font-size:12px">
|
||||||
|
<li class="homeli" style="text-align: center; margin-bottom: 10px;;">
|
||||||
|
<a href="./?app=board" style="color: #fff; text-decoration: none;"><span class="fa fa-home" style=" font-size: 30px;;"></span>
|
||||||
|
<br>项目</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="homeli" style="text-align: center; margin-bottom: 10px;;">
|
||||||
|
<a href="./?app=timeline" style="color: #fff; text-decoration: none;"><span class="fa fa-book" style=" font-size: 30px;;"></span>
|
||||||
|
<br>日程</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="homeli" style="text-align: center; margin-bottom: 10px;;">
|
||||||
|
<a href="./?app=events" style="color: #fff; text-decoration: none;"><span class="fa fa-calendar" style=" font-size: 30px;;"></span>
|
||||||
|
<br>事件</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="left_chart" class="homeli" style="text-align: center; margin-bottom: 10px;display: none">
|
||||||
|
<a href="./?app=chart" style="color: #fff; text-decoration: none;"><span class="fa fa-area-chart" style=" font-size: 30px;;"></span>
|
||||||
|
<br>图表</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="left_chart2" class="homeli" style="text-align: center; margin-bottom: 10px;display: none">
|
||||||
|
<a href="./?app=chart2" style="color: #fff; text-decoration: none;"><span class="fa fa-area-chart" style=" font-size: 30px;;"></span>
|
||||||
|
<br>图表2</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="left_chart3" class="homeli" style="text-align: center; margin-bottom: 10px;display: none">
|
||||||
|
<a href="./?app=usercard" style="color: #fff; text-decoration: none;"><span class="fa fa-area-chart" style=" font-size: 30px;;"></span>
|
||||||
|
<br>人员看板</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="lis">
|
||||||
|
<!-- <ul id="lis"></ul>-->
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
<span class="lbmyname" style="cursor: pointer;" onclick="location.href='./?app=mycalendar'">
|
||||||
|
<img src="img/cad.png" style="position: absolute;margin-top: -20px;margin-left:1px"/>
|
||||||
|
<span class="mynametext"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
.leftbar .tag{ font-size: 10px; padding: 3px; padding-right: 10px; background:#155077;margin-bottom: 8px;border-top-left-radius:5px;border-bottom-left-radius:5px; color: #aaa; text-align: right; margin-left: 5px; line-height: 31px;; }
|
||||||
|
.leftbar .tag.on{ background:#f1f1f1; color: #000;}
|
||||||
|
#lis{
|
||||||
|
max-height: 700px;
|
||||||
|
overflow-y: overlay;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
if(MYINFO){
|
||||||
|
$('.lbmyname').show().css("background-image","url("+ MYINFO.profile.avatarUrl +")");
|
||||||
|
//$('.mynametext').html( MYINFO.profile.fullname.substr(-2) );
|
||||||
|
$('.mynametext').html("");
|
||||||
|
}else{
|
||||||
|
$('.lbmyname').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
var TITLEKEY="";
|
||||||
|
//提取列表中的tag
|
||||||
|
function createListTags(){
|
||||||
|
if(!DATA.boardid)return;
|
||||||
|
|
||||||
|
// card hash 跳转
|
||||||
|
var hashCardId = '';
|
||||||
|
var listId = '';
|
||||||
|
var clickTag = '';
|
||||||
|
if( window['HASH'] && HASH()['cardid']){
|
||||||
|
hashCardId = HASH()['cardid'];
|
||||||
|
listId = DATA.cards[hashCardId].listId
|
||||||
|
}
|
||||||
|
|
||||||
|
var lists = DATA.lists;
|
||||||
|
var ALLTAG = {};
|
||||||
|
for(var i in lists){
|
||||||
|
if(lists[i].boardId != DATA.boardid)continue;
|
||||||
|
if(lists[i].archived)continue;
|
||||||
|
var tags = lists[i].title.match(/【(\S*?)】/g);
|
||||||
|
if(tags && tags.length>0){
|
||||||
|
tags.forEach(function(v){
|
||||||
|
if (listId != '' && i == listId){
|
||||||
|
var _key = v.replace('【','').replace('】','');
|
||||||
|
clickTag = _key
|
||||||
|
}
|
||||||
|
ALLTAG[v] = 1;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var keys = Object.keys(ALLTAG);
|
||||||
|
keys.sort();
|
||||||
|
|
||||||
|
var lis=[];
|
||||||
|
keys.forEach(function(v){
|
||||||
|
var _key = v.replace('【','').replace('】','');
|
||||||
|
lis.push( '<li class="tag tagkey'+ _key +'" data-key="'+ _key +'">'+ _key +'</li>' );
|
||||||
|
});
|
||||||
|
|
||||||
|
if(lis.length>0){
|
||||||
|
lis.push( '<li class="tag" data-key="">所有</li>' );
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#lis').html( lis.join('')).css('height', $(document).height()-400);
|
||||||
|
|
||||||
|
|
||||||
|
if(lis.length>0){
|
||||||
|
$('#lis .tag').off().on('click',function(){
|
||||||
|
TITLEKEY = $(this).data('key');
|
||||||
|
$('#lis .tag').removeClass('on');
|
||||||
|
$(this).addClass('on');
|
||||||
|
setTitleKey();
|
||||||
|
});
|
||||||
|
|
||||||
|
if($('#lis .tagkey'+TITLEKEY).length>0){
|
||||||
|
$('#lis .tagkey'+TITLEKEY).click();
|
||||||
|
}else{
|
||||||
|
$('#lis .tag').eq(0).click();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
TITLEKEY = "";
|
||||||
|
setTitleKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(clickTag){
|
||||||
|
$('#lis .tagkey' + clickTag).click();
|
||||||
|
}
|
||||||
|
// $('#lis .tagkey优化建议').click();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTitleKey(){
|
||||||
|
listInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
//setTimeout(function(){
|
||||||
|
createListTags();
|
||||||
|
//},0);
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
$(function () {
|
||||||
|
checkPermission('QAlabels',function (isok) {
|
||||||
|
if(isok) {
|
||||||
|
$('#left_chart').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
checkPermission('QALeftChart2',function (isok) {
|
||||||
|
if(isok) {
|
||||||
|
$('#left_chart2').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
checkPermission('QALeftChart3',function (isok) {
|
||||||
|
if(isok) {
|
||||||
|
$('#left_chart3').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
})
|
||||||
|
*/
|
||||||
|
</script>
|
555
list.php
Normal file
@ -0,0 +1,555 @@
|
|||||||
|
<?
|
||||||
|
require_once "api.php";
|
||||||
|
$boardid = r('boardid');
|
||||||
|
|
||||||
|
$boards = boards(true);
|
||||||
|
$lists = getlists($boardid);
|
||||||
|
$cards = getcards($boardid,array_keys($lists));
|
||||||
|
$users = getusers();
|
||||||
|
$risklabels = getRiskLabels();
|
||||||
|
$allrisklabels = getAllRiskLabels();
|
||||||
|
$yanqidepartmentuser = getYanQiDepartmentUser();
|
||||||
|
|
||||||
|
$DATA = array(
|
||||||
|
'boardid' => $boardid,
|
||||||
|
'boards' => $boards,
|
||||||
|
'lists' => $lists,
|
||||||
|
'cards' => $cards,
|
||||||
|
'users'=>$users,
|
||||||
|
'risklabels'=>$risklabels,
|
||||||
|
'allrisklabels'=>$allrisklabels,
|
||||||
|
'yanqidepartmentuser'=> $yanqidepartmentuser,
|
||||||
|
'ts'=>time(),
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
<link type="text/css" href="css/jquery.atwho.css?_<?=filemtime('css/jquery.atwho.css')?>" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="scripts/jedate.css?_<?=filemtime('scripts/jedate.css')?>" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="scripts/jquery.caret.js?_<?=filemtime('scripts/jquery.caret.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jquery.atwho.js?_<?=filemtime('scripts/jquery.atwho.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/proreport.js?_<?=filemtime('scripts/proreport.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/cardPopover.js?_<?=filemtime('scripts/cardPopover.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/card_list_timeline.js?_<?=filemtime('scripts/card_list_timeline.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/copy_list_to_new.js?_<?=filemtime('scripts/copy_list_to_new.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/echarts.min.js?_<?=filemtime('scripts/echarts.min.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jedate.js?_<?=filemtime('scripts/jedate.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/diff.js"></script>
|
||||||
|
|
||||||
|
<!-- fullcalendar v4.1.0 start -->
|
||||||
|
<link href='timeline/core.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<link href='timeline/resource-timeline.main.min.css' rel='stylesheet'/>
|
||||||
|
<script src='timeline/core.main.min.js'></script>
|
||||||
|
<script src='timeline/locales-all.min.js'></script>
|
||||||
|
<script src='timeline/interaction.main.min.js'></script>
|
||||||
|
<script src='timeline/timeline.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-common.main.min.js'></script>
|
||||||
|
<script src='timeline/resource-timeline.main.min.js'></script>
|
||||||
|
<style>
|
||||||
|
a.fc-timeline-event {
|
||||||
|
color: #fff
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- fullcalendar v4.1.0 end -->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
<div id="firstlabelcardinfoMask" style="display:none;"></div>
|
||||||
|
<script type="text/tmpl" id="tmpl-cardinfo" >
|
||||||
|
<? require_once "cardinfo.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-card_timeline" >
|
||||||
|
<? require_once "card_list_timeline.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-listmenu" >
|
||||||
|
<? require_once "listmenu.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardmenu" >
|
||||||
|
<? require_once "cardmenu.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardinfo_comments" >
|
||||||
|
<? require_once "cardinfo_comments.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-proreport" >
|
||||||
|
<? require_once "proreport.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardpopover" >
|
||||||
|
<? require_once "cardpopover.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-memberlist" >
|
||||||
|
<? require_once "memberlist.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addlabels" >
|
||||||
|
<? require_once "labels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addRisklabels" >
|
||||||
|
<? require_once "risklabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addQAlabels" >
|
||||||
|
<? require_once "qalabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-firstAddQaLabels" >
|
||||||
|
<? require_once "firstAddQaLabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-modifyTitle" >
|
||||||
|
<div class="pop-over" id="modifyTitle">
|
||||||
|
<div class="header">
|
||||||
|
<span class="header-title">修改看板名</span>
|
||||||
|
<a class="headbtn_right close_popover"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<input type="text" class="modifyTitle_text" placeholder="输入看板名"></input>
|
||||||
|
<button class="button modifyTitle_btnsubmit" type="button" style=" margin: 4px 0 15px 0;">确定</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-lists" >
|
||||||
|
<div class="panel" data-id="<%=data['_id']%>" id="list_<%=data['_id']%>">
|
||||||
|
<div class="tasktitle">
|
||||||
|
<div class="tasklistcount"></div>
|
||||||
|
<h2 class="tasktitle_cont"><%=data['title']%></h2>
|
||||||
|
<a class="fa fa-bars list_menu" href="javascript:;;;"></a>
|
||||||
|
<div class="setlisttile_editor_div" style="display:none ;">
|
||||||
|
<textarea class="setlisttile_editor js-new-comment-input" data-bindbtn='.setlisttile_btnsubmit' placeholder="输入栏目标题" data-autosize-on="true" style=" word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button setlisttile_btnsubmit" type="button" style=" float: right; margin-top: 4px;">确定</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tasklist">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="" style=" width:94%; clear: both; position:relative;; margin:0 3%;margin-top: 15px; display: ;">
|
||||||
|
<a class="js-card-composer add_card_href" href="javascript:;" style="display: block;width: 115px;">
|
||||||
|
<i class="fa fa-plus"></i>添加卡片
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="class_addcard_div" style="display: none;">
|
||||||
|
<textarea class="addcard_editor js-new-comment-input" data-bindbtn='.addcard_btnsubmit' placeholder="输入任务(Ctrl+Enter提交)" data-autosize-on="true" style="word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button addcard_btnsubmit" type="button" style=" float: right; margin-top: 4px;">添加</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-list-add" >
|
||||||
|
<div class="panel" id="list_add_panel">
|
||||||
|
<div class="tasktitle">
|
||||||
|
<h2 class="tasktitle_cont"><i class="fa fa-plus"></i> 新增栏目</h2>
|
||||||
|
<div class="setlisttile_editor_div" style="display:none ;">
|
||||||
|
<textarea class="setlisttile_editor js-new-comment-input" data-bindbtn='.setlisttile_btnsubmit' placeholder="输入标题(Ctrl+Enter提交)" data-autosize-on="true" style="word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button setlisttile_btnsubmit" type="button" style=" float: right; margin-top: 4px;">确定</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="tasklist">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-card" >
|
||||||
|
<div class="card" data-id="<%=data['_id']%>" id="card_<%=data['_id']%>">
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" id="finishcheck_<%=data['_id']%>" class="finishcheck" style="vertical-align: top;"/>
|
||||||
|
<span class="list_card_title_qalabel_name"></span>
|
||||||
|
<span class="list_card_title"></span>
|
||||||
|
<div class="commonts_num"><span></span></div>
|
||||||
|
<span class="card-corner-mark"></span>
|
||||||
|
</div>
|
||||||
|
<!--<span class="badge-icon fa fa-comment-o badge-comment"> 4</span> -->
|
||||||
|
<div class="badges">
|
||||||
|
<div class="minicard-labels"></div>
|
||||||
|
</div>
|
||||||
|
<div class="minicard-members js-minicard-members"></div>
|
||||||
|
<div style="clear:both"></div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="main">
|
||||||
|
<div id="centerpanel" style=" white-space:nowrap;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
DATA = <?=json_encode($DATA)?>;
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
listInit();
|
||||||
|
|
||||||
|
$('#centerpanel').sortable({
|
||||||
|
tolerance:'pointer',
|
||||||
|
items: ".panel:not(#list_add_panel)",
|
||||||
|
distance: 15,
|
||||||
|
opacity:0.8,
|
||||||
|
revert:100,
|
||||||
|
stop: function(event, ui){
|
||||||
|
var newOrder = $('#centerpanel').sortable('serialize');
|
||||||
|
doSubmitSortList(DATA.boardid,newOrder);
|
||||||
|
console.log( newOrder );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
bindTasklistsort();
|
||||||
|
|
||||||
|
|
||||||
|
$('body').on("click",".card",function(e){
|
||||||
|
if(e.toElement && e.toElement.type == 'checkbox')return;
|
||||||
|
console.log('showcard');
|
||||||
|
var cardid = $(this).data('id');
|
||||||
|
//checkUnfinishedCardCanClick(cardid,function() {
|
||||||
|
showCard( cardid );
|
||||||
|
//});
|
||||||
|
});
|
||||||
|
//增加卡片链接
|
||||||
|
$('body').on("click",".add_card_href",function(){
|
||||||
|
$(this).parent().find('.class_addcard_div').show();
|
||||||
|
// $(this).parent().find('.addcard_editor').val('【分类】');
|
||||||
|
$(this).parent().find('.addcard_editor').val('');
|
||||||
|
$(this).parent().find('.addcard_editor').select();
|
||||||
|
$(this).hide();
|
||||||
|
//
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
// 新的提单方式
|
||||||
|
var me = this;
|
||||||
|
var val = DC.unfinishedTitle;
|
||||||
|
|
||||||
|
// var val = $(this).parent().find('.addcard_editor').val();
|
||||||
|
// if(val.length==0){
|
||||||
|
// $(this).parents('.class_addcard_div').hide();
|
||||||
|
// $(this).parents('.panel').find('.add_card_href').show();
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
var listid = $(this).parents('.panel').data('id');
|
||||||
|
doSubmitAddCard2(val,DATA.boardid,listid,function(data){
|
||||||
|
$(me).parent().find('.addcard_editor').val('');
|
||||||
|
$('#list_'+ listid+ ' .tasklist').scrollTop(999999);
|
||||||
|
console.log('new data',data);
|
||||||
|
|
||||||
|
showCard( data.data._id );
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//添加卡片-添加按钮
|
||||||
|
$('body').on("click",".addcard_btnsubmit",function(e){
|
||||||
|
|
||||||
|
|
||||||
|
var me = this;
|
||||||
|
$(this).parents('.class_addcard_div').hide();
|
||||||
|
$(this).parents('.panel').find('.add_card_href').show();
|
||||||
|
|
||||||
|
var val = $(this).parent().find('.addcard_editor').val();
|
||||||
|
if(val.length==0){
|
||||||
|
$(this).parents('.class_addcard_div').hide();
|
||||||
|
$(this).parents('.panel').find('.add_card_href').show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var listid = $(this).parents('.panel').data('id');
|
||||||
|
doSubmitAddCard2(val,DATA.boardid,listid,function(data){
|
||||||
|
$(me).parent().find('.addcard_editor').val('');
|
||||||
|
$('#list_'+ listid+ ' .tasklist').scrollTop(999999);
|
||||||
|
// console.log('old data',data);
|
||||||
|
|
||||||
|
DATA.lastShowCardID = data.data._id;
|
||||||
|
|
||||||
|
// $('#firstlabelcardinfoMask').show();
|
||||||
|
// showQALabelsOnNewAdd(e);
|
||||||
|
|
||||||
|
showCard( data.data._id ,function () {
|
||||||
|
var target = $('#cardinfo').offset();
|
||||||
|
console.log('target',target);
|
||||||
|
|
||||||
|
var boardTitle = DATA.boards[DATA.boardid].title;
|
||||||
|
var isCheckBoardTitle = boardTitle.match(/《(\S*?)》/g);
|
||||||
|
if (isCheckBoardTitle){
|
||||||
|
showQALabelsOnNewAdd({clientY:target.top+110,clientX:target.left+15});
|
||||||
|
}
|
||||||
|
|
||||||
|
// $('.cardinfo_description').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//栏目标题
|
||||||
|
$('body').on("click",".tasktitle_cont",function(){
|
||||||
|
$(this).parent().find('.setlisttile_editor_div').show();
|
||||||
|
$(this).hide();
|
||||||
|
var ov = $(this).text();
|
||||||
|
if(ov==' 新增栏目')ov="【】";
|
||||||
|
$(this).parent().find('.setlisttile_editor').val( ov );
|
||||||
|
});
|
||||||
|
//栏目标题确认按钮
|
||||||
|
$('body').on("click",".setlisttile_btnsubmit",function(){
|
||||||
|
var me = this;
|
||||||
|
var val = $(this).parent().find('.setlisttile_editor').val();
|
||||||
|
if(val.length==0){
|
||||||
|
$(this).parents('.setlisttile_editor_div').hide();
|
||||||
|
$(this).parents('.panel').find('.tasktitle_cont').show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isvalok = val.match(/【(\S*?)】/g);
|
||||||
|
if(!isvalok || isvalok.length == 0){
|
||||||
|
alert('请添加【】符号正确创建新列表');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(val.replace(/\s+/g, "") == '【】'){
|
||||||
|
alert('请在【】中添加内容');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var listid = $(this).parents('.panel').data('id');
|
||||||
|
if(listid==null){
|
||||||
|
doSubmitAddList(val,DATA.boardid,function(){
|
||||||
|
$(me).parent().find('.setlisttile_editor').val('');
|
||||||
|
$(me).click();
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
doSubmitSetListTitle(val,DATA.boardid,listid,function(){
|
||||||
|
$(me).parent().find('.setlisttile_editor').val('');
|
||||||
|
$(me).click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//顶部标题
|
||||||
|
$('body').on("click",".projectheader h1",function(e){
|
||||||
|
showMidiTitle(e);
|
||||||
|
});
|
||||||
|
//顶部标题确定按钮
|
||||||
|
$('body').on("click",".modifyTitle_btnsubmit",function(e){
|
||||||
|
doSubmitMidifyBoardTitle( DATA.boardid , $('.modifyTitle_text').val(),function(){
|
||||||
|
$('#modifyTitle .close_popover').click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
//popover统一关闭逻辑
|
||||||
|
$('body').on("click",".close_popover",function(e){
|
||||||
|
$(this).parents('.pop-over').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//title前的复选框
|
||||||
|
$('body').on("click",".finishcheck",function(){
|
||||||
|
var that = $(this);
|
||||||
|
// that.preventDefault();
|
||||||
|
var cardid = $(this).parents('.card').data('id');
|
||||||
|
|
||||||
|
/*
|
||||||
|
var labels = DATA.cards[cardid].labelIds;
|
||||||
|
for(var i=0;i<labels.length;i++){
|
||||||
|
doSubmitSetLabel(cardid,labels[i]);
|
||||||
|
}
|
||||||
|
if(DATA.cards[cardid].risklabelIds){
|
||||||
|
var risklabels = DATA.cards[cardid].risklabelIds;
|
||||||
|
for(var i=0;i<risklabels.length;i++){
|
||||||
|
doSubmitSetRiskLabel(cardid,risklabels[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
var _oldTitle = DATA.cards[cardid].title;
|
||||||
|
if(_oldTitle.indexOf('~~') == -1){
|
||||||
|
_oldTitle = '~~'+ _oldTitle + '~~';
|
||||||
|
doSubmitCommonts('我勾选了<font color=blue>[完成]</font>卡片',DATA.boardid,cardid);
|
||||||
|
|
||||||
|
if(window.MYINFO && DATA.cards[ cardid ].userId != window.MYINFO._id ){
|
||||||
|
//如果这个单子不是我创建的
|
||||||
|
var ownerInfo = DATA.users[DATA.cards[ cardid ].userId];
|
||||||
|
if(ownerInfo && ownerInfo.profile.fullname){
|
||||||
|
var msgInfo = window.MYINFO.profile.fullname + "完成了任务["+ DATA.cards[ cardid ].title+']';
|
||||||
|
sendDDMSG(ownerInfo.profile.fullname,msgInfo,location.href,ownerInfo.dduserid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
_oldTitle = _oldTitle.replace(/~/g,'');
|
||||||
|
}
|
||||||
|
doSubmitTitle(_oldTitle, DATA.boardid, cardid,function(){});
|
||||||
|
});
|
||||||
|
|
||||||
|
//list列表菜单按钮
|
||||||
|
$('body').on("click",".list_menu",function(e){
|
||||||
|
showListMenu(e,this);
|
||||||
|
});
|
||||||
|
$('#wrap').on('click',function(){
|
||||||
|
$('.listmenu').remove();
|
||||||
|
});
|
||||||
|
$('body').on("click",".close_menu_li",function(e){
|
||||||
|
$('.listmenu').remove();
|
||||||
|
});
|
||||||
|
$('body').on("click",".archived_list",function(e){
|
||||||
|
if(confirm("确定要将这个列表归档吗?")){
|
||||||
|
var listid = $(this).parents('.listmenu').data('id');
|
||||||
|
doSubmitArchivedList(listid,function(){
|
||||||
|
$('.close_menu_li').click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('.listmenu').remove();
|
||||||
|
});
|
||||||
|
$('body').on("click",".archived_overedcards",function(e){
|
||||||
|
if(confirm("确定要将这个列表中所有已完成项归档吗?")){
|
||||||
|
var listid = $(this).parents('.listmenu').data('id');
|
||||||
|
doSubmitArchivedOveredCards(listid,function(){
|
||||||
|
$('.close_menu_li').click();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on("click",".export_excel_this_list",function(e){
|
||||||
|
const lid = $(this).parents('.listmenu').data('id');
|
||||||
|
const bid = DATA.lists[lid].boardId;
|
||||||
|
export_excel_url = pyapi_host + `/v2/export/list?bid=${bid}&lid=${lid}`;
|
||||||
|
window.open(export_excel_url);
|
||||||
|
return;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on("click",".list_timeline",function(e){
|
||||||
|
var listid = $(this).parents('.listmenu').data('id');
|
||||||
|
|
||||||
|
|
||||||
|
$('.listmenu').remove();
|
||||||
|
showCardTimeline(listid);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on("contextmenu",".card",function(e){
|
||||||
|
$('#cardmenu').remove();
|
||||||
|
var cardid = $(this).data('id');
|
||||||
|
//var listid = $(obj).parents('.panel').data('id');
|
||||||
|
//var html = T( $('#tmpl-listmenu').html() , DATA.lists[ listid ] );
|
||||||
|
var html = $('#tmpl-cardmenu').html();
|
||||||
|
$('body').append( html );
|
||||||
|
|
||||||
|
var listTitle = {};
|
||||||
|
for(var listid in DATA.lists){
|
||||||
|
if(DATA.lists[listid].boardId != DATA.boardid)continue;
|
||||||
|
if(DATA.lists[listid].archived)continue;
|
||||||
|
listTitle[ DATA.lists[listid].title ] = listid;
|
||||||
|
}
|
||||||
|
var listTitles = Object.keys(listTitle);
|
||||||
|
listTitles.sort();
|
||||||
|
var html = ["<option value=''>请选择</option>"];
|
||||||
|
for(var i=0;i<listTitles.length;i++){
|
||||||
|
html.push("<option value='"+ listTitle[ listTitles[i] ] +"'>"+ listTitles[i] +"</option>");
|
||||||
|
}
|
||||||
|
console.log( html );
|
||||||
|
$('#cardmovetoselect').html( html.join('') );
|
||||||
|
|
||||||
|
$('#cardmenu').css({
|
||||||
|
'left':$(document).scrollLeft() + e.clientX,
|
||||||
|
'top':e.clientY+15
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#cardmovetoselect').off().on('change',function(){
|
||||||
|
if(!$(this).val())return;
|
||||||
|
doSubmitChangeListID(cardid,$(this).val());
|
||||||
|
$('#cardmenu').remove();
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$('body').on('click','#movecardto',function(e){
|
||||||
|
$('#movetodiv').css({
|
||||||
|
top:$(this).offset().top+20,
|
||||||
|
left:$(this).offset().left+60
|
||||||
|
}).show();
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('body').on("click",".copy_list_to_new",function(e){
|
||||||
|
var listid = $(this).parents('.listmenu').data('id');
|
||||||
|
|
||||||
|
$('.listmenu').remove();
|
||||||
|
// showCardTimeline(listid);
|
||||||
|
copyListToNew(listid);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//当有hash值时,自动选中对应card
|
||||||
|
if( window['HASH'] && HASH()['cardid']){
|
||||||
|
if($('#card_'+ HASH()['cardid']).length >0 ){
|
||||||
|
moveToCard( HASH()['cardid'] )
|
||||||
|
showCard( HASH()['cardid'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//移动到指定卡片
|
||||||
|
function moveToCard(cardid,callback){
|
||||||
|
if($('#card_'+ cardid).length == 0 ){
|
||||||
|
callback && callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var offset = $('#card_'+ cardid).offset();
|
||||||
|
$('body').animate({scrollLeft: (offset.left-200)+'px'}, 400);
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
var top = $('#card_'+ cardid).position().top;
|
||||||
|
$('#card_'+ cardid).parents('.tasklist').animate({scrollTop: (top-300) +'px'}, 400);
|
||||||
|
callback && callback();
|
||||||
|
},400);
|
||||||
|
}
|
||||||
|
|
||||||
|
//textarea ctrl+Enter处理
|
||||||
|
$('body').on('keydown','textarea,input',function(e){
|
||||||
|
if(e.keyCode == 13 && e.ctrlKey ){
|
||||||
|
var _select = $(this).data('bindbtn');
|
||||||
|
$(this).parent().find(_select).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//快捷键
|
||||||
|
$('body').on('keydown',function(e){
|
||||||
|
//console.log(e);
|
||||||
|
//ALT+M
|
||||||
|
if(e.keyCode == 77 && e.altKey ){
|
||||||
|
if(filterList._lastFiler!='my'){
|
||||||
|
filterList.my();
|
||||||
|
$('#filterText').val('my');
|
||||||
|
}else{
|
||||||
|
filterList.null();
|
||||||
|
$('#filterText').val('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
86
listmenu.html
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<ul id="listmenu" class="listmenu" data-id="<%=data._id%>" style="position: absolute; z-index: 999;">
|
||||||
|
<!--<li class="ui-state-disabled">
|
||||||
|
<div>Toys (n/a)</div>
|
||||||
|
</li>-->
|
||||||
|
<li>
|
||||||
|
<div class="list_timeline">当前日程</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li></li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="copy_list_to_new">复制当前列</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li></li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<div class="archived_list">归档该列表</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div class="archived_overedcards">归档已完成项</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div class="export_excel_this_list">下载该列表</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<li class="close_menu_li">
|
||||||
|
<div>close</div>
|
||||||
|
</li>-->
|
||||||
|
<!--<li>
|
||||||
|
<div>Electronics</div>
|
||||||
|
<ul>
|
||||||
|
<li class="ui-state-disabled">
|
||||||
|
<div>Home Entertainment</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Car Hifi</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Utilities</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Movies</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Music</div>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div>Rock</div>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div>Alternative</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Classic</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Jazz</div>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div>Freejazz</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Big Band</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Modern</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<div>Pop</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="ui-state-disabled">
|
||||||
|
<div>Specials (n/a)</div>
|
||||||
|
</li>-->
|
||||||
|
</ul>
|
50
memberlist.html
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<%
|
||||||
|
var currCard = DATA.cards[ DATA.lastShowCardID ];
|
||||||
|
var lastTs = DATA.ts-86400*7;
|
||||||
|
%>
|
||||||
|
<div class="pop-over" id="memberlist">
|
||||||
|
<div class="header">
|
||||||
|
<!--<a class="back-btn js-back-view headbtn_left" href="#"><i class="fa fa-chevron-left"></i></a>-->
|
||||||
|
<span class="header-title">成员</span>
|
||||||
|
<a class="headbtn_right close_memberlist"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent" style="height: 360px;">
|
||||||
|
<input type="text" placeholder="输入关键词筛选" class="memberlist_input"></input>
|
||||||
|
|
||||||
|
<ul class="pop-over-list js-card-member-list" style=" height:290px;overflow-y: auto;color:#4d4d4d;">
|
||||||
|
|
||||||
|
|
||||||
|
<%
|
||||||
|
var order = getMemberOrder();
|
||||||
|
for(var uid in data){
|
||||||
|
data[uid]['_clientOrder'] = order[uid] || 0;
|
||||||
|
}
|
||||||
|
var values = [];
|
||||||
|
for(var uid in data){
|
||||||
|
if(data[uid]['lastlogin'] > lastTs){
|
||||||
|
values.push( data[uid] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
values.sort(function(a,b){
|
||||||
|
return b._clientOrder - a._clientOrder;
|
||||||
|
});
|
||||||
|
|
||||||
|
for(var _i=0;_i< values.length;_i++){
|
||||||
|
var uid = values[_i]._id;
|
||||||
|
var _isSelect = "";
|
||||||
|
if(currCard.members.indexOf(uid) != -1){
|
||||||
|
_isSelect = true;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<li class="memlist_li member_list_<%=uid%>" data-select="<%=_isSelect%>" data-uid="<%=uid%>">
|
||||||
|
<span class="full-name"><%=data[uid].profile.fullname%>@<%=data[uid].orgname%><span class="username" style="display:none">(<%=data[uid].username%>)</span></span>
|
||||||
|
<%= (_isSelect?'<i class="fa fa-check"></i>':'')%>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
134
mycalendar.php
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
<?
|
||||||
|
/*
|
||||||
|
require_once "api.php";
|
||||||
|
$boardid = r('boardid');
|
||||||
|
|
||||||
|
$boards = getboards();
|
||||||
|
$cards = getmycards();
|
||||||
|
//we($mycards);
|
||||||
|
//$lists = getlists($boardid);
|
||||||
|
//$cards = getcards($boardid,array_keys($lists));
|
||||||
|
$users = getusers();
|
||||||
|
|
||||||
|
$list = array();
|
||||||
|
foreach($cards as $cid=>$card){
|
||||||
|
$borderid = $card['boardId'];
|
||||||
|
if($list[$borderid])continue;
|
||||||
|
if(!$boards[ $borderid ]['title'])continue;
|
||||||
|
$list[ $borderid ] = array(
|
||||||
|
"archived"=>false,
|
||||||
|
"title"=> $boards[ $borderid ]['title'],
|
||||||
|
"_id"=> $borderid
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$DATA = array(
|
||||||
|
'boardid' => $boardid,
|
||||||
|
'boards' => $boards,
|
||||||
|
'lists' => $list,
|
||||||
|
'cards' => $cards,
|
||||||
|
'users'=>$users
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/fullcalendar.css">
|
||||||
|
<script src='fullcalendarjs/jquery-ui-1.10.2.custom.min.js'></script>
|
||||||
|
<script src='fullcalendarjs/fullcalendar.min.js'></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="calendar" style="margin:15px;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$('.projectheader h1').html('我的日程');
|
||||||
|
|
||||||
|
var date = new Date();
|
||||||
|
var d = date.getDate();
|
||||||
|
var m = date.getMonth();
|
||||||
|
var y = date.getFullYear();
|
||||||
|
|
||||||
|
$('#calendar').fullCalendar({
|
||||||
|
header: {
|
||||||
|
left: 'prev,next today',
|
||||||
|
center: 'title',
|
||||||
|
right: 'month,agendaWeek,agendaDay'
|
||||||
|
},
|
||||||
|
firstDay: 1,
|
||||||
|
aspectRatio: 2.4,
|
||||||
|
editable: false,
|
||||||
|
timeFormat: 'H:mm',
|
||||||
|
axisFormat: 'H:mm',
|
||||||
|
|
||||||
|
events: function (start, end, callback) {
|
||||||
|
var _start = Math.round(start.getTime() / 1000);
|
||||||
|
var _end = Math.round(end.getTime() / 1000);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: './?app=api&apiact=get_mem_time',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
start: _start,
|
||||||
|
end: _end,
|
||||||
|
who: "mime"
|
||||||
|
},
|
||||||
|
success: function (doc) {
|
||||||
|
callback(doc.calendarData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
eventRender: function (event, element) {
|
||||||
|
element.html('<i class="eventboardtitle">' + event.boardtitle + "</i> " + event.title.substr(0, 40)).css('background', fmtColorByBID(event.boardid));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var bid2color = {};
|
||||||
|
|
||||||
|
function fmtColorByBID(bid) {
|
||||||
|
if (!bid2color[bid]) bid2color[bid] = getRandomSafeColor();
|
||||||
|
return bid2color[bid];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRandomSafeColor() {
|
||||||
|
var base = ['00', '11', '22', '33', '44', '55', '66', '77', '88', '99', 'aa', 'bb', 'cc'];//基础色代码
|
||||||
|
var res = '#';
|
||||||
|
for (var i = 0; i < 3; i++) {
|
||||||
|
res += base[Math.floor(Math.random() * base.length)];
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.fc-week .fc-sun{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.fc-week .fc-sat{
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
366
mylists.php
Normal file
@ -0,0 +1,366 @@
|
|||||||
|
<?
|
||||||
|
require_once "api.php";
|
||||||
|
$boardid = r('boardid');
|
||||||
|
|
||||||
|
$boards = getboards();
|
||||||
|
$cards = getmycards();
|
||||||
|
//we($mycards);
|
||||||
|
//$lists = getlists($boardid);
|
||||||
|
//$cards = getcards($boardid,array_keys($lists));
|
||||||
|
$users = getusers();
|
||||||
|
$risklabels = getRiskLabels();
|
||||||
|
$allrisklabels = getAllRiskLabels();
|
||||||
|
|
||||||
|
$list = array();
|
||||||
|
foreach($cards as $cid=>$card){
|
||||||
|
$borderid = $card['boardId'];
|
||||||
|
if($list[$borderid])continue;
|
||||||
|
if(!$boards[ $borderid ]['title'])continue;
|
||||||
|
$list[ $borderid ] = array(
|
||||||
|
"archived"=>false,
|
||||||
|
"title"=> $boards[ $borderid ]['title'],
|
||||||
|
"_id"=> $borderid
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
$DATA = array(
|
||||||
|
'boardid' => $boardid,
|
||||||
|
'boards' => $boards,
|
||||||
|
'lists' => array("mime"=>array(
|
||||||
|
"archived"=>false,
|
||||||
|
"title"=>"与我相关",
|
||||||
|
"_id"=>'mime'
|
||||||
|
)),
|
||||||
|
'cards' => $cards,
|
||||||
|
'users'=>$users
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
|
$DATA = array(
|
||||||
|
'boardid' => $boardid,
|
||||||
|
'boards' => $boards,
|
||||||
|
'lists' => $list,
|
||||||
|
'cards' => $cards,
|
||||||
|
'users'=>$users,
|
||||||
|
'risklabels'=>$risklabels,
|
||||||
|
'allrisklabels'=>$allrisklabels,
|
||||||
|
'ts'=>time(),
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<? require_once "header.html"; ?>
|
||||||
|
<link type="text/css" href="css/jquery.atwho.css?_<?=filemtime('css/jquery.atwho.css')?>" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="scripts/jedate.css?_<?=filemtime('scripts/jedate.css')?>" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="scripts/jquery.caret.js?_<?=filemtime('scripts/jquery.caret.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jquery.atwho.js?_<?=filemtime('scripts/jquery.atwho.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/proreport.js?_<?=filemtime('scripts/proreport.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/cardPopover.js?_<?=filemtime('scripts/cardPopover.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/card_list_timeline.js?_<?=filemtime('scripts/card_list_timeline.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/copy_list_to_new.js?_<?=filemtime('scripts/copy_list_to_new.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/echarts.min.js?_<?=filemtime('scripts/echarts.min.js')?>"></script>
|
||||||
|
<script type="text/javascript" src="scripts/jedate.js?_<?=filemtime('scripts/jedate.js')?>"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<? require_once "leftbar.html"; ?>
|
||||||
|
<? require_once "projectheader.html"; ?>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardinfo" >
|
||||||
|
<? require_once "cardinfo.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-card_timeline" >
|
||||||
|
<? require_once "card_list_timeline.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-listmenu" >
|
||||||
|
<? require_once "listmenu.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardinfo_comments" >
|
||||||
|
<? require_once "cardinfo_comments.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-proreport" >
|
||||||
|
<? require_once "proreport.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-cardpopover" >
|
||||||
|
<? require_once "cardpopover.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-memberlist" >
|
||||||
|
<? require_once "memberlist.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addlabels" >
|
||||||
|
<? require_once "labels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addQAlabels" >
|
||||||
|
<? require_once "qalabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-addRisklabels" >
|
||||||
|
<? require_once "risklabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-firstAddQaLabels" >
|
||||||
|
<? require_once "firstAddQaLabels.html"; ?>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-modifyTitle" >
|
||||||
|
<div class="pop-over" id="modifyTitle">
|
||||||
|
<div class="header">
|
||||||
|
<span class="header-title">修改看板名</span>
|
||||||
|
<a class="headbtn_right close_popover"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<input type="text" class="modifyTitle_text" placeholder="输入看板名"></input>
|
||||||
|
<button class="button modifyTitle_btnsubmit" type="button" style=" margin: 4px 0 15px 0;">确定</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-lists" >
|
||||||
|
<div class="panel" data-id="<%=data['_id']%>" id="list_<%=data['_id']%>">
|
||||||
|
<div class="tasktitle">
|
||||||
|
<div class="tasklistcount"></div>
|
||||||
|
<h2 class="tasktitle_cont"><%=data['title']%></h2>
|
||||||
|
<a class="fa fa-bars list_menu" href="javascript:;;;"></a>
|
||||||
|
<div class="setlisttile_editor_div" style="display:none ;">
|
||||||
|
<textarea class="setlisttile_editor js-new-comment-input" data-bindbtn='.setlisttile_btnsubmit' placeholder="输入栏目标题" data-autosize-on="true" style=" word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button setlisttile_btnsubmit" type="button" style=" float: right; margin-top: 4px;">确定</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tasklist">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="" style=" width:94%; clear: both; position:relative;; margin:0 3%;margin-top: 15px; display: ;">
|
||||||
|
<a class="js-card-composer add_card_href" href="javascript:;">
|
||||||
|
<i class="fa fa-plus"></i>添加卡片
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="class_addcard_div" style="display: none;">
|
||||||
|
<textarea class="addcard_editor js-new-comment-input" data-bindbtn='.addcard_btnsubmit' placeholder="输入任务(Ctrl+Enter提交)" data-autosize-on="true" style="word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button addcard_btnsubmit" type="button" style=" float: right; margin-top: 4px;">添加</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-list-add" >
|
||||||
|
<div class="panel" id="list_add_panel">
|
||||||
|
<div class="tasktitle">
|
||||||
|
<h2 class="tasktitle_cont"><i class="fa fa-plus"></i> 新增栏目</h2>
|
||||||
|
<div class="setlisttile_editor_div" style="display:none ;">
|
||||||
|
<textarea class="setlisttile_editor js-new-comment-input" data-bindbtn='.setlisttile_btnsubmit' placeholder="输入标题(Ctrl+Enter提交)" data-autosize-on="true" style="word-wrap: break-word; height: 35px;width: 200px;"></textarea><button class="button setlisttile_btnsubmit" type="button" style=" float: right; margin-top: 4px;">确定</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="tasklist">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/tmpl" id="tmpl-card" >
|
||||||
|
<div class="card" data-id="<%=data['_id']%>" id="card_<%=data['_id']%>">
|
||||||
|
<div><input type="checkbox" id="finishcheck_<%=data['_id']%>" class="finishcheck" style="vertical-align: top;"/> <span class="list_card_title"></span> <span class="commonts_num"></span></div>
|
||||||
|
<!--<span class="badge-icon fa fa-comment-o badge-comment"> 4</span> -->
|
||||||
|
<div class="badges">
|
||||||
|
<div class="minicard-labels"></div>
|
||||||
|
</div>
|
||||||
|
<div class="minicard-members js-minicard-members"></div>
|
||||||
|
<div style="clear:both"></div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="wrap">
|
||||||
|
<div id="main">
|
||||||
|
<div id="centerpanel" style=" white-space:nowrap;">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/*.panel{width:450px;}
|
||||||
|
.list_card_title p, .list_card_title ol{max-width:380px}*/
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
DATA = <?=json_encode($DATA)?>;
|
||||||
|
|
||||||
|
function listInit(){
|
||||||
|
var lists = [];
|
||||||
|
for(var listid in DATA.lists){
|
||||||
|
lists.push( DATA.lists[listid] );
|
||||||
|
}
|
||||||
|
lists.sort(function(a,b){
|
||||||
|
return (a.sort||0) - (b.sort||0);
|
||||||
|
});
|
||||||
|
|
||||||
|
fill('#tmpl-lists',lists ,'#centerpanel');
|
||||||
|
|
||||||
|
$('#centerpanel').append( $('#tmpl-list-add').html() );
|
||||||
|
|
||||||
|
for(var listid in DATA.lists){
|
||||||
|
freshList(listid);
|
||||||
|
}
|
||||||
|
$('.tasklist').height( $('#main').height() - 80 );
|
||||||
|
$('#list_add_panel .tasklist').height( $('#main').height() - 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
function freshList(listid){
|
||||||
|
var cards = [];
|
||||||
|
for(var cardid in DATA.cards){
|
||||||
|
if(DATA.cards[cardid].boardId != listid)continue;
|
||||||
|
if(DATA.cards[cardid].archived ) continue;
|
||||||
|
//if(!Filter(DATA.cards[cardid]))continue;
|
||||||
|
|
||||||
|
|
||||||
|
if(DATA.cards[cardid].title.indexOf('~~')==-1){
|
||||||
|
//DATA.cards[cardid].sort = 1;
|
||||||
|
cards.push( DATA.cards[cardid] );
|
||||||
|
}else{
|
||||||
|
//cards.push( DATA.cards[cardid] );
|
||||||
|
//DATA.cards[cardid].sort = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cards.sort(function(a,b){
|
||||||
|
var as = a.sort||0;
|
||||||
|
var bs = b.sort||0;
|
||||||
|
if(as==bs){
|
||||||
|
return a.createdAt.sec - b.createdAt.sec;
|
||||||
|
}else{
|
||||||
|
return as-bs;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fill('#tmpl-card',cards ,'#list_'+ listid+' .tasklist');
|
||||||
|
|
||||||
|
var _all = cards.length;
|
||||||
|
var _over = 0;
|
||||||
|
for(var i=0;i<cards.length;i++){
|
||||||
|
if(cards[i].title.indexOf('~~')!=-1)_over++;
|
||||||
|
fmtCardTitle( cards[i]._id );
|
||||||
|
fmtLabelsByCardID(cards[i]._id);
|
||||||
|
fmtRiskLabelsByCardID(cards[i]._id);
|
||||||
|
fmtIssueTagsByCardID(cards[i]._id);
|
||||||
|
fmtMembersByCardID(cards[i]._id);
|
||||||
|
}
|
||||||
|
//console.log('freshList',listid,_over,_all)
|
||||||
|
$('#list_'+ listid +' .tasklistcount').html(_over + '/' + _all);
|
||||||
|
|
||||||
|
if( (_all == 0 && filterList._lastFiler != 'null') || _all == _over ){ //所有单子都已完成的列表不显示
|
||||||
|
//有筛选条件,且当列1个卡片都没有,直接隐藏
|
||||||
|
$('#list_'+ listid).hide();
|
||||||
|
}else{
|
||||||
|
$('#list_'+ listid).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
listInit();
|
||||||
|
|
||||||
|
//增加卡片链接
|
||||||
|
$('.add_card_href').hide();
|
||||||
|
//新增栏目
|
||||||
|
$('#list_add_panel').hide();
|
||||||
|
//list列表菜单按钮
|
||||||
|
$('.list_menu').hide();
|
||||||
|
|
||||||
|
$('body').on("click",".card",function(e){
|
||||||
|
if(e.toElement && e.toElement.type == 'checkbox')return;
|
||||||
|
showCard( $(this).data('id') );
|
||||||
|
});
|
||||||
|
|
||||||
|
//popover统一关闭逻辑
|
||||||
|
$('body').on("click",".close_popover",function(e){
|
||||||
|
$(this).parents('.pop-over').remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//title前的复选框
|
||||||
|
$('body').on("click",".finishcheck",function(){
|
||||||
|
var that = $(this);
|
||||||
|
var cardid = $(this).parents('.card').data('id');
|
||||||
|
|
||||||
|
// if (isQA()){
|
||||||
|
// if (!isSetQALabel(cardid)){
|
||||||
|
// $(this).prop("checked",false);
|
||||||
|
// alert('请设置问题类型');
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
var labels = DATA.cards[cardid].labelIds;
|
||||||
|
|
||||||
|
/*
|
||||||
|
for(var i=0;i<labels.length;i++){
|
||||||
|
doSubmitSetLabel(cardid,labels[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(DATA.cards[cardid].risklabelIds){
|
||||||
|
var risklabels = DATA.cards[cardid].risklabelIds;
|
||||||
|
for(var i=0;i<risklabels.length;i++){
|
||||||
|
doSubmitSetRiskLabel(cardid,risklabels[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
var _oldTitle = DATA.cards[cardid].title;
|
||||||
|
if(_oldTitle.indexOf('~~') == -1){
|
||||||
|
_oldTitle = '~~'+ _oldTitle + '~~';
|
||||||
|
doSubmitCommonts('我勾选了<font color=blue>[完成]</font>卡片',DATA.boardid,cardid);
|
||||||
|
|
||||||
|
if(window.MYINFO && DATA.cards[ cardid ].userId != window.MYINFO._id ){
|
||||||
|
//如果这个单子不是我创建的
|
||||||
|
var ownerInfo = DATA.users[DATA.cards[ cardid ].userId];
|
||||||
|
if(ownerInfo && ownerInfo.profile.fullname){
|
||||||
|
var msgInfo = window.MYINFO.profile.fullname + "完成了任务["+ DATA.cards[ cardid ].title+']';
|
||||||
|
sendDDMSG(ownerInfo.profile.fullname,msgInfo,location.href,ownerInfo.dduserid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
_oldTitle = _oldTitle.replace(/~/g,'');
|
||||||
|
}
|
||||||
|
doSubmitTitle(_oldTitle, DATA.boardid, cardid,function(){});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//textarea ctrl+Enter处理
|
||||||
|
$('body').on('keydown','textarea,input',function(e){
|
||||||
|
if(e.keyCode == 13 && e.ctrlKey ){
|
||||||
|
var _select = $(this).data('bindbtn');
|
||||||
|
$(this).parent().find(_select).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//快捷键
|
||||||
|
$('body').on('keydown',function(e){
|
||||||
|
//console.log(e);
|
||||||
|
//ALT+M
|
||||||
|
if(e.keyCode == 77 && e.altKey ){
|
||||||
|
if(filterList._lastFiler!='my'){
|
||||||
|
filterList.my();
|
||||||
|
$('#filterText').val('my');
|
||||||
|
}else{
|
||||||
|
filterList.null();
|
||||||
|
$('#filterText').val('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
194
projectheader.html
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
<div class="projectheader">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
//print_r($LEGUWORKUSER);
|
||||||
|
?>
|
||||||
|
<a href="./?app=board"><img src="img/wekan-logo1.png" style="height: 45px; margin-left: 10px;;" /></a>
|
||||||
|
<h1 style="display: inline-block; font-size: 22px; font-weight: normal;vertical-align:top; margin-top: 10px; margin-left: 15px;;">
|
||||||
|
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<span style="display: inline-block; font-size: 14px; font-weight: normal;vertical-align:top; margin-top: 20px; margin-left: 15px;;" id="lastpackinfo"></span>
|
||||||
|
|
||||||
|
<?if(r('app')=='list'){?>
|
||||||
|
<div class="proctrl" style=" position: fixed; display: inline-block;; right: 0; top: 0;;">
|
||||||
|
<!--<span class="fa fa-address-book" onclick="" id="" style="font-size: 20px; margin: 15px 10px 0 0; cursor: pointer;" title="项目报表"></span>-->
|
||||||
|
|
||||||
|
过滤:
|
||||||
|
<div style="display: inline-block; width: 150px;;">
|
||||||
|
<input type="text" id="filterText" style="position: absolute; z-index: 2;width: 121px; margin-top: -15px;border:1px solid #888"/>
|
||||||
|
<select id="editable-select" onchange="$('#filterText').val(this.value);doSearch();" style=" position: absolute;z-index: 0;width: 140px;margin-top: -15px;border:1px solid #888">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<span class="fa fa-bar-chart" onclick="showReport()" id="projectReport" style="font-size: 20px; margin: 15px 10px 0 15px; cursor: pointer;" title="项目报表"></span>
|
||||||
|
<span class="fa fa-universal-access" onclick="showCardPopover()" id="projectReport1" style="font-size: 20px; margin: 15px 10px 0 15px; cursor: pointer;" title="项目集成"></span>
|
||||||
|
</div>
|
||||||
|
<?}?>
|
||||||
|
|
||||||
|
<?if(r('app')=='usercard'){?>
|
||||||
|
<div class="proctrl" style=" position: fixed; display: inline-block;; right: 0; top: 0;;">
|
||||||
|
<div style="display:inline-block;margin-top:15px;margin-right:10px">
|
||||||
|
成员 <select name="user" id="user">
|
||||||
|
<option value="">请选择</option>
|
||||||
|
</select> 的
|
||||||
|
<select name="time_type" id="time_type">
|
||||||
|
<option value="bj">标记时间</option>
|
||||||
|
<option value="wc">完成时间</option>
|
||||||
|
<option value="xz">新增时间</option>
|
||||||
|
</select>
|
||||||
|
于
|
||||||
|
<input type="text" name="daterange" id="date" readonly style="text-align: center;width: 200px;">
|
||||||
|
|
||||||
|
<button id="search">查询</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<? } ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$userinfo = getUserInfo($MYID);
|
||||||
|
if((r('app')=='events') && $userinfo && $userinfo['extData'] && $userinfo['extData']['admin']==='all'){
|
||||||
|
$orgs = getorgs();
|
||||||
|
?>
|
||||||
|
<span style=" position: relative;top: -15px;">
|
||||||
|
<select style="padding:5px;" id="selectorg">
|
||||||
|
<option value="">切换组织</option>
|
||||||
|
<? foreach($orgs as $orgid=>$orgname){?>
|
||||||
|
<option value="<?=$orgid?>"><?=$orgname?></option>
|
||||||
|
<? } ?>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
//提取tag
|
||||||
|
function createTags(){
|
||||||
|
if(!DATA.boardid)return;
|
||||||
|
var cards = DATA.cards;
|
||||||
|
var ALLTAG = {};
|
||||||
|
for(var i in cards){
|
||||||
|
if(cards[i].boardId != DATA.boardid)continue;
|
||||||
|
var tags = cards[i].title.match(/【(\S*?)】/g);
|
||||||
|
if(tags && tags.length>0){
|
||||||
|
tags.forEach(function(v){
|
||||||
|
ALLTAG[v] = 1;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var keys = Object.keys(ALLTAG);
|
||||||
|
|
||||||
|
var labelsHTML=[];
|
||||||
|
if(DATA.boards[DATA.boardid]){
|
||||||
|
var labels = DATA.boards[DATA.boardid].labels;
|
||||||
|
labels.forEach(function(v){
|
||||||
|
labelsHTML.push( '<option value="label_'+ v._id +'">* 匹配标签['+ v.name +']</option>' );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var qaLabelsHTML=[];
|
||||||
|
|
||||||
|
if(DATA.boards[DATA.boardid]){
|
||||||
|
var qaLabels = DATA.boards[DATA.boardid].qalabels;
|
||||||
|
qaLabels.forEach(function(v){
|
||||||
|
qaLabelsHTML.push( '<option value="qalabel_'+ v._id +'">* 匹配QA标签['+ v.name +']</option>' );
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// var html = ['<option value="">选择分类或输入关键词</option><option value="my">* 指派给我的(ALT+M)</option>'+ labelsHTML.join('') + qaLabelsHTML.join('')];
|
||||||
|
var html = ['<option value="">选择分类或输入关键词</option><option value="my">* 指派给我的(ALT+M)</option>'];
|
||||||
|
|
||||||
|
|
||||||
|
// 延期标签 UI 策 策配 美 动效 前程 后程 所有
|
||||||
|
// 选择标签 过滤标签的人设置的完成时间是今天的
|
||||||
|
var htmlTodayDone4DeptLabel = ['UI','策', '策配', '美', '动效', '前程', '后程', '所有'];
|
||||||
|
var htmlTodayDone4DeptLabel = [];
|
||||||
|
var yanqidepartmentuserList = Object.keys(DATA.yanqidepartmentuser);
|
||||||
|
yanqidepartmentuserList.forEach(function (k) {
|
||||||
|
htmlTodayDone4DeptLabel.push({
|
||||||
|
_id:k,
|
||||||
|
name:DATA.yanqidepartmentuser[k].name
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
htmlTodayDone4DeptLabel.forEach(function (v) {
|
||||||
|
if(v.name){
|
||||||
|
html.push('<option value="todaydonedeptlabel_'+ v._id +'">* 当天完成['+v.name+']</option>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
html.push('<option value="hasTodayDone">* 当天完成[所有]</option>');
|
||||||
|
|
||||||
|
html.push(labelsHTML + qaLabelsHTML);
|
||||||
|
|
||||||
|
keys.forEach(function(v){
|
||||||
|
html.push('<option value="'+ v.replace('【','').replace('】','') +'">'+v+'</option>');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#editable-select').html( html.join(''));
|
||||||
|
}
|
||||||
|
//开始筛选
|
||||||
|
function doSearch(){
|
||||||
|
var v = $('#filterText').val();
|
||||||
|
if(v=='my'){
|
||||||
|
filterList.my();
|
||||||
|
}else if(v.indexOf('qalabel_')==0) {
|
||||||
|
var lid = v.replace('qalabel_', '');
|
||||||
|
filterList.hasqaLabel(lid);
|
||||||
|
|
||||||
|
}else if(v.indexOf('label_')==0){
|
||||||
|
var lid = v.replace('label_','');
|
||||||
|
filterList.hasLabel(lid);
|
||||||
|
}else if(v.indexOf('todaydonedeptlabel_')==0){
|
||||||
|
var lid = v.replace('todaydonedeptlabel_','');
|
||||||
|
filterList.hasTodayDone4DeptLabel(lid);
|
||||||
|
}else if(v.indexOf('hasTodayDone')==0){
|
||||||
|
var lid = v;
|
||||||
|
filterList.hasTodayDone(lid);
|
||||||
|
}else if(v==''){
|
||||||
|
filterList.null();
|
||||||
|
}else{
|
||||||
|
filterList.key(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
createTags();
|
||||||
|
|
||||||
|
if(window.MYINFO){
|
||||||
|
watermark({
|
||||||
|
watermark_txt0: MYINFO.profile.fullname,
|
||||||
|
watermark_txt1: MYINFO.orgname + " " + MYINFO.group,
|
||||||
|
watermark_txt2: (DATA.ts?new Date(DATA.ts*1000):new Date()).Format("yyyy-MM-dd hh:mm:ss")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},10);
|
||||||
|
|
||||||
|
//筛选框回车
|
||||||
|
$('#filterText').keydown(function(e){
|
||||||
|
setTimeout(function(){
|
||||||
|
if(e.keyCode==13){
|
||||||
|
doSearch();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if(DATA.boardid && DATA.boards && DATA.boards[ DATA.boardid ]){
|
||||||
|
var board = DATA.boards[ DATA.boardid ];
|
||||||
|
$('.projectheader h1').html( board.title );
|
||||||
|
}else{
|
||||||
|
$('.projectheader h1').html('我的看板');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
30
proreport.html
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<div id="proreportMask" class="rightfixedMask" style="display:none;"></div>
|
||||||
|
<div id="proreport" class="rightfixed" style="overflow-y:auto;">
|
||||||
|
<div class="card-details-header">
|
||||||
|
<h2 class="card-details-title">
|
||||||
|
项目报表
|
||||||
|
</h2>
|
||||||
|
<div class="card-details-ctrl" style="float:right">
|
||||||
|
<a id="cardreportClose" class="fa fa-close" href="javascript:;;;"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div class="card-details-items" id="reportdata" >
|
||||||
|
<!--<h3 class="card-details-item-title">总完成情况</h3>
|
||||||
|
<div id="report1" style="height: 200px;;"></div>
|
||||||
|
<hr/>
|
||||||
|
<h3 class="card-details-item-title">总标签数分布</h3>
|
||||||
|
<div id="report2" style="height: 300px;;"></div>
|
||||||
|
<hr/>-->
|
||||||
|
<!--<div style="clear:both"></div>-->
|
||||||
|
</div>
|
||||||
|
<div class="card-details-items">
|
||||||
|
<div id="lastMonthRemainList">上月</div>
|
||||||
|
<div id="remainlist" style="height: 600px;"></div>
|
||||||
|
<!-- <div id="remainlist"></div>-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
32
python/tw.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
#coding:utf-8
|
||||||
|
'''
|
||||||
|
twisted 公共类
|
||||||
|
@author
|
||||||
|
@email4041990@qq.com
|
||||||
|
'''
|
||||||
|
|
||||||
|
import os
|
||||||
|
if os.name=='nt':
|
||||||
|
try:
|
||||||
|
import twisted.internet.iocpreactor as iocpreactor
|
||||||
|
iocpreactor.install()
|
||||||
|
except:
|
||||||
|
print "iocp error"
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
import twisted.internet.epollreactor as epollreactor
|
||||||
|
epollreactor.install()
|
||||||
|
except:
|
||||||
|
print "epoll error"
|
||||||
|
|
||||||
|
from twisted.internet.protocol import Factory,Protocol
|
||||||
|
from twisted.internet import reactor,threads,defer
|
||||||
|
from twisted.internet.protocol import ClientFactory
|
||||||
|
|
||||||
|
if os.name=='nt':
|
||||||
|
#开发机只开1个线程 以便发现阻塞点
|
||||||
|
reactor.suggestThreadPoolSize(1)
|
||||||
|
else:
|
||||||
|
reactor.suggestThreadPoolSize(100)
|
BIN
python/tw.pyc
Normal file
63
python/websocket.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
#coding:utf-8
|
||||||
|
|
||||||
|
import sys,os,socket
|
||||||
|
import tw,ws
|
||||||
|
|
||||||
|
client = []
|
||||||
|
|
||||||
|
class Server(tw.Protocol):
|
||||||
|
#有客户端接入
|
||||||
|
def connectionMade(self):
|
||||||
|
self.attr={} #主要保存客户端的连接类型
|
||||||
|
self.socketLeftString = '' #socket传输中需要粘包的数据
|
||||||
|
self.transport.getHandle().setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF,32*1024)
|
||||||
|
client.append( self )
|
||||||
|
|
||||||
|
#有客户端断开
|
||||||
|
def connectionLost(self,reason):
|
||||||
|
if self in client:
|
||||||
|
client.remove(self)
|
||||||
|
|
||||||
|
print 'connectionLost'
|
||||||
|
|
||||||
|
#收到客户端发来数据
|
||||||
|
def dataReceived(self, msg):
|
||||||
|
#WS握手
|
||||||
|
if msg.lower().find('upgrade: websocket') != -1:
|
||||||
|
ws.shake(self,msg)
|
||||||
|
return
|
||||||
|
ws.parse_recv_data(self,msg,self._dataReceived)
|
||||||
|
|
||||||
|
#数据解压后,执行解包粘包操作
|
||||||
|
def _dataReceived (self,msg):
|
||||||
|
if msg=='ping':
|
||||||
|
self.send('pong')
|
||||||
|
|
||||||
|
elif msg.startswith('sendOther@_@'):
|
||||||
|
msg = msg.replace('sendOther@_@','')
|
||||||
|
|
||||||
|
for c in client:
|
||||||
|
if c == self:
|
||||||
|
continue
|
||||||
|
c.send( msg )
|
||||||
|
|
||||||
|
|
||||||
|
def send (self,msg,callback=None):
|
||||||
|
msg = str(msg)
|
||||||
|
msg = ws.send_data(self,msg)
|
||||||
|
return self.sendDo(msg,callback)
|
||||||
|
|
||||||
|
def sendDo(self,msg,callback=None):
|
||||||
|
if not self.transport.connected or msg is None:
|
||||||
|
return
|
||||||
|
msg = str(msg)
|
||||||
|
tw.reactor.callFromThread(self.transport.write,msg)
|
||||||
|
|
||||||
|
#启动服务器
|
||||||
|
if __name__=='__main__':
|
||||||
|
f = tw.Factory()
|
||||||
|
f.protocol = Server
|
||||||
|
tw.reactor.listenTCP(3000,f)
|
||||||
|
print 'starting 3000'
|
||||||
|
tw.reactor.run()
|
161
python/ws.py
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
#coding:utf-8
|
||||||
|
|
||||||
|
#本文件主要用于webSocket握手协议及消息处理
|
||||||
|
import hashlib, struct, base64
|
||||||
|
|
||||||
|
#WS握手开始,socket=socket对象 msg=消息体
|
||||||
|
def shake (conn,msg):
|
||||||
|
headers = {}
|
||||||
|
header, data = msg.split('\r\n\r\n', 1)
|
||||||
|
for line in header.split('\r\n')[1:]:
|
||||||
|
key, value = line.split(": ", 1)
|
||||||
|
headers[key] = value
|
||||||
|
if "Host" in headers:headers["Location"] = "ws://%s/" % headers["Host"]
|
||||||
|
conn.attr['type'] = 'ws'
|
||||||
|
|
||||||
|
#老版本的ws协议 目主要用于兼容IOS
|
||||||
|
if headers.has_key('Sec-WebSocket-Key1'):
|
||||||
|
key1 = headers["Sec-WebSocket-Key1"]
|
||||||
|
key2 = headers["Sec-WebSocket-Key2"]
|
||||||
|
key3 = data[:8]
|
||||||
|
token = creatToken(key1, key2, key3)
|
||||||
|
handshake = '\
|
||||||
|
HTTP/1.1 101 Web Socket Protocol Handshake\r\n\
|
||||||
|
Upgrade: WebSocket\r\n\
|
||||||
|
Connection: Upgrade\r\n\
|
||||||
|
Sec-WebSocket-Origin: %s\r\n\
|
||||||
|
Sec-WebSocket-Location: %s\r\n\r\n\
|
||||||
|
' %(headers['Origin'], headers['Location'])
|
||||||
|
|
||||||
|
conn.attr['newVersion'] = False
|
||||||
|
conn.sendDo(handshake + token)
|
||||||
|
#新版本ws协议
|
||||||
|
else:
|
||||||
|
key = headers['Sec-WebSocket-Key']
|
||||||
|
token = creatToken2(key)
|
||||||
|
handshake = '\
|
||||||
|
HTTP/1.1 101 Switching Protocols\r\n\
|
||||||
|
Upgrade: WebSocket\r\n\
|
||||||
|
Connection: Upgrade\r\n\
|
||||||
|
Sec-WebSocket-Accept: %s\r\n\r\n\
|
||||||
|
' % (token)
|
||||||
|
conn.attr['newVersion'] = True
|
||||||
|
conn.sendDo(handshake)
|
||||||
|
|
||||||
|
#格式化http协议发来的消息
|
||||||
|
def parse_httprecv_data(conn,_string,callBack):
|
||||||
|
#TODO解密_string
|
||||||
|
raw_str = _string
|
||||||
|
callBack(raw_str)
|
||||||
|
|
||||||
|
#WS收到消息时,格式化消息
|
||||||
|
def parse_recv_data(conn,_string,callBack):
|
||||||
|
|
||||||
|
if not 'socket_BUFF' in conn.attr:
|
||||||
|
conn.attr['socket_BUFF'] = ''
|
||||||
|
|
||||||
|
msg = conn.attr['socket_BUFF'] + _string
|
||||||
|
|
||||||
|
if 'newVersion' in conn.attr and conn.attr['newVersion']:
|
||||||
|
code_length = ord(msg[1]) & 127
|
||||||
|
if code_length == 126:
|
||||||
|
msgLen = struct.unpack('>H',msg[2:4])[0]
|
||||||
|
masks = msg[4:8]
|
||||||
|
msgTo = 8+msgLen
|
||||||
|
data = msg[8:msgTo]
|
||||||
|
elif code_length == 127:
|
||||||
|
msgLen = struct.unpack('>I',msg[2:6])[0]
|
||||||
|
masks = msg[10:14]
|
||||||
|
msgTo = 14+msgLen
|
||||||
|
data = msg[14:msgTo]
|
||||||
|
else:
|
||||||
|
msgLen = code_length
|
||||||
|
masks = msg[2:6]
|
||||||
|
msgTo = 6+msgLen
|
||||||
|
data = msg[6:msgTo]
|
||||||
|
|
||||||
|
#数据长度不够,等待
|
||||||
|
if len(data)<msgLen:
|
||||||
|
conn.attr['socket_BUFF'] = msg
|
||||||
|
return
|
||||||
|
|
||||||
|
if len(data)==msgLen:
|
||||||
|
conn.attr['socket_BUFF'] = ''
|
||||||
|
parse_recv_data_over(conn,data,masks,callBack)
|
||||||
|
|
||||||
|
#还有未处理的数据
|
||||||
|
if msgTo<len(msg):
|
||||||
|
conn.attr['socket_buff'] = ''
|
||||||
|
parse_recv_data(conn,msg[msgTo:],callBack)
|
||||||
|
|
||||||
|
if msgTo==len(msg):
|
||||||
|
conn.attr['socket_buff'] = ''
|
||||||
|
|
||||||
|
else:
|
||||||
|
raw_str = msg.split("\xFF")[0][1:]
|
||||||
|
callBack(raw_str)
|
||||||
|
|
||||||
|
def parse_recv_data_over (conn,data,masks,callBack):
|
||||||
|
i = 0
|
||||||
|
raw_str = ''
|
||||||
|
for d in data:
|
||||||
|
raw_str += chr(ord(d) ^ ord(masks[i%4]))
|
||||||
|
i += 1
|
||||||
|
callBack(raw_str)
|
||||||
|
|
||||||
|
#WS发送消息时,格式化消息
|
||||||
|
def send_data(conn, raw_str):
|
||||||
|
if 'newVersion' in conn.attr and conn.attr['newVersion']:
|
||||||
|
|
||||||
|
'''
|
||||||
|
首先是一个固定的字节(1000 0001或是1000 0002),这个字节可以不用理会。麻烦的是第二个字节,这里假设第二个字节是1011 1100,首先这个字节的第一位肯定是1,表示这是一个”masked”位,剩下的7个0/1位能够计算出一个数值,比如这里剩下的是 011 1100,计算出来就是60,这个值需要做如下判断:
|
||||||
|
如果这个值介于0000 0000 和 0111 1101 (0 ~ 125) 之间,那么这个值就代表了实际数据的长度;如果这个数值刚好等于0111 1110 (126),那么接下来的2个字节才代表真实数据长度;如果这个数值刚好等于0111 1111 (127),那么接下来的8个字节代表数据长度。
|
||||||
|
'''
|
||||||
|
token = "\x81"
|
||||||
|
length = len(raw_str)
|
||||||
|
if length < 126:
|
||||||
|
token += struct.pack("B", length)
|
||||||
|
elif length <= 0xFFFF:
|
||||||
|
token += struct.pack("!BH", 126, length)
|
||||||
|
else:
|
||||||
|
token += struct.pack("!BQ", 127, length)
|
||||||
|
|
||||||
|
back_str = '%s%s' % (token,raw_str)
|
||||||
|
|
||||||
|
'''
|
||||||
|
back_str = []
|
||||||
|
back_str.append('\x81')
|
||||||
|
data_length = len(raw_str)
|
||||||
|
|
||||||
|
if data_length <= 125:
|
||||||
|
back_str.append(chr(data_length))
|
||||||
|
else:
|
||||||
|
back_str.append(chr(126))
|
||||||
|
back_str.append(chr(data_length >> 8))
|
||||||
|
back_str.append(chr(data_length & 0xFF))
|
||||||
|
|
||||||
|
back_str = "".join(back_str) + raw_str
|
||||||
|
'''
|
||||||
|
else:
|
||||||
|
back_str = '\x00%s\xFF' % (raw_str)
|
||||||
|
return back_str
|
||||||
|
|
||||||
|
#老版本WS服务器握手信息
|
||||||
|
def creatToken( key1, key2, key3):
|
||||||
|
num1 = int("".join([digit for digit in list(key1) if digit.isdigit()]))
|
||||||
|
spaces1 = len([char for char in list(key1) if char == " "])
|
||||||
|
num2 = int("".join([digit for digit in list(key2) if digit.isdigit()]))
|
||||||
|
spaces2 = len([char for char in list(key2) if char == " "])
|
||||||
|
|
||||||
|
combined = struct.pack(">II", num1/spaces1, num2/spaces2) + key3
|
||||||
|
return hashlib.md5(combined).digest()
|
||||||
|
|
||||||
|
#新版本WS服务器握手信息
|
||||||
|
def creatToken2(key):
|
||||||
|
key = key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
|
||||||
|
ser_key = hashlib.sha1(key).digest()
|
||||||
|
return base64.b64encode(ser_key)
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
print send_data("conn", "raw_str"*50000)
|
BIN
python/ws.pyc
Normal file
59
qalabels.html
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<%
|
||||||
|
var card = DATA.cards[ DATA.lastShowCardID ];
|
||||||
|
var board = DATA.boards[ card.boardId ];
|
||||||
|
if(!board.qalabels){
|
||||||
|
board.qalabels = [];
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<div class="pop-over" id="addQAlabels">
|
||||||
|
<div class="header">
|
||||||
|
<a class="back-btn js-back-view headbtn_left qalabelback" style="display: none;"><i class="fa fa-chevron-left"></i></a>
|
||||||
|
<span class="header-title">问题类型</span>
|
||||||
|
<a class="headbtn_right close_addQAlabels"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<ul class="pop-over-list js-card-label-list chooseLabelUL" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
for(var i=0;i<board.qalabels.length;i++){
|
||||||
|
var label = board.qalabels[i];
|
||||||
|
var _isSelect = false;
|
||||||
|
if(card.qalabelIds && card.qalabelIds.indexOf(label._id) != -1){
|
||||||
|
_isSelect = true;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<li class="qalabel_li card-label-<%=label.color%> card-labelid-<%=label._id%>" data-labelname="<%=label.name%>" data-labelcolor="<%=label.color%>" data-id="<%=label._id%>">
|
||||||
|
<span class="full-name"><%=label.name%></span>
|
||||||
|
<%= (_isSelect?'<i class="fa fa-check"></i>':'')%>
|
||||||
|
|
||||||
|
<span class="fa fa-edit labelEdit" style="float: right; opacity: 0.5;" ></span>
|
||||||
|
<!--span class="fa fa-clock-o labelSetTimer" id="labelTimer_<%=label._id%>" style="float: right; opacity: 0.6; margin-right: 10px;" ></span-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
<li class="qalabel_li add_qalabel_li2">
|
||||||
|
<span class="full-name">增加标签</span>
|
||||||
|
<i class="fa fa-plus" style="float: right; opacity: 0.5;"></i>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="addLabelUL" style=" display: none;">
|
||||||
|
<input type="hidden" placeholder="id" maxlength="4" class="addLabelID">
|
||||||
|
<input type="text" placeholder="标签内容" maxlength="4" class="addLabelName">
|
||||||
|
<ul class="pop-over-list js-card-label-list" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
var colors = ['legugreen','legupurple','legublue','leguyellow','legured','legupink','legugray','leguaqua'];
|
||||||
|
for(var i=0;i<colors.length;i++){
|
||||||
|
%>
|
||||||
|
<li class="add_qalabel_li card-label-<%=colors[i]%>" data-labelcolor="<%=colors[i]%>">
|
||||||
|
|
||||||
|
<!--<i class="fa fa-check"></i>-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
<button class="button addQAlabelbtn" type="button" style="margin: 10px 0;">确定</button>
|
||||||
|
<button class="button btn-danger delQAlabelbtn" type="button" style="margin: 10px 0;float: right;">删除</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
56
risklabels.html
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<%
|
||||||
|
var card = DATA.cards[ DATA.lastShowCardID ];
|
||||||
|
var board = DATA.boards[ card.boardId ];
|
||||||
|
%>
|
||||||
|
|
||||||
|
<div class="pop-over" id="addRisklabels">
|
||||||
|
<div class="header">
|
||||||
|
<a class="back-btn js-back-view headbtn_left risklabelback" style="display: none;"><i class="fa fa-chevron-left"></i></a>
|
||||||
|
<span class="header-title">风险标签</span>
|
||||||
|
<a class="headbtn_right close_addRisklabels"><i class="fa fa-close"></i></a>
|
||||||
|
</div>
|
||||||
|
<div class="popcontent">
|
||||||
|
<ul class="pop-over-list js-card-label-list chooseLabelUL" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
for(var i in data){
|
||||||
|
var label = data[i];
|
||||||
|
|
||||||
|
var _isSelect = false;
|
||||||
|
if(card.risklabelIds && card.risklabelIds.indexOf(label._id) != -1){
|
||||||
|
_isSelect = true;
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
|
||||||
|
<li class="risklabel_li card-label-<%=label.color%> card-labelid-<%=label._id%>" data-labelname="<%=label.name%>" data-labelcolor="<%=label.color%>" data-id="<%=label._id%>">
|
||||||
|
<span class="full-name"><%=label.name%></span>
|
||||||
|
<%= (_isSelect?'<i class="fa fa-check"></i>':'')%>
|
||||||
|
|
||||||
|
<span class="fa fa-edit labelEdit" style="float: right; opacity: 0.5;" ></span>
|
||||||
|
<!--span class="fa fa-clock-o labelSetTimer" id="labelTimer_<%=label._id%>" style="float: right; opacity: 0.6; margin-right: 10px;" ></span-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="addLabelUL" style=" display: none;">
|
||||||
|
<input type="hidden" placeholder="id" maxlength="4" class="addLabelID">
|
||||||
|
<input type="text" placeholder="标签内容" maxlength="4" class="addLabelName">
|
||||||
|
<ul class="pop-over-list js-card-label-list" style="max-height:290px;overflow-y: auto;">
|
||||||
|
<%
|
||||||
|
var colors = ['legugreen','legupurple','legublue','leguyellow','legured','legupink','legugray','leguaqua'];
|
||||||
|
for(var i=0;i<colors.length;i++){
|
||||||
|
%>
|
||||||
|
<li class="add_risklabel_li card-label-<%=colors[i]%>" data-labelcolor="<%=colors[i]%>">
|
||||||
|
|
||||||
|
<!--<i class="fa fa-check"></i>-->
|
||||||
|
</li>
|
||||||
|
<% } %>
|
||||||
|
</ul>
|
||||||
|
<button class="button addRisklabelbtn" type="button" style="margin: 10px 0;">确定</button>
|
||||||
|
<button class="button btn-danger delRisklabelbtn" type="button" style="margin: 10px 0;float: right;">删除</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
46
scripts/Find Results
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
Searching 773 files for "showIssueTags"
|
||||||
|
|
||||||
|
/Users/SriLanka/php/leguwork_draft_new/scripts/cardinfo.js:
|
||||||
|
333 // DATA.allrisklabels[k] = json[k];
|
||||||
|
334 // }
|
||||||
|
335: // showIssueTags();
|
||||||
|
336 // });
|
||||||
|
337 // }
|
||||||
|
|
||||||
|
1 match in 1 file
|
||||||
|
|
||||||
|
|
||||||
|
Searching 773 files for "fmtAllRiskLabelsByCardID"
|
||||||
|
|
||||||
|
/Users/SriLanka/php/leguwork_draft_new/scripts/cardinfo.js:
|
||||||
|
48
|
||||||
|
49 fmtCommentsByCardID(cardid);
|
||||||
|
50: fmtAllRiskLabelsByCardID(cardid);
|
||||||
|
51 fmtCheckListByCardID(cardid);
|
||||||
|
52 showAttachmentsByCardID(cardid);
|
||||||
|
..
|
||||||
|
326 }
|
||||||
|
327
|
||||||
|
328: // function fmtAllRiskLabelsByCardID(cardid){
|
||||||
|
329 // $.get('./?app=api&apiact=get_allrisktags&cardid='+cardid,function(text){
|
||||||
|
330 // var json = JSON.parse( text );
|
||||||
|
|
||||||
|
2 matches in 1 file
|
||||||
|
|
||||||
|
|
||||||
|
Searching 773 files for "fmtAllRiskLabelsByCardID"
|
||||||
|
|
||||||
|
/Users/SriLanka/php/leguwork_draft_new/scripts/cardinfo.js:
|
||||||
|
48
|
||||||
|
49 fmtCommentsByCardID(cardid);
|
||||||
|
50: // fmtAllRiskLabelsByCardID(cardid);
|
||||||
|
51 fmtCheckListByCardID(cardid);
|
||||||
|
52 showAttachmentsByCardID(cardid);
|
||||||
|
..
|
||||||
|
326 }
|
||||||
|
327
|
||||||
|
328: // function fmtAllRiskLabelsByCardID(cardid){
|
||||||
|
329 // $.get('./?app=api&apiact=get_allrisktags&cardid='+cardid,function(text){
|
||||||
|
330 // var json = JSON.parse( text );
|
||||||
|
|
||||||
|
2 matches in 1 file
|
44
scripts/cardPopover.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
function showCardPopover(){
|
||||||
|
var html = T( $('#tmpl-cardpopover').html() );
|
||||||
|
$('body').append( html );
|
||||||
|
$('#cardPopoverMask').fadeIn(100).css('width',$(document).width());
|
||||||
|
|
||||||
|
$('.card-details-title').text('项目集成');
|
||||||
|
|
||||||
|
// $.get('?app=api&apiact=finishcount&boardid='+DATA.boardid,function(txt){
|
||||||
|
$.get('./?app=api&apiact=getsettingcardinfo&boardid=' + DATA.boardid + '&cardtitle='+ 'hearderleft',function(text){
|
||||||
|
|
||||||
|
console.log(text);
|
||||||
|
var j = JSON.parse(text);
|
||||||
|
console.log(j);
|
||||||
|
|
||||||
|
var cardid = Object.keys(j)[0];
|
||||||
|
cardData = j[cardid];
|
||||||
|
console.log(cardData);
|
||||||
|
|
||||||
|
if (cardData){
|
||||||
|
html = cardData['description'];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
html = "添加标题为<pre>__setting.hearderleft 的卡片</pre>"
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#cardpopoverdata').append(html);
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function closeCardPopover(){
|
||||||
|
$('#cardPopoverMask').remove();
|
||||||
|
$('#cardPopover').remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$('body').on("click","#cardPopoverMask",function(){
|
||||||
|
closeCardPopover();
|
||||||
|
});
|
||||||
|
$('body').on("click","#cardPopoverClose",function(){
|
||||||
|
closeCardPopover();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
218
scripts/card_list_timeline.js
Normal file
@ -0,0 +1,218 @@
|
|||||||
|
function showCardTimeline(listid){
|
||||||
|
|
||||||
|
// console.log('==========');
|
||||||
|
// console.log(listid);
|
||||||
|
|
||||||
|
var html = T( $('#tmpl-card_timeline').html() );
|
||||||
|
$('body').append( html );
|
||||||
|
$('#cardListTimelineMask').fadeIn(100).css('width',$(document).width());
|
||||||
|
|
||||||
|
// $('.card-details-title').text('项目集成');
|
||||||
|
|
||||||
|
// $.get('?app=api&apiact=finishcount&boardid='+DATA.boardid,function(txt){
|
||||||
|
$.get('./?app=api&apiact=getsettingcardinfo&boardid=' + DATA.boardid + '&cardtitle='+ 'hearderleft',function(text){
|
||||||
|
|
||||||
|
// console.log(text);
|
||||||
|
var j = JSON.parse(text);
|
||||||
|
// console.log(j);
|
||||||
|
|
||||||
|
var cardid = Object.keys(j)[0];
|
||||||
|
cardData = j[cardid];
|
||||||
|
// console.log(cardData);
|
||||||
|
|
||||||
|
if (cardData){
|
||||||
|
html = cardData['description'];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
html = "添加标题为<pre>__setting.hearderleft 的卡片</pre>"
|
||||||
|
}
|
||||||
|
html += listid;
|
||||||
|
// $('#cardListTimelineData').append(html);
|
||||||
|
|
||||||
|
|
||||||
|
var calendarEl = document.getElementById('cardListTimelineData');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||||
|
plugins: ['interaction', 'resourceTimeline'],
|
||||||
|
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
|
||||||
|
timeZone: '+8',
|
||||||
|
locale: 'zh-cn',
|
||||||
|
defaultView: 'resourceTimelineMonth',
|
||||||
|
aspectRatio: 2.4,
|
||||||
|
header: {
|
||||||
|
left: 'prev,next',
|
||||||
|
// center: 'title',
|
||||||
|
center: 'title',
|
||||||
|
right: 'resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth'
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
editable: false,
|
||||||
|
resourceLabelText: '单子',
|
||||||
|
// resourceGroupField: 'group',
|
||||||
|
resourceAreaWidth: "300px",
|
||||||
|
|
||||||
|
resources: './?app=api&apiact=get_timeline_list_card&list=' + listid,
|
||||||
|
|
||||||
|
// resources11: [
|
||||||
|
// {"id":"5cd52386c5363","title":"<p>fasd</p>"},{"id":"3qCRNfNDywDcvfhxJ","group":"\u7f8e\u672f1\u90e8","title":"\u9648\u9752"},{"id":"5aeab9d8e8ab3","group":"\u6d4b\u8bd5\u90e8","title":"\u5218\u601d\u79cb"},{"id":"5aebf6e46df68","group":"H5\u5ba2\u6237\u7aef","title":"\u675c\u6052\u665f"},{"id":"5aeff82ec323d","group":"\u670d\u52a1\u7aef","title":"\u5f90\u671d"},{"id":"5b42d28a3df35","group":"UI\u7ec4","title":"\u738b\u4f73\u4f1f"},
|
||||||
|
// ],
|
||||||
|
|
||||||
|
resourceRender: function(renderInfo) {
|
||||||
|
// console.log("==-==-=");
|
||||||
|
// console.log(renderInfo);
|
||||||
|
|
||||||
|
var labels = renderInfo.resource.extendedProps.labels;
|
||||||
|
var board = DATA.boards[ DATA.boardid];
|
||||||
|
// console.log(labels);
|
||||||
|
|
||||||
|
// console.log(board.labels);
|
||||||
|
|
||||||
|
var html = `<div class="minicard-labels">`;
|
||||||
|
|
||||||
|
|
||||||
|
labels.forEach(function (ele) {
|
||||||
|
var label = getLabelsData(ele,board.labels);
|
||||||
|
html += ` <span class="minicard-label card-label-${label.color}" title="${label.name}">${label.name}</span> `;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if(renderInfo.resource.extendedProps.isyanqi){
|
||||||
|
html += ` <span class="minicard-label card-label-legured" title="延期">延期</span> `;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += `</div>`;
|
||||||
|
|
||||||
|
// $(info.el).data('id',info.event.extendedProps.id);
|
||||||
|
$(renderInfo.el).children('div').append(html);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
events: './?app=api&apiact=get_timeline_list_card_events&list=' + listid,
|
||||||
|
|
||||||
|
// events11: [
|
||||||
|
// {allDay: true,
|
||||||
|
// boardid: "5bbdbf66031d2",
|
||||||
|
// end: "2019-05-11",
|
||||||
|
// resourceId: "5cd52386c5363",
|
||||||
|
// start: "2019-05-09",
|
||||||
|
// title: "地牢冒险",
|
||||||
|
// isyanqi: "延期了",
|
||||||
|
// url: "./?app=list&boardid=5bbdbf66031d2#cardid=5c63af7623239"}
|
||||||
|
// ],
|
||||||
|
|
||||||
|
eventRender: function(info) {
|
||||||
|
|
||||||
|
// console.log("==-==-=");
|
||||||
|
// console.log(info);
|
||||||
|
|
||||||
|
$(info.el).data('id',info.event.extendedProps.cardid);
|
||||||
|
$(info.el).addClass('card-list-timeline-event-open');
|
||||||
|
|
||||||
|
if (info.event.extendedProps.isyanqi){
|
||||||
|
var txt = rtime2txt(yqrt);
|
||||||
|
if (txt){
|
||||||
|
var yqtxt = `<span class="minicard-label card-label-legured" title="延期">延期${txt}</span>`;
|
||||||
|
}
|
||||||
|
// var yqtxt = `<span class="minicard-label card-label-legured" title="延期">延期${info.event.extendedProps.yanqiday}天 ${info.event.extendedProps.yanqiRt}</span>`;
|
||||||
|
|
||||||
|
$(info.el).prepend(yqtxt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// var tooltip = new Tooltip(info.el, {
|
||||||
|
// title: info.event.extendedProps.description,
|
||||||
|
// placement: 'top',
|
||||||
|
// trigger: 'hover',
|
||||||
|
// container: 'body'
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
// events: function(info,success,failure){
|
||||||
|
// console.log('==========');
|
||||||
|
// console.log(info);
|
||||||
|
// success(function () {
|
||||||
|
// return [
|
||||||
|
// {allDay: true,
|
||||||
|
// boardid: "5bbdbf66031d2",
|
||||||
|
// end: "2019-05-11",
|
||||||
|
// resourceId: "5cd52386c5363",
|
||||||
|
// start: "2019-05-09",
|
||||||
|
// title: "地牢冒险",
|
||||||
|
// url: "./?app=list&boardid=5bbdbf66031d2#cardid=5c63af7623239"}
|
||||||
|
// ]
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// },
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
calendar.render();
|
||||||
|
|
||||||
|
// setTimeout(function () {
|
||||||
|
// $('.fc-expander').click();
|
||||||
|
// }, 100);
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeCardListTimeline(){
|
||||||
|
$('#cardListTimelineMask').remove();
|
||||||
|
$('#cardListTimeline').remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLabelsData(labelsId,labels){
|
||||||
|
var res = '';
|
||||||
|
labels.forEach(function (ele) {
|
||||||
|
if (ele._id == labelsId){
|
||||||
|
res = ele
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
return res
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 时间转字符串 天 小时 分钟
|
||||||
|
function rtime2txt(rt) {
|
||||||
|
var txt = '';
|
||||||
|
// 天
|
||||||
|
if (rt > 24*3600){
|
||||||
|
txt = parseInt(rt/(24*3600)) + '天';
|
||||||
|
// 小时
|
||||||
|
}else if (rt > 3600){
|
||||||
|
txt = parseInt(rt/3600) + '小时'
|
||||||
|
// 分钟
|
||||||
|
}else if(rt > 60){
|
||||||
|
txt = parseInt(rt/60) + '分钟'
|
||||||
|
}else {
|
||||||
|
txt = rt + '秒'
|
||||||
|
}
|
||||||
|
|
||||||
|
return txt
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$('body').on("click","#cardListTimelineMask",function(){
|
||||||
|
closeCardListTimeline();
|
||||||
|
});
|
||||||
|
$('body').on("click","#cardTimelineClose",function(){
|
||||||
|
closeCardListTimeline();
|
||||||
|
});
|
||||||
|
$('body').on('click','.card-list-timeline-event-open',function () {
|
||||||
|
showCard( $(this).data('id') );
|
||||||
|
// closeCardListTimeline();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('body').on('click','#cardListTimeline',function () {
|
||||||
|
closeCardInfo();
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
1306
scripts/cardinfo.js
Normal file
561
scripts/colpick.js
Normal file
@ -0,0 +1,561 @@
|
|||||||
|
/*
|
||||||
|
colpick Color Picker
|
||||||
|
Copyright 2013 Jose Vargas. Licensed under GPL license. Based on Stefan Petre's Color Picker www.eyecon.ro, dual licensed under the MIT and GPL licenses
|
||||||
|
|
||||||
|
For usage and examples: colpick.com/plugin
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function ($) {
|
||||||
|
var colpick = function () {
|
||||||
|
var
|
||||||
|
tpl = '<div class="colpick"><div class="colpick_color"><div class="colpick_color_overlay1"><div class="colpick_color_overlay2"><div class="colpick_selector_outer"><div class="colpick_selector_inner"></div></div></div></div></div><div class="colpick_hue"><div class="colpick_hue_arrs"><div class="colpick_hue_larr"></div><div class="colpick_hue_rarr"></div></div></div><div class="colpick_new_color"></div><div class="colpick_current_color"></div><div class="colpick_hex_field"><div class="colpick_field_letter">#</div><input type="text" maxlength="6" size="6" /></div><div class="colpick_rgb_r colpick_field"><div class="colpick_field_letter">R</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_g colpick_field"><div class="colpick_field_letter">G</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_rgb_b colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsx_h colpick_field"><div class="colpick_field_letter">H</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsx_s colpick_field"><div class="colpick_field_letter">S</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_hsx_x colpick_field"><div class="colpick_field_letter">B</div><input type="text" maxlength="3" size="3" /><div class="colpick_field_arrs"><div class="colpick_field_uarr"></div><div class="colpick_field_darr"></div></div></div><div class="colpick_submit"></div></div>',
|
||||||
|
defaults = {
|
||||||
|
showEvent: 'click',
|
||||||
|
onShow: function () {},
|
||||||
|
onBeforeShow: function(){},
|
||||||
|
onHide: function () {},
|
||||||
|
onChange: function () {},
|
||||||
|
onSubmit: function () {},
|
||||||
|
colorScheme: 'light',
|
||||||
|
color: '3289c7',
|
||||||
|
livePreview: true,
|
||||||
|
flat: false,
|
||||||
|
layout: 'full',
|
||||||
|
submit: 1,
|
||||||
|
submitText: 'OK',
|
||||||
|
height: 156,
|
||||||
|
hsl: false
|
||||||
|
},
|
||||||
|
//Fill the inputs of the plugin
|
||||||
|
fillRGBFields = function (hsx, cal) {
|
||||||
|
var rgb = $(cal).data('colpick').hsl ? hslToRgb(hsx) : hsbToRgb(hsx);
|
||||||
|
$(cal).data('colpick').fields
|
||||||
|
.eq(1).val(rgb.r).end()
|
||||||
|
.eq(2).val(rgb.g).end()
|
||||||
|
.eq(3).val(rgb.b).end();
|
||||||
|
},
|
||||||
|
fillHSXFields = function (hsx, cal) {
|
||||||
|
|
||||||
|
$(cal).data('colpick').fields
|
||||||
|
.eq(4).val(Math.round(hsx.h)).end()
|
||||||
|
.eq(5).val(Math.round(hsx.s)).end()
|
||||||
|
.eq(6).val(Math.round(hsx.x)).end();
|
||||||
|
},
|
||||||
|
fillHexFields = function (hsx, cal) {
|
||||||
|
$(cal).data('colpick').fields.eq(0).val($(cal).data('colpick').hsl ? hslToHex(hsx) : hsbToHex(hsx));
|
||||||
|
},
|
||||||
|
//Set the round selector position
|
||||||
|
setSelector = function (hsx, cal) {
|
||||||
|
$(cal).data('colpick').selector.css('backgroundColor', '#' + ($(cal).data('colpick').hsl ? hslToHex({h:hsx.h,s:100,x:50}) : hsbToHex({h:hsx.h,s:100,x:100})) );
|
||||||
|
$(cal).data('colpick').selectorIndic.css({
|
||||||
|
left: parseInt($(cal).data('colpick').height * hsx.s/100, 10),
|
||||||
|
top: parseInt($(cal).data('colpick').height * (100-hsx.x)/100, 10)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Set the hue selector position
|
||||||
|
setHue = function (hsx, cal) {
|
||||||
|
$(cal).data('colpick').hue.css('top', parseInt($(cal).data('colpick').height - $(cal).data('colpick').height * hsx.h/360, 10));
|
||||||
|
},
|
||||||
|
//Set current and new colors
|
||||||
|
setCurrentColor = function (hsx, cal) {
|
||||||
|
$(cal).data('colpick').currentColor.css('backgroundColor', '#' + ($(cal).data('colpick').hsl ? hslToHex(hsx) : hsbToHex(hsx)) );
|
||||||
|
},
|
||||||
|
setNewColor = function (hsx, cal) {
|
||||||
|
$(cal).data('colpick').newColor.css('backgroundColor', '#' + ($(cal).data('colpick').hsl ? hslToHex(hsx) : hsbToHex(hsx)) );
|
||||||
|
},
|
||||||
|
//Called when the new color is changed
|
||||||
|
change = function (ev) {
|
||||||
|
var cal = $(this).parent().parent(), col;
|
||||||
|
if (this.parentNode.className.indexOf('_hex') > 0) {
|
||||||
|
cal.data('colpick').color = col = cal.data('colpick').hsl ? hexToHsl(fixHex(this.value)) : hexToHsb(fixHex(this.value));
|
||||||
|
fillRGBFields(col, cal.get(0));
|
||||||
|
fillHSXFields(col, cal.get(0));
|
||||||
|
} else if (this.parentNode.className.indexOf('_hsx') > 0) {
|
||||||
|
cal.data('colpick').color = col = fixHsx({
|
||||||
|
h: parseInt(cal.data('colpick').fields.eq(4).val(), 10),
|
||||||
|
s: parseInt(cal.data('colpick').fields.eq(5).val(), 10),
|
||||||
|
x: parseInt(cal.data('colpick').fields.eq(6).val(), 10)
|
||||||
|
});
|
||||||
|
fillRGBFields(col, cal.get(0));
|
||||||
|
fillHexFields(col, cal.get(0));
|
||||||
|
} else {
|
||||||
|
var rgb = {
|
||||||
|
r: parseInt(cal.data('colpick').fields.eq(1).val(), 10),
|
||||||
|
g: parseInt(cal.data('colpick').fields.eq(2).val(), 10),
|
||||||
|
b: parseInt(cal.data('colpick').fields.eq(3).val(), 10)
|
||||||
|
};
|
||||||
|
cal.data('colpick').color = col = cal.data('colpick').hsl ? rgbToHsl(fixRgb(rgb)) : rgbToHsb(fixRgb(rgb));
|
||||||
|
fillHexFields(col, cal.get(0));
|
||||||
|
fillHSXFields(col, cal.get(0));
|
||||||
|
}
|
||||||
|
setSelector(col, cal.get(0));
|
||||||
|
setHue(col, cal.get(0));
|
||||||
|
setNewColor(col, cal.get(0));
|
||||||
|
cal.data('colpick').onChange.apply(cal.parent(), [col, cal.data('colpick').hsl ? hslToHex(col) : hsbToHex(col), cal.data('colpick').hsl ? hslToRgb(col) : hsbToRgb(col), cal.data('colpick').el, 0]);
|
||||||
|
},
|
||||||
|
//Change style on blur and on focus of inputs
|
||||||
|
blur = function (ev) {
|
||||||
|
$(this).parent().removeClass('colpick_focus');
|
||||||
|
},
|
||||||
|
focus = function () {
|
||||||
|
$(this).parent().parent().data('colpick').fields.parent().removeClass('colpick_focus');
|
||||||
|
$(this).parent().addClass('colpick_focus');
|
||||||
|
},
|
||||||
|
//Increment/decrement arrows functions
|
||||||
|
downIncrement = function (ev) {
|
||||||
|
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||||
|
var field = $(this).parent().find('input').focus();
|
||||||
|
var current = {
|
||||||
|
el: $(this).parent().addClass('colpick_slider'),
|
||||||
|
max: this.parentNode.className.indexOf('_hsx_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsx') > 0 ? 100 : 255),
|
||||||
|
y: ev.pageY,
|
||||||
|
field: field,
|
||||||
|
val: parseInt(field.val(), 10),
|
||||||
|
preview: $(this).parent().parent().data('colpick').livePreview
|
||||||
|
};
|
||||||
|
$(document).mouseup(current, upIncrement);
|
||||||
|
$(document).mousemove(current, moveIncrement);
|
||||||
|
},
|
||||||
|
moveIncrement = function (ev) {
|
||||||
|
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val - ev.pageY + ev.data.y, 10))));
|
||||||
|
if (ev.data.preview) {
|
||||||
|
change.apply(ev.data.field.get(0), [true]);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
upIncrement = function (ev) {
|
||||||
|
change.apply(ev.data.field.get(0), [true]);
|
||||||
|
ev.data.el.removeClass('colpick_slider').find('input').focus();
|
||||||
|
$(document).off('mouseup', upIncrement);
|
||||||
|
$(document).off('mousemove', moveIncrement);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
//Hue slider functions
|
||||||
|
downHue = function (ev) {
|
||||||
|
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||||
|
var current = {
|
||||||
|
cal: $(this).parent(),
|
||||||
|
y: $(this).offset().top
|
||||||
|
};
|
||||||
|
$(document).on('mouseup touchend',current,upHue);
|
||||||
|
$(document).on('mousemove touchmove',current,moveHue);
|
||||||
|
|
||||||
|
var pageY = ((ev.type == 'touchstart') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
|
||||||
|
change.apply(
|
||||||
|
current.cal.data('colpick')
|
||||||
|
.fields.eq(4).val(parseInt(360*(current.cal.data('colpick').height - (pageY - current.y))/current.cal.data('colpick').height, 10))
|
||||||
|
.get(0),
|
||||||
|
[current.cal.data('colpick').livePreview]
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
moveHue = function (ev) {
|
||||||
|
var pageY = ((ev.type == 'touchmove') ? ev.originalEvent.changedTouches[0].pageY : ev.pageY );
|
||||||
|
change.apply(
|
||||||
|
ev.data.cal.data('colpick')
|
||||||
|
.fields.eq(4).val(parseInt(360*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.y))))/ev.data.cal.data('colpick').height, 10))
|
||||||
|
.get(0),
|
||||||
|
[ev.data.preview]
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
upHue = function (ev) {
|
||||||
|
//fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||||
|
//fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||||
|
$(document).off('mouseup touchend',upHue);
|
||||||
|
$(document).off('mousemove touchmove',moveHue);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
//Color selector functions
|
||||||
|
downSelector = function (ev) {
|
||||||
|
ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
|
||||||
|
var current = {
|
||||||
|
cal: $(this).parent(),
|
||||||
|
pos: $(this).offset()
|
||||||
|
};
|
||||||
|
current.preview = current.cal.data('colpick').livePreview;
|
||||||
|
|
||||||
|
$(document).on('mouseup touchend',current,upSelector);
|
||||||
|
$(document).on('mousemove touchmove',current,moveSelector);
|
||||||
|
|
||||||
|
var payeX,pageY;
|
||||||
|
if(ev.type == 'touchstart') {
|
||||||
|
pageX = ev.originalEvent.changedTouches[0].pageX,
|
||||||
|
pageY = ev.originalEvent.changedTouches[0].pageY;
|
||||||
|
} else {
|
||||||
|
pageX = ev.pageX;
|
||||||
|
pageY = ev.pageY;
|
||||||
|
}
|
||||||
|
|
||||||
|
change.apply(
|
||||||
|
current.cal.data('colpick').fields
|
||||||
|
.eq(6).val(parseInt(100*(current.cal.data('colpick').height - (pageY - current.pos.top))/current.cal.data('colpick').height, 10)).end()
|
||||||
|
.eq(5).val(parseInt(100*(pageX - current.pos.left)/current.cal.data('colpick').height, 10))
|
||||||
|
.get(0),
|
||||||
|
[current.preview]
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
moveSelector = function (ev) {
|
||||||
|
var payeX,pageY;
|
||||||
|
if(ev.type == 'touchmove') {
|
||||||
|
pageX = ev.originalEvent.changedTouches[0].pageX,
|
||||||
|
pageY = ev.originalEvent.changedTouches[0].pageY;
|
||||||
|
} else {
|
||||||
|
pageX = ev.pageX;
|
||||||
|
pageY = ev.pageY;
|
||||||
|
}
|
||||||
|
|
||||||
|
change.apply(
|
||||||
|
ev.data.cal.data('colpick').fields
|
||||||
|
.eq(6).val(parseInt(100*(ev.data.cal.data('colpick').height - Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageY - ev.data.pos.top))))/ev.data.cal.data('colpick').height, 10)).end()
|
||||||
|
.eq(5).val(parseInt(100*(Math.max(0,Math.min(ev.data.cal.data('colpick').height,(pageX - ev.data.pos.left))))/ev.data.cal.data('colpick').height, 10))
|
||||||
|
.get(0),
|
||||||
|
[ev.data.preview]
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
upSelector = function (ev) {
|
||||||
|
//fillRGBFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||||
|
//fillHexFields(ev.data.cal.data('colpick').color, ev.data.cal.get(0));
|
||||||
|
$(document).off('mouseup touchend',upSelector);
|
||||||
|
$(document).off('mousemove touchmove',moveSelector);
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
//Submit button
|
||||||
|
clickSubmit = function (ev) {
|
||||||
|
var cal = $(this).parent();
|
||||||
|
var col = cal.data('colpick').color;
|
||||||
|
cal.data('colpick').origColor = col;
|
||||||
|
setCurrentColor(col, cal.get(0));
|
||||||
|
cal.data('colpick').onSubmit(col, cal.data('colpick').hsl ? hslToHex(col) : hsbToHex(col), cal.data('colpick').hsl ? hslToRgb(col) : hsbToRgb(col), cal.data('colpick').el);
|
||||||
|
},
|
||||||
|
//Show/hide the color picker
|
||||||
|
show = function (ev) {
|
||||||
|
// Prevent the trigger of any direct parent
|
||||||
|
ev.stopPropagation();
|
||||||
|
var cal = $('#' + $(this).data('colpickId'));
|
||||||
|
cal.data('colpick').onBeforeShow.apply(this, [cal.get(0)]);
|
||||||
|
var pos = $(this).offset();
|
||||||
|
var top = pos.top + this.offsetHeight;
|
||||||
|
var left = pos.left;
|
||||||
|
var viewPort = getViewport();
|
||||||
|
var calW = cal.width();
|
||||||
|
if (left + calW > viewPort.l + viewPort.w) {
|
||||||
|
left -= calW;
|
||||||
|
}
|
||||||
|
cal.css({left: left + 'px', top: top + 'px'});
|
||||||
|
if (cal.data('colpick').onShow.apply(this, [cal.get(0)]) != false) {
|
||||||
|
cal.show();
|
||||||
|
}
|
||||||
|
//Hide when user clicks outside
|
||||||
|
$('html').mousedown({cal:cal}, hide);
|
||||||
|
cal.mousedown(function(ev){ev.stopPropagation();})
|
||||||
|
},
|
||||||
|
hide = function (ev) {
|
||||||
|
if (ev.data.cal.data('colpick').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
|
||||||
|
ev.data.cal.hide();
|
||||||
|
}
|
||||||
|
$('html').off('mousedown', hide);
|
||||||
|
},
|
||||||
|
getViewport = function () {
|
||||||
|
var m = document.compatMode == 'CSS1Compat';
|
||||||
|
return {
|
||||||
|
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
|
||||||
|
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//Fix the values if the user enters a negative or high value
|
||||||
|
fixHsx = function (hsx) {
|
||||||
|
return {
|
||||||
|
h: Math.min(360, Math.max(0, hsx.h)),
|
||||||
|
s: Math.min(100, Math.max(0, hsx.s)),
|
||||||
|
x: Math.min(100, Math.max(0, hsx.x))
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fixRgb = function (rgb) {
|
||||||
|
return {
|
||||||
|
r: Math.min(255, Math.max(0, rgb.r)),
|
||||||
|
g: Math.min(255, Math.max(0, rgb.g)),
|
||||||
|
b: Math.min(255, Math.max(0, rgb.b))
|
||||||
|
};
|
||||||
|
},
|
||||||
|
fixHex = function (hex) {
|
||||||
|
var len = 6 - hex.length;
|
||||||
|
if (len > 0) {
|
||||||
|
var o = [];
|
||||||
|
for (var i=0; i<len; i++) {
|
||||||
|
o.push('0');
|
||||||
|
}
|
||||||
|
o.push(hex);
|
||||||
|
hex = o.join('');
|
||||||
|
}
|
||||||
|
return hex;
|
||||||
|
},
|
||||||
|
restoreOriginal = function () {
|
||||||
|
var cal = $(this).parent();
|
||||||
|
var col = cal.data('colpick').origColor;
|
||||||
|
cal.data('colpick').color = col;
|
||||||
|
fillRGBFields(col, cal.get(0));
|
||||||
|
fillHexFields(col, cal.get(0));
|
||||||
|
fillHSXFields(col, cal.get(0));
|
||||||
|
setSelector(col, cal.get(0));
|
||||||
|
setHue(col, cal.get(0));
|
||||||
|
setNewColor(col, cal.get(0));
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
init: function (opt) {
|
||||||
|
opt = $.extend({}, defaults, opt||{});
|
||||||
|
//Set color
|
||||||
|
if (typeof opt.color == 'string') {
|
||||||
|
opt.color = opt.hsl ? hexToHsl(opt.color) : hexToHsb(opt.color);
|
||||||
|
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
|
||||||
|
opt.color = opt.hsl ? rgbToHsl(opt.color) : rgbToHsb(opt.color);
|
||||||
|
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
|
||||||
|
opt.color = opt.hsl ? fixHsl(opt.color) : fixHsb(opt.color);
|
||||||
|
} else {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//For each selected DOM element
|
||||||
|
return this.each(function () {
|
||||||
|
//If the element does not have an ID
|
||||||
|
if (!$(this).data('colpickId')) {
|
||||||
|
var options = $.extend({}, opt);
|
||||||
|
options.origColor = opt.color;
|
||||||
|
//Generate and assign a random ID
|
||||||
|
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
|
||||||
|
$(this).data('colpickId', id);
|
||||||
|
//Set the tpl's ID and get the HTML
|
||||||
|
var cal = $(tpl).attr('id', id);
|
||||||
|
//Add class according to layout
|
||||||
|
cal.addClass('colpick_'+options.layout+(options.submit?'':' colpick_'+options.layout+'_ns'));
|
||||||
|
//Add class if the color scheme is not default
|
||||||
|
if(options.colorScheme != 'light') cal.addClass('colpick_'+options.colorScheme);
|
||||||
|
//Add class if HSL is enabled
|
||||||
|
if(options.hsl) cal.addClass('colpick_hsl');
|
||||||
|
//Setup submit button
|
||||||
|
cal.find('div.colpick_submit').html(options.submitText).click(clickSubmit);
|
||||||
|
//Setup input fields
|
||||||
|
options.fields = cal.find('input').change(change).blur(blur).focus(focus);
|
||||||
|
cal.find('div.colpick_field_arrs').mousedown(downIncrement).end().find('div.colpick_current_color').click(restoreOriginal);
|
||||||
|
//Setup hue selector
|
||||||
|
options.selector = cal.find('div.colpick_color').on('mousedown touchstart',downSelector);
|
||||||
|
options.selectorIndic = options.selector.find('div.colpick_selector_outer');
|
||||||
|
//Store parts of the plugin
|
||||||
|
options.el = this;
|
||||||
|
options.hue = cal.find('div.colpick_hue_arrs');
|
||||||
|
huebar = options.hue.parent();
|
||||||
|
//Paint the hue bar
|
||||||
|
var UA = navigator.userAgent.toLowerCase();
|
||||||
|
var isIE = navigator.appName === 'Microsoft Internet Explorer';
|
||||||
|
var IEver = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
|
||||||
|
var ngIE = ( isIE && IEver < 10 );
|
||||||
|
var stops = ['#ff0000','#ff0080','#ff00ff','#8000ff','#0000ff','#0080ff','#00ffff','#00ff80','#00ff00','#80ff00','#ffff00','#ff8000','#ff0000'];
|
||||||
|
if(ngIE) {
|
||||||
|
var i, div;
|
||||||
|
for(i=0; i<=11; i++) {
|
||||||
|
div = $('<div></div>').attr('style','height:8.333333%; filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+'); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='+stops[i]+', endColorstr='+stops[i+1]+')";');
|
||||||
|
huebar.append(div);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
stopList = stops.join(',');
|
||||||
|
huebar.attr('style','background:-webkit-linear-gradient(top center,'+stopList+'); background:-moz-linear-gradient(top center,'+stopList+'); background:linear-gradient(to bottom,'+stopList+'); ');
|
||||||
|
}
|
||||||
|
cal.find('div.colpick_hue').on('mousedown touchstart',downHue);
|
||||||
|
options.newColor = cal.find('div.colpick_new_color');
|
||||||
|
options.currentColor = cal.find('div.colpick_current_color');
|
||||||
|
//Store options and fill with default color
|
||||||
|
cal.data('colpick', options);
|
||||||
|
fillRGBFields(options.color, cal.get(0));
|
||||||
|
fillHSXFields(options.color, cal.get(0));
|
||||||
|
fillHexFields(options.color, cal.get(0));
|
||||||
|
setHue(options.color, cal.get(0));
|
||||||
|
setSelector(options.color, cal.get(0));
|
||||||
|
setCurrentColor(options.color, cal.get(0));
|
||||||
|
setNewColor(options.color, cal.get(0));
|
||||||
|
//Append to body if flat=false, else show in place
|
||||||
|
if (options.flat) {
|
||||||
|
cal.appendTo(this).show();
|
||||||
|
cal.css({
|
||||||
|
position: 'relative',
|
||||||
|
display: 'block'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
cal.appendTo(document.body);
|
||||||
|
$(this).on(options.showEvent, show);
|
||||||
|
cal.css({
|
||||||
|
position:'absolute'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Shows the picker
|
||||||
|
showPicker: function() {
|
||||||
|
return this.each( function () {
|
||||||
|
if ($(this).data('colpickId')) {
|
||||||
|
show.apply(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Hides the picker
|
||||||
|
hidePicker: function() {
|
||||||
|
return this.each( function () {
|
||||||
|
if ($(this).data('colpickId')) {
|
||||||
|
$('#' + $(this).data('colpickId')).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//Sets a color as new and current (default)
|
||||||
|
setColor: function(col, setCurrent) {
|
||||||
|
setCurrent = (typeof setCurrent === "undefined") ? 1 : setCurrent;
|
||||||
|
if (typeof col == 'string') {
|
||||||
|
col = hexToHsb(col);
|
||||||
|
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
|
||||||
|
col = rgbToHsb(col);
|
||||||
|
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
|
||||||
|
col = fixHsb(col);
|
||||||
|
} else {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
return this.each(function(){
|
||||||
|
if ($(this).data('colpickId')) {
|
||||||
|
var cal = $('#' + $(this).data('colpickId'));
|
||||||
|
cal.data('colpick').color = col;
|
||||||
|
cal.data('colpick').origColor = col;
|
||||||
|
fillRGBFields(col, cal.get(0));
|
||||||
|
fillHSXFields(col, cal.get(0));
|
||||||
|
fillHexFields(col, cal.get(0));
|
||||||
|
setHue(col, cal.get(0));
|
||||||
|
setSelector(col, cal.get(0));
|
||||||
|
|
||||||
|
setNewColor(col, cal.get(0));
|
||||||
|
cal.data('colpick').onChange.apply(cal.parent(), [
|
||||||
|
col,
|
||||||
|
cal.data('colpick').hsl ? hslToHex(col) : hsbToHex(col),
|
||||||
|
cal.data('colpick').hsl ? hslToRgb(col) : hsbToRgb(col),
|
||||||
|
cal.data('colpick').el,
|
||||||
|
1
|
||||||
|
]);
|
||||||
|
if(setCurrent) {
|
||||||
|
setCurrentColor(col, cal.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}();
|
||||||
|
//Color space convertions
|
||||||
|
var hexToRgb = function (hex) {
|
||||||
|
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||||
|
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
|
||||||
|
};
|
||||||
|
var hexToHsb = function (hex) {
|
||||||
|
return rgbToHsb(hexToRgb(hex));
|
||||||
|
};
|
||||||
|
var hexToHsl = function (hex) {
|
||||||
|
return rgbToHsl(hexToRgb(hex));
|
||||||
|
};
|
||||||
|
var rgbToHsb = function (rgb) {
|
||||||
|
var hsb = {h: 0, s: 0, x: 0};
|
||||||
|
var min = Math.min(rgb.r, rgb.g, rgb.b);
|
||||||
|
var max = Math.max(rgb.r, rgb.g, rgb.b);
|
||||||
|
var delta = max - min;
|
||||||
|
hsb.x = max;
|
||||||
|
hsb.s = max != 0 ? 255 * delta / max : 0;
|
||||||
|
if (hsb.s != 0) {
|
||||||
|
if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta;
|
||||||
|
else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta;
|
||||||
|
else hsb.h = 4 + (rgb.r - rgb.g) / delta;
|
||||||
|
} else hsb.h = -1;
|
||||||
|
hsb.h *= 60;
|
||||||
|
if (hsb.h < 0) hsb.h += 360;
|
||||||
|
hsb.s *= 100/255;
|
||||||
|
hsb.x *= 100/255;
|
||||||
|
return hsb;
|
||||||
|
};
|
||||||
|
var rgbToHsl = function (rgb) {
|
||||||
|
return hsbToHsl(rgbToHsb(rgb));
|
||||||
|
};
|
||||||
|
var hsbToHsl = function(hsb) {
|
||||||
|
var hsl = {h: 0, s: 0, x: 0};
|
||||||
|
hsl.h = hsb.h;
|
||||||
|
hsl.x = hsb.x*(200-hsb.s)/200;
|
||||||
|
hsl.s = hsb.x*hsb.s/(100-Math.abs(2*hsl.x-100));
|
||||||
|
return hsl;
|
||||||
|
};
|
||||||
|
var hslToHsb = function(hsl) {
|
||||||
|
var hsb = {h: 0, s: 0, x: 0};
|
||||||
|
hsb.h = hsl.h;
|
||||||
|
hsb.x = (200*hsl.x + hsl.s*(100-Math.abs(2*hsl.x-100)))/200
|
||||||
|
hsb.s = 200*(hsb.x-hsl.x)/hsb.x;
|
||||||
|
return hsb;
|
||||||
|
};
|
||||||
|
var hsbToRgb = function (hsb) {
|
||||||
|
var rgb = {};
|
||||||
|
var h = hsb.h;
|
||||||
|
var s = hsb.s*255/100;
|
||||||
|
var v = hsb.x*255/100;
|
||||||
|
if(s == 0) {
|
||||||
|
rgb.r = rgb.g = rgb.b = v;
|
||||||
|
} else {
|
||||||
|
var t1 = v;
|
||||||
|
var t2 = (255-s)*v/255;
|
||||||
|
var t3 = (t1-t2)*(h%60)/60;
|
||||||
|
if(h==360) h = 0;
|
||||||
|
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
|
||||||
|
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
|
||||||
|
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
|
||||||
|
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
|
||||||
|
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
|
||||||
|
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
|
||||||
|
else {rgb.r=0; rgb.g=0; rgb.b=0}
|
||||||
|
}
|
||||||
|
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
|
||||||
|
};
|
||||||
|
var hslToRgb = function(hsl) {
|
||||||
|
return hsbToRgb(hslToHsb(hsl));
|
||||||
|
};
|
||||||
|
var rgbToHex = function (rgb) {
|
||||||
|
var hex = [
|
||||||
|
rgb.r.toString(16),
|
||||||
|
rgb.g.toString(16),
|
||||||
|
rgb.b.toString(16)
|
||||||
|
];
|
||||||
|
$.each(hex, function (nr, val) {
|
||||||
|
if (val.length == 1) {
|
||||||
|
hex[nr] = '0' + val;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return hex.join('');
|
||||||
|
};
|
||||||
|
var hsbToHex = function (hsb) {
|
||||||
|
return rgbToHex(hsbToRgb(hsb));
|
||||||
|
};
|
||||||
|
var hslToHex = function (hsl) {
|
||||||
|
return hsbToHex(hslToHsb(hsl));
|
||||||
|
};
|
||||||
|
$.fn.extend({
|
||||||
|
colpick: colpick.init,
|
||||||
|
colpickHide: colpick.hidePicker,
|
||||||
|
colpickShow: colpick.showPicker,
|
||||||
|
colpickSetColor: colpick.setColor
|
||||||
|
});
|
||||||
|
$.extend({
|
||||||
|
colpick:{
|
||||||
|
rgbToHex: rgbToHex,
|
||||||
|
rgbToHsb: rgbToHsb,
|
||||||
|
rgbToHsl: rgbToHsl,
|
||||||
|
hsbToHex: hsbToHex,
|
||||||
|
hsbToRgb: hsbToRgb,
|
||||||
|
hsbToHsl: hsbToHsl,
|
||||||
|
hexToHsb: hexToHsb,
|
||||||
|
hexToHsl: hexToHsl,
|
||||||
|
hexToRgb: hexToRgb,
|
||||||
|
hslToHsb: hslToHsb,
|
||||||
|
hslToRgb: hslToRgb,
|
||||||
|
hslToHex: hslToHex
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(jQuery);
|
36
scripts/copy_list_to_new.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// 复制到新列
|
||||||
|
function copyListToNew(listid){
|
||||||
|
|
||||||
|
console.log('==========');
|
||||||
|
console.log(listid);
|
||||||
|
|
||||||
|
var listTitle = DATA.lists[listid]['title'];
|
||||||
|
var val = listTitle + '复制';
|
||||||
|
// 添加列表
|
||||||
|
doSubmitAddList(val, DATA.boardid, function (listData) {
|
||||||
|
var copyListId = listData['data']['_id'];
|
||||||
|
copyCardData = {};
|
||||||
|
$.extend(copyCardData,DATA.cards);
|
||||||
|
// 添加卡片
|
||||||
|
for (var cardId in copyCardData) {
|
||||||
|
if (copyCardData[cardId].boardId != DATA.boardid) continue;
|
||||||
|
if (copyCardData[cardId].listId != listid) continue;
|
||||||
|
if (copyCardData[cardId].archived) continue;
|
||||||
|
|
||||||
|
var cardTitle = copyCardData[cardId]['title'];
|
||||||
|
var description = '';
|
||||||
|
if (copyCardData[cardId].description){
|
||||||
|
description = copyCardData[cardId].description;
|
||||||
|
}
|
||||||
|
doSubmitAddCardAndDesc(cardTitle,description, DATA.boardid, copyListId, function (cardData) {
|
||||||
|
console.log(cardData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
1055
scripts/diff.js
Normal file
1
scripts/echarts.min.js
vendored
Normal file
292
scripts/event.js
Normal file
@ -0,0 +1,292 @@
|
|||||||
|
/*
|
||||||
|
var emitter = cc.EventEmitter.create();
|
||||||
|
emitter.emit('my_event', args);
|
||||||
|
emitter.on('my_event', function(args){
|
||||||
|
......
|
||||||
|
});
|
||||||
|
|
||||||
|
http://nodejs.org/api/events.html
|
||||||
|
*/
|
||||||
|
;(function(global){
|
||||||
|
var cc = {};
|
||||||
|
|
||||||
|
cc.isUndefined = function(arg) {
|
||||||
|
return arg === void 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
cc.isObject = function(arg) {
|
||||||
|
return typeof arg === 'object' && arg !== null;
|
||||||
|
};
|
||||||
|
|
||||||
|
cc.isFunction = function(arg) {
|
||||||
|
return typeof arg === 'function';
|
||||||
|
};
|
||||||
|
|
||||||
|
function EventEmitter(maxListeners) {
|
||||||
|
this._events = this._events || {};
|
||||||
|
this._maxListeners = maxListeners || undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backwards-compat with node 0.10.x
|
||||||
|
EventEmitter.EventEmitter = EventEmitter;
|
||||||
|
|
||||||
|
EventEmitter.prototype._events = undefined;
|
||||||
|
EventEmitter.prototype._maxListeners = undefined;
|
||||||
|
|
||||||
|
// By default EventEmitters will print a warning if more than 10 listeners are
|
||||||
|
// added to it. This is a useful default which helps finding memory leaks.
|
||||||
|
EventEmitter.defaultMaxListeners = 10;
|
||||||
|
|
||||||
|
|
||||||
|
// Obviously not all Emitters should be limited to 10. This function allows
|
||||||
|
// that to be increased. Set to zero for unlimited.
|
||||||
|
EventEmitter.prototype.setMaxListeners = function(n) {
|
||||||
|
if (isNaN(n) || n < 0 )
|
||||||
|
throw TypeError('n must be a positive number');
|
||||||
|
this._maxListeners = n;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.prototype.emit = function(type) {
|
||||||
|
var er, handler, len, args, i, listeners;
|
||||||
|
|
||||||
|
if (!this._events)
|
||||||
|
this._events = {};
|
||||||
|
|
||||||
|
// If there is no 'error' event listener then throw.
|
||||||
|
if (type === 'error' && !this._events.error) {
|
||||||
|
er = arguments[1];
|
||||||
|
if (er instanceof Error) {
|
||||||
|
throw er; // Unhandled 'error' event
|
||||||
|
} else {
|
||||||
|
throw Error('Uncaught, unspecified "error" event.');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
handler = this._events[type];
|
||||||
|
|
||||||
|
if (cc.isUndefined(handler))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (cc.isFunction(handler)) {
|
||||||
|
switch (arguments.length) {
|
||||||
|
// fast cases
|
||||||
|
case 1:
|
||||||
|
handler.call(this);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handler.call(this, arguments[1]);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handler.call(this, arguments[1], arguments[2]);
|
||||||
|
break;
|
||||||
|
// slower
|
||||||
|
default:
|
||||||
|
len = arguments.length;
|
||||||
|
args = new Array(len - 1);
|
||||||
|
for (i = 1; i < len; i++)
|
||||||
|
args[i - 1] = arguments[i];
|
||||||
|
handler.apply(this, args);
|
||||||
|
}
|
||||||
|
} else if (cc.isObject(handler)) {
|
||||||
|
len = arguments.length;
|
||||||
|
args = new Array(len - 1);
|
||||||
|
for (i = 1; i < len; i++)
|
||||||
|
args[i - 1] = arguments[i];
|
||||||
|
|
||||||
|
listeners = handler.slice();
|
||||||
|
len = listeners.length;
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
listeners[i].apply(this, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.prototype.addListener = function(type, listener) {
|
||||||
|
var m;
|
||||||
|
|
||||||
|
if (!cc.isFunction(listener))
|
||||||
|
throw TypeError('listener must be a function');
|
||||||
|
|
||||||
|
if (!this._events)
|
||||||
|
this._events = {};
|
||||||
|
|
||||||
|
// To avoid recursion in the case that type === "newListener"! Before
|
||||||
|
// adding it to the listeners, first emit "newListener".
|
||||||
|
if (this._events.newListener)
|
||||||
|
this.emit('newListener', type,
|
||||||
|
cc.isFunction(listener.listener) ?
|
||||||
|
listener.listener : listener);
|
||||||
|
|
||||||
|
if (!this._events[type])
|
||||||
|
// Optimize the case of one listener. Don't need the extra array object.
|
||||||
|
this._events[type] = listener;
|
||||||
|
else if (cc.isObject(this._events[type]))
|
||||||
|
// If we've already got an array, just append.
|
||||||
|
this._events[type].push(listener);
|
||||||
|
else
|
||||||
|
// Adding the second element, need to change to array.
|
||||||
|
this._events[type] = [this._events[type], listener];
|
||||||
|
|
||||||
|
// Check for listener leak
|
||||||
|
if (cc.isObject(this._events[type]) && !this._events[type].warned) {
|
||||||
|
var m;
|
||||||
|
if (!cc.isUndefined(this._maxListeners)) {
|
||||||
|
m = this._maxListeners;
|
||||||
|
} else {
|
||||||
|
m = EventEmitter.defaultMaxListeners;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m && m > 0 && this._events[type].length > m) {
|
||||||
|
this._events[type].warned = true;
|
||||||
|
console.error('(node) warning: possible EventEmitter memory ' +
|
||||||
|
'leak detected. %d listeners added. ' +
|
||||||
|
'Use emitter.setMaxListeners() to increase limit.',
|
||||||
|
this._events[type].length);
|
||||||
|
console.trace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
||||||
|
|
||||||
|
EventEmitter.prototype.once = function(type, listener) {
|
||||||
|
if (!cc.isFunction(listener))
|
||||||
|
throw TypeError('listener must be a function');
|
||||||
|
|
||||||
|
var fired = false;
|
||||||
|
|
||||||
|
function g() {
|
||||||
|
this.removeListener(type, g);
|
||||||
|
|
||||||
|
if (!fired) {
|
||||||
|
fired = true;
|
||||||
|
listener.apply(this, arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g.listener = listener;
|
||||||
|
this.on(type, g);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
// emits a 'removeListener' event iff the listener was removed
|
||||||
|
EventEmitter.prototype.removeListener = function(type, listener) {
|
||||||
|
var list, position, length, i;
|
||||||
|
|
||||||
|
if (!cc.isFunction(listener))
|
||||||
|
throw TypeError('listener must be a function');
|
||||||
|
|
||||||
|
if (!this._events || !this._events[type])
|
||||||
|
return this;
|
||||||
|
|
||||||
|
list = this._events[type];
|
||||||
|
length = list.length;
|
||||||
|
position = -1;
|
||||||
|
|
||||||
|
if (list === listener ||
|
||||||
|
(cc.isFunction(list.listener) && list.listener === listener)) {
|
||||||
|
delete this._events[type];
|
||||||
|
if (this._events.removeListener)
|
||||||
|
this.emit('removeListener', type, listener);
|
||||||
|
|
||||||
|
} else if (cc.isObject(list)) {
|
||||||
|
for (i = length; i-- > 0;) {
|
||||||
|
if (list[i] === listener ||
|
||||||
|
(list[i].listener && list[i].listener === listener)) {
|
||||||
|
position = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position < 0)
|
||||||
|
return this;
|
||||||
|
|
||||||
|
if (list.length === 1) {
|
||||||
|
list.length = 0;
|
||||||
|
delete this._events[type];
|
||||||
|
} else {
|
||||||
|
list.splice(position, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._events.removeListener)
|
||||||
|
this.emit('removeListener', type, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.prototype.removeAllListeners = function(type) {
|
||||||
|
var key, listeners;
|
||||||
|
|
||||||
|
if (!this._events)
|
||||||
|
return this;
|
||||||
|
|
||||||
|
// not listening for removeListener, no need to emit
|
||||||
|
if (!this._events.removeListener) {
|
||||||
|
if (arguments.length === 0)
|
||||||
|
this._events = {};
|
||||||
|
else if (this._events[type])
|
||||||
|
delete this._events[type];
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// emit removeListener for all listeners on all events
|
||||||
|
if (arguments.length === 0) {
|
||||||
|
for (key in this._events) {
|
||||||
|
if (key === 'removeListener') continue;
|
||||||
|
this.removeAllListeners(key);
|
||||||
|
}
|
||||||
|
this.removeAllListeners('removeListener');
|
||||||
|
this._events = {};
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
listeners = this._events[type];
|
||||||
|
|
||||||
|
if (cc.isFunction(listeners)) {
|
||||||
|
this.removeListener(type, listeners);
|
||||||
|
} else if (Array.isArray(listeners)) {
|
||||||
|
// LIFO order
|
||||||
|
while (listeners.length)
|
||||||
|
this.removeListener(type, listeners[listeners.length - 1]);
|
||||||
|
}
|
||||||
|
delete this._events[type];
|
||||||
|
this._noRepeatKey = {};
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.prototype.listeners = function(type) {
|
||||||
|
var ret;
|
||||||
|
if (!this._events || !this._events[type])
|
||||||
|
ret = [];
|
||||||
|
else if (cc.isFunction(this._events[type]))
|
||||||
|
ret = [this._events[type]];
|
||||||
|
else
|
||||||
|
ret = this._events[type].slice();
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
|
EventEmitter.listenerCount = function(emitter, type) {
|
||||||
|
var ret;
|
||||||
|
if (!emitter._events || !emitter._events[type])
|
||||||
|
ret = 0;
|
||||||
|
else if (cc.isFunction(emitter._events[type]))
|
||||||
|
ret = 1;
|
||||||
|
else
|
||||||
|
ret = emitter._events[type].length;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
|
window.EventEmitter = EventEmitter;
|
||||||
|
//cc.EventEmitter.create = function(maxListeners){
|
||||||
|
// return new EventEmitter(maxListeners);
|
||||||
|
//};
|
||||||
|
|
||||||
|
})(this);
|
53
scripts/jedate.css
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
@charset "utf-8";
|
||||||
|
|
||||||
|
.jedatebox{width:268px;height:auto; border:1px #00A1CB solid;position: absolute;background-color:#fff;font-family:'microsoft yahei',Verdana,"\u5fae\u8f6f\u96c5\u9ed1","\5b8b\4f53",Arial;font-size:14px; display:none; cursor:default;}
|
||||||
|
.jedatebox.dateshow{display:block;}
|
||||||
|
.jedatebox li{list-style:none}
|
||||||
|
.jedatebox .jedatetop{width:100%;background: #00A1CB; color:#fff; overflow:hidden;text-align:center;font-family:'\5B8B\4F53';}
|
||||||
|
.jedatebox .jedateym{float:left;height:40px; line-height:40px;}
|
||||||
|
.jedateym span{width:70%;padding: 0;float:left;text-align: center;text-overflow: ellipsis; display:block;}
|
||||||
|
.jedateym span input{width:100%;float:left;padding: 0;border:none;background-color:transparent;text-align: center;}
|
||||||
|
.jedateym .prev,.jedateym .next{width:15%;height:40px; line-height:45px;float:left;display:block;text-align: center;}
|
||||||
|
.jedateym .prev:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-right-style:solid; border-right-color:#fff;content: "";margin: 0 9px 0 0;}
|
||||||
|
.jedateym .next:before{width: 0;height: 0; display:inline-block;border-width: 7px; border-style: dashed;border-color: transparent;overflow: hidden;border-left-style:solid; border-left-color:#fff;content: "";margin: 0 0 0 6px;}
|
||||||
|
.jedateym .pndrop{width:14px;height:14px; overflow:hidden;display: inline-block;position:relative;vertical-align: middle;}
|
||||||
|
.jedateym .pndrop:before{width: 0;height: 0; display:inline-block;border-width:5px; border-style: dashed;border-color: transparent;overflow: hidden;border-top-style:solid; border-top-color:#fff;content: ""; position:absolute; top:4px; left:2px;}
|
||||||
|
|
||||||
|
.jedatesety,.jedatesetm{width: 100%; position:absolute;left:0; top:40px; bottom:0;background-color: #fff;}
|
||||||
|
.jedatesety .ymdropul,.jedatesetm .ymdropul{width:100%;height:210px;overflow:auto;}
|
||||||
|
.jedatesety .ymdropul li{width:33.3%;float:left;text-align: center;height:40px; line-height:40px;}
|
||||||
|
.jedatesetm .ymdropul li{width:33.3%;float:left;text-align: center;height:50px; line-height:50px;}
|
||||||
|
.jedatesety .ymdropul li.action,.jedatesetm .ymdropul li.action{background: #00A1CB;color:#fff;}
|
||||||
|
.jedatetopym p{overflow:auto; padding-top:4px;}
|
||||||
|
.jedatetopym p span{width:31%; margin:0 1.1%;background-color: #00A1CB;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;font-family:'\5B8B\4F53';}
|
||||||
|
.jedatetopym p span.jedateymchri{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
|
||||||
|
.jedatetopym p span.jedateymchle{background-color: #ECF4FB;color: #1F547E;float:left;font-size: 16px;}
|
||||||
|
.jedatetopym p span.jedateymchok{background-color: #00A1CB;color:#fff;float:right;font-size: 12px;}
|
||||||
|
|
||||||
|
.jedatebox .jedaym{height:202px;overflow:auto; padding:5px;}
|
||||||
|
.jedatebox .jedaym li{width:50%;float:left;text-align: center;height:32px; line-height:32px;}
|
||||||
|
.jedatebox .jedaym li.action{background: #00A1CB;color:#fff;}
|
||||||
|
.jedatebox .jedaol{width:100%;overflow:auto;}
|
||||||
|
.jedatebox .jedaul{ padding:0 4px;overflow:auto;}
|
||||||
|
.jedatebox .jedaol li,.jedatebox .jedaul li{width:14.28%; float:left; height:30px; line-height:30px; text-align:center;}
|
||||||
|
.jedatebox .jedaul li{width:14.28%;float:left;}
|
||||||
|
.jedatebox .jedaol li.weeks{background:#f5f5f5;border-bottom: 1px solid #ddd;}
|
||||||
|
.jedatebox .jedaul li.action{background: #00A1CB;color:#fff;}
|
||||||
|
.jedatebox .jedaul li.prevdate,.jedatebox .jedaul li.nextdate{color:#4DDBFF;}
|
||||||
|
.jedatebox .jedaul li.disabled{ color:#bbb;}
|
||||||
|
.jedatebox .jedaul li:nth-child(7n){border-right:none;}
|
||||||
|
|
||||||
|
.jedatebot{height:34px;line-height:34px; padding:0 3px 0 5px;overflow:hidden;background:#f5f5f5;}
|
||||||
|
.jedatebot .botflex{width:50%;float:left;display:block;margin:0;padding-top:3px; overflow:hidden;}
|
||||||
|
.jedatebot .botflex li{width:33.33%; float:left;text-align:center;}
|
||||||
|
.jedatebot .botflex li em{width:70%;float:left;padding: 0;border:none;border:1px #ddd solid;background-color: #fff;text-align: center;display:block;height:28px;line-height:28px;}
|
||||||
|
.jedatebot .botflex li i{width:30%;float:left;height:28px;line-height:26px;font-style:normal;display:block;text-align: center;}
|
||||||
|
.jedatebot .jedatebtn{text-align:center;font-size: 12px;font-family:'\5B8B\4F53';}
|
||||||
|
.jedatebot .jedatebtn span{float:left; margin:0 1.1%;background-color: #00A1CB;color: #fff;display: block;height:28px;line-height:28px; border-radius:5px;text-align:center;}
|
||||||
|
.jedateh,.jedatems{width: 100%; position:absolute;left:0; bottom:40px;background-color: #fff;border-top: 1px solid #ccc;}
|
||||||
|
.jedatehmstitle{width:100%;height:35px;line-height:35px;background: #f5f5f5; color:#000;position: relative; overflow:hidden;text-align:center;font-size: 15px;}
|
||||||
|
.jedateh p{width:20%;float:left;text-align: center;height:32px; line-height:32px;}
|
||||||
|
.jedatems p{width:10%;float:left;text-align: center;height:32px; line-height:32px;}
|
||||||
|
.jedateh p.action,.jedatems p.action{background: #00A1CB;color:#fff;}
|
||||||
|
.jedatehmsclose{width:30px; height:30px; line-height:26px; text-align:center;position: absolute;top:50%;right:4px; margin-top:-15px;z-index:150;font-size:24px;}
|
||||||
|
|
675
scripts/jedate.js
Normal file
@ -0,0 +1,675 @@
|
|||||||
|
/**
|
||||||
|
@Name : jeDate v2.0 日期控件
|
||||||
|
@Author: chne guojun
|
||||||
|
@Date: 2015-12-28
|
||||||
|
@QQ群:516754269
|
||||||
|
@Site:https://github.com/singod/jeDate
|
||||||
|
*/
|
||||||
|
(function(win) {
|
||||||
|
var jeDt = {}, doc = document, Cell = "#jedatebox";
|
||||||
|
/* (tag), (#id), (.className) ,(tag > .className) ,(tag > tag) ,(#id > tag.className) ,
|
||||||
|
(.className tag) ,(tag, tag, #id) ,(tag#id.className) ,(span > * > b) ,(input[name=radio])
|
||||||
|
*/
|
||||||
|
var QD = jeDt.query =function(){function r(c,g){g=g||document;if(!/^[\w\-_#]+$/.test(c)&&g.querySelectorAll)return m(g.querySelectorAll(c));if(-1<c.indexOf(",")){for(var d=c.split(/,/g),a=[],b=0,e=d.length;b<e;++b)a=a.concat(r(d[b],g));return y(a)}var d=c.match(z),a=d.pop(),e=(a.match(t)||k)[1],f=!e&&(a.match(u)||k)[1],b=!e&&(a.match(v)||k)[1],a=c.match(/\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\]/g);if(f&&!a&&!b&&g.getElementsByClassName)b=m(g.getElementsByClassName(f));else{b=!e&&m(g.getElementsByTagName(b||"*"));f&&(b=w(b,"className",RegExp("(^|\\s)"+f+"(\\s|$)")));if(e)return(d=g.getElementById(e))?[d]:[];if(a)for(e=0;e<a.length;e++)var f=(a[e].match(x)||k)[1],h=(a[e].match(x)||k)[2],h=h.replace(/\'/g,"").replace(/\-/g,"\\-").replace(/\[/g,"\\[").replace(/\]/g,"\\]"),b=w(b,f,RegExp("(^"+h+"$)"))}return d[0]&&b[0]?p(d,b):b}function m(c){try{return Array.prototype.slice.call(c)}catch(g){for(var d=[],a=0,b=c.length;a<b;++a)d[a]=c[a];return d}}function p(c,g,d){var a=c.pop();if("\x3e"===a)return p(c,g,!0);for(var b=[],e=-1,f=(a.match(t)||k)[1],h=!f&&(a.match(u)||k)[1],a=!f&&(a.match(v)||k)[1],m=-1,q,l,n,a=a&&a.toLowerCase();q=g[++m];){l=q.parentNode;do if(n=(n=(n=!a||"*"===a||a===l.nodeName.toLowerCase())&&(!f||l.id===f))&&(!h||RegExp("(^|\\s)"+h+"(\\s|$)").test(l.className)),d||n)break;while(l=l.parentNode);n&&(b[++e]=q)}return c[0]&&b[0]?p(c,b):b}function w(c,g,d){for(var a=-1,b,e=-1,f=[];b=c[++a];)d.test(b.getAttribute(g))&&(f[++e]=b);return f}var z=/(?:[\*\w\-\\.#]+)+(?:\[(?:[\w\-_][^=]+)=(?:[\'\[\]\w\-_]+)\])*|\*|>/gi,u=/^(?:[\w\-_]+)?\.([\w\-_]+)/,t=/^(?:[\w\-_]+)?#([\w\-_]+)/,v=/^([\w\*\-_]+)/,k=[null,null,null],x=/\[([\w\-_][^=]+)=([\'\[\]\w\-_]+)\]/,y=function(){var c=+new Date,g=function(){var d=1;return function(a){var b=a[c],e=d++;return b?!1:(a[c]=e,!0)}}();return function(d){for(var a=d.length,b=[],e=-1,f=0,h;f<a;++f)h=d[f],g(h)&&(b[++e]=h);c+=1;return b}}();return r}();
|
||||||
|
|
||||||
|
jeDt.each = function(arr, fn) {
|
||||||
|
var i = 0, len = arr.length;
|
||||||
|
for (;i < len; i++) {
|
||||||
|
if (fn(i, arr[i]) === false) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jeDt.extend = function() {
|
||||||
|
var _extend = function me(dest, source) {
|
||||||
|
for (var name in dest) {
|
||||||
|
if (dest.hasOwnProperty(name)) {
|
||||||
|
//当前属性是否为对象,如果为对象,则进行递归
|
||||||
|
if (dest[name] instanceof Object && source[name] instanceof Object) {
|
||||||
|
me(dest[name], source[name]);
|
||||||
|
}
|
||||||
|
//检测该属性是否存在
|
||||||
|
if (source.hasOwnProperty(name)) {
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
source[name] = dest[name];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var _result = {}, arr = arguments;
|
||||||
|
//遍历属性,至后向前
|
||||||
|
if (!arr.length) return {};
|
||||||
|
for (var i = arr.length - 1; i >= 0; i--) {
|
||||||
|
_extend(arr[i], _result);
|
||||||
|
}
|
||||||
|
arr[0] = _result;
|
||||||
|
return _result;
|
||||||
|
};
|
||||||
|
jeDt.trim = function(str) {
|
||||||
|
str = str || "";
|
||||||
|
return str.replace(/^\s|\s$/g, "").replace(/\s+/g, " ");
|
||||||
|
};
|
||||||
|
jeDt.attr = function(elem, key, val) {
|
||||||
|
if (typeof key === "string" && typeof val === 'undefined') {
|
||||||
|
return elem.getAttribute(key);
|
||||||
|
} else {
|
||||||
|
elem.setAttribute(key, val);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
jeDt.stopmp = function(e) {
|
||||||
|
e = e || win.event;
|
||||||
|
e.stopPropagation ? e.stopPropagation() :e.cancelBubble = true;
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
jeDt.getCss = function(obj, name) {
|
||||||
|
if (obj.currentStyle) {
|
||||||
|
return obj.currentStyle[name];
|
||||||
|
} else if (window.getComputedStyle) {
|
||||||
|
return document.defaultView.getComputedStyle(obj)[name];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
//查询样式是否存在
|
||||||
|
jeDt.hasClass = function(elem, cls) {
|
||||||
|
elem = elem || {};
|
||||||
|
return new RegExp("\\b" + cls + "\\b").test(elem.className);
|
||||||
|
};
|
||||||
|
//添加样式
|
||||||
|
jeDt.addClass = function(elem, cls) {
|
||||||
|
elem = elem || {};
|
||||||
|
jeDt.hasClass(elem, cls) || (elem.className += " " + cls);
|
||||||
|
elem.className = jeDt.trim(elem.className);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
//删除样式
|
||||||
|
jeDt.removeClass = function(elem, cls) {
|
||||||
|
elem = elem || {};
|
||||||
|
if (jeDt.hasClass(elem, cls)) {
|
||||||
|
elem.className = elem.className.replace(new RegExp("(\\s|^)" + cls + "(\\s|$)"), "");
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
//事件监听器
|
||||||
|
jeDt.on = function(obj, type, fn) {
|
||||||
|
if (obj.addEventListener) {
|
||||||
|
obj.addEventListener(type, fn, false);
|
||||||
|
} else if (obj.attachEvent) {
|
||||||
|
obj.attachEvent("on" + type, fn);
|
||||||
|
} else {
|
||||||
|
obj["on" + type] = fn;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//阻断mouseup
|
||||||
|
jeDt.stopMosup = function(evt, elem) {
|
||||||
|
if (evt !== "mouseup") {
|
||||||
|
jeDt.on(elem, "mouseup", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jeDt.html = function(elem, value) {
|
||||||
|
if (typeof value != "undefined" || value !== undefined && elem.nodeType === 1) {
|
||||||
|
elem.innerHTML = value;
|
||||||
|
} else {
|
||||||
|
return elem.innerHTML;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
jeDt.text = function(elem, value) {
|
||||||
|
if (value !== undefined && elem.nodeType === 1) {
|
||||||
|
document.all ? elem.innerText = value :elem.textContent = value;
|
||||||
|
} else {
|
||||||
|
var emText = document.all ? elem.innerText :elem.textContent;
|
||||||
|
return emText;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
jeDt.val = function(elem, value) {
|
||||||
|
if (value !== undefined && elem.nodeType === 1) {
|
||||||
|
elem.value = value;
|
||||||
|
} else {
|
||||||
|
return elem.value;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
jeDt.scroll = function(type) {
|
||||||
|
type = type ? "scrollLeft" :"scrollTop";
|
||||||
|
return doc.body[type] | doc.documentElement[type];
|
||||||
|
};
|
||||||
|
jeDt.winarea = function(type) {
|
||||||
|
return doc.documentElement[type ? "clientWidth" :"clientHeight"];
|
||||||
|
};
|
||||||
|
//转换日期格式
|
||||||
|
jeDt.parse = function(ymd, hms, format) {
|
||||||
|
ymd = ymd.concat(hms);
|
||||||
|
var format = format, _this = this;
|
||||||
|
return format.replace(/YYYY|MM|DD|hh|mm|ss/g, function(str, index) {
|
||||||
|
ymd.index = ++ymd.index | 0;
|
||||||
|
return jeDt.digit(ymd[ymd.index]);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//初始化日期
|
||||||
|
jeDt.nowDate = function(timestamp, format) {
|
||||||
|
var De = new Date(timestamp | 0 ? function(tamp) {
|
||||||
|
return tamp < 864e5 ? +new Date() + tamp * 864e5 :tamp;
|
||||||
|
}(parseInt(timestamp)) :+new Date());
|
||||||
|
return jeDt.parse([ De.getFullYear(), De.getMonth() + 1, De.getDate() ], [ De.getHours(), De.getMinutes(), De.getSeconds() ], format);
|
||||||
|
};
|
||||||
|
jeDt.montharr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
|
||||||
|
//判断元素类型
|
||||||
|
jeDt.isValHtml = function(that) {
|
||||||
|
return /textarea|input/.test(that.tagName.toLocaleLowerCase());
|
||||||
|
};
|
||||||
|
jeDt.weeks = [ "日", "一", "二", "三", "四", "五", "六" ];
|
||||||
|
//节日
|
||||||
|
jeDt.festival = function(md, n) {
|
||||||
|
var str = "";
|
||||||
|
switch (md) {
|
||||||
|
case "01.01": str = "元旦"; break;
|
||||||
|
case "02.14": str = "情人"; break;
|
||||||
|
case "03.08": str = "妇女"; break;
|
||||||
|
case "04.05": str = "清明"; break;
|
||||||
|
case "05.01": str = "劳动"; break;
|
||||||
|
case "06.01": str = "儿童"; break;
|
||||||
|
case "08.01": str = "建军"; break;
|
||||||
|
case "09.10": str = "教师"; break;
|
||||||
|
case "10.01": str = "国庆"; break;
|
||||||
|
case "12.24": str = "平安"; break;
|
||||||
|
case "12.25": str = "圣诞"; break;
|
||||||
|
default: str = n; break;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
//补齐数位
|
||||||
|
jeDt.digit = function(num) {
|
||||||
|
return num < 10 ? "0" + (num | 0) :num;
|
||||||
|
};
|
||||||
|
//显示隐藏层
|
||||||
|
jeDt.shdeCell = function(type) {
|
||||||
|
type ? QD(Cell)[0].style.display = "none" :QD(Cell)[0].style.display = "block";
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
dateCell:"#dateval",
|
||||||
|
format:"YYYY-MM-DD hh:mm:ss", //日期格式
|
||||||
|
minDate:"1900-01-01 00:00:00", //最小日期
|
||||||
|
maxDate:"2099-12-31 23:59:59", //最大日期
|
||||||
|
isinitVal:false, //是否初始化时间
|
||||||
|
isTime:false, //是否开启时间选择
|
||||||
|
isClear:true, //是否显示清空
|
||||||
|
festival:false, //是否显示节日
|
||||||
|
zIndex:9999999, //弹出层的层级高度
|
||||||
|
choosefun:function(val) {},
|
||||||
|
clearfun:function(val) {},
|
||||||
|
okfun:function(val) {}
|
||||||
|
}, InitDate = function(options) {
|
||||||
|
var that = this, newConf = JSON.parse(JSON.stringify(config));
|
||||||
|
that.config = jeDt.extend(newConf, options);
|
||||||
|
that.init();
|
||||||
|
};
|
||||||
|
var jeDate = function(options) {
|
||||||
|
return new InitDate(options || {});
|
||||||
|
};
|
||||||
|
InitDate.prototype = {
|
||||||
|
init:function() {
|
||||||
|
var that = this, opts = that.config, self = QD(opts.dateCell)[0], elem, devt, even = window.event, target;
|
||||||
|
var dateDiv = doc.createElement("div");
|
||||||
|
if (!QD(Cell)[0]) {
|
||||||
|
dateDiv.className = dateDiv.id = Cell.replace("#", "");
|
||||||
|
dateDiv.style.zIndex = opts.zIndex;
|
||||||
|
doc.body.appendChild(dateDiv);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
target = even.target || even.srcElement || {};
|
||||||
|
} catch (e) {
|
||||||
|
target = {};
|
||||||
|
}
|
||||||
|
elem = opts.dateCell ? QD(opts.dateCell)[0] :target;
|
||||||
|
var nowDateVal = jeDt.nowDate(null, opts.format);
|
||||||
|
if (opts.isinitVal) {
|
||||||
|
(jeDt.val(self) || jeDt.text(self)) == "" ? jeDt.isValHtml(self) ? jeDt.val(self, nowDateVal) :jeDt.text(self, nowDateVal) :jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
|
||||||
|
}
|
||||||
|
if (even && target.tagName) {
|
||||||
|
if (!elem || elem === jeDt.elem) return;
|
||||||
|
jeDt.stopMosup(even.type, elem);
|
||||||
|
jeDt.stopmp(even);
|
||||||
|
that.setHtml(opts, self);
|
||||||
|
} else {
|
||||||
|
devt = opts.event || "click";
|
||||||
|
jeDt.each((elem.length | 0) > 0 ? elem :[ elem ], function(ii, cel) {
|
||||||
|
jeDt.stopMosup(devt, that);
|
||||||
|
jeDt.on(cel, devt, function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
if (cel !== jeDt.elem) that.setHtml(opts, self);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setHtml:function(opts, self) {
|
||||||
|
var that = this, weekHtml = "", date = new Date(), nowDateVal = jeDt.nowDate(null, opts.format), isformat = opts.format.match(/\w+|d+/g).join("-") == "YYYY-MM" ? true :false;
|
||||||
|
var initVal = opts.isinitVal ? jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self) :(jeDt.val(self) || jeDt.text(self)) == "" ? nowDateVal :jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
|
||||||
|
if (jeDt.val(self) != "" || jeDt.text(self) != "") {
|
||||||
|
var arrTime = initVal.match(/\d+/g);
|
||||||
|
} else {
|
||||||
|
var arrTime = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(opts.shownowtime){
|
||||||
|
arrTime = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];
|
||||||
|
}
|
||||||
|
|
||||||
|
var topymSty = !isformat ? '<div class="jedateym" style="width:50%;"><i class="prev triangle yearprev"></i><span class="jedateyy" data-ym="24"><em class="jedateyear"></em><em class="pndrop"></em></span><i class="next triangle yearnext"></i></div>' + '<div class="jedateym" style="width:50%;"><i class="prev triangle monthprev"></i><span class="jedatemm" data-ym="12"><em class="jedatemonth"></em><em class="pndrop"></em></span><i class="next triangle monthnext"></i></div>' :'<div class="jedateym" style="width:100%;"><i class="prev triangle ymprev"></i><span class="jedateyy"><em class="jedateyearmonth"></em></span><i class="next triangle ymnext"></i></div>';
|
||||||
|
var datetopStr = '<div class="jedatetop">' + topymSty + "</div>";
|
||||||
|
var dateymList = !isformat ? '<div class="jedatetopym" style="display: none;">' + '<ul class="ymdropul"></ul><p><span class="jedateymchle">←</span><span class="jedateymchri">→</span><span class="jedateymchok">关闭</span></p>' + "</div>" :'<ul class="jedaym"></ul>';
|
||||||
|
var dateriList = '<ol class="jedaol"></ol><ul class="jedaul"></ul>';
|
||||||
|
var bothmsStr = !isformat ? '<ul class="botflex jedatehms"><li><em data-hms="24"></em><i>:</i></li><li><em data-hms="60"></em><i>:</i></li><li><em data-hms="60"></em></li></ul>' + '<div class="botflex jedatebtn"><span class="jedateclear" style="width:31%;">清空</span><span class="jedatetodaymonth" style="width:31%;">今天</span><span class="jedateok" style="width:31%;">确认</span></div>' :'<div class="botflex jedatebtn"><span class="jedateclear" style="width:31%;">清空</span><span class="jedatetodaymonth" style="width:31%;">本月</span><span class="jedateok" style="width:31%;">确认</span></div>';
|
||||||
|
var datebotStr = '<div class="jedatebot">' + bothmsStr + "</div>";
|
||||||
|
var dateHtmStr = isformat ? datetopStr + dateymList + datebotStr :datetopStr + dateymList + dateriList + datebotStr + '<div class="jedateprophms"></div>';
|
||||||
|
jeDt.html(QD(Cell)[0], dateHtmStr);
|
||||||
|
opts.isClear ? "" :QD(Cell + " .jedatebot .jedateclear")[0].style.display = "none";
|
||||||
|
if (opts.isTime) {
|
||||||
|
var dhmsArr = jeDt.val(self) != "" || jeDt.text(self) != "" ? [ arrTime[3], arrTime[4], arrTime[5] ] :[ date.getHours(), date.getMinutes() + 1, date.getSeconds() ];
|
||||||
|
jeDt.each(QD(Cell + " .jedatebot .jedatehms em"), function(i, cls) {
|
||||||
|
jeDt.html(cls, jeDt.digit(dhmsArr[i]));
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (!isformat) QD(Cell + " .jedatebot .jedatehms")[0].style.display = "none";
|
||||||
|
QD(Cell + " .jedatebot .jedatebtn")[0].style.width = "100%";
|
||||||
|
}
|
||||||
|
if (!isformat) {
|
||||||
|
for (var i = 0; i < jeDt.weeks.length; i++) {
|
||||||
|
weekHtml += '<li class="weeks" data-week="' + jeDt.weeks[i] + '">' + jeDt.weeks[i] + "</li>";
|
||||||
|
}
|
||||||
|
jeDt.html(QD(Cell + " .jedaol")[0], weekHtml);
|
||||||
|
that.getDateStr(arrTime[0], arrTime[1], arrTime[2]);
|
||||||
|
that.YearAndMonth(that, opts, self, arrTime);
|
||||||
|
} else {
|
||||||
|
jeDt.html(QD(Cell + " .jedaym")[0], that.onlyYMStr(arrTime[0], arrTime[1]));
|
||||||
|
jeDt.text(QD(Cell + " .jedateym .jedateyearmonth")[0], arrTime[0] + "年" + jeDt.digit(arrTime[1]) + "月");
|
||||||
|
that.onlyYMevents(that, opts, self, arrTime);
|
||||||
|
}
|
||||||
|
jeDt.shdeCell(false);
|
||||||
|
that.orien(QD(Cell)[0], self);
|
||||||
|
that.events(that, opts, self, arrTime);
|
||||||
|
},
|
||||||
|
onlyYMStr:function(y, m) {
|
||||||
|
var onlyYM = "";
|
||||||
|
jeDt.each(jeDt.montharr, function(i, val) {
|
||||||
|
onlyYM += "<li " + (m == val ? 'class="action"' :"") + ' data-onym="' + y + "-" + jeDt.digit(val) + '">' + y + "年" + jeDt.digit(val) + "月</li>";
|
||||||
|
});
|
||||||
|
return onlyYM;
|
||||||
|
},
|
||||||
|
onlyYMevents:function(that, opts, self, arrTime) {
|
||||||
|
var ymPre = QD(Cell + " .jedateym .ymprev")[0], ymNext = QD(Cell + " .jedateym .ymnext")[0], ony = parseInt(arrTime[0]), onm = parseInt(arrTime[1]);
|
||||||
|
jeDt.each([ ymPre, ymNext ], function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var ym = cls == ymPre ? ony -= 1 :ony += 1;
|
||||||
|
jeDt.html(QD(Cell + " .jedaym")[0], that.onlyYMStr(ym, onm));
|
||||||
|
that.events(that, opts, self, arrTime);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//方位辨别
|
||||||
|
orien:function(obj, self, pos) {
|
||||||
|
var tops, rect = self.getBoundingClientRect();
|
||||||
|
obj.style.left = rect.left + (pos ? 0 :jeDt.scroll(1)) + "px";
|
||||||
|
tops = (rect.bottom + obj.offsetHeight / 1.5 <= jeDt.winarea()) ?
|
||||||
|
rect.bottom - 1 : rect.top > obj.offsetHeight / 1.5 ? rect.top - obj.offsetHeight + 1 :jeDt.winarea() - obj.offsetHeight;
|
||||||
|
obj.style.top = Math.max(tops + (pos ? 0 :jeDt.scroll()) + 1, 1) + "px";
|
||||||
|
},
|
||||||
|
getDateStr:function(y, m, d) {
|
||||||
|
var that = this, opts = that.config, dayStr = "", m = jeDt.digit(m);
|
||||||
|
jeDt.text(QD(Cell + " .jedateyear")[0], y + "年").attr(QD(Cell + " .jedateyear")[0], "data-year", y);
|
||||||
|
jeDt.text(QD(Cell + " .jedatemonth")[0], m + "月").attr(QD(Cell + " .jedatemonth")[0], "data-month", m);
|
||||||
|
//是否显示节日
|
||||||
|
var isfestival = function(day, n) {
|
||||||
|
return opts.festival ? jeDt.festival(day, n) :n;
|
||||||
|
};
|
||||||
|
var parseArr = function(str) {
|
||||||
|
var timeArr = str.split(" ");
|
||||||
|
return timeArr[0].split("-");
|
||||||
|
};
|
||||||
|
//先得到当前月第一天是星期几.
|
||||||
|
var date = setMonthDays(y, m), weekday = new Date(y, parseInt(m) - 1, 1).getDay();
|
||||||
|
//根据这个星期算前面几天的上个月最后几天.
|
||||||
|
var pervLastDay = weekday != 0 ? weekday :weekday + 7;
|
||||||
|
//得到上个月最后一天;
|
||||||
|
var pervMonthlastDay = getPervMonthLastDay(y, m), currentMonthDays = getPervMonthLastDay(y, parseInt(m) + 1);
|
||||||
|
//上月最后几天循环
|
||||||
|
var lastdays = pervMonthlastDay - pervLastDay;
|
||||||
|
//判断是否超出允许的日期范围
|
||||||
|
var startDay = 1, minArr = parseArr(opts.minDate), maxArr = parseArr(opts.maxDate), endDay = currentMonthDays, thisDate = new Date(y, m, d), firstDate = new Date(y, m, 1), lastDate = new Date(y, m, currentMonthDays), minTime = new Date(minArr[0], minArr[1], minArr[2]), maxTime = new Date(maxArr[0], maxArr[1], maxArr[2]), minDateDay = minTime.getDate();
|
||||||
|
if (minTime > lastDate) {
|
||||||
|
startDay = parseInt(currentMonthDays) + 1;
|
||||||
|
} else if (minTime >= firstDate && minTime <= lastDate) {
|
||||||
|
startDay = minDateDay;
|
||||||
|
} else if (minTime >= firstDate) {}
|
||||||
|
if (maxTime) {
|
||||||
|
var maxDateDay = maxTime.getDate();
|
||||||
|
if (maxTime < firstDate) {
|
||||||
|
endDay = startDay;
|
||||||
|
} else if (maxTime >= firstDate && maxTime <= lastDate) {
|
||||||
|
endDay = maxDateDay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//循环上月剩余的天数
|
||||||
|
for (var p = pervLastDay - 1; p >= 0; p--) {
|
||||||
|
var py, pm, preCls, preDays = jeDt.digit(pervMonthlastDay - p);
|
||||||
|
m == 1 ? (py = parseInt(y) - 1, pm = 13) :(py = y, pm = m);
|
||||||
|
var thatpretm = parseInt(py.toString() + jeDt.digit(parseInt(pm) - 1).toString() + preDays.toString()), minpretm = parseInt(minArr[0].toString() + jeDt.digit(minArr[1]).toString() + jeDt.digit(minArr[2]).toString()), maxnexttm = parseInt(maxArr[0].toString() + jeDt.digit(maxArr[1]).toString() + jeDt.digit(maxArr[2]).toString());
|
||||||
|
preCls = thatpretm >= minpretm && thatpretm <= maxnexttm ? "prevdate" :preCls = "disabled";
|
||||||
|
dayStr += "<li class='" + preCls + "' data-y='" + py + "' data-m='" + (parseInt(pm) - 1) + "' data-d='" + preDays + "'>" + isfestival(parseInt(pm) - 1 + "." + preDays, preDays) + "</li>";
|
||||||
|
}
|
||||||
|
//循环本月的天数,将日期按允许的范围分三段拼接
|
||||||
|
for (var i = 1; i < startDay; i++) {
|
||||||
|
i = jeDt.digit(i);
|
||||||
|
dayStr += '<li class="disabled" data-y="' + y + '" data-m="' + m + '" data-d="' + i + '">' + isfestival(m + "." + i, i) + "</li>";
|
||||||
|
}
|
||||||
|
for (var j = startDay; j <= endDay; j++) {
|
||||||
|
var current = "";
|
||||||
|
j = jeDt.digit(j);
|
||||||
|
if (/*y==value.year && m==value.month+1&& */ d == j) {
|
||||||
|
current = "action";
|
||||||
|
}
|
||||||
|
dayStr += '<li class="' + current + '" data-y="' + y + '" data-m="' + m + '" data-d="' + j + '">' + isfestival(m + "." + j, j) + "</li>";
|
||||||
|
}
|
||||||
|
for (var k = endDay + 1; k <= currentMonthDays; k++) {
|
||||||
|
k = jeDt.digit(k);
|
||||||
|
dayStr += '<li class="disabled" data-y="' + y + '" data-m="' + m + '" data-d="' + k + '">' + isfestival(m + "." + k, k) + "</li>";
|
||||||
|
}
|
||||||
|
//循环补上下个月的开始几天
|
||||||
|
var nextDayArr = [], nextMonthStartDays = 42 - pervLastDay - setMonthDays(y, m);
|
||||||
|
for (var n = 1; n <= nextMonthStartDays; n++) {
|
||||||
|
var ny, nm, nextCls;
|
||||||
|
n = jeDt.digit(n);
|
||||||
|
m >= 12 ? (ny = parseInt(y) + 1, nm = 0) :(ny = y, nm = m);
|
||||||
|
var thatnexttm = parseInt(ny.toString() + jeDt.digit(parseInt(nm) + 1).toString() + jeDt.digit(n).toString()), minnexttm = parseInt(minArr[0].toString() + jeDt.digit(minArr[1]).toString() + jeDt.digit(minArr[2]).toString()), maxnexttm = parseInt(maxArr[0].toString() + jeDt.digit(maxArr[1]).toString() + jeDt.digit(maxArr[2]).toString());
|
||||||
|
nextCls = thatnexttm <= maxnexttm && thatnexttm >= minnexttm ? "nextdate" :nextCls = "disabled";
|
||||||
|
dayStr += "<li class='" + nextCls + "' data-y='" + ny + "' data-m='" + (parseInt(nm) + 1) + "' data-d='" + n + "'>" + isfestival(parseInt(nm) + 1 + "." + n, n) + "</li>";
|
||||||
|
}
|
||||||
|
jeDt.html(QD(Cell + " .jedaul")[0], dayStr);
|
||||||
|
jeDt.attr(QD(Cell + " .monthprev")[0], "data-y", jeDt.digit(parseInt(m) - 1));
|
||||||
|
jeDt.attr(QD(Cell + " .monthnext")[0], "data-y", jeDt.digit(parseInt(m) + 1));
|
||||||
|
//计算某年某月有多少天,如果是二月,闰年28天否则29天
|
||||||
|
function setMonthDays(year, month) {
|
||||||
|
var er = year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ? 29 :28;
|
||||||
|
return [ 31, er, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ][month - 1];
|
||||||
|
}
|
||||||
|
//得到指定月的上个月最后一天传进来按 12月算
|
||||||
|
function getPervMonthLastDay(year, month) {
|
||||||
|
//当月就是 yue-1 也就是计算机里面的0-11月份,那么算上个月的最后一天就是当月的0天
|
||||||
|
return parseInt(new Date(year, month - 1, 0).getDate());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
events:function(that, opts, self, arrTime) {
|
||||||
|
var yearPre = QD(Cell + " .yearprev")[0], yearNext = QD(Cell + " .yearnext")[0], monthPre = QD(Cell + " .monthprev")[0], monthNext = QD(Cell + " .monthnext")[0], newDate = new Date(), jedateyear = QD(Cell + " .jedateyear")[0], jedatemonth = QD(Cell + " .jedatemonth")[0], isformat = opts.format.match(/\w+|d+/g).join("-") == "YYYY-MM" ? true :false;
|
||||||
|
if (!isformat) {
|
||||||
|
//切换年
|
||||||
|
jeDt.each([ yearPre, yearNext ], function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var y = parseInt(jeDt.attr(jedateyear, "data-year")), m = parseInt(jeDt.attr(jedatemonth, "data-month"));
|
||||||
|
cls == yearPre ? y -= 1 :y += 1;
|
||||||
|
var d = newDate.toLocaleDateString() == y + "/" + m + "/" + newDate.getDate() ? arrTime[2] :1;
|
||||||
|
that.getDateStr(y, m, d);
|
||||||
|
that.clickLiDays(that, opts, self);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//切换月
|
||||||
|
jeDt.each([ monthPre, monthNext ], function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var y = parseInt(jeDt.attr(jedateyear, "data-year")), m = parseInt(jeDt.attr(jedatemonth, "data-month"));
|
||||||
|
if (cls == monthPre) {
|
||||||
|
m == 1 ? (y -= 1, m = 12) :m -= 1;
|
||||||
|
} else {
|
||||||
|
m == 12 ? (y += 1, m = 1) :m += 1;
|
||||||
|
}
|
||||||
|
var d = newDate.toLocaleDateString() == y + "/" + m + "/" + newDate.getDate() ? arrTime[2] :1;
|
||||||
|
that.getDateStr(y, m, d);
|
||||||
|
that.clickLiDays(that, opts, self);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//生成定位时分秒
|
||||||
|
jeDt.each(QD(Cell + " .jedatebot .jedatehms em"), function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function() {
|
||||||
|
var hmsStr = "", acton, hmscell = QD(Cell + " .jedateprophms")[0], hmslen = jeDt.attr(cls, "data-hms"), hmsstxt = [ "小时", "分钟", "秒数" ], removeEmpty = function() {
|
||||||
|
jeDt.removeClass(hmscell, hmslen == 24 ? "jedateh" :"jedatems");
|
||||||
|
jeDt.html(hmscell, "");
|
||||||
|
};
|
||||||
|
hmsStr += '<div class="jedatehmstitle">' + hmsstxt[i] + '<div class="jedatehmsclose">×</div></div>';
|
||||||
|
for (var h = 0; h < hmslen; h++) {
|
||||||
|
h = jeDt.digit(h);
|
||||||
|
acton = jeDt.text(cls) == h ? "action" :"";
|
||||||
|
hmsStr += '<p class="' + acton + '">' + h + "</p>";
|
||||||
|
}
|
||||||
|
jeDt.removeClass(hmscell, hmslen == 24 ? "jedatems" :"jedateh").addClass(hmscell, hmslen == 24 ? "jedateh" :"jedatems");
|
||||||
|
jeDt.html(hmscell, hmsStr);
|
||||||
|
jeDt.each(QD(Cell + " .jedateprophms p"), function(i, p) {
|
||||||
|
jeDt.on(p, "click", function() {
|
||||||
|
jeDt.html(cls, jeDt.digit(jeDt.text(p)));
|
||||||
|
removeEmpty();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
jeDt.each(QD(Cell + " .jedateprophms .jedatehmstitle"), function(i, c) {
|
||||||
|
jeDt.on(c, "click", function() {
|
||||||
|
removeEmpty();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//今天
|
||||||
|
jeDt.on(QD(Cell + " .jedatebot .jedatetodaymonth")[0], "click", function() {
|
||||||
|
var toTime = [ newDate.getFullYear(), newDate.getMonth() + 1, newDate.getDate(), newDate.getHours(), newDate.getMinutes(), newDate.getSeconds() ];
|
||||||
|
var gettoDate = jeDt.parse([ toTime[0], toTime[1], toTime[2] ], [ toTime[3], toTime[4], toTime[5] ], opts.format);
|
||||||
|
that.getDateStr(toTime[0], toTime[1], toTime[2]);
|
||||||
|
jeDt.isValHtml(self) ? jeDt.val(self, gettoDate) :jeDt.text(self, gettoDate);
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
if (opts.choosefun === "function" || opts.choosefun != null) opts.choosefun(gettoDate);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
jeDt.each(QD(Cell + " .jedaym li"), function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var atYM = jeDt.attr(cls, "data-onym").match(/\w+|d+/g);
|
||||||
|
var getYMDate = jeDt.parse([ atYM[0], atYM[1], 1 ], [ 0, 0, 0 ], opts.format);
|
||||||
|
jeDt.isValHtml(self) ? jeDt.val(self, getYMDate) :jeDt.text(self, getYMDate);
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//本月
|
||||||
|
jeDt.on(QD(Cell + " .jedatebot .jedatetodaymonth")[0], "click", function() {
|
||||||
|
var thisYM = jeDt.attr(QD(Cell + " .jedaym .action")[0], "data-onym").match(/\w+|d+/g), thisYMDate = jeDt.parse([ thisYM[0], thisYM[1], 1 ], [ 0, 0, 0 ], opts.format);
|
||||||
|
jeDt.isValHtml(self) ? jeDt.val(self, thisYMDate) :jeDt.text(self, thisYMDate);
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
if (opts.choosefun === "function" || opts.choosefun != null) opts.choosefun(thisYMDate);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//清空
|
||||||
|
jeDt.on(QD(Cell + " .jedatebot .jedateclear")[0], "click", function() {
|
||||||
|
var clearVal = jeDt.isValHtml(self) ? jeDt.val(self) :jeDt.text(self);
|
||||||
|
if(opts.notFillValWhenGet!=true)jeDt.isValHtml(self) ? jeDt.val(self, "") :jeDt.text(self, "");
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
if(clearVal != ""){
|
||||||
|
if (opts.clearfun === "function" || opts.clearfun != null) opts.clearfun(clearVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//确认
|
||||||
|
jeDt.on(QD(Cell + " .jedatebot .jedateok")[0], "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var jedCell = isformat ? QD(Cell + " .jedaym li") :QD(Cell + " .jedaul li")
|
||||||
|
if (!isformat) {
|
||||||
|
var okTimeArr = [], okTime = [ parseInt(jeDt.attr(jedateyear, "data-year")), parseInt(jeDt.attr(jedatemonth, "data-month")), arrTime[2] ];
|
||||||
|
jeDt.each(QD(Cell + " .jedatehms em"), function(l, tval) {
|
||||||
|
okTimeArr.push(jeDt.text(tval));
|
||||||
|
});
|
||||||
|
var okVal = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.parse([ okTime[0], okTime[1], okTime[2] ], [ okTimeArr[0], okTimeArr[1], okTimeArr[2] ], opts.format) :"";
|
||||||
|
that.getDateStr(okTime[0], okTime[1], okTime[2]);
|
||||||
|
}else{
|
||||||
|
var jedYM = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.attr(QD(Cell + " .jedaym .action")[0], "data-onym").match(/\w+|d+/g) :"",
|
||||||
|
okVal = jeDt.val(self) != "" || jeDt.text(self) != "" ? jeDt.parse([ jedYM[0], jedYM[1], 1 ], [ 0, 0, 0 ], opts.format) :""
|
||||||
|
}
|
||||||
|
jeDt.each(jedCell, function(i, cls) {
|
||||||
|
if (jeDt.attr(cls, "class") == "action") {
|
||||||
|
if(opts.notFillValWhenGet!=true)jeDt.isValHtml(self) ? jeDt.val(self, okVal) :jeDt.text(self, okVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
if(okVal != ""){
|
||||||
|
if (opts.okfun === "function" || opts.okfun != null) opts.okfun(okVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//点击空白处隐藏
|
||||||
|
jeDt.on(document, "click", function() {
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
});
|
||||||
|
jeDt.on(QD(Cell)[0], "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
});
|
||||||
|
that.clickLiDays(that, opts, self);
|
||||||
|
},
|
||||||
|
//下拉选择年和月
|
||||||
|
YearAndMonth:function(that, opts, self, arrTime) {
|
||||||
|
var jetopym = QD(Cell + " .jedatetopym")[0], jedateyy = QD(Cell + " .jedateyy")[0], jedatemm = QD(Cell + " .jedatemm")[0], jedateyear = QD(Cell + " .jedateyy .jedateyear")[0], jedatemonth = QD(Cell + " .jedatemm .jedatemonth")[0], mchri = QD(Cell + " .jedateymchri")[0], mchle = QD(Cell + " .jedateymchle")[0];
|
||||||
|
function eachYears(YY) {
|
||||||
|
var eachStr = "";
|
||||||
|
jeDt.each(new Array(15), function(i) {
|
||||||
|
if (i === 7) {
|
||||||
|
var getyear = jeDt.attr(jedateyear, "data-year");
|
||||||
|
eachStr += "<li " + (getyear == YY ? 'class="action"' :"") + ' data-y="' + YY + '">' + YY + "年</li>";
|
||||||
|
} else {
|
||||||
|
eachStr += '<li data-y="' + (YY - 7 + i) + '">' + (YY - 7 + i) + "年</li>";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return eachStr;
|
||||||
|
}
|
||||||
|
function setYearMonth(YY, ymlen) {
|
||||||
|
var ymStr = "";
|
||||||
|
if (ymlen == 12) {
|
||||||
|
jeDt.each(jeDt.montharr, function(i, val) {
|
||||||
|
var getmonth = jeDt.attr(jedatemonth, "data-month"), val = jeDt.digit(val);
|
||||||
|
ymStr += "<li " + (getmonth == val ? 'class="action"' :"") + ' data-m="' + val + '">' + val + "月</li>";
|
||||||
|
});
|
||||||
|
jeDt.each([ mchri, mchle ], function(c, cls) {
|
||||||
|
cls.style.display = "none";
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ymStr = eachYears(YY);
|
||||||
|
jeDt.each([ mchri, mchle ], function(c, cls) {
|
||||||
|
cls.style.display = "block";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
jeDt.removeClass(jetopym, ymlen == 12 ? "jedatesety" :"jedatesetm").addClass(jetopym, ymlen == 12 ? "jedatesetm" :"jedatesety");
|
||||||
|
jeDt.html(QD(Cell + " .jedatetopym .ymdropul")[0], ymStr);
|
||||||
|
jetopym.style.display = "block";
|
||||||
|
}
|
||||||
|
function clickLiYears(year) {
|
||||||
|
jeDt.each(QD(Cell + " .ymdropul li"), function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
var Years = jeDt.attr(this, "data-y"), Months = jeDt.attr(jedatemonth, "data-month");
|
||||||
|
jeDt.attr(year, "data-year", Years);
|
||||||
|
jeDt.html(year, Years);
|
||||||
|
jetopym.style.display = "none";
|
||||||
|
that.getDateStr(Years, Months, arrTime[2]);
|
||||||
|
that.clickLiDays(that, opts, self);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//下拉选择年
|
||||||
|
jeDt.on(jedateyy, "click", function() {
|
||||||
|
var YMlen = parseInt(jeDt.attr(jedateyy, "data-ym")), yearAttr = parseInt(jeDt.attr(jedateyear, "data-year"));
|
||||||
|
setYearMonth(yearAttr, YMlen);
|
||||||
|
clickLiYears(jedateyear);
|
||||||
|
});
|
||||||
|
//下拉选择月
|
||||||
|
jeDt.on(jedatemm, "click", function() {
|
||||||
|
var YMlen = parseInt(jeDt.attr(jedatemm, "data-ym")), yearAttr = parseInt(jeDt.attr(jedateyear, "data-year"));
|
||||||
|
setYearMonth(yearAttr, YMlen);
|
||||||
|
jeDt.each(QD(Cell + " .ymdropul li"), function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
var Years = jeDt.attr(jedateyear, "data-year"), Months = jeDt.attr(this, "data-m");
|
||||||
|
jeDt.attr(jedatemonth, "data-month", Months);
|
||||||
|
jeDt.html(jedatemonth, Months);
|
||||||
|
jetopym.style.display = "none";
|
||||||
|
that.getDateStr(Years, Months, arrTime[2]);
|
||||||
|
that.clickLiDays(that, opts, self);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//关闭下拉选择
|
||||||
|
jeDt.on(QD(Cell + " .jedateymchok")[0], "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
jetopym.style.display = "none";
|
||||||
|
});
|
||||||
|
var yearMch = parseInt(jeDt.attr(jedateyear, "data-year"));
|
||||||
|
jeDt.each([ mchle, mchri ], function(lr, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
lr == 0 ? yearMch -= 15 :yearMch += 15;
|
||||||
|
var mchStr = eachYears(yearMch);
|
||||||
|
jeDt.html(QD(Cell + " .jedatetopym .ymdropul")[0], mchStr);
|
||||||
|
clickLiYears(jedateyear);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//选择日
|
||||||
|
clickLiDays:function(that, opts, self) {
|
||||||
|
jeDt.each(QD(Cell + " .jedaul li"), function(i, cls) {
|
||||||
|
jeDt.on(cls, "click", function(ev) {
|
||||||
|
if (jeDt.hasClass(cls, "disabled")) return;
|
||||||
|
jeDt.stopmp(ev);
|
||||||
|
var liTms = [];
|
||||||
|
jeDt.each(QD(Cell + " .jedatehms em"), function(l, tval) {
|
||||||
|
liTms.push(jeDt.text(tval));
|
||||||
|
});
|
||||||
|
var aty = parseInt(jeDt.attr(cls, "data-y")) | 0, atm = parseInt(jeDt.attr(cls, "data-m")) | 0, atd = parseInt(jeDt.attr(cls, "data-d")) | 0;
|
||||||
|
var getParDate = jeDt.parse([ aty, atm, atd ], [ liTms[0], liTms[1], liTms[2] ], opts.format);
|
||||||
|
that.getDateStr(aty, atm, atd);
|
||||||
|
if(opts.notFillValWhenGet!=true)jeDt.isValHtml(self) ? jeDt.val(self, getParDate) :jeDt.text(self, getParDate);
|
||||||
|
jeDt.html(QD(Cell)[0], "");
|
||||||
|
jeDt.shdeCell(true);
|
||||||
|
if (opts.choosefun === "function" || opts.choosefun != null) {
|
||||||
|
opts.choosefun(getParDate);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jeDt.getPath = (function(){
|
||||||
|
var js = document.scripts, jsPath = js[js.length - 1].src;
|
||||||
|
return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
|
||||||
|
}());
|
||||||
|
jeDt.creatlink = function(lib){
|
||||||
|
var link = document.createElement('link');
|
||||||
|
link.type = 'text/css';
|
||||||
|
link.rel = 'stylesheet';
|
||||||
|
link.href = jeDt.getPath + lib + '.css';
|
||||||
|
link.id = 'jeDateSkin';
|
||||||
|
QD('head')[0].appendChild(link);
|
||||||
|
link = null;
|
||||||
|
};
|
||||||
|
jeDt.creatlink('jedate');
|
||||||
|
jeDate.skin = function(lib){
|
||||||
|
QD('#jeDateSkin')[0].parentNode.removeChild(QD('#jeDateSkin')[0]);
|
||||||
|
jeDt.creatlink(lib);
|
||||||
|
};
|
||||||
|
//返回指定日期
|
||||||
|
jeDate.now = function(num) {
|
||||||
|
var dd = new Date();
|
||||||
|
dd.setDate(dd.getDate() + num);
|
||||||
|
var y = dd.getFullYear(), m = dd.getMonth() + 1, d = dd.getDate();
|
||||||
|
return y + "-" + m + "-" + d;
|
||||||
|
};
|
||||||
|
"function" === typeof define ? define(function() {
|
||||||
|
return jeDate;
|
||||||
|
}) :window.jeDate = jeDate;
|
||||||
|
})(window);
|
5
scripts/jquery-1.9.1.min.js
vendored
Normal file
13
scripts/jquery-ui.min.js
vendored
Normal file
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 120 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 111 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 101 B |
BIN
scripts/jquery-ui/themes/base/images/ui-icons_222222_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
scripts/jquery-ui/themes/base/images/ui-icons_2e83ff_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
scripts/jquery-ui/themes/base/images/ui-icons_454545_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
scripts/jquery-ui/themes/base/images/ui-icons_888888_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
scripts/jquery-ui/themes/base/images/ui-icons_cd0a0a_256x240.png
Normal file
After Width: | Height: | Size: 4.3 KiB |