diff --git a/VERSION b/VERSION index f712d85..337167b 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ latest 1 1.1 -1.1.11 +1.1.12 diff --git a/system/load/devjs/globals.js b/system/load/devjs/globals.js index 431628a..692d61e 100644 --- a/system/load/devjs/globals.js +++ b/system/load/devjs/globals.js @@ -225,8 +225,9 @@ function displayAsApp(){ border: 'none', 'box-shadow': 'none' }); - $('h1').css({ - 'font-size': '1.2em' + $('h1').first().css({ + 'font-size': '1.2em', + 'display': 'none' }); $('div.logout button#logout, div.logout span.small, div.footer a').css({ display: 'none' diff --git a/system/load/notes.min.js b/system/load/notes.min.js index d2be606..a1370db 100644 --- a/system/load/notes.min.js +++ b/system/load/notes.min.js @@ -1 +1 @@ -$(function(){loginsys(),isOpenedAsApp&&displayAsApp()});class OfflineManager{constructor(){null!==localStorage.getItem("notes_offline_storage")?this.data=JSON.parse(localStorage.getItem("notes_offline_storage")):this.data={},this.status=null}statusChanged(t){!0!==this.status&&null!==this.status||t||this.pushToServer(),this.status=t}saveNote(t,a,e){this.status&&(this.data[t]={content:a,name:e},this.saveLocalStorage())}saveLocalStorage(){localStorage.setItem("notes_offline_storage",JSON.stringify(this.data))}pushToServer(){if("{}"==JSON.stringify(this.data))this.data={},this.saveLocalStorage();else if(0==this.status){var t=this;$.each(this.data,function(a,e){ajax_request("view",{userid:userinformation.id,noteid:a,note:{name:e.name,cont:e.content}},function(e){if($("div.noteview div.loading").addClass("disable"),"okay"===e.status){if(4==e.data.length){var s=JSON.parse(localStorage.getItem("note_autosave_"+a));s.lastserverchanged=e.data[3],localStorage.setItem("note_autosave_"+a,JSON.stringify(s))}delete t.data[a],t.saveLocalStorage()}})})}}}class NotesEncrypter{constructor(){null!==localStorage.getItem("notes_encrypt_data")?this.data=JSON.parse(localStorage.getItem("notes_encrypt_data")):this.data={password:"",status:!1}}setNotesPassword(t){this.data.password=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(t+"bu79ubwqrzbIgbuwiw")),this.data.status=!0,this.saveLocalStorage()}requestForPassword(){this.data.status||errorMessage("Es ist kein Passwort zum Verschlüsseln von Notizen angegeben.",20)}encryptNote(t){return this.data.status?JSON.stringify(sjcl.encrypt(this.data.password,t)):t}decryptNote(t){return this.data.status?sjcl.decrypt(this.data.password,JSON.parse(t)):t}saveLocalStorage(){localStorage.setItem("notes_encrypt_data",JSON.stringify(this.data))}}var userinformation={name:null,id:null,admin:!1,authcode:null},errorMessageTimeOut=null,systemOfflineMode=!1,systemOfflineManager=new OfflineManager,systemEncrypter=new NotesEncrypter,systemRESTAPI=!1;function review(e){$("div.login").addClass("disable"),$("div.noteview").addClass("disable"),$("div.noteslist").addClass("disable"),$("div.globalloader").addClass("disable"),$("div."+e).removeClass("disable")}function errorMessage(e,o){null!==errorMessageTimeOut&&clearTimeout(errorMessageTimeOut),null===e?($("div.global.error.message").html("Fehler!"),$("div.global.error.message").addClass("disable")):(void 0===o&&(o=10),$("div.global.error.message").html(e),$("div.global.error.message").removeClass("disable"),!1!==o&&(errorMessageTimeOut=setTimeout(function(){$("div.global.error.message").addClass("disable")},1e3*o)))}function ajax_request(e,o,s,i){if(systemRESTAPI&&("share"!=e||"login"!=e)||"auth"==e){var a="rest";void 0!==o.authcode&&null!=o.authcode||(o.authcode=userinformation.authcode)}else{a="ajax";if($("input#usercookieok").length>0&&(!$("input#usercookieok").prop("checked")||!localStorage.hasOwnProperty("cookie")))return errorMessage("Es wird das Recht benötigt, Cookies abzulegen!",!1),void("function"==typeof i&&i())}$.post(domain+"/"+a+".php?"+e,o,function(e){"object"==typeof e?("error"===e.status?console.log(e.error):(systemOfflineMode&&$("div.global.error.message").off("click"),systemOfflineMode=!1,systemOfflineManager.statusChanged(!1),errorMessage(null)),"function"==typeof s&&s(e)):(errorMessage("Sever antwortet nicht korrekt!",!1),"function"==typeof i&&i(e))}).fail(function(){errorMessage("Offlinemodus",!1),$("div.global.error.message").click(()=>{errorMessage("Neu verbinden ...",!1),ajax_request("login",{status:userinformation.id},()=>{},()=>{errorMessage("Offlinemodus",!1)})}),systemOfflineMode=!0,systemOfflineManager.statusChanged(!0),"function"==typeof s&&s({data:{}})})}function confirmDialog(e,o,s){if(void 0===o)o={OK:function(){},Abbrechen:function(){}};if(void 0===s)s="Wichtig!";function i(e){$("div.globalDialog").html(e)}return $("div.globalDialog").removeClass("disable"),$("div.globalDialog").dialog({resizable:!1,height:"auto",width:"auto",minWidth:200,minHeight:150,modal:!0,title:s,close:function(){$("div.globalDialog").html(""),$("div.globalDialog").addClass("disable")},position:{my:"center",at:"center",of:$("div.main")},buttons:o}),i(e),i}let isOpenedAsApp="standalone"in window.navigator&&1==window.navigator.standalone||window.matchMedia("(display-mode: standalone)").matches||"?runningAsApp"===window.location.search;function displayAsApp(){$("body").css({background:"var(--as-app-color)"}),$("div.main").css({border:"none","box-shadow":"none"}),$("h1").css({"font-size":"1.2em"}),$("div.logout button#logout, div.logout span.small, div.footer a").css({display:"none"}),$("div.logout").css({height:"26px",width:"48px",position:"initial"}),$("div.logout").removeClass("box")}function loginsys(){if($("div.nojs.error.message").remove(),$("input#usercookieok").length>0){localStorage.hasOwnProperty("cookie")&&"allowed"==localStorage.getItem("cookie")&&$("input#usercookieok").prop("checked",!0);var e=$("input#usercookieok").prop("checked");$("input#usercookieok").click(()=>{e?localStorage.removeItem("cookie"):localStorage.setItem("cookie","allowed"),window.location.reload()})}function o(){var e=window.location.hash;if(""!=e)if(e=e.substr(1),new RegExp("[a-z]+:[a-z0-9]+").test(e)){var o=e.split(":"),n=o[0],t=o[1];console.log('Versuche User "'+n+'" mit Loginlink einzuloggen.'),$("div.login div.input div.loading").removeClass("disable"),ajax_request("auth",{username:n,authcode:t},function(o){$("div.login div.input div.loading").addClass("disable"),"okay"===o.status?(userinformation.name=n,userinformation.id=o.data.id,userinformation.admin=o.data.admin,userinformation.authcode=t,localStorage.setItem("userinformation_id",userinformation.id),localStorage.setItem("userinformation_name",userinformation.name),localStorage.setItem("userinformation_admin",userinformation.admin),localStorage.setItem("userinformation_authcode",userinformation.authcode),systemRESTAPI=!0,$("meta[name=application-url]").attr("content",$("meta[name=application-url]").attr("content")+"#"+e),a(),list()):i()})}else i();else i()}function i(){function e(){$("div.login div.input div.loading").removeClass("disable"),$("div.login div.input div#loginform").addClass("disable"),$("div.login p.message.important").addClass("disable");var e=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash($("input#userpassword").val()));ajax_request("login",{username:$("input#username").val(),password:e},function(e){$("div.login div.input div.loading").addClass("disable"),"error"===e.status?($("div.login p.message.error").removeClass("disable"),$("div.login div.input div#loginform").removeClass("disable")):"okay"===e.status&&($("div.login p.message.okay").removeClass("disable"),$("div.login p.message.error").addClass("disable"),$("div.login div.input").addClass("disable"),$("input#username").val(""),$("input#userpassword").val(""),userinformation.name=e.data.name,userinformation.id=e.data.id,userinformation.admin=e.data.admin,localStorage.setItem("userinformation_id",userinformation.id),localStorage.setItem("userinformation_name",userinformation.name),localStorage.setItem("userinformation_admin",userinformation.admin),a(),list())})}systemOfflineMode?($("div.login p.message.important.offline").removeClass("disable"),$("div.login p.message.important.online").addClass("disable"),$("div.login div.input div#loginform").addClass("disable"),$("div.login div.input").addClass("disable")):(ajax_request("login",{status:userinformation.id},function(e){systemOfflineMode&&i()}),$("div.login p.message.important.offline").addClass("disable"),$("div.login p.message.important.online").removeClass("disable")),$("div.login p.message.error").addClass("disable"),$("div.login p.message.okay").addClass("disable"),$("div.login div.input div.loading").addClass("disable"),systemOfflineMode||($("div.login div.input div#loginform").removeClass("disable"),$("div.login div.input").removeClass("disable"),$("button#userlogin").off("click").click(e),$("input#userpassword").off("keyup").keyup(function(o){13==o.keyCode&&e()}))}function a(){var e=null;function o(){systemOfflineMode||systemRESTAPI||ajax_request("login",{logout:null},function(e){"okay"===e.status&&($("p.message.error.loggedout").removeClass("disable"),setTimeout(function(){$("p.message.error.loggedout").addClass("disable")},2e4))}),0==$("input#logouttype:checked").length?localStorage.clear():(localStorage.removeItem("userinformation_id"),localStorage.removeItem("userinformation_name"),localStorage.removeItem("userinformation_authcode"),localStorage.removeItem("userinformation_admin")),userinformation={name:null,id:null,admin:!1,authcode:null},systemRESTAPI=!1,window.location.hash="",null!==e&&clearInterval(e),errorMessage(null),"undefined"!=typeof cm_editor&&cm_editor.setValue("empty"),["input#userpassword","input#username","input#notename","div#notespreview","textarea#notesinput","input#newnotename","div.listpart div.list"].forEach(function(e){$(e).empty(),"textarea#notesinput"!==e&&$(e).val("")}),$("div.logout").addClass("disable"),loginsys()}function i(){$("div.logout span.usertools").tooltip(),systemOfflineMode?($("div.logout span.usertools span.ui-icon-wrench").addClass("disable"),$("div.logout span.usertools span.ui-icon-person").addClass("disable")):(userinformation.admin?($("div.logout span.usertools span.ui-icon-wrench").removeClass("disable"),$("div.logout span.usertools span.ui-icon-wrench").off("click").click(function(){$.ajax({type:"GET",url:domain+"/load/backend."+jsdevmin+".js",success:function(){adminDialog()},dataType:"script",cache:!0})})):$("div.logout span.usertools span.ui-icon-wrench").addClass("disable"),$("div.logout span.usertools span.ui-icon-person").off("click").click(function(){authCodeManager()}))}$("div.logout").removeClass("disable"),$("button#logout").off("click").click(o),e=setInterval(function(){if(null!=localStorage.getItem("note_maker_reopen")&&"none"!=localStorage.getItem("note_maker_reopen")){var e=JSON.parse(localStorage.getItem("note_maker_reopen"));ajax_request("view",{userid:userinformation.id,noteid:e.noteid,history:4},function(o){if("error"===o.status)errorMessage("Die Session ist abgelaufen!",!1);else if(null!=JSON.parse(localStorage.getItem("note_autosave_"+e.noteid))){var i=JSON.parse(localStorage.getItem("note_autosave_"+e.noteid)).lastserverchanged;o.data-i>5&&newerNoteOnServerFound()}})}else systemRESTAPI||ajax_request("login",{status:userinformation.id},function(e){1!=e.data&&errorMessage("Die Session ist abgelaufen!",!1)})},1e3*global_polling_secs),i(),$(document).ajaxComplete(function e(){i(),$(document).off("ajaxComplete",e)})}!function(){review("globalloader");var e=window.location.hash;function n(){review("login"),""!=localStorage.getItem("userinformation_id")&&null!=localStorage.getItem("userinformation_id")&&""!=localStorage.getItem("userinformation_name")&&null!=localStorage.getItem("userinformation_name")?(userinformation.id=localStorage.getItem("userinformation_id"),userinformation.name=localStorage.getItem("userinformation_name"),userinformation.admin=JSON.parse(localStorage.getItem("userinformation_admin")),""!=localStorage.getItem("userinformation_authcode")&&null!=localStorage.getItem("userinformation_authcode")?(userinformation.authcode=localStorage.getItem("userinformation_authcode"),systemRESTAPI=!0,a(),list()):($("div.login div.input div.loading").removeClass("disable"),ajax_request("login",{status:userinformation.id},function(e){$("div.login div.input div.loading").addClass("disable"),systemOfflineMode?(a(),list()):1==e.data?(a(),list()):o()}))):systemOfflineMode?i():o()}""!=e?(e=e.substr(1),new RegExp("[^A-Za-z0-9]").test(e)?n():shareviewer(e,n)):n()}()}function list(){if(review("noteslist"),systemOfflineManager.pushToServer(),null!=localStorage.getItem("note_maker_reopen")&&"none"!=localStorage.getItem("note_maker_reopen")){var t=JSON.parse(localStorage.getItem("note_maker_reopen"));maker(t.noteid,t.name,void 0,void 0,t.enc)}function i(t){systemOfflineMode?$("div.toolbar").addClass("disable"):($("div.toolbar").removeClass("disable"),$("button#newnote").off("click").click(function(){var t=$("input#newnotename").val();""!=t&&function(t){$("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id,name:t,enc:!$("div.noteslist div.toolbar span.encrypt-note.ui-icon-locked").hasClass("disable")},function(i){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===i.status&&(console.log('Notiz: "'+t+'" ("'+i.data.id+'") angelegt.'),list())})}(t)}),$("button#notesarchive").off("click").click(function(){oldNotesManager()}));var i="",$("div.noteslist div.listpart div.list").html(i),$("li.noteslist_notesnames").tooltip(),$("div.noteslist div.listpart div.list ul li.noteslist_notesnames").css({"line-height":"28px"}),$("span.noteseditbuttons").css({float:"right",cursor:"pointer"}),list_first_load&&($(window).resize(()=>setTimeout(s,200)),list_first_load=!1),s(),setTimeout(s,300),$("div.noteslist div.listpart div.list ul li span.notesnames").off("click").click(function(){var t=$(this).parent().attr("noteid"),i=$(this).text(),s="true"===$(this).parent().attr("enc");console.log('Oeffne: "'+i+'" ("'+t+'")'),s&&(systemEncrypter.requestForPassword(),!systemEncrypter.data.status)||maker(t,i,void 0,void 0,s)}),systemOfflineMode?$("span.noteseditbuttons").addClass("disable"):($("span.noteseditbuttons").removeClass("disable"),$("span.noteseditbuttons button").off("click").click(function(){var t=$(this).attr("art"),i=$(this).parent().parent().attr("noteid");$("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id,art:t,noteid:i},function(s){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===s.status&&(console.log('Notiz: "'+i+'" wurde '+("del"==t?"gelöscht":"up"==t?"nach oben verschoben":"nach unten verschoben")),list())})})),$("div.noteslist div.toolbar span.encrypt-note").off("click").click(function(){$("div.noteslist div.toolbar span.encrypt-note").toggleClass("disable"),$("div.noteslist div.toolbar span.encrypt-note.ui-icon-locked").hasClass("disable")||systemEncrypter.requestForPassword()}),$("div.noteslist div.toolbar span.encrypt-note").tooltip()}!function(){systemOfflineMode?t():($("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id},function(s){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===s.status?(localStorage.setItem("note_list_notes",JSON.stringify(s.data)),i(s.data)):t()},t));function t(){$("div.noteslist div.listpart div.loading").addClass("disable"),null!=localStorage.getItem("note_list_notes")&&i(JSON.parse(localStorage.getItem("note_list_notes")))}}()}var list_first_load=!0;var cm_editor;function maker(e,t,a,i,n){if(void 0!==n&&!0===n||(n=!1),$("button#publishnote").prop("disabled",n),void 0===a){var o=!1,r=!1;localStorage.setItem("note_maker_reopen",JSON.stringify({noteid:e,name:t,enc:n}))}else{if("function"==typeof i)r=!0;else r=!1;o=!0}var d,s;review("noteview");var l,c,u=!1,g=!1;function f(){"object"==typeof cm_editor&&(cm_editor.off("change",l),cm_editor.off("change",c)),newerNoteOnServerFound=function(){}}function v(){s=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(d.content)),localStorage.setItem("note_autosave_"+d.id,JSON.stringify(d)),$("input#notename").val(d.name),$("textarea#notesinput").text(d.content),"object"!=typeof cm_editor?cm_editor=CodeMirror.fromTextArea(document.getElementById("notesinput"),{mode:"gfm",lineNumbers:!0,theme:"default"}):cm_editor.setValue($("textarea#notesinput").val()),function(){var e=new marked.Renderer;function t(e,t){var a=/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);if(a&&void 0!==t&&1===t.text.length&&/^[A-Z]$/.test(t.text[0])){var i=$(":focus");i.blur(),i.focus()}$("div#notespreview").html(marked(cm_editor.getValue())),$(".openothernote").off("click").click(function(){var e=$(this).attr("noteid");m(function(){f(),maker(e,"")})})}e.heading=function(e,t){return""+e+""},e.link=function(e,t,a){return''+a+""},e.text=function(e){return(e=e.replace(/@(([0-9a-zA-Z]{1,8})[0-9a-zA-Z]*)/g,'@$2')).replace(/:(\S+):/g,'')},e.checkbox=function(e){return e?' ':' '},marked.setOptions({renderer:e,gfm:!0,tables:!0,smartLists:!0,smartypants:!0,highlight:function(e,t){if("tex"!=t)return-1!==["markup","css","clike","javascript","c","bash","cpp","csharp","ruby","git","ini","java","json","lua","markdown","matlab","objectivec","perl","php","python","r","sql","swift"].indexOf(t)?Prism.highlight(e,Prism.languages[t]):e;try{return katex.renderToString(e)}catch(e){return''+e.message+""}}}),t(),o&&!r?$("div.input.box").addClass("disable"):($("div.input.box").removeClass("disable"),cm_editor.on("change",t));l=t}(),function(){function e(){var e=Date.now()-3e4>h,t={name:$("input#notename").val(),id:d.id,content:cm_editor.getValue(),lastserverchanged:d.lastserverchanged};localStorage.setItem("note_autosave_"+d.id,JSON.stringify(t)),e?m():($("span.noteunsaved").removeClass("disable"),$("span.notesaved").addClass("disable"))}$("span.noteunsaved").tooltip(),$("span.notesaved").tooltip(),g&&(e(),g=!1);cm_editor.on("change",e),c=e,$("span.noteunsaved").off("click").click(m)}()}var h=0;function m(a){if(s!=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(cm_editor.getValue()))||g){function l(){if(o&&r)h=Date.now(),i(cm_editor.getValue(),!1);else if(!1===o)if(systemOfflineMode)systemOfflineManager.saveNote(e,cm_editor.getValue(),$("input#notename").val()),h=Date.now(),"function"==typeof a&&a(!0);else{$("div.noteview div.loading").removeClass("disable");var s=cm_editor.getValue();n&&(s=systemEncrypter.encryptNote(s)),ajax_request("view",{userid:userinformation.id,noteid:e,note:{name:$("input#notename").val(),cont:s}},function(i){if($("div.noteview div.loading").addClass("disable"),"okay"===i.status){if(console.log('Notiz: "'+t+'" ("'+e+'") auf Server gespeichert.'),h=Date.now(),4==i.data.length){d.lastserverchanged=i.data[3];var n=JSON.parse(localStorage.getItem("note_autosave_"+e));n.lastserverchanged=i.data[3],localStorage.setItem("note_autosave_"+e,JSON.stringify(n))}$("span.notesaved").removeClass("disable"),$("span.noteunsaved").addClass("disable")}"function"==typeof a&&a("okay"===i.status)},function(e){"function"==typeof a&&a(!1)})}}u?($("body").append('
Beim Speichern der Notiz kann es eventuell zu Datenverlust kommen, da die aktuellste Version nicht vom Server geladen werden konnte!
'),$("#dangerMessageNoteSave").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Gefahr des Datenverlustes!",buttons:{"Trotzdem Speichern":function(){$(this).dialog("close"),u=!1,l()},"Erstmal nicht":function(){$(this).dialog("close")}},close:function(){$(this).remove()}})):l()}else"function"==typeof a&&a(!0)}function b(){function t(){errorMessage("Freigaben konnten nicht geladen werden."),$("div.noteview div.loading").addClass("disable")}$("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e},function(a){if("okay"===a.status){var i='
Konnte Aktion nicht durchführen.
',n=!1;$.each(a.data,function(e,t){n=!0,i+='',i+="",i+="",i+='",i+="",i+=''}),i+="
LinkNameErstelltBearbeitenLetzter Aufruf (Anzahl)Löschen
Aufrufen "+t.name+""+t.created+"'+t.edit+""+t.lastAccessed+" ("+t.accesses+")
",!1===n&&(i+="

Noch keine Freigaben!

"),i+='

Neue Freigabe


Bearbeiten erlauben Nur lesen
',$("body").append('
'+i+"
"),$("div.noteview div.loading").addClass("disable"),$("div#freigabeManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Freigaben",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),$("button.deleteFreigabe").click(function(){var t=$(this).attr("authcode");$("div.freigabeDialog.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,share:{authcode:t,edit:"leer",name:"leer"}},function(e){"okay"===e.status?($("div#freigabeManagerDialog").dialog("close"),b()):($("div.freigabeDialog.loading").addClass("disable"),$("div.freigabeDialog.error").removeClass("disable"))})}),$("button#addFreigabe").click(function(){var t=$("input#freigabeManagerNewName").val(),a="true"==$("input#freigabeManagerNewEdit:checked").val();""!=t&&($("div.freigabeDialog.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,share:{authcode:"leer",edit:a,name:t}},function(e){"okay"===e.status?($("div#freigabeManagerDialog").dialog("close"),b()):($("div.freigabeDialog.loading").addClass("disable"),$("div.freigabeDialog.error").removeClass("disable"))}))}),$("button.freigabeQR").click(function(){var e=$(this).attr("authcode"),t=domain+"/#"+e,a='

Code: '+e+'

URL:

Link: Aufrufen

';$("body").append('
'+a+"
"),$("div#freigabeManagerQRDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Freigabelink",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),new QRCode(document.getElementById("freigabeManagerQR"),t)})}else t()},t)}function p(){function t(){errorMessage("Notizverlauf konnte nicht geladen werden."),$("div.noteview div.loading").addClass("disable")}$("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,history:3},function(e){if("okay"===e.status){var a="";$.each(e.data,function(e,t){a+="",a+="'}),a+="
ÄnderungenZeitpunkt
"+(n?"Kein Diff. bei verschlüsselten Notizen!":t.diff)+""+t.time+'
",$("body").append('
'+a+"
"),$("div.noteview div.loading").addClass("disable"),$("div#historyManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Notizverlauf",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),$("button.takeInputFromHistory").click(function(){var t=$(this).attr("key"),a=e.data[t].text;if(n)try{a=systemEncrypter.decryptNote(a)}catch(e){return void setTimeout(()=>{errorMessage("Kann Verlauf nicht entschlüsseln!",10)},200)}cm_editor.setValue(a),$("div#historyManagerDialog").dialog("close")})}else t()},t)}!function(){function i(a,i){a||systemOfflineMode||(u=!0,errorMessage("Kann die aktuelle Version der Notiz nicht vom Server holen.",20)),null!=localStorage.getItem("note_autosave_"+e)?(d=JSON.parse(localStorage.getItem("note_autosave_"+e)),v()):systemOfflineMode?(confirmDialog("Die gewählte Notiz ist auf diesem Gerät leider nicht offline verfügbar!",{OK:function(){$(this).dialog("close")}},"Offlinemodus"),list()):(d={name:t,id:e,content:"# "+t+"\nUnd hier dann der Text!!\n",lastserverchanged:void 0!==i?i:0},v())}o?(d={name:t,id:e,content:a.content,lastserverchanged:a.lastchanged},$("div.noteview div.loading").addClass("disable"),v()):systemOfflineMode?($("div.noteview div.loading").addClass("disable"),i(!1)):($("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,history:2},function(e){if($("div.noteview div.loading").addClass("disable"),"okay"===e.status)if(g=e.data.empty,e.data.empty)i(!0,e.data.geandert);else{var t=e.data.content;if(n)try{t=systemEncrypter.decryptNote(e.data.content)}catch(e){localStorage.setItem("note_maker_reopen","none"),f(),list(),setTimeout(()=>{errorMessage("Kann Notiz nicht entschlüsseln!",10)},200)}d={name:e.data.name,id:e.data.id,content:t,lastserverchanged:e.data.geandert},v()}else i(!1)},function(e){i(!1)}))}(),$("button#closenote").off("click").click(function(){f(),o&&r?i(cm_editor.getValue(),!0):o?(window.location.hash="",loginsys()):!1===o&&m(function(e){e?(localStorage.setItem("note_maker_reopen","none"),list()):($("body").append('
Die Speicherung der Notiz auf dem Server schlug fehl!
Wollen Sie den Editor verlassen und einen Verlust der Änderungen in Kauf nehmen oder abbrechen?
'),$("#errorMessageNoteSave").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Fehler beim Speichern!",buttons:{"Änderungen verwerfen":function(){localStorage.setItem("note_maker_reopen","none"),list(),$(this).dialog("close")},Abbrechen:function(){$(this).dialog("close")}},close:function(){$(this).remove()}}))})}),o||systemOfflineMode?($("button#publishnote").addClass("disable"),$("button#notehistory").addClass("disable")):($("button#publishnote").removeClass("disable"),$("button#notehistory").removeClass("disable"),$("button#publishnote").off("click").click(b),$("button#notehistory").off("click").click(p)),newerNoteOnServerFound=function(){!0,s==sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(cm_editor.getValue()))?(f(),maker(e,t)):(u=!0,confirmDialog("

Die Notiz ist auf dem Server verändert worden.
Wollen Sie die neue Version laden?

Dadurch können Ihre Änderungen verloren gehen! Andernfalls die Änderungen auf dem Server.

",{Ja:function(){f(),maker(e,t),!1,$(this).dialog("close")},Nein:function(){u=!1,m(),!1,$(this).dialog("close")}},"Änderung auf Server"))}}var newerNoteOnServerFound=function(){};function authCodeManager(){function e(e){$("div#authCodeManagerDialog").html(e)}function n(n){var a='

Authentifizierungslinks

';function t(e,n){var s=!1;if($("span#newPasswordAIndikator").css({color:"white"}),""==e&&($("span#newPasswordAIndikator").css({"background-color":"inherit"}),$("span#newPasswordAIndikator").text("Bitte geben Sie ein Passwort ein!"),s=!0),""==n&&($("span#newPasswordBIndikator").css({"background-color":"inherit"}),$("span#newPasswordBIndikator").text("Bitte geben Sie das Passwort ein!"),s=!0),""!=e){var a,t=e,o=e.length,i=0;o>5?((i+=5*(o-=5))>20&&(i=20),t.match(/([a-zA-Z])/)&&(i+=10),t.match(/([A-Z])/)&&(i+=5),t.match(/([0-9])/)&&(i+=5),t.match(/([0-9].*[0-9])/)&&(i+=10),t.match(/([0-9].*[0-9].*[0-9])/)&&(i+=10),t.match(/([!,%,&,@,#,*,?,_,])/)&&(i+=15),t.match(/([!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,])/)&&(i+=15),t.match(/([!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,])/)&&(i+=15)):i=0,i<=25?(a="Das soll ein Passwort sein?",$("span#newPasswordAIndikator").css({"background-color":"red"})):i<=50?(a="Gut, aber es geht noch besser!",$("span#newPasswordAIndikator").css({"background-color":"orange"}),$("span#newPasswordAIndikator").css({color:"black"})):i<=75?(a="Das sieht doch super aus!",$("span#newPasswordAIndikator").css({"background-color":"yellow"}),$("span#newPasswordAIndikator").css({color:"black"})):i<=100&&(a="Da werden die Hacker schwitzen!",$("span#newPasswordAIndikator").css({"background-color":"green"})),$("span#newPasswordAIndikator").text(a)}return e!=n&&""!=e&&""!=n&&($("span#newPasswordBIndikator").css({"background-color":"red"}),$("span#newPasswordBIndikator").text("Die Passwörter stimmen nicht überein!"),s=!0),!s&&($("span#newPasswordBIndikator").css({"background-color":"green"}),$("span#newPasswordBIndikator").text("Passwörter stimmen überein!"),!0)}!1!==n?(a+="",n.forEach(function(e){a+=''}),a+="
Code (Anfang)Letzte NutzungLöschen
'+e.code+""+e.time+'
"):a+="

Sie haben noch keine Authentifizierungslinks!

",a+='

 

',a+='

Passwort ändern

Bitte geben Sie ein Passwort ein!
Bitte geben Sie das Passwort ein!
',e(a+='

Passwort zur Verschlüsselung von Notizen

Bitte geben Sie ein Passwort zur Verschlüsselung der Notizen ein!
'),$("button#newPasswordSet").prop("disabled",!0),$("span.newPasswordIndikator").css({"border-radius":"5px",padding:"2px"}),$("button#newPasswordSet").click(function(){var e=$("input#newPasswordA").val(),n=$("input#newPasswordB").val();if(!t(e,n))return!1;$("div#newPasswordLoader").removeClass("disable"),ajax_request("account",{userid:userinformation.id},function(n){if("okay"===n.status){var s=n.data,a=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(e));a=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(a+"+"+s)),ajax_request("account",{userid:userinformation.id,newpass:a,salt:s},function(e){$("div#newPasswordLoader").addClass("disable"),"okay"===e.status?($("div#newPasswordDone").removeClass("disable error"),$("div#newPasswordDone").addClass("okay"),$("div#newPasswordDone").text("Passwort geändert!")):($("div#newPasswordDone").removeClass("disable okay"),$("div#newPasswordDone").addClass("error"),$("div#newPasswordDone").text("Konnte Passwort nicht ändern!"))})}else $("div#newPasswordLoader").addClass("disable"),$("div#newPasswordDone").removeClass("disable okay"),$("div#newPasswordDone").addClass("error"),$("div#newPasswordDone").text("Konnte Passwort nicht ändern!")})}),$("input.newPassword").on("keyup",function(){t($("input#newPasswordA").val(),$("input#newPasswordB").val())?$("button#newPasswordSet").prop("disabled",!1):$("button#newPasswordSet").prop("disabled",!0)}),$("input.noteEncPassw").on("keyup",function(){$("button#noteEncPasswSet").prop("disabled",$("input.noteEncPassw").val().length<4)}),$("button#noteEncPasswSet").click(function(){systemEncrypter.setNotesPassword($("input.noteEncPassw").val()),$("button#noteEncPasswSet").prop("disabled",!0)}),$("button.deleteAuthLink").click(function(){var e=$(this).attr("linkid"),n=$(this).attr("codeteil");confirm('Wollen sie den Code "'+n+'" wirklich löschen? ')&&($("div#authLinkLoading").removeClass("disable"),ajax_request("account",{userid:userinformation.id,art:"del",id:e},function(e){$("div#authLinkLoading").addClass("disable"),"okay"===e.status?s():alert("Konnte den Code nicht löschen!")}))}),$("button#addAuthLink").click(function(){$("div#authLinkLoading").removeClass("disable"),ajax_request("account",{userid:userinformation.id,art:"new",id:"new"},function(e){$("div#authLinkLoading").addClass("disable"),"okay"===e.status?(!function(e){var n=domain+"/#"+userinformation.name+":"+e;$("meta[name=application-url]").attr("content",$("meta[name=application-url]").attr("content")+"#"+userinformation.name+":"+e);var s='

Neuer Authentifizierungslink wurde erstellt:

Code: '+e+'

URL:

Link: Aufrufen

Achtung: Dieser Link und Code wird nur ein einziges Mal angezeigt!!

';$("body").append('
'+s+"
"),$("div#authCodeManagerNewCodeDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Neuer Authentifizierungslink",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),new QRCode(document.getElementById("authCodeManagerNewCodeDialogQR"),n)}(e.data),s()):alert("Konnte keinen Code erstellen!")})})}function s(){ajax_request("account",{userid:userinformation.id,art:"list",id:"list"},function(s){"okay"===s.status?n(s.data):e("Kann nicht laden!")})}$("body").append('
Lädt ...
'),$("div#authCodeManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Authentifizierungslinks und Passwort",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),s()}function oldNotesManager(){function t(t){t='
'+t,$("div#oldNotesDialog").html(t)}$("body").append('
'),$("div#oldNotesDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Notizarchiv",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),t("Lädt ..."),$("div#oldNotesDialogLoader").removeClass("disable"),ajax_request("list",{userid:userinformation.id,reload:"none"},function(o){if($("div#oldNotesDialogLoader").addClass("disable"),"okay"===o.status){var e="";o.data.forEach(function(t){e+="'}),t(e+="
NameZuletzt geändertWiederherstellen
"+t.name+""+t.geaendert+'
"),$("button.oldNotesDialogReload").click(function(){var t=$(this).attr("noteid");$("div#oldNotesDialogLoader").removeClass("disable"),ajax_request("list",{userid:userinformation.id,reload:t},function(t){$("div#oldNotesDialogLoader").addClass("disable"),"okay"===t.status?(list(),$("div#oldNotesDialog").dialog("close")):alert("Konnte die Notiz nicht wiederherstellen!")})})}else t("Konnte nicht laden!!")})}function shareviewer(e,n){var a,t=0,i=!1;function s(){ajax_request("share",{authcode:e},function(n){systemOfflineMode?(errorMessage("Offline können keine Freigaben geöffnet werden!"),r()):"okay"===n.status?(t=n.data.geandert,i=n.data.edit,n.data.edit?(maker(n.data.id,n.data.name,{content:n.data.content,lastchanged:n.data.geandert},function(n,i){function s(e){i&&(e&&!confirm("Konnte nicht Notiz speichern, trotzdem schließen?")||(clearInterval(a),window.location.hash="",loginsys()))}$("div.noteview div.loading").removeClass("disable"),ajax_request("share",{authcode:e,cont:n},function(e){$("div.noteview div.loading").addClass("disable"),t=e.data[3],"okay"===e.status?($("span.notesaved").removeClass("disable"),$("span.noteunsaved").addClass("disable")):errorMessage("Konnte Notiz nicht speichern!"),s(!("okay"===e.status))},function(e){$("div.noteview div.loading").addClass("disable"),errorMessage("Konnte Notiz nicht speichern!"),s(!0)})}),o()):(maker(n.data.id,n.data.name,{content:n.data.content,lastchanged:n.data.geandert}),o())):(errorMessage("Nachricht lässt sich mittels Freigabelink nicht öffnen.",!1),r())},function(e){r()})}function r(){"function"==typeof n&&n()}function o(){a=setInterval(function(){ajax_request("share",{authcode:e},function(e){"error"===e.status?errorMessage("Die Freigabe kann nichtmehr erreicht werden",!1):(console.log(e.data.geandert-t,e.data.geandert,t),e.data.geandert-t>5&&(clearInterval(a),i?confirmDialog("

Die Notiz ist auf dem Server verändert worden.
Wollen Sie die neue Version laden?

Dadurch können Ihre Änderungen verloren gehen!

",{Ja:function(){s(),$(this).dialog("close")},Abbrechen:function(){$(this).dialog("close")}},"Änderung auf Server"):s()))})},1e3*global_polling_secs)}systemRESTAPI=!1,s()} \ No newline at end of file +$(function(){loginsys(),isOpenedAsApp&&displayAsApp()});class OfflineManager{constructor(){null!==localStorage.getItem("notes_offline_storage")?this.data=JSON.parse(localStorage.getItem("notes_offline_storage")):this.data={},this.status=null}statusChanged(t){!0!==this.status&&null!==this.status||t||this.pushToServer(),this.status=t}saveNote(t,a,e){this.status&&(this.data[t]={content:a,name:e},this.saveLocalStorage())}saveLocalStorage(){localStorage.setItem("notes_offline_storage",JSON.stringify(this.data))}pushToServer(){if("{}"==JSON.stringify(this.data))this.data={},this.saveLocalStorage();else if(0==this.status){var t=this;$.each(this.data,function(a,e){ajax_request("view",{userid:userinformation.id,noteid:a,note:{name:e.name,cont:e.content}},function(e){if($("div.noteview div.loading").addClass("disable"),"okay"===e.status){if(4==e.data.length){var s=JSON.parse(localStorage.getItem("note_autosave_"+a));s.lastserverchanged=e.data[3],localStorage.setItem("note_autosave_"+a,JSON.stringify(s))}delete t.data[a],t.saveLocalStorage()}})})}}}class NotesEncrypter{constructor(){null!==localStorage.getItem("notes_encrypt_data")?this.data=JSON.parse(localStorage.getItem("notes_encrypt_data")):this.data={password:"",status:!1}}setNotesPassword(t){this.data.password=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(t+"bu79ubwqrzbIgbuwiw")),this.data.status=!0,this.saveLocalStorage()}requestForPassword(){this.data.status||errorMessage("Es ist kein Passwort zum Verschlüsseln von Notizen angegeben.",20)}encryptNote(t){return this.data.status?JSON.stringify(sjcl.encrypt(this.data.password,t)):t}decryptNote(t){return this.data.status?sjcl.decrypt(this.data.password,JSON.parse(t)):t}saveLocalStorage(){localStorage.setItem("notes_encrypt_data",JSON.stringify(this.data))}}var userinformation={name:null,id:null,admin:!1,authcode:null},errorMessageTimeOut=null,systemOfflineMode=!1,systemOfflineManager=new OfflineManager,systemEncrypter=new NotesEncrypter,systemRESTAPI=!1;function review(e){$("div.login").addClass("disable"),$("div.noteview").addClass("disable"),$("div.noteslist").addClass("disable"),$("div.globalloader").addClass("disable"),$("div."+e).removeClass("disable")}function errorMessage(e,o){null!==errorMessageTimeOut&&clearTimeout(errorMessageTimeOut),null===e?($("div.global.error.message").html("Fehler!"),$("div.global.error.message").addClass("disable")):(void 0===o&&(o=10),$("div.global.error.message").html(e),$("div.global.error.message").removeClass("disable"),!1!==o&&(errorMessageTimeOut=setTimeout(function(){$("div.global.error.message").addClass("disable")},1e3*o)))}function ajax_request(e,o,s,i){if(systemRESTAPI&&("share"!=e||"login"!=e)||"auth"==e){var a="rest";void 0!==o.authcode&&null!=o.authcode||(o.authcode=userinformation.authcode)}else{a="ajax";if($("input#usercookieok").length>0&&(!$("input#usercookieok").prop("checked")||!localStorage.hasOwnProperty("cookie")))return errorMessage("Es wird das Recht benötigt, Cookies abzulegen!",!1),void("function"==typeof i&&i())}$.post(domain+"/"+a+".php?"+e,o,function(e){"object"==typeof e?("error"===e.status?console.log(e.error):(systemOfflineMode&&$("div.global.error.message").off("click"),systemOfflineMode=!1,systemOfflineManager.statusChanged(!1),errorMessage(null)),"function"==typeof s&&s(e)):(errorMessage("Sever antwortet nicht korrekt!",!1),"function"==typeof i&&i(e))}).fail(function(){errorMessage("Offlinemodus",!1),$("div.global.error.message").click(()=>{errorMessage("Neu verbinden ...",!1),ajax_request("login",{status:userinformation.id},()=>{},()=>{errorMessage("Offlinemodus",!1)})}),systemOfflineMode=!0,systemOfflineManager.statusChanged(!0),"function"==typeof s&&s({data:{}})})}function confirmDialog(e,o,s){if(void 0===o)o={OK:function(){},Abbrechen:function(){}};if(void 0===s)s="Wichtig!";function i(e){$("div.globalDialog").html(e)}return $("div.globalDialog").removeClass("disable"),$("div.globalDialog").dialog({resizable:!1,height:"auto",width:"auto",minWidth:200,minHeight:150,modal:!0,title:s,close:function(){$("div.globalDialog").html(""),$("div.globalDialog").addClass("disable")},position:{my:"center",at:"center",of:$("div.main")},buttons:o}),i(e),i}let isOpenedAsApp="standalone"in window.navigator&&1==window.navigator.standalone||window.matchMedia("(display-mode: standalone)").matches||"?runningAsApp"===window.location.search;function displayAsApp(){$("body").css({background:"var(--as-app-color)"}),$("div.main").css({border:"none","box-shadow":"none"}),$("h1").first().css({"font-size":"1.2em",display:"none"}),$("div.logout button#logout, div.logout span.small, div.footer a").css({display:"none"}),$("div.logout").css({height:"26px",width:"48px",position:"initial"}),$("div.logout").removeClass("box")}function loginsys(){if($("div.nojs.error.message").remove(),$("input#usercookieok").length>0){localStorage.hasOwnProperty("cookie")&&"allowed"==localStorage.getItem("cookie")&&$("input#usercookieok").prop("checked",!0);var e=$("input#usercookieok").prop("checked");$("input#usercookieok").click(()=>{e?localStorage.removeItem("cookie"):localStorage.setItem("cookie","allowed"),window.location.reload()})}function o(){var e=window.location.hash;if(""!=e)if(e=e.substr(1),new RegExp("[a-z]+:[a-z0-9]+").test(e)){var o=e.split(":"),n=o[0],t=o[1];console.log('Versuche User "'+n+'" mit Loginlink einzuloggen.'),$("div.login div.input div.loading").removeClass("disable"),ajax_request("auth",{username:n,authcode:t},function(o){$("div.login div.input div.loading").addClass("disable"),"okay"===o.status?(userinformation.name=n,userinformation.id=o.data.id,userinformation.admin=o.data.admin,userinformation.authcode=t,localStorage.setItem("userinformation_id",userinformation.id),localStorage.setItem("userinformation_name",userinformation.name),localStorage.setItem("userinformation_admin",userinformation.admin),localStorage.setItem("userinformation_authcode",userinformation.authcode),systemRESTAPI=!0,$("meta[name=application-url]").attr("content",$("meta[name=application-url]").attr("content")+"#"+e),a(),list()):i()})}else i();else i()}function i(){function e(){$("div.login div.input div.loading").removeClass("disable"),$("div.login div.input div#loginform").addClass("disable"),$("div.login p.message.important").addClass("disable");var e=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash($("input#userpassword").val()));ajax_request("login",{username:$("input#username").val(),password:e},function(e){$("div.login div.input div.loading").addClass("disable"),"error"===e.status?($("div.login p.message.error").removeClass("disable"),$("div.login div.input div#loginform").removeClass("disable")):"okay"===e.status&&($("div.login p.message.okay").removeClass("disable"),$("div.login p.message.error").addClass("disable"),$("div.login div.input").addClass("disable"),$("input#username").val(""),$("input#userpassword").val(""),userinformation.name=e.data.name,userinformation.id=e.data.id,userinformation.admin=e.data.admin,localStorage.setItem("userinformation_id",userinformation.id),localStorage.setItem("userinformation_name",userinformation.name),localStorage.setItem("userinformation_admin",userinformation.admin),a(),list())})}systemOfflineMode?($("div.login p.message.important.offline").removeClass("disable"),$("div.login p.message.important.online").addClass("disable"),$("div.login div.input div#loginform").addClass("disable"),$("div.login div.input").addClass("disable")):(ajax_request("login",{status:userinformation.id},function(e){systemOfflineMode&&i()}),$("div.login p.message.important.offline").addClass("disable"),$("div.login p.message.important.online").removeClass("disable")),$("div.login p.message.error").addClass("disable"),$("div.login p.message.okay").addClass("disable"),$("div.login div.input div.loading").addClass("disable"),systemOfflineMode||($("div.login div.input div#loginform").removeClass("disable"),$("div.login div.input").removeClass("disable"),$("button#userlogin").off("click").click(e),$("input#userpassword").off("keyup").keyup(function(o){13==o.keyCode&&e()}))}function a(){var e=null;function o(){systemOfflineMode||systemRESTAPI||ajax_request("login",{logout:null},function(e){"okay"===e.status&&($("p.message.error.loggedout").removeClass("disable"),setTimeout(function(){$("p.message.error.loggedout").addClass("disable")},2e4))}),0==$("input#logouttype:checked").length?localStorage.clear():(localStorage.removeItem("userinformation_id"),localStorage.removeItem("userinformation_name"),localStorage.removeItem("userinformation_authcode"),localStorage.removeItem("userinformation_admin")),userinformation={name:null,id:null,admin:!1,authcode:null},systemRESTAPI=!1,window.location.hash="",null!==e&&clearInterval(e),errorMessage(null),"undefined"!=typeof cm_editor&&cm_editor.setValue("empty"),["input#userpassword","input#username","input#notename","div#notespreview","textarea#notesinput","input#newnotename","div.listpart div.list"].forEach(function(e){$(e).empty(),"textarea#notesinput"!==e&&$(e).val("")}),$("div.logout").addClass("disable"),loginsys()}function i(){$("div.logout span.usertools").tooltip(),systemOfflineMode?($("div.logout span.usertools span.ui-icon-wrench").addClass("disable"),$("div.logout span.usertools span.ui-icon-person").addClass("disable")):(userinformation.admin?($("div.logout span.usertools span.ui-icon-wrench").removeClass("disable"),$("div.logout span.usertools span.ui-icon-wrench").off("click").click(function(){$.ajax({type:"GET",url:domain+"/load/backend."+jsdevmin+".js",success:function(){adminDialog()},dataType:"script",cache:!0})})):$("div.logout span.usertools span.ui-icon-wrench").addClass("disable"),$("div.logout span.usertools span.ui-icon-person").off("click").click(function(){authCodeManager()}))}$("div.logout").removeClass("disable"),$("button#logout").off("click").click(o),e=setInterval(function(){if(null!=localStorage.getItem("note_maker_reopen")&&"none"!=localStorage.getItem("note_maker_reopen")){var e=JSON.parse(localStorage.getItem("note_maker_reopen"));ajax_request("view",{userid:userinformation.id,noteid:e.noteid,history:4},function(o){if("error"===o.status)errorMessage("Die Session ist abgelaufen!",!1);else if(null!=JSON.parse(localStorage.getItem("note_autosave_"+e.noteid))){var i=JSON.parse(localStorage.getItem("note_autosave_"+e.noteid)).lastserverchanged;o.data-i>5&&newerNoteOnServerFound()}})}else systemRESTAPI||ajax_request("login",{status:userinformation.id},function(e){1!=e.data&&errorMessage("Die Session ist abgelaufen!",!1)})},1e3*global_polling_secs),i(),$(document).ajaxComplete(function e(){i(),$(document).off("ajaxComplete",e)})}!function(){review("globalloader");var e=window.location.hash;function n(){review("login"),""!=localStorage.getItem("userinformation_id")&&null!=localStorage.getItem("userinformation_id")&&""!=localStorage.getItem("userinformation_name")&&null!=localStorage.getItem("userinformation_name")?(userinformation.id=localStorage.getItem("userinformation_id"),userinformation.name=localStorage.getItem("userinformation_name"),userinformation.admin=JSON.parse(localStorage.getItem("userinformation_admin")),""!=localStorage.getItem("userinformation_authcode")&&null!=localStorage.getItem("userinformation_authcode")?(userinformation.authcode=localStorage.getItem("userinformation_authcode"),systemRESTAPI=!0,a(),list()):($("div.login div.input div.loading").removeClass("disable"),ajax_request("login",{status:userinformation.id},function(e){$("div.login div.input div.loading").addClass("disable"),systemOfflineMode?(a(),list()):1==e.data?(a(),list()):o()}))):systemOfflineMode?i():o()}""!=e?(e=e.substr(1),new RegExp("[^A-Za-z0-9]").test(e)?n():shareviewer(e,n)):n()}()}function list(){if(review("noteslist"),systemOfflineManager.pushToServer(),null!=localStorage.getItem("note_maker_reopen")&&"none"!=localStorage.getItem("note_maker_reopen")){var t=JSON.parse(localStorage.getItem("note_maker_reopen"));maker(t.noteid,t.name,void 0,void 0,t.enc)}function i(t){systemOfflineMode?$("div.toolbar").addClass("disable"):($("div.toolbar").removeClass("disable"),$("button#newnote").off("click").click(function(){var t=$("input#newnotename").val();""!=t&&function(t){$("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id,name:t,enc:!$("div.noteslist div.toolbar span.encrypt-note.ui-icon-locked").hasClass("disable")},function(i){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===i.status&&(console.log('Notiz: "'+t+'" ("'+i.data.id+'") angelegt.'),list())})}(t)}),$("button#notesarchive").off("click").click(function(){oldNotesManager()}));var i="",$("div.noteslist div.listpart div.list").html(i),$("li.noteslist_notesnames").tooltip(),$("div.noteslist div.listpart div.list ul li.noteslist_notesnames").css({"line-height":"28px"}),$("span.noteseditbuttons").css({float:"right",cursor:"pointer"}),list_first_load&&($(window).resize(()=>setTimeout(s,200)),list_first_load=!1),s(),setTimeout(s,300),$("div.noteslist div.listpart div.list ul li span.notesnames").off("click").click(function(){var t=$(this).parent().attr("noteid"),i=$(this).text(),s="true"===$(this).parent().attr("enc");console.log('Oeffne: "'+i+'" ("'+t+'")'),s&&(systemEncrypter.requestForPassword(),!systemEncrypter.data.status)||maker(t,i,void 0,void 0,s)}),systemOfflineMode?$("span.noteseditbuttons").addClass("disable"):($("span.noteseditbuttons").removeClass("disable"),$("span.noteseditbuttons button").off("click").click(function(){var t=$(this).attr("art"),i=$(this).parent().parent().attr("noteid");$("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id,art:t,noteid:i},function(s){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===s.status&&(console.log('Notiz: "'+i+'" wurde '+("del"==t?"gelöscht":"up"==t?"nach oben verschoben":"nach unten verschoben")),list())})})),$("div.noteslist div.toolbar span.encrypt-note").off("click").click(function(){$("div.noteslist div.toolbar span.encrypt-note").toggleClass("disable"),$("div.noteslist div.toolbar span.encrypt-note.ui-icon-locked").hasClass("disable")||systemEncrypter.requestForPassword()}),$("div.noteslist div.toolbar span.encrypt-note").tooltip()}!function(){systemOfflineMode?t():($("div.noteslist div.listpart div.loading").removeClass("disable"),ajax_request("list",{userid:userinformation.id},function(s){$("div.noteslist div.listpart div.loading").addClass("disable"),"okay"===s.status?(localStorage.setItem("note_list_notes",JSON.stringify(s.data)),i(s.data)):t()},t));function t(){$("div.noteslist div.listpart div.loading").addClass("disable"),null!=localStorage.getItem("note_list_notes")&&i(JSON.parse(localStorage.getItem("note_list_notes")))}}()}var list_first_load=!0;var cm_editor;function maker(e,t,a,i,n){if(void 0!==n&&!0===n||(n=!1),$("button#publishnote").prop("disabled",n),void 0===a){var o=!1,r=!1;localStorage.setItem("note_maker_reopen",JSON.stringify({noteid:e,name:t,enc:n}))}else{if("function"==typeof i)r=!0;else r=!1;o=!0}var d,s;review("noteview");var l,c,u=!1,g=!1;function f(){"object"==typeof cm_editor&&(cm_editor.off("change",l),cm_editor.off("change",c)),newerNoteOnServerFound=function(){}}function v(){s=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(d.content)),localStorage.setItem("note_autosave_"+d.id,JSON.stringify(d)),$("input#notename").val(d.name),$("textarea#notesinput").text(d.content),"object"!=typeof cm_editor?cm_editor=CodeMirror.fromTextArea(document.getElementById("notesinput"),{mode:"gfm",lineNumbers:!0,theme:"default"}):cm_editor.setValue($("textarea#notesinput").val()),function(){var e=new marked.Renderer;function t(e,t){var a=/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);if(a&&void 0!==t&&1===t.text.length&&/^[A-Z]$/.test(t.text[0])){var i=$(":focus");i.blur(),i.focus()}$("div#notespreview").html(marked(cm_editor.getValue())),$(".openothernote").off("click").click(function(){var e=$(this).attr("noteid");m(function(){f(),maker(e,"")})})}e.heading=function(e,t){return""+e+""},e.link=function(e,t,a){return''+a+""},e.text=function(e){return(e=e.replace(/@(([0-9a-zA-Z]{1,8})[0-9a-zA-Z]*)/g,'@$2')).replace(/:(\S+):/g,'')},e.checkbox=function(e){return e?' ':' '},marked.setOptions({renderer:e,gfm:!0,tables:!0,smartLists:!0,smartypants:!0,highlight:function(e,t){if("tex"!=t)return-1!==["markup","css","clike","javascript","c","bash","cpp","csharp","ruby","git","ini","java","json","lua","markdown","matlab","objectivec","perl","php","python","r","sql","swift"].indexOf(t)?Prism.highlight(e,Prism.languages[t]):e;try{return katex.renderToString(e)}catch(e){return''+e.message+""}}}),t(),o&&!r?$("div.input.box").addClass("disable"):($("div.input.box").removeClass("disable"),cm_editor.on("change",t));l=t}(),function(){function e(){var e=Date.now()-3e4>h,t={name:$("input#notename").val(),id:d.id,content:cm_editor.getValue(),lastserverchanged:d.lastserverchanged};localStorage.setItem("note_autosave_"+d.id,JSON.stringify(t)),e?m():($("span.noteunsaved").removeClass("disable"),$("span.notesaved").addClass("disable"))}$("span.noteunsaved").tooltip(),$("span.notesaved").tooltip(),g&&(e(),g=!1);cm_editor.on("change",e),c=e,$("span.noteunsaved").off("click").click(m)}()}var h=0;function m(a){if(s!=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(cm_editor.getValue()))||g){function l(){if(o&&r)h=Date.now(),i(cm_editor.getValue(),!1);else if(!1===o)if(systemOfflineMode)systemOfflineManager.saveNote(e,cm_editor.getValue(),$("input#notename").val()),h=Date.now(),"function"==typeof a&&a(!0);else{$("div.noteview div.loading").removeClass("disable");var s=cm_editor.getValue();n&&(s=systemEncrypter.encryptNote(s)),ajax_request("view",{userid:userinformation.id,noteid:e,note:{name:$("input#notename").val(),cont:s}},function(i){if($("div.noteview div.loading").addClass("disable"),"okay"===i.status){if(console.log('Notiz: "'+t+'" ("'+e+'") auf Server gespeichert.'),h=Date.now(),4==i.data.length){d.lastserverchanged=i.data[3];var n=JSON.parse(localStorage.getItem("note_autosave_"+e));n.lastserverchanged=i.data[3],localStorage.setItem("note_autosave_"+e,JSON.stringify(n))}$("span.notesaved").removeClass("disable"),$("span.noteunsaved").addClass("disable")}"function"==typeof a&&a("okay"===i.status)},function(e){"function"==typeof a&&a(!1)})}}u?($("body").append('
Beim Speichern der Notiz kann es eventuell zu Datenverlust kommen, da die aktuellste Version nicht vom Server geladen werden konnte!
'),$("#dangerMessageNoteSave").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Gefahr des Datenverlustes!",buttons:{"Trotzdem Speichern":function(){$(this).dialog("close"),u=!1,l()},"Erstmal nicht":function(){$(this).dialog("close")}},close:function(){$(this).remove()}})):l()}else"function"==typeof a&&a(!0)}function b(){function t(){errorMessage("Freigaben konnten nicht geladen werden."),$("div.noteview div.loading").addClass("disable")}$("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e},function(a){if("okay"===a.status){var i='
Konnte Aktion nicht durchführen.
',n=!1;$.each(a.data,function(e,t){n=!0,i+='',i+="",i+="",i+='",i+="",i+=''}),i+="
LinkNameErstelltBearbeitenLetzter Aufruf (Anzahl)Löschen
Aufrufen "+t.name+""+t.created+"'+t.edit+""+t.lastAccessed+" ("+t.accesses+")
",!1===n&&(i+="

Noch keine Freigaben!

"),i+='

Neue Freigabe


Bearbeiten erlauben Nur lesen
',$("body").append('
'+i+"
"),$("div.noteview div.loading").addClass("disable"),$("div#freigabeManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Freigaben",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),$("button.deleteFreigabe").click(function(){var t=$(this).attr("authcode");$("div.freigabeDialog.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,share:{authcode:t,edit:"leer",name:"leer"}},function(e){"okay"===e.status?($("div#freigabeManagerDialog").dialog("close"),b()):($("div.freigabeDialog.loading").addClass("disable"),$("div.freigabeDialog.error").removeClass("disable"))})}),$("button#addFreigabe").click(function(){var t=$("input#freigabeManagerNewName").val(),a="true"==$("input#freigabeManagerNewEdit:checked").val();""!=t&&($("div.freigabeDialog.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,share:{authcode:"leer",edit:a,name:t}},function(e){"okay"===e.status?($("div#freigabeManagerDialog").dialog("close"),b()):($("div.freigabeDialog.loading").addClass("disable"),$("div.freigabeDialog.error").removeClass("disable"))}))}),$("button.freigabeQR").click(function(){var e=$(this).attr("authcode"),t=domain+"/#"+e,a='

Code: '+e+'

URL:

Link: Aufrufen

';$("body").append('
'+a+"
"),$("div#freigabeManagerQRDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Freigabelink",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),new QRCode(document.getElementById("freigabeManagerQR"),t)})}else t()},t)}function p(){function t(){errorMessage("Notizverlauf konnte nicht geladen werden."),$("div.noteview div.loading").addClass("disable")}$("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,history:3},function(e){if("okay"===e.status){var a="";$.each(e.data,function(e,t){a+="",a+="'}),a+="
ÄnderungenZeitpunkt
"+(n?"Kein Diff. bei verschlüsselten Notizen!":t.diff)+""+t.time+'
",$("body").append('
'+a+"
"),$("div.noteview div.loading").addClass("disable"),$("div#historyManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Notizverlauf",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),$("button.takeInputFromHistory").click(function(){var t=$(this).attr("key"),a=e.data[t].text;if(n)try{a=systemEncrypter.decryptNote(a)}catch(e){return void setTimeout(()=>{errorMessage("Kann Verlauf nicht entschlüsseln!",10)},200)}cm_editor.setValue(a),$("div#historyManagerDialog").dialog("close")})}else t()},t)}!function(){function i(a,i){a||systemOfflineMode||(u=!0,errorMessage("Kann die aktuelle Version der Notiz nicht vom Server holen.",20)),null!=localStorage.getItem("note_autosave_"+e)?(d=JSON.parse(localStorage.getItem("note_autosave_"+e)),v()):systemOfflineMode?(confirmDialog("Die gewählte Notiz ist auf diesem Gerät leider nicht offline verfügbar!",{OK:function(){$(this).dialog("close")}},"Offlinemodus"),list()):(d={name:t,id:e,content:"# "+t+"\nUnd hier dann der Text!!\n",lastserverchanged:void 0!==i?i:0},v())}o?(d={name:t,id:e,content:a.content,lastserverchanged:a.lastchanged},$("div.noteview div.loading").addClass("disable"),v()):systemOfflineMode?($("div.noteview div.loading").addClass("disable"),i(!1)):($("div.noteview div.loading").removeClass("disable"),ajax_request("view",{userid:userinformation.id,noteid:e,history:2},function(e){if($("div.noteview div.loading").addClass("disable"),"okay"===e.status)if(g=e.data.empty,e.data.empty)i(!0,e.data.geandert);else{var t=e.data.content;if(n)try{t=systemEncrypter.decryptNote(e.data.content)}catch(e){localStorage.setItem("note_maker_reopen","none"),f(),list(),setTimeout(()=>{errorMessage("Kann Notiz nicht entschlüsseln!",10)},200)}d={name:e.data.name,id:e.data.id,content:t,lastserverchanged:e.data.geandert},v()}else i(!1)},function(e){i(!1)}))}(),$("button#closenote").off("click").click(function(){f(),o&&r?i(cm_editor.getValue(),!0):o?(window.location.hash="",loginsys()):!1===o&&m(function(e){e?(localStorage.setItem("note_maker_reopen","none"),list()):($("body").append('
Die Speicherung der Notiz auf dem Server schlug fehl!
Wollen Sie den Editor verlassen und einen Verlust der Änderungen in Kauf nehmen oder abbrechen?
'),$("#errorMessageNoteSave").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Fehler beim Speichern!",buttons:{"Änderungen verwerfen":function(){localStorage.setItem("note_maker_reopen","none"),list(),$(this).dialog("close")},Abbrechen:function(){$(this).dialog("close")}},close:function(){$(this).remove()}}))})}),o||systemOfflineMode?($("button#publishnote").addClass("disable"),$("button#notehistory").addClass("disable")):($("button#publishnote").removeClass("disable"),$("button#notehistory").removeClass("disable"),$("button#publishnote").off("click").click(b),$("button#notehistory").off("click").click(p)),newerNoteOnServerFound=function(){!0,s==sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(cm_editor.getValue()))?(f(),maker(e,t)):(u=!0,confirmDialog("

Die Notiz ist auf dem Server verändert worden.
Wollen Sie die neue Version laden?

Dadurch können Ihre Änderungen verloren gehen! Andernfalls die Änderungen auf dem Server.

",{Ja:function(){f(),maker(e,t),!1,$(this).dialog("close")},Nein:function(){u=!1,m(),!1,$(this).dialog("close")}},"Änderung auf Server"))}}var newerNoteOnServerFound=function(){};function authCodeManager(){function e(e){$("div#authCodeManagerDialog").html(e)}function n(n){var a='

Authentifizierungslinks

';function t(e,n){var s=!1;if($("span#newPasswordAIndikator").css({color:"white"}),""==e&&($("span#newPasswordAIndikator").css({"background-color":"inherit"}),$("span#newPasswordAIndikator").text("Bitte geben Sie ein Passwort ein!"),s=!0),""==n&&($("span#newPasswordBIndikator").css({"background-color":"inherit"}),$("span#newPasswordBIndikator").text("Bitte geben Sie das Passwort ein!"),s=!0),""!=e){var a,t=e,o=e.length,i=0;o>5?((i+=5*(o-=5))>20&&(i=20),t.match(/([a-zA-Z])/)&&(i+=10),t.match(/([A-Z])/)&&(i+=5),t.match(/([0-9])/)&&(i+=5),t.match(/([0-9].*[0-9])/)&&(i+=10),t.match(/([0-9].*[0-9].*[0-9])/)&&(i+=10),t.match(/([!,%,&,@,#,*,?,_,])/)&&(i+=15),t.match(/([!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,])/)&&(i+=15),t.match(/([!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,].*[!,%,&,@,#,*,?,_,])/)&&(i+=15)):i=0,i<=25?(a="Das soll ein Passwort sein?",$("span#newPasswordAIndikator").css({"background-color":"red"})):i<=50?(a="Gut, aber es geht noch besser!",$("span#newPasswordAIndikator").css({"background-color":"orange"}),$("span#newPasswordAIndikator").css({color:"black"})):i<=75?(a="Das sieht doch super aus!",$("span#newPasswordAIndikator").css({"background-color":"yellow"}),$("span#newPasswordAIndikator").css({color:"black"})):i<=100&&(a="Da werden die Hacker schwitzen!",$("span#newPasswordAIndikator").css({"background-color":"green"})),$("span#newPasswordAIndikator").text(a)}return e!=n&&""!=e&&""!=n&&($("span#newPasswordBIndikator").css({"background-color":"red"}),$("span#newPasswordBIndikator").text("Die Passwörter stimmen nicht überein!"),s=!0),!s&&($("span#newPasswordBIndikator").css({"background-color":"green"}),$("span#newPasswordBIndikator").text("Passwörter stimmen überein!"),!0)}!1!==n?(a+="",n.forEach(function(e){a+=''}),a+="
Code (Anfang)Letzte NutzungLöschen
'+e.code+""+e.time+'
"):a+="

Sie haben noch keine Authentifizierungslinks!

",a+='

 

',a+='

Passwort ändern

Bitte geben Sie ein Passwort ein!
Bitte geben Sie das Passwort ein!
',e(a+='

Passwort zur Verschlüsselung von Notizen

Bitte geben Sie ein Passwort zur Verschlüsselung der Notizen ein!
'),$("button#newPasswordSet").prop("disabled",!0),$("span.newPasswordIndikator").css({"border-radius":"5px",padding:"2px"}),$("button#newPasswordSet").click(function(){var e=$("input#newPasswordA").val(),n=$("input#newPasswordB").val();if(!t(e,n))return!1;$("div#newPasswordLoader").removeClass("disable"),ajax_request("account",{userid:userinformation.id},function(n){if("okay"===n.status){var s=n.data,a=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(e));a=sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(a+"+"+s)),ajax_request("account",{userid:userinformation.id,newpass:a,salt:s},function(e){$("div#newPasswordLoader").addClass("disable"),"okay"===e.status?($("div#newPasswordDone").removeClass("disable error"),$("div#newPasswordDone").addClass("okay"),$("div#newPasswordDone").text("Passwort geändert!")):($("div#newPasswordDone").removeClass("disable okay"),$("div#newPasswordDone").addClass("error"),$("div#newPasswordDone").text("Konnte Passwort nicht ändern!"))})}else $("div#newPasswordLoader").addClass("disable"),$("div#newPasswordDone").removeClass("disable okay"),$("div#newPasswordDone").addClass("error"),$("div#newPasswordDone").text("Konnte Passwort nicht ändern!")})}),$("input.newPassword").on("keyup",function(){t($("input#newPasswordA").val(),$("input#newPasswordB").val())?$("button#newPasswordSet").prop("disabled",!1):$("button#newPasswordSet").prop("disabled",!0)}),$("input.noteEncPassw").on("keyup",function(){$("button#noteEncPasswSet").prop("disabled",$("input.noteEncPassw").val().length<4)}),$("button#noteEncPasswSet").click(function(){systemEncrypter.setNotesPassword($("input.noteEncPassw").val()),$("button#noteEncPasswSet").prop("disabled",!0)}),$("button.deleteAuthLink").click(function(){var e=$(this).attr("linkid"),n=$(this).attr("codeteil");confirm('Wollen sie den Code "'+n+'" wirklich löschen? ')&&($("div#authLinkLoading").removeClass("disable"),ajax_request("account",{userid:userinformation.id,art:"del",id:e},function(e){$("div#authLinkLoading").addClass("disable"),"okay"===e.status?s():alert("Konnte den Code nicht löschen!")}))}),$("button#addAuthLink").click(function(){$("div#authLinkLoading").removeClass("disable"),ajax_request("account",{userid:userinformation.id,art:"new",id:"new"},function(e){$("div#authLinkLoading").addClass("disable"),"okay"===e.status?(!function(e){var n=domain+"/#"+userinformation.name+":"+e;$("meta[name=application-url]").attr("content",$("meta[name=application-url]").attr("content")+"#"+userinformation.name+":"+e);var s='

Neuer Authentifizierungslink wurde erstellt:

Code: '+e+'

URL:

Link: Aufrufen

Achtung: Dieser Link und Code wird nur ein einziges Mal angezeigt!!

';$("body").append('
'+s+"
"),$("div#authCodeManagerNewCodeDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Neuer Authentifizierungslink",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),new QRCode(document.getElementById("authCodeManagerNewCodeDialogQR"),n)}(e.data),s()):alert("Konnte keinen Code erstellen!")})})}function s(){ajax_request("account",{userid:userinformation.id,art:"list",id:"list"},function(s){"okay"===s.status?n(s.data):e("Kann nicht laden!")})}$("body").append('
Lädt ...
'),$("div#authCodeManagerDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Authentifizierungslinks und Passwort",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),s()}function oldNotesManager(){function t(t){t='
'+t,$("div#oldNotesDialog").html(t)}$("body").append('
'),$("div#oldNotesDialog").dialog({resizable:!1,height:"auto",width:"auto",modal:!0,title:"Notizarchiv",close:function(){$(this).remove()},position:{my:"center",at:"center",of:$("div.main")}}),t("Lädt ..."),$("div#oldNotesDialogLoader").removeClass("disable"),ajax_request("list",{userid:userinformation.id,reload:"none"},function(o){if($("div#oldNotesDialogLoader").addClass("disable"),"okay"===o.status){var e="";o.data.forEach(function(t){e+="'}),t(e+="
NameZuletzt geändertWiederherstellen
"+t.name+""+t.geaendert+'
"),$("button.oldNotesDialogReload").click(function(){var t=$(this).attr("noteid");$("div#oldNotesDialogLoader").removeClass("disable"),ajax_request("list",{userid:userinformation.id,reload:t},function(t){$("div#oldNotesDialogLoader").addClass("disable"),"okay"===t.status?(list(),$("div#oldNotesDialog").dialog("close")):alert("Konnte die Notiz nicht wiederherstellen!")})})}else t("Konnte nicht laden!!")})}function shareviewer(e,n){var a,t=0,i=!1;function s(){ajax_request("share",{authcode:e},function(n){systemOfflineMode?(errorMessage("Offline können keine Freigaben geöffnet werden!"),r()):"okay"===n.status?(t=n.data.geandert,i=n.data.edit,n.data.edit?(maker(n.data.id,n.data.name,{content:n.data.content,lastchanged:n.data.geandert},function(n,i){function s(e){i&&(e&&!confirm("Konnte nicht Notiz speichern, trotzdem schließen?")||(clearInterval(a),window.location.hash="",loginsys()))}$("div.noteview div.loading").removeClass("disable"),ajax_request("share",{authcode:e,cont:n},function(e){$("div.noteview div.loading").addClass("disable"),t=e.data[3],"okay"===e.status?($("span.notesaved").removeClass("disable"),$("span.noteunsaved").addClass("disable")):errorMessage("Konnte Notiz nicht speichern!"),s(!("okay"===e.status))},function(e){$("div.noteview div.loading").addClass("disable"),errorMessage("Konnte Notiz nicht speichern!"),s(!0)})}),o()):(maker(n.data.id,n.data.name,{content:n.data.content,lastchanged:n.data.geandert}),o())):(errorMessage("Nachricht lässt sich mittels Freigabelink nicht öffnen.",!1),r())},function(e){r()})}function r(){"function"==typeof n&&n()}function o(){a=setInterval(function(){ajax_request("share",{authcode:e},function(e){"error"===e.status?errorMessage("Die Freigabe kann nichtmehr erreicht werden",!1):(console.log(e.data.geandert-t,e.data.geandert,t),e.data.geandert-t>5&&(clearInterval(a),i?confirmDialog("

Die Notiz ist auf dem Server verändert worden.
Wollen Sie die neue Version laden?

Dadurch können Ihre Änderungen verloren gehen!

",{Ja:function(){s(),$(this).dialog("close")},Abbrechen:function(){$(this).dialog("close")}},"Änderung auf Server"):s()))})},1e3*global_polling_secs)}systemRESTAPI=!1,s()} \ No newline at end of file diff --git a/system/php/systemInit.php b/system/php/systemInit.php index f1be6b0..e97646c 100644 --- a/system/php/systemInit.php +++ b/system/php/systemInit.php @@ -66,7 +66,7 @@ abstract class SystemInit{ //Sytemversion // [ Hauptversionsnummer, Unternummer, Patch, Zusatz (Alpha, Beta, Final) ] => [1, 23, 5, 'B'] -> 1.23.5 Beta - const SYSTEMVERSION = [ 1, 1, 11, 'Final' ]; + const SYSTEMVERSION = [ 1, 1, 12, 'Final' ]; /* Auslesen der Konfiguration