Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f34b03a
Temporary Reversion of contributions by @alexbt
arjun-menon Oct 14, 2017
f87bda3
Refactor tracker.js slightly for improved code quality
arjun-menon Jun 15, 2017
1dc7d53
Add firebase-[app,database] JS files
arjun-menon Jun 15, 2017
4dbdbda
Add firebase-[app,database] JS deps in manifest.json
arjun-menon Jun 15, 2017
1eb77bd
Initialize firebase & firebase.database
arjun-menon Jun 15, 2017
d03938e
Organize core/lib/etc files better
arjun-menon Jun 15, 2017
c2e1aed
Merge LICENSE into README.md
arjun-menon Jun 15, 2017
98638bf
Get rid of unused chrome.storage
arjun-menon Jun 15, 2017
ff81c86
Set pollInterval, and remove `Settings` retrieval
arjun-menon Jun 15, 2017
5af97d7
Migrate basic value read and set to Firebase
arjun-menon Jun 15, 2017
990c29d
Use Promise.all for read, uncomment some functionality, delete unused…
arjun-menon Jun 15, 2017
1f25ce3
Listen for real-time updates to status with Firebase
arjun-menon Jun 15, 2017
a20cad5
Remove lib/parse*.js, options.html, options.js
arjun-menon Jun 15, 2017
711c23d
Refactor and add firebase-helper.js
arjun-menon Jun 15, 2017
4c13df7
Refactor updateMergeButton
arjun-menon Jun 15, 2017
b882d3a
Refactor updateThread
arjun-menon Jun 15, 2017
358721f
Refactor; move stuff to core/init.js
arjun-menon Jun 15, 2017
7c0dbc4
Eliminate global allThreads, simplify page update check code
arjun-menon Jun 16, 2017
59dee84
Create/add a nice icon for this extension
arjun-menon Jun 16, 2017
53f5440
Refactor, merge in init.js, eliminate global canBeMerged
arjun-menon Jun 16, 2017
3da6832
Inline the function areAllResolved
arjun-menon Jun 16, 2017
acb96ed
Refactor & fix branch merge waring insertion code
arjun-menon Jun 16, 2017
c49b313
Extirpate branch merge message alternation
arjun-menon Jun 16, 2017
7cf9200
Use Web APIs instead of jQuery in findAllThreads()
arjun-menon Jun 20, 2017
7665c39
Add .gitignore
arjun-menon Jun 20, 2017
e87430b
Add RxJS, listen to DOM changes with MutationObserver, refactor, etc.
arjun-menon Jun 20, 2017
f6a54ff
Add .eslintrc.json, delete .jscsrc
arjun-menon Jun 20, 2017
8eae9f8
Fix ESLint problems
arjun-menon Jun 20, 2017
bd777be
Change how we check for unresolved comments
arjun-menon Jun 20, 2017
67ca317
Refactor setListeners
arjun-menon Jun 20, 2017
1a7c8a4
Refactor expandUnresolvedThread (minor)
arjun-menon Jun 20, 2017
0e6ff4d
Inline updateInfo
arjun-menon Jun 20, 2017
809a36e
Refactor makeButton and updateThread
arjun-menon Jun 20, 2017
1741e1b
Refactor hookComment
arjun-menon Jun 20, 2017
a5b2a1e
Fix duplicate listeners, fix DOM mutations observation, remove lastCo…
arjun-menon Jun 23, 2017
45cd99d
Use webpack, delete dependency JS files, reorganize.
arjun-menon Jun 30, 2017
0bc7d62
Use css-loader
arjun-menon Jun 30, 2017
daa459e
Fix missing merge button error
arjun-menon Jun 30, 2017
d6009e8
Reorganize; move content code to src/content
arjun-menon Jun 30, 2017
bb5d290
Create stub background script
arjun-menon Jun 30, 2017
1518d53
Clean up src/content/package.json
arjun-menon Jun 30, 2017
b9eaa65
Update build.sh
arjun-menon Jun 30, 2017
d2e22e1
Move resources to src/ as well
arjun-menon Jul 18, 2017
b732484
Move Firebase to background script
arjun-menon Aug 8, 2017
989dad5
Add quicker build-update.sh
arjun-menon Aug 8, 2017
b8d9971
Follow Standard JS ESLint rules in all .js project files
arjun-menon Aug 8, 2017
ca94494
Retrieve previous comment statuses from Parse
arjun-menon Oct 12, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "standard",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true,
"amd": true,
"node": false
},

