Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Commit

Permalink
fix pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
xwartz committed Feb 27, 2016
1 parent 124de5b commit d5dc020
Show file tree
Hide file tree
Showing 283 changed files with 31 additions and 56,786 deletions.
32 changes: 18 additions & 14 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

let $ = require('jquery'),
Objectid = require('objectid')
let Objectid = require('objectid')


let path = require('path'),
userConfig = require('./user-config'),
Expand All @@ -11,23 +11,27 @@ let path = require('path'),
const Appest = Object.assign({}, appest, conf)

let App = {
$el: $('#js-add'),
$el: document.getElementById('js-add'),
createTask (model) {
let _this = this
const api = Appest.protocol + Appest.api_domain + '/api/v2/task'
$.ajax({
type: 'POST',
url: api,
contentType: 'application/json',
data: JSON.stringify(model),
success (data) {
_this.$el.val('')

fetch(api, {
credentials: 'include',
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(model)
}).then((res) => {
if(res.status >= 200 && res.status < 300) {
this.$el.value = ''
}
})
},

initEvent () {
this.$el.on('keyup', (event) => {
this.$el.addEventListener('keyup', (event) => {
if(event.keyCode === 13) {
let model = {
assignee: null,
Expand All @@ -45,11 +49,11 @@ let App = {
reminders: null,
status: 0,
timeZone: 'Asia/Shanghai',
title: this.$el.val(),
title: this.$el.value,
}
this.createTask(model)
}
})
}, false)
},

init () {
Expand Down
1 change: 0 additions & 1 deletion app/node_modules/.bin/window-size

This file was deleted.

4 changes: 0 additions & 4 deletions app/node_modules/ansi-regex/index.js

This file was deleted.

21 changes: 0 additions & 21 deletions app/node_modules/ansi-regex/license

This file was deleted.

112 changes: 0 additions & 112 deletions app/node_modules/ansi-regex/package.json

This file was deleted.

31 changes: 0 additions & 31 deletions app/node_modules/ansi-regex/readme.md

This file was deleted.

125 changes: 0 additions & 125 deletions app/node_modules/async/CHANGELOG.md

This file was deleted.

19 changes: 0 additions & 19 deletions app/node_modules/async/LICENSE

This file was deleted.

Loading

0 comments on commit d5dc020

Please sign in to comment.