page_edit_tab_job.min.js 4.21 KB
function date(a,b){var c,d,e,f=this,g=/\\?([a-z])/gi,h=function(a,b){return a=a.toString(),a.length<b?h("0"+a,b,"0"):a},i=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"];return e=function(a,b){return d[a]?d[a]():b},d={d:function(){return h(d.j(),2)},D:function(){return d.l().slice(0,3)},j:function(){return c.getDate()},l:function(){return i[d.w()]+"day"},N:function(){return d.w()||7},S:function(){var a=d.j(),b=a%10;return 3>=b&&1==parseInt(a%100/10)&&(b=0),["st","nd","rd"][b-1]||"th"},w:function(){return c.getDay()},z:function(){var a=new Date(d.Y(),d.n()-1,d.j()),b=new Date(d.Y(),0,1);return Math.round((a-b)/864e5)},W:function(){var a=new Date(d.Y(),d.n()-1,d.j()-d.N()+3),b=new Date(a.getFullYear(),0,4);return h(1+Math.round((a-b)/864e5/7),2)},F:function(){return i[6+d.n()]},m:function(){return h(d.n(),2)},M:function(){return d.F().slice(0,3)},n:function(){return c.getMonth()+1},t:function(){return new Date(d.Y(),d.n(),0).getDate()},L:function(){var a=d.Y();return a%4===0&a%100!==0|a%400===0},o:function(){var a=d.n(),b=d.W(),c=d.Y();return c+(12===a&&9>b?1:1===a&&b>9?-1:0)},Y:function(){return c.getFullYear()},y:function(){return d.Y().toString().slice(-2)},a:function(){return c.getHours()>11?"pm":"am"},A:function(){return d.a().toUpperCase()},B:function(){var a=3600*c.getUTCHours(),b=60*c.getUTCMinutes(),d=c.getUTCSeconds();return h(Math.floor((a+b+d+3600)/86.4)%1e3,3)},g:function(){return d.G()%12||12},G:function(){return c.getHours()},h:function(){return h(d.g(),2)},H:function(){return h(d.G(),2)},i:function(){return h(c.getMinutes(),2)},s:function(){return h(c.getSeconds(),2)},u:function(){return h(1e3*c.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(d.Y(),0),b=Date.UTC(d.Y(),0),c=new Date(d.Y(),6),e=Date.UTC(d.Y(),6);return a-b!==c-e?1:0},O:function(){var a=c.getTimezoneOffset(),b=Math.abs(a);return(a>0?"-":"+")+h(100*Math.floor(b/60)+b%60,4)},P:function(){var a=d.O();return a.substr(0,3)+":"+a.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-c.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(g,e)},r:function(){return"D, d M Y H:i:s O".replace(g,e)},U:function(){return c/1e3|0}},this.date=function(a,b){return f=this,c=void 0===b?new Date:b instanceof Date?new Date(b):new Date(1e3*b),a.replace(g,e)},this.date(a,b)}jQuery(document).ready(function(a){a('input[name="type[]"]').change(function(){a('input[name="type[]"]:checked').hasClass("filetype")?a(".hasdests").show():a(".hasdests").hide(),a("#tab-jobtype-"+a(this).val().toLowerCase()).toggle()}),a('input[name="type[]"]:checked').hasClass("filetype")?a(".hasdests").show():a(".hasdests").hide(),a('input[name="destinations[]"]').change(function(){a("#tab-dest-"+a(this).val().toLowerCase()).toggle()}),a('input[name="name"]').keyup(function(){a("#h2jobtitle").replaceWith('<span id="h2jobtitle">'+backwpup_htmlspecialchars(a(this).val())+"</span>")}),a('input[name="name"]').focus(function(){a(this).val()==a(this).data("empty")&&a(this).val("")}),a('input[name="name"]').blur(function(){""===a(this).val()&&a(this).val(a(this).data("empty"))}),a('input[name="backuptype"]').change(function(){"sync"==a(this).val()?(a(".nosync").hide(),a(".sync").show()):(a(".nosync").show(),a(".sync").hide())}),"sync"==a('input[name="backuptype"]:checked').val()?(a(".nosync").hide(),a(".sync").show()):(a(".nosync").show(),a(".sync").hide()),a('input[name="archivename"]').keyup(function(){var b=a(this).val();b=b.replace("%d",date("d")),b=b.replace("%j",date("j")),b=b.replace("%m",date("m")),b=b.replace("%n",date("n")),b=b.replace("%Y",date("Y")),b=b.replace("%y",date("y")),b=b.replace("%a",date("a")),b=b.replace("%A",date("A")),b=b.replace("%B",date("B")),b=b.replace("%g",date("g")),b=b.replace("%G",date("G")),b=b.replace("%h",date("h")),b=b.replace("%H",date("H")),b=b.replace("%i",date("i")),b=b.replace("%s",date("s")),a("#archivefilename").replaceWith('<span id="archivefilename">'+backwpup_htmlspecialchars(b)+"</span>")}),a('input[name="archiveformart"]').change(function(){a("#archiveformart").replaceWith('<span id="archiveformart">'+a(this).val()+"</span>")})});