// ==UserScript== // @name dev_note_search2 // @namespace dev_note_search2 // @description searching notes! // @match http://*.deviantart.com/notifications/notes/* // @match https://*.deviantart.com/notifications/notes/* // @version 1.1.18 // @author http://dediggefedde.deviantart.com // @grant none // @downloadURL https://update.greasyfork.icu/scripts/5776/dev_note_search2.user.js // @updateURL https://update.greasyfork.icu/scripts/5776/dev_note_search2.meta.js // ==/UserScript== function injected(){ var mapfolder=[]; var mapwords=[]; //speed up indexing notes! //Amount of notes requested on each index-cycle. //But: progressbar can only update once a cycle! //numbers for a 380 Notes Scan: //370: 4884 ms needed - 77,8 Notes/s //100: 6487 ms needed - 58,6 Notes/s <-standard //50: 7950 ms needed - 47,8 Notes/s //10: 17714 ms needed - 21,5 Notes/s //if you've got around 10.000 Notes (default: 2.8 min) you can reduce the time by settings this number higher! //Any Value above 100 will increase the update-speed and decrease how often the Progressbar is updated. //Any Value above your total amount of Notes won't make a difference. var note_index_steps=100; if (typeof uneval === "undefined") { uneval = function(a){ return (JSON.stringify(a))||''; }; } //remove the /* and */ and reload to remove all stored data! //Put them back to use the script afterwards! /* var keys = GM_listValues(); for (var i=0, key=null; key=keys[i]; i++) { GM_deleteValue(key); } */ // var $=unsafeWindow.jQuery,holder,query,offset,fPage,pPage,lPage; // var DiFi=unsafeWindow.DiFi; var noteauthor=[]; //list of authors var notetitle=[]; //list of titles var notetext=[]; //list of word -> list of index for other lists var notedata=[]; //note-id, folder, note-date var noteamount=[]; //count , updatedate var safheader=""; //old note-menu stored to be restored when leaving search var lastactfolder=""; //last active folder for continue indexing var aktfolder=""; //current selected folder (per dropdown) var aktindexfirstnoteid=""; //last note scanned in indexing -> used in updating index. var totalamm; //total amount of notes in current folder var newaddedli; // added notes used by checknewnotes var toindexnoteoffsets=[]; //note's offset that still needs to be scanned var resarr=[]; //array of note-indices that matches the current search var aktsort=4; // sorting of search results: up&down: 01 name|23 author|45 date var GM_setValue; //indexedDB: replace GM_functions! var transaction; //indexedDB var objectStore; //indexedDB //style var sty=document.createElement("style"); sty.innerHTML="h2.dev_note_search2_search input[type='text']{"+ "background-color: #BBCCBA;"+ "border: 1px inset #5E7264;"+ "border-radius: 7px;"+ "color: #3C4441;"+ "display: inline-block;"+ "margin-left: 10px;"+ "padding: 2px;"+ "padding-left:4px;"+ "width:70%;"+ "vertical-align: middle;}"+ "div.dev_note_header{"+ "background: linear-gradient(0deg, rgba(0,0,0,0.2) 0%, rgba(255,255, 255, 0.5) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);"+ "padding: 0 0 0 6px!important;height:20px;}"+ "div.dev_note_header>div{"+ "height:20px;cursor:pointer;}"+ "li.dev_noteentry>span, div.dev_note_header>div{"+ "display:inline-block;"+ "width:33.33%;"+ "}"+ "#dev_note_search2_search_info{"+ "font-size:8pt;width:30%;margin:0;}"+ "li.dev_noteentry{"+ "min-height: 5px !important;"+ "cursor:pointer;"+ "padding:6px 0 6px 6px!important;"+ "}"+ "h2.dev_note_search2_search span{"+ "margin-left: 10px;"+ "width: 80px;"+ "display: inline-block;"+ "vertical-align: middle;"+ "font-size:10pt;}"+ "#dev_note_search2_search_index, #dev_note_search2_removeall_index{"+ "position:absolute;right:0;height:18px;font-size:8pt;padding:0;"+ "}"+ "#dev_note_search2_removeall_index{right:70px;}"+ "h2.dev_note_search2_search span.dev_note_search2_search_header{"+ "font-size:14pt;height:30px;display:inline-block;}"+ ".dev_aktsort_down{"+ // "background: linear-gradient(0deg, #afdbae 0%, #E4F4E3 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);}"+ "background: linear-gradient(0deg, rgba(175,155,40,0.2) 0%, rgba(72, 194, 27, 0.5) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);}"+ ".dev_aktsort_up{"+ "background: linear-gradient(180deg, rgba(175,155,40,0.2) 0%, rgba(72, 194, 27, 0.5) 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);}"+ "h2.dev_note_search2_search input[type='submit'],h2.dev_note_search2_search select{"+ "border-radius: 7px;"+ "background: linear-gradient(0deg, #E2E9E3, #D3DFD5) repeat scroll 0 0 transparent;"+ "border: 1px solid #93A98F;"+ "padding: 3px;"+ "margin: 6px;"+ "float: left;"+ "cursor:pointer;"+ "color: #2C3635;}"+ "h2.dev_note_search2_search input[type='submit']:active{"+ "border:1px inset #93A98F;"+ "background: linear-gradient(180deg, #E2E9E3, #B5C9B8) repeat scroll 0 0 transparent;}"; document.body.appendChild(sty); //removes all elements of array subtrahend from array minuend with creating a new one. function arrsubstract(minuend, subtrahend){ var ruckarr=[]; for(var i=0;i word var indexF=mapfolder.indexOf(aktfolder);if(indexF<0)indexF=0; for(var w =0;w word var indexF=mapfolder.indexOf(aktfolder);if(indexF<0)indexF=0; for(var w =0;w-1 , notetext[indexF].length-1 && notetext[indexF].length>indexW && typeof notetext[indexF][indexW]!= "undefined"){ for(var j=0;j $ returnarr=returnarr.concat(search(searchwords[i].replace(/\$/g," ").trim(),mode)); //make a normal search like there were no " var leerwords=searchwords[i].split("$"); //words within quotes var aktretarr=returnarr; //now make a difi-request: get the full text of the notes that matches the normal search and check if the originally search matches their text. //if yes, the note with the data-noteid-property will get removed. for(var j=0;j=notetext[indexF].length||typeof notetext[indexF][indexW]=="undefined")continue; if( $.inArray(noteid, notetext[indexF][indexW])==-1 //this note is not already added (e.g. 2 times word in a note) &¬etext[indexF][indexW].push) //and the array is legit notetext[indexF][indexW].push(noteid); //then add this note's index (pointing to other lists) } } }catch(ex){ console.log("MSG-convert error: ",ex); return; } } //this goes from newest to oldest note until it finds a note with the last indexed note id, stored in noteamount[folder][2] //this is actually how getnotes() also looked like before made pausable and turning the pushposts into bunches. function checknewnotes(folder,offset){ if(offset==40)return; //in case there is no last indexed id as there was no index, make a full index var indexF=mapfolder.indexOf(folder); // var indexW=mapwords[indexF].indexOf(elements[i]); // if(typeof notetext[folder]=="undefined"&&totalamm!=-1){getnotes(folder,Math.floor(totalamm/10)*10,true);return;} if((indexF<0 || typeof notetext[indexF]=="undefined")&&totalamm!=-1){getnotes(folder,Math.floor(totalamm/10)*10,true);return;} if(totalamm==-1){ //folder unknown full noteauthor[folder]=[]; //everywhere 0! notetitle[folder]=[]; notetext[indexF]=[]; notedata[folder]=[]; // mapfolder=[]; // mapwords=[]; noteamount[folder]=[0,(new Date).toLocaleString(),""]; lastindexfolder=folder; aktindexfirstnoteid=""; var intex=""; saveindexnotes(folder, intex); //save 0... $("#dev_note_search2_search_folders").change(); //display 0 Notes indexed } DiFi.pushPost('Notes', 'display_folder', [folder,offset,false],function(success,data){ var aktsite=$(data.response.content.body); //parse note-page (<10 notes) aktsite.find("li.note").each(function(){ //break when the last indexed note was found. All notes before that (newer) will be in newaddedli. if($(this).attr("data-noteid")!=noteamount[folder][2]){ newaddedli=newaddedli.add($(this)); }else return false; //false will break the each-loop }); if(newaddedli.length==0)return; //no new notes if(aktsite.find("li.note[data-noteid='"+noteamount[folder][2]+"']").length==0&&aktsite.find("li.note").length>0){ //the last indexed note is not on this site checknewnotes(folder,offset+10); //recursive call to scan the next page. }else{ //reverse order of found new notes (convert to oldes->newest) $(newaddedli.get().reverse()).each(function(){ if(NoteAlreadyScanned($(this).attr("data-noteid"),folder))return; //username is a must have. if($(this).find("span.sender a.username,span.sender span.username").html()==null){ return; } if(typeof $(this).find("div.note-preview").html()=="undefined"){ noteauthor[folder].push($(this).find("span.sender a.username,span.sender span.username").html()); notetitle[folder].push($(this).find("span.subject a").html()); var dstime=Date.parse($(this).find("span.ts").attr("title")); if(isNaN(dstime))dstime=Date.parse($(this).find("span.ts").html()); aktindexfirstnoteid=$(this).attr("data-noteid"); notedata[folder].push(new Array($(this).attr("data-noteid"), $(this).find("span.subject a").attr("data-folderid"), dstime)); return; } noteauthor[folder].push($(this).find("span.sender a.username,span.sender span.username").html()); //otherwise noteauthor has a problem notetitle[folder].push($(this).find("span.subject a").html()); //title just assumes, there is a note title //no convert and add the text into word-list. //note-preview contains the whole text, but without linebreaks(spaces inserted) and without html //notedata[folder].length is the new index after this entry is pushed into notedata! adddata($(this).find("div.note-preview").html(),notedata[folder].length,folder); //parse the time when the note was sent/recieved. var dtime=Date.parse($(this).find("span.ts").attr("title")); if(isNaN(dtime))dtime=Date.parse($(this).find("span.ts").html()); //the display switches: one says the date, one xx minutes ago. aktindexfirstnoteid=$(this).attr("data-noteid"); //last indexed note will be overwritten untill the newset index. //add note-id, folderid and recieved date to notedata. notedata[folder].push(new Array($(this).attr("data-noteid"), $(this).find("span.subject a").attr("data-folderid"), (new Date(dtime)).toLocaleString())); }); var intex=""; saveindexnotes(folder,intex); //progressbar and title $("#dev_note_search2_search_index").css("background-image","").attr("title","100%: "+noteauthor[folder].length+"/"+totalamm+", "+Math.round(100*(intex.length+uneval(noteauthor[folder]).length+uneval(notetitle[folder]).length+uneval(notedata[folder]).length)/1024/1024)/100+"MB storage used"); } // } }); DiFi.send(); } // var aktstartdat; //time measurement. //saves the values to indexedDB! function saveindexnotes(folder, intex){ try{ if(typeof intex=="undefined"||intex==null)intex=""; var indexF=mapfolder.indexOf(folder); // var indexW=mapwords[indexF].indexOf(elements[i]); // for(var el in notetext[folder]){//convert word-list into a string. saves some bytes in contrast to uneval(). // intex+=String.fromCharCode(17)+el+String.fromCharCode(18)+notetext[folder][el].join(String.fromCharCode(18)); // } for(var el =0;el1) $("#dev_note_search2_search_info").html(noteamount[aktfolder][0]+" Notes fetched
Updated on"+noteamount[aktfolder][1]); // setTimeout(function(){ //neded for the original GM_setValue. Now IndexDb GM_setValue("notetext_"+folder,intex.substr(1)); GM_setValue("noteauthor_"+folder,uneval(noteauthor[folder])); GM_setValue("notetitle_"+folder,uneval(notetitle[folder])); GM_setValue("noteamount_"+folder,uneval(noteamount[folder])); GM_setValue("notedata_"+folder,uneval(notedata[folder])); GM_setValue("toindexnoteoffsets",uneval(toindexnoteoffsets)); GM_setValue("lastindexfolder",uneval(lastindexfolder)); // },0); }catch(ex){ console.log("indexDB-storage error: ",ex); return; } } function NoteAlreadyScanned(id,folder){ try{ for(var i=0;i0){return;} //already running! noteauthor[folder]=[]; notetitle[folder]=[]; if(mapfolder.indexOf(folder)<0){ mapfolder.push(folder); mapwords.push([]); } notedata[folder]=[]; noteamount[folder]=[]; lastindexfolder=folder; aktindexfirstnoteid=""; for(var i=offset;i>=0;i-=10) //create all note-offset I want to scan! offset=(page-1)*10. toindexnoteoffsets.push(i); //go from high to 0: old notes first! } if(offset==-10){ //finished: all notes scanned, toindexnoteoffsets empty. var intex=""; saveindexnotes(folder, intex); //save all data. //update progressbar if(typeof noteauthor[folder]=="undefined"||noteauthor[folder]==null)return; $("#dev_note_search2_search_index").css("background-image","").attr("title","100%: "+noteauthor[folder].length+"/"+totalamm+", "+Math.round(100*(intex.length+uneval(noteauthor[folder]).length+uneval(notetitle[folder]).length+uneval(notedata[folder]).length)/1024/1024)/100+"MB storage used"); //update info-text $("#dev_note_search2_search_folders").change(); }else{ var runter=note_index_steps; //number of offsets within a request. Is set at top. default 100 if(offset%note_index_steps!=0)runter=offset%note_index_steps; //360: first 6*10, then only 10*10. for(var i=0;i0)return; aktfolder="1"; //standard is inbox. aktsort=4; //standard is sorting results with date resarr=[]; //show no notes at the beginning (index of notes to show) //search-entry on the left var tab=$('Search'); //make the search-form undo-able $("div.messages-menu div.pager-holder div.pager2 div.page2").children().click(function(){ if(safheader!=""){ $("h2.mczone-title").empty(); $("h2.mczone-title").css("height",""); $("h2.mczone-title").first().append(safheader); } if(lastactfolder!=""){ //switch to last selected folder! lastactfolder.addClass("selected"); $("#dev_note_search2_tab").removeClass("selected"); } }); $("#notes a.folder-link").first().before(tab); //insert "search" // $("div.messages-menu div.pager-holder div.pager2 div.page2 div.header").first().after(tab); //insert "search" tab.click(function(event){//and click event event.preventDefault(); event.stopPropagation(); //no parent-clicks needed! $(".dev_note_header").remove(); //no double search forms! //folder where you came from lastactfolder=$("div.messages-menu div.pager-holder div.pager2 div.page2 a.selected").removeClass("selected").first(); $("#dev_note_search2_tab").addClass("selected"); //search is now selected if($("#dev_note_search2_search_title").length==0)safheader=$("h2.mczone-title").first().children(); var header1=$("td.notes-left h2.mczone-title").first().empty(); var header2=$("td.notes-right h2.mczone-title").first().empty(); //no double search forms! header1.addClass("dev_note_search2_search"); header2.addClass("dev_note_search2_search"); $( window ).resize(function(){ //adapt search form to window's site $("#dev_note_search2_search_info").width($("h2.dev_note_search2_search").eq(1).width()-320); $("h2.dev_note_search2_search input[type='text']").width($("h2.dev_note_search2_search").first().width()-130); }); //inset search form header1.append($("Search:
Username:
"+ "
Subject:
Text:
")).css({"height":"110px","background-size":"contain","padding":"10px 0px"}); header1.find("input[type='text']").keydown(function(event){ //enter means search! if(event.which==13)$("#dev_note_search2_search_submit").click(); }); header2.append(""+ ""+ ""); header1.prepend(""); header1.prepend(""); $("#dev_note_search2_search_addindex").first().click(function(){ //refresh-button to update index //total amount of notes is displayed at each note-folder's rel-attribute totalamm=parseInt($("a.folder-link[data-folderid="+aktfolder+"]").attr("rel").replace(/,/g,"")); newaddedli=$([]); checknewnotes(aktfolder,0); }); //load data for each folder and generate the dropdown! $("div.messages-menu div.pager-holder div.pager2 div.page2 a.folder-link").not(".dev_search_tab").each(function(){ if($(this).html()=="Search")return; var wert=$(this).attr("data-folderid"); if(typeof(noteamount[wert])=="undefined"){ //only load first // setTimeout(function(){ loaddata(wert); // },0); } $("#dev_note_search2_search_folders").first().append(""); }); $("#dev_note_search2_search_folders option").first().addClass("selected"); //select "inbox" $("#dev_note_search2_search_folders").change(function(){ //change will update the info-text and chooses aktfolder if($(this).prop("selectedIndex")==-1)$(this).prop("selectedIndex",0); //stange=first aktfolder=$(this).val(); if(toindexnoteoffsets.length>0){ //continue scan? if(confirm("You interrupted the last scan of your folder '"+lastindexfolder+"'.\n Do you want to continue indexing it?")){ totalamm=parseInt($("a.folder-link[data-folderid="+aktfolder+"]").attr("rel").replace(/,/g,"")); getnotes(aktfolder,0,false); }else{ //no... toindexnoteoffsets=[]; // GM_setValue("toindexnoteoffsets",uneval(toindexnoteoffsets)); } } if(typeof(noteamount[aktfolder])=="undefined") //no indexed notes! $("#dev_note_search2_search_info").html("No notes fetched so far!
Press \"Index Notes\"!"); else //show the indexed note's amount and update-Date in the info-text-field! $("#dev_note_search2_search_info").html(noteamount[aktfolder][0]+" Notes fetched
Updated on "+noteamount[aktfolder][1]); }).keyup(function() { //using dropdown with keyboard $(this).change(); }).change(); //and do it already once! $("#dev_note_search2_removeall_index").click(function(){ location.href="http://www.deviantart.com/notifications/notes/#1_0/#killoldindex"; location.reload(); }); $("#dev_note_search2_search_index").click(function(){ //index notes! //total amount of notes is displayed at each rel-attribute totalamm=parseInt($("a.folder-link[data-folderid="+aktfolder+"]").attr("rel").replace(/,/g,"")); if(totalamm==-1){ newaddedli=$([]); checknewnotes(aktfolder,0); }else{ getnotes(aktfolder,Math.floor(totalamm/10)*10,true); } }); //make a search! //here is also the actuall search and use of search() defined! header2.find("#dev_note_search2_search_submit").click(function(){ resarr=getUnique(search($("#dev_note_search2_search_name").val(),0)); //search authors resarr=getintersection(resarr,search($("#dev_note_search2_search_title").val(),1)); //search titles //use intersection to have notes that match author AND title var query=$("#dev_note_search2_search_text").val().trim(); //and now the text-search... var queryplus=query.match(/\+("[^"]*?"|[^ "]*)/g); //all words with a + before (also +"asd dsa") var queryminus=query.match(/-("[^"]*?"|[^ "]*)/g); //same with - var querynotplus=query.replace(/(\+|-)("[^"]*?"|[^ "]*)/g,""); //and words with neither if(queryplus==null) //no plus words? resarr=getintersection(resarr,search(querynotplus,2)); //normal search else{ for(var i=0;i").first().append($("
Subject
").click(function(){ $(".dev_aktsort_down").removeClass("dev_aktsort_down"); $(".dev_aktsort_up").removeClass("dev_aktsort_up"); if(resarr==null)return; //no notes to sort if(aktsort==0){ //toggle between 0 and 1 $(this).addClass("dev_aktsort_up"); aktsort=1; resarr=resarr.sort(function(a,b){return notetitle[aktfolder][a].toLowerCase()<=notetitle[aktfolder][b].toLowerCase();}); //sort subjects ascending }else{ $(this).addClass("dev_aktsort_down"); aktsort=0; resarr=resarr.sort(function(a,b){return notetitle[aktfolder][a].toLowerCase()>=notetitle[aktfolder][b].toLowerCase();}); //sort subjects descending } displayresarr(); //show sorted notes })).first().append($("
Username
").click(function(){ $(".dev_aktsort_down").removeClass("dev_aktsort_down"); $(".dev_aktsort_up").removeClass("dev_aktsort_up"); if(resarr==null)return; if(aktsort==2){//toggle between 2 and 3 $(this).addClass("dev_aktsort_up"); aktsort=3; resarr=resarr.sort(function(a,b){return noteauthor[aktfolder][a].toLowerCase()<=noteauthor[aktfolder][b].toLowerCase();}); //sort usernames ascending }else{ $(this).addClass("dev_aktsort_down"); aktsort=2; resarr=resarr.sort(function(a,b){return noteauthor[aktfolder][a].toLowerCase()>=noteauthor[aktfolder][b].toLowerCase();}); //sort usernames descending } displayresarr(); })).first().append($("
Date
").click(function(){ $(".dev_aktsort_up").removeClass("dev_aktsort_up"); $(".dev_aktsort_down").removeClass("dev_aktsort_down"); if(resarr==null)return; if(aktsort==4){//toggle between 4 and 5 $(this).addClass("dev_aktsort_up"); aktsort=5; resarr=resarr.sort(function(a,b){return notedata[aktfolder][a][2]>=notedata[aktfolder][b][2];}); //sort dates ascending }else{ $(this).addClass("dev_aktsort_down"); aktsort=4; resarr=resarr.sort(function(a,b){return notedata[aktfolder][a][2]<=notedata[aktfolder][b][2];}); //sort dates descending } displayresarr(); }))); displayresarr(); //show no notes at the beginning }); } function displayresarr(){ //show the notes which indices are in resarr var body=$("ul.notes").first(); body.empty(); //empty the old displayed list if(resarr==null)return; //new list empty? for(var i=0;i"+ ""+notetitle[aktfolder][resarr[i]]+""+ ""+noteauthor[aktfolder][resarr[i]]+""+ ""+(new Date(notedata[aktfolder][resarr[i]][2])).toLocaleString()+""+ "").click(function(){ //click on the li: $("li.current-note").removeClass("current-note"); $(this).addClass("current-note"); //note highlight location.href=location.href.replace(/\/\d+$/,"")+"/"+$(this).attr("data-noteid"); //adapt displayed url! DiFi.pushPost("Notes","display_note",[$(this).attr("data-folderid"),$(this).attr("data-noteid")],function(success,data){ //display the note via difi! $("div.push").first().html(""+ stripslashes(data.response.content.body)); //difi slashes lot of things... $("div.note-controls.current-note-actions").css("display",""); //otherwise, the buttons are hidden... }); DiFi.send(); })); } } var db; function indexedDBinit(neu){ //indexedDB: if(location.href.substring(location.href.length-("#killoldindex").length)=="#killoldindex"){ indexedDB.deleteDatabase('devnotesearch2'); location.href="http://www.deviantart.com/notifications/notes/#1_0/"; } var request = indexedDB.open("devnotesearch2",1); request.onerror = function(event) { console.log(event); }; request.onupgradeneeded = function(event) { if(event!=null)db = event.target.result; var objectStore = db.createObjectStore("devnotesearch2",{keyPath:"name"}); objectStore.createIndex("name", "name", { unique: true }); } request.onsuccess = function(event) { db = request.result; db.onabort = function(e) { db.close(); db = null; } // db = event.target.result; // var objectStore = db.createObjectStore("devnotesearch2",{keyPath:"name"}); // objectStore.createIndex("name", "name", { unique: true }); try{ transaction = db.transaction(["devnotesearch2"], "readwrite"); }catch(e){ request.onupgradeneeded(null); return; } objectStore = transaction.objectStore("devnotesearch2"); var putter=objectStore.put({name:"test",value:"erfolgreich"}); putter.onerror=function(event){console.log("ERR:",event);}; putter.onsuccess=function(event){}; objectStore.get("test").onsuccess=function(event){ //load authorlist if(typeof event.target.result!="undefined")console.log(event.target.result.value); }; transaction.onerror = function(event) { console.log(event) }; GM_setValue=function(Gname,Gvalue){//{name:Gname,value:Gvalue} // transaction = db.transaction(["devnotesearch2"], "readwrite"); // var objectStore = transaction.objectStore("devnotesearch2"); // transaction.onerror = function(event) { // console.log(event) // }; items.push({name:Gname,value:Gvalue}); if($("#overlaysavingprocess").length==0) $("body").append($("
Saving Data...
")); else $("#overlaysavingprocess").attr("len",parseInt($("#overlaysavingprocess").attr("len"))+1); // var putter=objectStore.put(data);//{name:Gname,value:Gvalue} // putter.onerror=function(event){console.log("ERR:",event);}; // putter.onsuccess=function(event){ // $("#overlaysavingprocess").attr("len",parseInt($("#overlaysavingprocess").attr("len"))-1); // if($("#overlaysavingprocess").attr("len")==0)$("#overlaysavingprocess").remove(); // }; if(!safeworking)putNext(); }; function putNext() { if(!safeworking){ transaction = db.transaction(["devnotesearch2"], "readwrite"); objectStore = transaction.objectStore("devnotesearch2"); } if (items.length>0){ safeworking=true; objectStore.put(items.shift()).onsuccess = putNext; $("#overlaysavingprocess").attr("len",parseInt($("#overlaysavingprocess").attr("len"))-1); if($("#overlaysavingprocess").attr("len")==0)$("#overlaysavingprocess").remove(); } else { // complete safeworking=false; } } addlayout(); }; } var items=[]; var safeworking=false; indexedDBinit(); }; // GM_xmlhttpRequest({ // url:"http://phi.pf-control.de/jquery_min.js", // method:"GET", // onload: function(data){ // eval(data.responseText); // injected(); // } // }); var el=document.createElement("script"); el.innerHTML="("+injected.toString()+")();"; document.body.appendChild(el);