From be18578af63e60da83d25e44fa731213ddf087e2 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 23 Feb 2018 13:41:53 -0500 Subject: Revert "Restore toolkit/obsolete" This reverts commit b61927d4cdb92636758c4c80d5050b3266486529. --- toolkit/moz.build | 1 - toolkit/obsolete/content/dialogOverlay.js | 107 ------------------------ toolkit/obsolete/content/dialogOverlay.xul | 101 ----------------------- toolkit/obsolete/content/globalOverlay.xul | 38 --------- toolkit/obsolete/content/inlineSpellCheckUI.js | 7 -- toolkit/obsolete/content/nsClipboard.js | 64 --------------- toolkit/obsolete/content/nsUserSettings.js | 108 ------------------------- toolkit/obsolete/content/strres.js | 28 ------- toolkit/obsolete/jar.mn | 12 --- toolkit/obsolete/moz.build | 7 -- 10 files changed, 473 deletions(-) delete mode 100644 toolkit/obsolete/content/dialogOverlay.js delete mode 100644 toolkit/obsolete/content/dialogOverlay.xul delete mode 100644 toolkit/obsolete/content/globalOverlay.xul delete mode 100644 toolkit/obsolete/content/inlineSpellCheckUI.js delete mode 100644 toolkit/obsolete/content/nsClipboard.js delete mode 100644 toolkit/obsolete/content/nsUserSettings.js delete mode 100644 toolkit/obsolete/content/strres.js delete mode 100644 toolkit/obsolete/jar.mn delete mode 100644 toolkit/obsolete/moz.build (limited to 'toolkit') diff --git a/toolkit/moz.build b/toolkit/moz.build index 9444a5179..d9becc9c6 100644 --- a/toolkit/moz.build +++ b/toolkit/moz.build @@ -14,7 +14,6 @@ DIRS += [ 'mozapps/downloads', 'mozapps/handling', 'mozapps/preferences', - 'obsolete', 'pluginproblem', 'profile', 'themes', diff --git a/toolkit/obsolete/content/dialogOverlay.js b/toolkit/obsolete/content/dialogOverlay.js deleted file mode 100644 index 4b03f268f..000000000 --- a/toolkit/obsolete/content/dialogOverlay.js +++ /dev/null @@ -1,107 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -var doOKFunction = 0; -var doCancelFunction = 0; -var doButton2Function = 0; -var doButton3Function = 0; - -// call this from dialog onload() to allow ok and cancel to call your code -// functions should return true if they want the dialog to close -function doSetOKCancel(okFunc, cancelFunc, button2Func, button3Func ) -{ - //dump("top.window.navigator.platform: " + top.window.navigator.platform + "\n"); - - doOKFunction = okFunc; - doCancelFunction = cancelFunc; - doButton2Function = button2Func; - doButton3Function = button3Func; -} - -function doOKButton() -{ - var close = true; - - if ( doOKFunction ) - close = doOKFunction(); - - if (close && top) - top.window.close(); -} - -function doCancelButton() -{ - var close = true; - - if ( doCancelFunction ) - close = doCancelFunction(); - - if (close && top) - top.window.close(); -} - -function doButton2() -{ - var close = true; - - if ( doButton2Function ) - close = doButton2Function(); - - if (close && top) - top.window.close(); -} - -function doButton3() -{ - var close = true; - - if ( doButton3Function ) - close = doButton3Function(); - - if (close && top) - top.window.close(); -} - -function moveToAlertPosition() -{ - // hack. we need this so the window has something like its final size - if (window.outerWidth == 1) { - dump("Trying to position a sizeless window; caller should have called sizeToContent() or sizeTo(). See bug 75649.\n"); - sizeToContent(); - } - - if (opener) { - var xOffset = (opener.outerWidth - window.outerWidth) / 2; - var yOffset = opener.outerHeight / 5; - - var newX = opener.screenX + xOffset; - var newY = opener.screenY + yOffset; - } else { - newX = (screen.availWidth - window.outerWidth) / 2; - newY = (screen.availHeight - window.outerHeight) / 2; - } - - // ensure the window is fully onscreen (if smaller than the screen) - if (newX < screen.availLeft) - newX = screen.availLeft + 20; - if ((newX + window.outerWidth) > (screen.availLeft + screen.availWidth)) - newX = (screen.availLeft + screen.availWidth) - window.outerWidth - 20; - - if (newY < screen.availTop) - newY = screen.availTop + 20; - if ((newY + window.outerHeight) > (screen.availTop + screen.availHeight)) - newY = (screen.availTop + screen.availHeight) - window.outerHeight - 60; - - window.moveTo( newX, newY ); -} - -function centerWindowOnScreen() -{ - var xOffset = screen.availWidth/2 - window.outerWidth/2; - var yOffset = screen.availHeight/2 - window.outerHeight/2; //(opener.outerHeight *2)/10; - - xOffset = ( xOffset > 0 ) ? xOffset : 0; - yOffset = ( yOffset > 0 ) ? yOffset : 0; - window.moveTo( xOffset, yOffset); -} diff --git a/toolkit/obsolete/content/dialogOverlay.xul b/toolkit/obsolete/content/dialogOverlay.xul deleted file mode 100644 index 09e00613e..000000000 --- a/toolkit/obsolete/content/dialogOverlay.xul +++ /dev/null @@ -1,101 +0,0 @@ - -# -*- Mode: HTML -*- -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# WARNING!!! This file is obsoleted by the dialog.xml widget -# - - - - - - - - - - - - - diff --git a/toolkit/obsolete/content/inlineSpellCheckUI.js b/toolkit/obsolete/content/inlineSpellCheckUI.js deleted file mode 100644 index 177ce90cd..000000000 --- a/toolkit/obsolete/content/inlineSpellCheckUI.js +++ /dev/null @@ -1,7 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm"); - -var InlineSpellCheckerUI = new InlineSpellChecker(); diff --git a/toolkit/obsolete/content/nsClipboard.js b/toolkit/obsolete/content/nsClipboard.js deleted file mode 100644 index d9f7c4589..000000000 --- a/toolkit/obsolete/content/nsClipboard.js +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * nsClipboard - wrapper around nsIClipboard and nsITransferable - * that simplifies access to the clipboard. - **/ -var nsClipboard = { - _CB: null, - get mClipboard() - { - if (!this._CB) - { - const kCBContractID = "@mozilla.org/widget/clipboard;1"; - const kCBIID = Components.interfaces.nsIClipboard; - this._CB = Components.classes[kCBContractID].getService(kCBIID); - } - return this._CB; - }, - - currentClipboard: null, - /** - * Array/Object read (Object aFlavourList, long aClipboard, Bool aAnyFlag) ; - * - * returns the data in the clipboard - * - * @param FlavourSet aFlavourSet - * formatted list of desired flavours - * @param long aClipboard - * the clipboard to read data from (kSelectionClipboard/kGlobalClipboard) - * @param Bool aAnyFlag - * should be false. - **/ - read: function (aFlavourList, aClipboard, aAnyFlag) - { - this.currentClipboard = aClipboard; - var data = nsTransferable.get(aFlavourList, this.getClipboardTransferable, aAnyFlag); - return data.first.first; // only support one item - }, - - /** - * nsISupportsArray getClipboardTransferable (Object aFlavourList) ; - * - * returns a nsISupportsArray of the item on the clipboard - * - * @param Object aFlavourList - * formatted list of desired flavours. - **/ - getClipboardTransferable: function (aFlavourList) - { - const supportsContractID = "@mozilla.org/supports-array;1"; - const supportsIID = Components.interfaces.nsISupportsArray; - var supportsArray = Components.classes[supportsContractID].createInstance(supportsIID); - var trans = nsTransferable.createTransferable(); - for (var flavour in aFlavourList) - trans.addDataFlavor(flavour); - nsClipboard.mClipboard.getData(trans, nsClipboard.currentClipboard) - supportsArray.AppendElement(trans); - return supportsArray; - } -}; - diff --git a/toolkit/obsolete/content/nsUserSettings.js b/toolkit/obsolete/content/nsUserSettings.js deleted file mode 100644 index e0c378caf..000000000 --- a/toolkit/obsolete/content/nsUserSettings.js +++ /dev/null @@ -1,108 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -/** - * nsPreferences - a wrapper around nsIPrefService. Provides built in - * exception handling to make preferences access simpler. - **/ -var nsPreferences = { - get mPrefService() - { - return Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); - }, - - setBoolPref: function (aPrefName, aPrefValue) - { - try - { - this.mPrefService.setBoolPref(aPrefName, aPrefValue); - } - catch (e) - { - } - }, - - getBoolPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getBoolPref(aPrefName); - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - setUnicharPref: function (aPrefName, aPrefValue) - { - try - { - var str = Components.classes["@mozilla.org/supports-string;1"] - .createInstance(Components.interfaces.nsISupportsString); - str.data = aPrefValue; - this.mPrefService.setComplexValue(aPrefName, - Components.interfaces.nsISupportsString, str); - } - catch (e) - { - } - }, - - copyUnicharPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getComplexValue(aPrefName, - Components.interfaces.nsISupportsString).data; - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - setIntPref: function (aPrefName, aPrefValue) - { - try - { - this.mPrefService.setIntPref(aPrefName, aPrefValue); - } - catch (e) - { - } - }, - - getIntPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getIntPref(aPrefName); - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - }, - - getLocalizedUnicharPref: function (aPrefName, aDefVal) - { - try - { - return this.mPrefService.getComplexValue(aPrefName, - Components.interfaces.nsIPrefLocalizedString).data; - } - catch (e) - { - return aDefVal != undefined ? aDefVal : null; - } - return null; // quiet warnings - } -}; - diff --git a/toolkit/obsolete/content/strres.js b/toolkit/obsolete/content/strres.js deleted file mode 100644 index 928c8f75f..000000000 --- a/toolkit/obsolete/content/strres.js +++ /dev/null @@ -1,28 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -var strBundleService = null; - -function srGetStrBundle(path) -{ - var strBundle = null; - - if (!strBundleService) { - try { - strBundleService = - Components.classes["@mozilla.org/intl/stringbundle;1"].getService(); - strBundleService = - strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService); - } catch (ex) { - dump("\n--** strBundleService failed: " + ex + "\n"); - return null; - } - } - - strBundle = strBundleService.createBundle(path); - if (!strBundle) { - dump("\n--** strBundle createInstance failed **--\n"); - } - return strBundle; -} diff --git a/toolkit/obsolete/jar.mn b/toolkit/obsolete/jar.mn deleted file mode 100644 index 95d86da2f..000000000 --- a/toolkit/obsolete/jar.mn +++ /dev/null @@ -1,12 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -toolkit.jar: - content/global/globalOverlay.xul (content/globalOverlay.xul) -* content/global/dialogOverlay.xul (content/dialogOverlay.xul) - content/global/dialogOverlay.js (content/dialogOverlay.js) - content/global/inlineSpellCheckUI.js (content/inlineSpellCheckUI.js) - content/global/nsClipboard.js (content/nsClipboard.js) - content/global/nsUserSettings.js (content/nsUserSettings.js) - content/global/strres.js (content/strres.js) diff --git a/toolkit/obsolete/moz.build b/toolkit/obsolete/moz.build deleted file mode 100644 index eb4454d28..000000000 --- a/toolkit/obsolete/moz.build +++ /dev/null @@ -1,7 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file -- cgit v1.2.3