1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

added support for sidebar

This commit is contained in:
Kyle Spearrin
2017-09-28 10:39:31 -04:00
parent 915546aa0f
commit 6fa5582883
10 changed files with 72 additions and 16 deletions

View File

@@ -228,6 +228,21 @@ function initUtilsService() {
}
};
UtilsService.prototype.inSidebar = function (theWindow) {
return theWindow.location.search && theWindow.location.search.indexOf('sidebar=true') > -1;
};
UtilsService.prototype.sidebarViewName = function () {
if (this.isFirefox()) {
return 'sidebar';
}
else if (this.isOpera()) {
return 'sidebar_panel';
}
return null;
};
function validIpAddress(ipString) {
var ipRegex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
return ipRegex.test(ipString);