Don't use double quotes for things that don't need to be translated

This is our convention.

The only exceptions are double quotes for words in comments that give
them a special meaning (though beware that these quotes are not truly
necessary most of the time) and double quotes that need to be a part
of the output string.
This commit is contained in:
Marina Zhurakhinskaya 2010-05-13 15:46:04 -04:00
parent c7ec84eb33
commit 703b21cef0
28 changed files with 248 additions and 248 deletions

View File

@ -120,7 +120,7 @@ AltTabPopup.prototype = {
show : function(backward) { show : function(backward) {
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
let apps = tracker.get_running_apps (""); let apps = tracker.get_running_apps ('');
if (!apps.length) if (!apps.length)
return false; return false;
@ -420,7 +420,7 @@ AltTabPopup.prototype = {
Tweener.addTween(this._thumbnails.actor, Tweener.addTween(this._thumbnails.actor,
{ opacity: 0, { opacity: 0,
time: THUMBNAIL_FADE_TIME, time: THUMBNAIL_FADE_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: function() { this.destroy(); } onComplete: function() { this.destroy(); }
}); });
this._thumbnails = null; this._thumbnails = null;
@ -437,7 +437,7 @@ AltTabPopup.prototype = {
Tweener.addTween(this._thumbnails.actor, Tweener.addTween(this._thumbnails.actor,
{ opacity: 255, { opacity: 255,
time: THUMBNAIL_FADE_TIME, time: THUMBNAIL_FADE_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
} }
}; };
@ -761,7 +761,7 @@ function AppIcon(app) {
AppIcon.prototype = { AppIcon.prototype = {
_init: function(app) { _init: function(app) {
this.app = app; this.app = app;
this.actor = new St.BoxLayout({ style_class: "alt-tab-app", this.actor = new St.BoxLayout({ style_class: 'alt-tab-app',
vertical: true }); vertical: true });
this.icon = null; this.icon = null;
this._iconBin = new St.Bin(); this._iconBin = new St.Bin();
@ -948,7 +948,7 @@ ThumbnailList.prototype = {
let activeWorkspace = global.screen.get_active_workspace(); let activeWorkspace = global.screen.get_active_workspace();
// We fake the value of "separatorAdded" when the app has no window // We fake the value of 'separatorAdded' when the app has no window
// on the current workspace, to avoid displaying a useless separator in // on the current workspace, to avoid displaying a useless separator in
// that case. // that case.
let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace; let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace;
@ -964,10 +964,10 @@ ThumbnailList.prototype = {
separatorAdded = true; separatorAdded = true;
} }
let box = new St.BoxLayout({ style_class: "thumbnail-box", let box = new St.BoxLayout({ style_class: 'thumbnail-box',
vertical: true }); vertical: true });
let bin = new St.Bin({ style_class: "thumbnail" }); let bin = new St.Bin({ style_class: 'thumbnail' });
box.add_actor(bin); box.add_actor(bin);
this._thumbnailBins.push(bin); this._thumbnailBins.push(bin);

View File

@ -323,7 +323,7 @@ AppSearchProvider.prototype = {
}, },
expandSearch: function(terms) { expandSearch: function(terms) {
log("TODO expand search"); log('TODO expand search');
} }
}; };
@ -713,7 +713,7 @@ AppIconMenu.prototype = {
}, },
_appendSeparator: function () { _appendSeparator: function () {
let bin = new St.Bin({ style_class: "app-well-menu-separator" }); let bin = new St.Bin({ style_class: 'app-well-menu-separator' });
this._windowContainer.add_actor(bin); this._windowContainer.add_actor(bin);
}, },
@ -850,7 +850,7 @@ function WellGrid() {
WellGrid.prototype = { WellGrid.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ name: "dashAppWell", vertical: true }); this.actor = new St.BoxLayout({ name: 'dashAppWell', vertical: true });
// Pulled from CSS, but hardcode some defaults here // Pulled from CSS, but hardcode some defaults here
this._spacing = 0; this._spacing = 0;
this._item_size = 48; this._item_size = 48;
@ -1012,7 +1012,7 @@ AppWell.prototype = {
let favorites = AppFavorites.getAppFavorites().getFavoriteMap(); let favorites = AppFavorites.getAppFavorites().getFavoriteMap();
/* hardcode here pending some design about how exactly desktop contexts behave */ /* hardcode here pending some design about how exactly desktop contexts behave */
let contextId = ""; let contextId = '';
let running = this._tracker.get_running_apps(contextId); let running = this._tracker.get_running_apps(contextId);
let runningIds = this._appIdListToHash(running); let runningIds = this._appIdListToHash(running);

View File

@ -26,7 +26,7 @@ function BoxPointer(side, sourceActor, binProperties) {
BoxPointer.prototype = { BoxPointer.prototype = {
_init: function(arrowSide, sourceActor, binProperties) { _init: function(arrowSide, sourceActor, binProperties) {
if (arrowSide != St.Side.TOP) if (arrowSide != St.Side.TOP)
throw new Error("not implemented"); throw new Error('Not implemented');
this._arrowSide = arrowSide; this._arrowSide = arrowSide;
this._sourceActor = sourceActor; this._sourceActor = sourceActor;
this._arrowOrigin = 0; this._arrowOrigin = 0;

View File

@ -24,27 +24,27 @@ Calendar.prototype = {
// GTK+ by preference uses nl_langinfo (NL_TIME_FIRST_WEEKDAY). We probably // GTK+ by preference uses nl_langinfo (NL_TIME_FIRST_WEEKDAY). We probably
// should add a C function so we can do the full handling. // should add a C function so we can do the full handling.
this._weekStart = NaN; this._weekStart = NaN;
let weekStartString = Gettext_gtk20.gettext("calendar:week_start:0"); let weekStartString = Gettext_gtk20.gettext('calendar:week_start:0');
if (weekStartString.indexOf("calendar:week_start:") == 0) { if (weekStartString.indexOf('calendar:week_start:') == 0) {
this._weekStart = parseInt(weekStartString.substring(20)); this._weekStart = parseInt(weekStartString.substring(20));
} }
if (isNaN(this._weekStart) || this._weekStart < 0 || this._weekStart > 6) { if (isNaN(this._weekStart) || this._weekStart < 0 || this._weekStart > 6) {
log("Translation of 'calendar:week_start:0' in GTK+ is not correct"); log('Translation of "calendar:week_start:0" in GTK+ is not correct');
this._weekStart = 0; this._weekStart = 0;
} }
// Find the ordering for month/year in the calendar heading // Find the ordering for month/year in the calendar heading
switch (Gettext_gtk20.gettext("calendar:MY")) { switch (Gettext_gtk20.gettext('calendar:MY')) {
case "calendar:MY": case 'calendar:MY':
this._headerFormat = "%B %Y"; this._headerFormat = '%B %Y';
break; break;
case "calendar:YM": case 'calendar:YM':
this._headerFormat = "%Y %B"; this._headerFormat = '%Y %B';
break; break;
default: default:
log("Translation of 'calendar:MY' in GTK+ is not correct"); log('Translation of "calendar:MY" in GTK+ is not correct');
this._headerFormat = "%B %Y"; this._headerFormat = '%B %Y';
break; break;
} }
@ -52,7 +52,7 @@ Calendar.prototype = {
this.date = new Date(); this.date = new Date();
this.actor = new St.Table({ homogeneous: false, this.actor = new St.Table({ homogeneous: false,
style_class: "calendar", style_class: 'calendar',
reactive: true }); reactive: true });
this.actor.connect('scroll-event', this.actor.connect('scroll-event',
@ -63,21 +63,21 @@ Calendar.prototype = {
this.actor.add(this._topBox, this.actor.add(this._topBox,
{ row: 0, col: 0, col_span: 7 }); { row: 0, col: 0, col_span: 7 });
let [backlabel, forwardlabel] = ["&lt;", "&gt;"]; let [backlabel, forwardlabel] = ['&lt;', '&gt;'];
if (St.Widget.get_default_direction () == St.TextDirection.RTL) { if (St.Widget.get_default_direction () == St.TextDirection.RTL) {
[backlabel, forwardlabel] = [forwardlabel, backlabel]; [backlabel, forwardlabel] = [forwardlabel, backlabel];
} }
let back = new St.Button({ label: backlabel, style_class: 'calendar-change-month' }); let back = new St.Button({ label: backlabel, style_class: 'calendar-change-month' });
this._topBox.add(back); this._topBox.add(back);
back.connect("clicked", Lang.bind(this, this._prevMonth)); back.connect('clicked', Lang.bind(this, this._prevMonth));
this._dateLabel = new St.Label(); this._dateLabel = new St.Label();
this._topBox.add(this._dateLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE }); this._topBox.add(this._dateLabel, { expand: true, x_fill: false, x_align: St.Align.MIDDLE });
let forward = new St.Button({ label: forwardlabel, style_class: 'calendar-change-month' }); let forward = new St.Button({ label: forwardlabel, style_class: 'calendar-change-month' });
this._topBox.add(forward); this._topBox.add(forward);
forward.connect("clicked", Lang.bind(this, this._nextMonth)); forward.connect('clicked', Lang.bind(this, this._nextMonth));
// We need to figure out the abbreviated localized names for the days of the week; // We need to figure out the abbreviated localized names for the days of the week;
// we do this by just getting the next 7 days starting from right now and then putting // we do this by just getting the next 7 days starting from right now and then putting
@ -86,7 +86,7 @@ Calendar.prototype = {
iter.setSeconds(0); // Leap second protection. Hah! iter.setSeconds(0); // Leap second protection. Hah!
iter.setHours(12); iter.setHours(12);
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
this.actor.add(new St.Label({ text: iter.toLocaleFormat("%a") }), this.actor.add(new St.Label({ text: iter.toLocaleFormat('%a') }),
{ row: 1, { row: 1,
col: (7 + iter.getDay() - this._weekStart) % 7, col: (7 + iter.getDay() - this._weekStart) % 7,
x_fill: false, x_align: St.Align.END }); x_fill: false, x_align: St.Align.END });
@ -161,11 +161,11 @@ Calendar.prototype = {
while (true) { while (true) {
let label = new St.Label({ text: iter.getDate().toString() }); let label = new St.Label({ text: iter.getDate().toString() });
if (_sameDay(now, iter)) if (_sameDay(now, iter))
label.style_class = "calendar-day calendar-today"; label.style_class = 'calendar-day calendar-today';
else if (iter.getMonth() != this.date.getMonth()) else if (iter.getMonth() != this.date.getMonth())
label.style_class = "calendar-day calendar-other-month-day"; label.style_class = 'calendar-day calendar-other-month-day';
else else
label.style_class = "calendar-day"; label.style_class = 'calendar-day';
this.actor.add(label, this.actor.add(label,
{ row: row, col: (7 + iter.getDay() - this._weekStart) % 7, { row: row, col: (7 + iter.getDay() - this._weekStart) % 7,
x_fill: false, x_align: St.Align.END }); x_fill: false, x_align: St.Align.END });

View File

@ -249,7 +249,7 @@ Chrome.prototype = {
// The chrome layer should be visible unless there is a window // The chrome layer should be visible unless there is a window
// with layer FULLSCREEN, or a window with layer // with layer FULLSCREEN, or a window with layer
// OVERRIDE_REDIRECT that covers the whole screen. // OVERRIDE_REDIRECT that covers the whole screen.
// ("override_redirect" is not actually a layer above all // ('override_redirect' is not actually a layer above all
// other windows, but this seems to be how mutter treats it // other windows, but this seems to be how mutter treats it
// currently...) If we wanted to be extra clever, we could // currently...) If we wanted to be extra clever, we could
// figure out when an OVERRIDE_REDIRECT window was trying to // figure out when an OVERRIDE_REDIRECT window was trying to

View File

@ -22,8 +22,8 @@ const Search = imports.ui.search;
// 25 search results (per result type) should be enough for everyone // 25 search results (per result type) should be enough for everyone
const MAX_RENDERED_SEARCH_RESULTS = 25; const MAX_RENDERED_SEARCH_RESULTS = 25;
const DOCS = "docs"; const DOCS = 'docs';
const PLACES = "places"; const PLACES = 'places';
/* /*
* Returns the index in an array of a given length that is obtained * Returns the index in an array of a given length that is obtained
@ -54,7 +54,7 @@ Pane.prototype = {
_init: function () { _init: function () {
this._open = false; this._open = false;
this.actor = new St.BoxLayout({ style_class: "dash-pane", this.actor = new St.BoxLayout({ style_class: 'dash-pane',
vertical: true, vertical: true,
reactive: true }); reactive: true });
this.actor.connect('button-press-event', Lang.bind(this, function (a, e) { this.actor.connect('button-press-event', Lang.bind(this, function (a, e) {
@ -185,7 +185,7 @@ function SearchEntry() {
SearchEntry.prototype = { SearchEntry.prototype = {
_init : function() { _init : function() {
this.actor = new St.Entry({ name: "searchEntry", this.actor = new St.Entry({ name: 'searchEntry',
hint_text: _("Find") }); hint_text: _("Find") });
this.entry = this.actor.clutter_text; this.entry = this.actor.clutter_text;
@ -193,7 +193,7 @@ SearchEntry.prototype = {
function() { function() {
if (this.isActive()) if (this.isActive())
this.actor.set_secondary_icon_from_file(global.imagedir + this.actor.set_secondary_icon_from_file(global.imagedir +
"close-black.svg"); 'close-black.svg');
else else
this.actor.set_secondary_icon_from_file(null); this.actor.set_secondary_icon_from_file(null);
})); }));
@ -530,7 +530,7 @@ SearchResults.prototype = {
let meta = this._metaForProvider(provider); let meta = this._metaForProvider(provider);
meta.actor.show(); meta.actor.show();
meta.resultDisplay.renderResults(providerResults, terms); meta.resultDisplay.renderResults(providerResults, terms);
meta.count.set_text(""+providerResults.length); meta.count.set_text('' + providerResults.length);
} }
this.selectDown(false); this.selectDown(false);
@ -608,11 +608,11 @@ function MoreLink() {
MoreLink.prototype = { MoreLink.prototype = {
_init : function () { _init : function () {
this.actor = new St.BoxLayout({ style_class: "more-link", this.actor = new St.BoxLayout({ style_class: 'more-link',
reactive: true }); reactive: true });
this.pane = null; this.pane = null;
this._expander = new St.Bin({ style_class: "more-link-expander" }); this._expander = new St.Bin({ style_class: 'more-link-expander' });
this.actor.add(this._expander, { expand: true, y_fill: false }); this.actor.add(this._expander, { expand: true, y_fill: false });
}, },
@ -644,9 +644,9 @@ function BackLink() {
BackLink.prototype = { BackLink.prototype = {
_init : function () { _init : function () {
this.actor = new St.Button({ style_class: "section-header-back", this.actor = new St.Button({ style_class: 'section-header-back',
reactive: true }); reactive: true });
this.actor.set_child(new St.Bin({ style_class: "section-header-back-image" })); this.actor.set_child(new St.Bin({ style_class: 'section-header-back-image' }));
} }
}; };
@ -656,12 +656,12 @@ function SectionHeader(title, suppressBrowse) {
SectionHeader.prototype = { SectionHeader.prototype = {
_init : function (title, suppressBrowse) { _init : function (title, suppressBrowse) {
this.actor = new St.Bin({ style_class: "section-header", this.actor = new St.Bin({ style_class: 'section-header',
x_align: St.Align.START, x_align: St.Align.START,
x_fill: true, x_fill: true,
y_fill: true, y_fill: true,
reactive: !suppressBrowse }); reactive: !suppressBrowse });
this._innerBox = new St.BoxLayout({ style_class: "section-header-inner" }); this._innerBox = new St.BoxLayout({ style_class: 'section-header-inner' });
this.actor.set_child(this._innerBox); this.actor.set_child(this._innerBox);
this.backLink = new BackLink(); this.backLink = new BackLink();
@ -671,12 +671,12 @@ SectionHeader.prototype = {
this.emit('back-link-activated'); this.emit('back-link-activated');
})); }));
let textBox = new St.BoxLayout({ style_class: "section-text-content" }); let textBox = new St.BoxLayout({ style_class: 'section-text-content' });
this.text = new St.Label({ style_class: "section-title", this.text = new St.Label({ style_class: 'section-title',
text: title }); text: title });
textBox.add(this.text, { x_align: St.Align.START }); textBox.add(this.text, { x_align: St.Align.START });
this.countText = new St.Label({ style_class: "section-count" }); this.countText = new St.Label({ style_class: 'section-count' });
textBox.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END }); textBox.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END });
this.countText.hide(); this.countText.hide();
@ -712,7 +712,7 @@ SectionHeader.prototype = {
}, },
setCountText : function(countText) { setCountText : function(countText) {
if (countText == "") { if (countText == '') {
this.countText.hide(); this.countText.hide();
} else { } else {
this.countText.show(); this.countText.show();
@ -729,14 +729,14 @@ function SearchSectionHeader(title, onClick) {
SearchSectionHeader.prototype = { SearchSectionHeader.prototype = {
_init : function(title, onClick) { _init : function(title, onClick) {
this.actor = new St.Button({ style_class: "dash-search-section-header", this.actor = new St.Button({ style_class: 'dash-search-section-header',
x_fill: true, x_fill: true,
y_fill: true }); y_fill: true });
let box = new St.BoxLayout(); let box = new St.BoxLayout();
this.actor.set_child(box); this.actor.set_child(box);
let titleText = new St.Label({ style_class: "dash-search-section-title", let titleText = new St.Label({ style_class: 'dash-search-section-title',
text: title }); text: title });
this.countText = new St.Label({ style_class: "dash-search-section-count" }); this.countText = new St.Label({ style_class: 'dash-search-section-count' });
box.add(titleText); box.add(titleText);
box.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END }); box.add(this.countText, { expand: true, x_fill: false, x_align: St.Align.END });
@ -776,14 +776,14 @@ Dash.prototype = {
// of the Group actor ends up including the width of its hidden children, so we were getting a reactive object as // of the Group actor ends up including the width of its hidden children, so we were getting a reactive object as
// wide as the details pane that was blocking the clicks to the workspaces underneath it even when the details pane // wide as the details pane that was blocking the clicks to the workspaces underneath it even when the details pane
// was actually hidden. // was actually hidden.
this.actor = new St.BoxLayout({ name: "dash", this.actor = new St.BoxLayout({ name: 'dash',
vertical: true, vertical: true,
reactive: true }); reactive: true });
// The searchArea just holds the entry // The searchArea just holds the entry
this.searchArea = new St.BoxLayout({ name: "dashSearchArea", this.searchArea = new St.BoxLayout({ name: 'dashSearchArea',
vertical: true }); vertical: true });
this.sectionArea = new St.BoxLayout({ name: "dashSections", this.sectionArea = new St.BoxLayout({ name: 'dashSections',
vertical: true }); vertical: true });
this.actor.add(this.searchArea); this.actor.add(this.searchArea);

View File

@ -254,7 +254,7 @@ _Draggable.prototype = {
{ scale_x: scale * origScale, { scale_x: scale * origScale,
scale_y: scale * origScale, scale_y: scale * origScale,
time: SCALE_ANIMATION_TIME, time: SCALE_ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onUpdate: function() { onUpdate: function() {
let currentScale = this._dragActor.scale_x / origScale; let currentScale = this._dragActor.scale_x / origScale;
this._dragOffsetX = currentScale * origDragOffsetX; this._dragOffsetX = currentScale * origDragOffsetX;
@ -368,7 +368,7 @@ _Draggable.prototype = {
scale_y: this._snapBackScale, scale_y: this._snapBackScale,
opacity: this._dragOrigOpacity, opacity: this._dragOrigOpacity,
time: SNAP_BACK_ANIMATION_TIME, time: SNAP_BACK_ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._onSnapBackComplete, onComplete: this._onSnapBackComplete,
onCompleteScope: this, onCompleteScope: this,
onCompleteParams: [this._dragActor, eventTime] onCompleteParams: [this._dragActor, eventTime]

View File

@ -41,7 +41,7 @@ DocDisplayItem.prototype = {
GenericDisplay.GenericDisplayItem.prototype._init.call(this); GenericDisplay.GenericDisplayItem.prototype._init.call(this);
this._docInfo = docInfo; this._docInfo = docInfo;
this._setItemInfo(docInfo.name, ""); this._setItemInfo(docInfo.name, '');
this._timeoutTime = -1; this._timeoutTime = -1;
this._resetTimeDisplay(currentSecs); this._resetTimeDisplay(currentSecs);
@ -80,7 +80,7 @@ DocDisplayItem.prototype = {
// Creates and returns a large preview icon, but only if this._docInfo is an image file // Creates and returns a large preview icon, but only if this._docInfo is an image file
// and we were able to generate a pixbuf from it successfully. // and we were able to generate a pixbuf from it successfully.
_createLargePreviewIcon : function() { _createLargePreviewIcon : function() {
if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf("image/") != 0) if (this._docInfo.mimeType == null || this._docInfo.mimeType.indexOf('image/') != 0)
return null; return null;
try { try {
@ -513,6 +513,6 @@ DocSearchProvider.prototype = {
}, },
expandSearch: function(terms) { expandSearch: function(terms) {
log("TODO expand docs search"); log('TODO expand docs search');
} }
}; };

View File

@ -36,7 +36,7 @@ function init() {
String.prototype.format = Format.format; String.prototype.format = Format.format;
// Set the default direction for St widgets (this needs to be done before any use of St) // Set the default direction for St widgets (this needs to be done before any use of St)
if (Gettext_gtk20.gettext("default:LTR") == "default:RTL") { if (Gettext_gtk20.gettext('default:LTR') == 'default:RTL') {
St.Widget.set_default_direction(St.TextDirection.RTL); St.Widget.set_default_direction(St.TextDirection.RTL);
} }
} }

View File

@ -124,7 +124,7 @@ function init() {
try { try {
userExtensionsDir.make_directory_with_parents(null); userExtensionsDir.make_directory_with_parents(null);
} catch (e) { } catch (e) {
global.logError(""+e); global.logError('' + e);
} }
disabledExtensions = Shell.GConf.get_default().get_string_list('disabled_extensions'); disabledExtensions = Shell.GConf.get_default().get_string_list('disabled_extensions');

View File

@ -34,7 +34,7 @@ function GenericDisplayItem() {
GenericDisplayItem.prototype = { GenericDisplayItem.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ style_class: "generic-display-item", this.actor = new St.BoxLayout({ style_class: 'generic-display-item',
reactive: true }); reactive: true });
this.actor._delegate = this; this.actor._delegate = this;
@ -144,7 +144,7 @@ GenericDisplayItem.prototype = {
// Performes an action associated with launching this item, such as opening a file or an application. // Performes an action associated with launching this item, such as opening a file or an application.
launch: function() { launch: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
//// Protected methods //// //// Protected methods ////
@ -176,12 +176,12 @@ GenericDisplayItem.prototype = {
this._icon = this._createIcon(); this._icon = this._createIcon();
this._iconBin.set_child(this._icon); this._iconBin.set_child(this._icon);
this._name = new St.Label({ style_class: "generic-display-item-name", this._name = new St.Label({ style_class: 'generic-display-item-name',
text: nameText }); text: nameText });
this._infoText.add(this._name); this._infoText.add(this._name);
this._description = new St.Label({ style_class: "generic-display-item-description", this._description = new St.Label({ style_class: 'generic-display-item-description',
text: descriptionText ? descriptionText : "" }); text: descriptionText ? descriptionText : '' });
this._infoText.add(this._description); this._infoText.add(this._description);
}, },
@ -208,12 +208,12 @@ GenericDisplayItem.prototype = {
// Returns an icon for the item. // Returns an icon for the item.
_createIcon: function() { _createIcon: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
// Returns a preview icon for the item. // Returns a preview icon for the item.
_createPreviewIcon: function() { _createPreviewIcon: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
} }
//// Private methods //// //// Private methods ////
@ -356,7 +356,7 @@ GenericDisplay.prototype = {
// TODO: figure out why this._list.displayedCount is returning a // TODO: figure out why this._list.displayedCount is returning a
// positive number when this._mathedItems.length is 0 // positive number when this._mathedItems.length is 0
// This can be triggered if a search string is entered for which there are no matches. // This can be triggered if a search string is entered for which there are no matches.
// log("this._mathedItems.length: " + this._matchedItems.length + " this._list.displayedCount " + this._list.displayedCount); // log('this._mathedItems.length: ' + this._matchedItems.length + ' this._list.displayedCount ' + this._list.displayedCount);
return this._matchedItemKeys.length > 0; return this._matchedItemKeys.length > 0;
}, },
@ -402,7 +402,7 @@ GenericDisplay.prototype = {
// and adds it to the list of displayed items, but does not yet display it. // and adds it to the list of displayed items, but does not yet display it.
_addDisplayItem : function(itemId) { _addDisplayItem : function(itemId) {
if (this._displayedItems.hasOwnProperty(itemId)) { if (this._displayedItems.hasOwnProperty(itemId)) {
log("Tried adding a display item for " + itemId + ", but an item with this item id is already among displayed items."); log('Tried adding a display item for ' + itemId + ', but an item with this item id is already among displayed items.');
return; return;
} }
@ -461,7 +461,7 @@ GenericDisplay.prototype = {
// Return true if there's an active search or other constraint // Return true if there's an active search or other constraint
// on the list // on the list
_filterActive: function() { _filterActive: function() {
return this._search != ""; return this._search != '';
}, },
// Called when we are resetting state // Called when we are resetting state
@ -584,13 +584,13 @@ GenericDisplay.prototype = {
// Implementation should return %true if we are up to date, and %false // Implementation should return %true if we are up to date, and %false
// if a full reload occurred. // if a full reload occurred.
_refreshCache: function() { _refreshCache: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
// Sets the list of the displayed items based on the default sorting order. // Sets the list of the displayed items based on the default sorting order.
// The default sorting order is specific to each implementing class. // The default sorting order is specific to each implementing class.
_setDefaultList: function() { _setDefaultList: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
// Compares items associated with the item ids based on the order in which the // Compares items associated with the item ids based on the order in which the
@ -598,18 +598,18 @@ GenericDisplay.prototype = {
// Intended to be used as a compareFunction for array.sort(). // Intended to be used as a compareFunction for array.sort().
// Returns an integer value indicating the result of the comparison. // Returns an integer value indicating the result of the comparison.
_compareItems: function(itemIdA, itemIdB) { _compareItems: function(itemIdA, itemIdB) {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
// Checks if the item info can be a match for the search string. // Checks if the item info can be a match for the search string.
// Returns a boolean flag indicating if that's the case. // Returns a boolean flag indicating if that's the case.
_isInfoMatching: function(itemInfo, search) { _isInfoMatching: function(itemInfo, search) {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
// Creates a display item based on itemInfo. // Creates a display item based on itemInfo.
_createDisplayItem: function(itemInfo) { _createDisplayItem: function(itemInfo) {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
//// Private methods //// //// Private methods ////

View File

@ -17,22 +17,22 @@ const Tweener = imports.ui.tweener;
const Main = imports.ui.main; const Main = imports.ui.main;
/* Imports...feel free to add here as needed */ /* Imports...feel free to add here as needed */
var commandHeader = "const Clutter = imports.gi.Clutter; " + var commandHeader = 'const Clutter = imports.gi.Clutter; ' +
"const GLib = imports.gi.GLib; " + 'const GLib = imports.gi.GLib; ' +
"const Gtk = imports.gi.Gtk; " + 'const Gtk = imports.gi.Gtk; ' +
"const Mainloop = imports.mainloop; " + 'const Mainloop = imports.mainloop; ' +
"const Meta = imports.gi.Meta; " + 'const Meta = imports.gi.Meta; ' +
"const Shell = imports.gi.Shell; " + 'const Shell = imports.gi.Shell; ' +
"const Main = imports.ui.main; " + 'const Main = imports.ui.main; ' +
"const Lang = imports.lang; " + 'const Lang = imports.lang; ' +
"const Tweener = imports.ui.tweener; " + 'const Tweener = imports.ui.tweener; ' +
/* Utility functions...we should probably be able to use these /* Utility functions...we should probably be able to use these
* in the shell core code too. */ * in the shell core code too. */
"const stage = global.stage; " + 'const stage = global.stage; ' +
"const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; " + 'const color = function(pixel) { let c= new Clutter.Color(); c.from_pixel(pixel); return c; }; ' +
/* Special lookingGlass functions */ /* Special lookingGlass functions */
"const it = Main.lookingGlass.getIt(); " + 'const it = Main.lookingGlass.getIt(); ' +
"const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); "; 'const r = Lang.bind(Main.lookingGlass, Main.lookingGlass.getResult); ';
function Notebook() { function Notebook() {
this._init(); this._init();
@ -42,14 +42,14 @@ Notebook.prototype = {
_init: function() { _init: function() {
this.actor = new St.BoxLayout({ vertical: true }); this.actor = new St.BoxLayout({ vertical: true });
this.tabControls = new St.BoxLayout({ style_class: "labels" }); this.tabControls = new St.BoxLayout({ style_class: 'labels' });
this._selectedIndex = -1; this._selectedIndex = -1;
this._tabs = []; this._tabs = [];
}, },
appendPage: function(name, child) { appendPage: function(name, child) {
let labelBox = new St.BoxLayout({ style_class: "notebook-tab" }); let labelBox = new St.BoxLayout({ style_class: 'notebook-tab' });
let label = new St.Button({ label: name }); let label = new St.Button({ label: name });
label.connect('clicked', Lang.bind(this, function () { label.connect('clicked', Lang.bind(this, function () {
this.selectChild(child); this.selectChild(child);
@ -153,13 +153,13 @@ Result.prototype = {
cmdTxt.ellipsize = Pango.EllipsizeMode.END; cmdTxt.ellipsize = Pango.EllipsizeMode.END;
this.actor.add(cmdTxt); this.actor.add(cmdTxt);
let resultTxt = new St.Label({ text: "r(" + index + ") = " + o }); let resultTxt = new St.Label({ text: 'r(' + index + ') = ' + o });
resultTxt.ellipsize = Pango.EllipsizeMode.END; resultTxt.ellipsize = Pango.EllipsizeMode.END;
this.actor.add(resultTxt); this.actor.add(resultTxt);
let line = new Clutter.Rectangle({ name: "Separator", let line = new Clutter.Rectangle({ name: 'Separator',
height: 1 }); height: 1 });
let padBin = new St.Bin({ name: "Separator", x_fill: true, y_fill: true }); let padBin = new St.Bin({ name: 'Separator', x_fill: true, y_fill: true });
padBin.add_actor(line); padBin.add_actor(line);
this.actor.add(padBin); this.actor.add(padBin);
} }
@ -171,7 +171,7 @@ function WindowList() {
WindowList.prototype = { WindowList.prototype = {
_init : function () { _init : function () {
this.actor = new St.BoxLayout({ name: "Windows", vertical: true, style: "spacing: 8px" }); this.actor = new St.BoxLayout({ name: 'Windows', vertical: true, style: 'spacing: 8px' });
let display = global.screen.get_display(); let display = global.screen.get_display();
let tracker = Shell.WindowTracker.get_default(); let tracker = Shell.WindowTracker.get_default();
this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList)); this._updateId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._updateWindowList));
@ -193,16 +193,16 @@ WindowList.prototype = {
box.add(label.actor); box.add(label.actor);
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' }); let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
box.add(propsBox); box.add(propsBox);
propsBox.add(new St.Label({ text: "wmclass: " + metaWindow.get_wm_class() })); propsBox.add(new St.Label({ text: 'wmclass: ' + metaWindow.get_wm_class() }));
let app = tracker.get_window_app(metaWindow); let app = tracker.get_window_app(metaWindow);
if (app != null && !app.is_transient()) { if (app != null && !app.is_transient()) {
let icon = app.create_icon_texture(22); let icon = app.create_icon_texture(22);
let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' }); let propBox = new St.BoxLayout({ style: 'spacing: 6px; ' });
propsBox.add(propBox); propsBox.add(propBox);
propBox.add(new St.Label({ text: "app: " + app.get_id() }), { y_align: St.Align.MIDDLE }); propBox.add(new St.Label({ text: 'app: ' + app.get_id() }), { y_align: St.Align.MIDDLE });
propBox.add(icon, { y_align: St.Align.MIDDLE }); propBox.add(icon, { y_align: St.Align.MIDDLE });
} else { } else {
propsBox.add(new St.Label({ text: "<untracked>" })); propsBox.add(new St.Label({ text: '<untracked>' }));
} }
} }
} }
@ -219,7 +219,7 @@ PropertyInspector.prototype = {
this._parentList = []; this._parentList = [];
this.actor = new St.BoxLayout({ name: "PropertyInspector", vertical: true }); this.actor = new St.BoxLayout({ name: 'PropertyInspector', vertical: true });
}, },
setTarget: function(actor) { setTarget: function(actor) {
@ -230,11 +230,11 @@ PropertyInspector.prototype = {
for (let propName in actor) { for (let propName in actor) {
let valueStr; let valueStr;
try { try {
valueStr = "" + actor[propName]; valueStr = '' + actor[propName];
} catch (e) { } catch (e) {
valueStr = '<error>'; valueStr = '<error>';
} }
let propText = propName + ": " + valueStr; let propText = propName + ': ' + valueStr;
let propDisplay = new St.Label({ reactive: true, let propDisplay = new St.Label({ reactive: true,
text: propText }); text: propText });
this.actor.add_actor(propDisplay); this.actor.add_actor(propDisplay);
@ -250,7 +250,7 @@ Inspector.prototype = {
_init: function() { _init: function() {
let width = 150; let width = 150;
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
let eventHandler = new St.BoxLayout({ name: "LookingGlassDialog", let eventHandler = new St.BoxLayout({ name: 'LookingGlassDialog',
vertical: false, vertical: false,
y: primary.y + Math.floor(primary.height / 2), y: primary.y + Math.floor(primary.height / 2),
reactive: true }); reactive: true });
@ -336,7 +336,7 @@ ErrorLog.prototype = {
let stack = Main._getAndClearErrorStack(); let stack = Main._getAndClearErrorStack();
for (let i = 0; i < stack.length; i++) { for (let i = 0; i < stack.length; i++) {
let logItem = stack[i]; let logItem = stack[i];
text += logItem.category + " t=" + this._formatTime(new Date(logItem.timestamp)) + " " + logItem.message + "\n"; text += logItem.category + ' t=' + this._formatTime(new Date(logItem.timestamp)) + ' ' + logItem.message + '\n';
} }
this.text.text = text; this.text.text = text;
} }
@ -396,7 +396,7 @@ Extensions.prototype = {
case ExtensionSystem.ExtensionState.OUT_OF_DATE: case ExtensionSystem.ExtensionState.OUT_OF_DATE:
return _("Out of date"); return _("Out of date");
} }
return "Unknown"; // Not translated, shouldn't appear return 'Unknown'; // Not translated, shouldn't appear
}, },
_createExtensionDisplay: function(meta) { _createExtensionDisplay: function(meta) {
@ -442,7 +442,7 @@ function LookingGlass() {
LookingGlass.prototype = { LookingGlass.prototype = {
_init : function() { _init : function() {
this._idleHistorySaveId = 0; this._idleHistorySaveId = 0;
let historyPath = global.userdatadir + "/lookingglass-history.txt"; let historyPath = global.userdatadir + '/lookingglass-history.txt';
this._historyFile = Gio.file_new_for_path(historyPath); this._historyFile = Gio.file_new_for_path(historyPath);
this._savedText = null; this._savedText = null;
this._historyNavIndex = -1; this._historyNavIndex = -1;
@ -461,19 +461,19 @@ LookingGlass.prototype = {
// Sort of magic, but...eh. // Sort of magic, but...eh.
this._maxItems = 150; this._maxItems = 150;
this.actor = new St.BoxLayout({ name: "LookingGlassDialog", this.actor = new St.BoxLayout({ name: 'LookingGlassDialog',
vertical: true, vertical: true,
visible: false }); visible: false });
let gconf = Shell.GConf.get_default(); let gconf = Shell.GConf.get_default();
gconf.watch_directory("/desktop/gnome/interface"); gconf.watch_directory('/desktop/gnome/interface');
gconf.connect("changed::/desktop/gnome/interface/monospace_font_name", gconf.connect('changed::/desktop/gnome/interface/monospace_font_name',
Lang.bind(this, this._updateFont)); Lang.bind(this, this._updateFont));
this._updateFont(); this._updateFont();
Main.uiGroup.add_actor(this.actor); Main.uiGroup.add_actor(this.actor);
let toolbar = new St.BoxLayout({ name: "Toolbar" }); let toolbar = new St.BoxLayout({ name: 'Toolbar' });
this.actor.add_actor(toolbar); this.actor.add_actor(toolbar);
let inspectIcon = St.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }), let inspectIcon = St.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }),
24); 24);
@ -501,13 +501,13 @@ LookingGlass.prototype = {
toolbar.add(emptyBox, { expand: true }); toolbar.add(emptyBox, { expand: true });
toolbar.add_actor(notebook.tabControls); toolbar.add_actor(notebook.tabControls);
this._evalBox = new St.BoxLayout({ name: "EvalBox", vertical: true }); this._evalBox = new St.BoxLayout({ name: 'EvalBox', vertical: true });
notebook.appendPage('Evaluator', this._evalBox); notebook.appendPage('Evaluator', this._evalBox);
this._resultsArea = new St.BoxLayout({ name: "ResultsArea", vertical: true }); this._resultsArea = new St.BoxLayout({ name: 'ResultsArea', vertical: true });
this._evalBox.add(this._resultsArea, { expand: true }); this._evalBox.add(this._resultsArea, { expand: true });
let entryArea = new St.BoxLayout({ name: "EntryArea" }); let entryArea = new St.BoxLayout({ name: 'EntryArea' });
this._evalBox.add_actor(entryArea); this._evalBox.add_actor(entryArea);
let label = new St.Label({ text: 'js>>> ' }); let label = new St.Label({ text: 'js>>> ' });
@ -543,7 +543,7 @@ LookingGlass.prototype = {
// newline-separated. // newline-separated.
text.replace('\n', ' '); text.replace('\n', ' ');
// Strip leading and trailing whitespace // Strip leading and trailing whitespace
text = text.replace(/^\s+/g, "").replace(/\s+$/g, ""); text = text.replace(/^\s+/g, '').replace(/\s+$/g, '');
if (text == '') if (text == '')
return true; return true;
this._evaluate(text); this._evaluate(text);
@ -579,7 +579,7 @@ LookingGlass.prototype = {
_updateFont: function() { _updateFont: function() {
let gconf = Shell.GConf.get_default(); let gconf = Shell.GConf.get_default();
let fontName = gconf.get_string("/desktop/gnome/interface/monospace_font_name"); let fontName = gconf.get_string('/desktop/gnome/interface/monospace_font_name');
// This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName); // This is mishandled by the scanner - should by Pango.FontDescription_from_string(fontName);
// https://bugzilla.gnome.org/show_bug.cgi?id=595889 // https://bugzilla.gnome.org/show_bug.cgi?id=595889
let fontDesc = Pango.Font.description_from_string(fontName); let fontDesc = Pango.Font.description_from_string(fontName);
@ -653,7 +653,7 @@ LookingGlass.prototype = {
try { try {
resultObj = eval(fullCmd); resultObj = eval(fullCmd);
} catch (e) { } catch (e) {
resultObj = "<exception " + e + ">"; resultObj = '<exception ' + e + '>';
} }
this._pushResult(command, resultObj); this._pushResult(command, resultObj);
@ -725,7 +725,7 @@ LookingGlass.prototype = {
global.stage.set_key_focus(this._entry); global.stage.set_key_focus(this._entry);
Tweener.addTween(this.actor, { time: 0.5, Tweener.addTween(this.actor, { time: 0.5,
transition: "easeOutQuad", transition: 'easeOutQuad',
y: this._targetY y: this._targetY
}); });
}, },
@ -750,7 +750,7 @@ LookingGlass.prototype = {
Main.popModal(this.actor); Main.popModal(this.actor);
Tweener.addTween(this.actor, { time: 0.5, Tweener.addTween(this.actor, { time: 0.5,
transition: "easeOutQuad", transition: 'easeOutQuad',
y: this._hiddenY, y: this._hiddenY,
onComplete: Lang.bind(this, function () { onComplete: Lang.bind(this, function () {
this.actor.hide(); this.actor.hide();

View File

@ -43,22 +43,22 @@ const DEFAULT_CROSSHAIRS_LENGTH = 4096;
const DEFAULT_CROSSHAIRS_CLIP = false; const DEFAULT_CROSSHAIRS_CLIP = false;
const DEFAULT_CROSSHAIRS_CLIP_SIZE = [100, 100]; const DEFAULT_CROSSHAIRS_CLIP_SIZE = [100, 100];
const DEFAULT_CROSSHAIRS_COLOR = new Clutter.Color(); const DEFAULT_CROSSHAIRS_COLOR = new Clutter.Color();
DEFAULT_CROSSHAIRS_COLOR.from_string("Red"); DEFAULT_CROSSHAIRS_COLOR.from_string('Red');
// GConf settings // GConf settings
const A11Y_MAG_PREFS_DIR = "/desktop/gnome/accessibility/magnifier"; const A11Y_MAG_PREFS_DIR = '/desktop/gnome/accessibility/magnifier';
const SHOW_KEY = A11Y_MAG_PREFS_DIR + "/show_magnifier"; const SHOW_KEY = A11Y_MAG_PREFS_DIR + '/show_magnifier';
const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + "/screen_position"; const SCREEN_POSITION_KEY = A11Y_MAG_PREFS_DIR + '/screen_position';
const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + "/mag_factor"; const MAG_FACTOR_KEY = A11Y_MAG_PREFS_DIR + '/mag_factor';
const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + "/lens_mode"; const LENS_MODE_KEY = A11Y_MAG_PREFS_DIR + '/lens_mode';
const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + "/scroll_at_edges"; const CLAMP_MODE_KEY = A11Y_MAG_PREFS_DIR + '/scroll_at_edges';
const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + "/mouse_tracking"; const MOUSE_TRACKING_KEY = A11Y_MAG_PREFS_DIR + '/mouse_tracking';
const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + "/show_cross_hairs"; const SHOW_CROSS_HAIRS_KEY = A11Y_MAG_PREFS_DIR + '/show_cross_hairs';
const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_thickness"; const CROSS_HAIRS_THICKNESS_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_thickness';
const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_color"; const CROSS_HAIRS_COLOR_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_color';
const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_opacity"; const CROSS_HAIRS_OPACITY_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_opacity';
const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_length"; const CROSS_HAIRS_LENGTH_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_length';
const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + "/cross_hairs_clip"; const CROSS_HAIRS_CLIP_KEY = A11Y_MAG_PREFS_DIR + '/cross_hairs_clip';
let magDBusService = null; let magDBusService = null;
@ -329,7 +329,7 @@ Magnifier.prototype = {
/** /**
* setCrosshairsColor: * setCrosshairsColor:
* Set the color of the crosshairs for all ZoomRegions. * Set the color of the crosshairs for all ZoomRegions.
* @color: The color as a string, e.g. "#ff0000ff" or "red". * @color: The color as a string, e.g. '#ff0000ff' or 'red'.
*/ */
setCrosshairsColor: function(color) { setCrosshairsColor: function(color) {
if (this._crossHairs) { if (this._crossHairs) {
@ -342,7 +342,7 @@ Magnifier.prototype = {
/** /**
* getCrosshairsColor: * getCrosshairsColor:
* Get the color of the crosshairs. * Get the color of the crosshairs.
* @return: The color as a string, e.g. "#0000ffff" for blue. * @return: The color as a string, e.g. '#0000ffff' or 'blue'.
*/ */
getCrosshairsColor: function() { getCrosshairsColor: function() {
if (this._crossHairs) { if (this._crossHairs) {
@ -350,7 +350,7 @@ Magnifier.prototype = {
return clutterColor.to_string(); return clutterColor.to_string();
} }
else else
return "#00000000"; return '#00000000';
}, },
/** /**

View File

@ -53,8 +53,8 @@ const ZoomRegionIface = {
}; };
// For making unique ZoomRegion DBus proxy object paths of the form: // For making unique ZoomRegion DBus proxy object paths of the form:
// "/org/gnome/Magnifier/ZoomRegion/zoomer0", // '/org/gnome/Magnifier/ZoomRegion/zoomer0',
// "/org/gnome/Magnifier/ZoomRegion/zoomer1", etc. // '/org/gnome/Magnifier/ZoomRegion/zoomer1', etc.
let _zoomRegionInstanceCount = 0; let _zoomRegionInstanceCount = 0;
function ShellMagnifier() { function ShellMagnifier() {
@ -118,7 +118,7 @@ ShellMagnifier.prototype = {
let ROI = { x: roi[0], y: roi[1], width: roi[2], height: roi[3] }; let ROI = { x: roi[0], y: roi[1], width: roi[2], height: roi[3] };
let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2], height: viewPort[3] }; let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2], height: viewPort[3] };
let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox); let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox);
let objectPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount; let objectPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount;
_zoomRegionInstanceCount++; _zoomRegionInstanceCount++;
let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion); let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion);
@ -169,7 +169,7 @@ ShellMagnifier.prototype = {
} }
if (!found) { if (!found) {
// Got a ZoomRegion with no DBus proxy, make one. // Got a ZoomRegion with no DBus proxy, make one.
let newPath = ZOOM_SERVICE_PATH + "/zoomer" + _zoomRegionInstanceCount; let newPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount;
_zoomRegionInstanceCount++; _zoomRegionInstanceCount++;
let zoomRegionProxy = new ShellMagnifierZoomRegion(newPath, aZoomRegion); let zoomRegionProxy = new ShellMagnifierZoomRegion(newPath, aZoomRegion);
let proxyAndZoomer = {}; let proxyAndZoomer = {};

View File

@ -54,9 +54,9 @@ let _startDate;
let background = null; let background = null;
function start() { function start() {
// Add a binding for "global" in the global JS namespace; (gjs // Add a binding for 'global' in the global JS namespace; (gjs
// keeps the web browser convention of having that namespace be // keeps the web browser convention of having that namespace be
// called "window".) // called 'window'.)
window.global = Shell.Global.get(); window.global = Shell.Global.get();
// Now monkey patch utility functions into the global proxy; // Now monkey patch utility functions into the global proxy;
@ -65,7 +65,7 @@ function start() {
global.logError = _logError; global.logError = _logError;
global.log = _logDebug; global.log = _logDebug;
Gio.DesktopAppInfo.set_desktop_env("GNOME"); Gio.DesktopAppInfo.set_desktop_env('GNOME');
global.grab_dbus_service(); global.grab_dbus_service();
shellDBusService = new ShellDBus.GnomeShell(); shellDBusService = new ShellDBus.GnomeShell();
@ -94,17 +94,17 @@ function start() {
global.stage.color = DEFAULT_BACKGROUND_COLOR; global.stage.color = DEFAULT_BACKGROUND_COLOR;
let themeContext = St.ThemeContext.get_for_stage (global.stage); let themeContext = St.ThemeContext.get_for_stage (global.stage);
let stylesheetPath = global.datadir + "/theme/gnome-shell.css"; let stylesheetPath = global.datadir + '/theme/gnome-shell.css';
let theme = new St.Theme ({ application_stylesheet: stylesheetPath }); let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
themeContext.set_theme (theme); themeContext.set_theme (theme);
let shellwm = global.window_manager; let shellwm = global.window_manager;
shellwm.takeover_keybinding("panel_main_menu"); shellwm.takeover_keybinding('panel_main_menu');
shellwm.connect("keybinding::panel_main_menu", function () { shellwm.connect('keybinding::panel_main_menu', function () {
overview.toggle(); overview.toggle();
}); });
shellwm.takeover_keybinding("panel_run_dialog"); shellwm.takeover_keybinding('panel_run_dialog');
shellwm.connect("keybinding::panel_run_dialog", function () { shellwm.connect('keybinding::panel_run_dialog', function () {
getRunDialog().open(); getRunDialog().open();
}); });
@ -136,9 +136,9 @@ function start() {
} else { } else {
//read the parameters from GConf always in case they have changed //read the parameters from GConf always in case they have changed
let gconf = Shell.GConf.get_default(); let gconf = Shell.GConf.get_default();
recorder.set_framerate(gconf.get_int("recorder/framerate")); recorder.set_framerate(gconf.get_int('recorder/framerate'));
recorder.set_filename("shell-%d%u-%c." + gconf.get_string("recorder/file_extension")); recorder.set_filename('shell-%d%u-%c.' + gconf.get_string('recorder/file_extension'));
let pipeline = gconf.get_string("recorder/pipeline"); let pipeline = gconf.get_string('recorder/pipeline');
if (!pipeline.match(/^\s*$/)) if (!pipeline.match(/^\s*$/))
recorder.set_pipeline(pipeline); recorder.set_pipeline(pipeline);
else else
@ -191,7 +191,7 @@ function _log(category, msg) {
for (let i = 2; i < arguments.length; i++) { for (let i = 2; i < arguments.length; i++) {
text += JSON.stringify(arguments[i]); text += JSON.stringify(arguments[i]);
if (i < arguments.length - 1) if (i < arguments.length - 1)
text += " "; text += ' ';
} }
} }
_errorLogStack.push({timestamp: new Date().getTime(), _errorLogStack.push({timestamp: new Date().getTime(),
@ -280,8 +280,8 @@ function _globalKeyPressHandler(actor, event) {
if (symbol == Clutter.Print) { if (symbol == Clutter.Print) {
// We want to be able to take screenshots of the shell at all times // We want to be able to take screenshots of the shell at all times
let gconf = Shell.GConf.get_default(); let gconf = Shell.GConf.get_default();
let command = gconf.get_string("/apps/metacity/keybinding_commands/command_screenshot"); let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot');
if (command != null && command != "") { if (command != null && command != '') {
let [ok, len, args] = GLib.shell_parse_argv(command); let [ok, len, args] = GLib.shell_parse_argv(command);
let p = new Shell.Process({'args' : args}); let p = new Shell.Process({'args' : args});
p.run(); p.run();
@ -354,7 +354,7 @@ function _findModal(actor) {
function pushModal(actor) { function pushModal(actor) {
if (modalCount == 0) { if (modalCount == 0) {
if (!global.begin_modal(global.get_current_time())) { if (!global.begin_modal(global.get_current_time())) {
log("pushModal: invocation of begin_modal failed"); log('pushModal: invocation of begin_modal failed');
return false; return false;
} }
} }
@ -521,7 +521,7 @@ function _queueBeforeRedraw(workId) {
*/ */
function initializeDeferredWork(actor, callback, props) { function initializeDeferredWork(actor, callback, props) {
// Turn into a string so we can use as an object property // Turn into a string so we can use as an object property
let workId = "" + (++_deferredWorkSequence); let workId = '' + (++_deferredWorkSequence);
_deferredWorkData[workId] = { 'actor': actor, _deferredWorkData[workId] = { 'actor': actor,
'callback': callback }; 'callback': callback };
actor.connect('notify::mapped', function () { actor.connect('notify::mapped', function () {
@ -551,7 +551,7 @@ function initializeDeferredWork(actor, callback, props) {
function queueDeferredWork(workId) { function queueDeferredWork(workId) {
let data = _deferredWorkData[workId]; let data = _deferredWorkData[workId];
if (!data) { if (!data) {
global.logError("invalid work id ", workId); global.logError('invalid work id ', workId);
return; return;
} }
if (_deferredWorkQueue.indexOf(workId) < 0) if (_deferredWorkQueue.indexOf(workId) < 0)

View File

@ -30,10 +30,10 @@ const State = {
function _cleanMarkup(text) { function _cleanMarkup(text) {
// Support &amp;, &quot;, &apos;, &lt; and &gt;, escape all other // Support &amp;, &quot;, &apos;, &lt; and &gt;, escape all other
// occurrences of '&'. // occurrences of '&'.
let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, "&amp;"); let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, '&amp;');
// Support <b>, <i>, and <u>, escape anything else // Support <b>, <i>, and <u>, escape anything else
// so it displays as raw markup. // so it displays as raw markup.
return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, "&lt;$1"); return _text.replace(/<(\/?[^biu]>|[^>\/][^>])/g, '&lt;$1');
} }
// Notification: // Notification:
@ -332,7 +332,7 @@ Notification.prototype = {
Tweener.addTween(this._bannerLabel, Tweener.addTween(this._bannerLabel,
{ opacity: 0, { opacity: 0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" }); transition: 'easeOutQuad' });
return true; return true;
}, },
@ -342,7 +342,7 @@ Notification.prototype = {
Tweener.addTween(this._bannerLabel, Tweener.addTween(this._bannerLabel,
{ opacity: 255, { opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" }); transition: 'easeOutQuad' });
return true; return true;
}, },
@ -692,7 +692,7 @@ MessageTray.prototype = {
// All of the logic for what happens when occurs here; the various // All of the logic for what happens when occurs here; the various
// event handlers merely update variables such as // event handlers merely update variables such as
// "this._pointerInTray", "this._summaryState", etc, and // 'this._pointerInTray', 'this._summaryState', etc, and
// _updateState() figures out what (if anything) needs to be done // _updateState() figures out what (if anything) needs to be done
// at the present time. // at the present time.
_updateState: function() { _updateState: function() {
@ -782,19 +782,19 @@ MessageTray.prototype = {
_showTray: function() { _showTray: function() {
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
this._tween(this.actor, "_trayState", State.SHOWN, this._tween(this.actor, '_trayState', State.SHOWN,
{ y: primary.y + primary.height - this.actor.height, { y: primary.y + primary.height - this.actor.height,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
_hideTray: function() { _hideTray: function() {
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
this._tween(this.actor, "_trayState", State.HIDDEN, this._tween(this.actor, '_trayState', State.HIDDEN,
{ y: primary.y + primary.height - 1, { y: primary.y + primary.height - 1,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
@ -806,11 +806,11 @@ MessageTray.prototype = {
this._notificationBin.y = this.actor.height; this._notificationBin.y = this.actor.height;
this._notificationBin.show(); this._notificationBin.show();
this._tween(this._notificationBin, "_notificationState", State.SHOWN, this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: 0, { y: 0,
opacity: 255, opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._showNotificationCompleted, onComplete: this._showNotificationCompleted,
onCompleteScope: this onCompleteScope: this
}); });
@ -858,11 +858,11 @@ MessageTray.prototype = {
this._reExpandNotificationId = 0; this._reExpandNotificationId = 0;
} }
this._tween(this._notificationBin, "_notificationState", State.HIDDEN, this._tween(this._notificationBin, '_notificationState', State.HIDDEN,
{ y: this.actor.height, { y: this.actor.height,
opacity: 0, opacity: 0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._hideNotificationCompleted, onComplete: this._hideNotificationCompleted,
onCompleteScope: this onCompleteScope: this
}); });
@ -877,10 +877,10 @@ MessageTray.prototype = {
_expandNotification: function() { _expandNotification: function() {
if (this._notification && this._notification.popOut()) { if (this._notification && this._notification.popOut()) {
this._tween(this._notificationBin, "_notificationState", State.SHOWN, this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: this.actor.height - this._notificationBin.height, { y: this.actor.height - this._notificationBin.height,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
if (!this._reExpandNotificationId) if (!this._reExpandNotificationId)
@ -892,11 +892,11 @@ MessageTray.prototype = {
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
this._summaryBin.opacity = 0; this._summaryBin.opacity = 0;
this._summaryBin.y = this.actor.height; this._summaryBin.y = this.actor.height;
this._tween(this._summaryBin, "_summaryState", State.SHOWN, this._tween(this._summaryBin, '_summaryState', State.SHOWN,
{ y: 0, { y: 0,
opacity: 255, opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._showSummaryCompleted, onComplete: this._showSummaryCompleted,
onCompleteScope: this, onCompleteScope: this,
onCompleteParams: [withTimeout] onCompleteParams: [withTimeout]
@ -920,10 +920,10 @@ MessageTray.prototype = {
}, },
_hideSummary: function() { _hideSummary: function() {
this._tween(this._summaryBin, "_summaryState", State.HIDDEN, this._tween(this._summaryBin, '_summaryState', State.HIDDEN,
{ opacity: 0, { opacity: 0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
this._summaryNeedsToBeShown = false; this._summaryNeedsToBeShown = false;
}, },
@ -942,11 +942,11 @@ MessageTray.prototype = {
this._summaryNotificationBin.y = this.actor.height; this._summaryNotificationBin.y = this.actor.height;
this._summaryNotificationBin.show(); this._summaryNotificationBin.show();
this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN, this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN,
{ y: this.actor.height - this._summaryNotificationBin.height, { y: this.actor.height - this._summaryNotificationBin.height,
opacity: 255, opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
if (!this._reExpandSummaryNotificationId) if (!this._reExpandSummaryNotificationId)
@ -954,21 +954,21 @@ MessageTray.prototype = {
}, },
_reExpandSummaryNotification: function() { _reExpandSummaryNotification: function() {
this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.SHOWN, this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.SHOWN,
{ y: this.actor.height - this._summaryNotificationBin.height, { y: this.actor.height - this._summaryNotificationBin.height,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
_hideSummaryNotification: function() { _hideSummaryNotification: function() {
this._summaryNotification.popIn(); this._summaryNotification.popIn();
this._tween(this._summaryNotificationBin, "_summaryNotificationState", State.HIDDEN, this._tween(this._summaryNotificationBin, '_summaryNotificationState', State.HIDDEN,
{ y: this.actor.height, { y: this.actor.height,
opacity: 0, opacity: 0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._hideSummaryNotificationCompleted, onComplete: this._hideSummaryNotificationCompleted,
onCompleteScope: this onCompleteScope: this
}); });

View File

@ -121,10 +121,10 @@ NotificationDaemon.prototype = {
// kill the notification-daemon. pkill is more portable // kill the notification-daemon. pkill is more portable
// than killall, but on Linux at least it won't match if // than killall, but on Linux at least it won't match if
// you pass more than 15 characters of the process name... // you pass more than 15 characters of the process name...
// However, if you use the "-f" flag to match the entire // However, if you use the '-f' flag to match the entire
// command line, it will work, but we have to be careful // command line, it will work, but we have to be careful
// in that case that we don't match "gedit // in that case that we don't match 'gedit
// notification-daemon.c" or whatever... // notification-daemon.c' or whatever...
let p = new Shell.Process({ args: ['pkill', '-f', let p = new Shell.Process({ args: ['pkill', '-f',
'^([^ ]*/)?(notification-daemon|notify-osd)$']}); '^([^ ]*/)?(notification-daemon|notify-osd)$']});
p.run(); p.run();

View File

@ -794,7 +794,7 @@ Panel.prototype = {
/* center */ /* center */
let clockButton = new St.Button({ style_class: "panel-button", let clockButton = new St.Button({ style_class: 'panel-button',
toggle_mode: true, toggle_mode: true,
x_fill: true, x_fill: true,
y_fill: true }); y_fill: true });
@ -881,7 +881,7 @@ Panel.prototype = {
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ y: 0, { y: 0,
time: 0.2, time: 0.2,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
@ -941,7 +941,7 @@ Panel.prototype = {
case 'unix': case 'unix':
// force updates every second // force updates every second
showSeconds = true; showSeconds = true;
clockFormat = "%s"; clockFormat = '%s';
break; break;
case 'custom': case 'custom':
// force updates every second // force updates every second
@ -1119,7 +1119,7 @@ CalendarPopup.prototype = {
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ y: panelActor.y + panelActor.height, { y: panelActor.y + panelActor.height,
time: 0.2, time: 0.2,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
@ -1129,7 +1129,7 @@ CalendarPopup.prototype = {
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ y: panelActor.y + panelActor.height - this.actor.height, { y: panelActor.y + panelActor.height - this.actor.height,
time: 0.2, time: 0.2,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: function() { this.actor.hide(); }, onComplete: function() { this.actor.hide(); },
onCompleteScope: this onCompleteScope: this
}); });

View File

@ -71,7 +71,7 @@ PlaceDeviceInfo.prototype = {
this._mount = mount; this._mount = mount;
this.name = mount.get_name(); this.name = mount.get_name();
this._lowerName = this.name.toLowerCase(); this._lowerName = this.name.toLowerCase();
this.id = "mount:" + mount.get_root().get_uri(); this.id = 'mount:' + mount.get_root().get_uri();
}, },
iconFactory: function(size) { iconFactory: function(size) {
@ -155,7 +155,7 @@ PlacesManager.prototype = {
this._connect = new PlaceInfo('special:connect', _("Connect to..."), this._connect = new PlaceInfo('special:connect', _("Connect to..."),
function (size) { function (size) {
return St.TextureCache.get_default().load_icon_name("applications-internet", size); return St.TextureCache.get_default().load_icon_name('applications-internet', size);
}, },
function () { function () {
new Shell.Process({ args: ['nautilus-connect-server'] }).run(); new Shell.Process({ args: ['nautilus-connect-server'] }).run();
@ -168,7 +168,7 @@ PlacesManager.prototype = {
try { try {
networkApp = Shell.AppSystem.get_default().load_from_desktop_file('network-scheme.desktop'); networkApp = Shell.AppSystem.get_default().load_from_desktop_file('network-scheme.desktop');
} catch(e) { } catch(e) {
log("Cannot create \"Network\" item, .desktop file not found or corrupt."); log('Cannot create "Network" item, .desktop file not found or corrupt.');
} }
} }
@ -208,7 +208,7 @@ PlacesManager.prototype = {
this._volumeMonitor.connect('drive-changed', Lang.bind(this, this._updateDevices)); this._volumeMonitor.connect('drive-changed', Lang.bind(this, this._updateDevices));
this._updateDevices(); this._updateDevices();
this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), ".gtk-bookmarks"]); this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']);
this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath); this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath);
let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null);
this._bookmarkTimeoutId = 0; this._bookmarkTimeoutId = 0;
@ -340,7 +340,7 @@ PlacesManager.prototype = {
this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY); this._isDesktopHome = gconf.get_boolean(DESKTOP_IS_HOME_KEY);
if (this._isDesktopHome) if (this._isDesktopHome)
this._removeById(this._defaultPlaces, "special:desktop"); this._removeById(this._defaultPlaces, 'special:desktop');
else else
this._defaultPlaces.splice(this._desktopMenuIndex, 0, this._defaultPlaces.splice(this._desktopMenuIndex, 0,
this._desktopMenu); this._desktopMenu);

View File

@ -51,7 +51,7 @@ CommandCompleter.prototype = {
this._paths[i] = file.get_path(); this._paths[i] = file.get_path();
this._monitors[i] = file.monitor_directory(Gio.FileMonitorFlags.NONE, null); this._monitors[i] = file.monitor_directory(Gio.FileMonitorFlags.NONE, null);
if (this._monitors[i] != null) { if (this._monitors[i] != null) {
this._monitors[i].connect("changed", Lang.bind(this, this._onChanged)); this._monitors[i].connect('changed', Lang.bind(this, this._onChanged));
} }
} }
this._paths = this._paths.filter(function(a) { this._paths = this._paths.filter(function(a) {
@ -132,7 +132,7 @@ CommandCompleter.prototype = {
}, },
getCompletion: function(text) { getCompletion: function(text) {
let common = ""; let common = '';
let notInit = true; let notInit = true;
if (!this._valid) { if (!this._valid) {
this._update(0); this._update(0);
@ -145,7 +145,7 @@ CommandCompleter.prototype = {
break; break;
} }
if (k == 0) if (k == 0)
return ""; return '';
return s1.substr(0, k); return s1.substr(0, k);
} }
function _hasPrefix(s1, prefix) { function _hasPrefix(s1, prefix) {
@ -372,7 +372,7 @@ RunDialog.prototype = {
// We are only interested in the actual error, so parse // We are only interested in the actual error, so parse
//that out. //that out.
let m = /.+\((.+)\)/.exec(e); let m = /.+\((.+)\)/.exec(e);
let errorStr = _("Execution of '%s' failed:").format(command) + "\n" + m[1]; let errorStr = _("Execution of '%s' failed:").format(command) + '\n' + m[1];
this._errorMessage.set_text(errorStr); this._errorMessage.set_text(errorStr);
this._errorBox.show(); this._errorBox.show();

View File

@ -40,7 +40,7 @@ SearchResultDisplay.prototype = {
* The terms are useful for search match highlighting. * The terms are useful for search match highlighting.
*/ */
renderResults: function(results, terms) { renderResults: function(results, terms) {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -67,7 +67,7 @@ SearchResultDisplay.prototype = {
* Returns: The number of actors visible. * Returns: The number of actors visible.
*/ */
getVisibleResultCount: function() { getVisibleResultCount: function() {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -79,14 +79,14 @@ SearchResultDisplay.prototype = {
* available. * available.
*/ */
selectIndex: function() { selectIndex: function() {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
* Activate the currently selected search result. * Activate the currently selected search result.
*/ */
activateSelected: function() { activateSelected: function() {
throw new Error("not implemented"); throw new Error('Not implemented');
} }
}; };
@ -127,7 +127,7 @@ SearchProvider.prototype = {
* or network queries. * or network queries.
*/ */
getInitialResultSet: function(terms) { getInitialResultSet: function(terms) {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -144,7 +144,7 @@ SearchProvider.prototype = {
* result set, rather than possibly performing a full re-query. * result set, rather than possibly performing a full re-query.
*/ */
getSubsearchResultSet: function(previousResults, newTerms) { getSubsearchResultSet: function(previousResults, newTerms) {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -155,7 +155,7 @@ SearchProvider.prototype = {
* properties which describe the given search result. * properties which describe the given search result.
*/ */
getResultMeta: function(id) { getResultMeta: function(id) {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -194,7 +194,7 @@ SearchProvider.prototype = {
* Called when the user chooses a given result. * Called when the user chooses a given result.
*/ */
activateResult: function(id) { activateResult: function(id) {
throw new Error("not implemented"); throw new Error('Not implemented');
}, },
/** /**
@ -205,7 +205,7 @@ SearchProvider.prototype = {
* displaying search results for that item type. * displaying search results for that item type.
*/ */
expandSearch: function(terms) { expandSearch: function(terms) {
throw new Error("not implemented"); throw new Error('Not implemented');
} }
}; };
Signals.addSignalMethods(SearchProvider.prototype); Signals.addSignalMethods(SearchProvider.prototype);
@ -238,7 +238,7 @@ SearchSystem.prototype = {
}, },
updateSearch: function(searchString) { updateSearch: function(searchString) {
searchString = searchString.replace(/^\s+/g, "").replace(/\s+$/g, ""); searchString = searchString.replace(/^\s+/g, '').replace(/\s+$/g, '');
if (searchString == '') if (searchString == '')
return null; return null;

View File

@ -8,16 +8,16 @@ const Mainloop = imports.mainloop;
const Main = imports.ui.main; const Main = imports.ui.main;
const GnomeShellIface = { const GnomeShellIface = {
name: "org.gnome.Shell", name: 'org.gnome.Shell',
methods: [{ name: "Eval", methods: [{ name: 'Eval',
inSignature: "s", inSignature: 's',
outSignature: "bs" outSignature: 'bs'
} }
], ],
signals: [], signals: [],
properties: [{ name: "OverviewActive", properties: [{ name: 'OverviewActive',
signature: "b", signature: 'b',
access: "readwrite" }] access: 'readwrite' }]
}; };
function GnomeShell() { function GnomeShell() {
@ -50,7 +50,7 @@ GnomeShell.prototype = {
returnValue = JSON.stringify(eval(code)); returnValue = JSON.stringify(eval(code));
// A hack; DBus doesn't have null/undefined // A hack; DBus doesn't have null/undefined
if (returnValue == undefined) if (returnValue == undefined)
returnValue = ""; returnValue = '';
success = true; success = true;
} catch (e) { } catch (e) {
returnValue = JSON.stringify(e); returnValue = JSON.stringify(e);

View File

@ -19,8 +19,8 @@ const SCROLLBACK_RECENT_TIME = 15 * 60; // 15 minutes
const SCROLLBACK_RECENT_LENGTH = 20; const SCROLLBACK_RECENT_LENGTH = 20;
const SCROLLBACK_IDLE_LENGTH = 5; const SCROLLBACK_IDLE_LENGTH = 5;
// This is GNOME Shell's implementation of the Telepathy "Client" // This is GNOME Shell's implementation of the Telepathy 'Client'
// interface. Specifically, the shell is a Telepathy "Observer", which // interface. Specifically, the shell is a Telepathy 'Observer', which
// lets us see messages even if they belong to another app (eg, // lets us see messages even if they belong to another app (eg,
// Empathy). // Empathy).

View File

@ -46,7 +46,7 @@ let slowDownFactor = 1.0;
// Called from Main.start // Called from Main.start
function init() { function init() {
let slowdownEnv = GLib.getenv("GNOME_SHELL_SLOWDOWN_FACTOR"); let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');
if (slowdownEnv) { if (slowdownEnv) {
let factor = parseFloat(slowdownEnv); let factor = parseFloat(slowdownEnv);
if (!isNaN(factor) && factor > 0.0) if (!isNaN(factor) && factor > 0.0)
@ -190,7 +190,7 @@ function registerSpecialPropertySplitter(name, splitFunction, parameters) {
} }
// The "FrameTicker" object is an object used to feed new frames to // The 'FrameTicker' object is an object used to feed new frames to
// Tweener so it can update values and redraw. The default frame // Tweener so it can update values and redraw. The default frame
// ticker for Tweener just uses a simple timeout at a fixed frame rate // ticker for Tweener just uses a simple timeout at a fixed frame rate
// and has no idea of "catching up" by dropping frames. // and has no idea of "catching up" by dropping frames.

View File

@ -103,7 +103,7 @@ WindowManager.prototype = {
x: xDest, x: xDest,
y: 0, y: 0,
time: WINDOW_ANIMATION_TIME, time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone, onComplete: this._minimizeWindowDone,
onCompleteScope: this, onCompleteScope: this,
onCompleteParams: [shellwm, actor], onCompleteParams: [shellwm, actor],
@ -160,7 +160,7 @@ WindowManager.prototype = {
Tweener.addTween(actor, Tweener.addTween(actor,
{ opacity: 255, { opacity: 255,
time: WINDOW_ANIMATION_TIME, time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._mapWindowDone, onComplete: this._mapWindowDone,
onCompleteScope: this, onCompleteScope: this,
onCompleteParams: [shellwm, actor], onCompleteParams: [shellwm, actor],
@ -258,7 +258,7 @@ WindowManager.prototype = {
{ x: xDest, { x: xDest,
y: yDest, y: yDest,
time: WINDOW_ANIMATION_TIME, time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: this._switchWorkspaceDone, onComplete: this._switchWorkspaceDone,
onCompleteScope: this, onCompleteScope: this,
onCompleteParams: [shellwm] onCompleteParams: [shellwm]
@ -267,7 +267,7 @@ WindowManager.prototype = {
{ x: 0, { x: 0,
y: 0, y: 0,
time: WINDOW_ANIMATION_TIME, time: WINDOW_ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
}, },
@ -306,7 +306,7 @@ WindowManager.prototype = {
_showWorkspaceSwitcher : function(shellwm, binding, window, backwards) { _showWorkspaceSwitcher : function(shellwm, binding, window, backwards) {
/* We don't support this kind of layout */ /* We don't support this kind of layout */
if (binding == "switch_to_workspace_up" || binding == "switch_to_workspace_down") if (binding == 'switch_to_workspace_up' || binding == 'switch_to_workspace_down')
return; return;
if (global.screen.n_workspaces == 1) if (global.screen.n_workspaces == 1)
@ -315,11 +315,11 @@ WindowManager.prototype = {
if (this._workspaceSwitcherPopup == null) if (this._workspaceSwitcherPopup == null)
this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
if (binding == "switch_to_workspace_left") { if (binding == 'switch_to_workspace_left') {
this.actionMoveWorkspaceLeft(); this.actionMoveWorkspaceLeft();
} }
if (binding == "switch_to_workspace_right") { if (binding == 'switch_to_workspace_right') {
this.actionMoveWorkspaceRight(); this.actionMoveWorkspaceRight();
} }
}, },

View File

@ -325,7 +325,7 @@ DesktopClone.prototype = {
Tweener.addTween(this._desktop, Tweener.addTween(this._desktop,
{ opacity: 255, { opacity: 255,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad" }); transition: 'easeOutQuad' });
} }
}, },
@ -339,7 +339,7 @@ DesktopClone.prototype = {
Tweener.addTween(this._desktop, Tweener.addTween(this._desktop,
{ opacity: 0, { opacity: 0,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: Lang.bind(this, onComplete: Lang.bind(this,
function() { function() {
this._desktop.hide(); this._desktop.hide();
@ -374,7 +374,7 @@ WindowOverlay.prototype = {
this._windowClone = windowClone; this._windowClone = windowClone;
this._parentActor = parentActor; this._parentActor = parentActor;
let title = new St.Label({ style_class: "window-caption", let title = new St.Label({ style_class: 'window-caption',
text: metaWindow.title }); text: metaWindow.title });
title.clutter_text.ellipsize = Pango.EllipsizeMode.END; title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
title._spacing = 0; title._spacing = 0;
@ -384,7 +384,7 @@ WindowOverlay.prototype = {
this.title.text = w.title; this.title.text = w.title;
})); }));
let button = new St.Button({ style_class: "window-close" }); let button = new St.Button({ style_class: 'window-close' });
button._overlap = 0; button._overlap = 0;
this._idleToggleCloseId = 0; this._idleToggleCloseId = 0;
@ -439,7 +439,7 @@ WindowOverlay.prototype = {
Tweener.addTween(this.title, Tweener.addTween(this.title,
{ opacity: 255, { opacity: 255,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad" }); transition: 'easeOutQuad' });
}, },
chromeWidth: function () { chromeWidth: function () {
@ -1105,7 +1105,7 @@ Workspace.prototype = {
Tweener.addTween(clone.actor, Tweener.addTween(clone.actor,
{ opacity: 255, { opacity: 255,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeInQuad" transition: 'easeInQuad'
}); });
} }
@ -1116,7 +1116,7 @@ Workspace.prototype = {
scale_y: scale, scale_y: scale,
workspace_relative: workspaceZooming ? this : null, workspace_relative: workspaceZooming ? this : null,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() { onComplete: Lang.bind(this, function() {
this._fadeInWindowOverlay(clone, overlay); this._fadeInWindowOverlay(clone, overlay);
}) })
@ -1370,7 +1370,7 @@ Workspace.prototype = {
workspace_relative: this, workspace_relative: this,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
opacity: 255, opacity: 255,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
} else { } else {
// The window is hidden, make it shrink and fade it out // The window is hidden, make it shrink and fade it out
@ -1380,7 +1380,7 @@ Workspace.prototype = {
opacity: 0, opacity: 0,
workspace_relative: this, workspace_relative: this,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
} }
} }
@ -1403,7 +1403,7 @@ Workspace.prototype = {
scale_x: this.scale, scale_x: this.scale,
scale_y: this.scale, scale_y: this.scale,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: Lang.bind(this, this._fadeInAllOverlays) onComplete: Lang.bind(this, this._fadeInAllOverlays)
}); });
}, },
@ -1423,7 +1423,7 @@ Workspace.prototype = {
scale_x: this.scale, scale_x: this.scale,
scale_y: this.scale, scale_y: this.scale,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
this._visible = true; this._visible = true;
@ -1445,7 +1445,7 @@ Workspace.prototype = {
scale_x: this.scale, scale_x: this.scale,
scale_y: this.scale, scale_y: this.scale,
time: Overview.ANIMATION_TIME, time: Overview.ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: onComplete onComplete: onComplete
}); });

View File

@ -30,8 +30,8 @@ WorkspaceSwitcherPopup.prototype = {
this._scaleWidth = global.screen_width / global.screen_height; this._scaleWidth = global.screen_width / global.screen_height;
this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" }); this._container = new St.BoxLayout({ style_class: 'workspace-switcher-container' });
this._list = new St.BoxLayout({ style_class: "workspace-switcher" }); this._list = new St.BoxLayout({ style_class: 'workspace-switcher' });
this._container.add(this._list); this._container.add(this._list);
@ -73,7 +73,7 @@ WorkspaceSwitcherPopup.prototype = {
_show : function() { _show : function() {
Tweener.addTween(this._container, { opacity: 255, Tweener.addTween(this._container, { opacity: 255,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad" transition: 'easeOutQuad'
}); });
this._position(); this._position();
this.actor.show(); this.actor.show();
@ -92,7 +92,7 @@ WorkspaceSwitcherPopup.prototype = {
this._timeoutId = 0; this._timeoutId = 0;
Tweener.addTween(this._container, { opacity: 0.0, Tweener.addTween(this._container, { opacity: 0.0,
time: ANIMATION_TIME, time: ANIMATION_TIME,
transition: "easeOutQuad", transition: 'easeOutQuad',
onComplete: function() { this.actor.hide(); }, onComplete: function() { this.actor.hide(); },
onCompleteScope: this onCompleteScope: this
}); });

View File

@ -43,7 +43,7 @@ function GenericWorkspacesView(width, height, x, y, workspaces) {
GenericWorkspacesView.prototype = { GenericWorkspacesView.prototype = {
_init: function(width, height, x, y, workspaces) { _init: function(width, height, x, y, workspaces) {
this.actor = new St.Bin({ style_class: "workspaces" }); this.actor = new St.Bin({ style_class: 'workspaces' });
this._actor = new Clutter.Group(); this._actor = new Clutter.Group();
this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@ -227,7 +227,7 @@ GenericWorkspacesView.prototype = {
}, },
createControllerBar: function() { createControllerBar: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
canAddWorkspace: function() { canAddWorkspace: function() {
@ -244,7 +244,7 @@ GenericWorkspacesView.prototype = {
}, },
_getWorkspaceIndexToRemove: function() { _getWorkspaceIndexToRemove: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
canRemoveWorkspace: function() { canRemoveWorkspace: function() {
@ -263,19 +263,19 @@ GenericWorkspacesView.prototype = {
}, },
updateWorkspaces: function() { updateWorkspaces: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
_transitionWorkspaces: function() { _transitionWorkspaces: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
_computeWorkspacePositions: function() { _computeWorkspacePositions: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
_activeWorkspaceChanged: function() { _activeWorkspaceChanged: function() {
throw new Error("Not implemented"); throw new Error('Not implemented');
}, },
_acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) { _acceptNewWorkspaceDrop: function(source, dropActor, x, y, time) {