text
stringlengths 7
3.69M
|
|---|
import React, { useEffect } from 'react';
import { connect } from 'dva';
import styles from './Add_api_jurisdiction.scss'
import { Form, Input, Button, Radio } from 'antd';
function Add_api_jurisdiction(props) {
const { addApi_jurisdiction } = props
useEffect(() => {
}, [])
const { getFieldDecorator } = props.form;
let handleReset = () => {
props.form.resetFields();
};
return (
<div className={styles.add_api_jurisdiction}>
<Radio.Group defaultValue="a" size="large" className={styles.tab}>
<Radio.Button value="a">添加api接口权限</Radio.Button>
</Radio.Group>
<Form onSubmit={
e => {
e.preventDefault();
props.form.validateFields((err, values) => {
console.log(values)
if (!err) {
addApi_jurisdiction({
api_authority_text: values.api_authority_text,
api_authority_url: values.api_authority_url,
api_authority_method: values.api_authority_method
})
}
});
}
} className={styles.api_jurisdiction}>
<Form.Item>
{getFieldDecorator('api_authority_text', {
//validateTrigger 校验子节点值的时机
validateTrigger: 'onBlur',
//rules 校验规则
rules: [
{ required: true, message: '请输入api接口权限名称' },
{ min: 1, max: 20, message: '请输入api接口权限名称!' }
],
})(<Input placeholder='请输入api接口权限名称' />)}
</Form.Item>
<Form.Item>
{getFieldDecorator('api_authority_url', {
//validateTrigger 校验子节点值的时机
validateTrigger: 'onBlur',
//rules 校验规则
rules: [
{ required: true, message: '请输入api接口权限url' },
{ min: 1, max: 20, message: '请输入api接口权限url!' }
],
})(<Input placeholder='请输入api接口权限url' />)}
</Form.Item>
<Form.Item>
{getFieldDecorator('api_authority_method', {
//validateTrigger 校验子节点值的时机
validateTrigger: 'onBlur',
//rules 校验规则
rules: [
{ required: true, message: '请输入api接口权限方法' },
{ min: 1, max: 20, message: '请输入api接口权限方法!' }
],
})(<Input placeholder='请输入api接口权限方法' />)}
</Form.Item>
<Form.Item className={styles.footer_button}>
<Button type="primary" htmlType="submit" className={styles.button}>确定</Button>
<Button onClick={handleReset}>重置</Button>
</Form.Item>
</Form>
</div>
)
}
Add_api_jurisdiction.propTypes = {
};
const mapStateToProps = state => {
return state.addUser
}
const mapDispatchToProps = dispatch => {
return {
//添加api接口权限
addApi_jurisdiction: payload => {
dispatch({
type: "addUser/addApi_jurisdiction",
payload
})
},
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Form.create()(Add_api_jurisdiction));
|
/**
* Created by adronhall on 6/20/14.
* Description: apikey management.
*/
var Chance = require('chance');
var chance = new Chance();
var apikeys = function apikeys(ring) {
this.ConnectionRing = ring;
};
apikeys.ConnectionRing = {};
apikeys.prototype.getUser = function (apikey) {
}
apikeys.prototype.get = function (username, password) {
var collection = this.ConnectionRing.collections.apikeys;
return this.ConnectionRing.kv_get(collection, username);
}
apikeys.prototype.add = function (username, password, role) {
var collection = this.ConnectionRing.collections.apikeys;
var key = chance.guid();
var value = {apikey: chance.guid(), username: username, role: role};
return this.ConnectionRing.kv_set(collection, key, value);
}
apikeys.prototype.generate = function (email) {
if (email.length > 3) {
var apikey = {
apikey: chance.guid(),
email: email
}
return apikey;
} else {
throw Error('Must have a valid email when generating an API key.');
}
}
module.exports = apikeys;
|
var orm = require('../config/orm')
var challenge_log = {
//Expecting newChallengeLog object that includes user_id and group_challenge_id
createRunningDistLog: function (newChallengeLog, callback) {
let query = {
table: 'running_distance_logs',
data: newChallengeLog,
debug: true
};
orm.insert(query, callback);
},
getUserRunningDistLogs: function ({user_id, group_challenge_id}, callback) {
let query = {
table: 'running_distance_logs',
where: [{user_id: user_id}, {group_challenge_id: group_challenge_id}],
debug: true
};
orm.select(query, callback);
},
getRunningDistLogs: function (group_challenge_id, callback) {
let queryString = `SELECT
group_challenges.id as group_challenge_id,
users.username,
SUM(running_distance) AS running_distance,
user_id
FROM
group_challenges
INNER JOIN
running_distance_logs
ON
group_challenges.id = running_distance_logs.group_challenge_id
INNER JOIN
users
ON
users.id = running_distance_logs.user_id
WHERE
group_challenges.id = ?
GROUP BY username
ORDER BY running_distance DESC;`
let queryCondition = [group_challenge_id];
orm.query(queryString, queryCondition, callback);
},
createRunningPaceLog: function (newChallengeLog, callback) {
let query = {
table: 'running_pace_logs',
data: newChallengeLog,
debug: true
};
orm.insert(query, callback);
},
getRunningPaceLogs: function (group_challenge_id, callback) {
let queryString = `SELECT
group_challenges.id as group_challenge_id,
users.username,
running_pace,
user_id
FROM
group_challenges
INNER JOIN
running_pace_logs
ON
group_challenges.id = running_pace_logs.group_challenge_id
INNER JOIN
users
ON
users.id = running_pace_logs.user_id
WHERE
group_challenges.id = ?;`
let queryCondition = [group_challenge_id];
orm.query(queryString, queryCondition, callback);
},
createBikingPaceLog: function (newChallengeLog, callback) {
let query = {
table: 'biking_pace_logs',
data: newChallengeLog,
debug: true
};
orm.insert(query, callback);
},
getBikingPaceLogs: function (group_challenge_id, callback) {
let queryString = `SELECT
group_challenges.id as group_challenge_id,
users.username,
biking_pace,
user_id
FROM
group_challenges
INNER JOIN
biking_pace_logs
ON
group_challenges.id = running_pace_logs.group_challenge_id
INNER JOIN
users
ON
users.id = biking_pace_logs.user_id
WHERE
group_challenges.id = ?;`
let queryCondition = [group_challenge_id];
orm.query(queryString, queryCondition, callback);
},
createBikingDistLog: function (newChallengeLog, callback) {
let query = {
table: 'biking_distance_logs',
data: newChallengeLog,
debug: true
};
orm.insert(query, callback);
},
getBikingDistLogs: function (group_challenge_id, callback) {
let queryString = `SELECT
group_challenges.id as group_challenge_id,
users.username,
SUM(biking_distance) AS biking_distance,
user_id
FROM
group_challenges
INNER JOIN
biking_distance_logs
ON
group_challenges.id = biking_distance_logs.group_challenge_id
INNER JOIN
users
ON
users.id = biking_distance_logs.user_id
WHERE
group_challenges.id = ?
GROUP BY username
ORDER BY biking_distance DESC;`
let queryCondition = [group_challenge_id];
orm.query(queryString, queryCondition, callback);
}
};
module.exports = challenge_log;
|
function MathCalculator(a, b) {
this.a = a;
this.b = b;
this.add = function () {
return this.a + this.b;
}
this.divide = function () {
if (!this.b)
return 'b can\'t be zero or null or undefined';
return this.a / this.b;
}
}
MathCalculator.prototype.sub = function () {
return this.a - this.b;
}
MathCalculator.prototype.multiply = function () {
return this.a * this.b;
}
MathCalculator.prototype.Name = 'Hello Name';
let calculator = new MathCalculator(5, 6);
console.log(calculator.add())
console.log(calculator.divide())
console.log(calculator.multiply())
console.log(calculator.sub());
console.log(calculator.Name);
|
import React, {useState, useEffect} from "react"
import './contact.css'
import emailjs from 'emailjs-com'
import Lottie from 'react-lottie-segments';
import Json from '../assets/21735-join-chat.json'
function Contact(props) {
const [name, setName] = useState("")
const [email, setEmail] = useState("")
const [subject, setSubject] = useState("")
const [message, setMessage] = useState("")
const [btnText, setBtnText] = useState("Send")
useEffect(() => {
emailjs.init("user_UgVJMKr7nOqKUY3z8wt5z")
}, [])
const handleChange = (e) => {
if (e.target.id === "name") {
setName(e.target.value)
} else if (e.target.id === "email") {
setEmail(e.target.value)
} else if (e.target.id === "subject") {
setSubject(e.target.value)
} else if (e.target.id === "message") {
setMessage(e.target.value)
}
}
const handleSubmit = (e) => {
e.preventDefault()
setBtnText("Sending...")
const templateParams = {
name: name,
email: email,
subject: subject,
message: message
}
emailjs.send("gmail", "portfolio_site_emails", templateParams)
.then(
function(response) {
console.log(response)
setBtnText("Message Sent")
setName("")
setEmail("")
setSubject("")
setMessage("")
setTimeout(() => {
setBtnText("Send")
}, 3000);
}, function(err) {
console.log(err)
setBtnText("Message Failed")
setTimeout(() => {
setBtnText("Send")
}, 3000);
}
)
}
return (
<div id="contact" style={{backgroundColor: "#283060"}}>
<h1>Don't be a stranger</h1>
<h3 className="form-head">Just say hello</h3>
<div className="contact-wrapper">
<form name="contact" className="contact-form" onSubmit={handleSubmit}>
<input required placeholder="Name" className="input" type="text" name="name" id="name" value={name} onChange={handleChange} autoComplete="off"/>
<br/>
<input required placeholder="Email" className="input" type="email" name="email" id="email" value={email} onChange={handleChange} autoComplete="off"/>
<br/>
<input required placeholder="Subject" className="input" type="text" name="subject" id="subject" value={subject} onChange={handleChange} autoComplete="off"/>
<br/>
<textarea required placeholder="Your Message" name="message" className="input" id="message" value={message} onChange={handleChange}/>
<br/>
<button className="submit btn" type="submit">{btnText}</button>
</form>
<div className="contact-ani">
<Lottie
options={{loop: true, autoplay: true, animationData: Json}}
></Lottie>
</div>
</div>
</div>
)
}
export default Contact;
|
const Sound = require('react-native-sound');
Sound.setCategory('Ambient', true);
// const loadNote = (numCorde, numCase) => {
// Sound.setCategory('Ambient', true);
// const sound = new Sound(`corde${numCorde}case${numCase}.mp3`, Sound.MAIN_BUNDLE, (error) => {
// console.log(`path of sound file to load: corde${numCorde}case${numCase}.mp3`);
// if (error) {
// console.log('failed to load the sound', error);
// return;
// }
// sound.setSpeed(1);
// console.log(`duration: ${sound.getDuration()}`);
// });
// return sound;
// };
//
// export const loadAllNotes = () => {
// const allNotes = [
// [],
// [],
// [],
// [],
// [],
// [],
// ];
// for (let numCorde = 0; numCorde < 6; numCorde++) {
// for (let numCase = 0; numCase < 22; numCase++) {
// allNotes[numCorde].push(loadNote(numCorde + 1, numCase + 1));
// }
// }
// return allNotes;
// };
//
// export const playLoadedNote = (allNotes, numCorde, numCase) => {
// allNotes[numCorde - 1][numCase - 1].play();
// };
export const loadAndPlayNote = (numCorde, numCase) => {
Sound.setCategory('Ambient', true);
const s = new Sound(`corde${numCorde}case${numCase}.mp3`, Sound.MAIN_BUNDLE, (error) => {
console.log(`path of sound file to load: corde${numCorde}case${numCase}.mp3`);
if (error) {
console.log('failed to load the sound', error);
return;
}
s.setSpeed(1);
console.log(`duration: ${s.getDuration()}`);
s.play(() => s.release());
});
};
//TODO:
/*
• importer une bibliothèque de fichiers de sons complète
• créer une fonction qui crée des objets s = new Sound(…) pour chaque objet et
les met dans un objet qui contient des array corde1, …, corde6, dans cet objet
on aura donc le son de chaque case de la guitare préchargé
• on appelera cette fonction au lancement de l'app pour charger tous les sons au lieu
de les charger chaque fois qu'on clique sur un bouton (lol)
• créer une fonction playsoundfor(numCase,numCorde) qui ira chercher dans
le tableau de sons le bon son (simplement avec ses coordonnées) et le jouera
avec un truc du style s.play(() => s.release())
• là on devrait être bon pour les sons :)
*/
|
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _yeomanGenerator = __webpack_require__(1);
var _yeomanGenerator2 = _interopRequireDefault(_yeomanGenerator);
var _deps = __webpack_require__(2);
var _deps2 = _interopRequireDefault(_deps);
var _devDeps = __webpack_require__(3);
var _devDeps2 = _interopRequireDefault(_devDeps);
var _main = __webpack_require__(4);
var _main2 = _interopRequireDefault(_main);
var _repo = __webpack_require__(10);
var _repo2 = _interopRequireDefault(_repo);
var _push = __webpack_require__(11);
var _push2 = _interopRequireDefault(_push);
var _common = __webpack_require__(12);
var commonActions = _interopRequireWildcard(_common);
var _frontendApp = __webpack_require__(14);
var frontendAppActions = _interopRequireWildcard(_frontendApp);
var _railsApi = __webpack_require__(16);
var railsApiActions = _interopRequireWildcard(_railsApi);
var _scaffoldRoots = __webpack_require__(18);
var _scaffoldRoots2 = _interopRequireDefault(_scaffoldRoots);
var _scaffoldFrontendApp = __webpack_require__(19);
var _scaffoldFrontendApp2 = _interopRequireDefault(_scaffoldFrontendApp);
var _scaffoldRailsApi = __webpack_require__(20);
var _scaffoldRailsApi2 = _interopRequireDefault(_scaffoldRailsApi);
var _allDone = __webpack_require__(21);
var _allDone2 = _interopRequireDefault(_allDone);
var _utils = __webpack_require__(15);
var utils = _interopRequireWildcard(_utils);
var _instance = __webpack_require__(22);
var instanceUtils = _interopRequireWildcard(_instance);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var FluxOnRailsGenerator = function (_yeoman$Base) {
_inherits(FluxOnRailsGenerator, _yeoman$Base);
function FluxOnRailsGenerator() {
var _Object$getPrototypeO;
_classCallCheck(this, FluxOnRailsGenerator);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _this = _possibleConstructorReturn(this, (_Object$getPrototypeO = Object.getPrototypeOf(FluxOnRailsGenerator)).call.apply(_Object$getPrototypeO, [this].concat(args)));
_this.npmDeps = _deps2.default;
_this.npmDevDeps = _devDeps2.default;
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = Object.keys(instanceUtils)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var method = _step.value;
_this[method] = instanceUtils[method].bind(_this);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
_this.commonActions = utils.bindToContext(_this, commonActions);
_this.frontendAppActions = utils.bindToContext(_this, frontendAppActions);
_this.railsApiActions = utils.bindToContext(_this, railsApiActions);
return _this;
}
_createClass(FluxOnRailsGenerator, [{
key: 'mainPrompts',
value: function mainPrompts() {
_main2.default.call(this);
}
}, {
key: 'repoPrompts',
value: function repoPrompts() {
_repo2.default.call(this);
}
}, {
key: 'pushPrompt',
value: function pushPrompt() {
_push2.default.call(this);
}
}, {
key: 'writing',
get: function get() {
return {
scaffoldRoots: _scaffoldRoots2.default,
scaffoldFrontendApp: _scaffoldFrontendApp2.default,
scaffoldRailsApi: _scaffoldRailsApi2.default,
allDone: _allDone2.default
};
}
}]);
return FluxOnRailsGenerator;
}(_yeomanGenerator2.default.Base);
module.exports = FluxOnRailsGenerator;
/***/ },
/* 1 */
/***/ function(module, exports) {
module.exports = require("yeoman-generator");
/***/ },
/* 2 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ['axios', 'babel', 'babel-cli', 'babel-core', 'babel-polyfill', 'babel-preset-es2015', 'babel-preset-react', 'babel-preset-stage-0', 'babel-register', 'body-parser', 'classnames', 'compression', 'cookie', 'cookie-parser', 'express', 'history', 'immutable', 'jade', 'mirror-creator', 'morgan', 'normalize.css', 'normalizr', 'nprogress', 'react', 'react-dom', 'react-redux', 'react-router', 'redux', 'redux-thunk', 'serialize-javascript', 'transit-immutable-js', 'transit-js'];
/***/ },
/* 3 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ['autoprefixer', 'babel-eslint', 'babel-loader', 'babel-plugin-react-transform', 'babel-plugin-transform-decorators-legacy', 'babel-plugin-typecheck', 'chunk-manifest-webpack-plugin', 'compression-webpack-plugin', 'css-loader', 'escape-string-regexp', 'eslint', 'eslint-config-alexfedoseev', 'eslint-plugin-babel', 'eslint-plugin-react', 'extract-text-webpack-plugin', 'file-loader', 'fly', 'fly-build-utils', 'image-webpack-loader', 'json-loader', 'nodemon', 'node-sass', 'path', 'postcss-loader', 'react-addons-test-utils', 'react-transform-catch-errors', 'react-transform-hmr', 'redbox-react', 'redux-devtools', 'sass-loader', 'sass-resources-loader', 'source-map-support', 'style-loader', 'url-loader', 'webpack', 'webpack-dev-middleware', 'webpack-hot-middleware', 'webpack-manifest-plugin', 'chai', 'chai-enzyme', 'chai-immutable', 'css-modules-require-hook', 'enzyme', 'jsdom', 'mocha', 'sinon'];
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = mainPrompts;
var _chalk = __webpack_require__(5);
var _chalk2 = _interopRequireDefault(_chalk);
var _yosay = __webpack_require__(6);
var _yosay2 = _interopRequireDefault(_yosay);
var _changeCase = __webpack_require__(7);
var _changeCase2 = _interopRequireDefault(_changeCase);
var _shelljs = __webpack_require__(8);
var _shelljs2 = _interopRequireDefault(_shelljs);
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function mainPrompts() {
var _this = this;
this.log((0, _yosay2.default)('Welcome to the marvelous ' + _chalk2.default.red('Redux-on-Rails') + ' generator!'));
var done = this.async();
var defaultName = _changeCase2.default.param(this.options.argv.original[0]) || null;
var skipPrompts = this.options.skipPrompts;
if (skipPrompts) {
if (!defaultName) {
this.env.error(_chalk2.default.red('NoNameError: Sorry, bro, no way.'));
}
this.name = defaultName;
this.appName = this.name + '-app';
this.apiName = this.name + '-api';
this.installApp = true;
this.installApi = true;
this.root = _path2.default.join(_shelljs2.default.pwd(), this.name);
this.rubyVersion = _shelljs2.default.env['RUBY_VERSION'];
this.rvmString = 'rvm ' + this.rubyVersion + '@' + this.name + ' do ';
this.configRepo = false;
return done();
}
var prompts = [{
type: 'input',
name: 'name',
message: 'Enter app name:',
default: defaultName
}, {
type: 'checkbox',
name: 'parts',
message: 'Choose parts to install:',
choices: [{
name: 'Frontend App',
value: 'app',
checked: true
}, {
name: 'Rails API',
value: 'api',
checked: true
}]
}, {
type: 'confirm',
name: 'configRepo',
message: 'Configure remote repo on Github / Bitbucket?',
default: true
}];
return this.prompt(prompts, function (props) {
var installPart = function installPart(part) {
return props.parts.indexOf(part) !== -1;
};
_this.name = _changeCase2.default.param(props.name);
_this.appName = _this.name + '-app';
_this.apiName = _this.name + '-api';
_this.installApp = installPart('app');
_this.installApi = installPart('api');
_this.root = _path2.default.join(_shelljs2.default.pwd(), _this.name);
_this.rubyVersion = _shelljs2.default.env['RUBY_VERSION'];
_this.rvmString = 'rvm ' + _this.rubyVersion + '@' + _this.name + ' do ';
_this.configRepo = props.configRepo;
return done();
});
}
/***/ },
/* 5 */
/***/ function(module, exports) {
module.exports = require("chalk");
/***/ },
/* 6 */
/***/ function(module, exports) {
module.exports = require("yosay");
/***/ },
/* 7 */
/***/ function(module, exports) {
module.exports = require("change-case");
/***/ },
/* 8 */
/***/ function(module, exports) {
module.exports = require("shelljs");
/***/ },
/* 9 */
/***/ function(module, exports) {
module.exports = require("path");
/***/ },
/* 10 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = repoPrompts;
function repoPrompts() {
var _this = this;
var done = this.async();
if (this.configRepo) {
var prompts = [{
type: 'list',
name: 'repo',
message: 'Github or Bitbucket?',
default: 0,
choices: [{
name: 'Github',
value: 'github'
}, {
name: 'Bitbucket',
value: 'bitbucket'
}]
}, {
type: 'input',
name: 'repoUser',
message: 'Your username:'
}];
return this.prompt(prompts, function (props) {
var appName = _this.appName;
var apiName = _this.apiName;
_this.repo = props.repo;
if (_this.repo === 'github') {
_this.repoUser = props.repoUser || 'alexfedoseev';
var repoUser = _this.repoUser;
_this.repoAppUrl = 'https://github.com/' + repoUser + '/' + appName;
_this.repoApiUrl = 'https://github.com/' + repoUser + '/' + apiName;
_this.repoAppSsh = 'git@github.com:' + repoUser + '/' + appName + '.git';
_this.repoApiSsh = 'git@github.com:' + repoUser + '/' + apiName + '.git';
} else {
_this.repoUser = props.repoUser || 'alex_fedoseev';
var _repoUser = _this.repoUser;
_this.repoAppUrl = 'https://bitbucket.org/' + _repoUser + '/' + appName;
_this.repoApiUrl = 'https://bitbucket.org/' + _repoUser + '/' + apiName;
_this.repoAppSsh = 'git@bitbucket.org:' + _repoUser + '/' + appName + '.git';
_this.repoApiSsh = 'git@bitbucket.org:' + _repoUser + '/' + apiName + '.git';
}
return done();
});
}
return done();
}
/***/ },
/* 11 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = pushPrompt;
function pushPrompt() {
var _this = this;
var done = this.async();
if (this.configRepo && this.repo) {
var newLine = '\n ';
var repoAppSsh = this.repoAppSsh;
var repoApiSsh = this.repoApiSsh;
var notice = newLine + 'Check that you have created:';
if (this.installApp) notice += newLine + ('Node app repo: ' + repoAppSsh);
if (this.installApi) notice += newLine + ('Rails app repo: ' + repoApiSsh);
notice = newLine + notice + newLine + newLine;
var prompt = [{
type: 'confirm',
name: 'pushToRemote',
message: 'Push first commit to remote?' + notice + 'Push now?',
default: false
}];
return this.prompt(prompt, function (props) {
_this.pushToRemote = props.pushToRemote;
return done();
});
}
return done();
}
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createRvmFiles = createRvmFiles;
exports.createGitignore = createGitignore;
exports.gitInit = gitInit;
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function createRvmFiles() {
say.info('Creating rvm files...');
this.render('ruby-version', '.ruby-version', { version: this.rubyVersion });
this.render('ruby-gemset', '.ruby-gemset', { gemset: this.name });
}
function createGitignore() {
say.info('Creating `.gitignore` file...');
this.render('gitignore', '.gitignore');
}
function gitInit() {
say.info('Initializing git repo...');
this.shellExec('git init');
this.shellExec('git add .');
this.shellExec('git commit --quiet -m "Initial commit"');
}
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.section = section;
exports.info = info;
exports.cmd = cmd;
exports.status = status;
exports.plain = plain;
var _chalk = __webpack_require__(5);
var _chalk2 = _interopRequireDefault(_chalk);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var POINTER = '----> ';
var TAB = ' ';
function section(msg) {
console.log('\n\n\n' + _chalk2.default.black.bgGreen(POINTER + msg));
}
function info(msg) {
console.log('\n\n' + _chalk2.default.yellow(POINTER + msg));
}
function cmd(command) {
console.log('\n' + _chalk2.default.green('$ ' + command));
}
function status(item, icon) {
console.log(TAB + _chalk2.default.green(icon + ' ') + item);
}
function plain(msg) {
console.log(TAB + msg);
}
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setupProject = setupProject;
exports.setupDeploy = setupDeploy;
exports.npmInstall = npmInstall;
exports.gitRemote = gitRemote;
var _shelljs = __webpack_require__(8);
var _shelljs2 = _interopRequireDefault(_shelljs);
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
var _utils = __webpack_require__(15);
var utils = _interopRequireWildcard(_utils);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function setupProject() {
say.info('Setting up project...');
this.render('app/_package.json', 'package.json', { appName: this.appName, repoUrl: this.repoAppUrl });
this.copy('app/server.js', '.', 'server.js');
this.copy('app/server.app.js', '.', 'server.app.js');
this.copy('app/server.dev.js', '.', 'server.dev.js');
this.copy('app/server.hot.js', '.', 'server.hot.js');
_shelljs2.default.mkdir('-p', 'configs/build');
_shelljs2.default.mkdir('-p', 'configs/server');
this.render('app/configs/server/_server.base.js', 'configs/server/server.base.js', { name: this.name });
this.copy('app/configs/server/server.app.js', 'configs/server/', 'configs/server/server.app.js');
this.copy('app/configs/build/', 'configs/build/', 'configs/build');
this.copy('app/flyfile.js', '.', 'flyfile.js');
this.copy('app/.babelrc', '.', '.babelrc');
this.copy('app/.eslintrc', '.', '.eslintrc');
this.copy('app/.eslintignore', '.', '.eslintignore');
this.copy('app/.editorconfig', '.', '.editorconfig');
this.copy('app/app/', 'app/');
this.copy('app/middlewares/', 'middlewares/');
this.copy('app/scripts/', 'scripts/');
_shelljs2.default.chmod('-R', '700', 'scripts/*');
_shelljs2.default.mkdir('build/');
_shelljs2.default.mkdir('public/');
_shelljs2.default.mkdir('logs/');
}
function setupDeploy() {
say.info('Setting up deploy...');
_shelljs2.default.mkdir('-p', 'configs/deploy');
this.copy('app/configs/deploy/', 'configs/deploy/');
this.render('docs/app.rb', 'configs/deploy/docs/deploy.rb');
this.render('app/configs/_deploy_defaults.rb', 'configs/deploy/defaults.rb', { repo: this.repoAppSsh });
this.render('app/configs/_deploy.rb', 'configs/deploy/deploy.rb', { name: this.name });
}
function npmInstall() {
var deps = utils.latestifyDeps(this.npmDeps);
var devDeps = utils.latestifyDeps(this.npmDevDeps);
say.info('Installing dependencies...');
this.shellExec('npm install --save ' + deps);
this.shellExec('npm install --save-dev ' + devDeps);
this.shellExec('npm shrinkwrap --loglevel error');
}
function gitRemote() {
if (this.repoAppSsh) {
say.info('Configuring remote...');
this.shellExec('git remote add origin ' + this.repoAppSsh);
if (this.pushToRemote) {
say.info('Pushing to remote...');
this.shellExec('git push -u origin master');
}
}
}
/***/ },
/* 15 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bindToContext = bindToContext;
exports.latestifyDeps = latestifyDeps;
function bindToContext(context, methods) {
var binded = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = Object.keys(methods)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var method = _step.value;
binded[method] = methods[method].bind(context);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return binded;
}
function latestifyDeps(modules) {
return modules.map(function (module) {
return module.includes('@') ? module + '@latest' : module;
}).join(' ');
}
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prepareEnv = prepareEnv;
exports.createApp = createApp;
exports.editGemfile = editGemfile;
exports.installGems = installGems;
exports.editDBConfig = editDBConfig;
exports.createDB = createDB;
exports.editCore = editCore;
exports.setupDeploy = setupDeploy;
exports.setupTests = setupTests;
exports.setupAuth = setupAuth;
exports.gitRemote = gitRemote;
var _shelljs = __webpack_require__(8);
var _shelljs2 = _interopRequireDefault(_shelljs);
var _changeCase = __webpack_require__(7);
var _changeCase2 = _interopRequireDefault(_changeCase);
var _fs = __webpack_require__(17);
var _fs2 = _interopRequireDefault(_fs);
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function prepareEnv() {
say.info('Creating gemset...');
this.shellExec('rvm gemset create ' + this.name);
say.info('Installing `bundler` gem...');
this.rvmExec('gem install bundler --quiet');
// say.info('Installing `rails` gem...');
// this.rvmExec('gem install rails --quiet');
}
function createApp() {
say.info('Creating Rails app...');
var cmd = 'rails new ' + this.apiName;
var opts = ['--skip-sprockets', '--skip-bundle', '--quiet', '--database=postgresql'].join(' ');
this.rvmExec(cmd + ' ' + opts);
}
function editGemfile() {
say.info('Modifying Gemfile...');
this.render('api/_Gemfile', 'Gemfile', {
version: _fs2.default.readFileSync(_path2.default.resolve('Gemfile'), 'utf8').match(/gem 'rails', (.*)/i)[1]
});
}
function installGems() {
say.info('Installing gems...');
say.plain('This WILL take a while.');
this.rvmExec('bundle install --without production --quiet');
}
function editDBConfig() {
say.info('Modifying database config...');
this.render('api/config/_database.yml', 'config/database.yml', { app: _changeCase2.default.snake(this.apiName) });
}
function createDB() {
say.info('Creating databases...');
this.rvmExec('bundle exec rake db:create:all');
}
function editCore() {
say.info('Modifying core...');
this.injectInto('config/application.rb', 'class Application < Rails::Application', ' config.middleware.use Rack::Deflater');
this.render('api/lib/_api_constraints.rb', 'lib/api_constraints.rb', { name: this.name });
this.render('api/app/controllers/_application_controller.rb', 'app/controllers/application_controller.rb');
this.copy('api/app/controllers/api/', 'app/controllers/api/');
}
function setupDeploy() {
say.info('Setting up deploy...');
this.copy('api/lib/mina/', 'lib/mina/');
this.render('docs/api.rb', 'lib/mina/docs/deploy.rb');
this.render('api/lib/_deploy_defaults.rb', 'lib/mina/defaults.rb', { repo: this.repoApiSsh });
this.render('api/config/_deploy.rb', 'config/deploy.rb', { name: this.name });
this.render('api/config/_environment_variables.yml', 'config/environment_variables.yml');
this.copy('api/config/initializers/!environment_variables.rb', 'config/initializers/');
}
function setupTests() {
say.info('Setting up tests...');
this.rvmExec('rails g rspec:install');
_shelljs2.default.mkdir('-p', 'spec/routing');
_shelljs2.default.mkdir('-p', 'spec/support');
this.render('api/spec/routing/_api_constraints_spec.rb', 'spec/routing/api_constraints_spec.rb', { name: this.name });
this.render('api/spec/support/_request_helpers.rb', 'spec/support/request_helpers.rb', { name: this.name });
this.copy('api/spec/support/unauthorized_shared_examples.rb', 'spec/support/');
this.injectInto('spec/spec_helper.rb', 'RSpec.configure do |config|', 'api/spec/__spec_helper.rb', true);
}
function setupAuth() {
say.info('Setting up authentication...');
this.rvmExec('rails generate devise:install');
this.rvmExec('rails generate devise User');
this.injectInto('app/models/user.rb', ':recoverable, :rememberable, :trackable, :validatable', ' acts_as_token_authenticatable');
var migration = _fs2.default.readdirSync(this.destinationPath('db/migrate'))[0];
this.injectInto('db/migrate/' + migration, 't.string :encrypted_password, null: false, default: ""', ' t.string :authentication_token, null: false, default: ""');
this.injectInto('db/migrate/' + migration, 'add_index :users, :reset_password_token, unique: true', ' add_index :users, :authentication_token, unique: true');
this.rvmExec('rails generate serializer User');
this.copy('api/app/serializers/user_serializer.rb', 'app/serializers/');
this.injectInto('config/initializers/devise.rb', 'Devise.setup do |config|', " config.secret_key = ENV['DEVISE_SECRET_KEY'] if Rails.env.production?");
this.render('api/config/_routes.rb', 'config/routes.rb');
}
function gitRemote() {
if (this.repoApiSsh) {
say.info('Configuring remote...');
this.shellExec('git remote add origin ' + this.repoApiSsh);
if (this.pushToRemote) {
say.info('Pushing to remote...');
this.shellExec('git push -u origin master');
}
}
}
/***/ },
/* 17 */
/***/ function(module, exports) {
module.exports = require("fs");
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scaffoldRoots;
var _shelljs = __webpack_require__(8);
var _shelljs2 = _interopRequireDefault(_shelljs);
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scaffoldRoots() {
_shelljs2.default.mkdir('-p', this.name);
if (this.installApp) {
_shelljs2.default.mkdir('-p', _path2.default.join(this.name, this.appName));
}
if (this.installApi) {
_shelljs2.default.mkdir('-p', _path2.default.join(this.name, this.apiName));
}
}
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scaffoldFrontendApp;
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scaffoldFrontendApp() {
if (!this.installApp) return;
say.section('Scaffolding Frontend App...');
var frontendAppActions = this.frontendAppActions;
var commonActions = this.commonActions;
var frontendAppRoot = _path2.default.join(this.root, this.appName);
this.destinationRoot(frontendAppRoot);
frontendAppActions.setupProject();
commonActions.createRvmFiles();
commonActions.createGitignore();
frontendAppActions.setupDeploy();
frontendAppActions.npmInstall();
commonActions.gitInit();
frontendAppActions.gitRemote();
}
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = scaffoldRailsApi;
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function scaffoldRailsApi() {
if (!this.installApi) return;
say.section('Scaffolding Rails API...');
var railsApiActions = this.railsApiActions;
var commonActions = this.commonActions;
var railsApiRoot = _path2.default.join(this.root, this.apiName);
this.destinationRoot(this.root);
railsApiActions.prepareEnv();
railsApiActions.createApp();
this.destinationRoot(railsApiRoot);
commonActions.createRvmFiles();
commonActions.createGitignore();
railsApiActions.editGemfile();
railsApiActions.installGems();
railsApiActions.editDBConfig();
railsApiActions.createDB();
railsApiActions.editCore();
railsApiActions.setupDeploy();
railsApiActions.setupTests();
railsApiActions.setupAuth();
commonActions.gitInit();
railsApiActions.gitRemote();
}
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = allDone;
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function allDone() {
console.log('\n\n');
say.status('What else:', 'All done!');
if (this.installApp) {
say.section('Frontend App');
say.plain('- Check app configuration.');
say.plain('- Check deploy settings in `configs/deploy.rb` & `configs/deploy` folder.');
}
if (this.installApi) {
say.section('Rails Api');
say.plain('- Setup User:');
say.plain('---> Check User model: `app/models/user.rb`');
say.plain('---> Check User migration: `db/migrate/XXXXXXXXXXXXXX_devise_create_users.rb`');
say.plain('---> Migrate: `bundle exec rake db:migrate`');
say.plain('');
say.plain('- Check app configuration.');
say.plain('- Check deploy settings in `config/deploy.rb` & `lib/mina` folder.');
}
say.section('And...');
say.plain('Spin it up > Check logs > Fix errors > Have fun!');
console.log('\n\n');
}
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shellExec = shellExec;
exports.rvmExec = rvmExec;
exports.render = render;
exports.copy = copy;
exports.injectInto = injectInto;
var _fs = __webpack_require__(17);
var _fs2 = _interopRequireDefault(_fs);
var _path = __webpack_require__(9);
var _path2 = _interopRequireDefault(_path);
var _shelljs = __webpack_require__(8);
var _shelljs2 = _interopRequireDefault(_shelljs);
var _ejs = __webpack_require__(23);
var _ejs2 = _interopRequireDefault(_ejs);
var _say = __webpack_require__(13);
var say = _interopRequireWildcard(_say);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DONE = '✓ ';
var UTF8 = 'utf8';
function shellExec(cmd) {
say.cmd(cmd);
_shelljs2.default.exec(cmd);
console.log('Completed.');
}
function rvmExec(cmd) {
this.shellExec(this.rvmString + cmd);
}
function render(src, dest) {
var params = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var output = _ejs2.default.render(this.read(this.templatePath(src)), params);
_fs2.default.writeFileSync(this.destinationPath(dest), output);
say.status(dest, DONE);
}
function copy(src, dest, show) {
_shelljs2.default.cp('-Rf', this.templatePath(src), this.destinationPath(dest));
say.status(show || dest, DONE);
}
function injectInto(file, baseString, addString, readFromFile) {
var injectant = readFromFile ? _fs2.default.readFileSync(this.templatePath(addString)) : addString;
var content = _fs2.default.readFileSync(_path2.default.resolve(file), UTF8).replace(baseString + '\n', baseString + '\n\n' + injectant + '\n\n');
_fs2.default.writeFileSync(this.destinationPath(file), content);
say.status(file, DONE);
}
/***/ },
/* 23 */
/***/ function(module, exports) {
module.exports = require("ejs");
/***/ }
/******/ ]);
|
import React from "react";
// core components
import Paper from "@material-ui/core/Paper";
import Typography from "@material-ui/core/Typography";
import image from "../../../assets/img/avatar-default.jpg";
class UserCard extends React.Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillReceiveProps(newProps) {
this.setState(newProps.state);
}
render() {
const { classes, profile } = this.props;
return (
<Paper className={classes.paper} elevation={4}>
<img src={image} width="100%" alt="Profile" />
<Paper className={classes.innerPaper} elevation={0}>
<Typography className={classes.userName} align="center" variant="title">
{profile.fullname}
</Typography>
<Typography gutterBottom align="center" variant="body1">
{profile.username}
</Typography>
<Typography gutterBottom align="center" variant="subheading">
{profile.email}
</Typography>
<Typography gutterBottom align="center" variant="subheading">
{profile.phone}
</Typography>
<br />
</Paper>
</Paper>
);
}
}
export default (UserCard);
|
import { Component } from 'react';
import styled from 'styled-components/macro';
export default class BrandButton extends Component {
render() {
return (
<Container>
<Title>{this.props.children}</Title>
</Container>
);
}
}
const Container = styled.button`
display: flex;
align-items: center;
margin-right: 10px;
padding: 10px 20px;
background-color: white;
border-radius: 50px;
border: 1px solid #e9ebed;
color: #46464d;
`;
const Title = styled.div`
font-size: 19px;
font-weight: 400;
`;
|
module.exports = {
JoiSignIn: require("./JoiSignIn.js"),
JoiUpdateUser: require("./JoiUpdateUser"),
JoiSignUp: require("./JoiSignUp.js"),
JoiValidateTransactionListQuery: require("./JoiValidateTransactionListQuery"),
JoiAddUserTransaction: require("./JoiAddUserTransaction"),
};
|
import React, { Component } from "react";
import { StyleSheet, View, Text, Image, TouchableOpacity } from "react-native";
class ShareMain extends Component {
constructor({ props }) {
super(props);
}
render() {
return (
<View style={styles.container}>
<View style={styles.bodyView}>
<TouchableOpacity style={styles.btnStyle}
onPress={() => this.props.navigation.push('ShareStart')}
>
<Text style={styles.btnText}>
쉐어링 서비스 시작
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.btnStyle}
onPress={() => this.props.navigation.push('ShareMain')}
>
<Text style={styles.btnText}>
쉐어링 서비스 내역
</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.btnStyle}
onPress={() => this.props.navigation.push('ShareMain')}
>
<Text style={styles.btnText}>
쉐어링 서비스 등록
</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-end",
backgroundColor: "#f9e6e9"
},
bodyView: {
flex:1,
justifyContent: 'center',
alignItems: 'center'
},
btnStyle: {
borderWidth: 1,
borderColor: 'pink',
justifyContent: 'center',
alignItems: 'center',
width: '70%',
height: '8%',
marginBottom: '10%',
backgroundColor: 'white'
},
btnText: {
fontSize: 20,
},
})
export default ShareMain;
|
'use strict';
var express = require( 'express' );
var path = require( 'path' );
var bodyParser = require( 'body-parser' );
var cookieParser = require( 'cookie-parser' );
var fs = require( 'fs' );
var favicon = require( 'serve-favicon' );
var config = require( '../app/models/config-model' ).server;
var logger = require( 'morgan' );
var i18next = require( 'i18next' );
var I18nextBackend = require( 'i18next-node-fs-backend' );
var i18nextMiddleware = require( 'i18next-express-middleware' );
var compression = require( 'compression' );
var errorHandler = require( '../app/controllers/error-handler' );
var controllersPath = path.join( __dirname, '../app/controllers' );
var app = express();
var debug = require( 'debug' )( 'express' );
// general
for ( var item in config ) {
if ( Object.prototype.hasOwnProperty.call( config, item ) ) {
app.set( item, app.get( item ) || config[ item ] );
}
}
app.set( 'port', process.env.PORT || app.get( 'port' ) || 3000 );
app.set( 'env', process.env.NODE_ENV || 'production' );
app.set( 'authentication cookie name', '__enketo_' );
// views
app.set( 'views', path.resolve( __dirname, '../app/views' ) );
app.set( 'view engine', 'pug' );
// pretty json API responses
app.set( 'json spaces', 4 );
// setup i18next
i18next
.use( i18nextMiddleware.LanguageDetector )
.use( I18nextBackend )
.init( {
//debug: true, // DEBUG
whitelist: app.get( 'languages supported' ),
fallbackLng: 'en',
joinArrays: '\n',
backend: {
loadPath: path.resolve( __dirname, '../locales/build/__lng__/translation-combined.json' )
},
load: 'languageOnly',
lowerCaseLng: true,
detection: {
order: [ 'querystring', 'header' ],
lookupQuerystring: 'lang',
caches: false,
},
interpolation: {
prefix: '__',
suffix: '__'
}
} );
// middleware
app.use( compression() );
app.use( bodyParser.json( {
limit: config[ 'payload limit' ]
} ) );
app.use( bodyParser.urlencoded( {
limit: config[ 'payload limit' ],
extended: true
} ) );
app.use( cookieParser( app.get( 'encryption key' ) ) );
app.use( i18nextMiddleware.handle( i18next, {
/*ignoreRoutes: [ '/css', '/fonts', '/images', '/js' ]*/
} ) );
app.use( favicon( path.resolve( __dirname, '../public/images/favicon.ico' ) ) );
app.use( app.get( 'base path' ), express.static( path.resolve( __dirname, '../public' ) ) );
app.use( `${app.get( 'base path' )}/x`, express.static( path.resolve( __dirname, '../public' ) ) );
app.use( app.get( 'base path' ) + '/locales/build', express.static( path.resolve( __dirname, '../locales/build' ) ) );
app.use( `${app.get( 'base path' )}/x` + '/locales/build', express.static( path.resolve( __dirname, '../locales/build' ) ) );
// set variables that should be accessible in all view templates
app.use( function( req, res, next ) {
res.locals.livereload = req.app.get( 'env' ) === 'development';
res.locals.environment = req.app.get( 'env' );
res.locals.analytics = req.app.get( 'analytics' );
res.locals.googleAnalytics = {
ua: req.app.get( 'google' ).analytics.ua,
domain: req.app.get( 'google' ).analytics.domain || 'auto'
};
res.locals.piwikAnalytics = {
trackerUrl: req.app.get( 'piwik' ).analytics[ 'tracker url' ],
siteId: req.app.get( 'piwik' ).analytics[ 'site id' ]
};
res.locals.logo = req.app.get( 'logo' );
res.locals.defaultTheme = req.app.get( 'default theme' ).replace( 'theme-', '' ) || 'kobo';
res.locals.title = req.app.get( 'app name' );
res.locals.dir = function( lng ) {
return i18next.dir( lng );
};
res.locals.basePath = req.app.get( 'base path' );
res.locals.draftEnabled = !req.app.get( 'disable save as draft' );
next();
} );
// load controllers (including their routers)
fs.readdirSync( controllersPath ).forEach( function( file ) {
if ( file.indexOf( '-controller.js' ) >= 0 ) {
debug( 'loading', file );
require( controllersPath + '/' + file )( app );
}
} );
// logging
app.use( logger( ( app.get( 'env' ) === 'development' ? 'dev' : 'tiny' ) ) );
// error handlers
app.use( errorHandler[ '404' ] );
if ( app.get( 'env' ) === 'development' ) {
app.use( errorHandler.development );
} else {
app.use( errorHandler.production );
}
module.exports = app;
|
//Include this is a seprate JS file
//Provide client side input validation for login page(s)
$("#loginSubmitButton").click(function() {
var userID = $("#userIDinput").val();
var password = $("#userPasswordInput").val();
//TODO replace with function bools, no extra vars
var validUser = validateUserID(userID);
var validPass = validatePassword(password);
if (validUser == false || validPass == false)
{
event.preventDefault();
}
});
function validateUserID(userID)
{
//If blank
if (userID == "")
{
invalidUserID("User ID cannot be blank!");
return false;
}
//Check if userID contains the correct prefix
//Protect backend from buffer overflows (need to check length during backend implementation too)
var userPrefix = userID.substring(0,2);
if (!(userPrefix.match(/DB|BM|CM|CS|US|UE/g))||(userID.length > 15))
{
invalidUserID("Please Enter a Valid User ID. User IDs are case sensitive.");
return false;
}
//Valid userID
$("#userIDinput").removeClass("is-invalid").addClass("is-valid");
$("#invalidUserID").text("");
return true;
}
//Provide feedback from string input
function invalidUserID(errorString)
{
$("#userIDinput").addClass("is-invalid");
$("#invalidUserID").text(errorString);
}
//Make sure password isn't blank
function validatePassword(password)
{
if (password =="")
{
invalidPassword("Please Enter a password!");
return false;
}
//Valid password
$("#userPasswordInput").removeClass("is-invalid").addClass("is-valid");
$("#invalidPassword").text("");
return true;
}
//Provide feedback from string input
function invalidPassword(errorString)
{
$("#userPasswordInput").addClass("is-invalid");
$("#invalidPassword").text(errorString);
}
|
import layoutFragment from "../_fragments/layout/layout.fragment.js";
import videosListItemFragment from "../_fragments/videosListItem/videosListItem.fragment.js";
export default data => layoutFragment(
data,
{
title: 'VIDÉOS | ' + data.title,
content: `<div class="container">
<h1 class="main">
VIDÉOS</h1>
<p class="mb-5">
Index de mes vidéos sur YouTube</p>
<ul class="list-unstyled">
${
data.videos
.map(video =>
videosListItemFragment({ video }))
.join('')
}
</ul>
<h3>
Retour
<a href="/">HUB (accueil)</a>
</h3>
</div>`
})
|
import React from "react"
import Zoom from "react-medium-image-zoom"
import styles from "./ZoomedImage.module.scss"
import Image from "gatsby-image"
const ZoomedImage = ({ image, text }) => {
return (
<div className={styles.card_container}>
<Zoom>
<span className={styles.image_container}>
<Image fluid={image} className={styles.image} />
</span>
</Zoom>
{
text.length > 0 &&
<>
<div className={styles.image_layout_line} />
<p className={styles.image_layout_title}>{text}</p>
</>
}
</div>
)
}
export default ZoomedImage;
|
/**
* Created by a88u on 2016/10/17.
*/
var investTypeSelections=[
{text:"全部",value:"all",isSelected:true,isAll:true},
{text:"A轮",value:"A轮",isSelected:true,isAll:false},
{text:"B轮",value:"B轮",isSelected:true,isAll:false},
{text:"C轮",value:"C轮",isSelected:true,isAll:false},
{text:"D轮",value:"D轮",isSelected:true,isAll:false},
{text:"E轮",value:"E轮",isSelected:true,isAll:false},
{text:"天使轮",value:"天使轮",isSelected:true,isAll:false}
];
var exitTypeSelections=[
{text:"全部",value:"all",isSelected:true,isAll:true},
{text:"上市",value:"上市",isSelected:true,isAll:false},
{text:"收购",value:"收购",isSelected:true,isAll:false},
{text:"转让",value:"转让",isSelected:true,isAll:false},
{text:"清算",value:"清算",isSelected:true,isAll:false},
{text:"减持",value:"减持",isSelected:true,isAll:false},
{text:"分红",value:"分红",isSelected:true,isAll:false}
];
|
import { get } from 'lodash';
export default {
getPlugins: state => get(state, 'plugins', {}),
getRoleButtons: state => get(state, 'plugins.buttons', []),
};
|
/*
File: chart.js
Purpose: Contains methods that take create the visualizations in our app. This is done through use
of the c3 and d3 libraries, in conjunction with data that the last.fm API has fed into our database.
*/
function generateGauge(id){
var chart = c3.generate({
bindto: id,
data: {
columns: [
['data', 9.4]
],
type: 'gauge',
onclick: function (d, i) { console.log("onclick", d, i); },
onmouseover: function (d, i) { console.log("onmouseover", d, i); },
onmouseout: function (d, i) { console.log("onmouseout", d, i); }
},
gauge: {
// label: {
// format: function(value, ratio) {
// return value;
// },
// show: false // to turn off the min/max labels.
// },
// min: 0, // 0 is default, //can handle negative min e.g. vacuum / voltage / current flow / rate of change
// max: 100, // 100 is default
// units: ' %',
// width: 39 // for adjusting arc thickness
},
color: {
pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values.
threshold: {
// unit: 'value', // percentage is default
// max: 200, // 100 is default
values: [30, 60, 90, 100]
}
},
size: {
height: 180
}
});
return chart;
}
function loadGauge(chart, data){
setTimeout(function () {
chart.unload({
ids: 'data'
});
}, 500);
chart.load({
columns: [['Music Compatibility', data]]
});
}
function loadPieChart(chart, data){
let columns = [];
for(genre in data){
let category = [];
category.push(genre);
let songs = data[genre];
for(song in songs){
category.push(Number.parseInt(songs[song].playcount, 10));
}
columns.push(category);
}
chart.load({
columns: columns
});
}
function pieChartOnClick(data){
}
|
import React, { useMemo, useRef, useCallback, useEffect } from 'react'
import { geoMercator, geoPath } from 'd3';
import { feature } from 'topojson-client';
import { useThree, useFrame, Dom } from 'react-three-fiber';
import { a, useSpring, interpolate } from 'react-spring/three';
import { pick } from 'canvas-sketch-util/random';
import { mapRange } from 'canvas-sketch-util/math';
import { createCanvas } from './utlis';
import { PIXEL_RATIO, SCROLL_VIEW_HEIGHT, SCROLL_VIEW_WIDTH, WIDTH, WIDTH_BY_PIXEL_RATIO, COLOR } from './constants';
import { maps as mapsData } from './maps/index.js';
import { maps, order, w0, w1, totalBahasa } from './data';
import Title from './Title';
function Painting({ maps, mapsKey, total, ...props }) {
const canvas = useMemo(() => {
const height = WIDTH * 1.4;
const width = WIDTH;
const canvas = createCanvas(width, height);
const context = canvas.getContext('2d');
const w = width * PIXEL_RATIO;
const h = height * PIXEL_RATIO;
context.beginPath();
context.fillStyle = props.color;
context.fillRect(0, h * 0.85, w, h * 0.15);
context.beginPath();
context.strokeStyle = props.color;
context.lineWidth = 30;
context.strokeRect(0, 0, w, h);
const font = `bold 120px -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif`;
context.font = font;
context.fillStyle = "white";
context.fillText(mapsKey.toUpperCase().split("-").join(" "), w * 0.05, h * 0.925);
const font1 = `100px -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, ubuntu, roboto, noto, segoe ui, arial, sans-serif`;
context.font = font1;
context.fillStyle = "white";
context.textBaseline = "middle";
context.fillText(`${total} bahasa`, w * 0.05, h * 0.96);
return canvas;
}, [mapsKey, total, props.color]);
const mapCanvas = useMemo(() => {
const width = window.innerWidth;
const canvas = createCanvas(width, width);
const context = canvas.getContext('2d');
const w = width * PIXEL_RATIO;
const f = feature(maps, maps.objects[mapsKey]);
const projection = geoMercator().fitSize([w, w], f);
const path = geoPath(projection, context);
context.beginPath();
context.fillStyle = props.color;
path(f);
context.fill();
return canvas;
}, [maps, mapsKey, props.color]);
const ref = useRef();
const [{ x, y }, set] = useSpring(() => ({
x: 0,
y: 0,
}));
useFrame(({ mouse }) => {
set({ x: mouse.x, y: mouse.y });
});
const dX = pick([1, -1]);
const dY = pick([1, -1]);
return (
<group position={props.position}>
<mesh onClick={props.onClick} renderOrder={props.order} >
<meshBasicMaterial attach="material" depthTest={false}>
<canvasTexture attach="map" image={canvas} />
</meshBasicMaterial>
<planeBufferGeometry attach="geometry" args={[1, 1.4, 1]} />
</mesh>
<a.mesh
renderOrder={props.order}
ref={ref}
position={interpolate([x, y], (x, y) => [x * 0.03 * dX, (y * -0.03 * dY) + 0.1, 0])}
>
<meshBasicMaterial attach="material" depthTest={false}>
<canvasTexture attach="map" image={mapCanvas} />
</meshBasicMaterial>
<planeBufferGeometry attach="geometry" args={[0.8, 0.8, 0]} />
</a.mesh>
</group>
);
}
function Text({ left }) {
const { viewport: { width: vw, height: vh } } = useThree();
return (
<a.group
position={left.interpolate((l) => {
const x = mapRange(l, 0, WIDTH * 0.5, vw * -0.5, -vw);
return [x, vh * 0.5, 0];
})}
>
<Dom>
<Title />
</Dom>
</a.group>
)
}
function Control({ onClick }) {
const { viewport: { width, height } } = useThree();
const s = 0.8;
const canvas = useMemo(() => {
const canvas = createCanvas(WIDTH, WIDTH);
const context = canvas.getContext('2d');
const w = WIDTH_BY_PIXEL_RATIO;
context.beginPath();
context.lineWidth = w * 0.05;
context.strokeStyle = COLOR;
context.arc(w * 0.5, w * 0.5, w * 0.3, 0, Math.PI * 2);
context.stroke();
context.beginPath();
context.lineWidth = w * 0.2;
context.strokeStyle = COLOR;
context.arc(w * 0.5, w * 0.5, w * 0.1, 0, Math.PI * 2);
context.stroke();
return canvas;
}, []);
return (
<mesh scale={[s, s, s]} position={[width * 0.46, height * -0.45, 0]} onClick={onClick}>
<meshBasicMaterial attach="material" transparent>
<canvasTexture attach="map" image={canvas} />
</meshBasicMaterial>
<planeBufferGeometry attach="geometry" args={[1, 1, 1]} />
</mesh>
)
}
function Gallery({ top, left, setScroll, setLocation, setTooltip, setGalleryPosition, galleryPositionY }) {
const positionRef = useRef(null);
const activeRef = useRef(false);
const [{ y }, set] = useSpring(() => ({
to: {
y: 0,
}
}));
const onClick = useCallback((position) => {
return () => {
const [p, c] = position;
let [x, y, z, key] = c;
const zScroll = mapRange((z - 3.7) * -1, 0, 7, 0, SCROLL_VIEW_HEIGHT);
const xScroll = mapRange(p[0] + x, w0, w1, 0, SCROLL_VIEW_WIDTH);
y = y * -1;
if (positionRef.current === position && activeRef.current) {
set({
y: 0,
});
setGalleryPosition([xScroll, zScroll]);
galleryPositionY.current = y;
setScroll(xScroll, 0);
setTooltip(false);
activeRef.current = false;
setLocation(key);
} else {
setTooltip(true);
setScroll(xScroll, zScroll);
set({ y });
activeRef.current = true;
}
positionRef.current = position;
}
}, [set, setGalleryPosition, galleryPositionY, setScroll, setTooltip, setLocation]);
const zoomOut = useCallback(() => {
if (activeRef.current) {
const [p, c] = positionRef.current;
const xScroll = mapRange(p[0] + c[0], w0, w1, 0, SCROLL_VIEW_WIDTH);
setScroll(xScroll, 0);
}
set({
y: 0
});
setTooltip(false);
activeRef.current = false;
}, [set, setScroll, setTooltip]);
useEffect(() => {
if (galleryPositionY.current !== null) {
set({
y: galleryPositionY.current
})
galleryPositionY.current = null;
}
}, [galleryPositionY, set]);
return (
<group>
<Text left={left} />
<a.group
position={interpolate([left, top, y], (l, t, y) => {
const x = mapRange(l, 0, SCROLL_VIEW_WIDTH, w1, w0);
const z = mapRange(t, 0, SCROLL_VIEW_HEIGHT, 0, 7);
return [x, y, z];
})}
>
{maps.map((d, i) => {
return (
<group key={i} position={d.parent}>
{d.child.map((c, j) => {
const [x, y, z, mapsKey, color] = c;
return (
<Painting
key={mapsKey}
position={[x, y, z]}
onClick={onClick([d.parent, c])}
color={color}
maps={mapsData[mapsKey]}
mapsKey={mapsKey}
order={order[mapsKey]}
total={totalBahasa[mapsKey]}
/>
)
}
)}
</group>
)
})}
</a.group>
<Control onClick={zoomOut} />
</group>
)
}
export default Gallery;
|
export default {
template: `
<div>
首页
</div>
`
}
|
Grailbird.data.tweets_2014_12 =
[ {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/549878788813631489\/photo\/1",
"indices" : [ 56, 78 ],
"url" : "http:\/\/t.co\/C7ZGAdP5nB",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B6GP1_nCMAAjHbk.png",
"id_str" : "549878787286904832",
"id" : 549878787286904832,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B6GP1_nCMAAjHbk.png",
"sizes" : [ {
"h" : 457,
"resize" : "fit",
"w" : 847
}, {
"h" : 457,
"resize" : "fit",
"w" : 847
}, {
"h" : 323,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 183,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/C7ZGAdP5nB"
} ],
"hashtags" : [ {
"text" : "ramdajs",
"indices" : [ 17, 25 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "549878788813631489",
"text" : "First time using #ramdajs createMapEntry(). I like it. http:\/\/t.co\/C7ZGAdP5nB",
"id" : 549878788813631489,
"created_at" : "2014-12-30 10:44:54 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Gleb Bahmutov",
"screen_name" : "bahmutov",
"indices" : [ 0, 9 ],
"id_str" : "30477646",
"id" : 30477646
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "549779623190732800",
"geo" : { },
"id_str" : "549780635695337474",
"in_reply_to_user_id" : 30477646,
"text" : "@bahmutov How strange, considering Node is built on V8. I also don't know why Chrome is so particular about the calling context.",
"id" : 549780635695337474,
"in_reply_to_status_id" : 549779623190732800,
"created_at" : "2014-12-30 04:14:52 +0000",
"in_reply_to_screen_name" : "bahmutov",
"in_reply_to_user_id_str" : "30477646",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Gleb Bahmutov",
"screen_name" : "bahmutov",
"indices" : [ 0, 9 ],
"id_str" : "30477646",
"id" : 30477646
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "549776307316617216",
"geo" : { },
"id_str" : "549778811919687680",
"in_reply_to_user_id" : 30477646,
"text" : "@bahmutov Are you using Chrome?\n\n_.times(5,console.log) \/\/TypeError: Illegal invocation\n_.times(5,console.log.bind(console))",
"id" : 549778811919687680,
"in_reply_to_status_id" : 549776307316617216,
"created_at" : "2014-12-30 04:07:37 +0000",
"in_reply_to_screen_name" : "bahmutov",
"in_reply_to_user_id_str" : "30477646",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "549511979287580673",
"text" : "I thought of something, and now it hurts my brain.",
"id" : 549511979287580673,
"created_at" : "2014-12-29 10:27:19 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "javascript",
"indices" : [ 39, 50 ]
} ],
"urls" : [ {
"indices" : [ 16, 38 ],
"url" : "http:\/\/t.co\/mWmy4nTtwa",
"expanded_url" : "http:\/\/jlongster.com\/Writing-Your-First-Sweet.js-Macro",
"display_url" : "jlongster.com\/Writing-Your-F\u2026"
} ]
},
"geo" : { },
"id_str" : "549488864398544896",
"text" : "This is insane: http:\/\/t.co\/mWmy4nTtwa #javascript",
"id" : 549488864398544896,
"created_at" : "2014-12-29 08:55:28 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "549348285212000257",
"text" : "log = console.log.bind(console)\nfiles.fetch(\u007B data: offset: 5, limit: 0 \u007D)\n .then(R.get('result'))\n .then(R.pluck('file_id'))\n .then(log)",
"id" : 549348285212000257,
"created_at" : "2014-12-28 23:36:52 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Chevy Ray",
"screen_name" : "ChevyRay",
"indices" : [ 0, 9 ],
"id_str" : "55472734",
"id" : 55472734
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 91, 113 ],
"url" : "http:\/\/t.co\/glUm3OgHAb",
"expanded_url" : "http:\/\/www.newyorker.com\/magazine\/2011\/04\/25\/the-possibilian",
"display_url" : "newyorker.com\/magazine\/2011\/\u2026"
} ]
},
"in_reply_to_status_id_str" : "549289819474370561",
"geo" : { },
"id_str" : "549290357393874944",
"in_reply_to_user_id" : 16025792,
"text" : "@ChevyRay \nAn investigation into \"time slowing down\" during trauma by a bizarre profressor http:\/\/t.co\/glUm3OgHAb",
"id" : 549290357393874944,
"in_reply_to_status_id" : 549289819474370561,
"created_at" : "2014-12-28 19:46:41 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Chevy Ray",
"screen_name" : "ChevyRay",
"indices" : [ 0, 9 ],
"id_str" : "55472734",
"id" : 55472734
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 50, 72 ],
"url" : "http:\/\/t.co\/KN2FGw4QsH",
"expanded_url" : "http:\/\/blog.brendanvance.com\/2014\/07\/16\/usurpers\/",
"display_url" : "blog.brendanvance.com\/2014\/07\/16\/usu\u2026"
}, {
"indices" : [ 116, 138 ],
"url" : "http:\/\/t.co\/eryANAb4s7",
"expanded_url" : "http:\/\/www.newyorker.com\/magazine\/2012\/12\/24\/utopian-for-beginners?currentPage=all",
"display_url" : "newyorker.com\/magazine\/2012\/\u2026"
} ]
},
"in_reply_to_status_id_str" : "549286685259751424",
"geo" : { },
"id_str" : "549289819474370561",
"in_reply_to_user_id" : 55472734,
"text" : "@ChevyRay \nEffects of 'content', changing meaning\nhttp:\/\/t.co\/KN2FGw4QsH\n\nA designed language with precise meaning:\nhttp:\/\/t.co\/eryANAb4s7",
"id" : 549289819474370561,
"in_reply_to_status_id" : 549286685259751424,
"created_at" : "2014-12-28 19:44:32 +0000",
"in_reply_to_screen_name" : "ChevyRay",
"in_reply_to_user_id_str" : "55472734",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "549182633268088834",
"text" : "I gave Far Cry 3 another chance. Still meh about it",
"id" : 549182633268088834,
"created_at" : "2014-12-28 12:38:37 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 32, 38 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "549103733498327040",
"text" : "Unity load times are ridiculous #ldjam",
"id" : 549103733498327040,
"created_at" : "2014-12-28 07:25:06 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Robert Forbes",
"screen_name" : "PartyCoffee",
"indices" : [ 0, 12 ],
"id_str" : "273819574",
"id" : 273819574
}, {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"indices" : [ 13, 26 ],
"id_str" : "486414259",
"id" : 486414259
} ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 60, 66 ]
} ],
"urls" : [ {
"indices" : [ 86, 109 ],
"url" : "https:\/\/t.co\/YctUXFsvJ1",
"expanded_url" : "https:\/\/dl.dropboxusercontent.com\/u\/132594400\/Silk\/Desktop.html",
"display_url" : "dl.dropboxusercontent.com\/u\/132594400\/Si\u2026"
} ]
},
"geo" : { },
"id_str" : "546086815472439300",
"in_reply_to_user_id" : 273819574,
"text" : "@PartyCoffee @doktorgoogle \nI think you both may enjoy this #ldjam game: Zen Garden\n\n https:\/\/t.co\/YctUXFsvJ1",
"id" : 546086815472439300,
"created_at" : "2014-12-19 23:36:57 +0000",
"in_reply_to_screen_name" : "PartyCoffee",
"in_reply_to_user_id_str" : "273819574",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 26, 48 ],
"url" : "http:\/\/t.co\/LMvjdRYyVV",
"expanded_url" : "http:\/\/excaliburjs.com\/sweep\/?utm_source=original-site&utm_medium=banner&utm_campaign=Original%20Site%20Banner",
"display_url" : "excaliburjs.com\/sweep\/?utm_sou\u2026"
} ]
},
"geo" : { },
"id_str" : "545802192800608256",
"text" : "Great little puzzle game, http:\/\/t.co\/LMvjdRYyVV",
"id" : 545802192800608256,
"created_at" : "2014-12-19 04:45:57 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 21, 27 ]
} ],
"urls" : [ {
"indices" : [ 28, 50 ],
"url" : "http:\/\/t.co\/DZovHEbbEV",
"expanded_url" : "http:\/\/www.brianmacintosh.com\/projects\/ld31\/",
"display_url" : "brianmacintosh.com\/projects\/ld31\/"
} ]
},
"geo" : { },
"id_str" : "545799629523017728",
"text" : "This was interesting #ldjam http:\/\/t.co\/DZovHEbbEV",
"id" : 545799629523017728,
"created_at" : "2014-12-19 04:35:46 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"indices" : [ 0, 13 ],
"id_str" : "486414259",
"id" : 486414259
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "545489355674902528",
"geo" : { },
"id_str" : "545521249946849280",
"in_reply_to_user_id" : 486414259,
"text" : "@doktorgoogle Yes, yes it was.",
"id" : 545521249946849280,
"in_reply_to_status_id" : 545489355674902528,
"created_at" : "2014-12-18 10:09:35 +0000",
"in_reply_to_screen_name" : "doktorgoogle",
"in_reply_to_user_id_str" : "486414259",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 44, 50 ]
} ],
"urls" : [ {
"indices" : [ 21, 43 ],
"url" : "http:\/\/t.co\/QJACrfmdz8",
"expanded_url" : "http:\/\/feiss.be\/ld31\/",
"display_url" : "feiss.be\/ld31\/"
} ]
},
"geo" : { },
"id_str" : "545435859126730752",
"text" : "This is astonishing: http:\/\/t.co\/QJACrfmdz8 #ldjam",
"id" : 545435859126730752,
"created_at" : "2014-12-18 04:30:17 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "545141300165484544",
"text" : "Just when I was about to give up on installing Zombie I found \n\nnpm cache clean\n\nWorks now!",
"id" : 545141300165484544,
"created_at" : "2014-12-17 08:59:48 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "545129248462086144",
"text" : "Now I'm gonna try some scraping.",
"id" : 545129248462086144,
"created_at" : "2014-12-17 08:11:55 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "545128656746446848",
"text" : "Wrote a cool utility to sort files on your desktop\/downloads etc, obviously pretty scary program to write, so doing lots of testing.",
"id" : 545128656746446848,
"created_at" : "2014-12-17 08:09:34 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "545083009729191936",
"text" : "Xbox Music removes free 10hrs\/month streaming, I open Youtube. Your move Microsoft.",
"id" : 545083009729191936,
"created_at" : "2014-12-17 05:08:11 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"indices" : [ 0, 15 ],
"id_str" : "16025792",
"id" : 16025792
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/544708472969777152\/photo\/1",
"indices" : [ 50, 72 ],
"url" : "http:\/\/t.co\/25RjBUtiCW",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B48xeAPCYAItFNj.png",
"id_str" : "544708471464026114",
"id" : 544708471464026114,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B48xeAPCYAItFNj.png",
"sizes" : [ {
"h" : 564,
"resize" : "fit",
"w" : 250
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 564,
"resize" : "fit",
"w" : 250
}, {
"h" : 564,
"resize" : "fit",
"w" : 250
}, {
"h" : 564,
"resize" : "fit",
"w" : 250
} ],
"display_url" : "pic.twitter.com\/25RjBUtiCW"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "544708207495507968",
"geo" : { },
"id_str" : "544708472969777152",
"in_reply_to_user_id" : 16025792,
"text" : "@james_a_forbes And here is the generated struct. http:\/\/t.co\/25RjBUtiCW",
"id" : 544708472969777152,
"in_reply_to_status_id" : 544708207495507968,
"created_at" : "2014-12-16 04:19:54 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/544708207495507968\/photo\/1",
"indices" : [ 114, 136 ],
"url" : "http:\/\/t.co\/LCBrrd5HC8",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B48xOjRCYAEvDTg.png",
"id_str" : "544708205989748737",
"id" : 544708205989748737,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B48xOjRCYAEvDTg.png",
"sizes" : [ {
"h" : 896,
"resize" : "fit",
"w" : 561
}, {
"h" : 896,
"resize" : "fit",
"w" : 561
}, {
"h" : 543,
"resize" : "fit",
"w" : 340
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 896,
"resize" : "fit",
"w" : 561
} ],
"display_url" : "pic.twitter.com\/LCBrrd5HC8"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "544708207495507968",
"text" : "Today has been all about promises. Coverts JSON to C structures, then compiles, executes & tests the struct. http:\/\/t.co\/LCBrrd5HC8",
"id" : 544708207495507968,
"created_at" : "2014-12-16 04:18:51 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "sophie xie",
"screen_name" : "puffins",
"indices" : [ 3, 11 ],
"id_str" : "14330980",
"id" : 14330980
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "544414606748180480",
"text" : "RT @puffins: scrolling tweets is the new thumbing the rosary",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003ETwitter for iPhone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540443858291523584",
"text" : "scrolling tweets is the new thumbing the rosary",
"id" : 540443858291523584,
"created_at" : "2014-12-04 09:53:51 +0000",
"user" : {
"name" : "sophie xie",
"screen_name" : "puffins",
"protected" : false,
"id_str" : "14330980",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/557793253550870528\/tD5Lsk54_normal.png",
"id" : 14330980,
"verified" : false
}
},
"id" : 544414606748180480,
"created_at" : "2014-12-15 08:52:11 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "544298965626130432",
"text" : "Structs you guysth. Structs.",
"id" : 544298965626130432,
"created_at" : "2014-12-15 01:12:40 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543920751892373504",
"text" : "I'm really enjoying C. There isn't a lot of ceremony, you have finer control and speed. And so far, no foot has been shot.",
"id" : 543920751892373504,
"created_at" : "2014-12-14 00:09:47 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543737805604548608",
"text" : "I just OD'd on cheese and Parks and Recreation. It was the blurst of times.",
"id" : 543737805604548608,
"created_at" : "2014-12-13 12:02:49 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543658614821355520",
"text" : "I tolerate people who say they are tolerant.",
"id" : 543658614821355520,
"created_at" : "2014-12-13 06:48:09 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543554957014618112",
"text" : "I'm thinking of trying Promises next. As that could actually be quite viable.\nOr possible faking closures with some kind of virtual memory",
"id" : 543554957014618112,
"created_at" : "2014-12-12 23:56:15 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 112, 135 ],
"url" : "https:\/\/t.co\/zpbXPvgnrh",
"expanded_url" : "https:\/\/gist.github.com\/JAForbes\/a6458a00845f3338fee7#file-callback_closures-c",
"display_url" : "gist.github.com\/JAForbes\/a6458\u2026"
} ]
},
"geo" : { },
"id_str" : "543554750008926208",
"text" : "Turns out C deletes the closure whenever you move up the stack. So the next (awkward) experiment is callbacks.\nhttps:\/\/t.co\/zpbXPvgnrh",
"id" : 543554750008926208,
"created_at" : "2014-12-12 23:55:25 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 46, 69 ],
"url" : "https:\/\/t.co\/RpdwfXpbkE",
"expanded_url" : "https:\/\/gist.github.com\/JAForbes\/a6458a00845f3338fee7",
"display_url" : "gist.github.com\/JAForbes\/a6458\u2026"
} ]
},
"geo" : { },
"id_str" : "543411237522898946",
"text" : "Mapping over an array and closures in C (gcc)\nhttps:\/\/t.co\/RpdwfXpbkE\n\nPretty excited!",
"id" : 543411237522898946,
"created_at" : "2014-12-12 14:25:09 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543389143745560578",
"text" : "I'm accepting functions as functions and returning functions from functions in C!",
"id" : 543389143745560578,
"created_at" : "2014-12-12 12:57:22 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543366661852520448",
"text" : "I have no idea what I am doing! But you can totally map over a list with a custom visitor function in C. It isn't even hard...",
"id" : 543366661852520448,
"created_at" : "2014-12-12 11:28:02 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543347630844043264",
"text" : "Kind of blown away that C can't return complex types. Is it possible to map over an array in C? I've got a few misguided ideas.",
"id" : 543347630844043264,
"created_at" : "2014-12-12 10:12:24 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543311801123737600",
"text" : "Sometimes, when I get to jam in a room, and I feel like no else is listening, and I can take chances and explore. There is nothing like it.",
"id" : 543311801123737600,
"created_at" : "2014-12-12 07:50:02 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Tim Shorrock",
"screen_name" : "TimothyS",
"indices" : [ 3, 12 ],
"id_str" : "15818978",
"id" : 15818978
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/TimothyS\/status\/543144152708698114\/photo\/1",
"indices" : [ 73, 95 ],
"url" : "http:\/\/t.co\/s3qOnqOC2z",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4miuqhIUAAoz4S.jpg",
"id_str" : "543144152645783552",
"id" : 543144152645783552,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4miuqhIUAAoz4S.jpg",
"sizes" : [ {
"h" : 340,
"resize" : "fit",
"w" : 340
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
} ],
"display_url" : "pic.twitter.com\/s3qOnqOC2z"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543175443617021952",
"text" : "RT @TimothyS: Incredible event taking place on the steps of the Capitol. http:\/\/t.co\/s3qOnqOC2z",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/www.apple.com\" rel=\"nofollow\"\u003EiOS\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/TimothyS\/status\/543144152708698114\/photo\/1",
"indices" : [ 59, 81 ],
"url" : "http:\/\/t.co\/s3qOnqOC2z",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4miuqhIUAAoz4S.jpg",
"id_str" : "543144152645783552",
"id" : 543144152645783552,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4miuqhIUAAoz4S.jpg",
"sizes" : [ {
"h" : 340,
"resize" : "fit",
"w" : 340
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
}, {
"h" : 450,
"resize" : "fit",
"w" : 450
} ],
"display_url" : "pic.twitter.com\/s3qOnqOC2z"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "543144152708698114",
"text" : "Incredible event taking place on the steps of the Capitol. http:\/\/t.co\/s3qOnqOC2z",
"id" : 543144152708698114,
"created_at" : "2014-12-11 20:43:51 +0000",
"user" : {
"name" : "Tim Shorrock",
"screen_name" : "TimothyS",
"protected" : false,
"id_str" : "15818978",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/575140535008030720\/L-3W6dpo_normal.jpeg",
"id" : 15818978,
"verified" : false
}
},
"id" : 543175443617021952,
"created_at" : "2014-12-11 22:48:12 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Michael Boyd ",
"screen_name" : "MichaelBoyd_23",
"indices" : [ 0, 15 ],
"id_str" : "513728466",
"id" : 513728466
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "542821586219184128",
"geo" : { },
"id_str" : "542822193747337216",
"in_reply_to_user_id" : 513728466,
"text" : "@MichaelBoyd_23 Exactly! \"My client has an exciting new programming role! My client is a leader in their respective field. Apply today!\"",
"id" : 542822193747337216,
"in_reply_to_status_id" : 542821586219184128,
"created_at" : "2014-12-10 23:24:30 +0000",
"in_reply_to_screen_name" : "MichaelBoyd_23",
"in_reply_to_user_id_str" : "513728466",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "bronwyn agrios",
"screen_name" : "bronwynagrios",
"indices" : [ 3, 17 ],
"id_str" : "266373252",
"id" : 266373252
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/bronwynagrios\/status\/542774380330119168\/photo\/1",
"indices" : [ 139, 140 ],
"url" : "http:\/\/t.co\/qOAkmNpulT",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4hSbDQCAAAx568.png",
"id_str" : "542774379780636672",
"id" : 542774379780636672,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4hSbDQCAAAx568.png",
"sizes" : [ {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 431,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/qOAkmNpulT"
} ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 109, 132 ],
"url" : "https:\/\/t.co\/JUh0S05mbS",
"expanded_url" : "https:\/\/medium.com\/@3fingeredfox\/margaret-hamilton-lead-software-engineer-project-apollo-158754170da8",
"display_url" : "medium.com\/@3fingeredfox\/\u2026"
} ]
},
"geo" : { },
"id_str" : "542821210120151040",
"text" : "RT @bronwynagrios: Margaret Hamilton, lead software engineer, Project Apollo. Showing offer her source code. https:\/\/t.co\/JUh0S05mbS http:\/\u2026",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/bronwynagrios\/status\/542774380330119168\/photo\/1",
"indices" : [ 114, 136 ],
"url" : "http:\/\/t.co\/qOAkmNpulT",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4hSbDQCAAAx568.png",
"id_str" : "542774379780636672",
"id" : 542774379780636672,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4hSbDQCAAAx568.png",
"sizes" : [ {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 719,
"resize" : "fit",
"w" : 566
}, {
"h" : 431,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/qOAkmNpulT"
} ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 90, 113 ],
"url" : "https:\/\/t.co\/JUh0S05mbS",
"expanded_url" : "https:\/\/medium.com\/@3fingeredfox\/margaret-hamilton-lead-software-engineer-project-apollo-158754170da8",
"display_url" : "medium.com\/@3fingeredfox\/\u2026"
} ]
},
"geo" : { },
"id_str" : "542774380330119168",
"text" : "Margaret Hamilton, lead software engineer, Project Apollo. Showing offer her source code. https:\/\/t.co\/JUh0S05mbS http:\/\/t.co\/qOAkmNpulT",
"id" : 542774380330119168,
"created_at" : "2014-12-10 20:14:31 +0000",
"user" : {
"name" : "bronwyn agrios",
"screen_name" : "bronwynagrios",
"protected" : false,
"id_str" : "266373252",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/3022684110\/415ea6d0113060ed8597bd6c064504ea_normal.jpeg",
"id" : 266373252,
"verified" : false
}
},
"id" : 542821210120151040,
"created_at" : "2014-12-10 23:20:36 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Michael Boyd ",
"screen_name" : "MichaelBoyd_23",
"indices" : [ 0, 15 ],
"id_str" : "513728466",
"id" : 513728466
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "542813782926323712",
"geo" : { },
"id_str" : "542820557004099584",
"in_reply_to_user_id" : 513728466,
"text" : "@MichaelBoyd_23 Appreciate the level of detail in the description of the role and the company. So many descriptions are beyond vague.",
"id" : 542820557004099584,
"in_reply_to_status_id" : 542813782926323712,
"created_at" : "2014-12-10 23:18:00 +0000",
"in_reply_to_screen_name" : "MichaelBoyd_23",
"in_reply_to_user_id_str" : "513728466",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Mike Kasprzak\u2122",
"screen_name" : "mikekasprzak",
"indices" : [ 118, 131 ],
"id_str" : "14368555",
"id" : 14368555
} ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 49, 55 ]
} ],
"urls" : [ {
"indices" : [ 56, 78 ],
"url" : "http:\/\/t.co\/yBdv31YoGV",
"expanded_url" : "http:\/\/ludumdare.com\/compo\/ludum-dare-31\/?action=preview&uid=6228",
"display_url" : "ludumdare.com\/compo\/ludum-da\u2026"
} ]
},
"geo" : { },
"id_str" : "542628282319912960",
"text" : "I've now got Terra embedded on the rating page. #ldjam\nhttp:\/\/t.co\/yBdv31YoGV\n\nWhich is an awesome addition thankyou @mikekasprzak :)",
"id" : 542628282319912960,
"created_at" : "2014-12-10 10:33:58 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 0, 6 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542621893589614593",
"text" : "#ldjam Tomorrow I'll rate a bunch of games! Super excited!",
"id" : 542621893589614593,
"created_at" : "2014-12-10 10:08:35 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 130, 136 ]
} ],
"urls" : [ {
"indices" : [ 44, 66 ],
"url" : "http:\/\/t.co\/yBdv31YoGV",
"expanded_url" : "http:\/\/ludumdare.com\/compo\/ludum-dare-31\/?action=preview&uid=6228",
"display_url" : "ludumdare.com\/compo\/ludum-da\u2026"
} ]
},
"geo" : { },
"id_str" : "542621799352004609",
"text" : "Sweet! You can now play Terra on the iPad!\nhttp:\/\/t.co\/yBdv31YoGV\nIf anyone tries it out on their smart phone, I'd love to know!\n#ldjam",
"id" : 542621799352004609,
"created_at" : "2014-12-10 10:08:13 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Joss Whedon",
"screen_name" : "josswhedon",
"indices" : [ 3, 14 ],
"id_str" : "1424700757",
"id" : 1424700757
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542604943866093570",
"text" : "RT @josswhedon: I don't care about Oscars. But my next project, \"Mecha-Keanu vs Gun-Bot from Planet Titties: A Christmas Miracle\" means the\u2026",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003ETwitter for iPhone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542576071145566210",
"text" : "I don't care about Oscars. But my next project, \"Mecha-Keanu vs Gun-Bot from Planet Titties: A Christmas Miracle\" means they're all mine",
"id" : 542576071145566210,
"created_at" : "2014-12-10 07:06:30 +0000",
"user" : {
"name" : "Joss Whedon",
"screen_name" : "josswhedon",
"protected" : false,
"id_str" : "1424700757",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/474662671821074432\/N2wjSlKc_normal.jpeg",
"id" : 1424700757,
"verified" : true
}
},
"id" : 542604943866093570,
"created_at" : "2014-12-10 09:01:14 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "542582672258629633",
"geo" : { },
"id_str" : "542604133824335872",
"in_reply_to_user_id" : 16025792,
"text" : "Ended up just dropping the res of the images. I thought, once loaded, the cache would take care of it. But I guess not.",
"id" : 542604133824335872,
"in_reply_to_status_id" : 542582672258629633,
"created_at" : "2014-12-10 08:58:01 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"indices" : [ 0, 15 ],
"id_str" : "16025792",
"id" : 16025792
} ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 122, 128 ]
} ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "542582672258629633",
"geo" : { },
"id_str" : "542588070118187008",
"in_reply_to_user_id" : 16025792,
"text" : "@james_a_forbes Strange, that using css positioning is pretty damn fast on the iPad, but context.drawImage is horrendous. #ldjam",
"id" : 542588070118187008,
"in_reply_to_status_id" : 542582672258629633,
"created_at" : "2014-12-10 07:54:11 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "LDJAM",
"indices" : [ 100, 106 ]
} ],
"urls" : [ {
"indices" : [ 76, 98 ],
"url" : "http:\/\/t.co\/yBdv31YoGV",
"expanded_url" : "http:\/\/ludumdare.com\/compo\/ludum-dare-31\/?action=preview&uid=6228",
"display_url" : "ludumdare.com\/compo\/ludum-da\u2026"
} ]
},
"geo" : { },
"id_str" : "542582672258629633",
"text" : "Okay, gonna try and make Terra run well on an iPad (really slow right now). http:\/\/t.co\/yBdv31YoGV\n\n#LDJAM",
"id" : 542582672258629633,
"created_at" : "2014-12-10 07:32:44 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/542436097557397507\/photo\/1",
"indices" : [ 42, 64 ],
"url" : "http:\/\/t.co\/coKZJn83TD",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4cewWACcAAcB7E.png",
"id_str" : "542436096009728000",
"id" : 542436096009728000,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4cewWACcAAcB7E.png",
"sizes" : [ {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 806,
"resize" : "fit",
"w" : 575
}, {
"h" : 806,
"resize" : "fit",
"w" : 575
}, {
"h" : 806,
"resize" : "fit",
"w" : 575
}, {
"h" : 476,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/coKZJn83TD"
} ],
"hashtags" : [ {
"text" : "visualstudio",
"indices" : [ 28, 41 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542436097557397507",
"text" : "This literally took 4 hours #visualstudio http:\/\/t.co\/coKZJn83TD",
"id" : 542436097557397507,
"created_at" : "2014-12-09 21:50:18 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542435305588940802",
"text" : "Why do the ads always load perfectly but the actual video does not?",
"id" : 542435305588940802,
"created_at" : "2014-12-09 21:47:09 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542433458371297281",
"text" : "Here's the thing. Patreon is awesome.",
"id" : 542433458371297281,
"created_at" : "2014-12-09 21:39:49 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/542225242509176832\/photo\/1",
"indices" : [ 12, 34 ],
"url" : "http:\/\/t.co\/dyAib0OV5T",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4Ze_BoCYAAuGy1.jpg",
"id_str" : "542225242005856256",
"id" : 542225242005856256,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4Ze_BoCYAAuGy1.jpg",
"sizes" : [ {
"h" : 255,
"resize" : "fit",
"w" : 340
}, {
"h" : 768,
"resize" : "fit",
"w" : 1024
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 1920,
"resize" : "fit",
"w" : 2560
}, {
"h" : 450,
"resize" : "fit",
"w" : 600
} ],
"display_url" : "pic.twitter.com\/dyAib0OV5T"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542225242509176832",
"text" : "Antipattern http:\/\/t.co\/dyAib0OV5T",
"id" : 542225242509176832,
"created_at" : "2014-12-09 07:52:26 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 114, 120 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542123874582671360",
"text" : "Seriously considering packaging this up as an app and adding multiplayer, and leader boards. *HYPERVENTILATING* #ldjam",
"id" : 542123874582671360,
"created_at" : "2014-12-09 01:09:38 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/542123310599790592\/photo\/1",
"indices" : [ 117, 139 ],
"url" : "http:\/\/t.co\/6uDYkMBGyr",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4YCRwLCUAELwPL.jpg",
"id_str" : "542123309156945921",
"id" : 542123309156945921,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4YCRwLCUAELwPL.jpg",
"sizes" : [ {
"h" : 255,
"resize" : "fit",
"w" : 340
}, {
"h" : 768,
"resize" : "fit",
"w" : 1024
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 450,
"resize" : "fit",
"w" : 600
}, {
"h" : 955,
"resize" : "fit",
"w" : 1273
} ],
"display_url" : "pic.twitter.com\/6uDYkMBGyr"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 10, 16 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "542123310599790592",
"text" : "Alright! #ldjam Terra runs really well on my brothers phone! Some of the sounds don't play because they are ogg... http:\/\/t.co\/6uDYkMBGyr",
"id" : 542123310599790592,
"created_at" : "2014-12-09 01:07:24 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 0, 6 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541826600329699328",
"text" : "#ldjam I have no idea why my game is soooo slow on an iPad. Like crazy slow.",
"id" : 541826600329699328,
"created_at" : "2014-12-08 05:28:22 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541776993952346112",
"text" : "So I guess I have another 24 hours? Because I can't live without these sounds...",
"id" : 541776993952346112,
"created_at" : "2014-12-08 02:11:15 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 133, 139 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541776517181620224",
"text" : "Oh man, I didn't know the compo meant you had to create sounds. I thought it meant you could only use freely available ones! Dang! #ldjam",
"id" : 541776517181620224,
"created_at" : "2014-12-08 02:09:22 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 96, 102 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541775712890277888",
"text" : "Wow so happy with my entry! I didn't get to spend a whole 48 hours, but I hope people like it. #ldjam",
"id" : 541775712890277888,
"created_at" : "2014-12-08 02:06:10 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "LDJAM",
"indices" : [ 134, 140 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541766828016402432",
"text" : "Half an hour to go. Still haven't named the game, made a title screen, found a cool font. But I could live with submitting it as is #LDJAM",
"id" : 541766828016402432,
"created_at" : "2014-12-08 01:30:51 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 16, 38 ],
"url" : "http:\/\/t.co\/e0PAtt6zTB",
"expanded_url" : "http:\/\/james-forbes.com\/ld31",
"display_url" : "james-forbes.com\/ld31"
} ]
},
"geo" : { },
"id_str" : "541761182814593024",
"text" : "< 1hr left. http:\/\/t.co\/e0PAtt6zTB\nAdded sounds, SFX, screen flash, screen shake etc. Still yet to add a menu or a win\/lose screen.",
"id" : 541761182814593024,
"created_at" : "2014-12-08 01:08:26 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 117, 123 ]
} ],
"urls" : [ {
"indices" : [ 42, 64 ],
"url" : "http:\/\/t.co\/X43ZQv232O",
"expanded_url" : "http:\/\/james-forbes.com\/ld31\/",
"display_url" : "james-forbes.com\/ld31\/"
} ]
},
"geo" : { },
"id_str" : "541731872867250176",
"text" : "You can play what I've built so far here: http:\/\/t.co\/X43ZQv232O\n\nLots left to do. < 2 hours left on the clock. #ldjam",
"id" : 541731872867250176,
"created_at" : "2014-12-07 23:11:58 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"indices" : [ 0, 15 ],
"id_str" : "16025792",
"id" : 16025792
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "541710727438794753",
"geo" : { },
"id_str" : "541718850316685312",
"in_reply_to_user_id" : 16025792,
"text" : "@james_a_forbes Turns out I just had to give up on this approach and went with a game loop on top of the event based game.",
"id" : 541718850316685312,
"in_reply_to_status_id" : 541710727438794753,
"created_at" : "2014-12-07 22:20:13 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"indices" : [ 0, 13 ],
"id_str" : "486414259",
"id" : 486414259
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "541699202749693952",
"geo" : { },
"id_str" : "541710947258077184",
"in_reply_to_user_id" : 486414259,
"text" : "@doktorgoogle Thanks Mum!",
"id" : 541710947258077184,
"in_reply_to_status_id" : 541699202749693952,
"created_at" : "2014-12-07 21:48:48 +0000",
"in_reply_to_screen_name" : "doktorgoogle",
"in_reply_to_user_id_str" : "486414259",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541710727438794753\/photo\/1",
"indices" : [ 34, 56 ],
"url" : "http:\/\/t.co\/BfJxZbZ6zB",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4SLCP5CIAEV1fV.png",
"id_str" : "541710725933047809",
"id" : 541710725933047809,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4SLCP5CIAEV1fV.png",
"sizes" : [ {
"h" : 236,
"resize" : "fit",
"w" : 523
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 236,
"resize" : "fit",
"w" : 523
}, {
"h" : 153,
"resize" : "fit",
"w" : 340
}, {
"h" : 236,
"resize" : "fit",
"w" : 523
} ],
"display_url" : "pic.twitter.com\/BfJxZbZ6zB"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 27, 33 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541710727438794753",
"text" : "My first ever screenshake! #ldjam http:\/\/t.co\/BfJxZbZ6zB",
"id" : 541710727438794753,
"created_at" : "2014-12-07 21:47:56 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 70, 93 ],
"url" : "https:\/\/t.co\/FNNzIYruKW",
"expanded_url" : "https:\/\/soundcloud.com\/gazevectors\/solar-guarantee",
"display_url" : "soundcloud.com\/gazevectors\/so\u2026"
} ]
},
"geo" : { },
"id_str" : "541687841902702592",
"text" : "Here is a song I wrote, that I thought I didn't like, but now I do...\nhttps:\/\/t.co\/FNNzIYruKW\n\nRecorded it with a friend two years ago.",
"id" : 541687841902702592,
"created_at" : "2014-12-07 20:17:00 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Arne",
"screen_name" : "AndroidArts",
"indices" : [ 0, 12 ],
"id_str" : "314201301",
"id" : 314201301
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "541592534859149313",
"geo" : { },
"id_str" : "541600405327593474",
"in_reply_to_user_id" : 314201301,
"text" : "@AndroidArts Oh! So 80% for Design Doc, means you've nearly finished writing your Design Doc, or you've implemented 80% of it in code?",
"id" : 541600405327593474,
"in_reply_to_status_id" : 541592534859149313,
"created_at" : "2014-12-07 14:29:33 +0000",
"in_reply_to_screen_name" : "AndroidArts",
"in_reply_to_user_id_str" : "314201301",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 27, 50 ],
"url" : "https:\/\/t.co\/hNpBxBwpt6",
"expanded_url" : "https:\/\/gist.github.com\/JAForbes\/f9f7aadac7e5203df78a",
"display_url" : "gist.github.com\/JAForbes\/f9f7a\u2026"
} ]
},
"geo" : { },
"id_str" : "541593800930369536",
"text" : "Do you hate CSS? So do I! https:\/\/t.co\/hNpBxBwpt6",
"id" : 541593800930369536,
"created_at" : "2014-12-07 14:03:19 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 86, 92 ]
} ],
"urls" : [ {
"indices" : [ 93, 116 ],
"url" : "https:\/\/t.co\/hNpBxBwpt6",
"expanded_url" : "https:\/\/gist.github.com\/JAForbes\/f9f7aadac7e5203df78a",
"display_url" : "gist.github.com\/JAForbes\/f9f7a\u2026"
} ]
},
"geo" : { },
"id_str" : "541590369331200001",
"text" : "Do you hate CSS? Me too!\n\n(For anyone out there struggling with positioning their UI) #ldjam\nhttps:\/\/t.co\/hNpBxBwpt6",
"id" : 541590369331200001,
"created_at" : "2014-12-07 13:49:40 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541569263048196099\/photo\/1",
"indices" : [ 116, 138 ],
"url" : "http:\/\/t.co\/FsOuGH9cln",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4QKX7sCAAA7a0t.png",
"id_str" : "541569261466943488",
"id" : 541569261466943488,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4QKX7sCAAA7a0t.png",
"sizes" : [ {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 344,
"resize" : "fit",
"w" : 600
}, {
"h" : 507,
"resize" : "fit",
"w" : 883
}, {
"h" : 507,
"resize" : "fit",
"w" : 882
}, {
"h" : 195,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/FsOuGH9cln"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 90, 96 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541569263048196099",
"text" : "Thinking of dropping ship on the left, and changing colour scheme of ship on the right. #ldjam\n\nWiring things up. http:\/\/t.co\/FsOuGH9cln",
"id" : 541569263048196099,
"created_at" : "2014-12-07 12:25:48 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "#ShutItDown",
"screen_name" : "superbranch",
"indices" : [ 3, 15 ],
"id_str" : "274089351",
"id" : 274089351
}, {
"name" : "Mitchell",
"screen_name" : "huangbong",
"indices" : [ 68, 78 ],
"id_str" : "52391837",
"id" : 52391837
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/huangbong\/status\/541502948639911936\/photo\/1",
"indices" : [ 93, 115 ],
"url" : "http:\/\/t.co\/hLzghE6EWr",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4PODpBCQAA2APV.jpg",
"id_str" : "541502942159716352",
"id" : 541502942159716352,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4PODpBCQAA2APV.jpg",
"sizes" : [ {
"h" : 453,
"resize" : "fit",
"w" : 340
}, {
"h" : 1024,
"resize" : "fit",
"w" : 768
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 800,
"resize" : "fit",
"w" : 600
}, {
"h" : 1024,
"resize" : "fit",
"w" : 768
} ],
"display_url" : "pic.twitter.com\/hLzghE6EWr"
} ],
"hashtags" : [ {
"text" : "ICantBreathe",
"indices" : [ 79, 92 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541545338616561664",
"text" : "RT @superbranch: \"Aren't you a little short for a stormtrooper?\" HT @huangbong #ICantBreathe http:\/\/t.co\/hLzghE6EWr",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003ETwitter for Android\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Mitchell",
"screen_name" : "huangbong",
"indices" : [ 51, 61 ],
"id_str" : "52391837",
"id" : 52391837
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/huangbong\/status\/541502948639911936\/photo\/1",
"indices" : [ 76, 98 ],
"url" : "http:\/\/t.co\/hLzghE6EWr",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4PODpBCQAA2APV.jpg",
"id_str" : "541502942159716352",
"id" : 541502942159716352,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4PODpBCQAA2APV.jpg",
"sizes" : [ {
"h" : 453,
"resize" : "fit",
"w" : 340
}, {
"h" : 1024,
"resize" : "fit",
"w" : 768
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 800,
"resize" : "fit",
"w" : 600
}, {
"h" : 1024,
"resize" : "fit",
"w" : 768
} ],
"display_url" : "pic.twitter.com\/hLzghE6EWr"
} ],
"hashtags" : [ {
"text" : "ICantBreathe",
"indices" : [ 62, 75 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541503665639809024",
"text" : "\"Aren't you a little short for a stormtrooper?\" HT @huangbong #ICantBreathe http:\/\/t.co\/hLzghE6EWr",
"id" : 541503665639809024,
"created_at" : "2014-12-07 08:05:09 +0000",
"user" : {
"name" : "#ShutItDown",
"screen_name" : "superbranch",
"protected" : false,
"id_str" : "274089351",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/542213097306341376\/QQAPH91G_normal.jpeg",
"id" : 274089351,
"verified" : false
}
},
"id" : 541545338616561664,
"created_at" : "2014-12-07 10:50:44 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Brendan Vance",
"screen_name" : "4xisblack",
"indices" : [ 3, 13 ],
"id_str" : "194501178",
"id" : 194501178
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541544911397326849",
"text" : "RT @4xisblack: I had an okay birthday. Everything in my life ranges from 'okay' to 'unmitigated disaster'",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003ETwitter for iPhone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541536247361970176",
"text" : "I had an okay birthday. Everything in my life ranges from 'okay' to 'unmitigated disaster'",
"id" : 541536247361970176,
"created_at" : "2014-12-07 10:14:37 +0000",
"user" : {
"name" : "Brendan Vance",
"screen_name" : "4xisblack",
"protected" : false,
"id_str" : "194501178",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/472286169271517184\/StxeEd4I_normal.png",
"id" : 194501178,
"verified" : false
}
},
"id" : 541544911397326849,
"created_at" : "2014-12-07 10:49:02 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 40, 46 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541544439043203073",
"text" : "Running low on energy. I've taken this #ldjam pretty easy. But tonight is when I actually code. I've left it til last for some reason...",
"id" : 541544439043203073,
"created_at" : "2014-12-07 10:47:10 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Saam",
"screen_name" : "saampahlavan",
"indices" : [ 0, 13 ],
"id_str" : "43239844",
"id" : 43239844
}, {
"name" : "Arne",
"screen_name" : "AndroidArts",
"indices" : [ 14, 26 ],
"id_str" : "314201301",
"id" : 314201301
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "541445846387003392",
"geo" : { },
"id_str" : "541493226398425089",
"in_reply_to_user_id" : 43239844,
"text" : "@saampahlavan @AndroidArts Suprised you make a design doc for a jam. What is it like?",
"id" : 541493226398425089,
"in_reply_to_status_id" : 541445846387003392,
"created_at" : "2014-12-07 07:23:40 +0000",
"in_reply_to_screen_name" : "saampahlavan",
"in_reply_to_user_id_str" : "43239844",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541489972239273985\/photo\/1",
"indices" : [ 41, 63 ],
"url" : "http:\/\/t.co\/HFM6nFhDYL",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4PCQirCUAIvtei.png",
"id_str" : "541489969655599106",
"id" : 541489969655599106,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4PCQirCUAIvtei.png",
"sizes" : [ {
"h" : 192,
"resize" : "fit",
"w" : 340
}, {
"h" : 339,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 427,
"resize" : "fit",
"w" : 754
}, {
"h" : 427,
"resize" : "fit",
"w" : 754
} ],
"display_url" : "pic.twitter.com\/HFM6nFhDYL"
}, {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541489972239273985\/photo\/1",
"indices" : [ 41, 63 ],
"url" : "http:\/\/t.co\/HFM6nFhDYL",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4PCQl0CQAAkypt.png",
"id_str" : "541489970498650112",
"id" : 541489970498650112,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4PCQl0CQAAkypt.png",
"sizes" : [ {
"h" : 620,
"resize" : "fit",
"w" : 855
}, {
"h" : 246,
"resize" : "fit",
"w" : 340
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 620,
"resize" : "fit",
"w" : 855
}, {
"h" : 435,
"resize" : "fit",
"w" : 600
} ],
"display_url" : "pic.twitter.com\/HFM6nFhDYL"
}, {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541489972239273985\/photo\/1",
"indices" : [ 41, 63 ],
"url" : "http:\/\/t.co\/HFM6nFhDYL",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4PCQjFCEAAyyr5.png",
"id_str" : "541489969764634624",
"id" : 541489969764634624,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4PCQjFCEAAyyr5.png",
"sizes" : [ {
"h" : 390,
"resize" : "fit",
"w" : 600
}, {
"h" : 402,
"resize" : "fit",
"w" : 618
}, {
"h" : 221,
"resize" : "fit",
"w" : 340
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 402,
"resize" : "fit",
"w" : 618
} ],
"display_url" : "pic.twitter.com\/HFM6nFhDYL"
} ],
"hashtags" : [ {
"text" : "LDJAM",
"indices" : [ 34, 40 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541489972239273985",
"text" : "Projectiles, Shield, And Charging #LDJAM http:\/\/t.co\/HFM6nFhDYL",
"id" : 541489972239273985,
"created_at" : "2014-12-07 07:10:44 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541476215844900864\/photo\/1",
"indices" : [ 107, 129 ],
"url" : "http:\/\/t.co\/4NhJxmsigA",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4O1v2WCcAANMyQ.png",
"id_str" : "541476213861019648",
"id" : 541476213861019648,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4O1v2WCcAANMyQ.png",
"sizes" : [ {
"h" : 735,
"resize" : "fit",
"w" : 1501
}, {
"h" : 293,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 166,
"resize" : "fit",
"w" : 340
}, {
"h" : 501,
"resize" : "fit",
"w" : 1024
} ],
"display_url" : "pic.twitter.com\/4NhJxmsigA"
}, {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541476215844900864\/photo\/1",
"indices" : [ 107, 129 ],
"url" : "http:\/\/t.co\/4NhJxmsigA",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4O1uG7CcAAknUM.png",
"id_str" : "541476183951437824",
"id" : 541476183951437824,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4O1uG7CcAAknUM.png",
"sizes" : [ {
"h" : 436,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 620,
"resize" : "fit",
"w" : 853
}, {
"h" : 247,
"resize" : "fit",
"w" : 340
}, {
"h" : 620,
"resize" : "fit",
"w" : 853
} ],
"display_url" : "pic.twitter.com\/4NhJxmsigA"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541476215844900864",
"text" : "Just tried publishing my Flash file as JS\/HTML. It converted all vectors to JS instructions. Blown away. http:\/\/t.co\/4NhJxmsigA",
"id" : 541476215844900864,
"created_at" : "2014-12-07 06:16:04 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541429010241052673\/photo\/1",
"indices" : [ 52, 74 ],
"url" : "http:\/\/t.co\/JMKI1sAbIV",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4OK0IdCYAAHt1c.png",
"id_str" : "541429008441696256",
"id" : 541429008441696256,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4OK0IdCYAAHt1c.png",
"sizes" : [ {
"h" : 201,
"resize" : "fit",
"w" : 340
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 571,
"resize" : "fit",
"w" : 962
}, {
"h" : 356,
"resize" : "fit",
"w" : 600
}, {
"h" : 571,
"resize" : "fit",
"w" : 962
} ],
"display_url" : "pic.twitter.com\/JMKI1sAbIV"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 45, 51 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541429010241052673",
"text" : "Now I have two ships. I need to work on VFX #ldjam http:\/\/t.co\/JMKI1sAbIV",
"id" : 541429010241052673,
"created_at" : "2014-12-07 03:08:29 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541413924650774528\/photo\/1",
"indices" : [ 29, 51 ],
"url" : "http:\/\/t.co\/I0TCBmyPCY",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4N9GCcCMAA6AN3.png",
"id_str" : "541413922901733376",
"id" : 541413922901733376,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4N9GCcCMAA6AN3.png",
"sizes" : [ {
"h" : 530,
"resize" : "fit",
"w" : 1024
}, {
"h" : 559,
"resize" : "fit",
"w" : 1080
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 310,
"resize" : "fit",
"w" : 600
}, {
"h" : 175,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/I0TCBmyPCY"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 22, 28 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541413924650774528",
"text" : "Working on a new ship #ldjam http:\/\/t.co\/I0TCBmyPCY",
"id" : 541413924650774528,
"created_at" : "2014-12-07 02:08:33 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541402756364267520\/photo\/1",
"indices" : [ 74, 96 ],
"url" : "http:\/\/t.co\/GlSMUBE20L",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4Ny79ECMAANXN1.png",
"id_str" : "541402754543923200",
"id" : 541402754543923200,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4Ny79ECMAANXN1.png",
"sizes" : [ {
"h" : 645,
"resize" : "fit",
"w" : 1464
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 264,
"resize" : "fit",
"w" : 600
}, {
"h" : 149,
"resize" : "fit",
"w" : 340
}, {
"h" : 451,
"resize" : "fit",
"w" : 1024
} ],
"display_url" : "pic.twitter.com\/GlSMUBE20L"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 67, 73 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541402756364267520",
"text" : "Pixels didn't work for me. So trying a different colour scheme. \n#ldjam http:\/\/t.co\/GlSMUBE20L",
"id" : 541402756364267520,
"created_at" : "2014-12-07 01:24:10 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "LDJAM",
"indices" : [ 108, 114 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541185435381166081",
"text" : "Think after all those hours tinkering with Flat, I don't think I can pull it off. Gonna try pixeling again #LDJAM",
"id" : 541185435381166081,
"created_at" : "2014-12-06 11:00:37 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/541183312211890177\/photo\/1",
"indices" : [ 36, 58 ],
"url" : "http:\/\/t.co\/CxROVJYPQf",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4KrWo1CMAA-H_6.png",
"id_str" : "541183310643212288",
"id" : 541183310643212288,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4KrWo1CMAA-H_6.png",
"sizes" : [ {
"h" : 439,
"resize" : "fit",
"w" : 792
}, {
"h" : 439,
"resize" : "fit",
"w" : 792
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 188,
"resize" : "fit",
"w" : 340
}, {
"h" : 332,
"resize" : "fit",
"w" : 600
} ],
"display_url" : "pic.twitter.com\/CxROVJYPQf"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 29, 35 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541183312211890177",
"text" : "No idea what I am doing here #ldjam http:\/\/t.co\/CxROVJYPQf",
"id" : 541183312211890177,
"created_at" : "2014-12-06 10:52:10 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 132, 138 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541159161707233280",
"text" : "Struggling to draw flat shaded vector spaceships in Photoshop and thought: \"damn I wish these shapes were dynamic like in Flash...\" #ldjam",
"id" : 541159161707233280,
"created_at" : "2014-12-06 09:16:13 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541103179446767616",
"text" : "Been trying to write this turn based game using an ECS. But I think it might be easier to write as an evented thing.",
"id" : 541103179446767616,
"created_at" : "2014-12-06 05:33:45 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 93, 99 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541089775071944704",
"text" : "The prototype AI has defeated me enough times. Game is fun. Time to build the real thing. #ldjam",
"id" : 541089775071944704,
"created_at" : "2014-12-06 04:40:29 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541078530402959360",
"text" : "If I can make individual battles interesting enough. Maybe I can add some sort of meta game.",
"id" : 541078530402959360,
"created_at" : "2014-12-06 03:55:49 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 80, 86 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541077787566546944",
"text" : "I'm tweaking the AI now, and actually finding it difficult to beat my own bots. #ldjam",
"id" : 541077787566546944,
"created_at" : "2014-12-06 03:52:51 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 109, 115 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541071952702472192",
"text" : "Coded all the combinations, and making two ships randomly compete, tweaking the rules based on observation. #ldjam",
"id" : 541071952702472192,
"created_at" : "2014-12-06 03:29:40 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 120, 126 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541071174264840192",
"text" : "I wrote down 5 ideas, decided they were too complex. Building a simple Rock Paper Scissors space tactics thing instead #ldjam",
"id" : 541071174264840192,
"created_at" : "2014-12-06 03:26:35 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 97, 103 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "541008736370696192",
"text" : "I just had a game idea, thought it was great. Tried it out with pen and paper. Was so boring. #ldjam",
"id" : 541008736370696192,
"created_at" : "2014-12-05 23:18:28 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 25, 48 ],
"url" : "https:\/\/t.co\/pCoZC3nXrN",
"expanded_url" : "https:\/\/github.com\/jriecken\/sat-js",
"display_url" : "github.com\/jriecken\/sat-js"
} ]
},
"geo" : { },
"id_str" : "540870396220694529",
"text" : "I might muck around with https:\/\/t.co\/pCoZC3nXrN tomorrow morning before the jam. I wanted something non-oop but whatever.",
"id" : 540870396220694529,
"created_at" : "2014-12-05 14:08:46 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540867016354050049",
"text" : "I was hoping for a generalisable thing.",
"id" : 540867016354050049,
"created_at" : "2014-12-05 13:55:20 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540866947093524481",
"text" : "I was looking at the source for the N collision tutorial. I was suprised how many Projection functions there were for specific tile types.",
"id" : 540866947093524481,
"created_at" : "2014-12-05 13:55:03 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "U.S. Dept. of Fear",
"screen_name" : "FearDept",
"indices" : [ 3, 12 ],
"id_str" : "141834186",
"id" : 141834186
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/FearDept\/status\/540783948205289472\/photo\/1",
"indices" : [ 18, 40 ],
"url" : "http:\/\/t.co\/g77DAR6Hsw",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4FAIc4CYAEViae.png",
"id_str" : "540783944195530753",
"id" : 540783944195530753,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4FAIc4CYAEViae.png",
"sizes" : [ {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 326,
"resize" : "fit",
"w" : 636
}, {
"h" : 307,
"resize" : "fit",
"w" : 600
}, {
"h" : 326,
"resize" : "fit",
"w" : 636
}, {
"h" : 174,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/g77DAR6Hsw"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540835491692572672",
"text" : "RT @FearDept: PSA http:\/\/t.co\/g77DAR6Hsw",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/FearDept\/status\/540783948205289472\/photo\/1",
"indices" : [ 4, 26 ],
"url" : "http:\/\/t.co\/g77DAR6Hsw",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4FAIc4CYAEViae.png",
"id_str" : "540783944195530753",
"id" : 540783944195530753,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4FAIc4CYAEViae.png",
"sizes" : [ {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 326,
"resize" : "fit",
"w" : 636
}, {
"h" : 307,
"resize" : "fit",
"w" : 600
}, {
"h" : 326,
"resize" : "fit",
"w" : 636
}, {
"h" : 174,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/g77DAR6Hsw"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540783948205289472",
"text" : "PSA http:\/\/t.co\/g77DAR6Hsw",
"id" : 540783948205289472,
"created_at" : "2014-12-05 08:25:15 +0000",
"user" : {
"name" : "U.S. Dept. of Fear",
"screen_name" : "FearDept",
"protected" : false,
"id_str" : "141834186",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/453113104939761664\/9ZqHHvvA_normal.png",
"id" : 141834186,
"verified" : false
}
},
"id" : 540835491692572672,
"created_at" : "2014-12-05 11:50:04 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "LDJAM",
"indices" : [ 123, 129 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540834688953094144",
"text" : "Wrote some vector utilities. But didn't actually get around to doing any collision :( \n\nHopefully tomorrow morning before #LDJAM",
"id" : 540834688953094144,
"created_at" : "2014-12-05 11:46:52 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/540819143922950144\/photo\/1",
"indices" : [ 31, 53 ],
"url" : "http:\/\/t.co\/gxQRKvdVju",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4FgJQRCYAABhVf.png",
"id_str" : "540819142362685440",
"id" : 540819142362685440,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4FgJQRCYAABhVf.png",
"sizes" : [ {
"h" : 366,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 207,
"resize" : "fit",
"w" : 340
}, {
"h" : 531,
"resize" : "fit",
"w" : 869
}, {
"h" : 531,
"resize" : "fit",
"w" : 869
} ],
"display_url" : "pic.twitter.com\/gxQRKvdVju"
} ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 24, 30 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540819143922950144",
"text" : "A good starting point. #ldjam http:\/\/t.co\/gxQRKvdVju",
"id" : 540819143922950144,
"created_at" : "2014-12-05 10:45:06 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540787553339592704",
"text" : "My fault, I was running npm install mocha --dev intead of npm install mocha --save-dev\nToo very different things...",
"id" : 540787553339592704,
"created_at" : "2014-12-05 08:39:34 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540780046743371776",
"text" : "Getting lots of deprecation warnings for both jasmine and mocha. I'll try vows?",
"id" : 540780046743371776,
"created_at" : "2014-12-05 08:09:45 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540778782416568320",
"text" : "I'll try jasmine",
"id" : 540778782416568320,
"created_at" : "2014-12-05 08:04:43 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540778610647236608",
"text" : "Having major issues installing mocha with npm today. Apparently I need to install visual studio...",
"id" : 540778610647236608,
"created_at" : "2014-12-05 08:04:02 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Metanet Software",
"screen_name" : "metanetsoftware",
"indices" : [ 0, 16 ],
"id_str" : "78403368",
"id" : 78403368
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "540777102283636737",
"geo" : { },
"id_str" : "540777245912997888",
"in_reply_to_user_id" : 78403368,
"text" : "@metanetsoftware Thanks!",
"id" : 540777245912997888,
"in_reply_to_status_id" : 540777102283636737,
"created_at" : "2014-12-05 07:58:37 +0000",
"in_reply_to_screen_name" : "metanetsoftware",
"in_reply_to_user_id_str" : "78403368",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Metanet Software",
"screen_name" : "metanetsoftware",
"indices" : [ 99, 115 ],
"id_str" : "78403368",
"id" : 78403368
} ],
"media" : [ ],
"hashtags" : [ {
"text" : "ldjam",
"indices" : [ 15, 21 ]
} ],
"urls" : [ {
"indices" : [ 117, 139 ],
"url" : "http:\/\/t.co\/pW9HItfPlo",
"expanded_url" : "http:\/\/www.metanetsoftware.com\/technique\/tutorialA.html",
"display_url" : "metanetsoftware.com\/technique\/tuto\u2026"
} ]
},
"geo" : { },
"id_str" : "540767651270639616",
"text" : "Gonna prep for #ldjam by replicating the examples in this excellent collision detection article by @metanetsoftware \nhttp:\/\/t.co\/pW9HItfPlo",
"id" : 540767651270639616,
"created_at" : "2014-12-05 07:20:29 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "U.S. Dept. of Fear",
"screen_name" : "FearDept",
"indices" : [ 3, 12 ],
"id_str" : "141834186",
"id" : 141834186
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540750123777552385",
"text" : "RT @FearDept: We run this land for the benefit of our corporate partners. Monday they cut prices on cheaply-made appliances. Maybe show som\u2026",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540724726297919488",
"text" : "We run this land for the benefit of our corporate partners. Monday they cut prices on cheaply-made appliances. Maybe show some gratitude?",
"id" : 540724726297919488,
"created_at" : "2014-12-05 04:29:55 +0000",
"user" : {
"name" : "U.S. Dept. of Fear",
"screen_name" : "FearDept",
"protected" : false,
"id_str" : "141834186",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/453113104939761664\/9ZqHHvvA_normal.png",
"id" : 141834186,
"verified" : false
}
},
"id" : 540750123777552385,
"created_at" : "2014-12-05 06:10:50 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/james_a_forbes\/status\/540641811513872384\/photo\/1",
"indices" : [ 0, 22 ],
"url" : "http:\/\/t.co\/0CeAJ54JNB",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B4C-3HoCIAA7yW-.png",
"id_str" : "540641809433501696",
"id" : 540641809433501696,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B4C-3HoCIAA7yW-.png",
"sizes" : [ {
"h" : 59,
"resize" : "crop",
"w" : 150
}, {
"h" : 59,
"resize" : "fit",
"w" : 532
}, {
"h" : 59,
"resize" : "fit",
"w" : 532
}, {
"h" : 59,
"resize" : "fit",
"w" : 532
}, {
"h" : 37,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/0CeAJ54JNB"
} ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "540641811513872384",
"text" : "http:\/\/t.co\/0CeAJ54JNB",
"id" : 540641811513872384,
"created_at" : "2014-12-04 23:00:27 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"indices" : [ 0, 13 ],
"id_str" : "486414259",
"id" : 486414259
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"in_reply_to_status_id_str" : "540312493663322112",
"geo" : { },
"id_str" : "540313351381721088",
"in_reply_to_user_id" : 486414259,
"text" : "@doktorgoogle That's pretty clever.",
"id" : 540313351381721088,
"in_reply_to_status_id" : 540312493663322112,
"created_at" : "2014-12-04 01:15:16 +0000",
"in_reply_to_screen_name" : "doktorgoogle",
"in_reply_to_user_id_str" : "486414259",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ {
"text" : "js",
"indices" : [ 125, 128 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539999101266313216",
"text" : "If the knex calls were curried would be so much easier to read.\n...\n.then(knex.insert(\u007Buser_name: 'Tim'\u007D).into('users'))\n...\n#js",
"id" : 539999101266313216,
"created_at" : "2014-12-03 04:26:33 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539994811357339648",
"text" : "Really impressed with Knex.js, makes me wonder why you'd want to go the ORM route at all.",
"id" : 539994811357339648,
"created_at" : "2014-12-03 04:09:30 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Brooke Jarvis",
"screen_name" : "brookejarvis",
"indices" : [ 3, 16 ],
"id_str" : "47349506",
"id" : 47349506
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/brookejarvis\/status\/539860908475154432\/photo\/1",
"indices" : [ 48, 70 ],
"url" : "http:\/\/t.co\/KQW9vdtFxV",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B334okrCQAA0d9v.png",
"id_str" : "539860906276962304",
"id" : 539860906276962304,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B334okrCQAA0d9v.png",
"sizes" : [ {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 163,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/KQW9vdtFxV"
} ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 25, 47 ],
"url" : "http:\/\/t.co\/kLXbkHOoJs",
"expanded_url" : "http:\/\/www.bostonglobe.com\/opinion\/2014\/11\/26\/ferguson-puts-spotlight-what-need-change\/dwjEbQP2MrdivnEXDCBIxN\/story.html",
"display_url" : "bostonglobe.com\/opinion\/2014\/1\u2026"
} ]
},
"geo" : { },
"id_str" : "539930341733986306",
"text" : "RT @brookejarvis: Oooof. http:\/\/t.co\/kLXbkHOoJs http:\/\/t.co\/KQW9vdtFxV",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/brookejarvis\/status\/539860908475154432\/photo\/1",
"indices" : [ 30, 52 ],
"url" : "http:\/\/t.co\/KQW9vdtFxV",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B334okrCQAA0d9v.png",
"id_str" : "539860906276962304",
"id" : 539860906276962304,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B334okrCQAA0d9v.png",
"sizes" : [ {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 182,
"resize" : "fit",
"w" : 378
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 163,
"resize" : "fit",
"w" : 340
} ],
"display_url" : "pic.twitter.com\/KQW9vdtFxV"
} ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 7, 29 ],
"url" : "http:\/\/t.co\/kLXbkHOoJs",
"expanded_url" : "http:\/\/www.bostonglobe.com\/opinion\/2014\/11\/26\/ferguson-puts-spotlight-what-need-change\/dwjEbQP2MrdivnEXDCBIxN\/story.html",
"display_url" : "bostonglobe.com\/opinion\/2014\/1\u2026"
} ]
},
"geo" : { },
"id_str" : "539860908475154432",
"text" : "Oooof. http:\/\/t.co\/kLXbkHOoJs http:\/\/t.co\/KQW9vdtFxV",
"id" : 539860908475154432,
"created_at" : "2014-12-02 19:17:25 +0000",
"user" : {
"name" : "Brooke Jarvis",
"screen_name" : "brookejarvis",
"protected" : false,
"id_str" : "47349506",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/378800000837432935\/830a44a221c5d8d394db77d0d26f2669_normal.jpeg",
"id" : 47349506,
"verified" : false
}
},
"id" : 539930341733986306,
"created_at" : "2014-12-02 23:53:19 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Asher Vollmer",
"screen_name" : "AsherVo",
"indices" : [ 0, 8 ],
"id_str" : "16741826",
"id" : 16741826
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539929897729138688",
"in_reply_to_user_id" : 16741826,
"text" : "@AsherVo Windows Phone or Windows 8 app would be so good.",
"id" : 539929897729138688,
"created_at" : "2014-12-02 23:51:33 +0000",
"in_reply_to_screen_name" : "AsherVo",
"in_reply_to_user_id_str" : "16741826",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "yvynyl ",
"screen_name" : "yvynyl",
"indices" : [ 3, 10 ],
"id_str" : "29809867",
"id" : 29809867
}, {
"name" : "Ricardo Cocom",
"screen_name" : "Franciscotweet",
"indices" : [ 35, 50 ],
"id_str" : "160886116",
"id" : 160886116
}, {
"name" : "Fat Possum Records",
"screen_name" : "FatPossum",
"indices" : [ 84, 94 ],
"id_str" : "39931385",
"id" : 39931385
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 95, 117 ],
"url" : "http:\/\/t.co\/qK6IzkWrWS",
"expanded_url" : "http:\/\/youtu.be\/kxhQuGbbyRs",
"display_url" : "youtu.be\/kxhQuGbbyRs"
} ]
},
"geo" : { },
"id_str" : "539928910935244803",
"text" : "RT @yvynyl: dig the new video from @FranciscoTweet The Man \"It's Not Your Fault\" on @FatPossum http:\/\/t.co\/qK6IzkWrWS",
"retweeted_status" : {
"source" : "\u003Ca href=\"https:\/\/dev.twitter.com\/docs\/tfw\" rel=\"nofollow\"\u003ETwitter for Websites\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Ricardo Cocom",
"screen_name" : "Franciscotweet",
"indices" : [ 23, 38 ],
"id_str" : "160886116",
"id" : 160886116
}, {
"name" : "Fat Possum Records",
"screen_name" : "FatPossum",
"indices" : [ 72, 82 ],
"id_str" : "39931385",
"id" : 39931385
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 83, 105 ],
"url" : "http:\/\/t.co\/qK6IzkWrWS",
"expanded_url" : "http:\/\/youtu.be\/kxhQuGbbyRs",
"display_url" : "youtu.be\/kxhQuGbbyRs"
} ]
},
"geo" : { },
"id_str" : "539874864526413824",
"text" : "dig the new video from @FranciscoTweet The Man \"It's Not Your Fault\" on @FatPossum http:\/\/t.co\/qK6IzkWrWS",
"id" : 539874864526413824,
"created_at" : "2014-12-02 20:12:52 +0000",
"user" : {
"name" : "yvynyl ",
"screen_name" : "yvynyl",
"protected" : false,
"id_str" : "29809867",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/1766495135\/yvynyl_bio_normal.jpeg",
"id" : 29809867,
"verified" : false
}
},
"id" : 539928910935244803,
"created_at" : "2014-12-02 23:47:38 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/www.twitter.com\" rel=\"nofollow\"\u003ETwitter for Windows Phone\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Rob Pike",
"screen_name" : "rob_pike",
"indices" : [ 3, 12 ],
"id_str" : "197263266",
"id" : 197263266
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 120, 140 ],
"url" : "http:\/\/t.co\/0WEpt34Gf6",
"expanded_url" : "http:\/\/ventrellathing.wordpress.com\/2013\/06\/18\/the-case-for-slow-programming\/",
"display_url" : "ventrellathing.wordpress.com\/2013\/06\/18\/the\u2026"
} ]
},
"geo" : { },
"id_str" : "539608927738933248",
"text" : "RT @rob_pike: \"Software programming is not typing\". Most of my best code has formed somewhere other than at a keyboard. http:\/\/t.co\/0WEpt34\u2026",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 106, 128 ],
"url" : "http:\/\/t.co\/0WEpt34Gf6",
"expanded_url" : "http:\/\/ventrellathing.wordpress.com\/2013\/06\/18\/the-case-for-slow-programming\/",
"display_url" : "ventrellathing.wordpress.com\/2013\/06\/18\/the\u2026"
} ]
},
"geo" : { },
"id_str" : "539601987822567424",
"text" : "\"Software programming is not typing\". Most of my best code has formed somewhere other than at a keyboard. http:\/\/t.co\/0WEpt34Gf6",
"id" : 539601987822567424,
"created_at" : "2014-12-02 02:08:33 +0000",
"user" : {
"name" : "Rob Pike",
"screen_name" : "rob_pike",
"protected" : false,
"id_str" : "197263266",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/1134816781\/robicon1_normal.jpg",
"id" : 197263266,
"verified" : false
}
},
"id" : 539608927738933248,
"created_at" : "2014-12-02 02:36:08 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Zoe Calton",
"screen_name" : "ZoeAppleseed",
"indices" : [ 3, 16 ],
"id_str" : "2268581455",
"id" : 2268581455
} ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/539357206777311232\/photo\/1",
"indices" : [ 94, 116 ],
"url" : "http:\/\/t.co\/8DpUzJWHp0",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B3wugHuCMAAS9Zz.jpg",
"id_str" : "539357184740438016",
"id" : 539357184740438016,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B3wugHuCMAAS9Zz.jpg",
"sizes" : [ {
"h" : 340,
"resize" : "fit",
"w" : 340
}, {
"h" : 600,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 1024,
"resize" : "fit",
"w" : 1024
}, {
"h" : 1024,
"resize" : "fit",
"w" : 1024
} ],
"display_url" : "pic.twitter.com\/8DpUzJWHp0"
} ],
"hashtags" : [ {
"text" : "art",
"indices" : [ 58, 62 ]
}, {
"text" : "illustration",
"indices" : [ 63, 76 ]
}, {
"text" : "drawing",
"indices" : [ 77, 85 ]
}, {
"text" : "sketch",
"indices" : [ 86, 93 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539387482798690304",
"text" : "RT @ZoeAppleseed: Sketching this beautiful girl tonight \uD83C\uDF0C #art #illustration #drawing #sketch http:\/\/t.co\/8DpUzJWHp0",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\/#!\/download\/ipad\" rel=\"nofollow\"\u003ETwitter for iPad\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ {
"expanded_url" : "http:\/\/twitter.com\/ZoeAppleseed\/status\/539357206777311232\/photo\/1",
"indices" : [ 76, 98 ],
"url" : "http:\/\/t.co\/8DpUzJWHp0",
"media_url" : "http:\/\/pbs.twimg.com\/media\/B3wugHuCMAAS9Zz.jpg",
"id_str" : "539357184740438016",
"id" : 539357184740438016,
"media_url_https" : "https:\/\/pbs.twimg.com\/media\/B3wugHuCMAAS9Zz.jpg",
"sizes" : [ {
"h" : 340,
"resize" : "fit",
"w" : 340
}, {
"h" : 600,
"resize" : "fit",
"w" : 600
}, {
"h" : 150,
"resize" : "crop",
"w" : 150
}, {
"h" : 1024,
"resize" : "fit",
"w" : 1024
}, {
"h" : 1024,
"resize" : "fit",
"w" : 1024
} ],
"display_url" : "pic.twitter.com\/8DpUzJWHp0"
} ],
"hashtags" : [ {
"text" : "art",
"indices" : [ 40, 44 ]
}, {
"text" : "illustration",
"indices" : [ 45, 58 ]
}, {
"text" : "drawing",
"indices" : [ 59, 67 ]
}, {
"text" : "sketch",
"indices" : [ 68, 75 ]
} ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539357206777311232",
"text" : "Sketching this beautiful girl tonight \uD83C\uDF0C #art #illustration #drawing #sketch http:\/\/t.co\/8DpUzJWHp0",
"id" : 539357206777311232,
"created_at" : "2014-12-01 09:55:53 +0000",
"user" : {
"name" : "Zoe Calton",
"screen_name" : "ZoeAppleseed",
"protected" : false,
"id_str" : "2268581455",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/577990416483545088\/mhOWEjUQ_normal.jpeg",
"id" : 2268581455,
"verified" : false
}
},
"id" : 539387482798690304,
"created_at" : "2014-12-01 11:56:11 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"indices" : [ 3, 16 ],
"id_str" : "486414259",
"id" : 486414259
}, {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"indices" : [ 18, 33 ],
"id_str" : "16025792",
"id" : 16025792
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 88, 110 ],
"url" : "http:\/\/t.co\/LrKBGyjlH1",
"expanded_url" : "http:\/\/www.c365.ro\/video\/carrot-clarinet-linsey-pollak-126.html",
"display_url" : "c365.ro\/video\/carrot-c\u2026"
} ]
},
"geo" : { },
"id_str" : "539368836701487105",
"text" : "RT @doktorgoogle: @james_a_forbes I'll never look at carrots quite the same way again. http:\/\/t.co\/LrKBGyjlH1",
"retweeted_status" : {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"indices" : [ 0, 15 ],
"id_str" : "16025792",
"id" : 16025792
} ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ {
"indices" : [ 70, 92 ],
"url" : "http:\/\/t.co\/LrKBGyjlH1",
"expanded_url" : "http:\/\/www.c365.ro\/video\/carrot-clarinet-linsey-pollak-126.html",
"display_url" : "c365.ro\/video\/carrot-c\u2026"
} ]
},
"geo" : { },
"id_str" : "539258586862329856",
"in_reply_to_user_id" : 16025792,
"text" : "@james_a_forbes I'll never look at carrots quite the same way again. http:\/\/t.co\/LrKBGyjlH1",
"id" : 539258586862329856,
"created_at" : "2014-12-01 03:24:00 +0000",
"in_reply_to_screen_name" : "james_a_forbes",
"in_reply_to_user_id_str" : "16025792",
"user" : {
"name" : "Siena Somerset",
"screen_name" : "doktorgoogle",
"protected" : false,
"id_str" : "486414259",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/524546925605842944\/hC2mg57N_normal.jpeg",
"id" : 486414259,
"verified" : false
}
},
"id" : 539368836701487105,
"created_at" : "2014-12-01 10:42:06 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
}, {
"source" : "\u003Ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003ETwitter Web Client\u003C\/a\u003E",
"entities" : {
"user_mentions" : [ ],
"media" : [ ],
"hashtags" : [ ],
"urls" : [ ]
},
"geo" : { },
"id_str" : "539239936973492224",
"text" : "\"Hey Gene, how you feeling?\"\n\n\"Kind of nauseous a little light headed. Pretty good! Glad I ate it!\"",
"id" : 539239936973492224,
"created_at" : "2014-12-01 02:09:54 +0000",
"user" : {
"name" : "James Forbes",
"screen_name" : "james_a_forbes",
"protected" : false,
"id_str" : "16025792",
"profile_image_url_https" : "https:\/\/pbs.twimg.com\/profile_images\/571253075579396096\/_csqQudw_normal.jpeg",
"id" : 16025792,
"verified" : false
}
} ]
|
import React, { Component } from 'react';
import { PropTypes } from 'prop-types';
import Icon from 'react-native-vector-icons/dist/FontAwesome';
import {
View,
TouchableHighlight,
StyleSheet,
} from 'react-native';
export default class HeartButton extends Component {
constructor(props) {
super(props);
this.state = { addedToFavorite: false };
this.addToFavorite = this.addToFavorite.bind(this);
}
// Propが更新される時に呼ばれます 親Componentが渡したPropsの値が変化した時
componentWillReceiveProps(nextProps) {
this.setState({ addedToFavorite: nextProps.selected });
}
addToFavorite() {
const { onPress } = this.props;
this.setState({
addedToFavorite: !this.state.addedToFavorite
}, () => {
onPress && onPress();
});
}
render() {
const { addedToFavorite } = this.state;
const { color, selectedColor } = this.props;
return(
<TouchableHighlight
onPress = {this.addToFavorite}
>
<View>
<Icon
name = { addedToFavorite ? 'heart' : 'heart-o' }
color = {addedToFavorite ? selectedColor : color }
size = {18}
/>
<Icon
name = 'heart-o'
size = {18}
color = {color}
style = {[
{ display: addedToFavorite ? 'flex' : 'none' },
styles.selectedColor,
]}
/>
</View>
</TouchableHighlight>
);
}
}
const styles = StyleSheet.create({
selectedColor: {
position: 'absolute',
left: 0,
top:0,
}
});
HeartButton.propTypes = {
color: PropTypes.string.isRequired,
selectedColor: PropTypes.string.isRequired,
itemId: PropTypes.number.isRequired,
onPress: PropTypes.func,
selected: PropTypes.bool,
}
/*
使用Iconについて
heart-o 透けてるハート
heart 色付きハート
http://blog.keisuke11.com/webdesign/display-none-visibility-hidden/
display:none;
文字通りディスプレイをなしにするので指定された要素は非表示になります。
Document Object Model からは消えないのでHTMLコード上では存在していることになります。
*/
|
db.movies.updateOne({title:"Home Alone"},{$inc:{budget:5}});
|
import React, {Component} from 'react';
import './App.css';
import {Col, Container, Row} from "reactstrap";
import Header from '../component/Header';
import ToolsPanel from '../component/ToolsPanel';
import SortingFilteringTableWithPagination from "../component/table/Table";
const columns = [
'id',
'firstName',
'lastName',
'email',
'phone'
];
class App extends Component {
constructor() {
super();
this.state = {
data: []
};
this.loadData = this.loadData.bind(this);
}
loadData(newData) {
this.setState({
data: newData
});
}
render() {
return (
<div>
<Container>
<Row style={{marginTop: 20}}>
<Col>
<Header/>
</Col>
</Row>
<Row>
<Col>
<ToolsPanel onLoad={this.loadData}/>
</Col>
</Row>
<Row>
<Col>
<SortingFilteringTableWithPagination
originalData={this.state.data}
columns={columns}
/>
</Col>
</Row>
</Container>
</div>
);
}
}
export default App;
|
//Get images from new settings
var getImages = function(imageSetting){
var images = [];
for(var i=0;i<imageSetting.length;i++){
var imgArr = imageSetting[i].images;
images.push(imgArr[imgArr.length-1].url);//get smallest image
//images.push(imgArr[0].url);//get original image
}
return images;
}
function getFont(family) {
family = (family || "").replace(/[^A-Za-z]/g, '').toLowerCase();
var sans = 'Helvetica, Arial, "Microsoft YaHei New", "Microsoft Yahei", "微软雅黑", 宋体, SimSun, STXihei, "华文细黑", sans-serif';
var serif = 'Georgia, "Times New Roman", "FangSong", "仿宋", STFangSong, "华文仿宋", serif';
var fonts = {
helvetica : sans,
verdana : "Verdana, Geneva," + sans,
lucida : "Lucida Sans Unicode, Lucida Grande," + sans,
tahoma : "Tahoma, Geneva," + sans,
trebuchet : "Trebuchet MS," + sans,
impact : "Impact, Charcoal, Arial Black," + sans,
comicsans : "Comic Sans MS, Comic Sans, cursive," + sans,
georgia : serif,
palatino : "Palatino Linotype, Book Antiqua, Palatino," + serif,
times : "Times New Roman, Times," + serif,
courier : "Courier New, Courier, monospace, Times," + serif
}
var font = fonts[family] || fonts.helvetica;
return font;
}
if (!Node.prototype.clean) {
Node.prototype.clean = function() {
for (var i = 0; i < this.childNodes.length; i++) {
var child = this.childNodes[i];
if (child.nodeType === 8 || child.nodeType === 3) {
this.removeChild(child);
i--;
}
}
}
}
if (!Node.prototype.empty) {
Node.prototype.empty = function(query) {
var children = query ? this.querySelectorAll(query) : this.childNodes;
for (var i=children.length-1;i>=0;i--) children[i].parentNode.removeChild(children[i]);
}
}
if (!HTMLElement.prototype.hasClass) {
Element.prototype.hasClass = function(c) {
return (" " + this.className + " ").replace(/[\n\t]/g, " ").indexOf(" " + c + " ") > -1;
}
}
if (!HTMLElement.prototype.addClass) {
Element.prototype.addClass = function(c) {
if (!this.hasClass(c)) this.className += (" " + c);
return this;
}
}
if (!HTMLElement.prototype.removeClass) {
Element.prototype.removeClass = function(c) {
if (this.hasClass(c)) this.className = (" " + this.className + " ").replace(" " + c + " ", " ").trim();
return this;
}
}
var BouncingBallWidget = function(window, document, BannerFlow) {
'use strict';
var NAME = "BouncingBall";
var INTERVAL = 1000 / 60; //bigger make speed slower
var COUNT_FRAME = 0;
var WORD_FRAME = 40 //bigger make speed slower
var SPEED = 1;
var JUMP_OFFSET = 10;
var PI = 3.14159265359;
var ROTATE_SPEED = 1;
var ROTATE_DIRECTION = "rotateY";
var AFTER_IMAGE = 5;
var CLASS = {
container: "container",
bouncing: "bouncing",
word: "word",
hint: "hint",
ball: "ball",
customStyle: "custom-style"
}
var DEFAULT = {
text: "Where do I begin. To tell the story of how great a love can be",
bounceDelay: 1 // frame
}
var requestAnimation = function(callback) {
COUNT_FRAME++;
window.setTimeout(callback, INTERVAL * SPEED);
};
var resetFrame = function() {
COUNT_FRAME = 0;
}
function BouncingBall() {
for (var i = 0; i < AFTER_IMAGE; i++) {
var span = document.createElement("span");
span.addClass("ball");
document.querySelector("body").appendChild(span);
}
this.container = document.querySelector("." + CLASS.container);
this.ball = document.querySelectorAll("." + CLASS.ball);
this.text = DEFAULT.text;
this.bounceDelay = DEFAULT.bounceDelay;
this.count = 0;
this.states = [];
this.positionFrame = [];
this.timer ;
this.parseText = this.parseText.bind(this);
this.parseTime = this.parseTime.bind(this);
this.onWindowResize= this.onWindowResize.bind(this);
this.resetEffect = this.resetEffect.bind(this);
this.initialize = this.initialize.bind(this);
this.onAnimationFrame = this.onAnimationFrame.bind(this);
this.onChangeSetting = this.onChangeSetting.bind(this);
this.firstTime = true;
}
var getDelay = function(word) {
if (!word || word.length == 0) return 0;
var delayTime = (1 + word.length / 5) * WORD_FRAME;
if (/\.|,/.test(word)) delayTime += WORD_FRAME;
return delayTime;
}
var testPosition = function(arr) {
var test = document.querySelectorAll(".test");
for (var i=0,t; i<test.length; i++) {
t = test[i];
t.parentNode.removeChild(t);
}
test = document.createElement("div");
test.addClass("test");
document.querySelector("body").appendChild(test);
for (var i = 0; i < arr.length; i++) {
var span = document.createElement("span");
span.addClass(CLASS.ball);
test.appendChild(span);
span.style.left = arr[i].left + "px";
span.style.top = arr[i].top + "px";
span.innerHTML = arr[i].state;
}
}
BouncingBall.prototype.initialize = function(){
this.parseText();
this.parseTime();
this.resetEffect();
if (this.firstTime) {
this.onAnimationFrame();
this.firstTime = false;
}
}
BouncingBall.prototype.parseText = function() {
var arr = this.text.replace(/\s+/g, " ").trim().split(" ");
//add text
this.container.empty();
console.log(this.container);
this.container.clean();
for (var i = 0; i < arr.length; i++) {
var span = document.createElement("span");
span.innerHTML = arr[i];
span.addClass(CLASS.word);
this.container.appendChild(span);
}
}
BouncingBall.prototype.parseTime = function() {
//calculate time and width
this.states = [];
var children = this.container.childNodes;
var firstWord = children[0];
var prev = {
top: firstWord.offsetTop - JUMP_OFFSET,
left: firstWord.offsetLeft - 40,
start: 0,
end: WORD_FRAME
};
this.states.push(prev);
for (var i = 0; i < children.length; i++) {
var delay = getDelay(children[i].innerHTML) * this.bounceDelay;
var left = children[i].offsetWidth / 2;
var current = {
top: children[i].offsetTop - JUMP_OFFSET,
left: children[i].offsetLeft + (left > 10 ? left : 2),
start: prev.end + 1,
end: prev.end + delay
}
this.states.push(current);
prev = current;
}
var lastWord = children[children.length - 1];
this.states.push({
top: lastWord.offsetTop - JUMP_OFFSET,
left: lastWord.offsetLeft + lastWord.offsetWidth + 40,
start: prev.end + 1,
end: prev.end + WORD_FRAME
});
//calculate position of ball on each frame
var rotate = 0;
this.positionFrame = [];
for (var i = 0; i < this.states.length - 1; i++) {
var current = this.states[i];
var next = this.states[i + 1];
var dLeft = next.left - current.left;
var dTop = next.top - current.top;
for (var frame = current.start; frame <= current.end; frame++) {
var percent = (frame - current.start) / (current.end - current.start);
var pos = {
left: current.left + dLeft * percent,
top: current.top + dTop * percent - Math.sin(PI * percent) * JUMP_OFFSET,
percent: percent,
state: i,
rotate: rotate
};
rotate += ROTATE_SPEED;
this.positionFrame.push(pos);
}
}
//testPosition(this.states);
//testPosition(this.positionFrame);
}
BouncingBall.prototype.resetEffect = function() {
this.count = 0;
var children = this.container.childNodes;
for (var i = 0; i < children.length; i++) {
children[i].removeClass(CLASS.hint);
}
for (var i = 0; i < this.ball.length; i++) {
this.ball[i].style.opacity = 0;
}
resetFrame();
}
BouncingBall.prototype.onWindowResize = function() {
this.parseTime();
this.resetEffect();
}
BouncingBall.prototype.onAnimationFrame = function() {
var children = this.container.childNodes;
if (COUNT_FRAME >= this.states[this.count].end) {
if (this.count < children.length) children[this.count].addClass(CLASS.hint)
this.count++;
if (this.count > this.states.length - 1) {
this.resetEffect();
}
}
for (var i = 0; i < AFTER_IMAGE; i++) {
var pos = this.positionFrame[COUNT_FRAME - i * 10];
if (typeof pos != 'undefined') {
var transform = "translate(" + (pos.left - i * 2) + "px," + (pos.top - i) + "px) " +
ROTATE_DIRECTION+"(" + (pos.rotate - i * ROTATE_SPEED) + "deg) " +
"scale(" + (1 - i / AFTER_IMAGE) + ")";
this.ball[i].style.transform = transform;
this.ball[i].style.opacity = 1;
}
}
requestAnimation(this.onAnimationFrame);
}
BouncingBall.prototype.onEditMode = function() {}
//remove html from text
var stripHtml = function(html) {
html = html.replace(/(<[^>]+>)/ig, " ").trim();
html = html.replace(/\s{2,}/ig, ", ");
return html;
}
BouncingBall.prototype.onChangeSetting = function() {
if (typeof BannerFlow === 'undefined') return;
if (BannerFlow.text) {
this.text = stripHtml(BannerFlow.text);
if (this.text.length == 0) this.text = DEFAULT.text;
}
if (BannerFlow.settings.Speed && BannerFlow.settings.Speed > 0) {
SPEED = 1 / +BannerFlow.settings.Speed;
}
if (BannerFlow.settings.JumpOffset) {
JUMP_OFFSET = BannerFlow.settings.JumpOffset;
}
if (BannerFlow.settings.AfterImage) {
AFTER_IMAGE = BannerFlow.settings.AfterImage;
document.querySelector("body").empty(".ball");
for (var i = 0; i < AFTER_IMAGE; i++) {
var span = document.createElement("span");
span.addClass("ball");
document.querySelector("body").appendChild(span);
}
this.ball = document.querySelectorAll(".ball")
}
if (BannerFlow.settings.RotateSpeed != null) {
ROTATE_SPEED = BannerFlow.settings.RotateSpeed;
}
if (BannerFlow.settings.RotateDirection != null) {
ROTATE_DIRECTION = BannerFlow.settings.RotateDirection;
}
var style = "";
var getStyle = function(selector, styleObj) {
var newStyle = selector + "{";
for (var attr in styleObj) {
if (styleObj[attr]) {
newStyle += attr + " : " + styleObj[attr] + ";";
}
}
newStyle += "}";
return newStyle;
}
style += getStyle(".word", {
"color": (BannerFlow.settings.ShowOnHint ? "transparent" : BannerFlow.settings.FontColor ? BannerFlow.settings.FontColor : ""),
"font-size": (BannerFlow.settings.FontSize ? BannerFlow.settings.FontSize + "px" : ""),
"line-height": (BannerFlow.settings.LineHeight ? BannerFlow.settings.LineHeight + "px": ""),
"font-family": (BannerFlow.settings.FontFamily ? getFont(BannerFlow.settings.FontFamily) : "")
});
var imgUrl = getImages(BannerFlow.settings.BallImage)[0];
style += getStyle(".ball", {
"background-color": (BannerFlow.settings.BallColor ? BannerFlow.settings.BallColor : ""),
"width": (BannerFlow.settings.BallSize ? BannerFlow.settings.BallSize + "px" : ""),
"height": (BannerFlow.settings.BallSize ? BannerFlow.settings.BallSize + "px" : ""),
"background": (imgUrl ? "url('" + imgUrl + "') center center no-repeat" : "")
});
style += getStyle(".hint", {
"color": (BannerFlow.settings.HintColor) ? BannerFlow.settings.HintColor : "",
"text-shadow": (BannerFlow.settings.HintColor && BannerFlow.settings.HintShadowSize >= 0) ? "0px 0px " + BannerFlow.settings.HintShadowSize + "px " + BannerFlow.settings.HintColor : ""
});
document.querySelector("#" + CLASS.customStyle).innerHTML = style;
this.initialize();
}
window[NAME] = BouncingBall;
};
var widget = null;
var ball = null;
if (typeof BannerFlow == 'undefined') {
window.addEventListener("load", function() {
if (widget == null) widget = BouncingBallWidget(window, document, undefined);
if (ball == null) ball = new BouncingBall();
ball.initialize();
ball.onEditMode();
});
window.addEventListener("resize", function() {
if (ball != null) {
clearTimeout(this.timer);
this.timer = setTimeout(function(){ball.onWindowResize();}.bind(this),100);
}
});
} else {
BannerFlow.addEventListener(BannerFlow.TEXT_CHANGED, function() {
if (ball != null) {
clearTimeout(this.timer);
this.timer = setTimeout(function(){ball.onChangeSetting();}.bind(this),500);
}
});
BannerFlow.addEventListener(BannerFlow.SETTINGS_CHANGED, function() {
if (ball != null) {
clearTimeout(this.timer);
this.timer = setTimeout(function(){ball.onChangeSetting();}.bind(this),500);
}
});
BannerFlow.addEventListener(BannerFlow.INIT, function() {
if (widget == null) widget = BouncingBallWidget(window, document, BannerFlow);
if (ball == null) ball = new BouncingBall();
clearTimeout(this.timer);
this.timer = setTimeout(function(){ball.onChangeSetting();}.bind(this),500);
if (BannerFlow.editorMode) ball.onEditMode();
});
}
|
import {
DASHBOARD_CARD_REQUEST,
DASHBOARD_CARD_SUCCESS,
DASHBOARD_CARD_FAILURE,
} from './dashboard-constants';
const dashboardCardRequest = () => ({
type: DASHBOARD_CARD_REQUEST,
});
export const dashboardCardSuccess = (data) => ({
data,
type: DASHBOARD_CARD_SUCCESS,
});
export const dashboardCardFailure = () => ({
type: DASHBOARD_CARD_FAILURE,
});
export const dashboardCard = async (dispatch) => {
dispatch(dashboardCardRequest());
};
|
function squareRootConvergents(expansionsBelowN) {
let count = 0;
for(const frac of sqrtIterations()) {
if(moreDigits(frac.num, frac.denom)) {
count ++;
}
}
return count;
function* sqrtIterations() {
let iterations = 0, frac = {num: 1, denom: 1};
while(iterations++ <= expansionsBelowN) {
let denom = frac.num + frac.denom;
let num = frac.denom + denom;
frac = reduceFraction({ num, denom });
yield frac;
}
}
//These fractions don't reduce (kinda makes sense for an irrational number). This "reduces" the fraction and still retains enough precision
function reduceFraction(frac) {
const res = { ...frac }
if(frac.num > 100 && frac.denom > 100) {
res.num /= 10;
res.denom /= 10;
}
return res;
}
function moreDigits(a,b) {
let pow10 = 1;
while(pow10 < a) {
pow10 *= 10;
}
return Math.floor(b / (pow10 / 10)) === 0
}
}
console.log(squareRootConvergents(1000))
|
// import React from 'react';
// import {
// Link,
// IndexLink
// } from 'react-router';
// export default class navlink extends React.Component {
// constructor(props) {
// super(props);
// }
// render() {
// return <IndexLink {...this.props} activeClassName="active"/>
// }
// }
|
'use strict';
const fs = require('fs');
const path = require('path');
module.exports = {
findOrCreate(filePath) {
return fs.stat(filePath, (err, stat) => {
if (!err) {
return false;
} else if(err.code == 'ENOENT') {
// file does not exist
fs.readFile(path.join(__dirname, 'tg-init/templates/terragrunt-template'), (err, data) => {
if (err) throw err;
fs.writeFile('.terragrunt', data);
return true;
});
}
return false;
});
}
};
|
import adminProductList from '@/web-client/reducers/admin/adminProductList';
import {
LOAD_ADMIN_PRODUCT_LIST,
CREATE_PRODUCT,
UPDATE_PRODUCT, DELETE_PRODUCT,
} from '@/web-client/actions/constants';
import {
dropRight,
map,
omit
} from 'lodash/fp';
jest.setTimeout(30000);
describe('adminProductList', () => {
it('should take a decent array of products.', async () => {
const products = [
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
},
['something'],
true,
{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
imageId: 'test',
something: true,
},
];
const newState = adminProductList(undefined, {
type: LOAD_ADMIN_PRODUCT_LIST,
payload: products,
});
expect(newState).toEqual([
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
},
{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
imageId: 'test',
},
]);
const newState2 = adminProductList([], {
type: LOAD_ADMIN_PRODUCT_LIST,
payload: {},
});
expect(newState2).toEqual([]);
});
it('should not take an array of products with a duplicated id.',
async () => {
const products = [
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
extra: 'not needed',
},
{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
},
{
id: '1',
name: 'name3',
price: 40,
description: 'testtesttest',
},
];
const newState = adminProductList(undefined, {
type: LOAD_ADMIN_PRODUCT_LIST,
payload: products,
});
const decentProducts = dropRight(1)(
map(omit(['extra']))(products));
expect(newState).toEqual(decentProducts);
});
it('should add a new product.',
async () => {
const product =
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
extra: 'not needed',
};
const newState = adminProductList(undefined, {
type: CREATE_PRODUCT,
payload: product,
});
expect(newState).toEqual([{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
}]);
});
it('should update a product.',
async () => {
const products = [
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
},
{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
}
];
const newProduct = {
id: '1',
name: 'newName',
price: 100,
description: 'updated description',
};
const newState = adminProductList(products, {
type: UPDATE_PRODUCT,
payload: newProduct,
});
expect(newState).toEqual([{
id: '1',
name: 'newName',
price: 100,
description: 'updated description',
}, {
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
}]);
});
it('should delete a product.',
async () => {
const products = [
{
id: '1',
name: 'name1',
price: 1,
description: 'testtesttest',
},
{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
}
];
const newState = adminProductList(products, {
type: DELETE_PRODUCT,
payload: {id: '1'},
});
expect(newState).toEqual([{
id: '2',
name: 'name2',
price: 20,
description: 'testtesttest',
}]);
});
});
|
function Shape(c, s, n) {
//check if args given, if not set args to =1
if(typeof(c)==='undefined') c = Math.floor((Math.random() * 4));
if(typeof(s)==='undefined') s = Math.floor((Math.random() * 4));
if(typeof(n)==='undefined') n = Math.floor((Math.random() * 4));
//set initial values
var color = c;
var shape = s;
var number = n;
//getters
this.getColor = function() {
return color;
}
this.getShape = function() {
return shape;
}
this.getNumber = function() {
return number;
}
//generate random vals
this.reroll = function() {
color = Math.floor((Math.random() * 4));
shape = Math.floor((Math.random() * 4));
number = Math.floor((Math.random() * 4));
}
}
//Globals
var patternElements = [];
var PATTERN_LENGTH = 1;
var TIME_ALLOWED = 5;
var VIEW_TIME = 3000;
var VARIABLES = 1;
var REMEMBER_PATTERN = 1;
var DIFFICULTY = 6;
var position = 0;
var total_incorrect = 0;
var start_time;
var end_time;
var timer_id;
var game_won = 0;
var TIME_FOR_INCORRECT = 2.5;
var time_remaining;
var time_under_total = 0;
function setDifficulty() {
switch(DIFFICULTY) {
case 0:
VARIABLES = 1;
REMEMBER_PATTER = 1;
break;
case 1:
VARIABLES = 2;
REMEMBER_PATTER = 1;
break;
case 2:
VARIABLES = 3;
REMEMBER_PATTER = 1;
break;
case 3:
VARIABLES = 1;
REMEMBER_PATTER = 0;
break;
case 4:
VARIABLES = 2;
REMEMBER_PATTER = 0;
break;
case 5:
VARIABLES = 3;
REMEMBER_PATTER = 0;
break;
}
}
function getShapeClass(sha) {
var shapeClass = "";
switch(sha) {
case 0:
shapeClass = "circle2 ";
break;
case 1:
shapeClass = "triangle2 ";
break;
case 2:
shapeClass = "square2 ";
break;
case 3:
shapeClass = "pentagon2 ";
break;
}
return shapeClass;
}
function getColorClass(col) {
var colorClass = "";
switch(col) {
case 0:
colorClass = "blue ";
break;
case 1:
colorClass = "pink ";
break;
case 2:
colorClass = "yellow ";
break;
case 3:
colorClass = "green ";
break;
}
return colorClass;
}
function rememberMain() {
setDifficulty();
var s1 = new Shape();
s1.reroll()
col = s1.getColor();
sha = s1.getShape();
num = s1.getNumber();
var shapeClass = getShapeClass(sha);
var colorClass = getColorClass(col);
var numchar = getNumchar(num, 1);
var elementWrapper = getPatternElement(shapeClass, colorClass, numchar);
patternElements.push([col,sha,num]);
$(elementWrapper).appendTo('.patternDiv').hide();
for(i = 0; i < PATTERN_LENGTH; i++) {
var id = "#sw" + i;
$(id).show();
}
console.log(patternElements);
NProgress.configure({ minimum: 0.0 });
NProgress.configure({ trickle: false });
NProgress.configure({ ease: 'ease', speed: 200 });
NProgress.configure({ parent: '.progressBar' });
NProgress.set(0.0);
//return;
var keyboardType = Math.floor((Math.random() * VARIABLES));
setTimeout(function(){
generateKeyboard(keyboardType);
bindClick(keyboardType);
createTimer(TIME_ALLOWED);
}, VIEW_TIME);
}
function getPatternElement(shapeClass,colorClass,numchar) {
var id = "'s" + (PATTERN_LENGTH) + "'";
switch(VARIABLES) {
case 1:
var classStr = "'shape2 " + colorClass + "circle2" + "'";
var element = "<div id=" + id + " class=" + classStr + ">" + "</div>";
break;
case 2:
var classStr = "'shape2 " + colorClass + shapeClass + "'";
var element = "<div id=" + id + " class=" + classStr + ">" + "</div>";
break;
case 3:
var classStr = "'shape2 " + colorClass + shapeClass + "'";
var element = "<div id=" + id + " class=" + classStr + ">" + numchar + "</div>";
break;
}
var elementWrapper = "<div id='sw" + i + "' class='wrapper'>" + element + "</div>";
return elementWrapper;
}
function main() {
var s1 = new Shape();
var col = s1.getColor();
var sha = s1.getShape();
var num = s1.getNumber();
console.log("color " + col + " shape " + sha + " num " + num);
for(i = 0; i < PATTERN_LENGTH; i++) {
var id = "'s" + i + "'";
s1.reroll();
col = s1.getColor();
sha = s1.getShape();
num = s1.getNumber();
var shapeClass = getShapeClass(sha);
var colorClass = getColorClass(col);
var numchar = getNumchar(num, 1);
var elementWrapper = getPatternElement(shapeClass, colorClass, numchar);
patternElements.push([col,sha,num]);
$('.patternDiv').append(elementWrapper);
}
console.log(patternElements);
NProgress.configure({ minimum: 0.0 });
NProgress.configure({ trickle: false });
NProgress.configure({ ease: 'ease', speed: 200 });
NProgress.configure({ parent: '.progressBar' });
NProgress.set(0.0);
//return;
var keyboardType = Math.floor((Math.random() * VARIABLES));
setTimeout(function(){
generateKeyboard(keyboardType);
bindClick(keyboardType);
createTimer(TIME_ALLOWED);
}, VIEW_TIME);
}
function getNumchar(num, type) {
if(typeof(type)==='undefined') type = 0;
if(type == 0) {
switch(num) {
case 0:
numchar = "A";
break;
case 1:
numchar = "B";
break;
case 2:
numchar = "X";
break;
case 3:
numchar = "Y";
break;
}
}
else if(type == 1) {
switch(num) {
case 0:
numchar = "\u03C0"; //pi
break;
case 1:
numchar = "\u03B2"; //beta
break;
case 2:
numchar = "\u03A9"; //Omega
break;
case 3:
numchar = "\u03A3"; //Sigma
break;
}
}
return numchar;
}
function generateKeyboard(type) {
for(i = 0; i < PATTERN_LENGTH; i++) {
var id = "#s" + i;
$(id).delay(250 * i).fadeOut(500);
}
switch(type) {
case 0:
colorKeyboard();
break;
case 1:
shapeKeyboard();
break;
case 2:
numberKeyboard();
break;
}
//box around first item to guess
$('#sw0').addClass("currentshape");
}
function shapeKeyboard() {
var keyboard_delay = 250 * PATTERN_LENGTH;
var b0 = "<div id='b0' class=" + "'btn pointer shape grey circle2'" + ">" + "</div>";
var b1 = "<div id='b1' class=" + "'btn pointer shape grey triangle2'" + ">" + "</div>";
var b2 = "<div id='b2' class=" + "'btn pointer shape grey square2'" + ">" + "</div>";
var b3 = "<div id='b3' class=" + "'btn pointer shape grey pentagon2'" + ">" + "</div>";
$(b0).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b1).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b2).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b3).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
}
function colorKeyboard() {
var keyboard_delay = 250 * PATTERN_LENGTH;
var b0 = "<div id='b0' class=" + "'pointer shape blue circle'" + ">" + "</div>";
var b1 = "<div id='b1' class=" + "'pointer shape pink circle'" + ">" + "</div>";
var b2 = "<div id='b2' class=" + "'pointer shape yellow circle'" + ">" + "</div>";
var b3 = "<div id='b3' class=" + "'pointer shape green circle'" + ">" + "</div>";
$(b0).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b1).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b2).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b3).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
}
function numberKeyboard() {
var keyboard_delay = 250 * PATTERN_LENGTH;
var b0 = "<div id='b0' class=" + "'pointer shape grey circle'" + ">" + getNumchar(0, 1) + "</div>";
var b1 = "<div id='b1' class=" + "'pointer shape grey circle'" + ">" + getNumchar(1, 1) + "</div>";
var b2 = "<div id='b2' class=" + "'pointer shape grey circle'" + ">" + getNumchar(2, 1) + "</div>";
var b3 = "<div id='b3' class=" + "'pointer shape grey circle'" + ">" + getNumchar(3, 1) + "</div>";
$(b0).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b1).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b2).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
$(b3).appendTo('.keyboardDiv').hide().delay(keyboard_delay).fadeIn(250);
}
//determine time till end
function createTimer(allowed) {
var keyboard_delay = 0.25 * PATTERN_LENGTH + 0.3;
var end = new Date();
start_time = new Date();
end.setSeconds(end.getSeconds() + allowed + keyboard_delay);
console.log("Timer ends at " + end);
end_time = end;
timer_id = setInterval(checkTimer, 100);
}
function decrementTimer(amount) {
var newtime = end_time;
newtime.setSeconds(newtime.getSeconds() - amount);
end_time = newtime;
}
function checkTimer() {
var now = new Date();
var dif = end_time - now;
var dif_secs = dif / 1000;
time_remaining = dif_secs;
var pct = (TIME_ALLOWED - dif_secs) / TIME_ALLOWED;
//Time is up
if(now >= end_time) {
NProgress.set(1);
clearInterval(timer_id);
gameOver(0);
}
//update progress bar
else {
NProgress.set(pct + 0.01);
}
}
//make keyboard clickable after loading keyboard
function bindClick(keyboard) {
$('#b0').click(function(){
console.log('Clicked 0!!');
checkInput(0,keyboard);
});
$('#b1').click(function(){
console.log('Clicked 1!!');
checkInput(1,keyboard);
});
$('#b2').click(function(){
console.log('Clicked 2!!');
checkInput(2,keyboard);
});
$('#b3').click(function(){
console.log('Clicked 3!!');
checkInput(3,keyboard);
});
}
function checkInput(button, keyboard) {
var answer = patternElements[position][keyboard];
console.log("answer is " + answer + " at position " + position);
if(button == answer) {
var id = "#s" + position;
var wid = "#sw" + position;
if((position+1) < patternElements.length) {
$(id).fadeIn(200);
$(wid).removeClass("currentshape");
position++;
wid = "#sw" + position;
$(wid).addClass("currentshape");
}
//you got the last item. you win
else {
console.log("WIN WITH " + time_remaining + "s REMAINING");
time_under_total += (time_remaining);
console.log("TOTAL TIME UNDER TARGET- " + time_under_total + "s");
clearInterval(timer_id);
$(id).show();
gameOver(1);
}
}
else {
total_incorrect++;
decrementTimer(TIME_FOR_INCORRECT);
console.log("INCORRECT");
}
}
function destroyKeyboard(ms) {
if(typeof(ms)==='undefined') ms = 500;
$('#b0').fadeOut(ms).remove();
$('#b1').fadeOut(ms).remove();
$('#b2').fadeOut(ms).remove();
$('#b3').fadeOut(ms).remove();
}
function gameOver(win) {
destroyKeyboard(1000);
for(i = 0; i < PATTERN_LENGTH; i++) {
var id = "#sw" + i;
$(id).fadeOut(1000);
}
$('#levelscore').text("-" + time_under_total + " seconds total");
if(win) {
var msg = "<h3 class='resulttext wintext'>You won with " + Math.round(time_remaining) + " of " + TIME_ALLOWED + "<br>seconds remaining." + "</h3>";
$(msg).appendTo('.patternDiv').hide().delay(1000).fadeIn(500);
//continue
var contmsg = "<h3 class='pointer resulttext continue'>Continue</h3>";
$(contmsg).appendTo('.patternDiv').hide().delay(1000).slideToggle(300);
$('.continue').click(function(){
var remember = REMEMBER_PATTERN;
refreshBoard(remember);
if(!remember) {
patternElements = [];
}
PATTERN_LENGTH++;
TIME_ALLOWED += 2.5;
VIEW_TIME += 1000;
position = 0;
if(remember) {
rememberMain();
}
else {
main();
}
});
}
else {
var msg = "<h3 class='resulttext losetext'>Sorry, you forgot.<br>Final Score: -" + time_under_total + "s</h3>";
$(msg).appendTo('.patternDiv').hide().delay(1200).fadeIn(500);
}
var retrymsg = "<h3 class='pointer resulttext tryagain'>Start Over</h3>";
$(retrymsg).appendTo('.patternDiv').hide().delay(1200).fadeIn(500);
$('.tryagain').click(function(){
window.location.reload();
});
}
function refreshBoard(remember) {
$('.wintext').fadeOut(500).remove();
$('.losetext').fadeOut(500).remove();
$('.tryagain').fadeOut(500).remove();
$('.continue').fadeOut(500).remove();
if(remember){
return;
}
for(i = 0; i < PATTERN_LENGTH; i++) {
var id = "#sw" + i;
$(id).remove();
}
}
|
import { useState } from "react";
import currency from "currency.js";
import { useNotification } from "./useNotification";
import { toMoney } from "../helpers/masks";
import values from "../values.json";
export function useWallet() {
const data = JSON.parse(JSON.stringify(values));
const [wallet, setWallet] = useState({
real: 5000,
dollar: 0,
euro: 0,
});
const [fee, setFee] = useState({
from: "BRL",
to: "USD",
});
const [value, setValue] = useState(0);
const showNotification = useNotification();
const doTransaction = (from, to, value) => {
if (wallet[fee.from] < value / 100) {
return showNotification(
"O valor escolhido é maior do que o limite disponível!",
"warning"
);
} else {
return setWallet({
...wallet,
[fee.from]: currency(wallet[fee.from]).subtract(value / 100).value,
// this operation converts the value passed to reais
// and converts it again to the coin selected.
// In a math way: fee.to = fee.to + (value / 100) * from.value / to.value
[fee.to]: currency(wallet[fee.to]).add(
currency(value).divide(100).multiply(from.value).divide(to.value)
.value
).value,
});
}
};
const transaction = (from, to, value) => {
const dictionary = {
real: {
dollar: () =>
doTransaction(
{ target: from, value: 1 },
{
target: to,
value: Number(
toMoney(data.USD.bid).replace("R$ ", "").replace(",", ".")
),
},
value
),
euro: () =>
doTransaction(
{ target: from, value: 1 },
{
target: to,
value: Number(
toMoney(data.EUR.bid).replace("R$ ", "").replace(",", ".")
),
},
value
),
real: () =>
showNotification("Por favor, selecione outra moeda!", "warning"),
},
dollar: {
dollar: () =>
showNotification("Por favor, selecione outra moeda!", "warning"),
euro: () =>
doTransaction(
{
target: to,
value: Number(
toMoney(data.USD.bid).replace("R$ ", "").replace(",", ".")
),
},
{
target: from,
value: Number(
toMoney(data.EUR.bid).replace("R$ ", "").replace(",", ".")
),
},
value
),
real: () =>
doTransaction(
{
target: to,
value: Number(
toMoney(data.USD.bid).replace("R$ ", "").replace(",", ".")
),
},
{ target: from, value: 1 },
value
),
},
euro: {
dollar: () =>
doTransaction(
{
target: to,
value: Number(
toMoney(data.EUR.bid).replace("R$ ", "").replace(",", ".")
),
},
{
target: from,
value: Number(
toMoney(data.USD.bid).replace("R$ ", "").replace(",", ".")
),
},
value
),
euro: () =>
showNotification("Por favor, selecione outra moeda!", "warning"),
real: () =>
doTransaction(
{
target: to,
value: Number(
toMoney(data.EUR.bid).replace("R$ ", "").replace(",", ".")
),
},
{ target: from, value: 1 },
value
),
},
};
return dictionary[from][to]();
};
return {
transaction,
setFee,
fee,
value,
setValue,
};
}
|
// shared variables for js and css
import SHARED from '../shared-variables'
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.delBlog = exports.updateBlog = exports.newBlog = exports.getDetail = exports.getList = void 0;
const mysql_1 = require("../db/mysql");
const xss_1 = __importDefault(require("xss"));
// xxx.html?a=1&k1=v1&k2=v2&k3=v3 利用 a=1 占住开头,这样后面的格式就统一了
// 获取博客列表数据
const getList = (author, keyword) => {
// 没有 author 就返回所有的 博客数据
let sql = `select * from blogs where 1=1 `; // 1=1 的意义:防止 where 后面没有值
if (author)
sql += `and author='${author}' `;
if (keyword)
sql += `and title like '%${keyword}%' `;
sql += `order by createtime desc`; // 降序排列
console.log('sql is: ', sql);
// 返回 promise
return (0, mysql_1.exec)(sql);
};
exports.getList = getList;
// 获取博客详情
function getDetail(id) {
const blogId = (0, mysql_1.escape)(id);
const sql = `select * from blogs where id = ${blogId}`;
return (0, mysql_1.exec)(sql).then(blogList => blogList[0]);
}
exports.getDetail = getDetail;
// 创建新博客
function newBlog(blogData) {
var _a, _b;
// blogData 是一个博客对象,包含 title content 属性
const title = (0, xss_1.default)((_a = blogData === null || blogData === void 0 ? void 0 : blogData.title) !== null && _a !== void 0 ? _a : "");
console.log('title', title);
const content = (0, xss_1.default)((_b = blogData === null || blogData === void 0 ? void 0 : blogData.content) !== null && _b !== void 0 ? _b : "");
const author = blogData === null || blogData === void 0 ? void 0 : blogData.author;
const createTime = Date.now();
const sql = `insert into blogs(title, content, createtime, author) values('${title}', '${content}', ${createTime}, '${author}');`;
console.log('sql is: ', sql);
// 表示新建博客,插入到数据表里面的 id
return (0, mysql_1.exec)(sql).then(okPacket => ({ id: okPacket.insertId }));
}
exports.newBlog = newBlog;
// 更新一个博客
function updateBlog(id, blogData) {
var _a, _b;
// id 就是要更新的博客 id
// blogData 是一个博客对象,包含 title content 属性
// console.log('update blog', id, blogData);
const title = (0, xss_1.default)((_a = blogData === null || blogData === void 0 ? void 0 : blogData.title) !== null && _a !== void 0 ? _a : "");
const content = (0, xss_1.default)((_b = blogData === null || blogData === void 0 ? void 0 : blogData.content) !== null && _b !== void 0 ? _b : "");
const sql = `update blogs set title=${title}, content=${content} where 1=1 and id=${id}`;
return (0, mysql_1.exec)(sql).then(okPacked => okPacked.changedRows > 0);
}
exports.updateBlog = updateBlog;
// 删除一个博客
function delBlog(id, author) {
const blogId = (0, mysql_1.escape)(id);
author = (0, mysql_1.escape)(author);
// id 就是要删除的博客 id
const sql = `delete from blogs where id=${blogId} and author=${author}`;
return (0, mysql_1.exec)(sql).then(okPacked => okPacked.affectedRows > 0);
}
exports.delBlog = delBlog;
|
const db = require("../models");
const Centro = db.centros;
const Op = db.Sequelize.Op;
// Create and Save a new Centro
// req --> request (contains the body)
exports.create = (req, res) => {
// Validate request
/*if (!req.body.ID_whis || !req.body.Nombre) {
res.status(400).send({
message: "Content can not be empty!"
});
return;
}*/
// Create a Centro
const centro = {
idCentro: req.body.Id_Centro,
nombre: req.body.nombre,
codigo_Postal:req.body.codigo_Postal,
idMunicipios : req.body.idMunicipios ,
lat: parseDouble(req.body.lat) ,
long: parseDouble(req.body.long)
};
// Save Centro in the database
Centro.create(centro)
.then(data => {
res.send(data);
})
.catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while creating the Centro."
});
});
};
// Retrieve all Centros from the database.
exports.findAll = (req, res) => {
Centro.findAll()
.then(data => {
res.send(data);
})
.catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while retrieving Centros."
});
});
};
// Find a single Centro with an id
exports.findOne = (req, res) => {
let id = req.params.id;
Centro.findByPk(id)
.then(data => {
console.log("estos son los datos")
console.log(data);
if (!data) {
res.status(400).send({
message: "No Centro found with that id"
})
}
res.send(data);
return;
})
.catch(err => {
console.log(err.message);
console.log("hola");
res.status(500).send({
message: err.message || "Some error occurred while retrieving Centro with id"
});
return;
});
};
// Update a Tutorial by the id in the request
exports.update = (req, res) => {
let id = req.body.id;
const centro = {
idCentro: req.body.Id_Centro,
nombre: req.body.nombre,
codigo_Postal:req.body.codigo_Postal,
idMunicipios : req.body.idMunicipios ,
lat: parseDouble(req.body.lat) ,
long: parseDouble(req.body.long)
};
Centro.update(id)
.then(data => {
res.send(data);
})
.catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while retrieving Centros."
});
});
};
// Delete a Tutorial with the specified id in the request
exports.delete = (req, res) => {
let id = req.params.id;
Centro.delete(id)
.then(data => {
res.send(data);
})
.catch(err => {
res.status(500).send({
message: err.message || "Some error occurred while retrieving Centros."
});
});
};
|
"use strict";
var Q = function(_ref) {
var Q = function Q() {
_ref.apply(this, arguments);
};
Q.prototype = Object.create(_ref.prototype, {
constructor: {
value: Q,
enumerable: false,
writable: true,
configurable: true
}
});
Q.__proto__ = _ref;
return Q;
}(function() {});
|
/* eslint-disable */
const eslint = require('./.eslintrc.js');
const jest = require('./jest.config.js');
const prettier = require('./.prettierrc.js');
module.exports = {
eslint,
jest,
prettier,
};
|
const fs = require("fs");
const util = require("util");
const mkdir = util.promisify(fs.mkdir);
module.exports = mkdir;
|
import { SET_CUP_ON, SET_CUP_OFF } from '../actions';
const initialState = true
export default function cupDisplayReducer(state = initialState, action) {
switch (action.type) {
case SET_CUP_ON:
return action.cupDisplay
case SET_CUP_OFF:
return action.cupDisplay
default:
return state;
}
}
|
import React,{useState,useContext} from 'react'
import Modal from 'react-bootstrap/Modal'
import OverlayTrigger from 'react-bootstrap/OverlayTrigger'
import Form from 'react-bootstrap/Form'
const EditPostModal = () => {
return (
<div>
</div>
)
}
export default EditPostModal
|
export const defData = [
{
id: 1,
name: 'Monday',
events: [
{ title: 'Study', edit: false },
{ title: 'Work', edit: false },
{ title: 'Gym', edit: false }
],
active: true
},
{
id: 2,
name: 'Tuesday',
events: [
{ title: 'Study', edit: false }
],
active: false
},
{
id: 3,
name: 'Wednesday',
events: [
{ title: 'Gym', edit: false }
],
active: false
},
{
id: 4,
name: 'Thursday',
events: [],
active: false
},
{
id: 5,
name: 'Friday',
events: [
{ title: 'Work', edit: false },
{ title: 'Gym', edit: false }
],
active: false
},
{
id: 6,
name: 'Saturday',
events: [
{ title: 'Watching a film', edit: false },
{ title: 'Shopping', edit: false }
],
active: false
},
{
id: 7,
name: 'Sunday',
events: [
{ title: 'Cleaning', edit: false }
],
active: false
}
]
|
var turf = require('@turf/turf'),
flatten = require('geojson-flatten'),
normalize = require('@mapbox/geojson-normalize'),
tilebelt = require('@mapbox/tilebelt'),
fs = require('fs'),
hashF = require('object-hash'),
fx = require('mkdir-recursive');
module.exports = function(data, tile, writeData, done) {
/* refDeltas is a featureCollection (array of features) it permits the stockage of our issues
streetBuffers is the variable that contains the buffers created on the basis of OSM source data
refRoads is the variable that contains the open data reference source
refRoadType takes the type of the feature we are actually processing and permits us to have clearer statements while comparing the tags (useful if we use two inputs (one with Polygons & the other one with LineStrings))
RefRoads & diffRoads -length are the variables for calculating the total length of the open data reference source
*/
var refDeltas = turf.featureCollection([]);
var streetBuffers = undefined;
var refRoads = undefined;
var refRoadType = "";
var refRoadsLength = 0;
var diffRoadsLength = 0;
var refRoadsCount = 0;
var debugDir = "/home/xivk/work/osmbe/road-completion/debug/";
var errorMessage = "";
if (!fs.existsSync(debugDir)) {
debugDir = undefined;
}
try {
if (tile[2] == 14)
{
var tileDir = tile[2] + "/" + tile[0] + "/";
var tileName = tile[1] + ".geojson";
var osmDataDir = debugDir + "osmdata/" + tileDir;
var refRoadsDir = debugDir + "refroads/" + tileDir;
var osmBuffersDir = debugDir + "osmbuffers/" + tileDir;
var diffsDir = debugDir + "diffs/" + tileDir;
// setting up the debug directory
if (debugDir) {
if (!fs.existsSync(osmDataDir)){
fx.mkdirSync(osmDataDir);
}
if (!fs.existsSync(refRoadsDir)){
fx.mkdirSync(refRoadsDir);
}
if (!fs.existsSync(osmBuffersDir)){
fx.mkdirSync(osmBuffersDir);
}
if (!fs.existsSync(diffsDir)){
fx.mkdirSync(diffsDir);
}
}
// concat feature classes and normalize data
refRoads = normalize(data.ref.roads);
if (data.source) {
var osmData = normalize(data.source.roads);
if (debugDir) {
fs.writeFile (osmDataDir + tileName, JSON.stringify(osmData));
fs.writeFile (refRoadsDir + tileName, JSON.stringify(refRoads));
}
osmData = flatten(osmData);
refRoads = flatten(refRoads);
//refRoads.features.forEach(function(road, i) {
//if (filter(road)) refRoads.features.splice(i,1);
//});
// buffer streets
streetBuffers = osmData.features.map(function(f){
var buffer = turf.buffer(f.geometry, 20, 'meters');
if (buffer) return buffer;
});
var merged = streetBuffers[0];
for (var i = 1; i < streetBuffers.length; i++) {
merged = turf.union(merged, streetBuffers[i]);
}
merged = turf.simplify(merged, 0.000001, false);
streetBuffers = normalize(merged);
if (debugDir) {
fs.writeFile (osmBuffersDir + tileName, JSON.stringify(merged));
}
refRoadsCount += refRoads.features.length;
if (refRoads && streetBuffers) {
refRoads.features.forEach(function(refRoad){
refRoadsLength += turf.lineDistance(refRoad);
streetBuffers.features.forEach(function(streetsRoad){
var roadDiff = turf.difference(refRoad, streetsRoad);
refRoadType = refRoad.geometry.type;
if(roadDiff && !filter(roadDiff, refRoadType)) {
// Here we are trying to calculate the distance of the reference roads & the issues (output of the difference between reference and source inputs)
//refRoadsLength += turf.lineDistance(refRoad);
//diffRoadsLength += turf.lineDistance(roadDiff);
//if( refRoad.geometry.type === "Polygon" && CompareByTags(refRoad.properties.name, streetsRoad.properties.name)) {
//if(refRoad.properties.bridge || refRoad.properties.tunnel || refRoad.properties.cobblestone) {
//if(!CompareByTag(streetsRoad.properties.bridge) || !CompareByTag(streetsRoad.properties.tunnel) || !CompareCobblestone(streetsRoad.properties.surface)) refDeltas.features.push(roadDiff);
//}
//else
diffRoadsLength += turf.lineDistance(roadDiff);
refDeltas.features.push(roadDiff);
//}
}
});
});
}
} else {
refDeltas = refRoads;
}
// add hashes as id's and tile-id's.
for (var f = 0; f < refDeltas.features.length; f++) {
var feature = refDeltas.features[f];
if (feature &&
feature.geometry) {
// 07/09** I think we could hash the tiles too (property part of feature)
//hash = hashF(feature);
//hash = hashF(feature.geometry);
// 07/10** 1st try to make the hashing system
//get the coordinates from the geojson files
NotConfirmedHashCodeException.prototype = Object.create(Error.prototype);
NotConfirmedHashCodeException.prototype.name = "NotConfirmedHashCodeException";
NotConfirmedHashCodeException.prototype.constructor = NotConfirmedHashCodeException;
var coords = 0;
var hash = undefined;
try {
// There is two loops over there one for the Polygons and one for the LineStrings, when we use LineStrings long/lat are in an array & those arrays are in another array
// for the polygons it's the same process but with one more array
if(feature.geometry.type === "Polygon") {
for(var c = 0; c < feature.geometry.coordinates.length; c++){
for(var d = 0; d < feature.geometry.coordinates[c].length; d++){
for(var e = 0; e < feature.geometry.coordinates[c][d].length; e++){
coords += feature.geometry.coordinates[c][d][e];
}
}
}
}
else {
for(var c = 0; c < feature.geometry.coordinates.length; c++){
for(var d = 0; d < feature.geometry.coordinates[c].length;d++){
coords += feature.geometry.coordinates[c][d];
}
}
}
// this function permits us to make a unique hash for each feature
hash = getNewHash( hashF(feature.properties), hashF(coords));
if(hash === null || hash === "") {
throw new NotConfirmedHashCodeException();
}
}catch(err) {
err = new NotConfirmedHashCodeException("Impossible to hash coordinates and properties");
console.log(err.toString());
}
// Here we are setting up the properties for the feature we are processing as its unique identifier and his tile coordinates
feature.properties.id = "" + hash;
feature.properties.tile_z = tile[2];
feature.properties.tile_x = tile[0];
feature.properties.tile_y = tile[1];
}
}
if (debugDir) {
fs.writeFile (diffsDir + tileName, JSON.stringify(normalize(refDeltas)));
}
}
}
catch (e)
{
errorMessage = "Could not process tile " + tileName + ": " + e.message;
}
done(null, {
// Here we are sending all the data that we need to write in our different output files
type: refRoadType,
diffs: refDeltas,
buffers: streetBuffers,
refs: refRoads,
osm: osmData,
stats: {
total: refRoadsLength,
diff: diffRoadsLength,
count: refRoadsCount
},
error: errorMessage
});
};
function clip(lines, tile) {
lines.features = lines.features.map(function(line){
try {
var clipped = turf.intersect(line, turf.polygon(tilebelt.tileToGeoJSON(tile).coordinates));
return clipped;
} catch(e){
return;
}
});
lines.features = lines.features.filter(function(line){
if(line) return true;
});
lines.features = lines.features.filter(function(line){
if(line.geometry.type === 'LineString' || line.geometry.type === 'MultiLineString') return true;
});
return lines;
}
function filter(road, refRoadType) {
// permits us to filter the streets that are too small to be processed
// if you want to add the linestring then you need to add refRoadType as a second argument for this function and uncomment the if + else statement
if(refRoadType === "Polygon" || refRoadType === "MultiPolygon"){
var area = turf.area(road, 'kilometers');
if(area < 30) {
return true;
} else {
return false;
}
}
else {
return false;
}
}
function getNewHash(featcoords, hashedcoords) {
NotNewHashCodeGenerationException.prototype = Object.create(Error.prototype);
NotNewHashCodeGenerationException.prototype.name = "NotNewHashCodeGenerationException";
NotNewHashCodeGenerationException.prototype.constructor = NotNewHashCodeGenerationException;
var hashresult = "";
let hashnb = 17;
try {
hashresult = featcoords + hashedcoords;
/* This process permits to hash strings we don't use it there because we wanted to have a more reliable hashing function
for(let i = 0; i < hashedcoords.length;i++) {
hashnb = (((hashnb << 5) - hashnb ) + hashedcoords.charCodeAt(i)) & 0xFFFFFFFF;
}
for(let i = 0; i < featcoords.length;i++) {
hashnb = (((hashnb << 5) - hashnb ) + featcoords.charCodeAt(i)) & 0xFFFFFFFF;
}
hashresult = hashnb.toString();*/
return hashresult;
}catch(err){
err = new NotNewHashCodeGenerationException("Data are invalid or hashing process doesn't work please report to getNewHash function");
console.log(err.toString());
}
}
// CompareByTags permits us to see if two tags are different, if they're different then we return true
function CompareByTags(refTag, sourceTag) {
if(refTag !== sourceTag) return true;
else return false;
}
// CompareByTag permits us to see if one tag has a "yes" value in the feature we're processing
function CompareByTag(refTag) {
if(refTag === "yes") return true;
else return false;
}
// CompareCobblestone permits us to see if one feature has a cobblestone value in the feature we're processing
function CompareCobblestone(refTag) {
if (refTag === "sett" || refTag === "unhewn_cobblestone" || refTag === "cobblestone") return true;
else return false;
}
// The two next functions are customized exceptions, it permits us to immediately know from where the error comes from
function NotNewHashCodeGenerationException(message) {
this.message = message;
if("captureStackTrace" in Error) Error.captureStackTrace(this, NotNewHashCodeGenerationException);
else this.stack = (new Error()).stack;
}
function NotConfirmedHashCodeException(message) {
this.message = message;
if("captureStackTrace" in Error) Error.captureStackTrace(this, NotConfirmedHashCodeException);
else this.stack = (new Error()).stack;
}
|
/*
* Classe représentant les enquêteurs présent autour du plateau
* @author : Batow
*/
var Shared = require("./Shared");
//
// Constructeur
// x y : position de l'enqueteur sur le plateau
// orientation : direction dans laquelle l'enquêteur regarde
//
function Enqueteur(x,y,orientation){
//identifiant de l'enqueteur
this.id_enqueteur = Shared.generateUUID();
this.x = x;
this.y = y;
this.orientation = orientation;
}
//
// Effectue un déplacement de l'enqueteur dans le sens horaire
// nb_deplacement : le nombre de deplacement a effectuer
// nb_longeur nb_largeur : Limite du plateau
//
Enqueteur.prototype.deplacement = function(nb_deplacement, nb_longeur, nb_largeur){
//Pour chaque déplacement demandé
for(var i=0;i<nb_deplacement;i++){
//Si le jeton se trouve sur la ligne NORD du plateau
if(this.y == 0){
//On le déplace sur cette ligne
this.x++;
//Si on arrive au bout de la ligne
//on change l'orientation
//on avance sur la ligne EST (le jeton ne va pas sur les angles)
if(this.x==nb_longeur){
this.y++;
this.orientation = "O";
}
}
//Si le jeton se trouve sur la ligne EST du plateau
else if(this.x==nb_longeur){
//On le déplace sur cette ligne
this.y++;
//Si on arrive au bout de la ligne
//on change l'orientation
//on avance sur la ligne SUD (le jeton ne va pas sur les angles)
if(this.y==nb_largeur){
this.x--;
this.orientation = "N";
}
}
//Si le jeton se trouve sur la ligne SUD du plateau
else if(this.y == nb_largeur){
//On le déplace sur cette ligne
this.x--;
//Si on arrive au bout de la ligne
//on change l'orientation
//on avance sur la ligne OUEST (le jeton ne va pas sur les angles)
if(this.x==0){
this.y--;
this.orientation = "E";
}
}
//Si le jeton se trouve sur la ligne EST du plateau
else if(this.x==0){
//On le déplace sur cette ligne
this.y--;
//Si on arrive au bout de la ligne
//on change l'orientation
//on avance sur la ligne SUD (le jeton ne va pas sur les angles)
if(this.y==0){
this.x++;
this.orientation = "S";
}
}
}
}
module.exports = Enqueteur;
|
/*
* The reducer takes care of state changes in our app through actions
*/
import {FETCH_ALL_TASKS, FETCH_ALL_TASKS_FULFILLED, FETCH_ALL_TASKS_REJECTED,} from '../Actions/ActionTypes'
// The initial task state
let initialState = {
fetchedTasks: [],
fetching: false,
fetched: false,
error: null
}
// Takes care of changing the task state
function reducer(state = initialState, action) {
switch (action.type) {
case FETCH_ALL_TASKS:
return {
...state,
fetching: true,
}
case FETCH_ALL_TASKS_FULFILLED:
return {
...state,
fetched: true,
fetchedTasks: action.payload.items,
}
case FETCH_ALL_TASKS_REJECTED:
return {
...state,
fetched: false,
error: action.payload,
}
default:
return state
}
}
export default reducer;
|
import FriendCard from './FriendCard'
const FriendsList = ({friends}) => {
return (
<div className="row">
{friends.map((friend, i) => {
return (
<FriendCard friend={friend} key={i} />
)
})}
</div>
)
}
export default FriendsList
|
/* VARIABLES */
const Discord = require("discord.js");
const gd = require('node-gd');
const http = require('http');
const fs = require('fs');
const chatbot = require('chatbot');
var prefix = ":";
var footer = "Created by Fabuss254#9232";
var bot = new Discord.Client();
/* EVENEMENT */
bot.on('ready', () => {
console.log("bot ready")
});
bot.on('message', message => {
if (message.author.equals(bot.user)) return;
var args = message.content.substring(prefix.length).split (" ");
if (!message.content.startsWith(prefix)) return;
switch (args[0].toLowerCase()) {
case "botinfo":
message.channel.send("Hi!")
break;
}
});
/* FUNCTION */
/* LOGIN */
bot.login(process.env.TOKEN);
console.log("Login succesfully!");
bot.on("error", err => {
console.log(err);
});
|
OC.L10N.register(
"files",
{
"Files" : "Fayllar"
},
"nplurals=1; plural=0;");
|
const merge = require('webpack-merge')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const common = require('./webpack.common')
module.exports = merge(common, {
plugins: [new BundleAnalyzerPlugin()],
})
|
import { applyMiddleware, combineReducers, compose, createStore } from "redux";
import thunk from "redux-thunk";
import { filtersReducer } from "./reducers/filterReducers";
import { productListReducer } from "./reducers/productReducers";
const initialState = {
filters: {
page: 1,
filterCategory: [],
filterType: [],
filterBrand: [],
filterRating: 0,
filterPrice: {},
filterName: "",
orderBy: "",
},
};
const reducer = combineReducers({
productList: productListReducer,
filters: filtersReducer,
});
const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
reducer,
initialState,
composeEnhancer(applyMiddleware(thunk))
);
export default store;
|
OC.L10N.register(
"settings",
{
"Wrong current password" : "A jelenlegi jelszót helytelenül adtad meg",
"The new password cannot be the same as the previous one" : "Az új jelszó nem lehet ugyanaz, mint az előző",
"No user supplied" : "Nincs megadva felhasználó",
"Authentication error" : "Azonosítási hiba",
"Please provide an admin recovery password; otherwise, all user data will be lost." : "Adjon meg admin helyreállító jelszót, egyébként valamennyi felhasználói adat törlődik.",
"Wrong admin recovery password. Please check the password and try again." : "Hibás admin helyreállítási jelszó. Ellenőrizze a jelszót és próbálja újra!",
"Backend doesn't support password change, but the user's encryption key was successfully updated." : "A háttér-alrendszer nem támogatja a jelszómódosítást, de felhasználó titkosítási kulcsát sikeresen frissítettük.",
"Unable to change password" : "Nem sikerült megváltoztatni a jelszót",
"%s password changed successfully" : "%s jelszó sikeresen megváltozott",
"Couldn't send reset email. Please contact your administrator." : "Visszaállítási e-mail nem küldhető. Kérjük, lépjen kapcsolatba a rendszergazdával.",
"cURL is using an outdated %s version (%s). Please update your operating system or features such as %s will not work reliably." : "cURL elavult %s verziót (%s) használ. Kérjük, frissítse az operációs rendszerét, vagy egyes funkciók (mint például a %s) megbízhatatlanul fognak működni.",
"Group already exists." : "A csoport már létezik.",
"Unable to add group." : "Nem lehet létrehozni a csoportot.",
"Unable to delete group." : "Nem lehet törölni a csoportot.",
"Saved" : "Elmentve",
"log-level out of allowed range" : "A naplózási szint a megengedett terjedelmen kívül van.",
"Invalid email address" : "Érvénytelen email cím",
"test email settings" : "e-mail beállítások ellenőrzése",
"A problem occurred while sending the email. Please revise your settings. (Error: %s)" : "Hiba történt az e-mail küldésekor. Kérjük ellenőrizd a beállításokat! (Hiba: %s)",
"Email sent" : "Az e-mail elküldve!",
"You need to set your user email before being able to send test emails." : "Előbb meg kell adnia az e-mail címét, mielőtt tesztelni tudná az e-mail küldést.",
"Couldn't change the email address because the user does not exist" : "Az email címet men lehet megváltoztatni mert a felhasználó nem létezik",
"Couldn't change the email address because the token is invalid" : "Nem sikerült megváltoztatni az e-mail címet, mert a token érvénytelen",
"Your %s account was created" : "%s fiók létrehozva",
"Invalid mail address" : "Érvénytelen e-mail cím",
"A user with that name already exists." : "Ilyen névvel már létezik felhasználó!",
"Unable to create user." : "Nem lehet létrehozni a felhasználót.",
"Unable to delete user." : "Nem lehet törölni a felhasználót.",
"Forbidden" : "Tiltott",
"Invalid user" : "Érvénytelen felhasználó",
"Unable to change mail address" : "Nem lehet megváltoztatni az e-mail címet",
"Email has been changed successfully." : "Az email cím megváltoztatása sikeres volt.",
"An email has been sent to this address for confirmation. Until the email is verified this address will not be set." : "Erre a címre e-mailt küldtek megerősítés céljából. Amíg az e-mailt nem ellenőrizzük, ez a cím nem lesz beállítva.",
"No email was sent because you already sent one recently. Please try again later." : "Nem küldtünk e-mailt, mert már nemrégiben küldtél. Kérlek, próbáld újra később.",
"Your full name has been changed." : "Az Ön teljes nevét módosítottuk.",
"Unable to change full name" : "Nem sikerült megváltoztatni a teljes nevét",
"%s email address confirm" : "%se-mail cím megerősítése",
"Couldn't send email address change confirmation mail. Please contact your administrator." : "Nem sikerült elküldeni az e-mail cím módosítási megerősítő üzenetet. Kérjük, lépjen kapcsolatba a rendszergazdájával.",
"%s email address changed successfully" : "%s az email cím megváltoztatása sikeres",
"Couldn't send email address change notification mail. Please contact your administrator." : "Nem sikerült elküldeni az e-mail cím módosítási értesítést. Kérjük, lépjen kapcsolatba a rendszergazdájával.",
"Unable to enable/disable user." : "A felhasználó engedélyezése / tiltása nem lehetséges.",
"Create" : "Létrehozás",
"Change" : "Változás",
"Delete" : "Törlés",
"Share" : "Megosztás",
"APCu" : "APCu",
"Redis" : "Redis",
"Language changed" : "A nyelv megváltozott",
"Invalid request" : "Érvénytelen kérés",
"Admins can't remove themself from the admin group" : "Adminisztrátorok nem távolíthatják el magukat az admin csoportból.",
"Unknown user" : "Ismeretlen felhasználó",
"Couldn't remove app." : "Az alkalmazást nem sikerült eltávolítani.",
"Official" : "Hivatalos",
"Approved" : "Jóváhagyott",
"All" : "Mind",
"Enabled" : "Engedélyezve",
"Not enabled" : "Tiltva",
"No apps found for your version" : "Nem található alkalmazás a verziód számára",
"The app will be downloaded from the app store" : "Az alkalmazás letöltésre kerül az alkalmazástárból",
"Official apps are developed by and within the ownCloud community. They offer functionality central to ownCloud and are ready for production use." : "A hivatalos alkalmazásokat az ownCloud közösségen belül fejlesztik. \nAz általuk nyújtott központi ownCloud funkciók készen állnak a produktív használatra.",
"Approved apps are developed by trusted developers and have passed a cursory security check. They are actively maintained in an open code repository and their maintainers deem them to be stable for casual to normal use." : "A jóváhagyott alkalmazásokat megbízható fejlesztők készítik, amik megfelelnek a felületes biztonsági ellenőrzésnek. Nyílt forráskódú tárolóban aktívan karbantartják és biztosítják a stabil használatot.",
"This app is not checked for security issues and is new or known to be unstable. Install at your own risk." : "Ez az alkalmazás még nincs biztonságilag ellenőrizve és vagy új, vagy ismert instabil. Telepítés csak saját felelősségre!",
"Please wait...." : "Kérjük várj...",
"Error while disabling app" : "Hiba az alkalmazás letiltása közben",
"Disable" : "Letiltás",
"Enable" : "Engedélyezés",
"Error while enabling app" : "Hiba az alkalmazás engedélyezése közben",
"Error: this app cannot be enabled because it makes the server unstable" : "Hiba: ezt az alkalmzást nem lehet engedélyezni, mert a szerver instabilitását eredményezné",
"Error: could not disable broken app" : "Hiba: nem lehet tiltani a megtört alkalmazást",
"Error while disabling broken app" : "Hiba történt a megtört alkalmazás tiltása közben",
"Updating...." : "Frissítés folyamatban...",
"Error while updating app" : "Hiba történt az alkalmazás frissítése közben",
"Updated" : "Frissítve",
"Uninstalling ...." : "Eltávolítás ...",
"Error while uninstalling app" : "Hiba történt az alkalmazás eltávolítása közben",
"Uninstall" : "Eltávolítás",
"The app has been enabled but needs to be updated. You will be redirected to the update page in 5 seconds." : "Ez az alkalmazás engedélyezve van, de frissíteni kell. A frissítő oldalra irányítjuk 5 másodpercen belül.",
"App update" : "Alkalmazás frissítése",
"Experimental" : "Kísérleti",
"No apps found for {query}" : "{query} keresésre nincs találat",
"Migration in progress. Please wait until the migration is finished" : "Migráció folyamatban. Kérjük várj, míg a migráció befejeződik.",
"Migration started …" : "Migráció elindítva ...",
"An error occurred. Please upload an ASCII-encoded PEM certificate." : "Hiba történt! Kérem töltsön fel egy, ASCII karakterekkel kódolt PEM tanusítványt!",
"Valid until {date}" : "Érvényes: {date}",
"Disconnect" : "Szétkapcsol",
"Error while loading browser sessions and device tokens" : "Hiba történt a böngésző munkamenetek és eszköztokenek betöltése során",
"Empty app name is not allowed." : "Az alkalmazásnév nem lehet üres.",
"Error while creating device token" : "Hiba történt az eszköztoken generálása közben",
"Error while deleting the token" : "Hiba történt az eszköztoken törlése közben",
"Sending..." : "Küldés...",
"Failed to change the email address." : "Az email cím megváltoztatása sikertelen.",
"Email changed successfully for {user}." : "A(z) {user} felhasználó email címe sikeresen megváltozott.",
"An error occurred: {message}" : "Hiba történt: {message}",
"Select a profile picture" : "Válasszon profilképet!",
"Very weak password" : "Nagyon gyenge jelszó",
"Weak password" : "Gyenge jelszó",
"So-so password" : "Nem túl jó jelszó",
"Good password" : "Jó jelszó",
"Strong password" : "Erős jelszó",
"Groups" : "Csoportok",
"Unable to delete {objName}" : "Ezt nem sikerült törölni: {objName}",
"Error creating group: {message}" : "Hiba történt a csoport létrehozásakor: {message}",
"A valid group name must be provided" : "Érvényes csoportnevet kell megadni",
"deleted {groupName}" : "törölve: {groupName}",
"undo" : "visszavonás",
"Delete group" : "Csoport törlése",
"never" : "soha",
"deleted {userName}" : "törölve: {userName}",
"Delete user" : "Felhasználó törlése",
"add group" : "csoport hozzáadása",
"Invalid quota value \"{val}\"" : "Érvénytelen kvótaérték \"{val}\"",
"enabled" : "Bekapcsolva",
"disabled" : "Kikapcsolva",
"User {uid} has been {state}!" : "A {uid} felhasználó {state} volt!",
"no group" : "nincs csoport",
"Changing the password will result in data loss, because data recovery is not available for this user" : "A jelszó megváltoztatása adatvesztéssel jár, mert lehetséges az adatok visszaállítása ennek a felhasználónak",
"Password successfully changed" : "Jelszó sikeresen megváltoztatva",
"A valid username must be provided" : "Érvényes felhasználónevet kell megadnia",
"Error creating user: {message}" : "Hiba történt a felhasználó létrehozásakor: {message}",
"A valid password must be provided" : "Érvényes jelszót kell megadnia",
"A valid email must be provided" : "Érvényes e-mail címet kell megadni",
"Use the following link to confirm your changes to the email address: {link}" : "A következő linken erősítse meg az email cím módosítását: {link}",
"Email address changed to {mailAddress} successfully." : "Emailcím {mailAddress}-re sikeresen módosítva ",
"Cheers!" : "Üdvözlet!",
"Hey there,\n\njust letting you know that you now have an %s account.\n\nYour username: %s\nAccess it: %s\n\n" : "Üdv!\n\nÉrtesítünk, hogy van egy %s fiókja.\n\nFelhasználónév: %s\nHozzáférés: %s\n\n",
"Language" : "Nyelv",
"Apps Management" : "Alkalmazások kezelése",
"Developer documentation" : "Fejlesztői dokumentáció",
"by %s" : "készítő: %s",
"%s-licensed" : "%s-licencelt",
"Documentation:" : "Dokumentációk:",
"User documentation" : "Felhasználói dokumentáció",
"Admin documentation" : "Adminisztrátori dokumentáció",
"Visit website" : "Webhely meglátogatása",
"Report a bug" : "Hibabejelentés",
"Show description …" : "Leírás megjelenítése ...",
"Hide description …" : "Leírás elrejtése ...",
"This app has no minimum ownCloud version assigned. This will be an error in ownCloud 11 and later." : "Ennek az alkalmazásnak nincs minimális ownCloud verzió megadva. Ez hibát okoz majd az ownCloud 11-es és későbbi verziókban.",
"This app has no maximum ownCloud version assigned. This will be an error in ownCloud 11 and later." : "Ennek az alkalmazásnak nincs maximális ownCloud verzió megadva. Ez hibát okoz majd az ownCloud 11-es és későbbi verziókban.",
"This app cannot be installed because the following dependencies are not fulfilled:" : "Ezt az applikációt nem lehet telepíteni, mert a következő függőségek hiányoznak:",
"Enable only for specific groups" : "Csak bizonyos csoportok számára tegyük elérhetővé",
"Uninstall App" : "Alkalmazás eltávolítása",
"Show enabled apps" : "Az engedélyezett alkalmazások megjelenítése",
"Show disabled apps" : "A nem engedélyezett alkalmazások megjelenítése",
"Cron" : "Ütemezett feladatok",
"Last cron job execution: %s." : "Az utolsó cron feladat ekkor futott le: %s.",
"Last cron job execution: %s. Something seems wrong." : "Az utolsó cron feladat ekkor futott le: %s. Valami nincs rendben.",
"Cron was not executed yet!" : "A cron feladat még nem futott le!",
"Open documentation" : "Dokumentáció megnyitása",
"Execute one task with each page loaded" : "Egy-egy feladat végrehajtása minden alkalommal, amikor egy weboldalt letöltenek",
"cron.php is registered at a webcron service to call cron.php every 15 minutes over http." : "A cron.php webcron szolgáltatásként van regisztrálva, hogy 15 percenként egyszer lefuttassa a cron.php-t.",
"Use system's cron service to call the cron.php file every 15 minutes." : "A rendszer cron szolgáltatását használjuk, mely a cron.php állományt futtatja le 15 percenként.",
"SSL Root Certificates" : "SSL Root tanusítványok",
"Common Name" : "Általános Név",
"Valid until" : "Érvényes",
"Issued By" : "Kiadta",
"Valid until %s" : "Érvényes: %s",
"Import root certificate" : "Gyökértanúsítvány importálása",
"Server-side encryption" : "Szerveroldali titkosítás",
"Enable server-side encryption" : "Szerveroldali titkosítás engedélyezése",
"Please read carefully before activating server-side encryption: " : "Kérjük, ezt olvasd el figyelmesen mielőtt engedélyezed a szerveroldali titkosítást:",
"Once encryption is enabled, all files uploaded to the server from that point forward will be encrypted at rest on the server. It will only be possible to disable encryption at a later date if the active encryption module supports that function, and all pre-conditions (e.g. setting a recover key) are met." : "Ha egyszer engedélyezve lett a titkosítás, akkor onnantól kezdve a szerveren az összes fájl titkosításra kerül, melyet később csak akkor lehet visszafordítani, ha azt az aktív titkosítási modul támogatja és minden elő-követelmény (például helyreállító kulcs) teljesül.",
"Encryption alone does not guarantee security of the system. Please see ownCloud documentation for more information about how the encryption app works, and the supported use cases." : "A titkosítás nem garantálja a rendszer biztonságát. Kérjük, bővebb információért keresse fel az ownCloud dokumentációját, ahol megtudhatja, hogy hogyan működik a titkosító alkalmazás és mikor érdemes használni.",
"Be aware that encryption always increases the file size." : "Ügyeljen arra, hogy a titkosítás mindig megnöveli a fájl méretét!",
"It is always good to create regular backups of your data, in case of encryption make sure to backup the encryption keys along with your data." : "Mindig jó ötlet rendszeres biztonsági mentést készíteni az adatokról. Titkosítás esetén a titkosító kulcsok biztonsági mentését elkülönítve tárolja az adatoktól!",
"This is the final warning: Do you really want to enable encryption?" : "Ez az utolsó figyelmeztetés: Biztosan szeretnéd engedélyezni a titkosítást?",
"Enable encryption" : "Titkosítás engedélyezése",
"No encryption module loaded, please enable an encryption module in the app menu." : "Nincs titkosítási modul betöltve, kérjük engedélyezd a titkosítási modult az alkalmazások menüben.",
"Select default encryption module:" : "Alapértelmezett titkosítási modul:",
"You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please enable the \"Default encryption module\" and run 'occ encryption:migrate'" : "Migrálni kell a titkosítási kulcsokat a régi titkosításból (ownCloud <= 8.0) egy újba. Kérjük, engedélyezd az „Alapértelmezett titkosítási modul”-t és futtasd ezt: occ encryption:migrate",
"You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one." : "Migrálni kell a titkosítási kulcsokat a régi titkosításból (ownCloud <= 8.0) egy újba.",
"Start migration" : "Migrálás indítása",
"Sharing" : "Megosztás",
"Allow apps to use the Share API" : "Lehetővé teszi, hogy a programmodulok is használhassák a megosztást",
"Allow users to share via link" : "Engedjük meg az állományok linkekkel történő megosztását",
"Allow public uploads" : "Nyilvános feltöltés engedélyezése",
"Enforce password protection for read-only links" : "Jelszavas védelem kényszerítése a csak olvasható hivatkozásokra.",
"Set default expiration date" : "Alapértelmezett lejárati idő beállítása",
"Expire after " : "A lejárat legyen",
"days" : "nap",
"Allow users to send mail notification for shared files" : "A felhasználók küldhessenek e-mail értesítést a megosztás létrejöttéről",
"Allow resharing" : "A megosztás továbbadásának engedélyezése",
"Allow sharing with groups" : "Megosztás engedélyezése a csoportokkal",
"Restrict users to only share with users in their groups" : "A csoporttagok csak a saját csoportjukon belül oszthassanak meg anyagokat",
"Allow users to send mail notification for shared files to other users" : "A felhasználók küldhessenek más felhasználóknak e-mail értesítést a megosztott fájlokról",
"Exclude groups from sharing" : "Csoportok megosztási jogának tiltása",
"These groups will still be able to receive shares, but not to initiate them." : "E csoportok tagjaival meg lehet osztani anyagokat, de ők nem hozhatnak létre megosztást.",
"Allow username autocompletion in share dialog. If this is disabled the full username needs to be entered." : "Felhasználónév automatikus befejezése engedélyezése a megosztás ablakban. Ha le van tiltva, akkor a teljes felhasználónevet kell beírni.",
"None" : "Egyik sem",
"Save" : "Mentés",
"Everything (fatal issues, errors, warnings, info, debug)" : "Minden (végzetes hibák, hibák, figyelmeztetések, információk, hibakeresési üzenetek)",
"Info, warnings, errors and fatal issues" : "Információk, figyelmeztetések, hibák és végzetes hibák",
"Warnings, errors and fatal issues" : "Figyelmeztetések, hibák és végzetes hibák",
"Errors and fatal issues" : "Hibák és végzetes hibák",
"Fatal issues only" : "Csak a végzetes hibák",
"Log" : "Naplózás",
"What to log" : "Mit naplózzon",
"Download logfile (%s)" : "Naplófájl letöltése (%s)",
"The logfile is bigger than 100 MB. Downloading it may take some time!" : "A naplófájl 100MB-nál nagyobb. A letöltése hosszabb időt vehet igénybe.",
"Login" : "Login",
"Plain" : "Plain",
"NT LAN Manager" : "NT LAN Manager",
"SSL/TLS" : "SSL/TLS",
"STARTTLS" : "STARTTLS",
"Email server" : "E-mail szerver",
"The config file is read only. Please adjust your setup by editing the config file manually." : "A konfigurációs fájl írásvédett. A beállításokat a fájl kézi módosításával végezd el.",
"This is used for sending out notifications." : "Ezt használjuk a jelentések kiküldésére.",
"Send mode" : "Küldési mód",
"Encryption" : "Titkosítás",
"From address" : "A feladó címe",
"mail" : "mail",
"Authentication method" : "A felhasználóazonosítás módszere",
"Authentication required" : "Felhasználóazonosítás szükséges",
"Server address" : "A kiszolgáló címe",
"Port" : "Port",
"Credentials" : "Azonosítók",
"SMTP Username" : "SMTP felhasználónév",
"SMTP Password" : "SMTP jelszó",
"Store credentials" : "Azonosítók eltárolása",
"Test email settings" : "Az e-mail beállítások ellenőrzése",
"Send email" : "E-mail küldése",
"Security & setup warnings" : "Biztonsági és telepítési figyelmeztetések",
"php does not seem to be setup properly to query system environment variables. The test with getenv(\"PATH\") only returns an empty response." : "Úgy tűnik, hogy a PHP nem tudja olvasni a rendszer környezeti változóit. A getenv(\"PATH\") teszt visszatérési értéke üres.",
"Please check the <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">installation documentation ↗</a> for php configuration notes and the php configuration of your server, especially when using php-fpm." : "Kérjük, ellenőrizze a <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">telepítési dokumentációt ↗</a> a PHP konfigurációs beállításaival kapcsolatban, főleg ha PHP-FPM-et használ.",
"The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update." : "Csak olvasható beállítófájl engedélyezve. Ez meggátolja a beállítások módosítását a webes felületről. Továbbá, a fájlt kézzel kell írhatóvá tenni minden frissítés alkalmával.",
"PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible." : "Úgy tűnik, hogy a PHP úgy van beállítva, hogy eltávolítja programok belsejében elhelyezett szövegblokkokat. Emiatt a rendszer több alapvető fontosságú eleme működésképtelen lesz.",
"This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Ezt valószínűleg egy gyorsítótár ill. kódgyorsító, mint pl, a Zend, OPcache vagy eAccelererator okozza.",
"%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version." : "%1$s %2$s verziója van telepítve, de a stabilitási és teljesítményi okok miatt javasoljuk az újabb, %1$s verzióra való frissítést.",
"The PHP module 'fileinfo' is missing. We strongly recommend to enable this module to get best results with mime-type detection." : "A 'fileinfo' PHP modul hiányzik. Erősen javasolt ennek a modulnak a telepítése, mert ezzel lényegesen jobb a MIME-típusok felismerése.",
"System locale can not be set to a one which supports UTF-8." : "A rendszer lokalizációs állományai között nem sikerült olyat beállítani, ami támogatja az UTF-8-at.",
"This means that there might be problems with certain characters in file names." : "Ez azt jelenti, hogy probléma lehet bizonyos karakterekkel a fájlnevekben.",
"We strongly suggest installing the required packages on your system to support one of the following locales: %s." : "Feltétlenül javasoljuk, hogy telepítse a szükséges csomagokat ahhoz, hogy a rendszere támogassa a következő lokalizációk valamelyikét: %s",
"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwrite.cli.url\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" : "Ha a telepítése nem a webkiszolgáló gyökerében van, és a rendszer cron szolgáltatását használja, akkor problémák lehetnek az URL-ek képzésével. Ezek elkerülése érdekében állítsa be a config.php-ban az \"overwrite.cli.url\" paramétert a telepítés által használt webútvonalra. (Javasolt beállítás: \"%s\")",
"SQLite is used as database. For larger installations we recommend to switch to a different database backend." : "Adatbázisként az SQLite-ot fogjuk használni. Nagyobb telepítések esetén javasoljuk, hogy váltson másik adatbázis háttérkiszolgálóra",
"Especially when using the desktop client for file syncing the use of SQLite is discouraged." : "Amikor az asztali klienset használja fálj szinkronizációra, akkor az SQLite használata nem ajánlott.",
"To migrate to another database use the command line tool: 'occ db:convert-type', or see the <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">documentation ↗</a>." : "Más adatbázisról való áttéréshez használja a parancssort: 'occ db:convert-type', vagy keresse fel a <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">dokumentációt ↗</a>.",
"We recommend to enable system cron as any other cron method has possible performance and reliability implications." : "Javasoljuk, hogy engedélyezd az operációs rendszer cron ütemezőjét, mivel a többi megoldás teljesítmény és megbízhatósági problémákat hordoz magában.",
"It was not possible to execute the cronjob via CLI. The following technical errors have appeared:" : "Az ütemezett feladat (cronjob) nem futott le parancssorból. A következő hibák tűntek fel:",
"Please double check the <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">installation guides ↗</a>, and check for any errors or warnings in the <a href=\"#log-section\">log</a>." : "Kérjük, ellenőrizze a <a target=\"_blank\" rel=\"noreferrer\" href=\"%s\">telepítési dokumentációt ↗</a> és ellenőrizze a <a href=\"#log-section\">naplófájlt</a>, hogy tartalmaz-e bármilyen hibát vagy figyelmeztetést.",
"All checks passed." : "Minden ellenőrzés sikeres.",
"System Status" : "Rendszerállapot",
"Tips & tricks" : "Tippek és trükkök",
"How to do backups" : "Hogyan csináljunk biztonsági mentéseket",
"Performance tuning" : "Teljesítményi hangolás",
"Improving the config.php" : "config.php javítása",
"Theming" : "Témázás",
"Hardening and security guidance" : "Erősítési és biztonsági útmutató",
"Get the apps to sync your files" : "Töltse le az állományok szinkronizációjához szükséges programokat!",
"Desktop client" : "Asztali kliens",
"Android app" : "Android applikáció",
"iOS app" : "IOS applikáció",
"Show First Run Wizard again" : "Nézzük meg újra az első bejelentkezéskori segítséget!",
"Domain" : "Domain",
"Add" : "Hozzáadás",
"Profile picture" : "Profilkép",
"Upload new" : "Új feltöltése",
"Select from Files" : "Kiválasztás a Fájlkból",
"Remove image" : "A kép eltávolítása",
"png or jpg, max. 20 MB" : "png vagy jpg, max. 20 MB",
"Cancel" : "Mégsem",
"Choose as profile picture" : "Kiválasztás profil képként",
"Full name" : "Teljes név",
"No display name set" : "Nincs megjelenítési név beállítva",
"Email" : "E-mail",
"Your email address" : "Az Ön e-mail címe",
"For password recovery and notifications" : "Jelszó helyreállításhoz és értesítésekhez",
"No email address set" : "Nincs e-mail cím beállítva",
"You are member of the following groups:" : "Tagja vagy a következő csoport(ok)nak:",
"You are not a member of any groups." : "Egyetlen csoportnak sem vagy tagja.",
"Password" : "Jelszó",
"Unable to change your password" : "A jelszó nem változtatható meg",
"Current password" : "A jelenlegi jelszó",
"New password" : "Az új jelszó",
"Change password" : "A jelszó megváltoztatása",
"Help translate" : "Segítsen a fordításban!",
"Developed by the {communityopen}ownCloud community{linkclose}, the {githubopen}source code{linkclose} is licensed under the {licenseopen}<abbr title=\"Affero General Public License\">AGPL</abbr>{linkclose}." : "{communityopen}ownCloud közösség{linkclose} fejleszti, a {githubopen}forráskód{linkclose} {licenseopen}<abbr title=\"Affero General Public License\">AGPL</abbr>{linkclose} licenc alatt licencelve.",
"Sessions" : "Munkamenetek",
"Browser" : "Böngésző",
"Name" : "Név",
"Username" : "Felhasználónév",
"Done" : "Kész",
"Version" : "Verzió",
"Resend activation link" : "Aktiválási link újraküldése",
"New Password" : "Új jelszó",
"Confirm Password" : "Jelszó megerősítése",
"Please set your password" : "Kérjük állítsa be jelszavát",
"Personal" : "Személyes",
"Admin" : "Adminsztráció",
"Settings" : "Beállítások",
"Show enabled/disabled option" : "Az engedélyezett / letiltott lehetőség megjelenítése",
"Show storage location" : "Háttértároló helyének mutatása",
"Show last log in" : "Utolsó bejelentkezés megjelenítése",
"Show user backend" : "Felhasználói háttér mutatása",
"Show email address" : "E-mail cím megjelenítése",
"E-Mail" : "E-mail",
"Admin Recovery Password" : "Adminisztrátori jelszó az állományok visszanyerésére",
"Enter the recovery password in order to recover the users files during password change" : "Adja meg az adatok visszanyeréséhez szükséges jelszót arra az esetre, ha a felhasználók megváltoztatják a jelszavukat",
"Add Group" : "Csoport létrehozása",
"Group" : "Csoport",
"Everyone" : "Mindenki",
"Admins" : "Adminok",
"Default Quota" : "Alapértelmezett kvóta",
"Please enter storage quota (ex: \"512 MB\" or \"12 GB\")" : "Kérjük adja meg a tárolási kvótát (pl. \"512 MB\" vagy \"12 GB\")",
"Unlimited" : "Korlátlan",
"Other" : "más",
"Full Name" : "Teljes név",
"Group Admin for" : "Csoport Adminisztrátor itt",
"Quota" : "Kvóta",
"Storage Location" : "A háttértár helye",
"User Backend" : "Felhasználói háttér",
"Last Login" : "Utolsó bejelentkezés",
"change full name" : "a teljes név megváltoztatása",
"set new password" : "új jelszó beállítása",
"change email address" : "e-mail cím megváltoztatása",
"Default" : "Alapértelmezett"
},
"nplurals=2; plural=(n != 1);");
|
import { getUserData, getIdentityData, getApiAuthority, getIdentityApiAuthorityRelation, getViewAuthority, getIdentityViewAuthorityRelation } from '@/services';
export default {
//命名空间
namespace: 'userDisplay',
//模块状态
state: {
//用户数据
UserData: [],
},
//异步操作
effects: {
*getUserData({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getUserData)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
*getIdentityData({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getIdentityData)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
*getApiAuthority({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getApiAuthority)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
*getIdentityApiAuthorityRelation({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getIdentityApiAuthorityRelation)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
*getViewAuthority({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getViewAuthority)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
*getIdentityViewAuthorityRelation({ payload, type }, { call, put }) { // eslint-disable-line
let data = yield call(getIdentityViewAuthorityRelation)
console.log(data)
yield put({ type: 'save', payload: { UserData: data.data } })
},
},
//同步操作
reducers: {
save(state, action) {
return { ...state, ...action.payload };
},
},
};
|
var arr=[1,2,3,4,5,6,7];
// console.log(arr.length)
function async(aa,callback){
console.log(aa)
callback()
}
// for (i=0; i < 7; ++i) {
// arr[i] = async(arr[i]);
// }
(function next(i, len, callback) {
if (i < len) {
async(arr[i], function (value) {
arr[i] = value;
next(i + 1, len, callback);
});
} else {
callback();
}
}(0, arr.length, function () {
console.log(123)
}));
//console.log(123)
// setTimeout(function(){
// },1000)
// (function (i, len, count, callback) {
// for (; i < len; ++i) {
// (function (i) {
// async(arr[i], function (value) {
// arr[i] = value;
// if (++count === len) {
// callback();
// }
// });
// }(i));
// }
// }(0, arr.length, 0, function () {
// // All array items have processed.
// console.log("123")
// }));
|
//input binding for jstree
var ss_jstree = new Shiny.InputBinding();
$.extend(ss_jstree, {
find: function(scope) {
return $(scope).find(".ss-jstree");
},
getValue: function(el) {
var tree = $(el).jstree();
var leaves = tree.get_selected()
var i, j, r = [];
for (i = 0, j = leaves.length; i < j; i++) {
r.push(tree.get_node(leaves[i]).text);
}
return r;
},
setValue: function(el, value) {},
subscribe: function(el, callback) {
$(el).on("changed.jstree", function(e) {
callback();
});
},
unsubscribe: function(el) {
$(el).off(".ss_jstree");
}
});
Shiny.inputBindings.register(ss_jstree);
|
var endpointsAPI = function(app, database, rootDir) {
var self = this;
var request=require('request');
var fs = require('fs'), ini = require('ini');
var config = ini.parse(fs.readFileSync('./config/config.ini', 'utf-8'));
self.activateEndpoints = function() {
app.get('/', function (req, res) {
res.sendFile('index.html')
});
app.get('/findMatches/', function(req, res) {
console.log(req.query);
if(! req.query.username) {
return res.status(400).send();
}
getSteamIDbyUserName(req.query.username, res);
});
app.get('/userLastPlayed/', function(req, res) {
console.log(req.query);
if(! req.query.username) {
return res.status(400).send();
}
/*
getSteamIDbyUserName(req.params.steamUserName, function(err, info) {
//callback hell?
});
*/
getSteamIDbyUserName(req.query.username, res);
});
function findMatches(user, potentialMatches) {
/*1. Find # of mathcing games between user and potential match
2. Count matcing hours vs total hours for both user & potential match
3. Get percent of matchingHours/totalHours for the two people being compared
4. Give percentage base on similarity
5. Loop and upload the top 5.
for (let i = 0; i < potentialMatches.length; i++) {
for (let j = 0; j < )
}
*/
}
function getSteamIDbyUserName(steamUserName, res) {
request.get('http://api.steampowered.com/ISteamUser/ResolveVanityURL/v0001/?key=' + config.steamAPI.key + '&vanityurl=' + steamUserName, function(err, innerRes, body){
if(err) {
console.log("err!");
return res.status(400).send();
}
if(innerRes.statusCode !== 200 ) {
console.log("status not 200!");
return innerRes.status(503).send();
}
console.log(body);
console.log(typeof(body));
body = JSON.parse(body);
console.log(body);
getAllGames(body.response.steamid, res);
});
}
function getAllGames(steamID, res) {
//important endpoints
//http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key=' + config.steamAPI.key + '&steamid=
//http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' + config.steamAPI.key + '&steamid=
//http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=' + config.steamAPI.key + '&steamids=
request.get('http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=' + config.steamAPI.key + '&steamid=' + steamID + '&format=json', function(err, innerRes, body){
if(err) {
console.log("err!");
return res.status(400).send();
}
if(innerRes.statusCode !== 200 ) {
console.log("service not available!");
return res.status(503).send();
}
body = JSON.parse(body);
var userGames = body.response.games;
userGames.sort(function(a, b) {
return parseInt(a.appid) - parseInt(b.appid);
});
fetchUserGames(res, userGames);
});
}
//will take in the user's list of games and times and match them with the game's name.
//return HTTP 200 to client
function fetchUserGames(res, userGames) {
var sql = formatGameNameSQL(userGames);
database.fetchAll(sql, extractGameIDs(userGames), function(data) {
for(var i = 0; i < data.length; i++) {
data[i].time = userGames[i].playtime_forever;
}
return res.status(200).send(data);
});
}
//formatting for SQL statement, to prevent injection
function formatGameNameSQL(userGames) {
var sql = "SELECT * FROM Games WHERE SteamID = ?";
for(var i = 0; i < userGames.length; i++) {
//make sure not last iteration
if(i != userGames.length - 1) {
sql += " OR SteamID = ?";
}
}
return sql;
}
//helper function for SQL formatting function
function extractGameIDs(userGames) {
var gameIDs = [];
for(var i = 0; i < userGames.length; i++) {
gameIDs.push(userGames[i].appid);
}
console.log("gameIDs: ", gameIDs);
return gameIDs;
}
//consider putting these helper functions into a module.
function registerUser(res, req) {
var username = req.body.username;
var password = req.body.password;
database.insertOrUpdate("INSERT INTO User (Username, Password) VALUES (?, ?)", [username, passwordHash.generate(password)], function(err, userInsertID) {
if(err) {
res.status(503).send("Database insert failure.");
} else {
//here we pass in an object containing user information to serialize to their session.
//in practice, a database call with all pertinent user info would be used here instead.
getNewUserInfo(username, req, res, serializeNewUser);
}
});
}
function getNewUserInfo(username, req, res, callback) {
database.fetchFirst("SELECT * FROM User WHERE User.Username = ?", [username], function (userRecord) {
return callback(userRecord, req, res);
});
}
function serializeNewUser(userRecord, req, res) {
req.login(userRecord, function(err) {
if(err) {
//unknown error, display error to console and die.
console.log("Fatal error in login serialization: ");
throw err;
} else {
//success, user is serialized.
res.redirect('/protected');
}
});
}
};
};
//allow this entire file to be exported to application.js
module.exports = endpointsAPI;
|
//=require 'survey/survey_elements'
//=require 'survey/survey_submit'
var Survey = $(document).ready(function() {
this.surveyElementNumber = 0;
this.createNewQustionButton = document.getElementsByClassName("statropia-create-new-question-button")[0];
this.submitButton = document.getElementsByClassName("statropia-submit-button")[0];
this.surveyElements = document.getElementById("survey_elements");
this.addOptionButtons = document.getElementsByClassName("survey-element add_option_button");
survey_ = this;
this.createNewQustionButton.addEventListener("click", function () {
surveyElement = new SurveyElement();
surveyElement.createSurveyElement(survey_.surveyElementNumber);
survey_.surveyElementNumber ++;
});
this.submitButton.addEventListener("click", function () {
surveySubmit = new SurveySubmit();
surveySubmit.submitSurvey();
});
});
|
import React, { useContext } from 'react';
import { GameContext } from '../../../contexts/GameContext';
const WaitRoomScreen = () => {
const { gameState } = useContext(GameContext);
return (
<>
<div className="mt-4 flex flex-col content-center justify-center text-center">
<p className="text-lg">{gameState.roomNumber}</p>
<p className="text-lg">Send this code to your friend</p>
</div>
</>
);
};
export default WaitRoomScreen;
|
import AudioDecoder from "@/components/AudioDecoder.js";
export default {
name: "Pad",
props: ["keyboard", "rows", "audio-context", "edit"],
mounted() {
this.allowPressKey = {};
// Register an event listener when the Vue component is ready
window.addEventListener("keydown", this.keyDown);
window.addEventListener("keyup", this.keyUp);
window.addEventListener("touchstart", this.keyDown);
window.addEventListener("touchend", this.keyUp);
},
data() {
return {
sounds: [{
name: "Kick-808",
sound: "kick-808",
},
{
name: "snare vinyl",
sound: "snare-vinyl01",
},
{
name: "clap",
sound: "clap-tape",
},
{
name: "hi-hat",
sound: "hihat-acoustic01",
},
{
name: "hi-hat808",
sound: "hihat-808",
},
{
name: "cowbell",
sound: "cowbell-808",
},
{
name: "Kick1",
sound: "kick-classic",
},
{
name: "snare808",
sound: "snare-808",
},
{
name: "Kick2",
sound: "kick-tape",
}],
editKey: false,
currentKey:{}
}
},
methods: {
play: function(key) {
console.log(key);
this.selectedKey = key;
this.audioContext.resume();
const playbackRate = 1;
const sampleSource = this.audioContext.createBufferSource();
sampleSource.buffer = key.audio;
sampleSource.playbackRate.setValueAtTime(
playbackRate,
this.audioContext.currentTime
);
sampleSource.connect(this.audioContext.destination);
sampleSource.start();
},
keyDown: function(e) {
if (typeof this.allowPressKey[e.keyCode] === "undefined") {
this.allowPressKey[e.keyCode] = true;
}
if (!this.allowPressKey[e.keyCode]) {
return;
}
this.allowPressKey[e.keyCode] = false;
const key = this.keyboard[e.keyCode];
if (key) {
key.selected = true;
setTimeout(() => this.play(key));
}
},
keyUp: function(e) {
this.allowPressKey[e.keyCode] = true;
const key = this.keyboard[e.keyCode];
if (key) {
key.selected = false;
}
},
select: function(key) {
if (this.edit) {
this.editKey = true;
this.selectedKey = key;
this.currentKey.sound = this.selectedKey.sound;
this.currentKey.color = this.selectedKey.color;
} else {
this.play(key);
}
},
confirmEdit: async function() {
this.editKey = false;
this.selectedKey.name= this.currentKey.name;
this.selectedKey.sound= this.currentKey.sound;
this.selectedKey.color = this.currentKey.color;
const decoder = new AudioDecoder(this.audioContext);
this.selectedKey.audio = await decoder.loadFile(`/sounds/${this.selectedKey.sound}.wav`);
}
}
};
|
'use strict';
const fs = require('fs');
const path = require('path');
const Promise = require('bluebird');
const readFile = Promise.promisify(fs.readFile);
let index={
method: 'GET',
path: '/',
config:{
// If an error occurs when parsing a cookie don't error, just log it.
state:{
failAction : 'log',
}
},
handler: function (request, h) {
return ('Hello, world!');
}
};
let hello={
method: ['GET', 'POST'],
path: '/hello/{user?}',
config:{
// If an error occurs when parsing a cookie don't error, just log it.
state:{
failAction : 'log',
}
},
handler: function (request, h) {
return ('Hello ' + encodeURIComponent(request.params.user) + '!');
}
};
let topshop={
method: 'GET',
path: '/topshop',
config:{
// If an error occurs when parsing a cookie don't error, just log it.
state:{
failAction : 'log',
}
},
handler: function (req, reply) {
const text = readFile(path.join(__dirname, '../static/index.html'), 'utf-8');
return (text);
}
};
module.exports=[index,hello,topshop];
|
import './App.css';
import {ApiSelector, Bottombar, Sidebar, Map, SelectedData, TrainLogic, BatchDispatcher} from "./Components";
import {Mqtt, messageHandler, useWindowDimensions} from "./Services";
export default function App() {
const {height, width } = useWindowDimensions();
const dataPanels =
<>
<ApiSelector/>
<SelectedData/>
</>
return (
<div className="App">
<BatchDispatcher/>
<Mqtt
url={"wss://mqtt.hsl.fi:443"}
subscription={"/hfp/v2/journey/+/+/+/+/+/+/+/+/+/+/3/#"}
function={messageHandler}
api={"HSL"}
/>
<Mqtt
url={"wss://meri.digitraffic.fi/mqtt"}
options={{port: 61619, username: "digitraffic", password: "digitrafficPassword"}}
subsciption={["#"]}
function={(i) => {console.log(i)}}
/>
<TrainLogic/>
{width >= height ?
<>
<Sidebar>
{dataPanels}
</Sidebar>
<Map side={width >= height}/>
</>
:
<>
<Bottombar>
{dataPanels}
</Bottombar>
<Map side={width >= height}/>
</>
}
</div>
);
}
|
const mongoose = require("mongoose");
mongoose.connect("mongodb://127.0.0.1:27017/e-commerce", {
useNewUrlParser: true,
useCreateIndex: true,
});
const Product = mongoose.model("Product", {
name: { type: String, required: true, unique: true },
category: { type: String, required: true },
isActive: { type: Boolean },
details: {
type: {
description: { type: String, required: true, minLength: 10 },
price: {
type: Number,
required: true,
validate(value) {
if (value < 0) {
throw new Error("price number has to be a positive value");
}
},
},
discount: { type: Number, required: false, default: 0, minLength: 10 },
images: {
type: [
{
type: String,
},
],
validate(value) {
if (value.length < 2) {
throw new Error("array of images must include at least two images");
}
},
},
phone: {
type: String,
minLength: 10,
required: true,
validate(value) {
if (!value.startsWith("05")) {
throw new Error("Not A valid israeli Number");
}
},
},
date: {
type: Date,
required: false,
unique: false,
default: Date.now(),
},
},
},
});
const product = new Product({
name: "EarPods",
category: "headphones",
isActive: true,
details: {
description: "Apple EarPods with Lightning Connector - White",
price: 100,
images: [
"https://images-na.ssl-images-amazon.com/images/I/41Mqt%2Bx5mLL._AC_SX522_.jpg",
"https://images-na.ssl-images-amazon.com/images/I/41wYbyr3LLL._AC_SX522_.jpg",
],
phone: "054-5756977",
},
});
product
.save()
.then(() => {
console.log(product);
})
.catch((error) => {
console.log("Error!", error);
});
|
import React from "react";
import { ContextData } from "../context/GlobalState";
export default function Transaction({ transaction, moneyFormatter }) {
const { DelTrans } = React.useContext(ContextData);
const sign = transaction.amount < 0 ? "-" : "+";
return (
<li className={transaction.amount < 0 ? "minus" : "plus"}>
{transaction.text}{" "}
<span>
{sign}
{moneyFormatter(transaction.amount)}
</span>
<button onClick={() => DelTrans(transaction.id)} className="delete-btn">
x
</button>
</li>
);
}
|
const searchURL = "https://api.github.com/search/repositories?q="
const repoURL = "https://api.github.com/repos"
function searchRepositories() {
const searchTerm = document.getElementById('searchTerms').value
$.get(searchURL + searchTerm, function(response) {
const repos = response.items
displayRepos(repos)
}).fail(function (error) {
displayError(error)
console.log("Hmm seems like there was an error:" + `${error}`)
})
}
function displayRepos(repos) {
const repoList =
'<ul>' +
repos
.map(r => {
return `
<li>
<h2><a href="${r.html_url}">${r.name}</a></h2>
<section>
<header><h4>Created By ${r.owner.login}</h4></header>
<img src="${r.owner.avatar_url}" height="32" width="32">
</section>
</li>`;
})
.join('') +
'</ul>';
$("div#results").html(repoList)
}
function showCommits(el) {
console.log();
$.get(`${repoURL}/${el.dataset.owner}/${el.dataset.repository}/commits`, function (response) {
document.getElementById("details").innerHTML = displayCommits(response)
}).fail(function (error) {
displayError(error)
console.log("Hmm seems like there was an error:" + `${error}`)
})
}
function displayCommits(response) {
return response
.map(r => {
return `
<div>
SHA: ${r.sha}<br>
Author: ${r.commit.author.name}<br>
Author Login: ${r.author.login}<br>
<img width="50px" height="50px" src="${r.author.avatar_url}"><br>
</div>`
}
)
}
function displayError() {
$("div#errors").html("error")
}
|
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
exports.editingModule = void 0;
var _renderer = _interopRequireDefault(require("../../core/renderer"));
var _dom_adapter = _interopRequireDefault(require("../../core/dom_adapter"));
var _events_engine = _interopRequireDefault(require("../../events/core/events_engine"));
var _guid = _interopRequireDefault(require("../../core/guid"));
var _dom = require("../../core/utils/dom");
var _type = require("../../core/utils/type");
var _iterator = require("../../core/utils/iterator");
var _extend = require("../../core/utils/extend");
var _uiGrid_core = _interopRequireDefault(require("./ui.grid_core.modules"));
var _click = require("../../events/click");
var _pointer = _interopRequireDefault(require("../../events/pointer"));
var _uiGrid_core2 = _interopRequireDefault(require("./ui.grid_core.utils"));
var _array_utils = require("../../data/array_utils");
var _index = require("../../events/utils/index");
var _dialog = require("../dialog");
var _message = _interopRequireDefault(require("../../localization/message"));
var _devices = _interopRequireDefault(require("../../core/devices"));
var _deferred = require("../../core/utils/deferred");
var _common = require("../../core/utils/common");
var iconUtils = _interopRequireWildcard(require("../../core/utils/icon"));
var _uiGrid_core3 = require("./ui.grid_core.editing_constants");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var READONLY_CLASS = 'readonly';
var LINK_CLASS = 'dx-link';
var ROW_SELECTED = 'dx-selection';
var EDIT_BUTTON_CLASS = 'dx-edit-button';
var COMMAND_EDIT_CLASS = 'dx-command-edit';
var COMMAND_EDIT_WITH_ICONS_CLASS = COMMAND_EDIT_CLASS + '-with-icons';
var INSERT_INDEX = '__DX_INSERT_INDEX__';
var ROW_INSERTED = 'dx-row-inserted';
var ROW_MODIFIED = 'dx-row-modified';
var CELL_MODIFIED = 'dx-cell-modified';
var EDITING_NAMESPACE = 'dxDataGridEditing';
var CELL_FOCUS_DISABLED_CLASS = 'dx-cell-focus-disabled';
var DATA_EDIT_DATA_UPDATE_TYPE = 'update';
var DEFAULT_START_EDIT_ACTION = 'click';
var EDIT_LINK_CLASS = {
save: 'dx-link-save',
cancel: 'dx-link-cancel',
edit: 'dx-link-edit',
undelete: 'dx-link-undelete',
delete: 'dx-link-delete',
add: 'dx-link-add'
};
var EDIT_ICON_CLASS = {
save: 'save',
cancel: 'revert',
edit: 'edit',
undelete: 'revert',
delete: 'trash',
add: 'add'
};
var METHOD_NAMES = {
edit: 'editRow',
delete: 'deleteRow',
undelete: 'undeleteRow',
save: 'saveEditData',
cancel: 'cancelEditData',
add: 'addRowByRowIndex'
};
var ACTION_OPTION_NAMES = {
add: 'allowAdding',
edit: 'allowUpdating',
delete: 'allowDeleting'
};
var BUTTON_NAMES = ['edit', 'save', 'cancel', 'delete', 'undelete'];
var EDITING_CHANGES_OPTION_NAME = 'editing.changes';
var NEW_SCROLLING_MODE = 'scrolling.newMode';
var createFailureHandler = function createFailureHandler(deferred) {
return function (arg) {
var error = arg instanceof Error ? arg : new Error(arg && String(arg) || 'Unknown error');
deferred.reject(error);
};
};
var isEditingCell = function isEditingCell(isEditRow, cellOptions) {
return cellOptions.isEditing || isEditRow && cellOptions.column.allowEditing;
};
var isEditingOrShowEditorAlwaysDataCell = function isEditingOrShowEditorAlwaysDataCell(isEditRow, cellOptions) {
var isCommandCell = !!cellOptions.column.command;
var isEditing = isEditingCell(isEditRow, cellOptions);
var isEditorCell = !isCommandCell && (isEditing || cellOptions.column.showEditorAlways);
return cellOptions.rowType === 'data' && isEditorCell;
};
var EditingController = _uiGrid_core.default.ViewController.inherit(function () {
var getEditingTexts = function getEditingTexts(options) {
var editingTexts = options.component.option('editing.texts') || {};
return {
save: editingTexts.saveRowChanges,
cancel: editingTexts.cancelRowChanges,
edit: editingTexts.editRow,
undelete: editingTexts.undeleteRow,
delete: editingTexts.deleteRow,
add: editingTexts.addRowToNode
};
};
var getButtonIndex = function getButtonIndex(buttons, name) {
var result = -1;
buttons.some(function (button, index) {
if (getButtonName(button) === name) {
result = index;
return true;
}
});
return result;
};
function getButtonName(button) {
return (0, _type.isObject)(button) ? button.name : button;
}
return {
init: function init() {
this._columnsController = this.getController('columns');
this._dataController = this.getController('data');
this._rowsView = this.getView('rowsView');
this._lastOperation = null;
if (this._deferreds) {
this._deferreds.forEach(function (d) {
return d.reject('cancel');
});
}
this._deferreds = [];
if (!this._dataChangedHandler) {
this._dataChangedHandler = this._handleDataChanged.bind(this);
this._dataController.changed.add(this._dataChangedHandler);
}
if (!this._saveEditorHandler) {
this.createAction('onInitNewRow', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowInserting', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowInserted', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onEditingStart', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowUpdating', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowUpdated', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowRemoving', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onRowRemoved', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onSaved', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onSaving', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onEditCanceling', {
excludeValidators: ['disabled', 'readOnly']
});
this.createAction('onEditCanceled', {
excludeValidators: ['disabled', 'readOnly']
});
}
this._updateEditColumn();
this._updateEditButtons();
if (!this._internalState) {
this._internalState = [];
}
this.component._optionsByReference[_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME] = true;
this.component._optionsByReference[EDITING_CHANGES_OPTION_NAME] = true;
},
getEditMode: function getEditMode() {
var editMode = this.option('editing.mode');
if (_uiGrid_core3.EDIT_MODES.indexOf(editMode) !== -1) {
return editMode;
}
return _uiGrid_core3.EDIT_MODE_ROW;
},
_getDefaultEditorTemplate: function _getDefaultEditorTemplate() {
var _this = this;
return function (container, options) {
var $editor = (0, _renderer.default)('<div>').appendTo(container);
_this.getController('editorFactory').createEditor($editor, (0, _extend.extend)({}, options.column, {
value: options.value,
setValue: options.setValue,
row: options.row,
parentType: 'dataRow',
width: null,
readOnly: !options.setValue,
isOnForm: options.isOnForm,
id: options.id
}));
};
},
getChanges: function getChanges() {
return this.option(EDITING_CHANGES_OPTION_NAME);
},
resetChanges: function resetChanges() {
var changes = this.getChanges();
var needReset = changes === null || changes === void 0 ? void 0 : changes.length;
if (needReset) {
this._silentOption(EDITING_CHANGES_OPTION_NAME, []);
}
},
_getInternalData: function _getInternalData(key) {
return this._internalState.filter(function (item) {
return (0, _common.equalByValue)(item.key, key);
})[0];
},
_addInternalData: function _addInternalData(params) {
var internalData = this._getInternalData(params.key);
if (internalData) {
return (0, _extend.extend)(internalData, params);
}
this._internalState.push(params);
return params;
},
_getOldData: function _getOldData(key) {
var _this$_getInternalDat;
return (_this$_getInternalDat = this._getInternalData(key)) === null || _this$_getInternalDat === void 0 ? void 0 : _this$_getInternalDat.oldData;
},
getUpdatedData: function getUpdatedData(data) {
var key = this._dataController.keyOf(data);
var changes = this.getChanges();
var editIndex = _uiGrid_core2.default.getIndexByKey(key, changes);
if (changes[editIndex]) {
return (0, _array_utils.createObjectWithChanges)(data, changes[editIndex].data);
}
return data;
},
getInsertedData: function getInsertedData() {
return this.getChanges().filter(function (change) {
return change.data && change.type === _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE;
}).map(function (change) {
return change.data;
});
},
getRemovedData: function getRemovedData() {
var _this2 = this;
return this.getChanges().filter(function (change) {
return _this2._getOldData(change.key) && change.type === _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE;
}).map(function (change) {
return _this2._getOldData(change.key);
});
},
_fireDataErrorOccurred: function _fireDataErrorOccurred(arg) {
if (arg === 'cancel') return;
var $popupContent = this.getPopupContent();
this._dataController.dataErrorOccurred.fire(arg, $popupContent);
},
_needToCloseEditableCell: _common.noop,
_closeEditItem: _common.noop,
_handleDataChanged: _common.noop,
_isDefaultButtonVisible: function _isDefaultButtonVisible(button, options) {
var result = true;
switch (button.name) {
case 'delete':
result = this.allowDeleting(options);
break;
case 'undelete':
result = false;
}
return result;
},
_isButtonVisible: function _isButtonVisible(button, options) {
var visible = button.visible;
if (!(0, _type.isDefined)(visible)) {
return this._isDefaultButtonVisible(button, options);
}
return (0, _type.isFunction)(visible) ? visible.call(button, {
component: options.component,
row: options.row,
column: options.column
}) : visible;
},
_getButtonConfig: function _getButtonConfig(button, options) {
var _this3 = this;
var config = (0, _type.isObject)(button) ? button : {};
var buttonName = getButtonName(button);
var editingTexts = getEditingTexts(options);
var methodName = METHOD_NAMES[buttonName];
var editingOptions = this.option('editing');
var actionName = ACTION_OPTION_NAMES[buttonName];
var allowAction = actionName ? editingOptions[actionName] : true;
return (0, _extend.extend)({
name: buttonName,
text: editingTexts[buttonName],
cssClass: EDIT_LINK_CLASS[buttonName],
onClick: function onClick(e) {
var event = e.event;
event.stopPropagation();
event.preventDefault();
setTimeout(function () {
options.row && allowAction && _this3[methodName] && _this3[methodName](options.row.rowIndex);
});
}
}, config);
},
_getEditingButtons: function _getEditingButtons(options) {
var _this4 = this;
var buttonIndex;
var haveCustomButtons = !!options.column.buttons;
var buttons = (options.column.buttons || []).slice();
if (haveCustomButtons) {
buttonIndex = getButtonIndex(buttons, 'edit');
if (buttonIndex >= 0) {
if (getButtonIndex(buttons, 'save') < 0) {
buttons.splice(buttonIndex + 1, 0, 'save');
}
if (getButtonIndex(buttons, 'cancel') < 0) {
buttons.splice(getButtonIndex(buttons, 'save') + 1, 0, 'cancel');
}
}
buttonIndex = getButtonIndex(buttons, 'delete');
if (buttonIndex >= 0 && getButtonIndex(buttons, 'undelete') < 0) {
buttons.splice(buttonIndex + 1, 0, 'undelete');
}
} else {
buttons = BUTTON_NAMES.slice();
}
return buttons.map(function (button) {
return _this4._getButtonConfig(button, options);
});
},
_renderEditingButtons: function _renderEditingButtons($container, buttons, options) {
var _this5 = this;
buttons.forEach(function (button) {
if (_this5._isButtonVisible(button, options)) {
_this5._createButton($container, button, options);
}
});
},
_getEditCommandCellTemplate: function _getEditCommandCellTemplate() {
var _this6 = this;
return function (container, options) {
var $container = (0, _renderer.default)(container);
if (options.rowType === 'data') {
var buttons = _this6._getEditingButtons(options);
_this6._renderEditingButtons($container, buttons, options);
options.watch && options.watch(function () {
return buttons.map(function (button) {
return _this6._isButtonVisible(button, options);
});
}, function () {
$container.empty();
_this6._renderEditingButtons($container, buttons, options);
});
} else {
_uiGrid_core2.default.setEmptyText($container);
}
};
},
isRowBasedEditMode: function isRowBasedEditMode() {
var editMode = this.getEditMode();
return _uiGrid_core3.ROW_BASED_MODES.indexOf(editMode) !== -1;
},
getFirstEditableColumnIndex: function getFirstEditableColumnIndex() {
var columnsController = this.getController('columns');
var columnIndex;
var visibleColumns = columnsController.getVisibleColumns();
(0, _iterator.each)(visibleColumns, function (index, column) {
if (column.allowEditing) {
columnIndex = index;
return false;
}
});
return columnIndex;
},
getFirstEditableCellInRow: function getFirstEditableCellInRow(rowIndex) {
var rowsView = this.getView('rowsView');
return rowsView && rowsView._getCellElement(rowIndex ? rowIndex : 0, this.getFirstEditableColumnIndex());
},
getFocusedCellInRow: function getFocusedCellInRow(rowIndex) {
return this.getFirstEditableCellInRow(rowIndex);
},
getIndexByKey: function getIndexByKey(key, items) {
return _uiGrid_core2.default.getIndexByKey(key, items);
},
hasChanges: function hasChanges(rowIndex) {
var changes = this.getChanges();
var result = false;
for (var i = 0; i < (changes === null || changes === void 0 ? void 0 : changes.length); i++) {
if (changes[i].type && (!(0, _type.isDefined)(rowIndex) || this._dataController.getRowIndexByKey(changes[i].key) === rowIndex)) {
result = true;
break;
}
}
return result;
},
dispose: function dispose() {
this.callBase();
clearTimeout(this._inputFocusTimeoutID);
_events_engine.default.off(_dom_adapter.default.getDocument(), _pointer.default.up, this._pointerUpEditorHandler);
_events_engine.default.off(_dom_adapter.default.getDocument(), _pointer.default.down, this._pointerDownEditorHandler);
_events_engine.default.off(_dom_adapter.default.getDocument(), _click.name, this._saveEditorHandler);
},
optionChanged: function optionChanged(args) {
if (args.name === 'editing') {
var fullName = args.fullName;
if (fullName === _uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME) {
this._handleEditRowKeyChange(args);
} else if (fullName === EDITING_CHANGES_OPTION_NAME) {
this._handleChangesChange(args);
} else if (!args.handled) {
this._columnsController.reinit();
this.init();
this.resetChanges();
this._resetEditColumnName();
this._resetEditRowKey();
}
args.handled = true;
} else {
this.callBase(args);
}
},
_handleEditRowKeyChange: function _handleEditRowKeyChange(args) {
var rowIndex = this._dataController.getRowIndexByKey(args.value);
var oldRowIndexCorrection = this._getEditRowIndexCorrection();
var oldRowIndex = this._dataController.getRowIndexByKey(args.previousValue) + oldRowIndexCorrection;
if ((0, _type.isDefined)(args.value)) {
if (args.value !== args.previousValue) {
this._editRowFromOptionChanged(rowIndex, oldRowIndex);
}
} else {
this.cancelEditData();
}
},
_handleChangesChange: function _handleChangesChange(args) {
var dataController = this._dataController;
if (!args.value.length && !args.previousValue.length) {
return;
}
this._processInsertChanges(args.value);
dataController.updateItems({
repaintChangesOnly: true
});
},
_processInsertChanges: function _processInsertChanges(changes) {
var _this7 = this;
changes.forEach(function (change) {
if (change.type === 'insert') {
_this7._addInsertInfo(change);
}
});
},
publicMethods: function publicMethods() {
return ['addRow', 'deleteRow', 'undeleteRow', 'editRow', 'saveEditData', 'cancelEditData', 'hasEditData'];
},
refresh: function refresh(isPageChanged) {
if (!(0, _type.isDefined)(this._pageIndex)) {
return;
}
this._refreshCore(isPageChanged);
},
_refreshCore: _common.noop,
isEditing: function isEditing() {
var isEditRowKeyDefined = (0, _type.isDefined)(this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME));
return isEditRowKeyDefined;
},
isEditRow: function isEditRow() {
return false;
},
_setEditRowKey: function _setEditRowKey(value, silent) {
if (silent) {
this._silentOption(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME, value);
} else {
this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME, value);
}
},
_setEditRowKeyByIndex: function _setEditRowKeyByIndex(rowIndex, silent) {
var key = this._dataController.getKeyByRowIndex(rowIndex);
if (key === undefined) {
this._dataController.fireError('E1043');
return;
}
this._setEditRowKey(key, silent);
},
getEditRowIndex: function getEditRowIndex() {
return this._getVisibleEditRowIndex();
},
getEditFormRowIndex: function getEditFormRowIndex() {
return -1;
},
_isEditRowByIndex: function _isEditRowByIndex(rowIndex) {
var key = this._dataController.getKeyByRowIndex(rowIndex); // Vitik: performance optimization equalByValue take O(1)
var isKeyEqual = (0, _type.isDefined)(key) && (0, _common.equalByValue)(this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME), key);
if (isKeyEqual) {
// Vitik: performance optimization _getVisibleEditRowIndex take O(n)
return this._getVisibleEditRowIndex() === rowIndex;
}
return isKeyEqual;
},
isEditCell: function isEditCell(visibleRowIndex, columnIndex) {
return this._isEditRowByIndex(visibleRowIndex) && this._getVisibleEditColumnIndex() === columnIndex;
},
getPopupContent: _common.noop,
_needInsertItem: function _needInsertItem(change, changeType) {
var dataController = this._dataController;
var dataSource = dataController.dataSource();
var scrollingMode = this.option('scrolling.mode');
var pageIndex = dataSource.pageIndex();
var beginPageIndex = dataSource.beginPageIndex ? dataSource.beginPageIndex() : pageIndex;
var endPageIndex = dataSource.endPageIndex ? dataSource.endPageIndex() : pageIndex;
var isLastPage = endPageIndex === dataSource.pageCount() - 1;
if (scrollingMode !== 'standard') {
var pageSize = dataSource.pageSize() || 1;
var changePageIndex = Math.floor(change.index / pageSize);
var needInsertOnLastPosition = isLastPage && change.index === -1;
switch (changeType) {
case 'append':
return changePageIndex === endPageIndex || needInsertOnLastPosition;
case 'prepend':
return changePageIndex === beginPageIndex;
default:
{
var _dataController$topIt, _dataController$botto;
var topItemIndex = (_dataController$topIt = dataController.topItemIndex) === null || _dataController$topIt === void 0 ? void 0 : _dataController$topIt.call(dataController);
var bottomItemIndex = (_dataController$botto = dataController.bottomItemIndex) === null || _dataController$botto === void 0 ? void 0 : _dataController$botto.call(dataController);
if (this.option(NEW_SCROLLING_MODE) && (0, _type.isDefined)(topItemIndex)) {
return change.index >= topItemIndex && change.index <= bottomItemIndex || needInsertOnLastPosition;
}
return changePageIndex >= beginPageIndex && changePageIndex <= endPageIndex || needInsertOnLastPosition;
}
}
}
return change.pageIndex === pageIndex || change.pageIndex === -1 && isLastPage;
},
_generateNewItem: function _generateNewItem(key) {
var _this$_getInternalDat2;
var item = {
key: key
};
var insertInfo = (_this$_getInternalDat2 = this._getInternalData(key)) === null || _this$_getInternalDat2 === void 0 ? void 0 : _this$_getInternalDat2.insertInfo;
if (insertInfo !== null && insertInfo !== void 0 && insertInfo[INSERT_INDEX]) {
item[INSERT_INDEX] = insertInfo[INSERT_INDEX];
}
return item;
},
_getLoadedRowIndex: function _getLoadedRowIndex(items, change, key) {
var dataController = this._dataController;
var loadedRowIndexOffset = dataController.getRowIndexOffset(true);
var changes = this.getChanges();
var index = change ? changes.filter(function (editChange) {
return (0, _common.equalByValue)(editChange.key, key);
})[0].index : 0;
var loadedRowIndex = index - loadedRowIndexOffset;
if (change.changeType === 'append') {
loadedRowIndex -= dataController.items(true).length;
if (change.removeCount) {
loadedRowIndex += change.removeCount;
}
}
for (var i = 0; i < loadedRowIndex; i++) {
if (items[i] && items[i][INSERT_INDEX]) {
loadedRowIndex++;
}
}
return loadedRowIndex;
},
processItems: function processItems(items, e) {
var _this8 = this;
var changeType = e.changeType;
this.update(changeType);
var changes = this.getChanges();
changes.forEach(function (change) {
var _this8$_getInternalDa;
var isInsert = change.type === _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE;
if (!isInsert) {
return;
}
var key = change.key;
var insertInfo = (_this8$_getInternalDa = _this8._getInternalData(key)) === null || _this8$_getInternalDa === void 0 ? void 0 : _this8$_getInternalDa.insertInfo;
if (!(0, _type.isDefined)(change.key) || !(0, _type.isDefined)(insertInfo)) {
var keys = _this8._addInsertInfo(change);
key = keys.key;
insertInfo = keys.insertInfo;
}
var loadedRowIndex = _this8._getLoadedRowIndex(items, e, key);
var item = _this8._generateNewItem(key);
if ((loadedRowIndex >= 0 || change.index === -1) && _this8._needInsertItem(change, changeType, items, item)) {
if (change.index !== -1) {
items.splice(change.index ? loadedRowIndex : 0, 0, item);
} else {
items.push(item);
}
}
});
return items;
},
processDataItem: function processDataItem(item, options, generateDataValues) {
var columns = options.visibleColumns;
var key = item.data[INSERT_INDEX] ? item.data.key : item.key;
var changes = this.getChanges();
var editIndex = _uiGrid_core2.default.getIndexByKey(key, changes);
item.isEditing = false;
if (editIndex >= 0) {
this._processDataItemCore(item, changes[editIndex], key, columns, generateDataValues);
}
},
_processDataItemCore: function _processDataItemCore(item, change, key, columns, generateDataValues) {
var data = change.data,
type = change.type;
switch (type) {
case _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE:
item.isNewRow = true;
item.key = key;
item.data = data;
break;
case DATA_EDIT_DATA_UPDATE_TYPE:
item.modified = true;
item.oldData = item.data;
item.data = (0, _array_utils.createObjectWithChanges)(item.data, data);
item.modifiedValues = generateDataValues(data, columns, true);
break;
case _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE:
item.removed = true;
break;
}
},
_initNewRow: function _initNewRow(options) {
var _this9 = this;
this.executeAction('onInitNewRow', options);
if (options.promise) {
var deferred = new _deferred.Deferred();
(0, _deferred.when)((0, _deferred.fromPromise)(options.promise)).done(deferred.resolve).fail(createFailureHandler(deferred)).fail(function (arg) {
return _this9._fireDataErrorOccurred(arg);
});
return deferred;
}
},
_calculateIndex: function _calculateIndex(rowIndex) {
var dataController = this._dataController;
var rows = dataController.items();
return dataController.getRowIndexOffset() + rows.filter(function (row, index) {
return index < rowIndex && (row.rowType === 'data' && !row.isNewRow || row.rowType === 'group');
}).length;
},
_createInsertInfo: function _createInsertInfo() {
var insertInfo = {};
insertInfo[INSERT_INDEX] = this._getInsertIndex();
return insertInfo;
},
_getCorrectedInsertRowIndex: function _getCorrectedInsertRowIndex(parentKey) {
var rowIndex = this._getInsertRowIndex(parentKey);
var dataController = this._dataController;
var rows = dataController.items();
var row = rows[rowIndex];
if (row && (!row.isEditing && row.rowType === 'detail' || row.rowType === 'detailAdaptive')) {
rowIndex++;
}
return rowIndex;
},
_addInsertInfo: function _addInsertInfo(change, parentKey) {
var _this$_getInternalDat3;
var insertInfo;
var rowIndex;
var key = change.key;
if (!(0, _type.isDefined)(key)) {
key = String(new _guid.default());
change.key = key;
}
insertInfo = (_this$_getInternalDat3 = this._getInternalData(key)) === null || _this$_getInternalDat3 === void 0 ? void 0 : _this$_getInternalDat3.insertInfo;
if (!(0, _type.isDefined)(insertInfo)) {
rowIndex = this._getCorrectedInsertRowIndex(parentKey);
insertInfo = this._createInsertInfo();
this._setIndexes(change, rowIndex);
}
this._addInternalData({
insertInfo: insertInfo,
key: key
});
return {
insertInfo: insertInfo,
key: key,
rowIndex: rowIndex
};
},
_setIndexes: function _setIndexes(change, rowIndex) {
var _change$index;
var dataController = this._dataController;
change.index = (_change$index = change.index) !== null && _change$index !== void 0 ? _change$index : this._calculateIndex(rowIndex);
if (this.option('scrolling.mode') !== 'virtual') {
var _change$pageIndex;
change.pageIndex = (_change$pageIndex = change.pageIndex) !== null && _change$pageIndex !== void 0 ? _change$pageIndex : dataController.pageIndex();
}
},
_getInsertRowIndex: function _getInsertRowIndex(parentKey) {
var rowsView = this.getView('rowsView');
var parentRowIndex = this._dataController.getRowIndexByKey(parentKey);
if (parentRowIndex >= 0) {
return parentRowIndex + 1;
}
if (rowsView) {
return rowsView.getTopVisibleItemIndex(true);
}
return 0;
},
_getInsertIndex: function _getInsertIndex() {
var _this10 = this;
var maxInsertIndex = 0;
this.getChanges().forEach(function (editItem) {
var _this10$_getInternalD;
var insertInfo = (_this10$_getInternalD = _this10._getInternalData(editItem.key)) === null || _this10$_getInternalD === void 0 ? void 0 : _this10$_getInternalD.insertInfo;
if ((0, _type.isDefined)(insertInfo) && editItem.type === _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE && insertInfo[INSERT_INDEX] > maxInsertIndex) {
maxInsertIndex = insertInfo[INSERT_INDEX];
}
});
return maxInsertIndex + 1;
},
addRow: function addRow(parentKey) {
var dataController = this._dataController;
var store = dataController.store();
if (!store) {
dataController.fireError('E1052', this.component.NAME);
return new _deferred.Deferred().reject();
}
return this._addRow(parentKey);
},
_addRow: function _addRow(parentKey) {
var _this11 = this;
var dataController = this._dataController;
var store = dataController.store();
var key = store && store.key();
var param = {
data: {}
};
var oldEditRowIndex = this._getVisibleEditRowIndex();
var deferred = new _deferred.Deferred();
this.refresh();
if (!this._allowRowAdding()) {
return deferred.reject('cancel');
}
if (!key) {
param.data.__KEY__ = String(new _guid.default());
}
(0, _deferred.when)(this._initNewRow(param, parentKey)).done(function () {
if (_this11._allowRowAdding()) {
(0, _deferred.when)(_this11._addRowCore(param.data, parentKey, oldEditRowIndex)).done(deferred.resolve).fail(deferred.reject);
} else {
deferred.reject('cancel');
}
}).fail(deferred.reject);
return deferred.promise();
},
_allowRowAdding: function _allowRowAdding() {
var insertIndex = this._getInsertIndex();
if (insertIndex > 1) {
return false;
}
return true;
},
_addRowCore: function _addRowCore(data, parentKey, initialOldEditRowIndex) {
var oldEditRowIndex = this._getVisibleEditRowIndex();
var change = {
data: data,
type: _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE
};
var _this$_addInsertInfo = this._addInsertInfo(change, parentKey),
key = _this$_addInsertInfo.key,
rowIndex = _this$_addInsertInfo.rowIndex;
this._setEditRowKey(key, true);
this._addChange(change);
this._dataController.updateItems({
changeType: 'update',
rowIndices: [initialOldEditRowIndex, oldEditRowIndex, rowIndex]
});
this._showAddedRow(rowIndex);
this._afterInsertRow({
key: key,
data: data
});
return new _deferred.Deferred().resolve();
},
_showAddedRow: function _showAddedRow(rowIndex) {
this._focusFirstEditableCellInRow(rowIndex);
},
_beforeFocusElementInRow: _common.noop,
_focusFirstEditableCellInRow: function _focusFirstEditableCellInRow(rowIndex) {
var _this12 = this;
var $firstCell = this.getFirstEditableCellInRow(rowIndex);
this._editCellInProgress = true;
this._delayedInputFocus($firstCell, function () {
_this12._editCellInProgress = false;
_this12._beforeFocusElementInRow(rowIndex);
});
},
_isEditingStart: function _isEditingStart(options) {
this.executeAction('onEditingStart', options);
return options.cancel;
},
_beforeUpdateItems: _common.noop,
_getVisibleEditColumnIndex: function _getVisibleEditColumnIndex() {
var editColumnName = this.option(_uiGrid_core3.EDITING_EDITCOLUMNNAME_OPTION_NAME);
if (!(0, _type.isDefined)(editColumnName)) {
return -1;
}
return this._columnsController.getVisibleColumnIndex(editColumnName);
},
_setEditColumnNameByIndex: function _setEditColumnNameByIndex(index, silent) {
var _visibleColumns$index;
var visibleColumns = this._columnsController.getVisibleColumns();
this._setEditColumnName((_visibleColumns$index = visibleColumns[index]) === null || _visibleColumns$index === void 0 ? void 0 : _visibleColumns$index.name, silent);
},
_setEditColumnName: function _setEditColumnName(name, silent) {
if (silent) {
this._silentOption(_uiGrid_core3.EDITING_EDITCOLUMNNAME_OPTION_NAME, name);
} else {
this.option(_uiGrid_core3.EDITING_EDITCOLUMNNAME_OPTION_NAME, name);
}
},
_resetEditColumnName: function _resetEditColumnName() {
this._setEditColumnName(null, true);
},
_getEditColumn: function _getEditColumn() {
var editColumnName = this.option(_uiGrid_core3.EDITING_EDITCOLUMNNAME_OPTION_NAME);
return this._getColumnByName(editColumnName);
},
_getColumnByName: function _getColumnByName(name) {
var visibleColumns = this._columnsController.getVisibleColumns();
var editColumn;
(0, _type.isDefined)(name) && visibleColumns.some(function (column) {
if (column.name === name) {
editColumn = column;
return true;
}
});
return editColumn;
},
_getVisibleEditRowIndex: function _getVisibleEditRowIndex(columnName) {
var dataController = this._dataController;
var editRowKey = this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME);
var rowIndex = dataController.getRowIndexByKey(editRowKey);
if (rowIndex === -1) {
return rowIndex;
}
return rowIndex + this._getEditRowIndexCorrection(columnName);
},
_getEditRowIndexCorrection: function _getEditRowIndexCorrection(columnName) {
var editColumn = columnName ? this._getColumnByName(columnName) : this._getEditColumn();
var isColumnHidden = (editColumn === null || editColumn === void 0 ? void 0 : editColumn.visibleWidth) === 'adaptiveHidden';
return isColumnHidden ? 1 : 0;
},
_resetEditRowKey: function _resetEditRowKey() {
this._setEditRowKey(null, true);
},
_resetEditIndices: function _resetEditIndices() {
this._resetEditColumnName();
this._resetEditRowKey();
},
editRow: function editRow(rowIndex) {
var _item$oldData;
var dataController = this._dataController;
var items = dataController.items();
var item = items[rowIndex];
var params = {
data: item && item.data,
cancel: false
};
var oldRowIndex = this._getVisibleEditRowIndex();
if (!item) {
return;
}
if (rowIndex === oldRowIndex) {
return true;
}
if (item.key === undefined) {
this._dataController.fireError('E1043');
return;
}
if (!item.isNewRow) {
params.key = item.key;
}
if (this._isEditingStart(params)) {
return;
}
this.resetChanges();
this.init();
this._resetEditColumnName();
this._pageIndex = dataController.pageIndex();
this._addInternalData({
key: item.key,
oldData: (_item$oldData = item.oldData) !== null && _item$oldData !== void 0 ? _item$oldData : item.data
});
this._setEditRowKey(item.key);
},
_editRowFromOptionChanged: function _editRowFromOptionChanged(rowIndex, oldRowIndex) {
var rowIndices = [oldRowIndex, rowIndex];
this._beforeUpdateItems(rowIndices, rowIndex, oldRowIndex);
this._editRowFromOptionChangedCore(rowIndices, rowIndex, oldRowIndex);
},
_editRowFromOptionChangedCore: function _editRowFromOptionChangedCore(rowIndices, rowIndex, oldRowIndex) {
this._needFocusEditor = true;
this._dataController.updateItems({
changeType: 'update',
rowIndices: rowIndices
});
},
_focusEditorIfNeed: _common.noop,
_showEditPopup: _common.noop,
_repaintEditPopup: _common.noop,
_getEditPopupHiddenHandler: function _getEditPopupHiddenHandler() {
var _this13 = this;
return function (e) {
if (_this13.isEditing()) {
_this13.cancelEditData();
}
};
},
_getPopupEditFormTemplate: _common.noop,
_getSaveButtonConfig: function _getSaveButtonConfig() {
return {
text: this.option('editing.texts.saveRowChanges'),
onClick: this.saveEditData.bind(this)
};
},
_getCancelButtonConfig: function _getCancelButtonConfig() {
return {
text: this.option('editing.texts.cancelRowChanges'),
onClick: this.cancelEditData.bind(this)
};
},
_removeInternalData: function _removeInternalData(key) {
var internalData = this._getInternalData(key);
var index = this._internalState.indexOf(internalData);
if (index > -1) {
this._internalState.splice(index, 1);
}
},
_removeChange: function _removeChange(index) {
if (index >= 0) {
var changes = _toConsumableArray(this.getChanges());
var key = changes[index].key;
this._removeInternalData(key);
changes.splice(index, 1);
this._silentOption(EDITING_CHANGES_OPTION_NAME, changes);
if ((0, _common.equalByValue)(this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME), key)) {
this._resetEditIndices();
}
}
},
executeOperation: function executeOperation(deferred, func) {
var _this14 = this;
this._lastOperation && this._lastOperation.reject();
this._lastOperation = deferred;
this.waitForDeferredOperations().done(function () {
if (deferred.state() === 'rejected') {
return;
}
func();
_this14._lastOperation = null;
}).fail(function () {
deferred.reject();
_this14._lastOperation = null;
});
},
waitForDeferredOperations: function waitForDeferredOperations() {
return _deferred.when.apply(void 0, _toConsumableArray(this._deferreds));
},
_processCanceledEditingCell: _common.noop,
_repaintEditCell: function _repaintEditCell(column, oldColumn, oldEditRowIndex) {
this._needFocusEditor = true;
if (!column || !column.showEditorAlways || oldColumn && !oldColumn.showEditorAlways) {
this._editCellInProgress = true; // T316439
this.getController('editorFactory').loseFocus();
this._dataController.updateItems({
changeType: 'update',
rowIndices: [oldEditRowIndex, this._getVisibleEditRowIndex()]
});
} else if (column !== oldColumn) {
// TODO check this necessity T816039
this._dataController.updateItems({
changeType: 'update',
rowIndices: []
});
}
},
_delayedInputFocus: function _delayedInputFocus($cell, beforeFocusCallback, callBeforeFocusCallbackAlways) {
var _this15 = this;
var inputFocus = function inputFocus() {
if (beforeFocusCallback) {
beforeFocusCallback();
}
if ($cell) {
var $focusableElement = $cell.find(_uiGrid_core3.FOCUSABLE_ELEMENT_SELECTOR).first();
_uiGrid_core2.default.focusAndSelectElement(_this15, $focusableElement);
}
_this15._beforeFocusCallback = null;
};
if (_devices.default.real().ios || _devices.default.real().android) {
inputFocus();
} else {
if (this._beforeFocusCallback) this._beforeFocusCallback();
clearTimeout(this._inputFocusTimeoutID);
if (callBeforeFocusCallbackAlways) {
this._beforeFocusCallback = beforeFocusCallback;
}
this._inputFocusTimeoutID = setTimeout(inputFocus);
}
},
_focusEditingCell: function _focusEditingCell(beforeFocusCallback, $editCell, callBeforeFocusCallbackAlways) {
var rowsView = this.getView('rowsView');
var editColumnIndex = this._getVisibleEditColumnIndex();
$editCell = $editCell || rowsView && rowsView._getCellElement(this._getVisibleEditRowIndex(), editColumnIndex);
if ($editCell) {
this._delayedInputFocus($editCell, beforeFocusCallback, callBeforeFocusCallbackAlways);
}
},
deleteRow: function deleteRow(rowIndex) {
this._checkAndDeleteRow(rowIndex);
},
_checkAndDeleteRow: function _checkAndDeleteRow(rowIndex) {
var _this16 = this;
var editingOptions = this.option('editing');
var editingTexts = editingOptions === null || editingOptions === void 0 ? void 0 : editingOptions.texts;
var confirmDelete = editingOptions === null || editingOptions === void 0 ? void 0 : editingOptions.confirmDelete;
var confirmDeleteMessage = editingTexts === null || editingTexts === void 0 ? void 0 : editingTexts.confirmDeleteMessage;
var item = this._dataController.items()[rowIndex];
var allowDeleting = !this.isEditing() || item.isNewRow; // T741746
if (item && allowDeleting) {
if (!confirmDelete || !confirmDeleteMessage) {
this._deleteRowCore(rowIndex);
} else {
var confirmDeleteTitle = editingTexts && editingTexts.confirmDeleteTitle;
var showDialogTitle = (0, _type.isDefined)(confirmDeleteTitle) && confirmDeleteTitle.length > 0;
(0, _dialog.confirm)(confirmDeleteMessage, confirmDeleteTitle, showDialogTitle).done(function (confirmResult) {
if (confirmResult) {
_this16._deleteRowCore(rowIndex);
}
});
}
}
},
_deleteRowCore: function _deleteRowCore(rowIndex) {
var dataController = this._dataController;
var item = dataController.items()[rowIndex];
var key = item && item.key;
var oldEditRowIndex = this._getVisibleEditRowIndex();
this.refresh();
var changes = this.getChanges();
var editIndex = _uiGrid_core2.default.getIndexByKey(key, changes);
if (editIndex >= 0) {
if (changes[editIndex].type === _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE) {
this._removeChange(editIndex);
} else {
this._addChange({
key: key,
type: _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE
});
}
} else {
this._addChange({
key: key,
oldData: item.data,
type: _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE
});
}
return this._afterDeleteRow(rowIndex, oldEditRowIndex);
},
_afterDeleteRow: function _afterDeleteRow(rowIndex, oldEditRowIndex) {
return this.saveEditData();
},
undeleteRow: function undeleteRow(rowIndex) {
var dataController = this._dataController;
var item = dataController.items()[rowIndex];
var oldEditRowIndex = this._getVisibleEditRowIndex();
var key = item && item.key;
var changes = this.getChanges();
if (item) {
var editIndex = _uiGrid_core2.default.getIndexByKey(key, changes);
if (editIndex >= 0) {
var data = changes[editIndex].data;
if ((0, _type.isEmptyObject)(data)) {
this._removeChange(editIndex);
} else {
this._addChange({
key: key,
type: DATA_EDIT_DATA_UPDATE_TYPE
});
}
dataController.updateItems({
changeType: 'update',
rowIndices: [oldEditRowIndex, rowIndex]
});
}
}
},
_fireOnSaving: function _fireOnSaving() {
var _this17 = this;
var onSavingParams = {
cancel: false,
promise: null,
changes: _toConsumableArray(this.getChanges())
};
this.executeAction('onSaving', onSavingParams);
var d = new _deferred.Deferred();
(0, _deferred.when)((0, _deferred.fromPromise)(onSavingParams.promise)).done(function () {
d.resolve(onSavingParams);
}).fail(function (arg) {
createFailureHandler(d);
_this17._fireDataErrorOccurred(arg);
d.resolve({
cancel: true
});
});
return d;
},
_executeEditingAction: function _executeEditingAction(actionName, params, func) {
if (this.component._disposed) {
return null;
}
var deferred = new _deferred.Deferred();
this.executeAction(actionName, params);
(0, _deferred.when)((0, _deferred.fromPromise)(params.cancel)).done(function (cancel) {
if (cancel) {
setTimeout(function () {
deferred.resolve('cancel');
});
} else {
func(params).done(deferred.resolve).fail(createFailureHandler(deferred));
}
}).fail(createFailureHandler(deferred));
return deferred;
},
_processChanges: function _processChanges(deferreds, results, dataChanges, changes) {
var _this18 = this;
var store = this._dataController.store();
(0, _iterator.each)(changes, function (index, change) {
var oldData = _this18._getOldData(change.key);
var data = change.data,
type = change.type;
var changeCopy = _extends({}, change);
var deferred;
var params;
if (_this18._beforeSaveEditData(change, index)) {
return;
}
switch (type) {
case _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE:
params = {
data: oldData,
key: change.key,
cancel: false
};
deferred = _this18._executeEditingAction('onRowRemoving', params, function () {
return store.remove(change.key).done(function (key) {
dataChanges.push({
type: 'remove',
key: key
});
});
});
break;
case _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE:
params = {
data: data,
cancel: false
};
deferred = _this18._executeEditingAction('onRowInserting', params, function () {
return store.insert(params.data).done(function (data, key) {
if ((0, _type.isDefined)(key)) {
changeCopy.key = key;
}
if (data && (0, _type.isObject)(data) && data !== params.data) {
changeCopy.data = data;
}
dataChanges.push({
type: 'insert',
data: data,
index: 0
});
});
});
break;
case DATA_EDIT_DATA_UPDATE_TYPE:
params = {
newData: data,
oldData: oldData,
key: change.key,
cancel: false
};
deferred = _this18._executeEditingAction('onRowUpdating', params, function () {
return store.update(change.key, params.newData).done(function (data, key) {
if (data && (0, _type.isObject)(data) && data !== params.newData) {
changeCopy.data = data;
}
dataChanges.push({
type: 'update',
key: key,
data: data
});
});
});
break;
}
changes[index] = changeCopy;
if (deferred) {
var doneDeferred = new _deferred.Deferred();
deferred.always(function (data) {
results.push({
key: change.key,
result: data
});
}).always(doneDeferred.resolve);
deferreds.push(doneDeferred.promise());
}
});
},
_processRemoveIfError: function _processRemoveIfError(changes, editIndex) {
var change = changes[editIndex];
if ((change === null || change === void 0 ? void 0 : change.type) === _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE) {
if (editIndex >= 0) {
changes.splice(editIndex, 1);
}
}
return true;
},
_processRemove: function _processRemove(changes, editIndex, cancel) {
var change = changes[editIndex];
if (!cancel || !change || change.type === _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE) {
return this._processRemoveCore(changes, editIndex, !cancel || !change);
}
},
_processRemoveCore: function _processRemoveCore(changes, editIndex) {
if (editIndex >= 0) {
changes.splice(editIndex, 1);
}
return true;
},
_processSaveEditDataResult: function _processSaveEditDataResult(results) {
var hasSavedData = false;
var changes = _toConsumableArray(this.getChanges());
var changesLength = changes.length;
for (var i = 0; i < results.length; i++) {
var arg = results[i].result;
var cancel = arg === 'cancel';
var editIndex = _uiGrid_core2.default.getIndexByKey(results[i].key, changes);
var change = changes[editIndex];
var isError = arg && arg instanceof Error;
if (isError) {
if (change) {
this._addInternalData({
key: change.key,
error: arg
});
}
this._fireDataErrorOccurred(arg);
if (this._processRemoveIfError(changes, editIndex)) {
break;
}
} else {
if (this._processRemove(changes, editIndex, cancel)) {
hasSavedData = !cancel;
}
}
}
if (changes.length < changesLength) {
this._silentOption(EDITING_CHANGES_OPTION_NAME, changes);
}
return hasSavedData;
},
_fireSaveEditDataEvents: function _fireSaveEditDataEvents(changes) {
var _this19 = this;
(0, _iterator.each)(changes, function (_, _ref) {
var data = _ref.data,
key = _ref.key,
type = _ref.type;
var internalData = _this19._addInternalData({
key: key
});
var params = {
key: key,
data: data
};
if (internalData.error) {
params.error = internalData.error;
}
switch (type) {
case _uiGrid_core3.DATA_EDIT_DATA_REMOVE_TYPE:
_this19.executeAction('onRowRemoved', (0, _extend.extend)({}, params, {
data: internalData.oldData
}));
break;
case _uiGrid_core3.DATA_EDIT_DATA_INSERT_TYPE:
_this19.executeAction('onRowInserted', params);
break;
case DATA_EDIT_DATA_UPDATE_TYPE:
_this19.executeAction('onRowUpdated', params);
break;
}
});
this.executeAction('onSaved', {
changes: changes
});
},
saveEditData: function saveEditData() {
var _this20 = this;
var deferred = new _deferred.Deferred();
this.waitForDeferredOperations().done(function () {
if (_this20.isSaving()) {
_this20._resolveAfterSave(deferred);
return;
}
(0, _deferred.when)(_this20._beforeSaveEditData()).done(function (cancel) {
if (cancel) {
_this20._resolveAfterSave(deferred, {
cancel: cancel
});
return;
}
_this20._saving = true;
_this20._saveEditDataInner().always(function () {
_this20._saving = false;
}).done(deferred.resolve).fail(deferred.reject);
}).fail(deferred.reject);
}).fail(deferred.reject);
return deferred.promise();
},
_resolveAfterSave: function _resolveAfterSave(deferred) {
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
cancel = _ref2.cancel,
error = _ref2.error;
(0, _deferred.when)(this._afterSaveEditData(cancel)).done(function () {
deferred.resolve(error);
}).fail(deferred.reject);
},
_saveEditDataInner: function _saveEditDataInner() {
var _this21 = this;
var results = [];
var deferreds = [];
var dataChanges = [];
var dataController = this._dataController;
var dataSource = dataController.dataSource();
var result = new _deferred.Deferred();
(0, _deferred.when)(this._fireOnSaving()).done(function (_ref3) {
var cancel = _ref3.cancel,
changes = _ref3.changes;
if (cancel) {
return result.resolve().promise();
}
_this21._processChanges(deferreds, results, dataChanges, changes);
if (deferreds.length) {
dataSource === null || dataSource === void 0 ? void 0 : dataSource.beginLoading();
_deferred.when.apply(void 0, deferreds).done(function () {
if (_this21._processSaveEditDataResult(results)) {
_this21._endSaving(dataChanges, changes, result);
} else {
dataSource === null || dataSource === void 0 ? void 0 : dataSource.endLoading();
result.resolve();
}
}).fail(function (error) {
dataSource === null || dataSource === void 0 ? void 0 : dataSource.endLoading();
result.resolve(error);
});
return result.always(function () {
_this21._focusEditingCell();
}).promise();
}
_this21._cancelSaving(result);
}).fail(result.reject);
return result.promise();
},
_beforeEndSaving: function _beforeEndSaving(changes) {
this._resetEditIndices();
},
_endSaving: function _endSaving(dataChanges, changes, deferred) {
var dataSource = this._dataController.dataSource();
this._beforeEndSaving(changes);
dataSource === null || dataSource === void 0 ? void 0 : dataSource.endLoading();
this._refreshDataAfterSave(dataChanges, changes, deferred);
},
_cancelSaving: function _cancelSaving(result) {
this.executeAction('onSaved', {
changes: []
});
this._resolveAfterSave(result);
},
_refreshDataAfterSave: function _refreshDataAfterSave(dataChanges, changes, deferred) {
var _this22 = this;
var dataController = this._dataController;
var refreshMode = this.option('editing.refreshMode');
var isFullRefresh = refreshMode !== 'reshape' && refreshMode !== 'repaint';
if (!isFullRefresh) {
dataController.push(dataChanges);
}
(0, _deferred.when)(dataController.refresh({
selection: isFullRefresh,
reload: isFullRefresh,
load: refreshMode === 'reshape',
changesOnly: this.option('repaintChangesOnly')
})).always(function () {
_this22._fireSaveEditDataEvents(changes);
}).done(function () {
_this22._resolveAfterSave(deferred);
}).fail(function (error) {
_this22._resolveAfterSave(deferred, {
error: error
});
});
},
isSaving: function isSaving() {
return this._saving;
},
_updateEditColumn: function _updateEditColumn() {
var isEditColumnVisible = this._isEditColumnVisible();
var useIcons = this.option('editing.useIcons');
var cssClass = COMMAND_EDIT_CLASS + (useIcons ? ' ' + COMMAND_EDIT_WITH_ICONS_CLASS : '');
this._columnsController.addCommandColumn({
type: 'buttons',
command: 'edit',
visible: isEditColumnVisible,
cssClass: cssClass,
width: 'auto',
alignment: 'center',
cellTemplate: this._getEditCommandCellTemplate(),
fixedPosition: 'right'
});
this._columnsController.columnOption('command:edit', {
visible: isEditColumnVisible,
cssClass: cssClass
});
},
_isEditColumnVisible: function _isEditColumnVisible() {
var editingOptions = this.option('editing');
return editingOptions.allowDeleting;
},
_isEditButtonDisabled: function _isEditButtonDisabled() {
var hasChanges = this.hasChanges();
var isEditRowDefined = (0, _type.isDefined)(this.option('editing.editRowKey'));
return !(isEditRowDefined || hasChanges);
},
_updateEditButtons: function _updateEditButtons() {
var headerPanel = this.getView('headerPanel');
var isButtonDisabled = this._isEditButtonDisabled();
if (headerPanel) {
headerPanel.setToolbarItemDisabled('saveButton', isButtonDisabled);
headerPanel.setToolbarItemDisabled('revertButton', isButtonDisabled);
}
},
_applyModified: function _applyModified($element) {
$element && $element.addClass(CELL_MODIFIED);
},
_beforeCloseEditCellInBatchMode: _common.noop,
cancelEditData: function cancelEditData() {
var changes = this.getChanges();
var params = {
cancel: false,
changes: changes
};
this.executeAction('onEditCanceling', params);
if (!params.cancel) {
this._cancelEditDataCore();
this.executeAction('onEditCanceled', {
changes: changes
});
}
},
_cancelEditDataCore: function _cancelEditDataCore() {
var rowIndex = this._getVisibleEditRowIndex();
this._beforeCancelEditData();
this.init();
this.resetChanges();
this._resetEditColumnName();
this._resetEditRowKey();
this._afterCancelEditData(rowIndex);
},
_afterCancelEditData: function _afterCancelEditData(rowIndex) {
var dataController = this._dataController;
dataController.updateItems({
repaintChangesOnly: this.option('repaintChangesOnly')
});
},
_hideEditPopup: _common.noop,
hasEditData: function hasEditData() {
return this.hasChanges();
},
update: function update(changeType) {
var dataController = this._dataController;
if (dataController && this._pageIndex !== dataController.pageIndex()) {
if (changeType === 'refresh') {
this.refresh(true);
}
this._pageIndex = dataController.pageIndex();
}
this._updateEditButtons();
},
_getRowIndicesForCascadeUpdating: function _getRowIndicesForCascadeUpdating(row, skipCurrentRow) {
return skipCurrentRow ? [] : [row.rowIndex];
},
addDeferred: function addDeferred(deferred) {
var _this23 = this;
if (this._deferreds.indexOf(deferred) < 0) {
this._deferreds.push(deferred);
deferred.always(function () {
var index = _this23._deferreds.indexOf(deferred);
if (index >= 0) {
_this23._deferreds.splice(index, 1);
}
});
}
},
_prepareChange: function _prepareChange(options, value, text) {
var _options$row,
_this24 = this;
var newData = {};
var oldData = (_options$row = options.row) === null || _options$row === void 0 ? void 0 : _options$row.data;
var rowKey = options.key;
var deferred = new _deferred.Deferred();
if (rowKey !== undefined) {
options.value = value;
var setCellValueResult = (0, _deferred.fromPromise)(options.column.setCellValue(newData, value, (0, _extend.extend)(true, {}, oldData), text));
setCellValueResult.done(function () {
deferred.resolve({
data: newData,
key: rowKey,
oldData: oldData,
type: DATA_EDIT_DATA_UPDATE_TYPE
});
}).fail(createFailureHandler(deferred)).fail(function (arg) {
return _this24._fireDataErrorOccurred(arg);
});
if ((0, _type.isDefined)(text) && options.column.displayValueMap) {
options.column.displayValueMap[value] = text;
}
this._updateRowValues(options);
this.addDeferred(deferred);
}
return deferred;
},
_updateRowValues: function _updateRowValues(options) {
if (options.values) {
var dataController = this._dataController;
var rowIndex = dataController.getRowIndexByKey(options.key);
var row = dataController.getVisibleRows()[rowIndex];
if (row) {
options.values = row.values;
}
options.values[options.columnIndex] = options.value;
}
},
updateFieldValue: function updateFieldValue(options, value, text, forceUpdateRow) {
var _this25 = this;
var rowKey = options.key;
var deferred = new _deferred.Deferred();
if (rowKey === undefined) {
this._dataController.fireError('E1043');
}
if (options.column.setCellValue) {
this._prepareChange(options, value, text).done(function (params) {
(0, _deferred.when)(_this25._applyChange(options, params, forceUpdateRow)).always(function () {
deferred.resolve();
});
});
} else {
deferred.resolve();
}
return deferred.promise();
},
_focusPreviousEditingCellIfNeed: function _focusPreviousEditingCellIfNeed(options) {
if (this.hasEditData() && !this.isEditCell(options.rowIndex, options.columnIndex)) {
this._focusEditingCell();
this._updateEditRow(options.row, true);
return true;
}
},
_needUpdateRow: function _needUpdateRow(column) {
var visibleColumns = this._columnsController.getVisibleColumns();
if (!column) {
column = this._getEditColumn();
}
var isCustomSetCellValue = column && column.setCellValue !== column.defaultSetCellValue;
var isCustomCalculateCellValue = visibleColumns.some(function (visibleColumn) {
return visibleColumn.calculateCellValue !== visibleColumn.defaultCalculateCellValue;
});
return isCustomSetCellValue || isCustomCalculateCellValue;
},
_applyChange: function _applyChange(options, params, forceUpdateRow) {
this._addChange(params, options.row);
this._updateEditButtons();
return this._applyChangeCore(options, forceUpdateRow);
},
_applyChangeCore: function _applyChangeCore(options, forceUpdateRow) {
var isCustomSetCellValue = options.column.setCellValue !== options.column.defaultSetCellValue;
var row = options.row;
if (row) {
if (forceUpdateRow || isCustomSetCellValue) {
this._updateEditRow(row, forceUpdateRow, isCustomSetCellValue);
} else if (row.update) {
row.update();
}
}
},
_updateEditRowCore: function _updateEditRowCore(row, skipCurrentRow, isCustomSetCellValue) {
this._dataController.updateItems({
changeType: 'update',
rowIndices: this._getRowIndicesForCascadeUpdating(row, skipCurrentRow)
});
},
_updateEditRow: function _updateEditRow(row, forceUpdateRow, isCustomSetCellValue) {
if (forceUpdateRow) {
this._updateRowImmediately(row, forceUpdateRow, isCustomSetCellValue);
} else {
this._updateRowWithDelay(row, isCustomSetCellValue);
}
},
_updateRowImmediately: function _updateRowImmediately(row, forceUpdateRow, isCustomSetCellValue) {
this._updateEditRowCore(row, !forceUpdateRow, isCustomSetCellValue);
this._validateEditFormAfterUpdate(row, isCustomSetCellValue);
if (!forceUpdateRow) {
this._focusEditingCell();
}
},
_updateRowWithDelay: function _updateRowWithDelay(row, isCustomSetCellValue) {
var _this26 = this;
var deferred = new _deferred.Deferred();
this.addDeferred(deferred);
setTimeout(function () {
var $focusedElement = (0, _renderer.default)(_dom_adapter.default.getActiveElement());
var columnIndex = _this26._rowsView.getCellIndex($focusedElement, row.rowIndex);
var focusedElement = $focusedElement.get(0);
var selectionRange = _uiGrid_core2.default.getSelectionRange(focusedElement);
_this26._updateEditRowCore(row, false, isCustomSetCellValue);
_this26._validateEditFormAfterUpdate(row, isCustomSetCellValue);
if (columnIndex >= 0) {
var $focusedItem = _this26._rowsView._getCellElement(row.rowIndex, columnIndex);
_this26._delayedInputFocus($focusedItem, function () {
setTimeout(function () {
focusedElement = _dom_adapter.default.getActiveElement();
if (selectionRange.selectionStart >= 0) {
_uiGrid_core2.default.setSelectionRange(focusedElement, selectionRange);
}
});
});
}
deferred.resolve();
});
},
_validateEditFormAfterUpdate: _common.noop,
_addChange: function _addChange(options, row) {
var changes = _toConsumableArray(this.getChanges());
var index = _uiGrid_core2.default.getIndexByKey(options.key, changes);
if (index < 0) {
index = changes.length;
this._addInternalData({
key: options.key,
oldData: options.oldData
});
delete options.oldData;
changes.push(options);
}
var change = _extends({}, changes[index]);
if (change) {
if (options.data) {
change.data = (0, _array_utils.createObjectWithChanges)(change.data, options.data);
}
if ((!change.type || !options.data) && options.type) {
change.type = options.type;
}
if (row) {
row.oldData = this._getOldData(row.key);
row.data = (0, _array_utils.createObjectWithChanges)(row.data, options.data);
}
}
changes[index] = change;
this._silentOption(EDITING_CHANGES_OPTION_NAME, changes);
return index;
},
_getFormEditItemTemplate: function _getFormEditItemTemplate(cellOptions, column) {
return column.editCellTemplate || this._getDefaultEditorTemplate();
},
getColumnTemplate: function getColumnTemplate(options) {
var _this27 = this;
var column = options.column;
var rowIndex = options.row && options.row.rowIndex;
var template;
var isRowMode = this.isRowBasedEditMode();
var isRowEditing = this.isEditRow(rowIndex);
var isCellEditing = this.isEditCell(rowIndex, options.columnIndex);
var editingStartOptions;
if ((column.showEditorAlways || column.setCellValue && (isRowEditing && column.allowEditing || isCellEditing)) && (options.rowType === 'data' || options.rowType === 'detailAdaptive') && !column.command) {
var allowUpdating = this.allowUpdating(options);
if (((allowUpdating || isRowEditing) && column.allowEditing || isCellEditing) && (isRowEditing || !isRowMode)) {
if (column.showEditorAlways && !isRowMode) {
editingStartOptions = {
cancel: false,
key: options.row.isNewRow ? undefined : options.row.key,
data: options.row.data,
column: column
};
this._isEditingStart(editingStartOptions);
}
if (!editingStartOptions || !editingStartOptions.cancel) {
options.setValue = function (value, text) {
_this27.updateFieldValue(options, value, text);
};
}
}
template = column.editCellTemplate || this._getDefaultEditorTemplate();
} else if (column.command === 'detail' && options.rowType === 'detail' && isRowEditing) {
template = this === null || this === void 0 ? void 0 : this.getEditFormTemplate(options);
}
return template;
},
_createButton: function _createButton($container, button, options) {
var icon = EDIT_ICON_CLASS[button.name];
var useIcons = this.option('editing.useIcons');
var $button = (0, _renderer.default)('<a>').attr('href', '#').addClass(LINK_CLASS).addClass(button.cssClass);
if (button.template) {
this._rowsView.renderTemplate($container, button.template, options, true);
} else {
if (useIcons && icon || button.icon) {
icon = button.icon || icon;
var iconType = iconUtils.getImageSourceType(icon);
if (iconType === 'image' || iconType === 'svg') {
$button = iconUtils.getImageContainer(icon).addClass(button.cssClass);
} else {
$button.addClass('dx-icon' + (iconType === 'dxIcon' ? '-' : ' ') + icon).attr('title', button.text);
}
$button.addClass('dx-link-icon');
$container.addClass(COMMAND_EDIT_WITH_ICONS_CLASS);
var localizationName = this.getButtonLocalizationNames()[button.name];
localizationName && $button.attr('aria-label', _message.default.format(localizationName));
} else {
$button.text(button.text);
}
if ((0, _type.isDefined)(button.hint)) {
$button.attr('title', button.hint);
}
_events_engine.default.on($button, (0, _index.addNamespace)('click', EDITING_NAMESPACE), this.createAction(function (e) {
button.onClick.call(button, (0, _extend.extend)({}, e, {
row: options.row,
column: options.column
}));
e.event.preventDefault();
e.event.stopPropagation();
}));
$container.append($button, ' ');
}
},
getButtonLocalizationNames: function getButtonLocalizationNames() {
return {
edit: 'dxDataGrid-editingEditRow',
save: 'dxDataGrid-editingSaveRowChanges',
delete: 'dxDataGrid-editingDeleteRow',
undelete: 'dxDataGrid-editingUndeleteRow',
cancel: 'dxDataGrid-editingCancelRowChanges'
};
},
prepareButtonItem: function prepareButtonItem(headerPanel, name, methodName, sortIndex) {
var _this28 = this;
var editingTexts = this.option('editing.texts') || {};
var titleButtonTextByClassNames = {
'revert': editingTexts.cancelAllChanges,
'save': editingTexts.saveAllChanges,
'addRow': editingTexts.addRow
};
var classNameButtonByNames = {
'revert': 'cancel',
'save': 'save',
'addRow': 'addrow'
};
var className = classNameButtonByNames[name];
var onInitialized = function onInitialized(e) {
(0, _renderer.default)(e.element).addClass(headerPanel._getToolbarButtonClass(EDIT_BUTTON_CLASS + ' ' + _this28.addWidgetPrefix(className) + '-button'));
};
var hintText = titleButtonTextByClassNames[name];
var isButtonDisabled = (className === 'save' || className === 'cancel') && this._isEditButtonDisabled();
return {
widget: 'dxButton',
options: {
onInitialized: onInitialized,
icon: 'edit-button-' + className,
disabled: isButtonDisabled,
onClick: function onClick() {
setTimeout(function () {
_this28[methodName]();
});
},
text: hintText,
hint: hintText
},
showText: 'inMenu',
name: name + 'Button',
location: 'after',
locateInMenu: 'auto',
sortIndex: sortIndex
};
},
prepareEditButtons: function prepareEditButtons(headerPanel) {
var editingOptions = this.option('editing') || {};
var buttonItems = [];
if (editingOptions.allowAdding) {
buttonItems.push(this.prepareButtonItem(headerPanel, 'addRow', 'addRow', 20));
}
return buttonItems;
},
highlightDataCell: function highlightDataCell($cell, parameters) {
var cellModified = this.isCellModified(parameters);
cellModified && parameters.column.setCellValue && $cell.addClass(CELL_MODIFIED);
},
_afterInsertRow: _common.noop,
_beforeSaveEditData: function _beforeSaveEditData(change) {
if (change && !(0, _type.isDefined)(change.key) && (0, _type.isDefined)(change.type)) {
return true;
}
},
_afterSaveEditData: _common.noop,
_beforeCancelEditData: _common.noop,
_allowEditAction: function _allowEditAction(actionName, options) {
var allowEditAction = this.option('editing.' + actionName);
if ((0, _type.isFunction)(allowEditAction)) {
allowEditAction = allowEditAction({
component: this.component,
row: options.row
});
}
return allowEditAction;
},
allowUpdating: function allowUpdating(options, eventName) {
var startEditAction = this.option('editing.startEditAction') || DEFAULT_START_EDIT_ACTION;
var needCallback = arguments.length > 1 ? startEditAction === eventName || eventName === 'down' : true;
return needCallback && this._allowEditAction('allowUpdating', options);
},
allowDeleting: function allowDeleting(options) {
return this._allowEditAction('allowDeleting', options);
},
isCellModified: function isCellModified(parameters) {
var columnIndex = parameters.columnIndex;
var modifiedValues = parameters.row && (parameters.row.isNewRow ? parameters.row.values : parameters.row.modifiedValues);
return !!modifiedValues && modifiedValues[columnIndex] !== undefined;
}
};
}());
var editingModule = {
defaultOptions: function defaultOptions() {
return {
editing: {
mode: 'row',
// "batch"
refreshMode: 'full',
allowAdding: false,
allowUpdating: false,
allowDeleting: false,
useIcons: false,
selectTextOnEditStart: false,
confirmDelete: true,
texts: {
editRow: _message.default.format('dxDataGrid-editingEditRow'),
saveAllChanges: _message.default.format('dxDataGrid-editingSaveAllChanges'),
saveRowChanges: _message.default.format('dxDataGrid-editingSaveRowChanges'),
cancelAllChanges: _message.default.format('dxDataGrid-editingCancelAllChanges'),
cancelRowChanges: _message.default.format('dxDataGrid-editingCancelRowChanges'),
addRow: _message.default.format('dxDataGrid-editingAddRow'),
deleteRow: _message.default.format('dxDataGrid-editingDeleteRow'),
undeleteRow: _message.default.format('dxDataGrid-editingUndeleteRow'),
confirmDeleteMessage: _message.default.format('dxDataGrid-editingConfirmDeleteMessage'),
confirmDeleteTitle: ''
},
form: {
colCount: 2
},
popup: {},
startEditAction: 'click',
editRowKey: null,
editColumnName: null,
changes: []
}
};
},
controllers: {
editing: EditingController
},
extenders: {
controllers: {
data: {
init: function init() {
this._editingController = this.getController('editing');
this.callBase();
},
reload: function reload(full, repaintChangesOnly) {
!repaintChangesOnly && this._editingController.refresh();
return this.callBase.apply(this, arguments);
},
repaintRows: function repaintRows() {
if (this.getController('editing').isSaving()) return;
return this.callBase.apply(this, arguments);
},
_updateEditRow: function _updateEditRow(items) {
var editRowKey = this.option(_uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME);
var editRowIndex = _uiGrid_core2.default.getIndexByKey(editRowKey, items);
var editItem = items[editRowIndex];
if (editItem) {
var _this$_updateEditItem;
editItem.isEditing = true;
(_this$_updateEditItem = this._updateEditItem) === null || _this$_updateEditItem === void 0 ? void 0 : _this$_updateEditItem.call(this, editItem);
}
},
_updateItemsCore: function _updateItemsCore(change) {
this.callBase(change);
this._updateEditRow(this.items(true));
},
_applyChangeUpdate: function _applyChangeUpdate(change) {
this._updateEditRow(change.items);
this.callBase(change);
},
_applyChangesOnly: function _applyChangesOnly(change) {
this._updateEditRow(change.items);
this.callBase(change);
},
_processItems: function _processItems(items, change) {
items = this._editingController.processItems(items, change);
return this.callBase(items, change);
},
_processDataItem: function _processDataItem(dataItem, options) {
this._editingController.processDataItem(dataItem, options, this.generateDataValues);
return this.callBase(dataItem, options);
},
_processItem: function _processItem(item, options) {
item = this.callBase(item, options);
if (item.isNewRow) {
options.dataIndex--;
delete item.dataIndex;
}
return item;
},
_getChangedColumnIndices: function _getChangedColumnIndices(oldItem, newItem, rowIndex, isLiveUpdate) {
if (oldItem.isNewRow !== newItem.isNewRow || oldItem.removed !== newItem.removed) {
return;
}
return this.callBase.apply(this, arguments);
},
_isCellChanged: function _isCellChanged(oldRow, newRow, visibleRowIndex, columnIndex, isLiveUpdate) {
var editingController = this.getController('editing');
var cell = oldRow.cells && oldRow.cells[columnIndex];
var isEditing = editingController && editingController.isEditCell(visibleRowIndex, columnIndex);
if (isLiveUpdate && isEditing) {
return false;
}
if (cell && cell.column && !cell.column.showEditorAlways && cell.isEditing !== isEditing) {
return true;
}
return this.callBase.apply(this, arguments);
}
}
},
views: {
rowsView: {
init: function init() {
this.callBase();
this._editingController = this.getController('editing');
},
getCellIndex: function getCellIndex($cell, rowIndex) {
if (!$cell.is('td') && rowIndex >= 0) {
var $cellElements = this.getCellElements(rowIndex);
var cellIndex = -1;
(0, _iterator.each)($cellElements, function (index, cellElement) {
if ((0, _renderer.default)(cellElement).find($cell).length) {
cellIndex = index;
}
});
return cellIndex;
}
return this.callBase.apply(this, arguments);
},
publicMethods: function publicMethods() {
return this.callBase().concat(['cellValue']);
},
_getCellTemplate: function _getCellTemplate(options) {
var template = this._editingController.getColumnTemplate(options);
return template || this.callBase(options);
},
_isNativeClick: function _isNativeClick() {
return (_devices.default.real().ios || _devices.default.real().android) && this.option('editing.allowUpdating');
},
_createRow: function _createRow(row) {
var $row = this.callBase(row);
if (row) {
var isRowRemoved = !!row.removed;
var isRowInserted = !!row.isNewRow;
var isRowModified = !!row.modified;
isRowInserted && $row.addClass(ROW_INSERTED);
isRowModified && $row.addClass(ROW_MODIFIED);
if (isRowInserted || isRowRemoved) {
$row.removeClass(ROW_SELECTED);
}
}
return $row;
},
_getColumnIndexByElement: function _getColumnIndexByElement($element) {
var $tableElement = $element.closest('table');
var $tableElements = this.getTableElements();
while ($tableElement.length && !$tableElements.filter($tableElement).length) {
$element = $tableElement.closest('td');
$tableElement = $element.closest('table');
}
return this._getColumnIndexByElementCore($element);
},
_getColumnIndexByElementCore: function _getColumnIndexByElementCore($element) {
var $targetElement = $element.closest('.' + _uiGrid_core3.ROW_CLASS + '> td:not(.dx-master-detail-cell)');
return this.getCellIndex($targetElement);
},
_editCellByClick: function _editCellByClick(e, eventName) {
var editingController = this._editingController;
var $targetElement = (0, _renderer.default)(e.event.target);
var columnIndex = this._getColumnIndexByElement($targetElement);
var row = this._dataController.items()[e.rowIndex];
var allowUpdating = editingController.allowUpdating({
row: row
}, eventName) || row && row.isNewRow;
var column = this._columnsController.getVisibleColumns()[columnIndex];
var isEditedCell = editingController.isEditCell(e.rowIndex, columnIndex);
var allowEditing = allowUpdating && column && (column.allowEditing || isEditedCell);
var startEditAction = this.option('editing.startEditAction') || 'click';
if (eventName === 'down') {
if ((_devices.default.real().ios || _devices.default.real().android) && !isEditedCell) {
(0, _dom.resetActiveElement)();
}
return column && column.showEditorAlways && allowEditing && editingController.editCell(e.rowIndex, columnIndex);
}
if (eventName === 'click' && startEditAction === 'dblClick' && !isEditedCell) {
editingController.closeEditCell();
}
if (allowEditing && eventName === startEditAction) {
return editingController.editCell(e.rowIndex, columnIndex) || editingController.isEditRow(e.rowIndex);
}
},
_rowPointerDown: function _rowPointerDown(e) {
var _this29 = this;
this._pointerDownTimeout = setTimeout(function () {
_this29._editCellByClick(e, 'down');
});
},
_rowClick: function _rowClick(e) {
var isEditForm = (0, _renderer.default)(e.rowElement).hasClass(this.addWidgetPrefix(_uiGrid_core3.EDIT_FORM_CLASS));
e.event[_uiGrid_core3.TARGET_COMPONENT_NAME] = this.component;
if (!this._editCellByClick(e, 'click') && !isEditForm) {
this.callBase.apply(this, arguments);
}
},
_rowDblClick: function _rowDblClick(e) {
if (!this._editCellByClick(e, 'dblClick')) {
this.callBase.apply(this, arguments);
}
},
_cellPrepared: function _cellPrepared($cell, parameters) {
var editingController = this._editingController;
var isCommandCell = !!parameters.column.command;
var isEditableCell = parameters.setValue;
var isEditRow = editingController.isEditRow(parameters.rowIndex);
var isEditing = isEditingCell(isEditRow, parameters);
if (isEditingOrShowEditorAlwaysDataCell(isEditRow, parameters)) {
var alignment = parameters.column.alignment;
$cell.toggleClass(this.addWidgetPrefix(READONLY_CLASS), !isEditableCell).toggleClass(CELL_FOCUS_DISABLED_CLASS, !isEditableCell);
if (alignment) {
$cell.find(_uiGrid_core3.EDITORS_INPUT_SELECTOR).first().css('textAlign', alignment);
}
}
if (isEditing) {
this._editCellPrepared($cell);
}
if (parameters.column && !isCommandCell) {
editingController.highlightDataCell($cell, parameters);
}
this.callBase.apply(this, arguments);
},
_editCellPrepared: _common.noop,
_formItemPrepared: _common.noop,
_getCellOptions: function _getCellOptions(options) {
var cellOptions = this.callBase(options);
cellOptions.isEditing = this._editingController.isEditCell(cellOptions.rowIndex, cellOptions.columnIndex);
return cellOptions;
},
_createCell: function _createCell(options) {
var $cell = this.callBase(options);
var isEditRow = this._editingController.isEditRow(options.rowIndex);
isEditingOrShowEditorAlwaysDataCell(isEditRow, options) && $cell.addClass(_uiGrid_core3.EDITOR_CELL_CLASS);
return $cell;
},
cellValue: function cellValue(rowIndex, columnIdentifier, value, text) {
var cellOptions = this.getCellOptions(rowIndex, columnIdentifier);
if (cellOptions) {
if (value === undefined) {
return cellOptions.value;
} else {
this._editingController.updateFieldValue(cellOptions, value, text, true);
}
}
},
dispose: function dispose() {
this.callBase.apply(this, arguments);
clearTimeout(this._pointerDownTimeout);
},
_renderCore: function _renderCore() {
this.callBase.apply(this, arguments);
this._editingController._focusEditorIfNeed();
}
},
headerPanel: {
_getToolbarItems: function _getToolbarItems() {
var items = this.callBase();
var editButtonItems = this.getController('editing').prepareEditButtons(this);
return editButtonItems.concat(items);
},
optionChanged: function optionChanged(args) {
var fullName = args.fullName;
switch (args.name) {
case 'editing':
{
var excludedOptions = [_uiGrid_core3.EDITING_POPUP_OPTION_NAME, EDITING_CHANGES_OPTION_NAME, _uiGrid_core3.EDITING_EDITCOLUMNNAME_OPTION_NAME, _uiGrid_core3.EDITING_EDITROWKEY_OPTION_NAME];
var shouldInvalidate = fullName && !excludedOptions.some(function (optionName) {
return optionName === fullName;
});
shouldInvalidate && this._invalidate();
this.callBase(args);
break;
}
default:
this.callBase(args);
}
},
isVisible: function isVisible() {
var editingOptions = this.getController('editing').option('editing');
return this.callBase() || (editingOptions === null || editingOptions === void 0 ? void 0 : editingOptions.allowAdding);
}
}
}
}
};
exports.editingModule = editingModule;
|
let shoppingList = document.getElementById("shoppingList");
let addButton = document.getElementById("addItem");
let trimButton = document.getElementById("trimList");
let clearButton = document.getElementById("clearList");
let nameButton = document.getElementById("nameList");
addButton.addEventListener("click", addToList);
trimButton.addEventListener("click", clearRemoved);
clearButton.addEventListener("click", clearList);
nameButton.addEventListener("click", nameList);
function addToList() {
let input = document.getElementById("listItem");
let newPost = createAnchorTag(input);
//lägg till i listan
shoppingList.appendChild(newPost);
resetFocus(input);
}
function removeFromList(item) {
let itemText = item.previousSibling.data;
let deleteItem = confirm("Är du säker på att du vill ta bort " + itemText + "?");
if (deleteItem) {
let listItem = item.parentNode;
listItem.classList.add("bg-info");
}
}
function clearRemoved() {
let removedItems = document.getElementsByClassName("bg-info");
while (removedItems.length > 0) {
shoppingList.removeChild(removedItems[0]);
}
}
function clearList() {
while (shoppingList.childElementCount > 0) {
shoppingList.removeChild(shoppingList.firstElementChild);
}
}
function nameList() {
let inputName = document.getElementById("listNameInput");
let listName = document.getElementById("listName");
listName.innerHTML = inputName.value;
resetFocus(inputName);
}
function resetFocus(input) {
input.value = "";
document.getElementById("listItem").focus();
}
function createAnchorTag(item) {
//skapa anchor-tag
let newAnchor = document.createElement("a");
//ge klass
newAnchor.setAttribute("class", "list-group-item list-group-item-action");
//skapa text till inlägget
let itemText = document.createTextNode(item.value);
//lägg till text i anchor
newAnchor.appendChild(itemText);
//lägg till button i anchor
newAnchor.appendChild(createButtonTag());
return newAnchor;
}
function createButtonTag() {
//skapa button
let newButton = document.createElement("button");
//ge attribut
setButtonAttributes(newButton);
//lägg till krysset i button
newButton.appendChild(document.createTextNode("\u00D7"));
return newButton;
}
function setButtonAttributes(newButton) {
newButton.setAttribute("type", "close");
newButton.setAttribute("onclick", "removeFromList(this)");
newButton.setAttribute("class", "close");
}
|
import React,{Component} from 'react'
// 点击删除删除父组件的数据 所以需要父组件传一个方法给子组件
// 点击checked决定事件是否完成
// 点击checked可以更改事件状态
// 点击span可以显示输入框 修改事件 可以先定义一条数据 来控制input输入框是否显示 最开始是不显示的
// 当input失去焦点时 修改父组件的数据 可以调用父组件的方法
class TodoItem extends Component {
constructor (props){
super(props);
this.state = {
isUpdate: false
}
}
render(){
let {isUpdate} = this.state
let {deleteTodo,changeFinished} = this.props
let {id,title,isFinished} = this.props.todo
return(
<li className="list-group-item">
<div className="row">
<input onChange = {changeFinished.bind(null,id)} defaultChecked = {isFinished} className="col-xs-1" type="checkbox" />
<div className="title col-xs-8">
{ isUpdate? <input onBlur = {this.updateTitle.bind(null,id)} ref = {'input'} type="text" />:<span onClick = {this.isShowInput.bind(null,title)}>{title}</span>}
</div>
{/* 给函数传参时 要使用bind */}
<button onClick = {deleteTodo.bind(null,id)} type="button" className="close col-xs-1" ><span>×</span></button>
</div>
</li>
)
}
updateTitle = (id) => {
this.setState({
isUpdate:!this.state.isUpdate
})
let title = this.refs.input.value
this.props.changeTitle(id,title)
}
isShowInput = (title,e)=> {
this.setState({
isUpdate:!this.state.isUpdate
})
// this.el.value = title
// setState是异步函数放在异步队列里执行 所以选择input的时候还没有这个dom
setTimeout(() => {
this.refs.input.value = title
this.refs.input.focus()
}, 0);
}
}
export default TodoItem
|
const { reviewModel } = require("../model/review");
const { collegeModel } = require("../model/college");
module.exports.post_review = async (req, res, next) => {
const { id } = req.params;
const reviewRecord = new reviewModel(req.body.review);
reviewRecord.author = req.user;
const studentRecord = await collegeModel.findById(id);
studentRecord.reviews.push(reviewRecord);
await reviewRecord.save();
await studentRecord.save();
return res.redirect(`/college/${id}`);
};
module.exports.delete_review = async (req, res, next) => {
const { id, review_id } = req.params;
await reviewModel.findByIdAndDelete(review_id);
await collegeModel.findByIdAndUpdate(id, { $pull: { reviews: review_id } });
return res.redirect(`/college/${id}`);
};
module.exports.edit_review = async (req, res, next) => {
const { id, review_id } = req.params;
const reviewRecord = await reviewModel.findById(review_id);
return res.render("student/editReview.ejs", { reviewRecord, id, review_id });
};
module.exports.update_review = async (req, res, next) => {
const { id, review_id } = req.params;
await reviewModel.findByIdAndUpdate(review_id, req.body.review);
return res.redirect(`/college/${id}`);
};
|
const fs = require("fs")
const path = require("path")
const { spawnSync } = require("child_process")
const AUTOGEN_WARNING =
"This is autogenerated, please modify predeploy.js to change this"
function staticFiles() {
const STATIC_BUCKET_NAME = "hypertalk-static"
spawnSync("gsutil", [
"-m",
"rsync",
"-r",
"./static",
`gs://${STATIC_BUCKET_NAME}/`
])
let staticIndex = `// ${AUTOGEN_WARNING}\nmodule.exports = {\n`
fs.readdirSync("./static").forEach(file => {
staticIndex += `'${file}': 'https://storage.googleapis.com/${STATIC_BUCKET_NAME}/${encodeURIComponent(
file
)}',\n`
})
staticIndex += `}\n`
writeFileSync("./src/staticFiles.js", staticIndex)
}
function appYaml() {
writeFileSync(
"./app.yaml",
`# ${AUTOGEN_WARNING}
runtime: nodejs
env: flex
# This sample incurs costs to run on the App Engine flexible environment.
# The settings below are to reduce costs during testing and are not appropriate
# for production use. For more information, see:
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
# none of these matter on the chat server
# env_variables:
# REACT_APP_CHATSERVER_ENDPOINT: '${
process.env.REACT_APP_CHATSERVER_ENDPOINT
}'
# REACT_APP_USE_LOCAL_ASSETS: 'false'
`
)
}
function writeFileSync(filename, contents) {
fs.writeFileSync(filename, contents, "utf8")
}
appYaml()
staticFiles()
|
import React from 'react';
import FlatList from 'flatlist-react';
import Grid from '@material-ui/core/Grid';
import {Divider, useMediaQuery} from "@material-ui/core";
import SwitchActivate from "./Switch";
export default function SupermarketList(props) {
const { isCheckedList, doEnable,supermarkets } = props;
const matches = useMediaQuery("(max-width:650px)");
function renderElements(item) {
return (
<div key={item.id}>
<Grid container style={matches ? {display:"block"} : null}>
<div className="form-group">
<ul className="App-list">
{item.nome}
</ul>
<div className="App-switch">
<SwitchActivate item={item} doEnable={doEnable} />
</div>
<Divider />
</div>
</Grid>
</div>
);
}
return (
isCheckedList ?
<form>
<div className="form-inner">
<Grid container direction="column"
justify="center"
alignItems="center"
>
<Grid item xs={12}>
<h2>Gestione supermercati</h2>
</Grid>
<FlatList
list={supermarkets}
renderItem={renderElements}
/>
</Grid>
</div>
</form>
: null
);
}
|
/*
* GET home page.
*/
var mongoose = require('mongoose');
var Post = mongoose.model('Post');
var Comment = mongoose.model('Comment');
exports.index = function(req, res){
res.render('index');
};
exports.partials = function (req, res) {
var name = req.params.name;
res.render('partials/' + name);
};
exports.getPosts = function(req, res, next) {
Post.find(function(err, posts){
if(err){ return next(err); }
res.json(posts);
});
};
exports.post = function(req, res, next) {
var post = new Post(req.body);
post.save(function(err, post){
if(err){ return next(err); }
res.json(post);
});
};
//function queries postId in database.
exports.preLoad = function(req, res, next, id){
var query = Post.findById(id);
query.exec(function(err, post){
if(err){return next(err)};
if(!post){return next(new Error('Cannot find post'))};
req.post = post;
return next();
});
};
//Middleware preLoad function attaches the post from MongoDB to req. Return the req.post
exports.getSinglePost = function(req, res){
res.json(req.post)
};
exports.upVote = function(req, res){
req.post.upvote(function(err, post){
if (err) {return next(err); }
res.json(post);
});
};
exports.downVote = function(req, res){
req.post.downvote(function(err, post){
if (err) {return next(err); }
res.json(post);
});
};
|
import { StyleSheet, Dimensions, Platform } from 'react-native';
const window = Dimensions.get('window');
import Constants from 'expo-constants';
import colors from '../../assets/colors';
import theme from '../../assets/theme';
export default styles = StyleSheet.create({
container: {
flex: 1,
},
navbarStyle: {
paddingTop: Constants.statusBarHeight,
height: Constants.startHeaderHeight,
backgroundColor: colors.green,
borderBottomWidth: 1,
borderBottomColor: colors.green
},
headerItem: {
flexDirection: 'row',
paddingLeft: 16,
paddingRight:16,
marginBottom: 16,
marginTop: 16,
width: '100%',
justifyContent: 'space-between'
},
exitTxt: {
fontSize: 40,
color: colors.text_color,
fontFamily: 'Roboto-Regular',
marginLeft: 16
},
wrapper : {
flex : 1,
// justifyContent: 'center',
alignItems: 'center',
},
citationView : {
width: '100%',
height: (Platform.OS === 'ios') ? 120 : 100,
flexDirection: 'row',
elevation: 1,
shadowColor: theme.primaryTextColor,
shadowOffset: { height : 1, width : 0},
shadowRadius: 2.25,
shadowOpacity: 0.25,
backgroundColor: theme.colorAccent,
borderRadius: 2,
paddingRight: 4,
marginTop: 8,
},
sorting : {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: theme.bgColorPrimary,
width : '25%',
height : '100%',
borderTopLeftRadius: 2,
borderBottomLeftRadius: 2
},
citationRange : {
width: '74%',
height: '100%',
justifyContent: 'center',
// alignItems: 'center',
borderTopRightRadius: 2,
borderBottomRightRadius: 2,
flexDirection : 'column',
paddingLeft : 8,
},
btnStyle : {
backgroundColor : theme.buttonPrimary,
width : '90%',
justifyContent: 'center',
alignItems : 'center',
height : 40,
borderRadius : 2,
marginTop: 16,
},
btnText : {
fontSize: 20,
color: colors.whiteShade,
fontFamily: theme.headerFont,
alignSelf: 'center',
},
sortIcon : {
height : 18,
width : 18,
tintColor : theme.primaryColor
},
citationNumber : {
marginBottom : 4,
fontSize : theme.SmallFont,
color : theme.textGray,
fontWeight: "bold"
},
citationBody : {
marginBottom : 4,
fontSize : theme.SmallFont,
color : theme.textGray,
},
text: {
fontSize: 25,
color: 'black',
padding: 10
},
expandedView : {
width : '90%',
// justifyContent: 'center',
// alignItems: 'center',
elevation : 1,
shadowColor : theme.primaryTextColor,
shadowOffset: { height : 1, width : 0},
shadowRadius : 2.25,
shadowOpacity : 0.25,
backgroundColor : theme.colorAccent,
borderRadius : 2,
},
divisionTp : {
paddingHorizontal : 4,
paddingVertical : 8,
},
categoryName: {
fontFamily : theme.primaryFont,
fontSize : theme.MediumFont,
color : theme.textGray,
},
reportHeader: {
marginVertical: 15,
},
cardView: {
width: '99%',
// height: 30,
backgroundColor: theme.colorAccent,
borderRadius : 2,
marginTop: 4,
marginBottom : 4,
shadowColor: theme.primaryTextColor,
shadowOffset: {
width: 0,
height: 1
},
shadowOpacity: 0.25,
shadowRadius: 2,
elevation: 1,
paddingVertical: 8,
marginHorizontal: 1,
alignItems: 'center'
},
listViewItem : {
alignItems: 'center',
width: '100%',
justifyContent: 'center',
paddingLeft: 10,
paddingRight: 10,
},
});
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
var _excluded = ["className", "dashStyle", "fill", "height", "opacity", "rotate", "rotateX", "rotateY", "rx", "ry", "scaleX", "scaleY", "sharp", "sharpDirection", "stroke", "strokeOpacity", "strokeWidth", "translateX", "translateY", "width", "x", "y"];
import { createVNode, normalizeProps } from "inferno";
import { BaseInfernoComponent } from "@devextreme/vdom";
import SvgGraphicsProps from "./base_graphics_props";
import { getGraphicExtraProps } from "./utils";
export var viewFunction = _ref => {
var {
parsedProps,
rectRef
} = _ref;
var {
fill,
height,
opacity,
rx,
ry,
stroke,
strokeOpacity,
strokeWidth,
width,
x,
y
} = parsedProps;
return normalizeProps(createVNode(32, "rect", null, null, 1, _extends({
"x": x,
"y": y,
"width": width,
"height": height,
"rx": rx,
"ry": ry,
"fill": fill,
"stroke": stroke,
"stroke-width": strokeWidth,
"stroke-opacity": strokeOpacity,
"opacity": opacity
}, getGraphicExtraProps(parsedProps, x, y)), null, rectRef));
};
export var RectSvgElementProps = _extends({}, SvgGraphicsProps, {
x: 0,
y: 0,
width: 0,
height: 0
});
import { createRef as infernoCreateRef } from "inferno";
export class RectSvgElement extends BaseInfernoComponent {
constructor(props) {
super(props);
this.state = {};
this.rectRef = infernoCreateRef();
}
get parsedProps() {
var tmpX;
var tmpY;
var tmpWidth;
var tmpHeight;
var tmpProps = _extends({}, this.props);
var {
height,
strokeWidth,
width,
x,
y
} = tmpProps;
var sw;
if (x !== undefined || y !== undefined || width !== undefined || height !== undefined || strokeWidth !== undefined) {
tmpX = x !== undefined ? x : 0;
tmpY = y !== undefined ? y : 0;
tmpWidth = width !== undefined ? width : 0;
tmpHeight = height !== undefined ? height : 0;
sw = strokeWidth !== undefined ? strokeWidth : 0;
var maxSW = ~~((tmpWidth < tmpHeight ? tmpWidth : tmpHeight) / 2);
var newSW = Math.min(sw, maxSW);
tmpProps.x = tmpX + newSW / 2;
tmpProps.y = tmpY + newSW / 2;
tmpProps.width = tmpWidth - newSW;
tmpProps.height = tmpHeight - newSW;
(sw !== newSW || !(newSW === 0 && strokeWidth === undefined)) && (tmpProps.strokeWidth = newSW);
}
tmpProps.sharp && (tmpProps.sharp = false);
return tmpProps;
}
get restAttributes() {
var _this$props = this.props,
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
return restProps;
}
render() {
var props = this.props;
return viewFunction({
props: _extends({}, props),
rectRef: this.rectRef,
parsedProps: this.parsedProps,
restAttributes: this.restAttributes
});
}
}
RectSvgElement.defaultProps = _extends({}, RectSvgElementProps);
|
var xhttp = new XMLHttpRequest();
xhttp.open('GET', 'http://api.openweathermap.org/data/2.5/weather?zip=94720,us&APPID=732e6658f618242e045a71feb919f108');
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var weather_data = JSON.parse(xhttp.responseText);
document.getElementById("city").innerHTML = "City: " + weather_data.name;
document.getElementById("temp").innerHTML = "Temperature: " + (weather_data.main.temp - 273.15).toFixed(2) + "°C";
document.getElementById("humi").innerHTML = "Huminity: " + weather_data.main.humidity + "%";
}
};
xhttp.send();
|
import QRCodeModal from "@walletconnect/qrcode-modal"
import WalletConnect from "@walletconnect/client"
export default function useTrustWallet(nft) {
const connector = new WalletConnect({
bridge: "https://bridge.walletconnect.org",
qrcodeModal: QRCodeModal,
});
if (!connector.connected) {
connector.createSession();
}
connector.on("connect", (error) => {
if (error) {
throw error;
}
const request = connector._formatRequest({
method: 'get_accounts',
});
connector
._sendCallRequest(request)
.then(async result => {
return await createTransaction(connector, result, nft)
})
.catch(error => {
console.error(error);
});
})
}
function createTransaction(connector, accounts, nft) {
const network = 461; // Filecoin network
const account = accounts.find((account) => account.network === network);
const tx = {
sendCoinsMessage: {
fromAddress: account.address,
toAddress: nft.fil_address,
amounts: [
{
denom: "filecoin",
amount: "1"
}
]
}
}
const request = connector._formatRequest({
method: 'trust_signTransaction',
params: [
{
network,
transaction: JSON.stringify(tx),
},
],
});
connector
._sendCallRequest(request)
.then(() => {
return true
})
.catch(() => {
return false
});
}
|
import React from 'react';
import styled from '@emotion/styled';
import { colors } from '../../theme';
import { Contact } from './../Contact/Contact';
import { SkillList } from './../SkillList/SkillList';
import { Education } from './../Education/Education';
import { Work } from './../Work/Work';
const LeftText = styled('div')`
background-color: ${colors.black};
height: 100vh;
width: 50%;
position: relative;
overflow: hidden;
box-shadow: 0 2rem 4rem rgba(${colors.black}, 0.4);
p {
margin: 0.5rem 0;
}
@media (max-width: 900px) {
width: 100%;
position: absolute;
top: 0;
left: 0;
h2 {
font-size: 1.2rem;
}
h3 {
font-size: 1rem;
margin: 0.5rem 0;
}
p {
padding: 0;
margin: 5px 0;
}
}
`;
const Button = styled('a')`
position: absolute;
color: ${colors.black};
z-index: 5;
top: 5px;
right: 8px;
text-decoration: none;
padding: 0.5rem 1rem;
font-weight: 900;
border-radius: 10rem;
transition: all 0.2s;
:hover {
cursor: pointer;
transform: translateY(-0.1rem);
box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.2);
}
:active {
transform: translateY(-1px);
box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.2);
}
`;
const ContactWorkWrapper = styled('div')`
display: flex;
min-height: 65%;
@media (max-width: 900px) {
min-height: 55%;
}
`;
const SkillEducationWrapper = styled('div')`
display: flex;
`;
const LeftUnder = props => (
<LeftText>
<Button onClick={props.toggleState}>→</Button>
<ContactWorkWrapper>
<Contact />
<Work />
</ContactWorkWrapper>
<SkillEducationWrapper>
<SkillList isActiveLeft={props.isActiveLeft} />
<Education />
</SkillEducationWrapper>
</LeftText>
);
export default LeftUnder;
|
'use strict';
const _ = require('lodash');
const GameResult = require('../gameResult.js');
/**
* Generator for common baccarat roadmaps.
*/
class RoadmapGenerator {
/**
* Calculates a bead plate based on games played.
* @param {GameResult[]} gameResults The game results to
* calculate the roadmap from.
* @param {Object} config The configuration object for drawing options.
* @return {Object} A data representation of how a bead plate can
* be drawn from this calculation.
*/
beadPlate(gameResults = [], {columns = 6, rows = 6}) {
const DisplayEntries = columns * rows;
const ColumnSize = rows;
// Get the selected amount of display entries from the most
// recent games.
gameResults = _.takeRight(gameResults, DisplayEntries);
return _.range(0, gameResults.length)
.map((index) =>
_.assign({}, {result: gameResults[index] || {}}, {
column: this.columnForGameNumber(index, ColumnSize),
row: this.rowForGameNumber(index, ColumnSize),
}));
}
/**
* Calculates a big road based on games played.
* @param {GameResult[]} gameResults The game results to calculate the
* roadmap from.
* @param {Object} config The configuration object for drawing options.
* @return {Object} A data representation of how a big road can
* be drawn from this calculation.
*/
bigRoad(gameResults = [], {columns = 12, rows = 6, scroll = true} = {}) {
let tieStack = [];
let placementMap = {};
let logicalColumnNumber = 0;
let lastItem;
let returnList = [];
let maximumColumnReached = 0;
// Build the logical column definitions that doesn't represent
// the actual "drawn" roadmap.
gameResults.forEach((gameResult) => {
if (gameResult.outcome === GameResult.Tie) {
tieStack.push(gameResult);
} else {
if (lastItem) {
// Add the ties that happened inbetween the last placed
// big road item and this new big road item to the
// last entered big road item.
let lastItemInResults = _.last(returnList);
if (lastItem.outcome === GameResult.Tie) {
if (lastItemInResults) {
lastItemInResults.ties = _.cloneDeep(tieStack);
tieStack = [];
}
} else if (lastItem.outcome !== gameResult.outcome) {
// If this item is different from the outcome of
// the last game then we must place it in another
// column
logicalColumnNumber++;
}
}
let probeColumn = logicalColumnNumber;
let probeRow = 0;
let done = false;
while (!done) {
let keySearch = `${probeColumn}.${probeRow}`;
let keySearchBelow = `${probeColumn}.${probeRow + 1}`;
// Position available at current probe location
if (!_.get(placementMap, keySearch)) {
let newEntry = _.merge({}, {
row: probeRow,
column: probeColumn,
logicalColumn: logicalColumnNumber,
ties: _.cloneDeep(tieStack),
}, {result: gameResult});
_.set(placementMap, keySearch, newEntry);
returnList.push(placementMap[probeColumn][probeRow]);
done = true;
} else if (probeRow + 1 >= rows) {
// The spot below would go beyond the table bounds.
probeColumn++;
} else if (!_.get(placementMap, keySearchBelow)) {
// The spot below is empty.
probeRow++;
} else if (_.get(placementMap,
keySearchBelow).result.outcome === gameResult.outcome) {
// The result below is the same outcome.
probeRow++;
} else {
probeColumn++;
}
}
maximumColumnReached = Math.max(maximumColumnReached,
probeColumn);
}
lastItem = gameResult;
});
// There were no outcomes added to the placement map.
// We only have ties.
if (_.isEmpty(returnList) && tieStack.length > 0) {
returnList.push({
ties: _.cloneDeep(tieStack),
column: 0,
row: 0,
logicalColumn: 0,
result: {}});
} else if (!_.isEmpty(returnList)) {
_.last(returnList).ties = _.cloneDeep(tieStack);
}
if (scroll) {
returnList = this.scrollBigRoad(returnList,
maximumColumnReached, columns);
}
return returnList;
}
/**
* Scrolls the big road drawing to only show the specified amount of
* drawing columns.
* @private
* @param {Object[]} results The big road data
* @param {Number} highestDrawingColumn The highest column reached in
* the big road supplied.
* @param {Number} drawingColumns The amount of columns to show in the
* big road
* @return {Object[]} A new list of big road items whose view is scrolled
* to have the amount of drawing columns visible.
*/
scrollBigRoad(results = [], highestDrawingColumn, drawingColumns) {
const highestDrawableIndex = drawingColumns - 1;
const offset = Math.max(0, highestDrawingColumn - highestDrawableIndex);
let validItems = results.filter(
(value) => (value.column - offset) >= 0);
validItems.forEach((value) => value.column -= offset);
return validItems;
}
/**
* Generates the column number for the game number of a game based
* on the column size of the table to be drawn.
* @private
* @param {Number} gameNumber The game number of the item in the sequence.
* @param {Number} columnSize The column size of the drawn table
* @return {Number} The column number that this gameNumber is drawn to.
*/
columnForGameNumber(gameNumber, columnSize) {
return Math.floor(gameNumber / columnSize);
}
/**
* Generates the row number for the game number of a game based
* on the column size of the table to be drawn.
* @private
* @param {Number} gameNumber The game number of the item in the sequence.
* @param {Number} columnSize The column size of the drawn table
* @return {Number} The row number that this gameNumber is drawn to.
*/
rowForGameNumber(gameNumber, columnSize) {
return gameNumber % columnSize;
}
}
module.exports = RoadmapGenerator;
|
import React from 'react';
import { Popover } from 'react-bootstrap';
import { OverlayTrigger } from 'react-bootstrap';
import {
AiFillStar,
AiOutlinePlus,
AiOutlineStar,
AiOutlineWindows,
} from 'react-icons/ai';
import { BiBookContent, BiExit, BiStats } from 'react-icons/bi';
import { NavLink } from 'react-router-dom';
const popover1 = (
<Popover id='key-1' className='rounded-xl shadow-sm border-0'>
<div className='p-3'>
<div className='font-weight-bold'>
<span className='im-text-primary mr-1'>1.</span>
<span>Let’s Setting Up Your Profile</span>
</div>
<p className='text-black-50 mt-4 small'>
Let’s setting up your profile by uploading a profile picture, and then
you are ready to go!
</p>
</div>
</Popover>
);
export const Sidebar = ({ location }) => {
let hideSidebar =
location.pathname === '/role-select' ||
location.pathname === '/game-success' ||
location.pathname === '/join-success' ||
location.pathname === '/login' ||
location.pathname === '/404' ||
location.pathname === '/signup';
return (
<>
{hideSidebar ? (
''
) : (
<section className='sidebar d-none d-lg-flex pt-5 mt-4'>
<header className='p-4 mb-5'>
<div className='d-flex align-items-center mb-3'>
<NavLink
to='/profile'
type='button'
className='btn btn-two rounded-pill d-flex align-items-center justify-content-center p-3 mr-3'
>
<AiOutlinePlus size={20} />
</NavLink>
<OverlayTrigger
trigger='click'
placement='auto'
overlay={popover1}
>
<button
type='button'
className='btn btn-two rounded-pill d-flex align-items-center justify-content-center py-0 px-2 bg-white'
>
<AiFillStar color='#FF8252' />
<span className='text-black-50'>4.8</span>
</button>
</OverlayTrigger>
</div>
<div className='font-weight-bold h5'>John Smith</div>
</header>
<main className='pl-4'>
<NavLink
to='/'
className='btn btn-sidebar p-0 w-100 text-left rounded-0 d-flex align-items-center mb-5'
>
<span className='mr-3'>
<AiOutlineWindows size={24} />
</span>
<span className='btn-sidebar__text'>Dashboard</span>
</NavLink>
<NavLink
to='/stats'
className='btn btn-sidebar p-0 w-100 text-left rounded-0 d-flex align-items-center mb-5'
>
<span className='mr-3'>
<BiStats size={24} />
</span>
<span className='btn-sidebar__text'>Stats</span>
</NavLink>
<NavLink
to='/ratings'
className='btn btn-sidebar p-0 w-100 text-left rounded-0 d-flex align-items-center mb-5'
>
<span className='mr-3'>
<AiOutlineStar size={24} />
</span>
<span className='btn-sidebar__text'>Ratings</span>
</NavLink>
<NavLink
to='/matches'
className='btn btn-sidebar p-0 w-100 text-left rounded-0 d-flex align-items-center mb-5'
>
<span className='mr-3'>
<BiBookContent size={24} />
</span>
<span className='btn-sidebar__text'>Matches</span>
</NavLink>
</main>
<footer className='pl-4 mt-auto'>
<NavLink
to='/login'
className='btn btn-sidebar p-0 w-100 text-left rounded-0 d-flex align-items-center mb-5'
>
<span className='mr-3'>
<BiExit size={24} />
</span>
<span className='btn-sidebar__text'>Logout</span>
</NavLink>
</footer>
</section>
)}
</>
);
};
|
// 微信账号管理
if (typeof Global === "undefined") {
Global = {};
}
AccountGridListPanel = Ext.extend(Disco.Ext.CrudPanel, {
gridSelModel : 'checkbox',
id : "accountGridListPanel",
baseUrl : "account.java",
showView: false,
type:[["订阅号","1"],["服务号","2"]],
typeRender:function(v){
if(v=="1"){
return "订阅号";
}else{
return "服务号";
}
},
onCreate : function() {
if (this.sUser) {
this.fp.form.findField("sUser").setOriginalValue(this.sUser);
}
},
edit : function() {
var win = AccountGridListPanel.superclass.edit.call(this);
if (win) {
var record = this.grid.getSelectionModel().getSelected();
var sUser = record.get("sUser");
sUser.title=sUser.name;
console.dir(sUser)
this.fp.form.findField("sUser").setOriginalValue(sUser);
}
},
createForm : function() {
var formPanel = new Ext.form.FormPanel({
frame : true,
labelWidth : 60,
labelAlign : 'right',
fileUpload: true,
defaultType : 'textfield',
defaults : {
anchor : "-20"
},
items : [
{
xtype : "hidden",
name : "id"
},
Disco.Ext.Util.twoColumnPanelBuild({
fieldLabel : "帐号名称",
name : "name",
emptyText : '帐号名称不能为空',
allowBlank : false,
blankText : '帐号名称不能为空'
},{
fieldLabel : "账号编码",
name : "code",
emptyText : '账号编码不能为空',
allowBlank : false,
blankText : '账号编码不能为空'
},{
fieldLabel : "服务令牌",
name : "token",
emptyText : '服务令牌不能为空',
allowBlank : false,
blankText : '服务令牌不能为空'
},{
fieldLabel : "微信号码",
name : "number",
emptyText : '微信号码不能为空',
allowBlank : false,
blankText : '微信号码不能为空'
},{
xtype : "combo",
name : "type",
hiddenName : "type",
fieldLabel : "帐号类型",
allowBlank : false,
blankText : '帐号类型不能为空',
displayField : "title",
valueField : "value",
store : new Ext.data.SimpleStore({
fields : [ 'title', 'value' ],
data : this.type
}),
editable : false,
mode : 'local',
triggerAction : 'all'
},{
fieldLabel : "原始ID号",
name : "accountid"
},{
fieldLabel : "应用ID号",
name : "appid"
},{
fieldLabel : "应用密钥",
name : "appsecret"
},{
xtype : 'fileuploadfield',
emptyText : '单击右侧按钮选择上传的多媒体',
fieldLabel : "默认图片",
name : "imgPath",
buttonCfg : {
text : '',
iconCls : 'upload-icon'
}
},{
xtype : 'fileuploadfield',
fieldLabel : "二维码",
name : "qrcodeImg",
buttonCfg : {
text : '',
iconCls : 'upload-icon'
}
},{
fieldLabel : "处理类",
name : "handlerName",
allowBlank : true
}),{
xtype: "textarea",
fieldLabel : "平台简介",
height:110,
name : "description"
}]
});
return formPanel;
},
reloadLeftTree : function() {
if (this.tree) {
this.tree.root.reload();
this.tree.expandAll();
}
if (this.fp) {
var dirNode = this.fp.form.findField("dir");
if (dirNode && dirNode.tree.rendered) {
dirNode.tree.root.reload();
dirNode.tree.expandAll();
}
}
},
createWin : function(callback, autoClose) {
return this.initWin(750, 320, "微信公众帐号管理", callback, autoClose);
},
storeMapping : [ "id", "name", "token", "number", "accountid", "type",
"description", "appid","appsecret","addtoekntime","tenant","doMain","imgPath","handlerName","code","qrcodeImg"],
initComponent : function() {
this.cm = new Ext.grid.ColumnModel([{
header : "帐号名称",
sortable : true,
width : 160,
dataIndex : "name"
},{
header : "微信号码",
sortable : true,
width : 160,
dataIndex : "number"
},{
header : "帐号类型",
sortable : true,
width : 160,
dataIndex : "type",
renderer : this.typeRender
},{
header : "服务令牌",
sortable : true,
width : 160,
dataIndex : "token"
},{
header : "二维码",
sortable : true,
width : 160,
dataIndex : "qrcodeImg",
renderer:function(v){
return '<img width=100 height=100 src="'+v+'"/>';
}
}]);
AccountGridListPanel.superclass.initComponent.call(this);
this.on("saveobject", this.reloadLeftTree, this);
this.on("removeobject", this.reloadLeftTree, this);
},
listeners : {
render : function(e) {
}
}
});
|
var searchData=
[
['fdatasync',['fdatasync',['../sqlite3_8c.html#a71be186076d9c018df61d695a82c6edb',1,'sqlite3.c']]],
['filehandleid',['FILEHANDLEID',['../sqlite3_8c.html#a7cace293575d93eb07cc5a9ab9b42e41',1,'sqlite3.c']]],
['findcell',['findCell',['../sqlite3_8c.html#adcb94212d5f55b413664d999ea94a449',1,'sqlite3.c']]],
['findcellv2',['findCellv2',['../sqlite3_8c.html#a1fecc4825cb0fe3d7ec77e6261784542',1,'sqlite3.c']]],
['flag_5fintern',['FLAG_INTERN',['../sqlite3_8c.html#a1fb17d8c136bc9523f9cfa5d7b66badd',1,'sqlite3.c']]],
['flag_5fsigned',['FLAG_SIGNED',['../sqlite3_8c.html#a3faa3c222627c6e8fce83e56b075cfce',1,'sqlite3.c']]],
['flag_5fstring',['FLAG_STRING',['../sqlite3_8c.html#a8a7e4aa621af3c751097ed9f02516fd4',1,'sqlite3.c']]],
['func_5fperfect_5fmatch',['FUNC_PERFECT_MATCH',['../sqlite3_8c.html#ad1f5d19ea2e023f90d8ddcb4f1e2d07b',1,'sqlite3.c']]],
['function',['FUNCTION',['../sqlite3_8c.html#a1dd71dcc1028eb0433bf066580c655ea',1,'sqlite3.c']]],
['function2',['FUNCTION2',['../sqlite3_8c.html#ae91bddf353804f6c101c18642da0e0e0',1,'sqlite3.c']]]
];
|
const WebSocketClient = require('websocket').w3cwebsocket;
const {URLS} = require('./const/url');
const config = require('./config');
const {buildSignature} = require('./sign');
const CONNECTING = 0;
const OPEN = 1;
const CLOSING = 2;
const CLOSED = 3;
(function main() {
const ws = new WebSocketClient(URLS.WS_URL);
let counter = 1;
function nextId() {
return counter++;
}
function send(msg, callback = null) {
if (ws.readyState === OPEN) {
msg.id = msg.id || nextId();
if (callback) {
function handleMessage(e) {
const data = JSON.parse(e.data);
if (data.id === msg.id) {
ws.removeEventListener('message', handleMessage);
callback(null, data);
}
}
ws.addEventListener('message', handleMessage);
}
const msgStr = JSON.stringify(msg);
ws.send(msgStr);
console.log('[SEND MSG]', msgStr);
return;
}
callback('websocket not open');
}
startHeartbeat(ws, send);
ws.addEventListener('open', function() {
send({method: 'orderbook.subscribe', params: ['BTCUSD']}, function(error, data) {
if (error) {
console.log('subscribe BTCUSD orderbook failed');
}
if (data) {
console.log('subscribe BTCUSD orderbook succeed');
}
});
});
wsLogin(ws, send, function handleLogin(error, data) {
if (error) {
console.log('ws auth failed');
}
if (data) {
console.log('ws auth succeed');
send({method: 'aop.subscribe', params: []}, function(error, data) {
if (error) {
console.log('subscribe aop data failed');
}
if (data) {
console.log('subscribe aop data succeed');
}
});
}
});
ws.addEventListener('message', function(e) {
console.log('[RECEIVE MSG]', e.data);
});
})();
function startHeartbeat(ws, send) {
let timer = 0;
ws.addEventListener('open', function() {
timer = setInterval(() => {
send({method: 'server.ping', params: []});
}, 3000);
});
ws.addEventListener('close', function() {
clearInterval(timer);
timer = 0;
});
}
function wsLogin(ws, send, callback) {
ws.addEventListener('open', function() {
// auth
const expiry = Math.floor(Date.now() / 1000) + 2 * 60;
const content = config.api_key + expiry;
const signature = buildSignature(content, config.secret);
send({method: 'user.auth', params: ['API', config.api_key, signature, expiry]}, callback);
});
}
|
function desativa(ts){
var input1 = window.document.getElementById(ts);
var cont = input1.innerHTML.replace(">","");
cont = cont + "disabled >";
input1.innerHTML = cont;
}
function ativa(ts) {
var input1 = window.document.getElementById(ts);
var cont = input1.innerHTML;
if(cont.includes("disabled")){
cont = cont.replace('disabled="">',">")
input1.innerHTML = cont;
}
}
function buttons(ts) {
if(ts === "bt1"){
desativa("teste");
desativa("teste2");
ativa("teste3");
}
else if(ts === "bt2"){
ativa("teste");
ativa("teste2");
desativa("teste3");
}
}
|
import React from 'react'
const Notification = ({ notification }) => {
if (notification) return <div className='default-notification'><strong>Success!</strong> {notification}</div>
else return null
}
export default Notification;
|
import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import MainLayout from '../../ui/layouts/mainlayout.html';
import Teams from '../../ui/views/data/teams.html';
import Players from '../../ui/views/data/players.html';
import Basketplayers from '../../ui/views/data/basketplayers.html';
import Home from '../../ui/views/home.html';
import Page1 from '../../ui/views/page1.html';
import Page2 from '../../ui/views/page2.html';
import Page3 from '../../ui/views/page3.html';
import bsoccer from '../../ui/views/bsoccer.html';
import football from '../../ui/views/football.html';
import gsoccer from '../../ui/views/gsoccer.html';
import fieldhockey from '../../ui/views/fieldhockey.html';
import baseball from '../../ui/views/baseball.html';
import bbasketball from '../../ui/views/bbasketball.html';
import blacrosse from '../../ui/views/blacrosse.html';
import boutdoortrack from '../../ui/views/boutdoortrack.html';
import btennis from '../../ui/views/btennis.html';
import gbasketball from '../../ui/views/gbasketball.html';
import glacrosse from '../../ui/views/glacrosse.html';
import golf from '../../ui/views/golf.html';
import goutdoortrack from '../../ui/views/goutdoortrack.html';
import gtennis from '../../ui/views/gtennis.html';
import hockey from '../../ui/views/hockey.html';
import softball from '../../ui/views/softball.html';
import volleyball from '../../ui/views/volleyball.html';
import wrestiling from '../../ui/views/wrestiling.html';
import data from '../../ui/views/data/data.html';
import updateteam from '../../ui/views/data/updateteam.html';
import updateplayer from '../../ui/views/data/updateplayer.html';
import soccer from '../../ui/views/data/soccer.html';
import footbal from '../../ui/views/data/footbal.html';
import field from '../../ui/views/data/field.html';
import volley from '../../ui/views/data/volley.html';
import hoc from '../../ui/views/data/hoc.html';
import wrest from '../../ui/views/data/wrest.html';
import base from '../../ui/views/data/base.html';
import soft from '../../ui/views/data/soft.html';
import track from '../../ui/views/data/track.html';
import lax from '../../ui/views/data/lax.html';
import ten from '../../ui/views/data/ten.html';
import gol from '../../ui/views/data/gol.html';
import laxupdate from '../../ui/views/data/laxupdate.html';
import softballupdate from '../../ui/views/data/softballupdate.html';
import baseupdate from '../../ui/views/data/baseupdate.html';
import tupdate from '../../ui/views/data/tupdate.html';
// Add more templates here
import '../../ui/layouts/navigation.html';
FlowRouter.route('/',{
name:'Home',
action(){
BlazeLayout.render('MainLayout',{main:'Home'});
}
})
FlowRouter.route('/page1',{
name:'Page1',
action(){
BlazeLayout.render('MainLayout',{main:'Page1'});
}
})
FlowRouter.route('/page2',{
name:'Page2',
action(){
BlazeLayout.render('MainLayout',{main:'Page2'});
}
})
FlowRouter.route('/page3',{
name:'Page3',
action(){
BlazeLayout.render('MainLayout',{main:'Page3'});
}
})
//end of nav bar
//start of team pages
FlowRouter.route('/bsoccer',{
name:'bsoccer',
action(){
BlazeLayout.render('MainLayout',{main:'Bsoccer'});
}
})
FlowRouter.route('/gsoccer',{
name:'gsoccer',
action(){
BlazeLayout.render('MainLayout',{main:'Gsoccer'});
}
})
FlowRouter.route('/football',{
name:'football',
action(){
BlazeLayout.render('MainLayout',{main:'Football'});
}
})
FlowRouter.route('/fieldhockey',{
name:'fieldhockey',
action(){
BlazeLayout.render('MainLayout',{main:'Fieldhockey'});
}
})
FlowRouter.route('/volleyball',{
name:'volleyball',
action(){
BlazeLayout.render('MainLayout',{main:'Volleyball'});
}
})
FlowRouter.route('/bbasketball',{
name:'bbasketball',
action(){
BlazeLayout.render('MainLayout',{main:'Bbasketball'});
}
})
FlowRouter.route('/gbasketball',{
name:'gbasketball',
action(){
BlazeLayout.render('MainLayout',{main:'Gbasketball'});
}
})
FlowRouter.route('/hockey',{
name:'hockey',
action(){
BlazeLayout.render('MainLayout',{main:'Hockey'});
}
})
FlowRouter.route('/wrestiling',{
name:'wrestiling',
action(){
BlazeLayout.render('MainLayout',{main:'Wrestiling'});
}
})
FlowRouter.route('/baseball',{
name:'baseball',
action(){
BlazeLayout.render('MainLayout',{main:'Baseball'});
}
})
FlowRouter.route('/softball',{
name:'softball',
action(){
BlazeLayout.render('MainLayout',{main:'Softball'});
}
})
FlowRouter.route('/goutdoortrack',{
name:'goutdoortrack',
action(){
BlazeLayout.render('MainLayout',{main:'Goutdoortrack'});
}
})
FlowRouter.route('/boutdoortrack',{
name:'boutdoortrack',
action(){
BlazeLayout.render('MainLayout',{main:'Boutdoortrack'});
}
})
FlowRouter.route('/golf',{
name:'golf',
action(){
BlazeLayout.render('MainLayout',{main:'Golf'});
}
})
FlowRouter.route('/glacrosse',{
name:'glacrosse',
action(){
BlazeLayout.render('MainLayout',{main:'Glacrosse'});
}
})
FlowRouter.route('/blacrosse',{
name:'blacrosse',
action(){
BlazeLayout.render('MainLayout',{main:'Blacrosse'});
}
})
FlowRouter.route('/btennis',{
name:'btennis',
action(){
BlazeLayout.render('MainLayout',{main:'Btennis'});
}
})
FlowRouter.route('/gtennis',{
name:'gtennis',
action(){
BlazeLayout.render('MainLayout',{main:'Gtennis'});
}
})
//end of team pages
//start of player stat pages
FlowRouter.route('/gsoccerplayers',{
name:'gsoccerplayers',
action(){
BlazeLayout.render('MainLayout',{main:'Gsoccerplayers'});
}
})
FlowRouter.route('/team',{
name:'team',
action(){
BlazeLayout.render('MainLayout',{main:'Teams'});
}
})
FlowRouter.route('/players',{
name:'players',
action(){
BlazeLayout.render('MainLayout',{main:'Players'});
}
})
FlowRouter.route('/players',{
name:'players',
action(){
BlazeLayout.render('MainLayout',{main:'Players'});
}
})
FlowRouter.route('/data',{
name:'data',
action(){
BlazeLayout.render('MainLayout',{main:'Data'});
}
})
FlowRouter.route('/updateteam',{
name:'updateteam',
action(){
BlazeLayout.render('MainLayout',{main:'Updateteam'});
}
})
FlowRouter.route('/updateplayer',{
name:'updateplayer',
action(){
BlazeLayout.render('MainLayout',{main:'Updateplayer'});
}
})
FlowRouter.route('/basketplayers',{
name:'basketplayers',
action(){
BlazeLayout.render('MainLayout',{main:'Basketplayers'});
}
})
FlowRouter.route('/soccer',{
name:'soccer',
action(){
BlazeLayout.render('MainLayout',{main:'Soccer'});
}
})
FlowRouter.route('/footbal',{
name:'footbal',
action(){
BlazeLayout.render('MainLayout',{main:'Footbal'});
}
})
FlowRouter.route('/field',{
name:'field',
action(){
BlazeLayout.render('MainLayout',{main:'Field'});
}
})
FlowRouter.route('/volley',{
name:'volley',
action(){
BlazeLayout.render('MainLayout',{main:'Volley'});
}
})
FlowRouter.route('/hoc',{
name:'hoc',
action(){
BlazeLayout.render('MainLayout',{main:'Hoc'});
}
})
FlowRouter.route('/wrest',{
name:'wrest',
action(){
BlazeLayout.render('MainLayout',{main:'Wrest'});
}
})
FlowRouter.route('/base',{
name:'base',
action(){
BlazeLayout.render('MainLayout',{main:'Base'});
}
})
FlowRouter.route('/soft',{
name:'soft',
action(){
BlazeLayout.render('MainLayout',{main:'Soft'});
}
})
FlowRouter.route('/track',{
name:'track',
action(){
BlazeLayout.render('MainLayout',{main:'Track'});
}
})
FlowRouter.route('/lax',{
name:'lax',
action(){
BlazeLayout.render('MainLayout',{main:'Lax'});
}
})
FlowRouter.route('/ten',{
name:'ten',
action(){
BlazeLayout.render('MainLayout',{main:'Ten'});
}
})
FlowRouter.route('/gol',{
name:'gol',
action(){
BlazeLayout.render('MainLayout',{main:'Gol'});
}
})
FlowRouter.route('/laxupdate/:id',{
name:'laxupdate',
action(){
BlazeLayout.render('MainLayout',{main:'Laxupdate'});
}
})
FlowRouter.route('/softballupdate/:id',{
name:'softballupdate',
action(){
BlazeLayout.render('MainLayout',{main:'Softballupdate'});
}
})
FlowRouter.route('/baseupdate/:id',{
name:'baseupdate',
action(){
BlazeLayout.render('MainLayout',{main:'Baseupdate'});
}
})
FlowRouter.route('/tupdate/:id',{
name:'tupdate',
action(){
BlazeLayout.render('MainLayout',{main:'Tupdate'});
}
})
|
import React from 'react';
import Forecast from './forecast';
export default class Weather extends React.Component {
constructor(props) {
super(props);
this.state = {
fahrenheit: 0,
celsius: 0,
weatherDescription: null,
icon: null,
humidity: 0,
high: 0,
low: 0,
windSpeed: 0,
cloudiness: 0,
forecasts: null
};
this.capitalizeFirstLetter = this.capitalizeFirstLetter.bind(this);
}
fetchWeatherData() {
fetch(`http://api.openweathermap.org/data/2.5/weather?q=${this.props.location}&appid=fba61597b693afd2b121ca0ad929d002&units=imperial`)
.then(result => {
return result.json();
}).then(result => {
this.setState({fahrenheit: Math.round(result.main.temp),
celsius: Math.round((result.main.temp - 32)*5/9),
weatherDescription: result.weather[0].description,
icon: `http://openweathermap.org/img/w/${result.weather[0].icon}.png`,
humidity: result.main.humidity,
low: Math.round(result.main.temp_min),
high: Math.round(result.main.temp_max),
windSpeed: Math.round(result.wind.speed),
cloudiness: result.clouds.all
});
});
}
fetchForecasts() {
fetch(`http://api.openweathermap.org/data/2.5/forecast?q=${this.props.location}&appid=fba61597b693afd2b121ca0ad929d002&units=imperial`)
.then(result => {
return result.json();
}).then(result => {
let tenDayForecast = result.list.slice(0, 10);
let formattedForecasts = tenDayForecast.map((obj, i) => {
return(
<Forecast
key={i}
time={obj.dt_txt}
fahrenheit={Math.round(obj.main.temp)}
description={obj.weather[0].main}
icon={`http://openweathermap.org/img/w/${obj.weather[0].icon}.png`}
/>
);
});
this.setState({forecasts: formattedForecasts});
})
}
componentDidMount() {
this.fetchWeatherData();
this.fetchForecasts();
}
capitalizeFirstLetter(str) {
if (str !== null) return str[0].toUpperCase().concat(str.slice(1));
}
render() {
if (this.state.forecasts === null) return(<div></div>);
return(
<div className="slds-card slds-p-around_small">
<div id={this.props.location} >
<div className="white-opaque-background slds-p-around_small">
<div className="slds-grid">
<div className="slds-col">
<ul className="slds-list_horizontal slds-has-block-links_space">
<li>
<h2>{this.capitalizeFirstLetter(this.props.location)}</h2>
</li>
<li>
<img className="slds-col icon-weather" src={this.state.icon} alt="weather icon"/>
</li>
</ul>
<div className="slds-grid">
<h3 className="slds-col slds-size_3-of-12 slds-p-right_xsmall">{this.state.fahrenheit}° F</h3>
<h5 className="slds-col">({this.state.celsius}° C)</h5>
</div>
</div>
<div className="slds-col slds-text-align_right">
<h3>{this.capitalizeFirstLetter(this.state.weatherDescription)}</h3>
<h4>Low: {this.state.low}° F; High: {this.state.high}° F</h4>
<h4>{this.state.cloudiness}% cloudy with wind speeds of {this.state.windSpeed} mph.</h4>
<h4>{this.state.humidity}% humidity</h4>
</div>
</div>
<div className="slds-p-top_large slds-p-bottom_small">
<h4>Forecast</h4>
</div>
<div className="slds-grid slds-gutters">
{this.state.forecasts}
</div>
</div>
</div>
</div>
)
}
}
|
/* tessel to tessel
* requires 2 nrf24 modules (and ideally two tessels)
*
* Transmits light level to receiver device.
* For receiver, see:
* https://github.com/SomeoneWeird/tessel-nrf-receiver
*/
var tessel = require('tessel');
var NRF24 = require('rf-nrf24');
var ambientlib = require('ambient-attx4');
var pipes = [0xF0F0F0F0E1, 0xF0F0F0F0D2];
var nrf = NRF24.channel(0x4c) // set the RF channel to 76. Frequency = 2400 + RF_CH [MHz] = 2476MHz
.transmitPower('PA_MAX') // set the transmit power to max
.dataRate('1Mbps')
.crcBytes(2) // 2 byte CRC
//.autoRetransmit({count:1, delay:100})
.use(tessel.port['C']);
var txPipe = null;
var isOn = true;
function sendByte(val) {
if (val < 0) val = 0;
if (val > 255) val = 255;
if (txPipe) {
var b = new Buffer(4);
b.fill(0);
b.writeUInt32BE(val,0);
console.log("Sending", b.readUInt32BE(0));
txPipe.write(b);
}
}
// AMBIENT
var ambient = ambientlib.use(tessel.port['D']);
ambient.on('ready', function () {
console.log("AMBIENT READY");
// Get points of light and sound data.
setInterval( function () {
ambient.getLightLevel( function(err, ldata) {
ambient.getLightLevel( function(err, sdata) {
console.log("Light level:", (ldata||0).toFixed(8), " ", "Sound Level:", (sdata||0).toFixed(8));
var light = ((ldata||0) * 16) * 255;
if (light > 255) light = 255;
sendByte( isOn ? light : 0 );
});
})}, 2000); // The readings will happen every .5 seconds unless the trigger is hit
// Set a sound level trigger
// The trigger is a float between 0 and 1
ambient.setSoundTrigger(0.2);
ambient.on('sound-trigger', function(data) {
console.log("Something happened with sound: ", data);
isOn = !isOn;
console.log( isOn ? "Light is now ON" : "Light is now OFF" );
// Clear it
ambient.clearSoundTrigger();
//After 1.5 seconds reset sound trigger
setTimeout(function () {
ambient.setSoundTrigger(0.1);
},500);
});
});
ambient.on('error', function (err) {
console.log("ambient:", err)
});
// NRF comms
nrf._debug = false;
nrf.on('ready', function () {
console.log("NRF READY");
var tx = nrf.openPipe('tx', pipes[0], {autoAck: false}), // transmit address F0F0F0F0D2
rx = nrf.openPipe('rx', pipes[1], {size: 4}); // receive address F0F0F0F0D2
tx.on('ready', function () {
txPipe = tx;
});
rx.on('data', function (d) {
console.log("Got response back:", d);
});
});
nrf.on('error', function (err) {
console.log("nrf:", err)
});
// hold this process open
process.ref();
|
var _viewer = this;
//列表需要建一个code为buttons的自定义字段。
$(".rhGrid").find("tr").each(function(index,item){
if(index !=0){
var dataId=item.id;
$(item).find("td[icode='BUTTONS']").append(
'<a class="rhGrid-td-rowBtnObj rh-icon" id="TS_XMGL_YDJK_edit" rowpk="'+dataId+'"><span class="rh-icon-inner">编辑</span><span class="rh-icon-img btn-edit"></span></a>'+
'<a class="rhGrid-td-rowBtnObj rh-icon" id="TS_XMGL_YDJK_delete" rowpk="'+dataId+'"><span class="rh-icon-inner">删除</span><span class="rh-icon-img btn-delete"></span></a>'
)
//为每个按钮绑定卡片
bindCard();
}
});
/*
* 删除前方法执行
*/
rh.vi.listView.prototype.beforeDelete = function(pkArray) {
showVerify(pkArray,_viewer);
}
//绑定的事件
function bindCard(){
//编辑
jQuery("td [id='TS_XMGL_YDJK_edit']").unbind("click").bind("click", function(){
var pkCode = jQuery(this).attr("rowpk");
rowEdit(pkCode,_viewer,[1000,500],[200,100]);
});
//当行删除事件
jQuery("td [id='TS_XMGL_YDJK_delete']").unbind("click").bind("click", function(){
var pkCode = jQuery(this).attr("rowpk");
rowDelete(pkCode,_viewer);
});
}
|
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/home/home.vue'
Vue.use(Router)
export default new Router({
mode: 'history',
beforeRouteEnter (to, from, next) {
// 在渲染该组件的对应路由被 confirm 前调用
// 不!能!获取组件实例 `this`
// 因为当钩子执行前,组件实例还没被创建
next();
},
routes: [{
path: '/',
name: 'Home',
component: Home
}]
})
|
import styled from "styled-components";
import giftpage from '../assets/bgimg/giftpage.png'
import { commerce } from '../lib/commerce'
import {Cart} from '../components'
import { useState, useEffect }from 'react'
const Carty = () => {
const [cart, setCart] = useState({})
const fetchCart = async () => {
setCart(await commerce.cart.retrieve());
}
const handleUpdateCartQty = async (productId, quantity) => {
const {cart} = await commerce.cart.update(productId, {quantity})
setCart(cart)
}
const handleRemoveFromCart = async (productId) => {
const {cart} = await commerce.cart.remove(productId)
setCart(cart)
}
const handleEmptyCart = async () => {
const {cart} = await commerce.cart.empty()
setCart(cart)
}
useEffect (() => {
fetchCart();
}, []);
console.log(cart)
return (
<Div>
<Cart
cart={cart}
handleUpdateCartQty={handleUpdateCartQty}
handleRemoveFromCart={handleRemoveFromCart}
handleEmptyCart={handleEmptyCart}
/>
</Div>
)
}
const Div =styled.div`
min-height: 100vh;
width: 100%;
display: inline-block;
background-image: url(${giftpage});
background-repeat: no-repeat;
background-size: cover;
padding-top: 3rem;
@media (max-width: 768px) {
padding-top: 5rem;
min-height: 80vh;
}
@media (max-width: 480px) {
min-height: 150vh;
}
`
export default Carty;
|
import React, { Component } from 'react';
import './OrgForm.scss';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import { connect } from 'react-redux';
import { Field, reduxForm } from 'redux-form'
import {INIT_ORGS_STATE, CLEAR_ORGS_STATE} from '../../store/actionTypes'
import {createNewOrg, updateCurrentOrg} from '../../store/actions'
const validate = values => {
const errors = {}
const requiredFields = [
'name',
'email',
]
requiredFields.forEach(field => {
if (!values[field]) {
errors[field] = 'The field is required'
}
})
if (values.email && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(values.email)) {
errors.email = 'Invalid email address'
}
return errors
}
class OrgForm extends Component {
state = {
name: '',
email: '',
logo: '',
site: '',
}
renderTextField = ({
name,
input,
label,
type,
meta: { touched, error },
...custom
}) => {
return <TextField
label={label}
helperText={touched && error}
margin="dense"
type={type}
error={touched && error && true}
fullWidth
InputLabelProps={{
shrink: true
}}
{...input}
{...custom}
/>
}
renderFileField = ({
name,
input,
label,
type,
meta: { touched, error },
...custom
}) => {
return <TextField
label={label}
helperText={touched && error}
error={touched && error && true}
margin="dense"
id="name"
type="file"
fullWidth
InputLabelProps={{
shrink: true
}}
onChange={this.handleChangeFile('logo')}
/>
}
handleChange = name => event => {
this.setState({
[name]: event.target.value,
});
};
handleChangeFile = name => event => {
if(event.target && event.target.files) {
this.setState({
logo: event.target.files[0],
});
}
};
updateFormHandler = (reset) => {
reset()
this.props.onClose()
this.props.updateCurrentOrg(this.state)
}
createFormHandler = (reset) => {
reset()
this.props.onClose()
this.props.createNewOrg(this.state)
}
componentDidMount = () => {
if(this.props.currentOrg) {
this.props.initOrg(this.props.currentOrg)
this.setState({
...this.props.currentOrg,
})
}
}
componentWillUnmount = () => {
this.props.clearInitialState()
}
render() {
const { pristine, reset, invalid, } = this.props
return (
<Dialog
className='OrgForm'
open={this.props.open}
onClose={this.props.onClose}
aria-labelledby="form-dialog-title"
>
<DialogTitle id="form-dialog-title">Add new organizator</DialogTitle>
<DialogContent>
<Field
name="name"
component={this.renderTextField}
label="Name"
type='text'
onChange={this.handleChange("name")}
/>
<Field
name="email"
component={this.renderTextField}
label="Email"
type='email'
onChange={this.handleChange("email")}
/>
<Field
name="site"
component={this.renderTextField}
label="Website"
type='text'
onChange={this.handleChange("site")}
/>
<Field
name="logo"
component={this.renderFileField}
label="Logo"
type='file'
/>
</DialogContent>
<DialogActions>
<Button onClick={this.props.onClose} color="primary">
Cancel
</Button>
<Button disabled={pristine || invalid} onClick={this.props.currentOrg ? this.updateFormHandler.bind(this, reset) : this.createFormHandler.bind(this, reset)} color="primary">
Add
</Button>
</DialogActions>
</Dialog>
)
}
}
const mapStateToProps = state => {
return {
currentOrg: state.organizators.currentOrg,
initialValues: state.orgFormInit.data
}
}
const mapDispatchToProps = dispatch => {
return {
createNewOrg: (data) => dispatch(createNewOrg(data)),
updateCurrentOrg: (data) => dispatch(updateCurrentOrg(data)),
initOrg: (data) => (dispatch({type: INIT_ORGS_STATE, data: data})),
clearInitialState: () => (dispatch({type: CLEAR_ORGS_STATE})),
}
}
OrgForm = reduxForm({
form: 'orgForm',
validate,
})(OrgForm);
export default connect(mapStateToProps, mapDispatchToProps)(OrgForm)
|
import types from 'Actions/types';
import { initialAuthorState } from './initialState';
const {
SET_AUTHORS,
AUTHOR_FETCHED,
ADD_AUTHOR,
AUTHOR_EDITED,
AUTHOR_DELETED,
AUTHOR_ASSIGNED
} = types;
const authors = (state = initialAuthorState, action) => {
switch (action.type) {
case SET_AUTHORS:
return {
...state,
authors: action.authors
}
break;
case AUTHOR_FETCHED:
return action.author
break;
case ADD_AUTHOR:
return {
...state,
authors: [
...state.authors, action.author
]
}
break;
case AUTHOR_EDITED:
const authorsAfterEditing = state.authors.map((author) => {
author.id === action.author.id ? action.author :
author
});
return {
...state,
authors: authorsAfterEditing
};
break;
case AUTHOR_DELETED:
const authorsAfterDeletion = state.authors.filter(
author => author.id !== action.authorId
)
return {
...state,
authors: authorsAfterDeletion
};
break;
case AUTHOR_ASSIGNED:
return {
...state,
authorBooks: [
...state.authorBooks, action.authorBook
]
};
break;
default:
return state
}
}
export default authors;
|
import React from "react";
import { createStore } from "redux";
//defaultState + store + reducer
const defaultState = {
QAlist: [],
question: "",
answer: ""
};
const reducer = (state = defaultState, action) => {
switch (action.type) {
case "ADD_QA_TOLIST": {
const newstate = JSON.parse(JSON.stringify(state));
newstate.QAlist.push({
question: newstate.question,
answer: newstate.answer
});
return newstate;
}
case "CHANGE_QUE": {
const newstate = JSON.parse(JSON.stringify(state));
newstate.question = action.value;
return newstate;
}
case "CHANGE_ANSWER": {
const newstate = JSON.parse(JSON.stringify(state));
newstate.answer = action.value;
return newstate;
}
}
return state;
};
const store = createStore(reducer);
export default class QuestionAnswerBar extends React.Component {
constructor(props) {
super(props);
this.state = store.getState();
store.subscribe(this.handle_state_change);
}
handle_state_change = () => {
this.setState(store.getState());
};
add_QA_tolist = () => {
store.dispatch({
type: "ADD_QA_TOLIST",
value: { question: this.state.question, answer: this.state.answer }
});
};
handle_Q_change = e => {
store.dispatch({
type: "CHANGE_QUE",
value: e.target.value
});
};
handle_A_change = e => {
store.dispatch({
type: "CHANGE_ANSWER",
value: e.target.value
});
};
render() {
return (
<div>
<input
type="text"
value={this.state.question}
onChange={this.handle_Q_change}
></input>
<input
type="text"
value={this.state.answer}
onChange={this.handle_A_change}
></input>
<button onClick={this.add_QA_tolist}>add QA to list</button>
<ul>
{this.state.QAlist.map((item, index) => {
return (
<li key={index}>
question is :{item.question} answer is:{item.answer}
{/* <button onClick={this.deleteItem}>delete</button> */}
</li>
);
})}
</ul>
</div>
);
}
}
|
import React from "react"
import PropTypes from 'prop-types'
import { PageHeader, Modal, Button } from "react-bootstrap"
const ReactModal = props => {
return (
<Modal show={props.isShowing} onHide={props.toggleShow}>
<Modal.Header closeButton>
<Modal.Title>{props.title}</Modal.Title>
</Modal.Header>
<Modal.Body>{props.body}</Modal.Body>
<Modal.Footer>
<Button variant="primary" onClick={props.onClick}>
{props.primaryCTA}
</Button>
</Modal.Footer>
</Modal>
)
}
ReactModal.propTypes = {
isShowing: PropTypes.bool,
toggleShow: PropTypes.func
}
ReactModal.defaultProps = {
isShowing: false,
title: '',
body: '',
primaryCTA: 'Submit'
}
export default ReactModal
|
import React from 'react';
import { Route, Redirect } from 'react-router-dom';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom'
// const PrivateRoute = ({ component: Component, ...rest }) => (
// <Route {...rest} render={props => (
// localStorage.getItem('user')
// ? <Component {...props} />
// : <Redirect to={{ pathname: '/login', state: { from: props.location } }} />
// )} />
// );
// export {PrivateRoute};
const PrivateRouteComponent = ({ component: Component, auth, ...rest }) => (
<Route {...rest} render={props => (
auth//localStorage.getItem('user')
? <Component {...props} />
: <Redirect to={{ pathname: '/login', state: { from: props.location } }} />
)}/>
// <Route {...rest} render={props => (<Component {...props} /> )}/>
)
const mapStateToProps = (state, ownProps) => {
return {
auth: state.auth
//logged_in: true,
//logged_in: state.auth.logged_in,
// location: ownProps.path,
// routeProps: {
// exact: ownProps.exact,
// path: ownProps.path
//}
};
};
const PrivateRoute = connect(mapStateToProps, null,null,{pure:false,})(PrivateRouteComponent);
// export default connect(mapStateToProps, null, null, {
// pure: false,
// })(PrivateRoute);
export {PrivateRoute};
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const StoryList = props => {
const { stories, rootClassName } = props;
return (
<div
className={classNames('story-list__component', {
[rootClassName]: !!rootClassName,
})}
>
<h2>Story List</h2>
<table>
<thead>
<tr>
<th>Story</th>
<th>Final Score</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{stories &&
stories.map(({ id, title, finalScore, status }) => (
<tr key={id}>
<td>{title}</td>
<td>{finalScore}</td>
<td>{status}</td>
</tr>
))}
{(!stories || stories.length <= 0) && (
<tr className="no-item">
<td>No item found!</td>
<td> </td>
<td> </td>
</tr>
)}
</tbody>
</table>
</div>
);
};
StoryList.propTypes = {
stories: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
title: PropTypes.string.isRequired,
finalScore: PropTypes.number,
status: PropTypes.oneOf(['ACTIVE', 'VOTED', 'NOT_VOTED']),
})
).isRequired,
rootClassName: PropTypes.string,
};
StoryList.defaultProps = {
rootClassName: null,
};
export default StoryList;
|
const accessTokenModify = require('./helpers/modify-access-token');
const postScheduler = require('./helpers/schedule-post');
exports.homepage = function(req, res) {
res.status(200)
.send('Homepage');
};
exports.page404 = function(req, res) {
res.sendStatus(404);
};
exports.newAccessTok = (req, res) => {
accessTokenModify.token(req, function(err, response) {
if (err) {
console.log(__filename.split('/').pop() + err);
res.sendStatus(500);
// add some mechanism to notify admins about error
} else {
res.status(200)
.send(req.params.account + req.params.token);
console.log(__filename.split('/').pop() + ' Token updated');
}
});
};
exports.schedulePost = (req, res) => {
postScheduler.schedule(req, function(err, response) {
if (err) {
console.log(__filename.split('/').pop() + err);
res.sendStatus(500);
// add some mechanism to notify admins about error
} else {
res.status(200)
.send(req.params);
console.log(__filename.split('/').pop() + ' Post Scheduled');
}
});
};
|
'use strict';
var u = require('./util')
var isArray = Array.isArray
function isFunction (f) {
return 'function' === typeof f
}
function join (str) {
return Array.isArray(str) ? str.join('.') : str
}
function toArray(str) {
return isArray(str) ? str : str.split('.')
}
function isPerms (p) {
return (
p &&
isFunction(p.pre) &&
isFunction(p.test) &&
isFunction(p.post)
)
}
/*
perms:
a given capability may be permitted to call a particular api.
but only if a perms function returns true for the arguments
it passes.
suppose, an app may be given access, but may only create functions
with it's own properties.
create perms:
{
allow: ['add', 'query'], deny: [...],
rules: {
add: {
call: function (value) {
return (value.type === 'task' || value.type === '_task')
},
query: {
call: function (value) {
safe.contains(value, {path: ['content', 'type'], eq: 'task'}) ||
safe.contains(value, {path: ['content', 'type'], eq: '_task'})
},
filter: function (value) {
return (value.type === 'task' || value.type === '_task')
}
}
}
}
*/
module.exports = function (opts) {
if(isPerms(opts)) return opts
if(isFunction(opts)) return {pre: opts}
var allow = null
var deny = {}
function perms (opts) {
if(opts.allow) {
allow = {}
opts.allow.forEach(function (path) {
u.set(allow, toArray(path), true)
})
}
else allow = null
if(opts.deny)
opts.deny.forEach(function (path) {
u.set(deny, toArray(path), true)
})
else deny = {}
return this
}
if(opts) perms(opts)
perms.pre = function (name, args) {
name = isArray(name) ? name : [name]
if(allow && !u.prefix(allow, name))
return new Error('method:'+name + ' is not on whitelist')
if(deny && u.prefix(deny, name))
return new Error('method:'+name + ' is on blacklist')
}
perms.post = function (err, value) {
//TODO
}
//alias for pre, used in tests.
perms.test = function (name, args) {
return perms.pre(name, args)
}
perms.get = function () {
return {allow: allow, deny: deny}
}
return perms
}
|
// @flow
// Imports
// ==========================================================================
import StdlibPath from 'path';
import _untildify from 'untildify';
import _tildify from 'tildify';
import _ from '//src/nodash';
import match from '//src/match';
// Types
// ==========================================================================
import type { $Refinement, $Reify } from 'tcomb';
import t from 'tcomb';
// Path Types
// --------------------------------------------------------------------------
// ### Normalized Path
/** @private */
function isNormalized(path: string): boolean {
return (
(
path === '.'
) || (
path === '/'
) || (
path !== '' && _.every(
path.split(StdlibPath.sep),
(seg, index, segs) => {
return (
seg !== '..'
) && (
seg !== '.'
) && (
index === 0 || index === segs.length - 1 || seg !== ''
);
}
)
)
);
}
/**
* A normalized path is a path that is either:
*
* - Exactly `.`.
* - Has no `.`, `..` or empty segments.
*
* Intended to represent the return type of [path.normalize][].
*
* [path.normalize]: https://nodejs.org/api/path.html#path_path_normalize_path
*
* @typedef {string} NormPath
*/
export type NormPath = string & $Refinement<typeof isNormalized>;
/**
* tcomb type for {@link NormPath}.
*
* @type {Type}
*/
export const tNormPath = (({}: any): $Reify<NormPath>);
// ### Absolute Path
/**
* An absolute path, per Node's [path.isAbsolute][],
* which returns `false` for tilde paths (`~/...`).
*
* [path.isAbsolute]: https://nodejs.org/api/path.html#path_path_isabsolute_path
*
* @typedef {string} AbsPath
*/
export type AbsPath = string & $Refinement<typeof StdlibPath.isAbsolute>;
/**
* tcomb type for {@link AbsPath}.
*
* @type {Type}
*/
export const tAbsPath = (({}: any): $Reify<AbsPath>);
// ### Resolved Path
/**
* A resolved path is a path that is absolute and normalized, as returned from
* Node's [path.resolve][].
*
* [path.resolve]: https://nodejs.org/api/path.html#path_path_resolve_path
*
* @typedef {string} ResPath
*/
export type ResPath = AbsPath & NormPath;
/**
* tcomb type for {@link ResPath}.
*
* @type {Type}
*/
export const tResPath = (({}: any): $Reify<ResPath>);
// ### Tilde Path
/** @private */
function isTildePath(path: string): boolean {
return path[0] === '~';
}
/**
* A tilde path is a string that starts with '~', which we interpret like the
* shell to mean the current user's home directory.
*
* @typedef {string} TildePath
*/
export type TildePath = string & $Refinement<typeof isTildePath>;
/**
* tcomb type for {@link TildePath}.
*
* @type {Type}
*/
export const tTildePath = (({}: any): $Reify<TildePath>);
/**
* A path that can be absolute - either {@link AbsPath} or {@link TildePath}.
*
* @typedef {AbsPath|TildePath} AbsOrTildePath
*/
export type AbsOrTildePath = AbsPath | TildePath;
/**
* tcomb type for {@link AbsOrTildePath}.
*
* @type {Type}
*/
export const tAbsOrTildePath = (({}: any): $Reify<AbsOrTildePath>);
// ### Path Segment
/** @private */
function isPathSegment(str: string): boolean {
return str.indexOf(StdlibPath.sep) === -1;
}
/**
* A piece of a path... which is a string that doesn't have the path
* separator character in it.
*
* @typedef {string} PathSegment
*/
export type PathSegment = string & $Refinement<typeof isPathSegment>;
/**
* tcomb type for {@link PathSegment}.
*
* @type {Type}
*/
export const tPathSegment = (({}: any): $Reify<PathSegment>);
/**
* Many pieces of paths.
*
* @typedef {Array<string>} PathSegments
*/
export type PathSegments = Array<PathSegment>;
/**
* tcomb type for {@link PathSegments}.
*
* @type {Type}
*/
export const tPathSegments = (({}: any): $Reify<PathSegments>);
// Directory Types
// --------------------------------------------------------------------------
// ### Directory Path
/** @private */
function isDirStr(path: string): boolean {
const last = _.last(split(path));
return (
last === ''
) || (
last === '.'
) || (
last === '..'
);
} // isDirStr()
/**
* A path that we know is a directory because it's last segment
* is empty, `.` or `..`.
*
* @typedef {string} Dir
*/
export type Dir = string & $Refinement<typeof isDirStr>;
/**
* tcomb type for {@link Dir}.
*
* @type {Type}
*/
export const tDir = (({}: any): $Reify<Dir>);
// ### Normalized Directory Path
/**
* A normalized directory - a {@link Dir} that is also a {@link NormPath}.
*
* @typedef {string} NormDir
*/
export type NormDir = Dir & NormPath;
/**
* tcomb type for {@link NormDir}.
*
* @type {Type}
*/
export const tNormDir = (({}: any): $Reify<NormDir>);
// ### Absolute Directory Path
/**
* An absolute directory - a {@link Dir} that is also a {@link AbsPath}.
*
* @typedef {string} AbsDir
*/
export type AbsDir = Dir & AbsPath;
/**
* tcomb type for {@link AbsDir}.
*
* @type {Type}
*/
export const tAbsDir = (({}: any): $Reify<AbsDir>);
// ### Resolved Directory Path
/**
* An resolved directory - a {@link Dir} that is also a {@link ResPath}.
*
* @typedef {string} ResDir
*/
export type ResDir = Dir & ResPath;
/**
* tcomb type for {@link ResDir}.
*
* @type {Type}
*/
export const tResDir = (({}: any): $Reify<ResDir>);
// ### Tilde (~) Directory Path
/**
* A directory relative to the user's home via starting with `~` -
* a {@link Dir} that is also a {@link TildePath}.
*
* @typedef {string} TildeDir
*/
export type TildeDir = Dir & TildePath;
/**
* tcomb type for {@link TildeDir}.
*
* @type {Type}
*/
export const tTildeDir = (({}: any): $Reify<TildeDir>);
// Exports
// ==========================================================================
// re-export everything from stdlib path
export * from 'path';
// export the tildify and untildify functions
export const untildify = _untildify;
export const tildify = _tildify;
/**
* Split a path by the system path separator.
*/
export function split(path: string): PathSegments {
return path.split(StdlibPath.sep);
}
/**
* Like {@link Path.resolve} but it expands tilde paths to the user's home
* directory.
*
* @param {...string} paths
* Paths to expand. Joins them from last backwards until am absolute path is
* formed, otherwise assumes relative to {@link process.cwd}.
*
* @return {ResPath}
* Resolved (absolute) path.
*/
export function expand(...paths: Array<string>): ResPath {
return StdlibPath.resolve(..._.map(paths, p => untildify(p)));
}
/**
* @deprecated Old name for {@link expand}.
*/
export const absolute = expand;
/**
* Find the common base path. Expands paths before comparison, and doesn't
* consider '/' to be common because it is shared between *all* unix-y file
* paths, making it a bit pointless.
*/
export function commonBase(...paths: Array<string>): ?ResPath {
const splits = _.map(paths, (path: string): PathSegments => {
return split(expand(path))
});
const common = _.reduce(
splits,
(common: PathSegments, segments: PathSegments): PathSegments => {
// short ciruit if we already know we can't match anything more
if (common.length === 0) {
return common;
}
let i = 0;
const max = Math.max(common.length, segments.length);
while (common[i] === segments[i] && i < max) { i++; }
// short-circuit copy if it matched the whole thing
if (i === common.length) {
return common;
}
return common.slice(0, i);
}
);
if (common.length > 1) {
return StdlibPath.join('/', ...common);
}
} // commonBase()
/**
* Make a path string into a {@link Dir} by appending `/` to it if needed.
*
* @param {...string} paths
* Paths to join then convert.
*
* @return {Dir}
* Directory string.
*/
export function toDir(...paths: Array<string>): Dir {
const joined = StdlibPath.join(...paths);
if (tDir.is(joined)) {
return joined;
}
return tDir(joined + '/');
} // .toDir()
/**
* Join paths and convert to {@link AbsPath} by calling `untildify` if
* it's a {@link TildePath}.
*
* @param {...string} paths
* String path segments.
*
* @return {AbsPath}
* Absolute path.
*
* @throws {TypeError}
* If the joined path is not an {@link AbsPath} or {@link TildePath}.
*/
export function toAbsPath(...paths: Array<string>): AbsPath {
const joined = tAbsOrTildePath(StdlibPath.join(...paths));
if (tTildePath.is(joined)) {
return untildify(joined)
}
return joined;
} // #toAbsPath()
/**
* Join paths and convert to an {@link AbsDir} by calling {@link toDir}
* and {@link toAbsPath} on them.
*
* @param {...string} paths
* String path segments.
*
* @return {AbsDir}
* Absolute directory path.
*
* @throws {TypeError}
* If the joined path is not an {@link AbsPath} or {@link TildePath}.
*/
export function toAbsDir(...paths: Array<string>): AbsDir {
return toDir(toAbsPath(...paths));
} // #toAbsDir()
/**
* Join paths and convert to a {@link ResDir}.
*
* @param {...string} paths
* String path segments.
*
* @return {ResDir}
* Resolved (normalized) absolute directory path.
*
* @throws {TypeError}
* If the joined path is not an {@link AbsPath} or {@link TildePath}.
*/
export function toResDir(...paths: Array<AbsPath | TildePath>): ResDir {
return StdlibPath.normalize(toAbsDir(...paths));
}
/**
* Resolve paths and apply {@link toDir} to the results to get a {@link ResDir}.
*
* **NOTICE**
*
* Unless you explicitly *don't* want tilde (`~/...`) expansion you probably
* want to use {@link expandDir}, which expands paths that start with `~` to
* the current user's home directory.
*
* @param {...string} paths
* Paths to resolve.
*
* @return {ResDir}
* Resolved directory path.
*/
export function resolveDir(...paths: Array<string>): ResDir {
return tResDir(toDir(StdlibPath.resolve(...paths)));
}
/**
* Expand paths and apply {@link toDir} to the results to get a {@link ResDir}.
*
* @param {...string} paths
* Paths to expand.
*
* @return {ResDir}
* Expanded directory path.
*/
export function expandDir(...paths: Array<string>): ResDir {
return tResDir(toDir(expand(...paths)));
}
|
/*================================================*\
* Author : Attaphon WongBuatong
* Created Date : 28/11/2014 10:51
* Module : script
* Description : javascript
* Involve People : zeroline
* Last Updated : 28/11/2014 10:51
\*================================================*/
/*================================================*\
:: FUNCTION ::
\*================================================*/
me.ViewHeader=function(){
me.ViewSetHeader([
// {display:'สาขา', name:'branch_code', type:'cbo', option:false},
// {display:'Bet ระหว่างวันที่', name:'date_start', cls:'dpk', guide:'00/00/0000'},
// {display:'ถึงวันที่', name:'date_stop', cls:'dpk', guide:'00/00/0000'}
]);
};
me.CheckData=function(){
var codename = $('#codename').val();
var myData = {
codename : codename
};
$.ajax({
url:me.url+'?mode=CheckData&mod='+me.mod,
type:'POST',
dataType:'json',
cache: false,
data:myData,
success:function(data){
switch(data.success){
case 'COMPLETE' :
$('#name').val(data.name);
$('#tel').val(data.tel);
$('#web1 option').remove();
$('#web2 option').remove();
// $('#lyWebDetail').text('');
// $(data.web).each(function(i, attr){
// me.LoadAppendWeb(attr);
// });
$('<option>').attr('value', '').text('++ เลือกเว็บ ++').appendTo('#web1');
$('<option>').attr('value', '').text('++ เลือกเว็บ ++').appendTo('#web2');
$.each(data.web, function(i, result) {
$('<option>').attr('value', result.code).text('[ '+result.web_code+' ] '+result.user).appendTo('#web1');
$('<option>').attr('value', result.code).text('[ '+result.web_code+' ] '+result.user).appendTo('#web2');
});
break;
case 'NOTFOUND' :
me.MsgDanger('ไม่พบข้อมูลในระบบ!', 3);
break;
default :
me.MsgDanger(data.msg, 3);
break;
}
}
});
};
me.LoadAppendWeb=function(data){
var html = '';
html += '<tr id="detail_{time}" class="webdata" rel="{code}">';
html += ' <td class="text-center" class="descno">{no}</td>';
html += ' <td class="web_codedata text-center">{web_code}</td>';
html += ' <td class="userdata text-center">{user}<input type="hidden" class="ref_code" value="{code}"></td>';
html += ' <td class="amountdata text-center"><input type="text" class="form-control input-sm amount" placeholder="จำนวนเงิน" value=""></td>';
html += '</tr>';
var time = new Date().getTime();
html = html.split('{code}').join(data.code);
html = html.split('{time}').join(time);
html = html.split('{no}').join($('.webdata').length+1);
html = html.split('{web_code}').join(data.web_code);
html = html.split('{user}').join(data.user);
html = html.split('{amount}').join('');
$('#lyWebDetail').append(html);
};
me.ClearData=function(){
$('input').val('');
$('select').val('');
$('#enable').prop('checked', true);
$('#lyWebDetail').text('');
};
me.SaveTransection=function(){
if($('#codename').val() == ""){
alert('กรุณาใส่ Code Name!');
$('#codename').focus()
return false;
}
if($('#amount').val() == ""){
alert('กรุณาใส่ จำนวนเงิน!');
$('#amount').focus()
return false;
}
if($('#web1').val() == ""){
alert('กรุณาเลือก โยกจากเว็บ');
$('#web1').focus()
return false;
}
if($('#web2').val() == ""){
alert('กรุณาเลือก ไปยังเว็บ');
$('#web2').focus()
return false;
}
if($('#timeh').val() == ""){
alert('กรุณาเลือก ชั่วโมง');
$('#timeh').focus()
return false;
}
if($('#timem').val() == ""){
alert('กรุณาเลือก นาที');
$('#timem').focus()
return false;
}
var myData = {
data : ft.LoadForm('mydata')
};
$.ajax({
url:me.url+'?mode=SaveTransection&mod='+me.mod,
type:'POST',
dataType:'json',
cache: false,
data:myData,
success:function(data){
switch(data.success){
case 'COMPLETE' :
me.ClearData();
me.MsgSuccess(data.msg, 1.5);
break;
default :
me.MsgDanger(data.msg, 3);
break;
}
}
});
};
/*================================================*\
:: DEFAULT ::
\*================================================*/
$(document).ready(function(){
me.SetUrl();
me.ViewHeader();
me.SetDate();
});
|
<script>jQuery.noConflict();</script>
<script type="text/javascript">
Event.observe(document,"dom:loaded", function() {
</script>
<script>
var modal1 = document.getElementById("academicSupportModal");
var btn1 = document.getElementById("fusdiv1");
var span1 = document.getElementsByClassName("close")[0];
if (document.body.contains(btn1)){
btn1.onclick = function(){
modal1.style.display = "block";
}
}
span1.onclick = function(){
modal1.style.display = "none";
}
var modal2 = document.getElementById("announcementsModal");
var btn2 = document.getElementById("fusdiv2");
var span2 = document.getElementsByClassName("close")[1];
if (document.body.contains(btn2)){
btn2.onclick = function(){
modal2.style.display = "block";
}
}
span2.onclick = function(){
modal2.style.display = "none";
}
var modal3 = document.getElementById("discussionsModal");
var btn3 = document.getElementById("fusdiv3");
var span3 = document.getElementsByClassName("close")[2];
if (document.body.contains(btn3)){
btn3.onclick = function(){
modal3.style.display = "block";
}
}
span3.onclick = function(){
modal3.style.display = "none";
}
var modal4 = document.getElementById("emailModal");
var btn4 = document.getElementById("fusdiv4");
var span4 = document.getElementsByClassName("close")[3];
if (document.body.contains(btn4)){
btn4.onclick = function(){
modal4.style.display = "block";
}
}
span4.onclick = function(){
modal4.style.display = "none";
}
var modal5 = document.getElementById("learningSessionsModal");
var btn5 = document.getElementById("fusdiv5");
var span5 = document.getElementsByClassName("close")[4];
if (document.body.contains(btn5)){
btn5.onclick = function(){
modal5.style.display = "block";
}
}
span5.onclick = function(){
modal5.style.display = "none";
}
var modal6 = document.getElementById("facultyModal");
var btn6 = document.getElementById("fusdiv6");
var span6 = document.getElementsByClassName("close")[5];
if (document.body.contains(btn6)){
btn6.onclick = function(){
modal6.style.display = "block";
}
}
span6.onclick = function(){
modal6.style.display = "none";
}
var modal7 = document.getElementById("gradebookModal");
var btn7 = document.getElementById("fusdiv7");
var span7 = document.getElementsByClassName("close")[6];
if (document.body.contains(btn7)){
btn7.onclick = function(){
modal7.style.display = "block";
}
}
span7.onclick = function(){
modal7.style.display = "none";
}
var modal8 = document.getElementById("homeModal");
var btn8 = document.getElementById("fusdiv8");
var span8 = document.getElementsByClassName("close")[7];
if (document.body.contains(btn8)){
btn8.onclick = function(){
modal8.style.display = "block";
}
}
span8.onclick = function(){
modal8.style.display = "none";
}
var modal9 = document.getElementById("supportModal");
var btn9 = document.getElementById("fusdiv9");
var span9 = document.getElementsByClassName("close")[8];
if (document.body.contains(btn9)){
btn9.onclick = function(){
modal9.style.display = "block";
}
}
span9.onclick = function(){
modal9.style.display = "none";
}
var modal10 = document.getElementById("papersModal");
var btn10 = document.getElementById("fusdiv10");
var span10 = document.getElementsByClassName("close")[9];
if (document.body.contains(btn10)){
btn10.onclick = function(){
modal10.style.display = "block";
}
}
span10.onclick = function(){
modal10.style.display = "none";
}
var modal11 = document.getElementById("projectsModal");
var btn11 = document.getElementById("fusdiv11");
var span11 = document.getElementsByClassName("close")[10];
if (document.body.contains(btn11)){
btn11.onclick = function(){
modal11.style.display = "block";
}
}
span11.onclick = function(){
modal11.style.display = "none";
}
var modal12 = document.getElementById("examsModal");
var btn12 = document.getElementById("fusdiv12");
var span12 = document.getElementsByClassName("close")[11];
if (document.body.contains(btn12)){
btn12.onclick = function(){
modal12.style.display = "block";
}
}
span12.onclick = function(){
modal12.style.display = "none";
}
var modal13 = document.getElementById("blogsModal");
var btn13 = document.getElementById("fusdiv13");
var span13 = document.getElementsByClassName("close")[12];
if (document.body.contains(btn13)){
btn13.onclick = function(){
modal13.style.display = "block";
}
}
span13.onclick = function(){
modal13.style.display = "none";
}
var modal14 = document.getElementById("journalsModal");
var btn14 = document.getElementById("fusdiv14");
var span14 = document.getElementsByClassName("close")[13];
if (document.body.contains(btn14)){
btn14.onclick = function(){
modal14.style.display = "block";
}
}
span14.onclick = function(){
modal14.style.display = "none";
}
window.onclick = function(event){
if (modal1.style.display == "block" && event.target == modal1){
modal1.style.display = "none";
}
if (modal2.style.display == "block" && event.target == modal2){
modal2.style.display = "none";
}
if (modal3.style.display == "block" && event.target == modal3){
modal3.style.display = "none";
}
if (modal4.style.display == "block" && event.target == modal4){
modal4.style.display = "none";
}
if (modal5.style.display == "block" && event.target == modal5){
modal5.style.display = "none";
}
if (modal6.style.display == "block" && event.target == modal6){
modal6.style.display = "none";
}
if (modal7.style.display == "block" && event.target == modal7){
modal7.style.display = "none";
}
if (modal8.style.display == "block" && event.target == modal8){
modal8.style.display = "none";
}
if (modal9.style.display == "block" && event.target == modal9){
modal9.style.display = "none";
}
if (modal10.style.display == "block" && event.target == modal10){
modal10.style.display = "none";
}
if (modal11.style.display == "block" && event.target == modal11){
modal11.style.display = "none";
}
if (modal12.style.display == "block" && event.target == modal12){
modal12.style.display = "none";
}
if (modal13.style.display == "block" && event.target == modal13){
modal13.style.display = "none";
}
if (modal14.style.display == "block" && event.target == modal14){
modal14.style.display = "none";
}
}
</script>
|
$(document).ready(() => {
if(localStorage.getItem('login')){
$(location).attr('href','./orders.html');
}
$('#login-hit').click((e) =>{
e.preventDefault();
if(($('#user-name').val() == $('#user-password').val()) && $('#user-name').val()){
window.alert('Login Successfully');
localStorage.setItem('login', $('#user-name').val())
if(localStorage.getItem('login')){
$(location).attr('href','./orders.html');
}
}else if(!($('#user-name').val() == $('#user-password').val())){
window.alert('Please Enter Valid Credential')
}
});
})
|
import types from './constants';
import API from '../../api';
function formatFilm(film) {
const formattedUsers = film.Users.reduce((result, user) => {
const buf = result;
const { Rating, ...restUser } = user;
buf.Users.push({
...restUser,
rate: Rating.rate,
});
buf.rating += Rating.rate;
return buf;
}, {
Users: [],
rating: 0,
});
return {
...film,
Users: formattedUsers.Users,
rating: formattedUsers.rating / formattedUsers.Users.length,
};
}
const getById = (filmId) => async (dispatch) => {
dispatch({ type: types.FETCH_PENDING });
try {
const { data: film } = await API.getFilmById(filmId);
dispatch({
type: types.FETCH_SUCCESS,
payload: {
order: [],
data: {
[film.id]: formatFilm(film),
},
},
});
} catch (error) {
dispatch({ type: types.FETCH_ERROR, payload: error });
}
};
const fetchFilms = () => async (dispatch) => {
dispatch({ type: types.FETCH_PENDING });
try {
const { data } = await API.fetchFilms();
dispatch({
type: types.FETCH_SUCCESS,
payload: {
...data.reduce((result, film) => {
const buf = result;
buf.order.push(film.id);
buf.data[film.id] = film;
return buf;
}, {
order: [],
data: {},
}),
},
});
} catch (error) {
dispatch({ type: types.FETCH_ERROR, payload: error });
}
};
const rateFilm = (filmId, rate) => async (dispatch, getState) => {
const state = getState();
dispatch({ type: types.FETCH_PENDING });
const userId = state.auth.user.id;
try {
const { data } = await API.rateFilm(userId, filmId, rate);
const formattedFilm = formatFilm(data);
dispatch({
type: types.FETCH_SUCCESS,
payload: {
order: [],
data: {
[formattedFilm.id]: formattedFilm,
},
},
});
} catch (error) {
dispatch({ type: types.FETCH_ERROR, payload: error });
}
};
export default {
getById,
fetchFilms,
rateFilm,
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.