Merge pull request #53 from northword/remove-zo6-code
Z7-related: remove zo6 code, add homepage url, and add vscode-fluent
This commit is contained in:
		
						commit
						eeb1ace01d
					
				
							
								
								
									
										6
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
 | 
					  "recommendations": [
 | 
				
			||||||
 | 
					    "dbaeumer.vscode-eslint",
 | 
				
			||||||
 | 
					    "esbenp.prettier-vscode",
 | 
				
			||||||
 | 
					    "macabeus.vscode-fluent"
 | 
				
			||||||
 | 
					  ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										42
									
								
								addon/bootstrap.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								addon/bootstrap.js
									
									
									
									
										vendored
									
									
								
							@ -71,17 +71,13 @@ async function startup({ id, version, resourceURI, rootURI }, reason) {
 | 
				
			|||||||
    rootURI = resourceURI.spec;
 | 
					    rootURI = resourceURI.spec;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (Zotero.platformMajorVersion >= 102) {
 | 
					  var aomStartup = Components.classes[
 | 
				
			||||||
    var aomStartup = Components.classes[
 | 
					    "@mozilla.org/addons/addon-manager-startup;1"
 | 
				
			||||||
      "@mozilla.org/addons/addon-manager-startup;1"
 | 
					  ].getService(Components.interfaces.amIAddonManagerStartup);
 | 
				
			||||||
    ].getService(Components.interfaces.amIAddonManagerStartup);
 | 
					  var manifestURI = Services.io.newURI(rootURI + "manifest.json");
 | 
				
			||||||
    var manifestURI = Services.io.newURI(rootURI + "manifest.json");
 | 
					  chromeHandle = aomStartup.registerChrome(manifestURI, [
 | 
				
			||||||
    chromeHandle = aomStartup.registerChrome(manifestURI, [
 | 
					    ["content", "__addonRef__", rootURI + "chrome/content/"],
 | 
				
			||||||
      ["content", "__addonRef__", rootURI + "chrome/content/"],
 | 
					  ]);
 | 
				
			||||||
    ]);
 | 
					 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    setDefaultPrefs(rootURI);
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * Global variables for plugin code.
 | 
					   * Global variables for plugin code.
 | 
				
			||||||
@ -124,27 +120,3 @@ function shutdown({ id, version, resourceURI, rootURI }, reason) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function uninstall(data, reason) {}
 | 
					function uninstall(data, reason) {}
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Loads default preferences from defaults/preferences/prefs.js in Zotero 6
 | 
					 | 
				
			||||||
function setDefaultPrefs(rootURI) {
 | 
					 | 
				
			||||||
  var branch = Services.prefs.getDefaultBranch("");
 | 
					 | 
				
			||||||
  var obj = {
 | 
					 | 
				
			||||||
    pref(pref, value) {
 | 
					 | 
				
			||||||
      switch (typeof value) {
 | 
					 | 
				
			||||||
        case "boolean":
 | 
					 | 
				
			||||||
          branch.setBoolPref(pref, value);
 | 
					 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
        case "string":
 | 
					 | 
				
			||||||
          branch.setStringPref(pref, value);
 | 
					 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
        case "number":
 | 
					 | 
				
			||||||
          branch.setIntPref(pref, value);
 | 
					 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
          Zotero.logError(`Invalid type '${typeof value}' for pref '${pref}'`);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
  Zotero.getMainWindow().console.log(rootURI + "prefs.js");
 | 
					 | 
				
			||||||
  Services.scriptloader.loadSubScript(rootURI + "prefs.js", obj);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -3,6 +3,7 @@
 | 
				
			|||||||
  "name": "__addonName__",
 | 
					  "name": "__addonName__",
 | 
				
			||||||
  "version": "__buildVersion__",
 | 
					  "version": "__buildVersion__",
 | 
				
			||||||
  "description": "__description__",
 | 
					  "description": "__description__",
 | 
				
			||||||
 | 
					  "homepage_url": "__homepage__",
 | 
				
			||||||
  "author": "__author__",
 | 
					  "author": "__author__",
 | 
				
			||||||
  "icons": {
 | 
					  "icons": {
 | 
				
			||||||
    "48": "chrome/content/icons/favicon@0.5x.png",
 | 
					    "48": "chrome/content/icons/favicon@0.5x.png",
 | 
				
			||||||
 | 
				
			|||||||
@ -131,13 +131,9 @@ async function main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  const optionsAddon = {
 | 
					  const optionsAddon = {
 | 
				
			||||||
    files: [
 | 
					    files: [
 | 
				
			||||||
      join(buildDir, "**/*.rdf"),
 | 
					 | 
				
			||||||
      join(buildDir, "**/*.dtd"),
 | 
					 | 
				
			||||||
      join(buildDir, "**/*.xul"),
 | 
					 | 
				
			||||||
      join(buildDir, "**/*.xhtml"),
 | 
					      join(buildDir, "**/*.xhtml"),
 | 
				
			||||||
      join(buildDir, "**/*.json"),
 | 
					      join(buildDir, "**/*.json"),
 | 
				
			||||||
      join(buildDir, "addon/prefs.js"),
 | 
					      join(buildDir, "addon/prefs.js"),
 | 
				
			||||||
      join(buildDir, "addon/chrome.manifest"),
 | 
					 | 
				
			||||||
      join(buildDir, "addon/manifest.json"),
 | 
					      join(buildDir, "addon/manifest.json"),
 | 
				
			||||||
      join(buildDir, "addon/bootstrap.js"),
 | 
					      join(buildDir, "addon/bootstrap.js"),
 | 
				
			||||||
      "update.json",
 | 
					      "update.json",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user