Skip to content

Commit

Permalink
FF57+GM4 warning & localStorage auto backup
Browse files Browse the repository at this point in the history
* Added a warning for Greasemonkey users about the upcoming changes and
automatically backed up their settings with the old method to
localStorage.
  • Loading branch information
Moebius-Strip committed Nov 12, 2017
1 parent 46502c5 commit 2aa4adf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion better-better-booru.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ function bbbScript() { // Wrapper for injecting the script into the document.
helpButton.href = "#";
helpButton.innerHTML = "Help";
helpButton.className = "bbb-list-button";
helpButton.bbbSetTip("<b>Name:</b> The name you want to refer to this group of tags by when using the group metatag. Names may not contain spaces or commas. <tipdesc>Tags:</tipdesc> Describes the posts that the group should match. Please read the \"thumbnail matching rules\" section under the help tab for information about creating rules. When used, all tags in a group are treated as if they're grouped/nested together (enclosed in parentheses). <tipdesc>Move:</tipdesc> Move the group to a new position. The order of groups affects the order they display in for tag autocomplete. <tipdesc>Delete:</tipdesc> Remove the group and its settings.<tipdesc>New:</tipdesc> Create a new group. <tiphead>Example</tiphead>If given a group named\"hidden\" that contains \"~loli ~shota ~toddlercon ~status:banned\" for its tags, a search for \"rating:questionable -group:hidden\" would behave like \"rating:questionable -( ~loli ~shota ~toddlercon ~status:banned )\".<tiphead>Tips</tiphead>The \"group\" metatag can be shortened to \"g\". <br><br>Groups used by themselves with the quick search option can provide a saved search functionality.<br><br>A blacklist or border entry (especially a complex one) that you want to work exclusively from other entries can be assigned to a group and excluded from other entries by using \"-group:entryname\". Updating that group will then update all entries linked to it. Similarly, tags you want shared across multiple entries can just use \"group:entryname\".");
helpButton.bbbSetTip("<b>Name:</b> The name you want to refer to this group of tags by when using the group metatag. Names may not contain spaces or commas. <tipdesc>Tags:</tipdesc> Describes the posts that the group should match. Please read the \"thumbnail matching rules\" section under the help tab for information about creating rules. When used, all tags in a group are treated as if they're grouped/nested together (enclosed in parentheses). <tipdesc>Move:</tipdesc> Move the group to a new position. The order of groups affects the order they display in for tag autocomplete. <tipdesc>Delete:</tipdesc> Remove the group and its settings.<tipdesc>New:</tipdesc> Create a new group. <tiphead>Example</tiphead>If given a group named \"hidden\" that contains \"~loli ~shota ~toddlercon ~status:banned\" for its tags, a search for \"rating:questionable -group:hidden\" would behave like \"rating:questionable -( ~loli ~shota ~toddlercon ~status:banned )\".<tiphead>Tips</tiphead>The \"group\" metatag can be shortened to \"g\". <br><br>Groups used by themselves with the quick search option can provide a saved search functionality.<br><br>A blacklist or border entry (especially a complex one) that you want to work exclusively from other entries can be assigned to a group and excluded from other entries by using \"-group:entryname\". Updating that group will then update all entries linked to it. Similarly, tags you want shared across multiple entries can just use \"group:entryname\".");
editSpan.appendChild(helpButton);

var groupSettingsDiv = document.createElement("div");
Expand Down Expand Up @@ -3344,6 +3344,12 @@ function bbbScript() { // Wrapper for injecting the script into the document.

deleteData("bbb_thumb_cache");
case "8.0":
case "8.0.1":
if (reason !== "backup") {
cleanLocalStorage("autocomplete");
localStorage.bbbSetItem("bbb_settings", JSON.stringify(bbb.user));
bbbNotice("Upon the release of Firefox 57 and the move over to Greasemonkey 4, BBB will not be able to fully support Greasemonkey due to decisions the developers have made about loading and saving data. Greasemonkey users will have to revert back to using an older storage method that will still work while suffering a few disadvantages. Those disadvantages include: 1) A much more limited amount of space for storage. 2) The inability to have your settings persist across all Danbooru subdomains and during private browsing. If you are reading this, a copy of your settings has already been saved using the old method, but it is advised that you create a separate backup before updating to Firefox 57 to collect any new changes and/or guard against any unforeseen problems.", 0);
}
break;
}

Expand Down

0 comments on commit 2aa4adf

Please sign in to comment.