Anuko time tracker 填报工具

自用
如图

  1. 填报本月开始和结束日期(如 2号到7号)
  2. 填报这区间内的所有工作,每项一行
  3. 点击 Enable jQery 标签
  4. 点击 AnukoFill 标签即可把任务平均分到每天。提交后页面会自动刷新。

浏览器 标签或书签的内容

Enable jQuery

javascript:void(function(){if(!document.getElementById('jQscript')){var jQscript=document.createElement('script');jQscript.id='jQscript';jQscript.src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js';document.documentElement.appendChild(jQscript);}}());

AnukoFill

javascript:!function(){var t=window.location.href.substr(0,window.location.href.lastIndexOf("/")),i=$("#activity").val().trim(),r=$("#project").val().trim();if(!i||!r)return void alert("Select product and activity please!");for(var a=$("#start").val().trim(),e=$("#finish").val().trim(),n=$("#note").val().trim().split("\n"),o=parseInt(n.length/(e-a+1)),l="",s=$("a.CalendarLinkRecordsExist").attr("href").substr(6),d=s.trim().substr(6,4),c=s.trim().substr(0,2),v=parseInt(a),m=0;m<n.length;m++)l+=n[m]+" ",(1==o||m>0&&m%o==0||m==n.length-1)&&(console.log("Adding "+(c+"/"+v+"/"+d)+": "+l),$.post(t+"/time.php",{project:r,activity:i,duration:8,note:l,billable:1,date:c+"/"+v+"/"+d,btn_submit:"Submit"}),l="",v++);window.location.reload()}();

Clear Today

javascript:!function(){for(var e=window.location.href.substr(0,window.location.href.lastIndexOf("/")),t=$("a").filter(function(){return"Delete"==$(this).text()}),o=0;o<t.length;o++){var l=$(t[o]).attr("href").substr(19);$.post(e+"/time_delete.php?id="+l,{delete_button:"Delete",id:l}),console.log("Deleted "+l)}location.reload()}();

源代码

AnukoFill

(function() {
var basePath=window.location.href.substr(0,window.location.href.lastIndexOf('/'));
var activity = $('#activity').val().trim();
var project = $('#project').val().trim();
if(!activity || !project){
    alert('Select product and activity please!');
    return;
}
var start = $('#start').val().trim();
var end =$('#finish').val().trim();
var allIssueList=$('#note').val().trim().split("\n");
var eachPartLength=parseInt(allIssueList.length/(end-start+1));
var cachedIssue='';
var currentDate=$('a.CalendarLinkRecordsExist').attr('href').substr(6);
var year=currentDate.trim().substr(6,4);
var month=currentDate.trim().substr(0,2);
var iterDay=parseInt(start);
for(var i =0;i< allIssueList.length; i++){
    cachedIssue+=allIssueList[i]+' ';
    if(eachPartLength==1 || (i > 0 && i % eachPartLength == 0 ) || i == allIssueList.length - 1) {
       console.log('Adding ' + (month + "/" + iterDay + "/" + year) +': ' + cachedIssue);
       $.post( basePath+"/time.php", { project: project, activity:activity, duration:8, note: cachedIssue, billable:1, date: (month + "/" + iterDay + "/" + year), btn_submit:"Submit" } );
       cachedIssue='';
       iterDay++;
    }
}
window.location.reload();
})();

Clear Today

(function() {
var basePath=window.location.href.substr(0,window.location.href.lastIndexOf('/'));
var btns=$('a').filter(function(index){return $(this).text() == "Delete"});
for(var i=0;i<btns.length;i++){ 
  var deleteId=$(btns[i]).attr('href').substr(19); 
  $.post( basePath+"/time_delete.php?id="+deleteId, { delete_button: 'Delete', id : deleteId} );
  console.log('Deleted ' + deleteId)
};
location.reload();
})();

问题:
任务数目目前不能少于天数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值