Skip to content

Commit

Permalink
Avoid Cc/Ci boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlegewie committed Oct 20, 2019
1 parent 734b44d commit 32852cd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions chrome/content/zotfile/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var Zotero = Components.classes["@zotero.org/Zotero;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;

Components.utils.import("resource://gre/modules/osfile.jsm")
Components.utils.import("resource://gre/modules/osfile.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");

// function to disable prefernce in pref window
// 'pref' can be passed as string or array
Expand Down Expand Up @@ -115,9 +116,7 @@ var updatePreferenceWindow = function (which) {
var checkRenameFormat = function(which) {
try {
// get current item
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var win = Services.wm.getMostRecentWindow("navigator:browser");
var items = win.ZoteroPane.getSelectedItems();
var item = items.length > 0 ? items[0] : Zotero.Items.get(1);
// get renaming rules
Expand Down Expand Up @@ -242,9 +241,7 @@ var checkFolderLocation = Zotero.Promise.coroutine(function* (folder) {
var previewFilename = function() {
try {
// get current item
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
var win = Services.wm.getMostRecentWindow("navigator:browser");
var items = win.ZoteroPane.getSelectedItems();
var item = items[0];
// get renaming rules
Expand Down

0 comments on commit 32852cd

Please sign in to comment.