Skip to content

Commit

Permalink
Merge pull request abalone0204#63 from abalone0204/goodjob
Browse files Browse the repository at this point in the history
Goodjob
  • Loading branch information
abalone0204 authored Sep 13, 2016
2 parents c2f308c + 6594ef8 commit 86a20d1
Show file tree
Hide file tree
Showing 31 changed files with 1,262 additions and 145 deletions.
9 changes: 5 additions & 4 deletions chromeExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Clairvoyance - 求職天眼通",
"description": "讓你能在各大人力銀行上留言討論職缺,減少求職的資訊不對稱",
"version": "3.5.3",
"version": "3.6.0",
"author": "clver",
"icons": {
"16": "icon16.png",
Expand All @@ -26,15 +26,16 @@
"https://ajax.googleapis.com/",
"http://jobhelper.g0v.ronny.tw/",
"https://jobhelper.g0v.ronny.tw/",
"http://www.taiwanjobs.gov.tw/"
"http://www.taiwanjobs.gov.tw/",
"https://tranquil-fortress-92731.herokuapp.com/"
],
"content_security_policy": "script-src 'self' https://connect.facebook.net; object-src 'self'",
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com https://connect.facebook.net; object-src 'self'",
"content_scripts": [{
"matches": [
"*://www.104.com.tw/job/*",
"*://104.com.tw/job/*",
"http://www.1111.com.tw/job-bank/job-description*",
"http://www.518.com.tw/*-job-*.html",
"http://www.518.com.tw/*-job-*.html*",
"*://www.yes123.com.tw/admin/job_refer_comp_job_detail2.asp*",
"http://www.1111.com.tw//job-bank/job-description*"
],
Expand Down
20 changes: 20 additions & 0 deletions front-end/app/API/goodjob/companyStat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {
checkStatus,
parseJSON,
} from '../helper.js'

export default function searchByJob({
company,
}) {
const options = {
headers: {
"Content-Type": "application/json"
},
method: 'GET',
mode: 'cors'
}
const url = `https://tranquil-fortress-92731.herokuapp.com/workings/statistics/by-company?company=${company}`
return fetch(url, options)
.then(checkStatus)
.then(parseJSON)
}
7 changes: 7 additions & 0 deletions front-end/app/API/goodjob/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import searchByJob from './searchByJob.js'

const goodjob = {
searchByJob,
}
export default goodjob

23 changes: 23 additions & 0 deletions front-end/app/API/goodjob/searchByJob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
checkStatus,
parseJSON,
} from '../helper.js'


export default function searchByJob({
job_title,
page,
}) {
const options = {
headers: {
"Content-Type": "application/json"
},
method: 'GET',
mode: 'cors'
}
const baseURL = `https://tranquil-fortress-92731.herokuapp.com/clairvoyance/search/by-job?job_title=${job_title}`
const url = page ? `${baseURL}&page=${page}` : `${baseURL}`
return fetch(url, options)
.then(checkStatus)
.then(parseJSON)
}
21 changes: 12 additions & 9 deletions front-end/app/API/helper.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
export function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response
} else {
var error = new Error(response.statusText)
error.response = response
throw error
}
if (response.status >= 200 && response.status < 300) {
return response
} else {
var error = new Error(response.statusText)
error.response = response
throw error
}
}

export function parseJSON(response) {
return response.json()
}
return response.text()
.then((text) => {
return text ? JSON.parse(text) : {}
})
}
58 changes: 58 additions & 0 deletions front-end/app/actions/fetchWorkingTime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
export const REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE = 'REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE'
export const RECEIVE_WORKING_TIME = 'RECEIVE_WORKING_TIME'
export const FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE = 'FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE'

export const REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME = 'REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME'
export const RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME = 'RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME'
export const FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME = 'FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME'


