From 01560fe7b416965e1245a2c5e5a89d138d3789e5 Mon Sep 17 00:00:00 2001 From: Frost Date: Tue, 8 Apr 2014 04:19:05 -0600 Subject: [PATCH 1/3] Update the Gruntfile to build the files from their new locations. Brian moved them and the Gruntfile was pointing to their old location. --- Gruntfile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 73900d5..fcc813b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,11 +38,11 @@ module.exports = function(grunt) { zip: { release: { src: [ - 'css/*.css', - 'img/**', - 'js/**', - 'panes/*.html', - 'panel.html', + 'devtools-panel/css/*.css', + 'devtools-panel/img/**', + 'devtools-panel/js/**', + 'devtools-panel/panes/*.html', + 'devtools-panel/panel.html', 'LICENSE', 'manifest.json', 'background.html', From da9dc6d740c885c1103b2eeaae6277a2da2c4244 Mon Sep 17 00:00:00 2001 From: Frost Date: Tue, 8 Apr 2014 04:21:01 -0600 Subject: [PATCH 2/3] ignore the bloody node_modules and the webstorm .idea files. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fd2a642..f6090c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ batarang-release-*.zip *.build.js +.idea +node_modules \ No newline at end of file From 5089764c36b06ba7f6275f44a61a078390304419 Mon Sep 17 00:00:00 2001 From: Frost Date: Tue, 8 Apr 2014 04:21:54 -0600 Subject: [PATCH 3/3] Add some comments to explain better what is going on here. --- devtoolsBackground.js | 13 +++++++++++-- scripts/inline.js | 9 +++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/devtoolsBackground.js b/devtoolsBackground.js index 89f7b71..09ae536 100644 --- a/devtoolsBackground.js +++ b/devtoolsBackground.js @@ -1,7 +1,15 @@ +/** + * This code loads the UI for the DevTools. + * + * HOW DOES THIS CODE GET LOADED INTO THE EXTENSION? + * In the 'manifest.json', the 'devtools_page' options + * loads 'devtoolsBackground.html' which links this file. + * + */ + var panels = chrome.devtools.panels; // The function below is executed in the context of the inspected page. - var getPanelContents = function () { if (window.angular && $0) { //TODO: can we move this scope export into updateElementProperties @@ -29,6 +37,7 @@ var getPanelContents = function () { } }; +// This adds the AngularJS Propeties piece to the Elements tab in devtools. panels.elements.createSidebarPane( "AngularJS Properties", function (sidebar) { @@ -37,7 +46,7 @@ panels.elements.createSidebarPane( }); }); -// Angular panel +// This adds the tab that appears at the top of your devtools, just after the console. var angularPanel = panels.create( "AngularJS", "devtools-panel/img/angular.png", diff --git a/scripts/inline.js b/scripts/inline.js index b37c4b8..28ae1cf 100644 --- a/scripts/inline.js +++ b/scripts/inline.js @@ -1,5 +1,10 @@ -// Similar to browserify, but inlines the scripts instead. -// This is a really dumb naive approach that only supports `module.exports =` +/** + * This file takes all of the files in 'content-scripts/' and concats + * then into one file. This so that only one file will need to be + * injected into the content of a page. + * + * You will need to run 'grunt inline' to build the new 'inject.build.js' + */ var fs = require('fs'); var r = new RegExp("( *)(.*?)require\\('(.+?)'\\)", 'g');