Merge fx-team to central, a=merge

This commit is contained in:
Wes Kocher 2016-08-17 16:53:20 -07:00
commit ae78ab94fa
174 changed files with 675 additions and 654 deletions

View File

@ -42,7 +42,7 @@ function init(aEvent)
let version = Services.appinfo.version;
if (/a\d+$/.test(version)) {
let buildID = Services.appinfo.appBuildID;
let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8);
let buildDate = buildID.slice(0, 4) + "-" + buildID.slice(4, 6) + "-" + buildID.slice(6, 8);
document.getElementById("version").textContent += " (" + buildDate + ")";
document.getElementById("experimental").hidden = false;
document.getElementById("communityDesc").hidden = true;

View File

@ -150,7 +150,7 @@ var healthReportWrapper = {
initRemotePage: function () {
let iframe = document.getElementById("remote-report").contentDocument;
iframe.addEventListener("RemoteHealthReportCommand",
function onCommand(e) {healthReportWrapper.handleRemoteCommand(e);},
function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
false);
healthReportWrapper.updatePrefState();
},

View File

@ -54,7 +54,7 @@ Cu.import("resource://gre/modules/NotificationDB.jsm");
["fxAccounts", "resource://gre/modules/FxAccounts.jsm"],
["gDevTools", "resource://devtools/client/framework/gDevTools.jsm"],
["gDevToolsBrowser", "resource://devtools/client/framework/gDevTools.jsm"],
["webrtcUI", "resource:///modules/webrtcUI.jsm",],
["webrtcUI", "resource:///modules/webrtcUI.jsm", ]
].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource));
if (AppConstants.MOZ_SAFE_BROWSING) {
@ -741,7 +741,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
}
];
let notification =
notificationBox.appendNotification(message,"keyword-uri-fixup", null,
notificationBox.appendNotification(message, "keyword-uri-fixup", null,
notificationBox.PRIORITY_INFO_HIGH,
buttons);
notification.persistence = 1;
@ -2850,7 +2850,7 @@ var BrowserOnClick = {
}
window.openDialog('chrome://pippki/content/exceptionDialog.xul',
'','chrome,centerscreen,modal', params);
'', 'chrome,centerscreen,modal', params);
// If the user added the exception cert, attempt to reload the page
if (params.exceptionAdded) {
@ -5205,7 +5205,7 @@ var gHomeButton = {
homeButton = document.getElementById("home-button");
if (homeButton) {
var homePage = this.getHomePage();
homePage = homePage.replace(/\|/g,', ');
homePage = homePage.replace(/\|/g, ', ');
if (homePage.toLowerCase() == "about:home")
homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
else

View File

@ -1194,7 +1194,7 @@ var PageInfoListener = {
// TODO: Reimplement once bug 714757 is fixed.
let strVal = val.getStringValue();
if (strVal.search(/^.*url\(\"?/) > -1) {
let url = strVal.replace(/^.*url\(\"?/,"").replace(/\"?\).*$/,"");
let url = strVal.replace(/^.*url\(\"?/, "").replace(/\"?\).*$/, "");
addImage(url, label, strings.notSet, elem, true);
}
}

View File

@ -643,7 +643,7 @@ function openURL(target)
window.open(url, "_blank", "chrome");
}
function onBeginLinkDrag(event,urlField,descField)
function onBeginLinkDrag(event, urlField, descField)
{
if (event.originalTarget.localName != "treechildren")
return;

View File

@ -4661,8 +4661,8 @@
return [];
},
// Also support adding event listeners (forward to the tab container)
addEventListener: function (a,b,c) { this.self.tabContainer.addEventListener(a,b,c); },
removeEventListener: function (a,b,c) { this.self.tabContainer.removeEventListener(a,b,c); }
addEventListener: function (a, b, c) { this.self.tabContainer.addEventListener(a, b, c); },
removeEventListener: function (a, b, c) { this.self.tabContainer.removeEventListener(a, b, c); }
});
]]>
</getter>

View File

@ -543,7 +543,7 @@ function isBidiEnabled() {
try {
var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"]
.getService(Components.interfaces.nsILocaleService);
var systemLocale = localeService.getSystemLocale().getCategory("NSILOCALE_CTYPE").substr(0,3);
var systemLocale = localeService.getSystemLocale().getCategory("NSILOCALE_CTYPE").substr(0, 3);
switch (systemLocale) {
case "ar-":

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1074,7 +1074,7 @@ var CustomizableUIInternal = {
}
}
for (let [,widget] of gPalette) {
for (let [, widget] of gPalette) {
widget.instances.delete(document);
this.notifyListeners("onWidgetInstanceRemoved", widget.id, document);
}
@ -2545,7 +2545,7 @@ var CustomizableUIInternal = {
// Clear the saved state to ensure that defaults will be used.
gSavedState = null;
// Restore the state for each area to its defaults
for (let [areaId,] of gAreas) {
for (let [areaId, ] of gAreas) {
this.restoreStateForArea(areaId);
}
},
@ -2665,7 +2665,7 @@ var CustomizableUIInternal = {
if (!widgetNode) {
// Pick any of the build windows to look at.
let [window,] = [...gBuildWindows][0];
let [window, ] = [...gBuildWindows][0];
[, widgetNode] = this.getWidgetNode(widgetId, window);
}
// If we don't have a node, we assume it's removable. This can happen because
@ -2899,7 +2899,7 @@ this.CustomizableUI = {
*/
windows: {
*[Symbol.iterator]() {
for (let [window,] of gBuildWindows)
for (let [window, ] of gBuildWindows)
yield window;
}
},
@ -3771,7 +3771,7 @@ function WidgetGroupWrapper(aWidget) {
this.__defineSetter__("disabled", function(aValue) {
aValue = !!aValue;
aWidget.disabled = aValue;
for (let [,instance] of aWidget.instances) {
for (let [, instance] of aWidget.instances) {
instance.disabled = aValue;
}
});

View File

@ -363,7 +363,7 @@ Settings.prototype = {
// Final string is sorted by quality (q=) param.
function parseAcceptLanguageList(v) {
return v.match(/([a-z]{1,8}(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/gi)
.sort(function (a , b) {
.sort(function (a, b) {
let qA = parseFloat(a.split(";q=")[1]) || 1.0;
let qB = parseFloat(b.split(";q=")[1]) || 1.0;
return qB - qA;

View File

@ -70,7 +70,7 @@ add_task(function test_LinkChecker_securityCheck() {
];
for (let {url, expected} of urls) {
let observed = PlacesProvider.LinkChecker.checkLoadURI(url);
equal(observed , expected, `can load "${url}"?`);
equal(observed, expected, `can load "${url}"?`);
}
});

View File

@ -727,12 +727,12 @@ BrowserGlue.prototype = {
let buildID = Services.appinfo.appBuildID;
let today = new Date().getTime();
let buildDate = new Date(buildID.slice(0,4), // year
buildID.slice(4,6) - 1, // months are zero-based.
buildID.slice(6,8), // day
buildID.slice(8,10), // hour
buildID.slice(10,12), // min
buildID.slice(12,14)) // ms
let buildDate = new Date(buildID.slice(0, 4), // year
buildID.slice(4, 6) - 1, // months are zero-based.
buildID.slice(6, 8), // day
buildID.slice(8, 10), // hour
buildID.slice(10, 12), // min
buildID.slice(12, 14)) // ms
.getTime();
const millisecondsIn24Hours = 86400000;

View File

@ -736,7 +736,7 @@ var PlacesOrganizer = {
ctx.fillStyle = "GrayText";
ctx.mozTextStyle = "12pt sans serif";
var len = ctx.mozMeasureText(notAvailableText);
ctx.translate(-len/2,0);
ctx.translate(-len/2, 0);
ctx.mozDrawText(notAvailableText);
ctx.restore();
},

View File

@ -30,7 +30,7 @@ add_task(function* () {
yield waitForCondition(function* () {
entry = yield PlacesUtils.keywords.fetch("kw");
return !!entry;
},"Unable to find the expected keyword");
}, "Unable to find the expected keyword");
is(entry.keyword, "kw", "keyword is correct");
is(entry.url.href, TEST_URL, "URL is correct");
is(entry.postData, "accenti%3D%E0%E8%EC%F2%F9&search%3D%25s", "POST data is correct");

View File

@ -72,7 +72,7 @@ function synthesizeDragWithDirection(aElement, aExpectedDragData, aDirection, aC
aCallback()
}, false);
var prevent = function(aEvent) {aEvent.preventDefault();}
var prevent = function(aEvent) { aEvent.preventDefault(); }
var xIncrement = 0;
var yIncrement = 0;

View File

@ -20,7 +20,7 @@ var gConnectionsDialog = {
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
// If the port is 0 and the proxy server is specified, focus on the port and cancel submission.
for (let prefName of ["http","ssl","ftp","socks"]) {
for (let prefName of ["http", "ssl", "ftp", "socks"]) {
let proxyPortPref = document.getElementById("network.proxy." + prefName + "_port");
let proxyPref = document.getElementById("network.proxy." + prefName);
// Only worry about ports which are currently active. If the share option is on, then ignore

View File

@ -167,7 +167,7 @@ function helpButtonCommand() {
function friendlyPrefCategoryNameToInternalName(aName) {
if (aName.startsWith("pane"))
return aName;
return "pane" + aName.substring(0,1).toUpperCase() + aName.substr(1);
return "pane" + aName.substring(0, 1).toUpperCase() + aName.substr(1);
}
// This function is duplicated inside of utilityOverlay.js's openPreferences.

View File

@ -18,13 +18,13 @@ function initTest() {
cm.removeAll();
// data for cookies
var vals = [[searchTerm+".com", dummyTerm, dummyTerm], // match
[searchTerm+".org", dummyTerm, dummyTerm], // match
[dummyTerm+".com", searchTerm, dummyTerm], // match
[dummyTerm+".edu", searchTerm+dummyTerm, dummyTerm],// match
[dummyTerm+".net", dummyTerm, searchTerm], // match
[dummyTerm+".org", dummyTerm, searchTerm+dummyTerm],// match
[dummyTerm+".int", dummyTerm, dummyTerm]]; // no match
var vals = [[searchTerm+".com", dummyTerm, dummyTerm], // match
[searchTerm+".org", dummyTerm, dummyTerm], // match
[dummyTerm+".com", searchTerm, dummyTerm], // match
[dummyTerm+".edu", searchTerm+dummyTerm, dummyTerm], // match
[dummyTerm+".net", dummyTerm, searchTerm], // match
[dummyTerm+".org", dummyTerm, searchTerm+dummyTerm], // match
[dummyTerm+".int", dummyTerm, dummyTerm]]; // no match
// matches must correspond to above data
const matches = 6;
@ -46,7 +46,7 @@ function initTest() {
"Browser:Cookies", "", {});
// when it has loaded, run actual tests
cmd.addEventListener("load", function() {executeSoon(function() {runTest(cmd, searchTerm, vals.length, matches);});}, false);
cmd.addEventListener("load", function() { executeSoon(function() { runTest(cmd, searchTerm, vals.length, matches); }); }, false);
}
function isDisabled(win, expectation) {

View File

@ -51,7 +51,7 @@ var gPermissionManager = {
cycleHeader: function(column) {},
getRowProperties: function(row) { return ""; },
getColumnProperties: function(column) { return ""; },
getCellProperties: function(row,column) {
getCellProperties: function(row, column) {
if (column.element.getAttribute("id") == "siteCol")
return "ltr";

View File

@ -91,12 +91,12 @@ add_task(function* testSyncedTabsSidebarList() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", ()=> Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", ()=> Promise.resolve(Cu.cloneInto(FIXTURE, {})));
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", () => Promise.resolve(Cu.cloneInto(FIXTURE, {})));
yield syncedTabsDeckComponent.updatePanel();
// This is a hacky way of waiting for the view to render. The view renders
@ -144,12 +144,12 @@ add_task(function* testSyncedTabsSidebarFilteredList() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", ()=> Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", ()=> Promise.resolve(Cu.cloneInto(FIXTURE, {})));
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", () => Promise.resolve(Cu.cloneInto(FIXTURE, {})));
yield syncedTabsDeckComponent.updatePanel();
// This is a hacky way of waiting for the view to render. The view renders
@ -204,7 +204,7 @@ add_task(function* testSyncedTabsSidebarStatus() {
isConfiguredToSyncTabs: false,
hasSyncedThisSession: false,
getTabClients() {},
syncTabs() {return Promise.resolve();},
syncTabs() { return Promise.resolve(); },
};
Assert.ok(syncedTabsDeckComponent, "component exists");
@ -212,7 +212,7 @@ add_task(function* testSyncedTabsSidebarStatus() {
sinon.spy(syncedTabsDeckComponent, "updatePanel");
sinon.spy(syncedTabsDeckComponent, "observe");
sinon.stub(syncedTabsDeckComponent, "_accountStatus", ()=> Promise.reject("Test error"));
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.reject("Test error"));
yield syncedTabsDeckComponent.updatePanel();
let selectedPanel = syncedTabsDeckComponent.container.querySelector(".sync-state.selected");
@ -220,7 +220,7 @@ add_task(function* testSyncedTabsSidebarStatus() {
"not-authed panel is selected on auth error");
syncedTabsDeckComponent._accountStatus.restore();
sinon.stub(syncedTabsDeckComponent, "_accountStatus", ()=> Promise.resolve(accountExists));
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(accountExists));
yield syncedTabsDeckComponent.updatePanel();
selectedPanel = syncedTabsDeckComponent.container.querySelector(".sync-state.selected");
Assert.ok(selectedPanel.classList.contains("notAuthedInfo"),
@ -239,14 +239,14 @@ add_task(function* testSyncedTabsSidebarStatus() {
"tabs fetch panel is selected");
SyncedTabs._internal.hasSyncedThisSession = true;
sinon.stub(SyncedTabs._internal, "getTabClients", ()=> Promise.resolve([]));
sinon.stub(SyncedTabs._internal, "getTabClients", () => Promise.resolve([]));
yield syncedTabsDeckComponent.updatePanel();
selectedPanel = syncedTabsDeckComponent.container.querySelector(".sync-state.selected");
Assert.ok(selectedPanel.classList.contains("singleDeviceInfo"),
"tabs fetch panel is selected");
SyncedTabs._internal.getTabClients.restore();
sinon.stub(SyncedTabs._internal, "getTabClients", ()=> Promise.resolve([{id: "mock"}]));
sinon.stub(SyncedTabs._internal, "getTabClients", () => Promise.resolve([{id: "mock"}]));
yield syncedTabsDeckComponent.updatePanel();
selectedPanel = syncedTabsDeckComponent.container.querySelector(".sync-state.selected");
Assert.ok(selectedPanel.classList.contains("tabs-container"),
@ -266,12 +266,12 @@ add_task(function* testSyncedTabsSidebarContextMenu() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", ()=> Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", ()=> Promise.resolve(Cu.cloneInto(FIXTURE, {})));
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));
sinon.stub(SyncedTabs._internal, "getTabClients", () => Promise.resolve(Cu.cloneInto(FIXTURE, {})));
yield syncedTabsDeckComponent.updatePanel();
// This is a hacky way of waiting for the view to render. The view renders

View File

@ -17,7 +17,7 @@ add_task(function* testInitUninit() {
let view = {render: sinon.spy(), destroy: sinon.spy(), container: {}};
ViewMock.returns(view);
sinon.stub(SyncedTabs, "syncTabs", ()=> Promise.resolve());
sinon.stub(SyncedTabs, "syncTabs", () => Promise.resolve());
sinon.spy(deckStore, "on");
sinon.stub(deckStore, "setPanels");
@ -86,7 +86,7 @@ add_task(function* testObserver() {
let view = {render: sinon.spy(), destroy: sinon.spy(), container: {}};
ViewMock.returns(view);
sinon.stub(SyncedTabs, "syncTabs", ()=> Promise.resolve());
sinon.stub(SyncedTabs, "syncTabs", () => Promise.resolve());
sinon.spy(deckStore, "on");
sinon.stub(deckStore, "setPanels");
@ -146,7 +146,7 @@ add_task(function* testPanelStatus() {
});
let isAuthed = false;
sinon.stub(fxAccounts, "accountStatus", ()=> Promise.resolve(isAuthed));
sinon.stub(fxAccounts, "accountStatus", () => Promise.resolve(isAuthed));
let result = yield component.getPanelStatus();
Assert.equal(result, component.PANELS.NOT_AUTHED_INFO);
@ -165,7 +165,7 @@ add_task(function* testPanelStatus() {
SyncedTabsMock.hasSyncedThisSession = true;
let clients = [];
sinon.stub(SyncedTabsMock, "getTabClients", ()=> Promise.resolve(clients));
sinon.stub(SyncedTabsMock, "getTabClients", () => Promise.resolve(clients));
result = yield component.getPanelStatus();
Assert.equal(result, component.PANELS.SINGLE_DEVICE_INFO);
@ -174,11 +174,11 @@ add_task(function* testPanelStatus() {
Assert.equal(result, component.PANELS.TABS_CONTAINER);
fxAccounts.accountStatus.restore();
sinon.stub(fxAccounts, "accountStatus", ()=> Promise.reject("err"));
sinon.stub(fxAccounts, "accountStatus", () => Promise.reject("err"));
result = yield component.getPanelStatus();
Assert.equal(result, component.PANELS.NOT_AUTHED_INFO);
sinon.stub(component, "getPanelStatus", ()=> Promise.resolve("mock-panelId"));
sinon.stub(component, "getPanelStatus", () => Promise.resolve("mock-panelId"));
sinon.spy(deckStore, "selectPanel");
yield component.updatePanel();
Assert.ok(deckStore.selectPanel.calledWith("mock-panelId"));

View File

@ -60,7 +60,7 @@ function is_hidden(element) {
if (style.visibility != "visible")
return true;
if (style.display == "-moz-popup")
return ["hiding","closed"].indexOf(element.state) != -1;
return ["hiding", "closed"].indexOf(element.state) != -1;
// Hiding a parent element will hide all its children
if (element.parentNode != element.ownerDocument)

View File

@ -245,7 +245,7 @@ add_task(function* test_times() {
{startTime: nowSec - 5 * SEC_IN_ONE_DAY,
endTime: nowSec + 10 * SEC_IN_ONE_DAY}],
[true, null, now,
{startTime: nowSec ,
{startTime: nowSec,
endTime: nowSec + 10 * SEC_IN_ONE_DAY}],
[false, "startTime", now,
{startTime: nowSec + 5 * SEC_IN_ONE_DAY,

View File

@ -28,7 +28,7 @@ var pktPanelMessaging = (function() {
// TODO: Figure out why e.target.parentNode is null
// e.target.parentNode.removeChild(e.target);
},false);
}, false);
}

View File

@ -27,7 +27,7 @@ var PKT_SAVED_OVERLAY = function (options)
this.cxt_suggested = 0;
this.cxt_removed = 0;
this.justaddedsuggested = false;
this.fillTagContainer = function(tags,container,tagclass) {
this.fillTagContainer = function(tags, container, tagclass) {
var newtagleft = 0;
container.children().remove();
for (var i = 0; i < tags.length; i++) {
@ -39,7 +39,7 @@ var PKT_SAVED_OVERLAY = function (options)
}
};
this.fillUserTags = function() {
thePKT_SAVED.sendMessage("getTags",{},function(resp)
thePKT_SAVED.sendMessage("getTags", {}, function(resp)
{
if (typeof resp == 'object' && typeof resp.tags == 'object')
{
@ -73,7 +73,7 @@ var PKT_SAVED_OVERLAY = function (options)
if (!myself.mouseInside) {
myself.startCloseTimer();
}
myself.fillTagContainer(newtags,$('.pkt_ext_suggestedtag_detail ul'),'token_suggestedtag');
myself.fillTagContainer(newtags, $('.pkt_ext_suggestedtag_detail ul'), 'token_suggestedtag');
}
else if (resp.status == 'error') {
var msg = $('<p class="suggestedtag_msg">');
@ -87,15 +87,15 @@ var PKT_SAVED_OVERLAY = function (options)
});
}
this.initAutoCloseEvents = function() {
this.wrapper.on('mouseenter',function() {
this.wrapper.on('mouseenter', function() {
myself.mouseInside = true;
myself.stopCloseTimer();
});
this.wrapper.on('mouseleave',function() {
this.wrapper.on('mouseleave', function() {
myself.mouseInside = false;
myself.startCloseTimer();
});
this.wrapper.on('click',function(e) {
this.wrapper.on('click', function(e) {
myself.closeValid = false;
});
};
@ -148,21 +148,21 @@ var PKT_SAVED_OVERLAY = function (options)
if ((inputleft + listleft + 20) > leftwidth)
{
$('.token-input-list').css('left',Math.min(((inputleft + listleftnatural - leftwidth + 20)*-1),0) + 'px');
$('.token-input-list').css('left', Math.min(((inputleft + listleftnatural - leftwidth + 20)*-1), 0) + 'px');
}
else
{
$('.token-input-list').css('left','0');
$('.token-input-list').css('left', '0');
}
};
this.checkPlaceholderStatus = function() {
if (this.wrapper.find('.pkt_ext_tag_input_wrapper').find('.token-input-token').length)
{
this.wrapper.find('.token-input-input-token input').attr('placeholder','');
this.wrapper.find('.token-input-input-token input').attr('placeholder', '');
}
else
{
this.wrapper.find('.token-input-input-token input').attr('placeholder',$('.pkt_ext_tag_input').attr('placeholder')).css('width','200px');
this.wrapper.find('.token-input-input-token input').attr('placeholder', $('.pkt_ext_tag_input').attr('placeholder')).css('width', '200px');
}
};
this.initTagInput = function() {
@ -187,7 +187,7 @@ var PKT_SAVED_OVERLAY = function (options)
}
}
if (!$('.token-input-dropdown-tag').data('init')) {
$('.token-input-dropdown-tag').css('width',inputwrapper.outerWidth()).data('init');
$('.token-input-dropdown-tag').css('width', inputwrapper.outerWidth()).data('init');
inputwrapper.append($('.token-input-dropdown-tag'));
}
cb(returnlist);
@ -199,7 +199,7 @@ var PKT_SAVED_OVERLAY = function (options)
changestamp = Date.now();
setTimeout(function() {
$('.token-input-input-token input').val(text).focus();
},10);
}, 10);
}
return null;
}
@ -208,32 +208,32 @@ var PKT_SAVED_OVERLAY = function (options)
},
onReady: function() {
$('.token-input-dropdown').addClass('token-input-dropdown-tag');
inputwrapper.find('.token-input-input-token input').attr('placeholder',$('.tag-input').attr('placeholder')).css('width','200px');
inputwrapper.find('.token-input-input-token input').attr('placeholder', $('.tag-input').attr('placeholder')).css('width', '200px');
if ($('.pkt_ext_suggestedtag_detail').length) {
myself.wrapper.find('.pkt_ext_suggestedtag_detail').on('click','.token_tag',function(e) {
myself.wrapper.find('.pkt_ext_suggestedtag_detail').on('click', '.token_tag', function(e) {
e.preventDefault();
var tag = $(e.target);
if ($(this).parents('.pkt_ext_suggestedtag_detail_disabled').length) {
return;
}
myself.justaddedsuggested = true;
inputwrapper.find('.pkt_ext_tag_input').tokenInput('add',{id:inputwrapper.find('.token-input-token').length,name:tag.text()});
inputwrapper.find('.pkt_ext_tag_input').tokenInput('add', {id:inputwrapper.find('.token-input-token').length, name:tag.text()});
tag.addClass('token-suggestedtag-inactive');
$('.token-input-input-token input').focus();
});
}
$('.token-input-list').on('keydown','input',function(e) {
$('.token-input-list').on('keydown', 'input', function(e) {
if (e.which == 37) {
myself.updateSlidingTagList();
}
}).on('keypress','input',function(e) {
}).on('keypress', 'input', function(e) {
if (e.which == 13) {
if (typeof changestamp == 'undefined' || (Date.now() - changestamp > 250)) {
e.preventDefault();
myself.wrapper.find('.pkt_ext_btn').trigger('click');
}
}
}).on('keyup','input',function(e) {
}).on('keyup', 'input', function(e) {
myself.checkValidTagSubmit();
});
myself.checkPlaceholderStatus();
@ -257,14 +257,14 @@ var PKT_SAVED_OVERLAY = function (options)
thePKT_SAVED.sendMessage("collapseSavePanel");
}
});
$('body').on('keydown',function(e) {
$('body').on('keydown', function(e) {
var key = e.keyCode || e.which;
if (key == 8) {
var selected = $('.token-input-selected-token');
if (selected.length) {
e.preventDefault();
e.stopImmediatePropagation();
inputwrapper.find('.pkt_ext_tag_input').tokenInput('remove',{name:selected.find('p').text()});
inputwrapper.find('.pkt_ext_tag_input').tokenInput('remove', {name:selected.find('p').text()});
}
}
else if ($(e.target).parent().hasClass('token-input-input-token')) {
@ -338,7 +338,7 @@ var PKT_SAVED_OVERLAY = function (options)
thePKT_SAVED.sendMessage("deleteItem",
{
itemId: myself.savedItemId
},function(resp) {
}, function(resp) {
if (resp.status == 'success') {
myself.showStateFinalMsg(myself.dictJSON.pageremoved);
}
@ -379,7 +379,7 @@ var PKT_SAVED_OVERLAY = function (options)
});
var inactivetags = $('.pkt_ext_suggestedtag_detail').find('.token_tag_inactive');
inactivetags.each(function(index,element) {
inactivetags.each(function(index, element) {
if (activetokenstext.indexOf('|' + $(element).text() + '|') == -1) {
$(element).removeClass('token_tag_inactive');
}
@ -394,7 +394,7 @@ var PKT_SAVED_OVERLAY = function (options)
activetokenstext += $(element).find('p').text() + '|';
});
var activesuggestedtags = $('.token_tag').not('.token_tag_inactive');
activesuggestedtags.each(function(index,element) {
activesuggestedtags.each(function(index, element) {
if (activetokenstext.indexOf('|' + $(element).text() + '|') > -1) {
$(element).addClass('token_tag_inactive');
}
@ -435,7 +435,7 @@ var PKT_SAVED_OVERLAY = function (options)
});
};
this.showStateFinalMsg = function(msg) {
this.wrapper.find('.pkt_ext_tag_detail').one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd',function(e)
this.wrapper.find('.pkt_ext_tag_detail').one('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function(e)
{
$(this).off('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd');
myself.preventCloseTimerCancel = true;
@ -444,7 +444,7 @@ var PKT_SAVED_OVERLAY = function (options)
});
this.wrapper.addClass('pkt_ext_container_finalstate');
};
this.showStateError = function(headline,detail) {
this.showStateError = function(headline, detail) {
this.wrapper.find('.pkt_ext_detail h2').text(headline);
this.wrapper.find('.pkt_ext_detail h3').text(detail);
this.wrapper.addClass('pkt_ext_container_detailactive pkt_ext_container_finalstate pkt_ext_container_finalerrorstate');
@ -560,23 +560,23 @@ PKT_SAVED.prototype = {
thePKT_SAVED.sendMessage("show");
// wait confirmation of save before flipping to final saved state
thePKT_SAVED.addMessageListener("saveLink",function(resp)
thePKT_SAVED.addMessageListener("saveLink", function(resp)
{
if (resp.status == 'error') {
if (typeof resp.error == 'object')
{
if (resp.error.localizedKey)
{
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved,myself.overlay.dictJSON[resp.error.localizedKey]);
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, myself.overlay.dictJSON[resp.error.localizedKey]);
}
else
{
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved,resp.error.message);
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, resp.error.message);
}
}
else
{
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved,myself.overlay.dictJSON.errorgeneric);
myself.overlay.showStateError(myself.overlay.dictJSON.pagenotsaved, myself.overlay.dictJSON.errorgeneric);
}
return;
}

View File

@ -1,150 +1,150 @@
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['saved_premiumextras'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
templates['saved_premiumextras'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) {
return "<div class=\"pkt_ext_suggestedtag_detailshown\">\n</div>";
},"useData":true});
templates['saved_premiumshell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
}, "useData":true});
templates['saved_premiumshell'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<div class=\"pkt_ext_suggestedtag_detail pkt_ext_suggestedtag_detail_loading\">\n <h4>"
+ escapeExpression(((helper = (helper = helpers.suggestedtags || (depth0 != null ? depth0.suggestedtags : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"suggestedtags","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.suggestedtags || (depth0 != null ? depth0.suggestedtags : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"suggestedtags", "hash":{}, "data":data}) : helper)))
+ "</h4>\n <div class=\"pkt_ext_loadingspinner\"><div></div></div>\n <ul class=\"pkt_ext_cf\">\n </ul>\n</div>";
},"useData":true});
templates['saved_shell'] = template({"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
}, "useData":true});
templates['saved_shell'] = template({"compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return "<div class=\"pkt_ext_initload\">\n <div class=\"pkt_ext_logo\"></div> \n <div class=\"pkt_ext_topdetail\">\n <h2>"
+ escapeExpression(((helper = (helper = helpers.saving || (depth0 != null ? depth0.saving : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"saving","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.saving || (depth0 != null ? depth0.saving : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"saving", "hash":{}, "data":data}) : helper)))
+ "</h2>\n </div> \n <div class=\"pkt_ext_loadingspinner\"><div></div></div>\n</div> \n<div class=\"pkt_ext_detail\"> \n <div class=\"pkt_ext_logo\"></div>\n <div class=\"pkt_ext_topdetail\">\n <h2>"
+ escapeExpression(((helper = (helper = helpers.pagesaved || (depth0 != null ? depth0.pagesaved : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pagesaved","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pagesaved || (depth0 != null ? depth0.pagesaved : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pagesaved", "hash":{}, "data":data}) : helper)))
+ "</h2>\n <h3 class=\"pkt_ext_errordetail\"></h3>\n <nav class=\"pkt_ext_item_actions pkt_ext_cf\">\n <ul>\n <li><a class=\"pkt_ext_removeitem\" href=\"#\">"
+ escapeExpression(((helper = (helper = helpers.removepage || (depth0 != null ? depth0.removepage : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"removepage","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.removepage || (depth0 != null ? depth0.removepage : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"removepage", "hash":{}, "data":data}) : helper)))
+ "</a></li>\n <li class=\"pkt_ext_actions_separator\"></li> \n <li><a class=\"pkt_ext_openpocket\" href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/a?src=ff_ext_saved\" target=\"_blank\">"
+ escapeExpression(((helper = (helper = helpers.viewlist || (depth0 != null ? depth0.viewlist : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"viewlist","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.viewlist || (depth0 != null ? depth0.viewlist : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"viewlist", "hash":{}, "data":data}) : helper)))
+ "</a></li>\n </ul>\n </nav> \n </div>\n <div class=\"pkt_ext_tag_detail pkt_ext_cf\">\n <div class=\"pkt_ext_tag_input_wrapper\">\n <div class=\"pkt_ext_tag_input_blocker\"></div>\n <input class=\"pkt_ext_tag_input\" type=\"text\" placeholder=\""
+ escapeExpression(((helper = (helper = helpers.addtags || (depth0 != null ? depth0.addtags : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"addtags","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.addtags || (depth0 != null ? depth0.addtags : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"addtags", "hash":{}, "data":data}) : helper)))
+ "\">\n </div>\n <a href=\"#\" class=\"pkt_ext_btn pkt_ext_btn_disabled\">"
+ escapeExpression(((helper = (helper = helpers.save || (depth0 != null ? depth0.save : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"save","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.save || (depth0 != null ? depth0.save : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"save", "hash":{}, "data":data}) : helper)))
+ "</a>\n </div>\n <p class=\"pkt_ext_edit_msg\"></p> \n</div>";
},"useData":true});
templates['signup_shell'] = template({"1":function(depth0,helpers,partials,data) {
}, "useData":true});
templates['signup_shell'] = template({"1":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"pkt_ext_learnmorecontainer\"><a class=\"pkt_ext_learnmore\" href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "?s=ffi&t=learnmore&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\">"
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"3":function(depth0,helpers,partials,data) {
}, "3":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"pkt_ext_learnmorecontainer\"><a class=\"pkt_ext_learnmore pkt_ext_learnmoreinactive\" href=\"#\">"
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"5":function(depth0,helpers,partials,data) {
}, "5":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/ff_signup?s=ffi&t=signupff&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">"
+ escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox", "hash":{}, "data":data}) : helper)))
+ "</span></a></p>\n";
},"7":function(depth0,helpers,partials,data) {
}, "7":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/ff_signup?s=ffi&t=signupff&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">"
+ escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox", "hash":{}, "data":data}) : helper)))
+ "</span></a></p>\n <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/signup?force=email&src=extension&s=ffi&t=signupemail&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn btn-secondary signup-btn-email signup-btn-initstate\">"
+ escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupemail", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
}, "compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"pkt_ext_introdetail pkt_ext_introdetailhero\">\n <h2 class=\"pkt_ext_logo\">Pocket</h2>\n <p class=\"pkt_ext_tagline\">"
+ escapeExpression(((helper = (helper = helpers.tagline || (depth0 != null ? depth0.tagline : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"tagline","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.tagline || (depth0 != null ? depth0.tagline : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"tagline", "hash":{}, "data":data}) : helper)))
+ "</p>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if", "hash":{}, "fn":this.program(1, data), "inverse":this.program(3, data), "data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " <div class=\"pkt_ext_introimg\"></div>\n</div>\n<div class=\"pkt_ext_signupdetail pkt_ext_signupdetail_hero\">\n <h4>"
+ escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave", "hash":{}, "data":data}) : helper)))
+ "</h4>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if", "hash":{}, "fn":this.program(5, data), "inverse":this.program(7, data), "data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " <p class=\"alreadyhave\">"
+ escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct", "hash":{}, "data":data}) : helper)))
+ " <a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/login?ep=3&src=extension&s=ffi&t=login&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\">"
+ escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"loginnow", "hash":{}, "data":data}) : helper)))
+ "</a>.</p>\n</div>";
},"useData":true});
templates['signupstoryboard_shell'] = template({"1":function(depth0,helpers,partials,data) {
}, "useData":true});
templates['signupstoryboard_shell'] = template({"1":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p><a class=\"pkt_ext_learnmore\" href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "?s=ffi&t=learnmore&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\">"
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"3":function(depth0,helpers,partials,data) {
}, "3":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p><a class=\"pkt_ext_learnmore pkt_ext_learnmoreinactive\" href=\"#\">"
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"learnmore","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.learnmore || (depth0 != null ? depth0.learnmore : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"learnmore", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"5":function(depth0,helpers,partials,data) {
}, "5":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/ff_signup?s=ffi&t=signupff&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">"
+ escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signinfirefox || (depth0 != null ? depth0.signinfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signinfirefox", "hash":{}, "data":data}) : helper)))
+ "</span></a></p>\n";
},"7":function(depth0,helpers,partials,data) {
}, "7":function(depth0, helpers, partials, data) {
var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
return " <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/ff_signup?s=ffi&t=signupff&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn signup-btn-firefox\"><span class=\"logo\"></span><span class=\"text\">"
+ escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signupfirefox || (depth0 != null ? depth0.signupfirefox : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupfirefox", "hash":{}, "data":data}) : helper)))
+ "</span></a></p>\n <p class=\"btn-container\"><a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/signup?force=email&src=extension&s=ffi&t=signupemail&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\" class=\"btn btn-secondary signup-btn-email signup-btn-initstate\">"
+ escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signupemail","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signupemail || (depth0 != null ? depth0.signupemail : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signupemail", "hash":{}, "data":data}) : helper)))
+ "</a></p>\n";
},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) {
}, "compiler":[6, ">= 2.0.0-beta.1"], "main":function(depth0, helpers, partials, data) {
var stack1, helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, buffer = "<div class=\"pkt_ext_introdetail pkt_ext_introdetailstoryboard\">\n <div class=\"pkt_ext_introstory pkt_ext_introstoryone\">\n <div class=\"pkt_ext_introstory_text\">\n <p class=\"pkt_ext_tagline\">"
+ escapeExpression(((helper = (helper = helpers.taglinestory_one || (depth0 != null ? depth0.taglinestory_one : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_one","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.taglinestory_one || (depth0 != null ? depth0.taglinestory_one : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_one", "hash":{}, "data":data}) : helper)))
+ "</p>\n </div>\n <div class=\"pkt_ext_introstoryone_img\"></div>\n </div>\n <div class=\"pkt_ext_introstorydivider\"></div>\n <div class=\"pkt_ext_introstory pkt_ext_introstorytwo\">\n <div class=\"pkt_ext_introstory_text\">\n <p class=\"pkt_ext_tagline\">"
+ escapeExpression(((helper = (helper = helpers.taglinestory_two || (depth0 != null ? depth0.taglinestory_two : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_two","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.taglinestory_two || (depth0 != null ? depth0.taglinestory_two : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"taglinestory_two", "hash":{}, "data":data}) : helper)))
+ "</p>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if","hash":{},"fn":this.program(1, data),"inverse":this.program(3, data),"data":data});
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.showlearnmore : depth0), {"name":"if", "hash":{}, "fn":this.program(1, data), "inverse":this.program(3, data), "data":data});
if (stack1 != null) { buffer += stack1; }
buffer += " </div>\n <div class=\"pkt_ext_introstorytwo_img\"></div>\n </div>\n</div>\n<div class=\"pkt_ext_signupdetail\">\n <h4>"
+ escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.signuptosave || (depth0 != null ? depth0.signuptosave : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"signuptosave", "hash":{}, "data":data}) : helper)))
+ "</h4>\n";
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if","hash":{},"fn":this.program(5, data),"inverse":this.program(7, data),"data":data});
stack1 = helpers['if'].call(depth0, (depth0 != null ? depth0.fxasignedin : depth0), {"name":"if", "hash":{}, "fn":this.program(5, data), "inverse":this.program(7, data), "data":data});
if (stack1 != null) { buffer += stack1; }
return buffer + " <p class=\"alreadyhave\">"
+ escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.alreadyhaveacct || (depth0 != null ? depth0.alreadyhaveacct : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"alreadyhaveacct", "hash":{}, "data":data}) : helper)))
+ " <a href=\"https://"
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pockethost","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.pockethost || (depth0 != null ? depth0.pockethost : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"pockethost", "hash":{}, "data":data}) : helper)))
+ "/login?ep=3&src=extension&s=ffi&t=login&v="
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"variant","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.variant || (depth0 != null ? depth0.variant : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"variant", "hash":{}, "data":data}) : helper)))
+ "\" target=\"_blank\">"
+ escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"loginnow","hash":{},"data":data}) : helper)))
+ escapeExpression(((helper = (helper = helpers.loginnow || (depth0 != null ? depth0.loginnow : depth0)) != null ? helper : helperMissing), (typeof helper === functionType ? helper.call(depth0, {"name":"loginnow", "hash":{}, "data":data}) : helper)))
+ "</a>.</p>\n</div>";
},"useData":true});
}, "useData":true});
})();

View File

@ -295,7 +295,7 @@ var pktApi = (function() {
// Set headers
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.setRequestHeader('X-Accept',' application/json');
request.setRequestHeader('X-Accept', ' application/json');
// Serialize and Fire off the request
var str = [];

View File

@ -1206,7 +1206,7 @@ var DirectoryLinksProvider = {
*/
_removeTileClick: function DirectoryLinksProvider_removeTileClick(url = "") {
// remove trailing slash, to accomodate Places sending site urls ending with '/'
let noTrailingSlashUrl = url.replace(/\/$/,"");
let noTrailingSlashUrl = url.replace(/\/$/, "");
let capObject = this._frequencyCaps[url] || this._frequencyCaps[noTrailingSlashUrl];
// return resolved promise if capObject is not found
if (!capObject) {

View File

@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils","resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UITour", "resource:///modules/UITour.jsm");

View File

@ -42,7 +42,7 @@ function test() {
for (let preview of AeroPeek.previews)
ok(preview.visible, "Preview is shown as expected after re-enabling");
[1,2,3,4].forEach(function (idx) {
[1, 2, 3, 4].forEach(function (idx) {
gBrowser.selectedTab = gBrowser.tabs[idx];
ok(checkSelectedTab(), "Current tab is correctly selected");
});

View File

@ -52,7 +52,7 @@ add_task(function* asyncCleanup() {
is(ZoomManager.zoom, 1, "Zoom level was restored");
if (document.getElementById("zoom-controls")) {
CustomizableUI.removeWidgetFromArea("zoom-controls", CustomizableUI.AREA_NAVBAR);
ok(!document.getElementById("zoom-controls"),"Customizable zoom widget removed from toolbar");
ok(!document.getElementById("zoom-controls"), "Customizable zoom widget removed from toolbar");
}
});

View File

@ -30,7 +30,7 @@ do_get_profile();
const DIRECTORY_LINKS_FILE = "directoryLinks.json";
const DIRECTORY_FRECENCY = 1000;
const SUGGESTED_FRECENCY = Infinity;
const kURLData = {"directory": [{"url":"http://example.com","title":"LocalSource"}]};
const kURLData = {"directory": [{"url":"http://example.com", "title":"LocalSource"}]};
const kTestURL = 'data:application/json,' + JSON.stringify(kURLData);
// DirectoryLinksProvider preferences
@ -57,7 +57,7 @@ Services.prefs.setCharPref(kPingUrlPref, kPingUrl);
Services.prefs.setBoolPref(kNewtabEnhancedPref, true);
const kHttpHandlerData = {};
kHttpHandlerData[kExamplePath] = {"directory": [{"url":"http://example.com","title":"RemoteSource"}]};
kHttpHandlerData[kExamplePath] = {"directory": [{"url":"http://example.com", "title":"RemoteSource"}]};
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
"nsIBinaryInputStream",
@ -1438,7 +1438,7 @@ add_task(function* test_DirectoryLinksProvider_getFrequencyCapLogic() {
// now step into the furture
let _wasTodayOrig = DirectoryLinksProvider._wasToday;
DirectoryLinksProvider._wasToday = function () {return false;}
DirectoryLinksProvider._wasToday = function () { return false; }
// exhaust total views
DirectoryLinksProvider._addFrequencyCapView("1")
do_check_true(DirectoryLinksProvider._testFrequencyCapLimits("1"));
@ -1487,7 +1487,7 @@ add_task(function* test_DirectoryLinksProvider_getFrequencyCapReportSiteAction()
targetedSite: "foo.com",
url: "bar.com"
},
isPinned: function() {return false;},
isPinned: function() { return false; },
}], "view", 0);
// read file content and ensure that view counters are updated
@ -1531,9 +1531,9 @@ add_task(function* test_DirectoryLinksProvider_ClickRemoval() {
}]
},
{
handleError: function () {do_check_true(false);},
handleError: function () { do_check_true(false); },
handleResult: function () {},
handleCompletion: function () {resolve();}
handleCompletion: function () { resolve(); }
}
);
});
@ -1828,8 +1828,8 @@ add_task(function* test_blockSuggestedTiles() {
// block suggested tile in a regular way
DirectoryLinksProvider.reportSitesAction([{
isPinned: function() {return false;},
link: Object.assign({frecency: 1000},suggestedLink)
isPinned: function() { return false; },
link: Object.assign({frecency: 1000}, suggestedLink)
}], "block", 0);
// suggested tile still must be recommended

View File

@ -8,8 +8,8 @@ Components.utils.import("resource://gre/modules/Services.jsm");
add_task(function* testPermissionsListing() {
Assert.deepEqual(SitePermissions.listPermissions().sort(),
["camera","cookie","desktop-notification","geo","image",
"indexedDB","install","microphone","popup", "screen"],
["camera", "cookie", "desktop-notification", "geo", "image",
"indexedDB", "install", "microphone", "popup", "screen"],
"Correct list of all permissions");
});

View File

@ -1071,11 +1071,6 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
#panic-button@toolbarButtonPressed@ {
-moz-image-region: rect(36px, 1404px, 72px, 1368px);
}
#add-share-provider {
list-style-image: url(chrome://browser/skin/menuPanel-small@2x.png);
-moz-image-region: rect(0px, 192px, 32px, 160px);
}
}
toolbar .toolbarbutton-1:not([type="menu-button"]),

View File

@ -314,6 +314,11 @@
-moz-image-region: rect(0, 1664px, 64px, 1600px);
}
#add-share-provider {
list-style-image: url(chrome://browser/skin/menuPanel-small@2x.png);
-moz-image-region: rect(0px, 192px, 32px, 160px);
}
/* Footer and wide panel control icons */
#edit-controls@inAnyPanel@ > toolbarbutton,
#zoom-controls@inAnyPanel@ > toolbarbutton,

View File

@ -20,7 +20,7 @@ this.Buttons = {
configurations: {
navBarButtons: {
applyConfig: Task.async(() =>{
applyConfig: Task.async(() => {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
CustomizableUI.addWidgetToArea("screenshot-widget", CustomizableUI.AREA_NAVBAR);
}),

View File

@ -1,30 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* 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/. */
/* Set the minimum width for the side bar so, all tabs are
properly visible. The value can be decreased when bug 1281789
is fixed and the all-tabs-menu is available again. */
#inspector-sidebar-container {
overflow: hidden;
min-width: 450px;
position: relative;
}
#inspector-sidebar {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
/* Override `-moz-user-focus:ignore;` from toolkit/content/minimal-xul.css */
.inspector-tabpanel > * {
-moz-user-focus: normal;
}
#inspector-sidebar-toggle-box {
line-height: initial;
}

View File

@ -4,7 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/shared/widgets/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/content/inspector/inspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/widgets.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/inspector.css" type="text/css"?>
<?xml-stylesheet href="chrome://devtools/skin/rules.css" type="text/css"?>

View File

@ -143,7 +143,6 @@ devtools.jar:
* content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
content/inspector/inspector.xul (inspector/inspector.xul)
content/inspector/inspector.css (inspector/inspector.css)
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
content/framework/connect/connect.css (framework/connect/connect.css)
content/framework/connect/connect.js (framework/connect/connect.js)

View File

@ -42,10 +42,6 @@
border-left: 1px solid var(--theme-splitter-color);
}
.presets-list .add {
margin-top: 4px;
}
#filter-container:not(.show-presets) .presets-list {
width: 0;
border-left: none;
@ -73,6 +69,7 @@
.footer {
display: flex;
margin: 10px 3px;
align-items: center;
}
.footer :not(button) {

View File

@ -25,6 +25,13 @@
display: inline-block;
}
/* Add element toolbar button */
#inspector-element-add-button::before {
background-image: url("chrome://devtools/skin/images/add.svg");
list-style-image: url("chrome://devtools/skin/images/add.svg");
-moz-user-focus: normal;
}
#inspector-searchlabel {
overflow: hidden;
margin-inline-end: 2px;
@ -52,6 +59,21 @@
line-height: 17px;
}
/* Eyedropper toolbar button */
#inspector-eyedropper-toggle {
/* hidden by default, until we can check that the required highlighter exists */
display: none;
}
#inspector-eyedropper-toggle::before {
background-image: var(--eyedropper-image);
}
#inspector-sidebar-toggle-box {
line-height: initial;
}
#inspector-breadcrumbs-toolbar {
padding: 0px;
border-bottom-width: 0px;
@ -97,21 +119,25 @@
font: message-box;
}
/* Eyedropper toolbar button */
#inspector-eyedropper-toggle {
/* hidden by default, until we can check that the required highlighter exists */
display: none;
/* Set the minimum width for the side bar so, all tabs are
properly visible. The value can be decreased when bug 1281789
is fixed and the all-tabs-menu is available again. */
#inspector-sidebar-container {
overflow: hidden;
min-width: 450px;
position: relative;
}
#inspector-eyedropper-toggle::before {
background-image: var(--eyedropper-image);
#inspector-sidebar {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
/* Add element toolbar button */
#inspector-element-add-button::before {
background-image: url("chrome://devtools/skin/images/add.svg");
list-style-image: url("chrome://devtools/skin/images/add.svg");
/* Override `-moz-user-focus:ignore;` from toolkit/content/minimal-xul.css */
.inspector-tabpanel > * {
-moz-user-focus: normal;
}

View File

@ -156,6 +156,15 @@ var inputTests = [
inspectable: true,
variablesViewLabel: "Object",
},
// 17
{
input: '({" ": "a"})',
output: 'Object { : "a" }',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
},
];
function test() {

View File

@ -1795,13 +1795,18 @@ DebuggerServer.ObjectActorPreviewers.Object = [
function PseudoArray({obj, hooks}, grip, rawObj) {
let length = 0;
// Making sure all keys are numbers from 0 to length-1
let keys = obj.getOwnPropertyNames();
if (keys.length == 0) {
return false;
}
// Making sure that all keys are array indices, that is:
// `ToString(ToUint32(key)) === key && key !== "4294967295"`.
// Also ensuring that the keys are consecutive and start at "0",
// this implies checking `key !== "4294967295"` is not necessary.
for (let key of keys) {
if (isNaN(key) || key != length++) {
let numKey = key >>> 0; // ToUint32(key)
if (numKey + '' != key || numKey != length++) {
return false;
}
}

View File

@ -16,6 +16,16 @@ from symFileManager import SymFileManager
from symbolicationRequest import SymbolicationRequest
from symLogging import LogMessage
"""
Symbolication is broken when using type 'str' in python 2.7, so we use 'basestring'.
But for python 3.0 compatibility, 'basestring' isn't defined, but the 'str' type works.
So we force 'basestring' to 'str'.
"""
try:
basestring
except NameError:
basestring = str
class SymbolError(Exception):
pass
@ -266,7 +276,7 @@ class ProfileSymbolicator:
delta_time = profile_start_time - self.main_start_time
for i, thread in enumerate(profile_json["threads"]):
if isinstance(thread, str):
if isinstance(thread, basestring):
thread_json = json.loads(thread)
self.symbolicate_profile(thread_json)
profile_json["threads"][i] = json.dumps(thread_json)
@ -297,7 +307,7 @@ class ProfileSymbolicator:
def _find_addresses_v3(self, profile_json):
addresses = set()
for thread in profile_json["threads"]:
if isinstance(thread, str):
if isinstance(thread, basestring):
continue
for s in thread["stringTable"]:
if s[0:2] == "0x":
@ -306,7 +316,7 @@ class ProfileSymbolicator:
def _substitute_symbols_v3(self, profile_json, symbolication_table):
for thread in profile_json["threads"]:
if isinstance(thread, str):
if isinstance(thread, basestring):
continue
for i, s in enumerate(thread["stringTable"]):
thread["stringTable"][i] = symbolication_table.get(s, s)

View File

@ -16,6 +16,16 @@ gLibNameRE = re.compile("[0-9a-zA-Z_+\-\.]*$")
# for symbolication. Also prevents loops.
MAX_FORWARDED_REQUESTS = 3
"""
Symbolication is broken when using type 'str' in python 2.7, so we use 'basestring'.
But for python 3.0 compatibility, 'basestring' isn't defined, but the 'str' type works.
So we force 'basestring' to 'str'.
"""
try:
basestring
except NameError:
basestring = str
class ModuleV3:
@ -25,11 +35,11 @@ class ModuleV3:
def getModuleV3(libName, breakpadId):
if not isinstance(libName, str) or not gLibNameRE.match(libName):
if not isinstance(libName, basestring) or not gLibNameRE.match(libName):
LogTrace("Bad library name: " + str(libName))
return None
if not isinstance(breakpadId, str):
if not isinstance(breakpadId, basestring):
LogTrace("Bad breakpad id: " + str(breakpadId))
return None

View File

@ -6,22 +6,22 @@
// "arrow-body-style": [2, "as-needed"],
// Require spacing around =>
// "arrow-spacing": 2,
"arrow-spacing": 2,
// Always require spacing around a single line block
// "block-spacing": 1,
"block-spacing": 2,
// No newline before open brace for a block
// "brace-style": 2,
// No space before always a space after a comma
// "comma-spacing": [2, {"before": false, "after": true}],
"comma-spacing": [2, {"before": false, "after": true}],
// Commas at the end of the line not the start
// "comma-style": 2,
// Don't require spaces around computed properties
// "computed-property-spacing": [2, "never"],
"computed-property-spacing": [2, "never"],
// Functions must always return something or nothing
"consistent-return": 2,

View File

@ -130,7 +130,7 @@ let tabFinder = {
function wait(ms = 0) {
try {
let resolve;
let p = new Promise(resolve_ => {resolve = resolve_});
let p = new Promise(resolve_ => { resolve = resolve_ });
setTimeout(resolve, ms);
return p;
} catch (e) {

View File

@ -228,8 +228,8 @@ function unregisterAutoCompleteSearch(aSearch) {
* Test AutoComplete with multiple AutoCompleteSearch sources.
*/
function run_test() {
var expected1 = ["1","2","3"];
var expected2 = ["a","b","c"];
var expected1 = ["1", "2", "3"];
var expected2 = ["a", "b", "c"];
var search1 = new AutoCompleteSearch("search1",
new AutoCompleteResult(expected1, [], []));
var search2 = new AutoCompleteSearch("search2",

View File

@ -40,7 +40,7 @@ function test_portal_not_found() {
do_check_eq(++step, 2);
do_check_true(success);
do_check_eq(attempt, 1);
gServer.stop(function() {dump('server stop\n'); do_test_finished(); });
gServer.stop(function() { dump('server stop\n'); do_test_finished(); });
}
};

View File

@ -349,7 +349,7 @@ ContentPrefService2.prototype = {
this._remove(group, name, true, context, callback);
},
removeGlobal: function CPS2_removeGlobal(name, context,callback) {
removeGlobal: function CPS2_removeGlobal(name, context, callback) {
this._remove(null, name, false, context, callback);
},

View File

@ -228,7 +228,7 @@ ContentPrefService.prototype = {
if (this._privModeStorage.has(group, aName)) {
let value = this._privModeStorage.get(group, aName);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;
@ -597,7 +597,7 @@ ContentPrefService.prototype = {
if (this._cache.has(aGroup, aSetting)) {
value = this._cache.get(aGroup, aSetting);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;
@ -647,7 +647,7 @@ ContentPrefService.prototype = {
if (this._cache.has(null, aName)) {
value = this._cache.get(null, aName);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;

View File

@ -79,22 +79,22 @@ function run_test() {
do_check_eq(cps.setPref(stringURI, "test.2", 2), undefined);
do_check_eq(cps.setPref(uri, "test.1", 1), undefined);
enumerateAndCheck(cps.getPrefs(uri), 8, ["test.1","test.2","test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 8, ["test.1","test.2","test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 8, ["test.1","test.2","test.5"]);
enumerateAndCheck(cps.getPrefs(uri), 8, ["test.1", "test.2", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 8, ["test.1", "test.2", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 8, ["test.1", "test.2", "test.5"]);
do_check_eq(cps.setPref(uri, "test.4", 4), undefined);
do_check_eq(cps.setPref(stringObjectURI, "test.0", 0), undefined);
enumerateAndCheck(cps.getPrefs(uri), 12, ["test.0","test.1","test.2","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 12, ["test.0","test.1","test.2","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 12, ["test.0","test.1","test.2","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(uri), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
do_check_eq(cps.setPref(stringURI, "test.3", 3), undefined);
enumerateAndCheck(cps.getPrefs(uri), 15, ["test.0","test.1","test.2","test.3","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 15, ["test.0","test.1","test.2","test.3","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 15, ["test.0","test.1","test.2","test.3","test.4","test.5"]);
enumerateAndCheck(cps.getPrefs(uri), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringURI), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
enumerateAndCheck(cps.getPrefs(stringObjectURI), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
}
}

View File

@ -35,9 +35,9 @@ function onload()
document.getElementById("cancel").accessKey = dialog.getAttribute("cancelKey");
// hook up button icons where implemented
document.getElementById("ok").setAttribute("icon","accept");
document.getElementById("cancel").setAttribute("icon","cancel");
document.getElementById("disclosureButton").setAttribute("icon","properties");
document.getElementById("ok").setAttribute("icon", "accept");
document.getElementById("cancel").setAttribute("icon", "cancel");
document.getElementById("disclosureButton").setAttribute("icon", "properties");
if (!gDateService) {
const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1";
@ -58,17 +58,17 @@ function onload()
detailsAccessKey = cookieBundle.getString('detailsAccessKey');
if (document.getElementById('infobox').hidden) {
document.getElementById('disclosureButton').setAttribute("label",showDetails);
document.getElementById('disclosureButton').setAttribute("label", showDetails);
} else {
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
document.getElementById('disclosureButton').setAttribute("label", hideDetails);
}
document.getElementById('disclosureButton').setAttribute("accesskey",detailsAccessKey);
document.getElementById('disclosureButton').setAttribute("accesskey", detailsAccessKey);
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) {
try {
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
var objects = params.objects;
var cookie = params.objects.queryElementAt(0,nsICookie);
var cookie = params.objects.queryElementAt(0, nsICookie);
var cookiesFromHost = params.GetInt(nsICookieAcceptDialog.COOKIESFROMHOST);
var messageFormat;
@ -85,18 +85,18 @@ function onload()
var messageText;
if (cookie)
messageText = cookieBundle.getFormattedString(messageFormat,[hostname, cookiesFromHost]);
messageText = cookieBundle.getFormattedString(messageFormat, [hostname, cookiesFromHost]);
else
// No cookies means something went wrong. Bring up the dialog anyway
// to not make the mess worse.
messageText = cookieBundle.getFormattedString(messageFormat,["",cookiesFromHost]);
messageText = cookieBundle.getFormattedString(messageFormat, ["", cookiesFromHost]);
var messageParent = document.getElementById("dialogtextbox");
var messageParagraphs = messageText.split("\n");
// use value for the header, so it doesn't wrap.
var headerNode = document.getElementById("dialog-header");
headerNode.setAttribute("value",messageParagraphs[0]);
headerNode.setAttribute("value", messageParagraphs[0]);
// use childnodes here, the text can wrap
for (var i = 1; i < messageParagraphs.length; i++) {
@ -107,15 +107,15 @@ function onload()
}
if (cookie) {
document.getElementById('ifl_name').setAttribute("value",cookie.name);
document.getElementById('ifl_value').setAttribute("value",cookie.value);
document.getElementById('ifl_host').setAttribute("value",cookie.host);
document.getElementById('ifl_path').setAttribute("value",cookie.path);
document.getElementById('ifl_name').setAttribute("value", cookie.name);
document.getElementById('ifl_value').setAttribute("value", cookie.value);
document.getElementById('ifl_host').setAttribute("value", cookie.host);
document.getElementById('ifl_path').setAttribute("value", cookie.path);
document.getElementById('ifl_isSecure').setAttribute("value",
cookie.isSecure ?
cookieBundle.getString("forSecureOnly") : cookieBundle.getString("forAnyConnection")
);
document.getElementById('ifl_expires').setAttribute("value",GetExpiresString(cookie.expires));
document.getElementById('ifl_expires').setAttribute("value", GetExpiresString(cookie.expires));
document.getElementById('ifl_isDomain').setAttribute("value",
cookie.isDomain ?
cookieBundle.getString("domainColon") : cookieBundle.getString("hostColon")
@ -144,11 +144,11 @@ function showhideinfo()
var infobox=document.getElementById('infobox');
if (infobox.hidden) {
infobox.setAttribute("hidden","false");
document.getElementById('disclosureButton').setAttribute("label",hideDetails);
infobox.setAttribute("hidden", "false");
document.getElementById('disclosureButton').setAttribute("label", hideDetails);
} else {
infobox.setAttribute("hidden","true");
document.getElementById('disclosureButton').setAttribute("label",showDetails);
infobox.setAttribute("hidden", "true");
document.getElementById('disclosureButton').setAttribute("label", showDetails);
}
sizeToContent();
}

View File

@ -2652,7 +2652,7 @@ function run_single_closure_tests(library, abi, suffix)
// mismatch with the cx stashed in the closure.
try {
var sb = Components.utils.Sandbox("http://www.example.com");
sb.fn = fn_v_t(function() {sb.foo = {};});
sb.fn = fn_v_t(function() { sb.foo = {}; });
Components.utils.evalInSandbox("fn();", sb);
} catch (e) {} // Components not available in workers.
@ -2734,9 +2734,9 @@ function run_variadic_tests(library) {
do_check_eq(result.value, 3 + 5 + 7 + 11);
result = ctypes.int32_t.array(3)([1,1,1]),
v1 = ctypes.int32_t.array(4)([1,2,3,5]),
v2 = ctypes.int32_t.array(3)([7,11,13]),
result = ctypes.int32_t.array(3)([1, 1, 1]),
v1 = ctypes.int32_t.array(4)([1, 2, 3, 5]),
v2 = ctypes.int32_t.array(3)([7, 11, 13]),
vector_add_va = library.declare("test_vector_add_va_cdecl",
ctypes.default_abi, ctypes.int32_t.ptr,
ctypes.uint8_t, ctypes.uint8_t, "..."),

View File

@ -363,7 +363,7 @@ Preference.prototype = {
},
set locked(aValue) {
this.branch._prefs[ aValue ? "lockPref" : "unlockPref" ](this.name);
this.branch._prefs[aValue ? "lockPref" : "unlockPref"](this.name);
},
get modified() {

View File

@ -93,7 +93,7 @@ function isIFeedContainer(a) {
}
function stripTags(someHTML) {
return someHTML.replace(/<[^>]+>/g,"");
return someHTML.replace(/<[^>]+>/g, "");
}
/**
@ -228,16 +228,16 @@ function Feed() {
Feed.prototype = {
searchLists: {
title: ["title", "rss1:title", "atom03:title", "atom:title"],
subtitle: ["description","dc:description","rss1:description",
"atom03:tagline","atom:subtitle"],
items: ["items","atom03_entries","entries"],
id: ["atom:id","rdf:about"],
subtitle: ["description", "dc:description", "rss1:description",
"atom03:tagline", "atom:subtitle"],
items: ["items", "atom03_entries", "entries"],
id: ["atom:id", "rdf:about"],
generator: ["generator"],
authors : ["authors"],
contributors: ["contributors"],
link: [["link",strToURI],["rss1:link",strToURI]],
link: [["link", strToURI], ["rss1:link", strToURI]],
categories: ["categories", "dc:subject"],
rights: ["atom03:rights","atom:rights"],
rights: ["atom03:rights", "atom:rights"],
cloud: ["cloud"],
image: ["image", "rss1:image", "atom:logo"],
textInput: ["textInput", "rss1:textinput"],
@ -406,15 +406,15 @@ Entry.prototype = {
searchLists: {
title: ["title", "rss1:title", "atom03:title", "atom:title"],
link: [["link",strToURI],["rss1:link",strToURI]],
link: [["link", strToURI], ["rss1:link", strToURI]],
id: [["guid", makePropGetter("guid")], "rdf:about",
"atom03:id", "atom:id"],
authors : ["authors"],
contributors: ["contributors"],
summary: ["description", "rss1:description", "dc:description",
"atom03:summary", "atom:summary"],
content: ["content:encoded","atom03:content","atom:content"],
rights: ["atom03:rights","atom:rights"],
content: ["content:encoded", "atom03:content", "atom:content"],
rights: ["atom03:rights", "atom:rights"],
published: ["pubDate", "atom03:issued", "dcterms:issued", "atom:published"],
updated: ["pubDate", "atom03:modified", "dc:date", "dcterms:modified",
"atom:updated"]
@ -659,13 +659,13 @@ Generator.prototype = {
set attributes(value) {
this._attributes = value;
this.version = this._attributes.getValueFromName("","version");
var uriAttribute = this._attributes.getValueFromName("","uri") ||
this._attributes.getValueFromName("","url");
this.version = this._attributes.getValueFromName("", "version");
var uriAttribute = this._attributes.getValueFromName("", "uri") ||
this._attributes.getValueFromName("", "url");
this.uri = strToURI(uriAttribute, this.baseURI);
// RSS1
uriAttribute = this._attributes.getValueFromName(RDF_NS,"resource");
uriAttribute = this._attributes.getValueFromName(RDF_NS, "resource");
if (uriAttribute) {
this.agent = uriAttribute;
this.uri = strToURI(uriAttribute, this.baseURI);
@ -706,7 +706,7 @@ Person.prototype = {
* transformation function (like parseInt).
*/
function fieldsToObj(container, fields) {
var props,prop,field,searchList;
var props, prop, field, searchList;
for (var key in fields) {
searchList = fields[key];
for (var i=0; i < searchList.length; ++i) {
@ -775,7 +775,7 @@ function rssGuid(s, guid) {
// We want to split this up and assign it to corresponding Atom
// fields.
//
function rssAuthor(s,author) {
function rssAuthor(s, author) {
author.QueryInterface(Ci.nsIFeedPerson);
// check for RSS2 string format
var chars = s.trim();
@ -1400,7 +1400,7 @@ FeedProcessor.prototype = {
//
if ((this._result.version == "atom" || this._result.version == "atom03") &&
this._textConstructs[key] != null) {
var type = attributes.getValueFromName("","type");
var type = attributes.getValueFromName("", "type");
if (type != null && type.indexOf("xhtml") >= 0) {
this._xhtmlHandler =
new XHTMLHandler(this, (this._result.version == "atom"));
@ -1545,7 +1545,7 @@ FeedProcessor.prototype = {
// off the handle in the browser, and loses track of the interface
// on large files. Bug 335638.
newProp.QueryInterface(Ci.nsIMutableArray);
newProp.appendElement(obj,false);
newProp.appendElement(obj, false);
// If new object is an nsIFeedContainer, we want to deal with
// its member nsIPropertyBag instead.
@ -1556,7 +1556,7 @@ FeedProcessor.prototype = {
else {
// If it doesn't, set it.
if (!prop) {
container.setPropertyAsInterface(elementInfo.fieldName,obj);
container.setPropertyAsInterface(elementInfo.fieldName, obj);
}
newProp = container.getProperty(elementInfo.fieldName);
}
@ -1629,7 +1629,7 @@ FeedProcessor.prototype = {
"0.94":"rss094" }
if (versions[versionAttr])
return versions[versionAttr];
if (versionAttr.substr(0,2) != "2.")
if (versionAttr.substr(0, 2) != "2.")
return "rssUnknown";
return "rss2";
},
@ -1712,7 +1712,7 @@ FeedProcessor.prototype = {
newProp.text = chars;
// Look up the default type in our table
var type = this._textConstructs[propName];
var typeAttribute = attributes.getValueFromName("","type");
var typeAttribute = attributes.getValueFromName("", "type");
if (this._result.version == "atom" && typeAttribute != null) {
type = typeAttribute;
}

View File

@ -811,7 +811,7 @@ function processPathEntry(path, fileArray)
file.initWithPath(filePath);
else if ((filePath.indexOf("/../") > 0) ||
(filePath.substr(-3) == "/..") ||
(filePath.substr(0,3) == "../") ||
(filePath.substr(0, 3) == "../") ||
(filePath == "..")) {
/* appendRelativePath doesn't allow .. */
try {

View File

@ -309,7 +309,7 @@ SanityTest.prototype = {
// There's no clean way to have an invisible window and ensure it's always painted.
// Instead, move the window far offscreen so it doesn't show up during launch.
sanityTest.moveTo(100000000,1000000000);
sanityTest.moveTo(100000000, 1000000000);
tester.scheduleTest(sanityTest);
},
};

View File

@ -73,10 +73,10 @@ const TEST_REFERRER_URL = "http://www.example.com/referrer.html";
const TEST_DATA_SHORT = "This test string is downloaded.";
// Generate using gzipCompressString in TelemetryController.jsm.
const TEST_DATA_SHORT_GZIP_ENCODED_FIRST = [
31,139,8,0,0,0,0,0,0,3,11,201,200,44,86,40,73,45,46,81,40,46,41,202,204
31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 11, 201, 200, 44, 86, 40, 73, 45, 46, 81, 40, 46, 41, 202, 204
];
const TEST_DATA_SHORT_GZIP_ENCODED_SECOND = [
75,87,0,114,83,242,203,243,114,242,19,83,82,83,244,0,151,222,109,43,31,0,0,0
75, 87, 0, 114, 83, 242, 203, 243, 114, 242, 19, 83, 82, 83, 244, 0, 151, 222, 109, 43, 31, 0, 0, 0
];
const TEST_DATA_SHORT_GZIP_ENCODED =
TEST_DATA_SHORT_GZIP_ENCODED_FIRST.concat(TEST_DATA_SHORT_GZIP_ENCODED_SECOND);

View File

@ -331,7 +331,7 @@ var Microformats; // jshint ignore:line
// find base tag to set baseUrl
baseTag = modules.domUtils.querySelector(this.document,'base');
baseTag = modules.domUtils.querySelector(this.document, 'base');
if (baseTag) {
href = modules.domUtils.getAttribute(baseTag, 'href');
if (href) {
@ -821,7 +821,7 @@ var Microformats; // jshint ignore:line
}
if (!out) {
out = modules.domUtils.getAttrValFromTagList(node, ['data','input'], 'value');
out = modules.domUtils.getAttrValFromTagList(node, ['data', 'input'], 'value');
}
if (node.name === 'br' || node.name === 'hr') {
@ -882,7 +882,7 @@ var Microformats; // jshint ignore:line
}
if (!out) {
out = modules.domUtils.getAttrValFromTagList(node, ['img','audio','video','source'], 'src');
out = modules.domUtils.getAttrValFromTagList(node, ['img', 'audio', 'video', 'source'], 'src');
}
if (!out) {
@ -899,7 +899,7 @@ var Microformats; // jshint ignore:line
}
if (!out) {
out = modules.domUtils.getAttrValFromTagList(node, ['data','input'], 'value');
out = modules.domUtils.getAttrValFromTagList(node, ['data', 'input'], 'value');
}
if (!out) {
@ -977,8 +977,8 @@ var Microformats; // jshint ignore:line
appendRootID: function(node, id, propertyName) {
if (this.hasRootID(node, id, propertyName) === false) {
var rootids = [];
if (modules.domUtils.hasAttribute(node,'rootids')) {
rootids = modules.domUtils.getAttributeList(node,'rootids');
if (modules.domUtils.hasAttribute(node, 'rootids')) {
rootids = modules.domUtils.getAttributeList(node, 'rootids');
}
rootids.push('id' + id + '-' + propertyName);
modules.domUtils.setAttribute(node, 'rootids', rootids.join(' '));
@ -996,7 +996,7 @@ var Microformats; // jshint ignore:line
*/
hasRootID: function(node, id, propertyName) {
var rootids = [];
if (!modules.domUtils.hasAttribute(node,'rootids')) {
if (!modules.domUtils.hasAttribute(node, 'rootids')) {
return false;
}
rootids = modules.domUtils.getAttributeList(node, 'rootids');
@ -1053,7 +1053,7 @@ var Microformats; // jshint ignore:line
return out.join('');
}
if (propertyType === 'dt') {
return modules.dates.concatFragments(out,this.options.dateFormat).toString(this.options.dateFormat);
return modules.dates.concatFragments(out, this.options.dateFormat).toString(this.options.dateFormat);
}
return undefined;
}
@ -1155,7 +1155,7 @@ var Microformats; // jshint ignore:line
z = context.propertyPrefixes.length;
while (z--) {
if (modules.utils.startWith(item, context.propertyPrefixes[z])) {
out.properties.push([item,'v2']);
out.properties.push([item, 'v2']);
}
}
@ -1209,10 +1209,10 @@ var Microformats; // jshint ignore:line
}
//only add property once
if (out.properties.indexOf(propName) === -1) {
out.properties.push([propName,'v1']);
out.properties.push([propName, 'v1']);
}
} else if (out.properties.indexOf(propName) === -1) {
out.properties.push([propName,'v1']);
out.properties.push([propName, 'v1']);
}
}
}
@ -1425,7 +1425,7 @@ var Microformats; // jshint ignore:line
arr = modules.domUtils.getNodesByAttribute(rootNode, 'rootids');
i = arr.length;
while (i--) {
modules.domUtils.removeAttribute(arr[i],'rootids');
modules.domUtils.removeAttribute(arr[i], 'rootids');
}
},
@ -1661,7 +1661,7 @@ var Microformats; // jshint ignore:line
* @return {String || null}
*/
modules.Parser.prototype.getNameAttr = function(node) {
var value = modules.domUtils.getAttrValFromTagList(node, ['img','area'], 'alt');
var value = modules.domUtils.getAttrValFromTagList(node, ['img', 'area'], 'alt');
if (!value) {
value = modules.domUtils.getAttrValFromTagList(node, ['abbr'], 'title');
}
@ -1750,15 +1750,15 @@ var Microformats; // jshint ignore:line
modules.Parser.prototype.getAltValue = function(uf, parentPropertyName, propertyName, value) {
if (uf.value && !uf.altValue) {
// first p-name of the h-* child
if (modules.utils.startWith(parentPropertyName,'p-') && propertyName === 'p-name') {
if (modules.utils.startWith(parentPropertyName, 'p-') && propertyName === 'p-name') {
uf.altValue = {name: propertyName, value: value};
}
// if it's an e-* property element
if (modules.utils.startWith(parentPropertyName,'e-') && modules.utils.startWith(propertyName,'e-')) {
if (modules.utils.startWith(parentPropertyName, 'e-') && modules.utils.startWith(propertyName, 'e-')) {
uf.altValue = {name: propertyName, value: value};
}
// if it's an u-* property element
if (modules.utils.startWith(parentPropertyName,'u-') && propertyName === 'u-url') {
if (modules.utils.startWith(parentPropertyName, 'u-') && propertyName === 'u-url') {
uf.altValue = {name: propertyName, value: value};
}
}
@ -1811,7 +1811,7 @@ var Microformats; // jshint ignore:line
if (geoPair) {
// allow for the use of a ';' as in microformats and also ',' as in Geo URL
geoPair = geoPair.replace(';',',');
geoPair = geoPair.replace(';', ',');
// has sep char
if (geoPair.indexOf(',') > -1 ) {
@ -1857,7 +1857,7 @@ var Microformats; // jshint ignore:line
// look for pattern in parent classes like "p-geo h-geo"
// these are structures built from backwards compat parsing of geo
if (parentClasses.root.length === 1 && parentClasses.properties.length === 1) {
if (parentClasses.root[0].replace('h-','') === this.removePropPrefix(parentClasses.properties[0][0])) {
if (parentClasses.root[0].replace('h-', '') === this.removePropPrefix(parentClasses.properties[0][0])) {
// if microformat has no properties apply the impliedName rule to get value from containing node
// this will get value from html such as <abbr class="geo" title="30.267991;-97.739568">Brighton</abbr>
@ -2003,7 +2003,7 @@ var Microformats; // jshint ignore:line
arr = modules.domUtils.getNodesByAttribute(rootNode, 'data-include');
i = arr.length;
while (i--) {
modules.domUtils.removeChild(rootNode,arr[i]);
modules.domUtils.removeChild(rootNode, arr[i]);
}
};
@ -2986,8 +2986,8 @@ var Microformats; // jshint ignore:line
// do not use a head tag it does not work with IE9
this._html = '<base id="base" href=""></base><a id="link" href=""></a>';
this._nodes = this._domParser.parseFromString( this._html, 'text/html' );
this._baseNode = modules.domUtils.getElementById(this._nodes,'base');
this._linkNode = modules.domUtils.getElementById(this._nodes,'link');
this._baseNode = modules.domUtils.getElementById(this._nodes, 'base');
this._linkNode = modules.domUtils.getElementById(this._nodes, 'link');
},
@ -3160,7 +3160,7 @@ var Microformats; // jshint ignore:line
}
dateString = dateString.toUpperCase().replace(' ','T');
dateString = dateString.toUpperCase().replace(' ', 'T');
// break on 'T' divider or space
if (dateString.indexOf('T') > -1) {
@ -3723,7 +3723,7 @@ var Microformats; // jshint ignore:line
*/
splitTimeAndZone: function ( text ) {
var out = [text],
chars = ['-','+','z','Z'],
chars = ['-', '+', 'z', 'Z'],
i = chars.length;
while (i--) {
@ -4209,7 +4209,7 @@ var Microformats; // jshint ignore:line
'location': {},
'price': {},
'item': {
'uf': ['h-card','a-adr','h-geo']
'uf': ['h-card', 'a-adr', 'h-geo']
},
'summary': {
'map': 'p-name'
@ -4423,38 +4423,38 @@ var Microformats; // jshint ignore:line
modules.rels = {
// xfn
'friend': [ 'yes','external'],
'acquaintance': [ 'yes','external'],
'contact': [ 'yes','external'],
'met': [ 'yes','external'],
'co-worker': [ 'yes','external'],
'colleague': [ 'yes','external'],
'co-resident': [ 'yes','external'],
'neighbor': [ 'yes','external'],
'child': [ 'yes','external'],
'parent': [ 'yes','external'],
'sibling': [ 'yes','external'],
'spouse': [ 'yes','external'],
'kin': [ 'yes','external'],
'muse': [ 'yes','external'],
'crush': [ 'yes','external'],
'date': [ 'yes','external'],
'sweetheart': [ 'yes','external'],
'me': [ 'yes','external'],
'friend': [ 'yes', 'external'],
'acquaintance': [ 'yes', 'external'],
'contact': [ 'yes', 'external'],
'met': [ 'yes', 'external'],
'co-worker': [ 'yes', 'external'],
'colleague': [ 'yes', 'external'],
'co-resident': [ 'yes', 'external'],
'neighbor': [ 'yes', 'external'],
'child': [ 'yes', 'external'],
'parent': [ 'yes', 'external'],
'sibling': [ 'yes', 'external'],
'spouse': [ 'yes', 'external'],
'kin': [ 'yes', 'external'],
'muse': [ 'yes', 'external'],
'crush': [ 'yes', 'external'],
'date': [ 'yes', 'external'],
'sweetheart': [ 'yes', 'external'],
'me': [ 'yes', 'external'],
// other rel=*
'license': [ 'yes','yes'],
'nofollow': [ 'no','external'],
'tag': [ 'no','yes'],
'self': [ 'no','external'],
'bookmark': [ 'no','external'],
'author': [ 'no','external'],
'home': [ 'no','external'],
'directory': [ 'no','external'],
'enclosure': [ 'no','external'],
'pronunciation': [ 'no','external'],
'payment': [ 'no','external'],
'principles': [ 'no','external']
'license': [ 'yes', 'yes'],
'nofollow': [ 'no', 'external'],
'tag': [ 'no', 'yes'],
'self': [ 'no', 'external'],
'bookmark': [ 'no', 'external'],
'author': [ 'no', 'external'],
'home': [ 'no', 'external'],
'directory': [ 'no', 'external'],
'enclosure': [ 'no', 'external'],
'pronunciation': [ 'no', 'external'],
'payment': [ 'no', 'external'],
'principles': [ 'no', 'external']
};

View File

@ -30,15 +30,15 @@ var path = require('path'),
var repo = 'glennjones/microformat-shiv',
tempDir = path.resolve(__dirname,'temp-repo'),
tempDir = path.resolve(__dirname, 'temp-repo'),
deployDirResolved = path.resolve(__dirname, deployDir),
pathList = [
['/modern/microformat-shiv-modern.js','/microformat-shiv.js'],
['/lib','/test/lib'],
['/test/interface-tests','/test/interface-tests'],
['/test/module-tests','/test/module-tests'],
['/test/standards-tests','/test/standards-tests'],
['/test/static','/test/static']
['/modern/microformat-shiv-modern.js', '/microformat-shiv.js'],
['/lib', '/test/lib'],
['/test/interface-tests', '/test/interface-tests'],
['/test/module-tests', '/test/module-tests'],
['/test/standards-tests', '/test/standards-tests'],
['/test/static', '/test/static']
];
@ -131,7 +131,7 @@ function addNewFiles( pathList, deployDirResolved ) {
* @return {String}
*/
function getRepoVersion() {
var pack = fs.readFileSync(path.resolve(tempDir,'package.json'), {encoding: 'utf8'});
var pack = fs.readFileSync(path.resolve(tempDir, 'package.json'), {encoding: 'utf8'});
if (pack) {
pack = JSON.parse(pack)
if (pack && pack.version) {

View File

@ -121,9 +121,7 @@ function NarrateControls(mm, win) {
dropdown.addEventListener("click", this, true);
let rateRange = dropdown.querySelector("#narrate-rate > input");
rateRange.addEventListener("input", this);
rateRange.addEventListener("mousedown", this);
rateRange.addEventListener("mouseup", this);
rateRange.addEventListener("change", this);
// The rate is stored as an integer.
rateRange.value = branch.getIntPref("rate");
@ -140,17 +138,12 @@ function NarrateControls(mm, win) {
NarrateControls.prototype = {
handleEvent: function(evt) {
switch (evt.type) {
case "mousedown":
this._rateMousedown = true;
break;
case "mouseup":
this._rateMousedown = false;
break;
case "input":
this._onRateInput(evt);
break;
case "change":
this._onVoiceChange();
if (evt.target.id == "narrate-rate-input") {
this._onRateInput(evt);
} else {
this._onVoiceChange();
}
break;
case "click":
this._onButtonClick(evt);
@ -190,10 +183,8 @@ NarrateControls.prototype = {
},
_onRateInput: function(evt) {
if (!this._rateMousedown) {
AsyncPrefs.set("narrate.rate", parseInt(evt.target.value, 10));
this.narrator.setRate(this._convertRate(evt.target.value));
}
AsyncPrefs.set("narrate.rate", parseInt(evt.target.value, 10));
this.narrator.setRate(this._convertRate(evt.target.value));
},
_onVoiceChange: function() {

View File

@ -82,7 +82,7 @@ add_task(function* testNarrate() {
promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
prefChanged = NarrateTestUtils.waitForPrefChange("narrate.rate");
$(NarrateTestUtils.RATE).focus();
eventUtils.sendKey("PAGE_UP", content);
eventUtils.sendKey("UP", content);
let newspeechinfo = (yield promiseEvent).detail;
is(newspeechinfo.paragraph, speechinfo.paragraph, "same paragraph");
isnot(newspeechinfo.rate, speechinfo.rate, "rate changed");

View File

@ -26,9 +26,9 @@ var rejectsTreeView = {
}
return rv;
},
isSeparator : function(index) {return false;},
isSeparator : function(index) { return false; },
isSorted: function() { return false; },
isContainer : function(index) {return false;},
isContainer : function(index) { return false; },
cycleHeader : function(column) {},
getRowProperties : function(row) { return ""; },
getColumnProperties : function(column) { return ""; },

View File

@ -159,7 +159,7 @@ ChildManager._get = function(map, key) {
let result = map.get(key);
if (!result) {
result = new ChildManager(map, key);
map.set(key ,result);
map.set(key, result);
}
return result;
};

View File

@ -43,11 +43,11 @@ function burnCPOW() {
let gBurnCPOW = null;
function burnContentCPU() {
setTimeout(() => {try {
setTimeout(() => { try {
gBurnContentCPU()
} catch (ex) {
dump(`test-addon error: ${ex}\n`);
}}, 0);
} }, 0);
}
let gBurnContentCPU = null;

View File

@ -928,7 +928,7 @@ this.PlacesUtils = {
// note: this._uri() will throw if uriString is not a valid URI
if (this._uri(uriString)) {
nodes.push({ uri: uriString,
title: titleString ? titleString : uriString ,
title: titleString ? titleString : uriString,
type: this.TYPE_X_MOZ_URL });
}
}

View File

@ -34,5 +34,5 @@ addPageBook(1, 0, 0, [1]);
// pages that should match; optional function to be run before the test
var gTests = [
["0: Make sure tag matches return the right url as well as '+' remain escaped",
theTag, [0,1]],
theTag, [0, 1]],
];

View File

@ -28,7 +28,7 @@ var gTests = [
["1: Match non-javascript: with almost javascript:",
"javascript", [0]],
["2: Match javascript:",
"javascript:", [0,1]],
"javascript:", [0, 1]],
["3: Match nothing with non-first javascript:",
"5 javascript:", []],
["4: Match javascript: with multi-word search",

View File

@ -23,9 +23,9 @@ var kTitles = [
// Add pages with varying number of tags
addPageBook(0, 0, 0, [0]);
addPageBook(1, 0, 0, [0,1]);
addPageBook(2, 0, 0, [0,2]);
addPageBook(3, 0, 0, [0,1,2]);
addPageBook(1, 0, 0, [0, 1]);
addPageBook(2, 0, 0, [0, 2]);
addPageBook(3, 0, 0, [0, 1, 2]);
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test
@ -39,5 +39,5 @@ var gTests = [
["3: Multiple tags come in commas for page4",
"page4", [3]],
["4: Extra test just to make sure we match the title",
"tag2", [1,3]],
"tag2", [1, 3]],
];

View File

@ -31,23 +31,23 @@ addPageBook(4, 0, 0); // bookmark
addPageBook(5, 0, 0); // bookmark typed
// Set some pages as typed
markTyped([2,3,5], 0);
markTyped([2, 3, 5], 0);
// Remove pages from history to treat them as unvisited
removePages([4,5]);
removePages([4, 5]);
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test
var gTests = [
["0: Match everything",
"foo", [0,1,2,3,4,5]],
"foo", [0, 1, 2, 3, 4, 5]],
["1: Match only typed history",
"foo ^ ~", [2,3]],
"foo ^ ~", [2, 3]],
["2: Drop-down empty search matches only typed history",
"", [2,3]],
"", [2, 3]],
["3: Drop-down empty search matches only bookmarks",
"", [2,3], matchBookmarks],
"", [2, 3], matchBookmarks],
["4: Drop-down empty search matches only typed",
"", [2,3], matchTyped],
"", [2, 3], matchTyped],
];
function matchBookmarks() {

View File

@ -45,13 +45,13 @@ var kTitles = [
// Add the keyword bookmark
addPageBook(0, 0, 1, [], keyKey);
// Add in the "fake pages" for keyword searches
gPages[1] = [1,2];
gPages[2] = [2,2];
gPages[3] = [3,2];
gPages[4] = [4,2];
gPages[1] = [1, 2];
gPages[2] = [2, 2];
gPages[3] = [3, 2];
gPages[4] = [4, 2];
// Add a page into history
addPageBook(5, 2);
gPages[6] = [6,2];
gPages[6] = [6, 2];
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test

View File

@ -36,7 +36,7 @@ var gTests = [
// Tests after this one will match against word boundaries and anywhere
["4: Sanity check that matching anywhere finds more",
"a", [0,1],
"a", [0, 1],
() => setBehavior(1)],
];

View File

@ -37,9 +37,9 @@ var gTests = [
["0: Match 2 terms all in url",
"c d", [0]],
["1: Match 1 term in url and 1 term in title",
"b e", [0,1]],
"b e", [0, 1]],
["2: Match 3 terms all in title; display bookmark title if matched",
"b a z", [1,3]],
"b a z", [1, 3]],
["3: Match 2 terms in url and 1 in title; make sure bookmark title is used for search",
"k f t", [2]],
["4: Match 3 terms in url and 1 in title",

View File

@ -50,9 +50,9 @@ addPageBook(11, 1, 1, [1]); // title and url
// Remove pages from history to treat them as unvisited, so pages that do have
// visits are 0,1,2,3,5,10
removePages([4,6,7,8,9,11]);
removePages([4, 6, 7, 8, 9, 11]);
// Set some pages as typed
markTyped([0,10], 0);
markTyped([0, 10], 0);
markTyped([3], 1);
// Provide for each test: description; search terms; array of gPages indices of
@ -60,85 +60,85 @@ markTyped([3], 1);
var gTests = [
// Test restricting searches
["0: History restrict",
"^", [0,1,2,3,5,10]],
"^", [0, 1, 2, 3, 5, 10]],
["1: Star restrict",
"*", [4,5,6,7,8,9,10,11]],
"*", [4, 5, 6, 7, 8, 9, 10, 11]],
["2: Tag restrict",
"+", [8,9,10,11]],
"+", [8, 9, 10, 11]],
// Test specials as any word position
["3: Special as first word",
"^ foo bar", [1,2,3,5,10]],
"^ foo bar", [1, 2, 3, 5, 10]],
["4: Special as middle word",
"foo ^ bar", [1,2,3,5,10]],
"foo ^ bar", [1, 2, 3, 5, 10]],
["5: Special as last word",
"foo bar ^", [1,2,3,5,10]],
"foo bar ^", [1, 2, 3, 5, 10]],
// Test restricting and matching searches with a term
["6.1: foo ^ -> history",
"foo ^", [1,2,3,5,10]],
"foo ^", [1, 2, 3, 5, 10]],
["6.2: foo | -> history (change pref)",
"foo |", [1,2,3,5,10], () => changeRestrict("history", "|")],
"foo |", [1, 2, 3, 5, 10], () => changeRestrict("history", "|")],
["7.1: foo * -> is star",
"foo *", [5,6,7,8,9,10,11], () => resetRestrict("history")],
"foo *", [5, 6, 7, 8, 9, 10, 11], () => resetRestrict("history")],
["7.2: foo | -> is star (change pref)",
"foo |", [5,6,7,8,9,10,11], () => changeRestrict("bookmark", "|")],
"foo |", [5, 6, 7, 8, 9, 10, 11], () => changeRestrict("bookmark", "|")],
["8.1: foo # -> in title",
"foo #", [1,3,5,7,8,9,10,11], () => resetRestrict("bookmark")],
"foo #", [1, 3, 5, 7, 8, 9, 10, 11], () => resetRestrict("bookmark")],
["8.2: foo | -> in title (change pref)",
"foo |", [1,3,5,7,8,9,10,11], () => changeRestrict("title", "|")],
"foo |", [1, 3, 5, 7, 8, 9, 10, 11], () => changeRestrict("title", "|")],
["9.1: foo @ -> in url",
"foo @", [2,3,6,7,10,11], () => resetRestrict("title")],
"foo @", [2, 3, 6, 7, 10, 11], () => resetRestrict("title")],
["9.2: foo | -> in url (change pref)",
"foo |", [2,3,6,7,10,11], () => changeRestrict("url", "|")],
"foo |", [2, 3, 6, 7, 10, 11], () => changeRestrict("url", "|")],
["10: foo + -> is tag",
"foo +", [8,9,10,11], () => resetRestrict("url")],
"foo +", [8, 9, 10, 11], () => resetRestrict("url")],
["10.2: foo | -> is tag (change pref)",
"foo |", [8,9,10,11], () => changeRestrict("tag", "|")],
"foo |", [8, 9, 10, 11], () => changeRestrict("tag", "|")],
["10.3: foo ~ -> is typed",
"foo ~", [3,10], () => resetRestrict("tag")],
"foo ~", [3, 10], () => resetRestrict("tag")],
["10.4: foo | -> is typed (change pref)",
"foo |", [3,10], () => changeRestrict("typed", "|")],
"foo |", [3, 10], () => changeRestrict("typed", "|")],
// Test various pairs of special searches
["11: foo ^ * -> history, is star",
"foo ^ *", [5,10], () => resetRestrict("typed")],
"foo ^ *", [5, 10], () => resetRestrict("typed")],
["12: foo ^ # -> history, in title",
"foo ^ #", [1,3,5,10]],
"foo ^ #", [1, 3, 5, 10]],
["13: foo ^ @ -> history, in url",
"foo ^ @", [2,3,10]],
"foo ^ @", [2, 3, 10]],
["14: foo ^ + -> history, is tag",
"foo ^ +", [10]],
["14.1: foo ^ ~ -> history, is typed",
"foo ^ ~", [3,10]],
"foo ^ ~", [3, 10]],
["15: foo * # -> is star, in title",
"foo * #", [5,7,8,9,10,11]],
"foo * #", [5, 7, 8, 9, 10, 11]],
["16: foo * @ -> is star, in url",
"foo * @", [6,7,10,11]],
"foo * @", [6, 7, 10, 11]],
["17: foo * + -> same as +",
"foo * +", [8,9,10,11]],
"foo * +", [8, 9, 10, 11]],
["17.1: foo * ~ -> is star, is typed",
"foo * ~", [10]],
["18: foo # @ -> in title, in url",
"foo # @", [3,7,10,11]],
"foo # @", [3, 7, 10, 11]],
["19: foo # + -> in title, is tag",
"foo # +", [8,9,10,11]],
"foo # +", [8, 9, 10, 11]],
["19.1: foo # ~ -> in title, is typed",
"foo # ~", [3,10]],
"foo # ~", [3, 10]],
["20: foo @ + -> in url, is tag",
"foo @ +", [10,11]],
"foo @ +", [10, 11]],
["20.1: foo @ ~ -> in url, is typed",
"foo @ ~", [3,10]],
"foo @ ~", [3, 10]],
["20.2: foo + ~ -> is tag, is typed",
"foo + ~", [10]],
// Test default usage by setting certain bits of default.behavior to 1
["21: foo -> default history",
"foo", [1,2,3,5,10], function () { setPref({ history: true }); }],
"foo", [1, 2, 3, 5, 10], function () { setPref({ history: true }); }],
["22: foo -> default history or is star",
"foo", [1,2,3,5,6,7,8,9,10,11], () => setPref({ history: true, bookmark: true })],
"foo", [1, 2, 3, 5, 6, 7, 8, 9, 10, 11], () => setPref({ history: true, bookmark: true })],
["22.1: foo -> default history or is star, is typed",
"foo", [3,10], () => setPref({ history: true, bookmark: true, "history.onlyTyped": true })],
"foo", [3, 10], () => setPref({ history: true, bookmark: true, "history.onlyTyped": true })],
];

View File

@ -36,7 +36,7 @@ addPageBook(5, 0);
addPageBook(6, 0);
addPageBook(7, 0);
var allSite = [0,1,2,3,4,5];
var allSite = [0, 1, 2, 3, 4, 5];
// Provide for each test: description; search terms; array of gPages indices of
// pages that should match; optional function to be run before the test
@ -49,9 +49,9 @@ var gTests = [
["5: https://site matches all site", "https://site", allSite],
["6: www.site matches all site", "www.site", allSite],
["7: w matches none of www.", "w", [6,7]],
["8: http://w matches none of www.", "w", [6,7]],
["9: http://www.w matches none of www.", "w", [6,7]],
["7: w matches none of www.", "w", [6, 7]],
["8: http://w matches none of www.", "w", [6, 7]],
["9: http://www.w matches none of www.", "w", [6, 7]],
["10: ww matches none of www.", "ww", [7]],
["11: http://ww matches none of www.", "http://ww", [7]],

View File

@ -47,19 +47,19 @@ var gTests = [
["0: single result, that is also a tab match",
"abc.com", [1]],
["1: two results, one tab match",
"abc", [1,2]],
"abc", [1, 2]],
["2: two results, both tab matches",
"abc", [1,3],
"abc", [1, 3],
function() {
addOpenPages(2, 1);
}],
["3: two results, both tab matches, one has multiple tabs",
"abc", [1,3],
"abc", [1, 3],
function() {
addOpenPages(2, 5);
}],
["4: two results, no tab matches",
"abc", [0,2],
"abc", [0, 2],
function() {
removeOpenPages(0, 1);
removeOpenPages(2, 6);

View File

@ -62,18 +62,18 @@ addPageBook(9, 0);
var gTests = [
// Tests after this one will match only on word boundaries
["0: Match 'match' at the beginning or after / or on a CamelCase",
"match", [0,2,4,9],
"match", [0, 2, 4, 9],
() => setBehavior(2)],
["1: Match 'dont' at the beginning or after /",
"dont", [1,3,5]],
"dont", [1, 3, 5]],
["2: Match '2' after the slash and after a word (in tags too)",
"2", [2,3,4,5]],
"2", [2, 3, 4, 5]],
["3: Match 't' at the beginning or after /",
"t", [0,1,2,3,4,5,9]],
"t", [0, 1, 2, 3, 4, 5, 9]],
["4: Match 'word' after many consecutive word boundaries",
"word", [6]],
["5: Match a word boundary '/' for everything",
"/", [0,1,2,3,4,5,6,7,8,9]],
"/", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]],
["6: Match word boundaries '()_+' that are among word boundaries",
"()_+", [6]],
@ -96,7 +96,7 @@ var gTests = [
// Tests after this one will match against word boundaries and anywhere
["14: Match on word boundaries as well as anywhere (bug 429531)",
"tch", [0,1,2,3,4,5,9],
"tch", [0, 1, 2, 3, 4, 5, 9],
() => setBehavior(1)],
];

View File

@ -30,7 +30,7 @@ add_task(function* invalid_input_throws() {
/Invalid GUID found in the sorted children array/);
Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ {} ]),
/Invalid GUID found in the sorted children array/);
Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ "012345678901" , null ]),
Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ "012345678901", null ]),
/Invalid GUID found in the sorted children array/);
});

View File

@ -115,7 +115,7 @@ add_task(function* test_history_insert() {
let pageInfo = {
title,
visits: [
{transition: transition, referrer: referrer, date: date,}
{transition: transition, referrer: referrer, date: date, }
]
};
@ -184,7 +184,7 @@ add_task(function* test_insert_multiple_error_cases() {
add_task(function* test_history_insertMany() {
const BAD_URLS = ["about:config", "chrome://browser/content/browser.xul"];
const GOOD_URLS = [1, 2, 3].map(x => {return `http://mozilla.com/${x}`;});
const GOOD_URLS = [1, 2, 3].map(x => { return `http://mozilla.com/${x}`; });
let makePageInfos = Task.async(function*(urls, filter = x => x) {
let pageInfos = [];

View File

@ -103,6 +103,6 @@ add_task(function test_execute()
let accesstime = Date(resultNode.time / 1000);
dump("----> result: " + resultNode.uri + " Date: " + accesstime.toLocaleString() + "\n");
}
do_check_eq(cc,0);
do_check_eq(cc, 0);
root.containerOpen = false;
});

View File

@ -140,12 +140,12 @@ add_task(function* test_abstime_annotation_uri()
// live update.
do_print("change title");
var change1 = [{isDetails: true, uri:"http://foo.com/",
title: "mo"},];
title: "mo"}, ];
yield task_populateDB(change1);
do_check_false(isInResult({uri: "http://foo.com/"}, root));
var change2 = [{isDetails: true, uri:"http://foo.com/",
title: "moz", lastvisit: endTime},];
title: "moz", lastvisit: endTime}, ];
yield task_populateDB(change2);
dump_table("moz_places");
do_check_false(isInResult({uri: "http://foo.com/"}, root));

View File

@ -37,7 +37,7 @@ add_task(function* test_queryMultipleFolders() {
return "folder=" + id;
}).join('&') + "&sort=5&maxResults=" + maxResults;
PlacesUtils.history.queryStringToQueries(queryString, query, {}, options);
let rootNode = PlacesUtils.history.executeQuery(query.value[0],options.value).root;
let rootNode = PlacesUtils.history.executeQuery(query.value[0], options.value).root;
rootNode.containerOpen = true;
let resultLength = rootNode.childCount;
Assert.equal(resultLength, maxResults);

View File

@ -19,7 +19,7 @@ var testData = [
uri: "http://foo.com/changeme1.html",
isBookmark: true,
isTag: true,
tagArray: ["moz","bugzilla"] },
tagArray: ["moz", "bugzilla"] },
{ isInQuery: false,
isDetails: true,

View File

@ -74,12 +74,12 @@ add_task(function* test_searchterms_uri()
// live update.
do_print("change title");
var change1 = [{isDetails: true, uri:"http://foo.com/",
title: "mo"},];
title: "mo"}, ];
yield task_populateDB(change1);
do_check_false(isInResult({uri: "http://foo.com/"}, root));
var change2 = [{isDetails: true, uri:"http://foo.com/",
title: "moz"},];
title: "moz"}, ];
yield task_populateDB(change2);
do_check_true(isInResult({uri: "http://foo.com/"}, root));

View File

@ -68,10 +68,10 @@ var testData = [
var domainsInRange = [2, 3];
var leveledTestData = [// Today
[[0], // Today, local files
[1,2]], // Today, example.com
[1, 2]], // Today, example.com
// Older than six months
[[3], // Older than six months, local files
[4,5], // Older than six months, example.com
[4, 5], // Older than six months, example.com
[6] // Older than six months, example.net
]];
@ -84,7 +84,7 @@ var testDataAddedLater = [
lastVisit: olderthansixmonths,
title: "test visit",
isInQuery: true,
levels: [1,1]
levels: [1, 1]
},
{
isVisit: true,
@ -92,7 +92,7 @@ var testDataAddedLater = [
lastVisit: olderthansixmonths,
title: "test visit",
isInQuery: true,
levels: [1,1]
levels: [1, 1]
},
{
isVisit: true,
@ -100,7 +100,7 @@ var testDataAddedLater = [
lastVisit: today,
title: "test visit",
isInQuery: true,
levels: [0,1]
levels: [0, 1]
},
{
isVisit: true,
@ -108,7 +108,7 @@ var testDataAddedLater = [
lastVisit: today,
title: "test visit",
isInQuery: true,
levels: [0,0]
levels: [0, 0]
}
];

View File

@ -108,7 +108,7 @@ add_task(function* test_transitions()
//dump_table("moz_places");
//dump_table("moz_historyvisits");
var numSortFunc = function (a,b) { return (a - b); };
var numSortFunc = function (a, b) { return (a - b); };
var arrs = testDataTyped.concat(testDataDownload).concat(testDataBookmark)
.sort(numSortFunc);

View File

@ -12,7 +12,7 @@ add_task(function* test_searchEngine_autoFill() {
let uri = NetUtil.newURI("http://www.example.com/my/");
let visits = [];
for (let i = 0; i < 100; ++i) {
visits.push({ uri , title: "Terms - SearchEngine Search" });
visits.push({ uri, title: "Terms - SearchEngine Search" });
}
yield PlacesTestUtils.addVisits(visits);
yield addBookmark({ uri: uri, title: "Example bookmark" });

View File

@ -209,7 +209,7 @@ add_task(function* test_frecency()
}
// sort results by frecency
results.sort((a,b) => b[1] - a[1]);
results.sort((a, b) => b[1] - a[1]);
// Make sure there's enough results returned
prefs.setIntPref("browser.urlbar.maxRichResults", results.length);

View File

@ -100,7 +100,7 @@ function check_bookmarks(aFolderId) {
var bookmarks = bmSvc.getBookmarkIdsForURI(bookmarkedURI);
for (var i = 0; i < bookmarks.length; i++) {
do_check_eq(bmSvc.getItemTitle(bookmarks[i]), validItemName);
do_check_true(annoSvc.itemHasAnnotation(bookmarks[i],validAnnoName));
do_check_true(annoSvc.itemHasAnnotation(bookmarks[i], validAnnoName));
}
// check that folder exists and has still its annotation

View File

@ -34,8 +34,8 @@ function runQuery(aResultType) {
for (let i = 0; i < cc; i++) {
let node = root.getChild(i);
// Check that all transition types but EMBED and FRAMED appear in results
do_check_neq(node.uri.substr(6,1), TRANSITION_EMBED);
do_check_neq(node.uri.substr(6,1), TRANSITION_FRAMED_LINK);
do_check_neq(node.uri.substr(6, 1), TRANSITION_EMBED);
do_check_neq(node.uri.substr(6, 1), TRANSITION_FRAMED_LINK);
}
root.containerOpen = false;
}

View File

@ -1298,9 +1298,9 @@ add_task(function* test_sort_folder_by_name() {
let folder_info = createTestFolderInfo();
let url = NetUtil.newURI("http://sort.by.name/");
let preSep = ["3","2","1"].map(i => ({ title: i, url }));
let preSep = ["3", "2", "1"].map(i => ({ title: i, url }));
let sep = {};
let postSep = ["c","b","a"].map(l => ({ title: l, url }));
let postSep = ["c", "b", "a"].map(l => ({ title: l, url }));
let originalOrder = [...preSep, sep, ...postSep];
let sortedOrder = [...preSep.slice(0).reverse(),
sep,

View File

@ -60,6 +60,7 @@ function days_for_x_months_ago(aNowObj, aMonths) {
var nowObj = new Date();
// This test relies on en-US locale
// Offset is number of days
/* eslint-disable comma-spacing */
var containers = [
{ label: "Today" , offset: 0 , visible: true },
{ label: "Yesterday" , offset: -1 , visible: true },
@ -72,9 +73,10 @@ var containers = [
{ label: "" , offset: -days_for_x_months_ago(nowObj, 4) , visible: true },
{ label: "Older than 6 months" , offset: -days_for_x_months_ago(nowObj, 5) , visible: true },
];
/* eslint-enable comma-spacing */
var visibleContainers = containers.filter(
function(aContainer) {return aContainer.visible});
function(aContainer) { return aContainer.visible });
/**
* Asynchronous task that fills history and checks containers' labels.

Some files were not shown because too many files have changed in this diff Show More