Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file added autodocs/other_docs.rst
Empty file.
30 changes: 30 additions & 0 deletions extension/writing-process/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"globals": {
"document": false,
"escape": false,
"navigator": false,
"unescape": false,
"window": false,
"describe": true,
"before": true,
"it": true,
"expect": true,
"sinon": true,
"chrome": true
},
"plugins": [],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
}
}
2 changes: 2 additions & 0 deletions extension/writing-process/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
43 changes: 43 additions & 0 deletions extension/writing-process/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# writing-process

Tracks writing in Google Docs, and provides nifty insights to you and your teachers!

## Development

This extension directory structure was created with [Extension CLI](https://oss.mobilefirst.me/extension-cli/).
The original extension, which was just a handful of javascript files, were then copied into the structure.

### To Begin

To get started, run the following:

```bash
cd extention/writing-process
npm install
```

### Available Commands

| Commands | Description |
| --- | --- |
| `npm run start` | builds extension into `dist/`, watches for file changes |
| `npm run build` | generate release version - `release.zip` |
| `npm run docs` | generate source code docs into `public/documentation` |
| `npm run clean` | removes `dist/` directory |
| `npm run test` | run unit tests |
| `npm run sync` | update projects config files for `extension-cli` |

For CLI instructions see [User Guide →](https://oss.mobilefirst.me/extension-cli/)

### Learn More

#### Extension Developer guides

- [Getting started with extension development](https://developer.chrome.com/extensions/getstarted)
- Manifest configuration: [version 3](https://developer.chrome.com/docs/extensions/mv3/intro/)
- [Permissions reference](https://developer.chrome.com/extensions/declare_permissions)
- [Chrome API reference](https://developer.chrome.com/docs/extensions/reference/)

#### Extension Publishing Guides

- [Publishing for Chrome](https://developer.chrome.com/webstore/publish)
11 changes: 11 additions & 0 deletions extension/writing-process/assets/locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"appName": {
"message": "writing-process"
},
"appShortName": {
"message": "writing-process"
},
"appDescription": {
"message": "Tracks writing in Google Docs, and provides nifty insights to you and your teachers!"
}
}
76 changes: 76 additions & 0 deletions extension/writing-process/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"name": "writing-process",
"description": "Tracks writing in Google Docs, and provides nifty insights to you and your teachers!",
"version": "1.0.0.2",
"homepage": "http://chrome.google.com/webstore",
"author": "Piotr Mitros, Bradley Erickson",
"repository": {
"type": "git",
"url": "https://github.com/ETS-Next-Gen/writing_observer/tree/master/extension/writing-process"
},
"scripts": {
"start": "xt-build -e dev -w",
"start:firefox": "xt-build -e dev -p firefox -w",
"build": "xt-build -e prod",
"build:firefox": "xt-build -e prod -p firefox",
"clean": "xt-clean",
"docs": "xt-docs",
"test": "xt-test",
"coverage": "nyc --reporter=lcov npm run test",
"sync": "xt-sync"
},
"babel": {
"presets": [
"@babel/preset-env"
]
},
"eslintIgnore": [
"test/**/*"
],
"devDependencies": {
"extension-cli": "latest"
},
"xtdocs": {
"source": {
"include": [
"README.md",
"src"
]
}
},
"xtbuild": {
"copyAsIs": [
"./src/pages/*"
],
"js_bundles": [
{
"name": "background",
"src": "./src/background.js"
},
{
"name": "inject",
"src": "./src/inject.js"
},
{
"name": "service_worker",
"src": "./src/service_worker.js"
},
{
"name": "writing_common",
"src": "./src/writing_common.js"
},
{
"name": "writing",
"src": "./src/writing.js"
},
{
"name": "3rdparty/sha256",
"src": "./src/3rdparty/sha256.js"
},
{
"name": "3rdparty/sha256",
"src": "./src/3rdparty/sha256.js"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var RAW_DEBUG = false;
*/
var WEBSOCKET_SERVER_URL = "wss://learning-observer.org/wsapi/in/"


import { googledocs_id_from_url } from './writing_common';
/*
TODO: FSM

Expand Down Expand Up @@ -111,7 +111,7 @@ function websocket_logger(server) {
function are_we_done() {
if (state.has("chrome_identity") &&
state.has("local_storage")) {
event = {};
var event = {};
event = add_event_metadata('metadata_finished', event);
socket.send(JSON.stringify(event));
state.add("ready");
Expand Down
File renamed without changes.
50 changes: 50 additions & 0 deletions extension/writing-process/src/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"description": "__MSG_appDescription__",
"homepage_url": "https://github.com/ETS-Next-Gen/writing_observer/tree/master/extension/writing-process",
"incognito": "not_allowed",
"version": "1.0.0.2",
"version_name": "1.0.0.2",
"manifest_version": 3,
"default_locale": "en",
"minimum_chrome_version": "88",
"permissions": [
"webRequest",
"declarativeNetRequest",
"identity",
"identity.email",
"storage",
"nativeMessaging",
"scripting",
"activeTab"
],
"icons": {
"48": "assets/lousy-fountain-pen-48.png"
},
"background": {
"service_worker": "service_worker.js"
},
"action": {
"default_popup": "pages/settings.html",
"default_icon": {
"48": "assets/lousy-fountain-pen-48.png"
},
"default_title": "__MSG_appName__"
},
"content_scripts": [{
"matches": ["*://docs.google.com/document/*"],
"js": ["3rdparty/sha256.js", "writing_common.js", "writing.js"]
}],
"web_accessible_resources": [{
"resources": ["inject.js"],
"matches": ["*://docs.google.com/*"],
"use_dynamic_url": true
}],
"host_permissions": [
"*://docs.google.com/document/*"
],
"options_ui": {
"page": "pages/options.html"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function treeget(tree, key) {
}


function googledocs_id_from_url(url) {
export function googledocs_id_from_url(url) {
/*
Given a URL like:
https://docs.google.com/document/d/jkldfhjklhdkljer8934789468976sduiyui34778dey/edit/foo/bar
Expand Down
6 changes: 6 additions & 0 deletions extension/writing-process/test/sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe('Test extension', () => {

it('This is a dummy test', () => {
expect(true).to.be.true;
});
});