From 78624c2607b7aa5472d26c5fff290be0cf0776b3 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Fri, 13 Apr 2018 07:16:06 +0100 Subject: Convert action.php to http/controller style --- public/assets-2.0.0/js/webtrees.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/assets-2.0.0/js') diff --git a/public/assets-2.0.0/js/webtrees.js b/public/assets-2.0.0/js/webtrees.js index 0e7345ee93..f670ad410f 100644 --- a/public/assets-2.0.0/js/webtrees.js +++ b/public/assets-2.0.0/js/webtrees.js @@ -1 +1 @@ -"use strict";function expand_layer(e){return $("#"+e+"_img").toggleClass("icon-plus icon-minus"),$("#"+e).slideToggle("fast"),$("#"+e+"-alt").toggle(),!1}function accept_changes(e){return $.post("action.php",{action:"accept-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function reject_changes(e){return $.post("action.php",{action:"reject-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_record(e,t,n){return confirm(e)&&$.post("action.php",{action:"delete-record",xref:t,ged:void 0===n?WT_GEDCOM:n},function(){location.reload()}),!1}function delete_fact(e,t,n){return confirm(e)&&$.post("action.php",{action:"delete-fact",xref:t,fact_id:n,ged:WT_GEDCOM},function(){location.reload()}),!1}function unlink_media(e,t,n){return confirm(e)&&$.post("action.php",{action:"unlink-media",source:t,target:n,ged:WT_GEDCOM},function(){location.reload()}),!1}function copy_fact(e,t){return $.post("action.php",{action:"copy-fact",xref:e,fact_id:t,ged:WT_GEDCOM},function(){location.reload()}),!1}function paste_fact(e,t){return $.post("action.php",{action:"paste-fact",xref:e,fact_id:$(t).val(),ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_user(e,t){return confirm(e)&&$.post("action.php",{action:"delete-user",user_id:t},function(){location.reload()}),!1}function masquerade(e){return $.post("index.php",{route:"masquerade",user_id:e},function(){location.reload()}),!1}function addmedia_links(e,t,n){return pastefield=e,insertRowToTable(t,n),!1}function valid_date(e){var t=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],n=["MUHAR","SAFAR","RABIA","RABIT","JUMAA","JUMAT","RAJAB","SHAAB","RAMAD","SHAWW","DHUAQ","DHUAH"],o=["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"],a=["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"],l=["FARVA","ORDIB","KHORD","TIR","MORDA","SHAHR","MEHR","ABAN","AZAR","DEY","BAHMA","ESFAN"],i=e.value,s=i.split("("),r="";if(s.length>1&&(i=s[0],r=s[1]),i=i.toUpperCase(),i=i.replace(/\s+/," "),i=i.replace(/(^\s)|(\s$)/,""),i=i.replace(/(\d)([A-Z])/,"$1 $2"),i=i.replace(/([A-Z])(\d)/,"$1 $2"),i.match(/^Q ([1-4]) (\d\d\d\d)$/)&&(i="BET "+t[3*RegExp.$1-3]+" "+RegExp.$2+" AND "+t[3*RegExp.$1-1]+" "+RegExp.$2),i.match(/^(@#DHIJRI@|HIJRI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHIJRI@"+RegExp.$2+n[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DJALALI@|JALALI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DJALALI@"+RegExp.$2+l[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DHEBREW@|HEBREW)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHEBREW@"+RegExp.$2+o[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DFRENCH R@|FRENCH)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DFRENCH R@"+RegExp.$2+a[parseInt(RegExp.$3,10)-1]+RegExp.$4),/^([^\d]*)(\d+)[^\d](\d+)[^\d](\d+)$/i.exec(i)){var c=RegExp.$1,d=parseInt(RegExp.$2,10),u=parseInt(RegExp.$3,10),p=parseInt(RegExp.$4,10),f="DMY";"undefined"!=typeof locale_date_format&&("MDY"!==locale_date_format&&"YMD"!==locale_date_format||(f=locale_date_format));var m=(new Date).getFullYear(),h=m%100,g=m-h;"DMY"===f&&d<=31&&u<=12||d>13&&d<=31&&u<=12&&p>31?i=c+d+" "+t[u-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):"MDY"===f&&d<=12&&u<=31||u>13&&u<=31&&d<=12&&p>31?i=c+u+" "+t[d-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):("YMD"===f&&u<=12&&p<=31||p>13&&p<=31&&u<=12&&d>31)&&(i=c+p+" "+t[u-1]+" "+(d>=100?d:d<=h?d+g:d+g-100))}i=i.replace(/^[>]([\w ]+)$/,"AFT $1"),i=i.replace(/^[<]([\w ]+)$/,"BEF $1"),i=i.replace(/^([\w ]+)[-]$/,"FROM $1"),i=i.replace(/^[-]([\w ]+)$/,"TO $1"),i=i.replace(/^[~]([\w ]+)$/,"ABT $1"),i=i.replace(/^[*]([\w ]+)$/,"EST $1"),i=i.replace(/^[#]([\w ]+)$/,"CAL $1"),i=i.replace(/^([\w ]+) ?- ?([\w ]+)$/,"BET $1 AND $2"),i=i.replace(/^([\w ]+) ?~ ?([\w ]+)$/,"FROM $1 TO $2"),i=i.replace(/(JANUARY)/,"JAN"),i=i.replace(/(FEBRUARY)/,"FEB"),i=i.replace(/(MARCH)/,"MAR"),i=i.replace(/(APRIL)/,"APR"),i=i.replace(/(MAY)/,"MAY"),i=i.replace(/(JUNE)/,"JUN"),i=i.replace(/(JULY)/,"JUL"),i=i.replace(/(AUGUST)/,"AUG"),i=i.replace(/(SEPTEMBER)/,"SEP"),i=i.replace(/(OCTOBER)/,"OCT"),i=i.replace(/(NOVEMBER)/,"NOV"),i=i.replace(/(DECEMBER)/,"DEC"),i=i.replace(/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.? (\d\d?)[, ]+(\d\d\d\d)/,"$2 $1 $3"),i=i.replace(/(^| )(\d [A-Z]{3,5} \d{4})/,"$10$2"),r&&(i=i+" ("+r),e.value!==i&&(e.value=i)}function show_submenu(e,t){var n=document.body.scrollWidth+document.documentElement.scrollLeft,o=document.getElementById(e);if(o&&o.style){document.all?n=document.body.offsetWidth:(n=document.body.scrollWidth+document.documentElement.scrollLeft-55,"rtl"===textDirection&&o.offsetLeft+o.offsetWidth+10);for(var a=0,l=o.childNodes.length,i=0;ia+5&&(a=s.offsetWidth)}o.offsetWidthn)){var c=n-o.offsetWidth;o.style.left=c+"px"}o.offsetLeft<0&&(o.style.left="0px"),o.offsetHeight>500&&(o.style.height="400px",o.style.overflow="auto"),o.style.visibility="visible"}clearTimeout(menutimeouts[e]),menutimeouts[e]=null}function hide_submenu(e){if("number"==typeof menutimeouts[e]){var t=document.getElementById(e);t&&t.style&&(t.style.visibility="hidden"),clearTimeout(menutimeouts[e]),menutimeouts[e]=null}}function timeout_submenu(e){"number"!=typeof menutimeouts[e]&&(menutimeouts[e]=setTimeout("hide_submenu('"+e+"')",100))}function statusDisable(e){var t=document.getElementById(e);t.checked=!1,t.disabled=!0}function statusEnable(e){document.getElementById(e).disabled=!1}function statusChecked(e){document.getElementById(e).checked=!0}function cal_setMonthNames(e,t,n,o,a,l,i,s,r,c,d,u){monthLabels[1]=e,monthLabels[2]=t,monthLabels[3]=n,monthLabels[4]=o,monthLabels[5]=a,monthLabels[6]=l,monthLabels[7]=i,monthLabels[8]=s,monthLabels[9]=r,monthLabels[10]=c,monthLabels[11]=d,monthLabels[12]=u}function cal_setDayHeaders(e,t,n,o,a,l,i){daysOfWeek[0]=e,daysOfWeek[1]=t,daysOfWeek[2]=n,daysOfWeek[3]=o,daysOfWeek[4]=a,daysOfWeek[5]=l,daysOfWeek[6]=i}function cal_setWeekStart(e){e>=0&&e<7&&(weekStart=e)}function calendarWidget(e,t){var n=document.getElementById(e),o=document.getElementById(t);if("visible"===n.style.visibility)return n.style.visibility="hidden",!1;if("show"===n.style.visibility)return n.style.visibility="hide",!1;var a,l=/((\d+ (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) )?\d+)/i;return a=l.exec(o.value)?new Date(RegExp.$1):new Date,n.innerHTML=cal_generateSelectorContent(t,e,a),"hidden"===n.style.visibility?(n.style.visibility="visible",!1):"hide"===n.style.visibility&&(n.style.visibility="show",!1)}function cal_generateSelectorContent(e,t,n){var o,a,l='';for(l+='",l+='",l+='",l+='",l+="
',l+='',l+="",a=weekStart,o=0;o<7;o++)l+="";var i=new Date(n.getFullYear(),n.getMonth(),1),s=i.getDay();s-=weekStart;for(i=i.getTime()-864e5*s+432e5,i=new Date(i),a=0;a<6;a++){for(l+="",o=0;o<7;o++){l+="";var r=i.getTime()+864e5;i=new Date(r)}l+=""}return l+="
",++a>6&&(a=0);l+="
',l+=i.getDate(),l+="
",l+="
"}function cal_setDateField(e,t,n,o){var a=document.getElementById(e);return!!a&&(o<10&&(o="0"+o),a.value=o+" "+monthShort[n+1]+" "+t,!1)}function cal_updateCalendar(e,t){var n=document.getElementById(e+"_daySelect");if(!n)return!1;var o=document.getElementById(e+"_monSelect");if(!o)return!1;var a=document.getElementById(e+"_yearInput");if(!a)return!1;var l=parseInt(o.options[o.selectedIndex].value,10);l-=1;var i=new Date(a.value,l,n.options[n.selectedIndex].value);cal_setDateField(e,i.getFullYear(),i.getMonth(),i.getDate());var s=document.getElementById(t);return s?(s.innerHTML=cal_generateSelectorContent(e,t,i),!1):(alert("no dateDiv "+t),!1)}function cal_dateClicked(e,t,n,o,a){return cal_setDateField(e,n,o,a),calendarWidget(t,e),!1}function openerpasteid(e){window.opener.paste_id&&window.opener.paste_id(e),window.close()}function paste_id(e){pastefield.value=e}function pastename(e){nameElement&&(nameElement.innerHTML=e),remElement&&(remElement.style.display="block")}function paste_char(e){document.selection?(pastefield.focus(),document.selection.createRange().text=e):pastefield.selectionStart||0===pastefield.selectionStart?(pastefield.value=pastefield.value.substring(0,pastefield.selectionStart)+e+pastefield.value.substring(pastefield.selectionEnd,pastefield.value.length),pastefield.selectionStart=pastefield.selectionEnd=pastefield.selectionStart+e.length):pastefield.value+=e,"NPFX"!==pastefield.id&&"GIVN"!==pastefield.id&&"SPFX"!==pastefield.id&&"SURN"!==pastefield.id&&"NSFX"!==pastefield.id||updatewholename()}function ilinkitem(e,t,n){return n=void 0===n?WT_GEDCOM:n,window.open("inverselink.php?mediaid="+encodeURIComponent(e)+"&linkto="+encodeURIComponent(t)+"&ged="+encodeURIComponent(n),"_blank",find_window_specs),!1}function persistent_toggle(e,t){var n=document.getElementById(e),o=document.querySelectorAll(t),a=localStorage.getItem(e);if(n){""!==a&&(a="none"),n.checked=""===a;for(var l=0;l')}),$.fn.dataTableExt.oSort["text-asc"]=function(e,t){return e.localeCompare(t,document.documentElement.lang,{sensitivity:"base"})},$.fn.dataTableExt.oSort["text-desc"]=function(e,t){return t.localeCompare(e,document.documentElement.lang,{sensitivity:"base"})},$("table.datatables").each(function(){$(this).DataTable(),$(this).show()}),$(".wt-modal-create-record").on("show.bs.modal",function(e){$("form",$(this)).data("element-id",$(e.relatedTarget).data("element-id")),$("form .form-group input:first",$(this)).focus()}),$(".wt-modal-create-record form").on("submit",function(e){e.preventDefault();var t=$(this).data("element-id");$.ajax({url:"action.php",type:"POST",data:new FormData(this),async:!1,cache:!1,contentType:!1,processData:!1,success:function(e){$("#"+t).select2().empty().append(new Option(e.text,e.id)).val(e.id).trigger("change")},failure:function(e){alert(e.error_message)}}),this.reset(),$(this).closest(".wt-modal-create-record").modal("hide")}),$(".menu-language").on("click","[data-language]",function(){return $.post("index.php",{route:"language",language:$(this).data("language")},function(){window.location.reload()}),!1}),$(".menu-theme").on("click","[data-theme]",function(){return $.post("index.php",{route:"theme",theme:$(this).data("theme")},function(){window.location.reload()}),!1});var e;$(".wt-osk-trigger").click(function(){e=document.getElementById($(this).data("id")),e.focus(),$(".wt-osk").show()}),$(document).on("focusin",":input",function(){e=this}),$(".wt-osk-script-button").change(function(){$(".wt-osk-script").prop("hidden",!0),$(".wt-osk-script-"+$(this).data("script")).prop("hidden",!1)}),$(".wt-osk-shift-button").click(function(){document.querySelector(".wt-osk-keys").classList.toggle("shifted")}),$(".wt-osk-keys").on("click",".wt-osk-key",function(){var t=$(this).contents().get(0).nodeValue,n=$(".wt-osk-shift-button").hasClass("active"),o=$("sup",this)[0];if(n&&void 0!==o&&(t=o.innerText),null!==e){var a=e.selectionStart,l=e.value,i=l.substring(0,a),s=l.substring(a,l.length);e.value=i+t+s,!1===$(".wt-osk-pin-button").hasClass("active")&&$(".wt-osk").hide()}})}); \ No newline at end of file +"use strict";function expand_layer(e){return $("#"+e+"_img").toggleClass("icon-plus icon-minus"),$("#"+e).slideToggle("fast"),$("#"+e+"-alt").toggle(),!1}function accept_changes(e){return $.post("index.php",{route:"accept-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function reject_changes(e){return $.post("index.php",{route:"reject-changes",xref:e,ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_record(e,t,n){return confirm(e)&&$.post("index.php",{route:"delete-record",xref:t,ged:void 0===n?WT_GEDCOM:n},function(){location.reload()}),!1}function delete_fact(e,t,n){return confirm(e)&&$.post("index.php",{route:"delete-fact",xref:t,fact_id:n,ged:WT_GEDCOM},function(){location.reload()}),!1}function copy_fact(e,t){return $.post("index.php",{route:"copy-fact",xref:e,fact_id:t,ged:WT_GEDCOM},function(){location.reload()}),!1}function paste_fact(e,t){return $.post("index.php",{route:"paste-fact",xref:e,fact_id:$(t).val(),ged:WT_GEDCOM},function(){location.reload()}),!1}function delete_user(e,t){return confirm(e)&&$.post("index.php",{route:"delete-user",user_id:t},function(){location.reload()}),!1}function masquerade(e){return $.post("index.php",{route:"masquerade",user_id:e},function(){location.reload()}),!1}function addmedia_links(e,t,n){return pastefield=e,insertRowToTable(t,n),!1}function valid_date(e){var t=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],n=["MUHAR","SAFAR","RABIA","RABIT","JUMAA","JUMAT","RAJAB","SHAAB","RAMAD","SHAWW","DHUAQ","DHUAH"],o=["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"],a=["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"],l=["FARVA","ORDIB","KHORD","TIR","MORDA","SHAHR","MEHR","ABAN","AZAR","DEY","BAHMA","ESFAN"],i=e.value,r=i.split("("),s="";if(r.length>1&&(i=r[0],s=r[1]),i=i.toUpperCase(),i=i.replace(/\s+/," "),i=i.replace(/(^\s)|(\s$)/,""),i=i.replace(/(\d)([A-Z])/,"$1 $2"),i=i.replace(/([A-Z])(\d)/,"$1 $2"),i.match(/^Q ([1-4]) (\d\d\d\d)$/)&&(i="BET "+t[3*RegExp.$1-3]+" "+RegExp.$2+" AND "+t[3*RegExp.$1-1]+" "+RegExp.$2),i.match(/^(@#DHIJRI@|HIJRI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHIJRI@"+RegExp.$2+n[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DJALALI@|JALALI)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DJALALI@"+RegExp.$2+l[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DHEBREW@|HEBREW)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DHEBREW@"+RegExp.$2+o[parseInt(RegExp.$3,10)-1]+RegExp.$4),i.match(/^(@#DFRENCH R@|FRENCH)( \d?\d )(\d?\d)( \d?\d?\d?\d)$/)&&(i="@#DFRENCH R@"+RegExp.$2+a[parseInt(RegExp.$3,10)-1]+RegExp.$4),/^([^\d]*)(\d+)[^\d](\d+)[^\d](\d+)$/i.exec(i)){var d=RegExp.$1,c=parseInt(RegExp.$2,10),u=parseInt(RegExp.$3,10),p=parseInt(RegExp.$4,10),f="DMY";"undefined"!=typeof locale_date_format&&("MDY"!==locale_date_format&&"YMD"!==locale_date_format||(f=locale_date_format));var m=(new Date).getFullYear(),h=m%100,g=m-h;"DMY"===f&&c<=31&&u<=12||c>13&&c<=31&&u<=12&&p>31?i=d+c+" "+t[u-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):"MDY"===f&&c<=12&&u<=31||u>13&&u<=31&&c<=12&&p>31?i=d+u+" "+t[c-1]+" "+(p>=100?p:p<=h?p+g:p+g-100):("YMD"===f&&u<=12&&p<=31||p>13&&p<=31&&u<=12&&c>31)&&(i=d+p+" "+t[u-1]+" "+(c>=100?c:c<=h?c+g:c+g-100))}i=i.replace(/^[>]([\w ]+)$/,"AFT $1"),i=i.replace(/^[<]([\w ]+)$/,"BEF $1"),i=i.replace(/^([\w ]+)[-]$/,"FROM $1"),i=i.replace(/^[-]([\w ]+)$/,"TO $1"),i=i.replace(/^[~]([\w ]+)$/,"ABT $1"),i=i.replace(/^[*]([\w ]+)$/,"EST $1"),i=i.replace(/^[#]([\w ]+)$/,"CAL $1"),i=i.replace(/^([\w ]+) ?- ?([\w ]+)$/,"BET $1 AND $2"),i=i.replace(/^([\w ]+) ?~ ?([\w ]+)$/,"FROM $1 TO $2"),i=i.replace(/(JANUARY)/,"JAN"),i=i.replace(/(FEBRUARY)/,"FEB"),i=i.replace(/(MARCH)/,"MAR"),i=i.replace(/(APRIL)/,"APR"),i=i.replace(/(MAY)/,"MAY"),i=i.replace(/(JUNE)/,"JUN"),i=i.replace(/(JULY)/,"JUL"),i=i.replace(/(AUGUST)/,"AUG"),i=i.replace(/(SEPTEMBER)/,"SEP"),i=i.replace(/(OCTOBER)/,"OCT"),i=i.replace(/(NOVEMBER)/,"NOV"),i=i.replace(/(DECEMBER)/,"DEC"),i=i.replace(/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\.? (\d\d?)[, ]+(\d\d\d\d)/,"$2 $1 $3"),i=i.replace(/(^| )(\d [A-Z]{3,5} \d{4})/,"$10$2"),s&&(i=i+" ("+s),e.value!==i&&(e.value=i)}function show_submenu(e,t){var n=document.body.scrollWidth+document.documentElement.scrollLeft,o=document.getElementById(e);if(o&&o.style){document.all?n=document.body.offsetWidth:(n=document.body.scrollWidth+document.documentElement.scrollLeft-55,"rtl"===textDirection&&o.offsetLeft+o.offsetWidth+10);for(var a=0,l=o.childNodes.length,i=0;ia+5&&(a=r.offsetWidth)}o.offsetWidthn)){var d=n-o.offsetWidth;o.style.left=d+"px"}o.offsetLeft<0&&(o.style.left="0px"),o.offsetHeight>500&&(o.style.height="400px",o.style.overflow="auto"),o.style.visibility="visible"}clearTimeout(menutimeouts[e]),menutimeouts[e]=null}function hide_submenu(e){if("number"==typeof menutimeouts[e]){var t=document.getElementById(e);t&&t.style&&(t.style.visibility="hidden"),clearTimeout(menutimeouts[e]),menutimeouts[e]=null}}function timeout_submenu(e){"number"!=typeof menutimeouts[e]&&(menutimeouts[e]=setTimeout("hide_submenu('"+e+"')",100))}function statusDisable(e){var t=document.getElementById(e);t.checked=!1,t.disabled=!0}function statusEnable(e){document.getElementById(e).disabled=!1}function statusChecked(e){document.getElementById(e).checked=!0}function cal_setMonthNames(e,t,n,o,a,l,i,r,s,d,c,u){monthLabels[1]=e,monthLabels[2]=t,monthLabels[3]=n,monthLabels[4]=o,monthLabels[5]=a,monthLabels[6]=l,monthLabels[7]=i,monthLabels[8]=r,monthLabels[9]=s,monthLabels[10]=d,monthLabels[11]=c,monthLabels[12]=u}function cal_setDayHeaders(e,t,n,o,a,l,i){daysOfWeek[0]=e,daysOfWeek[1]=t,daysOfWeek[2]=n,daysOfWeek[3]=o,daysOfWeek[4]=a,daysOfWeek[5]=l,daysOfWeek[6]=i}function cal_setWeekStart(e){e>=0&&e<7&&(weekStart=e)}function calendarWidget(e,t){var n=document.getElementById(e),o=document.getElementById(t);if("visible"===n.style.visibility)return n.style.visibility="hidden",!1;if("show"===n.style.visibility)return n.style.visibility="hide",!1;var a,l=/((\d+ (JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) )?\d+)/i;return a=l.exec(o.value)?new Date(RegExp.$1):new Date,n.innerHTML=cal_generateSelectorContent(t,e,a),"hidden"===n.style.visibility?(n.style.visibility="visible",!1):"hide"===n.style.visibility&&(n.style.visibility="show",!1)}function cal_generateSelectorContent(e,t,n){var o,a,l='';for(l+='",l+='",l+='",l+='",l+="
',l+='',l+="",a=weekStart,o=0;o<7;o++)l+="";var i=new Date(n.getFullYear(),n.getMonth(),1),r=i.getDay();r-=weekStart;for(i=i.getTime()-864e5*r+432e5,i=new Date(i),a=0;a<6;a++){for(l+="",o=0;o<7;o++){l+="";var s=i.getTime()+864e5;i=new Date(s)}l+=""}return l+="
",++a>6&&(a=0);l+="
',l+=i.getDate(),l+="
",l+="
"}function cal_setDateField(e,t,n,o){var a=document.getElementById(e);return!!a&&(o<10&&(o="0"+o),a.value=o+" "+monthShort[n+1]+" "+t,!1)}function cal_updateCalendar(e,t){var n=document.getElementById(e+"_daySelect");if(!n)return!1;var o=document.getElementById(e+"_monSelect");if(!o)return!1;var a=document.getElementById(e+"_yearInput");if(!a)return!1;var l=parseInt(o.options[o.selectedIndex].value,10);l-=1;var i=new Date(a.value,l,n.options[n.selectedIndex].value);cal_setDateField(e,i.getFullYear(),i.getMonth(),i.getDate());var r=document.getElementById(t);return r?(r.innerHTML=cal_generateSelectorContent(e,t,i),!1):(alert("no dateDiv "+t),!1)}function cal_dateClicked(e,t,n,o,a){return cal_setDateField(e,n,o,a),calendarWidget(t,e),!1}function openerpasteid(e){window.opener.paste_id&&window.opener.paste_id(e),window.close()}function paste_id(e){pastefield.value=e}function pastename(e){nameElement&&(nameElement.innerHTML=e),remElement&&(remElement.style.display="block")}function paste_char(e){document.selection?(pastefield.focus(),document.selection.createRange().text=e):pastefield.selectionStart||0===pastefield.selectionStart?(pastefield.value=pastefield.value.substring(0,pastefield.selectionStart)+e+pastefield.value.substring(pastefield.selectionEnd,pastefield.value.length),pastefield.selectionStart=pastefield.selectionEnd=pastefield.selectionStart+e.length):pastefield.value+=e,"NPFX"!==pastefield.id&&"GIVN"!==pastefield.id&&"SPFX"!==pastefield.id&&"SURN"!==pastefield.id&&"NSFX"!==pastefield.id||updatewholename()}function ilinkitem(e,t,n){return n=void 0===n?WT_GEDCOM:n,window.open("inverselink.php?mediaid="+encodeURIComponent(e)+"&linkto="+encodeURIComponent(t)+"&ged="+encodeURIComponent(n),"_blank",find_window_specs),!1}function persistent_toggle(e,t){var n=document.getElementById(e),o=document.querySelectorAll(t),a=localStorage.getItem(e);if(n){""!==a&&(a="none"),n.checked=""===a;for(var l=0;l')}),$.fn.dataTableExt.oSort["text-asc"]=function(e,t){return e.localeCompare(t,document.documentElement.lang,{sensitivity:"base"})},$.fn.dataTableExt.oSort["text-desc"]=function(e,t){return t.localeCompare(e,document.documentElement.lang,{sensitivity:"base"})},$("table.datatables").each(function(){$(this).DataTable(),$(this).show()}),$(".wt-modal-create-record").on("show.bs.modal",function(e){$("form",$(this)).data("element-id",$(e.relatedTarget).data("element-id")),$("form .form-group input:first",$(this)).focus()}),$(".wt-modal-create-record form").on("submit",function(e){e.preventDefault();var t=$(this).data("element-id");alert(123),$.ajax({url:"index.php",type:"POST",data:new FormData(this),async:!1,cache:!1,contentType:!1,processData:!1,success:function(e){$("#"+t).select2().empty().append(new Option(e.text,e.id)).val(e.id).trigger("change")},failure:function(e){alert(e.error_message)}}),this.reset(),$(this).closest(".wt-modal-create-record").modal("hide")}),$(".menu-language").on("click","[data-language]",function(){return $.post("index.php",{route:"language",language:$(this).data("language")},function(){window.location.reload()}),!1}),$(".menu-theme").on("click","[data-theme]",function(){return $.post("index.php",{route:"theme",theme:$(this).data("theme")},function(){window.location.reload()}),!1});var e;$(".wt-osk-trigger").click(function(){e=document.getElementById($(this).data("id")),e.focus(),$(".wt-osk").show()}),$(document).on("focusin",":input",function(){e=this}),$(".wt-osk-script-button").change(function(){$(".wt-osk-script").prop("hidden",!0),$(".wt-osk-script-"+$(this).data("script")).prop("hidden",!1)}),$(".wt-osk-shift-button").click(function(){document.querySelector(".wt-osk-keys").classList.toggle("shifted")}),$(".wt-osk-keys").on("click",".wt-osk-key",function(){var t=$(this).contents().get(0).nodeValue,n=$(".wt-osk-shift-button").hasClass("active"),o=$("sup",this)[0];if(n&&void 0!==o&&(t=o.innerText),null!==e){var a=e.selectionStart,l=e.value,i=l.substring(0,a),r=l.substring(a,l.length);e.value=i+t+r,!1===$(".wt-osk-pin-button").hasClass("active")&&$(".wt-osk").hide()}})}); \ No newline at end of file -- cgit v1.3