"globals": {
"module": true,
"browser": true,
"chrome": true
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
.idea
.DS_Store
node_modules
75 changes: 0 additions & 75 deletions .jscsrc

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
CommentTracker
==============

Repo for https://chrome.google.com/webstore/detail/github-comment-tracker/dkjmlcpmijiiejngafklkleghnaiabpa
Feel free to fork and create pull requests.

Feel free to fork and create pull requests
LICENSE
-------
The MIT License (MIT)

Copyright (c) 2014 Benjamin Bernard
Copyright (c) 2017 Arjun Menon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
21 changes: 21 additions & 0 deletions build-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/content/ghct-content.js
./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/background/ghct-background.js

./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/content/webpack.config.js
./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/background/webpack.config.js

mkdir -p dist

cd src

cd content
yarn build

cd ..

cd background
yarn build


31 changes: 31 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

yarn install

./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/content/ghct-content.js
./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/background/ghct-background.js

./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/content/webpack.config.js
./node_modules/eslint/bin/eslint.js --config .eslintrc.json --fix src/background/webpack.config.js

mkdir -p dist

cd src

cd content
yarn install
yarn build

cd ..

cd background
yarn install
yarn build

cd ..

cd ..

cp src/ghct-icon.png dist/
cp src/manifest.json dist/

4 changes: 0 additions & 4 deletions jquery-2.1.0.min.js

This file was deleted.

24 changes: 0 additions & 24 deletions manifest.json

This file was deleted.

12 changes: 0 additions & 12 deletions options.html

This file was deleted.

26 changes: 0 additions & 26 deletions options.js

This file was deleted.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"devDependencies": {
"eslint": "^4.8.0",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1"
}
}
16 changes: 0 additions & 16 deletions parse-1.6.14.min.js

This file was deleted.

51 changes: 51 additions & 0 deletions src/background/ghct-background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import * as firebase from 'firebase/app'
import 'firebase/database'
import * as Parse from 'parse'

firebase.initializeApp({
apiKey: 'AIzaSyBb_2bG5cUaW25MfCdaDP7l5HF8UbF2QR0',
authDomain: 'ghct-79a7b.firebaseapp.com',
databaseURL: 'https://ghct-79a7b.firebaseio.com',
projectId: 'ghct-79a7b',
storageBucket: 'ghct-79a7b.appspot.com',
messagingSenderId: '45909398186'
})

Parse.initialize('ghct')
Parse.serverURL = 'https://ghct.herokuapp.com/1'
const parseQuery = new Parse.Query(Parse.Object.extend('CommentTracker'))
const queryParse = (id, callback) => parseQuery.containedIn('commentId', [id]).first().then(callback)

const browser = chrome || browser // eslint-disable-line no-use-before-define

browser.runtime.onConnect.addListener(port => {
const path = 'testing_zone/' + port.name
const ref = firebase.database().ref(path)

const valueListener = ref.on('value', snapshot => {
const id = snapshot.key
const value = snapshot.child('resolved').val()

if (value === null) {
queryParse(id, pValue => {
if (pValue !== undefined) {
if (pValue.attributes.resolved === false || pValue.attributes.resolved === true) {
console.log('p:', pValue, pValue.attributes.resolved)
ref.set(pValue.attributes.resolved)
port.postMessage({id, resolved: pValue.attributes.resolved})
}
}
})
}

port.postMessage({id, resolved: !!value})
})

port.onMessage.addListener(m => {
ref.set(m)
})

port.onDisconnect.addListener(() => {
ref.off('value', valueListener)
})
})
12 changes: 12 additions & 0 deletions src/background/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scripts": {
"build": "webpack"
},
"devDependencies": {
"webpack": "^3.0.0"
},
"dependencies": {
"firebase": "^4.1.3",
"parse": "1.6.14"
}
}
9 changes: 9 additions & 0 deletions src/background/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var path = require('path')

module.exports = {
entry: './ghct-background.js',
output: {
filename: 'ghct-background.js',
path: path.resolve('../..', 'dist')
}
}
Loading