This file is indexed.

/usr/share/xul-ext/status4evar/modules/Australis.jsm is in xul-ext-status4evar 2014.07.06.05-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/*
 * ***** BEGIN LICENSE BLOCK *****
 * 
 * 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/.
 * 
 * Copyright (C) 2013-2014 Matthew Turnbull <sparky@bluefang-logic.com>. All Rights Reserved.
 * 
 * ***** END LICENSE BLOCK *****
*/

"use strict";

const EXPORTED_SYMBOLS = ["AustralisTools"];

const CU = Components.utils;

const STATUS_BAR_ID = "status4evar-status-bar";
const LEGACY_SHIM_ID = "status4evar-legacy-widget";
const DEFAULT_WIDGETS = ["status4evar-status-widget", "status4evar-download-button", "status4evar-progress-widget"];
const DEFAULT_POSITIONS = [0, 1, 2];

CU.import("resource:///modules/CustomizableUI.jsm");
CU.import("resource://gre/modules/Services.jsm");
CU.import("resource://services-common/stringbundle.js");

const strings = new StringBundle("chrome://status4evar/locale/overlay.properties");

CustomizableUI.registerArea(STATUS_BAR_ID, {
	type: CustomizableUI.TYPE_TOOLBAR,
	defaultPlacements: DEFAULT_WIDGETS
});

let AustralisTools = {
	migrateOnce: false,

	migrate: function()
	{
		if(this.migrateOnce)
		{
			return;
		}
		this.migrateOnce = true;

		DEFAULT_WIDGETS.forEach(function(id, index) {
			let placement = CustomizableUI.getPlacementOfWidget(id);
			if(!placement || placement.area === CustomizableUI.AREA_NAVBAR || placement.area === STATUS_BAR_ID)
			{
				Services.console.logStringMessage("S4E Australis migration - moving widget: " + id + " [" + CustomizableUI.isWidgetRemovable(id) + "]");
				CustomizableUI.addWidgetToArea(id, STATUS_BAR_ID, DEFAULT_POSITIONS[index]);
			}
			else if(id === DEFAULT_WIDGETS[0])
			{
				Services.console.logStringMessage("S4E Australis migration - adding spring");
				CustomizableUI.addWidgetToArea("spring", STATUS_BAR_ID, DEFAULT_POSITIONS[index]);
			}
		});

		CustomizableUI.setToolbarVisibility(STATUS_BAR_ID, true);
	},

	updateLegacyShim: function(action)
	{
		if(action)
		{
			this.initLegacyShim();

			let placement = CustomizableUI.getPlacementOfWidget(LEGACY_SHIM_ID);
			if(!placement) {
				CustomizableUI.addWidgetToArea(LEGACY_SHIM_ID, STATUS_BAR_ID);
				CustomizableUI.setToolbarVisibility(STATUS_BAR_ID, true);
			}
		}
		else
		{
			this.destroyLegacyShim();
		}
	},

	initLegacyShim: function()
	{
		CustomizableUI.createWidget({
			id: LEGACY_SHIM_ID,
			type: "custom",
			defaultArea: STATUS_BAR_ID,
			onBuild: function(doc)
			{
				let item = doc.createElement("toolbaritem");
				item.id = LEGACY_SHIM_ID;
				item.setAttribute("removable", true);
				item.setAttribute("label", strings.get("legacyWidgetTitle"));
				item.setAttribute("class", "panel-wide-item");
				item.setAttribute("closemenu", "none");
				item.appendChild(doc.getElementById("status-bar") || palette.querySelector("status-bar"));

				item.watcher = new doc.defaultView.MutationObserver(function(mutations)
				{
					if(!item.hasChildNodes())
					{
						Services.console.logStringMessage("S4E Repairing widget: " + LEGACY_SHIM_ID);
						item.appendChild(doc.getElementById("status-bar"));
					}
				});
				item.watcher.observe(item, { childList: true });

				return item;
			}
		});
	},

	destroyLegacyShim: function()
	{
		let widgetInfo = CustomizableUI.getWidget(LEGACY_SHIM_ID);
		if(widgetInfo)
		{
			widgetInfo.disabled = true;

			widgetInfo.instances.forEach(function(instance)
			{
				let item = instance.node;

				item.watcher.disconnect();

				if(item.firstChild && item.firstChild.id === "status-bar")
				{
					item.ownerDocument.getElementById("addon-bar").appendChild(item.firstChild);
				}
			});
		}

		CustomizableUI.destroyWidget(LEGACY_SHIM_ID);
	}
}

let statusBarHandler = {

	customizing: false,

	getSpringId: function(aArea)
	{
		let springId = null;

		let widgetIds = CustomizableUI.getWidgetIdsInArea(aArea);
		if(widgetIds)
		{
			let widgetId = null;
			for(let i = 0; i < widgetIds.length; i++)
			{
				widgetId = widgetIds[i];
				if(CustomizableUI.isSpecialWidget(widgetId) && widgetId.indexOf('spring') > 0)
				{
					springId = widgetId;
					break;
				}
			}
		}

		return springId;
	},

	updateWindows: function()
	{
		for(let window of CustomizableUI.windows)
		{
			window.caligon.status4evar.updateWindow();
		}
	},

	onWidgetAdded: function(aWidgetId, aArea, aPosition)
	{
		if(aArea === STATUS_BAR_ID && aWidgetId === DEFAULT_WIDGETS[0])
		{
			let springId = this.getSpringId(aArea);
			if(springId)
			{
				CustomizableUI.removeWidgetFromArea(springId, STATUS_BAR_ID, DEFAULT_POSITIONS[0]);
			}
		}

		if(!this.customizing && DEFAULT_WIDGETS.indexOf(aWidgetId))
		{
			this.updateWindows();
		}
	},

	onWidgetRemoved: function(aWidgetId, aArea)
	{
		if(aArea === STATUS_BAR_ID && aWidgetId === DEFAULT_WIDGETS[0])
		{
			CustomizableUI.addWidgetToArea("spring", STATUS_BAR_ID, DEFAULT_POSITIONS[0]);
		}

		if(!this.customizing && DEFAULT_WIDGETS.indexOf(aWidgetId))
		{
			this.updateWindows();
		}
	},

	onCustomizeStart: function(aWindow)
	{
		this.customizing = true;
		aWindow.caligon.status4evar.beforeCustomization();
	},

	onCustomizeEnd: function(aWindow)
	{
		this.customizing = false;
		this.updateWindows();
	}
}

CustomizableUI.addListener(statusBarHandler);