-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,64 @@ | ||
(function () { | ||
var HistoryPanel = function (namespace) { | ||
let historyPanelInstance = null; | ||
|
||
var HistoryPanel = function (namespace) { | ||
var self = this; | ||
|
||
self.namespace = namespace; | ||
|
||
self.bootstrapTab = function (tabId, changeInfo, tab){ | ||
if (tabId == self.window.tabs[0].id){ | ||
var request = { | ||
config: { | ||
namespace: self.namespace | ||
} | ||
}; | ||
if (changeInfo.status == 'complete'){ | ||
chrome.tabs.sendMessage(tabId, request); | ||
self.bootstrapTab = function (tabId, changeInfo, tab) { | ||
if (tabId == self.window.tabs[0].id) { | ||
var request = { | ||
config: { | ||
namespace: self.namespace, | ||
}, | ||
}; | ||
if (changeInfo.status == 'complete') { | ||
chrome.tabs.sendMessage(tabId, request); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
self.focus = function () { | ||
chrome.windows.update(self.window.id, { "focused": true }); | ||
chrome.windows.update(self.window.id, { focused: true }); | ||
}; | ||
|
||
self.openPanel = function () { | ||
var windowOptions = { | ||
'width': 900, | ||
'height': 600, | ||
'type': 'panel', | ||
'url': 'historyPanel.html' | ||
width: 900, | ||
height: 600, | ||
type: 'panel', | ||
url: 'historyPanel.html', | ||
}; | ||
chrome.windows.create(windowOptions, function (window) { | ||
self.window = window; | ||
chrome.tabs.onUpdated.addListener(self.bootstrapTab); | ||
}) | ||
self.window = window; | ||
chrome.tabs.onUpdated.addListener(self.bootstrapTab); | ||
}); | ||
}; | ||
|
||
self.openPanel(); | ||
}; | ||
|
||
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { | ||
chrome.runtime.onMessage.addListener(function ( | ||
request, | ||
sender, | ||
sendResponse | ||
) { | ||
if (request && request.action === 'openHistoryPanel') { | ||
if (!!window.historyPanel) { | ||
window.historyPanel.focus() | ||
if (!!historyPanelInstance) { | ||
historyPanelInstance.focus(); | ||
} else { | ||
window.historyPanel = new HistoryPanel(request.namespace); | ||
historyPanelInstance = new HistoryPanel(request.namespace); | ||
} | ||
} | ||
}); | ||
|
||
chrome.windows.onRemoved.addListener(function (windowID) { | ||
if (windowID === window.historyPanel.window.id) { | ||
window.historyPanel = null; | ||
if ( | ||
historyPanelInstance && | ||
windowID === historyPanelInstance.window.id | ||
) { | ||
historyPanelInstance = null; | ||
} | ||
}); | ||
|
||
}()); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jQuery('#console-form').off('submit'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,66 @@ | ||
$main-container-background-color: #ffffff; | ||
|
||
.main-container{ | ||
.main-container { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: $main-container-background-color; | ||
height: 100%; | ||
.header{ | ||
|
||
.header { | ||
flex: 0 1; | ||
} | ||
|
||
.panel-container{ | ||
|
||
.panel-container { | ||
height: calc(100% - 22px); | ||
display: flex; | ||
flex-direction: row; | ||
flex: 1 0; | ||
} | ||
.panel{ | ||
|
||
.panel { | ||
display: flex; | ||
flex-direction: column; | ||
flex: 1 0; | ||
height: 100%; | ||
overflow: hidden; | ||
overflow: hidden; | ||
} | ||
.footer{ | ||
|
||
.footer { | ||
background-color: #eee; | ||
border-top: 1px solid #ccc; | ||
flex: 0 1; | ||
line-height: 18px; | ||
padding:0 5px; | ||
padding: 0 5px; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
|
||
.footer-content{ | ||
.footer-content { | ||
display: flex; | ||
justify-content: space-between; | ||
|
||
} | ||
|
||
|
||
} | ||
.search-bar{ | ||
|
||
.search-bar { | ||
display: flex; | ||
width: 100%; | ||
} | ||
|
||
.search-bar{ | ||
.search-bar { | ||
width: 100%; | ||
padding: 5px; | ||
display: flex; | ||
background-color: #eee; | ||
border-top: 1px solid #ddd; | ||
z-index: 999; | ||
z-index: 999; | ||
|
||
input { | ||
flex: 1 1 auto; | ||
border: 1px solid #ccc; | ||
|
||
&:focus{ | ||
&:focus { | ||
outline: none; | ||
border: 1px solid #68d; | ||
} | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters