Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from arthurakay/master
Refactors and bug fixes
- Loading branch information
Showing
11 changed files
with
133 additions
and
63 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,9 +1,2 @@ | ||
|
||
|
||
/* | ||
* This file is generated by Sencha Cmd and should NOT be edited. It redirects | ||
* to the most recently built CSS file for the application to allow index.html | ||
* in the development directory to load properly (i.e., "dev mode"). | ||
*/ | ||
@import 'build/production/AI/resources/AI-all.css'; | ||
|
||
/* generated file */ | ||
@import 'theme/ext-theme-neptune-1b164612-6ea5-4722-8816-f85b69edae67.css' |
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,8 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
<head> | ||
<script type="text/javascript" src="background.js"></script> | ||
<!--<script type="text/javascript" src="right-click.js"></script>--> | ||
</head> | ||
<body> | ||
<script src="background.js"></script> | ||
|
||
</body> | ||
</html> |
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,22 +1,72 @@ | ||
'use strict'; | ||
|
||
/** | ||
* TABS[123] = { | ||
* url : 'http://cdn.sencha.com/ext/priv/ext-5.0.0.470/build/examples/kitchensink/#locking-grid', | ||
* hash : 'locking-grid' | ||
* } | ||
*/ | ||
var TABS = {}; | ||
|
||
// monitor page refresh | ||
chrome.extension.onConnect.addListener(function (port) { | ||
|
||
//when devtools-page connects (when App Inspector is actually opened) | ||
if (port.name === 'AppInspector') { | ||
|
||
//add event listener for tab refresh | ||
//NOTE: this fires across ALL tabs! | ||
//enable the right-click menu | ||
// chrome.contextMenus.update(CONTEXT_MENU, { | ||
// enabled : true | ||
// }); | ||
|
||
/** | ||
* add event listener for tab refresh | ||
* NOTE: this fires across ALL tabs! | ||
*/ | ||
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) { | ||
|
||
//changeInfo has multiple statuses... only fire on complete | ||
if (changeInfo.status === 'complete') { | ||
port.postMessage({ | ||
tabId : tabId, | ||
message : 'refreshed!' | ||
}); | ||
//changeInfo has multiple statuses... only fire on complete | ||
if (changeInfo.status === 'complete') { | ||
var oldUrl = TABS[tabId], | ||
hashLocation; | ||
|
||
//cache the URL so we can compare it later | ||
if (!oldUrl || tab.url !== oldUrl.url) { | ||
var newTab = { | ||
url : tab.url, | ||
hash : '' | ||
}; | ||
|
||
hashLocation = tab.url.indexOf('#'); | ||
|
||
if (hashLocation) { | ||
newTab.hash = tab.url.substr(hashLocation + 1); | ||
} | ||
|
||
TABS[tabId] = newTab; | ||
} | ||
|
||
if (oldUrl) { | ||
hashLocation = tab.url.indexOf('#'); | ||
|
||
var hash = (hashLocation) ? tab.url.substr(hashLocation + 1) : ''; | ||
|
||
//don't refresh the page if only the hash changes | ||
if (hash && oldUrl.hash !== hash) { | ||
TABS[tabId].hash = hash; | ||
} | ||
//if the hash has not changed, assume the user has manually refreshed the browser | ||
else { | ||
port.postMessage({ | ||
tabId : tabId, | ||
message : 'refreshed!' | ||
}); | ||
} | ||
} | ||
|
||
} | ||
} | ||
}); | ||
); | ||
|
||
} | ||
}); |
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,12 @@ | ||
'use strict'; | ||
|
||
// right-click context menu | ||
var CONTEXT_MENU = chrome.contextMenus.create({ | ||
'title' : 'App Inspector for Sencha', | ||
'contexts' : ['all'], | ||
'enabled' : false, | ||
|
||
'onclick' : function (info, tab) { | ||
//TODO: get access to inspectedWindow | ||
} | ||
}); |
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 was deleted.
Oops, something went wrong.
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