export function requestFetchWorkingTimeByJobTitle({
job_title,
page,
}) {
return {
type: REQUEST_FETCH_WORKING_TIME_BY_JOB_TITLE,
job_title,
page,
}
}

export function receiveWorkingTime(response) {
return {
type: RECEIVE_WORKING_TIME,
response,
}
}

export function failToFetchWorkingTimeByJobTitle(error) {
return {
type: FAIL_TO_FETCH_WORKING_TIME_BY_JOB_TITLE,
error,
}
}

export function requestFetchWorkingTimeStatByCompanyName({
company,
page,
}) {
return {
type: REQUEST_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME,
company,
page,
}
}

export function receiveWorkingTimeStatByCompanyName(response) {
return {
type: RECEIVE_WORKING_TIME_STAT_BY_COMPANY_NAME,
response,
}
}

export function failToFetchWorkingTimeStatByCompanyName(error) {
return {
type: FAIL_TO_FETCH_WORKING_TIME_STAT_BY_COMPANY_NAME,
error,
}
}
27 changes: 27 additions & 0 deletions front-end/app/actions/initialize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const SET_INIT_JOB_OBJECT = 'SET_INIT_JOB_OBJECT'
export const FETCH_INIT_JOB_OBJECT = 'FETCH_INIT_JOB_OBJECT'
export const FAIL_TO_INIT_JOB_OBJECT = 'FAIL_TO_INIT_JOB_OBJECT'

export function fetchInitJobObject() {
return {
type: FETCH_INIT_JOB_OBJECT,
}
}

export function setInitJobObject({
job_name,
company_name,
}) {
return {
type: SET_INIT_JOB_OBJECT,
job_name,
company_name,
}
}

export function failToInitJobObject(error) {
return {
type: FAIL_TO_INIT_JOB_OBJECT,
error
}
}
16 changes: 16 additions & 0 deletions front-end/app/components/Clock/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import CSSModules from 'react-css-modules'
import styles from './styles.css'

const Clock = () => (
<div styleName="clock">
<div styleName="top"></div>
<div styleName="right"></div>
<div styleName="bottom"></div>
<div styleName="left"></div>
<div styleName="center"></div>
<div styleName="hour"></div>
<div styleName="minute"></div>
</div>
)

export default CSSModules(Clock, styles)
122 changes: 122 additions & 0 deletions front-end/app/components/Clock/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
$size: 50px;
$border-color: #000;

.clock {
position: relative;
height: $size;
width: $size;
background: white;
box-sizing: border-box;
border-radius: 100%;
border: 2px solid $border-color;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}

.h-rect {
position: absolute;
width: 8px;
height: 3px;
background: #262626;
}

.v-rect {
position: absolute;
width: 3px;
height: 8px;
background: #262626;
}

.top {
composes: v-rect;
left: 0;
right: 0;
margin: 0 auto;
}

.right {
composes: h-rect;
top: 0;
bottom: 0;
right: 0;
margin: auto 0;
}

.bottom {
composes: v-rect;
left: 0;
right: 0;
bottom: 0;
margin: 0 auto;
}

.left {
composes: h-rect;
top: 0;
bottom: 0;
left: 0;
margin: auto 0;
}

.center {
height: 6px;
width: 6px;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background: #262626;
border-radius: 100%;
}

.hand {
width: 3px;
height: 100%;
position: absolute;
left: 0;
right: 0;
margin: 0 auto;
}

.hand:before {
position: absolute;
content: "";
}

.hour {
composes: hand;
animation: time 4s infinite linear;

&:before {
background: #262626;
height: calc($size * 0.225);
width: 3px;
top: calc($size * 0.225 * 0.9);
}

}

.minute {
composes: hand;
animation: time 0.8s infinite linear;

&:before {
background: #fd1111;
height: 17px;
width: 2px;
top: 26px;
}

}

@keyframes time {
to {
transform: rotate(360deg);
}

}
Loading

0 comments on commit 86a20d1

Please sign in to comment.