Skip to content

Commit

Permalink
boilerplate 状態で initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-sava committed Nov 20, 2018
0 parents commit 74ba900
Show file tree
Hide file tree
Showing 17 changed files with 452 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
app/scripts

# Created by https://www.gitignore.io/api/node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime marks
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# bookmark-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


# End of https://www.gitignore.io/api/node


.idea
package-lock.json
dist/js/*
dist/manifest.json
release/*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 ISIGE, Akira

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.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 概要

ページで使用されている色をグレースケールにします.

# 注意点

作りかけなのでHTMLカラーしか変換しません.
画像とかはまたいずれ.


# アイコンの出典

>Icons made by <a href="https://www.freepik.com/" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a>
13 changes: 13 additions & 0 deletions dist/html/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>sava marks</title>
<style>
</style>
</head>
<body>
<div id="main"></div>
<script type="text/javascript" src="../js/options.js"></script>
</body>
</html>
36 changes: 36 additions & 0 deletions dist/icons/monochromer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions manifests/manifest.firefox.development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{

"manifest_version": 2,
"name": "Monochromer",
"version": "0.1.0",

"description": "This extension makes web site monochrome.",
"author": "[email protected]",
"homepage_url": "https://github.com/xia-sava/monochromer",

"permissions": [
"activeTab"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",

"icons": {
"512": "icons/monochromer.svg"
},
"background": {
"scripts": ["js/background.js"]
},
"browser_action": {
"default_icon": {
"512": "icons/monochromer.svg"
},
"default_title": "Monochrome this page"
},
"options_ui": {
"page": "html/options.html"
}
}
30 changes: 30 additions & 0 deletions manifests/manifest.firefox.production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{

"manifest_version": 2,
"name": "Monochromer",
"version": "0.1.0",

"description": "This extension makes web site monochrome.",
"author": "[email protected]",
"homepage_url": "https://github.com/xia-sava/monochromer",

"permissions": [
],
"content_security_policy": "script-src 'self'; object-src 'self'",

"icons": {
"512": "icons/monochromer.svg"
},
"background": {
"scripts": ["js/background.js"]
},
"browser_action": {
"default_icon": {
"512": "icons/monochromer.svg"
},
"default_title": "Monochrome this page"
},
"options_ui": {
"page": "html/options.html"
}
}
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "monochromer",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"watch": "./node_modules/.bin/webpack --watch --mode=development --devtool=inline-source-map",
"build:prod": "./node_modules/.bin/webpack --mode=production && cp manifests/manifest.firefox.production.json dist/manifest.json",
"build:dev": "./node_modules/.bin/webpack --mode=development --devtool=inline-source-map && cp manifests/manifest.firefox.development.json dist/manifest.json",
"release": "npm run build:prod && rm -fr release/* && zip -r release/firefox-submit.zip src package.json manifests tsconfig.json webpack.config.js && cp -r dist release/firefox && cd release/firefox && zip -r ../firefox.zip ./*",
"clean": "rm -fr dist/js/* dist/manifest.json release/*"
},
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@material-ui/core": "^3.5.1",
"react": "^16.3.1",
"react-dom": "^16.3.1"
},
"devDependencies": {
"@material-ui/icons": "^1.0.0-beta.43",
"@types/firefox-webext-browser": "^58.0.2",
"@types/react": "^16.3.13",
"@types/react-dom": "^16.0.5",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"no-console-webpack-plugin": "0.0.5",
"ts-loader": "^4.2.0",
"typescript": "^2.8.1",
"uglifyjs-webpack-plugin": "^1.2.5",
"web-ext": "^2.6.0",
"webpack": "^4.4.1",
"webpack-cli": "^2.0.13"
}
}
8 changes: 8 additions & 0 deletions privacy-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Monochromer Privacy Policy

This app does not collect any privacy data.

<div style="text-align: right;">
2018-11-20 Sava Engineering
</div>

8 changes: 8 additions & 0 deletions src/actions/background.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

browser.browserAction.onClicked.addListener(async (tab) => {
//
console.log(`browserAction ${tab}`);
});

console.log("background");

6 changes: 6 additions & 0 deletions src/actions/options.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';

import {OptionsView} from "../components/optionsView";

ReactDOM.render(<OptionsView />, document.querySelector('#main'));
53 changes: 53 additions & 0 deletions src/components/optionsView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import * as React from 'react';
import {Component} from 'react';
import { CircularProgress, Divider, Typography } from '@material-ui/core'
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'


interface Props {
}

interface States {
settingsPrepared: boolean;
}

export class OptionsView extends Component<Props, States> {

constructor(props: Props) {
super(props);
this.state = {
settingsPrepared: false,
};
browser.storage.local.get("hoge").then(() => {
this.setState({
settingsPrepared: true,
})
});
}

public render() {
const theme = {
};
if (!this.state.settingsPrepared) {
// settings ロード中
return (
<MuiThemeProvider theme={createMuiTheme(theme)}>
<div style={{minHeight: '100px', 'textAlign': 'center'}}>
<CircularProgress />
</div>
</MuiThemeProvider>
);
}
return (
<MuiThemeProvider theme={createMuiTheme(theme)}>
<div>
<Divider/>
<Typography variant={'headline'}>Monochromer 設定</Typography>
<div style={{ padding: 24 }}>
<Typography variant={'title'}>とはいえ設定項目はまだ無い</Typography>
</div>
</div>
</MuiThemeProvider>
);
}
}
36 changes: 36 additions & 0 deletions src/icons/monochromer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/modules/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

export * from './monochrome';
4 changes: 4 additions & 0 deletions src/modules/monochrome.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export class Monochrome {

}
Loading

0 comments on commit 74ba900

Please sign in to comment.