Permalink
Browse files

removing Scriptish_openFolder because the amo vaildator is complainin…

…g about the use of launch(), which doesn't seem necessary to me anyhow.
  • Loading branch information...
1 parent 74f6798 commit df0f2f5588b0561a395afc75befaff9a39587836 @erikvold erikvold committed Sep 24, 2012
View
2 extension/content/addonstab.xml
@@ -27,7 +27,7 @@
break;
case "button_scriptish_userscript_show":
- Scriptish_openFolder(addon._file);
+ addon._file.reveal();
break;
}
]]></handler>
View
3 extension/content/js/addonstab.js
@@ -4,7 +4,6 @@ const {lazyImport, lazyUtil} = tools;
lazyImport(window, "resource://scriptish/config.js", ["Scriptish_config"]);
lazyImport(window, "resource://scriptish/prefmanager.js", ["Scriptish_prefRoot"]);
-lazyImport(window, "resource://scriptish/third-party/Scriptish_openFolder.js", ["Scriptish_openFolder"]);
lazyUtil(window, "ExtendedStringBundle");
lazyUtil(window, "installUri");
@@ -94,7 +93,7 @@ window.addEventListener("load", function() {
};
gViewController.commands.cmd_scriptish_userscript_show = {
isEnabled: addonIsInstalledScript,
- doCommand: function(aAddon) Scriptish_openFolder(aAddon._file)
+ doCommand: function(aAddon) aAddon._file.reveal()
};
gViewController.commands.cmd_scriptish_userscript_dl_link = {
isEnabled: function(aAddon) {
View
4 extension/modules/constants.js
@@ -69,10 +69,6 @@ lazyService(
lazyService(
Services, "cs", "@mozilla.org/consoleservice;1", "nsIConsoleService");
-lazyService(
- Services, "eps", "@mozilla.org/uriloader/external-protocol-service;1",
- "nsIExternalProtocolService");
-
if (Cc["@mozilla.org/privatebrowsing;1"]) {
lazyService(
Services, "pbs", "@mozilla.org/privatebrowsing;1",
View
66 extension/modules/third-party/Scriptish_openFolder.js
@@ -1,66 +0,0 @@
-/**** BEGIN LICENSE BLOCK *****
-Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
-The contents of this file are subject to the Mozilla Public License Version
-1.1 (the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-http://www.mozilla.org/MPL/
-
-Software distributed under the License is distributed on an "AS IS" basis,
-WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-for the specific language governing rights and limitations under the
-License.
-
-The Original Code is Mozilla.org Code.
-
-The Initial Developer of the Original Code is
-Netscape Communications Corporation.
-Portions created by the Initial Developer are Copyright (C) 2001
-the Initial Developer. All Rights Reserved.
-
-Contributor(s):
- Blake Ross <blakeross@telocity.com> (Original Author)
- Ben Goodger <ben@bengoodger.com> (v2.0)
- Dan Mosedale <dmose@mozilla.org>
- Fredrik Holmqvist <thesuckiestemail@yahoo.se>
- Josh Aas <josh@mozilla.com>
- Shawn Wilsher <me@shawnwilsher.com> (v3.0)
- Edward Lee <edward.lee@engineering.uiuc.edu>
-
- Anthony Lieuallen <arantius@gmail.com>
- Mike Medley <medleymind@gmail.com>
- Erik Vold <erikvvold@gmail.com>
-
-Alternatively, the contents of this file may be used under the terms of
-either the GNU General Public License Version 2 or later (the "GPL"), or
-the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-in which case the provisions of the GPL or the LGPL are applicable instead
-of those above. If you wish to allow use of your version of this file only
-under the terms of either the GPL or the LGPL, and not to allow others to
-use your version of this file under the terms of the MPL, indicate your
-decision by deleting the provisions above and replace them with the notice
-and other provisions required by the GPL or the LGPL. If you do not delete
-the provisions above, a recipient may use your version of this file under
-the terms of any one of the MPL, the GPL or the LGPL.
-
-***** END LICENSE BLOCK ****/
-var EXPORTED_SYMBOLS = ["Scriptish_openFolder"];
-Components.utils.import("resource://scriptish/constants.js");
-
-function Scriptish_openFolder(aFile) {
- try {
- // Show the directory containing the file and select the file.
- aFile.reveal();
- } catch (e) {
- // Either the file doesn't exist or reveal is not implemented
- var fParent = aFile.parent;
-
- try {
- // Lauch the parent directory if the file doesn't exist.
- if (fParent.exists()) fParent.launch();
- } catch (e) {
- // If launch also fails let the OS handler try to open the parent.
- Services.eps.loadUrl(Services.io.newFileURI(fParent));
- }
- }
-}

0 comments on commit df0f2f5

Please sign in to comment.