code stringlengths 2 1.05M | repo_name stringlengths 5 114 | path stringlengths 4 991 | language stringclasses 1 value | license stringclasses 15 values | size int32 2 1.05M |
|---|---|---|---|---|---|
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'sourcearea', 'he', {
toolbar: 'מקור'
} );
| otto-torino/gino | ckeditor/plugins/sourcearea/lang/he.js | JavaScript | mit | 247 |
(function() {
/*
jQuery stepout plugin v1.1
- carousel with zooming effect
(c) 2011 Matthias Schmidt <http://m-schmidt.eu/>
Example Usage:
$('#stepout').stepout();
Options:
**auto** (optional, defaults to true) - whether animation should run automatically.
**pause** (optional, defaults to 3500) - how log to wait between automatic animation moves.
**bigWidth** (optional, defaults to 500) - width in pixel for the focused image
**bigOffset** (optional, defaults to 100) - offset for positioning the focused image
*/
var $;
$ = jQuery;
$.fn.stepout = function(options) {
options = $.extend({
auto: true,
pause: 3500,
bigWidth: 500,
bigOffset: 100
}, options || {});
return this.each(function() {
var $items, $self, $single, auto_handler, focus, focus_item, focus_item_delta, getCentralItem, move, next, position, prev, singleWidth, startAuto, stopAuto, totalWidth, unfocus;
$self = $(this);
$self.addClass('jquery-stepout-wrapper');
$items = $self.find('li');
$single = $items.filter(':first');
singleWidth = $single.outerWidth(true);
totalWidth = $items.length * singleWidth;
$self.css('width', totalWidth);
$items.first().before($items.clone().addClass('clone'));
$items.last().after($items.clone().addClass('clone'));
$items = $self.find('li');
$self.scrollLeft(totalWidth - singleWidth);
position = -1;
focus_item = null;
focus_item_delta = null;
getCentralItem = function() {
var central_item_index;
central_item_index = Math.ceil($self.scrollLeft() / singleWidth + 1);
return $items.filter(":nth(" + central_item_index + ")").find('img');
};
unfocus = function() {
return $('.jquery-stepout-focused').animate({
left: '+=' + focus_item_delta.left,
top: '+=' + focus_item_delta.top,
width: $single.width()
}, 300, function() {
$(this).remove();
return focus_item = null;
});
};
focus = function(central_item) {
central_item || (central_item = getCentralItem());
$self.trigger('focus_start', central_item);
focus_item = central_item.clone();
focus_item.css({
position: 'absolute',
left: central_item.position().left + $self.scrollLeft(),
top: central_item.position().top
});
focus_item.addClass('jquery-stepout-focused');
$self.append(focus_item);
focus_item_delta = {
left: (options.bigWidth - singleWidth) / 2,
top: options.bigOffset
};
return focus_item.animate({
left: '-=' + focus_item_delta.left,
top: '-=' + focus_item_delta.top,
width: options.bigWidth
}, 300);
};
getCentralItem().load(function() {
return focus($(this));
});
move = function(direction) {
var scroll_inc;
$self.trigger('move');
if (direction === 'next') {
scroll_inc = 1;
$self.trigger('next');
} else {
scroll_inc = -1;
$self.trigger('prev');
}
if (focus_item) focus_item.remove();
return $self.filter(':not(:animated)').animate({
scrollLeft: (position + 3 + scroll_inc) * singleWidth
}, 300, function() {
position += scroll_inc;
if (position === -3 || position === 3) {
$self.scrollLeft(totalWidth);
position = 0;
}
return focus();
});
};
next = function() {
if (focus_item) {
unfocus();
setTimeout(function() {
return move('next');
}, 300);
} else {
move('next');
}
};
prev = function() {
if (focus_item) {
unfocus();
return setTimeout(function() {
return move('prev');
}, 300);
} else {
return move('prev');
}
};
$self.find('a').click(function(e) {
e.preventDefault();
if (!focus_item) return;
if ($(this).offset().left > focus_item.offset().left) {
return next();
} else {
return prev();
}
});
if (options.auto) {
auto_handler = null;
startAuto = function() {
if (!auto_handler) {
return auto_handler = setInterval(next, options.pause);
}
};
stopAuto = function() {
clearInterval(auto_handler);
return auto_handler = null;
};
startAuto();
$items.mouseenter(function(e) {
return stopAuto();
});
return $items.mouseout(function(e) {
return startAuto();
});
}
});
};
}).call(this);
| MSchmidt/jquery-stepout | js/jquery.stepout.js | JavaScript | mit | 4,882 |
/**
* @fileoverview twitter
* @name twitter.js
* @author Yoshiya Ito <myon53@gmail.com>
*/
import _ from 'lodash';
import Twit from 'twit';
import config from '../config';
export default class Twitter {
constructor() {
console.log(config);
this.client = new Twit(config.TWITTER_CONFIG);
this.tweets = [];
}
/**
* fetch twitter timeline asyncronoucely(recursive)
* @method fetchTimeline
* @param {Number} all tweets count
* @return {Array} tweets
*/
async fetchTimeline(maxCount, maxId) {
if ((maxCount) <= 0) {
return;
}
const tweets = await this.client.get(
'statuses/user_timeline', { screen_name: '', count: config.TWITTER_CONFIG.count, max_id: maxId },
);
const lastTweet = _.last(tweets.data);
if (_.isEmpty(lastTweet)) {
return;
}
const lastId = lastTweet.id;
const nextCount = maxCount - config.TWITTER_CONFIG.count;
this.tweets = _.concat(tweets.data, await this.fetchTimeline(nextCount, lastId));
}
/**
* @method makeHistogram
* @param {Array} tweets
* @return {Object}
*/
makeHistogram() {
return _.chain(this.tweets)
.countBy((tweet) => {
const date = _.split(tweet.created_at, ' ');
return _.last(date) + config.MONTH2NUM[date[1]] + date[2];
})
.map((count, day) => ({ day: _.toInteger(day), count }))
.sortBy(v => (v.day))
.value();
}
}
| yoshiya0503/third-eye | lib/twitter.js | JavaScript | mit | 1,417 |
// Generated by CoffeeScript 1.4.0
(function() {
var noDispose, noop, sx,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
sx = window.sx = {
utils: {},
internal: {},
binders: {}
};
noop = function() {};
noDispose = {
dispose: noop
};
sx.utils.bind = function(obsOrValue, callback) {
if (obsOrValue.subscribe) {
return obsOrValue.subscribe(callback);
}
callback(obsOrValue);
return noDispose;
};
sx.utils.wrap = function(valueOrBehavior) {
if (typeof valueOrBehavior.subscribe === 'function') {
return valueOrBehavior;
}
return new Rx.BehaviorSubject(valueOrBehavior);
};
sx.utils.parseBindingOptions = function(param, options) {
var key, value;
if (options == null) {
options = {};
}
if (typeof param === 'function' || param.onNext || param.subscribe) {
options.source = param;
return options;
}
for (key in param) {
value = param[key];
options[key] = value;
}
return options;
};
sx.utils.toJS = function(obj) {
return JSON.stringify(obj, function(s, field) {
if (field instanceof sx.ObservableArray) {
return field.values;
}
if (field instanceof Rx.Observable) {
return field.value;
}
if (field instanceof Rx.Observer) {
return void 0;
}
return field;
});
};
sx.utils.unwrap = function(valueOrBehavior) {
if (valueOrBehavior.value && valueOrBehavior.subscribe) {
return valueOrBehavior.value;
}
return valueOrBehavior;
};
sx.bind = function(vm, target) {
target = $(target || window.document.body);
return sx.internal.bind(target, {
vm: vm,
vmRoot: vm,
vmParent: void 0
});
};
sx.computed = function(options) {
var key, keys, source, value, values, _ref;
keys = [];
values = [];
_ref = options.params;
for (key in _ref) {
value = _ref[key];
keys.push(key);
values.push(sx.utils.wrap(value));
}
source = sx.utils.combineLatest(values).select(function(values) {
var i, params, _i, _len;
params = {};
for (i = _i = 0, _len = keys.length; _i < _len; i = ++_i) {
key = keys[i];
params[key] = values[i];
}
return params;
});
return Rx.Observable.create(function(o) {
return source.select(options.read).subscribe(o);
});
};
sx.internal.bind = function(target, context) {
var binder, bindings, disposable, options;
bindings = sx.internal.parseBindings(target, context);
disposable = new Rx.CompositeDisposable;
for (binder in bindings) {
options = bindings[binder];
disposable.add(sx.binders[binder](target, context, options));
}
target.children().each(function() {
return disposable.add(sx.internal.bind($(this), context));
});
return disposable;
};
sx.ObservableArray = (function(_super) {
__extends(ObservableArray, _super);
function ObservableArray(items) {
var item, _i, _len;
if (items == null) {
items = [];
}
ObservableArray.__super__.constructor.apply(this, arguments);
this.values = [];
this.lifetimes = [];
for (_i = 0, _len = items.length; _i < _len; _i++) {
item = items[_i];
this.push(item);
}
}
ObservableArray.prototype.push = function(value) {
var lifetime;
this.values.push(value);
this.lifetimes.push(lifetime = new Rx.BehaviorSubject(value));
this.onNext(lifetime);
return value;
};
ObservableArray.prototype.remove = function(value) {
var index;
index = this.values.indexOf(value);
if (index === -1) {
console.log(index);
}
return this.splice(index, 1);
};
ObservableArray.prototype.splice = function() {
var lifetime, removed, _i, _len, _results;
Array.prototype.splice.apply(this.values, arguments);
removed = Array.prototype.splice.apply(this.lifetimes, arguments);
_results = [];
for (_i = 0, _len = removed.length; _i < _len; _i++) {
lifetime = removed[_i];
_results.push(lifetime.onCompleted());
}
return _results;
};
ObservableArray.prototype.subscribe = function(observerOrOnNext) {
var lifetime, subscription, _i, _len, _ref;
subscription = ObservableArray.__super__.subscribe.apply(this, arguments);
this.purge();
observerOrOnNext = arguments.length > 1 || typeof observerOrOnNext === 'function' ? observerOrOnNext : observerOrOnNext.onNext;
_ref = this.lifetimes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
lifetime = _ref[_i];
observerOrOnNext(lifetime);
}
return subscription;
};
ObservableArray.prototype.purge = function() {
var lifetime, _i, _len, _ref, _results;
_ref = this.lifetimes;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
lifetime = _ref[_i];
if (lifetime.isCompleted) {
_results.push(this.remove(lifetime));
}
}
return _results;
};
ObservableArray.prototype.dispose = function() {
var lifetime, _i, _len, _ref, _results;
_ref = this.lifetimes;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
lifetime = _ref[_i];
_results.push(lifetime.onCompleted());
}
return _results;
};
return ObservableArray;
})(Rx.Subject);
sx.internal.parseBindings = function(target, context) {
var binding, key, keys, value, values, _ref;
binding = target.attr('data-splash');
if (!binding) {
return null;
}
keys = ['$data', '$root', '$parent'];
values = [context.vm, context.vmRoot, context.vmParent];
_ref = context.vm;
for (key in _ref) {
value = _ref[key];
keys.push(key);
values.push(value);
}
return new Function(keys, "return { " + binding + " };").apply(null, values);
};
sx.binders.checked = function(target, context, obsOrValue) {
var get, observer, set;
if (obsOrValue.onNext) {
observer = obsOrValue;
get = target.onAsObservable('change').select(function() {
return target.prop('checked');
}).subscribe(function(x) {
observer.onNext(x);
});
}
set = sx.utils.bind(obsOrValue, function(x) {
target.prop('checked', x);
});
return new Rx.CompositeDisposable(get, set);
};
sx.binders.attr = function(target, context, options) {
var disposable, key, obsOrValue, _fn, _i, _len;
disposable = new Rx.CompositeDisposable;
_fn = function() {
var attr;
attr = key;
return disposable.add(sx.utils.bind(obsOrValue, function(x) {
target.attr(attr, x);
}));
};
for (obsOrValue = _i = 0, _len = options.length; _i < _len; obsOrValue = ++_i) {
key = options[obsOrValue];
_fn();
}
return disposable;
};
sx.binders.click = function(target, context, options) {
return sx.binders.event(target, context, options, 'click', true);
};
sx.binders.css = function(target, context, options) {
var disposable, key, obsOrValue, _fn;
disposable = new Rx.CompositeDisposable;
_fn = function() {
var css;
css = key;
return disposable.add(sx.utils.bind(obsOrValue, function(x) {
target.toggleClass(css, x);
}));
};
for (key in options) {
obsOrValue = options[key];
_fn();
}
return disposable;
};
sx.binders.event = function(target, context, options, type) {
var obs;
if (type == null) {
type = options.type;
}
obs = $(target).onAsObservable(type);
if (typeof options === 'function') {
return obs.subscribe(function(e) {
options({
target: target,
context: context,
e: e
});
});
}
return obs.subscribe(function(e) {
options.onNext({
target: target,
context: context,
e: e
});
});
};
sx.binders.foreach = function(target, context, obsArray) {
var disposable, template;
template = target.html().trim();
target.empty();
disposable = new Rx.CompositeDisposable({
dispose: function() {
return target.empty().append(template);
}
});
setTimeout(function() {
disposable.add(obsArray.subscribe(function(lifetime) {
var binding, child, dispose, disposer, sub;
child = $(template).appendTo(target);
disposable.add(binding = sx.internal.bind(child, {
vm: lifetime.value,
vmRoot: context.vmRoot,
vmParent: context.vm
}));
dispose = function() {
child.remove();
disposable.remove(binding);
disposable.remove(sub);
disposable.remove(disposer);
};
disposable.add(disposer = {
dispose: dispose
});
disposable.add(sub = lifetime.subscribe(noop, dispose, dispose));
}));
});
return disposable;
};
sx.binders.html = function(target, context, obsOrValue) {
return sx.utils.bind(obsOrValue, function(x) {
target.html(x);
});
};
sx.binders.text = function(target, context, obsOrValue) {
return sx.utils.bind(obsOrValue, function(x) {
target.text(x);
});
};
sx.binders.value = function(target, context, options) {
var blur, focus, get, getObs, observer, set;
options = sx.utils.parseBindingOptions(options);
if (options.on && options.on.indexOf('after') === 0) {
options.on = options.on.slice(5);
options.delay = true;
}
if (typeof options.source.onNext === 'function') {
observer = options.source;
getObs = target.onAsObservable(options.on || 'change');
if (options.delay) {
getObs = getObs.delay(0);
}
get = getObs.select(function() {
return target.val();
}).subscribe(function(x) {
observer.onNext(x);
});
}
if (options.source instanceof Rx.Observable) {
focus = target.onAsObservable('focus');
blur = target.onAsObservable('blur');
options.source = options.source.takeUntil(focus).concat(blur.take(1)).repeat();
}
set = sx.utils.bind(options.source, function(x) {
target.val(x);
});
return new Rx.CompositeDisposable(get, set);
};
sx.binders.visible = function(target, context, options) {
return sx.utils.bind(obsOrValue, function(x) {
target.css(x ? '' : 'none');
});
};
}).call(this);
| cwharris/rxjs-splash | bin/rx.splash.js | JavaScript | mit | 10,880 |
/**
* The list of all functions inside creatine.
*
*
* ## Usage examples
*
* tine.wrapAngle(-20); // = 340
*
* tine.randInt(0, 20); // = 3
*
* tine.merge({b:6}, {a:5}); // {a:5, b:6}
*
*
* @module core functions
* @main core functions
*/
| renatopp/creatine | src/_docs/functions.js | JavaScript | mit | 277 |
import React, { Component } from 'react';
import { Container,List, Header, Title, Content, Button, Icon, IconNB, Card, CardItem, Text, Left, Right, Body, ListItem } from 'native-base';
import { View } from 'react-native'
import styles from '../../styles/socialBox';
import contacts from '../../../../mock/contacts'
import realm from '../../db_ini'
const _getContact = (contactId) => {
const contacts = realm.objects('User')
const searchResult = contacts.filtered(`userId = "${contactId}"`)
const recent_contact = searchResult[0]
return recent_contact
}
const _getMatchingData = (arr1,arr2) => {
arr1.prototype.diff = function(arr2) {
var ret = [];
for(var i in this) {
if(arr2.indexOf( this[i] ) > -1){
ret.push( this[i] );
}
}
return ret;
};
}
const renderData = (contactId) => {
const datas = contacts
const contact = _getContact(contactId)
return (
<View>
<List
dataArray={contact.publicSharedData[0].personalData} renderRow={data =>
<ListItem style={{backgroundColor:'white'}}>
<Text>{data.tagDescription}</Text>
<Right>
<Text>{data.tagText}</Text>
</Right>
</ListItem>
}
/>
</View>
)
}
const ConnectDetailPersonalDataBox = (props) => {
const datas = contacts
const {children} = props
return (
<View>
{renderData(children)}
</View>
)
}
export default ConnectDetailPersonalDataBox
| Florenz23/sangoo_04 | src/modules/connect/connectDetail/components/ConnectDetailPersonalDataBox.js | JavaScript | mit | 1,535 |
var cfg;
function form_init() {
$('#param-form, #vlc-form, #path-form, #config-form, .first-form').each(function (e) {
$(this).on('submit', function (e) {
e.preventDefault();
param_generic($(this));
});
});
}
function param_generic(form) {
var packet = $(form).serialize();
var btn_submit = $(form).find('button[type=submit]');
$(btn_submit).addClass("load");
$(btn_submit).prop("disabled", true);
$(form).find('.param-form-error').html('');
myPost("index.php", {m: "init", f: "params", p: packet}, function (data) {
setParams(data);
$(btn_submit).removeClass("load");
$(btn_submit).prop("disabled", false);
var btn_html = $(btn_submit).html();
$(btn_submit).html("Modifications effectuées <span class='fui-check'></span>");
setTimeout(function () {
$(btn_submit).html(btn_html);
}, 3000);
}, "json");
}
function setParams(_cfg) {
cfg = _cfg;
console.debug(cfg);
setAffichage(cfg['affichage']);
setTri(cfg['tri']);
if (!cfg['curseur_load']) {
$('body').removeClass('wait');
} else if ($.active > 0) {
$('body').addClass('wait');
}
if (cfg['bg_uni']) {
$('#all').addClass('bg_uni');
} else {
$('#all').removeClass('bg_uni');
}
} | Chnapy/Videotheque | js/form.js | JavaScript | mit | 1,190 |
var EventSource = require('eventsource');
var Twitter = require('twitter');
var LibhubClient = require('libhub');
var github = new LibhubClient();
var es = new EventSource('https://github-firehose.herokuapp.com/events');
var client = new Twitter({
consumer_key: process.env.CONSUMER_KEY,
consumer_secret: process.env.CONSUMER_SECRET,
access_token_key: process.env.ACCESS_TOKEN_KEY,
access_token_secret: process.env.ACCESS_TOKEN_SECRET
});
es.on('event', function(e) {
var data = JSON.parse(e.data)
if(data.type === 'PublicEvent'){
github.get(`/repos/${data.repo.name}`)
.then((repo) => {
var status = `${data.actor.login} just open sourced a repository: https://github.com/${data.repo.name}`
if (repo.language) status += ' #' + repo.language
client.post('statuses/update', {status: status}, function(error, tweet, response){
if (!error) {
console.log(tweet);
} else {
console.log(error);
};
});
});
}
});
| librariesio/justopensourced | index.js | JavaScript | mit | 1,002 |
/// <reference path="../tween/index.d.ts" />
import settings from '../settings';
import { node_plugins, alternative } from 'engine/registry';
import {
EventEmitter, Signal,
remove_items,
} from 'engine/dep/index';
import { TransformStatic, Transform, Point, Bounds, Rectangle } from 'engine/math/index';
import ObservablePoint from 'engine/math/ObservablePoint';
import Filter from 'engine/renderers/filters/Filter';
import { rgb2hex } from 'engine/utils/index';
let uid = 0;
/**
* @typedef DestroyOption
* @property {boolean} children if set to true, all the children will have their
* destroy method called as well. 'options' will be passed on to those calls.
* @property {boolean} [texture] Should it destroy the current texture of the sprite as well
* @property {boolean} [base_texture] Should it destroy the base texture of the sprite as well
*/
/**
* A Node2D represents a collection of display objects.
* It is the base class of all display objects that act as a container for other objects.
*
*```js
* let container = new Node2D();
* container.add_child(sprite);
* ```
*/
export default class Node2D extends EventEmitter {
constructor() {
super();
const self = this;
/**
* @private
* @type {Node2D}
*/
this.temp_node_2d_parent = null;
/**
* @type {number}
*/
this.id = uid++;
/**
* @type {string}
*/
this.name = '';
/**
* @type {string}
*/
this.type = 'Node2D';
/**
* @type {boolean}
*/
this.is_inside_tree = false;
/**
* @type {boolean}
*/
this.is_queued_for_deletion = false;
/**
* Nodes that will always keep identity transform if this is
* set to false.
*
* @type {boolean}
*/
this.has_transform = true;
/**
* @private
* @type {boolean}
*/
this.idle_process = false;
/**
* @private
* @type {boolean}
*/
this.physics_process = false;
this.is_physics_object = false;
// TODO: need to create Transform from factory
/**
* World transform and local transform of this object.
* This will become read-only later, please do not assign anything there unless you know what are you doing
*
* @type {TransformStatic}
*/
this.transform = new alternative.Transform();
/**
* The opacity of the object.
*
* @type {number}
*/
this.alpha = 1;
/**
* The visibility of the object. If false the object will not be drawn, and
* the update_transform function will not be called.
*
* Only affects recursive calls from parent. You can ask for bounds or call update_transform manually
*
* @type {boolean}
*/
this.visible = true;
/**
* Can this object be rendered, if false the object will not be drawn but the update_transform
* methods will still be called.
*
* Only affects recursive calls from parent. You can ask for bounds manually
*
* @type {boolean}
*/
this.renderable = true;
/**
* The display object container that contains this display object.
*
* @type {Node2D}
* @readonly
*/
this.parent = null;
/**
* @type {import('engine/SceneTree').default}
*/
this.scene_tree = null;
/**
* The multiplied alpha of the node
*
* @type {number}
* @readonly
*/
this.world_alpha = 1;
/**
* The area the filter is applied to. This is used as more of an optimisation
* rather than figuring out the dimensions of the node each frame you can set this rectangle
*
* Also works as an interaction mask
*
* @type {Rectangle}
*/
this.filter_area = null;
/**
* @type {Array}
*/
this._filters = null;
/**
* @type {Array}
*/
this._enabled_filters = null;
/**
* The bounds object, this is used to calculate and store the bounds of the node
*
* @private
* @type {Bounds}
*/
this._bounds = new Bounds();
/**
* @private
* @type {number}
*/
this._bounds_id = 0;
/**
* @private
* @type {number}
*/
this._last_bounds_id = -1;
/**
* @private
* @type {Rectangle}
*/
this._bounds_rect = null;
/**
* @private
* @type {Rectangle}
*/
this._local_bounds_rect = null;
/**
* @private
* @type {Point}
*/
this._world_position = new Point();
/**
* @private
* @type {Point}
*/
this._world_scale = new Point(1, 1);
/**
* @private
* @type {number}
*/
this._world_rotation = 0;
/**
* The original, cached mask of the object
*
* @private
* @type {import('./graphics/Graphics').default|import('./sprites/Sprite').default}
*/
this._mask = null;
/**
* @private
*/
this.is_mask = false;
/**
* If the object has been destroyed via destroy(). If true, it should not be used.
*
* @type {boolean}
* @private
* @readonly
*/
this._destroyed = false;
/**
* @private
* @type {boolean}
*/
this._is_ready = false;
/**
* The array of children of this container.
*
* @type {Array<Node2D>}
* @readonly
*/
this.children = [];
/**
* @type {any}
*/
this.named_children = Object.create(null);
/**
* @type {Array<number>}
*/
this.groups = null;
/**
* @type {tween.TweenManager}
*/
this.tweens = null;
if (node_plugins.TweenManager) {
this.tweens = new node_plugins.TweenManager();
}
this.tint = 0;
this.modulate = {
_rgb: [0, 0, 0],
get r() {
return this._rgb[0];
},
set r(value) {
this._rgb[0] = value;
self.tint = rgb2hex(this._rgb);
},
get g() {
return this._rgb[1];
},
set g(value) {
this._rgb[1] = value;
self.tint = rgb2hex(this._rgb);
},
get b() {
return this._rgb[2];
},
set b(value) {
this._rgb[2] = value;
self.tint = rgb2hex(this._rgb);
},
get a() {
return self.alpha;
},
set a(value) {
self.alpha = value;
},
};
this.tree_entered = new Signal();
this.tree_exited = new Signal();
}
_load_data(data) {
for (let k in data) {
switch (k) {
// Directly set
// - Node2D
case 'name':
case 'alpha':
case 'width':
case 'height':
case 'rotation':
case 'visible':
case 'x':
case 'y':
case 'interactive':
this[k] = data[k];
break;
// Set vector
// - Node2D
case 'pivot':
case 'position':
case 'skew':
this[k].x = data[k].x || 0;
this[k].y = data[k].y || 0;
break;
// - Node2D
case 'scale':
this[k].x = data[k].x || 1;
this[k].y = data[k].y || 1;
break;
}
}
}
/**
* Set value of this node with key, values and lerp factor
* @param {string} key
* @param {any} a
* @param {any} b
* @param {number} c
*/
set_lerp_value(key, a, b, c) {}
/**
* Set value of this node with its key
* @param {string} key
* @param {any} value
*/
set_value(key, value) {}
/**
* @private
* @type {Node2D}
*/
get _temp_node_2d_parent() {
if (this.temp_node_2d_parent === null) {
this.temp_node_2d_parent = new Node2D();
}
return this.temp_node_2d_parent;
}
/**
* Set name of this node
* @param {string} name
*/
set_name(name) {
this.name = name;
if (this.parent) {
this.parent._validate_child_name(this);
}
}
/**
* @param {boolean} p
*/
set_process(p) {
this.idle_process = !!p;
}
/**
* @param {boolean} p
*/
set_physics_process(p) {
this.physics_process = !!p;
}
/**
* @param {number} group
*/
add_to_group(group) {
if (!this.groups) {
this.groups = [];
}
if (this.groups.indexOf(group) < 0) {
this.groups.push(group);
if (this.is_inside_tree) {
this.scene_tree.add_node_to_group(this, group);
}
}
}
/**
* @param {number} group
*/
remove_from_group(group) {
if (!this.groups) {
this.groups = [];
}
let idx = this.groups.indexOf(group);
if (idx >= 0) {
remove_items(this.groups, idx, 1);
if (this.is_inside_tree) {
this.scene_tree.remove_node_from_group(this, group);
}
}
}
/**
* Updates the object transform for rendering
*
* TODO - Optimization pass!
* @private
*/
_update_transform() {
if (this.has_transform) {
this.transform.update_transform(this.parent.transform);
this._bounds.update_id++;
}
// multiply the alphas..
this.world_alpha = this.alpha * this.parent.world_alpha;
}
/**
* recursively updates transform of all objects from the root to this one
* internal function for to_local()
*
* @private
*/
_recursive_post_update_transform() {
if (this.parent) {
this.parent._recursive_post_update_transform();
if (this.has_transform) {
this.transform.update_transform(this.parent.transform);
}
}
else {
if (this.has_transform) {
this.transform.update_transform(this._temp_node_2d_parent.transform);
}
}
}
/**
* Retrieves the bounds of the node as a rectangle object.
*
* @param {boolean} [skip_update=false] - setting to true will stop the transforms of the scene graph from
* being updated. This means the calculation returned MAY be out of date BUT will give you a
* nice performance boost
* @param {Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation
* @return {Rectangle} the rectangular bounding area
*/
get_bounds(skip_update, rect) {
if (!skip_update) {
if (!this.parent) {
this.parent = this._temp_node_2d_parent;
this.update_transform();
this.parent = null;
}
else {
this._recursive_post_update_transform();
this.update_transform();
}
}
if (this._bounds_id !== this._last_bounds_id) {
this.calculate_bounds();
}
if (!rect) {
if (!this._bounds_rect) {
this._bounds_rect = new Rectangle();
}
rect = this._bounds_rect;
}
return this._bounds.get_rectangle(rect);
}
/**
* Retrieves the local bounds of the node as a rectangle object
*
* @param {Rectangle} [rect] - Optional rectangle to store the result of the bounds calculation
* @return {Rectangle} the rectangular bounding area
*/
get_local_bounds(rect) {
const transform_ref = this.transform;
const parent_ref = this.parent;
this.parent = null;
this.transform = this._temp_node_2d_parent.transform;
if (!rect) {
if (!this._local_bounds_rect) {
this._local_bounds_rect = new Rectangle();
}
rect = this._local_bounds_rect;
}
const bounds = this.get_bounds(false, rect);
this.parent = parent_ref;
this.transform = transform_ref;
return bounds;
}
/**
* Calculates the global position of the display object
*
* @param {Point} position - The world origin to calculate from
* @param {Point} [point] - A Point object in which to store the value, optional
* (otherwise will create a new Point)
* @param {boolean} [skip_update=false] - Should we skip the update transform.
* @return {Point} A point object representing the position of this object
*/
to_global(position, point, skip_update = false) {
if (!skip_update) {
this._recursive_post_update_transform();
// this parent check is for just in case the item is a root object.
// If it is we need to give it a temporary parent so that node2d_update_transform works correctly
// this is mainly to avoid a parent check in the main loop. Every little helps for performance :)
if (!this.parent) {
this.parent = this._temp_node_2d_parent;
this.node2d_update_transform();
this.parent = null;
}
else {
this.node2d_update_transform();
}
}
// don't need to update the lot
return this.world_transform.apply(position, point);
}
/**
* Calculates the local position of the display object relative to another point
*
* @param {Point} position - The world origin to calculate from
* @param {Node2D} [from] - The Node2D to calculate the global position from
* @param {Point} [point] - A Point object in which to store the value, optional
* (otherwise will create a new Point)
* @param {boolean} [skip_update=false] - Should we skip the update transform
* @return {Point} A point object representing the position of this object
*/
to_local(position, from, point, skip_update) {
if (from) {
position = from.to_global(position, point, skip_update);
}
if (!skip_update) {
this._recursive_post_update_transform();
// this parent check is for just in case the item is a root object.
// If it is we need to give it a temporary parent so that node2d_update_transform works correctly
// this is mainly to avoid a parent check in the main loop. Every little helps for performance :)
if (!this.parent) {
this.parent = this._temp_node_2d_parent;
this.node2d_update_transform();
this.parent = null;
}
else {
this.node2d_update_transform();
}
}
// simply apply the matrix..
return this.world_transform.apply_inverse(position, point);
}
/**
* Convenience function to set the position, scale, skew and pivot at once.
*
* @param {number} [x=0] - The X position
* @param {number} [y=0] - The Y position
* @param {number} [scale_x=1] - The X scale value
* @param {number} [scale_y=1] - The Y scale value
* @param {number} [rotation=0] - The rotation
* @param {number} [skew_x=0] - The X skew value
* @param {number} [skew_y=0] - The Y skew value
* @param {number} [pivot_x=0] - The X pivot value
* @param {number} [pivot_y=0] - The Y pivot value
* @return {Node2D} The Node2D instance
*/
set_transform(x = 0, y = 0, scale_x = 1, scale_y = 1, rotation = 0, skew_x = 0, skew_y = 0, pivot_x = 0, pivot_y = 0) {
this.position.x = x;
this.position.y = y;
this.scale.x = !scale_x ? 1 : scale_x;
this.scale.y = !scale_y ? 1 : scale_y;
this.rotation = rotation;
this.skew.x = skew_x;
this.skew.y = skew_y;
this.pivot.x = pivot_x;
this.pivot.y = pivot_y;
return this;
}
/**
* Base destroy method for generic display objects. This will automatically
* remove the display object from its parent Node2D as well as remove
* all current event listeners and internal references. Do not use a Node2D
* after calling `destroy`.
*/
destroy() {
// TODO: how do we cleanup an `EventEmitter`
this.removeAllListeners();
if (this.parent) {
this.parent.remove_child(this);
}
this.transform = null;
this.parent = null;
this._bounds = null;
this._current_bounds = null;
this._mask = null;
this.filter_area = null;
this.interactive = false;
this.interactive_children = false;
this._destroyed = true;
}
/**
* The position of the node on the x axis relative to the local coordinates of the parent.
* An alias to position.x
*
* @type {number}
*/
get x() {
return this.position.x;
}
set x(value) // eslint-disable-line require-jsdoc
{
this.transform.position.x = value;
}
/**
* The position of the node on the y axis relative to the local coordinates of the parent.
* An alias to position.y
*
* @type {number}
*/
get y() {
return this.position.y;
}
set y(value) // eslint-disable-line require-jsdoc
{
this.transform.position.y = value;
}
/**
* Current transform of the object based on world (parent) factors
*
* @member {Matrix}
* @readonly
*/
get world_transform() {
return this.transform.world_transform;
}
/**
* Current transform of the object based on local factors: position, scale, other stuff
*
* @member {Matrix}
* @readonly
*/
get local_transform() {
return this.transform.local_transform;
}
/**
* The coordinate of the object relative to the local coordinates of the parent.
* Assignment by value.
*
* @type {ObservablePoint}
*/
get position() {
return this.transform.position;
}
set position(value) // eslint-disable-line require-jsdoc
{
this.transform.position.copy(value);
}
get_position() {
return this.transform.position;
}
set_position(value) {
this.transform.position.copy(value);
}
get_global_position() {
return this._world_position;
}
/**
* The scale factor of the object.
* Assignment by value since pixi-v4.
*
* @type {ObservablePoint}
*/
get scale() {
return this.transform.scale;
}
set scale(value) // eslint-disable-line require-jsdoc
{
this.transform.scale.copy(value);
}
get_scale() {
return this.transform.scale;
}
set_scale(value) {
this.transform.scale.copy(value);
}
get_global_scale() {
return this._world_scale;
}
/**
* The pivot point of the node that it rotates around
* Assignment by value since pixi-v4.
*
* @type {ObservablePoint}
*/
get pivot() {
return this.transform.pivot;
}
set pivot(value) // eslint-disable-line require-jsdoc
{
this.transform.pivot.copy(value);
}
get_pivot() {
return this.transform.pivot;
}
set_pivot(value) {
this.transform.pivot.copy(value);
}
/**
* The skew factor for the object in radians.
* Assignment by value since pixi-v4.
*
* @type {ObservablePoint}
*/
get skew() {
return this.transform.skew;
}
set skew(value) // eslint-disable-line require-jsdoc
{
this.transform.skew.copy(value);
}
get_skew() {
return this.transform.skew;
}
set_skew(value) {
this.transform.skew.copy(value);
}
/**
* The rotation of the object in radians.
*
* @type {number}
*/
get rotation() {
return this.transform.rotation;
}
set rotation(value) // eslint-disable-line require-jsdoc
{
this.transform.rotation = value;
}
get_rotation() {
return this.transform.rotation;
}
/**
* @param {number} value
*/
set_rotation(value) {
this.transform.rotation = value;
}
get_global_rotation() {
return this._world_rotation;
}
/**
* Indicates if the object is globally visible.
*
* @type {boolean}
* @readonly
*/
get world_visible() {
/** @type {Node2D} */
let item = this;
do {
if (!item.visible) {
return false;
}
item = item.parent;
} while (item);
return true;
}
/**
* Sets a mask for the node. A mask is an object that limits the visibility of an
* object to the shape of the mask applied to it. In V a regular mask must be a
* Graphics or a Sprite object. This allows for much faster masking in canvas as it
* utilises shape clipping. To remove a mask, set this property to null.
*
* @todo For the moment, CanvasRenderer doesn't support Sprite as mask.
*
* @type {import('./graphics/Graphics').default|import('./sprites/Sprite').default}
*/
get mask() {
return this._mask;
}
set mask(value) // eslint-disable-line require-jsdoc
{
if (this._mask) {
this._mask.renderable = true;
this._mask.is_mask = false;
}
this._mask = value;
if (this._mask) {
this._mask.renderable = false;
this._mask.is_mask = true;
}
}
/**
* Sets the filters for the node.
* * IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
* To remove filters simply set this property to 'null'
*
* @type {Array<Filter>}
*/
get filters() {
return this._filters && this._filters.slice();
}
set filters(value) // eslint-disable-line require-jsdoc
{
this._filters = value && value.slice();
}
_enter_tree() { }
_ready() { }
/**
* @param {number} delta
*/
_process(delta) { }
/**
* @param {number} delta
*/
_physics_process(delta) { }
_exit_tree() { }
queue_free() {
if (!this.is_inside_tree) {
if (this.parent) {
this.parent.remove_child(this);
}
return;
}
if (this.scene_tree) {
this.scene_tree.queue_delete(this);
}
}
/**
* Call the method at the beginning of next frame
* @param {string} method
* @param {any} args
*/
call_deferred(method, args) {
if (!this.is_inside_tree) {
return;
}
if (this.scene_tree) {
this.scene_tree.message_queue.push_call(this, method, args);
}
}
_propagate_enter_tree() {
if (this.is_inside_tree) {
return;
}
this.is_inside_tree = true;
// Add to scene tree groups
if (this.groups && this.groups.length > 0) {
for (let i = 0; i < this.groups.length; i++) {
this.scene_tree.add_node_to_group(this, this.groups[i]);
}
}
this._enter_tree();
this.tree_entered.dispatch();
for (let i = 0, l = this.children.length; i < l; i++) {
this.children[i].scene_tree = this.scene_tree;
this.children[i]._propagate_enter_tree();
}
}
_propagate_ready() {
for (let i = 0, l = this.children.length; i < l; i++) {
this.children[i]._propagate_ready();
}
this._is_ready = true;
this._ready();
}
/**
* @private
* @param {number} delta
*/
_propagate_process(delta) {
if (this.idle_process) this._process(delta);
for (let i = 0, l = this.children.length; i < l; i++) {
this.children[i]._propagate_process(delta);
}
this.tweens && this.tweens._process(delta);
}
_propagate_exit_tree() {
// Stop animations
this.tweens && this.tweens._stop_all();
// Remove from scene tree groups
if (this.groups && this.groups.length > 0) {
for (let i = 0; i < this.groups.length; i++) {
this.scene_tree.remove_node_from_group(this, this.groups[i]);
}
}
// Let children exit tree
for (let i = 0, l = this.children.length; i < l; i++) {
this.children[i]._propagate_exit_tree();
this.children[i].scene_tree = null;
}
this._exit_tree();
this.tree_exited.dispatch();
// Reset flags
this._is_ready = false;
this.is_inside_tree = false;
this.scene_tree = null;
}
/**
* Overridable method that can be used by Node2D subclasses whenever the children array is modified
*
* @private
* @param {number} index
*/
on_children_change(index) {
/* empty */
}
/**
* Adds one or more children to the container.
*
* Multiple items can be added like so: `myNode2D.add_child(thingOne, thingTwo, thingThree)`
*
* @template {Node2D} T
* @param {T} child - The Node2D to add to the container
* @return {T} The child that was added.
*/
add_child(child) {
// if the child has a parent then lets remove it as Pixi objects can only exist in one place
if (child.parent) {
child.parent.remove_child(child);
}
child.parent = this;
child.scene_tree = this.scene_tree;
// ensure child transform will be recalculated
child.transform._parent_id = -1;
this.children.push(child);
// add to name hash
if (child.name.length > 0) {
this._validate_child_name(child);
}
// ensure bounds will be recalculated
this._bounds_id++;
if (this.is_inside_tree) {
child._propagate_enter_tree();
child.update_transform();
}
// TODO - lets either do all callbacks or all events.. not both!
this.on_children_change(this.children.length - 1);
if (this._is_ready) {
child._propagate_ready();
}
return child;
}
/**
* Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
*
* @template {Node2D} T
* @param {T} child - The child to add
* @param {number} index - The index to place the child in
* @return {T} The child that was added.
*/
add_child_at(child, index) {
if (index < 0 || index > this.children.length) {
throw new Error(`${child}add_child_at: The index ${index} supplied is out of bounds ${this.children.length}`);
}
if (child.parent) {
child.parent.remove_child(child);
}
child.parent = this;
child.scene_tree = this.scene_tree;
// ensure child transform will be recalculated
child.transform._parent_id = -1;
this.children.splice(index, 0, child);
// add to name hash
if (child.name.length > 0) {
this._validate_child_name(child);
}
// ensure bounds will be recalculated
this._bounds_id++;
if (this.is_inside_tree) {
child._propagate_enter_tree();
child.update_transform();
}
// TODO - lets either do all callbacks or all events.. not both!
this.on_children_change(this.children.length - 1);
if (this._is_ready) {
child._propagate_ready();
}
return child;
}
/**
* Swaps the position of 2 Display Objects within this container.
*
* @template {Node2D} T
* @param {T} child - First display object to swap
* @param {T} child2 - Second display object to swap
*/
swap_children(child, child2) {
if (child === child2) {
return;
}
const index1 = this.get_child_index(child);
const index2 = this.get_child_index(child2);
this.children[index1] = child2;
this.children[index2] = child;
this.on_children_change(index1 < index2 ? index1 : index2);
}
/**
* Returns the index position of a child Node2D instance
*
* @template {Node2D} T
* @param {T} child - The Node2D instance to identify
* @return {number} The index position of the child display object to identify
*/
get_child_index(child) {
const index = this.children.indexOf(child);
if (index === -1) {
throw new Error('The supplied Node2D must be a child of the caller');
}
return index;
}
/**
* Changes the position of an existing child in the display object container
*
* @template {Node2D} T
* @param {T} child - The child Node2D instance for which you want to change the index number
* @param {number} index - The resulting index number for the child display object
*/
set_child_index(child, index) {
if (index < 0 || index >= this.children.length) {
throw new Error(`The index ${index} supplied is out of bounds ${this.children.length}`);
}
const current_index = this.get_child_index(child);
remove_items(this.children, current_index, 1); // remove from old position
this.children.splice(index, 0, child); // add at new position
this.on_children_change(index);
}
/**
* Returns the child at the specified index
*
* @template T {Node2D}
* @param {number} index - The index to get the child at
* @return {T} The child at the given index, if any.
*/
get_child(index) {
if (index < 0 || index >= this.children.length) {
throw new Error(`get_child: Index (${index}) does not exist.`);
}
// @ts-ignore
return this.children[index];
}
/**
* Removes one or more children from the container.
*
* @param {Node2D} child - The Node2D to remove
* @return {Node2D} The first child that was removed.
*/
remove_child(child) {
const index = this.children.indexOf(child);
if (index === -1) return null;
child.parent = null;
// ensure child transform will be recalculated
child.transform._parent_id = -1;
remove_items(this.children, index, 1);
// remove from name hash
if (child.name.length > 0) {
this.named_children[child.name] = undefined;
}
// ensure bounds will be recalculated
this._bounds_id++;
child._propagate_exit_tree();
// TODO - lets either do all callbacks or all events.. not both!
this.on_children_change(index);
return child;
}
/**
* Removes a child from the specified index position.
*
* @param {number} index - The index to get the child from
* @return {Node2D} The child that was removed.
*/
remove_child_at(index) {
const child = this.get_child(index);
// ensure child transform will be recalculated..
child.parent = null;
child.scene_tree = null;
child.transform._parent_id = -1;
remove_items(this.children, index, 1);
// remove from name hash
if (child.name.length > 0) {
this.named_children[child.name] = undefined;
}
// ensure bounds will be recalculated
this._bounds_id++;
child._propagate_exit_tree();
// TODO - lets either do all callbacks or all events.. not both!
this.on_children_change(index);
return child;
}
/**
* Removes all children from this container that are within the begin and end indexes.
*
* @param {number} [beginIndex=0] - The beginning position.
* @param {number} [endIndex=this.children.length] - The ending position. Default value is size of the container.
* @returns {Array<Node2D>} List of removed children
*/
remove_children(beginIndex = 0, endIndex) {
const begin = beginIndex;
const end = typeof endIndex === 'number' ? endIndex : this.children.length;
const range = end - begin;
let removed;
if (range > 0 && range <= end) {
removed = this.children.splice(begin, range);
for (let i = 0; i < removed.length; ++i) {
removed[i].parent = null;
removed[i].scene_tree = null;
if (removed[i].transform) {
removed[i].transform._parent_id = -1;
}
// remove from name hash
if (removed[i].name.length > 0) {
this.named_children[removed[i].name] = undefined;
}
removed[i]._propagate_exit_tree();
}
this._bounds_id++;
this.on_children_change(beginIndex);
return removed;
}
else if (range === 0 && this.children.length === 0) {
return [];
}
throw new RangeError('remove_children: numeric values are outside the acceptable range.');
}
/**
* @returns {import('engine/SceneTree').default}
*/
get_tree() {
return this.scene_tree;
}
/**
* @template T {Node2D}
* @param {string} path
* @returns {T}
*/
get_node(path) {
const list = path.split('/');
// Find the base node
/** @type {Node2D} */
let node = this;
let i = 0, l = list.length, name;
// '/absolute/node/path' start from current scene
if (list[0].length === 0) {
node = this.scene_tree.current_scene;
i = 1;
}
for (; i < l; i++) {
name = list[i];
switch (name) {
case '.':
break;
case '..':
node = node.parent;
if (!node) {
console.log('no parent node exists');
return null;
}
break;
default:
node = node.named_children[name];
if (!node) {
console.log(`node called "${name}" does not exist`);
return null;
}
break;
}
}
// @ts-ignore
return node;
}
/**
* Updates the transform on all children of this container for rendering
*/
update_transform() {
if (this.has_transform) {
this._bounds_id++;
this.transform.update_transform(this.parent.transform);
let t = this.transform.world_transform;
this._world_position.set(t.tx, t.ty);
this._world_scale.copy(this.parent._world_scale)
.multiply(this.scale);
this._world_rotation = this.parent._world_rotation + this.transform.rotation;
}
// TODO: check render flags, how to process stuff here
this.world_alpha = this.alpha * this.parent.world_alpha;
for (let i = 0, j = this.children.length; i < j; ++i) {
const child = this.children[i];
if (child.visible) {
child.update_transform();
}
}
}
/**
* Recalculates the bounds of the container.
*/
calculate_bounds() {
this._bounds.clear();
this._calculate_bounds();
for (let i = 0; i < this.children.length; i++) {
const child = this.children[i];
if (!child.visible || !child.renderable) {
continue;
}
child.calculate_bounds();
// TODO: filter+mask, need to mask both somehow
if (child._mask) {
child._mask.calculate_bounds();
this._bounds.add_bounds_mask(child._bounds, child._mask._bounds);
}
else if (child.filter_area) {
this._bounds.add_bounds_area(child._bounds, child.filter_area);
}
else {
this._bounds.add_bounds(child._bounds);
}
}
this._last_bounds_id = this._bounds_id;
}
/**
* Recalculates the bounds of the object. Override this to
* calculate the bounds of the specific object (not including children).
* @private
*/
_calculate_bounds() {
// FILL IN//
}
_validate_child_name(child) {
let n = child.name;
let i = 2;
while (this.named_children[n]) {
n = `${name}_${i}`;
}
child.name = n;
this.named_children[n] = child;
}
/**
* Renders the object using the WebGL renderer
*
* @param {import('engine/renderers/WebGLRenderer').default} renderer - The renderer
*/
render_webgl(renderer) {
// if the object is not visible or the alpha is 0 then no need to render this element
if (!this.visible || this.world_alpha <= 0 || !this.renderable) {
return;
}
// do a quick check to see if this element has a mask or a filter.
if (this._mask || this._filters) {
this.render_advanced_webgl(renderer);
}
else {
this._render_webgl(renderer);
// simple render children!
for (let i = 0, j = this.children.length; i < j; ++i) {
this.children[i].render_webgl(renderer);
}
}
}
/**
* Render the object using the WebGL renderer and advanced features.
*
* @private
* @param {import('engine/renderers/WebGLRenderer').default} renderer - The renderer
*/
render_advanced_webgl(renderer) {
renderer.flush();
const filters = this._filters;
const mask = this._mask;
// push filter first as we need to ensure the stencil buffer is correct for any masking
if (filters) {
if (!this._enabled_filters) {
this._enabled_filters = [];
}
this._enabled_filters.length = 0;
for (let i = 0; i < filters.length; i++) {
if (filters[i].enabled) {
this._enabled_filters.push(filters[i]);
}
}
if (this._enabled_filters.length) {
renderer.filter_manager.push_filter(this, this._enabled_filters);
}
}
if (mask) {
renderer.mask_manager.push_mask(this, this._mask);
}
// add this object to the batch, only rendered if it has a texture.
this._render_webgl(renderer);
// now loop through the children and make sure they get rendered
for (let i = 0, j = this.children.length; i < j; i++) {
this.children[i].render_webgl(renderer);
}
renderer.flush();
if (mask) {
renderer.mask_manager.pop_mask(this, this._mask);
}
if (filters && this._enabled_filters && this._enabled_filters.length) {
renderer.filter_manager.pop_filter();
}
}
/**
* To be overridden by the subclasses.
*
* @private
* @param {import('engine/renderers/WebGLRenderer').default} renderer - The renderer
*/
_render_webgl(renderer) // eslint-disable-line no-unused-vars
{
// this is where content itself gets rendered...
}
/**
* Removes all internal references and listeners as well as removes children from the display list.
* Do not use a Node2D after calling `destroy`.
*
* @param {DestroyOption|boolean} [options] - Options parameter. A boolean will act as if all options
* have been set to that value
*/
destroy_children(options) {
const destroy_children = typeof options === 'boolean' ? options : options && options.children;
const old_children = this.remove_children(0, this.children.length);
if (destroy_children) {
for (let i = 0; i < old_children.length; ++i) {
old_children[i].destroy_children(options);
}
}
}
/**
* The width of the Node2D, setting this will actually modify the scale to achieve the value set
*
* @member {number}
*/
get width() {
return this.scale.x * this.get_local_bounds().width;
}
set width(value) // eslint-disable-line require-jsdoc
{
const width = this.get_local_bounds().width;
if (width !== 0) {
this.scale.x = value / width;
}
else {
this.scale.x = 1;
}
this._width = value;
}
/**
* The height of the Node2D, setting this will actually modify the scale to achieve the value set
*
* @member {number}
*/
get height() {
return this.scale.y * this.get_local_bounds().height;
}
set height(value) // eslint-disable-line require-jsdoc
{
const height = this.get_local_bounds().height;
if (height !== 0) {
this.scale.y = value / height;
}
else {
this.scale.y = 1;
}
this._height = value;
}
}
/**
* performance increase to avoid using call.. (10x faster)
* @this {Node2D}
*/
Node2D.prototype.node2d_update_transform = Node2D.prototype.update_transform;
| pixelpicosean/voltar | src/engine/scene/Node2D.js | JavaScript | mit | 42,750 |
gj.grid.messages['en-us'] = {
First: 'First',
Previous: 'Previous',
Next: 'Next',
Last: 'Last',
Page: 'Page',
FirstPageTooltip: 'First Page',
PreviousPageTooltip: 'Previous Page',
NextPageTooltip: 'Next Page',
LastPageTooltip: 'Last Page',
Refresh: 'Refresh',
Of: 'of',
DisplayingRecords: 'Displaying records',
RowsPerPage: 'Rows per page:',
Edit: 'Edit',
Delete: 'Delete',
Update: 'Update',
Cancel: 'Cancel',
NoRecordsFound: 'No records found.',
Loading: 'Loading...'
}; | atatanasov/gijgo | src/grid/js/messages/messages.en-us.js | JavaScript | mit | 550 |
(function() {
"use strict";
var VideoIds = {
'1': { videoId: '4d8ZDSyFS2g' },
'2': { videoId: 'dJOn3jG5tUk' },
'3': { videoId: 'EquPUW83D-Q' }
}, CardData = {
"../cards/video/card.js": VideoIds,
"../cards/ad/card.js": VideoIds,
"../cards/ad-playlist/card.js": {
'1': VideoIds
},
"../cards/superbowl/card.js": {
'1': VideoIds
},
"../cards/slot_machine/card.js": {
'1': { coins: 1, insertCoinsLabel: 'Watch another ad'},
'2': { coins: 2, insertCoinsLabel: 'Watch another ad'},
'3': { coins: 3, insertCoinsLabel: 'Watch another ad'}
}
};
function coerceId(id) {
return '' + id;
}
$.extend(Playground, {
loadData: function (url, _id) {
var id = coerceId(_id),
data = CardData[url] && CardData[url][id];
if (data) {
url = Playground.crossOriginHtmlUrl(url);
this.conductor.loadData(url, id, data);
}
}
});
})();
| tildeio/conductor.js | example/playground/js/playground-data.js | JavaScript | mit | 962 |
'use strict';
var bitcore = module.exports;
// module information
bitcore.version = 'v' + require('./package.json').version;
bitcore.versionGuard = function(version) {
if (version !== undefined) {
var message = 'More than one instance of bitcore-lib-cash found. ' +
'Please make sure to require bitcore-lib and check that submodules do' +
' not also include their own bitcore-lib dependency.';
throw new Error(message);
}
};
bitcore.versionGuard(global._bitcoreCash);
global._bitcoreCash = bitcore.version;
// crypto
bitcore.crypto = {};
bitcore.crypto.BN = require('./lib/crypto/bn');
bitcore.crypto.ECDSA = require('./lib/crypto/ecdsa');
bitcore.crypto.Hash = require('./lib/crypto/hash');
bitcore.crypto.Random = require('./lib/crypto/random');
bitcore.crypto.Point = require('./lib/crypto/point');
bitcore.crypto.Signature = require('./lib/crypto/signature');
// encoding
bitcore.encoding = {};
bitcore.encoding.Base58 = require('./lib/encoding/base58');
bitcore.encoding.Base58Check = require('./lib/encoding/base58check');
bitcore.encoding.BufferReader = require('./lib/encoding/bufferreader');
bitcore.encoding.BufferWriter = require('./lib/encoding/bufferwriter');
bitcore.encoding.Varint = require('./lib/encoding/varint');
// utilities
bitcore.util = {};
bitcore.util.buffer = require('./lib/util/buffer');
bitcore.util.js = require('./lib/util/js');
bitcore.util.preconditions = require('./lib/util/preconditions');
bitcore.util.base32 = require('./lib/util/base32');
bitcore.util.convertBits = require('./lib/util/convertBits');
// errors thrown by the library
bitcore.errors = require('./lib/errors');
// main bitcoin library
bitcore.Address = require('./lib/address');
bitcore.Block = require('./lib/block');
bitcore.MerkleBlock = require('./lib/block/merkleblock');
bitcore.BlockHeader = require('./lib/block/blockheader');
bitcore.HDPrivateKey = require('./lib/hdprivatekey.js');
bitcore.HDPublicKey = require('./lib/hdpublickey.js');
bitcore.Networks = require('./lib/networks');
bitcore.Opcode = require('./lib/opcode');
bitcore.PrivateKey = require('./lib/privatekey');
bitcore.PublicKey = require('./lib/publickey');
bitcore.Script = require('./lib/script');
bitcore.Transaction = require('./lib/transaction');
bitcore.URI = require('./lib/uri');
bitcore.Unit = require('./lib/unit');
// dependencies, subject to change
bitcore.deps = {};
bitcore.deps.bnjs = require('bn.js');
bitcore.deps.bs58 = require('bs58');
bitcore.deps.Buffer = Buffer;
bitcore.deps.elliptic = require('elliptic');
bitcore.deps._ = require('lodash');
// Internal usage, exposed for testing/advanced tweaking
bitcore.Transaction.sighash = require('./lib/transaction/sighash');
| bitjson/bitcore | packages/bitcore-lib-cash/index.js | JavaScript | mit | 2,703 |
import _ from 'lodash';
export default (el, mainProperty) => {
let computedStyles = window.getComputedStyle(el, null);
return _.reduce(computedStyles, (aggregator, property) => {
if(property.startsWith(mainProperty)) {
aggregator.push(computedStyles[property]);
}
return aggregator;
}, []).join(' ');
};
| aptivator/aptivator | src/animation/animations-executor/lib/styles-aggregator.js | JavaScript | mit | 329 |
/**
*@file gulp配置文件
*@author Like (likeaixi@gmail.com)
*@date 2017-10-27 09:41:07
*@disc
*/
var gulp = require('gulp');
var requireDir = require('require-dir');
var config = require('./config');
requireDir('./tasks', {recurse: true});
| like1028/like-gulp-tpl | gulpfile.js | JavaScript | mit | 252 |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["mapping"] = factory();
else
root["mapping"] = factory();
})(this, function() {
return /******/ (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) {
module.exports = {
/** Used to map method names to their aliases. */
'aliasMap': {
'ary': ['nAry'],
'conj': ['allPass'],
'disj': ['somePass'],
'filter': ['whereEq'],
'flatten': ['unnest'],
'flow': ['pipe'],
'flowRight': ['compose'],
'forEach': ['each'],
'forEachRight': ['eachRight'],
'get': ['path'],
'getOr': ['pathOr'],
'head': ['first'],
'includes': ['contains'],
'initial': ['init'],
'isEqual': ['equals'],
'mapValues': ['mapObj'],
'matchesProperty': ['pathEq'],
'modArgs': ['useWith'],
'modArgsSet': ['converge'],
'omit': ['dissoc', 'omitAll'],
'pick': ['pickAll'],
'property': ['prop'],
'propertyOf': ['propOf'],
'rest': ['unapply'],
'some': ['all'],
'spread': ['apply'],
'zipObject': ['zipObj']
},
/** Used to map method names to their iteratee ary. */
'aryIterateeMap': {
'assignWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'extendWith': 2,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
},
/** Used to map ary to method names. */
'aryMethodMap': {
1: (
'attempt,ceil,create,curry,floor,fromPairs,iteratee,invert,over,overEvery,' +
'overSome,memoize,method,methodOf,mixin,rest,reverse,round,runInContext,template,' +
'trim,trimLeft,trimRight,uniqueId,words').split(','),
2: (
'add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,' +
'debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,dropRightWhile,' +
'dropWhile,endsWith,every,extend,filter,find,find,findIndex,findKey,findLast,' +
'findLastIndex,findLastKey,flatMap,forEach,forEachRight,forIn,forInRight,' +
'forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,intersection,' +
'invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,matchesProperty,' +
'maxBy,mean,minBy,merge,modArgs,modArgsSet,omit,pad,padLeft,padRight,parseInt,' +
'partition,pick,pull,pullAll,pullAt,random,range,rangeRight,rearg,reject,' +
'remove,repeat,result,sampleSize,set,some,sortBy,sortByOrder,sortedIndexBy,' +
'sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,' +
'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' +
'xor,zip,zipObject').split(','),
3: (
'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' +
'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' +
'reduceRight,slice,transform,unionBy,xorBy,zipWith').split(','),
4:
['fill']
},
/** Used to map ary to rearg configs by method ary. */
'aryReargMap': {
2: [1, 0],
3: [2, 1, 0],
4: [3, 2, 0, 1]
},
/** Used to map ary to rearg configs by method names. */
'methodReargMap': {
'clamp': [2, 0, 1],
'reduce': [2, 0, 1],
'reduceRight': [2, 0, 1],
'slice': [2, 0, 1],
'transform': [2, 0, 1]
},
/** Used to iterate `mapping.aryMethodMap` keys. */
'caps': [1, 2, 3, 4],
/** Used to map keys to other keys. */
'keyMap': {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get'
},
/** Used to identify methods which mutate arrays or objects. */
'mutateMap': {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'extend': true,
'extendWith': true,
'merge': true,
'mergeWith': true
}
},
/** Used to track methods that skip `_.rearg`. */
'skipReargMap': {
'difference': true,
'matchesProperty': true,
'random': true,
'range': true,
'rangeRight': true,
'zip': true,
'zipObject': true
}
};
/***/ }
/******/ ])
});
; | boneskull/lodash | dist/mapping.fp.js | JavaScript | mit | 6,356 |
var gulp = require('gulp');
var templateCache = require('gulp-angular-templatecache');
gulp.task('default', function () {
return gulp.src('app/templates/**/*.html')
.pipe(templateCache())
.pipe(gulp.dest('app'));
});
| jpiskorz/simple-angularjs | gulpfile.js | JavaScript | mit | 229 |
version https://git-lfs.github.com/spec/v1
oid sha256:5cd6c05aff61c88c6cf5437154042c2bd702ffea1f72488286c55559bed066dc
size 10620
| yogeshsaroya/new-cdnjs | ajax/libs/ember-simple-auth/0.6.1/simple-auth.amd.min.js | JavaScript | mit | 130 |
version https://git-lfs.github.com/spec/v1
oid sha256:43c5157895728939399a134556825673721a78931ba308a7edd8ff0cfb793b47
size 705
| yogeshsaroya/new-cdnjs | ajax/libs/ng-context-menu/0.0.5/ng-context-menu.min.js | JavaScript | mit | 128 |
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
var _Object$create = require('babel-runtime/core-js/object/create')['default'];
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.cycleErrorMessage = cycleErrorMessage;
exports.NoFragmentCycles = NoFragmentCycles;
var _error = require('../../error');
function cycleErrorMessage(fragName, spreadNames) {
var via = spreadNames.length ? ' via ' + spreadNames.join(', ') : '';
return 'Cannot spread fragment "' + fragName + '" within itself' + via + '.';
}
function NoFragmentCycles(context) {
// Tracks already visited fragments to maintain O(N) and to ensure that cycles
// are not redundantly reported.
var visitedFrags = _Object$create(null);
// Array of AST nodes used to produce meaningful errors
var spreadPath = [];
// Position in the spread path
var spreadPathIndexByName = _Object$create(null);
return {
OperationDefinition: function OperationDefinition() {
return false;
},
FragmentDefinition: function FragmentDefinition(node) {
if (!visitedFrags[node.name.value]) {
detectCycleRecursive(node);
}
return false;
}
};
// This does a straight-forward DFS to find cycles.
// It does not terminate when a cycle was found but continues to explore
// the graph to find all possible cycles.
function detectCycleRecursive(fragment) {
var fragmentName = fragment.name.value;
visitedFrags[fragmentName] = true;
var spreadNodes = context.getFragmentSpreads(fragment);
if (spreadNodes.length === 0) {
return;
}
spreadPathIndexByName[fragmentName] = spreadPath.length;
for (var i = 0; i < spreadNodes.length; i++) {
var spreadNode = spreadNodes[i];
var spreadName = spreadNode.name.value;
var cycleIndex = spreadPathIndexByName[spreadName];
if (cycleIndex === undefined) {
spreadPath.push(spreadNode);
if (!visitedFrags[spreadName]) {
var spreadFragment = context.getFragment(spreadName);
if (spreadFragment) {
detectCycleRecursive(spreadFragment);
}
}
spreadPath.pop();
} else {
var cyclePath = spreadPath.slice(cycleIndex);
context.reportError(new _error.GraphQLError(cycleErrorMessage(spreadName, cyclePath.map(function (s) {
return s.name.value;
})), cyclePath.concat(spreadNode)));
}
}
spreadPathIndexByName[fragmentName] = undefined;
}
} | IgorKilipenko/KTS_React | node_modules/graphql/validation/rules/NoFragmentCycles.js | JavaScript | mit | 2,762 |
var fs = require('fs');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var retry = require('async-retry');
var debug = require('debug')('rpi-gpio');
var Epoll = require('epoll').Epoll;
var PATH = '/sys/class/gpio';
var PINS = {
v1: {
// 1: 3.3v
// 2: 5v
'3': 0,
// 4: 5v
'5': 1,
// 6: ground
'7': 4,
'8': 14,
// 9: ground
'10': 15,
'11': 17,
'12': 18,
'13': 21,
// 14: ground
'15': 22,
'16': 23,
// 17: 3.3v
'18': 24,
'19': 10,
// 20: ground
'21': 9,
'22': 25,
'23': 11,
'24': 8,
// 25: ground
'26': 7
},
v2: {
// 1: 3.3v
// 2: 5v
'3': 2,
// 4: 5v
'5': 3,
// 6: ground
'7': 4,
'8': 14,
// 9: ground
'10': 15,
'11': 17,
'12': 18,
'13': 27,
// 14: ground
'15': 22,
'16': 23,
// 17: 3.3v
'18': 24,
'19': 10,
// 20: ground
'21': 9,
'22': 25,
'23': 11,
'24': 8,
// 25: ground
'26': 7,
// Model B+ pins
// 27: ID_SD
// 28: ID_SC
'29': 5,
// 30: ground
'31': 6,
'32': 12,
'33': 13,
// 34: ground
'35': 19,
'36': 16,
'37': 26,
'38': 20,
// 39: ground
'40': 21
}
};
var RETRY_OPTS = {
retries: 100,
minTimeout: 10,
factor: 1
}
var DIR_IN = 'in';
var DIR_OUT = 'out';
var DIR_LOW = 'low';
var DIR_HIGH = 'high';
var MODE_RPI = 'mode_rpi';
var MODE_BCM = 'mode_bcm';
var EDGE_NONE = 'none';
var EDGE_RISING = 'rising';
var EDGE_FALLING = 'falling';
var EDGE_BOTH = 'both';
function Gpio() {
var currentPins;
var currentValidBcmPins;
var exportedInputPins = {};
var exportedOutputPins = {};
var getPinForCurrentMode = getPinRpi;
var pollers = {};
this.DIR_IN = DIR_IN;
this.DIR_OUT = DIR_OUT;
this.DIR_LOW = DIR_LOW;
this.DIR_HIGH = DIR_HIGH;
this.MODE_RPI = MODE_RPI;
this.MODE_BCM = MODE_BCM;
this.EDGE_NONE = EDGE_NONE;
this.EDGE_RISING = EDGE_RISING;
this.EDGE_FALLING = EDGE_FALLING;
this.EDGE_BOTH = EDGE_BOTH;
/**
* Set pin reference mode. Defaults to 'mode_rpi'.
*
* @param {string} mode Pin reference mode, 'mode_rpi' or 'mode_bcm'
*/
this.setMode = function(mode) {
if (mode === this.MODE_RPI) {
getPinForCurrentMode = getPinRpi;
} else if (mode === this.MODE_BCM) {
getPinForCurrentMode = getPinBcm;
} else {
throw new Error('Cannot set invalid mode');
}
};
/**
* Setup a channel for use as an input or output
*
* @param {number} channel Reference to the pin in the current mode's schema
* @param {string} direction The pin direction, either 'in' or 'out'
* @param edge edge Informs the GPIO chip if it needs to generate interrupts. Either 'none', 'rising', 'falling' or 'both'. Defaults to 'none'
* @param {function} onSetup Optional callback
*/
this.setup = function(channel, direction, edge, onSetup /*err*/) {
if (arguments.length === 2 && typeof direction == 'function') {
onSetup = direction;
direction = this.DIR_OUT;
edge = this.EDGE_NONE;
} else if (arguments.length === 3 && typeof edge == 'function') {
onSetup = edge;
edge = this.EDGE_NONE;
}
channel = parseInt(channel)
direction = direction || this.DIR_OUT;
edge = edge || this.EDGE_NONE;
onSetup = onSetup || function() {};
if (typeof channel !== 'number') {
return process.nextTick(function() {
onSetup(new Error('Channel must be a number'));
});
}
if (direction !== this.DIR_IN &&
direction !== this.DIR_OUT &&
direction !== this.DIR_LOW &&
direction !== this.DIR_HIGH
) {
return process.nextTick(function() {
onSetup(new Error('Cannot set invalid direction'));
});
}
if ([
this.EDGE_NONE,
this.EDGE_RISING,
this.EDGE_FALLING,
this.EDGE_BOTH
].indexOf(edge) == -1) {
return process.nextTick(function() {
onSetup(new Error('Cannot set invalid edge'));
});
}
var pinForSetup;
var onListen = function(readChannel) {
this.read(readChannel, function(err, value) {
if (err) {
debug(
'Error reading channel value after change, %d',
readChannel
);
return
}
debug(
'emitting change on channel %s with value %s',
readChannel,
value
);
this.emit('change', readChannel, value);
}.bind(this));
}.bind(this);
setRaspberryVersion()
.then(function() {
pinForSetup = getPinForCurrentMode(channel);
if (!pinForSetup) {
throw new Error(
'Channel ' + channel + ' does not map to a GPIO pin'
);
}
debug('set up pin %d', pinForSetup);
return isExported(pinForSetup)
})
.then(function(isExported) {
if (isExported) {
return unexportPin(pinForSetup);
}
})
.then(function() {
return exportPin(pinForSetup);
})
.then(function() {
return retry(function() {
return setEdge(pinForSetup, edge);
}, RETRY_OPTS);
})
.then(function() {
if (direction === DIR_IN) {
exportedInputPins[pinForSetup] = true;
} else {
exportedOutputPins[pinForSetup] = true;
}
return retry(function() {
return setDirection(pinForSetup, direction)
}, RETRY_OPTS);
})
.then(function() {
listen(channel, onListen);
})
.then(function() {
onSetup();
})
.catch(function(err) {
onSetup(err);
});
};
/**
* Write a value to a channel
*
* @param {number} channel The channel to write to
* @param {boolean} value If true, turns the channel on, else turns off
* @param {function} cb Optional callback
*/
this.write = this.output = function(channel, value, cb /*err*/) {
var pin = getPinForCurrentMode(channel);
cb = cb || function() {}
if (!exportedOutputPins[pin]) {
return process.nextTick(function() {
cb(new Error('Pin has not been exported for write'));
});
}
value = (!!value && value !== '0') ? '1' : '0';
debug('writing pin %d with value %s', pin, value);
fs.writeFile(PATH + '/gpio' + pin + '/value', value, cb);
};
/**
* Read a value from a channel
*
* @param {number} channel The channel to read from
* @param {function} cb Callback which receives the channel's boolean value
*/
this.read = this.input = function(channel, cb /*err,value*/) {
if (typeof cb !== 'function') {
throw new Error('A callback must be provided')
}
var pin = getPinForCurrentMode(channel);
if (!exportedInputPins[pin] && !exportedOutputPins[pin]) {
return process.nextTick(function() {
cb(new Error('Pin has not been exported'));
});
}
fs.readFile(PATH + '/gpio' + pin + '/value', 'utf-8', function(err, data) {
if (err) {
return cb(err)
}
data = (data + '').trim() || '0';
debug('read pin %s with value %s', pin, data);
return cb(null, data === '1');
});
};
/**
* Unexport any pins setup by this module
*
* @param {function} cb Optional callback
*/
this.destroy = function(cb) {
var tasks = Object.keys(exportedOutputPins)
.concat(Object.keys(exportedInputPins))
.map(function(pin) {
return new Promise(function(resolve, reject) {
removeListener(pin, pollers)
unexportPin(pin)
.then(resolve)
.catch(reject);
});
});
Promise.all(tasks)
.then(function() {
return cb();
})
.catch(function(err) {
return cb(err);
});
};
/**
* Reset the state of the module
*/
this.reset = function() {
exportedOutputPins = {};
exportedInputPins = {};
this.removeAllListeners();
currentPins = undefined;
currentValidBcmPins = undefined;
getPinForCurrentMode = getPinRpi;
pollers = {}
};
// Init
EventEmitter.call(this);
this.reset();
// Private functions requiring access to state
function setRaspberryVersion() {
if (currentPins) {
return Promise.resolve();
}
return new Promise(function(resolve, reject) {
fs.readFile('/proc/cpuinfo', 'utf8', function(err, data) {
if (err) {
return reject(err);
}
// Match the last 4 digits of the number following "Revision:"
var match = data.match(/Revision\s*:\s*[0-9a-f]*([0-9a-f]{4})/);
if (!match) {
var errorMessage = 'Unable to match Revision in /proc/cpuinfo: ' + data;
return reject(new Error(errorMessage));
}
var revisionNumber = parseInt(match[1], 16);
var pinVersion = (revisionNumber < 4) ? 'v1' : 'v2';
debug(
'seen hardware revision %d; using pin mode %s',
revisionNumber,
pinVersion
);
// Create a list of valid BCM pins for this Raspberry Pi version.
// This will be used to validate channel numbers in getPinBcm
currentValidBcmPins = []
Object.keys(PINS[pinVersion]).forEach(
function(pin) {
// Lookup the BCM pin for the RPI pin and add it to the list
currentValidBcmPins.push(PINS[pinVersion][pin]);
}
);
currentPins = PINS[pinVersion];
return resolve();
});
});
};
function getPinRpi(channel) {
return currentPins[channel] + '';
};
function getPinBcm(channel) {
channel = parseInt(channel, 10);
return currentValidBcmPins.indexOf(channel) !== -1 ? (channel + '') : null;
};
/**
* Listen for interrupts on a channel
*
* @param {number} channel The channel to watch
* @param {function} cb Callback which receives the channel's err
*/
function listen(channel, onChange) {
var pin = getPinForCurrentMode(channel);
if (!exportedInputPins[pin] && !exportedOutputPins[pin]) {
throw new Error('Channel %d has not been exported', channel);
}
debug('listen for pin %d', pin);
var poller = new Epoll(function(err, innerfd, events) {
if (err) throw err
clearInterrupt(innerfd);
onChange(channel);
});
var fd = fs.openSync(PATH + '/gpio' + pin + '/value', 'r+');
clearInterrupt(fd);
poller.add(fd, Epoll.EPOLLPRI);
// Append ready-to-use remove function
pollers[pin] = function() {
poller.remove(fd).close();
}
};
}
util.inherits(Gpio, EventEmitter);
function setEdge(pin, edge) {
debug('set edge %s on pin %d', edge.toUpperCase(), pin);
return new Promise(function(resolve, reject) {
fs.writeFile(PATH + '/gpio' + pin + '/edge', edge, function(err) {
if (err) {
return reject(err);
}
return resolve();
});
});
}
function setDirection(pin, direction) {
debug('set direction %s on pin %d', direction.toUpperCase(), pin);
return new Promise(function(resolve, reject) {
fs.writeFile(PATH + '/gpio' + pin + '/direction', direction, function(err) {
if (err) {
return reject(err);
}
return resolve();
});
});
}
function exportPin(pin) {
debug('export pin %d', pin);
return new Promise(function(resolve, reject) {
fs.writeFile(PATH + '/export', pin, function(err) {
if (err) {
return reject(err);
}
return resolve();
});
});
}
function unexportPin(pin) {
debug('unexport pin %d', pin);
return new Promise(function(resolve, reject) {
fs.writeFile(PATH + '/unexport', pin, function(err) {
if (err) {
return reject(err);
}
return resolve();
});
});
}
function isExported(pin) {
return new Promise(function(resolve, reject) {
fs.exists(PATH + '/gpio' + pin, function(exists) {
return resolve(exists);
});
});
}
function removeListener(pin, pollers) {
if (!pollers[pin]) {
return
}
debug('remove listener for pin %d', pin)
pollers[pin]()
delete pollers[pin]
}
function clearInterrupt(fd) {
fs.readSync(fd, Buffer.alloc(1), 0, 1, 0);
}
var GPIO = new Gpio();
// Promise
GPIO.promise = {
DIR_IN: DIR_IN,
DIR_OUT: DIR_OUT,
DIR_LOW: DIR_LOW,
DIR_HIGH: DIR_HIGH,
MODE_RPI: MODE_RPI,
MODE_BCM: MODE_BCM,
EDGE_NONE: EDGE_NONE,
EDGE_RISING: EDGE_RISING,
EDGE_FALLING: EDGE_FALLING,
EDGE_BOTH: EDGE_BOTH,
/**
* @see {@link Gpio.setup}
* @param channel
* @param direction
* @param edge
* @returns {Promise}
*/
setup: function (channel, direction, edge) {
return new Promise(function (resolve, reject) {
function done(error) {
if (error) return reject(error);
resolve();
}
GPIO.setup(channel, direction, edge, done)
})
},
/**
* @see {@link Gpio.write}
* @param channel
* @param value
* @returns {Promise}
*/
write: function (channel, value) {
return new Promise(function (resolve, reject) {
function done(error) {
if (error) return reject(error);
resolve();
}
GPIO.write(channel, value, done)
})
},
/**
* @see {@link Gpio.read}
* @param channel
* @returns {Promise}
*/
read: function (channel) {
return new Promise(function (resolve, reject) {
function done(error, result) {
if (error) return reject(error);
resolve(result);
}
GPIO.read(channel, done)
})
},
/**
* @see {@link Gpio.destroy}
* @returns {Promise}
*/
destroy: function () {
return new Promise(function (resolve, reject) {
function done(error) {
if (error) return reject(error);
resolve();
}
GPIO.destroy(done)
})
},
on: GPIO.on.bind(GPIO),
once: GPIO.once.bind(GPIO),
addListener: GPIO.addListener.bind(GPIO),
removeListener: GPIO.removeListener.bind(GPIO),
removeAllListeners: GPIO.removeAllListeners.bind(GPIO),
};
module.exports = GPIO;
| JamesBarwell/rpi-gpio.js | rpi-gpio.js | JavaScript | mit | 16,441 |
#!/usr/bin/env node
var adventure = require('adventure');
var shop = adventure('example-adventure');
var problems = [
'hide-and-seek'
];
problems.forEach(function (prob) {
shop.add(prob, function () { return require('./problems/' + prob) });
});
shop.execute(process.argv.slice(2));
| substack/unix-adventure | runner.js | JavaScript | mit | 293 |
$(function() {
$('.social-widget.mobile').on('click', function() {
$('.social-widget.mobile').toggleClass('hidden');
});
});
| TelerikAcademy/Telerik-Academy-Slides-Theme | theme/js/main.js | JavaScript | mit | 133 |
window.require = function (path) {
if (path == 'upper-case')
return {
__esModule: true,
default: function (text) {
return text.toUpperCase();
}
};
else
return {};
};
| monkberry/monkberry | spec/support/require.polyfill.js | JavaScript | mit | 209 |
import {basicModel} from "../fixtures/PropertiesModel.schemas";
const _d = {
name: "Ed Testy",
age: 99,
active: true,
};
describe("node commonjs require", () => {
const {Model} = require("../index");
let _model;
beforeEach(() => {
_model = new Model({
schemas: [basicModel],
});
});
it("should import Model and create document", ()=> {
_model.model = {
foo: "bar"
};
expect(_model.model.foo).toBe("bar");
});
it("should be an observable", (done) => {
let _ival = 0;
const _arr = new Array(0, 2000);
const _iterator = {
next: (
() => _ival++ < _arr.length ? {
value: _model.model = _d,
done: false,
} : {
value: _model.freeze(),
done: true,
}
),
};
_model.subscribe({next: _iterator.next, complete: done});
_iterator.next();
});
});
| Webfreshener/JSD | src/dist.test.js | JavaScript | mit | 1,044 |
UIALogger.logStart("Start");
var target = UIATarget.localTarget();
target.frontMostApp().navigationBar().rightButton().tap();
target.frontMostApp().navigationBar().rightButton().tap();
target.frontMostApp().navigationBar().rightButton().tap();
target.frontMostApp().mainWindow().tableViews()[0].tapWithOptions({tapOffset:{x:0.66, y:0.27}});
target.frontMostApp().navigationBar().leftButton().tap();
UIALogger.logPass("Success");
| christiancabarrocas/UIAutomation | tests.js | JavaScript | mit | 432 |
require("./49.js");
require("./98.js");
require("./196.js");
require("./391.js");
module.exports = 392; | skeiter9/javascript-para-todo_demo | webapp/node_modules/webpack/benchmark/fixtures/392.js | JavaScript | mit | 103 |
angular.module('memeMarket')
.controller('StocksController', function($rootScope, $scope, ApiService) {
$scope.name = 'Stocks';
(function initController() {
refreshSymbols();
})();
function refreshSymbols() {
var data = {};
if ($rootScope.currentUser)
data.user_id = $rootScope.currentUser.uid;
ApiService.GetSymbols(data).then(function (symbolData) {
$scope.stocks = symbolData;
$scope.stocks.sort(function(a, b) {
return (a.symbol < b.symbol) ? -1 : (a.symbol > b.symbol) ? 1 : 0;
});
if ($scope.selectedStock) {
$scope.selectedStock = $scope.stocks.filter(function (el) {
return el.symbol === $scope.selectedStock.symbol;
})[0];
} else {
$scope.selectedStock = $scope.stocks[0];
}
});
setTimeout(refreshSymbols, 3000);
}
$scope.selectStock = function(stock) {
$scope.selectedStock = stock;
}
$scope.$watch('selectedStock', function(newStock, oldStock) {
$rootScope.$broadcast('selectedStock', {
stock: newStock
});
});
$scope.isSelected = function(stock) {
return $scope.selectedStock != null && $scope.selectedStock.symbol === stock.symbol;
}
}); | andrewbrooke/meme-market | public/components/stocks/stocks.js | JavaScript | mit | 1,146 |
'use strict';
var _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; };
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
import warning from 'warning';
import { parse, stringify } from 'query-string';
import runTransitionHook from './runTransitionHook';
import { parsePath } from './PathUtils';
import deprecate from './deprecate';
var SEARCH_BASE_KEY = '$searchBase';
function defaultStringifyQuery(query) {
return stringify(query).replace(/%20/g, '+');
}
var defaultParseQueryString = parse;
function isNestedObject(object) {
for (var p in object) {
if (object.hasOwnProperty(p) && typeof object[p] === 'object' && !Array.isArray(object[p]) && object[p] !== null) return true;
}return false;
}
/**
* Returns a new createHistory function that may be used to create
* history objects that know how to handle URL queries.
*/
function useQueries(createHistory) {
return function () {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var stringifyQuery = options.stringifyQuery;
var parseQueryString = options.parseQueryString;
var historyOptions = _objectWithoutProperties(options, ['stringifyQuery', 'parseQueryString']);
var history = createHistory(historyOptions);
if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery;
if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString;
function addQuery(location) {
if (location.query == null) {
var search = location.search;
location.query = parseQueryString(search.substring(1));
location[SEARCH_BASE_KEY] = { search: search, searchBase: '' };
}
// TODO: Instead of all the book-keeping here, this should just strip the
// stringified query from the search.
return location;
}
function appendQuery(location, query) {
var _extends2;
var searchBaseSpec = location[SEARCH_BASE_KEY];
var queryString = query ? stringifyQuery(query) : '';
if (!searchBaseSpec && !queryString) {
return location;
}
process.env.NODE_ENV !== 'production' ? warning(stringifyQuery !== defaultStringifyQuery || !isNestedObject(query), 'useQueries does not stringify nested query objects by default; ' + 'use a custom stringifyQuery function') : undefined;
if (typeof location === 'string') location = parsePath(location);
var searchBase = undefined;
if (searchBaseSpec && location.search === searchBaseSpec.search) {
searchBase = searchBaseSpec.searchBase;
} else {
searchBase = location.search || '';
}
var search = searchBase;
if (queryString) {
search += (search ? '&' : '?') + queryString;
}
return _extends({}, location, (_extends2 = {
search: search
}, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2));
}
// Override all read methods with query-aware versions.
function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
runTransitionHook(hook, addQuery(location), callback);
});
}
function listen(listener) {
return history.listen(function (location) {
listener(addQuery(location));
});
}
// Override all write methods with query-aware versions.
function push(location) {
history.push(appendQuery(location, location.query));
}
function replace(location) {
history.replace(appendQuery(location, location.query));
}
function createPath(location, query) {
process.env.NODE_ENV !== 'production' ? warning(!query, 'the query argument to createPath is deprecated; use a location descriptor instead') : undefined;
return history.createPath(appendQuery(location, query || location.query));
}
function createHref(location, query) {
process.env.NODE_ENV !== 'production' ? warning(!query, 'the query argument to createHref is deprecated; use a location descriptor instead') : undefined;
return history.createHref(appendQuery(location, query || location.query));
}
function createLocation(location) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args));
if (location.query) {
fullLocation.query = location.query;
}
return addQuery(fullLocation);
}
// deprecated
function pushState(state, path, query) {
if (typeof path === 'string') path = parsePath(path);
push(_extends({ state: state }, path, { query: query }));
}
// deprecated
function replaceState(state, path, query) {
if (typeof path === 'string') path = parsePath(path);
replace(_extends({ state: state }, path, { query: query }));
}
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,
push: push,
replace: replace,
createPath: createPath,
createHref: createHref,
createLocation: createLocation,
pushState: deprecate(pushState, 'pushState is deprecated; use push instead'),
replaceState: deprecate(replaceState, 'replaceState is deprecated; use replace instead')
});
};
}
export default useQueries; | qianyuchang/React-Chat | App/Client/node_modules/history/es6/useQueries.js | JavaScript | mit | 5,820 |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Button from '../Button';
import LogBasicInfo from '../LogBasicInfo';
import styles from './styles.scss';
import i18n from './i18n';
export default function LogNotification(
{
formatPhone,
currentLog,
currentLocale,
isExpand,
onStay,
onDiscard,
onSave,
onExpand,
}
) {
return (
<div className={styles.container}>
<div className={styles.basicInfo}>
<LogBasicInfo
currentLog={currentLog}
currentLocale={currentLocale}
formatPhone={formatPhone}
/>
<Button
disabled={isExpand}
className={classnames(styles.expandButton, isExpand && styles.expandDisableButton)}
onClick={() => onExpand()}>
{i18n.getString('log', currentLocale)}
</Button>
</div>
{
isExpand ? (
<div className={styles.confirmationContainer}>
<div className={styles.confirmationInfo}>
{i18n.getString('confirmationInfo', currentLocale)}
</div>
<div className={styles.confirmationButtons}>
{
onSave ? (
<Button
className={classnames(styles.saveButton, styles.selected)}
onClick={() => onSave()}>
{i18n.getString('save', currentLocale)}
</Button>
) : null
}
{
onDiscard ? (
<Button
className={styles.discardButton}
onClick={() => onDiscard()}>
{i18n.getString('discard', currentLocale)}
</Button>
) : null
}
{
onStay ? (
<Button
className={styles.stayButton}
onClick={() => onStay()}>
{i18n.getString('stay', currentLocale)}
</Button>
) : null
}
</div>
</div>
) : null
}
</div>
);
}
LogNotification.propTypes = {
currentLocale: PropTypes.string.isRequired,
currentLog: PropTypes.object,
formatPhone: PropTypes.func,
isExpand: PropTypes.bool,
onStay: PropTypes.func,
onDiscard: PropTypes.func,
onSave: PropTypes.func,
onExpand: PropTypes.func,
};
LogNotification.defaultProps = {
currentLog: {},
formatPhone: undefined,
isExpand: undefined,
onStay: undefined,
onDiscard: undefined,
onSave: undefined,
onExpand: undefined,
};
| u9520107/ringcentral-js-widget | packages/ringcentral-widgets/components/LogNotification/index.js | JavaScript | mit | 2,676 |
import keyMirror from 'keyMirror';
const ActionKeys = keyMirror({
// Sample Actions
SET_SAMPLE_VALUE: 1
});
export default ActionKeys;
| smore-inc/react-native-hackathon-bootstrap | ReactApp/data/Actions/ActionKeys.js | JavaScript | mit | 142 |
const Corrode = require('../corrode');
const HEADER = {
signature: 0x41444620,
revision: 0x04
};
/**
* @return {
* instanceTableSize uint32,
* instanceTableOffset uint32,
* typeTableSize uint32,
* typeTableOffset uint32,
* stringHashTableSize uint32,
* stringHashTableOffset uint32,
* stringTableSize uint32,
* stringTableOffset uint32,
* addressedFileSize uint32,
* comment string
* }
*/
Corrode.addExtension('adfMeta', function(){
this
.tap('header', function(){
this
.uint32('signature')
.uint32('revision');
})
.assert.deepEqualObject('header', HEADER)
.tap('meta', function(){
this
.uint32('instanceTableSize')
.uint32('instanceTableOffset')
.uint32('typeTableSize')
.uint32('typeTableOffset')
.uint32('stringHashTableSize')
.uint32('stringHashTableOffset')
.uint32('stringTableSize')
.uint32('stringTableOffset')
.uint32('addressedFileSize');
})
.tap('sanityChecks', function(){
this
.uint32('flag1')
.uint32('flag2')
.uint32('flag3')
.uint32('flag4')
.uint32('flag5');
})
.assert.allEqualObject('sanityChecks', 0)
.terminatedString('comment')
.tap(function(){
this.vars = {
...this.vars.meta,
comment: this.vars.comment
};
});
});
/**
* @return {
* stringTable <stringTable>,
* stringHashTable <stringHashTable>,
* typeTable <typeTable>,
* instanceTable <instanceTable>,
* }
*/
Corrode.addExtension('adf', function(){
this
.ext.adfMeta('meta')
.tap(function(){
this
.position(this.vars.meta.stringTableOffset)
.ext.stringTable('stringTable', this.vars.meta.stringTableSize)
.position(this.vars.meta.stringHashTableOffset)
.ext.stringHashTable('stringHashTable', this.vars.meta.stringHashTableSize);
})
.tap(function(){
this
.position(this.vars.meta.typeTableOffset)
.ext.typeTable('typeTable', this.vars.stringTable, this.vars.meta.typeTableSize);
})
.tap(function(){
this
.position(this.vars.meta.instanceTableOffset)
.ext.instanceTable('instanceTable', this.vars.stringTable, this.vars.typeTable, this.vars.meta.instanceTableSize);
})
.tap(function(){
this.vars = {
stringTable: this.vars.stringTable,
stringHashTable: this.vars.stringHashTable,
typeTable: this.vars.typeTable,
instanceTable: this.vars.instanceTable
};
});
});
| screeny05/node-jc3 | src/lib/types/adf.js | JavaScript | mit | 3,003 |
{
"%s ago": "hace %s",
"%d unread message": {
"one": "%d unread message",
"other": "%d unread messages"
}
}
| Bashar/gitter-translations | es.js | JavaScript | mit | 122 |
require(__dirname + '/applicationSelector.ctrl.js') | annielcook/Silhouette | app/loggedIn/applications/applicationSelector/index.js | JavaScript | mit | 51 |
window.fooParamList = [
{
name: 'foo',
type: 'String',
desc: 'foo'
},
{
name: 'ignore',
type: 'String',
desc: 'ignore',
ignore: true
},
{
name: 'bar',
type: 'String',
desc: 'bar'
}
]
| zyy7259/regular-strap | test/params/fooParamList.js | JavaScript | mit | 235 |
'use strict';
const Slack = require('node-slack');
module.exports = function (attr) {
return function (callback) {
if (typeof(attr.server.slack) !== 'undefined') {
const slack = new Slack(attr.server.slack.hookurl);
slack.send({
text: `Deploy new version http://${attr.server.address}/ finished.`,
channel: `#${attr.server.slack.channel}`,
username: 'Bot Deployer'
});
}
callback();
};
};
| joshuan/bolt | app/tasks/slack.js | JavaScript | mit | 509 |
var React = require('../react');
var FieldValueMixin = require('../FieldValueMixin');
var css = require('../css');
var Constants = require('../Constants')
var makeFormatter = require('../formatter');
function ret(op) {
return op;
}
var dateRe = /^([0,1]?\d?)(?:\/?(\d{0,2}))?$/;
var zipRe = /^(\d{0,5})(?:[^\d]?(\d{0,4}))?$/;
function lastEq(input, val) {
return input && input[input.length - 1] === val;
}
function defaultValidator(value, regex) {
return regex.test(value);
}
function createValidator(validator, loader) {
if (validator === void(0)) {
return defaultValidator;
}
if (typeof validator === 'function') {
return validator;
}
if (typeof validator === 'string') {
validator = loader.loadValidator(validator)();
return function (value) {
return !validator(value)
}
}
if (validator instanceof RegExp) {
return RegExp.prototype.test.bind(re)
}
throw 'Do not know what to do with ' + validator;
}
function title(value) {
value = value || '';
if (value.length === 0) {
return value;
}
return value.substring(0, 1).toUpperCase() + value.substring(1);
}
var RestrictedMixin = {
mixins: [require('../BasicFieldMixin'), require('../FieldValueDefaultPropsMixin'), require('../FieldHandleValueMixin')],
statics: {
inputClassName: Constants.inputClassName
},
getInitialState(){
var value = this.props.value ? this.formatter(this.props.value) : {
isValid: false,
value: ''
};
return {
value: value.value || '',
hasValidValue: value.isValid
}
},
setValue(value){
this.setState({value});
},
getValue(){
return this.state.value;
},
componentWillReceiveProps(props){
if (props.formatter !== this.props.formatter) {
this._formatter = null;
}
},
formatters: {
uszip(value, isBackspace){
value = (value || '').substring(0, 10);
var parts = zipRe.exec(value) || [], isValid = false;
if (parts) {
if (parts[2]) {
value = parts[1] + '-' + parts[2]
} else {
value = parts[1] || '';
}
isValid = value.length === 5 || value.length === 10;
} else {
value = '';
}
return {
value,
isValid
}
},
capitalize(value) {
return {value: title(value), isValid: false};
},
title(value, isBackspace){
value = value || '';
return {value: value.split(/\s+?/).map(title).join(' '), isValid: false};
},
creditcard: '#### #### #### ####',
shortDate(value, isBackspace){
var parts = dateRe.exec(value) || [];
if (parts.shift()) {
var str = '';
var last = parts.pop();
var mm = parts.shift();
if (mm.length === 2) {
str += mm + '/'
} else if (last || last === '') {
str += '0' + mm + '/'
} else {
str += mm;
}
str += (last || '');
return {
value: (isBackspace) ? str.substring(0, (lastEq(value, '/') ? value.length - 1 : value.length)) : str,
isValid: str.length === 5
};
}
if (value && value.trim() === '') {
return {
value: value.trim(),
isValid: false
}
}
return {
value: '',
isValid: false
}
}
},
formatter: function (value, isBackspace) {
if (this._formatter) {
return this._formatter.call(this, value, isBackspace);
}
var formatter = this.props.formatter;
if (typeof formatter === 'string') {
formatter = this.formatters[formatter] || formatter;
if (typeof formatter === 'function') {
return (this._formatter = formatter).call(this, value, isBackspace);
} else {
return (this._formatter = makeFormatter(formatter, createValidator(this.props.validator, this.props.loader))).call(this, value, isBackspace);
}
} else if (typeof formatter === 'function') {
return (this._formatter = formatter).call(this, value, isBackspace);
}
return value;
},
valueFromEvt: function (e) {
return e.target.value;
},
handleKeyDown(e){
if (this.props.onKeyDown) {
this.props.onKeyDown.call(this, e);
}
var pos = e.target.selectionStart, end = e.target.selectionEnd;
if (e.key === 'Enter') {
this.props.onValid(this.state.hasValidValue, {
isValid: this.state.hasValidValue,
value: this.state.value
});
return;
}
if (e.key === 'Delete') {
e.preventDefault();
var value = (this.state.value || '');
value = value.substring(0, pos) + value.substring(end);
this._value(value, false, pos);
return;
}
if (e.key === 'Backspace') {
e.preventDefault();
e.stopPropagation();
var value = (this.state.value || '');
var back = false;
if (pos === end) {
value = value.trim().substring(0, value.length - 1);
back = true;
} else {
value = value.substring(0, pos) + value.substring(end);
}
this._value(value, back, pos + value.length);
return;
}
},
_value(str, isBackspace, caret){
var value = this.formatter(str, isBackspace) || {isValid: false};
this.props.onValid(value.isValid, value);
this.props.handleChange(value.value);
if (caret != null) {
if (isBackspace) {
caret += value.position - 1;
} else {
caret += value.position + 1;
}
}
this.setState({
value: value.value,
hasValue: value.value.length !== 0,
hasValidValue: value.isValid
}, caret ? function () {
this.getDOMNode().setSelectionRange(caret, caret);
} : null);
},
handleValueChange(e){
this.props.onChange.call(this, e);
this._value(e.target.value, false, e.target.selectionEnd);
}
};
module.exports = RestrictedMixin; | pbarnes/subschema | src/types/RestrictedMixin.js | JavaScript | mit | 6,805 |
import Promise from 'lie'
import { expect } from 'chai'
import { invoke } from '../../lib/piggyback'
describe('piggyback.invoke', () => {
it('should be a function', () => {
expect(invoke).to.be.a('function')
})
it('should return a Promise if fn does not expect a callback', () => {
expect(invoke(() => {})).to.be.an.instanceOf(Promise)
})
it('should resolve if fn does not expect a callback and returns', () => {
expect(invoke(() => true)).to.be.fulfilled
})
it('should reject if fn does not expect a callback and throws', () => {
expect(invoke(() => {
throw 'err'
})).to.be.rejected
})
it('should return a Promise if fn expects a callback', () => {
expect(invoke((done) => {})).to.be.an.instanceOf(Promise)
})
it('should resolve if fn expects a callback and invokes with falsey first param', () => {
expect(invoke((done) => done(null))).to.be.fulfilled
})
it('should reject if fn expects a callback and invokes with truthy first param', () => {
expect(invoke((done) => done(true))).to.be.rejected
})
it('should reject if fn expects a callback and throws', () => {
expect(invoke((done) => {
throw 'err'
})).to.be.rejected
})
})
| codeandcraftnyc/piggyback.js | test/unit/piggyback.invoke.js | JavaScript | mit | 1,222 |
var $spaghetti = {
submitURL : $url.root() + '/controller/changeController',
updatedTable : function (response) {
$('.datatable').DataTable().destroy();
$('.dataTable-tbody').html('');
for(i=0; i<response.length; ++i){
var content = '<tr class="tableRow" data-id="' + response[i].spaghetti_id + '">' +
'<td>' + (i+1) + '</td>' +
'<td>' + response[i].spaghetti_name + '</td>' +
'<td> $ ' + response[i].spaghetti_price + '</td>' +
'<td>' +
'<div class="text-center">' +
'<button class="btn btn-info editSpaghetti" title="Edit"><i class="halflings-icon white edit"></i> Edit</button> ' +
'<button class="btn btn-danger dltSpaghetti" title="Delete"><i class="halflings-icon white trash"></i> Delete</button>' +
'</div>' +
'</td>' +
'</tr>';
$('.dataTable-tbody').append(content);
}
initDataTable();
}
};
$('.tableRow').each(function (i) {
$("td:first", this).html(i + 1);
});
$('button#addSpaghetti').click(function () {
$('#itemName').val('');
$('#itemPrice').val('');
$('#type').val('add');
$('.addItem').modal('show');
});
$('#addbtn').click(function(){
var $add = {
name : $('#itemName').val(),
cost : $('#itemPrice').val(),
type : $('#type').val()
};
if($add.name =='' || $add.cost == ''){
alert('Both fields must be filled');
}else{
$.ajax({
type: 'POST',
dataType: 'json',
url: $spaghetti.submitURL,
data: {
spaghettiName: $add.name,
spaghettiCost: $add.cost,
spaghettiAction: $add.type
},
cache: false,
error: function(){
$('.addItem').modal('hide');
$('.errorItem').modal('show');
},
success: function(response){
$spaghetti.updatedTable(response);
$('.addItem').modal('hide');
$('.saveItem').modal('show');
}
});
}
});
$(document).on('click', '.editSpaghetti', function(){
$('.addItem').modal('show', {
backdrop: 'static'
});
var $edit = {
name : $(this).closest('tr').find('td').eq(1).text(),
price : $(this).closest('tr').find('td').eq(2).text().split(' ')[2],
type : $(this).closest('tr').data('id')
};
$('#itemName').val($edit.name);
$('#itemPrice').val($edit.price);
$('#type').val($edit.type);
});
$(document).on('click', '.dltSpaghetti', function(){
var $dlt = {
key : $(this).closest('tr').data('id')
};
$('.deleteItem').modal('show', {
backdrop: 'static'
});
$(document).on('click', '.yes', function(){
$.ajax({
type: 'POST',
dataType: 'json',
url: $spaghetti.submitURL,
data: {
deleteSpaghettiKey : $dlt.key
},
error: function(){
$('.deleteItem').modal('hide');
$('.errorItem').modal('show');
},
success: function(response){
$spaghetti.updatedTable(response);
$('.deleteItem').modal('hide');
$('.dltSuccess').modal('show');
}
});
});
}); | salehOyon/Three-Aces | admin/js/spaghetti-script.js | JavaScript | mit | 3,460 |
class InstanceContainer {
addInstance(name, instance) {
this[name] = instance;
}
}
exports.InstanceContainer = InstanceContainer; | karurosux/rest-creds | helpers/instance-container.helper.js | JavaScript | mit | 138 |
export const def = (val) => (orig, next) => next(typeof orig === 'undefined' ? val : orig)
export const key = (key) => (object, next) => ({ ...object, [key]: next(object[key]) })
export const safe_key = (key) => (object, next) => ({
...object,
[key]: next(typeof object != 'undefined' ? object[key] : undefined),
})
export const id = (id) => (array, next) => array.map((k) => (k.id === id ? next(k) : k))
export const match = (test) => (array, next) => array.map((k, i) => (test(k, i) ? next(k) : k))
export const index = (index) => (array, next) =>
array.slice(0, index).concat([next(array[index])], array.slice(index + 1))
export const replace = (value) => (object, next) => value
export const merge = (value) => (object, next) => ({ ...object, ...value })
export const removeMatch = (test) => (array, next) => array.filter((k) => !test(k))
export const removeId = (id) => (array, next) => array.filter((k) => k.id !== id)
export const removeIndex = (index) => (array, next) =>
array.slice(0, index).concat(array.slice(index + 1))
export const insertAt = (item, index = 0) => (array, next) =>
array.slice(0, index).concat([item], array.slice(index))
export const prepend = (item) => (array, next) => [item].concat(array)
export const append = (item) => (array, next) => array.concat([item])
export const inc = (num, next) => (num || 0) + 1
export const dec = (num, next) => (num || 0) - 1
export const toggle = (bool, next) => !bool
export const each = (array, next) => array.map(next)
export const all = (object, next) => {
let clone = {}
for (let key in object) clone[key] = next(object[key])
return clone
}
export function apply(object, ...sequence) {
if (sequence.length === 0) return object
return coerce(sequence[0])(object, (obj) => apply(obj, ...sequence.slice(1)))
}
export function getAll(object, ...sequence) {
let values = []
apply(object, ...sequence, (value) => values.push(value))
return values
}
export function get(object, ...sequence) {
return getAll(object, ...sequence)[0]
}
function coerce(transform) {
if (typeof transform === 'string') return safe_key(transform)
if (typeof transform === 'function') return transform
return (_) => transform
}
| HVF/franchise | src/state/update.js | JavaScript | mit | 2,248 |
module.exports = require('./src/Umeng'); | Evilcome/umeng-node-sdk | index.js | JavaScript | mit | 40 |
/**
* Module dependencies.
*/
var SchemaType = require('../schematype')
, CastError = SchemaType.CastError;
/**
* String SchemaType constructor.
*
* @param {String} key
* @api private
*/
function SchemaString (key, options) {
this.enumValues = [];
this.regExp = null;
SchemaType.call(this, key, options, 'String');
};
/**
* Inherits from SchemaType.
*/
SchemaString.prototype.__proto__ = SchemaType.prototype;
/**
* Adds enumeration values
*
* @param {multiple} enumeration values
* @api public
*/
SchemaString.prototype.enum = function () {
var len = arguments.length;
if (!len || undefined === arguments[0] || false === arguments[0]) {
if (this.enumValidator){
this.enumValidator = false;
this.validators = this.validators.filter(function(v){
return v[1] != 'enum';
});
}
return;
}
for (var i = 0; i < len; i++) {
if (undefined !== arguments[i]) {
this.enumValues.push(this.cast(arguments[i]));
}
}
if (!this.enumValidator) {
var values = this.enumValues;
this.enumValidator = function(v){
return ~values.indexOf(v);
};
this.validators.push([this.enumValidator, 'enum']);
}
};
/**
* Adds a lowercase setter
*
* @api public
*/
SchemaString.prototype.lowercase = function () {
return this.set(function (v) {
return v.toLowerCase();
});
};
/**
* Adds an uppercase setter
*
* @api public
*/
SchemaString.prototype.uppercase = function () {
return this.set(function (v) {
return v.toUpperCase();
});
};
/**
* Adds a trim setter
*
* @api public
*/
SchemaString.prototype.trim = function () {
return this.set(function (v) {
return v.trim();
});
};
/**
* Sets a regexp test
*
* @param {RegExp} regular expression to test against
* @param {String} optional validator message
* @api public
*/
SchemaString.prototype.match = function(regExp){
this.validators.push([function(v){
return regExp.test(v);
}, 'regexp']);
};
/**
* Check required
*
* @api private
*/
SchemaString.prototype.checkRequired = function checkRequired (value) {
if (SchemaType._isRef(this, value, true)) {
return null !== value;
} else {
return (value instanceof String || typeof value == 'string') && value.length;
}
};
/**
* Casts to String
*
* @api private
*/
SchemaString.prototype.cast = function (value, scope, init) {
if (SchemaType._isRef(this, value, init)) return value;
if (value === null) return value;
if ('undefined' !== typeof value && value.toString) return value.toString();
throw new CastError('string', value);
};
function handleSingle (val) {
return this.castForQuery(val);
}
function handleArray (val) {
var self = this;
return val.map(function (m) {
return self.castForQuery(m);
});
}
SchemaString.prototype.$conditionalHandlers = {
'$ne' : handleSingle
, '$in' : handleArray
, '$nin': handleArray
, '$gt' : handleSingle
, '$lt' : handleSingle
, '$gte': handleSingle
, '$lte': handleSingle
, '$all': handleArray
, '$regex': handleSingle
};
SchemaString.prototype.castForQuery = function ($conditional, val) {
var handler;
if (arguments.length === 2) {
handler = this.$conditionalHandlers[$conditional];
if (!handler)
throw new Error("Can't use " + $conditional + " with String.");
return handler.call(this, val);
} else {
val = $conditional;
if (val instanceof RegExp) return val;
return this.cast(val);
}
};
/**
* Module exports.
*/
module.exports = SchemaString;
| zencephalon/deftdraftjs | node_modules/mongoose/lib/schema/string.js | JavaScript | mit | 3,538 |
var AmpersandModel = require("nativescript-ampersand/model");
module.exports = AmpersandModel.extend({
urlRoot: "https://jsonplaceholder.typicode.com/todos",
// Properties this model will store
props: {
userId: {
type: 'number'
},
title: {
type: 'string',
default: ''
},
completed: {
type: 'boolean',
default: false
}
},
// session properties work the same way as `props`
// but will not be included when serializing.
session: {
editing: {
type: 'boolean',
default: false
}
},
destroy: function () {
if (this.collection) {
this.collection.remove(this);
}
}
}); | dapriett/nativescript-ampersand | demo/app/models/todo.js | JavaScript | mit | 671 |
const ms = require('ms');
const Now = require('../lib');
async function parsePlan(json) {
const { subscription } = json
let id;
let until;
let name
if (subscription) {
const planItems = subscription.items.data;
const mainPlan = planItems.find(d => d.plan.metadata.is_main_plan === '1');
if (mainPlan) {
id = mainPlan.plan.id
name = mainPlan.plan.name
if (subscription.cancel_at_period_end) {
until = ms(
new Date(subscription.current_period_end * 1000) - new Date(),
{ long: true }
);
}
} else {
id = 'oss'
}
} else {
id = 'oss';
}
return { id, name, until };
}
module.exports = class Plans extends Now {
async getCurrent() {
const res = await this._fetch('/plan');
const json = await res.json()
return parsePlan(json);
}
async set(plan) {
const res = await this._fetch('/plan', {
method: 'PUT',
body: { plan }
});
const json = await res.json()
if (res.ok) {
return parsePlan(json);
}
const err = new Error(json.error.message);
err.code = json.error.code
throw err;
}
};
| southpolesteve/now-cli | lib/plans.js | JavaScript | mit | 1,157 |
import ext from './ext';
var utils = {};
utils.event = function () {
function addListener(eventName, callback) {
ext.runtime.onMessage.addListener((message, sender, response) => {
if (eventName === message._event) {
callback(message._data, response);
}
});
}
function trigger(eventName, data, callback) {
ext.runtime.sendMessage({
_event: eventName,
_data: data
}, callback);
}
function triggerTab(tabId, eventName, data, callback) {
ext.tabs.sendMessage(tabId, {
_event: eventName,
_data: data
}, null, callback)
}
return {addListener, trigger, triggerTab}
}();
utils.getList = (Object, cb) => {
let list = [];
for (let key in Object) {
list.push(cb(Object[key], key))
}
return list;
};
utils.loadImage = (src) => new Promise((resolve, reject) => {
let img = new Image();
img.onload = function () {
resolve(img)
};
img.onerror = function () {
reject()
};
img.src = src;
});
export default utils; | KSOra/pixison-extension | src/public/util.js | JavaScript | mit | 1,133 |
var runSequence = require('run-sequence');
module.exports = function(done) {
runSequence(
"jshint-tasks",
"clean-dist",
"scss",
"tslint",
"typescript",
"copy-misc",
function() {
done();
});
}; | DamienDennehy/WebSandbox | WebTemplate/tasks/build.js | JavaScript | mit | 273 |
#import "try.js"
// VideoInfo - Get global video metadata
var VideoInfo = (function() {
var self = {
init: init,
};
// init() - Populates the VideoInfo object with video metadata
function init()
{
self.title = Try.all(
function() {
return ytplayer.config.args.title;
},
function() {
return document.querySelector("meta[name=title]").getAttribute("content");
},
function() {
return document.querySelector("meta[property=\"og:title\"]").getAttribute("content");
},
function() {
return document.querySelector("#watch-headline-title > .yt-uix-expander-head").getAttribute("title");
},
function() {
return document.title.match(/^(.*) - YouTube$/)[1];
}
);
self.author = Try.all(
function() {
return document.querySelector("#watch7-user-header > .yt-user-name").textContent;
},
function() {
return document.querySelector("#watch7-user-header .yt-thumb-clip img").getAttribute("alt");
},
function() {
return document.querySelector("span[itemprop=author] > link[itemprop=url]").getAttribute("href").match(/www.youtube.com\/user\/([^\/]+)/)[1];
}
);
self.date = Try.all(
function() {
return new Date(document.getElementById("eow-date").textContent);
}
);
self.video_id = Try.all(
function() {
return new URI(document.location.href).query.v;
}
);
self.seconds = Try.all(
function() {
return Math.floor(Number(ytplayer.config.args.length_seconds));
}
);
if (self.date)
{
self.day = ("0" + self.date.getDate()).match(/..$/)[0];
self.month = ("0" + (self.date.getMonth() + 1)).match(/..$/)[0];
self.year = self.date.getFullYear().toString();
self.date.toString = function() {
return self.year + "-" + self.month + "-" + self.day;
};
}
if (self.seconds)
self.duration = Math.floor(self.seconds / 60) + ":" + self.seconds % 60;
}
return self;
})();
| rossy/youtube-video-download | src/videoinfo.js | JavaScript | mit | 1,913 |
"use strict"
var fs = require('fs');
// write the error message to stdout and then tell make to stop with an error by causing it to
// execute the $(error ) function - then exit this node process (with an error exit code, but make
// ignores the exit code)
module.exports.make_assert = (err, str) => {
if (err) {
console.error(str || '' + err);
console.log('$(error )');
process.exit(1);
}
};
module.exports.assert = (err, str) => {
if (err) {
console.error(str || '' + err);
process.exit(1);
}
};
// read the given file (name) into a string, and once it has been thusly read, call the given
// "start" function, passing it the string
module.exports.read_file_and_start = (file_name, first_pass_make, start_func) => {
let _assert = first_pass_make ? module.exports.make_assert : module.exports.assert;
fs.stat(file_name, (error, stats) => {
module.exports.make_assert(error);
fs.open(file_name, 'r', (error, fd) => {
_assert(error);
let buffer = new Buffer(stats.size);
fs.read(fd, buffer, 0, stats.size, null, (error, bytesRead, buffer) => {
fs.close(fd);
_assert(error);
_assert(bytesRead != stats.size, 'incomplete read of file: ' + file_name + ', only read ' + bytesRead + ' bytes of ' + stats.size);
start_func(buffer.toString());
});
});
});
};
// the root directory named used in the s3 buckets for items we put in there
module.exports.root_dir = 'code/';
| pkholland/mutantspider | mutantspider.js | JavaScript | mit | 1,474 |
global.soc = function(server, port, callback){
var net = require("net");
var socket = 0;
this.init = function(){
socket = net.Socket({
allowHalfOpen: false,
readable: true,
writable: true
});
socket.connect(port, server);
socket.on('connect', function(e){
console.log('connected');
});
socket.on('timeout', function(){
console.log('socket timeout');
});
socket.on('error', function(){
console.log('Socket connection error');
});
socket.on('close', function(){
console.log('Socket connection closed');
});
socket.on('data', function(data){
callback(data);
});
};
this.send = function(data){
socket.write(data, function(e){
console.log('data sent');
});
};
this.close = function(){
socket.destroy();
};
this.init();
};
var connection = new soc("localhost", 8080, function(e){
console.log(e);
});
| guts2014/where-s-our-food | scrollingElements/net.js | JavaScript | mit | 1,080 |
var sg = sg || {};
sg.paths = sg.paths || {};
(function() {
sg.paths.BSpline = function(type, points) {
this.type = type;
this.points = points;
};
sg.paths.BSpline.prototype.evaluate = function(t) {
var clamped = Math.min(this.upperDomainBound(), t);
var index = Math.floor(clamped);
if (index >= 1 && clamped == index) index -= 1;
var u = clamped - index;
var un = 1 - u;
var result = this.type.scale(this.type.create(), this.points[index], 0.5 * un * un);
this.type.scaleAndAdd(result, result, this.points[index + 1], 0.5 + un * u);
return this.type.scaleAndAdd(result, result, this.points[index + 2], 0.5 * u * u);
};
sg.paths.BSpline.prototype.derivative = function(t) {
var clamped = Math.min(this.upperDomainBound(), t);
var index = Math.floor(clamped);
if (index >= 1 && clamped == index) index -= 1;
var u = clamped - index;
var result = this.type.scale(this.type.create(), this.points[index], u - 1);
this.type.scaleAndAdd(result, result, this.points[index + 1], 1 - 2 * u);
return this.type.scaleAndAdd(result, result, this.points[index + 2], u);
};
sg.paths.BSpline.prototype.lowerDomainBound = function() {
return 0;
};
sg.paths.BSpline.prototype.upperDomainBound = function() {
return this.points.length - 2;
};
sg.paths.BSpline.prototype.transform = function(m) {
var result = [];
for (var i = 0; i < this.points.length; i++) {
var transformed = this.type.transformMat4(
this.type.create(),
this.points[i],
m);
result.push(transformed);
}
return new sg.paths.BSpline(this.type, result);
};
})();
| andres-arana/degree-6671-tp-1c2014 | source/javascripts/paths/bspline.js | JavaScript | mit | 1,671 |
'use strict';
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const compression = require('compression');
const cors = require('cors');
const auth = require('http-auth');
const morgan = require('morgan');
const jsforce = require('jsforce');
const port = process.env.PORT || 3000;
// Basic auth
// Set USER and PASSWORD environment variables
const basic = auth.basic({
realm: 'Lightning Developer Tools'
}, (username, password, callback) =>
callback(username === process.env.USERNAME && password === process.env.PASSWORD));
if (process.env.USERNAME && process.env.PASSWORD) {
app.use(auth.connect(basic));
}
app.use(cors());
app.use(bodyParser.json());
app.use(compression());
app.use(morgan('combined'));
app.use('/', express.static('./dist'));
app.post('/describeMetadata', (req, res) => {
console.log('body', req.body);
let conn = new jsforce.Connection(req.body);
conn.metadata.describe((err, result) => {
if(err) res.json(err);
console.log('result', result);
res.json(result);
});
});
app.listen(port, () =>
console.log(`Listening on ${port}!`)); | dangt85/lightningdevtools | server.js | JavaScript | mit | 1,147 |
import draw from './ui'
import findFirstPositiveZeroCrossing from './findFirstPositiveZeroCrossing'
class Oscilloscope {
constructor(analyser, width, height) {
this.analyser = analyser
this.data = new Uint8Array(analyser.frequencyBinCount)
this.width = width
this.height = height
this.draw = this.draw.bind(this)
}
draw(context) {
let data = this.data
let scaling = this.height / 256
this.analyser.getByteTimeDomainData(data)
context.fillStyle = `#ffffff`
context.fillRect(0, 0, this.width, this.height)
context.strokeStyle = `#D94882`
context.beginPath()
let zeroCross = findFirstPositiveZeroCrossing(data, this.width)
context.moveTo(0, (256 - data[zeroCross]) * scaling)
for (let i = zeroCross, j = 0; (j < this.width) && (i < data.length); i++, j++) {
context.lineTo(j, (256 - data[i]) * scaling)
}
context.stroke()
}
}
export default ctx => {
let analyser = ctx.createAnalyser()
analyser.fftSize = 2048
let myOscilloscope = new Oscilloscope(analyser, 512, 256)
draw(myOscilloscope)
return analyser
}
| alex-wilmer/synth-starter | src/Oscilloscope/index.js | JavaScript | mit | 1,107 |
/**
* Handles the db setup - adds the questions to the database if not there already
* and handles the db connection
*/
var
//socketio ui stuff
io = require('socket.io'), //socket.io - used for our websocket connection
client = require('socket.io-client'),
socketServer = null,
TwitterController = require('./TwitterController');
pkg = require('../../package.json');
var SocketController = {
setup : function (app, server, config) {
//Start a Socket.IO listen
socketServer = io.listen(server);
// ==================
// === ON CONNECT ===
// ==================
//If a client connects, give them the current data that the server has tracked
//so here that would be how many tweets of each type we have stored
socketServer.sockets.on('connection', function(socket) {
console.log('ui : new connection logged');
MsgController.UI.newConnection(socket);
});
// ============================
// === SERVER ERROR LOGGING ===
// ============================
socketServer.sockets.on('close', function(socket) {
console.log('ui : socketServer has closed');
});
},
emitMsg : function (msg, data) {
socketServer.sockets.emit(msg, data);
}
}
var _self = SocketController;
module.exports = SocketController; | CiaranPark/node-iBeacon-scanner | app/controllers/SocketController.js | JavaScript | mit | 1,265 |
/*
jCanvas v14.03.20
Copyright 2014 Caleb Evans
Released under the MIT license
*/
(function(f,wa,xa,Ua,da,fa,na,n,w,h,k){function K(d){var c;if(L.future.inheritance)for(c in d)d.hasOwnProperty(c)&&(this[c]=d[c]);else X(this,d)}function L(d){var c;if(d)X(aa,d);else for(c in aa)aa.hasOwnProperty(c)&&delete aa[c];na&&na.warn&&!ya.jCanvas&&(ya.jCanvas=n,na.warn("The jCanvas() method has been deprecated and will be removed in a future release."));return this}function za(){}function ka(d){return"string"===ba(d)}function H(d){return d&&d.getContext?d.getContext("2d"):h}function la(d){d=
X({},d);d.masks=d.masks.slice(0);return d}function ga(d,c){var a;d.save();a=la(c.transforms);c.savedTransforms.push(a)}function Aa(d,c,a,b){a[b]&&(ea(a[b])?c[b]=a[b].call(d,a):c[b]=a[b])}function S(d,c,a){Aa(d,c,a,"fillStyle");Aa(d,c,a,"strokeStyle");c.lineWidth=a.strokeWidth;a.rounded?c.lineCap=c.lineJoin="round":(c.lineCap=a.strokeCap,c.lineJoin=a.strokeJoin,c.miterLimit=a.miterLimit);c.shadowOffsetX=a.shadowX;c.shadowOffsetY=a.shadowY;c.shadowBlur=a.shadowBlur;c.shadowColor=a.shadowColor;c.globalAlpha=
a.opacity;c.globalCompositeOperation=a.compositing;a.imageSmoothing&&(c.webkitImageSmoothingEnabled=c.mozImageSmoothingEnabled=a.imageSmoothing)}function Ba(d,c,a){a.mask&&(a.autosave&&ga(d,c),d.clip(),c.transforms.masks.push(a._args))}function Y(d,c,a){a.closed&&c.closePath();a.shadowStroke&&0!==a.strokeWidth?(c.stroke(),c.fill(),c.shadowColor="transparent",c.shadowBlur=0,c.stroke()):(c.fill(),"transparent"!==a.fillStyle&&(c.shadowColor="transparent"),0!==a.strokeWidth&&c.stroke());a.closed||c.closePath();
a._transformed&&c.restore();a.mask&&(d=E(d),Ba(c,d,a))}function Ca(d,c,a){c._toRad=c.inDegrees?C/180:1;d.translate(c.x,c.y);d.rotate(c.rotate*c._toRad);d.translate(-c.x,-c.y);a&&(a.rotate+=c.rotate*c._toRad)}function Da(d,c,a){1!==c.scale&&(c.scaleX=c.scaleY=c.scale);d.translate(c.x,c.y);d.scale(c.scaleX,c.scaleY);d.translate(-c.x,-c.y);a&&(a.scaleX*=c.scaleX,a.scaleY*=c.scaleY)}function Ea(d,c,a){c.translate&&(c.translateX=c.translateY=c.translate);d.translate(c.translateX,c.translateY);a&&(a.translateX+=
c.translateX,a.translateY+=c.translateY)}function R(d,c,a,b,g){a._toRad=a.inDegrees?C/180:1;a._transformed=n;c.save();a.fromCenter||a._centered||b===k||(g===k&&(g=b),a.x+=b/2,a.y+=g/2,a._centered=n);a.rotate&&Ca(c,a,h);1===a.scale&&1===a.scaleX&&1===a.scaleY||Da(c,a,h);(a.translate||a.translateX||a.translateY)&&Ea(c,a,h)}function E(d){var c=ca.dataCache,a;c._canvas===d&&c._data?a=c._data:(a=f.data(d,"jCanvas"),a||(a={canvas:d,layers:[],layer:{names:{},groups:{}},eventHooks:{},intersecting:[],lastIntersected:h,
cursor:f(d).css("cursor"),drag:{layer:h,dragging:w},event:{type:h,x:h,y:h},events:{},transforms:la(oa),savedTransforms:[],animating:w,animated:h,pixelRatio:1,scaled:w},f.data(d,"jCanvas",a)),c._canvas=d,c._data=a);return a}function Fa(d,c,a){for(var b in L.events)L.events.hasOwnProperty(b)&&(a[b]||a.cursors&&a.cursors[b])&&Ga(d,c,a,b)}function Ga(d,c,a,b){window.ontouchstart!==k&&Z.touchEvents[b]&&(b=Z.touchEvents[b]);L.events[b](d,c);a._event=n}function Ha(d,c,a){var b,g,e;if(a.draggable||a.cursors){b=
["mousedown","mousemove","mouseup"];for(e=0;e<b.length;e+=1)g=b[e],Ga(d,c,a,g);c.events.mouseoutdrag||(d.bind("mouseout.jCanvas",function(){var a=c.drag.layer;a&&(c.drag={},O(d,c,a,"dragcancel"),d.drawLayers())}),c.events.mouseoutdrag=n);a._event=n}}function pa(d,c,a,b){d=c.layer.names;b?b.name!==k&&ka(a.name)&&a.name!==b.name&&delete d[a.name]:b=a;ka(b.name)&&(d[b.name]=a)}function qa(d,c,a,b){d=c.layer.groups;var g,e,l,f;if(!b)b=a;else if(b.groups!==k&&a.groups!==h)for(e=0;e<a.groups.length;e+=
1)if(g=a.groups[e],c=d[g]){for(f=0;f<c.length;f+=1)if(c[f]===a){l=f;c.splice(f,1);break}0===c.length&&delete d[g]}if(b.groups!==k&&b.groups!==h)for(e=0;e<b.groups.length;e+=1)g=b.groups[e],c=d[g],c||(c=d[g]=[],c.name=g),l===k&&(l=c.length),c.splice(l,0,a)}function ra(d,c,a,b,g){b[a]&&c._running&&!c._running[a]&&(c._running[a]=n,b[a].call(d[0],c,g),c._running[a]=w)}function O(d,c,a,b,g){if(!a.disableEvents){if("mouseout"!==b){var e;a.cursors&&(e=a.cursors[b]);-1!==f.inArray(e,W.cursors)&&(e=W.prefix+
e);e&&d.css({cursor:e})}ra(d,a,b,a,g);ra(d,a,b,c.eventHooks,g);ra(d,a,b,L.eventHooks,g)}}function N(d,c,a,b){var g,e=c._layer?a:c;c._args=a;if(c.draggable||c.dragGroups)c.layer=n,c.draggable=n;c._method=b?b:c.method?f.fn[c.method]:c.type?f.fn[Z.drawings[c.type]]:function(){};c.layer&&!c._layer&&(a=f(d),b=E(d),g=b.layers,e.name===h||ka(e.name)&&b.layer.names[e.name]===k)&&(e=new K(c),e.canvas=d,e.$canvas=f(d),e.layer=n,e._layer=n,e._running={},e.data=e.data!==h?X({},e.data):{},e.groups=e.groups!==
h?e.groups.slice(0):[],pa(a,b,e),qa(a,b,e),Fa(a,b,e),Ha(a,b,e),c._event=e._event,e._method===f.fn.drawText&&a.measureText(e),e.index===h&&(e.index=g.length),g.splice(e.index,0,e),c._args=e,O(a,b,e,"add"));return e}function Ia(d,c){var a,b;for(b=0;b<W.props.length;b+=1)a=W.props[b],d[a]!==k&&(d["_"+a]=d[a],W.propsObj[a]=n,c&&delete d[a])}function Va(d,c,a){var b,g,e,l;for(b in a)if(a.hasOwnProperty(b)&&(g=a[b],ea(g)&&(a[b]=g.call(d,c,b)),"object"===ba(g))){for(e in g)g.hasOwnProperty(e)&&(l=g[e],c[b]!==
k&&(c[b+"."+e]=c[b][e],a[b+"."+e]=l));delete a[b]}return a}function Ja(d){var c,a,b=[],g=1;d.match(/^([a-z]+|#[0-9a-f]+)$/gi)&&("transparent"===d&&(d="rgba(0,0,0,0)"),a=wa.head,c=a.style.color,a.style.color=d,d=f.css(a,"color"),a.style.color=c);d.match(/^rgb/gi)&&(b=d.match(/(\d+(\.\d+)?)/gi),d.match(/%/gi)&&(g=2.55),b[0]*=g,b[1]*=g,b[2]*=g,b[3]=b[3]!==k?fa(b[3]):1);return b}function Wa(d){var c=3,a;"array"!==ba(d.start)&&(d.start=Ja(d.start),d.end=Ja(d.end));d.now=[];if(1!==d.start[3]||1!==d.end[3])c=
4;for(a=0;a<c;a+=1)d.now[a]=d.start[a]+(d.end[a]-d.start[a])*d.pos,3>a&&(d.now[a]=Xa(d.now[a]));1!==d.start[3]||1!==d.end[3]?d.now="rgba("+d.now.join(",")+")":(d.now.slice(0,3),d.now="rgb("+d.now.join(",")+")");d.elem.nodeName?d.elem.style[d.prop]=d.now:d.elem[d.prop]=d.now}function Ya(d){L.events[d]=function(c,a){var b,g;g=a.event;b="mouseover"===d||"mouseout"===d?"mousemove":d;a.events[b]||(c.bind(b+".jCanvas",function(a){g.x=a.offsetX;g.y=a.offsetY;g.type=b;g.event=a;c.drawLayers({resetFire:n});
a.preventDefault()}),a.events[b]=n)}}function T(d,c,a){var b,g,e,l;if(a=a._args)d=E(d),b=d.event,b.x!==h&&b.y!==h&&(e=b.x*d.pixelRatio,l=b.y*d.pixelRatio,g=c.isPointInPath(e,l)||c.isPointInStroke&&c.isPointInStroke(e,l)),c=d.transforms,a.eventX=a.mouseX=b.x,a.eventY=a.mouseY=b.y,a.event=b.event,b=d.transforms.rotate,e=a.eventX,l=a.eventY,0!==b?(a._eventX=e*P(-b)-l*U(-b),a._eventY=l*P(-b)+e*U(-b)):(a._eventX=e,a._eventY=l),a._eventX/=c.scaleX,a._eventY/=c.scaleY,g&&d.intersecting.push(a),a.intersects=
g}function Ka(d){for(;0>d;)d+=2*C;return d}function La(d,c,a,b){var g,e,l,f,A,t,h;a===b?h=t=0:(t=a.x,h=a.y);b.inDegrees||360!==b.end||(b.end=2*C);b.start*=a._toRad;b.end*=a._toRad;b.start-=C/2;b.end-=C/2;A=C/180*1;b.ccw&&(A*=-1);g=b.x+b.radius*P(b.start+A);e=b.y+b.radius*U(b.start+A);l=b.x+b.radius*P(b.start);f=b.y+b.radius*U(b.start);ha(d,c,a,b,g,e,l,f);c.arc(b.x+t,b.y+h,b.radius,b.start,b.end,b.ccw);g=b.x+b.radius*P(b.end+A);A=b.y+b.radius*U(b.end+A);e=b.x+b.radius*P(b.end);l=b.y+b.radius*U(b.end);
ia(d,c,a,b,e,l,g,A)}function Ma(d,c,a,b,g,e,l,f){var A,t;b.arrowRadius&&!a.closed&&(t=Za(f-e,l-g),t-=C,d=a.strokeWidth*P(t),A=a.strokeWidth*U(t),a=l+b.arrowRadius*P(t+b.arrowAngle/2),g=f+b.arrowRadius*U(t+b.arrowAngle/2),e=l+b.arrowRadius*P(t-b.arrowAngle/2),b=f+b.arrowRadius*U(t-b.arrowAngle/2),c.moveTo(a-d,g-A),c.lineTo(l-d,f-A),c.lineTo(e-d,b-A),c.moveTo(l-d,f-A),c.lineTo(l+d,f+A),c.moveTo(l,f))}function ha(d,c,a,b,g,e,l,f){b._arrowAngleConverted||(b.arrowAngle*=a._toRad,b._arrowAngleConverted=
n);b.startArrow&&Ma(d,c,a,b,g,e,l,f)}function ia(d,c,a,b,g,e,l,f){b._arrowAngleConverted||(b.arrowAngle*=a._toRad,b._arrowAngleConverted=n);b.endArrow&&Ma(d,c,a,b,g,e,l,f)}function Na(d,c,a,b){var g,e,l;g=2;ha(d,c,a,b,b.x2+a.x,b.y2+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==k&&b.y1!==k&&c.moveTo(b.x1+a.x,b.y1+a.y);n;)if(e=b["x"+g],l=b["y"+g],e!==k&&l!==k)c.lineTo(e+a.x,l+a.y),g+=1;else break;g-=1;ia(d,c,a,b,b["x"+(g-1)]+a.x,b["y"+(g-1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function Oa(d,c,a,b){var g,e,l,f,A;g=2;
ha(d,c,a,b,b.cx1+a.x,b.cy1+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==k&&b.y1!==k&&c.moveTo(b.x1+a.x,b.y1+a.y);n;)if(e=b["x"+g],l=b["y"+g],f=b["cx"+(g-1)],A=b["cy"+(g-1)],e!==k&&l!==k&&f!==k&&A!==k)c.quadraticCurveTo(f+a.x,A+a.y,e+a.x,l+a.y),g+=1;else break;g-=1;ia(d,c,a,b,b["cx"+(g-1)]+a.x,b["cy"+(g-1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function Pa(d,c,a,b){var g,e,l,f,A,t,h,J;g=2;e=1;ha(d,c,a,b,b.cx1+a.x,b.cy1+a.y,b.x1+a.x,b.y1+a.y);for(b.x1!==k&&b.y1!==k&&c.moveTo(b.x1+a.x,b.y1+a.y);n;)if(l=b["x"+g],f=b["y"+
g],A=b["cx"+e],t=b["cy"+e],h=b["cx"+(e+1)],J=b["cy"+(e+1)],l!==k&&f!==k&&A!==k&&t!==k&&h!==k&&J!==k)c.bezierCurveTo(A+a.x,t+a.y,h+a.x,J+a.y,l+a.x,f+a.y),g+=1,e+=2;else break;g-=1;e-=2;ia(d,c,a,b,b["cx"+(e+1)]+a.x,b["cy"+(e+1)]+a.y,b["x"+g]+a.x,b["y"+g]+a.y)}function Qa(d,c,a){c*=d._toRad;c-=C/2;return a*P(c)}function Ra(d,c,a){c*=d._toRad;c-=C/2;return a*U(c)}function Sa(d,c,a,b){var g,e,l,f,h,t,$;a===b?h=f=0:(f=a.x,h=a.y);g=1;e=f=t=b.x+f;l=h=$=b.y+h;ha(d,c,a,b,e+Qa(a,b.a1,b.l1),l+Ra(a,b.a1,b.l1),
e,l);for(b.x!==k&&b.y!==k&&c.moveTo(e,l);n;)if(e=b["a"+g],l=b["l"+g],e!==k&&l!==k)f=t,h=$,t+=Qa(a,e,l),$+=Ra(a,e,l),c.lineTo(t,$),g+=1;else break;ia(d,c,a,b,f,h,t,$)}function sa(d,c,a){isNaN(Number(a.fontSize))||(a.fontSize+="px");c.font=a.fontStyle+" "+a.fontSize+" "+a.fontFamily}function ta(d,c,a,b){var g,e;g=ca.propCache;if(g.text===a.text&&g.fontStyle===a.fontStyle&&g.fontSize===a.fontSize&&g.fontFamily===a.fontFamily&&g.maxWidth===a.maxWidth&&g.lineHeight===a.lineHeight)a.width=g.width,a.height=
g.height;else{a.width=c.measureText(b[0]).width;for(e=1;e<b.length;e+=1)g=c.measureText(b[e]).width,g>a.width&&(a.width=g);c=d.style.fontSize;d.style.fontSize=a.fontSize;a.height=fa(f.css(d,"fontSize"))*b.length*a.lineHeight;d.style.fontSize=c}}function Ta(d,c){var a=c.maxWidth,b=c.text.split("\n"),g=[],e,l,f,h,t;for(f=0;f<b.length;f+=1){h=b[f];t=h.split(" ");e=[];l="";if(1===t.length||d.measureText(h).width<a)e=[h];else{for(h=0;h<t.length;h+=1)d.measureText(l+t[h]).width>a&&(""!==l&&e.push(l),l=
""),l+=t[h],h!==t.length-1&&(l+=" ");e.push(l)}g=g.concat(e.join("\n").replace(/( (\n))|( $)/gi,"$2").split("\n"))}return g}var ma,aa,X=f.extend,ja=f.inArray,ba=f.type,ea=f.isFunction,C=da.PI,Xa=da.round,$a=da.abs,U=da.sin,P=da.cos,Za=da.atan2,ua=Ua.prototype.slice,ab=f.event.fix,Z={},ca={dataCache:{},propCache:{},imageCache:{}},oa={rotate:0,scaleX:1,scaleY:1,translateX:0,translateY:0,masks:[]},ya={jCanvas:w},W={};f.fn.jCanvas=L;L.events={};L.eventHooks={};L.future={inheritance:!1};ma=new function(){X(this,
{align:"center",arrowAngle:90,arrowRadius:0,autosave:n,baseline:"middle",bringToFront:w,ccw:w,closed:w,compositing:"source-over",concavity:0,cornerRadius:0,count:1,cropFromCenter:n,crossOrigin:"",cursors:h,disableEvents:w,draggable:w,dragGroups:h,groups:h,data:h,dx:h,dy:h,end:360,eventX:h,eventY:h,fillStyle:"transparent",fontStyle:"normal",fontSize:"12pt",fontFamily:"sans-serif",fromCenter:n,height:h,imageSmoothing:n,inDegrees:n,index:h,lineHeight:1,layer:w,mask:w,maxWidth:h,miterLimit:10,name:h,
opacity:1,r1:h,r2:h,radius:0,repeat:"repeat",respectAlign:w,rotate:0,rounded:w,scale:1,scaleX:1,scaleY:1,shadowBlur:0,shadowColor:"transparent",shadowStroke:w,shadowX:0,shadowY:0,sHeight:h,sides:0,source:"",letterSpacing:h,spread:0,start:0,strokeCap:"butt",strokeJoin:"miter",strokeStyle:"transparent",strokeWidth:1,sWidth:h,sx:h,sy:h,text:"",translate:0,translateX:0,translateY:0,type:h,visible:n,width:h,x:0,y:0})};za.prototype=ma;aa=new za;K.prototype=aa;L.extend=function(d){d.name&&(d.props&&X(ma,
d.props),f.fn[d.name]=function a(b){var g,e,l,f;for(e=0;e<this.length;e+=1)if(g=this[e],l=H(g))f=new K(b),N(g,f,b,a),S(g,l,f),d.fn.call(g,l,f);return this},d.type&&(Z.drawings[d.type]=d.name));return f.fn[d.name]};f.fn.getEventHooks=function(){var d;d={};0!==this.length&&(d=this[0],d=E(d),d=d.eventHooks);return d};f.fn.setEventHooks=function(d){var c,a;for(c=0;c<this.length;c+=1)f(this[c]),a=E(this[c]),X(a.eventHooks,d);return this};f.fn.getLayers=function(d){var c,a,b,g,e=[];if(0!==this.length)if(c=
this[0],a=E(c),a=a.layers,ea(d))for(g=0;g<a.length;g+=1)b=a[g],d.call(c,b)&&e.push(b);else e=a;return e};f.fn.getLayer=function(d){var c,a,b,g;if(0!==this.length)if(c=this[0],a=E(c),c=a.layers,g=ba(d),d&&d.layer)b=d;else if("number"===g)0>d&&(d=c.length+d),b=c[d];else if("regexp"===g)for(a=0;a<c.length;a+=1){if(ka(c[a].name)&&c[a].name.match(d)){b=c[a];break}}else b=a.layer.names[d];return b};f.fn.getLayerGroup=function(d){var c,a,b,g=ba(d);if(0!==this.length)if(c=this[0],"array"===g)b=d;else if("regexp"===
g)for(a in c=E(c),c=c.layer.groups,c){if(a.match(d)){b=c[a];break}}else c=E(c),b=c.layer.groups[d];return b};f.fn.getLayerIndex=function(d){var c=this.getLayers();d=this.getLayer(d);return ja(d,c)};f.fn.setLayer=function(d,c){var a,b,g,e,l,h,A;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=E(this[b]),e=f(this[b]).getLayer(d)){pa(a,g,e,c);qa(a,g,e,c);for(l in c)c.hasOwnProperty(l)&&(h=c[l],A=ba(h),"object"===A?e[l]=X({},h):"array"===A?e[l]=h.slice(0):"string"===A?0===h.indexOf("+=")?e[l]+=fa(h.substr(2)):
0===h.indexOf("-=")?e[l]-=fa(h.substr(2)):e[l]=h:e[l]=h);Fa(a,g,e);Ha(a,g,e);f.isEmptyObject(c)===w&&O(a,g,e,"change",c)}return this};f.fn.setLayers=function(d,c){var a,b,g,e;for(b=0;b<this.length;b+=1)for(a=f(this[b]),g=a.getLayers(c),e=0;e<g.length;e+=1)a.setLayer(g[e],d);return this};f.fn.setLayerGroup=function(d,c){var a,b,g,e;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=a.getLayerGroup(d))for(e=0;e<g.length;e+=1)a.setLayer(g[e],c);return this};f.fn.moveLayer=function(d,c){var a,b,g,e,l;for(b=
0;b<this.length;b+=1)if(a=f(this[b]),g=E(this[b]),e=g.layers,l=a.getLayer(d))l.index=ja(l,e),e.splice(l.index,1),e.splice(c,0,l),0>c&&(c=e.length+c),l.index=c,O(a,g,l,"move");return this};f.fn.removeLayer=function(d){var c,a,b,g,e;for(a=0;a<this.length;a+=1)if(c=f(this[a]),b=E(this[a]),g=c.getLayers(),e=c.getLayer(d))e.index=ja(e,g),g.splice(e.index,1),pa(c,b,e,{name:h}),qa(c,b,e,{groups:h}),O(c,b,e,"remove");return this};f.fn.removeLayers=function(d){var c,a,b,g,e,l;for(a=0;a<this.length;a+=1){c=
f(this[a]);b=E(this[a]);g=c.getLayers(d);for(l=0;l<g.length;l+=1)e=g[l],c.removeLayer(e),l-=1;b.layer.names={};b.layer.groups={}}return this};f.fn.removeLayerGroup=function(d){var c,a,b,g;if(d!==k)for(a=0;a<this.length;a+=1)if(c=f(this[a]),E(this[a]),c.getLayers(),b=c.getLayerGroup(d))for(b=b.slice(0),g=0;g<b.length;g+=1)c.removeLayer(b[g]);return this};f.fn.addLayerToGroup=function(d,c){var a,b,g,e=[c];for(b=0;b<this.length;b+=1)a=f(this[b]),g=a.getLayer(d),g.groups&&(e=g.groups.slice(0),-1===ja(c,
g.groups)&&e.push(c)),a.setLayer(g,{groups:e});return this};f.fn.removeLayerFromGroup=function(d,c){var a,b,g,e=[],l;for(b=0;b<this.length;b+=1)a=f(this[b]),g=a.getLayer(d),g.groups&&(l=ja(c,g.groups),-1!==l&&(e=g.groups.slice(0),e.splice(l,1),a.setLayer(g,{groups:e})));return this};W.cursors=["grab","grabbing","zoom-in","zoom-out"];W.prefix=function(){var d=getComputedStyle(wa.documentElement,"");return"-"+(ua.call(d).join("").match(/-(moz|webkit|ms)-/)||""===d.OLink&&["","o"])[1]+"-"}();f.fn.triggerLayerEvent=
function(d,c){var a,b,g;for(b=0;b<this.length;b+=1)a=f(this[b]),g=E(this[b]),(d=a.getLayer(d))&&O(a,g,d,c);return this};f.fn.drawLayer=function(d){var c,a,b;for(c=0;c<this.length;c+=1)a=f(this[c]),H(this[c]),(b=a.getLayer(d))&&b.visible&&b._method&&(b._next=h,b._method.call(a,b));return this};f.fn.drawLayers=function(d){var c,a,b=X({},d),g,e,l,I,A,t,$;b.index||(b.index=0);for(c=0;c<this.length;c+=1)if(d=f(this[c]),a=H(this[c])){I=E(this[c]);b.clear!==w&&d.clearCanvas();a=I.layers;for(l=b.index;l<
a.length;l+=1)if(g=a[l],g.index=l,b.resetFire&&(g._fired=w),A=d,t=g,e=l+1,t&&t.visible&&t._method&&(t._next=e?e:h,t._method.call(A,t)),g._masks=I.transforms.masks.slice(0),g._method===f.fn.drawImage&&g.visible){$=!0;break}if($)break;g=I;var J=e=t=A=void 0;A=h;for(t=g.intersecting.length-1;0<=t;t-=1)if(A=g.intersecting[t],A._masks){for(J=A._masks.length-1;0<=J;J-=1)if(e=A._masks[J],!e.intersects){A.intersects=w;break}if(A.intersects)break}g=A;A=I.event;t=A.type;if(I.drag.layer){e=d;var J=I,D=t,F=void 0,
p=void 0,y=void 0,s=y=void 0,x=void 0,y=F=F=y=void 0,y=J.drag,s=(p=y.layer)&&p.dragGroups||[],F=J.layers;if("mousemove"===D||"touchmove"===D){if(y.dragging||(y.dragging=n,p.dragging=n,p.bringToFront&&(F.splice(p.index,1),p.index=F.push(p)),p._startX=p.x,p._startY=p.y,p._endX=p._eventX,p._endY=p._eventY,O(e,J,p,"dragstart")),y.dragging)for(F=p._eventX-(p._endX-p._startX),y=p._eventY-(p._endY-p._startY),p.dx=F-p.x,p.dy=y-p.y,p.x=F,p.y=y,O(e,J,p,"drag"),F=0;F<s.length;F+=1)if(y=s[F],x=J.layer.groups[y],
p.groups&&x)for(y=0;y<x.length;y+=1)x[y]!==p&&(x[y].x+=p.dx,x[y].y+=p.dy)}else if("mouseup"===D||"touchend"===D)y.dragging&&(p.dragging=w,y.dragging=w,O(e,J,p,"dragstop")),J.drag={}}e=I.lastIntersected;e===h||g===e||!e._hovered||e._fired||I.drag.dragging||(I.lastIntersected=h,e._fired=n,e._hovered=w,O(d,I,e,"mouseout"),d.css({cursor:I.cursor}));g&&(g[t]||Z.mouseEvents[t]&&(t=Z.mouseEvents[t]),g._event&&g.intersects&&(I.lastIntersected=g,!(g.mouseover||g.mouseout||g.cursors)||I.drag.dragging||g._hovered||
g._fired||(g._fired=n,g._hovered=n,O(d,I,g,"mouseover")),g._fired||(g._fired=n,A.type=h,O(d,I,g,t)),!g.draggable||g.disableEvents||"mousedown"!==t&&"touchstart"!==t||(I.drag.layer=g)));g!==h||I.drag.dragging||d.css({cursor:I.cursor});l===a.length&&(I.intersecting.length=0,I.transforms=la(oa),I.savedTransforms.length=0)}return this};f.fn.addLayer=function(d){var c,a;for(c=0;c<this.length;c+=1)if(a=H(this[c]))a=new K(d),a.layer=n,N(this[c],a,d);return this};W.props=["width","height","opacity","lineHeight"];
W.propsObj={};f.fn.animateLayer=function(){function d(a,b,c){return function(){var d,g;for(g=0;g<W.props.length;g+=1)d=W.props[g],c[d]=c["_"+d];for(var l in c)c.hasOwnProperty(l)&&-1!==l.indexOf(".")&&delete c[l];b.animating&&b.animated!==c||a.drawLayers();c._animating=w;b.animating=w;b.animated=h;e[4]&&e[4].call(a[0],c);O(a,b,c,"animateend")}}function c(a,b,c){return function(d,g){var l,f,h=!1;"_"===g.prop[0]&&(h=!0,g.prop=g.prop.replace("_",""),c[g.prop]=c["_"+g.prop]);-1!==g.prop.indexOf(".")&&
(l=g.prop.split("."),f=l[0],l=l[1],c[f]&&(c[f][l]=g.now));c._pos!==g.pos&&(c._pos=g.pos,c._animating||b.animating||(c._animating=n,b.animating=n,b.animated=c),b.animating&&b.animated!==c||a.drawLayers());e[5]&&e[5].call(a[0],d,g,c);O(a,b,c,"animate",g);h&&(g.prop="_"+g.prop)}}var a,b,g,e=ua.call(arguments,0),l,I;"object"===ba(e[2])?(e.splice(2,0,e[2].duration||h),e.splice(3,0,e[3].easing||h),e.splice(4,0,e[4].complete||h),e.splice(5,0,e[5].step||h)):(e[2]===k?(e.splice(2,0,h),e.splice(3,0,h),e.splice(4,
0,h)):ea(e[2])&&(e.splice(2,0,h),e.splice(3,0,h)),e[3]===k?(e[3]=h,e.splice(4,0,h)):ea(e[3])&&e.splice(3,0,h));for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=H(this[b]))g=E(this[b]),(l=a.getLayer(e[0]))&&l._method!==f.fn.draw&&(I=X({},e[1]),I=Va(this[b],l,I),Ia(I,n),Ia(l),l.style=W.propsObj,f(l).animate(I,{duration:e[2],easing:f.easing[e[3]]?e[3]:h,complete:d(a,g,l),step:c(a,g,l)}),O(a,g,l,"animatestart"));return this};f.fn.animateLayerGroup=function(d){var c,a,b=ua.call(arguments,0),g,e;for(a=0;a<
this.length;a+=1)if(c=f(this[a]),g=c.getLayerGroup(d))for(e=0;e<g.length;e+=1)b[0]=g[e],c.animateLayer.apply(c,b);return this};f.fn.delayLayer=function(d,c){var a,b,g,e;c=c||0;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=E(this[b]),e=a.getLayer(d))f(e).delay(c),O(a,g,e,"delay");return this};f.fn.delayLayerGroup=function(d,c){var a,b,g,e,l;c=c||0;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=a.getLayerGroup(d))for(l=0;l<g.length;l+=1)e=g[l],a.delayLayer(e,c);return this};f.fn.stopLayer=function(d,c){var a,
b,g,e;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=E(this[b]),e=a.getLayer(d))f(e).stop(c),O(a,g,e,"stop");return this};f.fn.stopLayerGroup=function(d,c){var a,b,g,e,l;for(b=0;b<this.length;b+=1)if(a=f(this[b]),g=a.getLayerGroup(d))for(l=0;l<g.length;l+=1)e=g[l],a.stopLayer(e,c);return this};(function(d){var c;for(c=0;c<d.length;c+=1)f.fx.step[d[c]]=Wa})("color backgroundColor borderColor borderTopColor borderRightColor borderBottomColor borderLeftColor fillStyle outlineColor strokeStyle shadowColor".split(" "));
Z.touchEvents={mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"};Z.mouseEvents={touchstart:"mousedown",touchend:"mouseup",touchmove:"mousemove"};(function(d){var c;for(c=0;c<d.length;c+=1)Ya(d[c])})("click dblclick mousedown mouseup mousemove mouseover mouseout touchstart touchmove touchend".split(" "));f.event.fix=function(d){var c,a;d=ab.call(f.event,d);if(c=d.originalEvent)if(a=c.changedTouches,d.pageX!==k&&d.offsetX===k){if(c=f(d.currentTarget).offset())d.offsetX=d.pageX-c.left,
d.offsetY=d.pageY-c.top}else a&&(c=f(d.currentTarget).offset())&&(d.offsetX=a[0].pageX-c.left,d.offsetY=a[0].pageY-c.top);return d};Z.drawings={arc:"drawArc",bezier:"drawBezier",ellipse:"drawEllipse","function":"draw",image:"drawImage",line:"drawLine",path:"drawPath",polygon:"drawPolygon",slice:"drawSlice",quadratic:"drawQuadratic",rectangle:"drawRect",text:"drawText",vector:"drawVector",save:"saveCanvas",restore:"restoreCanvas",rotate:"rotateCanvas",scale:"scaleCanvas",translate:"translateCanvas"};
f.fn.draw=function c(a){var b,g,e=new K(a);if(Z.drawings[e.type])this[Z.drawings[e.type]](a);else for(b=0;b<this.length;b+=1)if(f(this[b]),g=H(this[b]))e=new K(a),N(this[b],e,a,c),e.visible&&e.fn&&e.fn.call(this[b],g,e);return this};f.fn.clearCanvas=function a(b){var g,e,l=new K(b);for(g=0;g<this.length;g+=1)if(e=H(this[g]))l.width===h||l.height===h?(e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this[g].width,this[g].height),e.restore()):(N(this[g],l,b,a),R(this[g],e,l,l.width,l.height),e.clearRect(l.x-
l.width/2,l.y-l.height/2,l.width,l.height),l._transformed&&e.restore());return this};f.fn.saveCanvas=function b(g){var e,l,f,h,t;for(e=0;e<this.length;e+=1)if(l=H(this[e]))for(h=E(this[e]),f=new K(g),N(this[e],f,g,b),t=0;t<f.count;t+=1)ga(l,h);return this};f.fn.restoreCanvas=function g(e){var l,f,h,t,k;for(l=0;l<this.length;l+=1)if(f=H(this[l]))for(t=E(this[l]),h=new K(e),N(this[l],h,e,g),k=0;k<h.count;k+=1){var J=f,D=t;0===D.savedTransforms.length?D.transforms=la(oa):(J.restore(),D.transforms=D.savedTransforms.pop())}return this};
f.fn.rotateCanvas=function e(l){var f,h,t,k;for(f=0;f<this.length;f+=1)if(h=H(this[f]))k=E(this[f]),t=new K(l),N(this[f],t,l,e),t.autosave&&ga(h,k),Ca(h,t,k.transforms);return this};f.fn.scaleCanvas=function l(f){var h,t,k,J;for(h=0;h<this.length;h+=1)if(t=H(this[h]))J=E(this[h]),k=new K(f),N(this[h],k,f,l),k.autosave&&ga(t,J),Da(t,k,J.transforms);return this};f.fn.translateCanvas=function I(f){var h,k,J,D;for(h=0;h<this.length;h+=1)if(k=H(this[h]))D=E(this[h]),J=new K(f),N(this[h],J,f,I),J.autosave&&
ga(k,D),Ea(k,J,D.transforms);return this};f.fn.drawRect=function A(f){var h,k,D,F,p,y,s,x,M;for(h=0;h<this.length;h+=1)if(k=H(this[h]))D=new K(f),N(this[h],D,f,A),D.visible&&(S(this[h],k,D),R(this[h],k,D,D.width,D.height),k.beginPath(),F=D.x-D.width/2,p=D.y-D.height/2,x=$a(D.cornerRadius),D.width&&D.height&&(x?(y=D.x+D.width/2,s=D.y+D.height/2,0>D.width&&(M=F,F=y,y=M),0>D.height&&(M=p,p=s,s=M),0>y-F-2*x&&(x=(y-F)/2),0>s-p-2*x&&(x=(s-p)/2),k.moveTo(F+x,p),k.lineTo(y-x,p),k.arc(y-x,p+x,x,3*C/2,2*C,
w),k.lineTo(y,s-x),k.arc(y-x,s-x,x,0,C/2,w),k.lineTo(F+x,s),k.arc(F+x,s-x,x,C/2,C,w),k.lineTo(F,p+x),k.arc(F+x,p+x,x,C,3*C/2,w),D.closed=n):k.rect(F,p,D.width,D.height)),T(this[h],k,D),Y(this[h],k,D));return this};f.fn.drawArc=function t(f){var h,k,F;for(h=0;h<this.length;h+=1)if(k=H(this[h]))F=new K(f),N(this[h],F,f,t),F.visible&&(S(this[h],k,F),R(this[h],k,F,2*F.radius),k.beginPath(),La(this[h],k,F,F),T(this[h],k,F),Y(this[h],k,F));return this};f.fn.drawEllipse=function $(f){var h,k,p,y,s;for(h=
0;h<this.length;h+=1)if(k=H(this[h]))p=new K(f),N(this[h],p,f,$),p.visible&&(S(this[h],k,p),R(this[h],k,p,p.width,p.height),y=4/3*p.width,s=p.height,k.beginPath(),k.moveTo(p.x,p.y-s/2),k.bezierCurveTo(p.x-y/2,p.y-s/2,p.x-y/2,p.y+s/2,p.x,p.y+s/2),k.bezierCurveTo(p.x+y/2,p.y+s/2,p.x+y/2,p.y-s/2,p.x,p.y-s/2),T(this[h],k,p),p.closed=n,Y(this[h],k,p));return this};f.fn.drawPolygon=function J(f){var h,p,k,s,x,M,Q,z,u,m;for(h=0;h<this.length;h+=1)if(p=H(this[h]))if(k=new K(f),N(this[h],k,f,J),k.visible){S(this[h],
p,k);R(this[h],p,k,2*k.radius);x=2*C/k.sides;M=x/2;s=M+C/2;Q=k.radius*P(M);p.beginPath();for(m=0;m<k.sides;m+=1)z=k.x+k.radius*P(s),u=k.y+k.radius*U(s),p.lineTo(z,u),k.concavity&&(z=k.x+(Q+-Q*k.concavity)*P(s+M),u=k.y+(Q+-Q*k.concavity)*U(s+M),p.lineTo(z,u)),s+=x;T(this[h],p,k);k.closed=n;Y(this[h],p,k)}return this};f.fn.drawSlice=function D(h){var k,y,s,x,M;for(k=0;k<this.length;k+=1)if(f(this[k]),y=H(this[k]))s=new K(h),N(this[k],s,h,D),s.visible&&(S(this[k],y,s),R(this[k],y,s,2*s.radius),s.start*=
s._toRad,s.end*=s._toRad,s.start-=C/2,s.end-=C/2,s.start=Ka(s.start),s.end=Ka(s.end),s.end<s.start&&(s.end+=2*C),x=(s.start+s.end)/2,M=s.radius*s.spread*P(x),x=s.radius*s.spread*U(x),s.x+=M,s.y+=x,y.beginPath(),y.arc(s.x,s.y,s.radius,s.start,s.end,s.ccw),y.lineTo(s.x,s.y),T(this[k],y,s),s.closed=n,Y(this[k],y,s));return this};f.fn.drawLine=function F(h){var f,k,x;for(f=0;f<this.length;f+=1)if(k=H(this[f]))x=new K(h),N(this[f],x,h,F),x.visible&&(S(this[f],k,x),R(this[f],k,x),k.beginPath(),Na(this[f],
k,x,x),T(this[f],k,x),Y(this[f],k,x));return this};f.fn.drawQuadratic=function p(f){var h,k,M;for(h=0;h<this.length;h+=1)if(k=H(this[h]))M=new K(f),N(this[h],M,f,p),M.visible&&(S(this[h],k,M),R(this[h],k,M),k.beginPath(),Oa(this[h],k,M,M),T(this[h],k,M),Y(this[h],k,M));return this};f.fn.drawBezier=function y(h){var f,k,Q;for(f=0;f<this.length;f+=1)if(k=H(this[f]))Q=new K(h),N(this[f],Q,h,y),Q.visible&&(S(this[f],k,Q),R(this[f],k,Q),k.beginPath(),Pa(this[f],k,Q,Q),T(this[f],k,Q),Y(this[f],k,Q));return this};
f.fn.drawVector=function s(f){var h,k,z;for(h=0;h<this.length;h+=1)if(k=H(this[h]))z=new K(f),N(this[h],z,f,s),z.visible&&(S(this[h],k,z),R(this[h],k,z),k.beginPath(),Sa(this[h],k,z,z),T(this[h],k,z),Y(this[h],k,z));return this};f.fn.drawPath=function x(h){var f,z,u,m,v;for(f=0;f<this.length;f+=1)if(z=H(this[f]))if(u=new K(h),N(this[f],u,h,x),u.visible){S(this[f],z,u);R(this[f],z,u);z.beginPath();for(m=1;n;)if(v=u["p"+m],v!==k)v=new K(v),"line"===v.type?Na(this[f],z,u,v):"quadratic"===v.type?Oa(this[f],
z,u,v):"bezier"===v.type?Pa(this[f],z,u,v):"vector"===v.type?Sa(this[f],z,u,v):"arc"===v.type&&La(this[f],z,u,v),m+=1;else break;T(this[f],z,u);Y(this[f],z,u)}return this};f.fn.drawText=function M(k){var z,u,m,v,V,r,B,n,G,w;for(z=0;z<this.length;z+=1)if(f(this[z]),u=H(this[z]))if(m=new K(k),v=N(this[z],m,k,M),m.visible){S(this[z],u,m);u.textBaseline=m.baseline;u.textAlign=m.align;sa(this[z],u,m);V=m.maxWidth!==h?Ta(u,m):m.text.toString().split("\n");ta(this[z],u,m,V);v&&(v.width=m.width,v.height=
m.height);R(this[z],u,m,m.width,m.height);B=m.x;"left"===m.align?m.respectAlign?m.x+=m.width/2:B-=m.width/2:"right"===m.align&&(m.respectAlign?m.x-=m.width/2:B+=m.width/2);if(m.radius)for(B=fa(m.fontSize),m.letterSpacing===h&&(m.letterSpacing=B/500),r=0;r<V.length;r+=1){u.save();u.translate(m.x,m.y);v=V[r];n=v.length;u.rotate(-(C*m.letterSpacing*(n-1))/2);for(w=0;w<n;w+=1)G=v[w],0!==w&&u.rotate(C*m.letterSpacing),u.save(),u.translate(0,-m.radius),u.fillText(G,0,0),u.restore();m.radius-=B;m.letterSpacing+=
B/(1E3*C);u.restore()}else for(r=0;r<V.length;r+=1)v=V[r],n=m.y+r*m.height/V.length-(V.length-1)*m.height/V.length/2,u.shadowColor=m.shadowColor,u.fillText(v,B,n),"transparent"!==m.fillStyle&&(u.shadowColor="transparent"),u.strokeText(v,B,n);n=0;"top"===m.baseline?n+=m.height/2:"bottom"===m.baseline&&(n-=m.height/2);m._event&&(u.beginPath(),u.rect(m.x-m.width/2,m.y-m.height/2+n,m.width,m.height),T(this[z],u,m),u.closePath());m._transformed&&u.restore()}ca.propCache=m;return this};f.fn.measureText=
function(f){var h,k;h=this.getLayer(f);if(!h||h&&!h._layer)h=new K(f);if(f=H(this[0]))sa(this[0],f,h),k=Ta(f,h),ta(this[0],f,h,k);return h};f.fn.drawImage=function Q(z){function u(k,m,u,q,r){return function(){var v=f(k);S(k,m,q);q.width===h&&q.sWidth===h&&(q.width=q.sWidth=G.width);q.height===h&&q.sHeight===h&&(q.height=q.sHeight=G.height);r&&(r.width=q.width,r.height=q.height);q.sWidth!==h&&q.sHeight!==h&&q.sx!==h&&q.sy!==h?(q.width===h&&(q.width=q.sWidth),q.height===h&&(q.height=q.sHeight),q.cropFromCenter||
(q.sx+=q.sWidth/2,q.sy+=q.sHeight/2),0>q.sy-q.sHeight/2&&(q.sy=q.sHeight/2),q.sy+q.sHeight/2>G.height&&(q.sy=G.height-q.sHeight/2),0>q.sx-q.sWidth/2&&(q.sx=q.sWidth/2),q.sx+q.sWidth/2>G.width&&(q.sx=G.width-q.sWidth/2),R(k,m,q,q.width,q.height),m.drawImage(G,q.sx-q.sWidth/2,q.sy-q.sHeight/2,q.sWidth,q.sHeight,q.x-q.width/2,q.y-q.height/2,q.width,q.height)):(R(k,m,q,q.width,q.height),m.drawImage(G,q.x-q.width/2,q.y-q.height/2,q.width,q.height));m.beginPath();m.rect(q.x-q.width/2,q.y-q.height/2,q.width,
q.height);T(k,m,q);m.closePath();q._transformed&&m.restore();Ba(m,u,q);q.layer?O(v,u,r,"load"):q.load&&q.load.call(v[0],r);q.layer&&(r._masks=u.transforms.masks.slice(0),q._next&&v.drawLayers({clear:w,resetFire:n,index:q._next}))}}var m,v,V,r,B,C,G,va,L,P=ca.imageCache;for(v=0;v<this.length;v+=1)if(m=this[v],V=H(this[v]))r=E(this[v]),B=new K(z),C=N(this[v],B,z,Q),B.visible&&(L=B.source,va=L.getContext,L.src||va?G=L:L&&(P[L]!==k?G=P[L]:(G=new xa,G.crossOrigin=B.crossOrigin,G.src=L,P[L]=G)),G&&(G.complete||
va?u(m,V,r,B,C)():(G.onload=u(m,V,r,B,C),G.src=G.src)));return this};f.fn.createPattern=function(k){function z(){r=m.createPattern(n,v.repeat);v.load&&v.load.call(u[0],r)}var u=this,m,v,n,r,B;(m=H(u[0]))?(v=new K(k),B=v.source,ea(B)?(n=f("<canvas />")[0],n.width=v.width,n.height=v.height,k=H(n),B.call(n,k),z()):(k=B.getContext,B.src||k?n=B:(n=new xa,n.crossOrigin=v.crossOrigin,n.src=B),n.complete||k?z():(n.onload=z(),n.src=n.src))):r=h;return r};f.fn.createGradient=function(f){var n,u=[],m,v,w,r,
B,C,G;f=new K(f);if(n=H(this[0])){f.x1=f.x1||0;f.y1=f.y1||0;f.x2=f.x2||0;f.y2=f.y2||0;n=f.r1!==h&&f.r2!==h?n.createRadialGradient(f.x1,f.y1,f.r1,f.x2,f.y2,f.r2):n.createLinearGradient(f.x1,f.y1,f.x2,f.y2);for(r=1;f["c"+r]!==k;r+=1)f["s"+r]!==k?u.push(f["s"+r]):u.push(h);m=u.length;u[0]===h&&(u[0]=0);u[m-1]===h&&(u[m-1]=1);for(r=0;r<m;r+=1){if(u[r]!==h){C=1;G=0;v=u[r];for(B=r+1;B<m;B+=1)if(u[B]!==h){w=u[B];break}else C+=1;v>w&&(u[B]=u[r])}else u[r]===h&&(G+=1,u[r]=v+(w-v)/C*G);n.addColorStop(u[r],
f["c"+(r+1)])}}else n=h;return n};f.fn.setPixels=function z(f){var k,n,w,r,B,C,G,E,L;for(n=0;n<this.length;n+=1)if(k=this[n],w=H(k)){r=new K(f);N(k,r,f,z);R(this[n],w,r,r.width,r.height);if(r.width===h||r.height===h)r.width=k.width,r.height=k.height,r.x=r.width/2,r.y=r.height/2;if(0!==r.width&&0!==r.height){C=w.getImageData(r.x-r.width/2,r.y-r.height/2,r.width,r.height);G=C.data;L=G.length;if(r.each)for(E=0;E<L;E+=4)B={r:G[E],g:G[E+1],b:G[E+2],a:G[E+3]},r.each.call(k,B,r),G[E]=B.r,G[E+1]=B.g,G[E+
2]=B.b,G[E+3]=B.a;w.putImageData(C,r.x-r.width/2,r.y-r.height/2);w.restore()}}return this};f.fn.getCanvasImage=function(f,n){var m,v=h;0!==this.length&&(m=this[0],m.toDataURL&&(n===k&&(n=1),v=m.toDataURL("image/"+f,n)));return v};f.fn.detectPixelRatio=function(h){var k,m,v,w,r,B,C;for(m=0;m<this.length;m+=1)k=this[m],f(this[m]),v=H(k),C=E(this[m]),C.scaled||(w=window.devicePixelRatio||1,r=v.webkitBackingStorePixelRatio||v.mozBackingStorePixelRatio||v.msBackingStorePixelRatio||v.oBackingStorePixelRatio||
v.backingStorePixelRatio||1,w/=r,1!==w&&(r=k.width,B=k.height,k.width=r*w,k.height=B*w,k.style.width=r+"px",k.style.height=B+"px",v.scale(w,w)),C.pixelRatio=w,C.scaled=n,h&&h.call(k,w));return this};L.clearCache=function(){for(var f in ca)ca.hasOwnProperty(f)&&(ca[f]={})};f.support.canvas=f("<canvas />")[0].getContext!==k;X(L,{defaults:ma,prefs:aa,setGlobalProps:S,transformShape:R,detectEvents:T,closePath:Y,setCanvasFont:sa,measureText:ta});f.jCanvas=L})(jQuery,document,Image,Array,Math,parseFloat,
console,!0,!1,null);
| koprivajakub/Tetriso | src/js/libs/jcanvas.min.js | JavaScript | mit | 32,078 |
var response_to = require(__dirname + '/utils/test_helpers.js').response_to;
var renderer = require(__dirname + '/utils/renderer.js').renderer;
var cheerio = require('cheerio');
var assert = require('chai').assert;
var _ = require('lodash');
describe('Proceed view', function () {
var templateData = {
'auth_token': '12345-67890-12345-67890',
'proceed_to_payment_path': '/pay',
'lastPayment': {
'paymentId': '112233',
'description': 'Test description',
'reference': 'Test reference',
'amount': '£34.54'
}
};
function renderSuccessPage(templateData, checkFunction) {
renderer('proceed', templateData, function (htmlOutput) {
var $ = cheerio.load(htmlOutput);
checkFunction($);
});
}
describe('when lastPayment.next_url is not available in the template data', function () {
it('should render the page without showing the last payment details', function (done) {
renderSuccessPage(templateData, function ($) {
$('#last-payment-reference').length.should.equal(0);
$('#last-payment-description').length.should.equal(0);
$('#last-payment-amount').length.should.equal(0);
$('#last-payment-resume').length.should.equal(0);
done();
});
});
});
describe('when lastPayment.next_url is available in the template data', function () {
it('should render the page showing the last payment details', function (done) {
templateData.lastPayment['next_url'] = 'http://next.url';
renderSuccessPage(templateData, function ($) {
$('#last-payment-reference').text().should.equal('Test reference');
$('#last-payment-description').text().should.equal('Test description');
$('#last-payment-amount').text().should.equal('£34.54');
$('#last-payment-resume').length.should.equal(1);
done();
});
});
});
})
;
| alphagov/pay-sample-integration | test/proceed_ui_tests.js | JavaScript | mit | 1,889 |
import PostItem from './PostItem';
export { PostItem };
| ernieyang09/ernieyang09.github.io | src/components/PostItem/index.js | JavaScript | mit | 58 |
'use strict';
/*
var cl = console.log;
console.log = function(){
console.trace();
cl.apply(console,arguments);
};
*/
// Requires meanio .
var mean = require('meanio');
var cluster = require('cluster');
// Code to run if we're in the master process or if we are not in debug mode/ running tests
if ((cluster.isMaster) &&
(process.execArgv.indexOf('--debug') < 0) &&
(process.env.NODE_ENV!=='test') && (process.env.NODE_ENV!=='development') &&
(process.execArgv.indexOf('--singleProcess')<0)) {
//if (cluster.isMaster) {
console.log("Environment "+process.env.NODE_ENV);
console.log('for real!');
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
console.log ('forking ',i);
cluster.fork();
}
// Listen for dying workers
cluster.on('exit', function (worker) {
// Replace the dead worker, we're not sentimental
console.log('Worker ' + worker.id + ' died :(');
cluster.fork();
});
// Code to run if we're in a worker process
} else {
var workerId = 0;
if (!cluster.isMaster)
{
workerId = cluster.worker.id;
}
// Creates and serves mean application
mean.serve({ workerid: workerId /* more options placeholder*/ }, function (app) {
var config = app.config.clean;
var port = config.https && config.https.port ? config.https.port : config.http.port;
console.log('Mean app started on port ' + port + ' (' + process.env.NODE_ENV + ') cluster.worker.id:', workerId);
});
}
| devsaik/paropakar | server.js | JavaScript | mit | 1,610 |
module.exports = require('./lib/modelhunter'); | mywei1989/ModelHunter.Core | index.js | JavaScript | mit | 46 |
app.controller('movieDetailCtr', ['$scope', '$stateParams', 'movieService', function ($scope, $stateParams, movieService) {
const vm = this;
(function () {
movieService.movieDetail($stateParams.id).then(function (res) {
if (res.data.code === 200) {
vm.movieDetail = res.data.data;
}else {
alert(res.data.data.message)
}
})
})()
}]); | WangSiTu/node-movies | web/viewAndCtr/movieDetail/movieDetailCtr.js | JavaScript | mit | 428 |
/*
* mvcActionResultApi
* author: ruleechen
* contact: rulee@live.cn
* create date: 2014.7.3
*/
'use strict';
var utils = require('zoo-utils');
var mvcActionResultApi = module.exports = function(set) {
utils.extend(this, set);
};
mvcActionResultApi.prototype = {
sync: false, callback: null,
constructor: mvcActionResultApi,
with: function(result) {
if (this.sync) {
return result;
}
if (utils.isFunction(this.callback)) {
utils.defer(this.callback, result);
}
}
};
| jszoo/cat-mvc | mvc/mvcActionResultApi.js | JavaScript | mit | 549 |
var ArchetypeSampleLabelTemplates = (function() {
//public functions
return {
Entity: function (value, scope, args) {
if(!args.entityType) {
args = {entityType: "Document", propertyName: "name"}
}
if (value) {
//if handed a csv list, take the first only
var id = value.split(",")[0];
if (id) {
var entity = scope.services.archetypeLabelService.getEntityById(scope, id, args.entityType);
if(entity) {
return entity[args.propertyName];
}
}
}
return "";
},
UrlPicker: function(value, scope, args) {
if(!args.propertyName) {
args = {propertyName: "name"}
}
var entity;
switch (value.type) {
case "content":
if(value.typeData.contentId) {
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.contentId, "Document");
}
break;
case "media":
if(value.typeData.mediaId) {
entity = scope.services.archetypeLabelService.getEntityById(scope, value.typeData.mediaId, "Media");
}
break;
case "url":
return value.typeData.url;
default:
break;
}
if(entity) {
return entity[args.propertyName];
}
return "";
},
Rte: function (value, scope, args) {
if(!args.contentLength) {
args = {contentLength: 50}
}
return $(value).text().substring(0, args.contentLength);
}
}
})(); | tomfulton/Archetype | app/helpers/sampleLabelHelpers.js | JavaScript | mit | 1,952 |
import { combineReducers } from 'redux';
import displaySettingsReducer from './displaySettingsReducer';
import foodListReducer, * as fromFoodListReducer from './foodListReducer';
import favouritesReducer, * as fromFavouritesReducer from './favouritesReducer';
import giTargetReducer, * as fromGiTargetReducer from './giTargetReducer';
import mealTrackingReducer, * as fromMealTrackingReducer from './mealTrackingReducer';
export default combineReducers({
displaySettings: displaySettingsReducer,
foodList: foodListReducer,
favourites: favouritesReducer,
giTarget: giTargetReducer,
mealTracking: mealTrackingReducer,
});
export const isFavourite = (state, id) => fromFavouritesReducer.isFavourite(state.favourites, id);
export const favouriteItems = (state) =>
fromFavouritesReducer.favouriteItems(state.foodList.allItems, state.favourites);
export const categoryList = (state) => fromFoodListReducer.categoryList(state.foodList.allItems);
export const foodListByCategory = (state, category) =>
fromFoodListReducer.foodListByCategory(state.foodList.itemsToDisplay, category);
export const targets = (state) =>
fromGiTargetReducer.targets(state.giTarget.targets);
export const firstWeek = (state) =>
fromMealTrackingReducer.firstWeek(state.mealTracking);
export const meals = (state) =>
fromMealTrackingReducer.meals(state.mealTracking);
export const mealsForWeek = (state, weekStart) =>
fromMealTrackingReducer.mealsForWeek(state.mealTracking, weekStart);
| bitmoremedia/mygi-app | src/reducers/index.js | JavaScript | mit | 1,483 |
var SerialPort = require('serialport');
var config = require('./config.json');
var port = new SerialPort(config.serialPort);
port.on('open', function () {
port.on('data', function (chunk) {
console.log(chunk.toString('utf8'));
});
});
// open errors will be emitted as an error event
port.on('error', function (err) {
console.log('Arduino met a problem: ');
console.log(err.message);
console.log('=======================');
}); | phariel/AyG-Arduino | serial-test.js | JavaScript | mit | 457 |
const returnDurationTemplate = function returnDurationTemplate(obj) {
return obj.duration && formatDate(obj.duration) || '';
};
const clickRefreshButton = function clickRefreshButton() {
$$('returnLendingHistoryError').setValue('');
let lendingHistoryTableUi = $$('lendingHistoryTable');
lendingHistoryTableUi.clearAll();
lendingHistoryTableUi.showProgress({ delay: 300000, hide: true });
let formValues = $$('lendingHistoryInputForm').getValues();
let params = {
start: formValues.startDate.getTime() / 1000,
end: formValues.endDate.getTime() / 1000,
limit: formValues.limit !== 0 && formValues.limit || null,
};
socket.emit('returnLendingHistory', params);
};
const clickExportButton = function clickExportButton() {
};
let onPeriodChange = function onPeriodChange(newv, oldv) {
let period = parseInt(newv);
let startDateUi = $$('startDate');
let endDateUi = $$('endDate');
switch (period) {
case 1: {
startDateUi.setValue(new Date(parseInt(moment().subtract(1, 'days').format('x'))));
endDateUi.setValue(new Date());
break;
}
case 2: {
startDateUi.setValue(new Date(parseInt(moment().subtract(7, 'days').format('x'))));
endDateUi.setValue(new Date());
break;
}
case 3: {
startDateUi.setValue(new Date(parseInt(moment().subtract(1, 'months').format('x'))));
endDateUi.setValue(new Date());
break;
}
}
};
let lendingHistoryInputFormConfig = {
id: 'lendingHistoryInputForm',
view:"form",
scroll:false,
elements: [
{
rows: [
{
cols: [
//{ view: 'datepicker', id: 'startDate', timepicker:true, label: 'Start date', value: new Date(parseInt(moment().subtract(7, 'days').format('x'))), format:'%Y-%m-%d %H:%i', labelPosition: 'top', name: 'startDate', width: 180 },
//{ view: 'datepicker', id: 'endDate', timepicker:true, label: 'End date', labelPosition: 'top', value: new Date(), format:'%Y-%m-%d %H:%i', name: 'endDate', width: 180 },
//{ view: 'counter', label: 'Limit', labelPosition: 'top', name: 'limit', step: 100, value: 50, min: 0, max: 10000 },
{ view: 'datepicker', id: 'startDate', timepicker:true, label: '시작일', value: new Date(parseInt(moment().subtract(7, 'days').format('x'))), labelPosition: 'top', name: 'startDate', width: 180 },
{ view: 'datepicker', id: 'endDate', timepicker:true, label: '종료일', labelPosition: 'top', value: new Date(), name: 'endDate', width: 180 },
{ view: 'counter', label: '페이지당 조회수', labelPosition: 'top', name: 'Limit', step: 100, value: 50, min: 0, max: 10000 },
]
},
{ view: 'radio', value: 2, name: 'period', options:[
//{ id: 1, value: 'Last day' }, //the initially selected item
//{ id: 2, value: 'Last week' },
//{ id: 3, value: 'Last month' },
{ id: 1, value: '어제' }, //the initially selected item
{ id: 2, value: '최근 1주' },
{ id: 3, value: '최근 1개월' },
] },
{ view: 'label', label: '' },
{
cols: [
{
id: 'refreshButton',
autoheight: true,
view: 'button',
//value: 'Refresh',
value: '조회',
width: 80,
type:"form",
click: clickRefreshButton,
},/*
{
id: 'export',
view: 'button',
disabled: true,
//value: 'Export',
value: '내보내기',
type:"form",
width: 120,
click: clickExportButton,
},*/
]
},
{ view: 'label', id: 'returnLendingHistoryError', label: '' },
]
}
]
};
let lendingHistoryTableConfig = {
id: 'lendingHistoryTable',
view: 'datatable',
resizeColumn: true,
autowidth: true,
autoheight: true,
minHeight: 200,
minWidth: 898,
select: true,
drag: true,
scroll: false,
columns: [
//{ id: 'currency', header: 'Currency', sort: 'string', adjust: true, tooltip: tooltip, template: returnCurrencyTemplate },
//// { id: 'id', header:[{ text: 'Id', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "string", tooltip: tooltip, cssFormat: alignRight },
//{ id: 'rate', header:[{ text: 'Rate', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip, cssFormat: alignRight, template: returnLoanRateTemplate },
//{ id: 'amount', header:[{ text: 'Amount', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip, cssFormat: alignRight, format: formatAmount },
//{ id: 'duration', header: [{text: 'Duration', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip , cssFormat: alignRight, format: formatDurationFromDays },
//{ id: 'interest', header: [{text: 'Interest', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
//{ id: 'fee', header: [{text: 'Fee', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
//{ id: 'earned', header: [{text: 'Earned', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
//{ id: 'openAt', header:[{ text: 'Open', css: 'table-header-center' }], autowidth: true, adjust: true, sort: 'date', tooltip: tooltip, cssFormat: alignRight, format: formatDate },
//{ id: 'closedAt', header:[{ text: 'Closed', css: 'table-header-center' }], autowidth: true, adjust: true, sort: 'date', tooltip: tooltip, cssFormat: alignRight, format: formatDate },
{ id: 'currency', header: '코인', sort: 'string', adjust: true, tooltip: tooltip, template: returnCurrencyTemplate },
// { id: 'id', header:[{ text: 'Id', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "string", tooltip: tooltip, cssFormat: alignRight },
{ id: 'rate', header:[{ text: '이율', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip, cssFormat: alignRight, template: returnLoanRateTemplate },
{ id: 'amount', header:[{ text: '비용', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip, cssFormat: alignRight, format: formatAmount },
{ id: 'duration', header: [{text: '기간', css: 'table-header-center' }], autowidth: true, adjust: true, sort: "int", tooltip: tooltip , cssFormat: alignRight, format: formatDurationFromDays },
{ id: 'interest', header: [{text: '이자', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
{ id: 'fee', header: [{text: '수수료', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
{ id: 'earned', header: [{text: '수익', css: 'table-header-center' }], adjust: true, autowidth: true, tooltip: tooltip, sort: "int", cssFormat: alignRight, format: formatAmount },
{ id: 'openAt', header:[{ text: '게시', css: 'table-header-center' }], autowidth: true, adjust: true, sort: 'date', tooltip: tooltip, cssFormat: alignRight, format: formatDate },
{ id: 'closedAt', header:[{ text: '종료', css: 'table-header-center' }], autowidth: true, adjust: true, sort: 'date', tooltip: tooltip, cssFormat: alignRight, format: formatDate },
],
fixedRowHeight:false, rowLineHeight:25, rowHeight:25,
data: [],
tooltip: true,
};
let historyView = {
id: 'history',
borderless: true,
type: 'clean',
sizeToContent: true,
cols: [
{ gravity: 0.1 },
{
type: 'clean',
rows: [
//{ view:"template", template:"Lending History", type:"section" },
{ view:"template", template:"랜딩 이력", type:"section" },
lendingHistoryInputFormConfig,
lendingHistoryTableConfig,
{ gravity: 1 },
]
},
{ gravity: 0.1 },
],
};
let updateLendingHistory = function updateLendingHistory(errMessage, result) {
let lendingHistoryTableUi = $$('lendingHistoryTable');
lendingHistoryTableUi.clearAll();
lendingHistoryTableUi.hideProgress();
if (errMessage) {
$$('returnLendingHistoryError').setValue(errMessage);
return;
}
//$$('returnLendingHistoryError').setValue(`Fetched ${result.length} loans`);
$$('returnLendingHistoryError').setValue(` ${result.length} 개의 내역이 조회됨`);
let lendingHistoryTable = [];
result.forEach((loan) => {
let newLoan = {
id: loan.id,
currency: loan.currency,
rate: parseFloat(loan.rate),
amount: parseFloat(loan.amount),
duration: loan.duration,
interest: parseFloat(loan.interest),
fee: parseFloat(loan.fee),
earned: parseFloat(loan.earned),
openAt: new Date(parseInt(moment.utc(loan.open).format('x'))),
closedAt: new Date(parseInt(moment.utc(loan.close).format('x'))),
};
lendingHistoryTable.push(newLoan);
});
lendingHistoryTableUi.clearAll();
lendingHistoryTableUi.define({
'data': lendingHistoryTable,
});
lendingHistoryTableUi.refreshColumns();
};
| Kaim-Lee/poloLender-ko | public/javascripts/history.js | JavaScript | mit | 9,428 |
'use strict';
var certs = require('./certs');
var events = require('events');
var http = require('http');
var https = require('https');
var json = require('./json');
var url = require('url');
var util = require('util');
module.exports = Transport;
// TODO(bnoordhuis,rmg) Make fingerprint configurable through lib/certs.js in
// order to suppress the error message during testing? Requires a rewrite
// of the fingerprint check regression tests.
var fingerprints = {
prod: '02:64:24:CC:40:B5:52:EB:46:62:CE:D8:0B:E2:1C:76:25:6D:21:C2',
dev: '2C:10:D9:6B:9C:8C:89:C1:87:E8:89:03:68:7D:39:B4:2F:52:9E:42',
};
var expectedFingerprint = fingerprints[process.env.SL_ENV] || fingerprints.prod;
// Parse a proxy or endpoint configuration string or object. When a string,
// it's a URL that look like 'proto://domain:port', where |proto| is one of
// 'http', 'https' or 'https+noauth'.
//
// +noauth disables certificate validation, something that may be necessary
// for corporate proxies that use a self-signed certificate or a certificate
// that is signed by a self-signed CA.
//
// When the input is an object, it looks like this:
//
// {
// "host": "example.com", // Host name. Semi-optional, see below.
// "port": 4242, // Port number. Optional.
// "secure": true, // Use HTTPS. Default: true.
// "rejectUnauthorized": true, // Verify server cert. Default: true.
// "ca": ["...", /* "..." */], // Chain of CAs. Optional.
// }
//
// * The host name is optional for the endpoint configuration (default:
// 'collector.strongloop.com') but obviously mandatory for the proxy
// configuration.
//
// * The port number defaults to 443 if secure or 80 if !secure.
//
// * The chain of CA certificates should be an array of strings, must preserve
// newlines and be in reverse order (i.e. the server certificate should come
// before the first CA.) Example:
//
// {
// "ca": [
// // server certificate
// "-----BEGIN CERTIFICATE-----\n" +
// "MIIDJjCCAg4CAlgOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n" +
// "VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n" +
// "...\n" +
// "-----END CERTIFICATE-----",
//
// // first CA certificate
// "-----BEGIN CERTIFICATE-----\n" +
// "VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n" +
// "MIIDbzCCAlcCAknbMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n" +
// "...\n" +
// "-----END CERTIFICATE-----" ]
// }
function parse(input) {
if (typeof(input) === 'string') {
var u = url.parse(input);
return {
auth: u.auth,
host: u.hostname,
port: u.port,
secure: /^https/.test(u.protocol),
rejectUnauthorized: /^https:$/.test(u.protocol),
};
}
if (input && typeof(input) === 'object') {
var result = Object.create(input);
result.secure =
typeof(result.secure) === 'undefined' || !!result.secure;
result.rejectUnauthorized =
typeof(result.rejectUnauthorized) === 'undefined' ||
!!result.rejectUnauthorized;
return result;
}
return null;
}
function encode(options) {
if (!options) {
return null;
}
var protocol = options.secure ? 'https' : 'http';
if (!options.rejectUnauthorized && options.secure) {
protocol += '+noauth';
}
var auth = (options.auth || '').replace(/:.+$/, function(s) {
return ':' + Array(s.length).join('*');
});
if (auth) {
auth += '@';
}
// url.format has no way of always adding the '//', so ...
return util.format('%s://%s%s:%d',
protocol,
auth,
options.host,
options.port);
}
function Transport(options) {
// Create a prototype-less backing store for the EventEmitter object.
// Avoids bringing down the process when a malicious collector sends
// a '__proto__' event. (Unlikely but defense in depth.)
this._events = Object.create(null);
this.constructor.call(this);
this.setMaxListeners(Infinity);
this.state = 'new';
this.options = options;
// FIXME(bnoordhuis) The decoder is recreated for each request to work around
// a streams2 bug where core emits a 'write after end' error for something
// that is outside our control. No tracking bug: I don't have time to put
// together a test case.
this.decoder = null;
// The encoder isn't affected by that but it follows the same pattern to
// avoid having multiple call sites where a JsonEncoder object is created.
this.encoder = null;
this.request = null;
this.response = null;
this.sessionId = null;
this.sendQueue = []; // See the comment in Transport#send().
var logger = options.logger || {};
this.notice = logger.notice || console.log;
this.info = logger.info || console.info;
this.warn = logger.warn || console.error;
this.endpoint = parse(options.endpoint) || {
host: options.host,
port: options.port,
secure: true,
rejectUnauthorized: true,
};
var collector = options.collector || {};
var c = (this.endpoint.secure ? collector.https : collector.http) || {};
this.endpoint.host = this.endpoint.host || c.host;
this.endpoint.port = this.endpoint.port || c.port;
this.proxy = parse(options.proxy);
}
Transport.prototype = Object.create(events.EventEmitter.prototype);
Transport.init = function(options) {
return new Transport(options);
};
Transport.prototype.send = function(message) {
// When the transport was explicitly disconnected, do not queue.
if (this.encoder === null) {
return false;
}
if (this.state === 'connected') {
return this.encoder.write(message);
}
// See https://github.com/joyent/node/issues/7451 - a streams2 bug that
// forces us to queue events if we don't want to lose events between the
// start of the handshake and its completion.
//
// Ideally, we'd just let the JsonEncoder stream buffer pending data but:
//
// - we can't pause the stream without unpiping it first, but
//
// - we can't unpipe it synchronously because then the handshake data
// isn't send (because streams2 only does that on the next tick), and
//
// - we cannot add a nextTick() or onwrite callback because that introduces
// a race window between write() call and the callback.
//
// I have many harsh words for streams2 but this comment is long enough
// as it is, I'll save them for a blog post or something...
this.sendQueue.push(this.send.apply.bind(this.send, this, arguments));
return false;
};
Transport.prototype.connect = function(err) {
if (this.request !== null) {
// XXX(bnoordhuis) I'm half convinced this should be an error.
this.request.end();
this.request = null;
this.encoder = null;
}
if (this.response !== null) {
this.response.destroy();
this.response = null;
this.decoder = null;
}
if (this.disconnected()) {
return;
}
var host = this.endpoint.host;
var port = this.endpoint.port;
var path = '/agent/v1';
var proto = this.endpoint.secure ? https : http;
var headers = { 'Content-Type': 'application/json' };
var ca = this.endpoint.ca || certs.ca;
// AES128-GCM-SHA256 is a TLS v1.2 cipher and only available when node is
// linked against openssl 1.0.1 or newer. Node.js v0.10 ships with openssl
// 1.0.1e so we're good with most installs but distro-built binaries are
// often linked against the system openssl and those can be as old as 0.9.8.
// That's why we have AES256-SHA as a fallback but because it's a CBC cipher,
// it's vulnerable to BEAST attacks. I don't think we have a reasonable
// alternative here because RC4 has known weaknesses too. The best we can
// probably do is *strongly* recommend that people upgrade.
var ciphers = 'AES128-GCM-SHA256:AES256-SHA';
var rejectUnauthorized = this.endpoint.rejectUnauthorized;
if (this.proxy) {
path = url.format({
protocol: this.endpoint.secure ? 'https' : 'http',
pathname: path,
hostname: host,
port: port,
});
host = this.proxy.host;
port = this.proxy.port;
proto = this.proxy.secure ? https : http;
ca = this.proxy.ca;
// Defaults to require('tls').DEFAULT_CIPHERS which is assumed to be sane.
ciphers = this.proxy.ciphers || '';
rejectUnauthorized = this.proxy.rejectUnauthorized;
if (this.proxy.auth) {
headers['Proxy-Authorization'] =
'Basic ' + Buffer(this.proxy.auth).toString('base64');
}
}
var options = {
agent: false,
host: host,
port: port,
path: path,
method: 'POST',
headers: headers,
};
if (proto === https) {
if (ca) {
options.ca = ca;
}
if (ciphers) {
options.ciphers = ciphers;
}
options.rejectUnauthorized = !!rejectUnauthorized;
}
if (this.state === 'new') {
var proxy = encode(this.proxy);
this.notice('using collector %s%s',
encode(this.endpoint),
proxy ? util.format(' via proxy %s', proxy) : '');
}
this.request = proto.request(options, this.onresponse.bind(this));
// Can't unref the socket until the connection has established, meaning
// the agent keeps the event loop alive until the DNS lookup completes.
// Maybe mitigate by caching the result of the DNS lookup?
// See https://github.com/joyent/node/issues/7149.
// See https://github.com/joyent/node/issues/7077.
this.request.once('socket', function(socket) {
socket = socket.socket || socket;
socket.unref();
});
this.request.once('close', this.onclose.bind(this));
this.request.once('error', this.onerror.bind(this));
this.encoder = json.JsonEncoder();
this.encoder.pipe(this.request);
var handshake = {
agentVersion: this.options.agentVersion,
appName: this.options.agent.appName,
hostname: this.options.agent.hostname,
key: this.options.agent.key,
pid: process.pid,
};
if (this.sessionId !== null) {
handshake.sessionId = this.sessionId;
}
this.encoder.write(handshake);
};
Transport.prototype.disconnect = function() {
if (this.request !== null) {
this.request.end();
this.request = null;
this.encoder = null;
}
if (this.response !== null) {
this.response.destroy();
this.response = null;
this.decoder = null;
}
this.state = 'disconnected';
};
Transport.prototype.disconnected = function() {
return this.state === 'disconnected';
};
// for tests
Transport.reconnectDelay = 500;
Transport.prototype.onclose = function(err) {
// TODO(bnoordhuis) Proper back-off. This is workable for now though.
setTimeout(this.connect.bind(this), Transport.reconnectDelay).unref();
};
Transport.prototype.onerror = function(err) {
if (this.state === 'new' || this.state === 'disconnected') {
this.warn('cannot connect to collector:', err.message);
this.state = 'not-connected';
} else if (this.state === 'connected') {
this.warn('lost connection to collector:', err.message);
this.state = 'lost-connection';
}
};
Transport.prototype.ondecodererror = function(err) {
var data = ('' + err.data).slice(0, 1024);
data = data.replace(/[\t\r\n]/g, function(c) {
return {'\t': '\\t', '\r': '\\r', '\n': '\\n'}[c] || c;
});
data = data.replace(/[^\u0020-\u007F]/g, function(c) {
return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);
});
this.warn('transport error: %s (input: \'%s\')', err.message, data);
};
Transport.prototype.onresponse = function(response) {
if (!this.proxy && response.socket.getPeerCertificate) {
var actual = response.socket.getPeerCertificate().fingerprint;
if (actual !== expectedFingerprint) {
this.warn('SSL fingerprint mismatch! Expected %s, have %s.',
expectedFingerprint, actual);
}
}
if (this.proxy && (response.statusCode === 401 ||
response.statusCode === 407)) {
this.warn('%d proxy authentication error. Bad username/password?',
response.statusCode);
return; // We reconnect after close.
}
this.decoder = new json.JsonDecoder(-1); // Unlimited, collector is trusted.
this.decoder.on('error', this.ondecodererror.bind(this));
this.decoder.once('data', this.onhandshake.bind(this));
this.response = response;
this.response.pipe(this.decoder);
};
Transport.prototype.onhandshake = function(handshake) {
this.decoder.on('data', ondata.bind(this));
this.sessionId = handshake.sessionId;
if (this.state === 'not-connected' || this.state === 'new') {
this.info('connected to collector');
} else if (this.state === 'lost-connection') {
this.info('reconnected to collector');
}
this.state = 'connected';
// Deliver queued Transport#send() calls.
this.sendQueue.splice(0, this.sendQueue.length).forEach(function(f) { f() });
if (typeof(this.onhandshakedone) === 'function') {
this.onhandshakedone(handshake); // Picked up by tests.
}
return;
function ondata(data) {
this.emit('message', data);
}
};
| sweir27/flare | node_modules/strong-agent/lib/transport.js | JavaScript | mit | 13,070 |
var webpack = require('webpack');
module.exports = {
entry : {
'vendor' : ['react'],
'app' : ['./js/init.jsx']
},
output : {
path : __dirname + '/build/',
filename : '[name].bundle.js',
publicPath : '/build/'
},
module : {
loaders : [
{ test : /\.jsx?$/, loaders : ['babel'], exclude: /node_modules/ },
{ test : /\.scss$/, loader : 'style!css!sass' }
]
},
resolve : {
extensions : ['', '.js', '.jsx', '.css', '.scss'],
moduleDirectories : ['web_loaders', 'web_mocules', 'node_loaders', 'node_modules']
},
plugins : [
new webpack.NoErrorsPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin()
]
}; | renemonroy/react-row | example/webpack.config.js | JavaScript | mit | 713 |
module.exports = function(config){
config.set({
basePath : './',
files : [
'app/vendor/angular/angular.js',
'app/vendor/angular-ui-router/release/angular-ui-router.js',
'app/vendor/angular-mocks/angular-mocks.js',
'app/vendor/underscore/underscore.js',
'app/app.js',
'app/controllers/*.js',
'app/directives/*.js',
'app/factories/*.js'
],
autoWatch : true,
frameworks: ['jasmine'],
browsers : ['Chrome'],
plugins : [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine',
'karma-junit-reporter'
],
junitReporter : {
outputFile: 'test_out/unit.xml',
suite: 'unit'
}
});
};
| jakegardner/book-catalog | karma.conf.js | JavaScript | mit | 752 |
var kinetic = require('./kinetic');
var firstStream = new kinetic({
region: 'ap-northeast-1',
streamName: 'firstStream'
});
var secondStream = new kinetic({
region: 'ap-northeast-1',
streamName: 'secondStream'
});
//firstStreamというStreamにListner関数を登録
firstStream.on('message',function(data){
secondStream.emit(
'message',
{key:data.partitionKey,value:data.data}
);
});
secondStream.on('message',function(data){
console.log(data);
});
//定期的にfirstStreamというStreamにメッセージをemitしてやる
setInterval(function() {
var array = ['a','b','c'];
var index = Math.floor(Math.random() * 2 + 1);
var key = array[index];
var value = {body: 'This is a body'};
firstStream.emit('message',{key:key,value:value});
},1000); | imaifactory/kinesis.io | test/kinesis.js | JavaScript | mit | 817 |
/*
用户登录、注册Action
*/
import * as types from '../constant/actionTypes';
import { fetchGet } from '../utils/dbUtil';
export function login(url, username, password, isLoading) {
return async (dispatch) => {
dispatch(loadUser(isLoading));
await fetchGet(url,
(responseObj) => {
if (responseObj.code === '1') {
dispatch(getUser({}));
console.info('用户名或密码错误');
} else {
dispatch(getUser(responseObj.user));
console.info(responseObj.user);
}
},
(error) => {
console.log(`error${error}`);
dispatch(getUser({}));
}, { username, password });
};
}
function loadUser(isLoading) {
return {
type: types.LOAD_USER,
isLoading,
};
}
function getUser(user) {
return {
type: types.GET_USER,
user,
};
}
| Seeingu/borrow-book | src/redux/actions/userAction.js | JavaScript | mit | 860 |
version https://git-lfs.github.com/spec/v1
oid sha256:3d417620403dde710c7fc8668431422954dee139c7803d5ed7c95299170aeb48
size 2686
| yogeshsaroya/new-cdnjs | ajax/libs/moment.js/2.2.1/lang/de.js | JavaScript | mit | 129 |
import RcModule from '../../lib/RcModule';
import actionTypes from './actionTypes';
import moduleStatuses from '../../enums/moduleStatuses';
import getRateLimiterReducer, {
getTimestampReducer,
} from './getRateLimiterReducer';
import errorMessages from './errorMessages';
import proxify from '../../lib/proxy/proxify';
const DEFAULT_THROTTLE_DURATION = 61 * 1000;
const DEFAULT_ALERT_TTL = 5 * 1000;
export default class RateLimiter extends RcModule {
constructor({
alert,
client,
environment,
globalStorage,
throttleDuration = DEFAULT_THROTTLE_DURATION,
...options
}) {
super({
...options,
actionTypes,
});
this._alert = alert;
this._client = client;
this._environment = environment;
this._storage = globalStorage;
this._throttleDuration = throttleDuration;
this._storageKey = 'rateLimiterTimestamp';
this._reducer = getRateLimiterReducer(this.actionTypes);
this._storage.registerReducer({
key: this._storageKey,
reducer: getTimestampReducer(this.actionTypes),
});
this._timeoutId = null;
this._lastEnvironmentCounter = 0;
}
initialize() {
this.store.subscribe(async () => {
if (
!this.ready &&
this._storage.ready &&
(!this._environment || this._environment.ready)
) {
this._bindHandlers();
this.store.dispatch({
type: this.actionTypes.initSuccess,
});
} else if (
this.ready &&
this._environment &&
this._environment.changeCounter !== this._lastEnvironmentCounter
) {
this._lastEnvironmentCounter = this._environment.changeCounter;
this._bindHandlers();
}
});
}
_beforeRequestHandler = () => {
if (this.throttling) {
throw new Error(errorMessages.rateLimitReached);
}
}
_checkTimestamp = () => {
if (!this.throttling) {
this.store.dispatch({
type: this.actionTypes.stopThrottle,
});
}
}
@proxify
async showAlert() {
if (this.throttling && this._alert) {
this._alert.danger({
message: errorMessages.rateLimitReached,
ttl: DEFAULT_ALERT_TTL,
allowDuplicates: false,
});
}
}
_requestErrorHandler = (apiResponse) => {
if (
apiResponse instanceof Error &&
apiResponse.message === 'Request rate exceeded'
) {
const wasThrottling = this.throttling;
this.store.dispatch({
type: this.actionTypes.startThrottle,
timestamp: Date.now(),
});
if (!wasThrottling) {
this.showAlert();
}
setTimeout(this._checkTimestamp, this._throttleDuration);
}
}
_bindHandlers() {
if (this._unbindHandlers) {
this._unbindHandlers();
}
const client = this._client.service.platform().client();
client.on(client.events.requestError, this._requestErrorHandler);
client.on(client.events.beforeRequest, this._beforeRequestHandler);
this._unbindHandlers = () => {
client.removeListener(client.events.requestError, this._requestErrorHandler);
client.removeListener(client.events.beforeRequest, this._beforeRequestHandler);
this._unbindHandlers = null;
};
}
get ttl() {
return this.throttling ? this._throttleDuration - (Date.now() - this.timestamp) : 0;
}
get status() {
return this.state.status;
}
get timestamp() {
return this._storage.getItem(this._storageKey);
}
get throttleDuration() {
return this._throttleDuration;
}
get throttling() {
return Date.now() - this._storage.getItem(this._storageKey) <= this._throttleDuration;
}
get ready() {
return this.state.status === moduleStatuses.ready;
}
}
| ele828/ringcentral-js-integration-commons | src/modules/RateLimiter/index.js | JavaScript | mit | 3,715 |
App.CredentialsIndexController = Ember.ArrayController.extend({
itemController: 'credentialIndex',
init: function() {
this.tick();
this._super();
},
tick: function() {
var unixTimeMiliseconds = new Date().getTime();
var unixTime = ~~(unixTimeMiliseconds / 1000);
this.set('unixTimeMiliseconds', unixTimeMiliseconds);
// Only update the property if it has changed in order to save
// unnecessary recomputations.
if (unixTime != this.get('unixTime')) {
this.set('unixTime', unixTime);
}
Ember.run.later(this, this.tick, 75);
},
progress: function() {
if (this.get('oneTimer')) {
return this.objectAt(0).get('progress');
} else {
return false;
}
}.property('@each.progress'),
oneTimer: function() {
var items = this.get('length');
if (items < 1) {
return false;
} else {
var thisTimeStep = this.objectAt(0).get('timeStep');
return this.every(function(item) {
return thisTimeStep == item.get('timeStep');
});
}
}.property('@each.timeStep'),
actions: {
about: function() {
this.transitionToRoute('about');
}
}
});
App.CredentialIndexController = Ember.ObjectController.extend({
needs: 'credentialsIndex',
credentials: Ember.computed.alias('controllers.credentialsIndex'),
clock: Ember.computed.alias('controllers.credentialsIndex'),
hexKey: function() {
return base32_decode(this.get('key'));
}.property('key'),
progress: function() {
unixTime = this.get('clock.unixTimeMiliseconds') / 1000;
return ((unixTime - this.get('offset')) / this.get('timeStep')) % 1;
}.property('clock.unixTimeMiliseconds', 'offset', 'timeStep'),
token: function() {
try {
return totp(this.get('hexKey'),
this.get('clock.unixTime'),
this.get('timeStep'),
this.get('hash'),
this.get('codeLength'),
this.get('offset'));
} catch(e) {
console.error(e);
return null;
}
}.property('hexKey', 'clock.unixTime', 'timeStep', 'hash', 'codeLength', 'offset')
});
| timothymctim/authenticator | js/controllers/credentialsIndex.js | JavaScript | mit | 1,970 |
import AuthorizeRoute from './../authorize';
export default AuthorizeRoute.extend({
queryParams: {
modify: false
},
beforeModel(params) {
var offerId = this.modelFor('offer').get('id');
var offer = this.store.peekRecord('offer', offerId);
if(offer) {
if ((offer.get('isScheduled') && !params.queryParams.modify) || !(offer.get("isReviewed") || offer.get('isScheduled')) ) {
if(this.get('session.isAdminApp')) {
this.transitionTo('review_offer.logistics', offer);
} else {
this.transitionTo('offer.transport_details', offer);
}
}
} else {
this.transitionTo("offers");
}
}
});
| crossroads/shared.goodcity | app/routes/offer/plan_delivery.js | JavaScript | mit | 673 |
const initialState = {
"marriageEquality": {
"title": "婚姻平權",
"statement": "婚姻不限性別",
"partyPositions": [
{
"party": "DPP",
"dominantPosition": "aye",
"dominantPercentage": 100,
"records": [
{
"id": 2,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1352390400,
"category": "發言",
"content": "美國剛進行總統大選,期間也針對很多公共議題進行公民投票,其中有三個州同意通過同性婚姻,請問院長,對於同性伴侶、同性婚姻、不同性傾向的權益問題,你有何立場?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/68/LCIDC01_1016801.pdf",
"meeting": "院會",
"meetingCategory": "院會質詢"
},
{
"id": 3,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 5,
"issue": "婚姻平權",
"legislator": "林佳龍",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 6,
"issue": "婚姻平權",
"legislator": "林淑芬",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 8,
"issue": "婚姻平權",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 9,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 4,
"issue": "婚姻平權",
"legislator": "吳秉叡",
"party": "DPP",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 12,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1356451200,
"category": "發言",
"content": "我自己非常幸運,在念書期間學校做了非常好的教育,讓我們進一步了解不同性傾向的觀點以及他們跟社會互動所面臨的種種挑戰,讓我們能夠尊重、了解他們;不只是包容他們,我們甚至能夠欣賞不同性傾向的人對社會多元化所帶來的貢獻。可是我非常遺憾,現在的行政部門還是採取迴避、保守、抗拒的心態。我們今天重新提出同性婚姻合法化這樣的修法方向,就是要呼籲從善如流,也希望立法院其他同仁能共同來支持,民間社團提出的伴侶制度,也是可以同時討論的。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/03/LCIDC01_1020304.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "公聽會\n 發言"
},
{
"id": 11,
"issue": "婚姻平權",
"legislator": "吳秉叡",
"party": "DPP",
"date": 1356451200,
"category": "發言",
"content": "同性婚姻其實是一種人權保障的高度體現,臺灣社會經過這麼久的教育,\n 觀念和資訊這麼發達,如果把這個理念闡述出來,我相信絕大多數的人是會同意的。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/03/LCIDC01_1020304.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "公聽會\n 發言"
},
{
"id": 13,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1356451200,
"category": "發言",
"content": "舉行「同性婚姻合法化及伴侶權益法制化」公聽會",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/03/LCIDC01_1020304.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "公聽會\n 主辦"
},
{
"id": 14,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1357488000,
"category": "發言",
"content": "其實,在亞洲其他國家中,尤其是一些講華語的國家,台灣算是相對自由與開放的國家,當然,越是自由與開放的國家,其文化與創意也更能蓬勃發展,樣態上也更趨多元,這也是台灣的優勢,像本席就主張同性婚姻可以合法化,因為我覺得台灣社會若能包容不同性傾向的人,就表示我們是一個越前衛、越進步的國家,在這樣的國家裡面文化創意的空間自然就更大,這也表示我們的社會可以包容更多不同意見,換言之,這裡是讓更多元意見存在的地方!",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/06/LCIDC01_1020601.pdf",
"meeting": "內政委員會會",
"meetingCategory": "委員會質詢"
},
{
"id": 16,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 17,
"issue": "婚姻平權",
"legislator": "林淑芬",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 18,
"issue": "婚姻平權",
"legislator": "段宜康",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 19,
"issue": "婚姻平權",
"legislator": "陳其邁",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 20,
"issue": "婚姻平權",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 21,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "提案將婚姻當事人由男女改為不限性別",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdcfc6d2cdccc7",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
},
{
"id": 24,
"issue": "婚姻平權",
"legislator": "陳其邁",
"party": "DPP",
"date": 1384876800,
"category": "提案",
"content": "內政部103年度單位預算第3目「戶政業務」分支計畫「01督導改進戶籍行政」編列業務費219萬2千元。惟今年6月內政部發函予一對已登記結婚之吳姓跨性別伴侶,要求其自行辦理撤銷婚姻,又於今年8月7日內政部專案會議,認定吳姓伴侶婚姻有效,內政部態度反覆,標準不一,侵害民眾權益,造成不必要之精神傷害,顯見內政部缺乏性別友善意識。爰此,提案凍結前開預算1/2,計109萬6千元,俟內政部提出「如何推行我國同性婚姻合法化」之專案報告,向本院內政委員會報告並經同意後,始得動支。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/75/LCIDC01_1027501.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算凍結案"
},
{
"id": 25,
"issue": "婚姻平權",
"legislator": "李俊俋",
"party": "DPP",
"date": 1384876800,
"category": "提案",
"content": "內政部103年度單位預算第3目「戶政業務」分支計畫「01督導改進戶籍行政」編列業務費219萬2千元。惟今年6月內政部發函予一對已登記結婚之吳姓跨性別伴侶,要求其自行辦理撤銷婚姻,又於今年8月7日內政部專案會議,認定吳姓伴侶婚姻有效,內政部態度反覆,標準不一,侵害民眾權益,造成不必要之精神傷害,顯見內政部缺乏性別友善意識。爰此,提案凍結前開預算1/2,計109萬6千元,俟內政部提出「如何推行我國同性婚姻合法化」之專案報告,向本院內政委員會報告並經同意後,始得動支。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/75/LCIDC01_1027501.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算凍結案"
},
{
"id": 26,
"issue": "婚姻平權",
"legislator": "段宜康",
"party": "DPP",
"date": 1384876800,
"category": "提案",
"content": "內政部103年度單位預算第3目「戶政業務」分支計畫「01督導改進戶籍行政」編列業務費219萬2千元。惟今年6月內政部發函予一對已登記結婚之吳姓跨性別伴侶,要求其自行辦理撤銷婚姻,又於今年8月7日內政部專案會議,認定吳姓伴侶婚姻有效,內政部態度反覆,標準不一,侵害民眾權益,造成不必要之精神傷害,顯見內政部缺乏性別友善意識。爰此,提案凍結前開預算1/2,計109萬6千元,俟內政部提出「如何推行我國同性婚姻合法化」之專案報告,向本院內政委員會報告並經同意後,始得動支。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/75/LCIDC01_1027501.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算凍結案"
},
{
"id": 27,
"issue": "婚姻平權",
"legislator": "姚文智",
"party": "DPP",
"date": 1387900800,
"category": "發言",
"content": "大家一直在反同性戀,在冬季奧運時,美國就請一個同性戀當團長到俄羅斯去,這不要花錢呀!這是一個用不同的事件去累積、激盪而推動性別平等的作法,你們也可以做呀!國內也有同志的遊行或是其他活動,你們也可以有些創意,不用花錢呀!但是現在不太看得到你們的角色。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/07/LCIDC01_1030702.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 28,
"issue": "婚姻平權",
"legislator": "段宜康",
"party": "DPP",
"date": 1387900800,
"category": "發言",
"content": "這樣問你好了,你覺得該不該往這個方向去努力?這樣比較有階段性,要往一個方向去努力跟現在馬上要落實是不同的,所以我這樣問你好了,你覺得我們的政府或性別平等業務該不該將此列為重要推動項目?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/07/LCIDC01_1030702.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 29,
"issue": "婚姻平權",
"legislator": "邱志偉",
"party": "DPP",
"date": 1396195200,
"category": "發言",
"content": "如果他(軍事院校的學生)今天參與其他的議題,例如我們支持同性婚姻或是多元成家的方案,如果他去參加,你們會禁止嗎?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/21/LCIDC01_1032101.pdf",
"meeting": "外交及國防委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 30,
"issue": "婚姻平權",
"legislator": "蕭美琴",
"party": "DPP",
"date": 1413388800,
"category": "發言",
"content": "有一些國家承認同性婚姻的合法性,如果今天在台灣的一些外交官有同性的配偶或伴侶,那外交部是否承認他們的婚姻關係?總是會涉及簽證以及居留權的問題,我們的態度為何?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/67/LCIDC01_1036701.pdf",
"meeting": "外交及國防委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 31,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1413388800,
"category": "發言",
"content": "舉行「用平等的心把每一個人擁入憲法的懷抱─同性婚姻及同志收養議題」公聽會",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/64/LCIDC01_1036401.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "公聽會\n 主辦"
},
{
"id": 32,
"issue": "婚姻平權",
"legislator": "陳其邁",
"party": "DPP",
"date": 1415721600,
"category": "提案",
"content": "查行政院100年函頒之「性別平等政策綱領」乃由行政院性別平等處主政,規劃我國性別平等施政藍圖。然查「性別平等政策綱領」內容偏重婦女政策,多元性別、同志權益等政策尚不完備,實有不盡完善之處。且查103年6月「消除對婦女一切形式歧視公約(CEDAW)中華民國(臺灣)第2次國家報告國外專家審查暨發表會議」中,國外專家建議政府應將多元性別內涵納入性別平等教育教材中,並建議政府就國內社會關注的多元家庭法制保障及福利取得議題評估與制定相關政策。又查近年台灣同志及多元性別權益諸多倡議活動皆將「多元性別」、「婚姻平權、平等成家」、「擁抱性/別認同差異」主題納入,國際知名之紐約時報亦於103年10月報導台灣社會追求同志平權運動,形容台灣已具有亞洲同性戀者的「燈塔」地位。爰此,為求政府之性別平等政策不致落後社會脈動及趨勢之外,行政院性別平等處身為「性別平等政策綱領」主政機關,應就同志權益、多元性別、婚姻平權等議題進行研擬,將上述層面之議題修正納入「性別平等政策綱領」政策內容。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/80/LCIDC01_1038001.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算主決議"
},
{
"id": 33,
"issue": "婚姻平權",
"legislator": "李俊俋",
"party": "DPP",
"date": 1415721600,
"category": "提案",
"content": "查行政院100年函頒之「性別平等政策綱領」乃由行政院性別平等處主政,規劃我國性別平等施政藍圖。然查「性別平等政策綱領」內容偏重婦女政策,多元性別、同志權益等政策尚不完備,實有不盡完善之處。且查103年6月「消除對婦女一切形式歧視公約(CEDAW)中華民國(臺灣)第2次國家報告國外專家審查暨發表會議」中,國外專家建議政府應將多元性別內涵納入性別平等教育教材中,並建議政府就國內社會關注的多元家庭法制保障及福利取得議題評估與制定相關政策。又查近年台灣同志及多元性別權益諸多倡議活動皆將「多元性別」、「婚姻平權、平等成家」、「擁抱性/別認同差異」主題納入,國際知名之紐約時報亦於103年10月報導台灣社會追求同志平權運動,形容台灣已具有亞洲同性戀者的「燈塔」地位。爰此,為求政府之性別平等政策不致落後社會脈動及趨勢之外,行政院性別平等處身為「性別平等政策綱領」主政機關,應就同志權益、多元性別、婚姻平權等議題進行研擬,將上述層面之議題修正納入「性別平等政策綱領」政策內容。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/80/LCIDC01_1038001.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算主決議"
},
{
"id": 34,
"issue": "婚姻平權",
"legislator": "姚文智",
"party": "DPP",
"date": 1415721600,
"category": "提案",
"content": "查行政院100年函頒之「性別平等政策綱領」乃由行政院性別平等處主政,規劃我國性別平等施政藍圖。然查「性別平等政策綱領」內容偏重婦女政策,多元性別、同志權益等政策尚不完備,實有不盡完善之處。且查103年6月「消除對婦女一切形式歧視公約(CEDAW)中華民國(臺灣)第2次國家報告國外專家審查暨發表會議」中,國外專家建議政府應將多元性別內涵納入性別平等教育教材中,並建議政府就國內社會關注的多元家庭法制保障及福利取得議題評估與制定相關政策。又查近年台灣同志及多元性別權益諸多倡議活動皆將「多元性別」、「婚姻平權、平等成家」、「擁抱性/別認同差異」主題納入,國際知名之紐約時報亦於103年10月報導台灣社會追求同志平權運動,形容台灣已具有亞洲同性戀者的「燈塔」地位。爰此,為求政府之性別平等政策不致落後社會脈動及趨勢之外,行政院性別平等處身為「性別平等政策綱領」主政機關,應就同志權益、多元性別、婚姻平權等議題進行研擬,將上述層面之議題修正納入「性別平等政策綱領」政策內容。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/80/LCIDC01_1038001.pdf",
"meeting": "內政委員會",
"meetingCategory": "預算主決議"
},
{
"id": 35,
"issue": "婚姻平權",
"legislator": "吳宜臻",
"party": "DPP",
"date": 1418227200,
"category": "發言",
"content": "抱歉!因為本席在10月及11月請假,所以未出席委員會會議,現在請教次長,對包含同性婚姻的婚姻平權法案,法務部到底提出了嗎?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/01/LCIDC01_1040101.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 36,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1418832000,
"category": "發言",
"content": "其次,我們看到很多國家都承認同性婚姻,他們甚至於可以去登記,如果他們在國外已經是合法登記的同性婚姻,今天他們到國內來,他們可不可以拿國外合法登記的結婚證書到國內來登記結婚?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/01/LCIDC01_1040101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 37,
"issue": "婚姻平權",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1419177600,
"category": "發言",
"content": "今天如果你們繼續要主張這條法律必須基於所謂的傳統、人倫與國情,就是一種社會的歧視,而此背後是這個法律制度性歧視的結構,所以,為什麼我們主張要修民法,因為如果前面所說的制度性歧視結構不打破,社會歧視依然可以這麼大聲地繼續污名,而且竟然是由立法委員在這裡說出來,讓我們覺得實在不可思議!",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 39,
"issue": "婚姻平權",
"legislator": "段宜康",
"party": "DPP",
"date": 1419177600,
"category": "發言",
"content": "因為擔心國家的人口政策而不贊成少數人同性婚姻,照這個邏輯,在一男一女結婚之前就要統統檢查有沒有生育能力,沒有生育能力的就沒有資格結婚,否則將影響國家人口政策,現在出生率已經這麼低了,怎麼可以容許沒有生育能力的人結婚?即便是一男一女結婚,在結婚之前都要證明可以生育,你的邏輯是這樣嗎?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 40,
"issue": "婚姻平權",
"legislator": "林淑芬",
"party": "DPP",
"date": 1419177600,
"category": "發言",
"content": "你這種說法根本是助長歧視,完全是一種假裝式的漸進及演進,基本上,你們認為同志的人權應該要保障,但現在不能給,然後結果就是剝奪同志的基本人權,我告訴你,你這是助長歧視,假裝演進,假裝漸進。你們認為基本上是應該要,但是現在不能,結果就是剝奪他們的基本人權嘛!",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 41,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1419177600,
"category": "發言",
"content": "你覺得人權是要用所謂的共識才能決定?剛剛段委員講得很好,法律是要保障少數人的權益,但今天對於這些少數人的權益,卻要經過多數人的同意,但那些多數人根本不承認這些少數人的存在啊!所以多數人不同意,因此這些少數人的權益就不受到保障,是這樣子嗎?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 45,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1420387200,
"category": "發言",
"content": "今日報紙刊載一則「原民部落喜辦同志家庭收養」的新聞,前陣子本委員會方才審查「婚姻平權法草案」,當時法務部認為「婚姻平權法草案」若通過,社會對立將會太高,也會有許多的負面輿論,因而不讓同志婚姻平權及收養孩童;但是,我們看到原住民部落有兩位女同志,他們一起生活近30年,並收養其中一位女同志哥哥的小孩,三人共同生活了12年,他們一直把她當親生女兒般照顧,所以部落特別認可這對同志家庭收養這名小孩,他們明知依照漢人的法律,組成同志家庭不具有法律效力,但是他們認為即使沒有被法律認可,仍可以實踐非常重要的家庭功能,所以他們的收養儀式獲得長老們的首肯,由頭目遵循傳統將祖傳禮刀、大鐵鍋、琉璃珠、現金等貴重禮品贈與被收養者生父的家族,完成收養儀式。既然部落做得到,我們漢族是不是也能夠拋下傲慢的心態,重新認識另外一個與我們不一樣的同志家族?請法務部與司法院能夠多加考量。好不好?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/08/LCIDC01_1040801.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 46,
"issue": "婚姻平權",
"legislator": "陳其邁",
"party": "DPP",
"date": 1420992000,
"category": "發言",
"content": "所以我說尊重部落會議的決定啊!這是原住民族自治,所以包括對同性婚姻的看法,我們也應該尊重部落,你剛剛的口頭宣示很好、很進步啊!我給你鼓勵啊!所以我的意思是,我們進一步在原住民族基本法裡頭,就把同性婚姻這個部分列入,明定我們尊重部落所做的決定,尊重原住民自治,人家魯凱族贊成,或是有其他族群贊成,我們應該要尊重他們啊!我也同意啊!",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/12/LCIDC01_1041201.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 47,
"issue": "婚姻平權",
"legislator": "尤美女",
"party": "DPP",
"date": 1426089600,
"category": "發言",
"content": "法務部在2001年呈報行政院的人權保障基本法草案第二十四條,即已明白規定國家應尊重同性戀者之權益,同性男女得依法組成家庭及收養子女。當時即已定調要保障同志的婚姻,馬政府上台之後,卻整個推翻,現在又要從頭來過嗎?事實上你們早已委託戴教授去對同志的權益作研究,厚厚的一本報告在法務部裡面都躺多久了,你們還要重啟爐灶,從頭再來?",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/16/LCIDC01_1041601.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 1
},
{
"party": "TSU",
"dominantPosition": "aye",
"dominantPercentage": 100,
"records": [
{
"id": 7,
"issue": "婚姻平權",
"legislator": "黃文玲",
"party": "TSU",
"date": 1356019200,
"category": "提案",
"content": "提案將婚姻當事人由男女改為雙方",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/08/02/14/LCEWA01_080214_00011.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "法律提案"
}
],
"rank": 1
},
{
"party": "KMT",
"dominantPosition": "nay",
"dominantPercentage": 77.78,
"records": [
{
"id": 1,
"issue": "婚姻平權",
"legislator": "黃昭順",
"party": "KMT",
"date": 1336665600,
"category": "發言",
"content": "本院黃委員昭順,針對近日同性婚姻合法化爭議,認為人生而平等,同性婚姻權益等同於異性之婚姻權,應與其享婚姻中相同的權利與義務,亦應受憲法婚姻自由之保障,對於同性婚姻也應採取理解並尊重之態度,儘速修正相關法令,以期落實平等原則,特向行政院提出質詢。",
"positionJudgement": "贊成同性婚姻合法化",
"position": "aye",
"clarificationContent": "假的澄清內容假的澄清內容假的澄清內容假的澄清內容假的澄清內容假的澄清內容",
"clarificationLastUpdate": "2015/5/11",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/32/LCIDC01_1013201.pdf",
"meeting": "院會",
"meetingCategory": "院會書面質詢"
},
{
"id": 10,
"issue": "婚姻平權",
"legislator": "呂學樟",
"party": "KMT",
"date": 1356451200,
"category": "發言",
"content": "本席認為,就法論法來看,法律上本不應該對同性戀者有所歧視,甚至不給予法律上權益的保障!\n \n 在立法上,則仍需要形成社會上的多數共識,尤其台灣現在少子化問題嚴重,如何增產報國也是重要的國安議題,所以同性婚姻合法化及伴侶權益法制化,在國外經過多年討論仍無法獲得絕對多數的支持,更何況民風保守的台灣,而台灣對此一議題缺乏廣泛的討論,也非我們主法院一場公聽會即可以下定論,仍需進一步廣納社會意見,讓社會多加討論才可以。",
"positionJudgement": "未明確表態,認為同性婚姻合法化需要更多社會共識",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/03/LCIDC01_1020304.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "公聽會\n 發言"
},
{
"id": 15,
"issue": "婚姻平權",
"legislator": "孔文吉",
"party": "KMT",
"date": 1382544000,
"category": "發言",
"content": "本席希望你們能夠仔細審酌這件事情,本席是反對的,因為我是基督徒,幸好尤美女委員的提案,本席沒有連署,連署欄沒有本席的名字,我必須在此表示反對,不然很多宗教團體都會來找我。現在有些學校會請同志團體到學校去分享他們的心得,本席希望法務部能站在中性的立場,多聽取各方的意見,教會團體對於同性戀結婚還是無法容許、無法同意的。",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/63/LCIDC01_1026301.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 22,
"issue": "婚姻平權",
"legislator": "羅淑蕾",
"party": "KMT",
"date": 1383235200,
"category": "發言",
"content": "本院羅委員淑蕾,鑑於近期少數團體基於「同性婚姻」、「伴侶制度」、「多人家屬及收養制度」之三大訴求,執意推動「多元成家法案」,將會為台灣帶來家庭的不穩定性及耗費大量社會成本,兒童的權益得不到保障,衍生更多社會問題,感到憂心。爰此,衡平台灣整體社會發展及少數特殊家庭需求,相關主管機關應在維護法制穩定性的前提下,建立起個案考量及處理之機制,特向行政院提出質詢。",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/61/LCIDC01_1026101.pdf",
"meeting": "院會",
"meetingCategory": "院會書面質詢"
},
{
"id": 23,
"issue": "婚姻平權",
"legislator": "丁守中",
"party": "KMT",
"date": 1383840000,
"category": "發言",
"content": "我完全同意同性戀者有相愛、同居也有財產自由處分的完全自主權利,但我更支持宗教團體,因為我是國際佛光會的副總會長。我認為對於宗教團體與一般人的傳統認知,也就是對家庭、對夫妻倫理與價值不應該改變。",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/65/LCIDC01_1026501.pdf",
"meeting": "院會",
"meetingCategory": "院會質詢"
},
{
"id": 38,
"issue": "婚姻平權",
"legislator": "林鴻池",
"party": "KMT",
"date": 1419177600,
"category": "發言",
"content": "今天要討論的民法親屬編部分條文修正案中針對去性別化,希望透過去性別化,修改民法親屬編,讓同性戀可以結婚。有的人認為這其實是基本人權,他們兩個要結婚並沒有礙著別人,不過,這是一個婚姻制度,也是一個家庭制度,我們幾千年來的家庭制度、倫理在一夕之間要透過民法親屬編改變它,我們也可以很快就讓它出委員會,送院會三讀通過,改文字很簡單,但我們需要考量的是,幾千年來的這個家庭制度、倫理的變化對社會產生的衝擊是什麼?",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 42,
"issue": "婚姻平權",
"legislator": "呂學樟",
"party": "KMT",
"date": 1419177600,
"category": "發言",
"content": "我反對的是為同性戀婚姻過當修法,因為這樣的修法會造成千百年來家庭倫常的淪喪,社會的價值觀也會崩潰。",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 43,
"issue": "婚姻平權",
"legislator": "李貴敏",
"party": "KMT",
"date": 1419177600,
"category": "發言",
"content": "我們去看看別的國家如何解決這個問題,我剛才特別提到,我到國外蒐集資料,美國的解決方式是在全民尚未達成共識時讓彼此的對立降到最低,可能是透過法院判決或其他方式,而不是在共識尚未達成時硬要撕裂人民之間的情感。",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 44,
"issue": "婚姻平權",
"legislator": "廖正井",
"party": "KMT",
"date": 1419177600,
"category": "發言",
"content": "我贊成你的看法,我們客家人有家族族譜,像我們就常常談起自己是來台第幾代,相關族譜也都會留傳下來,如果照這樣發展,可能就會失去家庭倫理,家庭關係也不復存在,是不是?",
"positionJudgement": "反對同性婚姻合法化",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/05/LCIDC01_1040501.pdf",
"meeting": "司法及法制委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0.1111111111111111
}
]
},
"recall": {
"title": "罷免",
"statement": "罷免門檻下修",
"partyPositions": [
{
"party": "TSU",
"dominantPosition": "aye",
"dominantPercentage": 100,
"records": [
{
"id": 84,
"issue": "罷免",
"legislator": "許忠信",
"party": "TSU",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5cbced2cbcd",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 83,
"issue": "罷免",
"legislator": "台灣團結聯盟黨團",
"party": "TSU",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5cbced2cbcd",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 82,
"issue": "罷免",
"legislator": "林世嘉",
"party": "TSU",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 54,
"issue": "罷免",
"legislator": "黃文玲",
"party": "TSU",
"date": 1336492800,
"category": "發言",
"content": "有關於總統副總統選舉罷免法第七十條,未滿一年不得罷免的部分,是一個法律的疏漏。本席的意思是,連任者不在此限,其實那個部分不用解釋,就是當時的法律沒有列入而已,這應該是屬於法律疏漏的問題,所以我們把這部分增列上去,應該是沒有影響的。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/34/LCIDC01_1013401.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 93,
"issue": "罷免",
"legislator": "林世嘉",
"party": "TSU",
"date": 1337875200,
"category": "提案",
"content": "公職人員刪除第一年不得罷免之規定 (公職人員選舉罷免法第七十五條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececcc8cdc5cdcfc8d2cdcfc7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 58,
"issue": "罷免",
"legislator": "黃文玲",
"party": "TSU",
"date": 1368374400,
"category": "發言",
"content": "針對總統就職未滿一年不得罷免的規定,我們覺得這不太合理,馬總統的民調這麼低,昨天最新民調出爐,馬總統的支持度只有百分之十九點多,不支持他的比例則有百分之六十幾,將近七成,部長,當時訂定這個法條的理由是什麼??馬總統是連任,是不是不應該適用這個限制規定呢?",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/35/LCIDC01_1023501.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 105,
"issue": "罷免",
"legislator": "台灣團結聯盟黨團",
"party": "TSU",
"date": 1385654400,
"category": "提案",
"content": "下修所有罷免門檻、限制。軍公教可提案罷免。罷免投票是否通過之條文應為正面表述 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcecdc8cdc5cdc7c8d2cdc6cd",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 106,
"issue": "罷免",
"legislator": "許忠信",
"party": "TSU",
"date": 1385654400,
"category": "提案",
"content": "下修所有罷免門檻、限制。軍公教可提案罷免。罷免投票是否通過之條文應為正面表述 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcecdc8cdc5cdc7c8d2cdc6cd",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 60,
"issue": "罷免",
"legislator": "許忠信",
"party": "TSU",
"date": 1386691200,
"category": "發言",
"content": "罷免的連署本來只需要簽名、身分證字號,現在國內有一個黨團提案修法,在罷法連署的時候,必須檢附身分證的影本。(中略)這才不是什麼以示慎重或是造假,而是因為有查核上的困難以及基於方便性考量,但是你們為了一時之方便,而侵害人民的人格權、隱私權及個人資料,所以本席認為這樣的修法不應該擴大,",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/01/LCIDC01_1030101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 111,
"issue": "罷免",
"legislator": "台灣團結聯盟黨團",
"party": "TSU",
"date": 1400169600,
"category": "提案",
"content": "罷免可宣傳 (公職人員選舉罷免法第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecfc8cdc5cccecad2cccec7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 112,
"issue": "罷免",
"legislator": "賴振昌",
"party": "TSU",
"date": 1400169600,
"category": "提案",
"content": "罷免可宣傳 (公職人員選舉罷免法第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecfc8cdc5cccecad2cccec7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 66,
"issue": "罷免",
"legislator": "周倪安",
"party": "TSU",
"date": 1420560000,
"category": "發言",
"content": "今天一個候選人要來宣傳自己,或是別人要來宣傳這個人,讓人家知道他有多麼優秀,他對什麼樣的公共事務非常關心,他希望能有這樣的職位,來擔任這個工作,然後為民喉舌。在這樣的情況下,當他可能面臨要被罷免時,我想所有的人民或關心的人,也會想要知道為什麼這個人必須要被罷免,或他到底違背了什麼樣的民意,所以說,「宣傳罷免」如果是因為這樣的法條而被扼殺,我們認為這是違憲的,也剝奪了人民的言論權。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/08/LCIDC01_1040801.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 1
},
{
"party": "DPP",
"dominantPosition": "aye",
"dominantPercentage": 96.3,
"records": [
{
"id": 81,
"issue": "罷免",
"legislator": "許添財",
"party": "DPP",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 80,
"issue": "罷免",
"legislator": "姚文智",
"party": "DPP",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 79,
"issue": "罷免",
"legislator": "陳歐珀",
"party": "DPP",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 78,
"issue": "罷免",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制 (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 77,
"issue": "罷免",
"legislator": "林佳龍",
"party": "DPP",
"date": 1334851200,
"category": "提案",
"content": "總統副總統連任者不受第一年任期不得罷免之限制\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcecfc7c8cdc5ccc8d2cbcf",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 49,
"issue": "罷免",
"legislator": "陳其邁",
"party": "DPP",
"date": 1335715200,
"category": "發言",
"content": "但是民意代表是民眾所賦予他行使代議政治的權利,假使民意代表在行使職權的過程中,若有違背民眾意願,民眾基於委任的理由,當然隨時可以回收,不應該有一年的限制,不是這樣嗎?",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/29/LCIDC01_1012901.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 89,
"issue": "罷免",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1336060800,
"category": "提案",
"content": "刪除第一年不得罷免之規定\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececfc8cdc5cbccd2cbc9",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 88,
"issue": "罷免",
"legislator": "趙天麟",
"party": "DPP",
"date": 1336060800,
"category": "提案",
"content": "刪除第一年不得罷免之規定\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececfc8cdc5cbccd2cbc9",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 85,
"issue": "罷免",
"legislator": "邱議瑩",
"party": "DPP",
"date": 1336060800,
"category": "提案",
"content": "刪除第一年不得罷免之規定\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececfc8cdc5cbccd2cbc9",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 86,
"issue": "罷免",
"legislator": "葉宜津",
"party": "DPP",
"date": 1336060800,
"category": "提案",
"content": "刪除第一年不得罷免之規定\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececfc8cdc5cbccd2cbc9",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 87,
"issue": "罷免",
"legislator": "許智傑",
"party": "DPP",
"date": 1336060800,
"category": "提案",
"content": "刪除第一年不得罷免之規定\n (總統副總統選舉罷免法第七十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececfc8cdc5cbccd2cbc9",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 51,
"issue": "罷免",
"legislator": "姚文智",
"party": "DPP",
"date": 1336492800,
"category": "發言",
"content": "A.這部分我代林佳龍委員及所有提案委員跟大家報告,希望修正現行條文,使對連任總統的罷免不應受到這一條文的限制,至於其它民選公職代表部分也可併同討論。\n \n B.因為第二任之後,有可能會以為後面都沒有民意束縛了,之後就能海闊天空、為所欲為,不管民怨再怎麼沸騰,再怎麼向你陳情、懇求,你都一意孤行,如果是這樣,那我們對第二任之後還有一年的保障,這其實是有問題的。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/34/LCIDC01_1013401.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 90,
"issue": "罷免",
"legislator": "陳其邁",
"party": "DPP",
"date": 1337875200,
"category": "提案",
"content": "公職人員刪除第一年不得罷免之規定 (公職人員選舉罷免法第七十五條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececcc8cdc5cdcfc8d2cdcfc7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 91,
"issue": "罷免",
"legislator": "姚文智",
"party": "DPP",
"date": 1337875200,
"category": "提案",
"content": "公職人員刪除第一年不得罷免之規定 (公職人員選舉罷免法第七十五條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececcc8cdc5cdcfc8d2cdcfc7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 92,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1337875200,
"category": "提案",
"content": "公職人員刪除第一年不得罷免之規定 (公職人員選舉罷免法第七十五條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcececcc8cdc5cdcfc8d2cdcfc7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 55,
"issue": "罷免",
"legislator": "許添財",
"party": "DPP",
"date": 1351699200,
"category": "發言",
"content": "行政院副院長在混嘛!因為他是負責物價的人。我說清楚了。台灣不是沒有救,該換的人換掉!該幹掉的人幹掉!當然不是用槍斃的,把他拉下來、罷免。人民覺醒的時候就有救了,謝謝!",
"positionJudgement": "贊成人民擁有罷免權",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/69/LCIDC01_1016901.pdf",
"meeting": "經濟委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 101,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "降低罷免投票門檻 (公職人員選舉罷免法第七十三條及第九十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdc8ccd2cdc8c9",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 100,
"issue": "罷免",
"legislator": "尤美女",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "降低罷免投票門檻 (公職人員選舉罷免法第七十三條及第九十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdc8ccd2cdc8c9",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 104,
"issue": "罷免",
"legislator": "李昆澤",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "罷免可宣傳、罷免案成立後辦公辦說明會、放寬罷免提案人數門檻,可補件。 (公職人員選舉罷免法第八十三條、第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfcac8cdc5cec8c8d2cec7cd",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 103,
"issue": "罷免",
"legislator": "蘇震清",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "降低罷免投票門檻 (公職人員選舉罷免法第七十三條及第九十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdc8ccd2cdc8c9",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 102,
"issue": "罷免",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1382630400,
"category": "提案",
"content": "降低罷免投票門檻 (公職人員選舉罷免法第七十三條及第九十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcbcfc8c8cdc5cdc8ccd2cdc8c9",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 62,
"issue": "罷免",
"legislator": "陳其邁",
"party": "DPP",
"date": 1386691200,
"category": "發言",
"content": "所以罷免能不能宣傳一事,應該是沒有問題的,如果罷免不宣傳,人家怎麼知道這位主委、民意代表或是\n 首長做得好不好?",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/01/LCIDC01_1030101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 61,
"issue": "罷免",
"legislator": "許添財",
"party": "DPP",
"date": 1386691200,
"category": "發言",
"content": "臺灣民主基金會的臺灣民主自由人權調查報告書提到,人民行使公投權利只要違背馬英九的旨意,一個接一個被技術性封殺,罷免馬家軍立委的連署也遭中選會技術性干擾,有這樣一回事嗎?",
"positionJudgement": "質疑中選會以行政干擾罷免",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/01/LCIDC01_1030101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 110,
"issue": "罷免",
"legislator": "蔡其昌",
"party": "DPP",
"date": 1397750400,
"category": "提案",
"content": "選舉罷免期間末日遇假日順延。罷免可宣傳 (公職人員選舉罷免法第五條、第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacfc9c8cdc5cec8ccd2cec8c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 109,
"issue": "罷免",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1397750400,
"category": "提案",
"content": "選舉罷免期間末日遇假日順延。罷免可宣傳 (公職人員選舉罷免法第五條、第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacfc9c8cdc5cec8ccd2cec8c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 107,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1397750400,
"category": "提案",
"content": "選舉罷免期間末日遇假日順延。罷免可宣傳 (公職人員選舉罷免法第五條、第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacfc9c8cdc5cec8ccd2cec8c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 108,
"issue": "罷免",
"legislator": "李昆澤",
"party": "DPP",
"date": 1397750400,
"category": "提案",
"content": "選舉罷免期間末日遇假日順延。罷免可宣傳 (公職人員選舉罷免法第五條、第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacfc9c8cdc5cec8ccd2cec8c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 64,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1400428800,
"category": "發言",
"content": "選舉可以宣傳,為什麼罷免不能宣傳?有一種理由是這樣會造成選民跟被罷免人之間的衝突,本席認為這個理由根本不成理由,就是因為公職人員的表現有問題,選民才會提出罷免,所以這個本來就是人民的基本權利,我可以投票給你,我也可以把權利收回來。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/42/LCIDC01_1034201.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 113,
"issue": "罷免",
"legislator": "邱志偉",
"party": "DPP",
"date": 1400774400,
"category": "提案",
"content": "罷免可宣傳 (公職人員選舉罷免法第八十六條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecec8cdc5c9c8d2c9c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 114,
"issue": "罷免",
"legislator": "蘇震清",
"party": "DPP",
"date": 1400774400,
"category": "提案",
"content": "罷免可宣傳 (公職人員選舉罷免法第八十六條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecec8cdc5c9c8d2c9c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 118,
"issue": "罷免",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "罷免可宣傳。罷免提案人數可補提。延長罷免相關期限。罷免選舉可合併舉辦 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cbc7ced2cbc7c7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 123,
"issue": "罷免",
"legislator": "薛凌",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "開放罷免宣傳 (公職人員選舉罷免法第八十六條及第一百十條條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cacbc6d2cacacd",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 115,
"issue": "罷免",
"legislator": "李應元",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "放寬罷免相關期限。放寬再度提起罷免期限。下修罷免連署、投票人數基數。軍公可連署罷免提案、罷免可宣傳。 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8cdc5ced2c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 116,
"issue": "罷免",
"legislator": "陳歐珀",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "放寬罷免相關期限。放寬再度提起罷免期限。下修罷免連署、投票人數基數。軍公可連署罷免提案、罷免可宣傳。 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8cdc5ced2c7",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 117,
"issue": "罷免",
"legislator": "陳其邁",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "罷免可宣傳。罷免提案人數可補提。延長罷免相關期限。罷免選舉可合併舉辦 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cbc7ced2cbc7c7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 122,
"issue": "罷免",
"legislator": "楊曜",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "降低提議門檻。降低連署門檻。廢除禁止宣傳規定/開放罷免宣傳。簡單多數決 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cacbcad2cacbc7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 119,
"issue": "罷免",
"legislator": "高志鵬",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "降低提議門檻。降低連署門檻。廢除禁止宣傳規定/開放罷免宣傳。簡單多數決 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cacbcad2cacbc7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 120,
"issue": "罷免",
"legislator": "柯建銘",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "降低提議門檻。降低連署門檻。廢除禁止宣傳規定/開放罷免宣傳。簡單多數決 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cacbcad2cacbc7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 121,
"issue": "罷免",
"legislator": "邱議瑩",
"party": "DPP",
"date": 1401379200,
"category": "提案",
"content": "降低提議門檻。降低連署門檻。廢除禁止宣傳規定/開放罷免宣傳。簡單多數決 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcacecdc8ccc5cacbcad2cacbc7",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 65,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1420560000,
"category": "發言",
"content": "各位委員,我跟大家報告一下,因為第八十六條跟第一百十條的修正,原則上大家都沒有意見,現在是有一些相關配套必須做文字上的處理,如果現在要做文字處理,可能會來不及,所以我們用協商的方式,兩個禮拜內請內政部、中選會處理好相關條文,跟我這邊配合起來,然後我們在兩個禮拜內進行協商,把這個案子定案,這樣可不可以?原則上我們就這樣處理。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/08/LCIDC01_1040801.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 67,
"issue": "罷免",
"legislator": "邱志偉",
"party": "DPP",
"date": 1421337600,
"category": "發言",
"content": "本次九合一選舉中,更開設二五八個投開票所,反觀台北市選委會告知割闌尾計畫的投開票所數量,卻只有九十九個。選舉、罷免本來就是憲法所保障的公民權,各項權利應該對等,才符合民主原則,選委會應該要說清楚,依據那些理由和法條,竟然讓罷免的投開票所比選舉少掉那麼多,何況當天沒有其他選舉,不可能有人手不足的問題。",
"positionJudgement": "質疑選委會技術干擾罷免投票",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/09/LCIDC01_1040905.pdf",
"meeting": "院會",
"meetingCategory": "委員會質詢\n 書面質詢"
},
{
"id": 124,
"issue": "罷免",
"legislator": "李應元",
"party": "DPP",
"date": 1421337600,
"category": "提案",
"content": "罷免連署人名冊格式一張填一人 (公職人員選舉罷免法增訂第八十條之一條文草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc9cec7c8cdc5c8ccd2c8cb",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 69,
"issue": "罷免",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1427126400,
"category": "發言",
"content": "所有的民意都認為,公投法和選罷法的門檻過高,應該往下修,讓它回應民意,把它變成多數決,不只讓所有的民意可以清楚表達對於某個民意代表是否適任的看法,也可以根據公投法表達自己的意見,做為主決。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/17/LCIDC01_1041701.pdf",
"meeting": "院會",
"meetingCategory": "委員會質詢"
},
{
"id": 70,
"issue": "罷免",
"legislator": "尤美女",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "回歸到人民在憲法上的基本權利──選舉、罷免、創制、複決,對不對?不要對罷免設置一堆門檻,至少要讓人民很清楚地知道為什麼要罷免,所以你所謂的不得宣傳,我想這是不合理的。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 75,
"issue": "罷免",
"legislator": "陳其邁",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "所以是罷免的門檻過高,造成對部分有爭議委員的罷免沒有辦法通過,最大的爭議就在這裡",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 72,
"issue": "罷免",
"legislator": "姚文智",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "A.張委員應該提早把苦處講出來,應該被罷免的是馬總統,不是你。接下來請陳委員其邁質詢。\n \n B.今天我們在講,無非是希望能朝向更公平、更開放、更民主,如果對罷免的投票用層層的技術障礙,最後沒有辦法罷免,其實你們就是違憲。憲法既然有規定,你們就應該設計制度,至少讓在一定的社會判準底下的可以逐步實踐。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 71,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "A.選罷法的問題在於罷免的門檻和罷免可不可以宣傳,你知不知道有關罷免可不可以宣傳的問題曾經在我們內政委員會討論過很多次?\n \n (中略)你們的主席不要說一套、做一套,口頭上說都可以合理地討論,但是行政院的立場卻是從頭到尾擋到底!\n \n B.最後是因為蔡正元當時被罷免,他說:誰敢給我過,我就杯葛到底!所以就擋下來了。大家都認同、內政委員會也通過的可以宣傳,現在就是蔡正元在擋!有關罷免的門檻,請問現在到底可不可以討論?",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 74,
"issue": "罷免",
"legislator": "莊瑞雄",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "我認為公投法的補正以及選罷法的修改是有其正當性的,不只社會上有這樣的需求,做這件事也確實是在落實國民的主權。我想秘書長、中選會主委以及內政部部長,你們應該也有這樣的認知。不要跟民意對抗,這個議題吵多久了?相信中國國民黨現在的朱立倫主席也有意回應社會大眾的訴求,就像秘書長剛剛說的,政黨來政黨去,有時誰要上台、有時誰要在台下都不一定,所以要合理地把關、堅守合理民主的正當性並完備合理的程序,而不要變成鐵板一塊,把公民團體的訴求全都砍掉,否則這樣的態度就非常錯誤而傲慢了。",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 125,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳、罷免活動經費可列所得稅扣除額、選務人員應對罷免保持中立⋯⋯ (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5ceccc6d2cecacb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 126,
"issue": "罷免",
"legislator": "吳秉叡",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳、罷免活動經費可列所得稅扣除額、選務人員應對罷免保持中立⋯⋯ (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5ceccc6d2cecacb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 127,
"issue": "罷免",
"legislator": "蘇震清",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳、罷免活動經費可列所得稅扣除額、選務人員應對罷免保持中立⋯⋯ (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5ceccc6d2cecacb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 128,
"issue": "罷免",
"legislator": "李俊俋",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳\n (總統副總統選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5cecacad2cec9cd",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 129,
"issue": "罷免",
"legislator": "吳秉叡",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳\n (總統副總統選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5cecacad2cec9cd",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 130,
"issue": "罷免",
"legislator": "蘇震清",
"party": "DPP",
"date": 1428595200,
"category": "提案",
"content": "罷免相關規定視同選舉,罷免可以宣傳\n (總統副總統選舉罷免法部分條文修正草案)",
"positionJudgement": "贊成下修罷免門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfc8cfc8c8cdc5cecacad2cec9cd",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
}
],
"rank": 0.9629629629629629
},
{
"party": "KMT",
"dominantPosition": "nay",
"dominantPercentage": 87.5,
"records": [
{
"id": 48,
"issue": "罷免",
"legislator": "紀國棟",
"party": "KMT",
"date": 1335715200,
"category": "發言",
"content": "既然選罷法裡面有規定選舉的非法或詐術手段,相對的,就罷免上,也應該做對等的規定。有需要的話,選罷法在這方面是否也要做個檢視、檢討?",
"positionJudgement": "未明確表態",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/29/LCIDC01_1012901.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 52,
"issue": "罷免",
"legislator": "紀國棟",
"party": "KMT",
"date": 1336492800,
"category": "發言",
"content": "所以設定一年的限制,基本上有一個目的,就是讓民眾可以更深層地思考、充分思考,不會意氣用事,應該有這樣的設計吧!不用說一年,如果就任一個月之內也可以提出罷免,是不是會讓整個政治充滿不安定性?",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/34/LCIDC01_1013401.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 53,
"issue": "罷免",
"legislator": "陳超明",
"party": "KMT",
"date": 1336492800,
"category": "發言",
"content": "A.一年就要把總統罷免,這種事情難道不會影響未來的好壞?才剛開始就反對這樣不太好吧?我認為至少要看兩年才知道好壞\n \n B.人生的過程很奇怪,當初你做大事情,反對的人很多,但是你把它完成以後,很多人會對你歌功頌德,舉本席的實例,大埔事件中的竹南科學園區是我一手創立,我在選舉的時候被人家攻擊,最後被打下來,但是經過10 年,本席這次東山再起,大家就說我當初那麼厲害,所以當政治人物不要隨便衝動,因為民意如流水,一個大的政策可能在一時看不出好壞,但未來就能看出來,因此總統不應該在一年不到的時間就罷免。副主委覺得我的看法正不正確?",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/34/LCIDC01_1013401.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 50,
"issue": "罷免",
"legislator": "吳育昇",
"party": "KMT",
"date": 1336492800,
"category": "發言",
"content": "第二任競選連任成功之後,一樣是一切歸零,要看第二任的第一年做了多少事情,所以從整個概念來看,在政治的現實面,他是連任的,但是從法理的解釋,他一樣是新任,不能因為他是連任,所以認為就任後就是第五年的開始,因此就可以罷免。",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/101/34/LCIDC01_1013401.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 98,
"issue": "罷免",
"legislator": "江啟臣",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 97,
"issue": "罷免",
"legislator": "吳育昇",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 96,
"issue": "罷免",
"legislator": "謝國樑",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 95,
"issue": "罷免",
"legislator": "紀國棟",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 99,
"issue": "罷免",
"legislator": "李慶華",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 94,
"issue": "罷免",
"legislator": "邱文彥",
"party": "KMT",
"date": 1347897600,
"category": "提案",
"content": "罷免連署應附切結書、罷免提議人應附身分證影本 (公職人員選舉罷免法部分條文修正草案)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lgmeetimage?cfc7cfcdcfcec8cdc5cac6d2c9cb",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 57,
"issue": "罷免",
"legislator": "吳育昇",
"party": "KMT",
"date": 1368374400,
"category": "發言",
"content": "a.「一年」是目前台灣政治文化當中,大家約定俗成而可以接受的概念。部長,你認為罷免的時間如果予以縮短,對台灣的政治會不會有影響?\n b.總之,我認為一年的時間是給國家社會一個比較公道喘息的空間,也是給當選人一個執政的表現機會。",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/35/LCIDC01_1023501.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 56,
"issue": "罷免",
"legislator": "江啟臣",
"party": "KMT",
"date": 1368374400,
"category": "發言",
"content": "本席共同提案公職人員選舉罷免法修正條文第七十六條、第七十九條、第八十條、第八十三條修正案,增訂罷免案之提議人及連署人除了填寫年籍資料外,還必須附上國民身分證件影本及切結書等要件,(書面意見)",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/102/35/LCIDC01_1023501.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢\n 書面質詢"
},
{
"id": 59,
"issue": "罷免",
"legislator": "徐欣瑩",
"party": "KMT",
"date": 1386691200,
"category": "發言",
"content": "請問這百分之二你怎麼確認?是要提供身分證嗎?如果我一個人隨便簽,也可以簽不少名字,所以到底要怎麼確認?(中略)連署人的部分呢?需不需要身分證?(中略)如果立法院有提案修法的話,希望大家能夠支持,因為任何罷免案都要很審慎地審查。謝謝。",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/01/LCIDC01_1030101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 76,
"issue": "罷免",
"legislator": "黃昭順",
"party": "KMT",
"date": 1411488000,
"category": "發言",
"content": "我每次只要在這裡主持一次會議,我和林國正委員回去高雄就被罷免一次,不僅只被罷免,他們還每天在那裡簽連署書。其實我個人根本不擔心這種事,對我來講那是小兒科,我也不在乎那些人。憑良心講,我知道他們做的事情有很多是違反我們大家所期待的。",
"positionJudgement": "講罷免但不知所云",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/57/LCIDC01_1035701_00007.pdf",
"meeting": "經濟委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 68,
"issue": "罷免",
"legislator": "蔡正元",
"party": "KMT",
"date": 1426435200,
"category": "發言",
"content": "前一段時間情人節不是要罷免我嗎?跟那些什麼爛花一起搞要罷免我,明明講好了,不管法律對不對都要遵守,最起碼媒體不准宣傳,我也沒有宣傳罷免活動啊!要宣傳我會輸他嗎?我謹守規定,要反宣傳還不容易,結果他們故意找人來製造宣傳,你看一下!",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/19/LCIDC01_1041901.pdf",
"meeting": "交通委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 73,
"issue": "罷免",
"legislator": "張慶忠",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "如果沒有門檻的話,我們可能每天都會被罷免,罷免除了過不過的問題之外,那種感覺、感受很不好,所以本席認為罷免還是要有門檻,謝謝。",
"positionJudgement": "反對下修罷免門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/104/21/LCIDC01_1042101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0
},
{
"party": "PFP",
"dominantPosition": "unknown",
"dominantPercentage": 100,
"records": [
{
"id": 63,
"issue": "罷免",
"legislator": "陳怡潔",
"party": "PFP",
"date": 1386691200,
"category": "發言",
"content": "(1)關於身分證字號、戶籍地址書寫不明、錯誤的部分,相關規定中並沒有規定不能拿回去補正,即沒有不准提議人拿回不符合的連署書,所以你們是依據什麼規定讓其不能拿回去? (2)你們的依法行政是依你們的想法在行政,這等於是自打嘴巴,難怪人家都質疑你們是特定政黨的打手,如果你們失去了公信力,那就沒有存在的必要。",
"positionJudgement": "質疑中選會以行政干擾罷免",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lci.ly.gov.tw/LyLCEW/communique1/final/pdf/103/01/LCIDC01_1030101.pdf",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0
}
]
},
"referendum": {
"title": "公投",
"statement": "公投門檻下修",
"partyPositions": [
{
"party": "TSU",
"dominantPosition": "aye",
"dominantPercentage": 100,
"records": [
{
"id": 132,
"issue": "公投",
"legislator": "黃文玲",
"party": "TSU",
"date": 1337702400,
"category": "發言",
"content": "為什麼要限制公民投票法的部分要絕對多數?在這種情況下,其實可以用相對多數來處理,只要人數超過二分之一,就是贊成或反對的有超過二分之一,成案就好了,為什麼要用絕對多數,總統、副總統選舉都沒有到絕對多數,對不對?",
"positionJudgement": "贊成簡單多數決",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 148,
"issue": "公投",
"legislator": "黃文玲",
"party": "TSU",
"date": 1338912000,
"category": "發言",
"content": "。公民投票是人民直接行使民權的一部分,所以我們認為,第一、提案人本來就不應該設有限制。至於連署人門檻的這部分,如果按照最近這一次總統、副總統選舉人數的 5%來講的話,那連署的門檻要將近 90 萬人左右才有辦法成案來舉行公民投票。本席認為,在這種情況下,這等於是設了重重的關卡要讓人民沒有辦法直接去行使民權。事實上,葉委員宜津所訂出的這個總數的 1.5%已經是太高了,我們認為 1%就已經很多了。",
"positionJudgement": "贊成降低公投連署門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 195,
"issue": "公投",
"legislator": "許忠信",
"party": "TSU",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為1人、連署門檻下修為1%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35814@08020102:45-58",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 194,
"issue": "公投",
"legislator": "台灣團結聯盟黨團",
"party": "TSU",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為1人、連署門檻下修為1%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35814@08020102:45-58",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 212,
"issue": "公投",
"legislator": "台灣團結聯盟黨團",
"party": "TSU",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28426@08031001:238-239",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 213,
"issue": "公投",
"legislator": "林世嘉",
"party": "TSU",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28426@08031001:238-239",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 158,
"issue": "公投",
"legislator": "黃文玲",
"party": "TSU",
"date": 1367164800,
"category": "發言",
"content": "需要用這樣的制度來疊床架屋嗎?如果照目前的狀況來看,公投審議委員會根本就是一個太上皇的單位,其實是影響公民行使投票權相關的決定。像台聯之前提了 3 次 ECFA 的問題,問你是否同意政府和中國簽定 ECFA?結果 3 次都被駁回,理由分別是,提案者反對 ECFA,主文卻寫「你是否同意?」;主文與理由部分是不符的,主文我們是問同意,但是理由寫反對;再來就是雙重命題的問題。",
"positionJudgement": "贊成廢除公審會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 170,
"issue": "公投",
"legislator": "周倪安",
"party": "TSU",
"date": 1427212800,
"category": "發言",
"content": "第一,降低全國性公民投票提案及連署門檻。第二,廢除公投審議委員會之設置,審議機關應為中選會。第三,針對非修憲案的一般性議題,應降低公民投票案通過之門檻。第四,建立電子提案及連署系統。以上 4 點本席非常贊同",
"positionJudgement": "贊成下修公投提案連署門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 236,
"issue": "公投",
"legislator": "葉津鈴",
"party": "TSU",
"date": 1428422400,
"category": "發言",
"content": "台聯黨團有關公投法的修正案共有兩案,一案是在 101 年 9 月提出,重點有刪除公民投票審議委員會、降低連署門檻以及取消投票門檻等第二案就是今天審議的提案,將公投的投票權年齡下修為 18 歲,",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0366;0367;0389;0392",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 254,
"issue": "公投",
"legislator": "賴振昌",
"party": "TSU",
"date": 1428422400,
"category": "發言",
"content": "本席認為,如果政府宣示尊重人民或保障人民對公共事務參與的權利,台聯主張提案只需一人,這是有其理論支持與理論背景,主要凸顯政府對人民參與公共事務權利的保障。這是我們之所以主張一人提案最重要的理由,我實在想不出公民投票提案門檻需要達到一百至五百人,甚至規定為千分之一或千分之五等任何數字或比例的理由,事實上,這些數字都找不出適當的支持理由。謝謝。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0440;0441;0444;0444;0447;0447",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 258,
"issue": "公投",
"legislator": "周倪安",
"party": "TSU",
"date": 1429632000,
"category": "發言",
"content": "關於提案人部分,台聯黨團主張一個人就可以提案,因為提案不代表可以成案,但是公投是要讓人民可以直接對議題表達主張。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0083;0084;0100;0101;0104;0106;0109;0109;0114;0114;0135;0138;0190;0190",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 1
},
{
"party": "DPP",
"dominantPosition": "aye",
"dominantPercentage": 96.47,
"records": [
{
"id": 184,
"issue": "公投",
"legislator": "葉宜津",
"party": "DPP",
"date": 1330617600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為100人、連署門檻下修為1.5%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@39179@08010201:51-62",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 185,
"issue": "公投",
"legislator": "趙天麟",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 186,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 187,
"issue": "公投",
"legislator": "李昆澤",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 188,
"issue": "公投",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 189,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 190,
"issue": "公投",
"legislator": "劉櫂豪",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 191,
"issue": "公投",
"legislator": "管碧玲",
"party": "DPP",
"date": 1334246400,
"category": "提案",
"content": "廢除「公民投票審議委員會」",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?2@/disk1/lydb/ttsdb/lgmeet@38289@08010701:204-209",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 134,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1337702400,
"category": "發言",
"content": "立陶宛是 1.47、西班牙是 1.26、奧地利是 0.69、葡萄牙是 0.49、波蘭是 0.25、斯洛維尼亞是 0.26、歐盟是 0.20、義大利是 0.08、瑞士是 0.67,沒有一個國家的連署門檻比台灣高,我們連署需要 90 萬人,公民投票不是人民最基本的權利義務?為什麼連署門檻要訂得這麼高?",
"positionJudgement": "贊成下修公投提案連署門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 138,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1337702400,
"category": "發言",
"content": "其實剛剛有很多委員都提出,不管是鳥籠公投、公投審議委員會的違法性或是其門檻造成不可實行性,這些都違反了人民的意志表達或公投法創制複決權的本意。",
"positionJudgement": "認為公投審議委員會違法",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 131,
"issue": "公投",
"legislator": "趙天麟",
"party": "DPP",
"date": 1337702400,
"category": "發言",
"content": "所以我們懇請委員會跟所有的委員,不分黨派,讓我們的民主憲政制度可以步上常軌,將公投審議委員會予以廢除,敬請公決,謝謝。",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 135,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1337702400,
"category": "發言",
"content": "主席、各位同仁。剛才會議停止,是為了等副秘書長來,而開會通知單上的通知對象第一個是行政院秘書長,秘書長請假沒有來,但是畢竟公民投票法的主管機關是行政院,所以行政院秘書長不能來報告,就該請副秘書長來報告,副秘書長沒有來報告,至少處長也要來報告,可是我們不但沒有聽到行政院方面有口頭報告,在桌上也沒有看到書面報告,到底公民投票法是誰管?",
"positionJudgement": "質疑行政院為何不派人來報告",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 193,
"issue": "公投",
"legislator": "林佳龍",
"party": "DPP",
"date": 1338480000,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.1%、連署門檻下修為1%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?5@/disk1/lydb/ttsdb/lgmeet@36029@08011401:158-172",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 192,
"issue": "公投",
"legislator": "陳歐珀",
"party": "DPP",
"date": 1338480000,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.1%、連署門檻下修為1%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?5@/disk1/lydb/ttsdb/lgmeet@36029@08011401:158-172",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 151,
"issue": "公投",
"legislator": "葉宜津",
"party": "DPP",
"date": 1338912000,
"category": "發言",
"content": "主席、各位列席官員、各位同仁。這不是新東西,只是配合憲法增修條文加以修正。依憲法增修條文第四條之規定,經全體立法委員四分之三之出席,及出席委員四分之三之決議,提出領土變更案,並於公告半年後,經中華民國自由地區選舉人投票複決,有效同意票過選舉人總額之半數就可以變更,所以我這個只是配合憲法增修條文的修正而已。我們應該要趕快配合憲法修正條文,否則就是立法怠惰,所以請大家支持。謝謝!",
"positionJudgement": "提案領土變更應交由人民複決",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 149,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1338912000,
"category": "發言",
"content": "主席陳其邁:大家為了「二日」或「七日」在那邊爭執,實在是……請問行政機關「五日」可不可以?一定要「二日」?開玩笑!",
"positionJudgement": "公投公報應於投票日前五日送達各戶",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 147,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1338912000,
"category": "發言",
"content": "當然我也承認,我們不可能讓公民投票的案子都沒有門檻,無論這個案子是政府提出、國會提出、或者是人民提出,但是如果今天這個門檻高到讓人民難以直接提出行使權利的地步,那就表示代議政治直接侵奪人民的權利了。我要問的是,你不覺得現在這個門檻太高了嗎?千分之五只是提案權,對不對?要有 9 萬多人連署才能提出一個案子,而且等到公民審議委員會通過之後,還要開始連署,請問連署還要多少人?是 90 萬人,對不對?誰有那個辦法、能力?我們到現在有哪一個案子是由人民直接提出來行使公民投票權利的?沒有。",
"positionJudgement": "贊成降低公投提案與連署門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 146,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1338912000,
"category": "發言",
"content": "因為除了 5,000 人的提案門檻之外,後面還有連署人數、還有層層的關卡,所以這些都代表我們對於這件事情的慎重,所以你不要再講什麼區域、族群、階層,這樣其實是治絲益棼。有些國家,光是連署的人數有 5,000 人就可以成案了,是連署、還不是提名。所以副主委是不是同意,只要有 5,000 人、也就是萬分之三你就可以支持,對不對?",
"positionJudgement": "贊成降低公投提案與連署門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 144,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1338912000,
"category": "發言",
"content": "今天在討論的是提案人數的連署門檻,應該要回到公投法最基本的精神是什麼?公投法最基本的精神就是要讓人民能夠參與、表達意見,但是我們卻利用立法院的立法權把所有的門檻都訂的非常高,讓人民都不能夠行使公投權,這是本末倒置,這是完全違背、剝奪人民參與的基本權利。其實 1.5%的這個門檻數字都已經有一點高了,我剛剛、還有在我上一次的質詢過程裡,我都已經唸得非常清楚,沒有一個國家的門檻比 1.5%還要高,只有臺灣訂得這麼高。而且從剛才幾位委員的態度裡面我們也都看得出來,他們其實就是不想修改公投法,這跟早上不想審查集遊法都是一樣的。這部分我們是贊成葉委員宜津所提的1.5%的版本,謝謝",
"positionJudgement": "贊成降低公投提案與連署門檻。",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 198,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35737@08020101:223-233",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 199,
"issue": "公投",
"legislator": "林淑芬",
"party": "DPP",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35737@08020101:223-233",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 200,
"issue": "公投",
"legislator": "邱志偉",
"party": "DPP",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35737@08020101:223-233",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 196,
"issue": "公投",
"legislator": "陳唐山",
"party": "DPP",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為100人、連署門檻下修為1%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35813@08020102:15-43",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 197,
"issue": "公投",
"legislator": "潘孟安",
"party": "DPP",
"date": 1347897600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35737@08020101:223-233",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 203,
"issue": "公投",
"legislator": "管碧玲",
"party": "DPP",
"date": 1349366400,
"category": "提案",
"content": "廢除「公民投票審議委員會」、廢除提案門檻、連署門檻下修為2%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35302@08020301:210-231",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 202,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1349366400,
"category": "提案",
"content": "廢除「公民投票審議委員會」、廢除提案門檻、連署門檻下修為2%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35302@08020301:210-231",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 201,
"issue": "公投",
"legislator": "李應元",
"party": "DPP",
"date": 1349366400,
"category": "提案",
"content": "廢除「公民投票審議委員會」、廢除提案門檻、連署門檻下修為2%、投票同意門檻下修為25%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@35302@08020301:210-231",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 206,
"issue": "公投",
"legislator": "林淑芬",
"party": "DPP",
"date": 1364486400,
"category": "提案",
"content": "廢除「公民投票審議委員會」、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?5@/disk1/lydb/ttsdb/lgmeet@29392@08030601:87-94",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 210,
"issue": "公投",
"legislator": "蔡其昌",
"party": "DPP",
"date": 1365696000,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28889@08030801:121-123",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 211,
"issue": "公投",
"legislator": "李昆澤",
"party": "DPP",
"date": 1365696000,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28889@08030801:121-123",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 209,
"issue": "公投",
"legislator": "吳秉叡",
"party": "DPP",
"date": 1365696000,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28889@08030801:121-123",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 216,
"issue": "公投",
"legislator": "劉建國",
"party": "DPP",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲、增加公費宣傳或辯論公投雙方意見",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28427@08031001:240-243",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 215,
"issue": "公投",
"legislator": "許智傑",
"party": "DPP",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲、增加公費宣傳或辯論公投雙方意見",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28427@08031001:240-243",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 214,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲、增加公費宣傳或辯論公投雙方意見",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28427@08031001:240-243",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 218,
"issue": "公投",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲、增加公費宣傳或辯論公投雙方意見",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28427@08031001:240-243",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 217,
"issue": "公投",
"legislator": "蔡其昌",
"party": "DPP",
"date": 1366905600,
"category": "提案",
"content": "投票年齡門檻下修至18歲、增加公費宣傳或辯論公投雙方意見",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@28427@08031001:240-243",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 159,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "因為憲法有明訂 20 歲,所以會有違憲之嫌,可是我們仔細去看憲法規定的四個權利,只有選舉權規定要年滿 20 歲,選舉權很顯然是對「人」的選舉,而不是對「事」的投票,因此本席認為這並沒有違憲。",
"positionJudgement": "贊成公投下修18歲可投票",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 152,
"issue": "公投",
"legislator": "潘孟安",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "修正調降全國性公民投票之提案及連署門檻,最近一次正副總統選舉選舉人總數萬分之一及百分之一點五。並降低公民投票案之通過門檻,調整為同意票數多於不同意票數、投票權人總數四分之一以上同意,即為通過。\n 公民投票法的精神是賦予直接民權行使,是創制、複決之外最重要的直接民權行使,不應該以過多的門檻做限制。本席特別在此補充說明,也請本委員會的委員共同支持該案通過,謝謝。",
"positionJudgement": "贊成下修提案連署門檻、贊成簡單多數決",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 154,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "非常清楚,公投審議委員會其實阻礙了民主憲政,許玉秀大法官講的很清楚,最高行政法院也說公投審議委員會根本是胡說八道,它不能進行實質的審查。",
"positionJudgement": "贊成廢除公投審議委員",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 165,
"issue": "公投",
"legislator": "許添財",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "以公投法來講,因為代議政治沒辦法滿足人民的需要,沒辦法促進社會的和諧,沒辦法發揮真正的民主競爭和自由選擇的效率,這時候不得已只好採取直接民意交付公投,這個公投法應該是中性的,但現在的公投法是負的,是有立場的,二分之一的門檻就是負的。如果你預期的答案是負的,那你就設一個正的命題,然後「正負得負」;如果你的目標是正的,那你就設一個負的命題,然後「負負得正」,因為公投法本身不是等號而是負號,沒有達到二分之一無效那就是負號。現在很好笑,有人認為那時候是民進黨同意的,民進黨過去如果有錯,現在應該要改,難道就因為民進黨過去錯了而不改嗎?",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 156,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "目前我國的門檻最嚴苛,其他像丹麥只要 30%投票的相對多數決、韓國三分之一投票的相對多數決、瑞士只要參加投票的多數、法國只要相對多數、愛爾蘭只要投票者的多數贊成,其實這些國家都是相對多數決。另外,有些國家雖然是設定了門檻,但是他們的門檻大概是30%或 40%左右,日本的門檻是公民數的三分之一到六分之一,視不同的議題而定。我現在把副主委當作最後的良心,請你把專業的意見帶回去,這些國家統統沒有人會說公投是少數決定,國家的重大議題和整個政治參與的行為,針對不去投票的行為也有很多研究,不去投票就代表否定或有其他的意見。",
"positionJudgement": "贊成簡單多數決",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 164,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "吳委員育昇:92 年是由民進黨執政,我哪有亂講?\n \n 陳委員其邁:你自己拿去看。\n \n 主席:公投審議會在民進黨版本中是沒有的。\n \n 陳委員其邁:我覺得大家進行朝野協商要有誠信,不要一而再、再而三地散播這種錯誤的資訊,民進黨當時所提出的版本並沒有,你可以自己看啊!\n \n 吳委員育昇:朝野協商最後通過的版本……\n \n 陳委員其邁:民進黨的版本並沒有嘛!",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 160,
"issue": "公投",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "本院陳亭妃委員,針對現行公民投票法要投票人數半數以上投票,且過半支持才算通過,這種絕對多數的高門檻規定,與先進國家不同,而遭批為「鳥籠公投法」為避免烏龍狀況發生,請主管機關內政部應重新評估降低公投的門檻。",
"positionJudgement": "贊成簡單多數決",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "書面質詢"
},
{
"id": 163,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1367164800,
"category": "發言",
"content": "吳委員育昇:我想公投審議委員會的爭議很久了,在目前這種情況下,我認為保持現狀,如果召委要這樣硬推,那當然不可能,我覺得你就把它保留送協商嘛,因為這是一個大哉問,不是我們幾個委員在這裡辯論就可以解決的問題,我和邱文彥委員兩位是國民黨籍的立委,我們在現場不是沒有意見,但我覺得大家互相尊重,我們認為並堅持這個不宜動。\n \n 主席:有哪部分是你們認為可以動的?今天到現在我都沒有聽到有任何一部分是你們認為可以動的。\n \n 吳委員育昇:為什麼我們哪個地方一定要動?你說動我們就要動喔?政黨政治本來就是這樣啊!\n \n 主席:沒關係,我了解你的意思,我們就一個一個來。其他委員對這一條有沒有意見?\n \n 段委員宜康:主張刪除。",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 219,
"issue": "公投",
"legislator": "邱志偉",
"party": "DPP",
"date": 1369238400,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決(僅限立法院提出之公投案)",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@16975@08051101:180-182",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 220,
"issue": "公投",
"legislator": "蘇震清",
"party": "DPP",
"date": 1369238400,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決(僅限立法院提出之公投案)",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@16975@08051101:180-182",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 221,
"issue": "公投",
"legislator": "楊曜",
"party": "DPP",
"date": 1369238400,
"category": "提案",
"content": "廢除投票門檻改為簡單多數決(僅限立法院提出之公投案)",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@16975@08051101:180-182",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 234,
"issue": "公投",
"legislator": "蔡其昌",
"party": "DPP",
"date": 1402588800,
"category": "發言",
"content": "在人權保障部分,「公民投票法」要儘速解決鳥籠公投的問題,如此方能補齊代議政治之不足...綜上,希望稍後進行表決時,國民黨不要再全面將社會所期盼、在野黨所提出的法案完全封殺,那將會是製造朝野對立的開始,也是讓民間聲音再次淹沒在多數暴力下的開端。謝謝!",
"positionJudgement": "贊成解決鳥籠公投",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10304801;0020;0020",
"meeting": "院會",
"meetingCategory": "院會發言"
},
{
"id": 222,
"issue": "公投",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 224,
"issue": "公投",
"legislator": "許智傑",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 225,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 226,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 227,
"issue": "公投",
"legislator": "田秋堇",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 223,
"issue": "公投",
"legislator": "蔡其昌",
"party": "DPP",
"date": 1418313600,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1%、廢除投票門檻改為簡單多數決、投票年齡門檻下修至18歲、增加電子提案連署系統",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@10980@08061372:65-78",
"meeting": "程序委員會",
"meetingCategory": "法律提案"
},
{
"id": 169,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "林義雄先生和 318 運動統統告訴你們,我們要補正公投法,最主要的就是這兩個,第一是門檻的問題,第二是公投審議委員會的問題。但是行政院從 2012 年也就是我進來的第一年到現在為止,一貫的態度就是這兩個絕對不能動!所以你們不是在阻礙社會的進步嗎?",
"positionJudgement": "贊成公投補正",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 168,
"issue": "公投",
"legislator": "莊瑞雄",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "我認為公投法的補正以及選罷法的修改是有其正當性的,不只社會上有這樣的需求,做這件事也確實是在落實國民的主權。我想秘書長、中選會主委以及內政部部長,你們應該也有這樣的認知。",
"positionJudgement": "贊成公投補正",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 177,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "主席,現在看來,行政院還是採取抗拒修法的態度,對不對?國民黨立委並沒有意見,50 天或兩個月,然後在程序委員會不杯葛,他們也贊成,但現在行政院還在杯葛、還在阻礙修法。秘書長剛剛自己講,當時在行政院作成決議,門檻不降低,幕僚幾個找一找,就作決定了,對不對?怎麼現在還在聽馬前主席的意見,而公投法的門檻不能改?",
"positionJudgement": "贊成公投補正",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 182,
"issue": "公投",
"legislator": "許添財",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "可以思考,所以現在的公投法要補正。",
"positionJudgement": "贊成公投補正",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 175,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "部長,雖然我剛當立委,但是我對公投法非常關心,你不要說那些!其實就是方才鄭麗君委員說的,設計了一個鳥籠公投、烏龍公投、鐵籠公投,最後變成牢籠公投,在立法院則是唬弄公投啦!一是公投審議委員會的問題,而你不回答,謝謝劉主委回答了;二是門檻問題,你對門檻有甚麼想法?今天最大的爭議就是門檻,要解開的就是門檻限制。",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 174,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "但是我們要的是簡單多數的公投,而非所謂的門檻公投,因為這種門檻公投就會造成上述翻轉的現象,照理說,愈具爭議性的議題原本應該投票率愈高,爭議性愈低的議題投票率愈低,可是現在只要反操作──讓大家不要去投票就好,可是不去投票並不意味著就跟你站在一邊啊!但是現行公投法的規範卻會造成這種現象。請問秘書長,這樣的公投法難道還不用修正嗎?",
"positionJudgement": "質疑不投票即是反對票,要求簡單多數決",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 173,
"issue": "公投",
"legislator": "邱志偉",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "其實那還不是重點中的重點,最重要的應該是如何降低提案門檻;另外,公投審議委員會設置的必要性、全國性公投適用範圍及連署門檻等也都應該檢討,立法院跨黨派委員對公投法分別提出了許多修正草案,本席期待行政院能提出相應的對案,但遺憾的是,行政院和內政部卻未提出院版修正案,照理說這應該是由內政部提案,但內政部民政司卻無任何動作,請問部長知道立法院內有多少公投法修正草案嗎?",
"positionJudgement": "贊成下修公投提案門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 172,
"issue": "公投",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1427212800,
"category": "發言",
"content": "好,本席的版本主要是連署門檻要下修,而且可以有電子連署,至少你支持電子連署。我再請教部長,你知道我們的投票時間是多少小時嗎?",
"positionJudgement": "贊成公投連署門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 229,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 231,
"issue": "公投",
"legislator": "田秋堇",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 232,
"issue": "公投",
"legislator": "劉建國",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 233,
"issue": "公投",
"legislator": "楊曜",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 228,
"issue": "公投",
"legislator": "陳亭妃",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 230,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1427731200,
"category": "提案",
"content": "廢除「公民投票審議委員會」、提案門檻下修為0.01%、連署門檻下修為1.5%、廢除投票門檻改為簡單多數決",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?3@/disk1/lydb/ttsdb/lgmeet@6392@08070672:61-66",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 235,
"issue": "公投",
"legislator": "陳歐珀",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "第一,所以本席建議將公民投票審議委員會予以刪除。\n 第二,就是公投提案及連署的門檻過高,外界對此已經質疑很久了,所以一定要修正,本席的提案是從千分之五降到千分之一,連署的門檻由百分之五調降至百分之一,以符合實際。\n 最後,各界都認為鳥籠公投最主要的問題就是投票的門檻過高,現在除了大選之外,有哪一種投票會超過 50%?所以對於要如何修正,立法院應該要有定見,而且要符合外界的期待",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0366;0367;0389;0392",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 237,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "不過如果要刪除原條文第二條第五項即廢除公投審議委員會,我建議如果有人意見不同、反對廢除,就應該提出公投審議委員會不可替代的理由,也就是要說清楚如果把公投審議委員會拿掉了,對公投程序的進行有什麼樣的影響,為什麼這樣做不好、為什麼必須要保留公投審議委員會,本席認為必須要有明確的態度、意見並提出說明。否則我們只看到贊成廢除公投審議委員會的意見,並沒有看到反對的意見,如果是這樣子,那就通過將原條文第二條第五項予以刪除,其他修正意見暫時先保留,然後進行下一個條文的討論。",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0370;0373;0421;0421;0431;0431;0436;0437;0442;0442",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 242,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "我直接告訴你,這個我們也討論過很多次,所有公投投票的門檻,台灣是全世界最高的。...提案門檻不一樣、有高有低沒有錯,但投票門檻 50%是全世界最高的。...,現在最大的問題就在公投審議委員會根本在做實質審查,用十幾個人的公投審議委員會取代了十幾萬人的連署,這是我們沒辦法接受的,所以第二條規定得非常清楚,方才段委員也提出非常具體的主張,第二條除了保留的事項以外,第二條就是直接廢除公投審議委員會,請各位予以支持,謝謝!",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0384;0389;0412;0413;0417;0418;0423;0423;0425;0426;0432;0432;0434;0434",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 244,
"issue": "公投",
"legislator": "黃偉哲",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "問題是現制認為不去投票就是反對的表示,才把門檻定得這麼高,要求必須過半,行政院的版本和內政部的說帖都表示不能讓少數人決定,問題是民眾會認為不見得是少數,只是因為你們門檻訂得不合理。一般來講,就算綁大選,投票率大概是在 6 成多到 7 成,總有 3 成左右的人不會去投票,但不能認為這 3 成不去投票的人,就是反對公投,或是反對這個候選人,現在大家爭執的部分就在此,所以,我認為這部分需要尋求一個解釋空間,這個解釋空間不能由任一方片面認定,這樣會比較公平。",
"positionJudgement": "具體指出高門檻問題",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0393;0396",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 245,
"issue": "公投",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "我主張公民投票提案門檻為萬分之一,而且我非常認同台聯黨團版本的精神,提案人只需一人即可成案。本席在質詢之前曾經做過對照比較,若一位公民要參選總統或副總統,只需領取申請表及繳交保證金即可參選,但如果發起人想要發起公民投票,譬如當年為了國人是否要吃美國牛肉,發起人不但要提案,甚至要先行連署,如此作法實在相當地不對稱、不公平。...大部分國家都只需完成第一階段的連署,唯獨我國採用兩階段連署方式。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0396;0400;0412;0412;0419;0422;0427;0429;0431;0436;0441;0444;0446;0447",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 246,
"issue": "公投",
"legislator": "姚文智",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "憲法規定人民有選舉、罷免、創制、複決的權利,你們所設計的制度就是要設法在我們的體制與文化當中,讓人民可以具體做出選擇與實踐,現在我們可以用投票多數決的方式選出總統,偏偏對於事情決定的門檻竟然高過選出總統的標準,這顯然不合理,但你們卻不改,都已經那麼多年了,還要強詞奪理!",
"positionJudgement": "具體指出高門檻問題",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0400;0403",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 247,
"issue": "公投",
"legislator": "田秋堇",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "如果整個社會上有幾千人、幾萬人願意連署這個提案,你憑什麼設置公投審議委員會,然後找幾個人來擔任委員後,就來封殺人家的提案,你們這樣的做法不是擔心人民展現人民的意志是什麼?",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0403;0406",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 249,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "本委員會於 3 月 25 日提案要求行政院應於一個月內提出具體回應就擴大公民投票適用範圍,廢除公民投票審議委員會、降低提案、連署及通過門檻、建立電子提案及連署系統、延長罷免連署期間,檢討現行法律對於罷免權行使之諸多不當限制等,回應國民主權之立法倡議之公民投票法及公職人員選舉罷免法修正草案。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0408;0408",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 251,
"issue": "公投",
"legislator": "柯建銘",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "所以,今天你整個思維沒有改變,弄一個公投審議委員會,讓過去許多民眾包括台聯提出的公投提案就在公投審議委員被封殺,因為你的人多,控制了公投審議委員會,導致公投審議委員會成為一個太上委員會,這部分根本應該刪除。",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0409;0412;0418;0419;0420;0421",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 252,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "本席認為應該要公投的事項必須訂定清楚,然後刪掉公投審議委員會,應該回歸到中選會,因為中選會的委員是由總統提名,經過立法院行使同意權,它是一個超然、獨立機構,所以應該由他們來審議,謝謝!",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0423;0423;0426;0427;0430;0430",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 253,
"issue": "公投",
"legislator": "李應元",
"party": "DPP",
"date": 1428422400,
"category": "發言",
"content": "公民投票審議委員會把這樣的權利都剝奪,根本違反公民投票法的立法意旨。",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0424;0424",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 255,
"issue": "公投",
"legislator": "段宜康",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "因為多數的提案是要將門檻降到萬分之一,就是 0.01%,現在行政院\n 說要降到千分之三,因此我們可以各讓一步,保留行政院採納的千分之三的 3,就是分子用行政院的建議,分母則採納委員的提案,大家各讓一步的結果,答案就是萬分之三。這樣雙方都可以交代,你們回去行政院就說 3 已經達到了,委員也說分母的 10000 是照我們的。雙方的差距其實不大,只要雙方各讓一步就可以完成。謝謝。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0080;0080;0101;0101;0103;0103;0108;0108;0111;0113;0116;0116;0122;0124;0143;0144;0146;0147;0149;0151;0153;0154;0159;0159;0162;0164;0170;0170;0172;0172;0174;0175;0179;0179;0189;0194",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 256,
"issue": "公投",
"legislator": "李俊俋",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "有關連署門檻,針對世界各國的現況,其實我們早已在內政委員會討論非常多次,立陶宛人口 340 萬,連署門檻是 1.47%、西班牙是 1.26%、奧地利 1.23%、葡萄牙 0.69%、匈牙利 0.49%、波蘭 0.25%、斯洛維尼亞 0.26%、歐盟 0.20%、義大利 0.08%、瑞士 0.67%,這麼清楚,每個國家都有,但沒有一國的連署條件比我們還高。所以包括行政部門、立法委員在內,既然要來參與逐條討論,自己就要做功課,然後依照逐條討論程序,一條一條討論。今天討論到第十二條,早上我們既然把第十條的提案門檻降低,那連署門檻當然也要相對降低,就是這麼清楚。所以依據陳委員唐山等 16 人提案的第十二條,我們非常清楚地主張把連署門檻修正為 1%,至於贊不贊成,大家可以表達,如此而已,不要再上台詢答其他國家連署門檻是多少,既然自己不做功課,就不要來參與逐條討論,這是內政委員會在討論問題、解決問題時應有的態度,這也才是我們今天逐條討論的主要內容。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0080;0080;0099;0099;0105;0107;0109;0109;0113;0114;0133;0133;0141;0142",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 257,
"issue": "公投",
"legislator": "鄭麗君",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "一個公民要選總統,他只要連署 25 萬人,就可以參選、被投票。我們今天討論的基準就從選罷法來看,1.5%是第二階段,假設第二階段是 1.5%,我們不應該超過這個門檻,所以,我建議,公投的門檻至少要比選罷法更低,因為選總統只需要這樣的門檻,如果依照現在行政院所謂的千分之三一直到百分之三,換言之,這個比選總統還要困難。...我還是認為我們的版本絕對不能超過選罷法,所以才會提出萬分之一,第二階段連署門檻是千分之一。我再補充最後一點理由,如果門檻太高、連署人數動輒就要五萬、二十幾萬,這樣的公投門檻就是圖利大黨。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0080;0083;0095;0097;0104;0106;0108;0110;0153;0153;0156;0157;0159;0162;0165;0165;0168;0170;0175;0176;0181;0181;0183;0183;0186;0188;0194;0195",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 261,
"issue": "公投",
"legislator": "莊瑞雄",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "我認為就算只有一個人提案也應該可以成案!你們建議改為千分之三,周委員倪安則建議一人亦可成案。其實一個案子提出來,即使經過審查,也尚未進入第二階段,也就是駁回或補正。換句話說,從提案、審查到連署,甚至對連署的有效部分又有門檻,遑論通過了,所\n 以整部公投法全部都是門檻,到處都關關卡卡。如果認同公投是直接民意的展現,那麼理當進行適度調整。再者,公投是對於現行制度、現況的一種反映,甚或是對政府與現狀不滿的否定,即使將門檻從千分之五降為千分之三,仍舊是一種限制。行政部門不要動不動就認為這是一種成本或社會資源的浪費,",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0086;0088;0099;0100;0102;0102;0142;0142;0165;0165;0168;0168;0185;0185",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 263,
"issue": "公投",
"legislator": "陳其邁",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "因為大家關切這個議題,政府認為讓人民去決定,所以就交付公民投票,公投那麼多,每次選舉都有公投,這樣怎麼會亂?公投從來沒有一次亂過,公投就是要解決爭議,為什麼會亂?我實在搞不懂你的邏輯為何,為什麼有一個審議委員會就不會亂?關於門檻,你告訴我說萬分之一就會亂,千分之五不會亂,按照你的邏輯,反而千分之五才\n 會亂,因為更多人在那裡提案、連署才會亂,對不對?因為辦了公投就會亂,你的想法就是這樣啊!",
"positionJudgement": "贊成廢除公投審議委員會",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0089;0093;0097;0098;0101;0110;0114;0117;0128;0129;0132;0133;0142;0142;0151;0151;0159;0160;0165;0168;0175;0176;0189;0193;0195;0195",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 269,
"issue": "公投",
"legislator": "尤美女",
"party": "DPP",
"date": 1429632000,
"category": "發言",
"content": "其實剛剛李委員俊俋已經講得很清楚,各國規定的連署人數佔選民比例,幾乎都在 1.4%到 0.6%、0.7%之間,所以,本條門檻當然應該降低,委員提案條文也幾乎都贊成降低到 1%,1%也大概有 18 萬人,其實也算滿多的。另外一個可以佐證的是,根據總統及副總統選舉罷免法,如果候選人要透過連署來競選連任,連署門檻也是選舉人數的 1.5%,從這兩個數據來看,1%事實上是合理的,因此本席建議門檻應該訂在 1%。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0130;0131;0142;0142;0143;0144;0147;0147;0149;0150;0152;0152",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0.9647058823529412
},
{
"party": "PFP",
"dominantPosition": "aye",
"dominantPercentage": 81.82,
"records": [
{
"id": 204,
"issue": "公投",
"legislator": "親民黨黨團",
"party": "PFP",
"date": 1362672000,
"category": "提案",
"content": "投票門檻下修為40%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@30267@08030301:141-143",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 205,
"issue": "公投",
"legislator": "李桐豪",
"party": "PFP",
"date": 1362672000,
"category": "提案",
"content": "投票門檻下修為40%",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?21@/disk1/lydb/ttsdb/lgmeet@30267@08030301:141-143",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 207,
"issue": "公投",
"legislator": "親民黨黨團",
"party": "PFP",
"date": 1365436800,
"category": "提案",
"content": "投票年齡門檻下修至18歲",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?5@/disk1/lydb/ttsdb/lgmeet@29257@08030701:236-238",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 208,
"issue": "公投",
"legislator": "李桐豪",
"party": "PFP",
"date": 1365436800,
"category": "提案",
"content": "投票年齡門檻下修至18歲",
"positionJudgement": "贊成公投門檻下修",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/ttspage3?5@/disk1/lydb/ttsdb/lgmeet@29257@08030701:236-238",
"meeting": "內政委員會",
"meetingCategory": "法律提案"
},
{
"id": 153,
"issue": "公投",
"legislator": "李桐豪",
"party": "PFP",
"date": 1367164800,
"category": "",
"content": "我們認為修正公民投票法讓 18 歲的青年可以做關於創制複決的投票,這是不違背憲法的。不論內政部或是行政院,他們一方面肯定,一方面又否決,我覺得應該對這點深切檢討。",
"positionJudgement": "贊成公投下修18歲可投票",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 167,
"issue": "公投",
"legislator": "陳怡潔",
"party": "PFP",
"date": 1367164800,
"category": "發言",
"content": "針對《公民投票法》修訂,依中華民國憲法第 130 條規定,我國國民年滿 20 歲才有依法選舉之權,但現今全世界已有 162 個國家將 18 歲訂為投票權行使的起始年齡,台灣身為民主先進國家,選舉制度卻是排名在 162 個國家之後。尤其公民投票一向是針對重大議題進行,多數國家亦以 18 歲訂為法定成年年齡,公投法實有將投票年齡下修之必要。",
"positionJudgement": "贊成公投下修18歲可投票",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 171,
"issue": "公投",
"legislator": "陳怡潔",
"party": "PFP",
"date": 1427212800,
"category": "發言",
"content": "因為外界在看這個門檻都覺得很高,我們知道過去公投的投票率最高只有達到 45%,而且你們把沒有投票的人都視為反對,目前是這樣,所以台灣的公投看起很難通過,但是結果又好像取決於題目的設定,我舉例好了,譬如之前朝野為了核四公投的題目吵很久,反核的人提出「核四續建」公投,擁核的人提出「核四停建」公投,其實這凸顯出來的是制度上的問題,因為這個題目顯示是非常的中性,感覺好像是由題目來決定結果,你們有沒有通盤去檢討整個公投制度應該要怎麼做全盤的調整?",
"positionJudgement": "質詢應針對公投制度做全盤的調整",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 243,
"issue": "公投",
"legislator": "李桐豪",
"party": "PFP",
"date": 1428422400,
"category": "發言",
"content": "本席對公投的看法也是一樣,我們積極支持公投,但是也希望支持公投、希望降低門檻、或希望降低通過門檻的朋友們和我們一起向社會說明現階段的規定有何處會造成大家疑慮。本席絕對支持人民的權利,可是要請教大家如何化解我們共同面對的問題...我們要以立法方式解決這個問題,而排除公投審議委員會呢?或立法只是原則性概括,要用公投審議委員會處理?",
"positionJudgement": "對門檻和公審會無明確表態",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0392;0393",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 250,
"issue": "公投",
"legislator": "陳怡潔",
"party": "PFP",
"date": 1428422400,
"category": "發言",
"content": "我國公投法通過門檻為二分之一以上有投票權人參與投票,且同意票過半數為通過,其門檻為全世界最嚴,已經造成公投難以施行,從我國歷次全國性公投結果可看出,即使與大選合併舉行,投票率亦難超過 50%,且本法在立法上將未投票者一律視為反對,加以公投法第三十三條之再提出時間限制,兩者交互作用下,使得公投法形同具文。",
"positionJudgement": "具體指出高門檻問題",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0408;0409",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 266,
"issue": "公投",
"legislator": "李桐豪",
"party": "PFP",
"date": 1429632000,
"category": "發言",
"content": "親民黨認為千分之一當做登記門檻應該是可以的,可是國民黨認為要千分之二點五,不曉得民進黨在這部分的態度是什麼?至於台聯就要對不起了,因為只有一個人不太好辦,如果只是就國民黨和親民黨的話,那就二一添作五,大概是千分之二左右,這是單獨考慮,但如果不是單獨考慮,當然就要放在一起合併思考。",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0101;0101;0103;0105;0110;0110",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 267,
"issue": "公投",
"legislator": "陳怡潔",
"party": "PFP",
"date": 1429632000,
"category": "發言",
"content": "我們原本是主張千分之一,現在也是退讓到千分之二,這部分應該可以有共識,否則一直討論下去也沒有結論啊!",
"positionJudgement": "具體提出公投門檻下修內容",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0102;0102;0106;0106",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0.8181818181818182
},
{
"party": "KMT",
"dominantPosition": "unknown",
"dominantPercentage": 59.38,
"records": [
{
"id": 133,
"issue": "公投",
"legislator": "張慶忠",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "要不要行使直接民權必須考量可能的成本與代價,因此必須要有提案與連署人數門檻的限制。我們從一些國家的經驗來觀察。在提案人數方面,其實各國並無一致的實踐,有的以公民人數之一定比例為門檻,有的則規定固定人數為門檻。以我國通過的公民投票法之有關規定與美國相比:我國提案人數為千分之五,遠低於美國各州的平均值百分之一至二;我國連署人數百分之五,也比美國各州較適中的百分之八為低。故不論是提案人數或是連署人數,其實都並不算高。以此門檻「過高」為由而認為我國的公法不易發動,是「鳥籠公投」的說法,根本是言過其實。",
"positionJudgement": "反對下修公投提案連署門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會書面質詢"
},
{
"id": 136,
"issue": "公投",
"legislator": "江啟臣",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "本席剛才要問的就是內政部、中選會,尤其是行政院這邊,針對審議委員會制度的改善,是否能提出比較具體的東西,而不要反正就是堅持不動。我想你們也開過公聽會,可能也有不一樣的建議或是不同的看法提出來,這個看法或許有時候是南轅北轍,有時候是對立的,但是如何在中間取得大家可以接受的平衡點,我覺得這是你們要努力的方向。我並不是這方面的專家,我也無法給你一個答案,可是我認為這個制度的修正非常重要,因為它影響到整個公民投票的進行能否順暢,以及公民意志最後是否有助於問題的解決,否則的話,到最後這個遊戲規則將讓公民投票變成是一種社會成本的浪費,如果是這樣,本席覺得我不要看到公民投票成為這樣,這會加深政治上的對立及增添許多麻煩,因此我認為公投法應該能夠有助於解決社會上的公民,他們以為該由他們自己來決定的問題。",
"positionJudgement": "認為行政單位需提出具體修改制度的方案",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 139,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "本院委員吳育昇有鑑於公民投票法制定後仍有多個縣市沒有完成公民投票自治條例?經本席口頭詢問得知,目前僅 2 個直轄市、6 個縣市政府完成公民投票自治條例。若地方民眾自主性對地方自治事項與地方法規欲進行公民投票,該縣市卻無公投自治條例時,又該如何進行?另外,假設中央政府欲推動重大交通建設時,地方民意有不同意見時,欲以公民投票方式表達,又該以地方性公民投票進行?還是全國性公民投票進行?特向內政部與中央選舉委員會提出書面質詢。",
"positionJudgement": "質詢地方與全國公投的標準",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會書面質詢"
},
{
"id": 140,
"issue": "公投",
"legislator": "徐欣瑩",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "國內現在的氛圍,一旦門檻降低,美牛、十二年國教、證所稅、油電雙漲、一國兩區、核能發電可能一口氣都要公投,中選會的工作絕對不可能變少,有些人甚至將舉辦公投視為發聲的工具,將發動公民投票當作是特定意見的常態發聲管道。所以門檻的降低應該考慮舉行公投的可行性,畢竟經費有限,中選會只有一個,而且瑞士的通訊投票跟不在籍投票便利選民,而我國尚無不在籍投票,選舉勞民,對於提案與連署門檻的調降,中選會應審慎考慮。",
"positionJudgement": "認為提案與連署門檻調降要謹慎",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會書面質詢"
},
{
"id": 141,
"issue": "公投",
"legislator": "陳超明",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "既然內政部知道部分規定重複且相互牴觸,為何不提出行政院的修法版本,將重複與牴觸的部分修正,或是將子法的施行細則提升至母法位階?大大方方的,讓人民很清楚公民投票案的提案程序跟相關規定,不要搞得好像我們執政黨很怕人民透過公民投票來直接參與民主!",
"positionJudgement": "質疑行政院不提出修法版本",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會書面質詢"
},
{
"id": 137,
"issue": "公投",
"legislator": "紀國棟",
"party": "KMT",
"date": 1337702400,
"category": "發言",
"content": "公投法的門檻,就在野黨的看法,本席認為他們要的是門檻再降低一點,所以其實你們很簡單,只要回去討論一次大概可以降低多少門檻,就降一點點,大家來討論趕快將這件事敲定,也讓這些執政黨委員不會陷於兩邊作戰,站在民眾的考量,認為應該讓公投法通過,為什麼我們不贊成?其實我們也不是反對,只是感覺那種規劃的節奏感似乎沒有那麼快,本席認為該做就趕快做,次長有什麼看法?",
"positionJudgement": "贊成下修公投門檻",
"position": "aye",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104201;0117;0150",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 143,
"issue": "公投",
"legislator": "邱文彥",
"party": "KMT",
"date": 1338912000,
"category": "發言",
"content": "主席、各位列席官員、各位同仁。關於葉宜津委員提案的第二條第一款,有關領土變更的複決,我也認為這件事要非常的慎重,因為這牽涉到歷史、地理、主權及國家的權益,沒有相當嚴謹的配套,考慮確實有失周延。所以我是覺得這個部分擺在這邊不妥,應該有更審慎的考慮。謝謝!",
"positionJudgement": "反對領土變更案列入公投法",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 142,
"issue": "公投",
"legislator": "陳超明",
"party": "KMT",
"date": 1338912000,
"category": "發言",
"content": "司長應該這樣明示,公民投票審議委員會有存在的價值,還可以做很多事,要把它廢掉是不合理的,而不是答復尊重他們的意見。所以不宜廢掉。謝謝!",
"positionJudgement": "反對廢除公審會",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 150,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1338912000,
"category": "發言",
"content": "主席:第十條的修正意見,關於人數的部分,整理剛才大家的發言後,大概有幾個數字,一、100\n 人;二、萬分之三;三、千分之五,也就是原來的規定。\n 100 人這部分有無意見?\n 吳委員育昇:(在席位上)不同意。\n 主席:萬分之三呢?\n 吳委員育昇:(在席位上)不同意,因為沒有配套措施。",
"positionJudgement": "反對降低公投提案門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 145,
"issue": "公投",
"legislator": "張慶忠",
"party": "KMT",
"date": 1338912000,
"category": "發言",
"content": "我們首先要考量公民投票和一般選舉不同的地方在哪裡,一般選舉決定在於人,也就是舉才;而公民投票雖然是人民直接行使權利,但是決定的是一件事,但是「事」以後的發展是誰來負責?當然是全體公民來負責,所以門檻不宜降低。",
"positionJudgement": "反對下修公投門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10104801;0297;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 155,
"issue": "公投",
"legislator": "徐欣瑩",
"party": "KMT",
"date": 1367164800,
"category": "發言",
"content": "因為總統是經過民意考驗選舉而來,立法院也都是背負著一定的民意,而人民連署卻只要達到千分之五,三者相較之下,最後一項是否稍低了",
"positionJudgement": "反對下修公投連署門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 157,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1367164800,
"category": "發言",
"content": "我同意他講的一個觀點,我國公投法和世界各國不太一樣,我們集合了重大政策、全國議題、立法原則、創制複決,以及修憲的問題,我們全部涵括在公投法之中,這種畢其功於一法的情況下,你能把公投門檻降低嗎?這不會造成國家的動盪嗎?\n \n ……我想公投審議委員會的爭議很久了,在目前這種情況下,我認為保持現狀",
"positionJudgement": "反對降低公投門檻、反對廢除公審會",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 161,
"issue": "公投",
"legislator": "張慶忠",
"party": "KMT",
"date": 1367164800,
"category": "發言",
"content": "【公投門檻問題】\n 二、本席認為,要不要行使直接民權必須考量可能的成本與代價,因此必須要有提案與連署人數門檻的限制。我們從一些國家的經驗來觀察。在提案人數方面,其實各國並無一致的實踐,有的以公民人數之一定比例為門檻,有的則規定固定人數為門檻。以我國通過的公民投票法之有關規定與美國相比:我國提案人數為千分之五,遠低於美國各州的平均值百分之一至二;我國連署人數百分之五,也比美國各州較適中的百分之八為低。故不論是提案人數或是連署人數,其實都並不算高。\n 【公投審議委員會的必要性】\n 這些認定問題需要由一個獨立機關來審議,所以公投審議委員會的設計不是政治性的,而是法律性的,是合法性的審查,並非目的性的審查,審議委員會只看公投項目符不符合公投法的規定,因此它的存在,本席認為確有必要。",
"positionJudgement": "反對降低公投門檻,反對廢除公投審議委員會",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "書面質詢"
},
{
"id": 162,
"issue": "公投",
"legislator": "邱文彥",
"party": "KMT",
"date": 1367164800,
"category": "發言",
"content": "我想就像呂前副總統提出要進行地方公投,若行政院有疑義,這要送給誰去解釋疑義?不就是交由公投審議委員會嗎?如果把公投審議委員給廢掉,未來交由行政院自行解釋,這麼做會是好的嗎?剛剛吳委員也提出建議,如果我們在認定和解釋方面沒有適當的配套措施,這個還是不動會比較好。",
"positionJudgement": "反對廢除公投審議委員會",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 166,
"issue": "公投",
"legislator": "李貴敏",
"party": "KMT",
"date": 1367164800,
"category": "發言",
"content": "據本席理解,公投目前最主要的爭議有三項,第一項是連署的門檻,第二項是通過的門檻,第三項是該不該先由公審會做事前的審核。在內政委員會前兩次質詢的時候,有委員提到和國外的法例相較之下台灣是最嚴的,本席就去查相對的資料看台灣的公投法是不是最嚴的,查出來的結果,副秘書長,台灣對於公投法是最嚴的嗎?我們看一下公投現制,在各個國家中,台灣的人民可以提出來,義大利的人民可以提出來,瑞士也可以。但是從人民的角度來講,法國不可以,英國不可以,日本不可以,德國不可以,美國也不可以,所以從發動主體來看,台灣是比較鬆的。",
"positionJudgement": "認為台灣公投法不是最嚴格的",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10202801;0263;0322",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 176,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "今天召委安排報告主題是「補正公投法、修改選罷法,以落實國民主權之立法倡議」。本席剛好想到行政院版《總統副總統選舉罷免法》修正草案,未來總統大選,因在外地工作、就學無法回戶籍所在地投票的軍警、上班族、學生,選民可以申請跨縣市移轉投票,節省返鄉投票所花費的時間與金錢,對於全國公民行使參政權有很大幫助。各界絞盡腦汁提升青年返鄉意願,但事實上,解決返鄉投票問題的根本,在於「不在籍投票」制度。目前大多數的民主國家都擁有不在籍投票規定,以此維護《憲法》權利,然而,一向以民主制度自傲的台灣,卻遲遲未能建立機制,外地遊子表達聲音的管道,希望朝野應該一起努力保障選舉人參政權行使!",
"positionJudgement": "贊成不在籍投票",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 178,
"issue": "公投",
"legislator": "鄭天財",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "為具體回應補正公投法、修改選罷法以落實國民主權之立法倡議降低提案、連署門檻、建立電子提案及連署門檻、延長罷免連署期間,檢討現行法律對於罷免權行使之諸多不當限制等,內政部舉辦完公聽會後,如有修法共識,應儘速提出公民投票法及公職人員選舉罷免法修正草案,以落實民主,鞏固民權。\n 提案人:盧嘉辰 邱文彥 吳育昇 鄭天財",
"positionJudgement": "要求內政部提出修正草案",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 179,
"issue": "公投",
"legislator": "盧嘉辰",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "為具體回應補正公投法、修改選罷法以落實國民主權之立法倡議降低提案、連署門檻、建立電子提案及連署門檻、延長罷免連署期間,檢討現行法律對於罷免權行使之諸多不當限制等,內政部舉辦完公聽會後,如有修法共識,應儘速提出公民投票法及公職人員選舉罷免法修正草案,以落實民主,鞏固民權。\n 提案人:盧嘉辰 邱文彥 吳育昇 鄭天財",
"positionJudgement": "要求內政部提出修正草案",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 180,
"issue": "公投",
"legislator": "邱文彥",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "我的意思是,你們一直說要凝聚社會共識,也希望這個議題可以討論。不管是門檻的問題、條文的問題,還是公投審議委員會要不要存在的問題,社會上都可以公開討論。",
"positionJudgement": "認為公投門檻可以公開討論",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 181,
"issue": "公投",
"legislator": "張慶忠",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "對,這是我們所擔心的,所以本席認為公投法應採較高門檻,因為做成決定之後,後續沒有人可以來負責,所以會擔心這只是一時的社會氛圍,或是少數人的情緒。",
"positionJudgement": "反對下修公投門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 183,
"issue": "公投",
"legislator": "徐志榮",
"party": "KMT",
"date": 1427212800,
"category": "發言",
"content": "補正公投法及修改選罷法,行政院立場為何\n 今天會議討論的主題是公投法與選罷法的修正問題,媒體報導上週朱立倫主席對於現行公投法的門檻及選罷法的罷免門檻均過高,表態支持應作合理調整,隨後行政院簡秘書長卻指稱現階段不宜修法,公開表達行政院反對立場。媒體紛紛表示行政院這樣的作法是打臉朱主席,此外民間團體也醞釀發動「四一○還權於民.重返立院」行動要來聲援補正公投法及修正選罷法。請行政院簡秘書長說明反對立場為何?本席聽聞內政部有針對選罷法修正問題擬召開座談會,請問陳部長具體時程為何?預計召開多少場?總統與立委選舉預計今年 9 月發布選舉公告,若要在下屆總統與立委選舉適用,就要在 9 月初之前完成相關修法,時間上是否來得及?修法問題茲事體大,與其急就章倉促完成拼裝上路,不如經過詳細規劃討論,不應急於適用明年初的總統及立委大選。",
"positionJudgement": "詢問行政院立場",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402101;0427;0486",
"meeting": "內政委員會",
"meetingCategory": "書面質詢"
},
{
"id": 238,
"issue": "公投",
"legislator": "邱文彥",
"party": "KMT",
"date": 1428422400,
"category": "發言",
"content": "本席首先要表明我的態度,我支持公民投票提案門檻下修,但這要做合理的評估。最重要的是,以行政能量來看,行政院應該說明,公民投票提案門檻下修之後,我們能否負擔相關的行政成本?果真如此,我們必須在行政成本可以負擔的條件之下,做出合理下修的比例。如果我們沒有釐清可負擔的合理下修比例,而你們每件提案都答應要處理,屆時你們如何能承擔?所以本席認為這點需要大家再研究。謝謝。",
"positionJudgement": "要考量行政成本再下修門檻",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0373;0375;0444;0444;0446;0446",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 240,
"issue": "公投",
"legislator": "鄭天財",
"party": "KMT",
"date": 1428422400,
"category": "發言",
"content": "秘書長知不知道總統及副總統選舉實施不在籍投票案送到立法院多久了?你不知道?你們都沒有計算!...我說的是總統副總統選罷法,這個還沒有付委啦!被誰擋住了?你們要去說明、溝通,甚至可以拜託公民團體,說為什麼不付委。實施不在籍投票有這麼困難嗎?全世界的先進國家都在做,所以這部分應該多溝通、多協調。",
"positionJudgement": "「不在籍投票」不在公投法修法討論內容",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0378;0380",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 241,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1428422400,
"category": "發言",
"content": "秘書長的意思是,目前我們的公投法是規定至少要二分之一的公民出來投票,達到出來投票的人的二分之一之門檻,才能夠通過。理論及實務上,就等於四分之一的積極公民就可以改變、經過國家合法程序做出一個新的決定。所以,你認為這個門檻夠了,不宜再下降,是不是這個邏輯?",
"positionJudgement": "對門檻是否應該下修無明確表態",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0380;0384",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 248,
"issue": "公投",
"legislator": "張慶忠",
"party": "KMT",
"date": 1428422400,
"category": "發言",
"content": "如果不管什麼事情都公投,那就很多事情沒辦法做了,我們這個國家也沒辦法進步。現在鄰近每個國家都在進步,我們不能再停滯了,本席認為主管機關或審議委員會有存在在行政院的必要。…本席建議還是維持原來的千分之五。",
"positionJudgement": "反對廢除公投審議委員會及修改提案門檻",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0406;0407;0413;0413;0418;0418;0420;0420;0422;0422;0424;0424;0426;0426;0429;0432;0435;0437;0440;0442;0444;0445;0447;0448",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 239,
"issue": "公投",
"legislator": "盧嘉辰",
"party": "KMT",
"date": 1428422400,
"category": "發言",
"content": "剛才主席說國民黨委員對於廢除公投審議委員會的問題也要提出不同的見解,我個人現在就說明行政院公民投票審議委員會之審議事項為何,還有為什麼不能輕易廢掉審議委員會。依公民投票法第三十四條、第三十八條的規定,行政院應設全國性公民投票審議委員會,所以這是依法有據。要審議的事項就是全國性公民投票事項之認定,還有公民投票提案事項是否為三年內曾經投票通過或否決之公民投票案的同一事項之認定。同一事項包括提案之基礎事實類似、擴張或減縮應受判斷事項者,由公民投票審議委員會認定之。還有行政院對公民投票事項是否屬地方性公民投票事項有疑義時之認定。基於這幾項原則,不能輕易廢掉。",
"positionJudgement": "反對廢除公投審議委員會",
"position": "nay",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10402801;0375;0378;0413;0413;0417;0417;0422;0422;0424;0424;0430;0430;0432;0432;0445;0446",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 268,
"issue": "公投",
"legislator": "王育敏",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "有些委員說,公投的投票率為何沒達到 50%?這要看是何種議題,像總統大選是全國性投票,可能因為對戰非常激烈,大家也非常重視,所以民眾投票會很踴躍。並非台灣的投票率不會超過 50%,我們歷年總統大選的投票率大概都超過七成,如此看來,討論到公投的投票率時,有時是議題設定的問題,對不對?觀察過去六次公投的主題為何?這些主題是否為大家非常關心、在乎的議題?這值得提出來討論。不要因為公投投票率未達 50%,就說一定是設計門檻的問題。",
"positionJudgement": "對投票門檻下修有疑慮",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0117;0118;0126;0128;0132;0133;0139;0141;0144;0145;0147;0147;0152;0153;0159;0162;0165;0166;0170;0170;0172;0175;0183;0183;0186;0186;0189;0190;0192;0192",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 260,
"issue": "公投",
"legislator": "李貴敏",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "憑良心講,是否應該為 1,800 人,並不是藍綠的問題,而是該怎麼做才能讓政府在未來將錢花在刀口上,這才是應該深思之處!但是,究竟應該是千分之幾,大家可以撇掉自己本身的政黨立場,為台灣思考一下,什麼樣的比例是我們能夠承受的一個行政資源支出的必要,因此,對於比例的部分,本席沒有任何的堅持,只是從邏輯上而言,如果 1 個人可以做的,就目前台灣的狀態而言,1,800 個人要提出提案是否可能,本席認為那實在太容易了,所以這個地方的確是需要深思。",
"positionJudgement": "要考量行政成本再下修門檻",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0085;0086;0099;0099;0102;0102;0106;0106;0108;0109;0118;0122;0124;0126;0128;0128;0131;0134",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 262,
"issue": "公投",
"legislator": "陳淑慧",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "我認為行政院版所提出的數據應符合比例原則,不論精神、目標與目的,都應符合全國人民多數意見與看法,畢竟會動用到公投法,就是為了解決人民對於現有法律或政策中無法解決的疑惑與問題。所以不論提案、連署、通過,都應該有根據,且符合比例原則,以符合多數人民的意見。",
"positionJudgement": "要考量行政成本再下修門檻",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0088;0089;0097;0098",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 264,
"issue": "公投",
"legislator": "吳育昇",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "我贊成調降公投門檻,也不一定支持千分之三,但是唯獨對萬分之一感到恐慌,因為我們立委動不動都是七、八萬票選出來的,甚至有超過十萬票選出來的,如果只要 1,800 個人就可以提案進行公投,那要立委幹什麼?...所以我認為 92 年修法時,朝野設定千分之五的門檻是有智慧的,也經過精算,今天若要與時俱進調降公投門檻,我認為還是應在千分比的概念下來討論。就這一點而言,行政院提案修法調降門檻,用千分比的概念還是好,我不贊成用萬分比,因為我很恐懼。",
"positionJudgement": "對門檻下修內容無明確表態",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0093;0096;0098;0099;0101;0101;0105;0106;0108;0110",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 265,
"issue": "公投",
"legislator": "陳超明",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "我是 8 萬多票當選的,吳育昇是 10 幾萬票當選的,如果 54,000 票你們就不能接受,每個立委隨時都可以提案,那民選的立委要做什麼用的?公民的力量可以作為思考的模式之一,但是他們講的不一定是對的。你們仔細想想,54,000 張票是最低的門檻,如果全國性公投54,000 個人不能接受,那台灣社會會變成什麼樣子?",
"positionJudgement": "認為公投提案門檻不能低於立委得票",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0095;0095;0098;0098;0100;0100;0102;0103;0107;0108",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
},
{
"id": 259,
"issue": "公投",
"legislator": "邱文彥",
"party": "KMT",
"date": 1429632000,
"category": "發言",
"content": "關於提案門檻,經濟學上可以從需求面、供給面來看。從需求面來講,我們必須兼顧民主的價值,讓更多人可以參與,在精神上我當然支持很多委員的看法。但是從供給面來看,我們到底能支撐多少業務,行政成本也要考慮,因此才會請秘書長回去精算。",
"positionJudgement": "要考量行政成本再下修門檻",
"position": "unknown",
"clarificationContent": "",
"clarificationLastUpdate": "",
"lyURL": "http://lis.ly.gov.tw/lgcgi/lypdftxt?10403401;0084;0085;0107;0107;0129;0130;0133;0133;0142;0143;0150;0151;0156;0157;0165;0165;0170;0170;0172;0172;0174;0176;0180;0180;0182;0182;0185;0192;0194;0195",
"meeting": "內政委員會",
"meetingCategory": "委員會質詢"
}
],
"rank": 0.03125
}
]
}
}
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
default:
return state;
}
}
| soidid/we-vote-10 | src/ducks/partyView.js | JavaScript | mit | 300,140 |
function doUnlock(agent) {
function announce(sender, recipient, object) {
if (sender === recipient) {
return `You unlock the ${object.name}.`;
}
return `${sender.name} unlocks some ${object.name}.`;
}
if (agent !== undefined && agent.location) {
agent.location.announce(announce, agent, this);
}
this.locked = false;
this.onUnlock(agent);
}
| doughsay/room.js | demo/world/lib/traits/closeable/doUnlock.js | JavaScript | mit | 377 |
/**********************************************************\
| |
| hprose |
| |
| Official WebSite: http://www.hprose.com/ |
| http://www.hprose.org/ |
| |
\**********************************************************/
/**********************************************************\
* *
* hprose/server/WebSocketService.js *
* *
* Hprose WebSocket Service for Node.js. *
* *
* LastModified: Sep 30, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
'use strict';
var util = require('util');
var HttpService = global.hprose.HttpService;
var BytesIO = global.hprose.BytesIO;
var Future = global.hprose.Future;
function WebSocketService() {
HttpService.call(this);
var _onAccept = null;
var _onClose = null;
var self = this;
function getAccept() {
return _onAccept;
}
function setAccept(value) {
if (value === null || typeof value === 'function') {
_onAccept = value;
}
else {
throw new Error('onAccept must be a function or null.');
}
}
function getClose() {
return _onClose;
}
function setClose(value) {
if (value === null || typeof value === 'function') {
_onClose = value;
}
else {
throw new Error('onClose must be a function or null.');
}
}
function _send(ws, data, id) {
var bytes = new BytesIO();
bytes.writeInt32BE(id);
if (data.constructor === String) {
bytes.writeString(data);
}
else {
bytes.write(data);
}
try {
ws.send(bytes.bytes, {
binary: true,
compress: false
});
}
catch (e) {
ws.emit('error', e);
}
}
function send(ws, data, id) {
if (Future.isFuture(data)) {
data.then(function(data) { _send(ws, data, id); });
}
else {
_send(ws, data, id);
}
}
function wsHandle(ws) {
var context = {
httpserver: self.httpserver,
server: self.server,
websocket: ws,
socket: ws._socket,
userdata: {}
};
try {
self.emit('accept', context);
if (_onAccept) { _onAccept(context); }
}
catch(e) {
ws.close();
return;
}
ws.on('close', function() {
try {
self.emit('close',context);
if (_onClose) { _onClose(context); }
}
catch(e) {}
});
ws.on('error', function(e) {
try {
self.emit('sendError', e, context);
if (self.onSendError) {
self.onSendError(e, context);
}
}
catch(e) {}
});
ws.on('message', function(data) {
var bytes = new BytesIO(data);
var id = bytes.readInt32BE();
var request = bytes.read(bytes.length - 4);
process.nextTick(function() {
var context = {
httpserver: self.httpserver,
server: self.server,
websocket: ws,
socket: ws._socket,
userdata: {}
};
data = self.defaultHandle(request, context);
send(ws, data, id);
});
});
}
Object.defineProperties(this, {
onAccept: { get: getAccept, set: setAccept },
onClose: { get: getClose, set: setClose },
wsHandle: { value: wsHandle }
});
}
util.inherits(WebSocketService, HttpService);
global.hprose.WebSocketService = WebSocketService;
| hprose/hprose-nodejs | lib/server/WebSocketService.js | JavaScript | mit | 4,407 |
/* Master.js
KC3改 Master Dataset
Represents master data from api_start2
Indexes significant data for easier access
Saves and loads significant data for future use
*/
(function(){
"use strict";
window.KC3Master = {
available: false,
// Not start from, excluding
abyssalShipIdFrom: 1500,
abyssalGearIdFrom: 500,
// Devs still archive seasonal ID backward from old max 997
// Since 2017-11-27, 998~ going to be used
// Since 2019-06-25, devs shifted IDs from 729~ to 5001~
seasonalCgIdFrom: 5000,
// Devs assigned Colorado Kai to 1496 making more things strange since 2019-05-25
//seasonalCgIdTo: 1400,
// Clear new updates data after 1 week
newUpdatesExpiredAfter: 7 * 24 * 60 * 60 * 1000,
_raw: {},
_abyssalShips: {},
_seasonalShips: {},
init: function( raw ){
this.load();
if(typeof raw != "undefined"){
return this.processRaw( raw );
}
try {
this.updateRemodelTable();
} catch(e) {
console.warn("Updating remodel table unexpected", e);
}
return false;
},
/* Process raw data, fresh from API
-------------------------------------*/
processRaw :function(raw){
var beforeCounts = false;
if( Object.size(this._raw) > 0) {
beforeCounts = [ Object.size(this._raw.ship), Object.size(this._raw.slotitem) ];
}
this._raw.newShips = this._raw.newShips || {};
this._raw.newItems = this._raw.newItems || {};
this._raw.newGraphs = this._raw.newGraphs || {};
this._raw.changedGraphs = this._raw.changedGraphs || {};
var self = this,
diff = {"ship":"newShips", "slotitem":"newItems", "shipgraph":"newGraphs"},
oraw = $.extend({}, this._raw),
newCounts = [0, 0],
ctime = Date.now();
// Loops through each api_mst_
Object.keys(raw).forEach(function(mst_name) {
var mst_data = raw[mst_name];
var short_mst_name = mst_name.replace("api_mst_", "");
// If the current master item is an array
if (Array.isArray(mst_data)) {
// Add the master item to local raw, as empty object
self._raw[short_mst_name] = {};
// Store the contents into the new local raw object
mst_data.map(function(elem, i){
var elem_key = elem.api_id || i;
// Add elements to local raw, with their IDs as indexes
// Elements have no IDs, store them with their original indexes
// There are duplicated api_id in `shipupgrade`, so use indexes instead
if(short_mst_name === "shipupgrade") elem_key = i;
self._raw[short_mst_name][elem_key] = elem;
if(!!diff[short_mst_name] && !!oraw[short_mst_name]) {
if(!oraw[short_mst_name][elem_key]) {
self._raw[diff[short_mst_name]][elem_key] = ctime;
} else {
if(short_mst_name === "shipgraph") {
if(self._raw[short_mst_name][elem_key].api_version[0]
!= oraw[short_mst_name][elem_key].api_version[0]) {
self._raw.changedGraphs[elem_key] = ctime;
} else if(self._raw.changedGraphs[elem_key] &&
(ctime - self._raw.changedGraphs[elem_key]) > self.newUpdatesExpiredAfter) {
delete self._raw.changedGraphs[elem_key];
}
}
if(self._raw[diff[short_mst_name]][elem_key] &&
(ctime - self._raw[diff[short_mst_name]][elem_key]) > self.newUpdatesExpiredAfter) {
delete self._raw[diff[short_mst_name]][elem_key];
}
}
}
});
}
});
if(KC3Meta.isAF() && this._raw.newShips[KC3Meta.getAF(4)] === undefined) {
this._raw.newShips[KC3Meta.getAF(4)] = KC3Meta.getAF(2) - KC3Master.newUpdatesExpiredAfter;
if(beforeCounts) beforeCounts[0] -= 1;
}
try {
this.updateRemodelTable();
} catch(e) {
console.warn("Updating remodel table unexpected", e);
}
this.save();
this.available = true;
// If there was a count before this update, calculate how many new
if (beforeCounts) {
return [
Object.size(this._raw.ship) - beforeCounts[0],
Object.size(this._raw.slotitem) - beforeCounts[1]
];
} else {
return [0,0];
}
},
loadAbyssalShips: function(repo) {
var shipJson = $.ajax({
url : repo + "abyssal_stats.json",
async: false
}).responseText;
try {
this._abyssalShips = JSON.parse(shipJson) || {};
} catch(e) {
}
},
loadSeasonalShips: function(repo) {
var shipJson = $.ajax({
url : repo + "seasonal_mstship.json",
async: false
}).responseText;
try {
this._seasonalShips = JSON.parse(shipJson) || {};
} catch(e) {
}
},
/* Data Access
-------------------------------------*/
ship :function(id){
return !this.available ? false : this._raw.ship[id] || false;
},
all_ships :function(withAbyssals, withSeasonals){
var id, ss, as;
var ships = $.extend(true, {}, this._raw.ship);
if(!!withAbyssals && Object.keys(ships).length > 0
&& Object.keys(this._abyssalShips).length > 0){
for(id in this._abyssalShips){
ss = ships[id];
as = this._abyssalShips[id];
if(!!ss && !!as){
for(var k in as){
if(k !== "api_id" && !ss.hasOwnProperty(k))
ss[k] = as[k];
}
}
}
}
if(!!withSeasonals && Object.keys(ships).length > 0
&& Object.keys(this._seasonalShips).length > 0){
for(id in this._seasonalShips){
ss = ships[id];
if(!ss) { ships[id] = this._seasonalShips[id]; }
}
// Apply a patch for Mikuma typo of KC devs
//ships[882] = this._seasonalShips[882];
//ships[793] = this._seasonalShips[793];
// Apply a patch for Asashimo Torelli submarine :P
//ships[787] = this._seasonalShips[787];
// Seasonal data no longer leaked since 2017-04-05
// Seasonal data leaks again since 2017-09-12 if ID < 800
// Seasonal data leaking fixed again since 2017-10-18
}
return ships;
},
seasonal_ship :function(id){
return this._seasonalShips[id] || false;
},
new_ships :function(){
return this._raw.newShips || {};
},
remove_new_ship :function(id){
delete this._raw.newShips[id];
},
graph :function(id){
return !this.available ? false : this._raw.shipgraph[id] || false;
},
graph_file :function(filename){
var self = this;
return !this.available ? false : Object.keys(this._raw.shipgraph).filter(function(key){
return self._raw.shipgraph[key].api_filename === filename;
})[0];
},
new_graphs :function(){
return this._raw.newGraphs || {};
},
remove_new_graphs :function(id){
delete this._raw.newGraphs[id];
},
changed_graphs :function(){
return this._raw.changedGraphs || {};
},
remove_changed_graphs :function(id){
delete this._raw.changedGraphs[id];
},
/**
* Build image URI of asset resources (like ship, equipment) since KC2ndSeq (HTML5 mode) on 2018-08-17.
* @see graph - replace old swf filename method, its filename now used as `uniqueKey` for some case
* @see main.js/ShipLoader.getPath - for the method of constructing resource path and usage of `uniqueKey` above
* @see main.js/SuffixUtil - for the method of calculating suffix numbers
* @param id - master id of ship or slotitem (also possible for furniture/useitem...)
* @param type - [`card`, `banner`, `full`, `character_full`, `character_up`, `remodel`, `supply_character`, `album_status`] for ship;
* [`card`, `card_t`, `item_character`, `item_up`, `item_on`, `remodel`, `btxt_flat`, `statustop_item`, `airunit_banner`, `airunit_fairy`, `airunit_name`] for slotitem
* @param shipOrSlot - `ship` or `slot`, or other known resource sub-folders
* @param isDamaged - for damaged ship CG, even some abyssal bosses
* @param debuffedAbyssalSuffix - specify old suffix for debuffed abyssal boss full CG. btw suffix is `_d`
*/
png_file :function(id, type = "card", shipOrSlot = "ship", isDamaged = false, debuffedAbyssalSuffix = ""){
if(!id || id < 0 || !type || !shipOrSlot) return "";
const typeWithSuffix = type + (isDamaged && shipOrSlot === "ship" ? "_dmg" : "");
const typeWithPrefix = shipOrSlot + "_" + typeWithSuffix;
const key = str => str.split("").reduce((acc, c) => acc + c.charCodeAt(0), 0);
const getFilenameSuffix = (id, typeStr) => String(
1000 + 17 * (Number(id) + 7) *
KC3Meta.resourceKeys[(key(typeStr) + Number(id) * typeStr.length) % 100] % 8973
);
const padWidth = ({
"ship": 4, "slot": 3, "furniture": 3, "useitem": 3,
})[shipOrSlot];
const paddedId = String(id).padStart(padWidth || 3, "0"),
suffix = shipOrSlot !== "useitem" ? "_" + getFilenameSuffix(id, typeWithPrefix) : "";
const uniqueKey = type === "full" && shipOrSlot === "ship" ? ((key) => (
key ? "_" + key : ""
))(this.graph(id).api_filename) : "";
return `/${shipOrSlot}/${typeWithSuffix}/${paddedId}${debuffedAbyssalSuffix}${suffix}${uniqueKey}.png`;
},
slotitem :function(id){
return !this.available ? false : this._raw.slotitem[id] || false;
},
all_slotitems :function(){
return this._raw.slotitem || {};
},
new_slotitems :function(){
return this._raw.newItems || {};
},
remove_new_slotitem :function(id){
delete this._raw.newItems[id];
},
all_slotitem_icontypes :function(){
if(!this._allIconTypes || !this._allIconTypes.length){
if(!Array.isArray(this._allIconTypes)) this._allIconTypes = [];
$.each(this.all_slotitems(), (_, g) => {
const iconType = g.api_type[3];
if(!this._allIconTypes.includes(iconType)) this._allIconTypes.push(iconType);
});
this._allIconTypes.sort((a, b) => a - b);
}
return this._allIconTypes;
},
stype :function(id){
return !this.available ? false : this._raw.stype[id] || false;
},
slotitem_equiptype :function(id){
return !this.available ? false : this._raw.slotitem_equiptype[id] || false;
},
equip_type :function(stype, shipId){
if(!this.available) return false;
// use ship specified equip types first if found
const equipTypeArr = shipId && this.equip_ship(shipId).api_equip_type;
if(equipTypeArr) return equipTypeArr;
const equipTypeObj = this.stype(stype).api_equip_type || {};
// remap equip types object of ship type to array
return Object.keys(equipTypeObj).filter(type => !!equipTypeObj[type]).map(id => Number(id));
},
equip_type_sp :function(slotitemId, defaultType){
return KC3Meta.specialEquipTypeMap[slotitemId] || defaultType;
},
equip_ship :function(shipId){
const equipShips = this._raw.equip_ship || {};
// look up ship specified equip types
return !this.available ? false :
equipShips[Object.keys(equipShips).find(i => equipShips[i].api_ship_id == shipId)] || false;
},
equip_exslot_type :function(equipTypes, stype, shipId){
if(!this.available) return false;
// remap general exslot types object to array
const generalExslotTypes = Object.keys(this._raw.equip_exslot).map(i => this._raw.equip_exslot[i]);
const regularSlotTypes = equipTypes || this.equip_type(stype, shipId) || [];
return !regularSlotTypes.length ? generalExslotTypes :
generalExslotTypes.filter(type => regularSlotTypes.includes(type));
},
// @return different from functions above, returns a slotitem ID list, not type2 ID list
equip_exslot_ship :function(shipId){
const exslotShips = this._raw.equip_exslot_ship || {};
// find and remap ship specified exslot items
return !this.available ? [] : Object.keys(exslotShips)
.filter(i => exslotShips[i].api_ship_ids.includes(Number(shipId)))
.map(i => exslotShips[i].api_slotitem_id) || [];
},
/**
* Special cases hard-coded at client-side:
* * [553/554] Ise-class Kai Ni can equip main gun on first 2 slots only,
* nothing needed to be handled for now, since we haven't added slot index condition.
* * see `main.js#RemodelUtil.excludeEquipList`
* * see `main.js#TaskIdleMain._onDropSlotItem`
* * [392] Richelieu Kai can equip seaplane bomber [194] Laté 298B only,
* either hard-coded the exception conndition in following codes.
* * see `main.js#TaskChoiceSlotItem.prototype._initSetList_` and `#_updateListItem_`
* * see `main.js#SlotitemModelHolder.prototype.createUnsetList` and `#createUnsetList_unType`
* * [166] AkitsuMaru Kai can equip aviation personnel [402] Arctic Gear & Deck Personnel only,
* the same hard-code method with Richelieu's one
* * [622/623/624] Yuubari Kai Ni+ can NOT equip main gun/torpedo [1, 2, 5, 22] on slot 4, can only equip [12, 21, 43] on slot 5,
* nothing needed to be handled for now, since we haven't added slot index condition.
* * see `main.js#RemodelUtil.excludeEquipList`
* * see `main.js#TaskIdleMain._onDropSlotItem`
* * [662/663/668] Noshiro/Yahagi Kai Ni+ can NOT equip torpedo [5] on slot 4,
* nothing needed to be handled for now, since we haven't added slot index condition.
* * see `main.js#RemodelUtil.excludeEquipList`
* * see `main.js#TaskIdleMain._onDropSlotItem`
*/
equip_on :function(gearId, type2Id){
if(!this.available) return false;
gearId = Number(gearId);
if(!type2Id && gearId > 0) {
const slotitem = this.slotitem(gearId);
if(!slotitem) return false;
type2Id = this.equip_type_sp(slotitem.api_id, slotitem.api_type[2]);
}
const capableStypes = [];
$.each(this._raw.stype, (_, stype) => {
if(!!(stype.api_equip_type || {})[type2Id])
capableStypes.push(stype.api_id);
});
const capableShips = [], incapableShips = [];
$.each(this._raw.equip_ship, (_, equipShip) => {
const shipId = equipShip.api_ship_id,
shipMst = this.ship(shipId), stype = shipMst.api_stype;
const equipTypes = equipShip.api_equip_type;
if(!capableStypes.includes(stype) && equipTypes.includes(type2Id))
capableShips.push(shipId);
if(capableStypes.includes(stype) && !equipTypes.includes(type2Id))
incapableShips.push(shipId);
});
const generalExslotTypes = Object.keys(this._raw.equip_exslot).map(i => this._raw.equip_exslot[i]);
const isCapableToExslot = generalExslotTypes.includes(type2Id);
let exslotCapableShips = false;
if(gearId > 0) {
const exslotShips = this._raw.equip_exslot_ship || {};
const exslotGear = Object.keys(exslotShips)
.find(i => exslotShips[i].api_slotitem_id == gearId);
if(exslotGear) {
exslotCapableShips = exslotShips[exslotGear].api_ship_ids.slice(0);
} else {
exslotCapableShips = [];
}
}
// Remove Richelieu Kai from Seaplane Bomber type list except Late 298B
if(type2Id === 11 && gearId !== 194) {
const richelieuKaiPos = capableShips.indexOf(392);
if(richelieuKaiPos >= 0) capableShips.splice(richelieuKaiPos, 1);
}
// Remove AkitsuMaru Kai from Aviation Personnel type list except Arctic Gear & Deck Personnel
if(type2Id === 35 && gearId !== 402) {
const akitsumaruKaiPos = capableShips.indexOf(166);
if(akitsumaruKaiPos >= 0) capableShips.splice(akitsumaruKaiPos, 1);
}
return {
stypes: capableStypes,
includes: capableShips,
excludes: incapableShips,
exslot: isCapableToExslot,
exslotIncludes: exslotCapableShips,
};
},
/**
* Check if specified equipment (or equip type) can be equipped on specified ship.
* @param {number} shipId - the master ID of ship to be checked.
* @param {number} gearId - the master ID of a gear to be checked. if omitted, will be checked by equip type.
* @param {number} gearType2 - the equip type ID of api_type[2] value, optional, but cannot be omitted at the same time with gearId.
* @return 1 indicates can be equipped on (some) regular slots, 2: ex-slot, 3: both, 0: cannot equip. false on exception.
* @see #equip_on
*/
equip_on_ship :function(shipId, gearId, gearType2) {
if(!this.available) return false;
if(!shipId) return false;
const gearMstId = Number(gearId),
shipMstId = Number(shipId),
shipMst = this.ship(shipMstId);
if(!shipMst) return false;
const stype = shipMst.api_stype;
const equipOn = this.equip_on(gearMstId, gearType2);
if(!equipOn || (!equipOn.stypes.length && !equipOn.includes.length)) return false;
var result = 0;
if(Array.isArray(equipOn.excludes) && !equipOn.excludes.includes(shipMstId)) {
if(equipOn.stypes.includes(stype)) result |= 1;
else if(Array.isArray(equipOn.includes) && equipOn.includes.includes(shipMstId)) result |= 1;
}
// Improved Kanhon Type Turbine can be always equipped on exslot of capable ship types
const isTurbine = gearMstId === 33;
if(equipOn.exslot || isTurbine) {
if(result) result |= 2;
} else if(Array.isArray(equipOn.exslotIncludes) && equipOn.exslotIncludes.includes(shipMstId)) {
result |= 2;
}
return result;
},
useitem :function(id){
return !this.available ? false : this._raw.useitem[id] || false;
},
all_useitems :function(){
return this._raw.useitem || {};
},
mission :function(id){
return !this.available ? false : this._raw.mission[id] || false;
},
all_missions :function(){
return this._raw.mission || {};
},
furniture :function(id, no, type){
if(!this.available) return false;
if(!id && no >= 0 && type >= 0){
$.each(this._raw.furniture, (i, f) => {
if(f.api_no === no && f.api_type === type){
id = f.api_id;
return false;
}
});
}
return id > 0 ? this._raw.furniture[id] || false : false;
},
all_furniture :function(){
return this._raw.furniture || {};
},
missionDispNo :function(id){
var dispNo = (this.mission(id) || {}).api_disp_no;
return dispNo || String(id);
},
setCellData :function(startData){
// `api_mst_mapcell` removed since KC Phase 2,
// have to collect them from `api_req_map/start.api_cell_data`
const mapcell = this._raw.mapcell || {};
const world = startData.api_maparea_id, map = startData.api_mapinfo_no;
const newCellsArr = startData.api_cell_data;
if(world > 0 && map > 0 && Array.isArray(newCellsArr) && newCellsArr.length > 0) {
if(KC3Meta.isEventWorld(world)) {
// Clean existed cells of old events for small footprint,
// since old event maps data will be accumulated to big
$.each(mapcell, (id, cell) => {
if(KC3Meta.isEventWorld(cell.api_maparea_id) && cell.api_maparea_id < world)
delete mapcell[id];
});
} else {
// Clean existed cells of this map for old master data
const apiIds = newCellsArr.map(c => c.api_id);
$.each(mapcell, (id, cell) => {
if(!apiIds.includes(id) &&
cell.api_maparea_id === world && cell.api_mapinfo_no === map)
delete mapcell[id];
});
}
newCellsArr.forEach(cell => {
mapcell[cell.api_id] = {
api_map_no: Number([world, map].join('')),
api_maparea_id: world,
api_mapinfo_no: map,
api_id: cell.api_id,
api_no: cell.api_no,
api_color_no: cell.api_color_no,
api_passed: cell.api_passed,
};
if(cell.api_distance !== undefined)
mapcell[cell.api_id].api_distance = cell.api_distance;
});
this._raw.mapcell = mapcell;
this.save();
}
},
mapCell :function(world, map, edge){
const mapCells = {};
$.each(this._raw.mapcell || {}, (id, cell) => {
if(cell.api_maparea_id === world && cell.api_mapinfo_no === map)
mapCells[cell.api_no] = cell;
});
return edge === undefined ? mapCells : mapCells[edge] || {};
},
abyssalShip :function(id, isMasterMerged){
var master = !!isMasterMerged && this.isAbyssalShip(id) && $.extend(true, {}, this.ship(id)) || {};
return Object.keys(master).length === 0 &&
(Object.keys(this._abyssalShips).length === 0 || !this._abyssalShips[id]) ?
false : $.extend(master, this._abyssalShips[id]);
},
isRegularShip :function(id){
// Master ID starts from 1, so range should be (lbound, ubound]
// falsy id always returns false
return !!id && !(this.isAbyssalShip(id) || this.isSeasonalShip(id));
},
isNotRegularShip :function(id){
return !this.isRegularShip(id);
},
isSeasonalShip :function(id){
return id > this.seasonalCgIdFrom; // && id <= this.seasonalCgIdTo;
},
isAbyssalShip :function(id){
return id > this.abyssalShipIdFrom && id <= this.seasonalCgIdFrom;
},
isAbyssalGear :function(id){
return id > this.abyssalGearIdFrom;
},
/* Save to localStorage
-------------------------------------*/
save :function(){
localStorage.raw = JSON.stringify(this._raw);
},
/* Load from localStorage
-------------------------------------*/
load :(function(){
var keyStor = {
raw: function fnlRaw(data){
this._raw = data;
return true;
},
master: function fnlMaster(data){
this._raw.ship = data.ship;
this._raw.shipgraph = data.graph || {};
this._raw.slotitem = data.slotitem;
this._raw.stype = data.stype;
this._raw.newShips = data.newShips || {};
this._raw.newItems = data.newItems || {};
this._raw.newGraphs = data.newGraphs || {};
this._raw.changedGraphs = data.changedGraphs || {};
return true;
},
};
function fnLoad(){
/*jshint validthis:true*/
this.available = false;
for(var storType in keyStor) {
if(this.available) continue;
if(typeof localStorage[storType] == 'undefined') continue;
try {
var tempRaw = JSON.parse(localStorage[storType]);
if(!tempRaw.ship) throw Error("Non-existing ship");
this.available = this.available || keyStor[storType].call(this,tempRaw);
console.info("Loaded master: %c%s%c data", "color:darkblue", storType, "color:initial");
} catch (e) {
console.error("Failed to process master: %s data", storType, e);
}
}
return this.available;
}
return fnLoad;
})(),
/* Remodel Table Storage
-------------------------------------*/
removeRemodelTable :function(){
var cShip,ship_id;
for(ship_id in this._raw.ship) {
cShip = this._raw.ship[ship_id];
if(!cShip) { /* invalid API */ continue; }
if(!cShip.api_buildtime) { /* non-kanmusu by API */ continue; }
delete cShip.kc3_maxed;
delete cShip.kc3_model;
delete cShip.kc3_bship;
}
},
updateRemodelTable :function(){
var cShip,ccShip,remodList,ship_id,shipAry,modelLv,bship_id;
this.removeRemodelTable();
shipAry = Object.keys(this.all_ships());
remodList = [];
modelLv = 1;
while(shipAry.length) {
ship_id = parseInt(shipAry.shift());
cShip = this._raw.ship[ship_id];
// Pre-checks of the remodel table
if(!cShip) { /* invalid API */ continue; }
// `api_buildtime` always non-zero for all shipgirls even not able to be built,
// can be used to differentiate seasonal graph / abyssal data
if(!cShip.api_buildtime) { /* non-kanmusu by API */ continue; }
/* proposed variable:
kc3 prefix variable -> to prevent overwriting what devs gonna say later on
maxed flag -> is it the end of the cycle? is it returns to a cyclic model?
model level -> mark the current model is already marked.
base id -> base form of the ship
*/
cShip.api_aftershipid = Number(cShip.api_aftershipid);
if(!!cShip.kc3_model) { /* already checked ship */ modelLv = 1; continue; }
if(cShip.api_name.indexOf("改") >= 0 && modelLv <= 1) { /* delays enumeration of the remodelled ship in normal state */ continue; }
// Prepare remodel flag
cShip.kc3_maxed = false;
cShip.kc3_model = modelLv++; // 1 stands for base model
cShip.kc3_bship = cShip.kc3_bship || ship_id;
// Prepare salt list for every base ship that is not even a remodel
// Only for enabled salt check
if(
(ConfigManager.info_salt) &&
(ConfigManager.salt_list.indexOf(cShip.kc3_bship) < 0) &&
(this._raw.newShips[cShip.kc3_bship])
){
ConfigManager.salt_list.push(cShip.kc3_bship);
}
// Check whether remodel is available and skip further processing
if(!!cShip.api_afterlv) {
shipAry.unshift(cShip.api_aftershipid);
ccShip = this._raw.ship[cShip.api_aftershipid];
ccShip.kc3_bship = cShip.kc3_bship;
cShip.kc3_maxed = !!ccShip.kc3_model;
continue;
}
// Finalize model data
cShip.kc3_maxed = true;
modelLv = 1;
}
}
};
})();
| dragonjet/KC3Kai | src/library/modules/Master.js | JavaScript | mit | 24,183 |
'use strict';
angular.module('localisation', [ ])
.value("localisationDefaults", {
locales: [
{
locale: "en-gb",
url: "localisation/en-gb.json"
}
],
debug: true
})
.service("localisationService",
["$rootScope", "$http", "$filter", "$log", "$injector", "localisationDefaults",
function ($rootScope, $http, $filter, $log, $injector, localisationDefaults) {
this.resourceAvailable = false;
this.resources = [];
this.getLocalisedString = function (key) {
var result = "";
if(this.resourceAvailable && this.resources[this.locale] != undefined) {
var matches = $filter('filter')(this.resources[this.locale] || [], {key:key});
if (matches.length > 1) {
this.log("More than one resource value found with key " + key + " using the first");
}
if (matches.length > 0) {
result = matches[0].value;
} else {
this.log("No resource value found with key " + key);
result = key;
}
} else if(!this.resourceAvailable) {
this.loadCurrentLocalisationResource();
this.resourceAvailable = true;
}
if(this.getLocaleConfig(this.locale).failure) {
this.log("Failed to load this resource earlier, no values can be provided : " + key);
result = key;
}
return result;
};
this.isLocaleAvailable = function (locale) {
return $filter('filter')(this.config.locales, {locale:locale}).length === 1;
};
this.getLocaleConfig = function (locale) {
return $filter('filter')(this.config.locales, {locale:locale})[0];
};
this.isResourceAvailable = function (locale) {
return this.resources[locale] != undefined;
};
// Check for a user specified config, otherwise use the defaults
this.initConfig = function () {
if ($injector.has("localisationConfig")) {
this.config = $injector.get("localisationConfig");
this.log("Locale config has been found");
} else {
this.config = localisationDefaults;
this.log("No locale config found, using defaults");
}
this.setLocale(this.config.locales[0].locale);
};
this.loadCurrentLocalisationResource = function () {
if(this.resources[this.locale] == undefined && !this.getLocaleConfig(this.locale).failure) {
$http.get(this.getLocaleConfig(this.locale).url)
.success(angular.bind(this, this.setCurrentLocalisationResource))
.error(angular.bind(this, function () {
this.log("Failed to load resource : " + this.getLocaleConfig(this.locale).url);
this.getLocaleConfig(this.locale).failure = true;
}));
}
};
this.setCurrentLocalisationResource = function (data) {
if(data != undefined) {
this.resources[this.locale] = data;
this.resourceAvailable = true;
$rootScope.$broadcast('localisationResourceChange');
}
};
this.setLocale = function (locale) {
if(this.isLocaleAvailable(locale)) {
this.locale = locale;
} else {
this.locale = this.config.locales[0].locale;
}
this.resourceAvailable = this.isResourceAvailable(this.locale);
};
this.log = function (message) {
if (this.config.debug)
$log.log("formular: " + message);
};
this.initConfig();
}])
.filter('localise', ['localisationService', function (localisationService) {
return function (key) {
return localisationService.getLocalisedString(key);
};
}]);
| clifforj/formular-localisation | app/js/localisation.js | JavaScript | mit | 4,437 |
import React from 'react';
import MessageListPropTypes from './MessagesListPropTypes';
import MessageItem from '../MessageItem/MessageItem';
const MessagesList = (props)=>{
const MessageItems = props.messages.map(
(item,index)=>{
console.log(item);
return <MessageItem key={index} text={item.text} author={item.author} time={item.time}/>
}
);
return (
<div>
<ul>{MessageItems}</ul>
</div>
)
}
MessagesList.propTypes = MessageListPropTypes;
export default MessagesList;
| DeadManPoe/ReactChat | src/Components/Presentational/MessagesList/MessagesList.js | JavaScript | mit | 556 |
exports.BattleScripts = {
gen: 6,
runMove: function (move, pokemon, target, sourceEffect) {
if (!sourceEffect && toId(move) !== 'struggle') {
var changedMove = this.runEvent('OverrideDecision', pokemon, target, move);
if (changedMove && changedMove !== true) {
move = changedMove;
target = null;
}
}
move = this.getMove(move);
if (!target && target !== false) target = this.resolveTarget(pokemon, move);
this.setActiveMove(move, pokemon, target);
if (pokemon.moveThisTurn) {
// THIS IS PURELY A SANITY CHECK
// DO NOT TAKE ADVANTAGE OF THIS TO PREVENT A POKEMON FROM MOVING;
// USE this.cancelMove INSTEAD
this.debug('' + pokemon.id + ' INCONSISTENT STATE, ALREADY MOVED: ' + pokemon.moveThisTurn);
this.clearActiveMove(true);
return;
}
if (!this.runEvent('BeforeMove', pokemon, target, move)) {
// Prevent invulnerability from persisting until the turn ends
pokemon.removeVolatile('twoturnmove');
// Prevent Pursuit from running again against a slower U-turn/Volt Switch/Parting Shot
pokemon.moveThisTurn = true;
this.clearActiveMove(true);
return;
}
if (move.beforeMoveCallback) {
if (move.beforeMoveCallback.call(this, pokemon, target, move)) {
this.clearActiveMove(true);
return;
}
}
pokemon.lastDamage = 0;
var lockedMove = this.runEvent('LockMove', pokemon);
if (lockedMove === true) lockedMove = false;
if (!lockedMove) {
if (!pokemon.deductPP(move, null, target) && (move.id !== 'struggle')) {
this.add('cant', pokemon, 'nopp', move);
this.clearActiveMove(true);
return;
}
}
pokemon.moveUsed(move);
this.useMove(move, pokemon, target, sourceEffect);
this.singleEvent('AfterMove', move, null, pokemon, target, move);
},
useMove: function (move, pokemon, target, sourceEffect) {
if (!sourceEffect && this.effect.id) sourceEffect = this.effect;
move = this.getMoveCopy(move);
if (this.activeMove) move.priority = this.activeMove.priority;
var baseTarget = move.target;
if (!target && target !== false) target = this.resolveTarget(pokemon, move);
if (move.target === 'self' || move.target === 'allies') {
target = pokemon;
}
if (sourceEffect) move.sourceEffect = sourceEffect.id;
this.setActiveMove(move, pokemon, target);
this.singleEvent('ModifyMove', move, null, pokemon, target, move, move);
if (baseTarget !== move.target) {
// Target changed in ModifyMove, so we must adjust it here
// Adjust before the next event so the correct target is passed to the
// event
target = this.resolveTarget(pokemon, move);
}
move = this.runEvent('ModifyMove', pokemon, target, move, move);
if (baseTarget !== move.target) {
// Adjust again
target = this.resolveTarget(pokemon, move);
}
if (!move) return false;
var attrs = '';
var missed = false;
if (pokemon.fainted) {
return false;
}
if (move.isTwoTurnMove && !pokemon.volatiles[move.id]) {
attrs = '|[still]'; // suppress the default move animation
}
var movename = move.name;
if (move.id === 'hiddenpower') movename = 'Hidden Power';
if (sourceEffect) attrs += '|[from]' + this.getEffect(sourceEffect);
this.addMove('move', pokemon, movename, target + attrs);
if (target === false) {
this.attrLastMove('[notarget]');
this.add('-notarget');
return true;
}
if (!this.runEvent('TryMove', pokemon, target, move)) {
return true;
}
if (typeof move.affectedByImmunities === 'undefined') {
move.affectedByImmunities = (move.category !== 'Status');
}
var damage = false;
if (move.target === 'all' || move.target === 'foeSide' || move.target === 'allySide' || move.target === 'allyTeam') {
damage = this.tryMoveHit(target, pokemon, move);
} else if (move.target === 'allAdjacent' || move.target === 'allAdjacentFoes') {
var targets = [];
if (move.target === 'allAdjacent') {
var allyActive = pokemon.side.active;
for (var i = 0; i < allyActive.length; i++) {
if (allyActive[i] && Math.abs(i - pokemon.position) <= 1 && i !== pokemon.position && !allyActive[i].fainted) {
targets.push(allyActive[i]);
}
}
}
var foeActive = pokemon.side.foe.active;
var foePosition = foeActive.length - pokemon.position - 1;
for (var i = 0; i < foeActive.length; i++) {
if (foeActive[i] && Math.abs(i - foePosition) <= 1 && !foeActive[i].fainted) {
targets.push(foeActive[i]);
}
}
if (move.selfdestruct) {
this.faint(pokemon, pokemon, move);
}
if (!targets.length) {
this.attrLastMove('[notarget]');
this.add('-notarget');
return true;
}
if (targets.length > 1) move.spreadHit = true;
damage = 0;
for (var i = 0; i < targets.length; i++) {
damage += (this.tryMoveHit(targets[i], pokemon, move, true) || 0);
}
if (!pokemon.hp) pokemon.faint();
} else {
if (target.fainted && target.side !== pokemon.side) {
// if a targeted foe faints, the move is retargeted
target = this.resolveTarget(pokemon, move);
}
var lacksTarget = target.fainted;
if (!lacksTarget) {
if (move.target === 'adjacentFoe' || move.target === 'adjacentAlly' || move.target === 'normal' || move.target === 'randomNormal') {
lacksTarget = !this.isAdjacent(target, pokemon);
}
}
if (lacksTarget) {
this.attrLastMove('[notarget]');
this.add('-notarget');
return true;
}
if (target.side.active.length > 1) {
target = this.runEvent('RedirectTarget', pokemon, pokemon, move, target);
}
damage = this.tryMoveHit(target, pokemon, move);
}
if (!pokemon.hp) {
this.faint(pokemon, pokemon, move);
}
if (!damage && damage !== 0 && damage !== undefined) {
this.singleEvent('MoveFail', move, null, target, pokemon, move);
return true;
}
if (move.selfdestruct) {
this.faint(pokemon, pokemon, move);
}
if (!move.negateSecondary) {
this.singleEvent('AfterMoveSecondarySelf', move, null, pokemon, target, move);
this.runEvent('AfterMoveSecondarySelf', pokemon, target, move);
}
return true;
},
tryMoveHit: function (target, pokemon, move, spreadHit) {
if (move.selfdestruct && spreadHit) pokemon.hp = 0;
this.setActiveMove(move, pokemon, target);
var hitResult = true;
hitResult = this.singleEvent('PrepareHit', move, {}, target, pokemon, move);
if (!hitResult) {
if (hitResult === false) this.add('-fail', target);
return false;
}
this.runEvent('PrepareHit', pokemon, target, move);
if (!this.singleEvent('Try', move, null, pokemon, target, move)) {
return false;
}
if (move.target === 'all' || move.target === 'foeSide' || move.target === 'allySide' || move.target === 'allyTeam') {
if (move.target === 'all') {
hitResult = this.runEvent('TryHitField', target, pokemon, move);
} else {
hitResult = this.runEvent('TryHitSide', target, pokemon, move);
}
if (!hitResult) {
if (hitResult === false) this.add('-fail', target);
return true;
}
return this.moveHit(target, pokemon, move);
}
if (move.affectedByImmunities && !target.runImmunity(move.type, true)) {
return false;
}
if (typeof move.affectedByImmunities === 'undefined') {
move.affectedByImmunities = (move.category !== 'Status');
}
hitResult = this.runEvent('TryHit', target, pokemon, move);
if (!hitResult) {
if (hitResult === false) this.add('-fail', target);
return false;
}
var boostTable = [1, 4 / 3, 5 / 3, 2, 7 / 3, 8 / 3, 3];
// calculate true accuracy
var accuracy = move.accuracy;
var boost;
if (accuracy !== true) {
var targetAbilityIgnoreAccuracy = !target.ignore['Ability'] && target.getAbility().ignoreAccuracy;
if (!move.ignoreAccuracy && !targetAbilityIgnoreAccuracy) {
boost = this.runEvent('ModifyBoost', pokemon, 'accuracy', null, pokemon.boosts.accuracy);
boost = this.clampIntRange(boost, -6, 6);
if (boost > 0) {
accuracy *= boostTable[boost];
} else {
accuracy /= boostTable[-boost];
}
}
var pokemonAbilityIgnoreEvasion = !pokemon.ignore['Ability'] && pokemon.getAbility().ignoreEvasion;
if (!move.ignoreEvasion && !pokemonAbilityIgnoreEvasion) {
boost = this.runEvent('ModifyBoost', pokemon, 'evasion', null, target.boosts.evasion);
boost = this.clampIntRange(boost, -6, 6);
if (boost > 0 && !move.ignorePositiveEvasion) {
accuracy /= boostTable[boost];
} else if (boost < 0) {
accuracy *= boostTable[-boost];
}
}
}
if (move.ohko) { // bypasses accuracy modifiers
if (!target.volatiles['bounce'] && !target.volatiles['dig'] && !target.volatiles['dive'] && !target.volatiles['fly'] && !target.volatiles['shadowforce'] && !target.volatiles['skydrop']) {
accuracy = 30;
if (pokemon.level > target.level) accuracy += (pokemon.level - target.level);
}
}
if (move.alwaysHit) {
accuracy = true; // bypasses ohko accuracy modifiers
} else {
accuracy = this.runEvent('Accuracy', target, pokemon, move, accuracy);
}
if (accuracy !== true && this.random(100) >= accuracy) {
if (!spreadHit) this.attrLastMove('[miss]');
this.add('-miss', pokemon, target);
return false;
}
var totalDamage = 0;
var damage = 0;
pokemon.lastDamage = 0;
if (move.multihit) {
var hits = move.multihit;
if (hits.length) {
// yes, it's hardcoded... meh
if (hits[0] === 2 && hits[1] === 5) {
if (this.gen >= 5) {
hits = [2, 2, 3, 3, 4, 5][this.random(6)];
} else {
hits = [2, 2, 2, 3, 3, 3, 4, 5][this.random(8)];
}
} else {
hits = this.random(hits[0], hits[1] + 1);
}
}
hits = Math.floor(hits);
var nullDamage = true;
var moveDamage;
// There is no need to recursively check the ´sleepUsable´ flag as Sleep Talk can only be used while asleep.
var isSleepUsable = move.sleepUsable || this.getMove(move.sourceEffect).sleepUsable;
var i;
for (i = 0; i < hits && target.hp && pokemon.hp; i++) {
if (pokemon.status === 'slp' && !isSleepUsable) break;
moveDamage = this.moveHit(target, pokemon, move);
if (moveDamage === false) break;
if (nullDamage && (moveDamage || moveDamage === 0)) nullDamage = false;
// Damage from each hit is individually counted for the
// purposes of Counter, Metal Burst, and Mirror Coat.
damage = (moveDamage || 0);
// Total damage dealt is accumulated for the purposes of recoil (Parental Bond).
totalDamage += damage;
this.eachEvent('Update');
}
if (i === 0) return true;
if (nullDamage) damage = false;
this.add('-hitcount', target, i);
} else {
damage = this.moveHit(target, pokemon, move);
totalDamage = damage;
}
if (move.recoil) {
this.damage(this.clampIntRange(Math.round(totalDamage * move.recoil[0] / move.recoil[1]), 1), pokemon, target, 'recoil');
}
if (target && move.category !== 'Status') target.gotAttacked(move, damage, pokemon);
if (!damage && damage !== 0) return damage;
if (target && !move.negateSecondary) {
this.singleEvent('AfterMoveSecondary', move, null, target, pokemon, move);
this.runEvent('AfterMoveSecondary', target, pokemon, move);
}
return damage;
},
moveHit: function (target, pokemon, move, moveData, isSecondary, isSelf) {
var damage;
move = this.getMoveCopy(move);
if (!moveData) moveData = move;
var hitResult = true;
// TryHit events:
// STEP 1: we see if the move will succeed at all:
// - TryHit, TryHitSide, or TryHitField are run on the move,
// depending on move target (these events happen in useMove
// or tryMoveHit, not below)
// == primary hit line ==
// Everything after this only happens on the primary hit (not on
// secondary or self-hits)
// STEP 2: we see if anything blocks the move from hitting:
// - TryFieldHit is run on the target
// STEP 3: we see if anything blocks the move from hitting the target:
// - If the move's target is a pokemon, TryHit is run on that pokemon
// Note:
// If the move target is `foeSide`:
// event target = pokemon 0 on the target side
// If the move target is `allySide` or `all`:
// event target = the move user
//
// This is because events can't accept actual sides or fields as
// targets. Choosing these event targets ensures that the correct
// side or field is hit.
//
// It is the `TryHitField` event handler's responsibility to never
// use `target`.
// It is the `TryFieldHit` event handler's responsibility to read
// move.target and react accordingly.
// An exception is `TryHitSide` as a single event (but not as a normal
// event), which is passed the target side.
if (move.target === 'all' && !isSelf) {
hitResult = this.singleEvent('TryHitField', moveData, {}, target, pokemon, move);
} else if ((move.target === 'foeSide' || move.target === 'allySide') && !isSelf) {
hitResult = this.singleEvent('TryHitSide', moveData, {}, target.side, pokemon, move);
} else if (target) {
hitResult = this.singleEvent('TryHit', moveData, {}, target, pokemon, move);
}
if (!hitResult) {
if (hitResult === false) this.add('-fail', target);
return false;
}
if (target && !isSecondary && !isSelf) {
hitResult = this.runEvent('TryPrimaryHit', target, pokemon, moveData);
if (hitResult === 0) {
// special Substitute flag
hitResult = true;
target = null;
}
}
if (target && isSecondary && !moveData.self) {
hitResult = true;
}
if (!hitResult) {
return false;
}
if (target) {
var didSomething = false;
damage = this.getDamage(pokemon, target, moveData);
// getDamage has several possible return values:
//
// a number:
// means that much damage is dealt (0 damage still counts as dealing
// damage for the purposes of things like Static)
// false:
// gives error message: "But it failed!" and move ends
// null:
// the move ends, with no message (usually, a custom fail message
// was already output by an event handler)
// undefined:
// means no damage is dealt and the move continues
//
// basically, these values have the same meanings as they do for event
// handlers.
if ((damage || damage === 0) && !target.fainted) {
if (move.noFaint && damage >= target.hp) {
damage = target.hp - 1;
}
damage = this.damage(damage, target, pokemon, move);
if (!(damage || damage === 0)) {
this.debug('damage interrupted');
return false;
}
didSomething = true;
}
if (damage === false || damage === null) {
if (damage === false) {
this.add('-fail', target);
}
this.debug('damage calculation interrupted');
return false;
}
if (moveData.boosts && !target.fainted) {
hitResult = this.boost(moveData.boosts, target, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.heal && !target.fainted) {
var d = target.heal((this.gen < 5 ? Math.floor : Math.round)(target.maxhp * moveData.heal[0] / moveData.heal[1]));
if (!d && d !== 0) {
this.add('-fail', target);
this.debug('heal interrupted');
return false;
}
this.add('-heal', target, target.getHealth);
didSomething = true;
}
if (moveData.status) {
if (!target.status) {
hitResult = target.setStatus(moveData.status, pokemon, move);
didSomething = didSomething || hitResult;
} else if (!isSecondary) {
if (target.status === moveData.status) {
this.add('-fail', target, target.status);
} else {
this.add('-fail', target);
}
return false;
}
}
if (moveData.forceStatus) {
hitResult = target.setStatus(moveData.forceStatus, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.volatileStatus) {
hitResult = target.addVolatile(moveData.volatileStatus, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.sideCondition) {
hitResult = target.side.addSideCondition(moveData.sideCondition, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.weather) {
hitResult = this.setWeather(moveData.weather, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.terrain) {
hitResult = this.setTerrain(moveData.terrain, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.pseudoWeather) {
hitResult = this.addPseudoWeather(moveData.pseudoWeather, pokemon, move);
didSomething = didSomething || hitResult;
}
if (moveData.forceSwitch) {
if (this.canSwitch(target.side)) didSomething = true; // at least defer the fail message to later
}
if (moveData.selfSwitch) {
if (this.canSwitch(pokemon.side)) didSomething = true; // at least defer the fail message to later
}
// Hit events
// These are like the TryHit events, except we don't need a FieldHit event.
// Scroll up for the TryHit event documentation, and just ignore the "Try" part. ;)
hitResult = null;
if (move.target === 'all' && !isSelf) {
if (moveData.onHitField) hitResult = this.singleEvent('HitField', moveData, {}, target, pokemon, move);
} else if ((move.target === 'foeSide' || move.target === 'allySide') && !isSelf) {
if (moveData.onHitSide) hitResult = this.singleEvent('HitSide', moveData, {}, target.side, pokemon, move);
} else {
if (moveData.onHit) hitResult = this.singleEvent('Hit', moveData, {}, target, pokemon, move);
if (!isSelf && !isSecondary) {
this.runEvent('Hit', target, pokemon, move);
}
if (moveData.onAfterHit) hitResult = this.singleEvent('AfterHit', moveData, {}, target, pokemon, move);
}
if (!hitResult && !didSomething && !moveData.self && !moveData.selfdestruct) {
if (!isSelf && !isSecondary) {
if (hitResult === false || didSomething === false) this.add('-fail', target);
}
this.debug('move failed because it did nothing');
return false;
}
}
if (moveData.self) {
var selfRoll;
if (!isSecondary && moveData.self.boosts) selfRoll = this.random(100);
// This is done solely to mimic in-game RNG behaviour. All self drops have a 100% chance of happening but still grab a random number.
if (typeof moveData.self.chance === 'undefined' || selfRoll < moveData.self.chance) {
this.moveHit(pokemon, pokemon, move, moveData.self, isSecondary, true);
}
}
if (moveData.secondaries && this.runEvent('TrySecondaryHit', target, pokemon, moveData)) {
var secondaryRoll;
for (var i = 0; i < moveData.secondaries.length; i++) {
secondaryRoll = this.random(100);
if (typeof moveData.secondaries[i].chance === 'undefined' || secondaryRoll < moveData.secondaries[i].chance) {
this.moveHit(target, pokemon, move, moveData.secondaries[i], true, isSelf);
}
}
}
if (target && target.hp > 0 && pokemon.hp > 0 && moveData.forceSwitch && this.canSwitch(target.side)) {
hitResult = this.runEvent('DragOut', target, pokemon, move);
if (hitResult) {
target.forceSwitchFlag = true;
} else if (hitResult === false) {
this.add('-fail', target);
}
}
if (move.selfSwitch && pokemon.hp) {
pokemon.switchFlag = move.selfSwitch;
}
return damage;
},
canMegaEvo: function (pokemon) {
var altForme = pokemon.baseTemplate.otherFormes && this.getTemplate(pokemon.baseTemplate.otherFormes[0]);
if (altForme && altForme.isMega && altForme.requiredMove && pokemon.moves.indexOf(toId(altForme.requiredMove)) > -1) return altForme.species;
var item = pokemon.getItem();
if (item.megaEvolves !== pokemon.baseTemplate.baseSpecies || item.megaStone === pokemon.species) return false;
return item.megaStone;
},
runMegaEvo: function (pokemon) {
var template = this.getTemplate(pokemon.canMegaEvo);
var side = pokemon.side;
// Pokémon affected by Sky Drop cannot mega evolve. Enforce it here for now.
var foeActive = side.foe.active;
for (var i = 0; i < foeActive.length; i++) {
if (foeActive[i].volatiles['skydrop'] && foeActive[i].volatiles['skydrop'].source === pokemon) {
return false;
}
}
pokemon.formeChange(template);
pokemon.baseTemplate = template; // mega evolution is permanent
pokemon.details = template.species + (pokemon.level === 100 ? '' : ', L' + pokemon.level) + (pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');
this.add('detailschange', pokemon, pokemon.details);
this.add('-mega', pokemon, template.baseSpecies, template.requiredItem);
pokemon.setAbility(template.abilities['0']);
pokemon.baseAbility = pokemon.ability;
// Limit one mega evolution
for (var i = 0; i < side.pokemon.length; i++) {
side.pokemon[i].canMegaEvo = false;
}
return true;
},
isAdjacent: function (pokemon1, pokemon2) {
if (pokemon1.fainted || pokemon2.fainted) return false;
if (pokemon1.side === pokemon2.side) return Math.abs(pokemon1.position - pokemon2.position) === 1;
return Math.abs(pokemon1.position + pokemon2.position + 1 - pokemon1.side.active.length) <= 1;
},
checkAbilities: function (selectedAbilities, defaultAbilities) {
if (!selectedAbilities.length) return true;
var selectedAbility = selectedAbilities.pop();
var isValid = false;
for (var i = 0; i < defaultAbilities.length; i++) {
var defaultAbility = defaultAbilities[i];
if (!defaultAbility) break;
if (defaultAbility.indexOf(selectedAbility) !== -1) {
defaultAbilities.splice(i, 1);
isValid = this.checkAbilities(selectedAbilities, defaultAbilities);
if (isValid) break;
defaultAbilities.splice(i, 0, defaultAbility);
}
}
if (!isValid) selectedAbilities.push(selectedAbility);
return isValid;
},
sampleNoReplace: function (list) {
var length = list.length;
var index = this.random(length);
var element = list[index];
for (var nextIndex = index + 1; nextIndex < length; index += 1, nextIndex += 1) {
list[index] = list[nextIndex];
}
list.pop();
return element;
},
hasMegaEvo: function (template) {
if (template.otherFormes) {
var forme = this.getTemplate(template.otherFormes[0]);
if (forme.requiredItem) {
var item = this.getItem(forme.requiredItem);
if (item.megaStone) return true;
} else if (forme.requiredMove && forme.isMega) {
return true;
}
}
return false;
},
getTeam: function (side, team) {
var format = side.battle.getFormat();
if (typeof format.team === 'string' && format.team.substr(0, 6) === 'random') {
return this[format.team + 'Team'](side);
} else if (team) {
return team;
} else {
return this.randomTeam(side);
}
},
randomCCTeam: function (side) {
var team = [];
var natures = Object.keys(this.data.Natures);
var items = Object.keys(this.data.Items);
var hasDexNumber = {};
var formes = [[], [], [], [], [], []];
// pick six random pokemon--no repeats, even among formes
// also need to either normalize for formes or select formes at random
// unreleased are okay. No CAP for now, but maybe at some later date
var num;
for (var i = 0; i < 6; i++) {
do {
num = this.random(721) + 1;
} while (num in hasDexNumber);
hasDexNumber[num] = i;
}
for (var id in this.data.Pokedex) {
if (!(this.data.Pokedex[id].num in hasDexNumber)) continue;
var template = this.getTemplate(id);
if (template.learnset && template.species !== 'Pichu-Spiky-eared') {
formes[hasDexNumber[template.num]].push(template.species);
}
}
for (var i = 0; i < 6; i++) {
var poke = formes[i][this.random(formes[i].length)];
var template = this.getTemplate(poke);
//level balance--calculate directly from stats rather than using some silly lookup table
var mbstmin = 1307; //sunkern has the lowest modified base stat total, and that total is 807
var stats = template.baseStats;
//modified base stat total assumes 31 IVs, 85 EVs in every stat
var mbst = (stats["hp"] * 2 + 31 + 21 + 100) + 10;
mbst += (stats["atk"] * 2 + 31 + 21 + 100) + 5;
mbst += (stats["def"] * 2 + 31 + 21 + 100) + 5;
mbst += (stats["spa"] * 2 + 31 + 21 + 100) + 5;
mbst += (stats["spd"] * 2 + 31 + 21 + 100) + 5;
mbst += (stats["spe"] * 2 + 31 + 21 + 100) + 5;
var level = Math.floor(100 * mbstmin / mbst); //initial level guess will underestimate
while (level < 100) {
mbst = Math.floor((stats["hp"] * 2 + 31 + 21 + 100) * level / 100 + 10);
mbst += Math.floor(((stats["atk"] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100); //since damage is roughly proportional to lvl
mbst += Math.floor((stats["def"] * 2 + 31 + 21 + 100) * level / 100 + 5);
mbst += Math.floor(((stats["spa"] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100);
mbst += Math.floor((stats["spd"] * 2 + 31 + 21 + 100) * level / 100 + 5);
mbst += Math.floor((stats["spe"] * 2 + 31 + 21 + 100) * level / 100 + 5);
if (mbst >= mbstmin)
break;
level++;
}
//random gender--already handled by PS?
//random ability (unreleased hidden are par for the course)
var abilities = [template.abilities['0']];
if (template.abilities['1']) {
abilities.push(template.abilities['1']);
}
if (template.abilities['H']) {
abilities.push(template.abilities['H']);
}
var ability = abilities[this.random(abilities.length)];
//random nature
var nature = natures[this.random(natures.length)];
//random item
var item = '';
if (template.requiredItem) {
item = template.requiredItem;
} else {
item = items[this.random(items.length)];
}
if (this.getItem(item).megaStone) {
// we'll exclude mega stones for now
item = items[this.random(items.length)];
}
//since we're selecting forme at random, we gotta make sure forme/item combo is correct
while (poke === 'Arceus' && item.substr(-5) !== 'plate' || poke === 'Giratina' && item === 'griseousorb') {
item = items[this.random(items.length)];
}
//random IVs
var ivs = {hp: this.random(32), atk: this.random(32), def: this.random(32), spa: this.random(32), spd: this.random(32), spe: this.random(32)};
//random EVs
var evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0};
var s = ["hp", "atk", "def", "spa", "spd", "spe"];
var evpool = 510;
do {
var x = s[this.random(s.length)];
var y = this.random(Math.min(256 - evs[x], evpool + 1));
evs[x] += y;
evpool -= y;
} while (evpool > 0);
//random happiness--useless, since return/frustration is currently a "cheat"
var happiness = this.random(256);
//random shininess?
var shiny = !this.random(1024);
//four random unique moves from movepool. don't worry about "attacking" or "viable"
var moves;
var pool = ['struggle'];
if (poke === 'Smeargle') {
pool = Object.keys(this.data.Movedex).exclude('struggle', 'chatter', 'magikarpsrevenge');
} else if (template.learnset) {
pool = Object.keys(template.learnset);
}
if (pool.length <= 4) {
moves = pool;
} else {
moves = [this.sampleNoReplace(pool), this.sampleNoReplace(pool), this.sampleNoReplace(pool), this.sampleNoReplace(pool)];
}
team.push({
name: poke,
moves: moves,
ability: ability,
evs: evs,
ivs: ivs,
nature: nature,
item: item,
level: level,
happiness: happiness,
shiny: shiny
});
}
//console.log(team);
return team;
},
randomMonoTypeTeam: function (side) {
var keys = [];
var pokemonLeft = 0;
var pokemon = [];
for (var i in this.data.FormatsData) {
var template = this.getTemplate(i);
if (this.data.FormatsData[i].randomBattleMoves && !this.data.FormatsData[i].isNonstandard && !template.evos.length && (template.forme.substr(0,4) !== 'Mega')) {
keys.push(i);
}
}
keys = keys.randomize();
// PotD stuff
var potd = {};
if ('Rule:potd' in this.getBanlistTable(this.getFormat())) {
potd = this.getTemplate(Config.potd);
}
var monoType = '';
var randomType = Math.floor(Math.random() * 18) + 1;
switch (randomType) {
case 1:
monoType = 'Bug';
break;
case 2:
monoType = 'Dark';
break;
case 3:
monoType = 'Dragon';
break;
case 4:
monoType = 'Electric';
break;
case 5:
monoType = 'Fairy';
break;
case 6:
monoType = 'Fighting';
break;
case 7:
monoType = 'Fire';
break;
case 8:
monoType = 'Flying';
break;
case 9:
monoType = 'Ghost';
break;
case 10:
monoType = 'Grass';
break;
case 11:
monoType = 'Ground';
break;
case 12:
monoType = 'Ice';
break;
case 13:
monoType = 'Normal';
break;
case 14:
monoType = 'Poison';
break;
case 15:
monoType = 'Psychic';
break;
case 16:
monoType = 'Rock';
break;
case 17:
monoType = 'Steel';
break;
default:
monoType = 'Water';
}
var typeCount = {};
var typeComboCount = {};
var baseFormes = {};
var uberCount = 0;
var nuCount = 0;
var megaCount = 0;
for (var i = 0; i < keys.length && pokemonLeft < 6; i++) {
var template = this.getTemplate(keys[i]);
if (!template || !template.name || !template.types) continue;
var tier = template.tier;
// This tries to limit the amount of Ubers and NUs on one team to promote "fun":
// LC Pokemon have a hard limit in place at 2; NFEs/NUs/Ubers are also limited to 2 but have a 20% chance of being added anyway.
// LC/NFE/NU Pokemon all share a counter (so having one of each would make the counter 3), while Ubers have a counter of their own.
if (tier === 'LC' && nuCount > 1) continue;
if ((tier === 'NFE' || tier === 'NU') && nuCount > 1 && Math.random() * 5 > 1) continue;
if (tier === 'Uber' && uberCount > 1 && Math.random() * 5 > 1) continue;
// CAPs have 20% the normal rate
if (tier === 'CAP' && Math.random() * 5 > 1) continue;
// Arceus formes have 1/18 the normal rate each (so Arceus as a whole has a normal rate)
if (keys[i].substr(0, 6) === 'arceus' && Math.random() * 18 > 1) continue;
// Basculin formes have 1/2 the normal rate each (so Basculin as a whole has a normal rate)
if (keys[i].substr(0, 8) === 'basculin' && Math.random() * 2 > 1) continue;
// Genesect formes have 1/5 the normal rate each (so Genesect as a whole has a normal rate)
if (keys[i].substr(0, 8) === 'genesect' && Math.random() * 5 > 1) continue;
// Gourgeist formes have 1/4 the normal rate each (so Gourgeist as a whole has a normal rate)
if (keys[i].substr(0, 9) === 'gourgeist' && Math.random() * 4 > 1) continue;
// Not available on XY
if (template.species === 'Pichu-Spiky-eared') continue;
// Limit 2 of any type
var types = template.types;
var skip = false;
for (var t = 0; t < types.length; t++) {
if (typeCount[types[t]] > 1 && Math.random() * 5 > 1) {
skip = false;
break;
}
}
if (!types) continue;
if (skip) continue;
if (toId(types[0]) !== toId(monoType) && toId(types[1]) !== toId(monoType)) continue;
if (potd && potd.name && potd.types) {
// The Pokemon of the Day belongs in slot 2
if (i === 1) {
template = potd;
if (template.species === 'Magikarp') {
template.randomBattleMoves = ['magikarpsrevenge', 'splash', 'bounce'];
} else if (template.species === 'Delibird') {
template.randomBattleMoves = ['present', 'bestow'];
}
} else if (template.species === potd.species) {
continue; // No, thanks, I've already got one
}
}
var set = this.randomSet(template, i, megaCount);
// Illusion shouldn't be on the last pokemon of the team
if (set.ability === 'Illusion' && pokemonLeft > 4) continue;
// Limit 1 of any type combination
var typeCombo = types.join();
if (set.ability === 'Drought' || set.ability === 'Drizzle') {
// Drought and Drizzle don't count towards the type combo limit
typeCombo = set.ability;
}
if (typeCombo in typeComboCount) continue;
// Limit the number of Megas to one, just like in-game
if (this.getItem(set.item).megaStone && megaCount > 0) continue;
// Limit to one of each species (Species Clause)
if (baseFormes[template.baseSpecies]) continue;
baseFormes[template.baseSpecies] = 1;
// Okay, the set passes, add it to our team
pokemon.push(set);
pokemonLeft++;
// Now that our Pokemon has passed all checks, we can increment the type counter
for (var t = 0; t < types.length; t++) {
if (types[t] in typeCount) {
typeCount[types[t]]++;
} else {
typeCount[types[t]] = 1;
}
}
typeComboCount[typeCombo] = 1;
// Increment Uber/NU and mega counter
if (tier === 'Uber') {
uberCount++;
} else if (tier === 'NU' || tier === 'NFE' || tier === 'LC') {
nuCount++;
}
if (this.getItem(set.item).megaStone) megaCount++;
}
return pokemon;
},
randomHackmonsCCTeam: function (side) {
var team = [];
var itemPool = Object.keys(this.data.Items);
var abilityPool = Object.keys(this.data.Abilities);
var movePool = Object.keys(this.data.Movedex);
var naturePool = Object.keys(this.data.Natures);
var hasDexNumber = {};
var formes = [[], [], [], [], [], []];
// pick six random pokemon--no repeats, even among formes
// also need to either normalize for formes or select formes at random
// unreleased are okay. No CAP for now, but maybe at some later date
var num;
for (var i = 0; i < 6; i++) {
do {
num = this.random(721) + 1;
} while (num in hasDexNumber);
hasDexNumber[num] = i;
}
for (var id in this.data.Pokedex) {
if (!(this.data.Pokedex[id].num in hasDexNumber)) continue;
var template = this.getTemplate(id);
if (template.learnset && template.species !== 'Pichu-Spiky-eared') {
formes[hasDexNumber[template.num]].push(template.species);
}
}
for (var i = 0; i < 6; i++) {
// Choose forme
var pokemon = formes[i][this.random(formes[i].length)];
var template = this.getTemplate(pokemon);
// Random unique item
var item = '';
do {
item = this.sampleNoReplace(itemPool);
} while (this.data.Items[item].isNonstandard);
// Genesect forms are a sprite difference based on its Drives
if (template.species.substr(0, 9) === 'Genesect-' && item !== toId(template.requiredItem)) pokemon = 'Genesect';
// Random unique ability
var ability = '';
do {
ability = this.sampleNoReplace(abilityPool);
} while (this.data.Abilities[ability].isNonstandard);
// Random unique moves
var m = [];
while (true) {
var moveid = this.sampleNoReplace(movePool);
if (!this.data.Movedex[moveid].isNonstandard && (moveid === 'hiddenpower' || moveid.substr(0, 11) !== 'hiddenpower')) {
if (m.push(moveid) >= 4) break;
}
}
// PS overrides your move if you have Struggle in the first slot
if (m[0] === 'struggle') m.push(m.shift());
// Random EVs
var evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0};
var s = ['hp', 'atk', 'def', 'spa', 'spd', 'spe'];
var evpool = 510;
do {
var x = s[this.random(s.length)];
var y = this.random(Math.min(256 - evs[x], evpool + 1));
evs[x] += y;
evpool -= y;
} while (evpool > 0);
// Random IVs
var ivs = {hp: this.random(32), atk: this.random(32), def: this.random(32), spa: this.random(32), spd: this.random(32), spe: this.random(32)};
// Random nature
var nature = naturePool[this.random(naturePool.length)];
// Level balance
var mbstmin = 1307;
var stats = template.baseStats;
var mbst = (stats['hp'] * 2 + 31 + 21 + 100) + 10;
mbst += (stats['atk'] * 2 + 31 + 21 + 100) + 5;
mbst += (stats['def'] * 2 + 31 + 21 + 100) + 5;
mbst += (stats['spa'] * 2 + 31 + 21 + 100) + 5;
mbst += (stats['spd'] * 2 + 31 + 21 + 100) + 5;
mbst += (stats['spe'] * 2 + 31 + 21 + 100) + 5;
var level = Math.floor(100 * mbstmin / mbst);
while (level < 100) {
mbst = Math.floor((stats['hp'] * 2 + 31 + 21 + 100) * level / 100 + 10);
mbst += Math.floor(((stats['atk'] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100);
mbst += Math.floor((stats['def'] * 2 + 31 + 21 + 100) * level / 100 + 5);
mbst += Math.floor(((stats['spa'] * 2 + 31 + 21 + 100) * level / 100 + 5) * level / 100);
mbst += Math.floor((stats['spd'] * 2 + 31 + 21 + 100) * level / 100 + 5);
mbst += Math.floor((stats['spe'] * 2 + 31 + 21 + 100) * level / 100 + 5);
if (mbst >= mbstmin) break;
level++;
}
// Random happiness
var happiness = this.random(256);
// Random shininess
var shiny = !this.random(1024);
team.push({
name: pokemon,
item: item,
ability: ability,
moves: m,
evs: evs,
ivs: ivs,
nature: nature,
level: level,
happiness: happiness,
shiny: shiny
});
}
return team;
},
randomSet: function (template, slot, noMega) {
if (slot === undefined) slot = 1;
var baseTemplate = (template = this.getTemplate(template));
var name = template.name;
if (!template.exists || (!template.randomBattleMoves && !template.learnset)) {
// GET IT? UNOWN? BECAUSE WE CAN'T TELL WHAT THE POKEMON IS
template = this.getTemplate('unown');
var stack = 'Template incompatible with random battles: ' + name;
var fakeErr = {stack: stack};
require('../crashlogger.js')(fakeErr, 'The randbat set generator');
}
// Meloetta-P can be chosen
if (template.num === 648) {
name = 'Meloetta';
}
// Decide if the Pokemon can mega evolve early, so viable moves for the mega can be generated
if (!noMega && this.hasMegaEvo(template)) {
// If there's more than one mega evolution, randomly pick one
template = this.getTemplate(template.otherFormes[this.random(template.otherFormes.length)]);
}
if (template.otherFormes && this.getTemplate(template.otherFormes[0]).isPrimal && this.random(2)) {
template = this.getTemplate(template.otherFormes[0]);
}
var movePool = (template.randomBattleMoves ? template.randomBattleMoves.slice() : Object.keys(template.learnset));
var moves = [];
var ability = '';
var item = '';
var evs = {
hp: 85,
atk: 85,
def: 85,
spa: 85,
spd: 85,
spe: 85
};
var ivs = {
hp: 31,
atk: 31,
def: 31,
spa: 31,
spd: 31,
spe: 31
};
var hasType = {};
hasType[template.types[0]] = true;
if (template.types[1]) {
hasType[template.types[1]] = true;
}
var hasAbility = {};
hasAbility[template.abilities[0]] = true;
if (template.abilities[1]) {
hasAbility[template.abilities[1]] = true;
}
if (template.abilities['H']) {
hasAbility[template.abilities['H']] = true;
}
var availableHP = 0;
for (var i = 0, len = movePool.length; i < len; i++) {
if (movePool[i].substr(0, 11) === 'hiddenpower') availableHP++;
}
// Moves that heal a fixed amount:
var RecoveryMove = {
milkdrink: 1, recover: 1, roost: 1, slackoff: 1, softboiled: 1
};
// Moves which drop stats:
var ContraryMove = {
leafstorm: 1, overheat: 1, closecombat: 1, superpower: 1, vcreate: 1
};
// Moves that boost Attack:
var PhysicalSetup = {
bellydrum:1, bulkup:1, coil:1, curse:1, dragondance:1, honeclaws:1, howl:1, poweruppunch:1, shiftgear:1, swordsdance:1
};
// Moves which boost Special Attack:
var SpecialSetup = {
calmmind:1, chargebeam:1, geomancy:1, nastyplot:1, quiverdance:1, tailglow:1
};
// Moves which boost Attack AND Special Attack:
var MixedSetup = {
growth:1, workup:1, shellsmash:1
};
var SpeedSetup = {
autotomize:1, agility:1, rockpolish:1
};
// These moves can be used even if we aren't setting up to use them:
var SetupException = {
dracometeor:1, leafstorm:1, overheat:1,
extremespeed:1, suckerpunch:1, superpower:1
};
var counterAbilities = {
'Adaptability':1, 'Blaze':1, 'Contrary':1, 'Hustle':1, 'Iron Fist':1,
'Overgrow':1, 'Skill Link':1, 'Swarm':1, 'Technician':1, 'Torrent':1
};
var ateAbilities = {
'Aerilate':1, 'Pixilate':1, 'Refrigerate':1
};
var damagingMoves, damagingMoveIndex, hasMove, counter, setupType, hasStab;
do {
// Keep track of all moves we have:
hasMove = {};
for (var k = 0; k < moves.length; k++) {
if (moves[k].substr(0, 11) === 'hiddenpower') {
hasMove['hiddenpower'] = true;
} else {
hasMove[moves[k]] = true;
}
}
// Choose next 4 moves from learnset/viable moves and add them to moves list:
while (moves.length < 4 && movePool.length) {
var moveid = this.sampleNoReplace(movePool);
if (moveid.substr(0, 11) === 'hiddenpower') {
availableHP--;
if (hasMove['hiddenpower']) continue;
hasMove['hiddenpower'] = true;
} else {
hasMove[moveid] = true;
}
moves.push(moveid);
}
damagingMoves = [];
damagingMoveIndex = {};
hasStab = false;
counter = {
Physical: 0, Special: 0, Status: 0, damage: 0, recovery: 0,
blaze: 0, overgrow: 0, swarm: 0, torrent: 0,
adaptability: 0, ate: 0, bite: 0, contrary: 0, hustle: 0,
ironfist: 0, serenegrace: 0, sheerforce: 0, skilllink: 0, technician: 0,
inaccurate: 0, priority: 0, recoil: 0,
physicalsetup: 0, specialsetup: 0, mixedsetup: 0, speedsetup: 0
};
setupType = '';
// Iterate through all moves we've chosen so far and keep track of what they do:
for (var k = 0; k < moves.length; k++) {
var move = this.getMove(moves[k]);
var moveid = move.id;
if (move.damage || move.damageCallback) {
// Moves that do a set amount of damage:
counter['damage']++;
damagingMoves.push(move);
damagingMoveIndex[moveid] = k;
} else {
// Are Physical/Special/Status moves:
counter[move.category]++;
}
// Moves that have a low base power:
if (moveid === 'lowkick' || (move.basePower && move.basePower <= 60 && moveid !== 'rapidspin')) counter['technician']++;
// Moves that hit multiple times:
if (move.multihit && move.multihit[1] === 5) counter['skilllink']++;
// Recoil:
if (move.recoil) counter['recoil']++;
// Moves which have a base power, but aren't super-weak like Rapid Spin:
if (move.basePower > 30 || move.multihit || move.basePowerCallback || moveid === 'naturepower') {
if (hasType[move.type]) {
counter['adaptability']++;
// STAB:
// Certain moves aren't acceptable as a Pokemon's only STAB attack
if (!(moveid in {bounce:1, fakeout:1, flamecharge:1, quickattack:1, skyattack:1})) hasStab = true;
}
if (hasAbility['Protean']) hasStab = true;
if (move.category === 'Physical') counter['hustle']++;
if (move.type === 'Fire') counter['blaze']++;
if (move.type === 'Grass') counter['overgrow']++;
if (move.type === 'Bug') counter['swarm']++;
if (move.type === 'Water') counter['torrent']++;
if (move.type === 'Normal') {
counter['ate']++;
if (hasAbility['Refrigerate'] || hasAbility['Pixilate'] || hasAbility['Aerilate']) hasStab = true;
}
if (move.flags['bite']) counter['bite']++;
if (move.flags['punch']) counter['ironfist']++;
damagingMoves.push(move);
damagingMoveIndex[moveid] = k;
}
// Moves with secondary effects:
if (move.secondary) {
counter['sheerforce']++;
if (move.secondary.chance >= 20) {
counter['serenegrace']++;
}
}
// Moves with low accuracy:
if (move.accuracy && move.accuracy !== true && move.accuracy < 90) counter['inaccurate']++;
// Moves with non-zero priority:
if (move.priority !== 0) counter['priority']++;
// Moves that change stats:
if (RecoveryMove[moveid]) counter['recovery']++;
if (ContraryMove[moveid]) counter['contrary']++;
if (PhysicalSetup[moveid]) counter['physicalsetup']++;
if (SpecialSetup[moveid]) counter['specialsetup']++;
if (MixedSetup[moveid]) counter['mixedsetup']++;
if (SpeedSetup[moveid]) counter['speedsetup']++;
}
// Choose a setup type:
if (counter['mixedsetup']) {
setupType = 'Mixed';
} else if (counter['specialsetup']) {
setupType = 'Special';
} else if (counter['physicalsetup']) {
setupType = 'Physical';
}
// Iterate through the moves again, this time to cull them:
for (var k = 0; k < moves.length; k++) {
var moveid = moves[k];
var move = this.getMove(moveid);
var rejected = false;
var isSetup = false;
switch (moveid) {
// Not very useful without their supporting moves
case 'batonpass':
if (!setupType && !counter['speedsetup'] && !hasMove['cosmicpower'] && !hasMove['substitute'] && !hasMove['wish'] && !hasAbility['Speed Boost']) rejected = true;
break;
case 'focuspunch':
if (!hasMove['substitute'] || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'perishsong':
if (!hasMove['protect']) rejected = true;
break;
case 'sleeptalk':
if (!hasMove['rest']) rejected = true;
break;
case 'storedpower':
if (!setupType && !hasMove['cosmicpower']) rejected = true;
break;
// Set up once and only if we have the moves for it
case 'bellydrum': case 'bulkup': case 'coil': case 'curse': case 'dragondance': case 'honeclaws': case 'swordsdance':
if (setupType !== 'Physical' || counter['physicalsetup'] > 1) rejected = true;
if (counter.Physical < 2 && !hasMove['batonpass'] && (!hasMove['rest'] || !hasMove['sleeptalk'])) rejected = true;
isSetup = true;
break;
case 'calmmind': case 'geomancy': case 'nastyplot': case 'quiverdance': case 'tailglow':
if (setupType !== 'Special' || counter['specialsetup'] > 1) rejected = true;
if (counter.Special < 2 && !hasMove['batonpass'] && (!hasMove['rest'] || !hasMove['sleeptalk'])) rejected = true;
isSetup = true;
break;
case 'growth': case 'shellsmash': case 'workup':
if (setupType !== 'Mixed' || counter['mixedsetup'] > 1) rejected = true;
if (counter.Physical + counter.Special < 2 && !hasMove['batonpass']) rejected = true;
isSetup = true;
break;
case 'agility': case 'autotomize': case 'rockpolish':
if (counter.Physical + counter.Special < 2 && !setupType && !hasMove['batonpass']) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
// Bad after setup
case 'circlethrow': case 'dragontail':
if (!!counter['speedsetup'] || hasMove['encore'] || hasMove['raindance'] || hasMove['roar'] || hasMove['whirlwind']) rejected = true;
if (setupType && hasMove['stormthrow']) rejected = true;
break;
case 'defog': case 'pursuit': case 'haze': case 'healingwish': case 'rapidspin': case 'spikes': case 'stealthrock': case 'waterspout':
if (setupType || !!counter['speedsetup'] || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'fakeout':
if (setupType || hasMove['substitute'] || hasMove['switcheroo'] || hasMove['trick']) rejected = true;
break;
case 'foulplay': case 'nightshade': case 'seismictoss': case 'superfang':
if (setupType) rejected = true;
break;
case 'healbell': case 'trickroom':
if (!!counter['speedsetup']) rejected = true;
break;
case 'memento':
if (setupType || !!counter['recovery'] || hasMove['substitute']) rejected = true;
break;
case 'protect':
if (setupType && (hasAbility['Guts'] || hasAbility['Speed Boost']) && !hasMove['batonpass']) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
case 'switcheroo': case 'trick':
if (setupType || counter.Physical + counter.Special < 2) rejected = true;
if (hasMove['acrobatics'] || hasMove['lightscreen'] || hasMove['reflect'] || hasMove['trickroom'] || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'uturn':
if (setupType || !!counter['speedsetup']) rejected = true;
break;
case 'voltswitch':
if (setupType || !!counter['speedsetup'] || hasMove['magnetrise'] || hasMove['uturn']) rejected = true;
break;
// Bit redundant to have both
// Attacks:
case 'bugbite':
if (hasMove['uturn'] && !setupType) rejected = true;
break;
case 'darkpulse':
if (hasMove['crunch'] && setupType !== 'Special') rejected = true;
break;
case 'suckerpunch':
if ((hasMove['crunch'] || hasMove['darkpulse']) && (hasMove['knockoff'] || hasMove['pursuit'])) rejected = true;
if (!setupType && hasMove['foulplay'] && (hasMove['darkpulse'] || hasMove['pursuit'])) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
case 'dragonclaw':
if (hasMove['outrage'] || hasMove['dragontail']) rejected = true;
break;
case 'dragonpulse': case 'spacialrend':
if (hasMove['dracometeor']) rejected = true;
break;
case 'thunder':
if (hasMove['thunderbolt'] && !hasMove['raindance']) rejected = true;
break;
case 'thunderbolt':
if (hasMove['discharge'] || (hasMove['thunder'] && hasMove['raindance']) || (hasMove['voltswitch'] && hasMove['wildcharge'])) rejected = true;
break;
case 'drainingkiss':
if (hasMove['dazzlinggleam']) rejected = true;
break;
case 'aurasphere': case 'drainpunch':
if (!hasMove['bulkup'] && (hasMove['closecombat'] || hasMove['highjumpkick'])) rejected = true;
if (hasMove['focusblast'] || hasMove['superpower']) rejected = true;
break;
case 'closecombat': case 'highjumpkick':
if (hasMove['bulkup'] && hasMove['drainpunch']) rejected = true;
break;
case 'focusblast':
if ((!setupType && hasMove['superpower']) || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'stormthrow':
if (hasMove['circlethrow'] && (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'superpower':
if (setupType && (hasMove['drainpunch'] || hasMove['focusblast'])) rejected = true;
break;
case 'fierydance': case 'flamethrower':
if (hasMove['fireblast'] || hasMove['overheat']) rejected = true;
break;
case 'fireblast':
if ((hasMove['flareblitz'] || hasMove['lavaplume']) && !setupType && !counter['speedsetup']) rejected = true;
break;
case 'firepunch': case 'sacredfire':
if (hasMove['flareblitz']) rejected = true;
break;
case 'lavaplume':
if (hasMove['fireblast'] && (setupType || !!counter['speedsetup'])) rejected = true;
break;
case 'overheat':
if (hasMove['lavaplume'] || setupType === 'Special') rejected = true;
break;
case 'acrobatics': case 'airslash': case 'oblivionwing':
if (hasMove['bravebird'] || hasMove['hurricane']) rejected = true;
break;
case 'phantomforce': case 'shadowforce': case 'shadowsneak':
if (hasMove['shadowclaw'] || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'shadowclaw':
if (hasMove['shadowball']) rejected = true;
break;
case 'solarbeam':
if ((!hasAbility['Drought'] && !hasMove['sunnyday']) || hasMove['gigadrain'] || hasMove['leafstorm']) rejected = true;
break;
case 'gigadrain':
if ((!setupType && hasMove['leafstorm']) || hasMove['petaldance']) rejected = true;
break;
case 'leafstorm':
if (setupType && hasMove['gigadrain']) rejected = true;
break;
case 'bonemerang': case 'precipiceblades':
if (hasMove['earthquake']) rejected = true;
break;
case 'icebeam':
if (hasMove['blizzard']) rejected = true;
break;
case 'bodyslam':
if (hasMove['glare']) rejected = true;
break;
case 'explosion':
if (setupType || hasMove['wish']) rejected = true;
break;
case 'hypervoice':
if (hasMove['naturepower'] || hasMove['return']) rejected = true;
break;
case 'judgment':
if (hasStab) rejected = true;
break;
case 'return':
if (hasMove['bodyslam'] || hasMove['doubleedge']) rejected = true;
break;
case 'weatherball':
if (!hasMove['raindance'] && !hasMove['sunnyday']) rejected = true;
break;
case 'poisonjab':
if (hasMove['gunkshot']) rejected = true;
break;
case 'psychic':
if (hasMove['psyshock'] || hasMove['storedpower']) rejected = true;
break;
case 'headsmash':
if (hasMove['stoneedge']) rejected = true;
break;
case 'rockblast': case 'rockslide':
if (hasMove['headsmash'] || hasMove['stoneedge']) rejected = true;
break;
case 'flashcannon':
if (hasMove['ironhead']) rejected = true;
break;
case 'hydropump':
if (hasMove['razorshell'] || hasMove['scald'] || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'originpulse': case 'surf':
if (hasMove['hydropump'] || hasMove['scald']) rejected = true;
break;
case 'scald':
if (hasMove['waterfall'] || hasMove['waterpulse']) rejected = true;
break;
// Status:
case 'raindance':
if (hasMove['sunnyday'] || (hasMove['rest'] && hasMove['sleeptalk']) || counter.Physical + counter.Special < 2) rejected = true;
break;
case 'rest':
if (!hasMove['sleeptalk'] && movePool.indexOf('sleeptalk') > -1) rejected = true;
if (hasMove['moonlight'] || hasMove['painsplit'] || hasMove['recover'] || hasMove['synthesis']) rejected = true;
break;
case 'roar':
if (hasMove['dragontail']) rejected = true;
break;
case 'roost': case 'softboiled': case 'synthesis':
if (hasMove['wish']) rejected = true;
break;
case 'substitute':
if (hasMove['dracometeor'] || (hasMove['leafstorm'] && !hasAbility['Contrary']) || hasMove['pursuit'] || hasMove['taunt'] || hasMove['uturn'] || hasMove['voltswitch']) rejected = true;
break;
case 'sunnyday':
if (hasMove['raindance'] || (hasMove['rest'] && hasMove['sleeptalk']) || counter.Physical + counter.Special < 2) rejected = true;
break;
case 'stunspore': case 'thunderwave':
if (setupType || !!counter['speedsetup']) rejected = true;
if (hasMove['discharge'] || hasMove['gyroball'] || hasMove['sleeppowder'] || hasMove['spore'] || hasMove['trickroom'] || hasMove['yawn']) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
case 'toxic':
if (hasMove['hypnosis'] || hasMove['sleeppowder'] || hasMove['stunspore'] || hasMove['thunderwave'] || hasMove['willowisp'] || hasMove['yawn']) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
case 'willowisp':
if (hasMove['lavaplume'] || hasMove['sacredfire'] || hasMove['scald'] || hasMove['spore']) rejected = true;
break;
}
// Increased/decreased priority moves unneeded with moves that boost only speed
if (move.priority !== 0 && !!counter['speedsetup']) {
rejected = true;
}
if (move.category === 'Special' && setupType === 'Physical' && !SetupException[move.id]) {
rejected = true;
}
if (move.category === 'Physical' && (setupType === 'Special' || hasMove['acidspray']) && !SetupException[move.id]) {
rejected = true;
}
// This move doesn't satisfy our setup requirements:
if (setupType && setupType !== 'Mixed' && move.category !== setupType && counter[setupType] < 2) {
// Mono-attacking with setup and RestTalk is allowed
if (!isSetup && moveid !== 'rest' && moveid !== 'sleeptalk') rejected = true;
}
// Hidden Power isn't good enough
if (setupType === 'Special' && move.id === 'hiddenpower' && counter['Special'] <= 2 && (!hasMove['shadowball'] || move.type !== 'Fighting')) {
rejected = true;
}
// Remove rejected moves from the move list
if (rejected && (movePool.length - availableHP || availableHP && (move.id === 'hiddenpower' || !hasMove['hiddenpower']))) {
moves.splice(k, 1);
break;
}
// Handle Hidden Power IVs
if (move.id === 'hiddenpower') {
var HPivs = this.getType(move.type).HPivs;
for (var iv in HPivs) {
ivs[iv] = HPivs[iv];
}
}
}
if (movePool.length && moves.length === 4 && !hasMove['judgment']) {
// Move post-processing:
if (damagingMoves.length === 0) {
// A set shouldn't have no attacking moves
moves.splice(this.random(moves.length), 1);
} else if (damagingMoves.length === 1) {
var damagingid = damagingMoves[0].id;
// Night Shade, Seismic Toss, etc. don't count:
if (!damagingMoves[0].damage && (movePool.length - availableHP || availableHP && (damagingid === 'hiddenpower' || !hasMove['hiddenpower']))) {
var replace = false;
if (damagingid in {counter:1, focuspunch:1, mirrorcoat:1, suckerpunch:1} || (damagingid === 'hiddenpower' && !hasStab)) {
// Unacceptable as the only attacking move
replace = true;
} else {
if (!hasStab) {
var damagingType = damagingMoves[0].type;
if (damagingType === 'Fairy') {
// Mono-Fairy is acceptable for Psychic types
if (!hasType['Psychic']) replace = true;
} else if (damagingType === 'Ice') {
if (hasType['Normal'] && template.types.length === 1) {
// Mono-Ice is acceptable for special attacking Normal types that lack Boomburst and Hyper Voice
if (counter.Physical >= 2 || movePool.indexOf('boomburst') > -1 || movePool.indexOf('hypervoice') > -1) replace = true;
} else {
replace = true;
}
} else {
replace = true;
}
}
}
if (replace) moves.splice(damagingMoveIndex[damagingid], 1);
}
} else if (damagingMoves.length === 2) {
// If you have two attacks, neither is STAB, and the combo isn't Electric/Ice or Fighting/Ghost, reject one of them at random.
var type1 = damagingMoves[0].type, type2 = damagingMoves[1].type;
var typeCombo = [type1, type2].sort().join('/');
if (!hasStab && typeCombo !== 'Electric/Ice' && typeCombo !== 'Fighting/Ghost') {
var rejectableMoves = [];
var baseDiff = movePool.length - availableHP;
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[0].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[0].id]);
}
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[1].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[1].id]);
}
if (rejectableMoves.length) {
moves.splice(rejectableMoves[this.random(rejectableMoves.length)], 1);
}
}
} else if (!hasStab) {
// If you have three or more attacks, and none of them are STAB, reject one of them at random.
var rejectableMoves = [];
var baseDiff = movePool.length - availableHP;
for (var l = 0; l < damagingMoves.length; l++) {
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[l].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[l].id]);
}
}
if (rejectableMoves.length) {
moves.splice(rejectableMoves[this.random(rejectableMoves.length)], 1);
}
}
}
} while (moves.length < 4 && movePool.length);
// Any moveset modification goes here:
// moves[0] = 'safeguard';
if (template.requiredItem && template.requiredItem.slice(-5) === 'Drive' && !hasMove['technoblast']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'technoblast';
hasMove['technoblast'] = true;
}
if (template.id === 'altariamega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'return';
hasMove['return'] = true;
}
if (template.id === 'gardevoirmega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'hypervoice';
hasMove['hypervoice'] = true;
}
if (template.id === 'salamencemega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'return';
hasMove['return'] = true;
}
if (template.id === 'sylveon' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'hypervoice';
hasMove['hypervoice'] = true;
}
if (template.requiredMove && !hasMove[toId(template.requiredMove)]) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = toId(template.requiredMove);
hasMove[toId(template.requiredMove)] = true;
}
// If Hidden Power has been removed, reset the IVs
if (!hasMove['hiddenpower']) {
ivs = {
hp: 31,
atk: 31,
def: 31,
spa: 31,
spd: 31,
spe: 31
};
}
var abilities = Object.values(baseTemplate.abilities).sort(function (a, b) {
return this.getAbility(b).rating - this.getAbility(a).rating;
}.bind(this));
var ability0 = this.getAbility(abilities[0]);
var ability1 = this.getAbility(abilities[1]);
var ability2 = this.getAbility(abilities[2]);
var ability = ability0.name;
if (abilities[1]) {
if (abilities[2] && ability2.rating === ability1.rating) {
if (this.random(2)) ability1 = ability2;
}
if (ability0.rating <= ability1.rating) {
if (this.random(2)) ability = ability1.name;
} else if (ability0.rating - 0.6 <= ability1.rating) {
if (!this.random(3)) ability = ability1.name;
}
var rejectAbility = false;
if (ability in counterAbilities) {
// Adaptability, Blaze, Contrary, Hustle, Iron Fist, Overgrow, Skill Link, Swarm, Technician, Torrent
rejectAbility = !counter[toId(ability)];
} else if (ability in ateAbilities) {
rejectAbility = !counter['ate'];
} else if (ability === 'Chlorophyll') {
rejectAbility = !hasMove['sunnyday'];
} else if (ability === 'Compound Eyes' || ability === 'No Guard') {
rejectAbility = !counter['inaccurate'];
} else if (ability === 'Defiant' || ability === 'Moxie') {
rejectAbility = !counter['Physical'] && !hasMove['batonpass'];
} else if (ability === 'Gluttony') {
rejectAbility = true;
} else if (ability === 'Limber') {
rejectAbility = template.types.indexOf('Electric') >= 0;
} else if (ability === 'Lightning Rod') {
rejectAbility = template.types.indexOf('Ground') >= 0;
} else if (ability === 'Moody') {
rejectAbility = template.id !== 'bidoof';
} else if (ability === 'Poison Heal') {
rejectAbility = abilities.indexOf('Technician') > -1 && !!counter['technician'];
} else if (ability === 'Prankster') {
rejectAbility = !counter['Status'];
} else if (ability === 'Reckless' || ability === 'Rock Head') {
rejectAbility = !counter['recoil'];
} else if (ability === 'Serene Grace') {
rejectAbility = !counter['serenegrace'] || template.id === 'chansey' || template.id === 'blissey';
} else if (ability === 'Sheer Force') {
rejectAbility = !counter['sheerforce'];
} else if (ability === 'Simple') {
rejectAbility = !setupType && !hasMove['cosmicpower'] && !hasMove['flamecharge'];
} else if (ability === 'Strong Jaw') {
rejectAbility = !counter['bite'];
} else if (ability === 'Sturdy') {
rejectAbility = !!counter['recoil'] && !counter['recovery'];
} else if (ability === 'Swift Swim') {
rejectAbility = !hasMove['raindance'];
} else if (ability === 'Unburden') {
rejectAbility = template.baseStats.spe > 120;
}
if (rejectAbility) {
if (ability === ability1.name) { // or not
ability = ability0.name;
} else if (ability1.rating > 1) { // only switch if the alternative doesn't suck
ability = ability1.name;
}
}
if (abilities.indexOf('Chlorophyll') > -1 && ability !== 'Solar Power' && hasMove['sunnyday']) {
ability = 'Chlorophyll';
}
if (abilities.indexOf('Guts') > -1 && ability !== 'Quick Feet' && hasMove['facade']) {
ability = 'Guts';
}
if (abilities.indexOf('Swift Swim') > -1 && hasMove['raindance']) {
ability = 'Swift Swim';
}
if (abilities.indexOf('Unburden') > -1 && hasMove['acrobatics']) {
ability = 'Unburden';
}
if (template.id === 'combee') {
// Combee always gets Hustle but its only physical move is Endeavor, which loses accuracy
ability = 'Honey Gather';
} else if (template.id === 'lopunny' && hasMove['switcheroo'] && this.random(3)) {
ability = 'Klutz';
} else if (template.id === 'mawilemega') {
// Mega Mawile only needs Intimidate for a starting ability
ability = 'Intimidate';
} else if (template.id === 'sigilyph') {
ability = 'Magic Guard';
} else if (template.id === 'unfezant') {
ability = 'Super Luck';
}
}
if (hasMove['gyroball']) {
ivs.spe = 0;
evs.atk += evs.spe;
evs.spe = 0;
} else if (hasMove['trickroom']) {
ivs.spe = 0;
evs.hp += evs.spe;
evs.spe = 0;
}
item = 'Leftovers';
if (template.requiredItem) {
item = template.requiredItem;
} else if (hasMove['magikarpsrevenge']) {
// PoTD Magikarp
item = 'Choice Band';
} else if (template.species === 'Rotom-Fan') {
// This is just to amuse Zarel
item = 'Air Balloon';
// First, the extra high-priority items
} else if (template.species === 'Clamperl' && !hasMove['shellsmash']) {
item = 'DeepSeaTooth';
} else if (template.species === 'Cubone' || template.species === 'Marowak') {
item = 'Thick Club';
} else if (template.species === 'Dedenne') {
item = 'Petaya Berry';
} else if (template.species === 'Deoxys-Attack') {
item = (slot === 0 && hasMove['stealthrock']) ? 'Focus Sash' : 'Life Orb';
} else if (template.species === 'Farfetch\'d') {
item = 'Stick';
} else if (template.baseSpecies === 'Pikachu') {
item = 'Light Ball';
} else if (template.species === 'Shedinja') {
item = 'Focus Sash';
} else if (template.species === 'Unfezant' && counter['Physical'] >= 2) {
item = 'Scope Lens';
} else if (template.species === 'Unown') {
item = 'Choice Specs';
} else if (ability === 'Imposter') {
item = 'Choice Scarf';
} else if (ability === 'Klutz' && hasMove['switcheroo']) {
// To perma-taunt a Pokemon by giving it Assault Vest
item = 'Assault Vest';
} else if (hasMove['geomancy']) {
item = 'Power Herb';
} else if (ability === 'Magic Guard' && hasMove['psychoshift']) {
item = 'Flame Orb';
} else if (hasMove['switcheroo'] || hasMove['trick']) {
var randomNum = this.random(2);
if (counter.Physical >= 3 && (template.baseStats.spe >= 95 || randomNum)) {
item = 'Choice Band';
} else if (counter.Special >= 3 && (template.baseStats.spe >= 95 || randomNum)) {
item = 'Choice Specs';
} else {
item = 'Choice Scarf';
}
} else if (template.evos.length) {
item = 'Eviolite';
} else if (hasMove['shellsmash']) {
item = 'White Herb';
} else if (ability === 'Magic Guard' || ability === 'Sheer Force') {
item = 'Life Orb';
} else if (hasMove['bellydrum']) {
item = 'Sitrus Berry';
} else if (ability === 'Poison Heal' || ability === 'Toxic Boost' || hasMove['facade']) {
item = 'Toxic Orb';
} else if (ability === 'Harvest') {
item = hasMove['rest'] ? 'Lum Berry' : 'Sitrus Berry';
} else if (hasMove['rest'] && !hasMove['sleeptalk'] && ability !== 'Natural Cure' && ability !== 'Shed Skin') {
item = (hasMove['raindance'] && ability === 'Hydration') ? 'Damp Rock' : 'Chesto Berry';
} else if (hasMove['raindance']) {
item = 'Damp Rock';
} else if (hasMove['sandstorm']) {
item = 'Smooth Rock';
} else if (hasMove['sunnyday']) {
item = 'Heat Rock';
} else if (hasMove['lightscreen'] && hasMove['reflect']) {
item = 'Light Clay';
} else if (hasMove['acrobatics']) {
item = 'Flying Gem';
} else if (ability === 'Unburden') {
if (hasMove['fakeout']) {
item = 'Normal Gem';
} else if (hasMove['dracometeor'] || hasMove['leafstorm'] || hasMove['overheat']) {
item = 'White Herb';
} else if (hasMove['substitute'] || setupType) {
item = 'Sitrus Berry';
} else {
item = 'Red Card';
for (var m in moves) {
var move = this.getMove(moves[m]);
if (hasType[move.type] && move.basePower >= 90) {
item = move.type + ' Gem';
break;
}
}
}
// Medium priority
} else if (ability === 'Guts') {
item = hasMove['drainpunch'] ? 'Flame Orb' : 'Toxic Orb';
} else if (counter.Physical >= 4 && !hasMove['fakeout'] && !hasMove['flamecharge'] && !hasMove['rapidspin'] && !hasMove['suckerpunch']) {
item = template.baseStats.spe > 82 && template.baseStats.spe < 109 && !counter['priority'] && this.random(3) ? 'Choice Scarf' : 'Choice Band';
} else if (counter.Special >= 4 && !hasMove['acidspray'] && !hasMove['chargebeam'] && !hasMove['fierydance']) {
item = template.baseStats.spe > 82 && template.baseStats.spe < 109 && !counter['priority'] && this.random(3) ? 'Choice Scarf' : 'Choice Specs';
} else if (hasMove['eruption'] || hasMove['waterspout']) {
item = counter.Status <= 1 ? 'Expert Belt' : 'Leftovers';
} else if ((hasMove['endeavor'] || hasMove['flail'] || hasMove['reversal']) && ability !== 'Sturdy') {
item = 'Focus Sash';
} else if (this.getEffectiveness('Ground', template) >= 2 && ability !== 'Levitate' && !hasMove['magnetrise']) {
item = 'Air Balloon';
} else if (ability === 'Speed Boost' && hasMove['protect'] && counter.Physical + counter.Special > 2) {
item = 'Life Orb';
} else if (hasMove['outrage'] && (setupType || ability === 'Multiscale')) {
item = 'Lum Berry';
} else if (ability === 'Moody' || hasMove['clearsmog'] || hasMove['detect'] || hasMove['protect'] || hasMove['substitute']) {
item = 'Leftovers';
} else if (hasMove['lightscreen'] || hasMove['reflect']) {
item = 'Light Clay';
} else if (ability === 'Iron Barbs' || ability === 'Rough Skin') {
item = 'Rocky Helmet';
} else if (counter.Physical + counter.Special >= 4 && (template.baseStats.def + template.baseStats.spd > 189 || hasMove['rapidspin'])) {
item = 'Assault Vest';
} else if (counter.Physical + counter.Special >= 4) {
item = (!!counter['ate'] || (hasMove['suckerpunch'] && !hasType['Dark'])) ? 'Life Orb' : 'Expert Belt';
} else if (counter.Physical + counter.Special >= 3 && !!counter['speedsetup'] && template.baseStats.hp + template.baseStats.def + template.baseStats.spd >= 300) {
item = 'Weakness Policy';
} else if ((counter.Physical + counter.Special >= 3) && ability !== 'Sturdy' && !hasMove['dragontail']) {
item = (setupType || !!counter['speedsetup'] || hasMove['trickroom'] || !!counter['recovery']) ? 'Life Orb' : 'Leftovers';
} else if (template.species === 'Palkia' && (hasMove['dracometeor'] || hasMove['spacialrend']) && hasMove['hydropump']) {
item = 'Lustrous Orb';
} else if (slot === 0 && ability !== 'Regenerator' && ability !== 'Sturdy' && !counter['recoil'] && template.baseStats.hp + template.baseStats.def + template.baseStats.spd < 285) {
item = 'Focus Sash';
// This is the "REALLY can't think of a good item" cutoff
} else if (ability === 'Super Luck') {
item = 'Scope Lens';
} else if (ability === 'Sturdy' && hasMove['explosion'] && !counter['speedsetup']) {
item = 'Custap Berry';
} else if (hasType['Poison']) {
item = 'Black Sludge';
} else if (this.getEffectiveness('Rock', template) >= 1 || hasMove['dragontail']) {
item = 'Leftovers';
} else if (this.getImmunity('Ground', template) && this.getEffectiveness('Ground', template) >= 1 && ability !== 'Levitate' && ability !== 'Solid Rock' && !hasMove['magnetrise']) {
item = 'Air Balloon';
} else if (counter.Status <= 1 && ability !== 'Sturdy') {
item = 'Life Orb';
} else {
item = 'Leftovers';
}
// For Trick / Switcheroo
if (item === 'Leftovers' && hasType['Poison']) {
item = 'Black Sludge';
}
var levelScale = {
LC: 92,
'LC Uber': 92,
NFE: 90,
PU: 88,
BL4: 88,
NU: 86,
BL3: 84,
RU: 82,
BL2: 80,
UU: 78,
BL: 76,
OU: 74,
CAP: 74,
Unreleased: 74,
Uber: 70,
AG: 68
};
var customScale = {
// Between OU and Uber
Aegislash: 72, Blaziken: 72, Genesect: 72, 'Genesect-Burn': 72, 'Genesect-Chill': 72, 'Genesect-Douse': 72, 'Genesect-Shock': 72, Greninja: 72, 'Kangaskhan-Mega': 72, 'Lucario-Mega': 72, 'Mawile-Mega': 72,
// Not holding mega stone
Altaria: 84, Banette: 86, Beedrill: 86, Charizard: 84, Gardevoir: 80, Heracross: 78, Lopunny: 86, Manectric: 78, Metagross: 78, Pinsir: 84, Sableye: 78, Venusaur: 80,
// Holistic judgment
Articuno: 82, Ninetales: 84, Politoed: 84, Regigigas: 86, "Rotom-Fan": 88, Scyther: 84, Sigilyph: 80, Unown: 90
};
var level = levelScale[template.tier] || 90;
if (customScale[template.name]) level = customScale[template.name];
if (template.name === 'Magikarp' && hasMove['magikarpsrevenge']) level = 90;
if (template.name === 'Xerneas' && hasMove['geomancy']) level = 68;
// Prepare HP for Belly Drum.
if (hasMove['bellydrum'] && item === 'Sitrus Berry') {
var hp = Math.floor(Math.floor(2 * template.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);
if (hp % 2 > 0) {
evs.hp -= 4;
evs.atk += 4;
}
} else {
// Prepare HP for double Stealth Rock weaknesses. Those are mutually exclusive with Belly Drum HP check.
// First, 25% damage.
if (this.getEffectiveness('Rock', template) === 1) {
var hp = Math.floor(Math.floor(2 * template.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);
if (hp % 4 === 0) {
evs.hp -= 4;
if (counter.Physical > counter.Special) {
evs.atk += 4;
} else {
evs.spa += 4;
}
}
}
// Then, prepare it for 50% damage.
if (this.getEffectiveness('Rock', template) === 2) {
var hp = Math.floor(Math.floor(2 * template.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10);
if (hp % 2 === 0) {
evs.hp -= 4;
if (counter.Physical > counter.Special) {
evs.atk += 4;
} else {
evs.spa += 4;
}
}
}
}
return {
name: name,
moves: moves,
ability: ability,
evs: evs,
ivs: ivs,
item: item,
level: level,
shiny: !this.random(1024)
};
},
randomTeam: function (side) {
var pokemonLeft = 0;
var pokemon = [];
var excludedTiers = {'LC':1, 'LC Uber':1, 'NFE':1};
var allowedNFE = {'Chansey':1, 'Doublade':1, 'Pikachu':1, 'Porygon2':1, 'Scyther':1};
var pokemonPool = [];
for (var id in this.data.FormatsData) {
var template = this.getTemplate(id);
if (!excludedTiers[template.tier] && !template.isMega && !template.isPrimal && !template.isNonstandard && template.randomBattleMoves) {
pokemonPool.push(id);
}
}
// PotD stuff
var potd;
if (Config.potd && 'Rule:potd' in this.getBanlistTable(this.getFormat())) {
potd = this.getTemplate(Config.potd);
}
var typeCount = {};
var typeComboCount = {};
var baseFormes = {};
var uberCount = 0;
var puCount = 0;
var megaCount = 0;
while (pokemonPool.length && pokemonLeft < 6) {
var template = this.getTemplate(this.sampleNoReplace(pokemonPool));
if (!template.exists) continue;
// Limit to one of each species (Species Clause)
if (baseFormes[template.baseSpecies]) continue;
// Not available on ORAS
if (template.species === 'Pichu-Spiky-eared') continue;
// Only certain NFE Pokemon are allowed
if (template.evos.length && !allowedNFE[template.species]) continue;
var tier = template.tier;
switch (tier) {
case 'PU':
// PUs are limited to 2 but have a 20% chance of being added anyway.
if (puCount > 1 && this.random(5) >= 1) continue;
break;
case 'Uber':
// Ubers are limited to 2 but have a 20% chance of being added anyway.
if (uberCount > 1 && this.random(5) >= 1) continue;
break;
case 'CAP':
// CAPs have 20% the normal rate
if (this.random(5) >= 1) continue;
break;
case 'Unreleased':
// Unreleased Pokémon have 20% the normal rate
if (this.random(5) >= 1) continue;
}
// Adjust rate for species with multiple formes
switch (template.baseSpecies) {
case 'Arceus':
if (this.random(18) >= 1) continue;
break;
case 'Basculin':
if (this.random(2) >= 1) continue;
break;
case 'Genesect':
if (this.random(5) >= 1) continue;
break;
case 'Gourgeist':
if (this.random(4) >= 1) continue;
break;
case 'Meloetta':
if (this.random(2) >= 1) continue;
break;
case 'Pikachu':
// Cosplay Pikachu formes have 20% the normal rate (1/30 the normal rate each)
if (template.species !== 'Pikachu' && this.random(30) >= 1) continue;
}
// Limit 2 of any type
var types = template.types;
var skip = false;
for (var t = 0; t < types.length; t++) {
if (typeCount[types[t]] > 1 && this.random(5) >= 1) {
skip = true;
break;
}
}
if (skip) continue;
if (potd && potd.exists) {
// The Pokemon of the Day belongs in slot 2
if (pokemon.length === 1) {
template = potd;
if (template.species === 'Magikarp') {
template.randomBattleMoves = ['bounce', 'flail', 'splash', 'magikarpsrevenge'];
} else if (template.species === 'Delibird') {
template.randomBattleMoves = ['present', 'bestow'];
}
} else if (template.species === potd.species) {
continue; // No, thanks, I've already got one
}
}
var set = this.randomSet(template, pokemon.length, megaCount);
// Illusion shouldn't be on the last pokemon of the team
if (set.ability === 'Illusion' && pokemonLeft > 4) continue;
// Limit 1 of any type combination
var typeCombo = types.join();
if (set.ability === 'Drought' || set.ability === 'Drizzle') {
// Drought and Drizzle don't count towards the type combo limit
typeCombo = set.ability;
}
if (typeCombo in typeComboCount) continue;
// Limit the number of Megas to one
var forme = template.otherFormes && this.getTemplate(template.otherFormes[0]);
var isMegaSet = this.getItem(set.item).megaStone || (forme && forme.isMega && forme.requiredMove && set.moves.indexOf(toId(forme.requiredMove)) >= 0);
if (isMegaSet && megaCount > 0) continue;
// Okay, the set passes, add it to our team
pokemon.push(set);
// Now that our Pokemon has passed all checks, we can increment our counters
pokemonLeft++;
// Increment type counters
for (var t = 0; t < types.length; t++) {
if (types[t] in typeCount) {
typeCount[types[t]]++;
} else {
typeCount[types[t]] = 1;
}
}
typeComboCount[typeCombo] = 1;
// Increment Uber/NU counters
if (tier === 'Uber') {
uberCount++;
} else if (tier === 'PU') {
puCount++;
}
// Increment mega and base species counters
if (isMegaSet) megaCount++;
baseFormes[template.baseSpecies] = 1;
}
return pokemon;
},
randomDoublesTeam: function (side) {
var pokemonLeft = 0;
var pokemon = [];
var excludedTiers = {'LC':1, 'LC Uber':1, 'NFE':1};
var allowedNFE = {'Chansey':1, 'Doublade':1, 'Pikachu':1, 'Porygon2':1, 'Scyther':1};
var pokemonPool = [];
for (var id in this.data.FormatsData) {
var template = this.getTemplate(id);
if (!excludedTiers[template.tier] && !template.isMega && !template.isPrimal && !template.isNonstandard && template.randomBattleMoves) {
pokemonPool.push(id);
}
}
// PotD stuff
var potd;
if (Config.potd && 'Rule:potd' in this.getBanlistTable(this.getFormat())) {
potd = this.getTemplate(Config.potd);
}
var typeCount = {};
var typeComboCount = {};
var baseFormes = {};
var uberCount = 0;
var puCount = 0;
var megaCount = 0;
while (pokemonPool.length && pokemonLeft < 6) {
var template = this.getTemplate(this.sampleNoReplace(pokemonPool));
if (!template.exists) continue;
// Limit to one of each species (Species Clause)
if (baseFormes[template.baseSpecies]) continue;
// Not available on ORAS
if (template.species === 'Pichu-Spiky-eared') continue;
// Only certain NFE Pokemon are allowed
if (template.evos.length && !allowedNFE[template.species]) continue;
var tier = template.tier;
switch (tier) {
case 'CAP':
// CAPs have 20% the normal rate
if (this.random(5) >= 1) continue;
break;
case 'Unreleased':
// Unreleased Pokémon have 20% the normal rate
if (this.random(5) >= 1) continue;
}
// Adjust rate for species with multiple formes
switch (template.baseSpecies) {
case 'Arceus':
if (this.random(18) >= 1) continue;
break;
case 'Basculin':
if (this.random(2) >= 1) continue;
break;
case 'Genesect':
if (this.random(5) >= 1) continue;
break;
case 'Gourgeist':
if (this.random(4) >= 1) continue;
break;
case 'Meloetta':
if (this.random(2) >= 1) continue;
break;
case 'Pikachu':
// Cosplay Pikachu formes have 20% the normal rate (1/30 the normal rate each)
if (template.species !== 'Pikachu' && this.random(30) >= 1) continue;
}
// Limit 2 of any type
var types = template.types;
var skip = false;
for (var t = 0; t < types.length; t++) {
if (typeCount[types[t]] > 1 && this.random(5) >= 1) {
skip = true;
break;
}
}
if (skip) continue;
if (potd && potd.exists) {
// The Pokemon of the Day belongs in slot 3
if (pokemon.length === 2) {
template = potd;
} else if (template.species === potd.species) {
continue; // No, thanks, I've already got one
}
}
var set = this.randomDoublesSet(template, pokemon.length, megaCount);
// Illusion shouldn't be on the last pokemon of the team
if (set.ability === 'Illusion' && pokemonLeft > 4) continue;
// Limit 1 of any type combination
var typeCombo = types.join();
if (set.ability === 'Drought' || set.ability === 'Drizzle') {
// Drought and Drizzle don't count towards the type combo limit
typeCombo = set.ability;
}
if (typeCombo in typeComboCount) continue;
// Limit the number of Megas to one
var forme = template.otherFormes && this.getTemplate(template.otherFormes[0]);
var isMegaSet = this.getItem(set.item).megaStone || (forme && forme.isMega && forme.requiredMove && set.moves.indexOf(toId(forme.requiredMove)) >= 0);
if (isMegaSet && megaCount > 0) continue;
// Okay, the set passes, add it to our team
pokemon.push(set);
// Now that our Pokemon has passed all checks, we can increment our counters
pokemonLeft++;
// Increment type counters
for (var t = 0; t < types.length; t++) {
if (types[t] in typeCount) {
typeCount[types[t]]++;
} else {
typeCount[types[t]] = 1;
}
}
typeComboCount[typeCombo] = 1;
// Increment Uber/NU counters
if (tier === 'Uber') {
uberCount++;
} else if (tier === 'PU') {
puCount++;
}
// Increment mega and base species counters
if (isMegaSet) megaCount++;
baseFormes[template.baseSpecies] = 1;
}
return pokemon;
},
randomDoublesSet: function (template, slot, noMega) {
var baseTemplate = (template = this.getTemplate(template));
var name = template.name;
if (!template.exists || (!template.randomDoubleBattleMoves && !template.randomBattleMoves && !template.learnset)) {
template = this.getTemplate('unown');
var stack = 'Template incompatible with random battles: ' + name;
var fakeErr = {stack: stack};
require('../crashlogger.js')(fakeErr, 'The doubles randbat set generator');
}
// Decide if the Pokemon can mega evolve early, so viable moves for the mega can be generated
if (!noMega && this.hasMegaEvo(template)) {
// If there's more than one mega evolution, randomly pick one
template = this.getTemplate(template.otherFormes[this.random(template.otherFormes.length)]);
}
if (template.otherFormes && this.getTemplate(template.otherFormes[0]).isPrimal && this.random(2)) {
template = this.getTemplate(template.otherFormes[0]);
}
var movePool = (template.randomDoubleBattleMoves || template.randomBattleMoves);
movePool = movePool ? movePool.slice() : Object.keys(template.learnset);
var moves = [];
var ability = '';
var item = '';
var evs = {
hp: 0,
atk: 0,
def: 0,
spa: 0,
spd: 0,
spe: 0
};
var ivs = {
hp: 31,
atk: 31,
def: 31,
spa: 31,
spd: 31,
spe: 31
};
var hasType = {};
hasType[template.types[0]] = true;
if (template.types[1]) {
hasType[template.types[1]] = true;
}
var hasAbility = {};
hasAbility[template.abilities[0]] = true;
if (template.abilities[1]) {
hasAbility[template.abilities[1]] = true;
}
if (template.abilities['H']) {
hasAbility[template.abilities['H']] = true;
}
var availableHP = 0;
for (var i = 0, len = movePool.length; i < len; i++) {
if (movePool[i].substr(0, 11) === 'hiddenpower') availableHP++;
}
// Moves which drop stats:
var ContraryMove = {
leafstorm: 1, overheat: 1, closecombat: 1, superpower: 1, vcreate: 1
};
// Moves that boost Attack:
var PhysicalSetup = {
swordsdance:1, dragondance:1, coil:1, bulkup:1, curse:1, bellydrum:1, shiftgear:1, honeclaws:1, howl:1
};
// Moves which boost Special Attack:
var SpecialSetup = {
nastyplot:1, tailglow:1, quiverdance:1, calmmind:1, chargebeam:1, geomancy:1
};
// Moves which boost Attack AND Special Attack:
var MixedSetup = {
growth:1, workup:1, shellsmash:1
};
// These moves can be used even if we aren't setting up to use them:
var SetupException = {
dracometeor:1, leafstorm:1, overheat:1,
extremespeed:1, suckerpunch:1, superpower:1
};
var counterAbilities = {
'Blaze':1, 'Overgrow':1, 'Swarm':1, 'Torrent':1, 'Contrary':1,
'Technician':1, 'Skill Link':1, 'Iron Fist':1, 'Adaptability':1, 'Hustle':1
};
// -ate Abilities
var ateAbilities = {
'Aerilate':1, 'Pixilate':1, 'Refrigerate':1
};
var damagingMoves, damagingMoveIndex, hasMove, counter, setupType, hasStab;
do {
// Keep track of all moves we have:
hasMove = {};
for (var k = 0; k < moves.length; k++) {
if (moves[k].substr(0, 11) === 'hiddenpower') {
hasMove['hiddenpower'] = true;
} else {
hasMove[moves[k]] = true;
}
}
// Choose next 4 moves from learnset/viable moves and add them to moves list:
while (moves.length < 4 && movePool.length) {
var moveid = toId(this.sampleNoReplace(movePool));
if (moveid.substr(0, 11) === 'hiddenpower') {
availableHP--;
if (hasMove['hiddenpower']) continue;
hasMove['hiddenpower'] = true;
} else {
hasMove[moveid] = true;
}
moves.push(moveid);
}
damagingMoves = [];
damagingMoveIndex = {};
hasStab = false;
counter = {
Physical: 0, Special: 0, Status: 0, damage: 0,
technician: 0, skilllink: 0, contrary: 0, sheerforce: 0, ironfist: 0, adaptability: 0, hustle: 0,
blaze: 0, overgrow: 0, swarm: 0, torrent: 0, serenegrace: 0, ate: 0, bite: 0,
recoil: 0, inaccurate: 0,
physicalsetup: 0, specialsetup: 0, mixedsetup: 0
};
setupType = '';
// Iterate through all moves we've chosen so far and keep track of what they do:
for (var k = 0; k < moves.length; k++) {
var move = this.getMove(moves[k]);
var moveid = move.id;
if (move.damage || move.damageCallback) {
// Moves that do a set amount of damage:
counter['damage']++;
damagingMoves.push(move);
damagingMoveIndex[moveid] = k;
} else {
// Are Physical/Special/Status moves:
counter[move.category]++;
}
// Moves that have a low base power:
if (moveid === 'lowkick' || (move.basePower && move.basePower <= 60 && moveid !== 'rapidspin')) counter['technician']++;
// Moves that hit multiple times:
if (move.multihit && move.multihit[1] === 5) counter['skilllink']++;
// Recoil:
if (move.recoil) counter['recoil']++;
// Moves which have a base power and aren't super-weak like Rapid Spin:
if (move.basePower > 30 || move.multihit || move.basePowerCallback || moveid === 'naturepower') {
if (hasType[move.type]) {
counter['adaptability']++;
// STAB:
// Bounce, Flame Charge, Sky Drop aren't considered STABs.
// If they're in the Pokémon's movepool and are STAB, consider the Pokémon not to have that type as a STAB.
if (moveid !== 'bounce' && moveid !== 'flamecharge' && moveid !== 'skydrop') hasStab = true;
}
if (hasAbility['Protean']) hasStab = true;
if (move.category === 'Physical') counter['hustle']++;
if (move.type === 'Fire') counter['blaze']++;
if (move.type === 'Grass') counter['overgrow']++;
if (move.type === 'Bug') counter['swarm']++;
if (move.type === 'Water') counter['torrent']++;
if (move.type === 'Normal') {
counter['ate']++;
if (hasAbility['Refrigerate'] || hasAbility['Pixilate'] || hasAbility['Aerilate']) hasStab = true;
}
if (move.flags['punch']) counter['ironfist']++;
if (move.flags['bite']) counter['bite']++;
damagingMoves.push(move);
damagingMoveIndex[moveid] = k;
}
// Moves with secondary effects:
if (move.secondary) {
counter['sheerforce']++;
if (move.secondary.chance >= 20) {
counter['serenegrace']++;
}
}
// Moves with low accuracy:
if (move.accuracy && move.accuracy !== true && move.accuracy < 90) {
counter['inaccurate']++;
}
if (ContraryMove[moveid]) counter['contrary']++;
if (PhysicalSetup[moveid]) counter['physicalsetup']++;
if (SpecialSetup[moveid]) counter['specialsetup']++;
if (MixedSetup[moveid]) counter['mixedsetup']++;
}
// Choose a setup type:
if (counter['mixedsetup']) {
setupType = 'Mixed';
} else if (counter['specialsetup']) {
setupType = 'Special';
} else if (counter['physicalsetup']) {
setupType = 'Physical';
}
// Iterate through the moves again, this time to cull them:
for (var k = 0; k < moves.length; k++) {
var moveid = moves[k];
var move = this.getMove(moveid);
var rejected = false;
var isSetup = false;
switch (moveid) {
// not very useful without their supporting moves
case 'sleeptalk':
if (!hasMove['rest']) rejected = true;
break;
case 'endure':
if (!hasMove['flail'] && !hasMove['endeavor'] && !hasMove['reversal']) rejected = true;
break;
case 'focuspunch':
if (hasMove['sleeptalk'] || !hasMove['substitute']) rejected = true;
break;
case 'storedpower':
if (!hasMove['cosmicpower'] && !setupType) rejected = true;
break;
case 'batonpass':
if (!setupType && !hasMove['substitute'] && !hasMove['cosmicpower'] && !counter['speedsetup'] && !hasAbility['Speed Boost']) rejected = true;
break;
// we only need to set up once
case 'swordsdance': case 'dragondance': case 'coil': case 'curse': case 'bulkup': case 'bellydrum':
if (counter.Physical < 2 && !hasMove['batonpass']) rejected = true;
if (setupType !== 'Physical' || counter['physicalsetup'] > 1) rejected = true;
isSetup = true;
break;
case 'nastyplot': case 'tailglow': case 'quiverdance': case 'calmmind': case 'geomancy':
if (counter.Special < 2 && !hasMove['batonpass']) rejected = true;
if (setupType !== 'Special' || counter['specialsetup'] > 1) rejected = true;
isSetup = true;
break;
case 'shellsmash': case 'growth': case 'workup':
if (counter.Physical + counter.Special < 2 && !hasMove['batonpass']) rejected = true;
if (setupType !== 'Mixed' || counter['mixedsetup'] > 1) rejected = true;
isSetup = true;
break;
// bad after setup
case 'seismictoss': case 'nightshade': case 'superfang':
if (setupType) rejected = true;
break;
case 'rapidspin': case 'perishsong': case 'magiccoat': case 'spikes':
if (setupType) rejected = true;
break;
case 'uturn': case 'voltswitch':
if (setupType || hasMove['agility'] || hasMove['rockpolish'] || hasMove['magnetrise']) rejected = true;
break;
case 'relicsong':
if (setupType) rejected = true;
break;
case 'pursuit': case 'protect': case 'haze': case 'stealthrock':
if (setupType || (hasMove['rest'] && hasMove['sleeptalk'])) rejected = true;
break;
case 'trick': case 'switcheroo':
if (setupType || counter.Physical + counter.Special < 2) rejected = true;
if ((hasMove['rest'] && hasMove['sleeptalk']) || hasMove['trickroom'] || hasMove['reflect'] || hasMove['lightscreen'] || hasMove['acrobatics']) rejected = true;
break;
case 'dragontail': case 'circlethrow':
if (hasMove['agility'] || hasMove['rockpolish']) rejected = true;
if (hasMove['whirlwind'] || hasMove['roar'] || hasMove['encore']) rejected = true;
break;
// bit redundant to have both
// Attacks:
case 'flamethrower': case 'fierydance':
if (hasMove['heatwave'] || hasMove['overheat'] || hasMove['fireblast'] || hasMove['blueflare']) rejected = true;
break;
case 'overheat':
if (setupType === 'Special' || hasMove['fireblast']) rejected = true;
break;
case 'icebeam':
if (hasMove['blizzard']) rejected = true;
break;
case 'surf':
if (hasMove['scald'] || hasMove['hydropump'] || hasMove['muddywater']) rejected = true;
break;
case 'hydropump':
if (hasMove['razorshell'] || hasMove['scald'] || hasMove['muddywater']) rejected = true;
break;
case 'waterfall':
if (hasMove['aquatail']) rejected = true;
break;
case 'airslash':
if (hasMove['hurricane']) rejected = true;
break;
case 'acrobatics': case 'pluck': case 'drillpeck':
if (hasMove['bravebird']) rejected = true;
break;
case 'solarbeam':
if ((!hasMove['sunnyday'] && !hasAbility['Drought']) || hasMove['gigadrain'] || hasMove['leafstorm']) rejected = true;
break;
case 'gigadrain':
if ((!setupType && hasMove['leafstorm']) || hasMove['petaldance']) rejected = true;
break;
case 'leafstorm':
if (setupType && hasMove['gigadrain']) rejected = true;
break;
case 'weatherball':
if (!hasMove['sunnyday']) rejected = true;
break;
case 'firepunch':
if (hasMove['flareblitz']) rejected = true;
break;
case 'crosschop': case 'highjumpkick':
if (hasMove['closecombat']) rejected = true;
break;
case 'drainpunch':
if (hasMove['closecombat'] || hasMove['crosschop']) rejected = true;
break;
case 'thunder':
if (hasMove['thunderbolt']) rejected = true;
break;
case 'thunderbolt': case 'electroweb':
if (hasMove['discharge']) rejected = true;
break;
case 'stoneedge':
if (hasMove['rockslide'] || hasMove['headsmash'] || hasMove['rockblast']) rejected = true;
break;
case 'headsmash':
if (hasMove['rockslide']) rejected = true;
break;
case 'bonemerang': case 'earthpower':
if (hasMove['earthquake']) rejected = true;
break;
case 'outrage':
if (hasMove['dragonclaw'] || hasMove['dragontail']) rejected = true;
break;
case 'ancientpower':
if (hasMove['paleowave']) rejected = true;
break;
case 'dragonpulse':
if (hasMove['dracometeor']) rejected = true;
break;
case 'moonblast':
if (hasMove['dazzlinggleam']) rejected = true;
break;
case 'acidspray':
if (hasMove['sludgebomb']) rejected = true;
break;
case 'return':
if (hasMove['bodyslam'] || hasMove['facade'] || hasMove['doubleedge'] || hasMove['tailslap'] || hasMove['doublehit']) rejected = true;
break;
case 'poisonjab':
if (hasMove['gunkshot']) rejected = true;
break;
case 'psychic':
if (hasMove['psyshock']) rejected = true;
break;
case 'fusionbolt':
if (setupType && hasMove['boltstrike']) rejected = true;
break;
case 'boltstrike':
if (!setupType && hasMove['fusionbolt']) rejected = true;
break;
case 'darkpulse':
if (hasMove['crunch'] && setupType !== 'Special') rejected = true;
break;
case 'hiddenpowerice':
if (hasMove['icywind']) rejected = true;
break;
case 'quickattack':
if (hasMove['feint']) rejected = true;
break;
case 'wideguard':
if (hasMove['protect']) rejected = true;
break;
case 'powersplit':
if (hasMove['guardsplit']) rejected = true;
break;
// Status:
case 'rest':
if (hasMove['painsplit'] || hasMove['wish'] || hasMove['recover'] || hasMove['moonlight'] || hasMove['synthesis']) rejected = true;
break;
case 'softboiled': case 'roost':
if (hasMove['wish'] || hasMove['recover']) rejected = true;
break;
case 'perishsong':
if (hasMove['roar'] || hasMove['whirlwind'] || hasMove['haze']) rejected = true;
break;
case 'roar':
// Whirlwind outclasses Roar because Soundproof
if (hasMove['whirlwind'] || hasMove['dragontail'] || hasMove['haze'] || hasMove['circlethrow']) rejected = true;
break;
case 'substitute':
if (hasMove['uturn'] || hasMove['voltswitch'] || hasMove['pursuit']) rejected = true;
break;
case 'fakeout':
if (hasMove['trick'] || hasMove['switcheroo'] || ability === 'Sheer Force') rejected = true;
break;
case 'feint':
if (hasMove['fakeout']) rejected = true;
break;
case 'encore':
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
if (hasMove['whirlwind'] || hasMove['dragontail'] || hasMove['roar'] || hasMove['circlethrow']) rejected = true;
break;
case 'suckerpunch':
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
break;
case 'cottonguard':
if (hasMove['reflect']) rejected = true;
break;
case 'lightscreen':
if (hasMove['calmmind']) rejected = true;
break;
case 'rockpolish': case 'agility': case 'autotomize':
if (!setupType && !hasMove['batonpass'] && hasMove['thunderwave']) rejected = true;
if ((hasMove['stealthrock'] || hasMove['spikes'] || hasMove['toxicspikes']) && !hasMove['batonpass']) rejected = true;
break;
case 'thunderwave':
if (setupType && (hasMove['rockpolish'] || hasMove['agility'])) rejected = true;
if (hasMove['discharge'] || hasMove['trickroom']) rejected = true;
if (hasMove['rest'] && hasMove['sleeptalk']) rejected = true;
if (hasMove['yawn'] || hasMove['spore'] || hasMove['sleeppowder']) rejected = true;
break;
case 'lavaplume':
if (hasMove['willowisp']) rejected = true;
break;
case 'trickroom':
if (hasMove['rockpolish'] || hasMove['agility']) rejected = true;
break;
case 'willowisp':
if (hasMove['scald'] || hasMove['yawn'] || hasMove['spore'] || hasMove['sleeppowder']) rejected = true;
break;
case 'toxic':
if (hasMove['thunderwave'] || hasMove['willowisp'] || hasMove['scald'] || hasMove['yawn'] || hasMove['spore'] || hasMove['sleeppowder']) rejected = true;
break;
}
// Increased/decreased priority moves unneeded with moves that boost only speed
if (move.priority !== 0 && (hasMove['rockpolish'] || hasMove['agility'])) {
rejected = true;
}
if (move.category === 'Special' && setupType === 'Physical' && !SetupException[move.id]) {
rejected = true;
}
if (move.category === 'Physical' && (setupType === 'Special' || hasMove['acidspray']) && !SetupException[move.id]) {
rejected = true;
}
// This move doesn't satisfy our setup requirements:
if (setupType === 'Physical' && move.category !== 'Physical' && counter['Physical'] < 2) {
rejected = true;
}
if (setupType === 'Special' && move.category !== 'Special' && counter['Special'] < 2) {
rejected = true;
}
// Hidden Power isn't good enough
if (setupType === 'Special' && move.id === 'hiddenpower' && counter['Special'] <= 2 && (!hasMove['shadowball'] || move.type !== 'Fighting')) {
rejected = true;
}
// Remove rejected moves from the move list.
if (rejected && (movePool.length - availableHP || availableHP && (move.id === 'hiddenpower' || !hasMove['hiddenpower']))) {
moves.splice(k, 1);
break;
}
// Handle HP IVs
if (move.id === 'hiddenpower') {
var HPivs = this.getType(move.type).HPivs;
for (var iv in HPivs) {
ivs[iv] = HPivs[iv];
}
}
}
if (movePool.length && moves.length === 4 && !hasMove['judgment']) {
// Move post-processing:
if (damagingMoves.length === 0) {
// A set shouldn't have no attacking moves
moves.splice(this.random(moves.length), 1);
} else if (damagingMoves.length === 1) {
var damagingid = damagingMoves[0].id;
// Night Shade, Seismic Toss, etc. don't count:
if (!damagingMoves[0].damage && (movePool.length - availableHP || availableHP && (damagingid === 'hiddenpower' || !hasMove['hiddenpower']))) {
var replace = false;
if (damagingid in {counter:1, focuspunch:1, mirrorcoat:1, suckerpunch:1} || (damagingid === 'hiddenpower' && !hasStab)) {
// Unacceptable as the only attacking move
replace = true;
} else {
if (!hasStab) {
var damagingType = damagingMoves[0].type;
if (damagingType === 'Fairy') {
// Mono-Fairy is acceptable for Psychic types
if (!hasType['Psychic']) replace = true;
} else if (damagingType === 'Ice') {
if (hasType['Normal'] && template.types.length === 1) {
// Mono-Ice is acceptable for special attacking Normal types that lack Boomburst and Hyper Voice
if (counter.Physical >= 2 || movePool.indexOf('boomburst') > -1 || movePool.indexOf('hypervoice') > -1) replace = true;
} else {
replace = true;
}
} else {
replace = true;
}
}
}
if (replace) moves.splice(damagingMoveIndex[damagingid], 1);
}
} else if (damagingMoves.length === 2) {
// If you have two attacks, neither is STAB, and the combo isn't Ice/Electric or Ghost/Fighting, reject one of them at random.
var type1 = damagingMoves[0].type, type2 = damagingMoves[1].type;
var typeCombo = [type1, type2].sort().join('/');
if (!hasStab && typeCombo !== 'Electric/Ice' && typeCombo !== 'Fighting/Ghost') {
var rejectableMoves = [];
var baseDiff = movePool.length - availableHP;
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[0].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[0].id]);
}
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[1].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[1].id]);
}
if (rejectableMoves.length) {
moves.splice(rejectableMoves[this.random(rejectableMoves.length)], 1);
}
}
} else if (!hasStab) {
// If you have three or more attacks, and none of them are STAB, reject one of them at random.
var rejectableMoves = [];
var baseDiff = movePool.length - availableHP;
for (var l = 0; l < damagingMoves.length; l++) {
if (baseDiff || availableHP && (!hasMove['hiddenpower'] || damagingMoves[l].id === 'hiddenpower')) {
rejectableMoves.push(damagingMoveIndex[damagingMoves[l].id]);
}
}
if (rejectableMoves.length) {
moves.splice(rejectableMoves[this.random(rejectableMoves.length)], 1);
}
}
}
} while (moves.length < 4 && movePool.length);
// any moveset modification goes here
//moves[0] = 'safeguard';
if (template.requiredItem && template.requiredItem.slice(-5) === 'Drive' && !hasMove['technoblast']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'technoblast';
hasMove['technoblast'] = true;
}
if (template.id === 'altariamega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'return';
hasMove['return'] = true;
}
if (template.id === 'gardevoirmega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'hypervoice';
hasMove['hypervoice'] = true;
}
if (template.id === 'salamencemega' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'return';
hasMove['return'] = true;
}
if (template.id === 'sylveon' && !counter['ate']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'hypervoice';
hasMove['hypervoice'] = true;
}
if (template.id === 'meloettapirouette' && !hasMove['relicsong']) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = 'relicsong';
hasMove['relicsong'] = true;
}
if (template.requiredMove && !hasMove[toId(template.requiredMove)]) {
delete hasMove[this.getMove(moves[3]).id];
moves[3] = toId(template.requiredMove);
hasMove[toId(template.requiredMove)] = true;
}
// If Hidden Power has been removed, reset the IVs
if (!hasMove['hiddenpower']) {
ivs = {
hp: 31,
atk: 31,
def: 31,
spa: 31,
spd: 31,
spe: 31
};
}
var abilities = Object.values(baseTemplate.abilities).sort(function (a, b) {
return this.getAbility(b).rating - this.getAbility(a).rating;
}.bind(this));
var ability0 = this.getAbility(abilities[0]);
var ability1 = this.getAbility(abilities[1]);
var ability = ability0.name;
if (abilities[1]) {
if (ability0.rating <= ability1.rating) {
if (this.random(2)) ability = ability1.name;
} else if (ability0.rating - 0.6 <= ability1.rating) {
if (!this.random(3)) ability = ability1.name;
}
var rejectAbility = false;
if (ability in counterAbilities) {
rejectAbility = !counter[toId(ability)];
} else if (ability === 'Rock Head' || ability === 'Reckless') {
rejectAbility = !counter['recoil'];
} else if (ability === 'No Guard' || ability === 'Compound Eyes') {
rejectAbility = !counter['inaccurate'];
} else if (ability === 'Strong Jaw') {
rejectAbility = !counter['bite'];
} else if (ability === 'Sheer Force') {
rejectAbility = !counter['sheerforce'];
} else if (ability === 'Serene Grace') {
rejectAbility = !counter['serenegrace'] && template.species !== 'Blissey' && template.species !== 'Chansey';
} else if (ability === 'Simple') {
rejectAbility = !setupType && !hasMove['flamecharge'] && !hasMove['stockpile'];
} else if (ability === 'Prankster') {
rejectAbility = !counter['Status'];
} else if (ability === 'Defiant') {
rejectAbility = !counter['Physical'] && !hasMove['batonpass'];
} else if (ability === 'Moody') {
rejectAbility = template.id !== 'bidoof';
} else if (ability === 'Lightning Rod') {
rejectAbility = template.types.indexOf('Ground') >= 0;
} else if (ability === 'Chlorophyll') {
rejectAbility = !hasMove['sunnyday'];
} else if (ability in ateAbilities) {
rejectAbility = !counter['ate'];
}
if (rejectAbility) {
if (ability === ability1.name) { // or not
ability = ability0.name;
} else if (ability1.rating > 0) { // only switch if the alternative doesn't suck
ability = ability1.name;
}
}
if (abilities.indexOf('Guts') > -1 && ability !== 'Quick Feet' && hasMove['facade']) {
ability = 'Guts';
}
if (abilities.indexOf('Swift Swim') > -1 && hasMove['raindance']) {
ability = 'Swift Swim';
}
if (abilities.indexOf('Chlorophyll') > -1 && ability !== 'Solar Power') {
ability = 'Chlorophyll';
}
if (abilities.indexOf('Intimidate') > -1 || template.id === 'mawilemega') {
ability = 'Intimidate';
}
if (template.id === 'unfezant') {
ability = 'Super Luck';
}
}
// Make EVs comply with the sets.
// Quite simple right now, 252 attack, 252 hp if slow 252 speed if fast, 4 evs for the strong defense.
// TO-DO: Make this more complex
if (counter.Special >= 2) {
evs.atk = 0;
evs.spa = 252;
} else if (counter.Physical >= 2) {
evs.atk = 252;
evs.spa = 0;
} else {
// Fallback in case a Pokémon lacks attacks... go by stats
if (template.baseStats.spa >= template.baseStats.atk) {
evs.atk = 0;
evs.spa = 252;
} else {
evs.atk = 252;
evs.spa = 0;
}
}
if (template.baseStats.spe > 80) {
evs.spe = 252;
evs.hp = 4;
} else {
evs.hp = 252;
if (template.baseStats.def > template.baseStats.spd) {
evs.def = 4;
} else {
evs.spd = 4;
}
}
// Naturally slow mons already have the proper EVs, check IVs for Gyro Ball and TR
if (hasMove['gyroball'] || hasMove['trickroom']) {
ivs.spe = 0;
}
item = 'Sitrus Berry';
if (template.requiredItem) {
item = template.requiredItem;
// First, the extra high-priority items
} else if (ability === 'Imposter') {
item = 'Choice Scarf';
} else if (hasMove["magikarpsrevenge"]) {
item = 'Mystic Water';
} else if (ability === 'Wonder Guard') {
item = 'Focus Sash';
} else if (template.species === 'Unown') {
item = 'Choice Specs';
} else if (hasMove['trick'] && hasMove['gyroball'] && (ability === 'Levitate' || hasType['Flying'])) {
item = 'Macho Brace';
} else if (hasMove['trick'] && hasMove['gyroball']) {
item = 'Iron Ball';
} else if (hasMove['trick'] || hasMove['switcheroo']) {
var randomNum = this.random(2);
if (counter.Physical >= 3 && (template.baseStats.spe >= 95 || randomNum)) {
item = 'Choice Band';
} else if (counter.Special >= 3 && (template.baseStats.spe >= 95 || randomNum)) {
item = 'Choice Specs';
} else {
item = 'Choice Scarf';
}
} else if (hasMove['rest'] && !hasMove['sleeptalk'] && ability !== 'Natural Cure' && ability !== 'Shed Skin') {
item = 'Chesto Berry';
} else if (hasMove['naturalgift']) {
item = 'Liechi Berry';
} else if (hasMove['geomancy']) {
item = 'Power Herb';
} else if (ability === 'Harvest') {
item = 'Sitrus Berry';
} else if (template.species === 'Cubone' || template.species === 'Marowak') {
item = 'Thick Club';
} else if (template.baseSpecies === 'Pikachu') {
item = 'Light Ball';
} else if (template.species === 'Clamperl') {
item = 'DeepSeaTooth';
} else if (template.species === 'Spiritomb') {
item = 'Leftovers';
} else if (template.species === 'Scrafty' && counter['Status'] === 0) {
item = 'Assault Vest';
} else if (template.species === 'Farfetch\'d') {
item = 'Stick';
} else if (template.species === 'Amoonguss') {
item = 'Black Sludge';
} else if (template.species === 'Dedenne') {
item = 'Petaya Berry';
} else if (hasMove['focusenergy'] || (template.species === 'Unfezant' && counter['Physical'] >= 2)) {
item = 'Scope Lens';
} else if (template.evos.length) {
item = 'Eviolite';
} else if (hasMove['reflect'] && hasMove['lightscreen']) {
item = 'Light Clay';
} else if (hasMove['shellsmash']) {
item = 'White Herb';
} else if (hasMove['facade'] || ability === 'Poison Heal' || ability === 'Toxic Boost') {
item = 'Toxic Orb';
} else if (hasMove['raindance']) {
item = 'Damp Rock';
} else if (hasMove['sunnyday']) {
item = 'Heat Rock';
} else if (hasMove['sandstorm']) {
item = 'Smooth Rock';
} else if (hasMove['hail']) {
item = 'Icy Rock';
} else if (ability === 'Magic Guard' && hasMove['psychoshift']) {
item = 'Flame Orb';
} else if (ability === 'Sheer Force' || ability === 'Magic Guard') {
item = 'Life Orb';
} else if (hasMove['acrobatics']) {
item = 'Flying Gem';
} else if (ability === 'Unburden') {
if (hasMove['fakeout']) {
item = 'Normal Gem';
} else if (hasMove['dracometeor'] || hasMove['leafstorm'] || hasMove['overheat']) {
item = 'White Herb';
} else if (hasMove['substitute'] || setupType) {
item = 'Sitrus Berry';
} else {
item = 'Red Card';
for (var m in moves) {
var move = this.getMove(moves[m]);
if (hasType[move.type] && move.basePower >= 90) {
item = move.type + ' Gem';
break;
}
}
}
// medium priority
} else if (ability === 'Guts') {
item = hasMove['drainpunch'] ? 'Flame Orb' : 'Toxic Orb';
if ((hasMove['return'] || hasMove['hyperfang']) && !hasMove['facade']) {
// lol no
for (var j = 0; j < moves.length; j++) {
if (moves[j] === 'Return' || moves[j] === 'Hyper Fang') {
moves[j] = 'Facade';
break;
}
}
}
} else if (ability === 'Marvel Scale' && hasMove['psychoshift']) {
item = 'Flame Orb';
} else if (counter.Physical >= 4 && !hasMove['fakeout'] && !hasMove['suckerpunch'] && !hasMove['flamecharge'] && !hasMove['rapidspin'] && ability !== 'Sturdy' && ability !== 'Multiscale') {
item = 'Life Orb';
} else if (counter.Special >= 4 && !hasMove['eruption'] && !hasMove['waterspout'] && ability !== 'Sturdy') {
item = 'Life Orb';
} else if (this.getImmunity('Ground', template) && this.getEffectiveness('Ground', template) >= 2 && ability !== 'Levitate' && !hasMove['magnetrise']) {
item = 'Shuca Berry';
} else if (this.getEffectiveness('Ice', template) >= 2) {
item = 'Yache Berry';
} else if (this.getEffectiveness('Rock', template) >= 2) {
item = 'Charti Berry';
} else if (this.getEffectiveness('Fire', template) >= 2) {
item = 'Occa Berry';
} else if (this.getImmunity('Fighting', template) && this.getEffectiveness('Fighting', template) >= 2) {
item = 'Chople Berry';
} else if (ability === 'Iron Barbs' || ability === 'Rough Skin') {
item = 'Rocky Helmet';
} else if ((template.baseStats.hp + 75) * (template.baseStats.def + template.baseStats.spd + 175) > 60000 || template.species === 'Skarmory' || template.species === 'Forretress') {
// skarmory and forretress get exceptions for their typing
item = 'Sitrus Berry';
} else if (counter.Physical + counter.Special >= 3 && setupType && ability !== 'Sturdy' && ability !== 'Multiscale') {
item = 'Life Orb';
} else if (counter.Special >= 3 && setupType && ability !== 'Sturdy') {
item = 'Life Orb';
} else if (counter.Physical + counter.Special >= 4 && template.baseStats.def + template.baseStats.spd > 179) {
item = 'Assault Vest';
} else if (counter.Physical + counter.Special >= 4) {
item = 'Expert Belt';
} else if (hasMove['outrage']) {
item = 'Lum Berry';
} else if (hasMove['substitute'] || hasMove['detect'] || hasMove['protect'] || ability === 'Moody') {
item = 'Leftovers';
} else if (this.getImmunity('Ground', template) && this.getEffectiveness('Ground', template) >= 1 && ability !== 'Levitate' && !hasMove['magnetrise']) {
item = 'Shuca Berry';
} else if (this.getEffectiveness('Ice', template) >= 1) {
item = 'Yache Berry';
// this is the "REALLY can't think of a good item" cutoff
} else if (counter.Physical + counter.Special >= 2 && template.baseStats.hp + template.baseStats.def + template.baseStats.spd > 315) {
item = 'Weakness Policy';
} else if (ability === 'Sturdy' && hasMove['explosion'] && !counter['speedsetup']) {
item = 'Custap Berry';
} else if (ability === 'Super Luck') {
item = 'Scope Lens';
} else if (hasType['Poison']) {
item = 'Black Sludge';
} else if (counter.Status <= 1 && ability !== 'Sturdy' && ability !== 'Multiscale') {
item = 'Life Orb';
} else {
item = 'Sitrus Berry';
}
// For Trick / Switcheroo
if (item === 'Leftovers' && hasType['Poison']) {
item = 'Black Sludge';
}
// We choose level based on BST. Min level is 70, max level is 99. 600+ BST is 70, less than 300 is 99. Calculate with those values.
// Every 10.34 BST adds a level from 70 up to 99. Results are floored. Uses the Mega's stats if holding a Mega Stone
var bst = template.baseStats.hp + template.baseStats.atk + template.baseStats.def + template.baseStats.spa + template.baseStats.spd + template.baseStats.spe;
// Adjust levels of mons based on abilities (Pure Power, Sheer Force, etc.) and also Eviolite
// For the stat boosted, treat the Pokemon's base stat as if it were multiplied by the boost. (Actual effective base stats are higher.)
var templateAbility = (baseTemplate === template ? ability : template.abilities[0]);
if (templateAbility === 'Huge Power' || templateAbility === 'Pure Power') {
bst += template.baseStats.atk;
} else if (templateAbility === 'Parental Bond') {
bst += 0.5 * (evs.atk > evs.spa ? template.baseStats.atk : template.baseStats.spa);
} else if (templateAbility === 'Protean') {
// Holistic judgment. Don't boost Protean as much as Parental Bond
bst += 0.3 * (evs.atk > evs.spa ? template.baseStats.atk : template.baseStats.spa);
} else if (templateAbility === 'Fur Coat') {
bst += template.baseStats.def ;
}
if (item === 'Eviolite') {
bst += 0.5 * (template.baseStats.def + template.baseStats.spd);
}
var level = 70 + Math.floor(((600 - this.clampIntRange(bst, 300, 600)) / 10.34));
return {
name: name,
moves: moves,
ability: ability,
evs: evs,
ivs: ivs,
item: item,
level: level,
shiny: !this.random(template.id === 'missingno' ? 4 : 1024)
};
},
randomSeasonalStaffTeam: function (side) {
var team = [];
var variant = this.random(2);
// Hardcoded sets of the available Pokémon.
var sets = {
// Admins.
'~Antar': {
species: 'Quilava', ability: 'Turboblaze', item: 'Eviolite', gender: 'M',
moves: ['blueflare', ['quiverdance', 'solarbeam', 'moonblast'][this.random(3)], 'sunnyday'],
baseSignatureMove: 'spikes', signatureMove: "Firebomb",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'~chaos': {
species: 'Bouffalant', ability: 'Fur Coat', item: 'Red Card', gender: 'M',
moves: ['precipiceblades', ['recover', 'stockpile', 'swordsdance'][this.random(3)], 'extremespeed', 'explosion'],
baseSignatureMove: 'embargo', signatureMove: "Forcewin",
evs: {hp:4, atk:252, spe:252}, nature: 'Adamant'
},
'~Haunter': {
species: 'Landorus', ability: 'Sheer Force', item: 'Life Orb', gender: 'M',
moves: ['hurricane', 'earthpower', 'fireblast', 'blizzard', 'thunder'],
baseSignatureMove: 'quiverdance', signatureMove: "Genius Dance",
evs: {hp:4, spa:252, spe:252}, nature: 'Modest'
},
'~Jasmine': {
species: 'Mew', ability: 'Speed Boost', item: 'Focus Sash', gender: 'F',
moves: ['explosion', 'transform', 'milkdrink', 'storedpower'],
baseSignatureMove: 'bellydrum', signatureMove: "Lockdown",
evs: {hp:252, def:252, spd:4}, nature: 'Bold'
},
'~Joim': {
species: 'Zapdos', ability: 'Download', item: 'Leftovers', gender: 'M', shiny: true,
moves: ['thunderbolt', 'hurricane', ['earthpower', 'roost', 'flamethrower', 'worryseed', 'haze', 'spore'][this.random(6)]],
baseSignatureMove: 'milkdrink', signatureMove: "Red Bull Drink",
evs: {hp:4, spa:252, spe:252}, nature: 'Modest'
},
'~The Immortal': {
species: 'Blastoise', ability: 'Magic Bounce', item: 'Blastoisinite', gender: 'M', shiny: true,
moves: ['shellsmash', 'steameruption', 'dragontail'],
baseSignatureMove: 'sleeptalk', signatureMove: "Sleep Walk",
evs: {hp:252, def:4, spd:252}, nature: 'Sassy'
},
'~V4': {
species: 'Victini', ability: 'Desolate Land', item: (variant === 0 ? ['Life Orb', 'Charcoal', 'Leftovers'][this.random(3)] : ['Life Orb', 'Choice Scarf', 'Leftovers'][this.random(3)]), gender: 'M',
moves: (variant === 0 ? ['thousandarrows', 'bolt strike', 'shiftgear', 'dragonascent', 'closecombat', 'substitute'] : ['thousandarrows', 'bolt strike', 'dragonascent', 'closecombat']),
baseSignatureMove: 'vcreate', signatureMove: "V-Generate",
evs: {hp:4, atk:252, spe:252}, nature: 'Jolly'
},
'~Zarel': {
species: 'Meloetta', ability: 'Serene Grace', item: '', gender: 'F',
moves: ['lunardance', 'fierydance', 'perishsong', 'petaldance', 'quiverdance'],
baseSignatureMove: 'relicsong', signatureMove: "Relic Song Dance",
evs: {hp:4, atk:252, spa:252}, nature: 'Quiet'
},
// Leaders.
'&hollywood': {
species: 'Mr. Mime', ability: 'Prankster', item: 'Leftovers', gender: 'M',
moves: ['batonpass', ['substitute', 'milkdrink'][this.random(2)], 'encore'],
baseSignatureMove: 'geomancy', signatureMove: "Meme Mime",
evs: {hp:252, def:4, spe:252}, nature: 'Timid'
},
'&jdarden': {
species: 'Dragonair', ability: 'Fur Coat', item: 'Eviolite', gender: 'M',
moves: ['rest', 'sleeptalk', 'quiverdance'], name: 'jdarden',
baseSignatureMove: 'dragontail', signatureMove: "Wyvern's Wind",
evs: {hp:252, def:4, spd:252}, nature: 'Calm'
},
'&Okuu': {
species: 'Honchkrow', ability: 'Drought', item: 'Life Orb', gender: 'F',
moves: [['bravebird', 'sacredfire'][this.random(2)], ['suckerpunch', 'punishment'][this.random(2)], 'roost'],
baseSignatureMove: 'firespin', signatureMove: "Blazing Star - Ten Evil Stars",
evs: {atk:252, spa:4, spe:252}, nature: 'Quirky'
},
'&sirDonovan': {
species: 'Togetic', ability: 'Gale Wings', item: 'Eviolite', gender: 'M',
moves: ['roost', 'hurricane', 'afteryou', 'charm', 'dazzlinggleam'],
baseSignatureMove: 'mefirst', signatureMove: "Ladies First",
evs: {hp:252, spa:252, spe:4}, nature: 'Modest'
},
'&Slayer95': {
species: 'Scizor', ability: 'Illusion', item: 'Scizorite', gender: 'M',
moves: ['swordsdance', 'bulletpunch', 'uturn'],
baseSignatureMove: 'allyswitch', signatureMove: "Spell Steal",
evs: {atk:252, def:252, spd: 4}, nature: 'Brave'
},
'&Sweep': {
species: 'Omastar', ability: 'Drizzle', item: ['Honey', 'Mail'][this.random(2)], gender: 'M',
moves: ['shellsmash', 'originpulse', ['thunder', 'icebeam'][this.random(2)]],
baseSignatureMove: 'kingsshield', signatureMove: "Sweep's Shield",
evs: {hp:4, spa:252, spe:252}, nature: 'Modest'
},
'&Vacate': {
species: 'Bibarel', ability: 'Adaptability', item: 'Leftovers', gender: 'M',
moves: ['earthquake', 'smellingsalts', 'stockpile', 'zenheadbutt', 'waterfall'],
baseSignatureMove: 'superfang', signatureMove: "Duper Fang",
evs: {atk:252, def:4, spd:252}, nature: 'Quiet'
},
'&verbatim': {
species: 'Archeops', ability: 'Reckless', item: 'Life Orb', gender: 'M',
moves: ['headsmash', 'highjumpkick', 'flareblitz', 'volttackle', 'woodhammer'],
baseSignatureMove: 'bravebird', signatureMove: "Glass Cannon",
evs: {hp:4, atk:252, spe:252}, nature: 'Jolly'
},
// Mods.
'@AM': {
species: 'Tyranitar', ability: 'Adaptability', item: (variant === 1 ? 'Lum Berry' : 'Choice Scarf'), gender: 'M',
moves: (variant === 1 ? ['earthquake', 'diamondstorm', 'swordsdance', 'meanlook'] : ['knockoff', 'diamondstorm', 'earthquake']),
baseSignatureMove: 'pursuit', signatureMove: "Predator",
evs: {atk:252, def:4, spe: 252}, nature: 'Jolly'
},
'@antemortem': {
species: 'Clefable', ability: (variant === 1 ? 'Sheer Force' : 'Multiscale'), item: (variant === 1 ? 'Life Orb' : 'Leftovers'), gender: 'M',
moves: ['earthpower', 'cosmicpower', 'recover', 'gigadrain'],
baseSignatureMove: 'drainingkiss', signatureMove: "Postmortem",
evs: {hp:252, spa:252, def:4}, nature: 'Modest'
},
'@Ascriptmaster': {
species: 'Rotom', ability: 'Teravolt', item: 'Air Balloon', gender: 'M',
moves: ['chargebeam', 'signalbeam', 'flamethrower', 'aurorabeam', 'dazzlinggleam'],
baseSignatureMove: 'triattack', signatureMove: "Spectrum Beam",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'@asgdf': {
species: 'Empoleon', ability: 'Filter', item: 'Rocky Helmet', gender: 'M',
moves: ['scald', 'recover', 'calmmind', 'searingshot', 'encore'],
baseSignatureMove: 'futuresight', signatureMove: "Obscure Pun",
evs: {hp:252, spa:252, def:4}, nature: 'Modest'
},
'@Barton': {
species: 'Piloswine', ability: 'Parental Bond', item: 'Eviolite', gender: 'M',
moves: ['earthquake', 'iciclecrash', 'taunt'],
baseSignatureMove: 'bulkup', signatureMove: "MDMA Huff",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'@bean': {
species: 'Liepard', ability: 'Prankster', item: 'Leftovers', gender: 'M',
moves: ['knockoff', 'encore', 'substitute', 'gastroacid', 'leechseed'],
baseSignatureMove: 'glare', signatureMove: "Coin Toss",
evs: {hp:252, def:252, spd:4}, nature: 'Calm'
},
'@Beowulf': {
species: 'Beedrill', ability: 'Download', item: 'Beedrillite', gender: 'M',
moves: ['spikyshield', 'gunkshot', ['sacredfire', 'boltstrike', 'diamondstorm'][this.random(3)]],
baseSignatureMove: 'bugbuzz', signatureMove: "Buzzing of the Swarm",
evs: {hp:4, spa:252, spe:252}, nature: 'Jolly'
},
'@BiGGiE': {
species: 'Snorlax', ability: 'Fur Coat', item: 'Leftovers', gender: 'M',
moves: ['drainpunch', 'diamondstorm', 'kingsshield', 'knockoff', 'precipiceblades'],
baseSignatureMove: 'dragontail', signatureMove: "Food Rush",
evs: {hp:4, atk:252, spd:252}, nature: 'Adamant'
},
'@Blitzamirin': {
species: 'Chandelure', ability: 'Prankster', item: 'Red Card', gender: 'M',
moves: ['heartswap', ['darkvoid', 'substitute'][this.random(2)], ['shadowball', 'blueflare'][this.random(2)]],
baseSignatureMove: 'oblivionwing', signatureMove: "Pneuma Relinquish",
evs: {def:4, spa:252, spe:252}, nature: 'Timid'
},
'@CoolStoryBrobat': {
species: 'Crobat', ability: 'Gale Wings', item: 'Black Glasses', gender: 'M',
moves: ['knockoff', 'bulkup', 'roost', 'closecombat', 'defog'],
baseSignatureMove: 'bravebird', signatureMove: "Brave Bat",
evs: {hp:4, atk:252, spe:252}, nature: 'Jolly'
},
'@Dell': {
species: 'Lucario', ability: 'Simple', item: 'Lucarionite', gender: 'M',
moves: ['jumpkick', ['flashcannon', 'bulletpunch'][this.random(2)], 'batonpass'],
baseSignatureMove: 'detect', signatureMove: "Aura Parry",
evs: {hp:4, atk:216, spa:36, spe:252}, nature: 'Naive'
},
'@Eevee General': {
species: 'Eevee', ability: 'Magic Guard', item: 'Eviolite', gender: 'M',
moves: ['shiftgear', 'healorder', 'crunch', 'sacredsword', 'doubleedge'],
baseSignatureMove: 'quickattack', signatureMove: "War Crimes",
evs: {hp:252, atk:252, def:4}, nature: 'Impish'
},
'@Electrolyte': {
species: 'Elekid', ability: 'Pure Power', item: 'Life Orb', gender: 'M',
moves: ['volttackle', 'earthquake', ['iciclecrash', 'diamondstorm'][this.random(2)]],
baseSignatureMove: 'entrainment', signatureMove: "Study",
evs: {atk:252, spd:4, spe:252}, nature: 'Adamant'
},
'@Enguarde': {
species: 'Gallade', ability: ['Intimidate', 'Hyper Cutter'][this.random(2)], item: 'Galladite', gender: 'M',
moves: ['psychocut', 'sacredsword', ['nightslash', 'precipiceblades', 'leafblade'][this.random(3)]],
baseSignatureMove: 'fakeout', signatureMove: "Ready Stance",
evs: {hp:4, atk:252, spe:252}, nature: 'Adamant'
},
'@Eos': {
species: 'Drifblim', ability: 'Fur Coat', item: 'Assault Vest', gender: 'M',
moves: ['oblivionwing', 'paraboliccharge', 'gigadrain', 'drainingkiss'],
baseSignatureMove: 'shadowball', signatureMove: "Shadow Curse", //placeholder
evs: {hp:248, spa:252, spd:8}, nature: 'Modest'
},
'@Former Hope': {
species: 'Froslass', ability: 'Prankster', item: 'Focus Sash', gender: 'M',
moves: [['icebeam', 'shadowball'][this.random(2)], 'destinybond', 'thunderwave'],
baseSignatureMove: 'roleplay', signatureMove: "Role Play",
evs: {hp:252, spa:252, spd:4}, nature: 'Modest'
},
'@Genesect': {
species: 'Genesect', ability: 'Mold Breaker', item: 'Life Orb', gender: 'M',
moves: ['bugbuzz', 'closecombat', 'extremespeed', 'thunderbolt', 'uturn'],
baseSignatureMove: 'geargrind', signatureMove: "Grind you're mum",
evs: {atk:252, spa:252, spe:4}, nature: 'Quiet'
},
'@Goddess Briyella': {
species: 'Floette-Eternal-Flower', ability: 'Magic Bounce', item: 'Big Root', gender: 'M',
moves: ['cottonguard', 'quiverdance', 'drainingkiss'],
baseSignatureMove: 'earthpower', signatureMove: "Earth Drain",
evs: {hp:252, spa:252, def:4}, nature: 'Modest'
},
'@Hippopotas': {
species: 'Hippopotas', ability: 'Regenerator', item: 'Eviolite', gender: 'M',
moves: ['haze', 'stealthrock', 'spikes', 'toxicspikes', 'stickyweb'],
baseSignatureMove: 'partingshot', signatureMove: "Hazard Pass",
evs: {hp:252, def:252, spd:4}, ivs: {atk:0, spa:0}, nature: 'Bold'
},
'@HYDRO IMPACT': {
species: 'Charizard', ability: 'Rivalry', item: 'Life Orb', gender: 'M',
moves: ['airslash', 'flamethrower', 'nobleroar', 'hydropump'],
baseSignatureMove: 'hydrocannon', signatureMove: "HYDRO IMPACT",
evs: {atk:4, spa:252, spe:252}, nature: 'Hasty'
},
'@imanalt': {
species: 'Rhydon', ability: 'Prankster', item: 'Eviolite', gender: 'M',
moves: ['heartswap', 'rockblast', 'stealthrock', 'substitute', 'batonpass'],
baseSignatureMove: 'naturepower', signatureMove: "FREE GENV BH",
evs: {hp:252, atk:252, spd:4}, nature: 'Adamant'
},
'@innovamania': {
species: 'Arceus', ability: 'Pick Up', item: 'Black Glasses', gender: 'M',
moves: [['holdhands', 'trickortreat'][this.random(2)], ['swordsdance', 'agility'][this.random(2)], 'celebrate'],
baseSignatureMove: 'splash', signatureMove: "Rage Quit",
evs: {hp:4, atk:252, spe:252}, nature: 'Jolly'
},
'@jas61292': {
species: 'Malaconda', ability: 'Analytic', item: 'Safety Goggles', gender: 'M',
moves: ['coil', 'thunderwave', 'icefang', 'powerwhip', 'moonlight'],
baseSignatureMove: 'crunch', signatureMove: "Minus One",
evs: {hp:252, atk:252, spd:4}, nature: 'Adamant'
},
'@jin of the gale': {
species: 'Starmie', ability: 'Drizzle', item: 'Damp Rock', gender: 'M',
moves: ['steameruption', 'hurricane', 'recover', 'psystrike', 'quiverdance'],
baseSignatureMove: 'rapidspin', signatureMove: "Beyblade",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'@Kostitsyn-Kun': {
species: 'Gothorita', ability: 'Simple', item: 'Eviolite', gender: 'F', //requested
moves: ['calmmind', 'psyshock', ['dazzlinggleam', 'secretsword'][this.random(2)]],
baseSignatureMove: 'refresh', signatureMove: "Kawaii-desu uguu~",
evs: {hp:252, def:136, spe:120}, nature: 'Bold'
},
'@kupo': {
species: 'Pikachu', ability: 'Prankster', item: "Light Ball", gender: 'M',
moves: ['substitute', 'spore', 'encore'],
baseSignatureMove: 'transform', signatureMove: "Kupo Nuts",
evs: {hp:252, def:4, spd:252}, nature: 'Jolly'
},
'@Lawrence III': {
species: 'Lugia', ability: 'Trace', item: "Grip Claw", gender: 'M',
moves: ['infestation', 'magmastorm', 'oblivionwing'],
baseSignatureMove: 'gust', signatureMove: "Shadow Storm",
evs: {hp:248, def:84, spa:92, spd:84}, nature: 'Modest'
},
'@Layell': {
species: 'Sneasel', ability: 'Technician', item: "King's Rock", gender: 'M',
moves: ['iceshard', 'iciclespear', ['machpunch', 'pursuit', 'knockoff'][this.random(3)]],
baseSignatureMove: 'protect', signatureMove: "Pixel Protection",
evs: {hp:4, atk:252, spe:252}, nature: 'Adamant'
},
'@LegitimateUsername': {
species: 'Shuckle', ability: 'Unaware', item: 'Leftovers', gender: 'M',
moves: ['leechseed', 'rest', 'foulplay'],
baseSignatureMove: 'shellsmash', signatureMove: "Shell Fortress",
evs: {hp:252, def:228, spd:28}, nature: 'Calm'
},
'@Level 51': {
species: 'Togekiss', ability: 'Parental Bond', item: 'Leftovers', gender: 'M',
moves: ['seismictoss', 'roost', ['cosmicpower', 'cottonguard'][this.random(2)]],
baseSignatureMove: 'trumpcard', signatureMove: "Next Level Strats",
evs: {hp:252, def:4, spd:252}, nature: 'Calm'
},
'@Lyto': {
species: 'Lanturn', ability: 'Magic Bounce', item: 'Leftovers', gender: 'M',
moves: ['originpulse', 'lightofruin', 'blueflare', 'recover', 'tailglow'],
baseSignatureMove: 'thundershock', signatureMove: "Gravity Storm",
evs: {hp:188, spa:252, spe:68}, nature: 'Timid'
},
'@Marty': {
species: 'Houndoom', ability: 'Drought', item: 'Houndoominite', gender: 'M',
moves: ['nightdaze', 'solarbeam', 'aurasphere', 'thunderbolt', 'earthpower'],
baseSignatureMove: 'sacredfire', signatureMove: "Immolate",
evs: {spa:252, spd:4, spe:252}, ivs: {atk:0}, nature: 'Timid'
},
'@MattL': {
species: 'Mandibuzz', ability: 'Poison Heal', item: 'Leftovers', gender: 'M',
moves: ['oblivionwing', 'leechseed', 'quiverdance', 'topsyturvy', 'substitute'],
baseSignatureMove: 'toxic', signatureMove: "Topology",
evs: {hp:252, def:252, spd:4}, nature: 'Bold'
},
'@Morfent': {
species: 'Dusknoir', ability: 'Fur Coat', item: "Leftovers", gender: 'M',
moves: [['recover', 'acidarmor', 'swordsdance', 'willowisp', 'trickroom'][this.random(5)], 'shadowclaw', ['earthquake', 'icepunch', 'thunderpunch'][this.random(3)]],
baseSignatureMove: 'spikes', signatureMove: "Used Needles",
evs: {hp:252, atk:4, def:252}, ivs: {spe:0}, nature: 'Impish'
},
'@Nani Man': {
species: 'Gengar', ability: 'Desolate Land', item: 'Black Glasses', gender: 'M', shiny: true,
moves: ['eruption', 'swagger', 'shadow ball', 'topsyturvy', 'dazzlinggleam'],
baseSignatureMove: 'fireblast', signatureMove: "Tanned",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'@NixHex': {
species: 'Porygon2', ability: 'No Guard', item: 'Eviolite', gender: 'M', shiny: true,
moves: ['thunder', 'blizzard', 'overheat', 'triattack', 'recover'],
baseSignatureMove: 'inferno', signatureMove: "Beautiful Disaster",
evs: {hp:252, spa:252, spe:4}, nature: 'Modest'
},
'@Osiris': {
species: 'Pumpkaboo-Super', ability: 'Bad Dreams', item: 'Eviolite', gender: 'M',
moves: ['leechseed', 'recover', 'cosmicpower'],
baseSignatureMove: 'hypnosis', signatureMove: "Restless Sleep",
evs: {hp:252, def:216, spd:40}, ivs: {atk:0}, nature: 'bold'
},
'@phil': {
species: 'Gastrodon', ability: 'Drizzle', item: 'Shell Bell', gender: 'M',
moves: ['scald', 'recover', 'gastroacid', 'brine'],
baseSignatureMove: 'whirlpool', signatureMove: "Slug Attack",
evs: {hp:252, spa:252, def:4}, nature: 'Quirky'
},
'@qtrx': {
species: 'Unown', ability: 'Levitate', item: 'Focus Sash', gender: 'M',
moves: [],
baseSignatureMove: 'meditate', signatureMove: "Hidden Power... Normal?",
evs: {hp:252, def:4, spa:252}, ivs: {atk:0, spe:0}, nature: 'Quiet'
},
'@Queez': {
species: 'Cubchoo', ability: 'Prankster', item: 'Eviolite', gender: 'M',
moves: ['pound', 'fly', 'softboiled', 'thunderwave', 'waterpulse'],
baseSignatureMove: 'leer', signatureMove: "Sneeze",
evs: {hp:252, def:228, spd:28}, nature: 'Calm'
},
'@rekeri': {
species: 'Tyrantrum', ability: 'Tough Claws', item: 'Life Orb', gender: 'M',
moves: ['outrage', 'extremespeed', 'stoneedge', 'closecombat'],
baseSignatureMove: 'headcharge', signatureMove: "Land Before Time",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'@Relados': {
species: 'Terrakion', ability: 'Guts', item: 'Flame Orb', gender: 'M',
moves: ['knockoff', 'diamondstorm', 'closecombat', 'iceshard', 'drainpunch'],
baseSignatureMove: 'stockpile', signatureMove: "Loyalty",
evs: {atk:252, def:4, spe:252}, nature: 'Adamant'
},
'@Reverb': {
species: 'Slaking', ability: 'Scrappy', item: 'Assault Vest', gender: 'M',
moves: ['feint', 'stormthrow', 'blazekick'], // Feint as a countermeasure to the abundance of Protect-based set-up moves.
baseSignatureMove: 'eggbomb', signatureMove: "fat monkey",
evs: {hp:252, spd:40, spe:216}, nature: 'Jolly' // EV-nerf.
},
'@RosieTheVenusaur': {
species: 'Venusaur', ability: 'Moxie', item: 'Leftovers', gender: 'F',
moves: ['flamethrower', 'extremespeed', 'sacredfire', 'knockoff', 'closecombat'],
baseSignatureMove: 'frenzyplant', signatureMove: "Swag Plant",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'@scalarmotion': {
species: 'Cryogonal', ability: 'Magic Guard', item: 'Focus Sash', gender: 'M',
moves: ['rapidspin', 'willowisp', 'taunt', 'recover', 'voltswitch'],
baseSignatureMove: 'icebeam', signatureMove: "Eroding Frost",
evs: {spa:252, spd:4, spe:252}, nature: 'Timid'
},
'@Scotteh': {
species: 'Suicune', ability: 'Fur Coat', item: 'Leftovers', gender: 'M',
moves: ['icebeam', 'steameruption', 'recover', 'nastyplot'],
baseSignatureMove: 'boomburst', signatureMove: "Geomagnetic Storm",
evs: {def:252, spa:4, spe:252}, nature: 'Bold'
},
'@Shame That': {
species: 'Weavile', ability: 'Magic Guard', item: 'Focus Sash', gender: 'M',
moves: ['substitute', 'captivate', 'reflect', 'rest', 'raindance', 'foresight'],
baseSignatureMove: 'healingwish', signatureMove: "Extreme Compromise",
evs: {hp:252, def:4, spe:252}, nature: 'Jolly'
},
'@shaymin': {
species: 'Shaymin-Sky', ability: 'Serene Grace', item: 'Expert Belt', gender: 'F',
moves: ['seedflare', 'airslash', ['secretsword', 'earthpower', 'roost'][this.random(3)]],
baseSignatureMove: 'detect', signatureMove: "Flower Garden",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'@shrang': {
species: 'Latias', ability: 'Pixilate', item: ['Latiasite', 'Life Orb', 'Leftovers'][this.random(3)], gender: 'M',
moves: ['dracometeor', 'roost', 'nastyplot', 'fireblast', 'aurasphere', 'psystrike'], //not QD again senpai >.<
baseSignatureMove: 'judgment', signatureMove: "Pixilate", //placeholder
evs: {hp:160, spa:96, spe:252}, ivs: {atk:0}, nature: 'Timid'
},
'@Skitty': {
species: 'Audino', ability: 'Intimidate', item: 'Audinite', gender: 'M',
moves: ['acupressure', 'recover', ['taunt', 'cosmicpower', 'magiccoat'][this.random(3)]],
baseSignatureMove: 'storedpower', signatureMove: "Ultimate Dismissal",
evs: {hp:252, def:252, spd:4}, nature: 'Bold'
},
'@Snowflakes': {
species: 'Celebi', ability: 'Filter', item: 'Leftovers', gender: 'M',
moves: [
['gigadrain', ['recover', 'quiverdance'][this.random(2)], ['icebeam', 'searingshot', 'psystrike', 'thunderbolt', 'aurasphere', 'moonblast'][this.random(6)]],
['gigadrain', 'recover', [['uturn', 'voltswitch'][this.random(2)], 'thunderwave', 'leechseed', 'healbell', 'healingwish', 'reflect', 'lightscreen', 'stealthrock'][this.random(8)]],
['gigadrain', 'perishsong', ['recover', ['uturn', 'voltswitch'][this.random(2)], 'leechseed', 'thunderwave', 'healbell'][this.random(5)]],
['gigadrain', 'recover', ['thunderwave', 'icebeam', ['uturn', 'voltswitch'][this.random(2)], 'psystrike'][this.random(4)]]
][this.random(4)],
baseSignatureMove: 'thousandarrows', signatureMove: "Azalea Butt Slam",
evs: {hp:252, spa:252, def:4}, nature: 'Modest'
},
'@Spydreigon': {
species: 'Hydreigon', ability: 'Mega Launcher', item: 'Life Orb', gender: 'M',
moves: ['dragonpulse', 'darkpulse', 'aurasphere', 'originpulse', 'shiftgear'],
baseSignatureMove: 'waterpulse', signatureMove: "Mineral Pulse",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'@Steamroll': {
species: 'Growlithe', ability: 'Adaptability', item: 'Life Orb', gender: 'M',
moves: ['flareblitz', 'volttackle', 'closecombat'],
baseSignatureMove: 'protect', signatureMove: "Conflagration",
evs: {atk:252, def:4, spe:252}, nature: 'Adamant'
},
'@SteelEdges': {
species: 'Alakazam', ability: 'Competitive', item: 'Alakazite', gender: 'M',
moves: ['bugbuzz', 'hypervoice', 'psystrike', 'batonpass', 'focusblast'],
baseSignatureMove: 'tailglow', signatureMove: "True Daily Double",
evs: {hp:4, spa:252, spe:252}, nature: 'Serious'
},
'@Temporaryanonymous': {
species: 'Doublade', ability: 'Tough Claws', item: 'Eviolite', gender: 'M',
moves: ['swordsdance', ['xscissor', 'sacredsword', 'knockoff'][this.random(3)], 'geargrind'],
baseSignatureMove: 'shadowsneak', signatureMove: "SPOOPY EDGE CUT",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'@Test2017': {
species: "Farfetch'd", ability: 'Wonder Guard', item: 'Stick', gender: 'M',
moves: ['foresight', 'gastroacid', 'nightslash', 'roost', 'thousandarrows'],
baseSignatureMove: 'karatechop', signatureMove: "Ducktastic",
evs: {hp:252, atk:252, spe:4}, nature: 'Adamant'
},
'@TFC': {
species: 'Blastoise', ability: 'Prankster', item: 'Leftovers', gender: 'M',
moves: ['quiverdance', 'cottonguard', 'storedpower', 'aurasphere', 'slackoff'],
baseSignatureMove: 'drainpunch', signatureMove: "Chat Flood",
evs: {atk:252, def:4, spe:252}, nature: 'Modest'
},
'@TGMD': {
species: 'Stoutland', ability: 'Speed Boost', item: 'Life Orb', gender: 'M',
moves: [['extremespeed', 'sacredsword'][this.random(2)], 'knockoff', 'protect'],
baseSignatureMove: 'return', signatureMove: "Canine Carnage",
evs: {hp:32, atk:252, spe:224}, nature: 'Adamant'
},
'@Trickster': {
species: 'Whimsicott', ability: 'Prankster', item: 'Leftovers', gender: 'M',
moves: ['swagger', 'spore', 'seedflare', 'recover', 'nastyplot'],
baseSignatureMove: 'naturepower', signatureMove: "Cometstorm",
evs: {hp:252, spa:252, spe:4}
},
'@WaterBomb': {
species: 'Poliwrath', ability: 'Unaware', item: 'Leftovers', gender: 'M',
moves: ['heartswap', 'softboiled', 'aromatherapy', 'highjumpkick'],
baseSignatureMove: 'waterfall', signatureMove: "Water Bomb",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'@zdrup': {
species: 'Slowking', ability: 'Slow Start', item: 'Leftovers', gender: 'M',
moves: ['psystrike', 'futuresight', 'originpulse', 'slackoff', 'destinybond'],
baseSignatureMove: 'wish', signatureMove: "Premonition",
evs: {hp:252, def:4, spd:252}, nature: 'Quiet'
},
'@Zebraiken': {
species: 'zebstrika', ability: 'Compound Eyes', item: 'Life Orb', gender: 'M',
moves: ['thunder', ['fire blast', 'focusblast', 'highjumpkick', 'meteormash'][this.random(3)], ['blizzard', 'iciclecrash', 'sleeppowder'][this.random(3)]], // why on earth does he learn Meteor Mash?
baseSignatureMove: 'detect', signatureMove: "bzzt",
evs: {atk:4, spa:252, spe:252}, nature: 'Hasty'
},
// Drivers.
'%Acedia': {
species: 'Slakoth', ability: 'Magic Bounce', item: 'Quick Claw', gender: 'F',
moves: ['metronome', 'sketch', 'assist', 'swagger', 'foulplay'],
baseSignatureMove: 'worryseed', signatureMove: "Procrastination",
evs: {hp:252, atk:252, def:4}, nature: 'Serious'
},
'%Aelita': {
species: 'Porygon-Z', ability: 'Protean', item: 'Life Orb', gender: 'F',
moves: ['boomburst', 'quiverdance', 'chatter', 'blizzard', 'moonblast'],
baseSignatureMove: 'thunder', signatureMove: "Energy Field",
evs: {hp:4, spa:252, spd:252}, nature: 'Modest'
},
'%Arcticblast': {
species: 'Cresselia', ability: 'Levitate', item: 'Sitrus Berry', gender: 'M',
moves: [
['fakeout', 'icywind', 'trickroom', 'safeguard', 'thunderwave', 'tailwind', 'knockoff'][this.random(7)],
['sunnyday', 'moonlight', 'calmmind', 'protect', 'taunt'][this.random(5)],
['originpulse', 'heatwave', 'hypervoice', 'icebeam', 'moonblast'][this.random(5)]
],
baseSignatureMove: 'psychoboost', signatureMove: "Doubles Purism",
evs: {hp:252, def:120, spa:56, spd:80}, nature: 'Sassy'
},
'%Ast☆arA': {
species: 'Jirachi', ability: 'Cursed Body', item: ['Leftovers', 'Sitrus Berry'][this.random(2)], gender: 'F',
moves: ['psychic', 'moonblast', 'nastyplot', 'recover', 'surf'],
baseSignatureMove: 'psywave', signatureMove: "Star Bolt Desperation",
evs: {hp:4, spa:252, spd:252}, nature: 'Modest'
},
'%Astyanax': {
species: 'Seismitoad', ability: 'Sap Sipper', item: 'Red Card', gender: 'M',
moves: ['earthquake', 'recover', 'icepunch'],
baseSignatureMove: 'toxic', signatureMove: "Amphibian Toxin",
evs: {atk:252, spd:252, spe:4}, nature: 'Adamant'
},
'%Audiosurfer': {
species: 'Audino', ability: 'Prankster', item: 'Audinite', gender: 'M',
moves: ['boomburst', 'slackoff', 'glare'],
baseSignatureMove: 'detect', signatureMove: "Audioshield",
evs: {hp:252, spa:252, spe:4}, nature: 'Modest'
},
'%birkal': {
species: 'Rotom-Fan', ability: 'Magic Guard', item: 'Choice Scarf', gender: 'M',
moves: ['trick', 'aeroblast', ['discharge', 'partingshot', 'recover', 'tailglow'][this.random(4)]],
baseSignatureMove: 'quickattack', signatureMove: "Caw",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'%bloobblob': {
species: 'Cinccino', ability: 'Skill Link', item: 'Life Orb', gender: 'M',
moves: ['bulletseed', 'rockblast', 'uturn', 'tailslap', 'knockoff'],
baseSignatureMove: 'spikecannon', signatureMove: "Lava Whip",
evs: {atk:252, def:4, spe:252}, nature: 'Adamant'
},
'%dtc': {
species: 'Charizard', ability: 'Magic Guard', item: 'Charizardite X', gender: 'M',
moves: ['shiftgear', 'blazekick', 'roost'],
baseSignatureMove: 'dragonrush', signatureMove: "Dragon Smash",
evs: {hp:4, atk:252, spe:252}, nature: 'Adamant'
},
'%Feliburn': {
species: 'Infernape', ability: 'Adaptability', item: 'Expert Belt', gender: 'M',
moves: ['highjumpkick', 'sacredfire', 'taunt', 'fusionbolt', 'machpunch'],
baseSignatureMove: 'firepunch', signatureMove: "Falcon Punch",
evs: {atk:252, def:4, spe:252}, nature: 'Jolly'
},
'%Hugendugen': {
species: 'Latios', ability: 'Prankster', item: 'Life Orb', gender: 'M',
moves: ['taunt', 'dracometeor', 'surf', 'earthpower', 'recover', 'thunderbolt', 'icebeam'],
baseSignatureMove: 'psychup', signatureMove: "Policy Decision",
evs: {hp:4, spa:252, spe:252}, nature: 'Modest'
},
'%Jellicent': {
species: 'Jellicent', ability: 'Poison Heal', item: 'Toxic Orb', gender: 'M',
moves: ['recover', 'freezedry', 'trick', 'substitute'],
baseSignatureMove: 'surf', signatureMove: "Shot For Shot",
evs: {hp:252, def:4, spd:252}, nature: 'Calm'
},
'%LJDarkrai': {
species: 'Garchomp', ability: 'Compound Eyes', item: 'Life Orb', gender: 'M',
moves: ['dragondance', 'dragonrush', 'gunkshot', 'precipiceblades', 'sleeppowder', 'stoneedge'], name: '%LJDarkrai',
baseSignatureMove: 'blazekick', signatureMove: "Blaze Blade",
evs: {hp:4, atk:252, spe:252}, nature: 'Adamant'
},
'%Majorbling': {
species: 'Dedenne', ability: 'Levitate', item: 'Expert Belt', gender: 'M',
moves: ['moonblast', 'voltswitch', 'discharge', 'focusblast', 'taunt'],
baseSignatureMove: 'bulletpunch', signatureMove: "Focus Laser",
evs: {hp:4, spa:252, spe:252}, nature: 'Timid'
},
'%Raseri': {
species: 'Prinplup', ability: 'Regenerator', item: 'Eviolite', gender: 'M',
moves: ['defog', 'stealthrock', 'toxic', 'roar', 'bravebird'],
baseSignatureMove: 'scald', signatureMove: "Ban Scald",
evs: {hp:252, def:228, spd:28}, nature: 'Bold'
},
'%Timbuktu': {
species: 'Heatmor', ability: 'Contrary', item: 'Life Orb', gender: 'M',
moves: ['overheat', ['hammerarm', 'substitute'][this.random(2)], ['glaciate', 'thunderbolt'][this.random(2)]], // Curse didn't make sense at all so it was changed to Hammer Arm
baseSignatureMove: 'rockthrow', signatureMove: "Geoblast",
evs: {spa:252, spd:4, spe:252}, nature: 'Timid'
},
'%trinitrotoluene': {
species: 'Metagross', ability: 'Levitate', item: 'Metagrossite', gender: 'M',
moves: ['meteormash', 'zenheadbutt', 'hammerarm', 'grassknot', 'earthquake', 'thunderpunch', 'icepunch', 'shiftgear'],
baseSignatureMove: 'explosion', signatureMove: "Get Haxed",
evs: {atk:252, def:4, spe:252}, nature: 'Jolly'
},
'%uselesstrainer': {
species: 'Scatterbug', ability: 'Skill Link', item: 'Mail', gender: 'M',
moves: ['explosion', 'stringshot', 'stickyweb', 'spiderweb', 'mist'],
baseSignatureMove: 'bulletpunch', signatureMove: "Ranting",
evs: {atk:252, def:4, spe:252}, nature: 'Jolly'
},
'%xfix': {
species: 'Xatu', ability: 'Magic Bounce', item: 'Focus Sash', gender: 'M',
moves: ['thunderwave', 'substitute', 'roost'],
baseSignatureMove: 'metronome', signatureMove: "(Super Glitch)",
evs: {hp:252, spd:252, def:4}, nature: 'Calm'
},
// Voices.
'+Aldaron': {
species: 'Conkeldurr', ability: 'Speed Boost', item: 'Assault Vest', gender: 'M',
moves: ['drainpunch', 'machpunch', 'iciclecrash', 'closecombat', 'earthquake', 'shadowclaw'],
baseSignatureMove: 'superpower', signatureMove: "Admin Decision",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'+bmelts': {
species: 'Mewtwo', ability: 'Regenerator', item: 'Mewtwonite X', gender: 'M',
moves: ['batonpass', 'uturn', 'voltswitch'],
baseSignatureMove: 'partingshot', signatureMove: "Aaaannnd... he's gone",
evs: {hp:4, spa:252, spe:252}, nature: 'Modest'
},
'+Cathy': {
species: 'Aegislash', ability: 'Stance Change', item: 'Life Orb', gender: 'F',
moves: ['kingsshield', 'shadowsneak', ['calmmind', 'shadowball', 'shadowclaw', 'flashcannon', 'dragontail', 'hyperbeam'][this.random(5)]],
baseSignatureMove: 'memento', signatureMove: "HP Display Policy",
evs: {hp:4, atk:252, spa:252}, nature: 'Quiet'
},
'+Diatom': {
species: 'Spiritomb', ability: 'Parental Bond', item: 'Custap Berry', gender: 'M',
moves: ['psywave', ['poisonfang', 'shadowstrike'][this.random(2)], ['uturn', 'rapidspin'][this.random(2)]],
baseSignatureMove: 'healingwish', signatureMove: "Be Thankful I Sacrificed Myself",
evs: {hp:252, def:136, spd:120}, nature: 'Impish'
},
'+Limi': {
species: 'Primeape', ability: 'Poison Heal', item: 'Leftovers', gender: 'M',
moves: ['ingrain', 'doubleedge', 'leechseed'],
baseSignatureMove: 'growl', signatureMove: "Resilience",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
},
'+mikel': {
species: 'Giratina', ability: 'Prankster', item: 'Lum Berry', gender: 'M',
moves: ['rest', 'recycle', ['toxic', 'willowisp'][this.random(2)]],
baseSignatureMove: 'swagger', signatureMove: "Trolling Lobby",
evs: {hp:252, def:128, spd:128}, ivs: {atk:0}, nature: 'Calm'
},
'+Great Sage': {
species: 'Shuckle', ability: 'Harvest', item: 'Leppa Berry', gender: '',
moves: ['substitute', 'protect', 'batonpass'],
baseSignatureMove: 'judgment', signatureMove: "Judgment",
evs: {hp:252, def:28, spd:228}, ivs: {atk:0, def:0, spe:0}, nature: 'Bold'
},
'+Redew': {
species: 'Minun', ability: 'Wonder Guard', item: 'Air Balloon', gender: 'M',
moves: ['nastyplot', 'thunderbolt', 'icebeam'],
baseSignatureMove: 'recover', signatureMove: "Recover",
evs:{hp:4, spa:252, spe:252}, nature: 'Modest'
},
'+SOMALIA': {
species: 'Gastrodon', ability: 'Anger Point', item: 'Leftovers', gender: 'M',
moves: ['recover', 'steameruption', 'earthpower', 'leafstorm', 'substitute'],
baseSignatureMove: 'energyball', signatureMove: "Ban Everyone",
evs: {hp:252, spa:252, spd:4}, nature: 'Modest'
},
'+TalkTakesTime': {
species: 'Registeel', ability: 'Flash Fire', item: 'Leftovers', gender: 'M',
moves: ['recover', 'ironhead', 'bellydrum'],
baseSignatureMove: 'taunt', signatureMove: "Bot Mute",
evs: {hp:252, atk:252, def:4}, nature: 'Adamant'
}
};
// Generate the team randomly.
var pool = Object.keys(sets).randomize();
var ranks = {'~':'admins', '&':'leaders', '@':'mods', '%':'drivers', '+':'voices'};
var levels = {'~':99, '&':97, '@':96, '%':96, '+':95};
for (var i = 0; i < 6; i++) {
var rank = pool[i].charAt(0);
var set = sets[pool[i]];
set.level = levels[rank];
set.name = pool[i];
if (!set.ivs) {
set.ivs = {hp:31, atk:31, def:31, spa:31, spd:31, spe:31};
} else {
for (var iv in {hp:31, atk:31, def:31, spa:31, spd:31, spe:31}) {
set.ivs[iv] = set.ivs[iv] ? set.ivs[iv] : 31;
}
}
// Assuming the hardcoded set evs are all legal.
if (!set.evs) set.evs = {hp:84, atk:84, def:84, spa:84, spd:84, spe:84};
set.moves = set.moves.sample(3).concat(set.baseSignatureMove);
team.push(set);
}
// Check for Illusion.
if (team[5].name === '&Slayer95') {
var temp = team[4];
team[4] = team[5];
team[5] = temp;
}
return team;
}
};
| DaBicBoi/finite | data/scripts.js | JavaScript | mit | 151,781 |
module.exports = function(grunt){
// config
grunt.initConfig({
watch:{
scripts:{
files:['dev/*.html' , 'dev/**/**/*', '!dev/app/scss/*'],
options: {
livereload: 1337
}
},
sass:{
files:['dev/app/scss/*.scss', 'dev/app/scss/components/*.scss'],
tasks:['sass']
}
},
connect: {
server: {
options: {
port: 9002,
base:'./dev',
livereload: 1337
}
}
},
sass: {
dist: {
files: {
'dev/app/css/style.css':'dev/app/scss/style.scss'
}
},
options:{
lineNumbers: true/*,
style:'compressed'*/
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.registerTask('default',['connect','watch'] );
grunt.registerTask('compile-sass',[ 'sass'] );
};
| skeiter9/scaffold-frontend | Gruntfile.js | JavaScript | mit | 923 |
const Route = require(process.cwd()+'/../core.js').Route;
Route.get('/custom', 'hotdog@wutang');
Route.get('/dog/:number', 'hotdog@dogs');
Route.get('/hot/dog', (req, res) => {
res.send('This is one hot dog main');
});
| elegantamvc/eleganta | demo/app/routes/hotdog/dog.js | JavaScript | mit | 224 |
'use strict';
angular.module('myApp.view2', ['ngRoute', 'lazyCss.module'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view2', {
templateUrl: 'view2/view2.html',
controller: 'View2Ctrl',
cssGroup: ['view2/view2.css']
});
}])
.controller('View2Ctrl', [function() {
}]); | brayansdt/angular-lazy-css | app/view2/view2.js | JavaScript | mit | 320 |
const chai = require('chai'),
chaiAsPromised = require('chai-as-promised'),
NestedPropertyHelper = require('../src/nestedPropertyHelper.js'),
ldGraph = require('ld-graph'),
sinon = require('sinon'),
axios = require('axios'),
fs = require('fs'),
assert = chai.assert,
should = chai.should
chai.use(chaiAsPromised)
const workWithRelations = fs.readFileSync(__dirname + '/mocks/w832213854948.json', 'UTF-8')
const workWithoutMainEntry = fs.readFileSync(__dirname + '/mocks/w8308833324.json', 'UTF-8')
const workWithoutContribs = fs.readFileSync(__dirname + '/mocks/w830883854948.json', 'UTF-8')
const series = fs.readFileSync(__dirname + '/mocks/s755809170436.json', 'UTF-8')
describe('Extracting nested properties from graphs', function () {
describe('Extracting nested properties from work', function () {
it('can extract mainEntryName', function () {
const graph = ldGraph.parse(JSON.parse(workWithRelations))
return assert.equal(NestedPropertyHelper.mainEntryName(graph.byType('Work')[ 0 ]), 'Olsen, Karl')
})
it('returns empty when contribution is not main entry', function () {
const graph = ldGraph.parse(JSON.parse(workWithoutMainEntry))
return assert.equal(NestedPropertyHelper.mainEntryName(graph.byType('Work')[ 0 ]), '')
})
it('returns empty when no contributions', function () {
const graph = ldGraph.parse(JSON.parse(workWithoutContribs))
return assert.equal(NestedPropertyHelper.mainEntryName(graph.byType('Work')[ 0 ]), '')
})
})
describe('Extracting nested properties from series', function () {
before(function (done) {
// http requests from axios used in module, faking returned promises
sinon.stub(axios, "get", function (path) {
switch (path) {
case "/services/corporation/c992230760239":
return Promise.resolve({ data: fs.readFileSync(__dirname + "/mocks/c992230760239.json", "UTF-8") });
}
})
done()
})
it('can extract series publisher name', function () {
const graph = ldGraph.parse(JSON.parse(series))
return assert.eventually.equal(NestedPropertyHelper.publisherName(graph.byType('Serial')[ 0 ]), 'Noregs Bondelag (Stjørdal)')
})
})
})
| digibib/ls.ext | redef/catalinker/client/test/nestedPropertyHelperSpec.js | JavaScript | mit | 2,243 |
// app/routes/tweet.js
module.exports = function(app,tweetRoutes) {
// used to create, sign, and verify tokens
var jwt = require('jsonwebtoken'); //https://npmjs.org/package/node-jsonwebtoken
var expressJwt = require('express-jwt'); //https://npmjs.org/package/express-jwt
var async = require('async');
var Tweet = require('../models/tweet'); // get our mongoose model
var User = require('../models/user');
var Word = require('../models/word');
tweetRoutes.get('/dual', function(req, res) {
Tweet.find(function(err, tweets) {
if (err)
res.send(err);
console.log(tweets);
res.json(tweets);
});
});
// http://localhost:8080/api/users/:username/tweets
tweetRoutes.route('/users/:username/tweets')
// get all the tweets
.get(function(req, res) {
Tweet.find({user_id: req.user._id}, function(err, tweets) {
console.log(req.user._id);
if (err)
res.send(err);
res.json(tweets);
});
})
// create a tweet
.post(function(req, res) {
var content = req.body.content;
var scs = true;
var msg = 'Tweet created!';
var words = content.split(' '); // separate by space
words = words.filter(function(value){return value!='';}); // remove extra spaces
console.log(words);
size = words.length;
// Array to hold async tasks
var asyncTasks = [];
// Loop through words
words.forEach(function(word){
// We don't actually execute the async action here
// We add a function containing it to an array of "tasks"
asyncTasks.push(function(callback){
// Call an async function, often a save() to DB
Word.findOne({text: word}, function(err, w) {
if (err)
res.send(err);
// if word is found
console.log(w);
if (w == null){
//console.log(msg);
scs = false;
msg = "Inexistent word(s) in tweet";
}
callback();
});
});
});
// At this point, nothing has been executed.
// We just pushed all the async tasks into an array.
// Then, whe add another task after iterations
asyncTasks.push(function(callback){
// Set a timeout for 3 seconds
if (scs){
var tweet = new Tweet(); // creating tweet
tweet.user_id = req.user._id;
tweet.content = words.join(' ');
tweet.date = Date.now();
tweet.save(function(err) {
if (err)
res.send(err);
});
}
callback();
});
// Now we have an array of functions doing async tasks
// Execute all async tasks in the asyncTasks array
async.series(asyncTasks, function(){
// All tasks are done now
res.json({ success: scs, message: msg });
});
});
// on routes that end in /users/:username/tweets/:tweet_id
// ----------------------------------------------------
tweetRoutes.route('/users/:username/tweets/:tweet_id')
// get the tweet with that id (accessed at GET http://localhost:8080/api/users/:username/tweets/:tweet_id)
.get(function(req, res) {
Tweet.findById(req.params.tweet_id, function(err, tweet) {
if (err)
res.send(err);
res.json(tweet);
});
})
//*
// update the tweet with this id (accessed at PUT http://localhost:8080/api/users/:username/tweets/:tweet_id)
.put(function(req, res) {
var content = req.body.content;
var scs = true;
var msg = 'Tweet updated!';
var words = content.split(' '); // separate by space
words = words.filter(function(value){return value!='';}); // remove extra spaces
console.log(words);
size = words.length;
// Array to hold async tasks
var asyncTasks = [];
// Loop through words
words.forEach(function(word){
// We don't actually execute the async action here
// We add a function containing it to an array of "tasks"
asyncTasks.push(function(callback){
// Call an async function, often a save() to DB
Word.findOne({text: word}, function(err, w) {
if (err)
res.send(err);
// if word is found
console.log(w);
if (w == null){
//console.log(msg);
scs = false;
msg = "Inexistent word(s) in tweet";
}
callback();
});
});
});
// At this point, nothing has been executed.
// We just pushed all the async tasks into an array.
// Then, whe add another task after iterations
asyncTasks.push(function(callback){
if (scs){
// finding tweet
Tweet.findById(req.params.tweet_id, function(err, tweet) {
if (err)
res.send(err);
tweet.content = words.join(' ');
// save the tweet
tweet.save(function(err) {
if (err)
res.send(err);
});
});
}
callback();
});
// Now we have an array of functions doing async tasks
// Execute all async tasks in the asyncTasks array
async.series(asyncTasks, function(){
// All tasks are done now
res.json({ success: scs, message: msg });
});
})
//*/
// delete the tweet with this id (accessed at DELETE http://localhost:8080/api/users/:username/tweets/:tweet_id)
.delete(function(req, res) {
Tweet.remove({
_id: req.params.tweet_id
}, function(err, tweet) {
if (err)
res.send(err);
res.json({ message: 'Tweet successfully deleted' });
});
});
// We are going to protect /api/words routes with JWT
app.use('/api/dual', expressJwt({secret: app.get('superSecret')}));
//app.use('/api/users/:username/tweets', expressJwt({secret: app.get('superSecret')}));
} | ybra1993/duckface-api | app/routes/tweet.js | JavaScript | mit | 7,491 |
// @flow
import { combineReducers } from 'redux'
import ColumnBookmark from 'containers/ColumnBookmark/reducer'
import ColumnFollow from 'containers/ColumnFollow/reducer'
import ColumnHistory from 'containers/ColumnHistory/reducer'
import ColumnManager from 'containers/ColumnManager/reducer'
import ColumnRanking from 'containers/ColumnRanking/reducer'
import ColumnRankingR18 from 'containers/ColumnRankingR18/reducer'
import ColumnRecommended from 'containers/ColumnRecommended/reducer'
import ColumnSearch from 'containers/ColumnSearch/reducer'
import ColumnUserIllust from 'containers/ColumnUserIllust/reducer'
import DrawerManager from 'containers/DrawerManager/reducer'
import HeaderContainer from 'containers/HeaderContainer/reducer'
import IllustById from 'containers/IllustById/reducer'
import IllustPreview from 'containers/IllustPreview/reducer'
import Language from 'containers/Language/reducer'
import LoginModal from 'containers/LoginModal/reducer'
import MangaPreview from 'containers/MangaPreview/reducer'
import ModalManeger from 'containers/ModalManeger/reducer'
import SearchField from 'containers/SearchField/reducer'
import SettingModal from 'containers/SettingModal/reducer'
import Table from 'containers/Table/reducer'
import UserById from 'containers/UserById/reducer'
import UserDrawerContainer from 'containers/UserDrawerContainer/reducer'
import UserPopoverContainer from 'containers/UserPopoverContainer/reducer'
export default combineReducers({
ColumnBookmark,
ColumnFollow,
ColumnHistory,
ColumnManager,
ColumnRanking,
ColumnRankingR18,
ColumnRecommended,
ColumnSearch,
ColumnUserIllust,
DrawerManager,
HeaderContainer,
IllustById,
IllustPreview,
Language,
LoginModal,
MangaPreview,
ModalManeger,
SearchField,
SettingModal,
Table,
UserById,
UserDrawerContainer,
UserPopoverContainer,
})
| akameco/PixivDeck | app/reducer.js | JavaScript | mit | 1,865 |
import asyncRoute from 'static/asyncroute';
export const About = asyncRoute(() => import('./about'));
export const Home = asyncRoute(() => import('./home'));
export const Layout = asyncRoute(() => import('./layout'));
export const NotFound = asyncRoute(() => import('./notfound'));
if (process.env.NODE_ENV === 'development') {
require('./about');
require('./home');
require('./layout');
require('./notfound');
}
| CodeMakeBros/react-minimum-universal | src/containers/index.js | JavaScript | mit | 423 |
$.validator.addMethod(
"different",
function(value, el, param) {
var otherVal = $("[name=" +param+ "]").val().trim();
value = value.trim();
return (otherVal!=value) || (!value && !otherVal);
},
""
); | matfish2/one-validator | src/Fish/OneValidator/assets/js/custom-rules/different.js | JavaScript | mit | 241 |
import Ember from 'ember';
import intercom from 'intercom';
const {
get,
merge,
Service,
computed,
assert,
run: { scheduleOnce }
} = Ember;
export default Service.extend({
api: intercom,
_userNameProp: computed('config.userProperties.nameProp', function() {
return get(this, `user.${get(this, 'config.userProperties.nameProp')}`);
}),
_userEmailProp: computed('config.userProperties.emailProp', function() {
return get(this, `user.${get(this, 'config.userProperties.emailProp')}`);
}),
_userCreatedAtProp: computed('config.userProperties.createdAtProp', function() {
return get(this, `user.${get(this, 'config.userProperties.createdAtProp')}`);
}),
user: {
name: null,
email: null
},
_hasUserContext: computed('user', '_userNameProp', '_userEmailProp', '_userCreatedAtProp', function() {
return !!get(this, 'user') &&
!!get(this, '_userNameProp') &&
!!get(this, '_userEmailProp');
}),
_intercomBootConfig: computed('_hasUserContext', function() {
let appId = get(this, 'config.appId');
assert('You must supply an "ENV.intercom.appId" in your "config/environment.js" file.', appId);
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
let obj = {
app_id: appId
};
if (get(this, '_hasUserContext')) {
obj.name = get(this, '_userNameProp');
obj.email = get(this, '_userEmailProp');
if (get(this, '_userCreatedAtProp')) {
obj.created_at = get(this, '_userCreatedAtProp');
}
}
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers
return obj;
}),
start(bootConfig = {}) {
let _bootConfig = merge(get(this, '_intercomBootConfig'), bootConfig);
scheduleOnce('afterRender', () => this.get('api')('boot', _bootConfig));
},
stop() {
scheduleOnce('afterRender', () => this.get('api')('shutdown'));
},
update(properties = {}) {
scheduleOnce('afterRender', () => this.get('api')('update', properties));
}
});
| seawatts/ember-intercom-io | addon/services/intercom.js | JavaScript | mit | 1,999 |
define(
({
// local representation of all CSS3 named colors, companion to dojo.colors. To be used where descriptive information
// is required for each color, such as a palette widget, and not for specifying color programatically.
//Note: due to the SVG 1.0 spec additions, some of these are alternate spellings for the same color (e.g. gray / grey).
//TODO: should we be using unique rgb values as keys instead and avoid these duplicates, or rely on the caller to do the reverse mapping?
aliceblue: "alice blue",
antiquewhite: "antique white",
aqua: "ฟ้าน้ำทะเล",
aquamarine: "aquamarine",
azure: "น้ำเงินฟ้า",
beige: "น้ำตาลเบจ",
bisque: "bisque",
black: "ดำ",
blanchedalmond: "blanched almond",
blue: "น้ำเงิน",
blueviolet: "น้ำเงินม่วง",
brown: "น้ำตาล",
burlywood: "burlywood",
cadetblue: "cadet blue",
chartreuse: "chartreuse",
chocolate: "ช็อกโกแลต",
coral: "coral",
cornflowerblue: "cornflower blue",
cornsilk: "cornsilk",
crimson: "แดงเลือดหมู",
cyan: "เขียวแกมน้ำเงิน",
darkblue: "น้ำเงินเข้ม",
darkcyan: "เขียวแกมน้ำเงินเข้ม",
darkgoldenrod: "dark goldenrod",
darkgray: "เทาเข้ม",
darkgreen: "เขียวเข้ม",
darkgrey: "เทาเข้ม", // same as darkgray
darkkhaki: "dark khaki",
darkmagenta: "แดงแกมม่วงเข้ม",
darkolivegreen: "เขียวโอลีฟเข้ม",
darkorange: "ส้มเข้ม",
darkorchid: "dark orchid",
darkred: "แดงเข้ม",
darksalmon: "dark salmon",
darkseagreen: "dark sea green",
darkslateblue: "dark slate blue",
darkslategray: "dark slate gray",
darkslategrey: "dark slate gray", // same as darkslategray
darkturquoise: "dark turquoise",
darkviolet: "ม่วงเข้ม",
deeppink: "ชมพูเข้ม",
deepskyblue: "deep sky blue",
dimgray: "dim gray",
dimgrey: "dim gray", // same as dimgray
dodgerblue: "dodger blue",
firebrick: "สีอิฐ",
floralwhite: "floral white",
forestgreen: "forest green",
fuchsia: "fuchsia",
gainsboro: "gainsboro",
ghostwhite: "ghost white",
gold: "ทอง",
goldenrod: "goldenrod",
gray: "เทา",
green: "เขียว",
greenyellow: "เขียวแกมเหลือง",
grey: "เทา", // same as gray
honeydew: "honeydew",
hotpink: "hot pink",
indianred: "indian red",
indigo: "indigo",
ivory: "งาช้าง",
khaki: "khaki",
lavender: "ม่วงลาเวนเดอร์",
lavenderblush: "lavender blush",
lawngreen: "lawn green",
lemonchiffon: "lemon chiffon",
lightblue: "น้ำเงินอ่อน",
lightcoral: "light coral",
lightcyan: "เขียวแกมน้ำเงินอ่อน",
lightgoldenrodyellow: "light goldenrod yellow",
lightgray: "เทาอ่อน",
lightgreen: "เขียวอ่อน",
lightgrey: "เทาอ่อน", // same as lightgray
lightpink: "ชมพูอ่อน",
lightsalmon: "light salmon",
lightseagreen: "light sea green",
lightskyblue: "ฟ้าอ่อน",
lightslategray: "light slate gray",
lightslategrey: "light slate gray", // same as lightslategray
lightsteelblue: "light steel blue",
lightyellow: "เหลืองอ่อน",
lime: "เหลืองมะนาว",
limegreen: "เขียวมะนาว",
linen: "linen",
magenta: "แดงแกมม่วง",
maroon: "น้ำตาลแดง",
mediumaquamarine: "medium aquamarine",
mediumblue: "medium blue",
mediumorchid: "medium orchid",
mediumpurple: "medium purple",
mediumseagreen: "medium sea green",
mediumslateblue: "medium slate blue",
mediumspringgreen: "medium spring green",
mediumturquoise: "medium turquoise",
mediumvioletred: "medium violet-red",
midnightblue: "midnight blue",
mintcream: "mint cream",
mistyrose: "misty rose",
moccasin: "ม็อคค่า",
navajowhite: "navajo white",
navy: "น้ำเงินเข้ม",
oldlace: "old lace",
olive: "โอลีฟ",
olivedrab: "olive drab",
orange: "ส้ม",
orangered: "ส้มแกมแดง",
orchid: "orchid",
palegoldenrod: "pale goldenrod",
palegreen: "pale green",
paleturquoise: "pale turquoise",
palevioletred: "pale violet-red",
papayawhip: "papaya whip",
peachpuff: "peach puff",
peru: "peru",
pink: "ชมพู",
plum: "plum",
powderblue: "powder blue",
purple: "ม่วง",
red: "แดง",
rosybrown: "rosy brown",
royalblue: "royal blue",
saddlebrown: "saddle brown",
salmon: "salmon",
sandybrown: "sandy brown",
seagreen: "sea green",
seashell: "seashell",
sienna: "sienna",
silver: "เงิน",
skyblue: "sky blue",
slateblue: "slate blue",
slategray: "slate gray",
slategrey: "slate gray", // same as slategray
snow: "snow",
springgreen: "spring green",
steelblue: "steel blue",
tan: "tan",
teal: "teal",
thistle: "thistle",
tomato: "tomato",
transparent: "สีใส",
turquoise: "turquoise",
violet: "ม่วง",
wheat: "wheat",
white: "ขาว",
whitesmoke: "ขาวควัน",
yellow: "เหลือง",
yellowgreen: "เหลืองแกมเขียว"
})
);
| aguadev/aguadev | html/dojo-1.8.3/dwb/src/main/webapp/js/build/amd_loader/nls/th/colors.js | JavaScript | mit | 5,369 |
function BaseRenderer(selector) {
this._select = document.querySelector(selector);
this._container = document.createElement("div");
this._container.classList.add("select-container");
this._list = document.createElement("div");
this._list.classList.add("select-list");
this._input = null;
this._values = [];
}
BaseRenderer.prototype = Object.create(IRenderer.prototype);
BaseRenderer.prototype.render = function () {
this._select.style.display = "none";
this._values = this._renderValues();
this._input = this._renderInput();
this._values.forEach(function(item) {
this._list.appendChild(item.getView());
}.bind(this));
this._container.appendChild(this._input.getView());
this._container.appendChild(this._list);
this._select.parentNode.insertBefore(this._container, this._select);
};
BaseRenderer.prototype._renderInput = function () {
return null;
};
BaseRenderer.prototype._renderValues = function () {
return null;
};
BaseRenderer.prototype.getInput = function () {
return this._input;
};
BaseRenderer.prototype.getValues = function () {
return this._values;
}; | telmanagababov/js-patterns-examples | bridge/src/renderer/BaseRenderer.js | JavaScript | mit | 1,089 |
//The MIT License (MIT)
//
//Copyright (c) 2015 Satoshi Fujiwara
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//
//The above copyright notice and this permission notice shall be included in
//all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/d3/3.5.2/d3.js" />
/// <reference path="http://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.js" />
/// <reference path="..\intellisense\q.intellisense.js" />
/// <reference path="dsp.js" />
/// <reference path="pathSerializer.js" />
// リリース時にはコメントアウトすること
//document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
//':35729/livereload.js?snipver=2"></' + 'script>');
var fs = require('fs');
// from gist
// https://gist.github.com/gabrielflorit/3758456
function createShape(geometry, color, x, y, z, rx, ry, rz, s) {
// flat shape
// var geometry = new THREE.ShapeGeometry( shape );
var material = new THREE.MeshBasicMaterial({
color: color,
side: THREE.DoubleSide,
overdraw: true
});
var mesh = new THREE.Mesh(geometry, material);
mesh.position.set(x, y, z);
mesh.rotation.set(rx, ry, rz);
mesh.scale.set(s, s, s);
return mesh;
}
// メイン
window.addEventListener('load', function () {
var preview = window.location.search.match(/preview/ig);
var WIDTH = window.innerWidth, HEIGHT = window.innerHeight;
var renderer = new THREE.WebGLRenderer({ antialias: false, sortObjects: true });
renderer.setSize(WIDTH, HEIGHT);
renderer.setClearColor(0x000000, 1);
renderer.domElement.id = 'console';
renderer.domElement.className = 'console';
renderer.domElement.style.zIndex = 0;
d3.select('#content').node().appendChild(renderer.domElement);
// var ctx2d = d3.select('#console').node().getContext('2d');
renderer.clear();
// シーンの作成
var scene = new THREE.Scene();
// カメラの作成
var camera = new THREE.PerspectiveCamera(90.0, WIDTH / HEIGHT);
camera.position.x = 0.0;
camera.position.y = 0.0;
camera.position.z = (WIDTH / 2.0) * HEIGHT / WIDTH;
camera.lookAt(new THREE.Vector3(0.0, 0.0, 0.0));
var horseGroups = [];
window.addEventListener('resize', function () {
WIDTH = window.innerWidth;
HEIGHT = window.innerHeight;
renderer.setSize(WIDTH, HEIGHT);
camera.aspect = WIDTH / HEIGHT;
camera.position.z = (WIDTH / 2.0) * HEIGHT / WIDTH;
camera.updateProjectionMatrix();
});
var gto;
try {
var shapes = [];
for (var i = 0; i < 11; ++i) {
var id = 'horse' + ('0' + i).slice(-2);
var path = fs.readFileSync('./media/' + id + '.json', 'utf-8');
// デシリアライズ
shape = SF.deserialize(JSON.parse(path)).toShapes();
var shapeGeometry = new THREE.ShapeGeometry(shape);
shapes.push({ name: id, shape: shapeGeometry });
}
var ggroup = new THREE.Group();
for (var i = 0; i < 1; ++i) {
var group = new THREE.Group();
shapes.forEach(function (sm) {
var shapeMesh = createShape(sm.shape, 0xFFFF00, 0, 0, 0, 0, 0, 0, 1.0);
shapeMesh.visible = false;
shapeMesh.name = sm.name;
group.add(shapeMesh);
});
group.position.x = 0;
group.position.y = 0;
// group.position.z = 2000.0 * Math.random() - 1000.0;
horseGroups.push(group);
ggroup.add(group);
}
scene.add(ggroup);
ggroup.name = 'world';
d3.select('#svg').remove();
} catch (e) {
console.log(e + '\n' + e.stack);
}
// FFT表示用テクスチャ
var canvas = document.createElement('canvas');
canvas.width = WIDTH;
canvas.height = HEIGHT;
var ctx = canvas.getContext('2d');
ctx.fillStyle = "rgba(0,0,0,0.0)";
ctx.clearRect(0,0,WIDTH,HEIGHT);
var ffttexture = new THREE.Texture(canvas);
ffttexture.needsUpdate = true;
var fftgeometry = new THREE.PlaneBufferGeometry(WIDTH,HEIGHT);
var fftmaterial = new THREE.MeshBasicMaterial({map:ffttexture,transparent:true});
var fftmesh = new THREE.Mesh(fftgeometry,fftmaterial);
fftmesh.position.z = 0.00;
scene.add(fftmesh);
//レンダリング
var r = 0.0;
var step = 48000 / 30;
var fftsize = 256;
var fft = new FFT(fftsize, 48000);
var waveCount = 0;
var index = 0;
var horseAnimSpeed = (60.0 / (143.0 * 11.0));
var time = 0.0;
var frameNo = 0;
var endTime = 60.0 * 4.0 + 35.0;
var frameSpeed = 1.0 / 30.0;
var delta = frameSpeed;
var previewCount = 0;
var chR;
var chL;
function renderToFile(preview) {
if (preview) {
// プレビュー
previewCount++;
if ((previewCount & 1) == 0) {
requestAnimationFrame(renderToFile.bind(renderToFile, true));
return;
}
}
delta -= horseAnimSpeed;
if (delta < 0) {
delta += frameSpeed;
++index;
if (index > 10) { index = 0; }
}
time += frameSpeed;
if (time > endTime) {
if (parent) {
parent.postMessage('end','*');
}
window.close();
return;
}
++frameNo;
var idx = parseInt(index,10);
for (var i = 0, end = horseGroups.length; i < end; ++i) {
var g = horseGroups[i];
g.getObjectByName('horse' + ('00' + idx.toString(10)).slice(-2)).visible = true;
if (idx == 0) {
g.getObjectByName('horse10').visible = false;
} else {
g.getObjectByName('horse' + ('00' + (idx - 1).toString(10)).slice(-2)).visible = false;
}
}
ctx.fillStyle = 'rgba(0,0,0,0.0)';
ctx.clearRect(0,0,WIDTH,HEIGHT);
ctx.fillStyle = 'rgba(255,0,0,0.5)';
fft.forward(chR.subarray(waveCount,waveCount + fftsize));
var spectrum = fft.real;
for(var x = 0,e = fftsize / 2;x < e;++x){
var h = Math.abs(spectrum[x]) * HEIGHT / 8;
ctx.fillRect(x * 8 + 100,HEIGHT / 2 - h,5,h);
}
fft.forward(chL.subarray(waveCount,waveCount + fftsize));
spectrum = fft.real;
for(var x = 0,e = fftsize / 2;x < e;++x){
var h = Math.abs(spectrum[x]) * HEIGHT / 8;
ctx.fillRect(x * 8 + 100,HEIGHT / 2,5,h);
}
waveCount += step;
if(waveCount > chR.length){
if(parent){
parent.postMessage("end");
}
window.close();
}
ffttexture.needsUpdate =true;
renderer.render(scene, camera);
if (!preview) {
// canvasのtoDataURLを使用した実装
var data = d3.select('#console').node().toDataURL('image/png');
data = data.substr(data.indexOf(',') + 1);
var buffer = new Buffer(data, 'base64');
Q.nfcall(fs.writeFile, './temp/out' + ('000000' + frameNo.toString(10)).slice(-6) + '.png', buffer, 'binary')
.then(renderToFile)
.catch(function(e){
console.log(err);
});
} else {
// プレビュー
requestAnimationFrame(renderToFile.bind(renderToFile, true));
}
}
//function render(index) {
// index += 0.25;
// if (index > 10.0) index = 0.0;
// var idx = parseInt(index, 10);
// for (var i = 0, end = horseGroups.length; i < end; ++i) {
// var g = horseGroups[i];
// g.getObjectByName('horse' + ('00' + idx.toString(10)).slice(-2)).visible = true;
// if (idx == 0) {
// g.getObjectByName('horse10').visible = false;
// } else {
// g.getObjectByName('horse' + ('00' + (idx - 1).toString(10)).slice(-2)).visible = false;
// }
// }
// renderer.render(scene, camera);
//};
SF.Audio.load().then(function () {
chL = SF.Audio.source.buffer.getChannelData(0);
chR = SF.Audio.source.buffer.getChannelData(1);
renderToFile(preview);
}).catch(function (e) {
console.log(e);
});
});
| sfpgmr/HTML5ToYouTube | contents/rydeen001/index.js | JavaScript | mit | 8,513 |
import ShareButton from '../components/share-button';
import layout from '../templates/components/gplus-share-button';
export default ShareButton.extend({
layout,
shareURL: '//plus.google.com/share',
classNames: ['gplus-share-button', 'share-button'],
click() {
let url = this.get('shareURL');
url += '?url=' + encodeURIComponent(this.getCurrentUrl());
this.openSharePopup(url);
}
});
| Crabar/ember-social-share | addon/components/gplus-share-button.js | JavaScript | mit | 408 |
import BasicAdapter from "ember-debug/adapters/basic";
import Port from "ember-debug/port";
import ObjectInspector from "ember-debug/object-inspector";
import GeneralDebug from "ember-debug/general-debug";
import RenderDebug from "ember-debug/render-debug";
import ViewDebug from "ember-debug/view-debug";
import RouteDebug from "ember-debug/route-debug";
import DataDebug from "ember-debug/data-debug";
import PromiseDebug from "ember-debug/promise-debug";
import ContainerDebug from "ember-debug/container-debug";
var EmberDebug;
var Ember = window.Ember;
EmberDebug = Ember.Namespace.extend({
application: null,
started: false,
Port: Port,
Adapter: BasicAdapter,
// These two are used to make RSVP start instrumentation
// even before this object is created
// all events triggered before creation are injected
// to this object as `existingEvents`
existingEvents: Ember.computed(function() { return []; }).property(),
existingCallbacks: Ember.computed(function() { return {}; }).property(),
start: function() {
if (this.get('started')) {
this.reset();
return;
}
this.set('started', true);
if (!this.get('application')) {
this.set('application', getApplication());
}
this.reset();
this.get("adapter").debug("Ember Inspector Active");
},
destroyContainer: function() {
var self = this;
['dataDebug',
'viewDebug',
'routeDebug',
'objectInspector',
'generalDebug',
'renderDebug',
'promiseDebug',
'containerDebug',
].forEach(function(prop) {
var handler = self.get(prop);
if (handler) {
Ember.run(handler, 'destroy');
self.set(prop, null);
}
});
},
startModule: function(prop, Module) {
this.set(prop, Module.create({ namespace: this }));
},
reset: function() {
this.destroyContainer();
Ember.run(this, function() {
this.startModule('adapter', this.Adapter);
this.startModule('port', this.Port);
this.startModule('generalDebug', GeneralDebug);
this.startModule('renderDebug', RenderDebug);
this.startModule('objectInspector', ObjectInspector);
this.startModule('routeDebug', RouteDebug);
this.startModule('viewDebug', ViewDebug);
this.startModule('dataDebug', DataDebug);
this.startModule('promiseDebug', PromiseDebug);
this.startModule('containerDebug', ContainerDebug);
this.generalDebug.sendBooted();
this.viewDebug.sendTree();
});
},
inspect: function(obj) {
this.get('objectInspector').sendObject(obj);
this.get('adapter').log('Sent to the Object Inspector');
return obj;
}
}).create();
function getApplication() {
var namespaces = Ember.Namespace.NAMESPACES,
application;
namespaces.forEach(function(namespace) {
if(namespace instanceof Ember.Application) {
application = namespace;
return false;
}
});
return application;
}
export default EmberDebug;
| rwjblue/ember-inspector | ember_debug/main.js | JavaScript | mit | 2,974 |
describe('Home', function () {
beforeEach(function () {
browser.get('/');
});
beforeAll(function () {
browser.executeScript('window.localStorage.clear();');
});
afterAll(function() {
browser.executeScript('window.localStorage.clear();');
});
it('should have <mrs-home>', function () {
var home = element(by.css('mrs-app mrs-home'));
expect(home.isPresent()).toEqual(true);
});
describe('- If user does not have a collection', function () {
it('should display a single link', function () {
var LinksCount = element(by.css('mrs-home .greetings-links'))
.all(by.css('a'))
.count();
expect(LinksCount).toBe(1);
});
it('should display a link to library', function () {
var link = element(by.css('mrs-home .greetings-links'))
.all(by.css('a'))
.get(0);
link.getAttribute('href')
.then(function(href) {
expect(href).toContain('/library');
});
});
});
describe('- If user has a collection', function () {
beforeAll(function() {
browser.executeScript('return window.localStorage.setItem(\'marvel-reading-stats\', \'{"comics": [ [12, {"id": 12}] ]}\');');
});
it('should display two link', function () {
var LinksCount = element(by.css('mrs-home .greetings-links'))
.all(by.css('a'))
.count();
expect(LinksCount).toBe(2);
});
it('should display a link to collection', function () {
var link = element(by.css('mrs-home .greetings-links'))
.all(by.css('a'))
.get(0);
link.getAttribute('href')
.then(function(href) {
expect(href).toContain('/collection');
});
});
it('should display a link to library', function () {
var link = element(by.css('mrs-home .greetings-links'))
.all(by.css('a'))
.get(1);
link.getAttribute('href')
.then(function(href) {
expect(href).toContain('/library');
});
});
});
});
| SBats/marvel-reading-stats-frontend | src/app/home/home.component.e2e-spec.js | JavaScript | mit | 2,006 |
'use strict';
var MenuItem = require('../dist/AppDrawer/MenuItem')
var Drawer = require('../dist/AppDrawer/Drawer')
var Divider = require('../dist/AppDrawer/Divider')
var ExpandVisible = require('../dist/AppDrawer/components/ExpandVisible')
var AppDrawerDomain = require('../dist/AppDrawer/AppDrawerDomain')
module.exports = {
MenuItem: MenuItem.default,
Drawer: Drawer.default,
Divider: Divider.default,
ExpandVisible: ExpandVisible.default,
AppDrawerDomain: AppDrawerDomain.AppDrawerDomain,
}
| mindhivenz/mui-components | AppDrawer/index.js | JavaScript | mit | 507 |
const highPass = (target = {}, { cutoff = 5 } = {}) => {
target.highPass = (n) => {
return n >= cutoff;
};
return target;
};
const lowPass = (target = {}, { cutoff = 5 } = {}) => {
target.lowPass = (n) => {
return n <= cutoff;
};
return target;
};
const createFilter = ({ highPassCutoff = 5, lowPassCutoff = 5 }) => {
let target = {};
target = highPass(target, { cutoff: highPassCutoff });
target = lowPass(target, { cutoff: lowPassCutoff });
return target;
};
export default createFilter;
| learn-javascript-courses/composition-examples | examples/simple-factory-encapsulation/index.js | JavaScript | mit | 523 |
module.exports = {
'all': {
'src': ['src/assets/sprites/*.png'],
// Location to output spritesheet
'destImg': 'src/assets/pngoptimized/sprite.png',
// Stylus with variables under sprite names
'destCSS': 'src/less/sprite.less',
'algorithm': 'binary-tree',
// OPTIONAL: Specify padding between images
'padding': 2,
'cssFormat': 'less',
'cssVarMap': function (sprite) {
// `sprite` has `name`, `image` (full path), `x`, `y`
// `width`, `height`, `total_width`, `total_height`
// EXAMPLE: Prefix all sprite names with 'sprite-'
sprite.name = 'sprite-' + sprite.name;
},
// OPTIONAL: Specify settings for algorithm
'algorithmOpts': {
// Skip sorting of images for algorithm (useful for sprite animations)
'sort': false
},
'imgOpts': {
// Format of the image (inferred from destImg' extension by default) (jpg, png)
'format': 'png'
},
// OPTIONAL: Specify css options
'cssOpts': {
// Some templates allow for skipping of function declarations
'functions': false,
// CSS template allows for overriding of CSS selectors
'cssClass': function (item) {
return '.sprite-' + item.name;
}
}
}
} | StephanGerbeth/tessel | grunt/conf/sprite.js | JavaScript | mit | 1,419 |
var submitted = new ReactiveVar(false);
Template.userFeedbackForm.created = function(){
submitted.set( false );
};
Template.userFeedbackForm.helpers({
submitted: function(){
return submitted.get();
}
});
AutoForm.addHooks(['userFeedbackForm'],{
onSuccess: function(){
submitted.set( true );
// kind of hacky, would prefer a callback.
Meteor.setTimeout(function(){
Modal.hide('userFeedbackModal');
submitted.set( false );
}, 2500);
}
});
Template.userFeedbackBtn.events({
'click': function(){
Modal.show('userFeedbackModal');
}
});
Template.userFeedbackAdmin.created = function(){
this.subscribe('userFeedback');
};
Template.userFeedbackAdmin.helpers({
feedback: function(){
return UserFeedback.find();
}
});
| jimmiebtlr/user-feedback | client/templates.js | JavaScript | mit | 778 |
/**
* Extend the form module to be able to output text input fields
*/
var formModule = angular.module('mlcl_forms.form');
/**
* fieldStringText - Function for string text rendering
*
* @param {function} $compile compile function
* @param {function} $templateCache angular templatecache
* @param {function} $rootScope description
* @return {type} description
*/
var fieldStringText = function fieldStringText($compile, $templateCache, $rootScope) {
return function(fieldScope) {
var self = this;
this.render = function() {
var inputHtml = $templateCache.get('plugins/field_string_password/field_string_password.tpl.html');
self.htmlObject = $compile(inputHtml)(fieldScope);
return this;
};
};
};
formModule.factory('string:password', ['$compile', '$templateCache', '$rootScope', fieldStringText]);
| molecuel/mlcl_forms | src/app/plugins/field_string_password/field_string_password.js | JavaScript | mit | 874 |