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
|
---|---|---|---|---|---|
define("ace/snippets/typescript",["require","exports","module"],function(e,t,p){"use strict";t.snippetText=undefined,t.scope="typescript"});
//# sourceMappingURL=node_modules/ace-builds/src-min/snippets/typescript.js.map
|
sdonaghey03/hia-forum
|
build/public/src/modules/ace/snippets/typescript.js
|
JavaScript
|
mit
| 220 |
Package('Console.Views', {
Day : new Class({
Extends : Sapphire.View,
initialize : function()
{
this.parent();
this.page = $('#day-page');
this.page.find('#edit-notification').timepicki();
this.page.find('#edit-send').timepicki();
this.page.find('#edit-close').timepicki();
this.page.find('#save-menu').click(this.onSaveClick.bind(this));
this.page.find('#day-done-button').click(this.onDoneClick.bind(this));
this.page.find('#new-meal').click(this.onNewMealClick.bind(this));
this.selected = false;
this.dropZone = this.page.find('#drop-zone');
this.dropZone.on('drop', this.onDrop.bind(this));
this.dropZone.on('dragover', this.onDragOver.bind(this));
this.newDropZone = this.page.find('#new-drop-zone');
this.newDropZone.on('drop', this.onNewDrop.bind(this));
this.newDropZone.on('dragover', this.onNewDragOver.bind(this));
},
clear : function()
{
this.selected = false;
},
draw : function(grub, update)
{
this.meals = [];
this.grub = grub;
this.page.find('#day-date').text(new Date(grub.date).format('%B %e, %Y'));
var container = this.page.find('#meal-container');
container.empty();
if (this.selected === false) this.selected = grub.meals.length - 1;
grub.meals.each(function(meal, index)
{
var template = SAPPHIRE.templates.get('meal-item');
template.find('#meal-item-type').text(meal.type || '');
template.find('#meal-item-venue').text(meal.venue || '');
template.find('#meal-item-notification').text(new Date(meal.notification).format('%l:%M %p'));
template.find('#meal-item-send').text(new Date(meal.start).format('%l:%M %p'));
template.find('#meal-item-close').text(new Date(meal.end).format('%l:%M %p'));
template.find('.item-delete-btn').click(this.onDelete.bind(this, index));
template.click(this.onMealClick.bind(this, index));
this.meals.push({meal: meal, template: template, index: index});
container.append(template);
}, this);
if (this.meals.length) this.drawSelected();
else this.page.addClass('no-details');
},
drawSelected : function()
{
if (this.selected >= this.grub.meals.length) this.selected = this.grub.meals.length - 1;
var template = this.meals[this.selected].template;
$('.meal-item').removeClass('current');
template.addClass('current');
var meal = this.meals[this.selected].meal;
var href = CONSOLE.baseUrl + 'console/services/grub/downloadMenu?name=' + meal.menu;
this.page.find('#edit-venue').val(meal.venue);
this.page.find('#edit-type').val(meal.type);
this.page.find('#meal-item-title').html(meal.type);
this.setInputTime(this.page.find('#edit-notification'), meal.notification);
this.setInputTime(this.page.find('#edit-send'), meal.start);
this.setInputTime(this.page.find('#edit-close'), meal.end);
this.page.find('#menu-pdf').off('click');
this.page.find('#menu-pdf').click(this.onMenuClick.bind(this, href));
var iframeContainer = $('.menu-iframe-container');
var iframe = $('<iframe class="menu-iframe">').attr('src', href);
iframeContainer.empty();
iframeContainer.append(iframe);
},
setInputTime : function(el, time)
{
var time = new Date(time);
el.val(time.format('%I:%M %p'));
el.attr('data-timepicki-tim', time.format('%I'));
el.attr('data-timepicki-mini', time.format('%M'));
el.attr('data-timepicki-meri', time.format('%p'));
},
getInputTime : function(el)
{
var hour = parseInt(el.attr('data-timepicki-tim'), 10);
var minute = parseInt(el.attr('data-timepicki-mini'), 10);
var meri = el.attr('data-timepicki-meri');
var result = new Date(this.grub.date);
hour = (hour === 12) ? 0 : hour;
if (meri.charAt(0).toLowerCase() === 'p') hour += 12;
result.setHours(hour);
result.setMinutes(minute);
return result.getTime();
},
onMealClick : function(index)
{
this.page.removeClass('no-details');
this.selected = index;
this.drawSelected();
},
onSaveClick : function()
{
var meal = this.meals[this.selected].meal;
meal.type = this.page.find('#edit-type').val();
meal.venue = this.page.find('#edit-venue').val();
meal.notification = this.getInputTime(this.page.find('#edit-notification'));
meal.start = this.getInputTime(this.page.find('#edit-send'));
meal.end = this.getInputTime(this.page.find('#edit-close'));
this.draw(this.grub);
this.fire('save', this.grub);
},
onDoneClick : function()
{
this.fire('done');
},
onDelete : function(index, event)
{
event.preventDefault();
event.stopPropagation();
this.grub.meals.splice(index, 1);
this.draw(this.grub);
this.fire('save', this.grub);
},
onDrop : function(event)
{
event.preventDefault();
event.stopPropagation();
var dt = event.originalEvent.dataTransfer;
this.fire('drop', this.grub, this.selected, dt.files);
},
onDragOver : function(event)
{
event.preventDefault();
event.stopPropagation();
},
onNewDrop : function(event)
{
event.preventDefault();
event.stopPropagation();
var dt = event.originalEvent.dataTransfer;
this.selected = false;
this.page.removeClass('no-details');
this.fire('new-drop', this.grub, this.selected, dt.files);
},
onNewDragOver : function(event)
{
event.preventDefault();
event.stopPropagation();
},
onNewMealClick : function()
{
this.page.addClass('no-details');
$('.meal-item').removeClass('current');
},
onMenuClick : function(href, e)
{
e.preventDefault();
e.stopPropagation();
var modules = SYMPHONY.services.subscribe('modules');
modules.openLink(href);
}
})
});
|
Ondoher/grubbot
|
applications/apps/console/pages/day/assets/js/Views/Day.js
|
JavaScript
|
mit
| 5,825 |
(function() {
function onReadyStateComplete(document, callback) {
function checkReadyState() {
if (document.readyState === 'complete') {
// TODO: the prototype code checked to see if the event exists before removing it.
$(document).unbind('readystatechange', checkReadyState);
callback();
return true;
} else {
return false;
}
}
$(document).bind('readystatechange', checkReadyState);
checkReadyState();
}
function observeFrameContentLoaded(element) {
element = $(element);
var bare = element.get(0);
var loaded, contentLoadedHandler;
loaded = false;
function fireFrameLoaded() {
if (loaded) { return };
loaded = true;
if (contentLoadedHandler) { contentLoadedHandler.stop(); }
element.trigger('frame:loaded');
}
if (window.addEventListener) {
contentLoadedHandler = $(document).bind("DOMFrameContentLoaded", function(event) {
if (element == $(this))
fireFrameLoaded();
});
}
element.load(function() {
var frameDocument;
if (typeof element.contentDocument !== 'undefined') {
frameDocument = element.contentDocument;
} else if (typeof element.contentWindow !== 'undefined' && typeof element.contentWindow.document !== 'undefined') {
frameDocument = element.contentWindow.document;
}
onReadyStateComplete(frameDocument, fireFrameLoaded);
});
return element;
}
function onFrameLoaded($element, callback) {
$element.bind('frame:loaded', callback);
$element.observeFrameContentLoaded();
}
$.fn.observeFrameContentLoaded = observeFrameContentLoaded;
$.fn.onFrameLoaded = onFrameLoaded;
})();
|
swilliams/jq-wysihat
|
src/wysihat/events/frame_loaded.js
|
JavaScript
|
mit
| 1,739 |
// @flow
import React, { Component } from 'react';
import type { ReactElement } from 'react';
import {
View,
StyleSheet,
ScrollView,
ViewPagerAndroid,
Platform,
} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
},
scrollView: {
flex: 1,
backgroundColor: 'transparent',
},
card: {
backgroundColor: 'transparent',
},
});
type Props = {
count: number;
selectedIndex: number;
onSelectedIndexChange?: (index: number) => void;
bounces?: boolean;
style?: any;
children: any;
};
const defaultProps = {
bounces: true,
style: null,
onSelectedIndexChange: () => {},
};
type State = {
width: number;
height: number;
selectedIndex: number;
initialSelectedIndex: number;
scrollingTo: ?number;
};
class ViewPager extends Component {
props: Props
state: State
static defaultProps = defaultProps
constructor(props: Props) {
super(props);
this.state = {
width: 0,
height: 0,
selectedIndex: this.props.selectedIndex,
initialSelectedIndex: this.props.selectedIndex,
scrollingTo: null,
};
(this: any).handleHorizontalScroll = this.handleHorizontalScroll.bind(this);
(this: any).adjustCardSize = this.adjustCardSize.bind(this);
}
componentWillReceiveProps(nextProps: Props) {
if (nextProps.selectedIndex !== this.state.selectedIndex) {
if (Platform.OS === 'ios') {
// this.scrollView.scrollTo({
// x: nextProps.selectedIndex * this.state.width,
// animated: true,
// });
this.setState({ scrollingTo: nextProps.selectedIndex });
} else {
this.scrollView.setPage(nextProps.selectedIndex);
this.setState({ selectedIndex: nextProps.selectedIndex });
}
}
}
adjustCardSize(e: any) {
this.setState({
width: e.nativeEvent.layout.width,
height: e.nativeEvent.layout.height,
});
}
handleHorizontalScroll(e: any) {
let selectedIndex = e.nativeEvent.position;
if (selectedIndex === undefined) {
selectedIndex = Math.round(
e.nativeEvent.contentOffset.x / this.state.width,
);
}
if (selectedIndex < 0 || selectedIndex >= this.props.count) {
return;
}
if (this.state.scrollingTo !== null && this.state.scrollingTo !== selectedIndex) {
return;
}
if (this.props.selectedIndex !== selectedIndex || this.state.scrollingTo !== null) {
this.setState({ selectedIndex, scrollingTo: null });
this.props.onSelectedIndexChange(selectedIndex);
}
}
renderContent(): Array<ReactElement> {
const { width, height } = this.state;
const style = Platform.OS === 'ios' && styles.card;
return React.Children.map(this.props.children, (child, i) => (
<View style={[style, { width, height }]} key={`r_${i}`}>
{child}
</View>
));
}
renderIOS() {
return (
<ScrollView
ref={(scrollView) => { this.scrollView = scrollView; }}
contentOffset={{
x: this.state.width * this.state.initialSelectedIndex,
y: 0,
}}
style={[styles.scrollView, this.props.style]}
horizontal
pagingEnabled
bounces={!!this.props.bounces}
scrollsToTop={false}
onScroll={this.handleHorizontalScroll}
scrollEventThrottle={100}
automaticallyAdjustContentInsets={false}
directionalLockEnabled
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
onLayout={this.adjustCardSize}
>
{this.renderContent()}
</ScrollView>
);
}
renderAndroid() {
return (
<ViewPagerAndroid
ref={(scrollView) => { this.scrollView = scrollView; }}
initialPage={this.state.initialSelectedIndex}
onPageSelected={this.handleHorizontalScroll}
style={styles.container}
>
{this.renderContent()}
</ViewPagerAndroid>
);
}
render() {
if (Platform.OS === 'ios') {
return this.renderIOS();
}
return this.renderAndroid();
}
}
export default ViewPager;
|
jacklam718/react-native-carousel-component
|
src/components/ViewPager.js
|
JavaScript
|
mit
| 4,123 |
/*global Ghost, _, Backbone, NProgress */
(function () {
"use strict";
NProgress.configure({ showSpinner: false });
// Adds in a call to start a loading bar
// This is sets up a success function which completes the loading bar
function wrapSync(method, model, options) {
if (options !== undefined && _.isObject(options)) {
NProgress.start();
/*jshint validthis:true */
var self = this,
oldSuccess = options.success;
/*jshint validthis:false */
options.success = function () {
NProgress.done();
return oldSuccess.apply(self, arguments);
};
}
/*jshint validthis:true */
return Backbone.sync.call(this, method, model, options);
}
Ghost.ProgressModel = Backbone.Model.extend({
sync: wrapSync
});
Ghost.ProgressCollection = Backbone.Collection.extend({
sync: wrapSync
});
}());
/*global Ghost, _, Backbone, JSON */
(function () {
'use strict';
Ghost.Models.Post = Ghost.ProgressModel.extend({
defaults: {
status: 'draft'
},
blacklist: ['published', 'draft'],
parse: function (resp) {
if (resp.posts) {
resp = resp.posts[0];
}
if (resp.status) {
resp.published = resp.status === 'published';
resp.draft = resp.status === 'draft';
}
if (resp.tags) {
return resp;
}
return resp;
},
validate: function (attrs) {
if (_.isEmpty(attrs.title)) {
return 'You must specify a title for the post.';
}
},
addTag: function (tagToAdd) {
var tags = this.get('tags') || [];
tags.push(tagToAdd);
this.set('tags', tags);
},
removeTag: function (tagToRemove) {
var tags = this.get('tags') || [];
tags = _.reject(tags, function (tag) {
return tag.id === tagToRemove.id || tag.name === tagToRemove.name;
});
this.set('tags', tags);
},
sync: function (method, model, options) {
//wrap post in {posts: [{...}]}
if (method === 'create' || method === 'update') {
options.data = JSON.stringify({posts: [this.attributes]});
options.contentType = 'application/json';
}
return Backbone.Model.prototype.sync.apply(this, arguments);
}
});
Ghost.Collections.Posts = Backbone.Collection.extend({
currentPage: 1,
totalPages: 0,
totalPosts: 0,
nextPage: 0,
prevPage: 0,
url: Ghost.paths.apiRoot + '/posts/',
model: Ghost.Models.Post,
parse: function (resp) {
if (_.isArray(resp.posts)) {
this.limit = resp.limit;
this.currentPage = resp.page;
this.totalPages = resp.pages;
this.totalPosts = resp.total;
this.nextPage = resp.next;
this.prevPage = resp.prev;
return resp.posts;
}
return resp;
}
});
}());
/*global Ghost */
(function () {
'use strict';
//id:0 is used to issue PUT requests
Ghost.Models.Settings = Ghost.ProgressModel.extend({
url: Ghost.paths.apiRoot + '/settings/?type=blog,theme,app',
id: '0'
});
}());
/*global Ghost */
(function () {
'use strict';
Ghost.Collections.Tags = Ghost.ProgressCollection.extend({
url: Ghost.paths.apiRoot + '/tags/'
});
}());
/*global Ghost, Backbone */
(function () {
'use strict';
Ghost.Models.Themes = Backbone.Model.extend({
url: Ghost.paths.apiRoot + '/themes'
});
}());
/*global Ghost, Backbone, $ */
(function () {
'use strict';
Ghost.Models.uploadModal = Backbone.Model.extend({
options: {
close: true,
type: 'action',
style: ["wide"],
animation: 'fade',
afterRender: function () {
var filestorage = $('#' + this.options.model.id).data('filestorage');
this.$('.js-drop-zone').upload({fileStorage: filestorage});
},
confirm: {
reject: {
func: function () { // The function called on rejection
return true;
},
buttonClass: true,
text: "Cancel" // The reject button text
}
}
},
content: {
template: 'uploadImage'
},
initialize: function (options) {
this.options.id = options.id;
this.options.key = options.key;
this.options.src = options.src;
this.options.confirm.accept = options.accept;
this.options.acceptEncoding = options.acceptEncoding || 'image/*';
}
});
}());
/*global Ghost */
(function () {
'use strict';
Ghost.Models.User = Ghost.ProgressModel.extend({
url: Ghost.paths.apiRoot + '/users/me/'
});
// Ghost.Collections.Users = Backbone.Collection.extend({
// url: Ghost.paths.apiRoot + '/users/'
// });
}());
/*global Ghost */
(function () {
'use strict';
Ghost.Models.Widget = Ghost.ProgressModel.extend({
defaults: {
title: '',
name: '',
author: '',
applicationID: '',
size: '',
content: {
template: '',
data: {
number: {
count: 0,
sub: {
value: 0,
dir: '', // "up" or "down"
item: '',
period: ''
}
}
}
},
settings: {
settingsPane: false,
enabled: false,
options: [{
title: 'ERROR',
value: 'Widget options not set'
}]
}
}
});
Ghost.Collections.Widgets = Ghost.ProgressCollection.extend({
// url: Ghost.paths.apiRoot + '/widgets/', // What will this be?
model: Ghost.Models.Widget
});
}());
|
choskim/Ghost
|
core/built/scripts/models.js
|
JavaScript
|
mit
| 6,521 |
/*global Spinner:true*/
'use strict';
angular.module('angularjsRundownApp')
.directive('rdLoading', ['$parse',
function ($parse) {
var baseOptions = {
'default': {
lines: 11,
length: 0,
width: 2,
radius: 5,
corners: 0,
rotate: 6,
direction: 1,
color: '#FFF',
speed: 1,
trail: 60,
shadow: false,
hwaccel: true,
className: 'spinner',
zIndex: 2e9,
top: 'auto',
left: 'auto'
},
'big': {
lines: 9,
length: 0,
width: 5,
radius: 11,
corners: 1,
rotate: 6,
direction: 1,
color: '#FFF',
speed: 1,
trail: 100,
shadow: false,
hwaccel: true,
className: 'spinner',
zIndex: 2e9,
top: 'auto',
left: 'auto'
}
};
return {
template: '<div class="rd-loading"></div>',
replace: true,
restrict: 'E',
link: function postLink(scope, element, attrs) {
var size = attrs.size || 'default';
// Get the default options set
var defaultOptions = baseOptions[size];
// Checking if we have custom options. If not, just create an empty object to
// avoid exceptions during the extend phase.
attrs.options = $parse(attrs.options)() || {};
// Create a new options object extending the default options with the custom
// options passed on the directive tag.
var options = angular.extend({}, defaultOptions, attrs.options);
// Create the Spinner Object and pass the directive's element.
// We need to get the [0] because the element is actually an Array
// so we need to get the first one.
var spinner = new Spinner(options).spin(element[0]);
// If the element was destroyed, we need to stop the spinner
element.bind('$destroy', function () {
spinner.stop();
});
}
};
}
]);
|
wlepinski/kinetoscope
|
app/scripts/directives/rd_loading.js
|
JavaScript
|
mit
| 2,146 |
var LineDraw = require('../helper/LineDraw');
var EffectLine = require('../helper/EffectLine');
var Line = require('../helper/Line');
var Polyline = require('../helper/Polyline');
var EffectPolyline = require('../helper/EffectPolyline');
var LargeLineDraw = require('../helper/LargeLineDraw');
require('../../echarts').extendChartView({
type: 'lines',
init: function () {},
render: function (seriesModel, ecModel, api) {
var data = seriesModel.getData();
var lineDraw = this._lineDraw;
var hasEffect = seriesModel.get('effect.show');
var isPolyline = seriesModel.get('polyline');
var isLarge = seriesModel.get('large') && data.count() >= seriesModel.get('largeThreshold');
if (__DEV__) {
if (hasEffect && isLarge) {
console.warn('Large lines not support effect');
}
}
if (hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLarge !== this._isLarge) {
if (lineDraw) {
lineDraw.remove();
}
lineDraw = this._lineDraw = isLarge
? new LargeLineDraw()
: new LineDraw(
isPolyline
? (hasEffect ? EffectPolyline : Polyline)
: (hasEffect ? EffectLine : Line)
);
this._hasEffet = hasEffect;
this._isPolyline = isPolyline;
this._isLarge = isLarge;
}
var zlevel = seriesModel.get('zlevel');
var trailLength = seriesModel.get('effect.trailLength');
var zr = api.getZr();
// Avoid the drag cause ghost shadow
// FIXME Better way ?
zr.painter.getLayer(zlevel).clear(true);
// Config layer with motion blur
if (this._lastZlevel != null) {
zr.configLayer(this._lastZlevel, {
motionBlur: false
});
}
if (hasEffect && trailLength) {
if (__DEV__) {
var notInIndividual = false;
ecModel.eachSeries(function (otherSeriesModel) {
if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) {
notInIndividual = true;
}
});
notInIndividual && console.warn('Lines with trail effect should have an individual zlevel');
}
zr.configLayer(zlevel, {
motionBlur: true,
lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
});
}
this.group.add(lineDraw.group);
lineDraw.updateData(data);
this._lastZlevel = zlevel;
},
updateLayout: function (seriesModel, ecModel, api) {
this._lineDraw.updateLayout(seriesModel);
// Not use motion when dragging or zooming
var zr = api.getZr();
zr.painter.getLayer(this._lastZlevel).clear(true);
},
remove: function (ecModel, api) {
this._lineDraw && this._lineDraw.remove(api, true);
}
});
|
smileFDD/mapApi
|
app/public/echarts/lib/chart/lines/LinesView.js
|
JavaScript
|
mit
| 3,410 |
var urlStaticFiles = '/static/';
//check if plugin has been loaded
if (!jQuery.getRowAndCellIndex)
{
$.ajax({
url: urlStaticFiles + 'js/RowAndCellIndex.js',
dataType: 'script',
async: false
});
}
$.ajax({
url: urlStaticFiles + 'js/external/jshashtable-2.1_src.js',
dataType: 'script',
async: false
});
if (typeof downloadImageOf != 'function')
{
$.ajax({
url: urlStaticFiles + 'js/generalUtil.js',
dataType: 'script',
async: false
});
}
//var nChangeableCols= 0; // number of cols without the cols used for the row menus
var colMenuTimers = new Hashtable();
var nFixedCols = 5;//number of cols that are not user for alternatives
var nFixedRows = 2;//number of rows that are not user for concerns
/**
* this function should be called if a new grid is loaded in the page
* @param containerDiv this object should contain the div where the gridTable.html page is placed
*/
function prepareForNewGrid(containerDiv)
{
var table = containerDiv.find('.mainGridDiv table');
//var tableContainer = $(table).parent();
//add the animation to the buttons of the menu of the grid
$(table).find(".deleteImage").hover(function () {
$(this).attr("src", urlStaticFiles + "icons/delete_hover.png");
},
function () {
$(this).attr("src", urlStaticFiles + "icons/delete.png");
});//end hover
$(table).find(".addImage").hover(function () {
$(this).attr("src", urlStaticFiles + "icons/plus_hover.png");
},
function () {
$(this).attr("src", urlStaticFiles + "icons/plus.png");
});//end hover
//add show and hide the menu function
$(table).find('.gridRow').mouseleave(function () {
$(this).find('.gridRowMenu').each(function () {
$(this).hide();
});
});//end mouse leave
//add hide cell menu
$(table).find('.ratioCell').each(function () {
var cell = $(this);
cell.mouseleave(function () {
hidecolMenu(cell, null, true, null);
});
});
$(table).find('.colMenu').each(function(){
var cell = $(this);
cell.mouseleave(function(){
hidecolMenu(cell, null, true, null);
});
});
$(table).find('.alternativeCell').each(function(){
var cell = $(this);
cell.mouseleave(function(){
hidecolMenu(cell, null, true, null);
});
});
//initiate an array for the col menu of the table
var tableId = getTableId(table);
if(!colMenuTimers.containsKey(tableId))
{
colMenuTimers.put(tableId, new Array(getNumberOfAlternatives(table)));
}
//initiate the grid menu
prepareGridMenu(containerDiv);
calculateTotalWeight(containerDiv);
}
/**
* This function will hide and show the row menu
* @param cell jquery object representing a cell in the row where the row menu should be shown/hidden
*/
function displayRowMenu(cell)
{
temp = cell.getRowAndCellIndex();
rowIndex = temp[0];
colIndex = temp[1];
nCols = cell.parent('tr').children('td').length;
if (Math.floor(nCols/2) > colIndex)
{
var rightMenu = cell.parent('tr').find('.rightRowMenuDiv');
if(!rightMenu.is(':hidden'))
{
rightMenu.hide();
}
cell.parent('tr').find('.leftRowMenuDiv').show();
}
else
{
var leftMenu = cell.parent('tr').find('.leftRowMenuDiv');
if(!leftMenu.is(':hidden'))
{
leftMenu.hide();
}
cell.parent('tr').find('.rightRowMenuDiv').show();
}
}
/**
* This function will set the col menu hide in n milliseconds and show the col menu
* @param cell jquery object representing a cell in the col where the col menu should be hidden
*/
function showColMenu(cell)
{
var temp = cell.getRowAndCellIndex();
var rowIndex = temp[0];
var cellIndex = temp[1];
var table = findTable(cell);
var tableId = getTableId(table);
if (colMenuTimers.get(tableId)[cellIndex - 2] != null)
{
//console.log('cancel: ' + tableId + ' ' + colMenuTimers.get(tableId)[cellIndex - 2]);
clearTimeout(colMenuTimers.get(tableId)[cellIndex - 2]);
colMenuTimers.get(tableId)[cellIndex - 2] = null;
}
colMenuDiv = table.find('tbody>tr:eq(0)').children('td:eq(' + cellIndex + ')').children('div');
if (colMenuDiv.is(':hidden'))
{
//console.log('show: ' + tableId + ' ' + colMenuTimers.get(tableId)[cellIndex - 2]);
colMenuDiv.show();
}
}
/**
* Hide the col menu
*
* @param cell jquery object representing a cell in the col where the col menu should be hidden
* @param cellIndex int representing the index of the cell
* @param delayed boolean indicating if the function will be executed now or not
* @param tableId string representing the table id of the cell where the cell menu will be hidden
*/
function hidecolMenu(cell, cellIndex, delayed, tableId)
{
if(delayed == true)
{
cellIndex = cell.getRowAndCellIndex()[1];
var tableId = getTableId(cell);
colMenuTimers.get(tableId)[cellIndex - 2] = setTimeout("hidecolMenu(null, " + cellIndex + ", false, '" + tableId + "' );", 200);
//console.log('start timer: ' + tableId + ' ' + colMenuTimers.get(tableId)[cellIndex - 2]);
}
else
{
//console.log('hidden: ' + tableId + ' ' + colMenuTimers.get(tableId)[cellIndex - 2]);
$('#' + tableId).find('tbody>tr:eq(0)').children('td:eq(' + cellIndex + ')').children('div').hide();
}
}
/**
* This function will add a row to the grid table
* @param cell jquery object representing a cell in the table that a new row will be added
*/
function addRow(cell)
{
var nConcerns = getNumberOfConcerns(cell);//parseInt($("#nConcerns").val());
nConcerns++;
var leftId = "concern_" + nConcerns + "_left";
var rightId = "concern_" + nConcerns +"_right";
var ratingReadOnly = isRatingReadOnly(cell);
var showRatingWhileFalseChangeRatingsWeights = isShowRatingIfReadOnly(cell);
var containerDiv = findTable(cell).parents('.gridTrableContainerDiv');
//$("#nConcerns").val(nConcerns);
//add the new row to the table
var nAlternatives = getNumberOfAlternatives(cell); //parseInt($("#nAlternatives").val());
var cols = '';
var id = ''; //id is the name used id and name options in the input tag
//row menu
cols += '<td onmouseover="displayRowMenu($(this))">\n';
cols += '<div class="gridRowMenu leftRowMenuDiv">\n';
cols += '<a><img class= "deleteImage" src="' + urlStaticFiles + 'icons/delete.png" alt="" onclick= "removeRow($(this).parents(\'td\'))"/></a>\n';
cols += '<a><img class= "addImage" src="' + urlStaticFiles + 'icons/plus.png" alt="" onclick= "addRow($(this).parents(\'td\'))"/></a>\n';
cols += '</div>\n';
cols += '</td>\n';
//concern left
cols += '<td onmouseover="displayRowMenu($(this))" class= "concernCell"><input class="tableHeader" type="text" id="' + leftId + '" name="' + leftId +'" onchange="isTextEmpty($(this));isTableSaved()" /></td>\n';
for(var i=0; i < nAlternatives; i++)
{
id = "ratio_concer" + nConcerns + "_alternative" + (i + 1);
if(!ratingReadOnly)
{
cols += '<td class= "ratioCell" onmouseover="displayRowMenu($(this));showColMenu($(this))" ><div><input type="text" id="' + id +'" name="' + id + '" onchange="isTextEmpty($(this));isTableSaved()"/></div></td>\n';
//cols+= "<td><input type=\"text\" id=" + id +" name= " + id +"/></td>";
}
else
{
cols += '<td class= "ratioCell" onmouseover="displayRowMenu($(this));showColMenu($(this))" ><div><input type="text" id="' + id +'" name="' + id + '" disabled="disabled" readonly/></div></td>\n';
}
}
//concern weight
if(!ratingReadOnly)
{
cols += '<td onmouseover="displayRowMenu($(this))">\n'
cols += '<input type="text" id= "weight_concern' + nConcerns + '" name= "weight_concern' + nConcerns + '" value= "1.0" onchange="calculateTotalWeight($(this).parents(\'.gridTrableContainerDiv\'));isTextEmpty($(this));isTableSaved()"/>\n';
cols += '</td>\n'
}
else
{
if(showRatingWhileFalseChangeRatingsWeights)
{
cols += '<td onmouseover="displayRowMenu($(this))">\n'
cols += '<input type="text" id= "weight_concern' + nConcerns + '" name= "weight_concern' + nConcerns + '" value= "1.0" onchange="calculateTotalWeight($(this).parents(\'.gridTrableContainerDiv\'))" disabled="disabled" readonly/>\n';
cols += '</td>\n'
}
else
{
cols += '<td onmouseover="displayRowMenu($(this))">\n'
cols += '<input type="text" id= "weight_concern' + nConcerns + '" name= "weight_concern' + nConcerns + '" value= "" onchange="calculateTotalWeight($(this).parents(\'.gridTrableContainerDiv\'))" disabled="disabled" readonly/>\n';
cols += '</td>\n'
}
}
//concern right
cols += '<td onmouseover="displayRowMenu($(this))" class= "concernCell"><input class= "tableHeader" type="text" id="' + rightId + '" name="' + rightId + '" onchange="isTextEmpty($(this));isTableSaved()" /></td>\n';
//add the new row to the table
cols += '<td onmouseover="displayRowMenu($(this))">\n';
cols += '<div class="gridRowMenu rightRowMenuDiv">\n';
cols += '<a><img class= "deleteImage" src="' + urlStaticFiles + 'icons/delete.png" alt="" onclick= "removeRow($(this).parents(\'td\'))"/></a>\n';
cols += '<a><img class= "addImage" src="' + urlStaticFiles + 'icons/plus.png" alt="" onclick= "addRow($(this).parents(\'td\'))"/></a>\n';
cols += '</div>\n';
cols += '</td>\n';
var table = findTable(cell);
//$("#Grid").append('<tr class="gridRow">' + cols + '</tr>');
table.find('tbody').append('<tr class="gridRow">' + cols + '</tr>');
//now add the mouseleave and mouseenter actions
//left part
var obj = table.find("tbody>tr:last");
//right and left
obj.find('.ratioCell').each(function(){
$(this).mouseleave(function(){
hidecolMenu($(this), null, true, null);
});
});
obj.find('.colMenu').each(function(){
var cell = $(this);
cell.mouseleave(function(){
hidecolMenu(cell, null, true, null);
});
});
obj.find('.alternativeCell').each(function(){
var cell = $(this);
cell.mouseleave(function(){
hidecolMenu(cell, null, true, null);
});
});
//add the animation to the buttons of the menu of the grid
obj.find(".deleteImage").hover(function(){
$(this).attr("src", urlStaticFiles + "icons/delete_hover.png");
},
function(){
$(this).attr("src", urlStaticFiles + "icons/delete.png");
});//end hover
obj.find(".addImage").hover(function(){
$(this).attr("src", urlStaticFiles + "icons/plus_hover.png");
},
function(){
$(this).attr("src", urlStaticFiles + "icons/plus.png");
});//end hover
//add show and hide the menu function
obj.mouseleave(function(){
$(this).find('.gridRowMenu').each(function(){
$(this).hide();
});
});//end mouse leave
//calculate the total weight
calculateTotalWeight(containerDiv);
if(typeof isTableSaved == 'function')
{
isTableSaved();
}
}
/**
* This function will remove a row in place of a grid table
* @param cell jquery object representing a cell in the table that a row will be removed
*/
function removeRow(cell)
{
var concernNumber = cell.getRowAndCellIndex()[0] - 1;
var nConcerns = getNumberOfConcerns(cell);//parseInt($("#nConcerns").val());
var temp = null;
var containerDiv = findTable(cell).parents('.gridTrableContainerDiv');
if(nConcerns - 1 != 0)
{
//update all the ids of the table
var table = findTable(cell).find("tbody");
table.find("tr:gt(" + (concernNumber + 1) + ")").each(function(i)
{
var concernIndex = concernNumber + i;
//create the old and new ids
var oldLeftId = "concern_" + (concernIndex + 1) + "_left";
var oldRightId = "concern_" + (concernIndex + 1) + "_right";
var leftId = "concern_" + concernIndex + "_left";
var rightId = "concern_" + concernIndex +"_right";
var oldWeightId = 'weight_concern' + (concernIndex + 1);
var weightId = 'weight_concern' + concernIndex;
//update the left concern
temp = $(this).find('#' + oldLeftId);
temp.attr('id', leftId);
temp.attr('name', leftId);
//update the ratios id and name attributes
var nAlternatives = getNumberOfAlternatives(cell);//parseInt($("#nAlternatives").val());
$(this).find("td:gt(1):lt(" + nAlternatives + ")").each(function(i){
var id="ratio_concer" + concernIndex + "_alternative" + (i + 1);
$(this).find("input").attr("id", id);
$(this).find("input").attr("name", id);
});
//update the weight
temp = $(this).find('#' + oldWeightId);
temp.attr('id', weightId);
temp.attr('name', weightId);
//update the right concern
temp = $(this).find('#' + oldRightId);
temp.attr('id', rightId);
temp.attr('name', rightId);
});
//remove the row
table.find("tr:eq(" + (concernNumber + 1) + ")").remove();
//remove add -1 to the total concerns
nConcerns--;
calculateTotalWeight(containerDiv);
if(typeof isTableSaved == 'function')
{
isTableSaved();
}
}
}
/**
* This function will add a col in a grid table
* @param cell jquery object representing a cell in the table that a new col will be added
*/
function addCol(cell)
{
var temp = null;
var nAlternatives = getNumberOfAlternatives(cell);//parseInt($("#nAlternatives").val());
var id = ''; //id is the name used id and name options in the input tag
nAlternatives++;
id = "alternative_" + nAlternatives + "_name";
var ratingReadOnly = isRatingReadOnly(cell);
//$("#nAlternatives").val(nAlternatives);
//add the col menu
var tbody = findTable(cell).find('tbody');//$('#Grid>tbody');
tbody.find('tr:eq(0)').find('td:eq(' + nAlternatives + ')').after('<td class= "colMenu" onmouseover="showColMenu($(this))">\n' +
'<div class= "colMenuDiv">\n' +
'<a><img class= "deleteImage" src="' + urlStaticFiles + 'icons/delete.png" alt="" onclick= "removeCol($(this).parents(\'td\'))"/></a>\n' +
'<a><img class= "addImage" src="' + urlStaticFiles + 'icons/plus.png" alt="" onclick= "addCol($(this).parents(\'td\'))"/></a>\n' +
'</div>\n' +
'</td>\n'
);
temp = tbody.find('tr:eq(0)').find('td:eq(' + (nAlternatives + 1) + ')');
//add the mouse leave function to the cell menu
temp.mouseleave(function(){
hidecolMenu($(this), null, true, null);
});
//add the mouse in and out events to the images
temp.find(".deleteImage").hover(function(){
$(this).attr("src", urlStaticFiles + "icons/delete_hover.png");
},
function(){
$(this).attr("src", urlStaticFiles + "icons/delete.png");
});//end hover
temp.find(".addImage").hover(function(){
$(this).attr("src", urlStaticFiles + "icons/plus_hover.png");
},
function(){
$(this).attr("src", urlStaticFiles + "icons/plus.png");
});//end hover
//add the 'header'
tbody.find('tr:eq(1)').find('td:eq(' + nAlternatives + ')').after('<td class= "alternativeCell" onmouseover="showColMenu($(this))" >\n' +
'<input class= "tableHeader" type="text" id="' + id + '" name="' + id + '" onchange="isTextEmpty($(this));isTableSaved()" />\n' +
'</td>\n'
);
//add the mouse leave function to the header cell
tbody.find('tr:eq(1)').find('td:eq(' + (nAlternatives + 1) + ')').mouseleave(function(){
hidecolMenu($(this), null, true, null);
});
//add the new col to the table
var nConcerns = getNumberOfConcerns(cell);//parseInt($("#nConcerns").val());
//take care of the normal cells of the table
for(var i=0; i < nConcerns; i++)
{
id = "ratio_concer" + (i + 1) + "_alternative" + nAlternatives;
temp = tbody.find("tr:eq(" + (i + 2) + ")");
//function changed because of the new added cell in the begin of the table ( there are now 2 cells now (name of the concern + the options)), also it is now i+2 because we added another tr to the begin of the table
if(!ratingReadOnly)
{
temp.find("td:eq(" + nAlternatives + ")").after('<td class= "ratioCell" onmouseover="displayRowMenu($(this));showColMenu($(this))" ><div><input type="text" id="' + id + '" name= "' + id + '" onchange="isTextEmpty($(this));isTableSaved()" /></div></td>\n');
}
else
{
temp.find("td:eq(" + nAlternatives + ")").after('<td class= "ratioCell" onmouseover="displayRowMenu($(this));showColMenu($(this))" ><div><input type="text" id="' + id + '" name= "' + id + '" disabled="disabled" readonly /></div></td>\n');
}
//with old index
//$("#ratioTable").find("tr:eq(" + (i + 1) + ")").find("td:eq(" + (nAlternatives - 1) + ")").after("<td><input type=\"text\" id=" + id + " name=" + id + " /></td>");
//add the mouseleave function to the ratio cell
temp.find("td:eq(" + (nAlternatives + 1) + ")").mouseleave(function(){
hidecolMenu($(this), null, true, null);
});
}
//add +1 position to the colMenuTimers
var tableId = getTableId(cell);
colMenuTimers.get(tableId).push(null);
if(typeof isTableSaved == 'function')
{
isTableSaved();
}
}
/* This function is to add the alternative columns when clicking new image on the results page
***********
*/
function addCol2(altObj)
{
var editable = $('#ratio_concer1_alternative1').attr('disabled');
if(editable!="disabled")
{
var cell = $("td[class='colMenu']:first");
addCol(cell);
var alternatives = $(altObj).find('td:first-child'); // Alternative name is obtained from the resultAlternativeTable.html
var altHtml = $(alternatives).html();
var inputAlt = $("input[id^='alternative']:last");
inputAlt.val(altHtml);
}
isGridComplete();
}
/* This function is to add Row and passing the concern values by clicking the New image in the results page
*********
*/
function addRow2(conObj)
{
console.log(conObj);
var editable = $('#ratio_concer1_alternative1').attr('disabled');
if(editable!="disabled")
{
var cell = $("td[onmouseover^='displayRow']:first");
addRow(cell);
var concernsLeft = $(conObj).find('td:first-child'); // Concern names are obtained from resultAlternativeTable.html
var conLeftHtml = $(concernsLeft).html();
var concernsRight = $(concernsLeft).next();
var conRightHtml = $(concernsRight).html();
var inputConLeft = $("input[id*='left']:last");
var inputConRight = $("input[id*='right']:last");
inputConLeft.val(conLeftHtml);
inputConRight.val(conRightHtml);
}
isGridComplete();
}
/**
* This function will remove a col in place of grid table
* @param cell jquery object representing a cell in the table that a col will be removed
*/
function removeCol(cell)
{
var alternativeNumber = cell.getRowAndCellIndex()[1] - 1;
var nAlternatives = getNumberOfAlternatives(cell);//parseInt($("#nAlternatives").val());
var nConcerns = getNumberOfConcerns(cell);//parseInt($("#nConcerns").val());
var table = findTable(cell);
// find now the tableId of this cell because when you remove it, it generates error
// because it cannot find it
var tableId = getTableId(cell);
var temp = null;
var id = null;
if (nAlternatives - 2 != 0)
{
//remove cell menu
var tbody= findTable(cell).find('tbody');//$('#Grid>tbody');
tbody.find('tr:eq(0)').find('td:eq(' + (alternativeNumber + 1) + ')').remove();
//rename the next headers
//let's first find the correct row where the headers are, after that find the
tbody.find('tr:eq(1)').find('td:gt(' + (alternativeNumber + 1) + '):lt(' + (nAlternatives - alternativeNumber) + ')').each(function(i){
id = "alternative_" + (alternativeNumber + i) + "_name";
$(this).find('input').attr("id", id);
$(this).find('input').attr('name', id);
})
//remove 'header'
tbody.find('tr:eq(1)').find('td:eq(' + (alternativeNumber + 1) + ')').remove();
//now lets remove 1 col from every row, update the ids of the other cols and change the id of the hidden fields (also from the header)
for (var i = 0; i < nConcerns; i++)
{
var row = table.find("tbody>tr:eq(" + (i + 2) + ")");//$("#Grid>tbody").find("tr:eq(" + (i + 2) + ")");
//update the ids of the other cols
for(var j = alternativeNumber + 1; j <= nAlternatives; j++)
{
id = "ratio_concer" + (i + 1) + "_alternative" + (j - 1);
var input = row.find("td:eq("+ (j + 1) +")").find("input");
input.attr("id", id);
input.attr("name", id);
}
//remove the col that isn't needed anymore
row.find("td:eq(" + (alternativeNumber + 1) + ")").remove();
}
//save the new total number of alternatives
nAlternatives--;
//remove -1 position to the colMenuTimers
colMenuTimers.get(tableId).pop();
if (typeof isTableSaved == 'function')
{
isTableSaved();
}
}
}
/**
* Function used to rescale weight value used in the grid table so that the total remains 100
* @param containerDiv jquery object containing all the components of a grid table
*/
function rescale(containerDiv)
{
var nConcerns = getNumberOfConcerns(containerDiv.find('.mainGridDiv table'));//parseInt($("#nConcerns").val())
var weightTotal = 0.0;
var id = null;
var tbody = $(containerDiv).find('.mainGridDiv table>tbody');
for (var i = 0; i < nConcerns; i++)
{
id = "weight_concern" + (i + 1);
weightTotal += parseFloat(tbody.find('#' + id + '[onchange]').val());
}
if (weightTotal >= 0 || weightTotal < 0)
{
if (weightTotal != 100)
{
var rescaleValue = 100/weightTotal;
for (var i = 0; i < nConcerns; i++)
{
var id = "weight_concern" + (i+1);
var weightVal = $('#' + id + '[onchange]').val();
var newWeightVal = (weightVal * rescaleValue).toFixed(2);
$('#' + id + '[onchange]').attr('value', newWeightVal);
}
weightTotal= 0.0;
for (var i = 0; i < nConcerns; i++)
{
id= "weight_concern" + (i + 1);
weightTotal+= parseFloat(tbody.find('#' + id).val());
}
}
}
if(weightTotal > 99.0 && weightTotal < 100)
{
weightTotal = 100;
}
if(weightTotal >= 0 || weightTotal < 0)
{
$(containerDiv).find('.weightMeter').attr('value', weightTotal);
}
else
{
$(containerDiv).find('.weightMeter').attr('value', '-----');
}
}
/**
* Function used to calculate the total weight value used in the grid table
* @param containerDiv jquery object containing all the components of a grid table
*/
function calculateTotalWeight(containerDiv)
{
var nConcerns = getNumberOfConcerns(containerDiv.find('.mainGridDiv table'));//parseInt($("#nConcerns").val())
var weightTotal = 0.0;
var id = null;
var tbody = containerDiv.find('.mainGridDiv table>tbody');//$('#Grid>tbody');
for(var i = 0; i < nConcerns; i++)
{
id= "weight_concern" + (i + 1);
weightTotal+= parseFloat(tbody.find('#' + id).val());
}
if (weightTotal > 99.0 && weightTotal <100.0)
{
weightTotal = 100;
}
if(weightTotal >= 0 || weightTotal < 0)
{
containerDiv.find('.weightMeter').attr('value', weightTotal);
}
else
{
containerDiv.find('.weightMeter').attr('value', '-----');
}
}
/**
* Function used to find what the number of alternatives, only supports table, td and tr objects
* @param obj jquery object representing a table or td or tr
* @returns {Number} numbers of alternative
*/
function getNumberOfAlternatives(obj)
{
var nCols = 0;
switch(obj.prop('tagName').toLowerCase())
{
case 'td':
{
nCols = obj.parent('tr').children('td').length;
break;
}
case 'tr':
{
nCols = obj.children('td').length;
break;
}
case 'table':
{
nCols = obj.children('tbody').children('tr:first').children('td').length;
break;
}
}
return nCols - nFixedCols;
}
/**
* Function used to find what the number of concerns, only supports table, td and tr objects
* @param obj jquery object representing a table or td or tr
* @returns {Number} number of concerns
*/
function getNumberOfConcerns(obj)
{
var nRows = 0;
switch(obj.prop('tagName').toLowerCase())
{
case 'td':
{
nRows = obj.parent('tr').parent('tbody').children('tr').length;
break;
}
case 'tr':
{
nRows = obj.length;
break;
}
case 'table':
{
nRows = obj.children('tbody').children('tr').length;
break;
}
}
return nRows - nFixedRows;
}
/**
* Only supports table, td and tr objects
* @param obj jquery object representing a table or td or tr
* @returns jquery object representing the table
*/
function findTable(obj)
{
switch(obj.prop('tagName').toLowerCase())
{
case 'td':
{
return obj.parents('table');
}
case 'tr':
{
return obj.parents('table');
}
case 'table':
{
return obj;
}
}
}
/**
* Get the table id the is stored in a hidden value that pertence to a grid table
* @param obj jquery object representing a table or tr or td
* @returns string representing the table id
*/
function getTableId(obj)
{
var table = findTable(obj);
return table.attr('id');
}
/**
* Function used to determine if the grid table ratings should be readonly
* @param obj jquery object representing a table or td or tr
* @returns boolean
*/
function isRatingReadOnly(obj)
{
var ratingReadOnly = findTable(obj).parents('.gridTrableContainerDiv').find('#changeRatingsWeights').val();
try
{
if (ratingReadOnly != null && (ratingReadOnly != '' || ratingReadOnly != ' '))
{
//the meaning of isRatingReadOnly and changeRatingsWeights are different from each other, so that is why we invert a true to false
if(ratingReadOnly.toLowerCase() == 'false')
{
ratingReadOnly = true;
}
else
{
ratingReadOnly = false;
}
}
else
{
ratingReadOnly = false;
}
}
catch(err)
{
ratingReadOnly = false;
}
return ratingReadOnly;
}
/**
* This function is used to determine if the ratings should be shown if the ratings are set to read only
* @param obj jquery object representing a table or td or tr
* @returns boolean
*/
function isShowRatingIfReadOnly(obj)
{
var showRatingWhileFalseChangeRatingsWeights = findTable(obj).parents('.gridTrableContainerDiv').find('#showRatingWhileFalseChangeRatingsWeights').val();
try
{
if (showRatingWhileFalseChangeRatingsWeights != null && (showRatingWhileFalseChangeRatingsWeights != '' || showRatingWhileFalseChangeRatingsWeights != ' '))
{
if(showRatingWhileFalseChangeRatingsWeights.toLowerCase() == 'true')
{
showRatingWhileFalseChangeRatingsWeights = true;
}
else
{
showRatingWhileFalseChangeRatingsWeights = false;
}
}
else
{
showRatingWhileFalseChangeRatingsWeights = false;
}
}
catch(err)
{
showRatingWhileFalseChangeRatingsWeights = false;
}
return showRatingWhileFalseChangeRatingsWeights;
}
/**
* This function is called when there is a change in the value of the
*
* For now only values from 1 to 5 are supported, those values are hardcoded for now.
* @param inputRating jquery object representing the input
*/
function rationRangeValidation(inputRating)
{
var rating = parseInt(inputRating.val());
if( !(rating >= 1 && rating <= 5))
{
inputRating.val(1.0);
showMessageInDialogBox('Only values betwen 1 and 5 are allowed');
}
}
function isGridComplete() {
var fields = $('#form').serializeArray();
enoughAlternatives = false;
enoughConcerns = false;
$.each(fields, function(i, field) {
if (field.value == "") {
return false;
}
enoughConcerns = enoughConcerns || field.name == "concern_2_left";
enoughAlternatives = enoughAlternatives || field.name == "alternative_2_name";
});
if (enoughConcerns && enoughAlternatives && hasTableBeenSaved) {
$('#tabs li').addClass('ui-state-default');
$('#tabs li').removeClass('ui-state-disabled');
$('#tabs p').hide();
} else {
$('#tabs li').removeClass('ui-state-default');
$('#tabs li').addClass('ui-state-disabled');
$('#tabs p').show();
}
}
function isTextEmpty(tag) {
var value = $.trim(tag.val());
if (value == "") {
tag.val('');
} else {
tag.val(value);
}
}
/**
* This function will make the menu that appears in the grid table ready to be used
* @param containerDiv jquery object representing the div where all the grid table componenets are located
*/
function prepareGridMenu(containerDiv)
{
//take care of all the mouse overs
containerDiv.find('.gridTableToggleLegendImg').mouseover(function(){
$(this).attr('src', '/static/icons/legend_hover.png');
});
//take care of when the menu should be displayed
containerDiv.find('.mainGridDiv').mouseenter(function(){
$(this).find('.gridTableExtraOptionsMenuDiv').show();
});
containerDiv.find('.mainGridDiv').mouseleave(function(){
$(this).find('.gridTableExtraOptionsMenuDiv').hide();
});
}
/**
* This function will hide or show the grid legend
* @param obj jquery object representing the html component that used the function
*/
function toggleGridLegend(obj)
{
obj.parents('.gridTrableContainerDiv').find('.tableLegendDiv').toggle('slide', {direction: "right"});
}
/**
* This function is used from an outside script to retrive the jquery object that represents the grid table
* @param obj an jquery object that represents the div encasing all the gri table components
*/
function getGridTable(obj)
{
return obj.find('.mainGridDiv table');
}
/**
* This function is used to retrieve the img of the save status of a grid table
* @param containerDiv jquery object containing all the components of a grid table
* @returns jquery object of the img tag
*/
function getGridTableSaveStatusImage(containerDiv)
{
return containerDiv.find('.tableStatus')
}
/**
* Function used to change the text of the tool tip
* @param containerDiv containerDiv jquery object containing all the components of a grid table
* @param text
*/
function setGridTableSaveStatusToolTip(containerDiv, text)
{
containerDiv.find('.tableStatus').attr('title', text);
}
/**
* Function used to change the icon that is used to indicate is the table is saved or not
* @param containerDiv jquery object containing all the components of a grid table
* @param isSaved boolean indicating if the table is saved or not
*/
function changeTableSaveStatusIcon(containerDiv, isSaved)
{
if(isSaved)
{
containerDiv.find('.tableStatus').attr('src', urlStaticFiles + 'icons/table_saved.png');
}
else
{
containerDiv.find('.tableStatus').attr('src', urlStaticFiles + 'icons/table_not_saved.png');
}
}
/**
* This function should be called one time when using the indicator if the table is saved or not
* @param containerDiv jquery object containing all the components of a grid table
*/
function initiateGridTableToolTip(containerDiv)
{
if(!jQuery.tipsy)
{
$.ajax({
url: urlStaticFiles + 'js/external/tipsy.js',
dataType: 'script',
async: false
});
}
containerDiv.find('.tableStatus').tipsy({fade:true, gravity: 's'});
}
/**
this function will download a html and place it in a dialog that will as the
user to select the file type he wants to download the grid as.
*/
function downloadGridAs(usidN)
{
if(usidN != 'None' && usidN != null && usidN != '')
{
downloadImageOf('/grids/download/grid/', {usid: usidN});
}
}
|
danrg/RGT-tool
|
static/js/gridTableGeneralFunctions.js
|
JavaScript
|
mit
| 30,437 |
/*!
* Sight Words Match Game
* https://github.com/rf3Studios/memgame-sight-words
*
* Copyright 2014 Rich Friedel
* Released under the MIT license
*/
// General Constants
const NUMBER_OF_CARDS = 16;
// String Constants
const HEADER_TITLE = "Match The Sight Words";
const HEADER_MATCH_SUCCESS = "YAY!!! YOU FOUND A MATCH!!!";
const HEADER_MATCH_FAIL = "NO MATCH!";
const HEADER_GAME_COMPLETE = "YOU MATCHED ALL THE CARDS!!!";
// Object that will hold the card ID and the card value
const flippedCard = {cardOneId: "", cardTwoId: "", cardOneVal: "", cardTwoVal: ""};
// Array of cards that have been matched throughout the game
const matchedCards = [];
// Flip counter
let flips = 0;
// Sight Words
const sightWords = ["a", "an", "and", "am", "are", "as", "at", "ate", "away", "be", "big", "black", "blue", "brown",
"but", "came", "can", "come", "did", "do", "down", "eat", "eight", "find", "five", "for", "four",
"get", "go", "good", "green", "has", "have", "he", "her", "here", "hers", "his", "him", "hum", "in",
"into", "I", "is", "it", "like", "look", "little", "make", "me", "my", "must", "new", "nine", "no",
"not", "of", "on", "one", "orange", "our", "out", "play", "pretty", "please", "purple", "ran", "red",
"run", "said", "say", "saw", "see", "seven", "she", "six", "small", "so", "soon", "ten", "that",
"the", "them", "they", "there", "this", "three", "to", "too", "two", "up", "was", "we", "white",
"why", "what", "who", "with", "year", "yes", "your", "yellow", "you", "yours", "zoo"];
// Audio Object
const audioSamples = {
welcome: ["dialog_welcome", "dialog_begin_by_selecting_a_card", "dialog_find_a_match", "dialog_lets_play_again"],
matchSuccess: ["dialog_good_job", "dialog_thats_a_match", "dialog_youre_awesome",
"dialog_wow_youre_really_good_at_this", "dialog_you_are_the_match_master", "dialog_match_tastic",
"dialog_you_have_some_awesome_matching_skills", "dialog_keep_it_up_youre_doing_great"],
matchFail: ["dialog_those_dont_match", "dialog_uhoh_those_dont_match", "dialog_keep_looking_i_know_you_can_do_it",
"dialog_try_again", "dialog_thats_not_a_match"],
gameComplete: ["dialog_game_complete"],
keepLooking: ["dialog_keep_looking", "dialog_can_you_find_another_match"]
};
// Create a new Score object
const theScore = new Score(0);
/**
* Function that initializes and starts the game
*/
function startGame(flag_restart_game) {
theScore.resetCurrentScore();
theScore.displayCurrentScore();
theScore.displayHighScore();
if ($(".flip-container").hasClass("flipped")) {
// We are restarting the game. Clear the flipped and locked classes so that the cards flip back
// over and are unlocked, that way the user can click them.
$(".flip-container").removeClass("flipped locked");
// Reset the flips counter
flips = 0;
// Clear the matched cards array
// Per this thread on StackOverflow: http://stackoverflow.com/a/1232046/520186
// this is the fastest way of clearing the array because the array is referenced in other functions.
while (matchedCards.length > 0) {
matchedCards.pop();
}
}
// Get eight words from the sight words array...
let sightWordsToUse = generateSightWords();
// Play the welcome sound
if (flag_restart_game === 1) {
$(playSound(audioSamples.welcome[2])).on("ended", function () {
// Populate the cards with the generated sight words
populateCardsWithWords(sightWordsToUse);
detectCardClick()
});
} else {
$(playSound(audioSamples.welcome[0])).on("ended", function () {
// Populate the cards with the generated sight words
populateCardsWithWords(sightWordsToUse);
// Allow the user to click the cards
$(playSound(audioSamples.welcome[1])).on("ended", function () {
detectCardClick()
});
});
}
}
/**
* This is where all the work happens
*/
function detectCardClick() {
$(".flip-container").on("click", function () {
// Check to see if there is a processing lock on the cards
if (isProcessingLock()) { // Locked
return;
}
// Increment the flips
flips === 2 ? flips = 1 : flips += 1;
// Check to see which flip we are attempting
if (flips === 1) { // First flip
// Get card ID
flippedCard.cardOneId = $(this).attr('id');
// Get card value
flippedCard.cardOneVal = $("#" + flippedCard.cardOneId).find(".card-text").text().toLowerCase();
// Check to see if the card is locked
if (isCardLocked(flippedCard.cardOneId)) {
flips = 0;
return;
}
// Lock the card so that the card cannot be flipped back
// over once it has been selected.
lockCard(flippedCard.cardOneId);
// Set the processing lock while audio is playing so that none of the cards
// can be flipped
addProcessingLock();
// Turn the card over
flipCard("#" + flippedCard.cardOneId);
$(playSound(flippedCard.cardOneVal)).on("ended", function () {
removeProcessingLock();
});
} else if (flips === 2) { // Second flip
// Get card ID
flippedCard.cardTwoId = $(this).attr('id');
// Get card value
flippedCard.cardTwoVal = $("#" + flippedCard.cardTwoId).find(".card-text").text().toLowerCase();
// Check to see if card is locked
if (isCardLocked(flippedCard.cardTwoId)) {
// Card is locked, reset the flip counter
flips = 1;
// Return because there is nothing more to do
return;
}
// Lock the card
lockCard(flippedCard.cardTwoId);
// Set the processing lock while audio is playing
addProcessingLock();
// Turn the second card
flipCard("#" + flippedCard.cardTwoId);
// Increment current score
theScore.incrementCurrentScore();
// Display the new score
theScore.displayCurrentScore();
// Play the card value audio
$(playSound(flippedCard.cardTwoVal)).on('ended', function () {
// Check to see if we have a match
if (flippedCard.cardOneVal === flippedCard.cardTwoVal) { // WOOHOO!!! WE FOUND A MATCH!!!
// Write success msg to the page alert area
$(".header").text(HEADER_MATCH_SUCCESS);
// Add the cards to the matched cards array
matchedCards.push(flippedCard.cardOneId, flippedCard.cardTwoId);
$(playSound(pickDialogAudio(audioSamples.matchSuccess))).on('ended', function () {
// Check to see if there are any more cards to match. If there are not, the player wins!
if (matchedCards.length === NUMBER_OF_CARDS) {
$(".header").text(HEADER_GAME_COMPLETE);
$(playSound(audioSamples.gameComplete[0])).on("ended", function () {
// Check to see if the current score is less than the stored best score
if (theScore.getHighScore() === 0 || theScore.getHighScore() > theScore.getCurrentScore()) {
// Set the high score
theScore.setHighScore(theScore.getCurrentScore());
// Display the high score
theScore.displayHighScore();
}
$(playSound(audioSamples.welcome[3])).on("ended", function () {
// Start a new game
startGame(1);
});
});
} else {
$(".header").text(HEADER_TITLE);
}
// Remove the processing lock on the cards
removeProcessingLock();
});
} else {
$(".header").text(HEADER_MATCH_FAIL);
$(playSound(pickDialogAudio(audioSamples.matchFail))).on('ended', function () {
// Remove the lock from both cards
unlockCard(flippedCard.cardOneId);
unlockCard(flippedCard.cardTwoId);
// Flip both cards back over
flipCard("#" + flippedCard.cardOneId);
flipCard("#" + flippedCard.cardTwoId);
$(".header").text(HEADER_TITLE);
removeProcessingLock();
});
}
});
}
});
}
/// UTILITY FUNCTIONS ///
/**
* Generates an array of 8 unique words randomly taken from the sightWords array
*
* @returns {Array} Returns an Array of sight words
*/
function generateSightWords() {
const sightWordsArr = [];
const numberOfWords = 8;
const indexArr = [];
// Generate 8 numbers with the lowest being 0 and the highest being the main sight words array length
while (indexArr.length < numberOfWords) {
const rndIndex = Math.floor((Math.random() * (sightWords.length - 1)));
// Each number need to be unique
if ($.inArray(rndIndex, indexArr) <= -1) {
indexArr.push(rndIndex);
}
}
// Push the value into the array
$.each(indexArr, function (index, value) {
sightWordsArr.push(sightWords[value]);
});
return sightWordsArr;
}
/**
* Populates the cards with the words from the passed array
*
* @param wordsArray {Array} An array of words that will be used to populate the cards with
*/
function populateCardsWithWords(wordsArray) {
const a1 = wordsArray.concat(wordsArray);
const a2 = shuffleArray(a1);
// DEBUG: Log the total array
console.log(a2);
for (let i = 1; i <= NUMBER_OF_CARDS; i++) {
$("#card-" + i).find(".card-text").text(a2[i - 1]);
// DEBUG: show which entry is in each card
console.log("card-" + i + " :: " + a2[i - 1]);
}
}
/**
* Randomize array element order in-place.
* Using Fisher-Yates shuffle algorithm.
*
* @param arrayToShuffle {Array} The array that is to be shuffled
* @returns {Array} Returns a randomly shuffled array
*/
function shuffleArray(arrayToShuffle) {
for (let i = arrayToShuffle.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
const temp = arrayToShuffle[i];
arrayToShuffle[i] = arrayToShuffle[j];
arrayToShuffle[j] = temp;
}
return arrayToShuffle;
}
/**
* Plays an audio clip
*
* Currently, the audio clip is set to auto play.
*
* @param audioName {string} Name of the audio clip without the extension
* @returns {HTMLElement} Returns the audio element
*/
function playSound(audioName) {
const audioElement = document.createElement('audio');
audioElement.setAttribute('src', 'audio/' + audioName + '.mp3');
audioElement.setAttribute('autoplay', 'autoplay');
return audioElement;
}
/**
* Picks a random audio sample from an array of audio samples that are passed into the function
* and returns the name of the audio sample
*
* @param {Array} audioSamples Array of the audio sample names
* @returns {string} Name of the selected audio sample
*/
function pickDialogAudio(audioSamples) {
const rndIndex = Math.floor((Math.random() * (audioSamples.length)));
return audioSamples[rndIndex];
}
/**
* Turns the card
*
* @param cardId {string} The card ID that needs to be flipped
*/
function flipCard(cardId) {
// Flip the card and set it to flipped
$(cardId).toggleClass("flipped");
}
/**
* Adds a processing lock to all of the cards.
*/
function addProcessingLock() {
$(".flip-container").addClass("processing");
}
/**
* Removes the processing lock from all of the cards.
*/
function removeProcessingLock() {
$(".flip-container").removeClass("processing");
}
/**
* Checks to see if there is a processing lock on any of the cards
*
* @returns {boolean} Returns TRUE if there is a processing lock active on the cards
*/
function isProcessingLock() {
return $(".flip-container").hasClass("processing");
}
/**
* Places a lock on a single card
*
* @param cardId {string} The ID of the card to lock
*/
function lockCard(cardId) {
$("#" + cardId).addClass("locked");
}
/**
* Removes a lock on a single card
*
* @param cardId {string} The ID of the card to unlock
*/
function unlockCard(cardId) {
$("#" + cardId).removeClass("locked");
}
/**
* Checks the locked state of the card
*
* @param cardId {string} The ID of the card that needs to be checked
* @returns {boolean} Returns TRUE if the card is actively locked
*/
function isCardLocked(cardId) {
return $("#" + cardId).hasClass("locked");
}
/**
* The Score object
*
* @param score
* @constructor
*/
function Score(score) {
this.score = score;
}
/**
* Resets the current score to 0
*/
Score.prototype.resetCurrentScore = function () {
this.setCurrentScore(0);
};
/**
* Resets the high score to 0
*/
Score.prototype.resetHighScore = function () {
this.setHighScore(0);
};
/**
* Gets the current score and returns it as a Number
*
* @returns {number} The current score
*/
Score.prototype.getCurrentScore = function () {
return Number(this.score);
};
/**
* Sets the current score to whatever is passed to it
*
* @param score The current score
*/
Score.prototype.setCurrentScore = function (score) {
this.score = score;
};
/**
* Displays the current score in the UI
*/
Score.prototype.displayCurrentScore = function () {
$("#score-current").find(".score-nums").text(this.score);
};
/**
* Gets the high score from the user cookie and if the cookie doesn't exist, it creates it
*
* @returns {number} The high score stored in the user's cookies as a Number
*/
Score.prototype.getHighScore = function () {
if (typeof $.cookie("high_score") === 'undefined') {
this.setHighScore(0);
}
return Number($.cookie("high_score"));
};
/**
* Sets the high score in the user's cookies
*
* @param score The high score to set
*/
Score.prototype.setHighScore = function (score) {
$.cookie("high_score", score, {expires: 365});
};
/**
* Displays the user's high score in the UI
*/
Score.prototype.displayHighScore = function () {
$("#score-best").find(".score-nums").text(this.getHighScore());
};
/**
* Increments the current score by 1 and sets it as the current score
*/
Score.prototype.incrementCurrentScore = function () {
this.setCurrentScore(++this.score);
};
|
rf3Studios/memgame-sight-words
|
js/game.js
|
JavaScript
|
mit
| 15,252 |
const Promise = require('bluebird');
const squel = require('squel').useFlavour('postgres');
const debug = require('debug')('GoodsController');
module.exports.getGoods = function(req, res, next) {
'use strict';
req.assert('storehouseId', 'storehouseId_required').notEmpty().isInt();
req.asyncValidationErrors()
.catch(function(errors) {
errors.status = 400;
return Promise.reject(errors);
})
.then(function() {
const storehouseId = req.sanitize('storehouseId').toInt();
const query = squel.select()
.from('goods')
.where('storehouse_id = ?', storehouseId)
.toString();
return req.db.many(query);
})
.catch(function(error) {
if (error.code === 0)
error.status = 404;
else
error.status = 400;
return Promise.reject(error);
})
.then(function(messages) {
res.status(200).send(messages).end();
})
.catch(next);
};
module.exports.createGood = function(req, res, next) {
'use strict';
req.assert('storehouseId', 'storehouseId_required').notEmpty().isInt();
req.asyncValidationErrors()
.catch(function(errors) {
errors.status = 400;
return Promise.reject(errors);
})
.then(function() {
return req.db.tx(function(context) {
const storehouseId = req.sanitize('storehouseId').toInt();
const name = req.sanitize('name').escape();
const values = {
storehouse_id: storehouseId,
name: name
};
const query = squel.insert()
.into('goods')
.setFields(values)
.returning('*')
.toString();
return context.one(query);
});
})
.catch(function(error) {
if (error.code === 23505) {
error.status = 403;
error.reason = '1';
}
return Promise.reject(error);
})
.then(function(data) {
debug('Good created: ', data);
res.status(201).send(data).end();
})
.catch(next);
};
|
oneassasin/api.storehouse
|
controllers/goods.js
|
JavaScript
|
mit
| 1,996 |
module.exports={A:{A:{"1":"A B","2":"H D G E HB"},B:{"1":"0 C p J L N I"},C:{"1":"0 1 2 4 6 7 8 9 F K H D G E A B C p J L N I O P Q R S T U V W X Y Z a c d e f g h i j k l m n o M q r s t u v w x y z AB BB","2":"3 cB aB UB"},D:{"1":"1 2 4 6 7 8 9 J L N I O P Q R S T U V W X Y Z a c d e f g h i j k l m n o M q r s t u v w x y z AB BB OB eB GB IB FB JB KB LB MB","16":"0 F K H D G E A B C p"},E:{"1":"K H D G E A B C PB QB RB SB TB b VB","2":"F NB EB"},F:{"1":"2 J L N I O P Q R S T U V W X Y Z a c d e f g h i j k l m n o M q r s t u v w x y z","16":"E WB","132":"B C XB YB ZB b CB bB DB"},G:{"1":"G C fB gB hB iB jB kB lB mB nB oB","2":"5 EB dB"},H:{"132":"pB"},I:{"1":"3 5 F GB sB tB uB vB","16":"qB rB"},J:{"1":"D A"},K:{"1":"M","132":"A B C b CB DB"},L:{"1":"FB"},M:{"1":"1"},N:{"1":"A B"},O:{"1":"wB"},P:{"1":"F K xB yB"},Q:{"1":"zB"},R:{"1":"0B"}},B:7,C:":optional CSS pseudo-class"};
|
Leo-g/Flask-Scaffold
|
app/templates/static/node_modules/caniuse-lite/data/features/css-optional-pseudo.js
|
JavaScript
|
mit
| 892 |
module.exports = function api(options) {
var routes = require('./routes');
this.add('role:api,path:dashboard', function (msg, respond) {
// console.warn('entering index js');
this.act('role:dashboard,cmd:index', msg, respond);
});
this.add('role:api,path:perspectives', function (msg, respond){
if(msg.request$.method === 'GET'){
this.act('role:perspectives,cmd:getall',msg,respond);
}
else{
this.act('role:perspectives,cmd:save', msg, respond);
}
});
this.add('role:api,path:datasources', function (msg, respond) {
if(msg.request$.method === 'GET'){
this.act('role:datasources,cmd:get', msg, respond);
}
else{
this.act('role:datasources,cmd:save', msg, respond);
}
});
this.add('role:api,path:indicatorsgetsync', function(msg, respond){
this.act('role:indicators,cmd:getallsync', msg, respond);
});
this.add('role:api,path:indicatorsgetall', function (msg, respond) {
this.act('role:indicators,cmd:getall', msg, respond);
});
this.add('role:api,path:indicatorcreate', function (msg, respond) {
this.act('role:indicators,cmd:save', msg, respond);
});
this.add('role:api,path:indicators', function (msg, respond) {
this.act('role:indicators,cmd:get', msg, respond);
});
this.add('role:api,path:goalindicator', function(msg,respond){
this.act('role:indicators,cmd:assigngoal', msg, respond);
});
this.add('role:api,path:goalindicatorremove', function(msg, respond){
this.act('role:indicators,cmd:removegoal', msg, respond);
});
// this.add('role:api,path:indicatorexpectation', function (msg, respond) {
// this.act('role:indicators,cmd:setquarter', msg, respond);
// });
this.add('role:api,path:indicatorsdatagetall', function (msg, respond) {
this.act('role:indicators,cmd:getallindicatordata', msg, respond);
});
this.add('role:api,path:updateindicatordata', function (msg, respond) {
this.act('role:indicators,cmd:updateindicatordata', msg, respond);
});
this.add('role:api,path:indicatorsdatasource', function (msg, respond) {
this.act('role:indicators,cmd:savedatasource', msg, respond);
});
this.add('role:api,path:indicatorsdata', function (msg, respond) {
this.act('role:indicators,cmd:saveimport', msg, respond);
});
this.add('role:api,path:goals', function(msg, respond){
this.act('role:goals,cmd:get', msg, respond);
});
this.add('role:api,path:goaldetailedperformance', function(msg, respond){
this.act('role:goals,cmd:detailedperformance', msg, respond);
});
this.add('role:api,path:goalcreate', function(msg, respond){
this.act('role:goals,cmd:save', msg, respond);
});
this.add('role:api,path:goalupdate', function(msg, respond){
this.act('role:goals,cmd:update', msg, respond);
});
this.add('role:api,path:goalremove', function(msg, respond){
this.act('role:goals,cmd:delete', msg, respond);
});
this.add('role:api,path:customers', function(msg,respond){
if(msg.request$.method === 'GET'){
this.act('role:customers,cmd:getall',msg,respond);
}
else{
this.act('role:customers,cmd:save', msg, respond);
}
});
this.add('role:api,path:login', function(msg, respond){
var pin = {
role:'user',
cmd:'login',
email: msg.request$.body.email,
password:msg.request$.body.password
};
this.act(pin, function(error, result){
respond(null, result);
});
});
this.add('role:api,path:auth', function(msg, respond){
var pin = {
role:'user',
cmd:'auth',
token: msg.args.params.token
};
this.act(pin, function(error, result){
respond(null, result);
});
});
this.add('role:api,path:profile', function(msg, respond){
console.log('profile', msg);
});
this.add('init:api', function (msg, respond) {
this.act('role:web',routes, respond);
});
this.wrap('role:api', function(msg, respond){
msg = setCustomerId(msg);
this.prior(msg, respond);
});
function setCustomerId(msg){
if(msg.request$ && msg.request$.user){
msg.args.params.customerId = msg.request$.user.user;
}
return msg;
}
}
|
gastonadrian/cmi-web
|
api/index.js
|
JavaScript
|
mit
| 4,597 |
var em = {
};
|
BonsaiDen/emblem-lang
|
lib/compiler/runtime/em.js
|
JavaScript
|
mit
| 16 |
const { SET_TIME, GET_TIME } = require('./constants');
const setTime = (time, roomId) => ({
type: SET_TIME,
time,
roomId
})
const getTime = (roomId) => ({
type: GET_TIME,
roomId
})
module.exports = {
setTime,
getTime
}
|
Bombanauts/Bombanauts
|
server/redux/timer/action-creator.js
|
JavaScript
|
mit
| 236 |
import '../../helpers/env';
import DomMock from '../../helpers/dom-mock';
import nock from 'nock';
import configureStore from 'redux-mock-store';
import thunkMiddleware from 'redux-thunk';
import expect from 'expect';
import * as actions from '../../../portal/src/actions/account';
import * as types from '../../../portal/src/constants/ActionTypes';
import Config from '../../../portal/src/config';
DomMock('<html><body></body></html>');
const mockStore = configureStore([thunkMiddleware]);
describe('[Portal] account action', () => {
afterEach(() => {
nock.cleanAll();
});
it('should create an action to receive account failure', () => {
expect(
actions.receiveAccountFailure('Error')
).toEqual({
type: types.RECEIVE_ACCOUNT_FAILURE,
errorMsg: 'Error'
});
});
it('should create an action to receive account success', () => {
const account = {
accountid: 'facebook-xxxxxx',
username: 'Mr. Test',
role: 'Admin'
};
expect(
actions.receiveAccountSuccess(account)
).toEqual({
type: types.RECEIVE_ACCOUNT_SUCCESS,
account
});
});
it('should create an action to set token', () => {
expect(
actions.setToken('token')
).toEqual({
type: types.SET_TOKEN,
token: 'token'
});
});
it('should create an action to handle token expired', () => {
const expectedActions = [
{ type: types.EXPIRED_TOKEN }
];
const store = mockStore({ surveyID: '', subject: '' });
store.dispatch(actions.expiredToken());
expect(
store.getActions()
).toEqual(expectedActions);
});
it('should create an action to handle verify token', () => {
const account = {
accountid: 'facebook-xxxxxx',
username: 'Mr. Test',
role: 'Admin'
};
const token = 'xxxxxxx';
nock(Config.baseURL, {
reqheaders: { 'authorization': token }
})
.get('/api/v1/mgnt/users/me')
.reply(200, account);
const expectedActions = [
{ type: types.SET_TOKEN, token },
{ type: types.RECEIVE_ACCOUNT_SUCCESS, account }
];
const store = mockStore({});
return store.dispatch(actions.verifyToken(token))
.then(() => {
expect(store.getActions()).toEqual(expectedActions);
});
});
});
|
trendmicro/serverless-survey-forms
|
web/test/portal/actions/account.js
|
JavaScript
|
mit
| 2,575 |
//= require vendor/jquery
//= require_tree ./plugins/
// Off Canvas Sliding
$(document).ready(function(){
// Menu button click
$('#js-menu-trigger').on('click touchstart', function(e){
$('#js-body').toggleClass('no-scroll');
$('#js-menu, #js-menu-screen').toggleClass('is-visible');
$('#js-menu-trigger').toggleClass('slide close');
$('#masthead, #page-wrapper').toggleClass('slide');
e.preventDefault();
});
// Page overlay click
$('#js-menu-screen').on('click touchstart', function(e){
$('#js-body').toggleClass('no-scroll');
$('#js-menu, #js-menu-screen').toggleClass('is-visible');
$('#js-menu-trigger').toggleClass('slide close');
$('#masthead, #page-wrapper').toggleClass('slide');
e.preventDefault();
});
});
// Add lightbox class to all image links
$("a[href$='.jpg'],a[href$='.png'],a[href$='.gif']").addClass("image-popup");
// Magnific-Popup options
$(document).ready(function() {
$('.image-popup').magnificPopup({
disableOn: function() {
if( $(window).width() < 500 ) {
return false;
}
return true;
},
type: 'image',
tLoading: 'Loading image #%curr%...',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: '<a href="%url%">Image #%curr%</a> could not be loaded.',
},
removalDelay: 300, // Delay in milliseconds before popup is removed
// Class that is added to body when popup is open.
// make it unique to apply your CSS animations just to this exact popup
mainClass: 'mfp-fade'
});
});
// Lazy Load
$("img.load").show().lazyload({
effect: "fadeIn",
skip_invisible: false
});
// FitVids
$(document).ready(function(){
// Target your .container, .wrapper, .post, etc.
$("#main").fitVids();
});
// Table of Contents Accordion
$("#markdown-toc").prepend("<li><h6>Overview</h6></li>");
// Add anchor links after headlines
var anchorForId = function (id) {
var anchor = document.createElement("a");
anchor.className = "header-link";
anchor.href = "#" + id;
anchor.innerHTML = "<i class=\"fa fa-link\"></i>";
return anchor;
};
var linkifyAnchors = function (level, containingElement) {
var headers = containingElement.getElementsByTagName("h" + level);
for (var h = 0; h < headers.length; h++) {
var header = headers[h];
if (typeof header.id !== "undefined" && header.id !== "") {
header.appendChild(anchorForId(header.id));
}
}
};
document.onreadystatechange = function () {
if (this.readyState === "complete") {
var contentBlock = document.getElementsByClassName("page-content")[0];
if (!contentBlock) {
return;
}
for (var level = 1; level <= 6; level++) {
linkifyAnchors(level, contentBlock);
}
}
};
|
ClimbAFingMountain/ClimbAFingMountain.github.io
|
_assets/javascripts/main.js
|
JavaScript
|
mit
| 2,789 |
import React from 'react';
import './assets/scss';
import './assets/images';
const ItemImage = ({ itemNumber, clickedItems, scrolledItem, content }) => {
const backgroundImage = () => {
for (let x = 0; x < content.length; x++) {
if (itemNumber === x) {
if (clickedItems !== undefined && clickedItems.includes(itemNumber)) {
if (content[x].gif !== undefined) return content[x].gif;
} else if (content[x].png !== null) return content[x].png;
}
}
};
const divStyle = {
backgroundImage: `url(/assets/images/${backgroundImage()})`
};
const setClass = () => {
const itemImageClass = ['img'];
if (scrolledItem) itemImageClass.push('scrolledImg');
if (clickedItems !== undefined && clickedItems.includes(itemNumber)) {
itemImageClass.push('activeImg');
}
return itemImageClass;
};
return <div className={setClass().join(' ')} style={divStyle} />;
};
export default ItemImage;
|
JamesMillercus/Portfolio-Website
|
web/react/src/client/components/locs/GridContainer/ItemContainer/ItemImage/ItemImage.js
|
JavaScript
|
mit
| 918 |
let Drag = React.createClass({
//核心还是要控制 left 和 top
getInitialState(){
return this.props;
},
handleMouseDown(event){
this.x = event.pageX - event.target.offsetLeft;
this.y = event.pageY - event.target.offsetTop;
this.dragging = true;//正在拖中
},
handleMouseMove(event){
if(this.dragging){
this.setState({
left:event.pageX - this.x,
top:event.pageY - this.y
})
}
},
handleMouseUp(){
this.dragging = false;//拖结束
},
render(){
return (
<div style={this.state} onMouseDown={this.handleMouseDown} onMouseMove={this.handleMouseMove} onMouseUp={this.handleMouseUp}></div>
)
}
});
let props = {
position:'absolute',
width:100,
height:100,
backgroundColor:'green',
top:0,
left:0
}
ReactDOM.render(<Drag {...props} />, document.querySelector('#app')
);
|
zhufengnodejs/201615node
|
3.react/js/14.drag.js
|
JavaScript
|
mit
| 873 |
import {
fetch,
} from 'j0';
import '../*/test/index.js';
import tests from '../tests.js';
tests(fetch, ['fetch']);
|
kei-ito/j0
|
lib/fetch/test/index.js
|
JavaScript
|
mit
| 120 |
// loading modules/libraries
var jsforce = require('jsforce');
var gpio = require('rpi-gpio');
var email = require('emailjs/email');
// GPIO pin number
const GPIO_PIN = 7;
// how frequently (in milliseconds) should the door be checked
const CHECKER_FREQUENCY = 400;
// salesforce variables
const SOBJECT_NAME = 'Doggy_Door_Activity__c';
var sfdc = {
clientId : '',
clientSecret : '',
redirectUri : '',
instanceUrl : '',
accessToken : '',
refreshToken : ''
};
// gmail variables
const EMAIL_TO_NOTIFY = ''; // email address of where the notifications should be sent.
const EMAIL_SENDER = ''; // email address of where the notifications should come from.
var gmail = email.server.connect({
user : '', // email address
password : '',
host : '',
ssl : true
});
// variables for tracking last door status
const STATE_OPEN = 'OPEN';
const STATE_CLOSED = 'CLOSED';
var previousDoorState = STATE_CLOSED;
var didSendStuckEmail = false;
var didSendErrorEmail = false;
var openTimeStamp;
// utility variables
const WEEKDAYS = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
/**
* @author: John Schultz
* @date: 2017-03-23
* @description: Checks the status of the door sensor by calling gpio methods.
*/
function checkDoorStatus() {
gpio.read(GPIO_PIN, function(err, value){
var dateObj = new Date();
var currentState;
if (err) {
console.error('ERROR READING DOOR: ' + err);
emailError(err, null);
}
else {
currentState = value ? STATE_CLOSED : STATE_OPEN;
if (previousDoorState != currentState) {
// door has just opened or closed.
previousDoorState = currentState;
// door has changed from closed to open
if (currentState === STATE_OPEN) {
notifySalesforce(currentState, dateObj);
updateFirstOpenTimeStamp(dateObj);
}
}
else if (currentState === STATE_OPEN) {
// door was and is open.
if (checkIfStuckOpen(dateObj)) {
// door is stuck open
emailDoorStuckOpen();
}
}
}
});
// re-run this function at a set interval
setTimeout(checkDoorStatus, CHECKER_FREQUENCY);
}
/**
* @author: John Schultz
* @date: 2017-03-23
* @description: Creates a salesforce Oauth connection and inserts a new record.
* @param: status - String.
* @param: dateObj - Date object.
*/
function notifySalesforce(status, dateObj) {
console.log('Notifying salesforce... ' + status);
var timeStamp = dateObj.getTime();
var hour = dateObj.getHours();
var day = WEEKDAYS[dateObj.getDay()];
var conn = new jsforce.Connection({
oauth2 : {
clientId : sfdc.clientId,
clientSecret : sfdc.clientSecret,
redirectUri : sfdc.redirectUri
},
instanceUrl : sfdc.instanceUrl,
accessToken : sfdc.accessToken,
refreshToken : sfdc.refreshToken
});
conn.on('refresh', function(accessToken, res){
sfdc.accessToken = accessToken;
});
conn.sobject(SOBJECT_NAME).create(
{
Timestamp__c : timeStamp,
Hour__c : hour,
Day__c : day
},
function(err, ret){
if (err || !ret.success) {
console.error(err, ret);
emailError(err, ret);
}
else {
console.log('Created doggy door activity. ID: ' + ret.id);
}
}
);
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Updates the timestamp of the first time the door is opened.
* @param: dateObj - Date object
*/
function updateFirstOpenTimeStamp(dateObj) {
openTimeStamp = dateObj.getTime();
didSendStuckEmail = false;
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Compares current timestamp with first time the door opened to see if it has been stuck open for longer than 5 minutes.
* @param: dateObj - Date object.
* @return: Boolean
*/
function checkIfStuckOpen(dateObj) {
var fiveMinutes = 300000;
var timeStamp = dateObj.getTime();
// return true if the door has been open longer than 5 minutes
return (timeStamp - openTimeStamp > fiveMinutes);
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Sends an email to alert that the door is stuck open if one hasn't already been sent.
*/
function emailDoorStuckOpen() {
if (!didSendStuckEmail) {
var subject,
body;
subject = 'The doggy door is stuck open!';
body = 'The doggy door has been stuck open for more than 5 minutes.';
// set to true so that we only get 1 email notification about it being stuck open.
didSendStuckEmail = true;
sendEmail(subject, body);
}
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Sends an email about errors.
* @param: err - Error message.
* @param: resp - Optional response object.
*/
function emailError(err, resp) {
if (!didSendErrorEmail) {
var subject,
body;
subject = 'Doggy Door App Error';
body = 'There is an error with the Doggy Door App.\r\r\r\r';
body += 'Error: ' + err;
if (resp) {
body += '\r\r';
body += 'Response: ' + JSON.stringify(resp);
}
// set to true so that we only get 1 email notification about an error.
didSendErrorEmail = true;
sendEmail(subject, body);
}
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Sends email when the doggy door app starts.
*/
function emailStartup() {
var subject = 'Doggy Door App Starting Up';
var body = 'The Doggy Door App has just started.';
sendEmail(subject, body);
}
/**
* @author: John Schultz
* @date: 2017-03-28
* @description: Sends emails.
* @param: emailSubject - String. Email subject line.
* @param: emailBody - String. Email body.
*/
function sendEmail(emailSubject, emailBody) {
gmail.send(
{
to : EMAIL_TO_NOTIFY,
from : EMAIL_SENDER,
subject : emailSubject,
text : emailBody
},
function(err, message) {
console.log(err || message);
}
);
}
// start process
console.log('Starting doggy door checker...');
emailStartup();
gpio.setup(GPIO_PIN, gpio.DIR_IN, checkDoorStatus);
|
jcschultz/doggy-door
|
pi/doggydoor.js
|
JavaScript
|
mit
| 5,832 |
/**This file contains functions related to checking for, adding
* and deleting .comment` files and `.comments` directories.*/
/*
* c
* https://github.com/rumpl/c
*
* Copyright (c) 2012 Djordje Lukic
* Licensed under the MIT license.
*/
"use strict";
const fs = require("fs"); //FileSystem
const path = require("path"); //Paths
const storage = module.exports;
//Constants representing the directory name & file extension, respectively.
const DIRECTORY = ".comments";
const EXTENSION = ".comment";
/**Sets a `.comment` file for a specific file.
* @param {string} absolutePathToTarget the absolute path from the
* working directory to the target node.
* @param {string} comment The comment to be written.
* @returns {number} exit code.
*/
storage.setCommentFile = function (absolutePathToTarget, comment) {
//Check if `.comments` exists, makes it if not.
if (!storage.commentsFolderExists(path.dirname(absolutePathToTarget))) {
createCommentsFolder(path.dirname(absolutePathToTarget));
}
const fileObject = fs.openSync(
getCommentsFile(absolutePathToTarget),
"a",
"0644"
);
fs.writeSync(fileObject, comment + "\n", null, "utf8");
fs.closeSync(fileObject);
return 0;
};
/**Deletes a `.comment` file, and deletes `.comments` if it is left empty.
* @param {string} absolutePathToTarget An absolute path to the
* target directory.
* @returns {number} exit code.
*/
storage.delete = function (absolutePathToTarget) {
if (!storage.commentsFolderExists(path.dirname(absolutePathToTarget))) {
return 1;
}
const commentsFile = getCommentsFile(absolutePathToTarget);
//If the `file.comment` does not exist...
if (!fs.existsSync(commentsFile)) {
return 1;
}
fs.unlinkSync(commentsFile);
//If the `.comments` directory is now empty...
if (
storage.loadFiles(path.join(path.dirname(absolutePathToTarget), DIRECTORY))
.length == 0
) {
fs.rmdirSync(path.join(path.dirname(absolutePathToTarget), DIRECTORY));
}
return 0;
};
/**Checks if `.comments` exists.
* @param {string} absolutePathToTargetParent the path to
* the parent of the target.
* @returns {boolean} true if `.comments` is present in the directory.
* */
storage.commentsFolderExists = function (absolutePathToTargetParent) {
return (
fs.existsSync(path.join(absolutePathToTargetParent, DIRECTORY)) &&
fs.statSync(absolutePathToTargetParent).isDirectory()
);
};
/**Loads the names of all files & directories in the
* current directory, EXCEPT `.comments` folder.
* @param {string} filePath a valid file path. May
* be either relative or absolute.
* @returns An array of filenames.
*/
storage.loadFiles = function (filePath) {
return fs.readdirSync(filePath).filter((file) => {
return file !== DIRECTORY;
});
};
/**Loads the comments of all files & directories in the current directory.
* @param {string} filePath a valid file path. May
* be either relative or absolute.
* @returns {array} A string array of comments.
*/
storage.loadComments = function (filePath) {
let comments = [];
const commentDir = fs.readdirSync(path.join(filePath, DIRECTORY));
commentDir.forEach(function (file) {
comments[path.basename(file, EXTENSION)] = fs
.readFileSync(path.join(filePath, DIRECTORY, file))
.toString();
});
return comments;
};
/**Fetches the comment associated with the current
directory from it's parent directory.
* @param {string} filePath a valid file path. May
be either relative or absolute.
* @returns {string} The comment associated with the directory.
*/
storage.returnCurrentDirectoryParentComment = function (filePath) {
const parentDir = path.join(filePath, "../");
if (!storage.commentsFolderExists(parentDir)) {
return "";
}
/*Loads the comments from parentDir into array; returns what is found
in the space indexed by the directory name.*/
const comment = storage.loadComments(parentDir)[
getFileNameFromPath(filePath)
];
if (comment) {
return `[Parent] ${comment}`;
}
return "";
};
/**Fetches the comment associated with the current
directory from it's parent directory.
* @param {string} relativePathToTarget the relative path from the
* current directory to the target directory.
* @returns {string} The comment associated with the directory.
*/
storage.returnCurrentDirectoryGrandparentComment = function (
relativePathToTarget
) {
const grandparentDir = path.join(relativePathToTarget, "../../");
if (!storage.commentsFolderExists(grandparentDir)) {
return "";
}
/*Loads the comments from grandparentDir into array; returns what is found
in the space indexed by the directory name.*/
const comment = storage.loadComments(grandparentDir)[
getFileNameFromPath(path.join(relativePathToTarget, "../"))
];
if (comment) {
return `[Grandparent] ${comment}`;
}
return "";
};
/**Finds out if the provided path is valid.
* @param {string} relativePathToTarget Relative file path.
* @returns {boolean} if the path exists.
*/
storage.ifPathIsValid = function (relativePathToTarget) {
return fs.existsSync(relativePathToTarget);
};
/**Finds out if the provided path is valid & not a file.
* @param {string} relativePathToTarget Relative file path.
* @returns {boolean} if the path exists & is not a file.
*/
storage.ifPathIsValidAndNotFile = function (relativePathToTarget) {
return (
fs.existsSync(relativePathToTarget) &&
!fs.statSync(relativePathToTarget).isFile()
);
};
/**Creates a `.comments` directory.
* @param {string} absolutePathToParent a relative directory from the
* working directory to the target files directory.
* @returns {number} exit code.
*/
function createCommentsFolder(absolutePathToParent) {
fs.mkdirSync(path.join(absolutePathToParent, DIRECTORY), "0755");
return 0;
}
/**Gets a single `.comment` file path from `.comments`.
* @param {string} absolutePathToTarget a provided filename from the file tree.
* @returns {string} parameter `file`'s equivalent `.comment` file.
*/
function getCommentsFile(absolutePathToTarget) {
console.log(absolutePathToTarget);
const dirname = path.dirname(absolutePathToTarget);
const filename = getFileNameFromPath(absolutePathToTarget);
return path.join(dirname, DIRECTORY, filename + EXTENSION);
}
/**From a valid filepath, returns the file the path refers to.
* For example, `getFileName("path/to/thisFile")` returns `thisFile`.
* @param {string} filePath a valid filepath, may be
* either relative or absolute.
* @returns {string} the filename the path refers to.
*/
function getFileNameFromPath(filePath) {
return path.basename(path.resolve(filePath));
}
|
rumpl/c
|
src/storage.js
|
JavaScript
|
mit
| 6,901 |
const { rdfsResource } = require('../constants');
const getGraphqlInterfaceType = require('./getGraphqlInterfaceType');
function getGraphqlPolymorphicObjectType(g/*, ranges*/) {
// TODO
return getGraphqlInterfaceType(g, rdfsResource);
}
module.exports = getGraphqlPolymorphicObjectType;
|
nelson-ai/semantic-graphql
|
src/graphql/getGraphqlPolymorphicObjectType.js
|
JavaScript
|
mit
| 293 |
// Generated by psc-make version 0.6.9.5
"use strict";
var Prelude = require("Prelude");
var Control_Monad_Eff = require("Control.Monad.Eff");
var hasStderr;
try { hasStderr = !!process.stderr; } catch (e) { hasStderr = false; }
;
function consoleLog(s) {
return function() {
console.log(s);
};
};
function consoleError(s) {
return function() {
console.error(s);
};
};
function savePos() {
process.stderr.write("\x1b[s");
};
function restorePos() {
process.stderr.write("\x1b[u");
};
function eraseLine() {
process.stderr.write("\x1b[K");
};
function print(s) {
return function() {
process.stderr.write("\x1b[33m" + s + "\x1b[0m");
};
};
function printLabel(s) {
return function() {
process.stderr.write("\x1b[33;1m" + s + "\x1b[0m");
};
};
function printFail(s) {
return function() {
process.stderr.write("\x1b[31;1m" + s + "\x1b[0m");
};
};
function printPass(s) {
return function() {
process.stderr.write("\x1b[32m" + s + "\x1b[0m");
};
};
module.exports = {
printPass: printPass,
printFail: printFail,
printLabel: printLabel,
print: print,
eraseLine: eraseLine,
restorePos: restorePos,
savePos: savePos,
consoleError: consoleError,
consoleLog: consoleLog,
hasStderr: hasStderr
};
|
holoed/AwesomeProject
|
node_modules/Test.Unit.Console/index.js
|
JavaScript
|
mit
| 1,379 |
'use strict';
var methods = {
'get': {method:'GET'},
'save': {method:'POST'},
'update': {method:'PUT'},
'query': {method:'GET', isArray:true},
'remove': {method:'DELETE'},
'delete': {method:'DELETE'}};
angular.module('fink.resources', ['ngResource']).factory('Tag', function($resource){
return $resource(fink_base+'/admin/api/tags/:tagId', {tagId:'@id'}, methods);
}).factory('Post', function($resource){
return $resource(fink_base+'/admin/api/posts/:postId', {postId:'@id'}, methods);
}).factory('Category', function($resource){
return $resource(fink_base+'/admin/api/categories/:categoryId', {categoryId:'@id'}, methods);
}).factory('Gallery', function($resource){
return $resource(fink_base+'/admin/api/galleries/:galleryId', {galleryId:'@id'}, methods);
}).factory('Page', function($resource){
return $resource(fink_base+'/admin/api/pages/:pageId', {pageId:'@id'}, methods);
}).factory('Image', function($resource){
return $resource(fink_base+'/admin/api/images/:imageId', {imageId:'@id'}, methods);
}).factory('Settings', function($resource){
return $resource(fink_base+'/admin/api/settings', {}, {
'get' : { method: 'GET' },
'save': { method: 'PUT' }
});
}).value('version', '0.1');
|
dozed/fink
|
src/main/webapp/admin/js/services.js
|
JavaScript
|
mit
| 1,234 |
/**!
* Pilot.js
* Version: 0.01
* Super-simple analytics component for the Pilot Wordpress management platform
*/
(function() {
init();
function init() {
var basic_data = {};
// collect basic data about the client
var basic_data = collect_basic_data();
// calculate the page load time AND submit everything
calculate_load_time(function(duration) {
basic_data['load_time'] = duration;
submit_data(basic_data);
});
}
/**
* Figure out the load time of the page and call the callback provided
* with the time in milliseconds
*/
function calculate_load_time(callback) {
// if the performance api isn't available, fall back to javascript date
var use_date_timing = (typeof window.performance == 'object') ? false : true;
var time_start = undefined;
var time_end = undefined;
do_start_calc();
if(window.attachEvent) {
window.attachEvent('onload', do_end_calc);
} else {
if(window.onload) {
var curronload = window.onload;
var newonload = function() {
curronload();
do_end_calc();
};
window.onload = newonload;
} else {
window.onload = do_end_calc;
}
}
function do_start_calc() {
if(use_date_timing) {
time_start = Date.now();
} else {
time_start = performance.timing.navigationStart;
}
}
function do_end_calc() {
var delay = 0;
if(!use_date_timing) {
delay = 500; // delay so load end even can fire
}
setTimeout(calculate_and_return, delay);
function calculate_and_return() {
if(use_date_timing) {
time_end = Date.now();
difference = time_end - time_start;
} else {
difference = performance.timing.loadEventEnd - performance.timing.navigationStart;
}
callback.call(this, difference);
}
}
}
/**
* Grab some basic information about the client and return an object
*/
function collect_basic_data() {
return {
client_w: screen.width,
client_h: screen.height
}
}
/**
* Submit the analytics data to the server
* @param Array - data to submit
*/
function submit_data( payload ) {
var payload_parts = [];
var formatted_payload;
for(key in payload) {
if(payload.hasOwnProperty(key)) {
payload_parts.push(key + '=' + payload[key]);
}
}
formatted_payload = '?' + payload_parts.join('&');
var img = document.createElement('img');
img.src = 'http://example.com/submit.php' + encodeURI(formatted_payload);
img.setAttribute('style', 'display:none;');
var target = document.getElementsByTagName('body')[0];
target.appendChild(img);
}
})();
|
Crane7/pilot-analytics
|
pilot.js
|
JavaScript
|
mit
| 2,593 |
export default {
'': '首页',
inTheaters: '正在上映',
comingSoon: '即将上映',
top250: '豆瓣电影Top250'
};
|
NJU-SAP/movie-board
|
src/mb/constants/topics.js
|
JavaScript
|
mit
| 127 |
var express = require('express');
var router = express.Router();
var passport = require('passport');
var authentication = require('../middlewares/authentication');
var Publicacion = require('../models/PublicacionSchema');
var Comentario = require('../models/ComentarioSchema');
var Respuesta = require('../models/RespuestaSchema');
var Publicator = require('../modules/Publicator');
var UsuarioAccion = require('../models/UsuarioAccionSchema');
var UsuarioNotificacion = require('../models/UsuarioNotificacionSchema');
var PublicacionLike = require('../models/PublicacionLikeSchema');
var PublicacionDisLike = require('../models/PublicacionDisLikeSchema');
var ComentarioLike = require('../models/ComentarioLikeSchema');
var ComentarioDisLike = require('../models/ComentarioDisLikeSchema');
var RespuestaLike = require('../models/RespuestaLikeSchema');
var RespuestaDisLike = require('../models/RespuestaDisLikeSchema');
var UsuarioAceptacion = require('../models/UsuarioAceptacionSchema');
var UsuarioSeguidor = require('../models/UsuarioSeguidorSchema');
router.post('/propuestas', authentication.isCandidato, function(req, res, next) {
Publicator.propuesta(req, res, next);
});
router.post('/quejas', authentication.isCiudadano, function(req, res, next) {
Publicator.queja(req, res, next);
});
router.get('/', function(req, res, next) {
Publicacion.find({eliminada: false}, function(err, publicaciones) {
if (!err) {
res.json(publicaciones);
} else {
return next(err);
}
});
});
router.get('/aceptadas/:id_usuario', function(req, res, next) {
var id_usuario = req.params.id_usuario;
Publicacion.find({aceptada: true, aceptada_por: id_usuario, eliminada: false}, function(err, publicaciones) {
if (!err) {
res.json(publicaciones);
} else {
return next(err);
}
});
});
router.get('/propuestas', function(req, res, next) {
Publicacion.find( {propuesta: true, eliminada: false}, function(err, publicaciones) {
if (!err) {
res.json(publicaciones);
} else {
return next(err);
}
});
});
router.get('/quejas', function(req, res, next) {
Publicacion.find( {propuesta: false, eliminada: false}, function(err, publicaciones) {
if (!err) {
res.json(publicaciones);
} else {
return next(err);
}
});
});
router.get('/comentarios/:id_comentario', function(req, res, next) {
var id_comentario = req.params.id_comentario;
Comentario.findOne({_id: id_comentario},'-__v', function(err, comentario) {
if (!err) {
res.json(comentario);
} else {
return next(err);
}
});
});
router.put('/likeComentario/:id_comentario', function(req, res, next) {
var id_comentario = req.params.id_comentario;
ComentarioLike.findOne({id_usuario: req.user.id_usuario, id_comentario: id_comentario}, function(err, comentarioLike) {
if (!err) {
if (comentarioLike) {
res.status(400).json({message: 'Sólo se puede dar un me gusta'});
} else {
var comentarioLike = new ComentarioLike();
comentarioLike.id_usuario = req.user.id_usuario;
comentarioLike.id_comentario = id_comentario;
comentarioLike.save(function(err) {
if (!err) {
Comentario.findOneAndUpdate({_id: id_comentario}, {$inc: {cantidad_likes: 1}}, function(err, comentario) {
if (!err) {
res.json(comentario);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'Error'});
}
});
});
router.put('/disLikeComentario/:id_comentario', function(req, res, next) {
var id_comentario = req.params.id_comentario;
ComentarioDisLike.findOne({id_usuario: req.user.id_usuario, id_comentario: id_comentario}, function(err, comentarioDisLike) {
if (!err) {
if (comentarioDisLike) {
res.status(400).json({message: 'Sólo se puede dar un no me gusta'});
} else {
var comentarioDisLike = new ComentarioDisLike();
comentarioDisLike.id_usuario = req.user.id_usuario;
comentarioDisLike.id_comentario = id_comentario;
comentarioDisLike.save(function(err) {
if (!err) {
Comentario.findOneAndUpdate({_id: id_comentario}, {$inc: {cantidad_disLikes: 1}}, function(err, comentario) {
if (!err) {
res.json(comentario);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'Error'});
}
});
});
router.put('/likeRespuesta/:id_respuesta', function(req, res, next) {
var id_respuesta = req.params.id_respuesta;
RespuestaLike.findOne({id_usuario: req.user.id_usuario, id_respuesta: id_respuesta}, function(err, respuestaLike) {
if (!err) {
if (respuestaLike) {
res.status(400).json({message: 'Sólo se puede dar un me gusta'});
} else {
var respuestaLike = new RespuestaLike();
respuestaLike.id_usuario = req.user.id_usuario;
respuestaLike.id_respuesta = id_respuesta;
respuestaLike.save(function(err) {
if (!err) {
Respuesta.findOneAndUpdate({_id: id_respuesta}, {$inc: {cantidad_likes: 1}}, function(err, respuesta) {
if (!err) {
res.json(respuesta);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'Error'});
}
});
});
router.put('/disLikeRespuesta/:id_respuesta', function(req, res, next) {
var id_respuesta = req.params.id_respuesta;
RespuestaDisLike.findOne({id_usuario: req.user.id_usuario, id_respuesta: id_respuesta}, function(err, respuestaDisLike) {
if (!err) {
if (respuestaDisLike) {
res.status(400).json({message: 'Sólo se puede dar un no me gusta'});
} else {
var respuestaDisLike = new RespuestaDisLike();
respuestaDisLike.id_usuario = req.user.id_usuario;
respuestaDisLike.id_respuesta = id_respuesta;
respuestaDisLike.save(function(err) {
if (!err) {
Respuesta.findOneAndUpdate({_id: id_respuesta}, {$inc: {cantidad_disLikes: 1}}, function(err, respuesta) {
if (!err) {
res.json(respuesta);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'Error'});
}
});
});
router.get('/:id_comentario/respuestas', function(req, res, next) {
var id_comentario = req.params.id_comentario;
Respuesta.find({id_comentario: id_comentario}, function(err, respuesta) {
if (!err) {
res.json(respuesta);
} else {
return next(err);
}
});
});
router.post('/:id_comentario/respuestas', authentication.isLoggedIn, function(req, res, next) {
var id_comentario = req.params.id_comentario;
var respuesta = new Respuesta();
var comentario = Comentario.findOne({_id: id_comentario}, function(err, comentario) {
if (err) {
res.status(400).json({message: 'Comentario no encontrado'})
} else {
comentario.toObject();
respuesta.id_usuario = req.user.id_usuario;
respuesta.imagen_perfil = req.user.imagen_perfil;
respuesta.id_comentario = comentario['_id'];
respuesta.descripcion = req.body.descripcion;
respuesta.save(function(err) {
if (!err) {
res.json({message: 'Respuesta creada con exito'})
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
});
});
router.get('/:id_publicacion', function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
Publicacion.findOne({_id: id_publicacion},'-__v', function(err, publicacion) {
if (!err) {
if (publicacion.eliminada == true) {
res.status(400).json({message: 'Publicacion eliminada'});
return;
}
if (req.user){
UsuarioAccion.findOneAndUpdate(
{id_usuario: req.user.id_usuario},
{$addToSet: {id_propuestas_vistas: id_publicacion}},
function(err, usuarioAccion) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'});
return;
} else {
UsuarioNotificacion.findOneAndUpdate(
{id_usuario: req.user.id_usuario},
{$pull: {notificacion_publicaciones: {id_objeto: id_publicacion}}},
function(err, usuarioNotificacion) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'});
return;
} else {
res.json(publicacion);
}
});
}
});
} else {
res.json(publicacion);
}
} else {
return next(err);
}
});
});
router.put('/:id_publicacion/like', function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
PublicacionLike.findOne({id_usuario: req.user.id_usuario, id_publicacion: id_publicacion}, function(err, publicacionLike) {
if (!err) {
if (publicacionLike) {
res.status(400).json({message: 'Sólo se puede dar un me gusta'});
} else {
var publicacionLike = new PublicacionLike();
publicacionLike.id_usuario = req.user.id_usuario;
publicacionLike.id_publicacion = id_publicacion;
publicacionLike.save(function(err) {
if (!err) {
Publicacion.findOneAndUpdate({_id: id_publicacion}, {$inc: {cantidad_likes: 1}}, function(err, publicacion) {
if (!err) {
res.json(publicacion);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'error'});
}
});
});
router.put('/:id_publicacion/disLike', function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
PublicacionDisLike.findOne({id_usuario: req.user.id_usuario, id_publicacion: id_publicacion}, function(err, publicacionDisLike) {
if (!err) {
if (publicacionDisLike) {
res.status(400).json({message: 'Sólo se puede dar un no me gusta'});
} else {
var publicacionDisLike = new PublicacionDisLike();
publicacionDisLike.id_usuario = req.user.id_usuario;
publicacionDisLike.id_publicacion = id_publicacion;
publicacionDisLike.save(function(err) {
if (!err) {
Publicacion.findOneAndUpdate({_id: id_publicacion}, {$inc: {cantidad_disLikes: 1}}, function(err, publicacion) {
if (!err) {
res.json(publicacion);
} else {
console.log(err);
return next(err);
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
} else {
res.status(400).json({message: 'error'});
}
});
});
router.get('/:id_publicacion/comentarios', function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
Comentario.find({id_publicacion: id_publicacion}, function(err, comentario) {
if (!err) {
res.json(comentario);
} else {
return next(err);
}
});
});
router.post('/:id_publicacion/comentarios', authentication.isLoggedIn, function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
var comentario = new Comentario();
var publicacion = Publicacion.findOne({_id: id_publicacion}, function(err, publicacion) {
if (err) {
res.status(400).json({message: 'Publicacion no encontrada'})
} else {
publicacion.toObject();
comentario.id_usuario = req.user.id_usuario;
comentario.imagen_perfil = req.user.imagen_perfil;
comentario.id_publicacion = publicacion['_id'];
comentario.descripcion = req.body.descripcion;
comentario.save(function(err) {
if (!err) {
res.json({message: 'Comentario creada con exito'})
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
});
});
router.post('/:id_publicacion/aceptaciones', authentication.isLoggedIn, function(req, res, next) {
var id_publicacion = req.params.id_publicacion;
var id_usuario = req.user.id_usuario;
var publicacion = Publicacion.findOne({_id: id_publicacion}, function(err, publicacion) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'})
} else {
if (!publicacion) {
res.status(400).json({message: 'Queja no encontrada'})
}
if (publicacion.aceptada_por) {
res.status(400).json({message: 'La Queja ya fue aceptada'})
}
publicacion.aceptada = true;
publicacion.aceptada_por = id_usuario;
publicacion.save(function(err) {
if (!err) {
UsuarioAceptacion.findOneAndUpdate(
{id_usuario: req.user.id_usuario},
{$addToSet: {id_quejas_aceptadas: id_publicacion}},
function(err, usuarioAccion) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'})
} else {
/* crear notificacion para cada seguidor */
UsuarioSeguidor.findOne({id_usuario: id_usuario}, function(err, usuarioSeguidor) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'});
return;
}
usuarioSeguidor.id_seguidores.forEach(function(id_seguidor, index){
UsuarioNotificacion.findOneAndUpdate(
{id_usuario: id_seguidor},
{
$addToSet: {
notificacion_publicaciones: {
id_candidato: id_usuario,
id_objeto: publicacion._id,
titulo: publicacion.titulo,
aceptacion: true
}
}
},
function(err, usuarioNotificacion) {
if (err) {
res.status(500).json({message: 'Intente de nuevo'});
}
});
});
});
res.json({message: 'Queja aceptada con exito!'})
}
});
} else {
res.status(400).json({message: 'Verifique los campos'});
}
});
}
});
});
module.exports = router;
|
slcosentino/ar-vota
|
app/routes/publicaciones.js
|
JavaScript
|
mit
| 15,428 |
/**
* The file defines the UI components which can be used in conjunction with the logic layer of the
* JSW Toolkit.
*
* Copyright <c> The University of Mancehster, 2010 - 2011.
* @author Vit Stepanovs <vitaly.stepanov@gmail.com>
*/
/** Namespace for all library objects. */
var jsw;
if (!jsw) {
jsw = {};
}
jsw.ui = {};
/**
* TableControl component allows to display data stored in the given array in a tabular form.
* Each element of array is expected to be an object of the same structure. Property names are used
* as column headers.
*
* @param dataSet Data set to display as a table.
* @param hostId ID of the HTML element to display the table in.
* @param tableClass (optional) Name of the CSS class to use for the table generated.
* @param noDataMsg (optional) Message to be displayed if the data set is empty.
*/
jsw.ui.TableControl = function (dataSet, hostId, tableClass, noDataMsg) {
var host, html, rowCount;
host = document.getElementById(hostId);
if (!host) {
throw 'The host element with ID "' + hostId + ' does not exist in the document!"';
}
if (!noDataMsg) {
noDataMsg = 'The data set contains no results!';
}
rowCount = dataSet.length;
if (rowCount > 0 || !noDataMsg) {
html = '<table';
if (tableClass) {
html += ' class="' + tableClass + '"';
}
html += '><tr>';
row = dataSet[0];
for (column in row) {
if (column && row.hasOwnProperty(column)) {
html += '<th>' + column + '</th>';
}
}
html += '</tr>';
for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {
html += '<tr>';
row = dataSet[rowIndex];
for (column in row) {
if (column && row.hasOwnProperty(column)) {
html += '<td>' + row[column] + '</td>';
}
}
html += '</tr>';
}
html += '</table>';
} else {
html = noDataMsg;
}
document.getElementById(hostId).innerHTML = html;
};
/**
* Tab control objects allow to control visibility of panels ('tabs'), based on the user selection.
* This is analogous to Windows tab control.
*
* @param tabs Array of objects representing each tab controlled.
* @param classNames An object defining the CSS names for active/inactive, enabled/disabled tab
* items.
*/
jsw.ui.TabControl = function (tabs, classNames) {
var firstEnabled, tab, tabCount, tabIndex;
/** Collection of objects representing each tab. */
this.tabs = tabs;
/**
* An object with properties defining CSS class names for active/inactive, enabled/disabled tab
* items
*/
this.classNames = classNames;
tabCount = tabs.length || 0;
// Set tabs as enabled or disabled.
for (tabIndex = 0; tabIndex < tabCount; tabIndex++) {
tab = tabs[tabIndex];
this.setOnClickHandler(this, tab.tabId);
if (tab.enabled) {
this.setEnabled(tab.tabId, true);
} else {
this.setEnabled(tab.tabId, false);
}
document.getElementById(tab.boxId).style.display = 'none';
}
// Select the first enabled tab.
firstEnabled = this.findFirstEnabled();
if (firstEnabled) {
this.select(firstEnabled.tabId);
}
}
/** Prototype for all TabControl objects. */
jsw.ui.TabControl.prototype = {
/**
* Returns an object representing the tab with the given id in the tabs collection.
*
* @param id ID of the tab object to find.
* @returns Object representing the tab with the given id.
*/
find: function (id) {
var tabs = this.tabs,
tabCount = tabs.length,
tabIndex;
for (tabIndex = 0; tabIndex < tabCount; tabIndex++) {
if (tabs[tabIndex].tabId === id) {
return tabs[tabIndex];
}
}
return undefined;
},
/**
* Sets the onclick handler for the tab item with the given ID.
*
* @param tabControl Reference to the parent tab control.
* @param id ID of the tab item to set the onclick handler for.
*/
setOnClickHandler: function (tabControl, id) {
var existingHandler = document.getElementById(id).onclick;
document.getElementById(id).onclick = function () {
if (existingHandler) {
existingHandler();
}
tabControl.select(id);
return false;
};
},
/**
* Finds the first tab in the tab collection which is not disabled.
*
* @returns Object corresponding to the first tab in the collection which is not disabled.
*/
findFirstEnabled: function () {
var tab,
tabs = this.tabs,
tabCount = tabs.length,
tabIndex;
for (tabIndex = 0; tabIndex < tabCount; tabIndex++) {
tab = tabs[tabIndex];
if (tab.enabled) {
return tab;
}
}
},
/**
* Sets the enabled/disabled status of the tab with the given ID.
*
* @param id ID of the tab to set the status for.
* @param enabled Boolean value indicating whether the tab should be enabled (true) or disabled
* (false).
*/
setEnabled: function (id, enabled) {
var firstEnabled, tab;
if (!this.classNames || (!enabled && !this.classNames.disabled)) {
return;
}
tab = this.find(id);
if (!tab) {
// Can't select tab if it's not registered.
return;
}
if (!enabled) {
document.getElementById(tab.tabId).className = this.classNames.disabled;
if (this.selected && this.selected.tabId === id) {
document.getElementById(tab.boxId).style.display = "none";
firstEnabled = this.findFirstEnabled();
if (firstEnabled) {
this.select(firstEnabled.tabId);
}
}
} else {
document.getElementById(tab.tabId).className = this.classNames.enabled || "";
}
tab.enabled = enabled;
},
/**
* Selects the tab item with the given ID on the page and displays the corresponding content.
*
* @param id ID of the tab item to select.
*/
select: function (id) {
var tab;
if (!this.classNames || !this.classNames.active) {
return;
}
tab = this.find(id);
if (!tab || !tab.enabled) {
// Can't select tab if it's not present or is disabled.
return;
}
if (this.selected) {
// Deselect the currently selected tab.
document.getElementById(this.selected.tabId).className = this.classNames.inactive || "";
document.getElementById(this.selected.boxId).style.display = "none";
}
// Deselect the given tab.
document.getElementById(tab.tabId).className = this.classNames.active;
document.getElementById(tab.boxId).style.display = "block";
this.selected = tab;
}
};
/**
* TreeControl component allows displaying a tree hierarchy on a page.
*
* @param hierarchy Array representing the hierarchy to show.
* @param hostId ID of the HTML element to host the hierarchy.
* @param options Object containing information how the nodes of the tree will be displayed. The
* object can contain the following fields:
* - titleClass: Name of the CSS class to use for displaying item titles.
* - childrenCountClass: Name of the CSS class to use for displaying the number of children of
* the class.
* - highlightClass: Name of the CSS class to use for highlighting parts of names matched
* during search.
* - specialClass: Name of the CSS class to use for displaying 'special' nodes.
*/
jsw.ui.TreeControl = function (hierarchy, hostId, options) {
var children, childrenCountClass, childrenElement, childCount, childIndex, element, elements,
elementTitle, item, items, itemElement, names, nameCount, nameIndex, rootElement,
specialClass, titleClass, titleElement;
this.hierarchy = hierarchy;
this.hostId = hostId;
this.options = options;
rootElement = document.createElement('span');
elements = new jsw.util.Queue();
items = new jsw.util.Queue();
childCount = hierarchy.length;
for (childIndex = 0; childIndex < childCount; childIndex++) {
items.enqueue(hierarchy[childIndex]);
elements.enqueue(rootElement);
}
if (options) {
titleClass = options.titleClass;
childrenCountClass = options.childrenCountClass;
specialClass = titleClass + ' ' + options.specialClass;
} else {
titleClass = '';
childrenCountClass = '';
specialClass = '';
}
while (!items.isEmpty()) {
item = items.dequeue();
element = elements.dequeue();
children = item.children;
childCount = children.length;
names = item.names;
nameCount = names.length;
elementTitle = '';
for (nameIndex = 0; nameIndex < nameCount; nameIndex++) {
elementTitle += names[nameIndex] + ', ';
}
itemElement = document.createElement('div');
itemElement.style.display = 'block';
titleElement = document.createElement('a');
if (item.special && specialClass) {
titleElement.setAttribute('class', specialClass);
} else if (titleClass) {
titleElement.setAttribute('class', titleClass);
}
titleElement.innerHTML = elementTitle.substring(0, elementTitle.length - 2);
itemElement.appendChild(titleElement);
if (childCount > 0) {
this.assignItemOnClick(itemElement);
itemElement.appendChild(document.createTextNode(' ('));
titleElement = document.createElement('span');
if (childrenCountClass) {
titleElement.setAttribute('class', childrenCountClass);
}
titleElement.innerHTML = childCount;
itemElement.appendChild(titleElement);
itemElement.appendChild(document.createTextNode(')'));
childrenElement = document.createElement('div');
childrenElement.style.display = 'none';
childrenElement.style.marginLeft = '20px';
for (childIndex = 0; childIndex < childCount; childIndex++) {
items.enqueue(children[childIndex]);
elements.enqueue(childrenElement);
}
itemElement.appendChild(childrenElement);
}
element.appendChild(itemElement);
}
this.showFirstLevel(rootElement);
document.getElementById(hostId).appendChild(rootElement);
}
/** Prototype for all TreeControl objects. */
jsw.ui.TreeControl.prototype = {
/**
* Assigns an onClick handler to the HTML element representing an item in the hierarchy.
*
* @param element Element to assign the onClick handler to.
* @param childrenElementId ID of the element containing all children of the item.
*/
assignItemOnClick: function (element) {
element.firstChild.onclick = function () {
var child, children, totalCount, visibleCount;
children = element.lastChild;
child = children.firstChild;
totalCount = 0;
visibleCount = 0;
while (child !== null) {
if (child.style.display !== 'none') {
visibleCount++;
}
child.style.display = 'block';
child = child.nextSibling;
totalCount++;
}
children.style.display =
(visibleCount < totalCount || children.style.display === 'none') ? 'block' : 'none';
};
},
/**
* Shows all nodes with the names (partially) matching the given string.
*
* @param str Substring to search the node names for.
*/
showMatches: function (str) {
var children, childElement, element, elements, searchForExpr, hierarchy, highlightClass,
hostElement, hostId, innerHtml, item, items, itemCount, itemIndex, names, nameCount,
nameIndex, matchFound, parentElement, replaceExpr, rootElement;
/**
* Function to be used in string.replace() method when trying to match node names against
* the given string.
*
* @param a
* @param b Text matched.
* @returns String to replace the matched text with.
*/
function replaceFunc(a, b) {
matchFound = true;
return (replaceExpr) ? replaceExpr + b + '</span>' : b;
}
hierarchy = this.hierarchy;
itemCount = hierarchy.length;
hostId = this.hostId;
hostElement = document.getElementById(hostId);
rootElement = hostElement.removeChild(hostElement.firstChild);
element = rootElement.firstChild;
items = new jsw.util.Queue();
elements = new jsw.util.Queue();
for (itemIndex = 0; itemIndex < itemCount; itemIndex++) {
items.enqueue(hierarchy[itemIndex]);
elements.enqueue(element);
element = element.nextSibling;
}
searchForExpr = new RegExp('(' + str + ')');
highlightClass = (this.options) ? this.options.highlightClass : null;
replaceExpr = (highlightClass) ? '<span class="' + highlightClass + '">' : '';
while (!items.isEmpty()) {
item = items.dequeue();
element = elements.dequeue();
children = item.children;
itemCount = children.length;
if (itemCount > 0) {
childElement = element.lastChild.firstChild;
for (itemIndex = 0; itemIndex < itemCount; itemIndex++) {
items.enqueue(children[itemIndex]);
elements.enqueue(childElement);
childElement = childElement.nextSibling;
}
}
names = item.names;
nameCount = names.length;
matchFound = false;
innerHtml = '';
if (str === '') {
for (nameIndex = 0; nameIndex < nameCount; nameIndex++) {
innerHtml += names[nameIndex] + ', ';
}
} else {
for (nameIndex = 0; nameIndex < nameCount; nameIndex++) {
innerHtml += names[nameIndex].replace(searchForExpr, replaceFunc) + ', ';
}
}
element.firstChild.innerHTML = innerHtml.substring(0, innerHtml.length - 2);
if (str === '') {
element.style.display = 'block';
if (itemCount > 0) {
element.lastChild.style.display = 'none';
}
} else if (matchFound) {
parentElement = element;
do {
parentElement.style.display = 'block';
if (!parentElement.style.marginLeft) {
parentElement.lastChild.style.display = 'block';
}
parentElement = parentElement.parentNode;
} while (parentElement.nodeName.toUpperCase() !== 'SPAN');
} else {
element.style.display = 'none';
}
}
if (str === '') {
this.showFirstLevel(rootElement);
}
hostElement.appendChild(rootElement);
},
/**
* Shows the first level of the tree as expanded.
*
* @param rootElement Element containing all the tree nodes.
*/
showFirstLevel: function (rootElement) {
var element, childrenElement;
element = rootElement.firstChild;
while (element !== null) {
element.style.display = 'block';
if (element.childNodes.length > 1) {
childrenElement = element.lastChild;
childrenElement.style.display = 'block';
}
element = element.nextSibling;
}
}
};
|
E-Conference/Live-con.com
|
src/fibe/MobileAppBundle/Resources/public/DataConfold/js/reasoner/jswui.js
|
JavaScript
|
mit
| 16,759 |
/* eslint-disable */
// Auto-generated by generate-enums script on Thu Feb 24 2022 03:38:38 GMT-0500 (Eastern Standard Time)
/**
* @enum
* @readonly
*/
const ELobbyComparison = {
"EqualToOrLessThan": -2,
"LessThan": -1,
"Equal": 0,
"GreaterThan": 1,
"EqualToOrGreaterThan": 2,
"NotEqual": 3,
// Value-to-name mapping for convenience
"-2": "EqualToOrLessThan",
"-1": "LessThan",
"0": "Equal",
"1": "GreaterThan",
"2": "EqualToOrGreaterThan",
"3": "NotEqual",
};
module.exports = ELobbyComparison;
|
DoctorMcKay/node-steam-user
|
enums/ELobbyComparison.js
|
JavaScript
|
mit
| 515 |
"use strict";
/*global module, require*/
var d3 = require("d3");
module.exports = function(update, toolbar) {
// Default to showing details if we are standalone, and not if we are in an iframe.
var enabled = window === window.parent;
toolbar.append("div")
.attr("id", "margins-toggle")
.classed("toolbar-button", true)
.text("Margins")
.classed("enabled", enabled)
.on("click", function(d, i) {
enabled = !enabled;
d3.select(this)
.classed("enabled", enabled);
update();
});
return {
enabled: function() {
return enabled;
}
};
};
|
cse-bristol/process-model
|
js/margins.js
|
JavaScript
|
mit
| 599 |
// When 'list-vehicles' is clicked, get all vehicles from the API
// and display them in a HTML select box.
$( "#list-vehicles" ).click(function() {
var auth_key = $('#request').val();
$("#vin option[value!='']").remove();
var url = "https://www.jlrdevchallenge.com/api/v1/get_vehicles/?request=" + auth_key;
$.getJSON(url, function( data ) {
$.each(data, function (index, packet) {
$('#vin').append($('<option/>', {
value: packet.vin,
text : packet.model + ' ' + packet.vin
}));
});
$('.vehicles-group').slideDown();
$('.journeys-group').hide();
$('.signals-group').hide();
});
});
// When a vin is selected, get all journeys for that VIN from the API
// and display them in a HTML select box
$( "#vin" ).on('change', function() {
var vin = $('#vin').val();
if (vin === "") {return;}
$("#jid option[value!='']").remove();
var auth_key = $('#request').val();
var query = "?request=" + auth_key + "&vin=" + vin;
var url = "https://www.jlrdevchallenge.com/api/v1/get_journeys/" + query;
$.getJSON(url, function( data ) {
$.each(data, function (index, packet) {
var text = packet.start_time.substring(0, packet.start_time.length - 7);
$('#jid').append($('<option/>', {
value: packet.journey_id,
text : packet.journey_id + ' - ' + text
}));
});
$('.journeys-group').slideDown();
$('.signals-group').hide();
});
});
// When a journey is selected, get all signals for that journey from the API
// and display them in a HTML select box
$( "#jid" ).on('change', function() {
var jid = $('#jid').val();
if (jid === "") {return;}
$("#signals option[value!='']").remove();
var auth_key = $('#request').val();
var query = "?request=" + auth_key + "&jid=" + jid;
var url = "https://www.jlrdevchallenge.com/api/v1/get_signals/" + query;
$.getJSON(url, function( data ) {
var signalNames = [];
$.each(data, function (key, packet) {
signalNames.push(key);
});
signalNames.sort();
$.each(signalNames, function (index, name) {
$('#signals').append($('<option/>', {
value: name,
text : name
}));
});
$('.signals-group').slideDown();
});
});
// When plot-data is clicked, retrieve signal time history from the API and
// plot it on a graph.
$( "#plot-data" ).click(function() {
var signals = $('#signals').val();
if (signals === "") {return;}
var auth_key = $('#request').val();
var jid = $('#jid').val();
var query = "?sampling_rate=1000&request=" + auth_key + "&jid=" + jid + "&signals=" + signals;
var url = "https://www.jlrdevchallenge.com/api/v1/get_data/" + query;
$.getJSON(url, function( data ) {
// Coerce the data
var chart = c3.generate({
bindto: '#chart',
data: {
json: coerce_data(data),
keys: {
x: 't',
value: ['val'],
},
names: {
val: Object.keys(data)[0]
}
},
axis: {
x: {
type: 'timeseries',
tick: {
count: 10,
format: '%Y-%m-%d %H:%M:%S'
}
}
},
point: {
show: false
}
});
});
});
function coerce_data(data) {
// Manipulate API data into a format that can be used by C3.js.
var newdata = data[Object.keys(data)[0]];
for (i=0; i<newdata.length; i++) {
newdata[i].t = new Date(newdata[i].t);
}
return newdata;
}
|
blake01/jlr-api-demo
|
js/http-connections.js
|
JavaScript
|
mit
| 3,536 |
var assert = require('assert'),
Route = require('../lib/route'),
Router = require('../lib/router');
describe('Router', function() {
var router;
beforeEach(function() {
router = new Router();
router.add('foo', new Route('GET', '/', function() {}));
});
describe('#add', function() {
it('should not throw error when all ok', function() {
assert.doesNotThrow(function() {
router.add('bar', new Route('GET', '/', function() {}));
}, Error);
});
it('should throw error when keys are duplicates', function() {
assert.throws(function() {
router.add('foo', new Route('GET', '/', function() {}));
}, Error);
});
});
describe('#match', function() {
it('should return Object with route and parameters when url was found', function() {
var matched = router.match('GET', '/');
assert.strictEqual('object', typeof matched);
assert.strictEqual(true, matched.data instanceof Map);
assert.strictEqual(true, matched.route instanceof Route);
});
it('should return null when the method incorrect or url not found', function() {
assert.strictEqual(null, router.match('METHOD', '/'));
assert.strictEqual(null, router.match('GET', '/foo'));
});
});
describe('#route', function() {
it('should return null when route not found', function() {
assert.strictEqual(null, router.route('bar'));
});
it('should return Route when route found', function() {
assert.strictEqual(true, router.route('foo') instanceof Route);
});
});
describe('#getUrl', function() {
it('should return string when all ok', function() {
assert.strictEqual('/', router.getUrl('foo'));
});
it('should return null when rout not found or not all parameters are set', function() {
assert.strictEqual(null, router.getUrl());
assert.strictEqual(null, router.getUrl('bar'));
});
});
});
|
IncSW/nk-router
|
test/router.js
|
JavaScript
|
mit
| 2,165 |
// -----------------------------------------------------------------------------
// Name: /public/js/game/components/actor/enemy.js
// Author: Adam Barreiro Costa
// Description: Registers the enemy component
// -----------------------------------------------------------------------------
/**
* enemy.js
* @dependency /public/js/game/components/actor/enemy/enemy1.js
* @dependency /public/js/game/components/actor/enemy/enemy2.js
* @dependency /public/js/game/components/actor/enemy/enemy3.js
* @dependency /public/js/game/components/actor/enemy/enemy4.js
* @dependency /public/js/game/components/actor/enemy/enemy5.js
* @dependency /public/js/game/components/actor/enemy/patrol.js
*/
define (["./enemy/enemy1", "./enemy/enemy2","./enemy/enemy3","./enemy/enemy4","./enemy/enemy5","./enemy/patrol"], function(Enemy1, Enemy2, Enemy3, Enemy4, Enemy5, Patrol) {
// -----------------------------------------------------------------------------
// Private
// -----------------------------------------------------------------------------
var MIN_DAMAGE = 25;
var MAX_DAMAGE = 45;
var POWERUP_MIN_DAMAGE = 45;
var POWERUP_MAX_DAMAGE = 75;
/**
* Registers all the child components.
*/
function createChildComponents(edition) {
// Enemy + component
Enemy1.registerComponent(edition);
// Enemy - component
Enemy2.registerComponent(edition);
// Enemy * component
Enemy3.registerComponent(edition);
// Enemy (*) component
Enemy4.registerComponent(edition);
// Enemy / component
Enemy5.registerComponent(edition);
// Patrol component
Patrol.registerComponent(edition);
}
// -----------------------------------------------------------------------------
// Public
// -----------------------------------------------------------------------------
return {
/**
* Registers the component into the game.
*/
registerComponent: function(edition) {
Crafty.c('Enemy', {
/**
* Sends the other player the amount of damage dealt to the enemy
*/
multiplayerDamage: function(damage) {
if (Crafty("Multiplayer").length > 0) {
Crafty("Character").multiplayerDamage(this._id, damage);
}
},
/**
* Substracts a random amount of life from the enemy's health.
* @return boolean - If the enemy's dead it's true.
*/
damage: function() {
Crafty.audio.play("attack");
Crafty.audio.play("monster_scream");
var d;
if (Crafty("Character")._power > 0) {
d = Math.floor(Math.random()*(POWERUP_MAX_DAMAGE-POWERUP_MIN_DAMAGE+1)+POWERUP_MIN_DAMAGE);
this._enemyHealth = this._enemyHealth - d;
Crafty("Character")._power--;
if (Crafty("Character")._power === 0) {
Crafty("Character").removeBonus("power");
}
} else {
d = Math.floor(Math.random()*(MAX_DAMAGE-MIN_DAMAGE+1)+MIN_DAMAGE);
this._enemyHealth = this._enemyHealth - d;
}
this.multiplayerDamage(d);
if (this._enemyHealth > 0) {
$('#enemybar').css({"width": (this._enemyHealth*3) + "px"});
return false;
} else {
Crafty.audio.play("enemy_death");
$($(".lifebox").children()[2]).hide();
$($(".lifebox").children()[3]).hide();
$('#enemybar').css({"width": "300px"});
Crafty("Character")._detectionEnemy.destroy();
Crafty.audio.stop("battle");
Crafty.audio.play("level",-1);
return true;
}
},
/**
* Starts all the components attached and events.
*/
startEnemy: function() {
this.addComponent("Patrol");
},
/**
* Stops all the components attached.
*/
stopEnemy: function() {
this.pauseAnimation();
this.removeComponent("Patrol");
this.unbind("EnterFrame");
},
/**
* Inits the component
*/
init: function() {
this.requires('Actor');
this.z=5;
if (!edition) {
this.gravity("Terrain").gravityConst(0.3);
this._enemyHealth = 100;
this.startEnemy();
}
}
});
createChildComponents(edition);
}
};
});
|
adambarreiro/Polynomial
|
public/js/game/components/actor/enemy.js
|
JavaScript
|
mit
| 4,794 |
import React from 'react'
import PropTypes from 'prop-types'
import Paper from 'material-ui/Paper'
import { isObject } from 'lodash'
import IconButton from 'material-ui/IconButton'
import DeleteIcon from 'material-ui/svg-icons/action/delete'
import classes from './ProjectTile.scss'
export const ProjectTile = ({ project, onSelect, onDelete, showDelete }) => (
<Paper className={classes.container}>
<div className={classes.top}>
<span className={classes.name} onClick={() => onSelect(project)}>
{project.name}
</span>
{showDelete && onDelete ? (
<IconButton tooltip="delete" onClick={onDelete}>
<DeleteIcon />
</IconButton>
) : null}
</div>
<span className={classes.owner}>
{isObject(project.createdBy) ? (
project.createdBy.displayName
) : (
project.createdBy || 'No Owner'
)}
</span>
</Paper>
)
ProjectTile.propTypes = {
project: PropTypes.object.isRequired,
onSelect: PropTypes.func.isRequired,
onDelete: PropTypes.func,
showDelete: PropTypes.bool
}
export default ProjectTile
|
ronihcohen/magic-vote
|
src/routes/Projects/components/ProjectTile/ProjectTile.js
|
JavaScript
|
mit
| 1,103 |
/**
* app.js
*
* This is the entry file for the application, only setup and boilerplate
* code.
*/
// Needed for redux-saga es6 generator support
import 'babel-polyfill';
/* eslint-disable import/no-unresolved, import/extensions */
// Load the favicon, the manifest.json file and the .htaccess file
import 'file?name=[name].[ext]!./favicon.ico';
import '!file?name=[name].[ext]!./manifest.json';
import 'file?name=[name].[ext]!./.htaccess';
/* eslint-enable import/no-unresolved, import/extensions */
// Import all the third party stuff
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { applyRouterMiddleware, Router, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import FontFaceObserver from 'fontfaceobserver';
import { useScroll } from 'react-router-scroll';
import configureStore from './store';
// Import Language Provider
import LanguageProvider from 'containers/LanguageProvider';
// Observe loading of Open Sans (to remove open sans, remove the <link> tag in
// the index.html file and this observer)
import styles from 'containers/App/styles.css';
const openSansObserver = new FontFaceObserver('Open Sans', {});
// When Open Sans is loaded, add a font-family using Open Sans to the body
openSansObserver.load().then(() => {
document.body.classList.add(styles.fontLoaded);
}, () => {
document.body.classList.remove(styles.fontLoaded);
});
// Import i18n messages
import { translationMessages } from './i18n';
// Create redux store with history
// this uses the singleton browserHistory provided by react-router
// Optionally, this could be changed to leverage a created history
// e.g. `const browserHistory = useRouterHistory(createBrowserHistory)();`
const initialState = {};
const store = configureStore(initialState, browserHistory);
// If you use Redux devTools extension, since v2.0.1, they added an
// `updateStore`, so any enhancers that change the store object
// could be used with the devTools' store.
// As this boilerplate uses Redux & Redux-Saga, the `updateStore` is needed
// if you want to `take` actions in your Sagas, dispatched from devTools.
if (window.devToolsExtension) {
window.devToolsExtension.updateStore(store);
}
// Sync history and store, as the react-router-redux reducer
// is under the non-default key ("routing"), selectLocationState
// must be provided for resolving how to retrieve the "route" in the state
import { selectLocationState } from 'containers/App/selectors';
const history = syncHistoryWithStore(browserHistory, store, {
selectLocationState: selectLocationState(),
});
// Set up the router, wrapping all Routes in the App component
import App from 'containers/App';
import createRoutes from './routes';
const rootRoute = {
component: App,
childRoutes: createRoutes(store),
};
const render = (messages) => {
ReactDOM.render(
<Provider store={store}>
<LanguageProvider messages={messages}>
<Router
history={history}
routes={rootRoute}
render={
// Scroll to top when going to a new page, imitating default browser
// behaviour
applyRouterMiddleware(useScroll())
}
/>
</LanguageProvider>
</Provider>,
document.getElementById('app')
);
};
// Hot reloadable translation json files
if (module.hot) {
// modules.hot.accept does not accept dynamic dependencies,
// have to be constants at compile-time
module.hot.accept('./i18n', () => {
render(translationMessages);
});
}
// Chunked polyfill for browsers without Intl support
if (!window.Intl) {
(new Promise((resolve) => {
resolve(System.import('intl'));
}))
.then(() => Promise.all([
System.import('intl/locale-data/jsonp/en.js'),
System.import('intl/locale-data/jsonp/de.js'),
]))
.then(() => render(translationMessages))
.catch((err) => {
throw err;
});
} else {
render(translationMessages);
}
// Install ServiceWorker and AppCache in the end since
// it's not most important operation and if main code fails,
// we do not want it installed
import { install } from 'offline-plugin/runtime';
install();
|
KarandikarMihir/react-boilerplate
|
app/app.js
|
JavaScript
|
mit
| 4,227 |
/*
* Document : uiProgress.js
* Author : pixelcave
* Description: Custom javascript code used in Progress & Loading page
*/
var NotificationService = function () {
// Get random number function from a given range
var getRandomInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
return {
init: function () {
/* Randomize progress bars width */
var random = 0;
/* Grawl Notifications with Bootstrap-growl plugin, check out more examples at http://ifightcrime.github.io/bootstrap-growl/ */
//$('.btn-growl').on('click', function(){
/* $('#success_btn').on('click', function(){
var growlType = $(this).data('growl');
// alert("sample error");
$.bootstrapGrowl('<h4><strong>Notification</strong></h4> <p>Content..</p>', {
type: growlType,
delay: 3000,
allow_dismiss: true,
offset: {from: 'top', amount: 20}
});
$(this).prop('disabled', true);
});*/
},
showMessage: function (_type, msg) {
$.bootstrapGrowl('<h4><strong>Notification</strong></h4> <p>msg</p>', {
type: _type,
delay: 3000,
allow_dismiss: true,
offset: {from: 'top', amount: 20}
});
}
};
}();
|
shr1th1k/0fferc1t1
|
app/assets/admin/js/pages/notificationService.js
|
JavaScript
|
mit
| 1,451 |
var microcomponent = require('.')
var morph = require('nanomorph')
var css = require('yo-css')
var html = require('bel')
var shallowEqual = require('juliangruber-shallow-equal/objects')
var move = require('array-move').mut
function createComponent () {
var component = microcomponent({
name: 'example',
state: {
first: null,
last: null
}
})
component.on('render', render)
component.on('update', update)
return component
function render () {
this.state.first = this.props.first()
this.state.last = this.props.last()
return html`
<article>
<h1 style=${css({
fontFamily: 'monospace'
})}>
${this.props.title} (+${this.props.likes})
<button onclick=${this.props.like}>Like</button>
<button onclick=${this.props.delete}>x</button>
<button onclick=${this.props.up} disabled=${this.state.first}>^</button>
<button onclick=${this.props.down} disabled=${this.state.last}>v</button>
</h1>
</article>
`
}
function update (props) {
return !shallowEqual(props, this.props) ||
props.first() !== this.state.first ||
props.last() !== this.state.last
}
}
var state = {
posts: []
}
var el = render()
document.body.appendChild(el)
for (var i = 0; i < 10; i++) addPost()
function addPost () {
var post = {
title: Math.random().toString(16).slice(2),
likes: 0,
component: createComponent(),
like: function () {
post.likes++
update()
},
delete: function () {
state.posts.splice(state.posts.indexOf(post), 1)
update()
},
up: function () {
var idx = state.posts.indexOf(post)
move(state.posts, idx, idx - 1)
update()
},
down: function () {
var idx = state.posts.indexOf(post)
move(state.posts, idx, idx + 1)
update()
},
first: function () {
return state.posts.indexOf(post) === 0
},
last: function () {
return state.posts.indexOf(post) === state.posts.length - 1
}
}
state.posts.push(post)
update()
}
function render () {
return html`
<div>
<button onclick=${addPost}>New Post</button>
${state.posts.map(post => post.component.render(Object.assign({}, post)))}
</div>
`
}
function update () {
el = morph(el, render())
}
|
yoshuawuyts/microcomponent
|
example.js
|
JavaScript
|
mit
| 2,344 |
/**
* Created by rasmuse on 2015-03-04.
*
* Startup for db connection, set start parameters for this class
*
*/
var mongoose = require('mongoose');
var logger = require('../config/logger').mainLogger;
var env = require('node-env-file');
env('process.env');
mongoose.connect(process.env.DB_CONNECT_STR);
var db = mongoose.connection;
db.on('error', function (err) {
logger.error('connection error to db @ db.js', err);
});
db.once('open', function () {
logger.info('connected to db @ db.js');
});
module.exports.db = db;
|
TechnoX/rcj-rescue-scoring
|
config/db.js
|
JavaScript
|
mit
| 538 |
export default class Tweettemplate extends React.Component {
render(){
return(
<li className="collection-item avatar">
<i className="material-icons circle red">play_arrow</i>
<span className="title">{this.props.tweetedby}</span>
<p>{this.props.body}</p>
<p>{this.props.timestamp}</p>
</li>
);
}
}
|
xianjunzhengbackup/Cloud-Native-Python
|
Chapter05/static/components/templatetweet.js
|
JavaScript
|
mit
| 357 |
"use strict";
var gulp = require('gulp');
var prettify = require('gulp-jsbeautifier');
var mocha = require('gulp-mocha');
gulp.task('format-js', function() {
gulp.src('./xbase64.js')
.pipe(prettify({
config: '.jsbeautifyrc',
mode: 'VERIFY_AND_WRITE'
}))
.pipe(gulp.dest('./'));
gulp.src('./test/**/*.js')
.pipe(prettify({
config: '.jsbeautifyrc',
mode: 'VERIFY_AND_WRITE'
}))
.pipe(gulp.dest('./test'));
});
gulp.task('test', function() {
gulp.src('./test/*.js')
.pipe(mocha({
timeout: 10000,
bail: true
}))
.once('end', function() {
process.exit();
});
});
gulp.task('default', ['format-js', 'test']);
|
vietor/xbase64
|
gulpfile.js
|
JavaScript
|
mit
| 818 |
module.exports = [
"Abaft",
"Abandoned",
"Abased",
"Abashed",
"Abasic",
"Abbatial",
"Abdicable",
"Abdicant",
"Abdicative",
"Abdominal",
"Abdominous",
"Abducent",
"Aberrant",
"Aberrational",
"Abeyant",
"Abhorrent",
"Abiotic",
"Ablaze",
"Able",
"Ablebodied",
"Ablutophobic",
"Abnormal",
"Abolitionary",
"Abominable",
"Aboriginal",
"Above",
"Aboveground",
"Abrupt",
"Absent",
"Absentminded",
"Absolute",
"Absolutistic",
"Abstract",
"Abstracted",
"Absurd",
"Abusive",
"Abysmal",
"Abyssal",
"Academic",
"Academical",
"Acardiac",
"Acceptable",
"Accepted",
"Accessible",
"Acclimatable",
"Acclimatisable",
"Acculturational",
"Acculturative",
"Accurate",
"Accused",
"Achluophobic",
"Achronite",
"Acid",
"Acidfast",
"Acidforming",
"Acidic",
"Acidifiable",
"Acidimetric",
"Acidimetrical",
"Acidophilic",
"Acidophobic",
"Acidotic",
"Acidulous",
"Aciduric",
"Acidy",
"Acoustic",
"Acquiescent",
"Acrid",
"Acrobatic",
"Acrophobic",
"Acrylic",
"Actinide",
"Actinium",
"Activated",
"Active",
"Actual",
"Actuarial",
"Actuarian",
"Acute",
"Adamantine",
"Adamantium",
"Added",
"Addictive",
"Additional",
"Addlebrained",
"Adept",
"Adequate",
"Adhesive",
"Adjacent",
"Adjoining",
"Administrative",
"Adobe",
"Adolescent",
"Adorable",
"Adored",
"Adoring",
"Adrenal",
"Adroit",
"Adult",
"Advanced",
"Advantageous",
"Adventureful",
"Adventuresome",
"Adventurous",
"Adversarial",
"Adverse",
"Advertent",
"Aerial",
"Aerobic",
"Aerodynamic",
"Aerodynamical",
"Aeromarine",
"Aeromedical",
"Aeronautic",
"Aeronautical",
"Aerophobic",
"Aesthetic",
"Afeard",
"Affable",
"Affectionate",
"Affirmative",
"Afflicted",
"Affluent",
"Affordable",
"Aforementioned",
"Afraid",
"Agate",
"Agatoid",
"Ageold",
"Aged",
"Ageless",
"Aggressive",
"Aghast",
"Agile",
"Agitable",
"Agitational",
"Agitative",
"Agonizing",
"Agoraphobic",
"Agrarian",
"Agreeable",
"Agreed",
"Agricultural",
"Agrobiologic",
"Agrobiological",
"Agrologic",
"Agrological",
"Agronomic",
"Agronomical",
"Agrostographic",
"Agrostographical",
"Agrostologic",
"Agrostological",
"Ahistoric",
"Ahistorical",
"Aichmophobic",
"Ailing",
"Ailurophilic",
"Ailurophobic",
"Aimless",
"Airborne",
"Airsick",
"Airtight",
"Airworthy",
"Airy",
"Alabaster",
"Alamode",
"Albinic",
"Albinistic",
"Albino",
"Albite",
"Alchemic",
"Alchemistical",
"Alert",
"Algebraic",
"Algophobic",
"Algorithmic",
"Alien",
"Alive",
"Alkalic",
"Alkaline",
"Alkalisable",
"Alkalizable",
"Alkaloidal",
"Alkylic",
"Allpowerful",
"Allpurpose",
"Allstar",
"Allayed",
"Alleged",
"Allegorical",
"Allegoristic",
"Allegro",
"Allergenic",
"Allergic",
"Allied",
"Alliterative",
"Alluring",
"Almond",
"Almondy",
"Alphabetic",
"Alphabetical",
"Alphameric",
"Alphanumeric",
"Alright",
"Alternative",
"Altophobic",
"Altruistic",
"Amaranth",
"Amateur",
"Amateurish",
"Amaxophobic",
"Amazing",
"Amber",
"Amberous",
"Ambery",
"Ambient",
"Ambigious",
"Ambisyllabic",
"Ambitious",
"Ambivalent",
"Amebic",
"Ameboid",
"Amenable",
"Americium",
"Amethyst",
"Amethystine",
"Amiable",
"Amicable",
"Ammoniac",
"Ammoniacal",
"Ammonic",
"Ammonitic",
"Ammonitoid",
"Ammophilic",
"Amnestic",
"Amoebaean",
"Amoebalike",
"Amoebic",
"Amoeboid",
"Amoral",
"Amphibian",
"Amphibiotic",
"Amphibious",
"Amphibole",
"Amphibolic",
"Amphibolite",
"Amphisbaenian",
"Amphisbaenic",
"Amphisbaenoid",
"Amphisbaenous",
"Amphitheatric",
"Amphitheatrical",
"Ample",
"Amputated",
"Amused",
"Amusing",
"Anachronic",
"Anachronistic",
"Anachronous",
"Anaemic",
"Anaesthetic",
"Analogical",
"Analogistic",
"Analogous",
"Analytical",
"Anarchic",
"Anarchistic",
"Anarthric",
"Anarthrous",
"Anatomical",
"Ancestral",
"Ancient",
"Androgenic",
"Androgenous",
"Androgynous",
"Androphagous",
"Androphilic",
"Anecdotal",
"Anesthetic",
"Angelic",
"Angry",
"Angstridden",
"Angsty",
"Anguished",
"Angular",
"Anhydrite",
"Animalic",
"Animalistic",
"Animated",
"Animist",
"Animistic",
"Annihilated",
"Annoyed",
"Annoying",
"Anonymous",
"Anorthite",
"Anorthosite",
"Antagonisable",
"Antagonistic",
"Antarctic",
"Antarthritic",
"Antebellum",
"Antediluvian",
"Antelopian",
"Antelopine",
"Anthophilic",
"Anthophobic",
"Anthracite",
"Anthropocentric",
"Anthropoid",
"Anthropoidal",
"Anthropological",
"Anthropomorphic",
"Anthropophobic",
"Anticapitalist",
"Antiheroic",
"Antiallergenic",
"Anticapitalist",
"Anticlimactic",
"Antidemocratic",
"Antidemocratical",
"Antidotal",
"Antidotical",
"Antifeminist",
"Antifeministic",
"Antifungal",
"Antigorite",
"Antigovernment",
"Antigovernmental",
"Antigravitation",
"Antigravitational",
"Antihuman",
"Antihumanistic",
"Antihygienic",
"Antimagnetic",
"Antimediaeval",
"Antimedical",
"Antimedication",
"Antimedicative",
"Antimedicine",
"Antimilitaristic",
"Antimilitary",
"Antimonarch",
"Antimonarchal",
"Antimonarchial",
"Antimonarchic",
"Antimonarchical",
"Antimonarchistic",
"Antimonarchy",
"Antimoral",
"Antimoralistic",
"Antimorality",
"Antimystical",
"Antinational",
"Antinationalisation",
"Antinationalistic",
"Antinatural",
"Antinaturalistic",
"Antinihilistic",
"Antioptimistic",
"Antioptimistical",
"Antipacifistic",
"Antipestilence",
"Antipestilent",
"Antipestilential",
"Antiphilosophic",
"Antiphilosophical",
"Antiphilosophy",
"Antipolitical",
"Antipolitics",
"Antiquarian",
"Antiquated",
"Antique",
"Antirational",
"Antirationalistic",
"Antiromance",
"Antiromantic",
"Antischolastic",
"Antischool",
"Antiscience",
"Antiscientific",
"Antisocial",
"Antisolar",
"Antiterrorist",
"Antitoxic",
"Antiutopian",
"Antiutopic",
"Antiviral",
"Antivirus",
"Antsy",
"Anxious",
"Apathetic",
"Apelike",
"Aphidian",
"Aphidious",
"Apian",
"Apiarian",
"Apicultural",
"Apidologic",
"Apidological",
"Apiologic",
"Apiological",
"Apiphobic",
"Apish",
"Apivorous",
"Apocalyptic",
"Apolitical",
"Apostolic",
"Apostrophic",
"Apothecial",
"Appalling",
"Apparent",
"Apparitional",
"Appealing",
"Appercetive",
"Appetitive",
"Appetizing",
"Applicable",
"Appreciative",
"Apprehensive",
"Apprentice",
"Appropriate",
"Apricot",
"Apt",
"Aquamarine",
"Aquaphobic",
"Aquarial",
"Aquatic",
"Aqueous",
"Aquicultural",
"Aquiline",
"Arachnidan",
"Arachnivorous",
"Arachnologic",
"Arachnological",
"Arachnophobic",
"Aragonite",
"Arbitrary",
"Arboraceous",
"Arboreal",
"Arbored",
"Arboreous",
"Arborescent",
"Arboresque",
"Arboricultural",
"Arborous",
"Arcane",
"Archaeological",
"Archaic",
"Archaistic",
"Archangelic",
"Archangelical",
"Archeologic",
"Archeological",
"Archetypal",
"Archetypic",
"Architectural",
"Archival",
"Arctic",
"Arctophilic",
"Ardent",
"Arduous",
"Argumentative",
"Arid",
"Aristocratic",
"Armed",
"Armless",
"Armourclad",
"Armourpiercing",
"Armoured",
"Armourplated",
"Aromatic",
"Arrogant",
"Arterial",
"Artful",
"Arthralgic",
"Arthritic",
"Arthritical",
"Arthrodial",
"Arthrodic",
"Arthromeric",
"Artificial",
"Artistic",
"Artless",
"Artsycraftsy",
"Arty",
"Artycrafty",
"Asbestine",
"Asbestoid",
"Asbestoidal",
"Asbestos",
"Asbestous",
"Ash",
"Ashamed",
"Ashen",
"Ashy",
"Asinine",
"Asocial",
"Asparaginous",
"Asphalt",
"Asphaltic",
"Asphaltum",
"Aspherical",
"Asphyxiated",
"Aspiring",
"Assertive",
"Assiduous",
"Assistant",
"Associated",
"Associative",
"Astatine",
"Asteria",
"Asthmatic",
"Asthmatoid",
"Astonishing",
"Astounding",
"Astrakhan",
"Astral",
"Astraphobic",
"Astrapophobic",
"Astrobiological",
"Astrochemical",
"Astrographic",
"Astrolabical",
"Astrological",
"Astromantic",
"Astrometric",
"Astronautic",
"Astronomical",
"Astrophilic",
"Astrophotographic",
"Astrophysical",
"Astute",
"Asyllabic",
"Athletic",
"Atmospheric",
"Atomic",
"Atrocious",
"Atrophic",
"Atrophied",
"Attack",
"Attentive",
"Attractive",
"Atypical",
"Auburn",
"Audacious",
"Audiophilic",
"Augite",
"Augmented",
"Auroral",
"Aurorean",
"Aurous",
"Auspicial",
"Auspicious",
"Autecologic",
"Autecological",
"Authentic",
"Authorial",
"Authoritarian",
"Authoritative",
"Authorized",
"Autobiographical",
"Autographic",
"Autographical",
"Autoimmune",
"Automatic",
"Automotive",
"Autonomous",
"Autophobic",
"Autositic",
"Autumnal",
"Auxiliary",
"Available",
"Avaricious",
"Avengeful",
"Aventurine",
"Average",
"Avian",
"Aviaphobic",
"Aviophobic",
"Avoided",
"Awake",
"Aware",
"Aweinspiring",
"Awestricken",
"Awestruck",
"Awesome",
"Awful",
"Awkward",
"Axiomatic",
"Azure",
"Baboonish",
"Baby",
"BabyFaced",
"Babyish",
"Bacciferous",
"Bacciform",
"Baccivorous",
"Bacillophobic",
"Backward",
"Bacterial",
"Bactericidal",
"Bacteriologic",
"Bacteriological",
"Bacteriophobic",
"Bacteroid",
"Bad",
"BadTempered",
"Baffling",
"Baggy",
"Bairnish",
"Bairnly",
"Balanced",
"Bald",
"Baldheaded",
"Balding",
"Baldish",
"Baleful",
"Balky",
"Balladic",
"Balmy",
"Balneal",
"Balneologic",
"Balneological",
"Balsamaceous",
"Balsamic",
"Balsamiferous",
"Balsaminaceous",
"Balsamy",
"Banal",
"Baneful",
"Barathea",
"Barbarian",
"Barbaric",
"Barbarous",
"Bardic",
"Bardish",
"Bardlike",
"Bardy",
"Bare",
"Bared",
"Barite",
"Barky",
"Barnacled",
"Baroque",
"Barren",
"Baryte",
"Basalt",
"Basaltic",
"Basaltine",
"Base",
"Baseborn",
"Basehearted",
"Bashful",
"Basic",
"Batiste",
"BattleScarred",
"Battlesome",
"Batty",
"Beachy",
"Beaming",
"Beamish",
"Beamlike",
"Beamy",
"Beaten",
"Beatific",
"Beauish",
"Beauteous",
"Beautiful",
"Becoming",
"Bediasite",
"Bedridden",
"BeefWitted",
"BeefWittedly",
"Beefy",
"Beelike",
"Beeswax",
"Befuddled",
"Befuddling",
"Beggarly",
"Beguiling",
"Behavioral",
"Beige",
"Belated",
"Bellicose",
"Belligerent",
"Belocolus",
"Belonephobic",
"Beloved",
"Bemused",
"Beneficent",
"Beneficial",
"Benevolent",
"Benighted",
"Benign",
"Benignant",
"Bereaved",
"Bereft",
"Beribboned",
"Berkelium",
"Berrylike",
"Berserk",
"Beryl",
"Besotted",
"Best",
"Bestial",
"Beton",
"Betrothed",
"Bewildered",
"Bewitched",
"Bewitching",
"Bibliographic",
"Bibliographical",
"Bibliolatrous",
"Bibliological",
"Bibliomaniacal",
"Bibliophagous",
"Bibliophilic",
"Bicolor",
"Big",
"BigBoned",
"BigHearted",
"Biggish",
"Bigheaded",
"Bigoted",
"Bilinear",
"Bilineate",
"Bilingual",
"Bimetallic",
"Bimetallistic",
"Binary",
"Binding",
"Bioclimatic",
"Bioclimatological",
"Biodegradable",
"Bioecologic",
"Bioecological",
"Bioeconomic",
"Bioeconomical",
"Biological",
"Biomedical",
"Bionic",
"Biophilic",
"Biotechnological",
"Biotite",
"Bipartisan",
"BirdBrained",
"Birdbrained",
"Birdlike",
"Birthstone",
"BiteSized",
"Bitter",
"Bitty",
"Bitumen",
"Bixbite",
"Bizarre",
"Black",
"BlackCoated",
"BlackHearted",
"Blackish",
"Blamable",
"Blameable",
"Blameful",
"Blameless",
"Blameworthy",
"Bland",
"Blank",
"Blasphemous",
"Bleached",
"Bleak",
"Bleakish",
"BlearEyed",
"Bleary",
"Blessed",
"Blind",
"Blissful",
"Blithe",
"Blitheful",
"Blithesome",
"Blizzardly",
"Blizzardy",
"Bloated",
"Blockish",
"Blocky",
"Blond",
"Blonde",
"Blondish",
"Bloodcurdling",
"Bloodshot",
"Bloodsucking",
"Bloodthirsty",
"Blotchy",
"Blousy",
"Blowsy",
"Blowy",
"Blowzy",
"Blubbery",
"Blue",
"BlueBlack",
"BlueCollar",
"BlueRibbon",
"Bluecoated",
"Blueish",
"Blunt",
"Blushing",
"Blusterous",
"Boarish",
"Boastful",
"Bohrium",
"Boiled",
"Boiling",
"Bold",
"BoldFaced",
"Boldhearted",
"Bolstered",
"Bombastic",
"BoneDry",
"Boneheaded",
"Bonelike",
"Bonny",
"Bony",
"BookLearned",
"Bookish",
"Boolean",
"Boorish",
"Bootlicking",
"Boreal",
"Bored",
"Boring",
"Bort",
"Bosky",
"Bossy",
"Botanic",
"Botanical",
"Botchy",
"Bothersome",
"BottleGreen",
"Bottom",
"Bouncy",
"Boundless",
"Bovid",
"Bovine",
"Boyish",
"Braced",
"Braided",
"Brainless",
"Brainsick",
"Brainy",
"Brambly",
"Branny",
"Brash",
"Brashy",
"Brass",
"Brassbound",
"Brassish",
"Brassy",
"Brattish",
"Bratty",
"Brave",
"Braving",
"Brazen",
"Breaded",
"Breakable",
"Breathless",
"Breathtaking",
"Breezelike",
"Breezy",
"Bribable",
"Bribeable",
"Brick",
"BrickRed",
"Brickish",
"Brickred",
"Bricky",
"Bridal",
"Brief",
"Brigandish",
"Bright",
"Brightish",
"Brilliant",
"Brimstone",
"Brimstony",
"Brinish",
"Briny",
"Brisk",
"Brittle",
"Broad",
"BroadFaced",
"BroadMinded",
"Broadish",
"Brocatel",
"Brocatello",
"Broke",
"Broken",
"BrokenDown",
"BrokenHearted",
"Brokenhearted",
"Bronchial",
"Brontophobic",
"Bronze",
"Bronzy",
"Broody",
"Brotherlike",
"Brotherly",
"Brown",
"Brownish",
"Browny",
"Brunette",
"Brusque",
"Brutal",
"Brutalitarian",
"Brutish",
"Bubbly",
"Bubonic",
"Buckskin",
"Buggy",
"Bulletproof",
"Bullish",
"Bulllike",
"Bullous",
"Bumbling",
"Bumpkinish",
"Bumpkinly",
"Bumpy",
"Buoyant",
"Burdensome",
"Bureaucratic",
"Burglarious",
"Burgundy",
"Buried",
"Burlap",
"Burly",
"Burned",
"BurnedOut",
"Burning",
"Burnt",
"Bushy",
"Busied",
"Busy",
"Busying",
"Butterfingered",
"Buttery",
"Byzantine",
"Byzantium",
"Cabbagy",
"Cacophonophilic",
"Cacotopic",
"CactusLike",
"Cactuslike",
"Cadaveric",
"Cadaverous",
"Caffeinated",
"Caffeinic",
"Cagophilic",
"Cainophobic",
"Cainotophobic",
"Calceiform",
"Calciphilic",
"Calciphobic",
"Calcite",
"Calcivorous",
"Calicoed",
"Californium",
"Calligraphic",
"Calligraphical",
"Callous",
"Calm",
"Calmative",
"Calmy",
"Caloric",
"Caloried",
"Calorifacient",
"Calorific",
"Calx",
"CameraShy",
"Camlet",
"Camoflage",
"Camouflage",
"Campy",
"Cancellable",
"Candid",
"Candied",
"CandyCoated",
"CandyStriped",
"Canine",
"Cankered",
"Cankerous",
"Cannibal",
"Cannibalistic",
"Canophilic",
"Cantankerous",
"Capable",
"Capillary",
"Capitalist",
"Capitalistic",
"Capitate",
"Capless",
"Capricious",
"Capsizable",
"Captious",
"Captivating",
"Captivative",
"Capturable",
"Carbasus",
"Carbon",
"Carbonaceous",
"Carbonic",
"Carboniferous",
"Carbonless",
"Carbonous",
"Carcinogenic",
"Cardboard",
"Cardiac",
"Cardinal",
"Cardiographic",
"Cardiologic",
"Cardiological",
"Cardiotonic",
"Cardiovascular",
"Carefree",
"Careful",
"Careless",
"Caressive",
"Careworn",
"Caring",
"Carmine",
"Carnauba",
"Carnelian",
"Carneous",
"Carniferous",
"Carnivalesque",
"Carnivallike",
"Carnivoral",
"Carnivorous",
"Carnose",
"Carnous",
"Carping",
"Carriable",
"Carroty",
"Carryable",
"Carsick",
"Cashmere",
"CastIron",
"CastOff",
"CastSteel",
"Castoff",
"Cataclysmic",
"Catastrophal",
"Catastrophic",
"Catastrophical",
"Catatonic",
"Catchable",
"Catching",
"Catchy",
"Catechisable",
"Categorical",
"Catlike",
"Catoptrophobic",
"Cattish",
"Cattlehide",
"Catty",
"Cauliflorous",
"Causable",
"Causational",
"Causative",
"Causeless",
"Caustic",
"Caustical",
"Cautious",
"Cavalier",
"Cavelike",
"Cavernous",
"Cavitied",
"Cayenned",
"Celadon",
"Celebrated",
"Celebrative",
"Celebratory",
"Celestial",
"Celestine",
"Celestite",
"CellLike",
"Cellular",
"Cement",
"Cementitious",
"Censorable",
"Censorial",
"Censorian",
"Censorious",
"Censual",
"Censurable",
"Censureless",
"Centaurial",
"Centaurian",
"Centauric",
"Centerable",
"Centered",
"Centipedal",
"Centophobic",
"Central",
"Centralistic",
"Centralized",
"Centric",
"Centrifugal",
"Cepevorous",
"Cephalic",
"Cepivorous",
"Ceramic",
"Cerate",
"Cere",
"Cerebellar",
"Cerebral",
"Cerebric",
"Cerebroid",
"Cerebrospinal",
"Cerise",
"Certain",
"Certifiable",
"Certificatory",
"Certified",
"Cerulean",
"Cetologic",
"Cetological",
"ChainDriven",
"ChainReacting",
"Chalcedony",
"Chalcopyrite",
"Chalk",
"Chalkstony",
"Chalky",
"Challenging",
"Chanceful",
"Chancy",
"Changeable",
"Changeful",
"Chantable",
"Chaotic",
"Characterful",
"Characteristic",
"Characterless",
"Charcoal",
"Charcoaly",
"Chargeable",
"Chargeful",
"Chargeless",
"Charismatic",
"Charityless",
"Charlatanical",
"Charlatanish",
"Charlatanistic",
"Charming",
"Charred",
"Charterable",
"Charitable",
"Chartreuse",
"Chaseable",
"Chasmophilic",
"Chaste",
"Chattable",
"Chattery",
"Chatty",
"Chauvinist",
"Chauvinistic",
"Cheap",
"Cheatable",
"Checkable",
"Checked",
"Checkered",
"Cheeky",
"Cheerful",
"Cheerless",
"Cheery",
"CheeseLike",
"Cheesecloth",
"Cheesy",
"Chelonaphilic",
"Chemic",
"Chemical",
"Chemophobic",
"Cherishable",
"Cherubic",
"Cherubical",
"Chevrette",
"Chevroned",
"Chewable",
"Chewed",
"Chewy",
"Chiasmic",
"Chic",
"ChickenHearted",
"ChickenLivered",
"Chief",
"Chiffon",
"Childish",
"Childless",
"Childlike",
"Childly",
"Childproof",
"Childsafe",
"Chilled",
"Chilly",
"Chino",
"Chintzy",
"Chippable",
"Chipper",
"Chiropterophilic",
"Chiroptophobic",
"Chiselled",
"Chitchatty",
"Chivalric",
"Chivalrous",
"Chloroformic",
"Chocolate",
"Chocolatey",
"Chocolaty",
"Choky",
"Choleric",
"Chondrite",
"Choosable",
"Choosey",
"Choosy",
"Choppy",
"Choral",
"Chordal",
"Chordamesodermal",
"Chordamesodermic",
"Chorded",
"Choreographic",
"Chorographic",
"Chorographical",
"Chosen",
"Chromatinic",
"Chromatnic",
"Chromic",
"Chromite",
"Chromium",
"Chromophilic",
"Chromophobic",
"Chromosomal",
"Chronogrammatic",
"Chronogrammatical",
"Chronographic",
"Chronological",
"Chronometric",
"Chronometrical",
"Chrysophilic",
"Chrysoprase",
"Chubby",
"Chuckleheaded",
"Chuffy",
"Chummy",
"Chunky",
"Churchless",
"Churchly",
"Churchy",
"Churlish",
"Churnable",
"Cibophobic",
"Cilia",
"Cilium",
"Cinderlike",
"Cinderous",
"Cindery",
"Cinematic",
"Cinematographic",
"Cinnabar",
"Cinnamic",
"Cinnamoned",
"Cinnamonic",
"Cipolin",
"Circular",
"Circulatory",
"Circumfluent",
"Circumnavigable",
"Circumnavigatory",
"Circumspect",
"Circumstantial",
"Citable",
"Citatory",
"Citeable",
"Citied",
"Citified",
"Citizenly",
"Citreous",
"Citric",
"Citrine",
"Citylike",
"Civic",
"Civil",
"CivilLaw",
"Civilian",
"Civilisable",
"Civilisational",
"Civilisatory",
"Civilized",
"Claimable",
"Clairvoyant",
"Clamlike",
"Clammy",
"Clandestine",
"Clannish",
"ClassConscious",
"Classic",
"Classical",
"Classified",
"Classless",
"Classy",
"Claustrophilic",
"Claustrophobic",
"Clay",
"Clayey",
"Clayish",
"Clean",
"CleanCut",
"CleanFaced",
"CleanHanded",
"CleanLimbed",
"CleanShaven",
"Cleanable",
"Cleansable",
"ClearCut",
"ClearEyed",
"ClearHeaded",
"ClearSighted",
"Clearable",
"Clerical",
"Clerkish",
"Clever",
"Cleverish",
"Cliffy",
"Climactic",
"Climatic",
"Climatologic",
"Climatological",
"Climbing",
"Clingy",
"Clinical",
"Clinophilic",
"Clippable",
"Clockwork",
"Cloddy",
"Cloggy",
"Cloistered",
"Cloned",
"Close",
"CloseBy",
"CloseFitting",
"CloseIn",
"CloseKnit",
"Closed",
"Cloth",
"Clothed",
"Clotty",
"Cloudy",
"ClownLike",
"Clownish",
"Clubbable",
"Clubby",
"Clubfooted",
"Clueless",
"Clumpish",
"Clumpy",
"Clumsy",
"Cluttered",
"CoEd",
"Coachable",
"Coal",
"Coaly",
"Coarse",
"CoarseGrained",
"Coastal",
"Coated",
"Cob",
"Cobblestone",
"Cobwebby",
"Cockeyed",
"Cocksure",
"Cocky",
"Cocoa",
"Codependent",
"Coeducational",
"Coercionary",
"Coercive",
"Coessential",
"Coexistent",
"CoffeeColored",
"Cogitative",
"Cognisant",
"Cognitive",
"Cognizant",
"Coherent",
"Cohesive",
"Cold",
"ColdBlooded",
"ColdHearted",
"ColdHeartedly",
"ColdWater",
"Coldish",
"Collaborative",
"Collapsible",
"Collective",
"Collielike",
"Collinear",
"Colloquial",
"Collusive",
"Colluvium",
"Colonial",
"Colonisable",
"Coloristic",
"Colossal",
"ColourBlind",
"Colourable",
"Colourational",
"Coloured",
"Colourific",
"Colouristic",
"Colourless",
"Coltish",
"Columnar",
"Columnarized",
"Columned",
"Combatable",
"Combative",
"Combustible",
"Combustive",
"Comedial",
"Comely",
"Comfortable",
"Comfortless",
"Comfy",
"Comic",
"Comical",
"Commanding",
"Commenceable",
"Commendable",
"Commendatory",
"Commensurable",
"Commensurate",
"Commentable",
"Commentarial",
"Commentative",
"Commentatorial",
"Commercial",
"Commercialistic",
"Comminative",
"Comminatory",
"Commiserable",
"Commiserative",
"Committable",
"Commodious",
"Common",
"CommonLaw",
"Commonable",
"Commonplace",
"Commonsense",
"Commonsensible",
"Commonsensical",
"Communal",
"Communalistic",
"Communicable",
"Communicative",
"Communicatory",
"Communionable",
"Communist",
"Communistic",
"Communistical",
"Communital",
"Community",
"Commutable",
"Commutative",
"Commutual",
"Compact",
"Compactable",
"Companionable",
"Companionless",
"Companyless",
"Comparable",
"Comparative",
"Compassable",
"Compassionate",
"Compassionless",
"Compatible",
"Compatriotic",
"Compellable",
"Compellent",
"Compensable",
"Compensational",
"Compensatory",
"Compentant",
"Competitive",
"Complacent",
"Complainable",
"Complaisant",
"Complementable",
"Complementary",
"Complemented",
"Completable",
"Complete",
"Complex",
"Complexional",
"Complexioned",
"Complexionless",
"Compliable",
"Compliant",
"Complicated",
"Componental",
"Componented",
"Comprehensive",
"Compressive",
"Comprisable",
"Compulsive",
"Compulsory",
"Computable",
"Computational",
"Computative",
"Concave",
"Conceited",
"Conceivable",
"Concentrative",
"Conceptual",
"Concerned",
"Concessible",
"Concessionary",
"Concessive",
"Conchin",
"Conchiolin",
"Conchologic",
"Conchological",
"Concise",
"Concludable",
"Concludible",
"Conclusional",
"Conclusive",
"Concrete",
"Concretionary",
"Concurrent",
"Condemnable",
"Condemnatory",
"Condemned",
"Condensable",
"Condensational",
"Condensative",
"Condensed",
"Condescending",
"Condescensive",
"Conditioned",
"Confident",
"Confidential",
"Configurational",
"Configurative",
"Confineable",
"Confined",
"Confirmable",
"Confirmatory",
"Confirmed",
"Confiscable",
"Confiscatory",
"Conflictive",
"Conflictory",
"Confluent",
"Confounded",
"Confounding",
"Confused",
"Confusing",
"Confusional",
"Congenial",
"Congested",
"Congratulant",
"Congratulational",
"Congratulatory",
"Congregational",
"Congregative",
"Congressional",
"Congruent",
"Congruous",
"Connectable",
"Connectible",
"Conscientious",
"Conscionable",
"Conscious",
"Consecutive",
"Consensual",
"Consentaneous",
"Consentient",
"Conservable",
"Conservational",
"Conservative",
"Considerable",
"Considerate",
"Consignable",
"Consistent",
"Consolable",
"Consolatory",
"Consolidative",
"Conspicuous",
"Conspirative",
"Conspiratorial",
"Constant",
"Constellatory",
"Constituent",
"Constitutional",
"Constitutive",
"Constrainable",
"Constrained",
"Constrictive",
"Constringent",
"Construable",
"Constructible",
"Constuctional",
"Constuctive",
"Consumable",
"Consummate",
"Consumptive",
"Contactual",
"Contagious",
"Containable",
"Contained",
"Contaminable",
"Contaminated",
"Contaminative",
"Contaminous",
"Contemnible",
"Contemplable",
"Contemplative",
"Contemporaneous",
"Contemporary",
"Contemptible",
"Contemptile",
"Contemptuous",
"Content",
"Contentable",
"Contented",
"Contentional",
"Contentious",
"Contestable",
"Contextual",
"Contiguous",
"Continental",
"Continual",
"Continued",
"Continuing",
"Continuous",
"Contorted",
"Contortional",
"Contortioned",
"Contortionistic",
"Contortive",
"Contractible",
"Contractile",
"Contractional",
"Contractive",
"Contractual",
"Contractured",
"Contradictable",
"Contradictious",
"Contradictive",
"Contradictory",
"Contrary",
"Contributable",
"Contrite",
"Contrivable",
"Contrived",
"Controlled",
"Controlless",
"Controversial",
"Controvertible",
"Contumelious",
"Contusioned",
"Convectional",
"Convective",
"Convenable",
"Convenient",
"Conventional",
"Conventual",
"Convergent",
"Conversable",
"Conversant",
"Conversational",
"Converted",
"Convertible",
"Conveyable",
"Convictable",
"Convictible",
"Convictional",
"Convictive",
"Convincible",
"Convincing",
"Convivial",
"Convulsant",
"Convulsible",
"Convulsionary",
"Convulsive",
"Cookable",
"Cooked",
"Cool",
"Cooperative",
"Copacetic",
"Coplanar",
"Copper",
"Coppery",
"Copyrightable",
"Coquettish",
"Coral",
"Coralliferous",
"Coralline",
"Coralloid",
"Cordial",
"Corduroy",
"Corelative",
"Cork",
"Corked",
"Corking",
"Corky",
"CornColored",
"Cornmeal",
"Corny",
"Coronary",
"Corporal",
"Corporate",
"Corporational",
"Corporatist",
"Corporative",
"Corporeal",
"Correct",
"Correctable",
"Correctible",
"Correctional",
"Corrective",
"Correlatable",
"Correlational",
"Correlative",
"Corroborant",
"Corroborative",
"Corrodible",
"Corrosional",
"Corrosive",
"Corrupt",
"Corrupted",
"Corruptful",
"Corruptible",
"Corrupting",
"Corruptive",
"Cosey",
"Coseys",
"Cosie",
"Cosies",
"Cosmetological",
"Cosmic",
"Cosmogonal",
"Cosmogonic",
"Cosmogonical",
"Cosmographic",
"Cosmographical",
"Cosmologic",
"Cosmological",
"Cosmonautic",
"CostEffective",
"Costless",
"Costly",
"Cosy",
"Cotton",
"Cottony",
"Coulrophobic",
"Councilmanic",
"Counselable",
"Countable",
"Counteractive",
"Countercoloured",
"Counterproductive",
"Counterterrorist",
"Countrified",
"CountryBred",
"CountryWide",
"Couped",
"Courageous",
"Courteous",
"Courtly",
"Coverable",
"Covered",
"Covert",
"Covetable",
"Coveting",
"Covetous",
"Cowardly",
"Cowlike",
"Coy",
"Coyish",
"Cozey",
"Cozy",
"Crabbed",
"Crabby",
"Crackable",
"Cracked",
"Crackless",
"Crafty",
"Craggy",
"Cramped",
"Cranial",
"Craniate",
"Craniological",
"Craniometric",
"Craniometrical",
"Cranioscopical",
"Cranky",
"Crashing",
"Crass",
"Craven",
"Crawly",
"Crazed",
"Crazy",
"Cream",
"CreamColored",
"Creamy",
"Creased",
"Creasy",
"Creatable",
"Creational",
"Creationary",
"Creationistic",
"Creative",
"Creatural",
"Creaturely",
"Credentialed",
"Credible",
"Creditable",
"Credulous",
"Creeded",
"Creepy",
"Crematory",
"Creophagous",
"Crestfallen",
"Cretaceous",
"Cretinoid",
"Cretinous",
"Creviced",
"Criminal",
"Criminative",
"Criminologic",
"Criminological",
"Crimpy",
"Crimson",
"Crippling",
"Crispy",
"Critical",
"Criticisable",
"Crocodiloid",
"Cronish",
"Crooked",
"CrossLegged",
"Crotchety",
"Crowning",
"Crucial",
"Crude",
"Cruel",
"Cruelhearted",
"Crumbable",
"Crumbly",
"Crumby",
"Crumply",
"Crurophilic",
"Cruse",
"Crushable",
"Crushing",
"Crustaceous",
"Crusted",
"Crusty",
"Crying",
"Cryogenic",
"Cryophilic",
"Cryptic",
"Cryptocrystalline",
"Cryptographic",
"Cryptographical",
"Cryptovolcanic",
"Cryptozoic",
"Crystal",
"Crystalliferous",
"Crystalline",
"Crystallisable",
"Crystallitic",
"Crystallographic",
"Crystalloid",
"Crystalloidal",
"Cthonophagous",
"Cubic",
"Cubical",
"Cubiform",
"Cubistic",
"Cuboid",
"Cuddlesome",
"Cuddly",
"Culinary",
"Culm",
"Culpable",
"Cultic",
"Cultish",
"Cultivable",
"Cultivated",
"Cultual",
"Cultural",
"Cultured",
"Cultureless",
"Cumbersome",
"Cumbrous",
"Cummy",
"Cumulative",
"Cuneiform",
"Cunning",
"Cupulate",
"Curable",
"Curative",
"Curatorial",
"Curbable",
"Curdy",
"Cured",
"Curious",
"Curium",
"Curly",
"Curmudgeonly",
"Current",
"Curricular",
"Cursed",
"Cursive",
"Cursorial",
"Cursory",
"Curt",
"Curvaceous",
"Curved",
"Curvilinear",
"Curvy",
"Cushiony",
"Cushy",
"Cussed",
"Custodial",
"CustomBuilt",
"CustomMade",
"Customable",
"Customary",
"Cut",
"CutPrice",
"CutRate",
"Cute",
"Cuttable",
"Cyan",
"Cybernetic",
"Cyberpunk",
"Cycadaceous",
"Cyclopean",
"Cylinderlike",
"Cylindraceous",
"Cylindrical",
"Cynical",
"Cynophobic",
"Cystic",
"Czarist",
"Dacite",
"Daemonic",
"Daffy",
"Daft",
"Dainty",
"Damageable",
"Damaged",
"Damaging",
"Damask",
"Damp",
"DampProof",
"Dampish",
"Dampproof",
"Dandriffy",
"Dandruffy",
"Dangerous",
"Dank",
"Dapper",
"DappleGray",
"Daredevil",
"Daring",
"Dark",
"Darkish",
"Darksome",
"Darmstadtium",
"Dashing",
"Dastardly",
"Dated",
"Daughterlike",
"Daughterly",
"Dauntless",
"Daydreaming",
"Daydreamy",
"Dazed",
"Dazzling",
"Deactivated",
"Dead",
"DeadSmooth",
"Deadbeat",
"Deadly",
"Deadpan",
"Dear",
"Deathful",
"Deathless",
"Deathlike",
"Deathly",
"Debatable",
"Debilitated",
"Debilitative",
"Debonair",
"Decadent",
"Decagonal",
"Decahedral",
"Decapitated",
"Decasyllabic",
"Decayable",
"Decayed",
"Deceased",
"Deceitful",
"Decent",
"Deceptive",
"Decidophobic",
"Deciduous",
"Decipherable",
"Decisive",
"Declamatory",
"Declarative",
"Declaratory",
"Declared",
"Declinable",
"Declinate",
"Declinational",
"Declinatory",
"Decomposable",
"Decomposed",
"Decontaminative",
"Decorated",
"Decorative",
"Decorous",
"Decrepit",
"Dedicated",
"Deducible",
"Deductible",
"Deductive",
"Deep",
"Deerskin",
"Defaceable",
"Defamatory",
"Defeasible",
"Defeated",
"Defectible",
"Defective",
"Defenceless",
"Defenestrated",
"Defensive",
"Deferable",
"Deferent",
"Deferential",
"Defiable",
"Defiant",
"Deficient",
"Definable",
"Definite",
"Definitive",
"Deflated",
"Deflationary",
"Deflectable",
"Deformable",
"Deformational",
"Deformative",
"Deformed",
"Deft",
"Defunct",
"Defunctive",
"Degenerative",
"Degradable",
"Degraded",
"Degrading",
"Dehydrated",
"Deific",
"Deiform",
"Deistic",
"Deistical",
"Dejected",
"Delayable",
"Delayed",
"Delectable",
"Delegable",
"Deliberate",
"Deliberative",
"Delicate",
"Delicious",
"Delighted",
"Delightful",
"Delightless",
"Delightsome",
"Delirious",
"Delusional",
"Delusive",
"Demagnetisable",
"Demagnetizable",
"Demandable",
"Demanding",
"Demented",
"Democratic",
"Demoded",
"Demographic",
"Demographical",
"Demoniac",
"Demonian",
"Demonic",
"Demonstrable",
"Demonstrational",
"Demonstrative",
"Demotic",
"Demure",
"Demurrable",
"Dendrachate",
"Dendric",
"Dendriform",
"Dendritic",
"Dendrochronological",
"Dendroid",
"Dendrological",
"Dendrophagous",
"Dendrophilic",
"Dendrophilous",
"Dendrophobic",
"Deniable",
"Denim",
"Dense",
"Dental",
"Dentine",
"Dentophobic",
"Deodorizing",
"Departed",
"Departmental",
"Dependable",
"Dependent",
"Depictive",
"Depilatory",
"Depleted",
"Depletive",
"Depletory",
"Deplorable",
"Deportable",
"Deposable",
"Depositional",
"Depraved",
"Deprecative",
"Deprecatory",
"Depreciable",
"Depreciatory",
"Depressant",
"Depressed",
"Depressible",
"Depressing",
"Depressive",
"Deprivable",
"Deprived",
"Derangeable",
"Deranged",
"Derelict",
"Derisible",
"Derisive",
"Derivable",
"Derivational",
"Derivative",
"Dermal",
"Dermatic",
"Dermatographic",
"Dermatoid",
"Dermatological",
"Dermatomic",
"Dermatophytic",
"Dermatoplastic",
"Dermatropic",
"Dermic",
"Dermographic",
"Dermoid",
"Derogative",
"Derogatory",
"Descendent",
"Descendible",
"Describable",
"Descriptive",
"Desecrated",
"DesertLike",
"Deserted",
"Desertic",
"Deserticolous",
"Desertlike",
"Deserved",
"Deserving",
"Designative",
"Designatory",
"Desirable",
"Desired",
"Desirous",
"Despairful",
"Despairing",
"Desperate",
"Despicable",
"Despisable",
"Despiteful",
"Despiteous",
"Despondent",
"Despotic",
"Destined",
"Destitute",
"Destroyable",
"Destroyed",
"Destructible",
"Destructive",
"Detachable",
"Detailed",
"Detainable",
"Detectable",
"Detectible",
"Deteriorative",
"Determinable",
"Determinant",
"Determinate",
"Determinately",
"Determinative",
"Determined",
"Deterministic",
"Detestable",
"Detonable",
"Detonative",
"Detoxicant",
"Detractive",
"Detrimental",
"Deviant",
"Deviative",
"Deviceful",
"Devious",
"Devoid",
"Devoted",
"Devotional",
"Devout",
"Dewy",
"DewyEyed",
"Dexterous",
"Diabetic",
"Diabolic",
"Diagnosable",
"Diagnostic",
"Diagonal",
"Dialectal",
"Dialectical",
"Dialectologic",
"Dialectological",
"Diamant",
"Diamantiferous",
"Diamantine",
"Diamond",
"Diarthrodial",
"Dicey",
"Dichromatic",
"Dictatorial",
"Didactic",
"Diet",
"Dietary",
"Dietetic",
"Different",
"Differentiable",
"Differential",
"Difficult",
"Diffident",
"Diffractive",
"Diffusible",
"Digestible",
"Digestional",
"Digestive",
"Digital",
"Digitiform",
"Dignified",
"Digressive",
"Dihedral",
"Dihydrated",
"Dihydric",
"Dilapidated",
"Dilligent",
"Dim",
"DimWitted",
"Diminished",
"Diminutive",
"Dimmed",
"Dimming",
"Dimply",
"Dingy",
"Dinky",
"Dinosaurian",
"Diopside",
"Diplocardiac",
"Diplomatic",
"Dippy",
"Dire",
"Directionless",
"Directorial",
"Direful",
"Dirgeful",
"Dirt",
"Dirty",
"DirtyFaced",
"Disabled",
"Disadvantaged",
"Disaffected",
"Disagreeable",
"Disallowable",
"Disappointed",
"Disappointing",
"Disarming",
"Disastrous",
"Disbursable",
"Discernible",
"Discerning",
"Disciplinable",
"Disciplinal",
"Disciplinary",
"Disciplined",
"Discoloured",
"Discombobulated",
"Discomfortable",
"Disconcerted",
"Disconsolate",
"Discontented",
"Discontinuous",
"Discophilic",
"Discountable",
"Discourageable",
"Discourteous",
"Discoverable",
"Discreditable",
"Discreet",
"Discrepant",
"Discrete",
"Discretional",
"Discretionary",
"Discussable",
"Discussible",
"Disdainful",
"Diseased",
"Disembodied",
"Disenfranchised",
"Disgraceful",
"Disguisable",
"Disgusted",
"Disgustful",
"Disgusting",
"Dishevelled",
"Dishonest",
"Dishonorable",
"Dishonourable",
"Disillusioned",
"Disillusive",
"Disimpassioned",
"Disinclined",
"Disingenuous",
"Disinherited",
"Disintegrable",
"Disintegrative",
"Disintegratory",
"Disinterested",
"Dislikeable",
"Disliked",
"Disloyal",
"Dismal",
"Dismissible",
"Dismissive",
"Dismountable",
"Disobedient",
"Disordered",
"Disorganized",
"Disparaged",
"Disparaging",
"Dispassionate",
"Dispellable",
"Dispensable",
"Dispersible",
"Dispirited",
"Dispiriting",
"Dispiteous",
"Displaceable",
"Displayed",
"Displeased",
"Displeasing",
"Displeasureable",
"Disposable",
"Dispossessed",
"Dispossessory",
"Disproportionable",
"Disproportional",
"Disprovable",
"Disputable",
"Disqualifiable",
"Disquieted",
"Disquieting",
"Disregardful",
"Disreputable",
"Disrespectable",
"Disrespectful",
"Disruptive",
"Dissatisfactory",
"Dissatisfied",
"Dissected",
"Dissectible",
"Dissentient",
"Dissentious",
"Dissident",
"Dissimilar",
"Dissociable",
"Dissocial",
"Dissociative",
"Dissolvable",
"Dissonant",
"Dissuadable",
"Dissuasive",
"Dissyllabic",
"Distant",
"Distasteful",
"Distended",
"Distent",
"Distillable",
"Distinct",
"Distinctive",
"Distinguished",
"Distinguishing",
"Distorted",
"Distortional",
"Distortive",
"Distracted",
"Distractible",
"Distractive",
"Distressful",
"Distributable",
"Distrustful",
"Disturbed",
"Disturbing",
"Disused",
"Disyllabic",
"Divergent",
"Diverse",
"Diversifiable",
"Diversified",
"Diversiform",
"Divinable",
"Divinatory",
"Divine",
"Diving",
"Divorceable",
"Dizzied",
"Dizzy",
"Dizzying",
"Docile",
"Doctoral",
"Doctorial",
"Doctrinaire",
"Doctrinal",
"Documentary",
"Doddered",
"Doddering",
"Dodecagonal",
"Dodecahedral",
"Dodecasyllabic",
"DogPoor",
"DogTired",
"Dogged",
"Doggish",
"Doggoned",
"Doglike",
"Dogmatic",
"Dollfaced",
"Dollish",
"Dolomite",
"Dolorous",
"Dolostone",
"Doltish",
"Domestic",
"Domesticable",
"Domesticated",
"Domesticative",
"Dominant",
"Dominating",
"Domineering",
"Doomed",
"Dopey",
"Dopy",
"Dorky",
"Dormant",
"Dorsal",
"Dorsispinal",
"Dotted",
"DoubleEdged",
"DoubleJointed",
"Doubtful",
"Doughty",
"Doughy",
"Dour",
"Doused",
"DoveColored",
"Dovish",
"Dowdy",
"Downcast",
"Downfallen",
"Downhearted",
"Downtrodden",
"Downy",
"Dozing",
"Dozy",
"Drab",
"Draconian",
"Draconic",
"Drafty",
"Dragonish",
"Dragonlike",
"Dramatic",
"Dramatisable",
"Dramatizable",
"Dramaturgic",
"Dramaturgical",
"Drastic",
"Draughty",
"Drawn",
"Dreadable",
"Dreadful",
"Dreamful",
"Dreamlike",
"Dreamy",
"Drear",
"Drearisome",
"Dreary",
"Dressy",
"Drifty",
"Drinkable",
"DripDry",
"Dripping",
"Drippy",
"Driveable",
"Drizzly",
"Droll",
"Dronish",
"Drooly",
"Droopy",
"Drossy",
"Droughty",
"Drouthy",
"Drowsy",
"Druidic",
"Druidical",
"Dry",
"Dryadic",
"DualPurpose",
"Dubious",
"Dubnium",
"Ducal",
"Duckie",
"Duelistic",
"Dull",
"Dullish",
"Dumb",
"Dumbfounded",
"Dumbstruck",
"Dumpish",
"Dumpy",
"Duncical",
"Duncish",
"Dunderheaded",
"Dungy",
"Dunite",
"Durable",
"Durational",
"Durative",
"Duskish",
"Dusky",
"Dustless",
"Dustproof",
"Dusty",
"Duteous",
"Dutiable",
"Dutiful",
"DutyBound",
"Dwarfed",
"Dwarfish",
"Dwarven",
"Dyable",
"Dying",
"Dynamic",
"Dynamistic",
"Dynamitic",
"Dynastic",
"Dynastical",
"Dysfunctional",
"Dysmorphophobic",
"Dystopian",
"Dystopic",
"Eager",
"EagleEyed",
"Earnest",
"Earth",
"Earthborn",
"Earthbound",
"Earthen",
"Earthenware",
"Earthly",
"Earthy",
"Easeful",
"Eastbound",
"Eastern",
"Easternmost",
"Eastmost",
"Easy",
"EasyGoing",
"Eatable",
"Eaved",
"Ebony",
"Ebullient",
"Eccentric",
"Eccentrical",
"Ecclesiastical",
"Ecclesiologic",
"Ecclesiological",
"Eclectic",
"Eclogite",
"Ecologic",
"Ecological",
"Econometric",
"Econometrical",
"Economic",
"Economical",
"Ecosystemic",
"Ecstatic",
"Ectocranial",
"Ectoplasmatic",
"Ectoplasmic",
"Ecumenical",
"Edacious",
"Edgy",
"Edible",
"Edificial",
"Editorial",
"Educable",
"Educated",
"Educational",
"Educative",
"Educatory",
"Eerie",
"Effaceable",
"Effectible",
"Effective",
"Effectual",
"Effeminate",
"Effervescent",
"Effervescible",
"Effete",
"Efficacious",
"Efficient",
"Effigial",
"Efflorescent",
"Effortful",
"Effortless",
"Effusive",
"Egalitarian",
"Egocentric",
"Egoistic",
"Egoistical",
"Egomaniacal",
"Egotistic",
"Egotistical",
"Egregious",
"Einsteinium",
"Ejective",
"Elaborate",
"Elaborative",
"Elastic",
"Elated",
"Elder",
"Elderly",
"Electoral",
"Electric",
"Electrical",
"Electrified",
"Electrobiological",
"Electrocardiographic",
"Electrodynamic",
"Electrokinetic",
"Electroluminescent",
"Electrolytic",
"Electromagnetic",
"Electromechanical",
"Electrometallurgical",
"Electrometric",
"Electrometrical",
"Electronic",
"Electrophilic",
"Electrophonic",
"Electrosensitive",
"Electrostatic",
"Elegant",
"Elemental",
"Elementary",
"Elephantiasic",
"Elephantine",
"Elephantoid",
"Elevated",
"Elfin",
"Elfish",
"Elicitable",
"Eligible",
"Eliminable",
"Elite",
"Ellipsoidal",
"Elliptic",
"Elliptical",
"Elmy",
"Eloquent",
"Elusive",
"Elvish",
"Emaciated",
"Emanatory",
"Emancipated",
"Emancipating",
"Emancipative",
"Emancipatory",
"Emasculated",
"Emasculative",
"Emasculatory",
"Embarrassed",
"Embarrassing",
"Embattled",
"Emblematic",
"Embolic",
"Embolismic",
"Embraceable",
"Embracive",
"Emerald",
"Emeritus",
"Emersed",
"Emetophobic",
"Emigrational",
"Emigrative",
"Emigratory",
"Eminent",
"Emo",
"Emotionable",
"Emotional",
"Emotionalistic",
"Emotionless",
"Emotive",
"Empathetic",
"Empathic",
"Emphatic",
"Empirical",
"Empiristic",
"Employable",
"Emptiable",
"Emptied",
"Empty",
"EmptyHanded",
"EmptyHeaded",
"Empyrean",
"Emulsible",
"Emulsifiable",
"Emulsive",
"Enarthrodial",
"Encephalic",
"Encephalitic",
"Enchanted",
"Enchanting",
"Encouraging",
"Encyclopaedic",
"Endangered",
"Endemic",
"Endless",
"Endocardial",
"Endocranial",
"Endocrine",
"Endocrinologic",
"Endocrinological",
"Endocrinopathic",
"Endocrinous",
"Endodermal",
"Endodermic",
"Endowed",
"Endurable",
"Endurant",
"Enduring",
"Energetic",
"Energetistic",
"Energistic",
"Enervated",
"Enervative",
"Enetophobic",
"Enforceable",
"Engaged",
"Engaging",
"Enginous",
"Englacial",
"Engrammic",
"Enhanced",
"Enhancive",
"Enharmonic",
"Enigmatic",
"Enjambed",
"Enjoyable",
"Enlargeable",
"Enneahedral",
"Enneasyllabic",
"Enormous",
"Enraged",
"Enrapt",
"Enslaved",
"Enstatite",
"Enterprising",
"Entertaining",
"Enthralled",
"Enthroned",
"Enthusiastic",
"Entire",
"Entitled",
"Entodermal",
"Entodermic",
"Entomologic",
"Entomological",
"Entomophagous",
"Entomophobic",
"Entrepreneurial",
"Enumerable",
"Enunciable",
"Enunciatory",
"Enuncuative",
"Enviable",
"Envious",
"Environmental",
"Enzymatic",
"Enzymolytic",
"Eolithic",
"Eonian",
"Ephebiphobic",
"Ephemeral",
"Epicardiac",
"Epicardial",
"Epicentral",
"Epicurean",
"Epidemic",
"Epidermal",
"Epidermic",
"Epidermoid",
"Epimyocardial",
"Episodic",
"Epistemological",
"Epitaphic",
"Epoxy",
"Equable",
"Equal",
"Equalitarian",
"Equanimous",
"Equatable",
"Equational",
"Equatorial",
"Equestrian",
"Equiangular",
"Equicontinuous",
"Equidistant",
"Equilateral",
"Equilibratory",
"Equilibrious",
"Equilibristic",
"Equine",
"Equinophobic",
"Equipable",
"Equitable",
"Equivalent",
"Eradicable",
"Erasable",
"Erect",
"Erectable",
"Erectile",
"Erective",
"Ergasiophobic",
"Ergonomic",
"Ergophilic",
"Ergophobic",
"Ermined",
"Erosive",
"Errable",
"Erratic",
"Erythrophobic",
"Escapable",
"Esophageal",
"Esoteric",
"Especial",
"Essential",
"Establishable",
"Established",
"Establishmentarian",
"Esthetic",
"Esthetical",
"Eternal",
"Ethereal",
"Ethical",
"Ethnic",
"Ethnocentric",
"Ethnogenic",
"Ethnographic",
"Ethnographical",
"Ethnohistoric",
"Ethnohistorical",
"Ethnolinguistic",
"Ethnologic",
"Ethnological",
"Ethnomusicological",
"Ethologic",
"Ethological",
"Etymologic",
"Etymological",
"Eucalyptic",
"Euhedral",
"Euphoric",
"Evacuated",
"Evadable",
"Evadible",
"Evaluable",
"Evasive",
"Even",
"EvenHanded",
"EvenMinded",
"EvenTempered",
"Eventful",
"Evergreen",
"Everlasting",
"Everyday",
"Evident",
"Evil",
"EvilEyed",
"EvilMinded",
"Evocable",
"Evolutional",
"Evolutionary",
"Evolutive",
"Evolvable",
"Evolved",
"Exacerbated",
"Exact",
"Exactable",
"Exacting",
"Exaggerated",
"Exalted",
"Exceedable",
"Excellent",
"Exceptional",
"Excess",
"Excessive",
"Exchangeable",
"Excisable",
"Excitable",
"Excited",
"Exciting",
"Exclaimational",
"Exclamatory",
"Exclusionary",
"Exclusionist",
"Exclusive",
"Exclusivistic",
"Excommunicable",
"Excusable",
"Executable",
"Exemplary",
"Exemplifiable",
"Exemplificative",
"Exemptible",
"Exhaustible",
"Exhaustive",
"Exilable",
"Existent",
"Existential",
"Existentialist",
"Existentialistic",
"Exodermal",
"Exorable",
"Exorcismal",
"Exorcistic",
"Exorcistical",
"Exoskeletal",
"Exoteric",
"Exothermic",
"Exotic",
"Expandable",
"Expanded",
"Expansive",
"Expectable",
"Expectant",
"Expected",
"Expecting",
"Expedient",
"Expediential",
"Expeditionary",
"Expeditious",
"Expensive",
"Experienced",
"Experimental",
"Expert",
"Explainable",
"Explicable",
"Exploding",
"Exploitable",
"Exploitative",
"Exploitatory",
"Exploitive",
"Explorable",
"Explosive",
"Exponential",
"Exportable",
"Exposable",
"Exposed",
"Expressible",
"Exquisite",
"Extended",
"Extendible",
"Extensible",
"Exterior",
"Exterminable",
"External",
"Extinct",
"Extinguishable",
"Extinguished",
"Extra",
"Extracellular",
"Extracorporeal",
"Extragalactic",
"Extrajudicial",
"Extralegal",
"Extranuclear",
"Extraordinary",
"Extraplanetary",
"Extraterrestrial",
"Extraterritorial",
"Extraverted",
"Extravertish",
"Extravertive",
"Extremal",
"Extreme",
"Extrovert",
"Extroverted",
"Extrovertish",
"Extrovertive",
"Exuberant",
"Exultant",
"Eyeable",
"Fab",
"Fabled",
"Fabric",
"Fabulous",
"Facial",
"Facile",
"Factional",
"Factorable",
"Fadable",
"Faded",
"Faint",
"Fainthearted",
"Faintish",
"Fair",
"Fairish",
"Fairylike",
"Faithful",
"Faithless",
"Fake",
"Falconiform",
"Falconine",
"Falconnoid",
"FalseHearted",
"Falsifiable",
"Famed",
"Fameless",
"Familial",
"Familiar",
"Familyish",
"Famished",
"Famous",
"Fanatical",
"Fanciful",
"Fancy",
"Far",
"FarFlung",
"FarSeeing",
"FarSighted",
"Farcical",
"Fascinated",
"Fascinating",
"Fascist",
"Fashionable",
"Fast",
"FastMoving",
"Fat",
"FatFaced",
"FatLike",
"FatWitted",
"Fatal",
"Fatherly",
"Fathomable",
"Fatigable",
"Fatlike",
"Fattening",
"Fattish",
"Fatty",
"Faultfinding",
"Faulty",
"Favourite",
"Fawning",
"Fearful",
"Fearless",
"Fearsome",
"Feasible",
"Feather",
"Featherbrained",
"Feathered",
"Featheredged",
"Featherlight",
"Feathery",
"Federal",
"Feeble",
"FeebleMinded",
"Feeblish",
"Feedable",
"Feisty",
"Fel",
"Feldspar",
"Felicific",
"Felicitous",
"Feline",
"Fellow",
"Felonious",
"Felt",
"Female",
"Feminine",
"Feminist",
"Feministic",
"Femoral",
"Feral",
"Fermentable",
"Fermium",
"Fernlike",
"Ferny",
"Ferocious",
"Ferreous",
"Ferrety",
"Ferric",
"Ferriferous",
"Ferrous",
"Fertile",
"Fertilizable",
"Fervent",
"Fervid",
"Festive",
"Fetid",
"Feudal",
"Feudalist",
"Feverish",
"Feverous",
"Fibered",
"Fiberglass",
"Fibre",
"Fibroid",
"Fibrous",
"Fickle",
"Fictional",
"Fidgety",
"Fiendish",
"Fierce",
"Fiery",
"Fightable",
"Figurable",
"Filched",
"Filibusterous",
"Fillable",
"Filmable",
"Filterable",
"Filthy",
"Finable",
"Final",
"Financial",
"Findable",
"Fine",
"FineDrawn",
"FineGrain",
"FineGrained",
"Fineable",
"Finespun",
"Finical",
"Finicky",
"Finnicky",
"FireBreathing",
"FireRetardant",
"FireBreathing",
"FireResistant",
"FireRetardant",
"Firebreathing",
"Fireless",
"Fireproof",
"Firm",
"First",
"FirstBorn",
"FirstGeneration",
"Fiscal",
"Fishable",
"Fishy",
"Fit",
"Fittable",
"Fixable",
"Fixed",
"FixedIncome",
"Fizzy",
"Flabby",
"Flaky",
"Flamboyant",
"FlameColored",
"Flameproof",
"Flaming",
"Flammable",
"Flamy",
"Flannel",
"Flashy",
"Flat",
"Flatterable",
"Flattering",
"Flattish",
"Flaunty",
"Flavorous",
"Flavoured",
"Flavourful",
"Flavourless",
"Flavoursome",
"Flavoury",
"Flawless",
"Flax",
"Flayed",
"Fleece",
"Fleecy",
"Fleeting",
"FleshColored",
"Fleshless",
"Fleshly",
"Fleshy",
"Flexible",
"Flexitarian",
"Flighty",
"Flimsy",
"Flinty",
"Flirtational",
"Flirtatious",
"Flirty",
"Floatable",
"Floating",
"Floaty",
"Flocculable",
"Floggable",
"Floodable",
"Floppy",
"Floral",
"Floreated",
"Floriated",
"Floricultural",
"Florid",
"Floriferous",
"Floristic",
"Flourishing",
"Floury",
"Flowable",
"Flowered",
"Flowering",
"Flowery",
"Fluent",
"Fluffy",
"Fluid",
"Fluidal",
"Fluidic",
"Fluorescent",
"Fluorite",
"Fluorspar",
"Flushed",
"Flyable",
"Flying",
"Foamy",
"Fogbound",
"Fogged",
"Foggy",
"Foggyish",
"Foil",
"Foilable",
"Foldable",
"Foliaceous",
"Foliaged",
"Foliated",
"Followable",
"Fond",
"Foolhardy",
"Foolish",
"Foolproof",
"Footed",
"Forbidden",
"Forbidding",
"Forcible",
"Fordable",
"ForeClosable",
"Foreign",
"Foreknowable",
"Forensic",
"Foreseeable",
"Forest",
"Forestial",
"Forfeitable",
"Forgeable",
"Forgetful",
"Forgettable",
"Forgivable",
"Forlorn",
"Formable",
"Formal",
"Former",
"Formidable",
"Formivorous",
"Forthcoming",
"Fortified",
"Fortitudinous",
"Fortuitous",
"Fortunate",
"FortuneHunting",
"Fortuneless",
"Forworn",
"FossilLike",
"Fossilisable",
"Fossillike",
"FoulMouthed",
"Foulard",
"Foulmouthed",
"Foxlike",
"Foxy",
"Fozy",
"Fractious",
"Fracturable",
"Fragile",
"Fragrant",
"Frail",
"Framable",
"Francium",
"Frangible",
"Frank",
"Frantic",
"Fraternal",
"Fratricidal",
"Freakish",
"Freaky",
"FreckleFaced",
"Freckled",
"Freckly",
"Free",
"FreeSwimming",
"FreeTrade",
"Freeborn",
"Freemasonic",
"Freethinking",
"Freezable",
"Freezing",
"Frenzied",
"Fresh",
"Fretful",
"Freudian",
"Friended",
"Friendless",
"Friendly",
"Friggatriskaidekaphobic",
"Frightenable",
"Frightened",
"Frightening",
"Frigid",
"Frilly",
"Frisky",
"Frivolous",
"Frizzly",
"Frizzy",
"Frogged",
"Froggy",
"Frolicky",
"Frolicsome",
"Front",
"FrostBreathing",
"FrostBreathing",
"Frostbitten",
"Frostbreathing",
"Frosted",
"Frosty",
"Frothy",
"Frousy",
"Frouzy",
"Frowsy",
"Frowzy",
"Frozen",
"Fructivorous",
"Frugal",
"Frugivorous",
"Fruitarian",
"Fruited",
"Fruitful",
"Fruity",
"Fruticose",
"Fuchsia",
"Full",
"FullGrown",
"FullTime",
"Fumbling",
"Fun",
"Functional",
"Fundamental",
"Fungal",
"Fungic",
"Fungicidal",
"Fungiform",
"Fungoid",
"Fungous",
"Fungus",
"Funny",
"Fur",
"Furious",
"Furred",
"Furry",
"Furtive",
"Fusible",
"Fussy",
"Futile",
"Future",
"Futuristic",
"Fuzzy",
"Gabardine",
"Gabby",
"Gadgety",
"Gainable",
"Galactic",
"Galactoid",
"Gallant",
"Galloping",
"Gamboge",
"Gammy",
"Gamy",
"Gangly",
"Gangrene",
"Gangrenous",
"Gargantuan",
"Garish",
"Garlicky",
"Garnet",
"Garnishable",
"Gaseous",
"Gasolinic",
"Gassy",
"Gastric",
"Gastroenterologic",
"Gastrointestinal",
"Gastronomic",
"Gastronomical",
"Gastroscopic",
"Gastrovascular",
"Gatherable",
"Gauche",
"Gaudy",
"Gaugeable",
"Gaunt",
"Gauze",
"Gauzy",
"Gelatinoid",
"Gelatinous",
"Gem",
"Gemmological",
"Gemmy",
"Gemological",
"Gemstone",
"Genealogic",
"Genealogical",
"General",
"GeneralPurpose",
"Generic",
"Generous",
"Genetic",
"Genial",
"Genius",
"Genocidal",
"Gentile",
"Gentle",
"Gentled",
"Gentlemanlike",
"Gentlemanly",
"Gentlewomanly",
"Gentling",
"Genuine",
"Geode",
"Geographical",
"Geologic",
"Geological",
"Geomedical",
"Geometric",
"Geometrical",
"Geophilic",
"Georgiaite",
"Gephyrophobic",
"Gerascophobic",
"Germfree",
"Germicidal",
"Germinable",
"Germless",
"Germlike",
"Germproof",
"Gerontophobic",
"Ghast",
"Ghastful",
"Ghastly",
"Ghetto",
"Ghostlike",
"Ghostly",
"Ghoulish",
"Giant",
"Giddied",
"Giddy",
"Giddying",
"GiftWrapped",
"Gifted",
"Giftwrapped",
"Gigantean",
"Gigantesque",
"Gigantic",
"Giggly",
"Gimmicky",
"Girlish",
"Girly",
"Giveable",
"Glacial",
"Glaciered",
"Glaciologic",
"Glaciological",
"Glad",
"Gladiatorial",
"Glamorous",
"Glandlike",
"Glandular",
"Glandulous",
"Glass",
"Glassy",
"Glaucophane",
"Glazed",
"Gleaming",
"Gleeful",
"Gleesome",
"Glistening",
"Glittery",
"Global",
"Gloomful",
"Gloomy",
"Glorious",
"Glossophilic",
"Glossophobic",
"Glossy",
"Glowing",
"Gluey",
"Glum",
"Gluteal",
"Glutinous",
"Gluttonous",
"Glycemic",
"Gnarled",
"Gnarly",
"Gnatty",
"Gnawable",
"Gnomic",
"Gnomish",
"Gnomologic",
"Gnomological",
"Gnomonic",
"GodFearing",
"Godforsaken",
"Godless",
"Godlike",
"Godly",
"Godsent",
"Gold",
"GoldFilled",
"GoldFoil",
"GoldLeaf",
"Golden",
"Goldenrod",
"Good",
"GoodHearted",
"GoodHumoured",
"GoodLooking",
"GoodNatured",
"GoodSized",
"GoodTempered",
"Goodish",
"Goodly",
"Gooey",
"Goofy",
"Goosebumpy",
"Goosepimply",
"Gorgeable",
"Gorgeous",
"Gorillian",
"Gorilline",
"Gorilloid",
"Gossipy",
"Gothic",
"Gourdlike",
"Governable",
"Governing",
"Governmental",
"Grabbable",
"Graceful",
"Graceless",
"Gracious",
"Gradable",
"Grained",
"Grainy",
"Graminivorous",
"Grand",
"Grandfatherly",
"Grandiloquent",
"Grandiose",
"Grandmotherly",
"Grandparental",
"Granite",
"Granitic",
"Granivorous",
"Grantable",
"Grapey",
"Graphic",
"Graphicial",
"Graphite",
"Grapy",
"Graspable",
"GrassGreen",
"Grasslike",
"Grassy",
"Grateful",
"Gratis",
"Gratuitous",
"Grave",
"Gravelish",
"Gravelly",
"Gray",
"Grayish",
"Grazeable",
"Greasy",
"Great",
"GreatHearted",
"Greedsome",
"Greedy",
"Green",
"Greenish",
"Greensick",
"Gregarious",
"Greisen",
"Grey",
"Greyish",
"GriefStricken",
"Grieving",
"Grievous",
"Griffinesque",
"Griffinish",
"Grilled",
"Grim",
"Grindable",
"Grisly",
"Groggy",
"Groovelike",
"Groovy",
"Gross",
"Grotesque",
"Grouchy",
"Groundable",
"Growable",
"Grown",
"GrownUp",
"Grubby",
"Grumpy",
"Grusome",
"Guardable",
"Gubernatorial",
"Guerdon",
"Guessable",
"Guidable",
"Guileless",
"Guiltless",
"Guilty",
"Gullible",
"Gummous",
"Gummy",
"GunMetal",
"GunShy",
"Gushy",
"Gustable",
"Gutless",
"Gutsy",
"Gymnasial",
"Gymnastic",
"Gynephilic",
"Gynophobic",
"Gypsum",
"Habitual",
"Haemophobic",
"HairRaising",
"Hairsplitting",
"Hairy",
"Half",
"HalfAlive",
"HalfAngry",
"HalfAsleep",
"HalfAwake",
"HalfBare",
"HalfBleached",
"HalfBoiled",
"HalfCrazed",
"HalfCrazy",
"HalfDazed",
"HalfDemocratic",
"HalfDestroyed",
"HalfDivine",
"HalfFeminine",
"HalfHypnotised",
"HalfIntellectual",
"HalfIntelligible",
"HalfJoking",
"HalfLiberal",
"HalfLinen",
"HalfMinded",
"HalfPetrified",
"HalfPlayful",
"HalfPleased",
"HalfPleasing",
"HalfRomantic",
"HalfRound",
"HalfSyllabled",
"HalfTheatrical",
"HalfWhite",
"HalfWitted",
"HalfWomanly",
"HalfWoolen",
"Halite",
"Hallowed",
"Hallucinational",
"Hallucinative",
"Hallucinatory",
"Hallucinogenic",
"Halophilic",
"HandDrawn",
"HandHeld",
"Handcrafted",
"Handheld",
"Handmade",
"Handsewn",
"Handsome",
"Handsomeish",
"Handwoven",
"Handwritten",
"Handy",
"Hapless",
"Happy",
"Haptephobic",
"Harassed",
"Hard",
"HardFeatured",
"HardHeaded",
"HardShell",
"HardWorking",
"Hardhearted",
"Harebrained",
"Harlequinesque",
"Harmful",
"Harmless",
"Harmonic",
"Harmonious",
"Harpaxophilic",
"Harsh",
"Hassium",
"Hasteful",
"Hasteless",
"Hasty",
"Hated",
"Hateful",
"Haughty",
"Haunted",
"HawkEyed",
"Hawkish",
"Haywire",
"Hazardous",
"Hazy",
"Head",
"Headless",
"Headstrong",
"Healthful",
"Healthy",
"HeartFree",
"HeartRending",
"HeartStricken",
"HeartWarming",
"HeartWhole",
"Heartaching",
"Heartbreaking",
"Heartbroken",
"Heartfelt",
"Heartless",
"Heartrending",
"Heartsick",
"Heartsickening",
"Heartsore",
"Heated",
"Heathen",
"Heathenish",
"HeavenSent",
"Heavenly",
"Heavy",
"HeavyHearted",
"Heavyset",
"Hedenbergite",
"Hedonistic",
"Heedful",
"Heedless",
"Heinous",
"Heliodor",
"Heliophilic",
"Heliophobic",
"Helminthologic",
"Helminthological",
"Helpful",
"Helpless",
"Hemihedral",
"Hemispheric",
"Hemispherical",
"Hemispheroidal",
"Hemophobic",
"Hemp",
"Hendecagonal",
"Hendecahedral",
"Hendecasyllabic",
"Hennish",
"Heptagonal",
"Heptahedral",
"Heptahedrical",
"Heptasyllabic",
"Herbaceous",
"Herbal",
"Herbicidal",
"Herbivorous",
"Herby",
"Herculean",
"Heretical",
"Hermitic",
"Hermitical",
"Hermitish",
"Hermitlike",
"Heroic",
"Herpetologic",
"Herpetological",
"Herringlike",
"Hesitant",
"Hessian",
"Hexadic",
"Hexaemeric",
"Hexagonal",
"Hexagrammoid",
"Hexahedral",
"Hexakosioihexekontahexaphobic",
"Hexametral",
"Hexametric",
"Hexametrical",
"Hexangular",
"Hexapartite",
"Hexasyllabic",
"Hexed",
"Hick",
"Hidden",
"Hideous",
"Hieroglyphic",
"High",
"HighClass",
"HighExplosive",
"HighSpirited",
"HighSpiritedly",
"Highborn",
"Highbred",
"Highfaluting",
"Highhanded",
"HighlyExplosive",
"Hilarious",
"Hillocked",
"Hillocky",
"Hilly",
"Hip",
"Hippophagous",
"Hippophilic",
"Hippophobic",
"Hippy",
"Hirsutophilic",
"Historic",
"Historical",
"Historied",
"Historiographic",
"Historiographical",
"Hogged",
"Hoggish",
"Hoglike",
"Holistic",
"Hollow",
"Hollowhearted",
"Holographic",
"Holohedral",
"Holy",
"HomeGrown",
"HomeMade",
"Homebred",
"Homebrewed",
"Homeless",
"Homely",
"Homemade",
"Homeopathic",
"Homesick",
"Homespun",
"Homey",
"Homicidal",
"Hominine",
"Hominoid",
"Honest",
"HoneySweet",
"Honeyed",
"Honeyful",
"Honeysuckled",
"Honorary",
"Honorific",
"Honourable",
"Honourless",
"Hopeful",
"Hoplophobia",
"Hopping",
"Horizontal",
"Hormonal",
"HornMad",
"Hornblende",
"Horoscopic",
"Horrendous",
"Horrible",
"Horrid",
"Horrific",
"Horrified",
"Horrifying",
"HorrorStruck",
"Horselike",
"Horseplayful",
"Horsey",
"Horsy",
"Horticultural",
"Hospitable",
"Hostile",
"Hot",
"HotHeaded",
"HotTempered",
"Hotheaded",
"Houndish",
"Houndlike",
"Houndy",
"Huge",
"Hulkingsuperstrong",
"Hulky",
"Human",
"Humane",
"Humanitarian",
"Humanlike",
"Humanoid",
"Humble",
"Humbled",
"Humdrum",
"Humid",
"Humiliated",
"Humoristic",
"Humorous",
"Humourful",
"Humourless",
"Humoursome",
"Hungry",
"Hurried",
"Hurt",
"Hurtful",
"HushHush",
"Hyacinth",
"Hydrated",
"Hydrogen",
"Hydrometallurgical",
"Hydrophilic",
"Hydrophobic",
"Hygenic",
"Hygienic",
"Hygrophilic",
"Hylophagous",
"Hyperactive",
"Hyperallergenic",
"Hyperangelic",
"Hyperangelical",
"Hyperbolic",
"Hyperbrutal",
"Hypercephalic",
"Hyperdemocratic",
"Hyperintelligent",
"Hypermystical",
"Hyperpolysyllabic",
"Hyperprophetic",
"Hyperprophetical",
"Hyperrational",
"Hyperritualistic",
"Hyperromantic",
"Hypersaintly",
"Hypersceptical",
"Hyperscholastic",
"Hypersensitive",
"Hyperspherical",
"Hypersthene",
"Hypervigilant",
"Hypnotic",
"Hypnotised",
"Hypnotizing",
"Hypoactive",
"Hypoallergenic",
"Hypocephalic",
"Hypocritical",
"Hypodermal",
"Hypoglycemic",
"Hypothetical",
"Hysterical",
"Iambic",
"Ice",
"IceCold",
"Icebound",
"Iced",
"Ichthyophagous",
"Ichthyophobic",
"Icicled",
"Icky",
"Iconic",
"Iconophilic",
"Icosahedral",
"Icy",
"Ideal",
"Idealistic",
"Identical",
"Ideological",
"Idiocratic",
"Idiocratical",
"Idiosyncratic",
"Idiotic",
"Idiotproof",
"Idle",
"Idled",
"Idling",
"Igneous",
"Ignitable",
"Igniteable",
"Ignoble",
"Ignorant",
"Ignored",
"Ill",
"IllAdvised",
"IllAffected",
"IllBehaved",
"IllBred",
"IllConsidered",
"IllDefined",
"IllDisposed",
"IllFated",
"IllFavoured",
"IllGotten",
"IllHumoured",
"IllInformed",
"IllJudged",
"IllLooking",
"IllMannered",
"IllNatured",
"IllSorted",
"IllStarred",
"IllSuited",
"IllTempered",
"IllTimed",
"IllWilled",
"Illegal",
"Illegible",
"Illhumored",
"Illicit",
"Illimitable",
"Illiterate",
"Illogical",
"Illtempered",
"Illuminating",
"Illusory",
"Illustrious",
"Imaginative",
"Immaculate",
"Immaterial",
"Immature",
"Immediate",
"Immense",
"Imminent",
"Immobile",
"Immoderate",
"Immolated",
"Immoral",
"Immortal",
"Immovable",
"Immoveable",
"Immune",
"Immunological",
"Imparisyllabic",
"Impassionate",
"Impassioned",
"Impatient",
"Impeccable",
"Impending",
"Imperfect",
"Imperial",
"Imperialistic",
"Imperious",
"Impertinent",
"Impervious",
"Impious",
"Impish",
"Impolite",
"Important",
"Imported",
"Imposing",
"Impossible",
"Impotent",
"Impoverished",
"Imprecise",
"Impregnable",
"Impressed",
"Impressive",
"Improbable",
"Improved",
"Improvident",
"Improvised",
"Imprudent",
"Impudent",
"Impulsive",
"Inaccurate",
"Inadequate",
"Inadvertent",
"Inanimate",
"Inappropriate",
"Inartistic",
"Inattentive",
"Inborn",
"Inbred",
"Incandescent",
"Incapable",
"Incautious",
"Incendiary",
"Incensed",
"Incognisant",
"Incognizant",
"Incoherent",
"Incombustible",
"Incompatible",
"Incompetent",
"Incomplete",
"Incomprehensible",
"Inconclusive",
"Inconsequent",
"Inconsequential",
"Inconsiderate",
"Inconspicuous",
"Inconstant",
"Incontinuous",
"Inconvenient",
"Incorporated",
"Incorporeal",
"Incorrupt",
"Incorruptible",
"Increased",
"Incredible",
"Incredulous",
"Incurable",
"Indecipherable",
"Indecisive",
"Indefatigable",
"Indefinite",
"Independent",
"Indestructible",
"Indicolite",
"Indifferent",
"Indigenous",
"Indigo",
"IndigoBlue",
"Indigoid",
"Indiscreet",
"Indisposed",
"Indistinct",
"Indistinctive",
"Individual",
"Individualistic",
"Indomitable",
"Indoor",
"Industrial",
"Industrialized",
"Industrious",
"Inedible",
"Ineffective",
"Inept",
"Inexistent",
"Inexpensive",
"Inexperienced",
"Inexplosive",
"Inextinguishable",
"Infamous",
"Infantile",
"Infantine",
"Infatuated",
"Infectious",
"Inferior",
"Infertile",
"Infinite",
"Infirm",
"Inflammable",
"Inflatable",
"Influential",
"Influenzal",
"Influenzalike",
"Informal",
"Ingenious",
"Ingenuous",
"Inglorious",
"Inherent",
"Inherited",
"Inhuman",
"Inhumane",
"Initial",
"Injudicious",
"Injured",
"Injurious",
"Inky",
"Inland",
"Inner",
"Innocent",
"Innocuous",
"Innovative",
"Inodorous",
"Inopportune",
"Inorganic",
"Inquiring",
"Inquisitive",
"Insane",
"Insanitary",
"Insectean",
"Insecticidal",
"Insectile",
"Insectival",
"Insectivorous",
"Insectologic",
"Insectological",
"Insecure",
"Insensate",
"Insensible",
"Insensitive",
"Insentient",
"Inseverable",
"Inside",
"Insidious",
"Insignificant",
"Insincere",
"Insipid",
"Insistent",
"Insolent",
"Insomniac",
"Inspirational",
"Instant",
"Institutional",
"Instrumental",
"Insubordinate",
"Insufficient",
"Insulaphilic",
"Insulted",
"Insulting",
"Insured",
"Insurrectional",
"Insurrectionary",
"Intact",
"Intangible",
"Integral",
"Intellectual",
"Intellectualistic",
"Intelligent",
"Intelligible",
"Intense",
"Intensive",
"Interacademic",
"Interartistic",
"Interchurch",
"Interclerical",
"Intercontradictory",
"Intercorporate",
"Intercosmic",
"Intercranial",
"Intercrystalline",
"Interdental",
"Interdestructive",
"Interested",
"Interesting",
"Interfaith",
"Interglacial",
"Interglandular",
"Intergovernmental",
"Interhemispheric",
"Interior",
"Interisland",
"Interlibrary",
"Intermarine",
"Intermediate",
"Intermetallic",
"Internal",
"International",
"Internuclear",
"Interoceanic",
"Interparenthetic",
"Interparenthetical",
"Interplanetary",
"Interreligious",
"Interscholastic",
"Interscience",
"Interspinal",
"Interspinous",
"Intersubjective",
"Interuniversity",
"Intestinal",
"Intimate",
"Intolerable",
"Intolerant",
"Intoxicated",
"Intracardiac",
"Intracranial",
"Intradermal",
"Intragovernmental",
"Intranational",
"Intranuclear",
"Intrapsychic",
"Intraspinal",
"Intravert",
"Intraverted",
"Intravertish",
"Intriguing",
"Introvert",
"Introverted",
"Introvertish",
"Intrusive",
"Invaluable",
"Invasive",
"Inverse",
"Inversive",
"Invigorative",
"Invincible",
"Invisibility",
"Invisible",
"Involuntary",
"Involved",
"Invulnerable",
"Ionic",
"Irascible",
"Irate",
"Iridescent",
"Irksome",
"IronGray",
"IronGrey",
"IronHearted",
"Ironbound",
"Ironclad",
"Ironfisted",
"Ironhanded",
"Ironic",
"Ironical",
"Irradiated",
"Irrational",
"Irrationalist",
"Irrationalistic",
"Irregular",
"Irrelevant",
"Irrepressible",
"Irreproachable",
"Irresistible",
"Irresponsible",
"Irresponsive",
"Irreversible",
"Irritable",
"Irritated",
"Irritating",
"Isinglass",
"Islandish",
"Islandless",
"Islandlike",
"Isleless",
"Isleted",
"Isoceles",
"Isogonal",
"Isogonic",
"Isolated",
"Isopolitical",
"Isotope",
"Itching",
"Itchy",
"IttyBitty",
"Ivory",
"IvoryTowered",
"Jade",
"JadeGreen",
"Jaded",
"Jadeite",
"Jadish",
"Jagged",
"Jaunty",
"Jazzy",
"Jealous",
"JeanLike",
"Jeffersonite",
"Jellied",
"Jestful",
"Jesting",
"Jet",
"JetBlack",
"Jewel",
"Jingoistic",
"Jittery",
"Jobless",
"Jockeyish",
"Jocund",
"Jokeless",
"Joking",
"Jolly",
"Journalary",
"Journalish",
"Journalistic",
"Jovial",
"Joyful",
"Joyless",
"Joyous",
"Jubilant",
"Judgemental",
"Judgmental",
"Judicial",
"Judicious",
"Juice",
"Juiced",
"Juicy",
"Jumping",
"Jumpy",
"Junior",
"Just",
"Jute",
"Juvenal",
"Juvenescent",
"Juvenile",
"Kainolophobic",
"Kainophobic",
"Kakotopic",
"Kaleidoscopic",
"Kamikaze",
"Kaolin",
"Kaolinite",
"Kaput",
"Karmic",
"Katatonic",
"Keen",
"Keraunophobic",
"Ketogenetic",
"Ketogenic",
"Ketonic",
"Key",
"Khaki",
"Kilted",
"Kimberlite",
"Kinaesthetic",
"Kind",
"KindHearted",
"Kindly",
"Kinesthetic",
"Kinetic",
"KingSize",
"Kinglike",
"Kingly",
"Kitschy",
"Kittenish",
"Klepto",
"Kleptomaniac",
"Kleptomanic",
"Klutzy",
"Knavish",
"KneeDeep",
"KneeHigh",
"KneeLength",
"Knightly",
"Knitted",
"Knotted",
"Knotty",
"Knowing",
"Knowledgeable",
"Known",
"Knuckleheaded",
"Kooky",
"Kosher",
"Kunzite",
"Kyanite",
"Laborious",
"Labyrinthine",
"Lace",
"LaceLike",
"Lacertilian",
"Lackadaisical",
"Lacklustre",
"Laconic",
"Lacquer",
"Lacquerware",
"Lacy",
"Ladyish",
"Ladylike",
"Lagging",
"LaissezFaire",
"Lambskin",
"Lambswool",
"Lame",
"Lamentable",
"Laminate",
"Lamproite",
"Lamprophyre",
"LandPoor",
"Lapis",
"Lardy",
"Large",
"LargeHearted",
"LargeScale",
"Largish",
"Larval",
"Larvicidal",
"Larvivorous",
"Last",
"Late",
"Latticed",
"Laudable",
"Lavender",
"Lavish",
"LawAbiding",
"Lawful",
"Lawless",
"Lawlike",
"Lawrencium",
"Lawyerlike",
"Lawyerly",
"Lax",
"Lazuline",
"Lazy",
"Lazyish",
"Leachy",
"Lead",
"Leading",
"Leady",
"Leafed",
"Leaflike",
"Leafy",
"Lean",
"Learned",
"Leather",
"Leathern",
"Leathery",
"LeekGreen",
"Leery",
"Left",
"Leftist",
"Legal",
"Legalistic",
"Legatine",
"Legendary",
"Legged",
"Leggy",
"Legible",
"Legislative",
"Legislatorial",
"Legless",
"Leisurable",
"Leisured",
"Leisureless",
"Lemon",
"Lemonish",
"Lemony",
"Lemuroid",
"Lengthy",
"LeopardPrint",
"Lepidolite",
"Leprous",
"Lethal",
"Lethargic",
"LetterHigh",
"LetterPerfect",
"Lettered",
"Level",
"Lexical",
"Lexicographic",
"Lexicographical",
"Lexicologic",
"Lexicological",
"Lexiconophilic",
"Lexicostatistic",
"Lexicostatistical",
"Lherzolite",
"Liable",
"Liberal",
"Liberalistic",
"Liberated",
"Liberating",
"Libertarian",
"Liberticidal",
"LifeSize",
"Lifeless",
"Light",
"LightHearted",
"Lighted",
"Lightsome",
"Lightweight",
"Lignite",
"Lignivorous",
"Ligyrophobic",
"Likable",
"Like",
"LikeMinded",
"Liked",
"Likely",
"Lilac",
"LilyLivered",
"LilyWhite",
"Limbless",
"Lime",
"Limestone",
"Limitless",
"Limivorous",
"Limnophilic",
"Limpid",
"Limping",
"Limy",
"Linear",
"Linen",
"Lineny",
"Linguistic",
"Linoleum",
"Linty",
"LionHearted",
"Lionesque",
"Lionly",
"Lipophobic",
"Liquid",
"Literal",
"LiteralMinded",
"Literalistic",
"Literary",
"Literate",
"Lithe",
"Lithophilic",
"Little",
"Littlish",
"Live",
"Lively",
"Livid",
"Living",
"Loath",
"Loathful",
"Loathsome",
"Local",
"Locomotive",
"Locomotor",
"Locustal",
"Logical",
"Logophilic",
"Lonely",
"Lonesome",
"Long",
"LongSuffering",
"LongTerm",
"Longish",
"Looney",
"Loony",
"Loopy",
"Lopsided",
"Lost",
"Lousy",
"Loutish",
"Lovable",
"Loveable",
"Lovecraftian",
"Loved",
"Loveless",
"Lovelorn",
"Lovely",
"Loverless",
"Lovesick",
"Lovesome",
"LoveyDovey",
"Loving",
"Low",
"LowCost",
"LowFat",
"LowKey",
"LowSpirited",
"Lowborn",
"Lowbred",
"LowerClass",
"Lowish",
"Lowly",
"Loyal",
"Lucid",
"Lucky",
"Ludicrous",
"Lukewarm",
"Luminescent",
"Luminiferous",
"Luminous",
"Lumpish",
"Lumpy",
"Lunar",
"Lunatic",
"Lunies",
"Lunisolar",
"Luny",
"Lupine",
"Luscious",
"Lush",
"Lustered",
"Lustrous",
"Luxuriant",
"Luxurious",
"Lycanthropic",
"Lygophilic",
"Lygophobic",
"Lying",
"Lyrical",
"Macabre",
"Machiavellian",
"Macho",
"Macrobiotic",
"Macroclimatic",
"Macroeconomic",
"Macroeconomical",
"Macronuclear",
"Macroscopic",
"Mad",
"Maddening",
"Maddish",
"Magenta",
"Magic",
"Magical",
"Magnanimous",
"Magnesial",
"Magnesian",
"Magnesic",
"Magnesium",
"Magnetic",
"Magnific",
"Magnificent",
"Mahogany",
"Maimouphilic",
"Main",
"Maize",
"Majestic",
"Major",
"Makeshift",
"Malacologic",
"Malacological",
"Maladroit",
"Malcontent",
"Male",
"Maleficent",
"Malevolent",
"Malicious",
"Malignant",
"Maligned",
"Malleable",
"Malnourished",
"Malodorous",
"Malophilic",
"Mammalian",
"Mammalogical",
"Mammoth",
"ManMade",
"Managerial",
"Managing",
"Maniacal",
"Manic",
"ManicDepressive",
"Manipulable",
"Manipulative",
"Manlike",
"Manly",
"Mannerly",
"Marauding",
"Marble",
"Marginal",
"Marine",
"Marital",
"Maritime",
"Marked",
"Marmatite",
"Maroon",
"Married",
"Marshlike",
"Marshy",
"Marvellous",
"Masculine",
"Masochistic",
"Masonic",
"Massive",
"Master",
"Masterful",
"Masticated",
"Material",
"Materialistic",
"Maternal",
"Maternalistic",
"Mathematical",
"Matriarchal",
"Matriarchic",
"Matricidal",
"Matrilateral",
"Matrilineal",
"Matrimonial",
"Matronal",
"Matronly",
"Mature",
"Maudlin",
"Mauve",
"Maximum",
"Maxixe",
"Mazelike",
"Meagre",
"Mean",
"Meaningful",
"Meaningless",
"Meanspirited",
"Measled",
"Measly",
"Meaty",
"Mechanical",
"Mechanistic",
"Meddlesome",
"Mediaeval",
"Medical",
"Medicinal",
"Medicore",
"Medium",
"MediumSized",
"Meek",
"Mega",
"Megacephalic",
"Megalomaniacal",
"Megamalophilic",
"Meitnerium",
"Melancholy",
"Melissophobic",
"Melittologic",
"Melittological",
"Mellow",
"Melodic",
"Melodious",
"Melodramatic",
"Melting",
"Mendelevium",
"Menial",
"Mental",
"Mercantile",
"Mercenary",
"Merciful",
"Mercurial",
"Mere",
"Meritocrat",
"Meritocratic",
"Merry",
"Mesodermal",
"Mesodermic",
"Messianic",
"Messy",
"Metal",
"Metalled",
"Metallic",
"Metalliferous",
"Metalline",
"Metallographic",
"Metallographical",
"Metamathematical",
"Metamorphic",
"Metamorphous",
"Metaphoric",
"Metaphorical",
"Metaphysical",
"Metapsychological",
"Metazoic",
"Metempsychic",
"Metempsychosic",
"Metempsychosical",
"Meteorographic",
"Meteorological",
"Meteoropathologic",
"Meticulous",
"Metrophilic",
"Metropolitan",
"Mettlesome",
"Mica",
"Microbial",
"Microbian",
"Microbic",
"Microbicidal",
"Microbiologic",
"Microbiological",
"Microbiophobic",
"Microclimatic",
"Microclimatologic",
"Microclimatological",
"Microcosmic",
"Microcosmical",
"Microcystalline",
"Microeconomic",
"Microeconomical",
"Microphysical",
"Microscopic",
"Mid",
"Middle",
"MiddleClass",
"Mighty",
"Mild",
"Militant",
"Militaristic",
"Military",
"MilkLivered",
"MilkWhite",
"Milky",
"Minced",
"Mindful",
"Mindless",
"Mineralogic",
"Mineralogical",
"Mini",
"Miniature",
"Minimal",
"Minimum",
"Miniscule",
"Ministerial",
"Minor",
"Minuscular",
"Minute",
"Miraculous",
"Mirky",
"Mirthful",
"Miry",
"Misandrist",
"Misandrous",
"Misanthropic",
"Miscellaneous",
"Mischievous",
"Miscreant",
"Miserable",
"Miserly",
"Misleading",
"Misogynic",
"Misogynistic",
"Misogynous",
"Missing",
"Mistrustful",
"Misty",
"Misunderstood",
"Mobile",
"Moderate",
"Modern",
"Modernistic",
"Modest",
"Modish",
"Moist",
"Moistful",
"Moldavite",
"Molecular",
"Moleskin",
"Molybdenite",
"Momentary",
"Monarchal",
"Monarchical",
"Monarchist",
"Monarchistic",
"Monetary",
"MoneyGrubbing",
"Monkeyish",
"Monochromatic",
"Monochrome",
"Monocultural",
"Monodramatic",
"Monogamous",
"Monolithic",
"Monometallic",
"Mononuclear",
"Monophagous",
"Monosyllabic",
"Monotonous",
"Monstrous",
"Monumental",
"Moody",
"Moonish",
"Moonlit",
"Moonstone",
"Moonwalking",
"Moony",
"Mopey",
"Moral",
"Morbid",
"Moronic",
"Morose",
"Mossy",
"Motherly",
"Motionless",
"Moudly",
"Mountable",
"Mountainous",
"Mousey",
"Mousy",
"Moving",
"Mucky",
"Mudbrick",
"Muddled",
"Muddy",
"Multicoloured",
"Multicystalline",
"Multilineal",
"Multilinear",
"Multimetallic",
"Multinuclear",
"Multipurpose",
"Mundane",
"Murderous",
"Murky",
"Muscovite",
"Mushroomy",
"Mushy",
"Musical",
"Musicianly",
"Musicological",
"Musophobic",
"Mustard",
"Mutant",
"Mutated",
"Mutinous",
"Mutual",
"Muzzled",
"Mycologic",
"Mycological",
"Mycophagous",
"Myocardial",
"Myopic",
"Myrmecological",
"Myrmecophagous",
"Myrmecophilic",
"Myrmecophilous",
"Myrtle",
"Mysophobic",
"Mysterious",
"Mystical",
"Mythical",
"Mythoclastic",
"Mythological",
"Mythopoeic",
"Naggish",
"Naggy",
"Naive",
"Naptunium",
"Narcissistic",
"Narcistic",
"Narcoleptic",
"Narrow",
"Nasty",
"Natant",
"Natatorial",
"Natatory",
"National",
"Nationalistic",
"Native",
"Natural",
"Naughty",
"Nauseating",
"Nauseous",
"Nautical",
"Naval",
"Navy",
"Near",
"NearSighted",
"Nearby",
"Nearsighted",
"Neat",
"Nebulous",
"Necessary",
"Necromantic",
"Necromantical",
"Necrophagous",
"Necrophobic",
"Necropolitan",
"Necrotic",
"Needless",
"Needy",
"Negative",
"Neglectful",
"Negligent",
"Neighbourly",
"Nematologic",
"Nematological",
"Nemophilic",
"Neofascist",
"Neon",
"Neophilic",
"Neophobic",
"Nepheline",
"Nephelite",
"Nephrite",
"Nepotic",
"Nepotistic",
"Nepotistical",
"Nerdy",
"Nervous",
"Nettlesome",
"Neuroeconomic",
"Neuroeconomical",
"Neurological",
"Neurotic",
"Neutered",
"Neutral",
"Neutralizing",
"New",
"NewRich",
"Newborn",
"Newspaperish",
"Newsworthy",
"Newsy",
"Next",
"Nice",
"Nickel",
"Nickelic",
"Nickeliferous",
"Nickelous",
"Nifty",
"Niggling",
"Nightmarish",
"Nihilistic",
"Nimble",
"Nirvanic",
"Nitpicking",
"Nitro",
"Nitrophilic",
"Nobelium",
"Noble",
"NobleMinded",
"Nocturnal",
"Noetic",
"Noir",
"Nomadic",
"Nomophobic",
"NonMoving",
"NonTraditional",
"Nonabsolute",
"Nonabsolutistic",
"Nonacademic",
"Nonacademical",
"Nonacculturated",
"Nonagrarian",
"Nonagricultural",
"Nonalgebraic",
"Nonalgebraical",
"Nonallergenic",
"Nonangelic",
"Nonartistic",
"Nonartistical",
"Nonblack",
"Noncapitalistic",
"Noncarcinogenic",
"Noncarnivorous",
"Nonchalant",
"Nonchurched",
"Nonchurchgoing",
"Noncollinear",
"Noncontinuous",
"Noncontradictory",
"Noncorporate",
"Noncorporative",
"Noncreative",
"Noncriminal",
"Noncrystalline",
"Noncrystallised",
"Noncrystallising",
"Noncultural",
"Noncultured",
"Nondeadly",
"Nondecasyllabic",
"Nondemocratic",
"Nondemocratical",
"Nondenominational",
"Nondeodorizing",
"Nondescript",
"Nondesirous",
"Nondespotic",
"Nondestructive",
"Nondifficult",
"Nondiplomatic",
"Nondramatic",
"Noneconomical",
"Noneducable",
"Noneducational",
"Nonempty",
"Nonessential",
"Nonevolutional",
"Nonevolutionary",
"Nonevolving",
"Nonexistent",
"Nonexistential",
"Nonexisting",
"Nonexperimental",
"Nonfalsifiable",
"Nonfat",
"Nonfatal",
"Nonfinancial",
"Nonfireproof",
"Nonflammable",
"Nonfragrant",
"Nongeometric",
"Nongeometrical",
"Nonglacial",
"Nongreen",
"Nonhazardous",
"Nonhistoric",
"Nonhistorical",
"Nonincorporated",
"Nonincorporative",
"Nonintrospective",
"Nonintroversive",
"Nonintroverted",
"Noninvincible",
"Nonirrational",
"Nonlegal",
"Nonlegislative",
"Nonlineal",
"Nonlinear",
"Nonliteral",
"Nonliterary",
"Nonliving",
"Nonluminous",
"Nonmagnetic",
"Nonmathematic",
"Nonmathematical",
"Nonmedicable",
"Nonmedical",
"Nonmedicative",
"Nonmelodramatic",
"Nonmercenary",
"Nonmetallic",
"Nonmetalliferous",
"Nonmetallurgic",
"Nonmetallurgical",
"Nonmonarchal",
"Nonmonarchial",
"Nonmonarchic",
"Nonmonarchistic",
"Nonmystic",
"Nonmystical",
"Nonmythical",
"Nonmythologic",
"Nonmythological",
"Nonnational",
"Nonnationalistic",
"Nonobjective",
"Nonobjectivistic",
"Nonodoriferous",
"Nonodorous",
"Nonorganic",
"Nonpartisan",
"Nonphilosophic",
"Nonphilosophical",
"Nonplanetary",
"Nonpoisonous",
"Nonpolitical",
"Nonpriestly",
"Nonprogressive",
"Nonproift",
"Nonprophetic",
"Nonprophetical",
"Nonpsychiatric",
"Nonpsychic",
"Nonpsychical",
"Nonpsychoanalytic",
"Nonpsychoanalytical",
"Nonpsychologic",
"Nonpsychological",
"Nonpsychopathic",
"Nonpsychotic",
"Nonrational",
"Nonrationalised",
"Nonrationalistic",
"Nonrationalistical",
"Nonrectangular",
"Nonreligious",
"Nonritualistic",
"Nonromantic",
"Nonround",
"Nonroyal",
"Nonscholarly",
"Nonscholastic",
"Nonscholastical",
"Nonscientific",
"Nonsecular",
"Nonsensical",
"Nonsentient",
"Nonskeptic",
"Nonskeptical",
"Nonsolar",
"Nonsolicitous",
"Nonspheral",
"Nonspheric",
"Nonspherical",
"Nonspinal",
"Nonspiny",
"Nonspirited",
"Nonspiritous",
"Nonspiritual",
"Nonspirituous",
"Nonstick",
"Nonsticky",
"Nonstop",
"Nonsubjective",
"Nonterrestrial",
"Nonterritorial",
"Nontheatric",
"Nontheatrical",
"Nontheocratic",
"Nontheocratical",
"Nontheologic",
"Nontheological",
"Nontoxic",
"Nontrigonometric",
"Nontrigonometrical",
"Nonvacant",
"Nonvagrant",
"Nonvaluable",
"Nonvalued",
"Nonzoologic",
"Nonzoological",
"Normal",
"Northbound",
"Northeastern",
"Northern",
"Northernmost",
"Northmost",
"Northwestern",
"Nosey",
"Nosophobic",
"Nostalgic",
"Nosy",
"Notable",
"Notaphilic",
"Noteworthy",
"Notorious",
"Novel",
"Novice",
"Nubuck",
"Nuclear",
"Nude",
"Numb",
"Numbing",
"Numeric",
"Numerical",
"Nuptial",
"Nutbrown",
"Nutlike",
"Nutritional",
"Nutritious",
"Nutty",
"Nyctophilic",
"Nyctophobic",
"Nylon",
"OAFISH",
"OBEDIENT",
"OBELISKOID",
"OBESE",
"OBJECTIVE",
"OBLIVIOUS",
"OBLONG",
"OBNOXIOUS",
"OBSCENE",
"OBSEQUIOUS",
"OBSERVANT",
"OBSESSIVE",
"OBSIDIAN",
"OBSOLETE",
"OBTUSE",
"OBVIOUS",
"OCCASIONAL",
"OCCUPATIONAL",
"OCEANGOING",
"OCEANIC",
"OCEANLIKE",
"OCEANOGRAPHIC",
"OCEANOGRAPHICAL",
"OCHRE",
"OCTAGONAL",
"OCTAHEDRAL",
"ODD",
"ODIOUS",
"ODORFUL",
"ODORIFEROUS",
"ODOROUS",
"ODOURFUL",
"ODOURLESS",
"OFFCOLOUR",
"OFFBEAT",
"OFFENDED",
"OFFENSIVE",
"OFFICIAL",
"OGREISH",
"OILY",
"OK",
"OKAY",
"OLD",
"OLDFASHIONED",
"OLERICULTURAL",
"OLFACTOPHOBIC",
"OLIGOANTIGENIC",
"OLIVE",
"OLIVINE",
"OLYMPIC",
"OMBROPHILIC",
"OMBROPHOBIC",
"OMINOUS",
"OMNIPOTENT",
"OMNIPRESENT",
"OMNISCIENT",
"OMNIVOROUS",
"OMPHACITE",
"ONDONTOPHOBIC",
"ONEROUS",
"ONIONY",
"ONLY",
"ONYX",
"OOZY",
"OPAL",
"OPEN",
"OPENMINDED",
"OPERATIC",
"OPERATIONAL",
"OPEROSE",
"OPHIDIOPHILIC",
"OPHIDIOPHOBIC",
"OPHIOPHILIC",
"OPHTHALMOLOGICAL",
"OPINIONATED",
"OPPOSITE",
"OPPRESSED",
"OPPRESSIVE",
"OPTIC",
"OPTICAL",
"OPTIMAL",
"OPTIMISTIC",
"OPTOMETRIC",
"OPTOMETRICAL",
"ORANGE",
"ORCHESTRAL",
"ORCISH",
"ORDINARY",
"ORE",
"ORGANIC",
"ORGANISATIONAL",
"ORGANIZATIONAL",
"ORGANOACTINOID",
"ORGANOMETALLIC",
"ORIENTAL",
"ORIGINAL",
"ORIGINATIVE",
"ORNAMENTAL",
"ORNATE",
"ORNERY",
"ORNITHOLOGIC",
"ORNITHOLOGICAL",
"ORNITHOPHILIC",
"ORNITHOPHOBIC",
"ORTHOCLASE",
"ORTHODONTIC",
"ORTHODOX",
"ORTHOGONAL",
"ORYZIVOROUS",
"OSCITANT",
"OSMOPHILIC",
"OSMOPHOBIC",
"OSSIVOROUS",
"OSTENTATIOUS",
"OSTRACIZED",
"OTHER",
"OTHERWORLDLY",
"OUTDOOR",
"OUTDOORSY",
"OUTER",
"OUTGOING",
"OUTRAGED",
"OUTRAGEOUS",
"OUTSIDE",
"OUTSTANDING",
"OVAL",
"OVERAGGRESSIVE",
"OVERBEARING",
"OVERBIG",
"OVERBRUTAL",
"OVERBURDENED",
"OVERCONFIDENT",
"OVERCONSERVATIVE",
"OVERCONSTANT",
"OVERCOOKED",
"OVERCULTURED",
"OVERCURIOUS",
"OVERDESIROUS",
"OVERDESTRUCTIVE",
"OVERDRAMATIC",
"OVERDRY",
"OVEREMOTIONAL",
"OVEREMPTY",
"OVERFAITHFUL",
"OVERGROWN",
"OVERHAUGHTY",
"OVERHOSTILE",
"OVERJOYED",
"OVERJOYFUL",
"OVERJOYOUS",
"OVERLIBERAL",
"OVERLITERARY",
"OVERLUXURIANT",
"OVERLUXURIOUS",
"OVERNOBLE",
"OVERPARTICULAR",
"OVERPOLITICAL",
"OVERPRICED",
"OVERRATED",
"OVERRATIONAL",
"OVERRELIGIOUS",
"OVERSEAS",
"OVERSIZE",
"OVERSKEPTICAL",
"OVERSOLEMN",
"OVERTHEATRICAL",
"OVERVIGOROUS",
"OVERWEAK",
"OVERWEALTHY",
"OVERWEIGHT",
"OVERWHELMING",
"OVERZEALOUS",
"OXYGEN",
"OXYMORONIC",
"PACHYDERMAL",
"PACHYDERMATOUS",
"PACHYDERMIC",
"PACHYDERMOID",
"PACHYDERMOUS",
"PACIFIED",
"PACIFIST",
"PACIFISTIC",
"PADPARADSCHA",
"PAEDIATRIC",
"PAGAN",
"PAGANIST",
"PAGANISTIC",
"PAINFUL",
"PAINSTAKING",
"PAINTED",
"PALAEOBIOLOGIC",
"PALAEOBIOLOGICAL",
"PALAEOBOTANIC",
"PALAEOBOTANICAL",
"PALAEOCLIMATOLOGIC",
"PALAEOCLIMATOLOGICAL",
"PALAEOECOLOGIC",
"PALAEOECOLOGICAL",
"PALAEOLOGICAL",
"PALAEOPHILIC",
"PALAEOZOOLOGIC",
"PALAEOZOOLOGICAL",
"PALE",
"PALEOBIOLOGIC",
"PALEOBIOLOGICAL",
"PALEOCLIMATOLOGIC",
"PALEOCLIMATOLOGICAL",
"PALEOECOLOGIC",
"PALEOECOLOGICAL",
"PALEOGEOLOGIC",
"PALEOGRAPHIC",
"PALEOGRAPHICAL",
"PALEOGROGRAPHICAL",
"PALEOLITHIC",
"PALEOLOGICAL",
"PALEOPSYCHIC",
"PALEOPSYCHOLOGICAL",
"PALEOZOOLOGIC",
"PALEOZOOLOGICAL",
"PALISH",
"PALLID",
"PANCRATIC",
"PANCREATIC",
"PANICKY",
"PANORAMIC",
"PANPHOBIC",
"PANPSYCHIC",
"PANPSYCHISTIC",
"PAPER",
"PAPERSHELLED",
"PAPERY",
"PAPYRACEOUS",
"PAPYRAL",
"PARADOXAL",
"PARADOXICAL",
"PARAFFIN",
"PARAGONIT",
"PARAGONITA",
"PARAGONITE",
"PARALLEL",
"PARALYSED",
"PARALYTIC",
"PARALYZED",
"PARALYZING",
"PARAMEDICAL",
"PARAMILITANT",
"PARAMILITARISTIC",
"PARAMILITARY",
"PARAMOUNT",
"PARANOIAC",
"PARANOID",
"PARANORMAL",
"PARAPSYCHOLOGICAL",
"PARASITIC",
"PARASITICIDAL",
"PARASKAVEDEKATRIAPHOBIC",
"PARASKAVIDEKATRIAPHOBIC",
"PARENTHETIC",
"PARENTHETICAL",
"PARISYLLABIC",
"PARLIAMENTARY",
"PAROCHIAL",
"PAROCHIALIST",
"PARODIC",
"PARODISTIC",
"PARSIMONIOUS",
"PARTTIME",
"PARTIAL",
"PARTICULAR",
"PARTLYCOLOURED",
"PASSIONATE",
"PASSIVE",
"PASTORAL",
"PASTY",
"PASTYFACED",
"PATCHWORK",
"PATCHY",
"PATERNAL",
"PATHETIC",
"PATHWORKY",
"PATIENT",
"PATRIARCHAL",
"PATRIARCHIC",
"PATRIARCHICAL",
"PATRICIAN",
"PATRICIDAL",
"PATRILATERAL",
"PATRILINEAL",
"PATRIOTIC",
"PATRONAL",
"PATRONISING",
"PATRONIZING",
"PATTERN",
"PATTERNED",
"PATTERNY",
"PEACEABLE",
"PEACEFUL",
"PEACH",
"PEACHY",
"PEACOCKISH",
"PEACOCKY",
"PEAR",
"PEARL",
"PEARLIZED",
"PEARLY",
"PEAT",
"PEBBLEDASHED",
"PEBBLY",
"PECKISH",
"PECULIAR",
"PEDAGOGIC",
"PEDAGOGICAL",
"PEDAGOGISH",
"PEDAGOGUISH",
"PEDANTIC",
"PEDIATRIC",
"PEDIOPHOBIC",
"PEDOPHOBIC",
"PEERLESS",
"PEEVISH",
"PEEWEE",
"PEGMATITE",
"PELAGE",
"PENNILESS",
"PENNYPINCHING",
"PENNYWISE",
"PENSIVE",
"PENTAGONAL",
"PENTAGONOID",
"PENTANGULAR",
"PENTASYLLABIC",
"PEPPERISH",
"PEPPERY",
"PEPPY",
"PERCEPTIVE",
"PERFECT",
"PERFUMY",
"PERICARDIAL",
"PERICRANIAL",
"PERIDENTAL",
"PERIDOT",
"PERIDOTITE",
"PERIGLACIAL",
"PERILOUS",
"PERISPHERIC",
"PERISPHERICAL",
"PERISTEROPHILIC",
"PERIWINKLE",
"PERIWINKLED",
"PERKISH",
"PERKY",
"PERLUCIN",
"PERMANENT",
"PERMIER",
"PERNICIOUS",
"PERNICKETY",
"PEROVSKITE",
"PERPENDICULAR",
"PERPETUAL",
"PERPLEXED",
"PERSEVERANT",
"PERSEVERING",
"PERSIMMON",
"PERSISTENT",
"PERSNICKETY",
"PERSONAL",
"PERSPICACIOUS",
"PERSUASIVE",
"PESCATARIAN",
"PESKY",
"PESSIMISTIC",
"PESTERSOME",
"PESTICIDAL",
"PESTILENT",
"PETALED",
"PETALINE",
"PETALLED",
"PETALLESS",
"PETALOUS",
"PETIT",
"PETITBOURGEOIS",
"PETITE",
"PETRIFIED",
"PETROPHILIC",
"PETTIFOGGING",
"PETTISH",
"PETTY",
"PETULANT",
"PHAGOPHOBIC",
"PHANEROCYSTALLINE",
"PHANTASMAGORIAL",
"PHANTASMAGORIAN",
"PHANTASMAGORIC",
"PHANTASMAGORICAL",
"PHANTASMAL",
"PHANTASTIC",
"PHANTASTICAL",
"PHANTOMLIKE",
"PHANTOMLIKE",
"PHARMACEUTICAL",
"PHARMACOLOGIC",
"PHARMACOLOGICAL",
"PHENOCRYST",
"PHENOMENAL",
"PHILALETHIC",
"PHILANTHROPIC",
"PHILHARMONIC",
"PHILOLOGIC",
"PHILOLOGICAL",
"PHILOSOPHICAL",
"PHLEGMY",
"PHLOGOPITE",
"PHOBIC",
"PHOBOPHOBIC",
"PHONOLITE",
"PHONOPHOBIC",
"PHONY",
"PHOSPHORESCENT",
"PHOSPHORUS",
"PHOTODRAMATIC",
"PHOTOGRAPHIC",
"PHOTOLUMINESCENT",
"PHOTONUCLEAR",
"PHOTOPHILIC",
"PHOTOPHOBIC",
"PHOTOSENSITIVE",
"PHYSICAL",
"PHYSIOLOGICAL",
"PHYTOCLIMATOLOGIC",
"PHYTOCLIMATOLOGICAL",
"PHYTOPHILIC",
"PICKLED",
"PICKY",
"PICTORIAL",
"PICTURAL",
"PICTURESQUE",
"PIECEMEAL",
"PIERCING",
"PIGEONHEARTED",
"PIGEONITE",
"PIGGISH",
"PIGISH",
"PILFERED",
"PILLARED",
"PILOTABLE",
"PINE",
"PINELIKE",
"PINK",
"PINKISH",
"PINTSIZE",
"PINY",
"PIOUS",
"PIPERACEOUS",
"PIRATIC",
"PIRATICAL",
"PISCATORIAL",
"PISCATORY",
"PISCICULTURAL",
"PISCIFORM",
"PISCINE",
"PISCIVOROUS",
"PISIFORM",
"PITCHBLACK",
"PITCHDARK",
"PITEOUS",
"PITHIKOSOPHILIC",
"PITIFUL",
"PIXILATED",
"PIXYISH",
"PLACID",
"PLAGIHEDRAL",
"PLAID",
"PLAIDED",
"PLAIN",
"PLANETARY",
"PLANETOIDAL",
"PLANISPHERICAL",
"PLANKTOLOGIC",
"PLANKTOLOGICAL",
"PLANTSEMIORGANIC",
"PLASTER",
"PLASTERED",
"PLASTERY",
"PLASTIC",
"PLATONIC",
"PLAUSIBLE",
"PLAYFUL",
"PLEASABLE",
"PLEASANT",
"PLEASED",
"PLEASING",
"PLEASURABLE",
"PLEASURESEEKING",
"PLEASUREFUL",
"PLUCKY",
"PLUGUGLY",
"PLUMP",
"PLURILITERAL",
"PLUSH",
"PLUSHED",
"PLUTONIUM",
"POACHABLE",
"POCKMARKED",
"POETIC",
"POGONOPHILIC",
"POINTLESS",
"POISONED",
"POISONOUS",
"POKEABLE",
"POLAR",
"POLARIZED",
"POLISHED",
"POLITE",
"POLITICAL",
"POLKADOTTED",
"POLLOTARIAN",
"POLLUTED",
"POLONIUM",
"POLYCYSTALLINE",
"POLYESTER",
"POLYGONAL",
"POLYHEDRAL",
"POLYHISTORIC",
"POLYMORPHONUCLEAR",
"POLYNUCLEAR",
"POLYPHAGOUS",
"POLYSYLLABIC",
"POMPOUS",
"POOR",
"POORSPIRITED",
"POORLY",
"POPULAR",
"PORCELAIN",
"PORCINE",
"PORKY",
"POROUS",
"PORTABLE",
"PORTLY",
"PORTRAYABLE",
"POSITIVE",
"POSSESSIVE",
"POSSIBLE",
"POSTAPOCALYPTIC",
"POSTMODERN",
"POSTWAR",
"POSTAL",
"POSTARTHRITIC",
"POSTCARDIAC",
"POSTDENTAL",
"POSTGLACIAL",
"POSTINDUSTRIAL",
"POSTLEGAL",
"POSTPERICARDIAL",
"POSTPROPHETIC",
"POSTSCHOLASTIC",
"POTBELLIED",
"POTBELLIED",
"POTENT",
"POTENTIAL",
"POTTY",
"POVERTYSTRICKEN",
"POWDERBLUE",
"POWDERY",
"POWELLITE",
"POWERFUL",
"PRACTICAL",
"PRAGMATIC",
"PREEXISTENT",
"PREACHY",
"PREAGRICULTURAL",
"PREALGEBRAIC",
"PREARTISTIC",
"PREBELOVED",
"PREBRONZE",
"PRECAMBRIAN",
"PRECAPITALISTIC",
"PRECARDIAC",
"PRECARNIVAL",
"PRECIOUS",
"PRECISE",
"PRECOLOURABLE",
"PRECOSMIC",
"PRECOSMICAL",
"PRECRANIAL",
"PRECRYSTALLINE",
"PRECULTURAL",
"PREDACIOUS",
"PREDATORY",
"PREDESIROUS",
"PREDESPONDENT",
"PREDESTITUTE",
"PREDETERMINATE",
"PREDETERMINATIVE",
"PREDICATABLE",
"PREDICTIVE",
"PREDIPLOMATIC",
"PREDISASTROUS",
"PREDOMINANT",
"PREDRAMATIC",
"PREECONOMIC",
"PREECONOMICAL",
"PREEVOLUTIONAL",
"PREFERRED",
"PREFINANCIAL",
"PREFRIENDLY",
"PREGGERS",
"PREGLACIAL",
"PREGNANT",
"PREHISTORIC",
"PRELAWFUL",
"PRELEGAL",
"PRELEGISLATIVE",
"PRELIMINARY",
"PRELITERARY",
"PRELITERATE",
"PRELUXURIOUS",
"PREMATURE",
"PREMEDICAL",
"PREMIUM",
"PREMOLAR",
"PREMONARCHAL",
"PREMONARCHIAL",
"PREMONARCHICAL",
"PREMYTHICAL",
"PRENATAL",
"PRENATIONAL",
"PREOBJECTIVE",
"PREOCCUPIED",
"PREOCEANIC",
"PREODOROUS",
"PREPOLITICAL",
"PREPSYCHOLOGICAL",
"PREPUBESCENT",
"PRERATIONAL",
"PREREGAL",
"PREROMANTIC",
"PREROYAL",
"PRESCIENT",
"PRESCIENTIFIC",
"PRESECULAR",
"PRESENTIENT",
"PRESHRUNK",
"PRESIDENTIAL",
"PRESOLAR",
"PRESPINAL",
"PRESTIGIOUS",
"PRESUMPTUOUS",
"PRETENTIOUS",
"PRETERLEGAL",
"PRETERRESTRIAL",
"PRETTIED",
"PRETTY",
"PRETTYING",
"PRETTYISH",
"PREVIGILANT",
"PREVIOUS",
"PRICELESS",
"PRICEY",
"PRICKLY",
"PRIDEFUL",
"PRIESTLESS",
"PRIESTLY",
"PRIGGISH",
"PRIM",
"PRIMAEVAL",
"PRIMARY",
"PRIMATOLOGIC",
"PRIMATOLOGICAL",
"PRIME",
"PRIMITIVE",
"PRIMORDIAL",
"PRINCELY",
"PRINCIPAL",
"PRINTED",
"PRIOR",
"PRISMATIC",
"PRISSY",
"PRISTINE",
"PRIVATE",
"PRIVATIZED",
"PRIVILEGED",
"PRIVY",
"PROABOLITION",
"PROABSOLUTISM",
"PROABSOLUTIST",
"PROACADEMIC",
"PROAGRARIAN",
"PROBABLE",
"PROCAPITALISM",
"PROCHURCH",
"PROCLERGY",
"PROCLERICAL",
"PRODEMOCRAT",
"PRODEMOCRATIC",
"PRODUCTIVE",
"PROFASCIST",
"PROFESSIONAL",
"PROFICIENT",
"PROFITABLE",
"PROFOUND",
"PROGRESSIVE",
"PROLIFIC",
"PROMETHEAN",
"PROMINENT",
"PROMISING",
"PROMONARCHY",
"PRONATIONALIST",
"PRONATIONALISTIC",
"PROPER",
"PROPHESIABLE",
"PROPHETIC",
"PROPOLITICS",
"PROPORTIONABLE",
"PROPORTIONAL",
"PROPORTIONED",
"PROPOSED",
"PROROMANTIC",
"PROSAIC",
"PROSCHOLASTIC",
"PROSCIENCE",
"PROSCIENTIFIC",
"PROSELYTICAL",
"PROSELYTISTIC",
"PROSPEROUS",
"PROTACTIUM",
"PROTECTED",
"PROTECTIVE",
"PROTOZOOLOGICAL",
"PROUD",
"PROUNIVERSITY",
"PROVINCIAL",
"PRUDENT",
"PRUDISH",
"PSEUDOACADEMIC",
"PSEUDOANAEMIC",
"PSEUDOANGELIC",
"PSEUDOANGELICAL",
"PSEUDOARTISTIC",
"PSEUDOCONSERVATIVE",
"PSEUDOCRYSTALLINE",
"PSEUDOCULTURAL",
"PSEUDODEMOCRATIC",
"PSEUDODIVINE",
"PSEUDODRAMATIC",
"PSEUDOECONOMICAL",
"PSEUDOFAITHFUL",
"PSEUDOHEXAGONAL",
"PSEUDOHISTORIC",
"PSEUDOHISTORICAL",
"PSEUDOINSANE",
"PSEUDOLEGAL",
"PSEUDOLEGISLATIVE",
"PSEUDOLIBERAL",
"PSEUDOLITERARY",
"PSEUDOMEDICAL",
"PSEUDOMYTHICAL",
"PSEUDONATIONAL",
"PSEUDONOBLE",
"PSEUDOPOLITICAL",
"PSEUDOPRIESTLY",
"PSEUDOPROPHETIC",
"PSEUDOPROPHETICAL",
"PSEUDOPSYCHOLOGICAL",
"PSEUDOREGAL",
"PSEUDORELIGIOUS",
"PSEUDORHOMBOHEDRAL",
"PSEUDOROMANTIC",
"PSEUDOROYAL",
"PSEUDOSCHOLARLY",
"PSEUDOSCHOLASTIC",
"PSEUDOSCIENTIFIC",
"PSEUDOSPIRITUAL",
"PSEUDOTETRAGONAL",
"PSEUDOZOOLOGICAL",
"PSYCHASTHENIC",
"PSYCHEDELIC",
"PSYCHIATRIC",
"PSYCHIATRICAL",
"PSYCHIC",
"PSYCHOACTIVE",
"PSYCHOANALYTIC",
"PSYCHOANALYTICAL",
"PSYCHODELIC",
"PSYCHODIAGNOSTIC",
"PSYCHOGENIC",
"PSYCHOGRAPHIC",
"PSYCHOLOGICAL",
"PSYCHOMETRIC",
"PSYCHOMETRICAL",
"PSYCHONEUROTIC",
"PSYCHOPATHIC",
"PSYCHOPATHOLOGIC",
"PSYCHOPATHOLOGICAL",
"PSYCHOPHARMACOLOGICAL",
"PSYCHOPHOBIC",
"PSYCHOSOCIAL",
"PSYCHOSOMATIC",
"PSYCHOTHERAPEUTIC",
"PSYCHOTIC",
"PSYCHOTROPIC",
"PSYCHROPHILIC",
"PUBESCENT",
"PUBLIC",
"PUBLICIZED",
"PUDGY",
"PUERILE",
"PUFFY",
"PUGNACIOUS",
"PUMICE",
"PUMPKIN",
"PUNCTILIOUS",
"PUNCTUAL",
"PUNY",
"PUPPYISH",
"PUPPYLIKE",
"PURE",
"PUREHEARTED",
"PUREBRED",
"PURGATORIAL",
"PURITANICAL",
"PURPLE",
"PURPLISH",
"PURPLY",
"PURPOSEFUL",
"PURPOSELESS",
"PUSSLIKE",
"PUTRID",
"PUZZLED",
"PUZZLING",
"PYGMY",
"PYGMYISH",
"PYRITE",
"PYROCRYSTALLINE",
"PYROPHOBIC",
"PYROXENE",
"QUAINT",
"QUALIFIED",
"QUARRELSOME",
"QUARTERWITTED",
"QUARTZ",
"QUARTZIFEROUS",
"QUARTZITIC",
"QUASIABSOLUTE",
"QUASIACADEMIC",
"QUASIANGELIC",
"QUASIARTISTIC",
"QUASIBRONZE",
"QUASICOMFORTABLE",
"QUASICONSERVATIVE",
"QUASICONSTANT",
"QUASICONTINUOUS",
"QUASIDEJECTED",
"QUASIDELIGHTED",
"QUASIDEMOCRATIC",
"QUASIDEPRESSED",
"QUASIDESOLATE",
"QUASIDESPERATE",
"QUASIDESPONDENT",
"QUASIDIFFICULT",
"QUASIDIGNIFIED",
"QUASIDIGNIFYING",
"QUASIDIPLOMATIC",
"QUASIDISASTROUS",
"QUASIDISGRACED",
"QUASIDISGUSTED",
"QUASIDRAMATIC",
"QUASIECONOMIC",
"QUASIECONOMICAL",
"QUASIEMPTY",
"QUASIEXISTENT",
"QUASIEXTRATERRITORIAL",
"QUASIFAITHFUL",
"QUASIFINANCIAL",
"QUASIFIREPROOF",
"QUASIHISTORIC",
"QUASIHISTORICAL",
"QUASIHONOURABLE",
"QUASILAWFUL",
"QUASILEGAL",
"QUASILEGISLATED",
"QUASILEGISLATIVE",
"QUASILIBERAL",
"QUASILITERARY",
"QUASILUXURIOUS",
"QUASIMEDICAL",
"QUASIMYTHICAL",
"QUASINATIONAL",
"QUASINATIONALISTIC",
"QUASIOBJECTIVE",
"QUASIPHILOSOPHICAL",
"QUASIPLEASURABLE",
"QUASIPOLITICAL",
"QUASIPOOR",
"QUASIPROGRESSIVE",
"QUASIPROPHETIC",
"QUASIPROPHETICAL",
"QUASIRATIONAL",
"QUASIRELIGIOUS",
"QUASIROMANTIC",
"QUASIROYAL",
"QUASISCHOLARLY",
"QUASISCHOLASTIC",
"QUASISCIENTIFIC",
"QUASISPHERICAL",
"QUASISPIRITED",
"QUASISPIRITUAL",
"QUASISUBJECTIVE",
"QUASITERRITORIAL",
"QUASITHEATRICAL",
"QUASIWEALTHY",
"QUEASY",
"QUEENLIKE",
"QUEENLY",
"QUELLED",
"QUENCHED",
"QUENCHING",
"QUERULOUS",
"QUESTIONABLE",
"QUIBBLING",
"QUICK",
"QUICKTEMPERED",
"QUICKWITTED",
"QUICKSILVERY",
"QUIESCENT",
"QUILTED",
"QUINTESSENTIAL",
"QUIXOTIC",
"RABID",
"RADIANT",
"RADIATED",
"RADIATION",
"RADICAL",
"RADIOACTIVE",
"RADIOLOGICAL",
"RADIOLUMINESCENT",
"RADIOPHOBIC",
"RADIUM",
"RADON",
"RAGGEDRAGGEDY",
"RAGGLETAGGLE",
"RAGING",
"RAINBOW",
"RAINBOWY",
"RAINPROOF",
"RAINY",
"RANCID",
"RANCOROUS",
"RANCOUR",
"RANDOM",
"RANIDAPHOBIC",
"RAPID",
"RAPT",
"RAPTORIAL",
"RAPTUROUS",
"RARE",
"RASH",
"RASKLY",
"RASPBERRY",
"RATIONAL",
"RATLIKE",
"RATTISH",
"RATTLEBRAINED",
"RATTLEHEADED",
"RAVENOUS",
"RAW",
"RAWHIDE",
"RAYON",
"READAPTABLE",
"READJUSTABLE",
"READY",
"READYWITTED",
"REAL",
"REALISABLE",
"REANALYZABLE",
"REAPPROACHABLE",
"REAR",
"REARMOST",
"REARRANGEABLE",
"REASONABLE",
"REASONLESS",
"REATTACHABLE",
"REBEL",
"REBELLIOUS",
"REBUFFABLE",
"REBUTTABLE",
"RECEIVABLE",
"RECENT",
"RECEPTIVE",
"RECHARGEABLE",
"RECIDIVISTIC",
"RECITABLE",
"RECKLESS",
"RECKONABLE",
"RECLAIMABLE",
"RECLINABLE",
"RECLINING",
"RECLOSEABLE",
"RECLUSIVE",
"RECOGNIZED",
"RECOMMENDABLE",
"RECOMPENSABLE",
"RECONCILABLE",
"RECONSTRUCTIBLE",
"RECORDABLE",
"RECOVERABLE",
"RECRUITABLE",
"RECTANGULAR",
"RECTILINEAR",
"RED",
"REDBLOODED",
"REDDISH",
"REDEEMABLE",
"REDEMANDABLE",
"REDISSOLUBLE",
"REDISTILLABLE",
"REDOUBTABLE",
"REDRESSIBLE",
"REDUCED",
"REDUNDANT",
"REEDY",
"REFERTILIZABLE",
"REFILLABLE",
"REFLECTIBLE",
"REFLECTIVE",
"REFLEXIONAL",
"REFLEXIVE",
"REFORGEABLE",
"REFORMABLE",
"REFRACTABLE",
"REFRACTIONAL",
"REFRACTIVE",
"REFRACTURABLE",
"REFRESHFUL",
"REFRESHING",
"REFUNDABLE",
"REFUSABLE",
"REFUTABLE",
"REGAINABLE",
"REGAL",
"REGARDABLE",
"REGENERABLE",
"REGENERATED",
"REGENERATIVE",
"REGIONAL",
"REGISTERABLE",
"REGISTERED",
"REGISTRABLE",
"REGRETFUL",
"REGRETTABLE",
"REGULABLE",
"REGULAR",
"REHEARSABLE",
"REINCARNATED",
"REINCARNATING",
"REINFLATABLE",
"REINFORCED",
"REISSUABLE",
"REJECTABLE",
"REJOICEFUL",
"RELAPSABLE",
"RELATABLE",
"RELATIVE",
"RELAXATIVE",
"RELAXATORY",
"RELAXED",
"RELAXER",
"RELEASABLE",
"RELEGABLE",
"RELEVANT",
"RELIABLE",
"RELIANT",
"RELIEVABLE",
"RELIEVED",
"RELIGIONISTIC",
"RELIGIOUS",
"RELISHABLE",
"RELUCTANT",
"REMAINING",
"REMARKABLE",
"REMITTABLE",
"REMORSEFUL",
"REMORSELESS",
"REMOTECONTROLLED",
"REMOVABLE",
"RENDERABLE",
"RENEGOTIABLE",
"RENEWED",
"RENOUNCEABLE",
"RENOWNED",
"REOBTAINABLE",
"REPAIRABLE",
"REPAYABLE",
"REPEALABLE",
"REPEATABLE",
"REPELLENT",
"REPONSIBLE",
"REPORTABLE",
"REPREHENSIBLE",
"REPRESENTATIONAL",
"REPRESENTATIVE",
"REPRESSED",
"REPRESSIBLE",
"REPRESSIVE",
"REPROACHABLE",
"REPRODUCTIVE",
"REPTILIAN",
"REPTILOID",
"REPUBLICAN",
"REPUBLISHABLE",
"REPULSIVE",
"REPUNISHABLE",
"REPUTABLE",
"REQUIRED",
"RESALABLE",
"RESEALABLE",
"RESENTFUL",
"RESERVABLE",
"RESERVED",
"RESIDENT",
"RESIDENTIAL",
"RESIGNED",
"RESISTANT",
"RESOLVABLE",
"RESPECTABLE",
"RESPECTED",
"RESPECTFUL",
"RESPIRABLE",
"RESPONSIVE",
"RESTFUL",
"RESTING",
"RESTLESS",
"RESTORABLE",
"RESTORATIVE",
"RESTORED",
"RESTORING",
"RESTRAINABLE",
"RESTRICTIVE",
"RESURRECTIONAL",
"RESURRECTIONARY",
"RESURRECTIVE",
"RESUSCITATIVE",
"RETAIL",
"RETALIATIVE",
"RETALIATORY",
"RETIRED",
"RETIRING",
"RETOUCHABLE",
"RETRIEVABLE",
"RETROPHILIC",
"RETURNABLE",
"REUNITABLE",
"REUSABLE",
"REVEALABLE",
"REVENGEFUL",
"REVENUAL",
"REVENUED",
"REVERED",
"REVEREND",
"REVERENT",
"REVERSIBLE",
"REVIEWABLE",
"REVILED",
"REVISITABLE",
"REVIVABLE",
"REVOCABLE",
"REVOLTING",
"REVOLUTIONARY",
"RHEOPHILIC",
"RHINESTONE",
"RHINOPHILIC",
"RHIZOPHILIC",
"RHOMBIC",
"RHOMBOHEDRAL",
"RHYOLITE",
"RIBBONLIKE",
"RIBBONY",
"RICH",
"RIDEABLE",
"RIDICULOUS",
"RIGHT",
"RIGHTWING",
"RIGHTABLE",
"RIGHTEOUS",
"RIGHTIST",
"RIOTOUS",
"RIPE",
"RIPENING",
"RISKY",
"RITUALISTIC",
"RITZY",
"RIVAL",
"ROASTABLE",
"ROASTED",
"ROASTING",
"ROBO",
"ROBOTIC",
"ROBOTLIKE",
"ROBUST",
"ROCKBOUND",
"ROCKFACED",
"ROCKABLE",
"ROCKY",
"ROENTGENIUM",
"ROGUISH",
"ROLLABLE",
"ROMANTIC",
"ROMANTICISTIC",
"ROOKIE",
"ROOMY",
"ROPABLE",
"ROPEABLE",
"ROSECOLORED",
"ROSEATE",
"ROSELIKE",
"ROSY",
"ROTATABLE",
"ROTTEN",
"ROUGH",
"ROUND",
"ROUNDBUILT",
"ROUNDED",
"ROWABLE",
"ROYAL",
"ROYALISTIC",
"RUBBER",
"RUBBERY",
"RUBBLY",
"RUBELLITE",
"RUBIDIUM",
"RUBIED",
"RUBY",
"RUDDY",
"RUDE",
"RUINABLE",
"RUINOUS",
"RULING",
"RUNIC",
"RUNNING",
"RUNTISH",
"RUNTY",
"RURAL",
"RUSSET",
"RUST",
"RUSTED",
"RUSTIC",
"RUSTY",
"RUTHERFORDIUM",
"RUTILE",
"SACCHARINE",
"SACRAMENTAL",
"SACRED",
"SACRIFICIAL",
"SACRILEGIOUS",
"SAD",
"SADDENED",
"SADDENING",
"SADISTIC",
"SAFE",
"SAGACIOUS",
"SAINTED",
"SAINTLESS",
"SAINTLY",
"SALAMANDRINE",
"SALARIED",
"SALINE",
"SALMON",
"SALMONLIKE",
"SALMONOID",
"SALTED",
"SALTISH",
"SALTWATER",
"SALTY",
"SANCTIFIED",
"SANCTIMONIOUS",
"SAND",
"SANDED",
"SANDPAPERY",
"SANDSTONE",
"SANDY",
"SANE",
"SANGRIA",
"SANGUINE",
"SANIDINE",
"SANITARIAN",
"SANITARY",
"SAPIENT",
"SAPPHIRE",
"SAPPY",
"SARCASTIC",
"SARCOPHILIC",
"SARDONIC",
"SASSY",
"SATIATED",
"SATIN",
"SATINY",
"SATIRICAL",
"SATISFACTORY",
"SATISFIED",
"SAVAGE",
"SAVOROUS",
"SAVOURLESS",
"SAVOURY",
"SAVVY",
"SAWDUSTISH",
"SAWDUSTY",
"SCABBY",
"SCABROUS",
"SCALED",
"SCALEY",
"SCALY",
"SCANDALOUS",
"SCARABAEIFORM",
"SCARABAEOID",
"SCARECROWISH",
"SCARECROWY",
"SCARED",
"SCARLET",
"SCARRED",
"SCARY",
"SCATHING",
"SCATTERBRAINED",
"SCATTERED",
"SCAVENGER",
"SCEPTICAL",
"SCHEELITE",
"SCHEMATIC",
"SCHOLARLESS",
"SCHOLARLY",
"SCHOLASTIC",
"SCHOLIASTIC",
"SCIENTIFIC",
"SCINTILLATING",
"SCIOPHILIC",
"SCOLECIPHOBIC",
"SCOPOPHOBIC",
"SCORNFUL",
"SCORPAENOID",
"SCORPIOID",
"SCORPIONIC",
"SCOTOPHOBIC",
"SCOWLFUL",
"SCRAPABLE",
"SCRATCHY",
"SCRAWNY",
"SCREAMING",
"SCRIBBLENAUTABLE",
"SCRIBBLENAUTIBLE",
"SCRIBBLENAUTIC",
"SCRIBBLENAUTICAL",
"SCRIBBLENAUTILOGIC",
"SCRIBBLENAUTILOGICAL",
"SCRIBBLENAUTOPHILIC",
"SCRIBBLENAUTOPHOBIC",
"SCRIBBLEPHOBIC",
"SCRIBBOPHOBIC",
"SCRIBOPHOBIC",
"SCRUMMY",
"SCRUMPTIOUS",
"SCULPTURESQUE",
"SCUMMY",
"SEAGREEN",
"SEAISLAND",
"SEABORGIUM",
"SEABORNE",
"SEAFARING",
"SEAGOING",
"SEALBROWN",
"SEARED",
"SEASICK",
"SEASONAL",
"SEAWORTHY",
"SECLUDED",
"SECLUSIVE",
"SECONDBEST",
"SECONDCLASS",
"SECONDHAND",
"SECONDRATE",
"SECONDARY",
"SECRET",
"SECRETIVE",
"SECULAR",
"SECULARISTIC",
"SECURE",
"SEDATE",
"SEDENTARY",
"SEDIMENT",
"SEDULOUS",
"SEEDY",
"SEEMLY",
"SEGREGATED",
"SEISMIC",
"SEISMOGRAPHIC",
"SEISMOGRAPHICAL",
"SEISMOLOGIC",
"SEISMOLOGICAL",
"SEISMOSCOPIC",
"SELECT",
"SELECTIVE",
"SELENITE",
"SELENIUM",
"SELFASSURED",
"SELFAWARE",
"SELFCENTERED",
"SELFCOLORED",
"SELFCONCEITED",
"SELFCONTRADICTION",
"SELFDEPRECATING",
"SELFDEPRECIATIVE",
"SELFDESTROYED",
"SELFDESTROYING",
"SELFDISGRACED",
"SELFDISGRACING",
"SELFDISQUIETING",
"SELFDISSATISFIED",
"SELFEDUCATED",
"SELFEMPTYING",
"SELFEVOLVED",
"SELFEVOLVING",
"SELFEXISTENT",
"SELFHONOURED",
"SELFHYPNOTIC",
"SELFHYPNOTISED",
"SELFINDULGENT",
"SELFRIGHTEOUS",
"SELFSATISFIED",
"SELFTAUGHT",
"SELFTEACHING",
"SELFTRAINED",
"SELFVULCANISING",
"SELFISH",
"SELFLESS",
"SEMANTIC",
"SEMIILLITERATE",
"SEMIINTELLECTUAL",
"SEMIINTELLECTUALIZED",
"SEMIINTELLIGENT",
"SEMIIRONIC",
"SEMIIRONICAL",
"SEMIACADEMIC",
"SEMIACADEMICAL",
"SEMIACIDIC",
"SEMIACIDIFIED",
"SEMIACIDULATED",
"SEMIADHESIVE",
"SEMIAGRICULTURAL",
"SEMIBLEACHED",
"SEMIBOILED",
"SEMICAPITALISTIC",
"SEMICONSERVATIVE",
"SEMICONTINUOUS",
"SEMICRYSTALLINE",
"SEMICULTURED",
"SEMIDESTRUCTIVE",
"SEMIDIVINE",
"SEMIDRAMATIC",
"SEMIDRAMATICAL",
"SEMIDRY",
"SEMIEMOTIONAL",
"SEMIEXPERIMENTAL",
"SEMIFLUID",
"SEMIGEOMETRIC",
"SEMIGEOMETRICAL",
"SEMIHISTORIC",
"SEMIHISTORICAL",
"SEMILEGISLATIVE",
"SEMILIBERAL",
"SEMILIQUID",
"SEMILITERATE",
"SEMIMAGICAL",
"SEMIMAGNETIC",
"SEMIMAGNETICAL",
"SEMIMARINE",
"SEMIMATHEMATICAL",
"SEMIMEDICINAL",
"SEMIMETALLIC",
"SEMIMONARCHIC",
"SEMIMONARCHICAL",
"SEMIMYSTICAL",
"SEMIMYTHIC",
"SEMIMYTHICAL",
"SEMINATIONALISTIC",
"SEMINEUROTIC",
"SEMINEUTRAL",
"SEMINOCTURNAL",
"SEMIOBJECTIVE",
"SEMIPARALYSIS",
"SEMIPARALYZED",
"SEMIPASSIVE",
"SEMIPEACEFUL",
"SEMIPETRIFIED",
"SEMIPHILOSOPHIC",
"SEMIPHILOSOPHICAL",
"SEMIPOISONOUS",
"SEMIPOLITICAL",
"SEMIPRIMITIVE",
"SEMIPROGRESSIVE",
"SEMIPSYCHOLOGIC",
"SEMIPSYCHOLOGICAL",
"SEMIRATIONALISED",
"SEMIREBELLIOUS",
"SEMIRELIGIOUS",
"SEMIRETIRED",
"SEMIROMANTIC",
"SEMIROUND",
"SEMISCHOLASTIC",
"SEMISOLEMN",
"SEMISPHERIC",
"SEMISUBTERRANEAN",
"SEMITHEATRIC",
"SEMITHEATRICAL",
"SEMITHEOLOGICAL",
"SEMIVOLCANIC",
"SEMIVULCANISED",
"SENATORIAL",
"SENILE",
"SENIOR",
"SENSELESS",
"SENSIBLE",
"SENSITIVE",
"SENSUALIST",
"SENTIENT",
"SENTIMENTAL",
"SEPARATE",
"SEPIA",
"SEPTIC",
"SEQUINED",
"SERAPHIC",
"SERENE",
"SERGE",
"SERICATE",
"SERICEOUS",
"SERICULTURAL",
"SERIOUS",
"SERPENTIFORM",
"SERPENTINE",
"SERVILE",
"SEVERE",
"SEWABLE",
"SHABBY",
"SHADED",
"SHADEFUL",
"SHADOWED",
"SHADOWGRAPHIC",
"SHADOWY",
"SHADY",
"SHAGGY",
"SHAGREEN",
"SHAKESPEAREAN",
"SHALLOW",
"SHAMANIC",
"SHAMANISTIC",
"SHAMEFACED",
"SHAMEFUL",
"SHAMELESS",
"SHAPABLE",
"SHAPEABLE",
"SHAPELY",
"SHARED",
"SHARP",
"SHARPCUT",
"SHARPEYED",
"SHARPSET",
"SHARPSIGHTED",
"SHARPTONGUED",
"SHARPWITTED",
"SHAVEN",
"SHEEPISH",
"SHEEPSKIN",
"SHEER",
"SHELLSHOCKED",
"SHELLSHOCKED",
"SHELLED",
"SHELLSHOCKED",
"SHELLY",
"SHIFTABLE",
"SHIFTY",
"SHIMMERY",
"SHINY",
"SHOCKED",
"SHOCKPROOF",
"SHODDY",
"SHOGUNAL",
"SHORT",
"SHORTCIRCUITED",
"SHORTHANDED",
"SHORTSIGHTED",
"SHORTTEMPERED",
"SHORTTERM",
"SHORTED",
"SHORTISH",
"SHORTSIGHTED",
"SHREWD",
"SHRINKABLE",
"SHRUBBY",
"SHRUNKEN",
"SHY",
"SIBLING",
"SICK",
"SICKENING",
"SICKLIED",
"SICKLY",
"SIDEROPHYLLITE",
"SIENNA",
"SIGHTED",
"SIGHTLESS",
"SIGHTLY",
"SIGNIFICANT",
"SILICONE",
"SILK",
"SILKEN",
"SILKY",
"SILLY",
"SILT",
"SILTY",
"SILVAN",
"SILVER",
"SILVERISH",
"SILVERN",
"SILVERY",
"SILVICOLOUS",
"SILVICULTURAL",
"SIMAROUBACEOUS",
"SIMIAN",
"SIMILAR",
"SIMIOUS",
"SIMPLE",
"SIMPLEHEARTED",
"SIMPLEMINDED",
"SINCERE",
"SINFUL",
"SINGLE",
"SINGLEMINDED",
"SINISTER",
"SINISTROUS",
"SINKING",
"SINLESS",
"SIRENIAN",
"SIRENIC",
"SISTERLIKE",
"SISTERLY",
"SITOPHOBIC",
"SIZABLE",
"SIZEABLE",
"SIZED",
"SIZY",
"SKALDIC",
"SKARN",
"SKELETAL",
"SKELETONLIKE",
"SKELETONLIKE",
"SKEPTICAL",
"SKETCHED",
"SKETCHY",
"SKILFUL",
"SKILLED",
"SKIMPY",
"SKINNY",
"SKIPPING",
"SKITTISH",
"SKYBLUE",
"SKYBORNE",
"SKYSCRAPING",
"SLANDERED",
"SLATE",
"SLAVISH",
"SLAVOCRATIC",
"SLEEPFUL",
"SLEEPING",
"SLEEPLESS",
"SLEEPY",
"SLENDER",
"SLICK",
"SLIGHT",
"SLIM",
"SLIMLINE",
"SLIMMING",
"SLIMY",
"SLIPPERY",
"SLITHERY",
"SLOBBERY",
"SLOPPY",
"SLOTHFUL",
"SLOVENLY",
"SLOW",
"SLOWMOTION",
"SLOWMOVING",
"SLOWWITTED",
"SLUDGY",
"SLUGGISH",
"SLUMBERLESS",
"SLUMBEROUS",
"SLUSHY",
"SLY",
"SMALL",
"SMALLMINDED",
"SMALLSCALE",
"SMALLTIME",
"SMALLISH",
"SMART",
"SMARTALECK",
"SMARTALECKY",
"SMARTY",
"SMASHABLE",
"SMASHED",
"SMELLABLE",
"SMELLY",
"SMILELESS",
"SMILING",
"SMOGGY",
"SMOKING",
"SMOKY",
"SMOOTH",
"SMOOTHSPOKEN",
"SMOOTHTONGUED",
"SMUDGELESS",
"SMUG",
"SNAKY",
"SNAPPISH",
"SNAPPY",
"SNAZZY",
"SNEAKING",
"SNEAKY",
"SNIDE",
"SNIPPY",
"SNIVELY",
"SNOBBISH",
"SNOOPY",
"SNOOTY",
"SNOOZY",
"SNOTTY",
"SNOWCLAD",
"SNOWWHITE",
"SNOWBOUND",
"SNOWCAPPED",
"SNOWY",
"SNUG",
"SNUGGING",
"SOCALLED",
"SOAKED",
"SOAPLIKE",
"SOAPLIKE",
"SOAPSTONE",
"SOAPSUDSY",
"SOAPY",
"SOCIABLE",
"SOCIAL",
"SOCIALMINDED",
"SOCIALIST",
"SOCIALISTIC",
"SOCIALIZED",
"SOCIOECONOMIC",
"SOCIOECONOMICAL",
"SOCIOLOGICAL",
"SOCIOPATHIC",
"SOCIOPHOBIC",
"SOCIOPOLITICAL",
"SOCIOPSYCHOLOGICAL",
"SODALITE",
"SODIUM",
"SOFT",
"SOFTHEARTED",
"SOFTISH",
"SOGGY",
"SOLAR",
"SOLDIERLIKE",
"SOLDIERLY",
"SOLE",
"SOLEMN",
"SOLID",
"SOLIDIFIABLE",
"SOLITARY",
"SOMBRE",
"SOMBROUS",
"SOME",
"SOMNIPHOBIC",
"SONGFUL",
"SONIC",
"SONOROUS",
"SOOT",
"SOOTY",
"SOPHISTICATED",
"SOPHOMORIC",
"SOPPING",
"SOPPY",
"SORCEROUS",
"SORROWLESS",
"SORRY",
"SOUBRETTISH",
"SOUGHTAFTER",
"SOULFUL",
"SOULLESS",
"SOUND",
"SOUPY",
"SOUR",
"SOURDOUGH",
"SOURED",
"SOURISH",
"SOUTHBOUND",
"SOUTHEASTERN",
"SOUTHEASTWARD",
"SOUTHERN",
"SOUTHERNMOST",
"SOUTHMOST",
"SOUTHWESTERN",
"SPACIOUS",
"SPANGLY",
"SPARE",
"SPARKLING",
"SPARSE",
"SPATIAL",
"SPECIAL",
"SPECIALIZED",
"SPECIFIC",
"SPECIFIED",
"SPECIOUS",
"SPECTACULAR",
"SPECTROPHOBIC",
"SPECULAR",
"SPECULATIVE",
"SPEEDFUL",
"SPEEDLESS",
"SPEEDY",
"SPELLBOUND",
"SPENDTHRIFT",
"SPHALERITE",
"SPHENE",
"SPHERAL",
"SPHERELESS",
"SPHERELIKE",
"SPHERICAL",
"SPHEROIDAL",
"SPHERULAR",
"SPHINGINE",
"SPHINXIAN",
"SPICEY",
"SPICY",
"SPIDERSILK",
"SPIDERY",
"SPIKY",
"SPINAL",
"SPINED",
"SPINELESS",
"SPINELIKE",
"SPINESCENT",
"SPINIFEROUS",
"SPINOUS",
"SPINULOSE",
"SPINY",
"SPIRITED",
"SPIRITLESS",
"SPIRITOUS",
"SPIRITUAL",
"SPIRITUALISTIC",
"SPITEFUL",
"SPLENDID",
"SPLENDIFEROUS",
"SPLENDOROUS",
"SPLINTERY",
"SPLURGY",
"SPODUMENE",
"SPOILED",
"SPONGY",
"SPONTANEOUS",
"SPOOKY",
"SPORADIC",
"SPORTFUL",
"SPORTING",
"SPORTIVE",
"SPORTSMANLIKE",
"SPORTSMANLY",
"SPORTY",
"SPOTLESS",
"SPOTTABLE",
"SPOTTED",
"SPOTTY",
"SPRIGHTFUL",
"SPRIGHTLY",
"SPRINGLOADED",
"SPRINGY",
"SPRUCING",
"SPY",
"SQUALID",
"SQUARE",
"SQUARISH",
"SQUEAMISH",
"SQUIRARCHAL",
"SQUIRARCHICAL",
"SQUIREARCHAL",
"SQUIREARCHICAL",
"SQUIRRELISH",
"SQUIRRELLIKE",
"SQUIRRELLY",
"SQUISHY",
"STABLE",
"STAGNANT",
"STAGNANTORY",
"STAINABLE",
"STALACTIFORM",
"STALAGMITIC",
"STALAGMITICAL",
"STALAGMOMETRIC",
"STALE",
"STALWART",
"STAMPABLE",
"STANDARD",
"STANDARDISABLE",
"STARCROSSED",
"STARSPANGLED",
"STARSTUDDED",
"STARCHY",
"STARRED",
"STARRY",
"STARVED",
"STARVING",
"STATESMANLIKE",
"STATESMANLY",
"STATIC",
"STATIONAL",
"STATIONARY",
"STATISTICAL",
"STATUED",
"STATUELIKE",
"STATUESQUE",
"STATUTORY",
"STEADFAST",
"STEALTHFUL",
"STEALTHLESS",
"STEALTHY",
"STEAMHEATED",
"STEAMY",
"STEEL",
"STEEP",
"STEGOPHILIC",
"STELLAR",
"STENCHFUL",
"STEREOTYPED",
"STERILE",
"STERILISED",
"STERILIZED",
"STERLING",
"STICKY",
"STIGMATOPHILIC",
"STILL",
"STILLLIFE",
"STIMULATED",
"STIMULATING",
"STINGY",
"STINKY",
"STOIC",
"STOICAL",
"STOLEN",
"STOMACHACHY",
"STOMACHY",
"STONE",
"STONEBROKE",
"STONED",
"STONELIKE",
"STONEWARE",
"STONEY",
"STONY",
"STONYHEARTED",
"STOPPABLE",
"STORMPROOF",
"STORMY",
"STOUT",
"STOUTHEARTED",
"STOUTISH",
"STRAIGHT",
"STRAIGHTLACED",
"STRAIGHTFORWARD",
"STRAINED",
"STRANGE",
"STRATEGIC",
"STRAWCOLORED",
"STREAKY",
"STREETSMART",
"STREETWISE",
"STRENGTHENED",
"STRENUOUS",
"STRESSED",
"STRESSFUL",
"STRETCHABLE",
"STRETCHY",
"STRICKEN",
"STRICT",
"STRIKING",
"STRINGENT",
"STRIPED",
"STRIPY",
"STRONG",
"STRONGMINDED",
"STRONGWILLED",
"STRONGISH",
"STRONTIUM",
"STRUCTURAL",
"STUBBORN",
"STUCK",
"STUCKUP",
"STUDIOUS",
"STUFFED",
"STUMPLIKE",
"STUMPY",
"STUNTY",
"STUPENDOUS",
"STUPID",
"STYLISH",
"SUAVE",
"SUBABSOLUTE",
"SUBACADEMIC",
"SUBACADEMICAL",
"SUBALGEBRAIC",
"SUBALGEBRAICAL",
"SUBATOMIC",
"SUBAVERAGE",
"SUBCLIMATIC",
"SUBCONSCIOUS",
"SUBCRANIAL",
"SUBCRYSTALLINE",
"SUBCULTURAL",
"SUBDENDROID",
"SUBDENDROIDAL",
"SUBDERMAL",
"SUBDERMIC",
"SUBDIVINE",
"SUBDUED",
"SUBENDOCARDIAL",
"SUBERIN",
"SUBEVERGREEN",
"SUBGEOMETRIC",
"SUBGEOMETRICAL",
"SUBGLACIAL",
"SUBHEDRAL",
"SUBHEMISPHERIC",
"SUBHEMISPHERICAL",
"SUBHEXAGONAL",
"SUBJECTIVE",
"SUBLIMATIONAL",
"SUBLIME",
"SUBLIMINAL",
"SUBLINEAR",
"SUBMETALLIC",
"SUBMISSIVE",
"SUBOCEAN",
"SUBOCEANIC",
"SUBORDINATE",
"SUBPENTAGONAL",
"SUBPERICARDIAC",
"SUBPERICARDIAL",
"SUBPERICRANIAL",
"SUBPOLYGONAL",
"SUBPYRAMIDAL",
"SUBPYRAMIDIC",
"SUBPYRAMIDICAL",
"SUBPYRIFORM",
"SUBQUADRANGULAR",
"SUBQUADRATE",
"SUBQUINQUEFID",
"SUBRECTANGULAR",
"SUBSEQUENT",
"SUBSERVIENT",
"SUBSIMIAN",
"SUBSIMIOUS",
"SUBSOLAR",
"SUBSONIC",
"SUBSPHERIC",
"SUBSPHERICAL",
"SUBSTANTIAL",
"SUBTERRANEAN",
"SUBTERRAQUEOUS",
"SUBTERRESTRIAL",
"SUBTLE",
"SUBTRACTIVE",
"SUBTRANSPARENT",
"SUBTRAPEZOID",
"SUBTRAPEZOIDAL",
"SUBTRIANGULAR",
"SUBTRIGONAL",
"SUBTRIHEDRAL",
"SUBTROPICAL",
"SUBURBAN",
"SUBURBICARIAN",
"SUBVERSIVE",
"SUBWEALTHY",
"SUBZERO",
"SUCCEEDABLE",
"SUCCESSFUL",
"SUCCESSIVE",
"SUCCINCT",
"SUCCULENT",
"SUDDEN",
"SUDORIFEROUS",
"SUDORIFIC",
"SUDSY",
"SUEDE",
"SUFFICIENT",
"SUFFIXAL",
"SUGAR",
"SUGARCANDY",
"SUGARCANE",
"SUGARLOAF",
"SUGARED",
"SUGARLESS",
"SUGARY",
"SUICIDAL",
"SUITABLE",
"SULFUR",
"SULFUREOUS",
"SULFURIC",
"SULFUROUS",
"SULFURYL",
"SULKY",
"SULLEN",
"SULTANIC",
"SULTANLIKE",
"SUNDRIED",
"SUNBAKED",
"SUNBEAMED",
"SUNBEAMY",
"SUNLIT",
"SUNNY",
"SUNSHINY",
"SUPER",
"SUPERDUPER",
"SUPERSMOOTH",
"SUPERAGRARIAN",
"SUPERANGELIC",
"SUPERB",
"SUPERBELOVED",
"SUPERCATASTROPHIC",
"SUPERCILIOUS",
"SUPERCOLOSSAL",
"SUPERCONSERVATIVE",
"SUPERCRIMINAL",
"SUPERCURIOUS",
"SUPERDEMOCRATIC",
"SUPERDESIROUS",
"SUPERDIFFICULT",
"SUPERDIVINE",
"SUPERENERGETIC",
"SUPEREXCITED",
"SUPERFICIAL",
"SUPERFLUOUS",
"SUPERGENEROUS",
"SUPERGLACIAL",
"SUPERHISTORIC",
"SUPERHISTORICAL",
"SUPERIMPORTANT",
"SUPERIOR",
"SUPERLATIVE",
"SUPERLUCKY",
"SUPERLUXURIOUS",
"SUPERMARINE",
"SUPERMATHEMATICAL",
"SUPERNATIONAL",
"SUPERNATURAL",
"SUPERNATURALISTIC",
"SUPERPOLITE",
"SUPERPOWERED",
"SUPERRATIONAL",
"SUPERREGAL",
"SUPERROMANTIC",
"SUPERSAFE",
"SUPERSCHOLARLY",
"SUPERSCIENTIFIC",
"SUPERSECRETIVE",
"SUPERSECULAR",
"SUPERSECURE",
"SUPERSENSITIVE",
"SUPERSERIOUS",
"SUPERSMART",
"SUPERSOLAR",
"SUPERSOLEMN",
"SUPERSONIC",
"SUPERSPIRITUAL",
"SUPERSTITIOUS",
"SUPERSTRICT",
"SUPERSTYLISH",
"SUPERSWEET",
"SUPERTERRESTRIAL",
"SUPERUGLY",
"SUPERVIGILANT",
"SUPERVIGOROUS",
"SUPERWEALTHY",
"SUPERZEALOUS",
"SUPPLEMENTAL",
"SUPPLEMENTARY",
"SUPPLETIVE",
"SUPPORTING",
"SUPPORTIVE",
"SUPRANATIONAL",
"SUPREME",
"SURAH",
"SURE",
"SUREFOOTED",
"SURGICAL",
"SURLY",
"SURPRISED",
"SURPRISING",
"SURREAL",
"SURREPTITIOUS",
"SUSCEPTIBLE",
"SUSPECT",
"SUSPICIOUS",
"SUSTAINABLE",
"SVELTE",
"SWALLOWABLE",
"SWAMPY",
"SWANKY",
"SWASHBUCKLING",
"SWEATED",
"SWEATING",
"SWEATY",
"SWEEPABLE",
"SWEET",
"SWEETSCENTED",
"SWEETTEMPERED",
"SWELTERING",
"SWIFT",
"SWIFTFOOTED",
"SWIMMING",
"SWINDLED",
"SWINISH",
"SWIRLY",
"SYBARITIC",
"SYCOPHANTIC",
"SYLLABIC",
"SYLPHIC",
"SYLPHISH",
"SYLPHLIKE",
"SYLPHY",
"SYMBIOTIC",
"SYMBOLIC",
"SYMMETRIC",
"SYMMETRICAL",
"SYMPATHETIC",
"SYMPHONIC",
"SYMPHONIOUS",
"SYMPTOMATIC",
"SYNARCHIST",
"SYNECOLOGIC",
"SYNECOLOGICAL",
"SYNONYMOUS",
"SYNTHETIC",
"SYRUPY",
"TABARDED",
"TABOO",
"TACKY",
"TACTFUL",
"TACTICAL",
"TAILORMADE",
"TAILORED",
"TAINTED",
"TALENTED",
"TALISMANIC",
"TALISMANICAL",
"TALKABLE",
"TALKATIVE",
"TALKY",
"TALL",
"TAME",
"TAMED",
"TAMING",
"TAN",
"TANGERINE",
"TANGIBLE",
"TANGLED",
"TANGY",
"TANNED",
"TANTALIZING",
"TANTALOUS",
"TANZANITE",
"TAPESTRIED",
"TAPHOPHOBIC",
"TARDY",
"TARGETED",
"TART",
"TASTEFUL",
"TASTELESS",
"TASTY",
"TATTOOED",
"TAUPE",
"TAURINE",
"TAUT",
"TAUTOLOGICAL",
"TAWDRY",
"TAXDEDUCTIBLE",
"TAXEXEMPT",
"TAXIDERMAL",
"TAXIDERMIC",
"TAXIDERMY",
"TAXING",
"TAXONOMIC",
"TAXONOMICAL",
"TEAL",
"TEARFUL",
"TEARING",
"TEARY",
"TECHNICAL",
"TECHNOCRAT",
"TECHNOCRATIC",
"TECHNOLOGICAL",
"TECHNOPHILIC",
"TECHNOPHOBIC",
"TECHY",
"TECTONIC",
"TEDIOUS",
"TEEN",
"TEENAGE",
"TEENSY",
"TEENSYWEENSY",
"TEENY",
"TEENYTINY",
"TEENYWEENY",
"TEKITE",
"TELEGRAPHIC",
"TELEGRAPHICAL",
"TELEKINETIC",
"TELEPATHIC",
"TEMPERAMENTAL",
"TEMPERATE",
"TEMPORAL",
"TEMPORARY",
"TEMPTING",
"TEMPTUOUS",
"TENDER",
"TENDERHEARTED",
"TENSE",
"TENUOUS",
"TERDEKAPHOBIA",
"TERIYAKI",
"TERMITIC",
"TERRACOTTA",
"TERRAZZO",
"TERRESTRIAL",
"TERRIBLE",
"TERRIFIC",
"TERRIFIED",
"TERRIFYING",
"TERRITORIAL",
"TERRORSTRICKEN",
"TERRORFUL",
"TERRORISTIC",
"TERRORLESS",
"TERSE",
"TERTIARY",
"TESTY",
"TETARTOHEDRAL",
"TETRAGONAL",
"TETRAHEDRAL",
"TEXTBOOKISH",
"TEXTILE",
"THALASSOPHILIC",
"THANKFUL",
"THANKLESS",
"THEATRICAL",
"THEOCENTRIC",
"THEOCRATIC",
"THEOCRATICAL",
"THEODICEAN",
"THEOLOGICAL",
"THEOMORPHIC",
"THEOPHAGOUS",
"THEOPHILIC",
"THEORETICAL",
"THEOSOPHIC",
"THEOSOPHICAL",
"THERAPEUTIC",
"THERMAL",
"THERMODYNAMIC",
"THERMONUCLEAR",
"THERMOPHILIC",
"THERMOPHOBIC",
"THICK",
"THICKSKULLED",
"THICKWITTED",
"THICKSET",
"THIEVING",
"THIEVISH",
"THIN",
"THINNISH",
"THIRSTY",
"THISTLE",
"THISTLY",
"THORIUM",
"THORNY",
"THOROUGH",
"THOROUGHBRED",
"THOUGHTFUL",
"THOUGHTLESS",
"THREADBARE",
"THREATENING",
"THREATFUL",
"THREPTEROPHILIC",
"THRIFTY",
"THRILLFUL",
"THRILLING",
"TICKLISH",
"TIDAL",
"TIDY",
"TIFF",
"TIGERSEYE",
"TIGHTKNIT",
"TIMBROPHILIC",
"TIMECONSUMING",
"TIMELESS",
"TIMELY",
"TIMID",
"TIN",
"TINFOIL",
"TINNED",
"TINNY",
"TINTED",
"TINY",
"TIPPABLE",
"TIRED",
"TIRELESS",
"TIRESOME",
"TITANIC",
"TITANIFEROUS",
"TITANITE",
"TITANIUM",
"TITANOUS",
"TOADISH",
"TOADYISH",
"TOKOPHOBIC",
"TOLERANT",
"TOMOPHOBIC",
"TONGUETIED",
"TOOTHSOME",
"TOPSECRET",
"TOPAZ",
"TOPAZINE",
"TOPIARY",
"TOPNOTCH",
"TORRENTIAL",
"TORRID",
"TORTOISESHELL",
"TORTOISESHELLED",
"TOTALITARIAN",
"TOUCHY",
"TOUGH",
"TOURISTIC",
"TOURISTY",
"TOURMALINE",
"TOURMALINIC",
"TOWCOLORED",
"TOWERING",
"TOXIC",
"TOXICOLOGICAL",
"TOXOPHILIC",
"TOY",
"TOYLIKE",
"TRACHYTE",
"TRADITIONAL",
"TRAGIC",
"TRAINSICK",
"TRAITOROUS",
"TRANQUIL",
"TRANSCENDENT",
"TRANSCENDENTAL",
"TRANSCENDENTALISTIC",
"TRANSCOLOUR",
"TRANSCRYSTALLINE",
"TRANSCULTURAL",
"TRANSHUMAN",
"TRANSIENT",
"TRANSLUCENT",
"TRANSLUNAR",
"TRANSMARINE",
"TRANSOCEANIC",
"TRANSPARENT",
"TRANSPLANETARY",
"TRANSRATIONAL",
"TRAPEZIAL",
"TRAPEZIFORM",
"TRAPEZOHEDRAL",
"TRAPEZOHEDRON",
"TRASHY",
"TRATASYLLABIC",
"TRATASYLLABICAL",
"TRAUMATIC",
"TRAUMATIZED",
"TRAUMATOPHOBIC",
"TRAVELSICK",
"TRAVELSICK",
"TREACHEROUS",
"TREASONABLE",
"TREASONOUS",
"TREELIKE",
"TREMENDOUS",
"TRENDY",
"TRIBAL",
"TRICHOPHOBIA",
"TRICKISH",
"TRICKSOME",
"TRICKSY",
"TRICKY",
"TRICOLOUR",
"TRICOLOURED",
"TRIDYMITE",
"TRIFLING",
"TRIGONAL",
"TRIGONOMETRIC",
"TRIGONOMETRICAL",
"TRIGONOUS",
"TRIHEDRAL",
"TRILATERAL",
"TRILINEAR",
"TRILITERAL",
"TRIMETALLIC",
"TRISKAIDEKAPHOBIC",
"TRISYLLABIC",
"TRISYLLABICAL",
"TRIUMPHAL",
"TRIUMPHANT",
"TRIVIAL",
"TROGLODYTIC",
"TROGLODYTICAL",
"TROGONOID",
"TROPHIC",
"TROPHIED",
"TROPICAL",
"TROUBLED",
"TROUBLESOME",
"TROUBLING",
"TRUEBLUE",
"TRUEBORN",
"TRUEHEARTED",
"TRUSTFUL",
"TRUSTING",
"TRUSTWORTHY",
"TRUTHFUL",
"TRYPANOPHOBIC",
"TSARIST",
"TSARISTIC",
"TSUNAMIC",
"TUBBY",
"TUNEFUL",
"TURBID",
"TUROPHILIC",
"TURPENTINIC",
"TURQUOISE",
"TURTLESHELL",
"TURTLESHELLED",
"TWEED",
"TWEEDY",
"TWILL",
"TWOFACED",
"TYPHLOPHILIC",
"TYPICAL",
"TYRANNICAL",
"TYRANNICIDAL",
"TYRANNOUS",
"TZARIST",
"TZARISTIC",
"UBER",
"UBIQUITARY",
"UBIQUITOUS",
"UGLY",
"ULCERATIVE",
"ULCEROUS",
"ULTIMATE",
"ULTRACONSERVATIVE",
"ULTRAFAULTLESS",
"ULTRAMARINE",
"ULTRAMICROSCOPIC",
"ULTRAMICROSCOPICAL",
"ULTRAMODERN",
"ULTRAMUNDANE",
"ULTRAPINK",
"ULTRASHORT",
"ULTRASONIC",
"ULTRATROPICAL",
"UMBRAL",
"UNABLE",
"UNACADEMIC",
"UNACADEMICAL",
"UNACCEPTABLE",
"UNACCEPTED",
"UNACIDIC",
"UNACIDULATED",
"UNACKNOWLEDGED",
"UNACTIVATED",
"UNADHESIVE",
"UNADJOINING",
"UNADORED",
"UNADULT",
"UNADVENTUROUS",
"UNADVERTURESOME",
"UNADVISED",
"UNAESTHETIC",
"UNAESTHETICAL",
"UNAFRAID",
"UNAGGRESSIVE",
"UNAGRARIAN",
"UNAGRICULTURAL",
"UNALGEBRAICAL",
"UNALIENATED",
"UNALLEGORICAL",
"UNALLEGORISED",
"UNALLERGIC",
"UNALLITERATED",
"UNALLITERATIVE",
"UNALPHABETIC",
"UNALPHABETICAL",
"UNALPHABETISED",
"UNAMAZED",
"UNAMBITIOUS",
"UNAMIABLE",
"UNAMICABLE",
"UNAMOROUS",
"UNAMUSABLE",
"UNAMUSED",
"UNAMUSING",
"UNANARCHIC",
"UNANARCHISTIC",
"UNANGRY",
"UNANGUISHED",
"UNANIMATED",
"UNANIMATING",
"UNANNOTATED",
"UNAPOLOGETIC",
"UNAPPEALING",
"UNAPPEASED",
"UNAPPRECIATED",
"UNAPPROACHABLE",
"UNARITHMETICAL",
"UNARMED",
"UNAROUSED",
"UNARTFUL",
"UNARTISTIC",
"UNASSUMING",
"UNATHLETIC",
"UNATTRACTIVE",
"UNAUTHORIZED",
"UNAVOIDABLE",
"UNAWAKE",
"UNAWAKEABLE",
"UNAWARE",
"UNBACKWARD",
"UNBATHED",
"UNBEATABLE",
"UNBEATEN",
"UNBECOMING",
"UNBEFRIENDED",
"UNBELIEVABLE",
"UNBELOVED",
"UNBIASED",
"UNBIOLOGICAL",
"UNBLACKED",
"UNBLACKENED",
"UNBLUED",
"UNBROWNED",
"UNBUOYANT",
"UNBURIED",
"UNBURNING",
"UNCALORIFIC",
"UNCANNY",
"UNCAPITALISTIC",
"UNCARNIVOROUS",
"UNCATALOGUED",
"UNCATEGORISED",
"UNCERTAIN",
"UNCHANGED",
"UNCHARITABLE",
"UNCHEERABLE",
"UNCHEERED",
"UNCHEERFUL",
"UNCHEERING",
"UNCHEERY",
"UNCHILDISH",
"UNCHILDLIKE",
"UNCITIZENLY",
"UNCIVIC",
"UNCIVIL",
"UNCIVILISABLE",
"UNCIVILISED",
"UNCLEAN",
"UNCLEANABLE",
"UNCLEANED",
"UNCLEANSABLE",
"UNCLEANSED",
"UNCLEAR",
"UNCOLOURABLE",
"UNCOLOURED",
"UNCOMFORTABLE",
"UNCOMMON",
"UNCOMPETENT",
"UNCONFIDENT",
"UNCONGESTED",
"UNCONGESTIVE",
"UNCONQUERABLE",
"UNCONSCIOUS",
"UNCONSTANT",
"UNCONSTITUTIONAL",
"UNCONTAGIOUS",
"UNCONTINUOUS",
"UNCONTRADICTABLE",
"UNCONTRADICTED",
"UNCONTRADICTIOUS",
"UNCONTRADICTIVE",
"UNCONTRADICTORY",
"UNCONTROLLABLE",
"UNCOOKED",
"UNCOOPERATIVE",
"UNCOUTH",
"UNCOVERED",
"UNCREATIVE",
"UNCRYSTALLED",
"UNCRYSTALLINE",
"UNCRYSTALLISABLE",
"UNCRYSTALLISED",
"UNCULTURABLE",
"UNCULTURED",
"UNCURABLE",
"UNDAMAGEABLE",
"UNDAMAGED",
"UNDAMAGING",
"UNDEAD",
"UNDECIDED",
"UNDECIPHERABLE",
"UNDEFEATABLE",
"UNDEFEATED",
"UNDEFILED",
"UNDEIFIED",
"UNDEISTICAL",
"UNDEJECTED",
"UNDELICIOUS",
"UNDELIGHTED",
"UNDELIGHTFUL",
"UNDELIGHTING",
"UNDEMOCRATIC",
"UNDENIABLE",
"UNDENOMINATED",
"UNDERAGE",
"UNDERAVERAGE",
"UNDERCOLOURED",
"UNDERCOVER",
"UNDEREDUCATED",
"UNDEREMPLOYED",
"UNDERGROUND",
"UNDERHANDED",
"UNDERPOWERED",
"UNDERPRICED",
"UNDERPRIVILEGED",
"UNDERQUALIFIED",
"UNDERSTATED",
"UNDERSTOOD",
"UNDERTERRESTRIAL",
"UNDERWEIGHT",
"UNDESIRABLE",
"UNDESIRED",
"UNDESIROUS",
"UNDESPAIRED",
"UNDESPAIRING",
"UNDESPISED",
"UNDESPISING",
"UNDESPONDENT",
"UNDESPOTIC",
"UNDESTINED",
"UNDESTITUTE",
"UNDESTROYED",
"UNDESTRUCTIBLE",
"UNDESTRUCTIVE",
"UNDEVILISH",
"UNDIFFICULT",
"UNDIGESTIBLE",
"UNDIGNIFIED",
"UNDIPLOMATIC",
"UNDISEASED",
"UNDISGRACED",
"UNDISGUSTED",
"UNDISHEARTENED",
"UNDISHEVELED",
"UNDISHEVELLED",
"UNDISHONOURED",
"UNDIVINABLE",
"UNDIVINED",
"UNDIVINING",
"UNDRAMATIC",
"UNDRAMATICAL",
"UNDRAMATISABLE",
"UNDRAMATISED",
"UNDRINKABLE",
"UNDYED",
"UNEARTHLY",
"UNEASY",
"UNECONOMIC",
"UNECONOMICAL",
"UNECONOMISING",
"UNEDUCATED",
"UNEMOTIONAL",
"UNEMPLOYED",
"UNEMPTIED",
"UNEMPTY",
"UNENTERTAINABLE",
"UNENTERTAINED",
"UNENTERTAINING",
"UNENTHUSIASTIC",
"UNEQUAL",
"UNEQUALED",
"UNEQUALLED",
"UNETHICAL",
"UNEVOLVED",
"UNEVOLVING",
"UNEXISTENT",
"UNEXISTENTIAL",
"UNEXISTING",
"UNEXPECTED",
"UNEXPERIMENTAL",
"UNEXPLAINABLE",
"UNEXPLAINED",
"UNEXTRAORDINARY",
"UNEXTRAVAGANT",
"UNFAIR",
"UNFAITHFUL",
"UNFASHIONABLE",
"UNFAVOURABLE",
"UNFEARED",
"UNFEARFUL",
"UNFEARING",
"UNFEELING",
"UNFIRED",
"UNFIRING",
"UNFIT",
"UNFLESHLY",
"UNFOOLED",
"UNFOOLISH",
"UNFORGIVING",
"UNFORTUNATE",
"UNFRAGRANT",
"UNFRIENDED",
"UNFRIGHTENED",
"UNFRIGHTENING",
"UNGENTLEMANLY",
"UNGEOMETRIC",
"UNGEOMETRICAL",
"UNGLACIAL",
"UNGLACIATED",
"UNGODLIKE",
"UNGODLY",
"UNGRACIOUS",
"UNGRAMMATICAL",
"UNGREENED",
"UNHAPPY",
"UNHEALTHY",
"UNHEAVENLY",
"UNHEEDFUL",
"UNHEEDING",
"UNHELPFUL",
"UNHELPING",
"UNHISTORIC",
"UNHISTORICAL",
"UNHISTORIED",
"UNHOLY",
"UNHONOURED",
"UNHUMAN",
"UNHUMANE",
"UNHUMANISTIC",
"UNHUMANITARIAN",
"UNHYDRATED",
"UNHYGENIC",
"UNHYGIENIC",
"UNICOLOR",
"UNIDENTIFIABLE",
"UNIDENTIFIED",
"UNIFORM",
"UNIFORMITARIAN",
"UNILATERAL",
"UNILATERALISED",
"UNILITERAL",
"UNIMAGINABLE",
"UNIMAGINATIVE",
"UNIMMUNISED",
"UNIMPORTANT",
"UNIMPOVERISHED",
"UNINCORPORATED",
"UNINFECTED",
"UNINFECTIOUS",
"UNINFESTED",
"UNINFORMED",
"UNINSPIRABLE",
"UNINSPIRED",
"UNINSPIRING",
"UNINSURED",
"UNINTELLECTUAL",
"UNINTELLIGENT",
"UNINTENTIONAL",
"UNINTERESTED",
"UNINTERESTING",
"UNINTROVERSIVE",
"UNINTROVERTED",
"UNINVINCIBLE",
"UNINVOLVED",
"UNIQUE",
"UNIRRITABLE",
"UNIRRITATED",
"UNISEX",
"UNITED",
"UNIVERSAL",
"UNJUST",
"UNKEMPT",
"UNKIND",
"UNKINDHEARTED",
"UNKISSED",
"UNKNOWN",
"UNLAWFUL",
"UNLEGAL",
"UNLEGALISED",
"UNLEGISLATED",
"UNLEGISLATIVE",
"UNLEISURELY",
"UNLIBERALISED",
"UNLIBERALIZED",
"UNLIBERATED",
"UNLIGHT",
"UNLIGHTED",
"UNLIGHTENED",
"UNLIKELY",
"UNLIMITED",
"UNLIT",
"UNLITERARY",
"UNLITERATE",
"UNLOVABLE",
"UNLOVED",
"UNLOVELY",
"UNLUCKY",
"UNLUNAR",
"UNLUXURIANT",
"UNLUXURIATING",
"UNLUXURIOUS",
"UNMARRIED",
"UNMATHEMATICAL",
"UNMEDICAL",
"UNMEDICINAL",
"UNMELODRAMATIC",
"UNMELTED",
"UNMERCENARY",
"UNMERCHANTABLE",
"UNMERCIFUL",
"UNMETALLED",
"UNMETALLIC",
"UNMETALLURGIC",
"UNMETALLURGICAL",
"UNMINDFUL",
"UNMODIFIED",
"UNMONARCHIC",
"UNMONARCHICAL",
"UNMOTIVATED",
"UNMYSTIC",
"UNMYSTICAL",
"UNMYSTIFIED",
"UNMYTHICAL",
"UNMYTHOLOGICAL",
"UNNARROWMINDED",
"UNNATIONAL",
"UNNATIONALISED",
"UNNATIONALISTIC",
"UNNECESSARY",
"UNNEEDED",
"UNNOTED",
"UNNOTEWORTHY",
"UNNOTICEABLE",
"UNNOTICED",
"UNOBJECTIVE",
"UNOBSERVANT",
"UNOCEANIC",
"UNODORIFEROUS",
"UNODOROUS",
"UNOPERATABLE",
"UNOPINIONATED",
"UNOPINIONED",
"UNOPTIMISTIC",
"UNOSTENTATIOUS",
"UNOUTLAWED",
"UNPACIFIED",
"UNPACIFISTIC",
"UNPAID",
"UNPARALLELED",
"UNPARALYSED",
"UNPARENTHESISED",
"UNPARENTHESIZED",
"UNPARENTHETIC",
"UNPARENTHETICAL",
"UNPHILOSOPHIC",
"UNPHILOSOPHICAL",
"UNPLAYABLE",
"UNPLAYFUL",
"UNPLEASANT",
"UNPLEASED",
"UNPLEASING",
"UNPLEASURABLE",
"UNPOLICED",
"UNPOLITICAL",
"UNPOPULAR",
"UNPRAISEWORTHY",
"UNPREDESTINED",
"UNPREDICTABLE",
"UNPRETENDING",
"UNPRETENTIOUS",
"UNPRINCIPLED",
"UNPROFESSIONAL",
"UNPROFITABLE",
"UNPRONOUNCEABLE",
"UNPROPHESIED",
"UNPROPHETIC",
"UNPROPHETICAL",
"UNPROTECTED",
"UNPSYCHIC",
"UNPSYCHOLOGICAL",
"UNPSYCHOPATHIC",
"UNPSYCHOTIC",
"UNPURIFIED",
"UNQUALIFIED",
"UNQUENCHABLE",
"UNQUENCHED",
"UNQUIET",
"UNQUIETABLE",
"UNQUIETED",
"UNQUIETING",
"UNRATIONABLE",
"UNRATIONAL",
"UNRATIONALISED",
"UNRATIONALISING",
"UNREAD",
"UNREADABLE",
"UNREAL",
"UNREALISTIC",
"UNREASONABLE",
"UNRECTANGULAR",
"UNREFRIGERATED",
"UNREGAL",
"UNRELATIVE",
"UNRELATIVISTIC",
"UNRELAXABLE",
"UNRELAXED",
"UNRELAXING",
"UNRELIGIONED",
"UNRELIGIOUS",
"UNREMARKABLE",
"UNREMORSEFUL",
"UNREPUTABLE",
"UNRESTRAINED",
"UNRESTRICTED",
"UNRESTRICTIVE",
"UNRIDEABLE",
"UNRITUAL",
"UNRITUALISTIC",
"UNRIVALED",
"UNROMANTIC",
"UNROMANTICISED",
"UNROUNDED",
"UNRULY",
"UNSAFE",
"UNSAINTED",
"UNSAINTLY",
"UNSALTED",
"UNSALTY",
"UNSANITARY",
"UNSANITISED",
"UNSANITIZED",
"UNSATISFIED",
"UNSAVOURY",
"UNSCHOLASTIC",
"UNSCHOOLED",
"UNSCIENTIFIC",
"UNSCRUPULOUS",
"UNSECULAR",
"UNSECULARISED",
"UNSECURE",
"UNSELFISH",
"UNSENTIENT",
"UNSHAKABLE",
"UNSHAKEN",
"UNSIGHTLY",
"UNSINFUL",
"UNSINKABLE",
"UNSKEPTICAL",
"UNSKILLFUL",
"UNSLEEPY",
"UNSOCIAL",
"UNSOLAR",
"UNSOLEMN",
"UNSOLEMNIFIED",
"UNSOLEMNISED",
"UNSOLICITATED",
"UNSOLICITED",
"UNSOLICITOUS",
"UNSOPHISTICATED",
"UNSPECIALIZED",
"UNSPECIFIC",
"UNSPECIFIED",
"UNSPECTACULAR",
"UNSPHERICAL",
"UNSPIRITED",
"UNSPIRITING",
"UNSPIRITUAL",
"UNSTABLE",
"UNSTOPPABLE",
"UNSUBJECTIVE",
"UNSUCCESSFUL",
"UNSUITABLE",
"UNSUITED",
"UNSURE",
"UNSUSPECTING",
"UNSUSTAINABLE",
"UNSWEET",
"UNSWEETENED",
"UNSYLLABICATED",
"UNSYLLABIFIED",
"UNSYLLABLED",
"UNSYMPATHETIC",
"UNTALENTED",
"UNTAMEABLE",
"UNTERRESTRIAL",
"UNTHANKFUL",
"UNTHANKING",
"UNTHEATRIC",
"UNTHEOLOGIC",
"UNTHEOLOGICAL",
"UNTHINKABLE",
"UNTHINKING",
"UNTIDIED",
"UNTIDY",
"UNTIDYING",
"UNTIMELY",
"UNTIRING",
"UNTOUCHABLE",
"UNTRADITIONAL",
"UNTRIGONOMETRIC",
"UNTRIGONOMETRICAL",
"UNTROUBLESOME",
"UNTRUSTING",
"UNTRUTHFUL",
"UNUNBIUM",
"UNUNHEXIUM",
"UNUNOCTIUM",
"UNUNPENTIUM",
"UNUNQUADIUM",
"UNUNSEPTIUM",
"UNUNTRIUM",
"UNUSUAL",
"UNVACANT",
"UNVAGRANT",
"UNVENTURESOME",
"UNVENTUROUS",
"UNVERIFIABLE",
"UNVERIFIED",
"UNWANTED",
"UNWASHED",
"UNWASTEFUL",
"UNWEALTHY",
"UNWEARIED",
"UNWELCOME",
"UNWHITE",
"UNWHITED",
"UNWHITENED",
"UNWHITEWASHED",
"UNWHOLESOME",
"UNWIELDABLE",
"UNWIELDY",
"UNWILLING",
"UNWISE",
"UNWITTY",
"UNWOMANISH",
"UNWOMANLIKE",
"UNWORLDLY",
"UNWORTHY",
"UPBEAT",
"UPPER",
"UPPERCLASS",
"UPPITY",
"UPRIGHT",
"UPSET",
"UPSTANDING",
"UPTIGHT",
"URANIUM",
"URBAN",
"URBANE",
"URGENT",
"UROLOGICAL",
"USABLE",
"USED",
"USEFUL",
"USELESS",
"USUAL",
"USURIOUS",
"UTILITARIAN",
"UTILIZABLE",
"UTOPIAN",
"UTOPIC",
"VACANT",
"VACCINATED",
"VACUOUS",
"VAGUE",
"VAIN",
"VAINGLORIOUS",
"VALIANT",
"VALID",
"VALOROUS",
"VALUABLE",
"VALUED",
"VAMPIRIC",
"VANILLA",
"VANILLIC",
"VANITIED",
"VANQUISHABLE",
"VAPID",
"VAPORESCENT",
"VAPORIFIC",
"VAPORISH",
"VAPOROUS",
"VAPORY",
"VAPOURESCENT",
"VAPOURIFIC",
"VAPOURISH",
"VAPOURY",
"VARIABLE",
"VARICOLOURED",
"VARIED",
"VARVE",
"VARYING",
"VAST",
"VATERITE",
"VEGAN",
"VEGANARCHIST",
"VEGETAL",
"VEGETARIAN",
"VEGETATIVE",
"VEINY",
"VELLUM",
"VELOUR",
"VELVET",
"VELVETEEN",
"VELVETY",
"VENAL",
"VENERABLE",
"VENERATED",
"VENGEFUL",
"VENOMOUS",
"VENTRILOQUIAL",
"VENTRILOQUISTIC",
"VENTURESOME",
"VENTUROUS",
"VENUSTRAPHOBIC",
"VERASTILE",
"VERBOSE",
"VERIFIABLE",
"VERIFIED",
"VERMICIDAL",
"VERMICULAR",
"VERMIFORM",
"VERMILLION",
"VERMINOUS",
"VERMIVOROUS",
"VERNAL",
"VERSICOLOR",
"VERTICAL",
"VERYBLUE",
"VERYFLYING",
"VERYMAD",
"VERYVERYBLUE",
"VERYVERYFLYING",
"VERYVERYMAD",
"VERYVERYVERYBLUE",
"VERYVERYVERYFLYING",
"VERYVERYVERYMAD",
"VESTIGIAL",
"VEXATIOUS",
"VIBRANT",
"VICEREGAL",
"VICIOUS",
"VICTIMIZED",
"VICTORIOUS",
"VIDEOPHILIC",
"VIEWABLE",
"VIGILANT",
"VIGOROUS",
"VILE",
"VILLAINOUS",
"VINCIBLE",
"VINEGARISH",
"VINEGARY",
"VINICULTURAL",
"VINIFERA",
"VINYL",
"VIOLENT",
"VIOLET",
"VIOLETY",
"VIPERINE",
"VIPERISH",
"VIPEROUS",
"VIRAL",
"VIRILE",
"VIRTUOUS",
"VISIBLE",
"VISIONARY",
"VITAL",
"VITRIOLIC",
"VIVACIOUS",
"VIVID",
"VIXENISH",
"VIXENLY",
"VOCATIONAL",
"VOGUISH",
"VOLATILE",
"VOLCANIC",
"VOLCANOLOGIC",
"VOLCANOLOGICAL",
"VOLTAIC",
"VOLUMED",
"VOLUMINOUS",
"VOLUPTUARY",
"VOLUPTUOUS",
"VOODOOISTIC",
"VORACIOUS",
"VULCANIAN",
"VULCANISABLE",
"VULCANOLOGICAL",
"VULGAR",
"VULNERABLE",
"VULPINE",
"VUVUZELAISH",
"WACKY",
"WAFERY",
"WAGELESS",
"WAGEWORKING",
"WAILFUL",
"WAILSOME",
"WAITING",
"WAKEFUL",
"WAKELESS",
"WALKING",
"WANDERING",
"WANTED",
"WARLESS",
"WARLIKE",
"WARM",
"WARMBLOODED",
"WARMHEARTED",
"WARMISH",
"WARMTHLESS",
"WARRIORLIKE",
"WARTLIKE",
"WARTY",
"WARY",
"WASHABLE",
"WASHEDOUT",
"WASHEDUP",
"WASPISH",
"WASPY",
"WASTEFUL",
"WATCHFUL",
"WATERREPELLENT",
"WATERRESISTANT",
"WATERBORNE",
"WATERBREATHING",
"WATERCOLOUR",
"WATEREDDOWN",
"WATERISH",
"WATERLOCKED",
"WATERLOG",
"WATERLOGGED",
"WATERPROOF",
"WATERTIGHT",
"WATERWORN",
"WATERY",
"WAVY",
"WAX",
"WAXY",
"WAYFARING",
"WAYWARD",
"WEAK",
"WEAKMINDED",
"WEAKENED",
"WEAKHANDED",
"WEAKISH",
"WEAKLY",
"WEAKWILLED",
"WEALTHY",
"WEAPONED",
"WEAPONISED",
"WEAPONLESS",
"WEARABLE",
"WEARIED",
"WEARIFUL",
"WEARILESS",
"WEARING",
"WEARISH",
"WEARISOME",
"WEARPROOF",
"WEARY",
"WEARYING",
"WEATHERBEATEN",
"WEATHERED",
"WEATHERPROOF",
"WEATHERTIGHT",
"WEATHERWORN",
"WEBBED",
"WEBBY",
"WEDDED",
"WEE",
"WEEDY",
"WEEPING",
"WEEPY",
"WEIGHABLE",
"WEIGHTED",
"WEIGHTLESS",
"WEIGHTY",
"WEIRD",
"WELCOME",
"WELL",
"WELLACCEPTED",
"WELLBELOVED",
"WELLBLACKED",
"WELLBORN",
"WELLBROWNED",
"WELLCOLOURED",
"WELLCULTURED",
"WELLDESIRED",
"WELLDESTROYED",
"WELLDRAMATIZED",
"WELLDRESSED",
"WELLEDUCATED",
"WELLFRECKLED",
"WELLGROOMED",
"WELLKNOTTED",
"WELLKNOWN",
"WELLLOVED",
"WELLMADE",
"WELLMANNERED",
"WELLNEEDED",
"WELLOFF",
"WELLPHILOSOPHISED",
"WELLPLEASED",
"WELLPOLICED",
"WELLUNDERSTOOD",
"WEREWOLFLIKE",
"WESTBOUND",
"WESTERN",
"WESTERNMOST",
"WET",
"WETPROOF",
"WETPROOF",
"WETTISH",
"WHACKY",
"WHEAT",
"WHEEZY",
"WHIMSICAL",
"WHITE",
"WHITECOLLAR",
"WHITEFACED",
"WHITELIVERED",
"WHITED",
"WHITISH",
"WHOLESOULED",
"WHOLEWHEAT",
"WHOLEHEARTED",
"WHOLESOME",
"WICKED",
"WIDE",
"WIDEAWAKE",
"WIDEEYED",
"WIDESPREAD",
"WIDISH",
"WIELDABLE",
"WIELDY",
"WIFELY",
"WILD",
"WILFUL",
"WILLING",
"WILY",
"WIMPY",
"WINDED",
"WINDOWY",
"WINDY",
"WINGED",
"WINGLESS",
"WINNING",
"WINSOME",
"WINTERHARDY",
"WINTERISH",
"WINTERY",
"WINTRY",
"WIRED",
"WISDOMLESS",
"WISE",
"WISED",
"WISHFUL",
"WISPY",
"WISTERIA",
"WISTFUL",
"WITCHING",
"WITCHY",
"WITLESS",
"WITTED",
"WITTING",
"WITTY",
"WIZARDLIKE",
"WIZARDLY",
"WOEBEGONE",
"WOEFUL",
"WOESOME",
"WOLFISH",
"WOLFLIKE",
"WOMANISH",
"WOMANLY",
"WONDERSTRICKEN",
"WONDERFUL",
"WONDROUS",
"WOOD",
"WOODBLOCK",
"WOODED",
"WOODEN",
"WOODENHEADED",
"WOODSY",
"WOODY",
"WOOL",
"WOOLLEN",
"WOOLLY",
"WOOLLYHEADED",
"WOOZY",
"WORDPERFECT",
"WORDY",
"WORKING",
"WORKINGCLASS",
"WORLDLYMINDED",
"WORLDLYWISE",
"WORLDWIDE",
"WORMISH",
"WORMLIKE",
"WORMY",
"WORNOUT",
"WORRIED",
"WORRILESS",
"WORRISOME",
"WORRYING",
"WORSE",
"WORTHLESS",
"WORTHWHILE",
"WORTHY",
"WOUNDED",
"WRAITHLIKE",
"WRAITHLIKE",
"WRAPPED",
"WRATHFUL",
"WRETCHED",
"WRINKLEABLE",
"WRINKLED",
"WRINKLELESS",
"WRINKLY",
"WRITTEN",
"WRONGHEADED",
"WRONGFUL",
"WROTH",
"WROUGHTIRON",
"WUTHERING",
"XENOPHOBIC",
"XEROPHAGOUS",
"XEROPHOBIC",
"XYLOPHAGOUS",
"YEASTY",
"YELLOW",
"YELLOWBELLIED",
"YELLOWISH",
"YESTER",
"YESTERN",
"YIELDING",
"YOKELISH",
"YOUNG",
"YOUTHFUL",
"YUMMY",
"YOGIC",
"ZANY",
"ZANYISH",
"ZEALOUS",
"ZEBRAPRINT",
"ZEBRAIC",
"ZEBRAPRINT",
"ZEBRINE",
"ZINCIC",
"ZINCIFEROUS",
"ZINCKY",
"ZINCOID",
"ZINCOUS",
"ZINCY",
"ZINNWALDITE",
"ZIPPERED",
"ZIPPY",
"ZIRCON",
"ZODIACAL",
"ZOISITE",
"ZOMBIE",
"ZOMBIFIED",
"ZOOGRAPHIC",
"ZOOGRAPHICAL",
"ZOOLATROUS",
"ZOOLOGICAL",
"ZOOMETRIC",
"ZOOMETRICAL",
"ZOOPHAGOUS",
"ZOOPHOBIC"
];
|
a-type/adjective-adjective-animal
|
lib/lists/adjectives.js
|
JavaScript
|
mit
| 120,695 |
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["Active Users"] = {
"filters": [
]
}
|
rohitw1991/smartfrappe
|
frappe/core/report/active_users/active_users.js
|
JavaScript
|
mit
| 186 |
'use strict';
const estraverse = require('estraverse');
const escodegen = require('escodegen');
const sqlite3 = require('sqlite3').verbose();
class SqlOptimizer {
constructor(database) {
this.database = database;
this.data = {};
}
load() {
return new Promise((resolve) => {
this.db = new sqlite3.Database(this.database);
resolve(true);
}).then(() => {
return new Promise((resolve, reject) => {
// テーブル一覧の取得
const tables = [];
this.db.all(`SELECT name FROM sqlite_master WHERE type = 'table'`, (err, rows) => {
if (err) {
reject(err);
}
rows.forEach((row) => {
tables.push(row.name);
});
resolve(tables);
});
});
}).then((tables) => {
const promises = [];
tables.forEach((table) => {
this.data[table] = {};
promises.push(new Promise((resolve, reject) => {
this.db.all(`SELECT * FROM ${table}`, (err, rows) => {
if (err) {
reject(err);
}
rows.forEach((row) => {
this.data[table][row.label] = row;
});
resolve(true);
});
}));
});
return Promise.all(promises);
}).then(() => {
return new Promise((resolve) => {
this.db.close();
resolve(true);
});
});
}
optimize(ast) {
const data = this.data;
estraverse.replace(ast, {
enter: function (node) {
if (node.type == 'MemberExpression') {
const newNode = replaceNode(node, data);
if (newNode) {
return newNode;
}
}
},
});
return ast;
}
}
function replaceNode(node, data) {
const code = escodegen.generate(node);
if (code.startsWith('tkMock.Sql')) {
// tableまで指定があるかチェック
const tokens = code.split('.');
if (tokens.length != 4) {
return false;
}
// テーブル名, key, カラム名を取得
const table = tokens[2];
let key, column = 'id';
if (node.computed == true) {
column = node.property.value;
key = node.object.property.name;
} else {
key = node.property.name;
}
// 値が見つからなかった場合、エラーにする
if (typeof data[table][key] === 'undefined' || typeof data[table][key][column] === 'undefined') {
throw Error(`optimizerSql 値が見つかりませんでした: ${table} ${key} ${column}`);
}
const value = data[table][key][column];
if (value < 0) {
return {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Literal",
"value": value * -1,
},
"prefix": true
};
} else {
return {"type": "Literal", "value": value};
}
}
}
module.exports = SqlOptimizer;
|
lpre-ys/js-to-tkcode
|
js/lib/optimizer/sql-optimizer.js
|
JavaScript
|
mit
| 2,914 |
import _map from "./internal/map";
import curry2 from "./internal/curry2";
import checkForMethod from "./internal/check_for_method";
/**
* Returns a new list, constructed by applying the supplied function to every element of the
* supplied list.
*
* Note: `ramda.map` does not skip deleted or unassigned indices (sparse arrays), unlike the
* native `Array.prototype.map` method. For more details on this behavior, see:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map#Description
*
* @func
* @memberOf R
* @category List
* @param {Function} fn The function to be called on every element of the input `list`.
* @param {Array} list The list to be iterated over.
* @return {Array} The new list.
* @example
*
* var double = function(x) {
* return x * 2;
* };
*
* ramda.map(double, [1, 2, 3]); //=> [2, 4, 6]
*/
var map = curry2(checkForMethod('map', _map));
/**
* Like `map`, but but passes additional parameters to the predicate function.
*
* `fn` receives three arguments: *(value, index, list)*.
*
* Note: `ramda.map.idx` does not skip deleted or unassigned indices (sparse arrays), unlike
* the native `Array.prototype.map` method. For more details on this behavior, see:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map#Description
*
* @func
* @memberOf R
* @category List
* @param {Function} fn The function to be called on every element of the input `list`.
* @param {Array} list The list to be iterated over.
* @return {Array} The new list.
* @alias map.idx
* @example
*
* var squareEnds = function(elt, idx, list) {
* if (idx === 0 || idx === list.length - 1) {
* return elt * elt;
* }
* return elt;
* };
*
* ramda.map.idx(squareEnds, [8, 6, 7, 5, 3, 0, 9];
* //=> [64, 6, 7, 5, 3, 0, 81]
*/
map.idx = curry2(checkForMethod('map', function _mapIdx(fn, list) {
var idx = -1, len = list.length, result = new Array(len);
while (++idx < len) {
result[idx] = fn(list[idx], idx, list);
}
return result;
}));
export default map;
|
markprzepiora/eigensheep
|
eigensheep/map.js
|
JavaScript
|
mit
| 2,162 |
// Destroys the localStorage copy of CSS that less.js creates
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/'
if (!window.localStorage || !less || less.env !== 'development') {
return;
}
var host = window.location.host;
var protocol = window.location.protocol;
var keyPrefix = protocol + '//' + host + pathToCss;
for (var key in window.localStorage) {
if (key.indexOf(keyPrefix) === 0) {
delete window.localStorage[key];
}
}
}
destroyLessCache('/css/');
|
prodeko-mediakeisari/Ilmokilke
|
web/js/functions.js
|
JavaScript
|
mit
| 517 |
'use strict';
var _ = require('lodash');
var glou = require('..');
function $initInsert(getArgs) {
_(arguments).shift();
// to be rewritten as a proper independent plugin on v2
var args = getArgs(
glou
.pipe(glou.plugins.swallow)
.pipe.apply(null, arguments)
);
return this.parallel.apply(null, args);
}
module.exports.prepend = _.partial($initInsert, function(arg) {
return [arg, glou.plugins.noop];
});
module.exports.append = _.partial($initInsert, function(arg) {
return [glou.plugins.noop, arg];
});
|
evanliomain/presentation_meteor
|
node_modules/glou/lib/pipelines/insert.js
|
JavaScript
|
mit
| 542 |
// Generated by CoffeeScript 1.7.1
requirejs.config({
urlArgs: "?ver=" + (Math.random()),
baseUrl: '../',
paths: {
jquery: 'bower_components/jquery/dist/jquery',
backbone: 'bower_components/backbone/backbone',
underscore: 'bower_components/underscore/underscore',
marionette: 'bower_components/marionette/lib/core/backbone.marionette',
mustache: 'bower_components/mustache/mustache',
text: 'bower_components/requirejs-text/text',
backbonesyphon: 'bower_components/backbone.syphon/lib/amd/backbone.syphon',
'backbone.wreqr': 'bower_components/backbone.wreqr/lib/backbone.wreqr',
'backbone.babysitter': 'bower_components/backbone.babysitter/lib/backbone.babysitter',
plupload: 'bower_components/plupload/js/plupload.full.min',
jasmineajax: 'bower_components/jasmine-ajax/lib/mock-ajax',
jasminejquery: 'bower_components/jasmine-jquery/lib/jasmine-jquery',
jqueryvalidate: 'bower_components/jquery.validation/dist/jquery.validate',
plupload: 'bower_components/plupload/js/plupload.full.min',
async: 'bower_components/async/lib/async',
bootstraptour: 'bower_components/bootstrap-tour/build/js/bootstrap-tour',
underscorestring: 'bower_components/underscore.string/lib/underscore.string',
extm: 'tmp/extm.amd'
},
shim: {
jquery: ['underscore'],
underscorestring: ['underscore'],
backbone: ['jquery', 'underscore'],
marionette: {
deps: ['backbone', 'backbone.wreqr', 'backbone.babysitter']
},
backbonesyphon: ['backbone'],
backboneassociations: ['backbone'],
jqueryvalidate: ['jquery'],
bootstrap: ['jquery'],
bootstraptour: ['bootstrap'],
jasminejquery: ['jquery'],
jasmineajax: ['jquery'],
plupload: {
deps: ['jquery'],
exports: 'plupload'
},
'entities-loader': ['extm'],
'apps-loader': ['entities-loader']
}
});
|
ajency/ExtM
|
app/js/requirejs.config.js
|
JavaScript
|
mit
| 1,875 |
/**
* interact.js v1.2.4
*
* Copyright (c) 2012-2015 Taye Adeyemi <dev@taye.me>
* Open source under the MIT License.
* https://raw.github.com/taye/interact.js/master/LICENSE
*/
(function (realWindow) {
'use strict';
// return early if there's no window to work with (eg. Node.js)
if (!realWindow) { return; }
var // get wrapped window if using Shadow DOM polyfill
window = (function () {
// create a TextNode
var el = realWindow.document.createTextNode('');
// check if it's wrapped by a polyfill
if (el.ownerDocument !== realWindow.document
&& typeof realWindow.wrap === 'function'
&& realWindow.wrap(el) === el) {
// return wrapped window
return realWindow.wrap(realWindow);
}
// no Shadow DOM polyfil or native implementation
return realWindow;
}()),
document = window.document,
DocumentFragment = window.DocumentFragment || blank,
SVGElement = window.SVGElement || blank,
SVGSVGElement = window.SVGSVGElement || blank,
SVGElementInstance = window.SVGElementInstance || blank,
HTMLElement = window.HTMLElement || window.Element,
PointerEvent = (window.PointerEvent || window.MSPointerEvent),
pEventTypes,
hypot = Math.hypot || function (x, y) { return Math.sqrt(x * x + y * y); },
tmpXY = {}, // reduce object creation in getXY()
documents = [], // all documents being listened to
interactables = [], // all set interactables
interactions = [], // all interactions
dynamicDrop = false,
// {
// type: {
// selectors: ['selector', ...],
// contexts : [document, ...],
// listeners: [[listener, useCapture], ...]
// }
// }
delegatedEvents = {},
defaultOptions = {
base: {
accept : null,
actionChecker : null,
styleCursor : true,
preventDefault: 'auto',
origin : { x: 0, y: 0 },
deltaSource : 'page',
allowFrom : null,
ignoreFrom : null,
_context : document,
dropChecker : null
},
drag: {
enabled: false,
manualStart: true,
max: Infinity,
maxPerElement: 1,
snap: null,
restrict: null,
inertia: null,
autoScroll: null,
axis: 'xy',
},
drop: {
enabled: false,
accept: null,
overlap: 'pointer'
},
resize: {
enabled: false,
manualStart: false,
max: Infinity,
maxPerElement: 1,
snap: null,
restrict: null,
inertia: null,
autoScroll: null,
square: false,
axis: 'xy',
// use default margin
margin: NaN,
// object with props left, right, top, bottom which are
// true/false values to resize when the pointer is over that edge,
// CSS selectors to match the handles for each direction
// or the Elements for each handle
edges: null,
// a value of 'none' will limit the resize rect to a minimum of 0x0
// 'negate' will alow the rect to have negative width/height
// 'reposition' will keep the width/height positive by swapping
// the top and bottom edges and/or swapping the left and right edges
invert: 'none'
},
gesture: {
manualStart: false,
enabled: false,
max: Infinity,
maxPerElement: 1,
restrict: null
},
perAction: {
manualStart: false,
max: Infinity,
maxPerElement: 1,
snap: {
enabled : false,
endOnly : false,
range : Infinity,
targets : null,
offsets : null,
relativePoints: null
},
restrict: {
enabled: false,
endOnly: false
},
autoScroll: {
enabled : false,
container : null, // the item that is scrolled (Window or HTMLElement)
margin : 60,
speed : 300 // the scroll speed in pixels per second
},
inertia: {
enabled : false,
resistance : 10, // the lambda in exponential decay
minSpeed : 100, // target speed must be above this for inertia to start
endSpeed : 10, // the speed at which inertia is slow enough to stop
allowResume : true, // allow resuming an action in inertia phase
zeroResumeDelta : true, // if an action is resumed after launch, set dx/dy to 0
smoothEndDuration: 300 // animate to snap/restrict endOnly if there's no inertia
}
},
_holdDuration: 600
},
// Things related to autoScroll
autoScroll = {
interaction: null,
i: null, // the handle returned by window.setInterval
x: 0, y: 0, // Direction each pulse is to scroll in
// scroll the window by the values in scroll.x/y
scroll: function () {
var options = autoScroll.interaction.target.options[autoScroll.interaction.prepared.name].autoScroll,
container = options.container || getWindow(autoScroll.interaction.element),
now = new Date().getTime(),
// change in time in seconds
dt = (now - autoScroll.prevTime) / 1000,
// displacement
s = options.speed * dt;
if (s >= 1) {
if (isWindow(container)) {
container.scrollBy(autoScroll.x * s, autoScroll.y * s);
}
else if (container) {
container.scrollLeft += autoScroll.x * s;
container.scrollTop += autoScroll.y * s;
}
autoScroll.prevTime = now;
}
if (autoScroll.isScrolling) {
cancelFrame(autoScroll.i);
autoScroll.i = reqFrame(autoScroll.scroll);
}
},
isScrolling: false,
prevTime: 0,
start: function (interaction) {
autoScroll.isScrolling = true;
cancelFrame(autoScroll.i);
autoScroll.interaction = interaction;
autoScroll.prevTime = new Date().getTime();
autoScroll.i = reqFrame(autoScroll.scroll);
},
stop: function () {
autoScroll.isScrolling = false;
cancelFrame(autoScroll.i);
}
},
// Does the browser support touch input?
supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
// Does the browser support PointerEvents
supportsPointerEvent = !!PointerEvent,
// Less Precision with touch input
margin = supportsTouch || supportsPointerEvent? 20: 10,
pointerMoveTolerance = 1,
// for ignoring browser's simulated mouse events
prevTouchTime = 0,
// Allow this many interactions to happen simultaneously
maxInteractions = Infinity,
// Check if is IE9 or older
actionCursors = (document.all && !window.atob) ? {
drag : 'move',
resizex : 'e-resize',
resizey : 's-resize',
resizexy: 'se-resize',
resizetop : 'n-resize',
resizeleft : 'w-resize',
resizebottom : 's-resize',
resizeright : 'e-resize',
resizetopleft : 'se-resize',
resizebottomright: 'se-resize',
resizetopright : 'ne-resize',
resizebottomleft : 'ne-resize',
gesture : ''
} : {
drag : 'move',
resizex : 'ew-resize',
resizey : 'ns-resize',
resizexy: 'nwse-resize',
resizetop : 'ns-resize',
resizeleft : 'ew-resize',
resizebottom : 'ns-resize',
resizeright : 'ew-resize',
resizetopleft : 'nwse-resize',
resizebottomright: 'nwse-resize',
resizetopright : 'nesw-resize',
resizebottomleft : 'nesw-resize',
gesture : ''
},
actionIsEnabled = {
drag : true,
resize : true,
gesture: true
},
// because Webkit and Opera still use 'mousewheel' event type
wheelEvent = 'onmousewheel' in document? 'mousewheel': 'wheel',
eventTypes = [
'dragstart',
'dragmove',
'draginertiastart',
'dragend',
'dragenter',
'dragleave',
'dropactivate',
'dropdeactivate',
'dropmove',
'drop',
'resizestart',
'resizemove',
'resizeinertiastart',
'resizeend',
'gesturestart',
'gesturemove',
'gestureinertiastart',
'gestureend',
'down',
'move',
'up',
'cancel',
'tap',
'doubletap',
'hold'
],
globalEvents = {},
// Opera Mobile must be handled differently
isOperaMobile = navigator.appName == 'Opera' &&
supportsTouch &&
navigator.userAgent.match('Presto'),
// scrolling doesn't change the result of
// getBoundingClientRect/getClientRects on iOS <=7 but it does on iOS 8
isIOS7orLower = (/iP(hone|od|ad)/.test(navigator.platform)
&& /OS [1-7][^\d]/.test(navigator.appVersion)),
// prefix matchesSelector
prefixedMatchesSelector = 'matches' in Element.prototype?
'matches': 'webkitMatchesSelector' in Element.prototype?
'webkitMatchesSelector': 'mozMatchesSelector' in Element.prototype?
'mozMatchesSelector': 'oMatchesSelector' in Element.prototype?
'oMatchesSelector': 'msMatchesSelector',
// will be polyfill function if browser is IE8
ie8MatchesSelector,
// native requestAnimationFrame or polyfill
reqFrame = realWindow.requestAnimationFrame,
cancelFrame = realWindow.cancelAnimationFrame,
// Events wrapper
events = (function () {
var useAttachEvent = ('attachEvent' in window) && !('addEventListener' in window),
addEvent = useAttachEvent? 'attachEvent': 'addEventListener',
removeEvent = useAttachEvent? 'detachEvent': 'removeEventListener',
on = useAttachEvent? 'on': '',
elements = [],
targets = [],
attachedListeners = [];
function add (element, type, listener, useCapture) {
var elementIndex = indexOf(elements, element),
target = targets[elementIndex];
if (!target) {
target = {
events: {},
typeCount: 0
};
elementIndex = elements.push(element) - 1;
targets.push(target);
attachedListeners.push((useAttachEvent ? {
supplied: [],
wrapped : [],
useCount: []
} : null));
}
if (!target.events[type]) {
target.events[type] = [];
target.typeCount++;
}
if (!contains(target.events[type], listener)) {
var ret;
if (useAttachEvent) {
var listeners = attachedListeners[elementIndex],
listenerIndex = indexOf(listeners.supplied, listener);
var wrapped = listeners.wrapped[listenerIndex] || function (event) {
if (!event.immediatePropagationStopped) {
event.target = event.srcElement;
event.currentTarget = element;
event.preventDefault = event.preventDefault || preventDef;
event.stopPropagation = event.stopPropagation || stopProp;
event.stopImmediatePropagation = event.stopImmediatePropagation || stopImmProp;
if (/mouse|click/.test(event.type)) {
event.pageX = event.clientX + getWindow(element).document.documentElement.scrollLeft;
event.pageY = event.clientY + getWindow(element).document.documentElement.scrollTop;
}
listener(event);
}
};
ret = element[addEvent](on + type, wrapped, Boolean(useCapture));
if (listenerIndex === -1) {
listeners.supplied.push(listener);
listeners.wrapped.push(wrapped);
listeners.useCount.push(1);
}
else {
listeners.useCount[listenerIndex]++;
}
}
else {
ret = element[addEvent](type, listener, useCapture || false);
}
target.events[type].push(listener);
return ret;
}
}
function remove (element, type, listener, useCapture) {
var i,
elementIndex = indexOf(elements, element),
target = targets[elementIndex],
listeners,
listenerIndex,
wrapped = listener;
if (!target || !target.events) {
return;
}
if (useAttachEvent) {
listeners = attachedListeners[elementIndex];
listenerIndex = indexOf(listeners.supplied, listener);
wrapped = listeners.wrapped[listenerIndex];
}
if (type === 'all') {
for (type in target.events) {
if (target.events.hasOwnProperty(type)) {
remove(element, type, 'all');
}
}
return;
}
if (target.events[type]) {
var len = target.events[type].length;
if (listener === 'all') {
for (i = 0; i < len; i++) {
remove(element, type, target.events[type][i], Boolean(useCapture));
}
return;
} else {
for (i = 0; i < len; i++) {
if (target.events[type][i] === listener) {
element[removeEvent](on + type, wrapped, useCapture || false);
target.events[type].splice(i, 1);
if (useAttachEvent && listeners) {
listeners.useCount[listenerIndex]--;
if (listeners.useCount[listenerIndex] === 0) {
listeners.supplied.splice(listenerIndex, 1);
listeners.wrapped.splice(listenerIndex, 1);
listeners.useCount.splice(listenerIndex, 1);
}
}
break;
}
}
}
if (target.events[type] && target.events[type].length === 0) {
target.events[type] = null;
target.typeCount--;
}
}
if (!target.typeCount) {
targets.splice(elementIndex, 1);
elements.splice(elementIndex, 1);
attachedListeners.splice(elementIndex, 1);
}
}
function preventDef () {
this.returnValue = false;
}
function stopProp () {
this.cancelBubble = true;
}
function stopImmProp () {
this.cancelBubble = true;
this.immediatePropagationStopped = true;
}
return {
add: add,
remove: remove,
useAttachEvent: useAttachEvent,
_elements: elements,
_targets: targets,
_attachedListeners: attachedListeners
};
}());
function blank () {}
function isElement (o) {
if (!o || (typeof o !== 'object')) { return false; }
var _window = getWindow(o) || window;
return (/object|function/.test(typeof _window.Element)
? o instanceof _window.Element //DOM2
: o.nodeType === 1 && typeof o.nodeName === "string");
}
function isWindow (thing) { return !!(thing && thing.Window) && (thing instanceof thing.Window); }
function isDocFrag (thing) { return !!thing && thing instanceof DocumentFragment; }
function isArray (thing) {
return isObject(thing)
&& (typeof thing.length !== undefined)
&& isFunction(thing.splice);
}
function isObject (thing) { return !!thing && (typeof thing === 'object'); }
function isFunction (thing) { return typeof thing === 'function'; }
function isNumber (thing) { return typeof thing === 'number' ; }
function isBool (thing) { return typeof thing === 'boolean' ; }
function isString (thing) { return typeof thing === 'string' ; }
function trySelector (value) {
if (!isString(value)) { return false; }
// an exception will be raised if it is invalid
document.querySelector(value);
return true;
}
function extend (dest, source) {
for (var prop in source) {
dest[prop] = source[prop];
}
return dest;
}
function copyCoords (dest, src) {
dest.page = dest.page || {};
dest.page.x = src.page.x;
dest.page.y = src.page.y;
dest.client = dest.client || {};
dest.client.x = src.client.x;
dest.client.y = src.client.y;
dest.timeStamp = src.timeStamp;
}
function setEventXY (targetObj, pointer, interaction) {
if (!pointer) {
if (interaction.pointerIds.length > 1) {
pointer = touchAverage(interaction.pointers);
}
else {
pointer = interaction.pointers[0];
}
}
getPageXY(pointer, tmpXY, interaction);
targetObj.page.x = tmpXY.x;
targetObj.page.y = tmpXY.y;
getClientXY(pointer, tmpXY, interaction);
targetObj.client.x = tmpXY.x;
targetObj.client.y = tmpXY.y;
targetObj.timeStamp = new Date().getTime();
}
function setEventDeltas (targetObj, prev, cur) {
targetObj.page.x = cur.page.x - prev.page.x;
targetObj.page.y = cur.page.y - prev.page.y;
targetObj.client.x = cur.client.x - prev.client.x;
targetObj.client.y = cur.client.y - prev.client.y;
targetObj.timeStamp = new Date().getTime() - prev.timeStamp;
// set pointer velocity
var dt = Math.max(targetObj.timeStamp / 1000, 0.001);
targetObj.page.speed = hypot(targetObj.page.x, targetObj.page.y) / dt;
targetObj.page.vx = targetObj.page.x / dt;
targetObj.page.vy = targetObj.page.y / dt;
targetObj.client.speed = hypot(targetObj.client.x, targetObj.page.y) / dt;
targetObj.client.vx = targetObj.client.x / dt;
targetObj.client.vy = targetObj.client.y / dt;
}
// Get specified X/Y coords for mouse or event.touches[0]
function getXY (type, pointer, xy) {
xy = xy || {};
type = type || 'page';
xy.x = pointer[type + 'X'];
xy.y = pointer[type + 'Y'];
return xy;
}
function getPageXY (pointer, page, interaction) {
page = page || {};
if (pointer instanceof InteractEvent) {
if (/inertiastart/.test(pointer.type)) {
interaction = interaction || pointer.interaction;
extend(page, interaction.inertiaStatus.upCoords.page);
page.x += interaction.inertiaStatus.sx;
page.y += interaction.inertiaStatus.sy;
}
else {
page.x = pointer.pageX;
page.y = pointer.pageY;
}
}
// Opera Mobile handles the viewport and scrolling oddly
else if (isOperaMobile) {
getXY('screen', pointer, page);
page.x += window.scrollX;
page.y += window.scrollY;
}
else {
getXY('page', pointer, page);
}
return page;
}
function getClientXY (pointer, client, interaction) {
client = client || {};
if (pointer instanceof InteractEvent) {
if (/inertiastart/.test(pointer.type)) {
extend(client, interaction.inertiaStatus.upCoords.client);
client.x += interaction.inertiaStatus.sx;
client.y += interaction.inertiaStatus.sy;
}
else {
client.x = pointer.clientX;
client.y = pointer.clientY;
}
}
else {
// Opera Mobile handles the viewport and scrolling oddly
getXY(isOperaMobile? 'screen': 'client', pointer, client);
}
return client;
}
function getScrollXY (win) {
win = win || window;
return {
x: win.scrollX || win.document.documentElement.scrollLeft,
y: win.scrollY || win.document.documentElement.scrollTop
};
}
function getPointerId (pointer) {
return isNumber(pointer.pointerId)? pointer.pointerId : pointer.identifier;
}
function getActualElement (element) {
return (element instanceof SVGElementInstance
? element.correspondingUseElement
: element);
}
function getWindow (node) {
if (isWindow(node)) {
return node;
}
var rootNode = (node.ownerDocument || node);
return rootNode.defaultView || rootNode.parentWindow || window;
}
function getElementClientRect (element) {
var clientRect = (element instanceof SVGElement
? element.getBoundingClientRect()
: element.getClientRects()[0]);
return clientRect && {
left : clientRect.left,
right : clientRect.right,
top : clientRect.top,
bottom: clientRect.bottom,
width : clientRect.width || clientRect.right - clientRect.left,
height: clientRect.heigh || clientRect.bottom - clientRect.top
};
}
function getElementRect (element) {
var clientRect = getElementClientRect(element);
if (!isIOS7orLower && clientRect) {
var scroll = getScrollXY(getWindow(element));
clientRect.left += scroll.x;
clientRect.right += scroll.x;
clientRect.top += scroll.y;
clientRect.bottom += scroll.y;
}
return clientRect;
}
function getTouchPair (event) {
var touches = [];
// array of touches is supplied
if (isArray(event)) {
touches[0] = event[0];
touches[1] = event[1];
}
// an event
else {
if (event.type === 'touchend') {
if (event.touches.length === 1) {
touches[0] = event.touches[0];
touches[1] = event.changedTouches[0];
}
else if (event.touches.length === 0) {
touches[0] = event.changedTouches[0];
touches[1] = event.changedTouches[1];
}
}
else {
touches[0] = event.touches[0];
touches[1] = event.touches[1];
}
}
return touches;
}
function touchAverage (event) {
var touches = getTouchPair(event);
return {
pageX: (touches[0].pageX + touches[1].pageX) / 2,
pageY: (touches[0].pageY + touches[1].pageY) / 2,
clientX: (touches[0].clientX + touches[1].clientX) / 2,
clientY: (touches[0].clientY + touches[1].clientY) / 2
};
}
function touchBBox (event) {
if (!event.length && !(event.touches && event.touches.length > 1)) {
return;
}
var touches = getTouchPair(event),
minX = Math.min(touches[0].pageX, touches[1].pageX),
minY = Math.min(touches[0].pageY, touches[1].pageY),
maxX = Math.max(touches[0].pageX, touches[1].pageX),
maxY = Math.max(touches[0].pageY, touches[1].pageY);
return {
x: minX,
y: minY,
left: minX,
top: minY,
width: maxX - minX,
height: maxY - minY
};
}
function touchDistance (event, deltaSource) {
deltaSource = deltaSource || defaultOptions.deltaSource;
var sourceX = deltaSource + 'X',
sourceY = deltaSource + 'Y',
touches = getTouchPair(event);
var dx = touches[0][sourceX] - touches[1][sourceX],
dy = touches[0][sourceY] - touches[1][sourceY];
return hypot(dx, dy);
}
function touchAngle (event, prevAngle, deltaSource) {
deltaSource = deltaSource || defaultOptions.deltaSource;
var sourceX = deltaSource + 'X',
sourceY = deltaSource + 'Y',
touches = getTouchPair(event),
dx = touches[0][sourceX] - touches[1][sourceX],
dy = touches[0][sourceY] - touches[1][sourceY],
angle = 180 * Math.atan(dy / dx) / Math.PI;
if (isNumber(prevAngle)) {
var dr = angle - prevAngle,
drClamped = dr % 360;
if (drClamped > 315) {
angle -= 360 + (angle / 360)|0 * 360;
}
else if (drClamped > 135) {
angle -= 180 + (angle / 360)|0 * 360;
}
else if (drClamped < -315) {
angle += 360 + (angle / 360)|0 * 360;
}
else if (drClamped < -135) {
angle += 180 + (angle / 360)|0 * 360;
}
}
return angle;
}
function getOriginXY (interactable, element) {
var origin = interactable
? interactable.options.origin
: defaultOptions.origin;
if (origin === 'parent') {
origin = parentElement(element);
}
else if (origin === 'self') {
origin = interactable.getRect(element);
}
else if (trySelector(origin)) {
origin = closest(element, origin) || { x: 0, y: 0 };
}
if (isFunction(origin)) {
origin = origin(interactable && element);
}
if (isElement(origin)) {
origin = getElementRect(origin);
}
origin.x = ('x' in origin)? origin.x : origin.left;
origin.y = ('y' in origin)? origin.y : origin.top;
return origin;
}
// http://stackoverflow.com/a/5634528/2280888
function _getQBezierValue(t, p1, p2, p3) {
var iT = 1 - t;
return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
}
function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
return {
x: _getQBezierValue(position, startX, cpX, endX),
y: _getQBezierValue(position, startY, cpY, endY)
};
}
// http://gizma.com/easing/
function easeOutQuad (t, b, c, d) {
t /= d;
return -c * t*(t-2) + b;
}
function nodeContains (parent, child) {
while (child) {
if (child === parent) {
return true;
}
child = child.parentNode;
}
return false;
}
function closest (child, selector) {
var parent = parentElement(child);
while (isElement(parent)) {
if (matchesSelector(parent, selector)) { return parent; }
parent = parentElement(parent);
}
return null;
}
function parentElement (node) {
var parent = node.parentNode;
if (isDocFrag(parent)) {
// skip past #shado-root fragments
while ((parent = parent.host) && isDocFrag(parent)) {}
return parent;
}
return parent;
}
function inContext (interactable, element) {
return interactable._context === element.ownerDocument
|| nodeContains(interactable._context, element);
}
function testIgnore (interactable, interactableElement, element) {
var ignoreFrom = interactable.options.ignoreFrom;
if (!ignoreFrom || !isElement(element)) { return false; }
if (isString(ignoreFrom)) {
return matchesUpTo(element, ignoreFrom, interactableElement);
}
else if (isElement(ignoreFrom)) {
return nodeContains(ignoreFrom, element);
}
return false;
}
function testAllow (interactable, interactableElement, element) {
var allowFrom = interactable.options.allowFrom;
if (!allowFrom) { return true; }
if (!isElement(element)) { return false; }
if (isString(allowFrom)) {
return matchesUpTo(element, allowFrom, interactableElement);
}
else if (isElement(allowFrom)) {
return nodeContains(allowFrom, element);
}
return false;
}
function checkAxis (axis, interactable) {
if (!interactable) { return false; }
var thisAxis = interactable.options.drag.axis;
return (axis === 'xy' || thisAxis === 'xy' || thisAxis === axis);
}
function checkSnap (interactable, action) {
var options = interactable.options;
if (/^resize/.test(action)) {
action = 'resize';
}
return options[action].snap && options[action].snap.enabled;
}
function checkRestrict (interactable, action) {
var options = interactable.options;
if (/^resize/.test(action)) {
action = 'resize';
}
return options[action].restrict && options[action].restrict.enabled;
}
function checkAutoScroll (interactable, action) {
var options = interactable.options;
if (/^resize/.test(action)) {
action = 'resize';
}
return options[action].autoScroll && options[action].autoScroll.enabled;
}
function withinInteractionLimit (interactable, element, action) {
var options = interactable.options,
maxActions = options[action.name].max,
maxPerElement = options[action.name].maxPerElement,
activeInteractions = 0,
targetCount = 0,
targetElementCount = 0;
for (var i = 0, len = interactions.length; i < len; i++) {
var interaction = interactions[i],
otherAction = interaction.prepared.name,
active = interaction.interacting();
if (!active) { continue; }
activeInteractions++;
if (activeInteractions >= maxInteractions) {
return false;
}
if (interaction.target !== interactable) { continue; }
targetCount += (otherAction === action.name)|0;
if (targetCount >= maxActions) {
return false;
}
if (interaction.element === element) {
targetElementCount++;
if (otherAction !== action.name || targetElementCount >= maxPerElement) {
return false;
}
}
}
return maxInteractions > 0;
}
// Test for the element that's "above" all other qualifiers
function indexOfDeepestElement (elements) {
var dropzone,
deepestZone = elements[0],
index = deepestZone? 0: -1,
parent,
deepestZoneParents = [],
dropzoneParents = [],
child,
i,
n;
for (i = 1; i < elements.length; i++) {
dropzone = elements[i];
// an element might belong to multiple selector dropzones
if (!dropzone || dropzone === deepestZone) {
continue;
}
if (!deepestZone) {
deepestZone = dropzone;
index = i;
continue;
}
// check if the deepest or current are document.documentElement or document.rootElement
// - if the current dropzone is, do nothing and continue
if (dropzone.parentNode === dropzone.ownerDocument) {
continue;
}
// - if deepest is, update with the current dropzone and continue to next
else if (deepestZone.parentNode === dropzone.ownerDocument) {
deepestZone = dropzone;
index = i;
continue;
}
if (!deepestZoneParents.length) {
parent = deepestZone;
while (parent.parentNode && parent.parentNode !== parent.ownerDocument) {
deepestZoneParents.unshift(parent);
parent = parent.parentNode;
}
}
// if this element is an svg element and the current deepest is
// an HTMLElement
if (deepestZone instanceof HTMLElement
&& dropzone instanceof SVGElement
&& !(dropzone instanceof SVGSVGElement)) {
if (dropzone === deepestZone.parentNode) {
continue;
}
parent = dropzone.ownerSVGElement;
}
else {
parent = dropzone;
}
dropzoneParents = [];
while (parent.parentNode !== parent.ownerDocument) {
dropzoneParents.unshift(parent);
parent = parent.parentNode;
}
n = 0;
// get (position of last common ancestor) + 1
while (dropzoneParents[n] && dropzoneParents[n] === deepestZoneParents[n]) {
n++;
}
var parents = [
dropzoneParents[n - 1],
dropzoneParents[n],
deepestZoneParents[n]
];
child = parents[0].lastChild;
while (child) {
if (child === parents[1]) {
deepestZone = dropzone;
index = i;
deepestZoneParents = [];
break;
}
else if (child === parents[2]) {
break;
}
child = child.previousSibling;
}
}
return index;
}
function Interaction () {
this.target = null; // current interactable being interacted with
this.element = null; // the target element of the interactable
this.dropTarget = null; // the dropzone a drag target might be dropped into
this.dropElement = null; // the element at the time of checking
this.prevDropTarget = null; // the dropzone that was recently dragged away from
this.prevDropElement = null; // the element at the time of checking
this.prepared = { // action that's ready to be fired on next move event
name : null,
axis : null,
edges: null
};
this.matches = []; // all selectors that are matched by target element
this.matchElements = []; // corresponding elements
this.inertiaStatus = {
active : false,
smoothEnd : false,
startEvent: null,
upCoords: {},
xe: 0, ye: 0,
sx: 0, sy: 0,
t0: 0,
vx0: 0, vys: 0,
duration: 0,
resumeDx: 0,
resumeDy: 0,
lambda_v0: 0,
one_ve_v0: 0,
i : null
};
if (isFunction(Function.prototype.bind)) {
this.boundInertiaFrame = this.inertiaFrame.bind(this);
this.boundSmoothEndFrame = this.smoothEndFrame.bind(this);
}
else {
var that = this;
this.boundInertiaFrame = function () { return that.inertiaFrame(); };
this.boundSmoothEndFrame = function () { return that.smoothEndFrame(); };
}
this.activeDrops = {
dropzones: [], // the dropzones that are mentioned below
elements : [], // elements of dropzones that accept the target draggable
rects : [] // the rects of the elements mentioned above
};
// keep track of added pointers
this.pointers = [];
this.pointerIds = [];
this.downTargets = [];
this.downTimes = [];
this.holdTimers = [];
// Previous native pointer move event coordinates
this.prevCoords = {
page : { x: 0, y: 0 },
client : { x: 0, y: 0 },
timeStamp: 0
};
// current native pointer move event coordinates
this.curCoords = {
page : { x: 0, y: 0 },
client : { x: 0, y: 0 },
timeStamp: 0
};
// Starting InteractEvent pointer coordinates
this.startCoords = {
page : { x: 0, y: 0 },
client : { x: 0, y: 0 },
timeStamp: 0
};
// Change in coordinates and time of the pointer
this.pointerDelta = {
page : { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
client : { x: 0, y: 0, vx: 0, vy: 0, speed: 0 },
timeStamp: 0
};
this.downEvent = null; // pointerdown/mousedown/touchstart event
this.downPointer = {};
this._eventTarget = null;
this._curEventTarget = null;
this.prevEvent = null; // previous action event
this.tapTime = 0; // time of the most recent tap event
this.prevTap = null;
this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 };
this.restrictOffset = { left: 0, right: 0, top: 0, bottom: 0 };
this.snapOffsets = [];
this.gesture = {
start: { x: 0, y: 0 },
startDistance: 0, // distance between two touches of touchStart
prevDistance : 0,
distance : 0,
scale: 1, // gesture.distance / gesture.startDistance
startAngle: 0, // angle of line joining two touches
prevAngle : 0 // angle of the previous gesture event
};
this.snapStatus = {
x : 0, y : 0,
dx : 0, dy : 0,
realX : 0, realY : 0,
snappedX: 0, snappedY: 0,
targets : [],
locked : false,
changed : false
};
this.restrictStatus = {
dx : 0, dy : 0,
restrictedX: 0, restrictedY: 0,
snap : null,
restricted : false,
changed : false
};
this.restrictStatus.snap = this.snapStatus;
this.pointerIsDown = false;
this.pointerWasMoved = false;
this.gesturing = false;
this.dragging = false;
this.resizing = false;
this.resizeAxes = 'xy';
this.mouse = false;
interactions.push(this);
}
Interaction.prototype = {
getPageXY : function (pointer, xy) { return getPageXY(pointer, xy, this); },
getClientXY: function (pointer, xy) { return getClientXY(pointer, xy, this); },
setEventXY : function (target, ptr) { return setEventXY(target, ptr, this); },
pointerOver: function (pointer, event, eventTarget) {
if (this.prepared.name || !this.mouse) { return; }
var curMatches = [],
curMatchElements = [],
prevTargetElement = this.element;
this.addPointer(pointer);
if (this.target
&& (testIgnore(this.target, this.element, eventTarget)
|| !testAllow(this.target, this.element, eventTarget))) {
// if the eventTarget should be ignored or shouldn't be allowed
// clear the previous target
this.target = null;
this.element = null;
this.matches = [];
this.matchElements = [];
}
var elementInteractable = interactables.get(eventTarget),
elementAction = (elementInteractable
&& !testIgnore(elementInteractable, eventTarget, eventTarget)
&& testAllow(elementInteractable, eventTarget, eventTarget)
&& validateAction(
elementInteractable.getAction(pointer, event, this, eventTarget),
elementInteractable));
if (elementAction && !withinInteractionLimit(elementInteractable, eventTarget, elementAction)) {
elementAction = null;
}
function pushCurMatches (interactable, selector) {
if (interactable
&& inContext(interactable, eventTarget)
&& !testIgnore(interactable, eventTarget, eventTarget)
&& testAllow(interactable, eventTarget, eventTarget)
&& matchesSelector(eventTarget, selector)) {
curMatches.push(interactable);
curMatchElements.push(eventTarget);
}
}
if (elementAction) {
this.target = elementInteractable;
this.element = eventTarget;
this.matches = [];
this.matchElements = [];
}
else {
interactables.forEachSelector(pushCurMatches);
if (this.validateSelector(pointer, event, curMatches, curMatchElements)) {
this.matches = curMatches;
this.matchElements = curMatchElements;
this.pointerHover(pointer, event, this.matches, this.matchElements);
events.add(eventTarget,
PointerEvent? pEventTypes.move : 'mousemove',
listeners.pointerHover);
}
else if (this.target) {
if (nodeContains(prevTargetElement, eventTarget)) {
this.pointerHover(pointer, event, this.matches, this.matchElements);
events.add(this.element,
PointerEvent? pEventTypes.move : 'mousemove',
listeners.pointerHover);
}
else {
this.target = null;
this.element = null;
this.matches = [];
this.matchElements = [];
}
}
}
},
// Check what action would be performed on pointerMove target if a mouse
// button were pressed and change the cursor accordingly
pointerHover: function (pointer, event, eventTarget, curEventTarget, matches, matchElements) {
var target = this.target;
if (!this.prepared.name && this.mouse) {
var action;
// update pointer coords for defaultActionChecker to use
this.setEventXY(this.curCoords, pointer);
if (matches) {
action = this.validateSelector(pointer, event, matches, matchElements);
}
else if (target) {
action = validateAction(target.getAction(this.pointers[0], event, this, this.element), this.target);
}
if (target && target.options.styleCursor) {
if (action) {
target._doc.documentElement.style.cursor = getActionCursor(action);
}
else {
target._doc.documentElement.style.cursor = '';
}
}
}
else if (this.prepared.name) {
this.checkAndPreventDefault(event, target, this.element);
}
},
pointerOut: function (pointer, event, eventTarget) {
if (this.prepared.name) { return; }
// Remove temporary event listeners for selector Interactables
if (!interactables.get(eventTarget)) {
events.remove(eventTarget,
PointerEvent? pEventTypes.move : 'mousemove',
listeners.pointerHover);
}
if (this.target && this.target.options.styleCursor && !this.interacting()) {
this.target._doc.documentElement.style.cursor = '';
}
},
selectorDown: function (pointer, event, eventTarget, curEventTarget) {
var that = this,
// copy event to be used in timeout for IE8
eventCopy = events.useAttachEvent? extend({}, event) : event,
element = eventTarget,
pointerIndex = this.addPointer(pointer),
action;
this.holdTimers[pointerIndex] = setTimeout(function () {
that.pointerHold(events.useAttachEvent? eventCopy : pointer, eventCopy, eventTarget, curEventTarget);
}, defaultOptions._holdDuration);
this.pointerIsDown = true;
// Check if the down event hits the current inertia target
if (this.inertiaStatus.active && this.target.selector) {
// climb up the DOM tree from the event target
while (isElement(element)) {
// if this element is the current inertia target element
if (element === this.element
// and the prospective action is the same as the ongoing one
&& validateAction(this.target.getAction(pointer, event, this, this.element), this.target).name === this.prepared.name) {
// stop inertia so that the next move will be a normal one
cancelFrame(this.inertiaStatus.i);
this.inertiaStatus.active = false;
this.collectEventTargets(pointer, event, eventTarget, 'down');
return;
}
element = parentElement(element);
}
}
// do nothing if interacting
if (this.interacting()) {
this.collectEventTargets(pointer, event, eventTarget, 'down');
return;
}
function pushMatches (interactable, selector, context) {
var elements = ie8MatchesSelector
? context.querySelectorAll(selector)
: undefined;
if (inContext(interactable, element)
&& !testIgnore(interactable, element, eventTarget)
&& testAllow(interactable, element, eventTarget)
&& matchesSelector(element, selector, elements)) {
that.matches.push(interactable);
that.matchElements.push(element);
}
}
// update pointer coords for defaultActionChecker to use
this.setEventXY(this.curCoords, pointer);
this.downEvent = event;
while (isElement(element) && !action) {
this.matches = [];
this.matchElements = [];
interactables.forEachSelector(pushMatches);
action = this.validateSelector(pointer, event, this.matches, this.matchElements);
element = parentElement(element);
}
if (action) {
this.prepared.name = action.name;
this.prepared.axis = action.axis;
this.prepared.edges = action.edges;
this.collectEventTargets(pointer, event, eventTarget, 'down');
return this.pointerDown(pointer, event, eventTarget, curEventTarget, action);
}
else {
// do these now since pointerDown isn't being called from here
this.downTimes[pointerIndex] = new Date().getTime();
this.downTargets[pointerIndex] = eventTarget;
extend(this.downPointer, pointer);
copyCoords(this.prevCoords, this.curCoords);
this.pointerWasMoved = false;
}
this.collectEventTargets(pointer, event, eventTarget, 'down');
},
// Determine action to be performed on next pointerMove and add appropriate
// style and event Listeners
pointerDown: function (pointer, event, eventTarget, curEventTarget, forceAction) {
if (!forceAction && !this.inertiaStatus.active && this.pointerWasMoved && this.prepared.name) {
this.checkAndPreventDefault(event, this.target, this.element);
return;
}
this.pointerIsDown = true;
this.downEvent = event;
var pointerIndex = this.addPointer(pointer),
action;
// If it is the second touch of a multi-touch gesture, keep the target
// the same if a target was set by the first touch
// Otherwise, set the target if there is no action prepared
if ((this.pointerIds.length < 2 && !this.target) || !this.prepared.name) {
var interactable = interactables.get(curEventTarget);
if (interactable
&& !testIgnore(interactable, curEventTarget, eventTarget)
&& testAllow(interactable, curEventTarget, eventTarget)
&& (action = validateAction(forceAction || interactable.getAction(pointer, event, this, curEventTarget), interactable, eventTarget))
&& withinInteractionLimit(interactable, curEventTarget, action)) {
this.target = interactable;
this.element = curEventTarget;
}
}
var target = this.target,
options = target && target.options;
if (target && (forceAction || !this.prepared.name)) {
action = action || validateAction(forceAction || target.getAction(pointer, event, this, curEventTarget), target, this.element);
this.setEventXY(this.startCoords);
if (!action) { return; }
if (options.styleCursor) {
target._doc.documentElement.style.cursor = getActionCursor(action);
}
this.resizeAxes = action.name === 'resize'? action.axis : null;
if (action === 'gesture' && this.pointerIds.length < 2) {
action = null;
}
this.prepared.name = action.name;
this.prepared.axis = action.axis;
this.prepared.edges = action.edges;
this.snapStatus.snappedX = this.snapStatus.snappedY =
this.restrictStatus.restrictedX = this.restrictStatus.restrictedY = NaN;
this.downTimes[pointerIndex] = new Date().getTime();
this.downTargets[pointerIndex] = eventTarget;
extend(this.downPointer, pointer);
this.setEventXY(this.prevCoords);
this.pointerWasMoved = false;
this.checkAndPreventDefault(event, target, this.element);
}
// if inertia is active try to resume action
else if (this.inertiaStatus.active
&& curEventTarget === this.element
&& validateAction(target.getAction(pointer, event, this, this.element), target).name === this.prepared.name) {
cancelFrame(this.inertiaStatus.i);
this.inertiaStatus.active = false;
this.checkAndPreventDefault(event, target, this.element);
}
},
setModifications: function (coords, preEnd) {
var target = this.target,
shouldMove = true,
shouldSnap = checkSnap(target, this.prepared.name) && (!target.options[this.prepared.name].snap.endOnly || preEnd),
shouldRestrict = checkRestrict(target, this.prepared.name) && (!target.options[this.prepared.name].restrict.endOnly || preEnd);
if (shouldSnap ) { this.setSnapping (coords); } else { this.snapStatus .locked = false; }
if (shouldRestrict) { this.setRestriction(coords); } else { this.restrictStatus.restricted = false; }
if (shouldSnap && this.snapStatus.locked && !this.snapStatus.changed) {
shouldMove = shouldRestrict && this.restrictStatus.restricted && this.restrictStatus.changed;
}
else if (shouldRestrict && this.restrictStatus.restricted && !this.restrictStatus.changed) {
shouldMove = false;
}
return shouldMove;
},
setStartOffsets: function (action, interactable, element) {
var rect = interactable.getRect(element),
origin = getOriginXY(interactable, element),
snap = interactable.options[this.prepared.name].snap,
restrict = interactable.options[this.prepared.name].restrict,
width, height;
if (rect) {
this.startOffset.left = this.startCoords.page.x - rect.left;
this.startOffset.top = this.startCoords.page.y - rect.top;
this.startOffset.right = rect.right - this.startCoords.page.x;
this.startOffset.bottom = rect.bottom - this.startCoords.page.y;
if ('width' in rect) { width = rect.width; }
else { width = rect.right - rect.left; }
if ('height' in rect) { height = rect.height; }
else { height = rect.bottom - rect.top; }
}
else {
this.startOffset.left = this.startOffset.top = this.startOffset.right = this.startOffset.bottom = 0;
}
this.snapOffsets.splice(0);
var snapOffset = snap && snap.offset === 'startCoords'
? {
x: this.startCoords.page.x - origin.x,
y: this.startCoords.page.y - origin.y
}
: snap && snap.offset || { x: 0, y: 0 };
if (rect && snap && snap.relativePoints && snap.relativePoints.length) {
for (var i = 0; i < snap.relativePoints.length; i++) {
this.snapOffsets.push({
x: this.startOffset.left - (width * snap.relativePoints[i].x) + snapOffset.x,
y: this.startOffset.top - (height * snap.relativePoints[i].y) + snapOffset.y
});
}
}
else {
this.snapOffsets.push(snapOffset);
}
if (rect && restrict.elementRect) {
this.restrictOffset.left = this.startOffset.left - (width * restrict.elementRect.left);
this.restrictOffset.top = this.startOffset.top - (height * restrict.elementRect.top);
this.restrictOffset.right = this.startOffset.right - (width * (1 - restrict.elementRect.right));
this.restrictOffset.bottom = this.startOffset.bottom - (height * (1 - restrict.elementRect.bottom));
}
else {
this.restrictOffset.left = this.restrictOffset.top = this.restrictOffset.right = this.restrictOffset.bottom = 0;
}
},
/*\
* Interaction.start
[ method ]
*
* Start an action with the given Interactable and Element as tartgets. The
* action must be enabled for the target Interactable and an appropriate number
* of pointers must be held down – 1 for drag/resize, 2 for gesture.
*
* Use it with `interactable.<action>able({ manualStart: false })` to always
* [start actions manually](https://github.com/taye/interact.js/issues/114)
*
- action (object) The action to be performed - drag, resize, etc.
- interactable (Interactable) The Interactable to target
- element (Element) The DOM Element to target
= (object) interact
**
| interact(target)
| .draggable({
| // disable the default drag start by down->move
| manualStart: true
| })
| // start dragging after the user holds the pointer down
| .on('hold', function (event) {
| var interaction = event.interaction;
|
| if (!interaction.interacting()) {
| interaction.start({ name: 'drag' },
| event.interactable,
| event.currentTarget);
| }
| });
\*/
start: function (action, interactable, element) {
if (this.interacting()
|| !this.pointerIsDown
|| this.pointerIds.length < (action.name === 'gesture'? 2 : 1)) {
return;
}
// if this interaction had been removed after stopping
// add it back
if (indexOf(interactions, this) === -1) {
interactions.push(this);
}
this.prepared.name = action.name;
this.prepared.axis = action.axis;
this.prepared.edges = action.edges;
this.target = interactable;
this.element = element;
this.setEventXY(this.startCoords);
this.setStartOffsets(action.name, interactable, element);
this.setModifications(this.startCoords.page);
this.prevEvent = this[this.prepared.name + 'Start'](this.downEvent);
},
pointerMove: function (pointer, event, eventTarget, curEventTarget, preEnd) {
this.recordPointer(pointer);
this.setEventXY(this.curCoords, (pointer instanceof InteractEvent)
? this.inertiaStatus.startEvent
: undefined);
var duplicateMove = (this.curCoords.page.x === this.prevCoords.page.x
&& this.curCoords.page.y === this.prevCoords.page.y
&& this.curCoords.client.x === this.prevCoords.client.x
&& this.curCoords.client.y === this.prevCoords.client.y);
var dx, dy,
pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
// register movement greater than pointerMoveTolerance
if (this.pointerIsDown && !this.pointerWasMoved) {
dx = this.curCoords.client.x - this.startCoords.client.x;
dy = this.curCoords.client.y - this.startCoords.client.y;
this.pointerWasMoved = hypot(dx, dy) > pointerMoveTolerance;
}
if (!duplicateMove && (!this.pointerIsDown || this.pointerWasMoved)) {
if (this.pointerIsDown) {
clearTimeout(this.holdTimers[pointerIndex]);
}
this.collectEventTargets(pointer, event, eventTarget, 'move');
}
if (!this.pointerIsDown) { return; }
if (duplicateMove && this.pointerWasMoved && !preEnd) {
this.checkAndPreventDefault(event, this.target, this.element);
return;
}
// set pointer coordinate, time changes and speeds
setEventDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
if (!this.prepared.name) { return; }
if (this.pointerWasMoved
// ignore movement while inertia is active
&& (!this.inertiaStatus.active || (pointer instanceof InteractEvent && /inertiastart/.test(pointer.type)))) {
// if just starting an action, calculate the pointer speed now
if (!this.interacting()) {
setEventDeltas(this.pointerDelta, this.prevCoords, this.curCoords);
// check if a drag is in the correct axis
if (this.prepared.name === 'drag') {
var absX = Math.abs(dx),
absY = Math.abs(dy),
targetAxis = this.target.options.drag.axis,
axis = (absX > absY ? 'x' : absX < absY ? 'y' : 'xy');
// if the movement isn't in the axis of the interactable
if (axis !== 'xy' && targetAxis !== 'xy' && targetAxis !== axis) {
// cancel the prepared action
this.prepared.name = null;
// then try to get a drag from another ineractable
var element = eventTarget;
// check element interactables
while (isElement(element)) {
var elementInteractable = interactables.get(element);
if (elementInteractable
&& elementInteractable !== this.target
&& !elementInteractable.options.drag.manualStart
&& elementInteractable.getAction(this.downPointer, this.downEvent, this, element).name === 'drag'
&& checkAxis(axis, elementInteractable)) {
this.prepared.name = 'drag';
this.target = elementInteractable;
this.element = element;
break;
}
element = parentElement(element);
}
// if there's no drag from element interactables,
// check the selector interactables
if (!this.prepared.name) {
var thisInteraction = this;
var getDraggable = function (interactable, selector, context) {
var elements = ie8MatchesSelector
? context.querySelectorAll(selector)
: undefined;
if (interactable === thisInteraction.target) { return; }
if (inContext(interactable, eventTarget)
&& !interactable.options.drag.manualStart
&& !testIgnore(interactable, element, eventTarget)
&& testAllow(interactable, element, eventTarget)
&& matchesSelector(element, selector, elements)
&& interactable.getAction(thisInteraction.downPointer, thisInteraction.downEvent, thisInteraction, element).name === 'drag'
&& checkAxis(axis, interactable)
&& withinInteractionLimit(interactable, element, 'drag')) {
return interactable;
}
};
element = eventTarget;
while (isElement(element)) {
var selectorInteractable = interactables.forEachSelector(getDraggable);
if (selectorInteractable) {
this.prepared.name = 'drag';
this.target = selectorInteractable;
this.element = element;
break;
}
element = parentElement(element);
}
}
}
}
}
var starting = !!this.prepared.name && !this.interacting();
if (starting
&& (this.target.options[this.prepared.name].manualStart
|| !withinInteractionLimit(this.target, this.element, this.prepared))) {
this.stop(event);
return;
}
if (this.prepared.name && this.target) {
if (starting) {
this.start(this.prepared, this.target, this.element);
}
var shouldMove = this.setModifications(this.curCoords.page, preEnd);
// move if snapping or restriction doesn't prevent it
if (shouldMove || starting) {
this.prevEvent = this[this.prepared.name + 'Move'](event);
}
this.checkAndPreventDefault(event, this.target, this.element);
}
}
copyCoords(this.prevCoords, this.curCoords);
if (this.dragging || this.resizing) {
this.autoScrollMove(pointer);
}
},
dragStart: function (event) {
var dragEvent = new InteractEvent(this, event, 'drag', 'start', this.element);
this.dragging = true;
this.target.fire(dragEvent);
// reset active dropzones
this.activeDrops.dropzones = [];
this.activeDrops.elements = [];
this.activeDrops.rects = [];
if (!this.dynamicDrop) {
this.setActiveDrops(this.element);
}
var dropEvents = this.getDropEvents(event, dragEvent);
if (dropEvents.activate) {
this.fireActiveDrops(dropEvents.activate);
}
return dragEvent;
},
dragMove: function (event) {
var target = this.target,
dragEvent = new InteractEvent(this, event, 'drag', 'move', this.element),
draggableElement = this.element,
drop = this.getDrop(event, draggableElement);
this.dropTarget = drop.dropzone;
this.dropElement = drop.element;
var dropEvents = this.getDropEvents(event, dragEvent);
target.fire(dragEvent);
if (dropEvents.leave) { this.prevDropTarget.fire(dropEvents.leave); }
if (dropEvents.enter) { this.dropTarget.fire(dropEvents.enter); }
if (dropEvents.move ) { this.dropTarget.fire(dropEvents.move ); }
this.prevDropTarget = this.dropTarget;
this.prevDropElement = this.dropElement;
return dragEvent;
},
resizeStart: function (event) {
var resizeEvent = new InteractEvent(this, event, 'resize', 'start', this.element);
if (this.prepared.edges) {
var startRect = this.target.getRect(this.element);
if (this.target.options.resize.square) {
var squareEdges = extend({}, this.prepared.edges);
squareEdges.top = squareEdges.top || (squareEdges.left && !squareEdges.bottom);
squareEdges.left = squareEdges.left || (squareEdges.top && !squareEdges.right );
squareEdges.bottom = squareEdges.bottom || (squareEdges.right && !squareEdges.top );
squareEdges.right = squareEdges.right || (squareEdges.bottom && !squareEdges.left );
this.prepared._squareEdges = squareEdges;
}
else {
this.prepared._squareEdges = null;
}
this.resizeRects = {
start : startRect,
current : extend({}, startRect),
restricted: extend({}, startRect),
previous : extend({}, startRect),
delta : {
left: 0, right : 0, width : 0,
top : 0, bottom: 0, height: 0
}
};
resizeEvent.rect = this.resizeRects.restricted;
resizeEvent.deltaRect = this.resizeRects.delta;
}
this.target.fire(resizeEvent);
this.resizing = true;
return resizeEvent;
},
resizeMove: function (event) {
var resizeEvent = new InteractEvent(this, event, 'resize', 'move', this.element);
var edges = this.prepared.edges,
invert = this.target.options.resize.invert,
invertible = invert === 'reposition' || invert === 'negate';
if (edges) {
var dx = resizeEvent.dx,
dy = resizeEvent.dy,
start = this.resizeRects.start,
current = this.resizeRects.current,
restricted = this.resizeRects.restricted,
delta = this.resizeRects.delta,
previous = extend(this.resizeRects.previous, restricted);
if (this.target.options.resize.square) {
var originalEdges = edges;
edges = this.prepared._squareEdges;
if ((originalEdges.left && originalEdges.bottom)
|| (originalEdges.right && originalEdges.top)) {
dy = -dx;
}
else if (originalEdges.left || originalEdges.right) { dy = dx; }
else if (originalEdges.top || originalEdges.bottom) { dx = dy; }
}
// update the 'current' rect without modifications
if (edges.top ) { current.top += dy; }
if (edges.bottom) { current.bottom += dy; }
if (edges.left ) { current.left += dx; }
if (edges.right ) { current.right += dx; }
if (invertible) {
// if invertible, copy the current rect
extend(restricted, current);
if (invert === 'reposition') {
// swap edge values if necessary to keep width/height positive
var swap;
if (restricted.top > restricted.bottom) {
swap = restricted.top;
restricted.top = restricted.bottom;
restricted.bottom = swap;
}
if (restricted.left > restricted.right) {
swap = restricted.left;
restricted.left = restricted.right;
restricted.right = swap;
}
}
}
else {
// if not invertible, restrict to minimum of 0x0 rect
restricted.top = Math.min(current.top, start.bottom);
restricted.bottom = Math.max(current.bottom, start.top);
restricted.left = Math.min(current.left, start.right);
restricted.right = Math.max(current.right, start.left);
}
restricted.width = restricted.right - restricted.left;
restricted.height = restricted.bottom - restricted.top ;
for (var edge in restricted) {
delta[edge] = restricted[edge] - previous[edge];
}
resizeEvent.edges = this.prepared.edges;
resizeEvent.rect = restricted;
resizeEvent.deltaRect = delta;
}
this.target.fire(resizeEvent);
return resizeEvent;
},
gestureStart: function (event) {
var gestureEvent = new InteractEvent(this, event, 'gesture', 'start', this.element);
gestureEvent.ds = 0;
this.gesture.startDistance = this.gesture.prevDistance = gestureEvent.distance;
this.gesture.startAngle = this.gesture.prevAngle = gestureEvent.angle;
this.gesture.scale = 1;
this.gesturing = true;
this.target.fire(gestureEvent);
return gestureEvent;
},
gestureMove: function (event) {
if (!this.pointerIds.length) {
return this.prevEvent;
}
var gestureEvent;
gestureEvent = new InteractEvent(this, event, 'gesture', 'move', this.element);
gestureEvent.ds = gestureEvent.scale - this.gesture.scale;
this.target.fire(gestureEvent);
this.gesture.prevAngle = gestureEvent.angle;
this.gesture.prevDistance = gestureEvent.distance;
if (gestureEvent.scale !== Infinity &&
gestureEvent.scale !== null &&
gestureEvent.scale !== undefined &&
!isNaN(gestureEvent.scale)) {
this.gesture.scale = gestureEvent.scale;
}
return gestureEvent;
},
pointerHold: function (pointer, event, eventTarget) {
this.collectEventTargets(pointer, event, eventTarget, 'hold');
},
pointerUp: function (pointer, event, eventTarget, curEventTarget) {
var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
clearTimeout(this.holdTimers[pointerIndex]);
this.collectEventTargets(pointer, event, eventTarget, 'up' );
this.collectEventTargets(pointer, event, eventTarget, 'tap');
this.pointerEnd(pointer, event, eventTarget, curEventTarget);
this.removePointer(pointer);
},
pointerCancel: function (pointer, event, eventTarget, curEventTarget) {
var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
clearTimeout(this.holdTimers[pointerIndex]);
this.collectEventTargets(pointer, event, eventTarget, 'cancel');
this.pointerEnd(pointer, event, eventTarget, curEventTarget);
this.removePointer(pointer);
},
// http://www.quirksmode.org/dom/events/click.html
// >Events leading to dblclick
//
// IE8 doesn't fire down event before dblclick.
// This workaround tries to fire a tap and doubletap after dblclick
ie8Dblclick: function (pointer, event, eventTarget) {
if (this.prevTap
&& event.clientX === this.prevTap.clientX
&& event.clientY === this.prevTap.clientY
&& eventTarget === this.prevTap.target) {
this.downTargets[0] = eventTarget;
this.downTimes[0] = new Date().getTime();
this.collectEventTargets(pointer, event, eventTarget, 'tap');
}
},
// End interact move events and stop auto-scroll unless inertia is enabled
pointerEnd: function (pointer, event, eventTarget, curEventTarget) {
var endEvent,
target = this.target,
options = target && target.options,
inertiaOptions = options && this.prepared.name && options[this.prepared.name].inertia,
inertiaStatus = this.inertiaStatus;
if (this.interacting()) {
if (inertiaStatus.active) { return; }
var pointerSpeed,
now = new Date().getTime(),
inertiaPossible = false,
inertia = false,
smoothEnd = false,
endSnap = checkSnap(target, this.prepared.name) && options[this.prepared.name].snap.endOnly,
endRestrict = checkRestrict(target, this.prepared.name) && options[this.prepared.name].restrict.endOnly,
dx = 0,
dy = 0,
startEvent;
if (this.dragging) {
if (options.drag.axis === 'x' ) { pointerSpeed = Math.abs(this.pointerDelta.client.vx); }
else if (options.drag.axis === 'y' ) { pointerSpeed = Math.abs(this.pointerDelta.client.vy); }
else /*options.drag.axis === 'xy'*/{ pointerSpeed = this.pointerDelta.client.speed; }
}
else {
pointerSpeed = this.pointerDelta.client.speed;
}
// check if inertia should be started
inertiaPossible = (inertiaOptions && inertiaOptions.enabled
&& this.prepared.name !== 'gesture'
&& event !== inertiaStatus.startEvent);
inertia = (inertiaPossible
&& (now - this.curCoords.timeStamp) < 50
&& pointerSpeed > inertiaOptions.minSpeed
&& pointerSpeed > inertiaOptions.endSpeed);
if (inertiaPossible && !inertia && (endSnap || endRestrict)) {
var snapRestrict = {};
snapRestrict.snap = snapRestrict.restrict = snapRestrict;
if (endSnap) {
this.setSnapping(this.curCoords.page, snapRestrict);
if (snapRestrict.locked) {
dx += snapRestrict.dx;
dy += snapRestrict.dy;
}
}
if (endRestrict) {
this.setRestriction(this.curCoords.page, snapRestrict);
if (snapRestrict.restricted) {
dx += snapRestrict.dx;
dy += snapRestrict.dy;
}
}
if (dx || dy) {
smoothEnd = true;
}
}
if (inertia || smoothEnd) {
copyCoords(inertiaStatus.upCoords, this.curCoords);
this.pointers[0] = inertiaStatus.startEvent = startEvent =
new InteractEvent(this, event, this.prepared.name, 'inertiastart', this.element);
inertiaStatus.t0 = now;
target.fire(inertiaStatus.startEvent);
if (inertia) {
inertiaStatus.vx0 = this.pointerDelta.client.vx;
inertiaStatus.vy0 = this.pointerDelta.client.vy;
inertiaStatus.v0 = pointerSpeed;
this.calcInertia(inertiaStatus);
var page = extend({}, this.curCoords.page),
origin = getOriginXY(target, this.element),
statusObject;
page.x = page.x + inertiaStatus.xe - origin.x;
page.y = page.y + inertiaStatus.ye - origin.y;
statusObject = {
useStatusXY: true,
x: page.x,
y: page.y,
dx: 0,
dy: 0,
snap: null
};
statusObject.snap = statusObject;
dx = dy = 0;
if (endSnap) {
var snap = this.setSnapping(this.curCoords.page, statusObject);
if (snap.locked) {
dx += snap.dx;
dy += snap.dy;
}
}
if (endRestrict) {
var restrict = this.setRestriction(this.curCoords.page, statusObject);
if (restrict.restricted) {
dx += restrict.dx;
dy += restrict.dy;
}
}
inertiaStatus.modifiedXe += dx;
inertiaStatus.modifiedYe += dy;
inertiaStatus.i = reqFrame(this.boundInertiaFrame);
}
else {
inertiaStatus.smoothEnd = true;
inertiaStatus.xe = dx;
inertiaStatus.ye = dy;
inertiaStatus.sx = inertiaStatus.sy = 0;
inertiaStatus.i = reqFrame(this.boundSmoothEndFrame);
}
inertiaStatus.active = true;
return;
}
if (endSnap || endRestrict) {
// fire a move event at the snapped coordinates
this.pointerMove(pointer, event, eventTarget, curEventTarget, true);
}
}
if (this.dragging) {
endEvent = new InteractEvent(this, event, 'drag', 'end', this.element);
var draggableElement = this.element,
drop = this.getDrop(event, draggableElement);
this.dropTarget = drop.dropzone;
this.dropElement = drop.element;
var dropEvents = this.getDropEvents(event, endEvent);
if (dropEvents.leave) { this.prevDropTarget.fire(dropEvents.leave); }
if (dropEvents.enter) { this.dropTarget.fire(dropEvents.enter); }
if (dropEvents.drop ) { this.dropTarget.fire(dropEvents.drop ); }
if (dropEvents.deactivate) {
this.fireActiveDrops(dropEvents.deactivate);
}
target.fire(endEvent);
}
else if (this.resizing) {
endEvent = new InteractEvent(this, event, 'resize', 'end', this.element);
target.fire(endEvent);
}
else if (this.gesturing) {
endEvent = new InteractEvent(this, event, 'gesture', 'end', this.element);
target.fire(endEvent);
}
this.stop(event);
},
collectDrops: function (element) {
var drops = [],
elements = [],
i;
element = element || this.element;
// collect all dropzones and their elements which qualify for a drop
for (i = 0; i < interactables.length; i++) {
if (!interactables[i].options.drop.enabled) { continue; }
var current = interactables[i],
accept = current.options.drop.accept;
// test the draggable element against the dropzone's accept setting
if ((isElement(accept) && accept !== element)
|| (isString(accept)
&& !matchesSelector(element, accept))) {
continue;
}
// query for new elements if necessary
var dropElements = current.selector? current._context.querySelectorAll(current.selector) : [current._element];
for (var j = 0, len = dropElements.length; j < len; j++) {
var currentElement = dropElements[j];
if (currentElement === element) {
continue;
}
drops.push(current);
elements.push(currentElement);
}
}
return {
dropzones: drops,
elements: elements
};
},
fireActiveDrops: function (event) {
var i,
current,
currentElement,
prevElement;
// loop through all active dropzones and trigger event
for (i = 0; i < this.activeDrops.dropzones.length; i++) {
current = this.activeDrops.dropzones[i];
currentElement = this.activeDrops.elements [i];
// prevent trigger of duplicate events on same element
if (currentElement !== prevElement) {
// set current element as event target
event.target = currentElement;
current.fire(event);
}
prevElement = currentElement;
}
},
// Collect a new set of possible drops and save them in activeDrops.
// setActiveDrops should always be called when a drag has just started or a
// drag event happens while dynamicDrop is true
setActiveDrops: function (dragElement) {
// get dropzones and their elements that could receive the draggable
var possibleDrops = this.collectDrops(dragElement, true);
this.activeDrops.dropzones = possibleDrops.dropzones;
this.activeDrops.elements = possibleDrops.elements;
this.activeDrops.rects = [];
for (var i = 0; i < this.activeDrops.dropzones.length; i++) {
this.activeDrops.rects[i] = this.activeDrops.dropzones[i].getRect(this.activeDrops.elements[i]);
}
},
getDrop: function (event, dragElement) {
var validDrops = [];
if (dynamicDrop) {
this.setActiveDrops(dragElement);
}
// collect all dropzones and their elements which qualify for a drop
for (var j = 0; j < this.activeDrops.dropzones.length; j++) {
var current = this.activeDrops.dropzones[j],
currentElement = this.activeDrops.elements [j],
rect = this.activeDrops.rects [j];
validDrops.push(current.dropCheck(this.pointers[0], event, this.target, dragElement, currentElement, rect)
? currentElement
: null);
}
// get the most appropriate dropzone based on DOM depth and order
var dropIndex = indexOfDeepestElement(validDrops),
dropzone = this.activeDrops.dropzones[dropIndex] || null,
element = this.activeDrops.elements [dropIndex] || null;
return {
dropzone: dropzone,
element: element
};
},
getDropEvents: function (pointerEvent, dragEvent) {
var dropEvents = {
enter : null,
leave : null,
activate : null,
deactivate: null,
move : null,
drop : null
};
if (this.dropElement !== this.prevDropElement) {
// if there was a prevDropTarget, create a dragleave event
if (this.prevDropTarget) {
dropEvents.leave = {
target : this.prevDropElement,
dropzone : this.prevDropTarget,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
timeStamp : dragEvent.timeStamp,
type : 'dragleave'
};
dragEvent.dragLeave = this.prevDropElement;
dragEvent.prevDropzone = this.prevDropTarget;
}
// if the dropTarget is not null, create a dragenter event
if (this.dropTarget) {
dropEvents.enter = {
target : this.dropElement,
dropzone : this.dropTarget,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
timeStamp : dragEvent.timeStamp,
type : 'dragenter'
};
dragEvent.dragEnter = this.dropElement;
dragEvent.dropzone = this.dropTarget;
}
}
if (dragEvent.type === 'dragend' && this.dropTarget) {
dropEvents.drop = {
target : this.dropElement,
dropzone : this.dropTarget,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
timeStamp : dragEvent.timeStamp,
type : 'drop'
};
dragEvent.dropzone = this.dropTarget;
}
if (dragEvent.type === 'dragstart') {
dropEvents.activate = {
target : null,
dropzone : null,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
timeStamp : dragEvent.timeStamp,
type : 'dropactivate'
};
}
if (dragEvent.type === 'dragend') {
dropEvents.deactivate = {
target : null,
dropzone : null,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
timeStamp : dragEvent.timeStamp,
type : 'dropdeactivate'
};
}
if (dragEvent.type === 'dragmove' && this.dropTarget) {
dropEvents.move = {
target : this.dropElement,
dropzone : this.dropTarget,
relatedTarget: dragEvent.target,
draggable : dragEvent.interactable,
dragEvent : dragEvent,
interaction : this,
dragmove : dragEvent,
timeStamp : dragEvent.timeStamp,
type : 'dropmove'
};
dragEvent.dropzone = this.dropTarget;
}
return dropEvents;
},
currentAction: function () {
return (this.dragging && 'drag') || (this.resizing && 'resize') || (this.gesturing && 'gesture') || null;
},
interacting: function () {
return this.dragging || this.resizing || this.gesturing;
},
clearTargets: function () {
this.target = this.element = null;
this.dropTarget = this.dropElement = this.prevDropTarget = this.prevDropElement = null;
},
stop: function (event) {
if (this.interacting()) {
autoScroll.stop();
this.matches = [];
this.matchElements = [];
var target = this.target;
if (target.options.styleCursor) {
target._doc.documentElement.style.cursor = '';
}
// prevent Default only if were previously interacting
if (event && isFunction(event.preventDefault)) {
this.checkAndPreventDefault(event, target, this.element);
}
if (this.dragging) {
this.activeDrops.dropzones = this.activeDrops.elements = this.activeDrops.rects = null;
}
}
this.clearTargets();
this.pointerIsDown = this.snapStatus.locked = this.dragging = this.resizing = this.gesturing = false;
this.prepared.name = this.prevEvent = null;
this.inertiaStatus.resumeDx = this.inertiaStatus.resumeDy = 0;
// remove pointers if their ID isn't in this.pointerIds
for (var i = 0; i < this.pointers.length; i++) {
if (indexOf(this.pointerIds, getPointerId(this.pointers[i])) === -1) {
this.pointers.splice(i, 1);
}
}
for (i = 0; i < interactions.length; i++) {
// remove this interaction if it's not the only one of it's type
if (interactions[i] !== this && interactions[i].mouse === this.mouse) {
interactions.splice(indexOf(interactions, this), 1);
}
}
},
inertiaFrame: function () {
var inertiaStatus = this.inertiaStatus,
options = this.target.options[this.prepared.name].inertia,
lambda = options.resistance,
t = new Date().getTime() / 1000 - inertiaStatus.t0;
if (t < inertiaStatus.te) {
var progress = 1 - (Math.exp(-lambda * t) - inertiaStatus.lambda_v0) / inertiaStatus.one_ve_v0;
if (inertiaStatus.modifiedXe === inertiaStatus.xe && inertiaStatus.modifiedYe === inertiaStatus.ye) {
inertiaStatus.sx = inertiaStatus.xe * progress;
inertiaStatus.sy = inertiaStatus.ye * progress;
}
else {
var quadPoint = getQuadraticCurvePoint(
0, 0,
inertiaStatus.xe, inertiaStatus.ye,
inertiaStatus.modifiedXe, inertiaStatus.modifiedYe,
progress);
inertiaStatus.sx = quadPoint.x;
inertiaStatus.sy = quadPoint.y;
}
this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
inertiaStatus.i = reqFrame(this.boundInertiaFrame);
}
else {
inertiaStatus.sx = inertiaStatus.modifiedXe;
inertiaStatus.sy = inertiaStatus.modifiedYe;
this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
inertiaStatus.active = false;
this.pointerEnd(inertiaStatus.startEvent, inertiaStatus.startEvent);
}
},
smoothEndFrame: function () {
var inertiaStatus = this.inertiaStatus,
t = new Date().getTime() - inertiaStatus.t0,
duration = this.target.options[this.prepared.name].inertia.smoothEndDuration;
if (t < duration) {
inertiaStatus.sx = easeOutQuad(t, 0, inertiaStatus.xe, duration);
inertiaStatus.sy = easeOutQuad(t, 0, inertiaStatus.ye, duration);
this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
inertiaStatus.i = reqFrame(this.boundSmoothEndFrame);
}
else {
inertiaStatus.sx = inertiaStatus.xe;
inertiaStatus.sy = inertiaStatus.ye;
this.pointerMove(inertiaStatus.startEvent, inertiaStatus.startEvent);
inertiaStatus.active = false;
inertiaStatus.smoothEnd = false;
this.pointerEnd(inertiaStatus.startEvent, inertiaStatus.startEvent);
}
},
addPointer: function (pointer) {
var id = getPointerId(pointer),
index = this.mouse? 0 : indexOf(this.pointerIds, id);
if (index === -1) {
index = this.pointerIds.length;
}
this.pointerIds[index] = id;
this.pointers[index] = pointer;
return index;
},
removePointer: function (pointer) {
var id = getPointerId(pointer),
index = this.mouse? 0 : indexOf(this.pointerIds, id);
if (index === -1) { return; }
if (!this.interacting()) {
this.pointers.splice(index, 1);
}
this.pointerIds .splice(index, 1);
this.downTargets.splice(index, 1);
this.downTimes .splice(index, 1);
this.holdTimers .splice(index, 1);
},
recordPointer: function (pointer) {
// Do not update pointers while inertia is active.
// The inertia start event should be this.pointers[0]
if (this.inertiaStatus.active) { return; }
var index = this.mouse? 0: indexOf(this.pointerIds, getPointerId(pointer));
if (index === -1) { return; }
this.pointers[index] = pointer;
},
collectEventTargets: function (pointer, event, eventTarget, eventType) {
var pointerIndex = this.mouse? 0 : indexOf(this.pointerIds, getPointerId(pointer));
// do not fire a tap event if the pointer was moved before being lifted
if (eventType === 'tap' && (this.pointerWasMoved
// or if the pointerup target is different to the pointerdown target
|| !(this.downTargets[pointerIndex] && this.downTargets[pointerIndex] === eventTarget))) {
return;
}
var targets = [],
elements = [],
element = eventTarget;
function collectSelectors (interactable, selector, context) {
var els = ie8MatchesSelector
? context.querySelectorAll(selector)
: undefined;
if (interactable._iEvents[eventType]
&& isElement(element)
&& inContext(interactable, element)
&& !testIgnore(interactable, element, eventTarget)
&& testAllow(interactable, element, eventTarget)
&& matchesSelector(element, selector, els)) {
targets.push(interactable);
elements.push(element);
}
}
while (element) {
if (interact.isSet(element) && interact(element)._iEvents[eventType]) {
targets.push(interact(element));
elements.push(element);
}
interactables.forEachSelector(collectSelectors);
element = parentElement(element);
}
// create the tap event even if there are no listeners so that
// doubletap can still be created and fired
if (targets.length || eventType === 'tap') {
this.firePointers(pointer, event, eventTarget, targets, elements, eventType);
}
},
firePointers: function (pointer, event, eventTarget, targets, elements, eventType) {
var pointerIndex = this.mouse? 0 : indexOf(getPointerId(pointer)),
pointerEvent = {},
i,
// for tap events
interval, createNewDoubleTap;
// if it's a doubletap then the event properties would have been
// copied from the tap event and provided as the pointer argument
if (eventType === 'doubletap') {
pointerEvent = pointer;
}
else {
extend(pointerEvent, event);
if (event !== pointer) {
extend(pointerEvent, pointer);
}
pointerEvent.preventDefault = preventOriginalDefault;
pointerEvent.stopPropagation = InteractEvent.prototype.stopPropagation;
pointerEvent.stopImmediatePropagation = InteractEvent.prototype.stopImmediatePropagation;
pointerEvent.interaction = this;
pointerEvent.timeStamp = new Date().getTime();
pointerEvent.originalEvent = event;
pointerEvent.type = eventType;
pointerEvent.pointerId = getPointerId(pointer);
pointerEvent.pointerType = this.mouse? 'mouse' : !supportsPointerEvent? 'touch'
: isString(pointer.pointerType)
? pointer.pointerType
: [,,'touch', 'pen', 'mouse'][pointer.pointerType];
}
if (eventType === 'tap') {
pointerEvent.dt = pointerEvent.timeStamp - this.downTimes[pointerIndex];
interval = pointerEvent.timeStamp - this.tapTime;
createNewDoubleTap = !!(this.prevTap && this.prevTap.type !== 'doubletap'
&& this.prevTap.target === pointerEvent.target
&& interval < 500);
pointerEvent.double = createNewDoubleTap;
this.tapTime = pointerEvent.timeStamp;
}
for (i = 0; i < targets.length; i++) {
pointerEvent.currentTarget = elements[i];
pointerEvent.interactable = targets[i];
targets[i].fire(pointerEvent);
if (pointerEvent.immediatePropagationStopped
||(pointerEvent.propagationStopped && elements[i + 1] !== pointerEvent.currentTarget)) {
break;
}
}
if (createNewDoubleTap) {
var doubleTap = {};
extend(doubleTap, pointerEvent);
doubleTap.dt = interval;
doubleTap.type = 'doubletap';
this.collectEventTargets(doubleTap, event, eventTarget, 'doubletap');
this.prevTap = doubleTap;
}
else if (eventType === 'tap') {
this.prevTap = pointerEvent;
}
},
validateSelector: function (pointer, event, matches, matchElements) {
for (var i = 0, len = matches.length; i < len; i++) {
var match = matches[i],
matchElement = matchElements[i],
action = validateAction(match.getAction(pointer, event, this, matchElement), match);
if (action && withinInteractionLimit(match, matchElement, action)) {
this.target = match;
this.element = matchElement;
return action;
}
}
},
setSnapping: function (pageCoords, status) {
var snap = this.target.options[this.prepared.name].snap,
targets = [],
target,
page,
i;
status = status || this.snapStatus;
if (status.useStatusXY) {
page = { x: status.x, y: status.y };
}
else {
var origin = getOriginXY(this.target, this.element);
page = extend({}, pageCoords);
page.x -= origin.x;
page.y -= origin.y;
}
status.realX = page.x;
status.realY = page.y;
page.x = page.x - this.inertiaStatus.resumeDx;
page.y = page.y - this.inertiaStatus.resumeDy;
var len = snap.targets? snap.targets.length : 0;
for (var relIndex = 0; relIndex < this.snapOffsets.length; relIndex++) {
var relative = {
x: page.x - this.snapOffsets[relIndex].x,
y: page.y - this.snapOffsets[relIndex].y
};
for (i = 0; i < len; i++) {
if (isFunction(snap.targets[i])) {
target = snap.targets[i](relative.x, relative.y, this);
}
else {
target = snap.targets[i];
}
if (!target) { continue; }
targets.push({
x: isNumber(target.x) ? (target.x + this.snapOffsets[relIndex].x) : relative.x,
y: isNumber(target.y) ? (target.y + this.snapOffsets[relIndex].y) : relative.y,
range: isNumber(target.range)? target.range: snap.range
});
}
}
var closest = {
target: null,
inRange: false,
distance: 0,
range: 0,
dx: 0,
dy: 0
};
for (i = 0, len = targets.length; i < len; i++) {
target = targets[i];
var range = target.range,
dx = target.x - page.x,
dy = target.y - page.y,
distance = hypot(dx, dy),
inRange = distance <= range;
// Infinite targets count as being out of range
// compared to non infinite ones that are in range
if (range === Infinity && closest.inRange && closest.range !== Infinity) {
inRange = false;
}
if (!closest.target || (inRange
// is the closest target in range?
? (closest.inRange && range !== Infinity
// the pointer is relatively deeper in this target
? distance / range < closest.distance / closest.range
// this target has Infinite range and the closest doesn't
: (range === Infinity && closest.range !== Infinity)
// OR this target is closer that the previous closest
|| distance < closest.distance)
// The other is not in range and the pointer is closer to this target
: (!closest.inRange && distance < closest.distance))) {
if (range === Infinity) {
inRange = true;
}
closest.target = target;
closest.distance = distance;
closest.range = range;
closest.inRange = inRange;
closest.dx = dx;
closest.dy = dy;
status.range = range;
}
}
var snapChanged;
if (closest.target) {
snapChanged = (status.snappedX !== closest.target.x || status.snappedY !== closest.target.y);
status.snappedX = closest.target.x;
status.snappedY = closest.target.y;
}
else {
snapChanged = true;
status.snappedX = NaN;
status.snappedY = NaN;
}
status.dx = closest.dx;
status.dy = closest.dy;
status.changed = (snapChanged || (closest.inRange && !status.locked));
status.locked = closest.inRange;
return status;
},
setRestriction: function (pageCoords, status) {
var target = this.target,
restrict = target && target.options[this.prepared.name].restrict,
restriction = restrict && restrict.restriction,
page;
if (!restriction) {
return status;
}
status = status || this.restrictStatus;
page = status.useStatusXY
? page = { x: status.x, y: status.y }
: page = extend({}, pageCoords);
if (status.snap && status.snap.locked) {
page.x += status.snap.dx || 0;
page.y += status.snap.dy || 0;
}
page.x -= this.inertiaStatus.resumeDx;
page.y -= this.inertiaStatus.resumeDy;
status.dx = 0;
status.dy = 0;
status.restricted = false;
var rect, restrictedX, restrictedY;
if (isString(restriction)) {
if (restriction === 'parent') {
restriction = parentElement(this.element);
}
else if (restriction === 'self') {
restriction = target.getRect(this.element);
}
else {
restriction = closest(this.element, restriction);
}
if (!restriction) { return status; }
}
if (isFunction(restriction)) {
restriction = restriction(page.x, page.y, this.element);
}
if (isElement(restriction)) {
restriction = getElementRect(restriction);
}
rect = restriction;
if (!restriction) {
restrictedX = page.x;
restrictedY = page.y;
}
// object is assumed to have
// x, y, width, height or
// left, top, right, bottom
else if ('x' in restriction && 'y' in restriction) {
restrictedX = Math.max(Math.min(rect.x + rect.width - this.restrictOffset.right , page.x), rect.x + this.restrictOffset.left);
restrictedY = Math.max(Math.min(rect.y + rect.height - this.restrictOffset.bottom, page.y), rect.y + this.restrictOffset.top );
}
else {
restrictedX = Math.max(Math.min(rect.right - this.restrictOffset.right , page.x), rect.left + this.restrictOffset.left);
restrictedY = Math.max(Math.min(rect.bottom - this.restrictOffset.bottom, page.y), rect.top + this.restrictOffset.top );
}
status.dx = restrictedX - page.x;
status.dy = restrictedY - page.y;
status.changed = status.restrictedX !== restrictedX || status.restrictedY !== restrictedY;
status.restricted = !!(status.dx || status.dy);
status.restrictedX = restrictedX;
status.restrictedY = restrictedY;
return status;
},
checkAndPreventDefault: function (event, interactable, element) {
if (!(interactable = interactable || this.target)) { return; }
var options = interactable.options,
prevent = options.preventDefault;
if (prevent === 'auto' && element && !/^(input|select|textarea)$/i.test(event.target.nodeName)) {
// do not preventDefault on pointerdown if the prepared action is a drag
// and dragging can only start from a certain direction - this allows
// a touch to pan the viewport if a drag isn't in the right direction
if (/down|start/i.test(event.type)
&& this.prepared.name === 'drag' && options.drag.axis !== 'xy') {
return;
}
// with manualStart, only preventDefault while interacting
if (options[this.prepared.name] && options[this.prepared.name].manualStart
&& !this.interacting()) {
return;
}
event.preventDefault();
return;
}
if (prevent === 'always') {
event.preventDefault();
return;
}
},
calcInertia: function (status) {
var inertiaOptions = this.target.options[this.prepared.name].inertia,
lambda = inertiaOptions.resistance,
inertiaDur = -Math.log(inertiaOptions.endSpeed / status.v0) / lambda;
status.x0 = this.prevEvent.pageX;
status.y0 = this.prevEvent.pageY;
status.t0 = status.startEvent.timeStamp / 1000;
status.sx = status.sy = 0;
status.modifiedXe = status.xe = (status.vx0 - inertiaDur) / lambda;
status.modifiedYe = status.ye = (status.vy0 - inertiaDur) / lambda;
status.te = inertiaDur;
status.lambda_v0 = lambda / status.v0;
status.one_ve_v0 = 1 - inertiaOptions.endSpeed / status.v0;
},
autoScrollMove: function (pointer) {
if (!(this.interacting()
&& checkAutoScroll(this.target, this.prepared.name))) {
return;
}
if (this.inertiaStatus.active) {
autoScroll.x = autoScroll.y = 0;
return;
}
var top,
right,
bottom,
left,
options = this.target.options[this.prepared.name].autoScroll,
container = options.container || getWindow(this.element);
if (isWindow(container)) {
left = pointer.clientX < autoScroll.margin;
top = pointer.clientY < autoScroll.margin;
right = pointer.clientX > container.innerWidth - autoScroll.margin;
bottom = pointer.clientY > container.innerHeight - autoScroll.margin;
}
else {
var rect = getElementClientRect(container);
left = pointer.clientX < rect.left + autoScroll.margin;
top = pointer.clientY < rect.top + autoScroll.margin;
right = pointer.clientX > rect.right - autoScroll.margin;
bottom = pointer.clientY > rect.bottom - autoScroll.margin;
}
autoScroll.x = (right ? 1: left? -1: 0);
autoScroll.y = (bottom? 1: top? -1: 0);
if (!autoScroll.isScrolling) {
// set the autoScroll properties to those of the target
autoScroll.margin = options.margin;
autoScroll.speed = options.speed;
autoScroll.start(this);
}
},
_updateEventTargets: function (target, currentTarget) {
this._eventTarget = target;
this._curEventTarget = currentTarget;
}
};
function getInteractionFromPointer (pointer, eventType, eventTarget) {
var i = 0, len = interactions.length,
mouseEvent = (/mouse/i.test(pointer.pointerType || eventType)
// MSPointerEvent.MSPOINTER_TYPE_MOUSE
|| pointer.pointerType === 4),
interaction;
var id = getPointerId(pointer);
// try to resume inertia with a new pointer
if (/down|start/i.test(eventType)) {
for (i = 0; i < len; i++) {
interaction = interactions[i];
var element = eventTarget;
if (interaction.inertiaStatus.active && interaction.target.options[interaction.prepared.name].inertia.allowResume
&& (interaction.mouse === mouseEvent)) {
while (element) {
// if the element is the interaction element
if (element === interaction.element) {
// update the interaction's pointer
if (interaction.pointers[0]) {
interaction.removePointer(interaction.pointers[0]);
}
interaction.addPointer(pointer);
return interaction;
}
element = parentElement(element);
}
}
}
}
// if it's a mouse interaction
if (mouseEvent || !(supportsTouch || supportsPointerEvent)) {
// find a mouse interaction that's not in inertia phase
for (i = 0; i < len; i++) {
if (interactions[i].mouse && !interactions[i].inertiaStatus.active) {
return interactions[i];
}
}
// find any interaction specifically for mouse.
// if the eventType is a mousedown, and inertia is active
// ignore the interaction
for (i = 0; i < len; i++) {
if (interactions[i].mouse && !(/down/.test(eventType) && interactions[i].inertiaStatus.active)) {
return interaction;
}
}
// create a new interaction for mouse
interaction = new Interaction();
interaction.mouse = true;
return interaction;
}
// get interaction that has this pointer
for (i = 0; i < len; i++) {
if (contains(interactions[i].pointerIds, id)) {
return interactions[i];
}
}
// at this stage, a pointerUp should not return an interaction
if (/up|end|out/i.test(eventType)) {
return null;
}
// get first idle interaction
for (i = 0; i < len; i++) {
interaction = interactions[i];
if ((!interaction.prepared.name || (interaction.target.options.gesture.enabled))
&& !interaction.interacting()
&& !(!mouseEvent && interaction.mouse)) {
interaction.addPointer(pointer);
return interaction;
}
}
return new Interaction();
}
function doOnInteractions (method) {
return (function (event) {
var interaction,
eventTarget = getActualElement(event.path
? event.path[0]
: event.target),
curEventTarget = getActualElement(event.currentTarget),
i;
if (supportsTouch && /touch/.test(event.type)) {
prevTouchTime = new Date().getTime();
for (i = 0; i < event.changedTouches.length; i++) {
var pointer = event.changedTouches[i];
interaction = getInteractionFromPointer(pointer, event.type, eventTarget);
if (!interaction) { continue; }
interaction._updateEventTargets(eventTarget, curEventTarget);
interaction[method](pointer, event, eventTarget, curEventTarget);
}
}
else {
if (!supportsPointerEvent && /mouse/.test(event.type)) {
// ignore mouse events while touch interactions are active
for (i = 0; i < interactions.length; i++) {
if (!interactions[i].mouse && interactions[i].pointerIsDown) {
return;
}
}
// try to ignore mouse events that are simulated by the browser
// after a touch event
if (new Date().getTime() - prevTouchTime < 500) {
return;
}
}
interaction = getInteractionFromPointer(event, event.type, eventTarget);
if (!interaction) { return; }
interaction._updateEventTargets(eventTarget, curEventTarget);
interaction[method](event, event, eventTarget, curEventTarget);
}
});
}
function InteractEvent (interaction, event, action, phase, element, related) {
var client,
page,
target = interaction.target,
snapStatus = interaction.snapStatus,
restrictStatus = interaction.restrictStatus,
pointers = interaction.pointers,
deltaSource = (target && target.options || defaultOptions).deltaSource,
sourceX = deltaSource + 'X',
sourceY = deltaSource + 'Y',
options = target? target.options: defaultOptions,
origin = getOriginXY(target, element),
starting = phase === 'start',
ending = phase === 'end',
coords = starting? interaction.startCoords : interaction.curCoords;
element = element || interaction.element;
page = extend({}, coords.page);
client = extend({}, coords.client);
page.x -= origin.x;
page.y -= origin.y;
client.x -= origin.x;
client.y -= origin.y;
var relativePoints = options[action].snap && options[action].snap.relativePoints ;
if (checkSnap(target, action) && !(starting && relativePoints && relativePoints.length)) {
this.snap = {
range : snapStatus.range,
locked : snapStatus.locked,
x : snapStatus.snappedX,
y : snapStatus.snappedY,
realX : snapStatus.realX,
realY : snapStatus.realY,
dx : snapStatus.dx,
dy : snapStatus.dy
};
if (snapStatus.locked) {
page.x += snapStatus.dx;
page.y += snapStatus.dy;
client.x += snapStatus.dx;
client.y += snapStatus.dy;
}
}
if (checkRestrict(target, action) && !(starting && options[action].restrict.elementRect) && restrictStatus.restricted) {
page.x += restrictStatus.dx;
page.y += restrictStatus.dy;
client.x += restrictStatus.dx;
client.y += restrictStatus.dy;
this.restrict = {
dx: restrictStatus.dx,
dy: restrictStatus.dy
};
}
this.pageX = page.x;
this.pageY = page.y;
this.clientX = client.x;
this.clientY = client.y;
this.x0 = interaction.startCoords.page.x - origin.x;
this.y0 = interaction.startCoords.page.y - origin.y;
this.clientX0 = interaction.startCoords.client.x - origin.x;
this.clientY0 = interaction.startCoords.client.y - origin.y;
this.ctrlKey = event.ctrlKey;
this.altKey = event.altKey;
this.shiftKey = event.shiftKey;
this.metaKey = event.metaKey;
this.button = event.button;
this.target = element;
this.t0 = interaction.downTimes[0];
this.type = action + (phase || '');
this.interaction = interaction;
this.interactable = target;
var inertiaStatus = interaction.inertiaStatus;
if (inertiaStatus.active) {
this.detail = 'inertia';
}
if (related) {
this.relatedTarget = related;
}
// end event dx, dy is difference between start and end points
if (ending) {
if (deltaSource === 'client') {
this.dx = client.x - interaction.startCoords.client.x;
this.dy = client.y - interaction.startCoords.client.y;
}
else {
this.dx = page.x - interaction.startCoords.page.x;
this.dy = page.y - interaction.startCoords.page.y;
}
}
else if (starting) {
this.dx = 0;
this.dy = 0;
}
// copy properties from previousmove if starting inertia
else if (phase === 'inertiastart') {
this.dx = interaction.prevEvent.dx;
this.dy = interaction.prevEvent.dy;
}
else {
if (deltaSource === 'client') {
this.dx = client.x - interaction.prevEvent.clientX;
this.dy = client.y - interaction.prevEvent.clientY;
}
else {
this.dx = page.x - interaction.prevEvent.pageX;
this.dy = page.y - interaction.prevEvent.pageY;
}
}
if (interaction.prevEvent && interaction.prevEvent.detail === 'inertia'
&& !inertiaStatus.active
&& options[action].inertia && options[action].inertia.zeroResumeDelta) {
inertiaStatus.resumeDx += this.dx;
inertiaStatus.resumeDy += this.dy;
this.dx = this.dy = 0;
}
if (action === 'resize' && interaction.resizeAxes) {
if (options.resize.square) {
if (interaction.resizeAxes === 'y') {
this.dx = this.dy;
}
else {
this.dy = this.dx;
}
this.axes = 'xy';
}
else {
this.axes = interaction.resizeAxes;
if (interaction.resizeAxes === 'x') {
this.dy = 0;
}
else if (interaction.resizeAxes === 'y') {
this.dx = 0;
}
}
}
else if (action === 'gesture') {
this.touches = [pointers[0], pointers[1]];
if (starting) {
this.distance = touchDistance(pointers, deltaSource);
this.box = touchBBox(pointers);
this.scale = 1;
this.ds = 0;
this.angle = touchAngle(pointers, undefined, deltaSource);
this.da = 0;
}
else if (ending || event instanceof InteractEvent) {
this.distance = interaction.prevEvent.distance;
this.box = interaction.prevEvent.box;
this.scale = interaction.prevEvent.scale;
this.ds = this.scale - 1;
this.angle = interaction.prevEvent.angle;
this.da = this.angle - interaction.gesture.startAngle;
}
else {
this.distance = touchDistance(pointers, deltaSource);
this.box = touchBBox(pointers);
this.scale = this.distance / interaction.gesture.startDistance;
this.angle = touchAngle(pointers, interaction.gesture.prevAngle, deltaSource);
this.ds = this.scale - interaction.gesture.prevScale;
this.da = this.angle - interaction.gesture.prevAngle;
}
}
if (starting) {
this.timeStamp = interaction.downTimes[0];
this.dt = 0;
this.duration = 0;
this.speed = 0;
this.velocityX = 0;
this.velocityY = 0;
}
else if (phase === 'inertiastart') {
this.timeStamp = interaction.prevEvent.timeStamp;
this.dt = interaction.prevEvent.dt;
this.duration = interaction.prevEvent.duration;
this.speed = interaction.prevEvent.speed;
this.velocityX = interaction.prevEvent.velocityX;
this.velocityY = interaction.prevEvent.velocityY;
}
else {
this.timeStamp = new Date().getTime();
this.dt = this.timeStamp - interaction.prevEvent.timeStamp;
this.duration = this.timeStamp - interaction.downTimes[0];
if (event instanceof InteractEvent) {
var dx = this[sourceX] - interaction.prevEvent[sourceX],
dy = this[sourceY] - interaction.prevEvent[sourceY],
dt = this.dt / 1000;
this.speed = hypot(dx, dy) / dt;
this.velocityX = dx / dt;
this.velocityY = dy / dt;
}
// if normal move or end event, use previous user event coords
else {
// speed and velocity in pixels per second
this.speed = interaction.pointerDelta[deltaSource].speed;
this.velocityX = interaction.pointerDelta[deltaSource].vx;
this.velocityY = interaction.pointerDelta[deltaSource].vy;
}
}
if ((ending || phase === 'inertiastart')
&& interaction.prevEvent.speed > 600 && this.timeStamp - interaction.prevEvent.timeStamp < 150) {
var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI,
overlap = 22.5;
if (angle < 0) {
angle += 360;
}
var left = 135 - overlap <= angle && angle < 225 + overlap,
up = 225 - overlap <= angle && angle < 315 + overlap,
right = !left && (315 - overlap <= angle || angle < 45 + overlap),
down = !up && 45 - overlap <= angle && angle < 135 + overlap;
this.swipe = {
up : up,
down : down,
left : left,
right: right,
angle: angle,
speed: interaction.prevEvent.speed,
velocity: {
x: interaction.prevEvent.velocityX,
y: interaction.prevEvent.velocityY
}
};
}
}
InteractEvent.prototype = {
preventDefault: blank,
stopImmediatePropagation: function () {
this.immediatePropagationStopped = this.propagationStopped = true;
},
stopPropagation: function () {
this.propagationStopped = true;
}
};
function preventOriginalDefault () {
this.originalEvent.preventDefault();
}
function getActionCursor (action) {
var cursor = '';
if (action.name === 'drag') {
cursor = actionCursors.drag;
}
if (action.name === 'resize') {
if (action.axis) {
cursor = actionCursors[action.name + action.axis];
}
else if (action.edges) {
var cursorKey = 'resize',
edgeNames = ['top', 'bottom', 'left', 'right'];
for (var i = 0; i < 4; i++) {
if (action.edges[edgeNames[i]]) {
cursorKey += edgeNames[i];
}
}
cursor = actionCursors[cursorKey];
}
}
return cursor;
}
function checkResizeEdge (name, value, page, element, interactableElement, rect, margin) {
// false, '', undefined, null
if (!value) { return false; }
// true value, use pointer coords and element rect
if (value === true) {
// if dimensions are negative, "switch" edges
var width = isNumber(rect.width)? rect.width : rect.right - rect.left,
height = isNumber(rect.height)? rect.height : rect.bottom - rect.top;
if (width < 0) {
if (name === 'left' ) { name = 'right'; }
else if (name === 'right') { name = 'left' ; }
}
if (height < 0) {
if (name === 'top' ) { name = 'bottom'; }
else if (name === 'bottom') { name = 'top' ; }
}
if (name === 'left' ) { return page.x < ((width >= 0? rect.left: rect.right ) + margin); }
if (name === 'top' ) { return page.y < ((height >= 0? rect.top : rect.bottom) + margin); }
if (name === 'right' ) { return page.x > ((width >= 0? rect.right : rect.left) - margin); }
if (name === 'bottom') { return page.y > ((height >= 0? rect.bottom: rect.top ) - margin); }
}
// the remaining checks require an element
if (!isElement(element)) { return false; }
return isElement(value)
// the value is an element to use as a resize handle
? value === element
// otherwise check if element matches value as selector
: matchesUpTo(element, value, interactableElement);
}
function defaultActionChecker (pointer, interaction, element) {
var rect = this.getRect(element),
shouldResize = false,
action = null,
resizeAxes = null,
resizeEdges,
page = extend({}, interaction.curCoords.page),
options = this.options;
if (!rect) { return null; }
if (actionIsEnabled.resize && options.resize.enabled) {
var resizeOptions = options.resize;
resizeEdges = {
left: false, right: false, top: false, bottom: false
};
// if using resize.edges
if (isObject(resizeOptions.edges)) {
for (var edge in resizeEdges) {
resizeEdges[edge] = checkResizeEdge(edge,
resizeOptions.edges[edge],
page,
interaction._eventTarget,
element,
rect,
resizeOptions.margin || margin);
}
resizeEdges.left = resizeEdges.left && !resizeEdges.right;
resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
shouldResize = resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom;
}
else {
var right = options.resize.axis !== 'y' && page.x > (rect.right - margin),
bottom = options.resize.axis !== 'x' && page.y > (rect.bottom - margin);
shouldResize = right || bottom;
resizeAxes = (right? 'x' : '') + (bottom? 'y' : '');
}
}
action = shouldResize
? 'resize'
: actionIsEnabled.drag && options.drag.enabled
? 'drag'
: null;
if (actionIsEnabled.gesture
&& interaction.pointerIds.length >=2
&& !(interaction.dragging || interaction.resizing)) {
action = 'gesture';
}
if (action) {
return {
name: action,
axis: resizeAxes,
edges: resizeEdges
};
}
return null;
}
// Check if action is enabled globally and the current target supports it
// If so, return the validated action. Otherwise, return null
function validateAction (action, interactable) {
if (!isObject(action)) { return null; }
var actionName = action.name,
options = interactable.options;
if (( (actionName === 'resize' && options.resize.enabled )
|| (actionName === 'drag' && options.drag.enabled )
|| (actionName === 'gesture' && options.gesture.enabled))
&& actionIsEnabled[actionName]) {
if (actionName === 'resize' || actionName === 'resizeyx') {
actionName = 'resizexy';
}
return action;
}
return null;
}
var listeners = {},
interactionListeners = [
'dragStart', 'dragMove', 'resizeStart', 'resizeMove', 'gestureStart', 'gestureMove',
'pointerOver', 'pointerOut', 'pointerHover', 'selectorDown',
'pointerDown', 'pointerMove', 'pointerUp', 'pointerCancel', 'pointerEnd',
'addPointer', 'removePointer', 'recordPointer', 'autoScrollMove'
];
for (var i = 0, len = interactionListeners.length; i < len; i++) {
var name = interactionListeners[i];
listeners[name] = doOnInteractions(name);
}
// bound to the interactable context when a DOM event
// listener is added to a selector interactable
function delegateListener (event, useCapture) {
var fakeEvent = {},
delegated = delegatedEvents[event.type],
eventTarget = getActualElement(event.path
? event.path[0]
: event.target),
element = eventTarget;
useCapture = useCapture? true: false;
// duplicate the event so that currentTarget can be changed
for (var prop in event) {
fakeEvent[prop] = event[prop];
}
fakeEvent.originalEvent = event;
fakeEvent.preventDefault = preventOriginalDefault;
// climb up document tree looking for selector matches
while (isElement(element)) {
for (var i = 0; i < delegated.selectors.length; i++) {
var selector = delegated.selectors[i],
context = delegated.contexts[i];
if (matchesSelector(element, selector)
&& nodeContains(context, eventTarget)
&& nodeContains(context, element)) {
var listeners = delegated.listeners[i];
fakeEvent.currentTarget = element;
for (var j = 0; j < listeners.length; j++) {
if (listeners[j][1] === useCapture) {
listeners[j][0](fakeEvent);
}
}
}
}
element = parentElement(element);
}
}
function delegateUseCapture (event) {
return delegateListener.call(this, event, true);
}
interactables.indexOfElement = function indexOfElement (element, context) {
context = context || document;
for (var i = 0; i < this.length; i++) {
var interactable = this[i];
if ((interactable.selector === element
&& (interactable._context === context))
|| (!interactable.selector && interactable._element === element)) {
return i;
}
}
return -1;
};
interactables.get = function interactableGet (element, options) {
return this[this.indexOfElement(element, options && options.context)];
};
interactables.forEachSelector = function (callback) {
for (var i = 0; i < this.length; i++) {
var interactable = this[i];
if (!interactable.selector) {
continue;
}
var ret = callback(interactable, interactable.selector, interactable._context, i, this);
if (ret !== undefined) {
return ret;
}
}
};
/*\
* interact
[ method ]
*
* The methods of this variable can be used to set elements as
* interactables and also to change various default settings.
*
* Calling it as a function and passing an element or a valid CSS selector
* string returns an Interactable object which has various methods to
* configure it.
*
- element (Element | string) The HTML or SVG Element to interact with or CSS selector
= (object) An @Interactable
*
> Usage
| interact(document.getElementById('draggable')).draggable(true);
|
| var rectables = interact('rect');
| rectables
| .gesturable(true)
| .on('gesturemove', function (event) {
| // something cool...
| })
| .autoScroll(true);
\*/
function interact (element, options) {
return interactables.get(element, options) || new Interactable(element, options);
}
/*\
* Interactable
[ property ]
**
* Object type returned by @interact
\*/
function Interactable (element, options) {
this._element = element;
this._iEvents = this._iEvents || {};
var _window;
if (trySelector(element)) {
this.selector = element;
var context = options && options.context;
_window = context? getWindow(context) : window;
if (context && (_window.Node
? context instanceof _window.Node
: (isElement(context) || context === _window.document))) {
this._context = context;
}
}
else {
_window = getWindow(element);
if (isElement(element, _window)) {
if (PointerEvent) {
events.add(this._element, pEventTypes.down, listeners.pointerDown );
events.add(this._element, pEventTypes.move, listeners.pointerHover);
}
else {
events.add(this._element, 'mousedown' , listeners.pointerDown );
events.add(this._element, 'mousemove' , listeners.pointerHover);
events.add(this._element, 'touchstart', listeners.pointerDown );
events.add(this._element, 'touchmove' , listeners.pointerHover);
}
}
}
this._doc = _window.document;
if (!contains(documents, this._doc)) {
listenToDocument(this._doc);
}
interactables.push(this);
this.set(options);
}
Interactable.prototype = {
setOnEvents: function (action, phases) {
if (action === 'drop') {
if (isFunction(phases.ondrop) ) { this.ondrop = phases.ondrop ; }
if (isFunction(phases.ondropactivate) ) { this.ondropactivate = phases.ondropactivate ; }
if (isFunction(phases.ondropdeactivate)) { this.ondropdeactivate = phases.ondropdeactivate; }
if (isFunction(phases.ondragenter) ) { this.ondragenter = phases.ondragenter ; }
if (isFunction(phases.ondragleave) ) { this.ondragleave = phases.ondragleave ; }
if (isFunction(phases.ondropmove) ) { this.ondropmove = phases.ondropmove ; }
}
else {
action = 'on' + action;
if (isFunction(phases.onstart) ) { this[action + 'start' ] = phases.onstart ; }
if (isFunction(phases.onmove) ) { this[action + 'move' ] = phases.onmove ; }
if (isFunction(phases.onend) ) { this[action + 'end' ] = phases.onend ; }
if (isFunction(phases.oninertiastart)) { this[action + 'inertiastart' ] = phases.oninertiastart ; }
}
return this;
},
/*\
* Interactable.draggable
[ method ]
*
* Gets or sets whether drag actions can be performed on the
* Interactable
*
= (boolean) Indicates if this can be the target of drag events
| var isDraggable = interact('ul li').draggable();
* or
- options (boolean | object) #optional true/false or An object with event listeners to be fired on drag events (object makes the Interactable draggable)
= (object) This Interactable
| interact(element).draggable({
| onstart: function (event) {},
| onmove : function (event) {},
| onend : function (event) {},
|
| // the axis in which the first movement must be
| // for the drag sequence to start
| // 'xy' by default - any direction
| axis: 'x' || 'y' || 'xy',
|
| // max number of drags that can happen concurrently
| // with elements of this Interactable. Infinity by default
| max: Infinity,
|
| // max number of drags that can target the same element+Interactable
| // 1 by default
| maxPerElement: 2
| });
\*/
draggable: function (options) {
if (isObject(options)) {
this.options.drag.enabled = options.enabled === false? false: true;
this.setPerAction('drag', options);
this.setOnEvents('drag', options);
if (/^x$|^y$|^xy$/.test(options.axis)) {
this.options.drag.axis = options.axis;
}
else if (options.axis === null) {
delete this.options.drag.axis;
}
return this;
}
if (isBool(options)) {
this.options.drag.enabled = options;
return this;
}
return this.options.drag;
},
setPerAction: function (action, options) {
// for all the default per-action options
for (var option in options) {
// if this option exists for this action
if (option in defaultOptions[action]) {
// if the option in the options arg is an object value
if (isObject(options[option])) {
// duplicate the object
this.options[action][option] = extend(this.options[action][option] || {}, options[option]);
if (isObject(defaultOptions.perAction[option]) && 'enabled' in defaultOptions.perAction[option]) {
this.options[action][option].enabled = options[option].enabled === false? false : true;
}
}
else if (isBool(options[option]) && isObject(defaultOptions.perAction[option])) {
this.options[action][option].enabled = options[option];
}
else if (options[option] !== undefined) {
// or if it's not undefined, do a plain assignment
this.options[action][option] = options[option];
}
}
}
},
/*\
* Interactable.dropzone
[ method ]
*
* Returns or sets whether elements can be dropped onto this
* Interactable to trigger drop events
*
* Dropzones can receive the following events:
* - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends
* - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone
* - `dragmove` when a draggable that has entered the dropzone is moved
* - `drop` when a draggable is dropped into this dropzone
*
* Use the `accept` option to allow only elements that match the given CSS selector or element.
*
* Use the `overlap` option to set how drops are checked for. The allowed values are:
* - `'pointer'`, the pointer must be over the dropzone (default)
* - `'center'`, the draggable element's center must be over the dropzone
* - a number from 0-1 which is the `(intersection area) / (draggable area)`.
* e.g. `0.5` for drop to happen when half of the area of the
* draggable is over the dropzone
*
- options (boolean | object | null) #optional The new value to be set.
| interact('.drop').dropzone({
| accept: '.can-drop' || document.getElementById('single-drop'),
| overlap: 'pointer' || 'center' || zeroToOne
| }
= (boolean | object) The current setting or this Interactable
\*/
dropzone: function (options) {
if (isObject(options)) {
this.options.drop.enabled = options.enabled === false? false: true;
this.setOnEvents('drop', options);
this.accept(options.accept);
if (/^(pointer|center)$/.test(options.overlap)) {
this.options.drop.overlap = options.overlap;
}
else if (isNumber(options.overlap)) {
this.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
}
return this;
}
if (isBool(options)) {
this.options.drop.enabled = options;
return this;
}
return this.options.drop;
},
dropCheck: function (pointer, event, draggable, draggableElement, dropElement, rect) {
var dropped = false;
// if the dropzone has no rect (eg. display: none)
// call the custom dropChecker or just return false
if (!(rect = rect || this.getRect(dropElement))) {
return (this.options.dropChecker
? this.options.dropChecker(pointer, event, dropped, this, dropElement, draggable, draggableElement)
: false);
}
var dropOverlap = this.options.drop.overlap;
if (dropOverlap === 'pointer') {
var page = getPageXY(pointer),
origin = getOriginXY(draggable, draggableElement),
horizontal,
vertical;
page.x += origin.x;
page.y += origin.y;
horizontal = (page.x > rect.left) && (page.x < rect.right);
vertical = (page.y > rect.top ) && (page.y < rect.bottom);
dropped = horizontal && vertical;
}
var dragRect = draggable.getRect(draggableElement);
if (dropOverlap === 'center') {
var cx = dragRect.left + dragRect.width / 2,
cy = dragRect.top + dragRect.height / 2;
dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
}
if (isNumber(dropOverlap)) {
var overlapArea = (Math.max(0, Math.min(rect.right , dragRect.right ) - Math.max(rect.left, dragRect.left))
* Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top , dragRect.top ))),
overlapRatio = overlapArea / (dragRect.width * dragRect.height);
dropped = overlapRatio >= dropOverlap;
}
if (this.options.dropChecker) {
dropped = this.options.dropChecker(pointer, dropped, this, dropElement, draggable, draggableElement);
}
return dropped;
},
/*\
* Interactable.dropChecker
[ method ]
*
* Gets or sets the function used to check if a dragged element is
* over this Interactable.
*
- checker (function) #optional The function that will be called when checking for a drop
= (Function | Interactable) The checker function or this Interactable
*
* The checker function takes the following arguments:
*
- pointer (Touch | PointerEvent | MouseEvent) The pointer/event that ends a drag
- event (TouchEvent | PointerEvent | MouseEvent) The event related to the pointer
- dropped (boolean) The value from the default drop check
- dropzone (Interactable) The dropzone interactable
- dropElement (Element) The dropzone element
- draggable (Interactable) The Interactable being dragged
- draggableElement (Element) The actual element that's being dragged
*
> Usage:
| interact(target)
| .dropChecker(function(pointer, // Touch/PointerEvent/MouseEvent
| event, // TouchEvent/PointerEvent/MouseEvent
| dropped, // result of the default checker
| dropzone, // dropzone Interactable
| dropElement, // dropzone elemnt
| draggable, // draggable Interactable
| draggableElement) {// draggable element
|
| return dropped && event.target.hasAttribute('allow-drop');
| }
\*/
dropChecker: function (checker) {
if (isFunction(checker)) {
this.options.dropChecker = checker;
return this;
}
if (checker === null) {
delete this.options.getRect;
return this;
}
return this.options.dropChecker;
},
/*\
* Interactable.accept
[ method ]
*
* Deprecated. add an `accept` property to the options object passed to
* @Interactable.dropzone instead.
*
* Gets or sets the Element or CSS selector match that this
* Interactable accepts if it is a dropzone.
*
- newValue (Element | string | null) #optional
* If it is an Element, then only that element can be dropped into this dropzone.
* If it is a string, the element being dragged must match it as a selector.
* If it is null, the accept options is cleared - it accepts any element.
*
= (string | Element | null | Interactable) The current accept option if given `undefined` or this Interactable
\*/
accept: function (newValue) {
if (isElement(newValue)) {
this.options.drop.accept = newValue;
return this;
}
// test if it is a valid CSS selector
if (trySelector(newValue)) {
this.options.drop.accept = newValue;
return this;
}
if (newValue === null) {
delete this.options.drop.accept;
return this;
}
return this.options.drop.accept;
},
/*\
* Interactable.resizable
[ method ]
*
* Gets or sets whether resize actions can be performed on the
* Interactable
*
= (boolean) Indicates if this can be the target of resize elements
| var isResizeable = interact('input[type=text]').resizable();
* or
- options (boolean | object) #optional true/false or An object with event listeners to be fired on resize events (object makes the Interactable resizable)
= (object) This Interactable
| interact(element).resizable({
| onstart: function (event) {},
| onmove : function (event) {},
| onend : function (event) {},
|
| edges: {
| top : true, // Use pointer coords to check for resize.
| left : false, // Disable resizing from left edge.
| bottom: '.resize-s',// Resize if pointer target matches selector
| right : handleEl // Resize if pointer target is the given Element
| },
|
| // a value of 'none' will limit the resize rect to a minimum of 0x0
| // 'negate' will allow the rect to have negative width/height
| // 'reposition' will keep the width/height positive by swapping
| // the top and bottom edges and/or swapping the left and right edges
| invert: 'none' || 'negate' || 'reposition'
|
| // limit multiple resizes.
| // See the explanation in the @Interactable.draggable example
| max: Infinity,
| maxPerElement: 1,
| });
\*/
resizable: function (options) {
if (isObject(options)) {
this.options.resize.enabled = options.enabled === false? false: true;
this.setPerAction('resize', options);
this.setOnEvents('resize', options);
if (/^x$|^y$|^xy$/.test(options.axis)) {
this.options.resize.axis = options.axis;
}
else if (options.axis === null) {
this.options.resize.axis = defaultOptions.resize.axis;
}
if (isBool(options.square)) {
this.options.resize.square = options.square;
}
return this;
}
if (isBool(options)) {
this.options.resize.enabled = options;
return this;
}
return this.options.resize;
},
/*\
* Interactable.squareResize
[ method ]
*
* Deprecated. Add a `square: true || false` property to @Interactable.resizable instead
*
* Gets or sets whether resizing is forced 1:1 aspect
*
= (boolean) Current setting
*
* or
*
- newValue (boolean) #optional
= (object) this Interactable
\*/
squareResize: function (newValue) {
if (isBool(newValue)) {
this.options.resize.square = newValue;
return this;
}
if (newValue === null) {
delete this.options.resize.square;
return this;
}
return this.options.resize.square;
},
/*\
* Interactable.gesturable
[ method ]
*
* Gets or sets whether multitouch gestures can be performed on the
* Interactable's element
*
= (boolean) Indicates if this can be the target of gesture events
| var isGestureable = interact(element).gesturable();
* or
- options (boolean | object) #optional true/false or An object with event listeners to be fired on gesture events (makes the Interactable gesturable)
= (object) this Interactable
| interact(element).gesturable({
| onstart: function (event) {},
| onmove : function (event) {},
| onend : function (event) {},
|
| // limit multiple gestures.
| // See the explanation in @Interactable.draggable example
| max: Infinity,
| maxPerElement: 1,
| });
\*/
gesturable: function (options) {
if (isObject(options)) {
this.options.gesture.enabled = options.enabled === false? false: true;
this.setPerAction('gesture', options);
this.setOnEvents('gesture', options);
return this;
}
if (isBool(options)) {
this.options.gesture.enabled = options;
return this;
}
return this.options.gesture;
},
/*\
* Interactable.autoScroll
[ method ]
**
* Deprecated. Add an `autoscroll` property to the options object
* passed to @Interactable.draggable or @Interactable.resizable instead.
*
* Returns or sets whether dragging and resizing near the edges of the
* window/container trigger autoScroll for this Interactable
*
= (object) Object with autoScroll properties
*
* or
*
- options (object | boolean) #optional
* options can be:
* - an object with margin, distance and interval properties,
* - true or false to enable or disable autoScroll or
= (Interactable) this Interactable
\*/
autoScroll: function (options) {
if (isObject(options)) {
options = extend({ actions: ['drag', 'resize']}, options);
}
else if (isBool(options)) {
options = { actions: ['drag', 'resize'], enabled: options };
}
return this.setOptions('autoScroll', options);
},
/*\
* Interactable.snap
[ method ]
**
* Deprecated. Add a `snap` property to the options object passed
* to @Interactable.draggable or @Interactable.resizable instead.
*
* Returns or sets if and how action coordinates are snapped. By
* default, snapping is relative to the pointer coordinates. You can
* change this by setting the
* [`elementOrigin`](https://github.com/taye/interact.js/pull/72).
**
= (boolean | object) `false` if snap is disabled; object with snap properties if snap is enabled
**
* or
**
- options (object | boolean | null) #optional
= (Interactable) this Interactable
> Usage
| interact(document.querySelector('#thing')).snap({
| targets: [
| // snap to this specific point
| {
| x: 100,
| y: 100,
| range: 25
| },
| // give this function the x and y page coords and snap to the object returned
| function (x, y) {
| return {
| x: x,
| y: (75 + 50 * Math.sin(x * 0.04)),
| range: 40
| };
| },
| // create a function that snaps to a grid
| interact.createSnapGrid({
| x: 50,
| y: 50,
| range: 10, // optional
| offset: { x: 5, y: 10 } // optional
| })
| ],
| // do not snap during normal movement.
| // Instead, trigger only one snapped move event
| // immediately before the end event.
| endOnly: true,
|
| relativePoints: [
| { x: 0, y: 0 }, // snap relative to the top left of the element
| { x: 1, y: 1 }, // and also to the bottom right
| ],
|
| // offset the snap target coordinates
| // can be an object with x/y or 'startCoords'
| offset: { x: 50, y: 50 }
| }
| });
\*/
snap: function (options) {
var ret = this.setOptions('snap', options);
if (ret === this) { return this; }
return ret.drag;
},
setOptions: function (option, options) {
var actions = options && isArray(options.actions)
? options.actions
: ['drag'];
var i;
if (isObject(options) || isBool(options)) {
for (i = 0; i < actions.length; i++) {
var action = /resize/.test(actions[i])? 'resize' : actions[i];
if (!isObject(this.options[action])) { continue; }
var thisOption = this.options[action][option];
if (isObject(options)) {
extend(thisOption, options);
thisOption.enabled = options.enabled === false? false: true;
if (option === 'snap') {
if (thisOption.mode === 'grid') {
thisOption.targets = [
interact.createSnapGrid(extend({
offset: thisOption.gridOffset || { x: 0, y: 0 }
}, thisOption.grid || {}))
];
}
else if (thisOption.mode === 'anchor') {
thisOption.targets = thisOption.anchors;
}
else if (thisOption.mode === 'path') {
thisOption.targets = thisOption.paths;
}
if ('elementOrigin' in options) {
thisOption.relativePoints = [options.elementOrigin];
}
}
}
else if (isBool(options)) {
thisOption.enabled = options;
}
}
return this;
}
var ret = {},
allActions = ['drag', 'resize', 'gesture'];
for (i = 0; i < allActions.length; i++) {
if (option in defaultOptions[allActions[i]]) {
ret[allActions[i]] = this.options[allActions[i]][option];
}
}
return ret;
},
/*\
* Interactable.inertia
[ method ]
**
* Deprecated. Add an `inertia` property to the options object passed
* to @Interactable.draggable or @Interactable.resizable instead.
*
* Returns or sets if and how events continue to run after the pointer is released
**
= (boolean | object) `false` if inertia is disabled; `object` with inertia properties if inertia is enabled
**
* or
**
- options (object | boolean | null) #optional
= (Interactable) this Interactable
> Usage
| // enable and use default settings
| interact(element).inertia(true);
|
| // enable and use custom settings
| interact(element).inertia({
| // value greater than 0
| // high values slow the object down more quickly
| resistance : 16,
|
| // the minimum launch speed (pixels per second) that results in inertia start
| minSpeed : 200,
|
| // inertia will stop when the object slows down to this speed
| endSpeed : 20,
|
| // boolean; should actions be resumed when the pointer goes down during inertia
| allowResume : true,
|
| // boolean; should the jump when resuming from inertia be ignored in event.dx/dy
| zeroResumeDelta: false,
|
| // if snap/restrict are set to be endOnly and inertia is enabled, releasing
| // the pointer without triggering inertia will animate from the release
| // point to the snaped/restricted point in the given amount of time (ms)
| smoothEndDuration: 300,
|
| // an array of action types that can have inertia (no gesture)
| actions : ['drag', 'resize']
| });
|
| // reset custom settings and use all defaults
| interact(element).inertia(null);
\*/
inertia: function (options) {
var ret = this.setOptions('inertia', options);
if (ret === this) { return this; }
return ret.drag;
},
getAction: function (pointer, event, interaction, element) {
var action = this.defaultActionChecker(pointer, interaction, element);
if (this.options.actionChecker) {
return this.options.actionChecker(pointer, event, action, this, element, interaction);
}
return action;
},
defaultActionChecker: defaultActionChecker,
/*\
* Interactable.actionChecker
[ method ]
*
* Gets or sets the function used to check action to be performed on
* pointerDown
*
- checker (function | null) #optional A function which takes a pointer event, defaultAction string, interactable, element and interaction as parameters and returns an object with name property 'drag' 'resize' or 'gesture' and optionally an `edges` object with boolean 'top', 'left', 'bottom' and right props.
= (Function | Interactable) The checker function or this Interactable
*
| interact('.resize-drag')
| .resizable(true)
| .draggable(true)
| .actionChecker(function (pointer, event, action, interactable, element, interaction) {
|
| if (interact.matchesSelector(event.target, '.drag-handle') {
| // force drag with handle target
| action.name = drag;
| }
| else {
| // resize from the top and right edges
| action.name = 'resize';
| action.edges = { top: true, right: true };
| }
|
| return action;
| });
\*/
actionChecker: function (checker) {
if (isFunction(checker)) {
this.options.actionChecker = checker;
return this;
}
if (checker === null) {
delete this.options.actionChecker;
return this;
}
return this.options.actionChecker;
},
/*\
* Interactable.getRect
[ method ]
*
* The default function to get an Interactables bounding rect. Can be
* overridden using @Interactable.rectChecker.
*
- element (Element) #optional The element to measure.
= (object) The object's bounding rectangle.
o {
o top : 0,
o left : 0,
o bottom: 0,
o right : 0,
o width : 0,
o height: 0
o }
\*/
getRect: function rectCheck (element) {
element = element || this._element;
if (this.selector && !(isElement(element))) {
element = this._context.querySelector(this.selector);
}
return getElementRect(element);
},
/*\
* Interactable.rectChecker
[ method ]
*
* Returns or sets the function used to calculate the interactable's
* element's rectangle
*
- checker (function) #optional A function which returns this Interactable's bounding rectangle. See @Interactable.getRect
= (function | object) The checker function or this Interactable
\*/
rectChecker: function (checker) {
if (isFunction(checker)) {
this.getRect = checker;
return this;
}
if (checker === null) {
delete this.options.getRect;
return this;
}
return this.getRect;
},
/*\
* Interactable.styleCursor
[ method ]
*
* Returns or sets whether the action that would be performed when the
* mouse on the element are checked on `mousemove` so that the cursor
* may be styled appropriately
*
- newValue (boolean) #optional
= (boolean | Interactable) The current setting or this Interactable
\*/
styleCursor: function (newValue) {
if (isBool(newValue)) {
this.options.styleCursor = newValue;
return this;
}
if (newValue === null) {
delete this.options.styleCursor;
return this;
}
return this.options.styleCursor;
},
/*\
* Interactable.preventDefault
[ method ]
*
* Returns or sets whether to prevent the browser's default behaviour
* in response to pointer events. Can be set to:
* - `'always'` to always prevent
* - `'never'` to never prevent
* - `'auto'` to let interact.js try to determine what would be best
*
- newValue (string) #optional `true`, `false` or `'auto'`
= (string | Interactable) The current setting or this Interactable
\*/
preventDefault: function (newValue) {
if (/^(always|never|auto)$/.test(newValue)) {
this.options.preventDefault = newValue;
return this;
}
if (isBool(newValue)) {
this.options.preventDefault = newValue? 'always' : 'never';
return this;
}
return this.options.preventDefault;
},
/*\
* Interactable.origin
[ method ]
*
* Gets or sets the origin of the Interactable's element. The x and y
* of the origin will be subtracted from action event coordinates.
*
- origin (object | string) #optional An object eg. { x: 0, y: 0 } or string 'parent', 'self' or any CSS selector
* OR
- origin (Element) #optional An HTML or SVG Element whose rect will be used
**
= (object) The current origin or this Interactable
\*/
origin: function (newValue) {
if (trySelector(newValue)) {
this.options.origin = newValue;
return this;
}
else if (isObject(newValue)) {
this.options.origin = newValue;
return this;
}
return this.options.origin;
},
/*\
* Interactable.deltaSource
[ method ]
*
* Returns or sets the mouse coordinate types used to calculate the
* movement of the pointer.
*
- newValue (string) #optional Use 'client' if you will be scrolling while interacting; Use 'page' if you want autoScroll to work
= (string | object) The current deltaSource or this Interactable
\*/
deltaSource: function (newValue) {
if (newValue === 'page' || newValue === 'client') {
this.options.deltaSource = newValue;
return this;
}
return this.options.deltaSource;
},
/*\
* Interactable.restrict
[ method ]
**
* Deprecated. Add a `restrict` property to the options object passed to
* @Interactable.draggable, @Interactable.resizable or @Interactable.gesturable instead.
*
* Returns or sets the rectangles within which actions on this
* interactable (after snap calculations) are restricted. By default,
* restricting is relative to the pointer coordinates. You can change
* this by setting the
* [`elementRect`](https://github.com/taye/interact.js/pull/72).
**
- options (object) #optional an object with keys drag, resize, and/or gesture whose values are rects, Elements, CSS selectors, or 'parent' or 'self'
= (object) The current restrictions object or this Interactable
**
| interact(element).restrict({
| // the rect will be `interact.getElementRect(element.parentNode)`
| drag: element.parentNode,
|
| // x and y are relative to the the interactable's origin
| resize: { x: 100, y: 100, width: 200, height: 200 }
| })
|
| interact('.draggable').restrict({
| // the rect will be the selected element's parent
| drag: 'parent',
|
| // do not restrict during normal movement.
| // Instead, trigger only one restricted move event
| // immediately before the end event.
| endOnly: true,
|
| // https://github.com/taye/interact.js/pull/72#issue-41813493
| elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
| });
\*/
restrict: function (options) {
if (!isObject(options)) {
return this.setOptions('restrict', options);
}
var actions = ['drag', 'resize', 'gesture'],
ret;
for (var i = 0; i < actions.length; i++) {
var action = actions[i];
if (action in options) {
var perAction = extend({
actions: [action],
restriction: options[action]
}, options);
ret = this.setOptions('restrict', perAction);
}
}
return ret;
},
/*\
* Interactable.context
[ method ]
*
* Gets the selector context Node of the Interactable. The default is `window.document`.
*
= (Node) The context Node of this Interactable
**
\*/
context: function () {
return this._context;
},
_context: document,
/*\
* Interactable.ignoreFrom
[ method ]
*
* If the target of the `mousedown`, `pointerdown` or `touchstart`
* event or any of it's parents match the given CSS selector or
* Element, no drag/resize/gesture is started.
*
- newValue (string | Element | null) #optional a CSS selector string, an Element or `null` to not ignore any elements
= (string | Element | object) The current ignoreFrom value or this Interactable
**
| interact(element, { ignoreFrom: document.getElementById('no-action') });
| // or
| interact(element).ignoreFrom('input, textarea, a');
\*/
ignoreFrom: function (newValue) {
if (trySelector(newValue)) { // CSS selector to match event.target
this.options.ignoreFrom = newValue;
return this;
}
if (isElement(newValue)) { // specific element
this.options.ignoreFrom = newValue;
return this;
}
return this.options.ignoreFrom;
},
/*\
* Interactable.allowFrom
[ method ]
*
* A drag/resize/gesture is started only If the target of the
* `mousedown`, `pointerdown` or `touchstart` event or any of it's
* parents match the given CSS selector or Element.
*
- newValue (string | Element | null) #optional a CSS selector string, an Element or `null` to allow from any element
= (string | Element | object) The current allowFrom value or this Interactable
**
| interact(element, { allowFrom: document.getElementById('drag-handle') });
| // or
| interact(element).allowFrom('.handle');
\*/
allowFrom: function (newValue) {
if (trySelector(newValue)) { // CSS selector to match event.target
this.options.allowFrom = newValue;
return this;
}
if (isElement(newValue)) { // specific element
this.options.allowFrom = newValue;
return this;
}
return this.options.allowFrom;
},
/*\
* Interactable.element
[ method ]
*
* If this is not a selector Interactable, it returns the element this
* interactable represents
*
= (Element) HTML / SVG Element
\*/
element: function () {
return this._element;
},
/*\
* Interactable.fire
[ method ]
*
* Calls listeners for the given InteractEvent type bound globally
* and directly to this Interactable
*
- iEvent (InteractEvent) The InteractEvent object to be fired on this Interactable
= (Interactable) this Interactable
\*/
fire: function (iEvent) {
if (!(iEvent && iEvent.type) || !contains(eventTypes, iEvent.type)) {
return this;
}
var listeners,
i,
len,
onEvent = 'on' + iEvent.type,
funcName = '';
// Interactable#on() listeners
if (iEvent.type in this._iEvents) {
listeners = this._iEvents[iEvent.type];
for (i = 0, len = listeners.length; i < len && !iEvent.immediatePropagationStopped; i++) {
funcName = listeners[i].name;
listeners[i](iEvent);
}
}
// interactable.onevent listener
if (isFunction(this[onEvent])) {
funcName = this[onEvent].name;
this[onEvent](iEvent);
}
// interact.on() listeners
if (iEvent.type in globalEvents && (listeners = globalEvents[iEvent.type])) {
for (i = 0, len = listeners.length; i < len && !iEvent.immediatePropagationStopped; i++) {
funcName = listeners[i].name;
listeners[i](iEvent);
}
}
return this;
},
/*\
* Interactable.on
[ method ]
*
* Binds a listener for an InteractEvent or DOM event.
*
- eventType (string | array | object) The types of events to listen for
- listener (function) The function to be called on the given event(s)
- useCapture (boolean) #optional useCapture flag for addEventListener
= (object) This Interactable
\*/
on: function (eventType, listener, useCapture) {
var i;
if (isString(eventType) && eventType.search(' ') !== -1) {
eventType = eventType.trim().split(/ +/);
}
if (isArray(eventType)) {
for (i = 0; i < eventType.length; i++) {
this.on(eventType[i], listener, useCapture);
}
return this;
}
if (isObject(eventType)) {
for (var prop in eventType) {
this.on(prop, eventType[prop], listener);
}
return this;
}
if (eventType === 'wheel') {
eventType = wheelEvent;
}
// convert to boolean
useCapture = useCapture? true: false;
if (contains(eventTypes, eventType)) {
// if this type of event was never bound to this Interactable
if (!(eventType in this._iEvents)) {
this._iEvents[eventType] = [listener];
}
else {
this._iEvents[eventType].push(listener);
}
}
// delegated event for selector
else if (this.selector) {
if (!delegatedEvents[eventType]) {
delegatedEvents[eventType] = {
selectors: [],
contexts : [],
listeners: []
};
// add delegate listener functions
for (i = 0; i < documents.length; i++) {
events.add(documents[i], eventType, delegateListener);
events.add(documents[i], eventType, delegateUseCapture, true);
}
}
var delegated = delegatedEvents[eventType],
index;
for (index = delegated.selectors.length - 1; index >= 0; index--) {
if (delegated.selectors[index] === this.selector
&& delegated.contexts[index] === this._context) {
break;
}
}
if (index === -1) {
index = delegated.selectors.length;
delegated.selectors.push(this.selector);
delegated.contexts .push(this._context);
delegated.listeners.push([]);
}
// keep listener and useCapture flag
delegated.listeners[index].push([listener, useCapture]);
}
else {
events.add(this._element, eventType, listener, useCapture);
}
return this;
},
/*\
* Interactable.off
[ method ]
*
* Removes an InteractEvent or DOM event listener
*
- eventType (string | array | object) The types of events that were listened for
- listener (function) The listener function to be removed
- useCapture (boolean) #optional useCapture flag for removeEventListener
= (object) This Interactable
\*/
off: function (eventType, listener, useCapture) {
var i;
if (isString(eventType) && eventType.search(' ') !== -1) {
eventType = eventType.trim().split(/ +/);
}
if (isArray(eventType)) {
for (i = 0; i < eventType.length; i++) {
this.off(eventType[i], listener, useCapture);
}
return this;
}
if (isObject(eventType)) {
for (var prop in eventType) {
this.off(prop, eventType[prop], listener);
}
return this;
}
var eventList,
index = -1;
// convert to boolean
useCapture = useCapture? true: false;
if (eventType === 'wheel') {
eventType = wheelEvent;
}
// if it is an action event type
if (contains(eventTypes, eventType)) {
eventList = this._iEvents[eventType];
if (eventList && (index = indexOf(eventList, listener)) !== -1) {
this._iEvents[eventType].splice(index, 1);
}
}
// delegated event
else if (this.selector) {
var delegated = delegatedEvents[eventType],
matchFound = false;
if (!delegated) { return this; }
// count from last index of delegated to 0
for (index = delegated.selectors.length - 1; index >= 0; index--) {
// look for matching selector and context Node
if (delegated.selectors[index] === this.selector
&& delegated.contexts[index] === this._context) {
var listeners = delegated.listeners[index];
// each item of the listeners array is an array: [function, useCaptureFlag]
for (i = listeners.length - 1; i >= 0; i--) {
var fn = listeners[i][0],
useCap = listeners[i][1];
// check if the listener functions and useCapture flags match
if (fn === listener && useCap === useCapture) {
// remove the listener from the array of listeners
listeners.splice(i, 1);
// if all listeners for this interactable have been removed
// remove the interactable from the delegated arrays
if (!listeners.length) {
delegated.selectors.splice(index, 1);
delegated.contexts .splice(index, 1);
delegated.listeners.splice(index, 1);
// remove delegate function from context
events.remove(this._context, eventType, delegateListener);
events.remove(this._context, eventType, delegateUseCapture, true);
// remove the arrays if they are empty
if (!delegated.selectors.length) {
delegatedEvents[eventType] = null;
}
}
// only remove one listener
matchFound = true;
break;
}
}
if (matchFound) { break; }
}
}
}
// remove listener from this Interatable's element
else {
events.remove(this._element, eventType, listener, useCapture);
}
return this;
},
/*\
* Interactable.set
[ method ]
*
* Reset the options of this Interactable
- options (object) The new settings to apply
= (object) This Interactablw
\*/
set: function (options) {
if (!isObject(options)) {
options = {};
}
this.options = extend({}, defaultOptions.base);
var i,
actions = ['drag', 'drop', 'resize', 'gesture'],
methods = ['draggable', 'dropzone', 'resizable', 'gesturable'],
perActions = extend(extend({}, defaultOptions.perAction), options[action] || {});
for (i = 0; i < actions.length; i++) {
var action = actions[i];
this.options[action] = extend({}, defaultOptions[action]);
this.setPerAction(action, perActions);
this[methods[i]](options[action]);
}
var settings = [
'accept', 'actionChecker', 'allowFrom', 'deltaSource',
'dropChecker', 'ignoreFrom', 'origin', 'preventDefault',
'rectChecker'
];
for (i = 0, len = settings.length; i < len; i++) {
var setting = settings[i];
this.options[setting] = defaultOptions.base[setting];
if (setting in options) {
this[setting](options[setting]);
}
}
return this;
},
/*\
* Interactable.unset
[ method ]
*
* Remove this interactable from the list of interactables and remove
* it's drag, drop, resize and gesture capabilities
*
= (object) @interact
\*/
unset: function () {
events.remove(this._element, 'all');
if (!isString(this.selector)) {
events.remove(this, 'all');
if (this.options.styleCursor) {
this._element.style.cursor = '';
}
}
else {
// remove delegated events
for (var type in delegatedEvents) {
var delegated = delegatedEvents[type];
for (var i = 0; i < delegated.selectors.length; i++) {
if (delegated.selectors[i] === this.selector
&& delegated.contexts[i] === this._context) {
delegated.selectors.splice(i, 1);
delegated.contexts .splice(i, 1);
delegated.listeners.splice(i, 1);
// remove the arrays if they are empty
if (!delegated.selectors.length) {
delegatedEvents[type] = null;
}
}
events.remove(this._context, type, delegateListener);
events.remove(this._context, type, delegateUseCapture, true);
break;
}
}
}
this.dropzone(false);
interactables.splice(indexOf(interactables, this), 1);
return interact;
}
};
function warnOnce (method, message) {
var warned = false;
return function () {
if (!warned) {
window.console.warn(message);
warned = true;
}
return method.apply(this, arguments);
};
}
Interactable.prototype.snap = warnOnce(Interactable.prototype.snap,
'Interactable#snap is deprecated. See the new documentation for snapping at http://interactjs.io/docs/snapping');
Interactable.prototype.restrict = warnOnce(Interactable.prototype.restrict,
'Interactable#restrict is deprecated. See the new documentation for resticting at http://interactjs.io/docs/restriction');
Interactable.prototype.inertia = warnOnce(Interactable.prototype.inertia,
'Interactable#inertia is deprecated. See the new documentation for inertia at http://interactjs.io/docs/inertia');
Interactable.prototype.autoScroll = warnOnce(Interactable.prototype.autoScroll,
'Interactable#autoScroll is deprecated. See the new documentation for autoScroll at http://interactjs.io/docs/#autoscroll');
Interactable.prototype.squareResize = warnOnce(Interactable.prototype.squareResize,
'Interactable#squareResize is deprecated. See http://interactjs.io/docs/#resize-square');
/*\
* interact.isSet
[ method ]
*
* Check if an element has been set
- element (Element) The Element being searched for
= (boolean) Indicates if the element or CSS selector was previously passed to interact
\*/
interact.isSet = function(element, options) {
return interactables.indexOfElement(element, options && options.context) !== -1;
};
/*\
* interact.on
[ method ]
*
* Adds a global listener for an InteractEvent or adds a DOM event to
* `document`
*
- type (string | array | object) The types of events to listen for
- listener (function) The function to be called on the given event(s)
- useCapture (boolean) #optional useCapture flag for addEventListener
= (object) interact
\*/
interact.on = function (type, listener, useCapture) {
if (isString(type) && type.search(' ') !== -1) {
type = type.trim().split(/ +/);
}
if (isArray(type)) {
for (var i = 0; i < type.length; i++) {
interact.on(type[i], listener, useCapture);
}
return interact;
}
if (isObject(type)) {
for (var prop in type) {
interact.on(prop, type[prop], listener);
}
return interact;
}
// if it is an InteractEvent type, add listener to globalEvents
if (contains(eventTypes, type)) {
// if this type of event was never bound
if (!globalEvents[type]) {
globalEvents[type] = [listener];
}
else {
globalEvents[type].push(listener);
}
}
// If non InteractEvent type, addEventListener to document
else {
events.add(document, type, listener, useCapture);
}
return interact;
};
/*\
* interact.off
[ method ]
*
* Removes a global InteractEvent listener or DOM event from `document`
*
- type (string | array | object) The types of events that were listened for
- listener (function) The listener function to be removed
- useCapture (boolean) #optional useCapture flag for removeEventListener
= (object) interact
\*/
interact.off = function (type, listener, useCapture) {
if (isString(type) && type.search(' ') !== -1) {
type = type.trim().split(/ +/);
}
if (isArray(type)) {
for (var i = 0; i < type.length; i++) {
interact.off(type[i], listener, useCapture);
}
return interact;
}
if (isObject(type)) {
for (var prop in type) {
interact.off(prop, type[prop], listener);
}
return interact;
}
if (!contains(eventTypes, type)) {
events.remove(document, type, listener, useCapture);
}
else {
var index;
if (type in globalEvents
&& (index = indexOf(globalEvents[type], listener)) !== -1) {
globalEvents[type].splice(index, 1);
}
}
return interact;
};
/*\
* interact.enableDragging
[ method ]
*
* Deprecated.
*
* Returns or sets whether dragging is enabled for any Interactables
*
- newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
= (boolean | object) The current setting or interact
\*/
interact.enableDragging = warnOnce(function (newValue) {
if (newValue !== null && newValue !== undefined) {
actionIsEnabled.drag = newValue;
return interact;
}
return actionIsEnabled.drag;
}, 'interact.enableDragging is deprecated and will soon be removed.');
/*\
* interact.enableResizing
[ method ]
*
* Deprecated.
*
* Returns or sets whether resizing is enabled for any Interactables
*
- newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
= (boolean | object) The current setting or interact
\*/
interact.enableResizing = warnOnce(function (newValue) {
if (newValue !== null && newValue !== undefined) {
actionIsEnabled.resize = newValue;
return interact;
}
return actionIsEnabled.resize;
}, 'interact.enableResizing is deprecated and will soon be removed.');
/*\
* interact.enableGesturing
[ method ]
*
* Deprecated.
*
* Returns or sets whether gesturing is enabled for any Interactables
*
- newValue (boolean) #optional `true` to allow the action; `false` to disable action for all Interactables
= (boolean | object) The current setting or interact
\*/
interact.enableGesturing = warnOnce(function (newValue) {
if (newValue !== null && newValue !== undefined) {
actionIsEnabled.gesture = newValue;
return interact;
}
return actionIsEnabled.gesture;
}, 'interact.enableGesturing is deprecated and will soon be removed.');
interact.eventTypes = eventTypes;
/*\
* interact.debug
[ method ]
*
* Returns debugging data
= (object) An object with properties that outline the current state and expose internal functions and variables
\*/
interact.debug = function () {
var interaction = interactions[0] || new Interaction();
return {
interactions : interactions,
target : interaction.target,
dragging : interaction.dragging,
resizing : interaction.resizing,
gesturing : interaction.gesturing,
prepared : interaction.prepared,
matches : interaction.matches,
matchElements : interaction.matchElements,
prevCoords : interaction.prevCoords,
startCoords : interaction.startCoords,
pointerIds : interaction.pointerIds,
pointers : interaction.pointers,
addPointer : listeners.addPointer,
removePointer : listeners.removePointer,
recordPointer : listeners.recordPointer,
snap : interaction.snapStatus,
restrict : interaction.restrictStatus,
inertia : interaction.inertiaStatus,
downTime : interaction.downTimes[0],
downEvent : interaction.downEvent,
downPointer : interaction.downPointer,
prevEvent : interaction.prevEvent,
Interactable : Interactable,
interactables : interactables,
pointerIsDown : interaction.pointerIsDown,
defaultOptions : defaultOptions,
defaultActionChecker : defaultActionChecker,
actionCursors : actionCursors,
dragMove : listeners.dragMove,
resizeMove : listeners.resizeMove,
gestureMove : listeners.gestureMove,
pointerUp : listeners.pointerUp,
pointerDown : listeners.pointerDown,
pointerMove : listeners.pointerMove,
pointerHover : listeners.pointerHover,
eventTypes : eventTypes,
events : events,
globalEvents : globalEvents,
delegatedEvents : delegatedEvents
};
};
// expose the functions used to calculate multi-touch properties
interact.getTouchAverage = touchAverage;
interact.getTouchBBox = touchBBox;
interact.getTouchDistance = touchDistance;
interact.getTouchAngle = touchAngle;
interact.getElementRect = getElementRect;
interact.matchesSelector = matchesSelector;
interact.closest = closest;
/*\
* interact.margin
[ method ]
*
* Returns or sets the margin for autocheck resizing used in
* @Interactable.getAction. That is the distance from the bottom and right
* edges of an element clicking in which will start resizing
*
- newValue (number) #optional
= (number | interact) The current margin value or interact
\*/
interact.margin = function (newvalue) {
if (isNumber(newvalue)) {
margin = newvalue;
return interact;
}
return margin;
};
/*\
* interact.supportsTouch
[ method ]
*
= (boolean) Whether or not the browser supports touch input
\*/
interact.supportsTouch = function () {
return supportsTouch;
};
/*\
* interact.supportsPointerEvent
[ method ]
*
= (boolean) Whether or not the browser supports PointerEvents
\*/
interact.supportsPointerEvent = function () {
return supportsPointerEvent;
};
/*\
* interact.stop
[ method ]
*
* Cancels all interactions (end events are not fired)
*
- event (Event) An event on which to call preventDefault()
= (object) interact
\*/
interact.stop = function (event) {
for (var i = interactions.length - 1; i > 0; i--) {
interactions[i].stop(event);
}
return interact;
};
/*\
* interact.dynamicDrop
[ method ]
*
* Returns or sets whether the dimensions of dropzone elements are
* calculated on every dragmove or only on dragstart for the default
* dropChecker
*
- newValue (boolean) #optional True to check on each move. False to check only before start
= (boolean | interact) The current setting or interact
\*/
interact.dynamicDrop = function (newValue) {
if (isBool(newValue)) {
//if (dragging && dynamicDrop !== newValue && !newValue) {
//calcRects(dropzones);
//}
dynamicDrop = newValue;
return interact;
}
return dynamicDrop;
};
/*\
* interact.pointerMoveTolerance
[ method ]
* Returns or sets the distance the pointer must be moved before an action
* sequence occurs. This also affects tolerance for tap events.
*
- newValue (number) #optional The movement from the start position must be greater than this value
= (number | Interactable) The current setting or interact
\*/
interact.pointerMoveTolerance = function (newValue) {
if (isNumber(newValue)) {
pointerMoveTolerance = newValue;
return this;
}
return pointerMoveTolerance;
};
/*\
* interact.maxInteractions
[ method ]
**
* Returns or sets the maximum number of concurrent interactions allowed.
* By default only 1 interaction is allowed at a time (for backwards
* compatibility). To allow multiple interactions on the same Interactables
* and elements, you need to enable it in the draggable, resizable and
* gesturable `'max'` and `'maxPerElement'` options.
**
- newValue (number) #optional Any number. newValue <= 0 means no interactions.
\*/
interact.maxInteractions = function (newValue) {
if (isNumber(newValue)) {
maxInteractions = newValue;
return this;
}
return maxInteractions;
};
interact.createSnapGrid = function (grid) {
return function (x, y) {
var offsetX = 0,
offsetY = 0;
if (isObject(grid.offset)) {
offsetX = grid.offset.x;
offsetY = grid.offset.y;
}
var gridx = Math.round((x - offsetX) / grid.x),
gridy = Math.round((y - offsetY) / grid.y),
newX = gridx * grid.x + offsetX,
newY = gridy * grid.y + offsetY;
return {
x: newX,
y: newY,
range: grid.range
};
};
};
function endAllInteractions (event) {
for (var i = 0; i < interactions.length; i++) {
interactions[i].pointerEnd(event, event);
}
}
function listenToDocument (doc) {
if (contains(documents, doc)) { return; }
var win = doc.defaultView || doc.parentWindow;
// add delegate event listener
for (var eventType in delegatedEvents) {
events.add(doc, eventType, delegateListener);
events.add(doc, eventType, delegateUseCapture, true);
}
if (PointerEvent) {
if (PointerEvent === win.MSPointerEvent) {
pEventTypes = {
up: 'MSPointerUp', down: 'MSPointerDown', over: 'mouseover',
out: 'mouseout', move: 'MSPointerMove', cancel: 'MSPointerCancel' };
}
else {
pEventTypes = {
up: 'pointerup', down: 'pointerdown', over: 'pointerover',
out: 'pointerout', move: 'pointermove', cancel: 'pointercancel' };
}
events.add(doc, pEventTypes.down , listeners.selectorDown );
events.add(doc, pEventTypes.move , listeners.pointerMove );
events.add(doc, pEventTypes.over , listeners.pointerOver );
events.add(doc, pEventTypes.out , listeners.pointerOut );
events.add(doc, pEventTypes.up , listeners.pointerUp );
events.add(doc, pEventTypes.cancel, listeners.pointerCancel);
// autoscroll
events.add(doc, pEventTypes.move, listeners.autoScrollMove);
}
else {
events.add(doc, 'mousedown', listeners.selectorDown);
events.add(doc, 'mousemove', listeners.pointerMove );
events.add(doc, 'mouseup' , listeners.pointerUp );
events.add(doc, 'mouseover', listeners.pointerOver );
events.add(doc, 'mouseout' , listeners.pointerOut );
events.add(doc, 'touchstart' , listeners.selectorDown );
events.add(doc, 'touchmove' , listeners.pointerMove );
events.add(doc, 'touchend' , listeners.pointerUp );
events.add(doc, 'touchcancel', listeners.pointerCancel);
// autoscroll
events.add(doc, 'mousemove', listeners.autoScrollMove);
events.add(doc, 'touchmove', listeners.autoScrollMove);
}
events.add(win, 'blur', endAllInteractions);
try {
if (win.frameElement) {
var parentDoc = win.frameElement.ownerDocument,
parentWindow = parentDoc.defaultView;
events.add(parentDoc , 'mouseup' , listeners.pointerEnd);
events.add(parentDoc , 'touchend' , listeners.pointerEnd);
events.add(parentDoc , 'touchcancel' , listeners.pointerEnd);
events.add(parentDoc , 'pointerup' , listeners.pointerEnd);
events.add(parentDoc , 'MSPointerUp' , listeners.pointerEnd);
events.add(parentWindow, 'blur' , endAllInteractions );
}
}
catch (error) {
interact.windowParentError = error;
}
if (events.useAttachEvent) {
// For IE's lack of Event#preventDefault
events.add(doc, 'selectstart', function (event) {
var interaction = interactions[0];
if (interaction.currentAction()) {
interaction.checkAndPreventDefault(event);
}
});
// For IE's bad dblclick event sequence
events.add(doc, 'dblclick', doOnInteractions('ie8Dblclick'));
}
documents.push(doc);
}
listenToDocument(document);
function indexOf (array, target) {
for (var i = 0, len = array.length; i < len; i++) {
if (array[i] === target) {
return i;
}
}
return -1;
}
function contains (array, target) {
return indexOf(array, target) !== -1;
}
function matchesSelector (element, selector, nodeList) {
if (ie8MatchesSelector) {
return ie8MatchesSelector(element, selector, nodeList);
}
// remove /deep/ from selectors if shadowDOM polyfill is used
if (window !== realWindow) {
selector = selector.replace(/\/deep\//g, ' ');
}
return element[prefixedMatchesSelector](selector);
}
function matchesUpTo (element, selector, limit) {
while (isElement(element)) {
if (matchesSelector(element, selector)) {
return true;
}
element = parentElement(element);
if (element === limit) {
return matchesSelector(element, selector);
}
}
return false;
}
// For IE8's lack of an Element#matchesSelector
// taken from http://tanalin.com/en/blog/2012/12/matches-selector-ie8/ and modified
if (!(prefixedMatchesSelector in Element.prototype) || !isFunction(Element.prototype[prefixedMatchesSelector])) {
ie8MatchesSelector = function (element, selector, elems) {
elems = elems || element.parentNode.querySelectorAll(selector);
for (var i = 0, len = elems.length; i < len; i++) {
if (elems[i] === element) {
return true;
}
}
return false;
};
}
// requestAnimationFrame polyfill
(function() {
var lastTime = 0,
vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !realWindow.requestAnimationFrame; ++x) {
reqFrame = realWindow[vendors[x]+'RequestAnimationFrame'];
cancelFrame = realWindow[vendors[x]+'CancelAnimationFrame'] || realWindow[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!reqFrame) {
reqFrame = function(callback) {
var currTime = new Date().getTime(),
timeToCall = Math.max(0, 16 - (currTime - lastTime)),
id = setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
}
if (!cancelFrame) {
cancelFrame = function(id) {
clearTimeout(id);
};
}
}());
/* global exports: true, module, define */
// http://documentcloud.github.io/underscore/docs/underscore.html#section-11
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = interact;
}
exports.interact = interact;
}
// AMD
else if (typeof define === 'function' && define.amd) {
define('interact', function() {
return interact;
});
}
else {
realWindow.interact = interact;
}
} (typeof window === 'undefined'? undefined : window));
|
naeluh/interact.js
|
interact.js
|
JavaScript
|
mit
| 216,281 |
import auth0 from 'auth0-js';
const CLIENT_DOMAIN = 'quiros.auth0.com';
const CLIENT_ID = 'nPHTZW3yqOpIZ2TWKG6rAyNGqH91Vunq';
const REDIRECT = 'http://localhost:3000/callback';
const SCOPE = 'openid email';
const auth = new auth0.WebAuth({
domain: CLIENT_DOMAIN,
clientID: CLIENT_ID,
});
const USER_ID_KEY = 'user_id';
const USER_TOKEN_KEY = 'user_token';
export function login() {
auth.authorize({
responseType: 'id_token',
redirectUri: REDIRECT,
scope: SCOPE,
});
}
export function logout(history) {
clearUserSession();
history.push('/');
}
export function clearUserSession() {
localStorage.removeItem(USER_ID_KEY);
localStorage.removeItem(USER_TOKEN_KEY);
}
export function getUserSession() {
return {
id: localStorage.getItem(USER_ID_KEY),
token: localStorage.getItem(USER_TOKEN_KEY),
};
}
// Convenience method since the user id is required frequently for queries
export function getUserId() {
return localStorage.getItem(USER_ID_KEY);
}
export function setUserSession(userId, userToken) {
localStorage.setItem(USER_ID_KEY, userId);
localStorage.setItem(USER_TOKEN_KEY, userToken);
}
export function isLoggedIn() {
const { id, token } = getUserSession();
return id && token;
}
// Helper function that parses and saves Auth0's id token
export function getIDToken() {
return new Promise((resolve, reject) => {
auth.parseHash(window.location.hash, function(err, authResult) {
if (err) reject(err);
resolve(authResult.idToken);
});
});
}
|
quiaro/chunches
|
app/src/common/AuthService.js
|
JavaScript
|
mit
| 1,524 |
version https://git-lfs.github.com/spec/v1
oid sha256:5da6bc83109f23a66b344a2118c2120a52f0430dbfad695e53a28cd461dfeccb
size 1610
|
yogeshsaroya/new-cdnjs
|
ajax/libs/timelinejs/2.35.6/js/locale/ga.js
|
JavaScript
|
mit
| 129 |
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('PhoneCat App', function() {
it('should redirect index.html to index.html#/phones', function() {
browser.get('app/index.html');
browser.getLocationAbsUrl().then(function(url) {
expect(url.split('#')[1]).toBe('/dechets');
});
});
describe('Waste list view', function() {
beforeEach(function() {
browser.get('app/index.html#/dechets');
});
it('should filter the waste list as user types into the search box', function() {
var wasteList = element.all(by.repeater('waste in phones'));
var query = element(by.model('query'));
expect(wasteList.count()).toBe(3);
query.sendKeys('plastic');
expect(wasteList.count()).toBe(1);
query.clear();
query.sendKeys('bouteille');
expect(wasteList.count()).toBe(1);
});
/*
it('should be possible to control phone order via the drop down select box', function() {
var phoneNameColumn = element.all(by.repeater('phone in phones').column('{{phone.name}}'));
var query = element(by.model('query'));
function getNames() {
return phoneNameColumn.map(function(elm) {
return elm.getText();
});
}
query.sendKeys('tablet'); //let's narrow the dataset to make the test assertions shorter
expect(getNames()).toEqual([
"Motorola XOOM\u2122 with Wi-Fi",
"MOTOROLA XOOM\u2122"
]);
element(by.model('orderProp')).findElement(by.css('option[value="name"]')).click();
expect(getNames()).toEqual([
"MOTOROLA XOOM\u2122",
"Motorola XOOM\u2122 with Wi-Fi"
]);
});
it('should render phone specific links', function() {
var query = element(by.model('query'));
query.sendKeys('nexus');
element(by.css('.phones li a')).click();
browser.getLocationAbsUrl().then(function(url) {
expect(url.split('#')[1]).toBe('/phones/nexus-s');
});
});
*/
});
/*
describe('Phone detail view', function() {
beforeEach(function() {
browser.get('app/index.html#/phones/nexus-s');
});
it('should display nexus-s page', function() {
expect(element(by.binding('phone.name')).getText()).toBe('Nexus S');
});
it('should display the first phone image as the main phone image', function() {
expect(element(by.css('img.phone.active')).getAttribute('src')).toMatch(/img\/phones\/nexus-s.0.jpg/);
});
it('should swap main image if a thumbnail image is clicked on', function() {
element(by.css('.phone-thumbs li:nth-child(3) img')).click();
expect(element(by.css('img.phone.active')).getAttribute('src')).toMatch(/img\/phones\/nexus-s.2.jpg/);
element(by.css('.phone-thumbs li:nth-child(1) img')).click();
expect(element(by.css('img.phone.active')).getAttribute('src')).toMatch(/img\/phones\/nexus-s.0.jpg/);
});
});*/
});
|
dirakkk/reecycle
|
test/e2e/scenarios.js
|
JavaScript
|
mit
| 2,961 |
(function($){
$.fn.taxonMap = function(options) {
options = options || {}
$(this).each(function() {
if (options == 'fit') {
fit(this)
} else {
setup(this, options)
}
})
}
function setup(elt, options) {
var options = $.extend({}, options)
if (options.taxon) {
options.taxonId = options.taxon.id
} else {
options.taxonId = options.taxonId || $(elt).attr('data-taxon-id')
}
if (!options.taxonId) { return }
options.latitude = options.latitude || $(elt).attr('data-latitude')
options.longitude = options.longitude || $(elt).attr('data-longitude')
options.placeKmlUrl = options.placeKmlUrl || $(elt).attr('data-place-kml')
if (options.placeKmlUrl == '') { options.placeKmlUrl = null }
options.taxonRangeKmlUrl = options.taxonRangeKmlUrl || $(elt).attr('data-taxon-range-kml')
if (options.taxonRangeKmlUrl == '') { options.taxonRangeKmlUrl = null }
options.gbifKmlUrl = options.gbifKmlUrl || $(elt).attr('data-gbif-kml')
if (options.gbifKmlUrl == '') { options.gbifKmlUrl = null }
if (options.observationsJsonUrl != false) {
options.observationsJsonUrl = options.observationsJsonUrl
|| $(elt).attr('data-observations-json')
|| observationsJsonUrl(options.taxonId)
}
options.bbox = options.bbox || $(elt).attr('data-bbox')
if (typeof(options.bbox) == 'string') {
options.bbox = $.map(options.bbox.split(','), Number)
}
$(elt).data('taxonMapOptions', options)
// if ($.browser.msie && typeof(google) != 'undefined') {
if (true) {
setupGoogle(elt)
} else if (typeof(org) != 'undefined' && typeof(org.polymaps) != 'undefined') {
setupPolymaps(elt)
}
}
function fit(elt) {
if (true) {
fitGoogle(elt)
} else if (typeof(org) != 'undefined' && typeof(org.polymaps) != 'undefined') {
fitPolymaps(elt)
}
}
function setupGoogle(elt) {
var options = $(elt).data('taxonMapOptions'),
map = iNaturalist.Map.createMap({div: elt}),
preserveViewport = options.preserveViewport
if (options.bbox) {
map.fitBounds(
new google.maps.LatLngBounds(
new google.maps.LatLng(options.bbox[0], options.bbox[1]),
new google.maps.LatLng(options.bbox[2], options.bbox[3])
)
)
preserveViewport = true
} else if (options.latitude || options.longitude) {
map.setCenter(new google.maps.LatLng(options.latitutde || 0, options.longitude || 0))
}
if (options.taxonRangeKmlUrl) {
var taxonRangeLyr = new google.maps.KmlLayer(options.taxonRangeKmlUrl, {suppressInfoWindows: true, preserveViewport: preserveViewport})
map.addOverlay('Taxon Range', taxonRangeLyr, {id: 'taxon_range-'+options.taxonId})
preserveViewport = true
}
if (options.placeKmlUrl) {
var placeLyr = new google.maps.KmlLayer(options.placeKmlUrl, {suppressInfoWindows: true, preserveViewport: preserveViewport})
map.addOverlay('Place Boundary', placeLyr, {id: 'place_boundary-'+options.taxonId})
preserveViewport = true
}
if (options.gbifKmlUrl) {
var gbifLyr = new google.maps.KmlLayer(options.gbifKmlUrl, {suppressInfoWindows: true, preserveViewport: true})
map.addOverlay('GBIF Occurrences', gbifLyr, {
id: 'gbif-'+options.taxonId,
hidden: true,
description:
['It may take Google a while ',
'to load these data, ',
'assuming GBIF has any. ',
'<a target="_blank" href="'+options.gbifKmlUrl.replace(/&format=kml/, '')+'">Data URL</a>'].join('<br/>')
})
google.maps.event.addListener(gbifLyr, 'click', function(e) {
if (!window['kmlInfoWindows']) window['kmlInfoWindows'] = {}
for (var k in window['kmlInfoWindows']) {
window['kmlInfoWindows'][k].close()
}
var win = window['kmlInfoWindows'][e.featureData.id]
if (!win) {
// filter out google's insane parsing
var content = (e.featureData.description || '').replace(/(<a.+?>)<a.+?>(.+?)<\/a><\/a>/g, "$1$2</a>")
content = content.replace(/<\/a/g, '')
content = content.replace(/>/g, '')
content = content.replace(/<\/a"/g, '"')
win = window['kmlInfoWindows'][e.featureData.id] = new google.maps.InfoWindow({
content: content,
position: e.latLng,
pixelOffset: e.pixelOffset
})
}
win.open(window.map)
return false
})
preserveViewport = true
}
if (options.observationsJsonUrl) {
$.get(options.observationsJsonUrl, function(data) {
map.addObservations(data)
if (!preserveViewport && map.observationBounds) {
map.zoomToObservations()
preserveViewport = true
}
})
}
if (!preserveViewport) {
fit(elt)
}
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(new iNaturalist.OverlayControl(map))
$(elt).data('taxonMap', map)
}
function setupPolymaps(elt) {
}
function fitGoogle(elt) {
var options = $(elt).data('taxonMapOptions'),
map = $(elt).data('taxonMap'),
preserveViewport = false
if (!map) {return};
if (options.bbox) {
map.fitBounds(
new google.maps.LatLngBounds(
new google.maps.LatLng(options.bbox[0], options.bbox[1]),
new google.maps.LatLng(options.bbox[2], options.bbox[3])
)
)
return
} else if (options.latitude || options.longitude) {
map.setCenter(new google.maps.LatLng(options.latitutde || 0, options.longitude || 0))
map.setZoom(4)
return
}
if (options.taxonRangeKmlUrl) {
var lyrInfo = map.getOverlay('Taxon Range')
lyrInfo.overlay.setMap(null)
lyrInfo.overlay.setMap(map)
return
}
if (options.placeKmlUrl) {
var lyrInfo = map.getOverlay('Place Boundary')
lyrInfo.overlay.setMap(null)
lyrInfo.overlay.setMap(map)
return
}
if (options.observationsJsonUrl && map.observationBounds) {
map.zoomToObservations()
return
}
map.setCenter(new google.maps.LatLng(0, 0))
map.setZoom(1)
}
function observationsJsonUrl(id) {
return 'http://' + window.location.host + '/observations/of/'+id+'.json'
}
}(jQuery))
|
nzbrn/naturewatch
|
public/javascripts/jquery/plugins/inat/taxonmap.js
|
JavaScript
|
mit
| 6,427 |
import path from 'path';
export default function ({types: t}) {
return {
visitor: {
ImportDeclaration(path, state) {
const node = path.node;
const importTarget = node.source.value;
if (!/!text$/.test(importTarget)) {
return;
}
const specifier = node.specifiers[0];
t.assertImportDefaultSpecifier(specifier);
const varName = specifier.local;
const fsModule = t.callExpression(t.identifier('require'), [t.stringLiteral('fs')]);
const readFileSync = t.memberExpression(fsModule, t.identifier('readFileSync'));
path.replaceWith(t.variableDeclaration('var', [
t.variableDeclarator(varName, t.callExpression(readFileSync, [
t.stringLiteral(resolveImportPath(importTarget.split('!')[0], state.opts.basePath)),
t.stringLiteral(state.opts.encoding || 'utf8')
]))
]));
}
}
};
function resolveImportPath(target, base) {
// target path begins with '/', './', or '../'
if (typeof base !== 'string' || /^\/|^\.\/|^\.\.\//.test(target)) {
return target;
}
return path.join(base, target);
}
}
|
onlywei/babel-plugin-transform-import-bangtext-node
|
src/index.js
|
JavaScript
|
mit
| 1,177 |
jQuery(document).ready(function() {
$('.fieldlabels').on('click', function(){
var fieldid = $(this).data('id');
$('#fieldid').val(fieldid);
});
});
|
mitsurugi/CodeathonURV2016_OpenURV
|
src/oGooseBundle/Resources/public/assets/js/script.js
|
JavaScript
|
mit
| 157 |
'use strict';
describe('', function() {
var module;
var dependencies;
dependencies = [];
var hasModule = function(module) {
return dependencies.indexOf(module) >= 0;
};
beforeEach(function() {
// Get module
module = angular.module('angularExtraValidator');
dependencies = module.requires;
});
it('should load config module', function() {
expect(hasModule('angularExtraValidator.config')).to.be.ok;
});
it('should load directives module', function() {
expect(hasModule('angularExtraValidator.directives')).to.be.ok;
});
});
|
VanMess/angular-extra-validator
|
test/unit/angular-extra-validator/angularExtraValidatorSpec.js
|
JavaScript
|
mit
| 582 |
// Make sure to include the `ui.router` module as a dependency
angular.module('uiRouterSample', [
'uiRouterSample.contacts',
'uiRouterSample.contacts.service',
'uiRouterSample.utils.service',
'ui.router',
'ngAnimate'
])
.run(
[ '$rootScope', '$state', '$stateParams',
function ($rootScope, $state, $stateParams) {
// It's very handy to add references to $state and $stateParams to the $rootScope
// so that you can access them from any scope within your applications.For example,
// <li ng-class="{ active: $state.includes('contacts.list') }"> will set the <li>
// to active whenever 'contacts.list' or one of its decendents is active.
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
}
]
)
.config(
[ '$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
/////////////////////////////
// Redirects and Otherwise //
/////////////////////////////
// Use $urlRouterProvider to configure any redirects (when) and invalid urls (otherwise).
$urlRouterProvider
// The `when` method says if the url is ever the 1st param, then redirect to the 2nd param
// Here we are just setting up some convenience urls.
.when('/c?id', '/contacts/:id')
.when('/user/:id', '/contacts/:id')
// If the url is ever invalid, e.g. '/asdf', then redirect to '/' aka the home state
.otherwise('/');
//////////////////////////
// State Configurations //
//////////////////////////
// Use $stateProvider to configure your states.
$stateProvider
//////////
// Home //
//////////
.state("home", {
// Use a url of "/" to set a state as the "index".
url: "/",
// Example of an inline template string. By default, templates
// will populate the ui-view within the parent state's template.
// For top level states, like this one, the parent template is
// the index.html file. So this template will be inserted into the
// ui-view within index.html.
template: '<p class="lead">Welcome to the UI-Router Demo</p>' +
'<p>Use the menu above to navigate. ' +
'Pay attention to the <code>$state</code> and <code>$stateParams</code> values below.</p>' +
'<p>Click these links—<a href="#/c?id=1">Alice</a> or ' +
'<a href="#/user/42">Bob</a>—to see a url redirect in action.</p>'
})
///////////
// About //
///////////
.state('about', {
url: '/about',
// Showing off how you could return a promise from templateProvider
templateProvider: ['$timeout',
function ( $timeout) {
return $timeout(function () {
return '<p class="lead">UI-Router Resources</p><ul>' +
'<li><a href="https://github.com/angular-ui/ui-router/tree/legacy/sample">Source for this Sample</a></li>' +
'<li><a href="https://github.com/angular-ui/ui-router">GitHub Main Page</a></li>' +
'<li><a href="https://github.com/angular-ui/ui-router#quick-start">Quick Start</a></li>' +
'<li><a href="https://github.com/angular-ui/ui-router/wiki">In-Depth Guide</a></li>' +
'<li><a href="https://github.com/angular-ui/ui-router/wiki/Quick-Reference">API Reference(old)</a></li>' +
'<li><a href="https://github.com/airwave-development/airwave-ui-router/site">Documentation</a></li>'+
'</ul>';
}, 100);
}]
})
}
]
);
|
airwave-development/airwave-ui-router
|
sample/app/app.js
|
JavaScript
|
mit
| 3,776 |
'use strict';
//angular modules
import angular from 'angular';
import 'angular-ui-router';
import 'ng-idle';
import './templates';
import './filters';
import './controllers';
import './services';
import './directives';
// create and bootstrap application
const requires = [
'ui.router',
'ngIdle',
'templates',
'app.filters',
'app.controllers',
'app.services',
'app.directives'
];
// mount on window for testing
window.app = angular.module('app', requires);
angular.module('app').constant('AppSettings', require('./constants'));
angular.module('app').config(require('./on_config'));
angular.module('app').run(require('./on_run'));
angular.bootstrap(document, ['app'], {
strictDi: true
});
|
qsysuser/master
|
app/js/main.js
|
JavaScript
|
mit
| 746 |
var app = angular.module('odin.importerControllers', ['ngFileUpload']);
app.factory('model', function($resource) {
return $resource();
});
function ImporterCreateController($scope, $location, usSpinnerService, Alertify, CkanImporterService, rest, model, Upload) {
$scope.model = new model();
$scope.model.url = 'http://data.buenosaires.gob.ar';
$scope.add = function(isValid) {
usSpinnerService.spin('spinner');
if (isValid) {
var defaults = {
owner: $scope.model.owner,
status: $scope.model.status,
freq: $scope.model.updateFrequency,
organization: $scope.model.organization,
url: $scope.model.url,
modules: {
categories: $scope.model.categories,
tags: $scope.model.tags,
datasets: $scope.model.datasets,
resources: $scope.model.resources
}
};
CkanImporterService.Import(rest, Upload, defaults, importCallback);
}
}
function importCallback() {
usSpinnerService.stop('spinner');
var url = '/importer/result';
$location.path(url);
}
}
function ImporterResultController($scope, $location, usSpinnerService, Alertify, CkanImporterService, $uibModal) {
$scope.results = CkanImporterService.getResults();
}
|
gcba-odin/odin-admin
|
js/controllers/importerController.js
|
JavaScript
|
mit
| 1,416 |
'use strict';
const chai = require('chai');
describe("date-x chai plugin", () => {
let expect;
before(() => {
chai.use(require('../chai'));
expect = chai.expect;
});
it("should have method to test date format: inDateFormat", () => {
expect(expect().inDateFormat).not.to.be.undefined;
});
it("should throw error if called without any format string", () => {
expect(() => {
expect("2014").inDateFormat();
}).to.throw(/set/);
});
it("should recognize datestring with given format [+]", () => {
expect("03/12/2016 11:11:32").to.be.inDateFormat("dd/MM/yyyy hh:mm:ss");
});
it("should recognize datestring with given format [-]", () => {
expect(() => {
expect("03/12/2016 11:11:32").to.not.be.inDateFormat("dd/MM/yyyy hh:mm:ss");
}).to.throw(/03\/12\/2016 11:11:32.*dd\/MM\/yyyy hh:mm:ss/);
});
it("should recognize datestring with not the given format [+]", () => {
expect("Thuesday").to.not.be.inDateFormat("dd/MM/yyyy hh:mm:ss");
});
it("should recognize datestring with not the given format [-]", () => {
expect(() => {
expect("Thuesday").to.be.inDateFormat("dd/MM/yyyy hh:mm:ss");
}).to.throw(/Thuesday.*dd\/MM\/yyyy hh:mm:ss/);
});
});
|
szikszail/date-x
|
test/chai.spec.js
|
JavaScript
|
mit
| 1,329 |
var x = 0;
var daat = []
if (!localStorage.daatList) {
localStorage.daatList = "[]";
}
daat = JSON.parse(localStorage.daatList);
daaAdd = function(){
var task = document.getElementById('taskdaa').value;
if (task != '') {
// Add the task to array and refresh list
daat[daat.length] = task;
daaRefresh();
// Clear the input
document.getElementById('taskdaa').value = '';
}
};
daaRefresh = function(){
var $tasks = $('#tldaa');
// Clear the existing task list
$tasks.empty();
if (daat.length) {
for (var i=0;i<daat.length;i++){
// Append each task
x = i;
var li = '<li class="nav" id="confirmdaa'+i+'" data-goto onclick="x = '+i+'">' + daat[i] + '</li>'
$tasks.append(li);
$(function () {
$("#confirmdaa"+i).bind("singletap", function() {
$.UIPopup({
id: "warning",
title: 'Completed?',
message: 'Have you really completed this task?',
cancelButton: 'No',
continueButton: 'Yes',
callback: function() {
daat.splice(x,1);
daaRefresh();
}
});
});
});
}
}
localStorage.daatList = JSON.stringify(daat || []);
}
|
georgethedan/georgethedan.github.io
|
js/daa.js
|
JavaScript
|
mit
| 1,202 |
//css related
1.remove highlight of input when focused?
/*
In your case, try:
input.middle:focus {
outline-width: 0;
}
Or in general, to affect all basic form elements:
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
In the comments, Noah Whitmore suggested taking this even further to support elements that have the contenteditable attribute set to true (effectively making them a type of input element). The following should target those as well (in CSS3 capable browsers):
[contenteditable="true"]:focus {
outline: none;
}
Although I wouldn't recommend it, for completeness' sake, you could always disable the focus outline on everything with this:
*:focus {
outline: none;
}
Keep in mind that the focus outline is an accessibility and usability feature; it clues the user into what element is currently focused.
*/
2.git error: Your local changes to the following files would be overwritten by merge:
wp-content/w3tc-config/master.php
Please, commit your changes or stash them before you can merge.
/*You can't merge with local modifications. Git protects you from losing potentially important changes.
You have three options.
1. Commit the change using
git commit -m "My message"
2. Stash it.
Stashing acts as a stack, where you can push changes, and you pop them in reverse order.
To stash type:
git stash
Do the merge, and then pull the stash:
git stash pop
3. Discard the local changes
using git reset --hard.
*/
3.disabled style?
select option:disabled {
color: #000;
font-weight: bold;
}
4.disable whole div
$("#test *").attr("disabled", "disabled").off('click');
5.git
git config --global user.name "My Name"
git config --global user.email "myemail"
git config --global GitHub.user myusername
6.git reset credential
The git credential cache runs a daemon process which caches your credentials in memory and hands them out on demand. So killing your git-credential-cache--daemon process throws all these away and results in re-prompting you for your password if you continue to use this as the cache.helper option.
You could also disable use of the git credential cache using git config --global --unset credential.helper. Then reset this and you would continue to have the cached credentials available for other repositories (if any). You may also need to do git config --system --unset credential.helper if this has been set in the system config file (eg: Git for Windows 2).
On Windows you might be better off using the manager helper (git config --global credential.helper manager). This stores your credentials in the Windows credential store which has a Control Panel interface where you can delete or edit your stored credentials. With this store, your details are secured by your Windows login and can persist over multiple sessions. The manager helper included in Got for Windows 2.x has replaced the earlier wincred helper that was added in Git for Windows 1.8.1.1. A similar helper called winstore is also available online and was used with GitExtensions as it offers a more GUI driven interface. The manager helper offers the same GUI interface as winstore.
Extract from Windows manual detailing the Windows credential store panel:
Open User Accounts by clicking the Start button Picture of the Start button, clicking Control Panel, clicking User Accounts and Family Safety (or clicking User Accounts, if you are connected to a network domain), and then clicking User Accounts. In the left pane, click Manage your credentials.
|
BeaverGuo/react-boilerplate
|
other_notes/css/css_rel.js
|
JavaScript
|
mit
| 3,599 |
/* */
'use strict';
Object.defineProperty(exports, "__esModule", {value: true});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');
var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);
var _svgIcon = require('../../svg-icon');
var _svgIcon2 = _interopRequireDefault(_svgIcon);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
var ImageCrop169 = _react2.default.createClass({
displayName: 'ImageCrop169',
mixins: [_reactAddonsPureRenderMixin2.default],
render: function render() {
return _react2.default.createElement(_svgIcon2.default, this.props, _react2.default.createElement('path', {d: 'M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z'}));
}
});
exports.default = ImageCrop169;
module.exports = exports['default'];
|
nayashooter/ES6_React-Bootstrap
|
public/jspm_packages/npm/material-ui@0.14.4/lib/svg-icons/image/crop-16-9.js
|
JavaScript
|
mit
| 960 |
require("kaoscript/register");
module.exports = function() {
var Shape = require("../export/export.class.default.ks")().Shape;
Shape.prototype.__ks_func_draw_0 = function(canvas) {
if(arguments.length < 1) {
throw new SyntaxError("Wrong number of arguments (" + arguments.length + " for 1)");
}
if(canvas === void 0 || canvas === null) {
throw new TypeError("'canvas' is not nullable");
}
return "I'm drawing a " + this._color + " rectangle.";
};
Shape.prototype.draw = function() {
if(arguments.length === 1) {
return Shape.prototype.__ks_func_draw_0.apply(this, arguments);
}
throw new SyntaxError("Wrong number of arguments");
};
};
|
kaoscript/kaoscript
|
test/fixtures/compile/implement/implement.import.default.js
|
JavaScript
|
mit
| 665 |
var lazy = require('lazyrequire')(require)
var recast = lazy('recast')
var esprima = lazy('esprima-fb')
var profile = require('debug')('ecstacy:js:profile')
var applySourceMap = require('apply-source-map')
var convert = require('convert-source-map')
var db = require('polyfills-db').recast
var Ecstacy = require('./ecstacy')
module.exports = JS
Ecstacy.extend(JS)
JS.db = db
JS.transform = db.transform
JS.transforms = db.transforms
JS.type =
JS.prototype.type = 'js'
JS.ext =
JS.prototype.ext = '.js'
function JS(options) {
if (!(this instanceof JS)) return new JS(options)
Ecstacy.call(this, options)
}
JS.prototype._transform = function (code, map, transforms) {
// i wish there was a way to cache this
profile('profiling %s', this.name)
profile('recasting AST')
var useSourcemaps = this.sourcemaps
var ast = recast().parse(code, {
esprima: esprima(),
sourceFileName: useSourcemaps
? this.name + '.js'
: null
})
profile('recasted AST')
transforms.forEach(function (transform) {
ast = transform.transform(ast)
profile('performed transform "%s"', transform.name)
})
var result = recast().print(ast, {
sourceMapName: useSourcemaps
? this.name + '.js'
: null
})
profile('stringified AST')
return {
code: convert.removeMapFileComments(result.code),
map: !useSourcemaps
? null
: (map
? applySourceMap(result.map, map)
: JSON.stringify(result.map)
)
}
}
|
polyfills/ecstacy
|
lib/js.js
|
JavaScript
|
mit
| 1,457 |
/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
var cordova = require('../cordova'),
platforms = require('../platforms'),
child_process = require('child_process'),
path = require('path'),
fs = require('fs'),
hooker = require('../src/hooker'),
Q = require('q'),
util = require('../src/util'),
os = require('os');
var supported_platforms = Object.keys(platforms).filter(function(p) { return p != 'www'; });
describe('run command', function() {
var is_cordova, list_platforms, fire, child, spawn_wrap;
var project_dir = '/some/path';
var prepare_spy;
child = {
on: function(child_event,cb){
if(child_event === 'close'){
cb(0);
}
},
stdout: {
setEncoding: function(){},
on: function(){}
},
stderr: {
setEncoding: function(){},
on: function(){}
}
};
spawn_wrap = function(cmd,args,options){
var _cmd = cmd,
_args = args;
if (os.platform() === 'win32') {
_args = ['/c',_cmd].concat(_args);
_cmd = 'cmd';
}
return {
"cmd": _cmd,
"args": _args,
"options": options
};
};
beforeEach(function() {
is_cordova = spyOn(util, 'isCordova').andReturn(project_dir);
list_platforms = spyOn(util, 'listPlatforms').andReturn(supported_platforms);
fire = spyOn(hooker.prototype, 'fire').andReturn(Q());
prepare_spy = spyOn(cordova.raw, 'prepare').andReturn(Q());
spyOn(child_process, 'spawn').andReturn(child);
});
describe('failure', function() {
it('should not run inside a Cordova-based project with no added platforms by calling util.listPlatforms', function(done) {
list_platforms.andReturn([]);
cordova.raw.run().then(function() {
expect('this call').toBe('fail');
}, function(err) {
expect(err).toEqual(new Error('No platforms added to this project. Please use `cordova platform add <platform>`.'));
}).fin(done);
});
it('should not run outside of a Cordova-based project', function(done) {
is_cordova.andReturn(false);
cordova.raw.run().then(function() {
expect('this call').toBe('fail');
}, function(err) {
expect(err).toEqual(new Error('Current working directory is not a Cordova-based project.'));
}).fin(done);
});
});
describe('success', function() {
it('should run inside a Cordova-based project with at least one added platform and call prepare and shell out to the run script', function(done) {
cordova.raw.run(['android','ios']).then(function() {
expect(prepare_spy).toHaveBeenCalledWith(['android', 'ios']);
spawn_call = spawn_wrap(path.join(project_dir, 'platforms', 'android', 'cordova', 'run'), ['--device']);
expect(child_process.spawn).toHaveBeenCalledWith(spawn_call.cmd, spawn_call.args);
spawn_call = spawn_wrap(path.join(project_dir, 'platforms', 'ios', 'cordova', 'run'), ['--device']);
expect(child_process.spawn).toHaveBeenCalledWith(spawn_call.cmd, spawn_call.args);
}, function(err) {
console.log(err);
expect(err).toBeUndefined();
}).fin(done);
});
it('should pass down parameters', function(done) {
cordova.raw.run({platforms: ['blackberry10'], options:['--password', '1q1q']}).then(function() {
expect(prepare_spy).toHaveBeenCalledWith(['blackberry10']);
spawn_call = spawn_wrap(path.join(project_dir, 'platforms', 'blackberry10', 'cordova', 'run'), ['--device', '--password', '1q1q']);
expect(child_process.spawn).toHaveBeenCalledWith(spawn_call.cmd, spawn_call.args);
}, function(err) {
expect(err).toBeUndefined();
}).fin(done);
});
});
describe('hooks', function() {
describe('when platforms are added', function() {
it('should fire before hooks through the hooker module', function(done) {
cordova.raw.run(['android', 'ios']).then(function() {
expect(fire).toHaveBeenCalledWith('before_run', {verbose: false, platforms:['android', 'ios'], options: []});
}, function(err) {
expect(err).toBeUndefined();
}).fin(done);
});
it('should fire after hooks through the hooker module', function(done) {
cordova.raw.run('android').then(function() {
expect(fire).toHaveBeenCalledWith('after_run', {verbose: false, platforms:['android'], options: []});
}, function(err) {
expect(err).toBeUndefined();
}).fin(done);
});
});
describe('with no platforms added', function() {
it('should not fire the hooker', function(done) {
list_platforms.andReturn([]);
cordova.raw.run().then(function() {
expect('this call').toBe('fail');
}, function(err) {
expect(fire).not.toHaveBeenCalled();
expect(err).toEqual(new Error('No platforms added to this project. Please use `cordova platform add <platform>`.'));
}).fin(done);
});
});
});
});
|
huangchaosuper/ReportViewer
|
reportviewer/node_modules/cordova/spec/run.spec.js
|
JavaScript
|
mit
| 6,399 |
import webpack from 'webpack'
import path from 'path'
console.log('process.env.NODE_ENV:', process.env.NODE_ENV)
const isDev = process.env.NODE_ENV !== 'production'
const config = {
mode: isDev ? 'development' : 'production',
entry: path.join(__dirname, 'demo', 'js', 'demo.js'),
output: {
path: path.join(__dirname, 'demo', 'js'),
filename: 'demo.min.js'
},
externals: {
react: 'React',
'react-dom': 'ReactDOM'
},
module: {
rules: [
{
test: /\.jsx?$/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
debug: true,
modules: 'umd',
corejs: 3
}
],
'@babel/preset-react'
],
plugins: []
}
}
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(
process.env.NODE_ENV || 'development'
)
})
]
}
if (isDev) {
config.cache = true
config.devtool = 'source-map'
}
export default config
|
craftzdog/react-codemirror-runmode
|
webpack.config.demo.babel.js
|
JavaScript
|
mit
| 1,202 |
var setupMinotaur = function(game){
var boss = game.add.sprite(game.world.centerX+150, game.world.centerY, 'boss');
// setup boss health, initial position, enable physics on this object
boss.health = 5;
boss.anchor.setTo(0.5, 0.6);
boss.scale.setTo(1.5, 1.5);
game.physics.arcade.enable(boss, Phaser.Physics.ARCADE);
boss.body.immovable = true;
// set up custom boss animations for each sprite
boss.animations.add('rise', [ 0, 0, 1, 1, 3, 3, 3, 3, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 10, 10, 10, 10, 10, 10, 4, 3, 2, 5]);
boss.animations.add('neutral', [4]);
boss.animations.add('flinch', [7, 7, 3, 8, 9, 10]);
boss.animations.add('die', [7, 6, 8, 9, 8, 9, 8, 7, 1, 0, 0]);
// opening animations
boss.animations.play('rise', 10, false);
return boss;
}
|
wesleye2003/donut-knight
|
app/assets/javascripts/loaders/minotaurLoader.js
|
JavaScript
|
mit
| 808 |
/* eslint-disable import/prefer-default-export */
import { useState, useLayoutEffect } from 'react';
/**
* custom hoook to detect the window size of a broswer
* @return {Array} [height, width ].
*/
export const useWindowSize = () => {
const [size, setSize] = useState([0, 0]);
useLayoutEffect(() => {
function updateSize() {
setSize([window.innerWidth, window.innerHeight]);
}
window.addEventListener('resize', updateSize);
updateSize();
return () => window.removeEventListener('resize', updateSize);
}, []);
return size;
};
|
KoryJCampbell/koryjcampbell.github.io
|
gatsby/src/utils/hooks.js
|
JavaScript
|
mit
| 563 |
/*
apex.submt_orign = apex.submit;
apex.submit = function(pOptions) {
var vjs_deft = {
request : null,
set : null,
showWait : true,
waitMsg : null,
form : 'wwv_flow'
};
var vjs_optio = {};
switch (typeof(pOptions)) {
case 'string' : vjs_optio = afw.jQuery.extend(vjs_deft,{request : pOptions}); break;
case 'object' : vjs_optio = afw.jQuery.extend(vjs_deft,pOptions); break;
default : vjs_optio = vjs_deft; break;
}
apex.submt_orign(vjs_optio);
//apex.submt_orign(pOptions);
//vva_mesg = '<img class="soums_page_indic_charg" src="/res/afw/images/indic_charg.gif" />';
//apex.jQuery.prompt(vva_mesg, { prefix: 'afwsoums' });
//apex.jQuery.prompt.close();
}
*/
/**
* @deprecated
* @function
* */
function confirmDelete(pva_mesg, pva_reqt) {
afw.afw_13.page.confr_suprs({
vva_mesg: pva_mesg,
vva_reqt: pva_reqt
});
}
/**
* @deprecated
* @function
* */
function confr_suprs(pnu_seqnc, pva_reqt) {
afw.afw_13.page.confr_suprs({
vva_mesg: "Désirez-vous supprimer l'enregistrement?",
vva_reqt: pva_reqt,
vjs_item: {"SSPC": pnu_seqnc}
});
}
/**
* @deprecated
* @function
* */
function doSubmit2(r, n, param) {
afw.afw_13.page.soumt_defnr_valr_item({
vva_reqt: r,
vjs_item: {n: param}
});
}
/**
* @deprecated
* @function
* */
function doSubmit3(r, sidf, sspc, sapc, sspi, sapi) {
afw.afw_13.page.soumt_defnr_valr_afw({
vva_reqt: r,
vjs_item: {
"SIDF": sidf,
"SSPC": sspc,
"SAPC": sapc,
"SSPI": sspi,
"SAPI": sapi
}
});
}
function goUrlBlank(url) {
window.open(url);
}
function obtnrDateDebutEfect(dateItem) {
if (dateItem.value == '') {
var dateCourn = new Date();
var annee = dateCourn.getUTCFullYear();
var mois = dateCourn.getMonth() + 101;
var jour = dateCourn.getDate() + 100;
var strMois = mois.toString();
var strJour = jour.toString();
dateItem.value = annee.toString() + '-' + strMois.substr(1) + '-' + strJour.substr(1);
}
}
function timestamp() {
var d, s = "T:";
var c = ":";
d = new Date();
s += d.getHours() + c;
s += d.getMinutes() + c;
s += d.getSeconds() + c;
s += d.getMilliseconds();
return (s);
}
/**
* @ignore
* @function
* @param pURL
* @param pName
* @param pWidth
* @param pHeight
* @param pScroll
* @param pResizable
* @return {Window Object}
* */
function afw_PopUp(pURL, pName, pWidth, pHeight, pScroll, pResizable, pRetourObjSeqnc, pRetourObjAfich, pRetourCallback, pRequest, pObjInit) {
var l_Window;
if (!pURL) {
pURL = 'about:blank';
}
if (!pName) {
pName = '_blank';
}
if (!pWidth) {
pWidth = 600;
}
if (!pHeight) {
pHeight = 600;
}
if (!pScroll) {
pScroll = 'yes';
}
if (!pResizable) {
pResizable = 'yes';
}
if (!pRequest) {
pRequest = '';
}
if (!pObjInit) {
pObjInit = {};
}
window.RetourObjSeqnc = pRetourObjSeqnc;
window.RetourObjAfich = pRetourObjAfich;
window.RetourCallback = pRetourCallback;
window.Request = pRequest;
window.ObjInit = pObjInit;
l_Window = window.open(pURL, pName, 'toolbar=no,scrollbars=' + pScroll + ',location=no,statusbar=no,menubar=no,resizable=' + pResizable + ',width=' + pWidth + ',height=' + pHeight);
if (l_Window.opener === null) {
l_Window.opener = self;
}
l_Window.focus();
}
function afw_PopUp_retour(ok, seqnc, afich, extra) {
var fentr_sourc = window.opener;
if (ok) {
if (fentr_sourc.RetourObjSeqnc)
fentr_sourc.RetourObjSeqnc.value = seqnc;
if (fentr_sourc.RetourObjAfich)
fentr_sourc.RetourObjAfich.value = afich;
}
if (fentr_sourc.RetourCallback)
fentr_sourc.RetourCallback(ok, extra);
}
function afw_PopUp_calbc_deft(ok, extra) {
if (ok) {
if (window.Request && window.Request != '') {
apex.submit(window.Request);
}
}
}
function afw_largr_fentr() {
var largr =
document.documentElement && document.documentElement.clientWidth ||
document.body && document.body.clientWidth ||
document.body && document.body.parentNode && document.body.parentNode.clientWidth ||
0;
return largr;
}
function afw_hautr_fentr() {
var hautr =
document.documentElement && document.documentElement.clientHeight ||
document.body && document.body.clientHeight ||
document.body && document.body.parentNode && document.body.parentNode.clientHeight ||
0;
return hautr;
}
function afw_obtnr_coord_absol(obj) {
var retrn = {};
var obj_boucl = obj;
var objx = objy = 0;
while (obj_boucl) {
objx += obj_boucl.offsetLeft;
objy += obj_boucl.offsetTop;
obj_boucl = obj_boucl.offsetParent;
}
retrn.x = objx;
retrn.y = objy;
return retrn;
}
function ById(id) {
return document.getElementById(id);
}
function Parent_ById(id) {
return window.parent.document.getElementById(id);
}
function afw_obtnr_selct(obj) {
var selct = {debut: 0, fin: 0};
// Support pour IE
if (document.selection) {
obj.focus();
var sel_range = document.selection.createRange();
var obj_range = obj.createTextRange();
var taille_selct = sel_range.text.length;
obj_range.moveToBookmark(sel_range.getBookmark());
obj_range.moveStart('character', -obj.value.length);
selct.fin = obj_range.text.length;
selct.debut = selct.fin - taille_selct;
}
// Support Firefox et autres
else if (obj.selectionStart || obj.selectionStart == '0') {
selct.debut = obj.selectionStart;
selct.fin = obj.selectionEnd;
}
return selct;
}
function afw_defnr_selct(obj, debut, fin) {
if (obj.setSelectionRange) {
obj.focus();
obj.setSelectionRange(debut, fin);
}
else if (obj.createTextRange) {
var obj_range = obj.createTextRange();
obj_range.collapse(true);
obj_range.moveEnd('character', fin);
obj_range.moveStart('character', debut);
obj_range.select();
}
}
isTabFormColumn = function (pFieldId) {
// did we get a field?
if (!pFieldId) return false;
// look for the pattern f00_0000 or f00_0 and just contains this pattern
if (pFieldId.search(/^f\d{2}\_\d{1,4}$/) == 0) return true;
return false;
}
getTabFormRow = function (pFieldId) {
if (isTabFormColumn(pFieldId)) {
return parseInt(pFieldId.substr(4), 10);
}
return null;
}
lpad = function (pValue, pLength, pChar) {
var vChar = (pChar) ? pChar : " ";
var vResult = String(pValue).toString();
while (vResult.length < pLength) {
vResult = vChar + vResult;
}
return vResult;
}
checkUpDownKey = function (pEvent) {
// only if the cursor is on a input field
if (pEvent.target.nodeName != "INPUT") return;
// if up or down has been pressed and no other key
if ((pEvent.ctrlKey == false) &&
(pEvent.shiftKey == false) &&
(pEvent.altKey == false) &&
((pEvent.metaKey == undefined) || (pEvent.metaKey == false)) &&
((pEvent.keyCode == 38) || (pEvent.keyCode == 40)) // up and down key
) {
// Is the current item a tabular form field?
if (isTabFormColumn(pEvent.target.id)) {
// get next row depending on up/down key
var vRow = getTabFormRow(pEvent.target.id) + ((pEvent.keyCode == 38) ? -1 : 1);
// get field of next row.
// Note: Take care if it's a manual tabular form (no leading 0), because
// in that case use no leading 0s for the new vRow
var vField = $x(pEvent.target.id.substr(0, 4) +
(($x(pEvent.target.id.substr(0, 4) + "1")) ? vRow : lpad(vRow, 4, "0"))
);
// only if it exists (in case we are on the first or last record)
if (vField) {
var vAutoComplete = vField.autocomplete;
afw.jQuery(vField).attr("autocomplete", "off");
$(vField).parents('tr.afw_18_range_tablr_form').click();
vField.focus();
afw.jQuery(vField).attr("autocomplete", vAutoComplete);
}
}
}
}
function afw_do_blink(id_obj) {
var obj = document.getElementById(id_obj);
//Prochaine valeur
obj.blink.valeur += obj.blink.step;
//Tester les limites, et changer le step de bord au besoin
if (obj.blink.valeur <= obj.blink.min) {
obj.blink.valeur = obj.blink.min;
obj.blink.step = -obj.blink.step;
}
else if (obj.blink.valeur >= obj.blink.max) {
obj.blink.valeur = obj.blink.max;
obj.blink.step = -obj.blink.step;
if (obj.blink.nb_blink > 0) {
obj.blink.nb_blink--;
}
}
//Ajuster l'opacit�
obj.style.opacity = obj.blink.valeur;
obj.style.filter = 'alpha(opacity=' + (obj.blink.valeur * 100) + ')';
//Continuer le timer
if (obj.blink.nb_blink != 0) {
obj.blink.timer = window.setTimeout("afw_do_blink('" + id_obj + "')", obj.blink.interval);
}
}
function afw_blink(obj) {
obj.blink = {
nb_blink: -1,
valeur: 1,
min: 0.5,
max: 1,
step: -0.05,
interval: 100
};
afw_do_blink(obj.id);
}
|
lgcarrier/APEXFramework
|
5.2.3/res/assets/libs/afw_legacy.js
|
JavaScript
|
mit
| 9,532 |
export default {
key: 'C',
suffix: 'add9',
positions: [
{
frets: '0203',
fingers: '0203'
},
{
frets: '5435',
fingers: '3214'
},
{
frets: '7787',
fingers: '1121',
barres: 7,
capo: true
},
{
frets: '9caa',
fingers: '1422',
barres: 10
}
]
};
|
tombatossals/chords-db
|
src/db/ukulele/chords/C/add9.js
|
JavaScript
|
mit
| 345 |
import {NthTrait} from '../nth';
import {PrependTrait} from '../prepend';
import {AppendTrait} from '../append';
import {DEPTHS, createClass} from './classUtil';
import {expect} from 'chai';
function pretty(number) {
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var Vector = createClass(AppendTrait, NthTrait, PrependTrait);
describe('eagle prepend tests', function() {
function testSize(MAX) {
it(`prepend ${pretty(MAX)} ordering test`, function() {
var vec = Vector.empty();
try {
for (var i = 0; MAX > i; i++) {
vec = vec.prepend(i, vec);
}
}
catch(e) {
console.log("i: ", i)
// console.log(vec);
throw e
}
try {
var n = MAX;
for (var i = 0; MAX > i; i++) {
expect(vec.nth(i, vec, 'missing')).to.equal(--n);
}
} catch(e) {
console.log("i: ", i)
console.log(vec);
throw e
}
});
}
// testSize(64);
testSize(1057);
// testSize(DEPTHS[0]);
// testSize(DEPTHS[1]);
// testSize(DEPTHS[2]);
// testSize(DEPTHS[3]);
})
|
rrbit-org/lib-rrbit
|
project/vault/eagle/_test_/prepend.test.js
|
JavaScript
|
mit
| 1,039 |
import { EventEmitter } from 'events'
import { Actions } from './constants'
import Dispatcher from './dispatcher'
import _ from 'underscore'
class Store extends EventEmitter {
constructor() {
super();
this.items = [];
Dispatcher.register(this.handleAction.bind(this))
}
handleAction(action) {
console.log('Dispatcher action', action);
switch(action.actionType) {
case Actions.addItem:
this.items.push(action.text.trim())
this.emitChange();
break;
case Actions.removeItem:
this.items.splice(this.items.indexOf(action.text.trim()), 1)
console.log(this.items);
this.emitChange()
break;
}
return true;
}
getAll() {
return this.items;
}
emitChange() {
this.emit('changed');
}
addChangeListener(callback) {
this.on('changed', callback)
}
removeChangeListener(callback) {
this.removeListener('changed', callback)
}
};
export default new Store();
|
elkdanger/ReactTodoDemo
|
store.js
|
JavaScript
|
mit
| 924 |
/*!
* jquery.fancytree.debug.js
*
* Miscellaneous debug extensions.
* (Extension module for jquery.fancytree.js: https://github.com/mar10/fancytree/)
*
* Copyright (c) 2008-2015, Martin Wendt (http://wwWendt.de)
*
* Released under the MIT license
* https://github.com/mar10/fancytree/wiki/LicenseInfo
*
* @version 2.14.0
* @date 2015-12-19T23:23
*/
;(function($, window, document, undefined) {
"use strict";
// prevent duplicate loading
// if ( $.ui.fancytree && $.ui.fancytree.version ) {
// $.ui.fancytree.warn("Fancytree: duplicate include");
// return;
// }
/* *****************************************************************************
* Private functions and variables
*/
var i,
HOOK_NAMES = "nodeClick nodeCollapseSiblings".split(" "),
EVENT_NAMES = "activate beforeActivate".split(" "),
HOOK_NAME_MAP = {},
EVENT_NAME_MAP = {};
for(i=0; i<HOOK_NAMES.length; i++){ HOOK_NAME_MAP[HOOK_NAMES[i]] = true; }
for(i=0; i<EVENT_NAMES.length; i++){ EVENT_NAME_MAP[EVENT_NAMES[i]] = true; }
/* *****************************************************************************
* Extension code
*/
$.ui.fancytree.registerExtension({
name: "tracecalls",
version: "0.0.1",
// Default options for this extension.
options: {
logTarget: null, // optional redirect logging to this <div> tag
traceEvents: false, // `true`or list of hook names
traceHooks: false // `true`or list of event names
},
// Overide virtual methods for this extension.
// `this` : is this Fancytree object
// `this._super`: the virtual function that was overridden (member of prev. extension or Fancytree)
treeInit: function(ctx){
var tree = ctx.tree;
// Bind init-handler to apply cookie state
tree.$div.bind("fancytreeinit", function(event){
tree.debug("COOKIE " + document.cookie);
});
// Init the tree
this._superApply(arguments);
},
nodeClick: function(ctx) {
if(this.options.tracecalls.traceHooks){
this.debug();
}
},
nodeCollapseSiblings: function(ctx) {
},
nodeDblclick: function(ctx) {
},
nodeKeydown: function(ctx) {
},
nodeLoadChildren: function(ctx, source) {
},
nodeOnFocusInOut: function(ctx) {
},
nodeRemoveChildMarkup: function(ctx) {
},
nodeRemoveMarkup: function(ctx) {
},
nodeRender: function(ctx, force, deep, collapsed, _recursive) {
},
nodeRenderStatus: function(ctx) {
},
nodeRenderTitle: function(ctx, title) {
},
nodeSetActive: function(ctx, flag, opts) {
},
nodeSetExpanded: function(ctx, flag, opts) {
},
nodeSetFocus: function(ctx) {
},
nodeSetSelected: function(ctx, flag) {
},
nodeSetStatus: function(ctx, status, message, details) {
},
nodeToggleExpanded: function(ctx) {
},
nodeToggleSelected: function(ctx) {
},
treeClear: function(ctx) {
},
treeCreate: function(ctx) {
},
treeDestroy: function(ctx) {
},
// treeInit: function(ctx) {
// },
treeLoad: function(ctx, source) {
},
treeSetFocus: function(ctx, flag) {
}
});
}(jQuery, window, document));
/* *****************************************************************************
* Fancytree extension: profiler
*/
;(function($, window, document, undefined) {
$.ui.fancytree.registerExtension({
name: "profiler",
version: "0.0.1",
// Default options for this extension
options: {
prefix: ""
},
// Overide virtual methods for this extension
nodeRender: function(ctx, force, deep, collapsed){
// ctx.tree.debug("**** PROFILER nodeRender");
var s = this.options.prefix + "render '" + ctx.node + "'";
/*jshint expr:true */
window.console && window.console.time && window.console.time(s);
this._superApply(arguments);
window.console && window.console.timeEnd && window.console.timeEnd(s);
}
});
}(jQuery, window, document));
|
HobieCat/fancytree
|
dist/src/jquery.fancytree.debug.js
|
JavaScript
|
mit
| 3,740 |
version https://git-lfs.github.com/spec/v1
oid sha256:7b3b254a44384804d505b2d129ae36ae295f97baeefd631bc375dbf0edb1f7cf
size 1964
|
yogeshsaroya/new-cdnjs
|
ajax/libs/kendo-ui-core/2014.1.416/js/cultures/kendo.culture.bs-Cyrl.min.js
|
JavaScript
|
mit
| 129 |
import {
apiFetchTests,
apiFetchTestVersions,
apiFetchTestValues
} from './apiActions';
import { statusTypes, createStateEntry, isReady } from './stateHelpers';
export const stateFetchTests = setState => () => {
setState({
tests: createStateEntry(statusTypes.LOADING)
});
const onSuccess = data => {
setState({ tests: createStateEntry(statusTypes.FULFILED, data) });
return Promise.resolve(data);
};
const onError = error => {
setState({
tests: createStateEntry(statusTypes.FAILED),
error: {
message: error.message,
refresh: () => {
stateClearError(setState)();
return stateFetchTests(setState)();
}
}
});
// return Promise.reject(error);
};
return apiFetchTests()(onSuccess, onError);
};
export const stateFetchTestVersions = setState => testId => {
setState((prevState, props) => {
const newTestVersions = prevState.testVersions;
newTestVersions[testId] = createStateEntry(statusTypes.LOADING);
return { testVersions: newTestVersions };
});
const onSuccess = data => {
setState((prevState, props) => {
const newTestVersions = prevState.testVersions;
newTestVersions[testId] = createStateEntry(statusTypes.FULFILED, data);
return { testVersions: newTestVersions };
});
return Promise.resolve(data);
};
const onError = error => {
setState((prevState, props) => {
const newTestVersions = prevState.testVersions;
newTestVersions[testId] = createStateEntry(statusTypes.FAILED);
return {
testVersions: newTestVersions,
error: {
message: error.message,
refresh: () => {
stateClearError(setState)();
return stateFetchTestVersions(setState)(testId);
}
}
};
});
// return Promise.reject(error);
};
return apiFetchTestVersions(testId)(onSuccess, onError);
};
export const stateFetchTestVersionsIfNeeded = (
getState,
setState
) => testId => {
if (!isReady(getState().testVersions[testId])) {
return stateFetchTestVersions(setState)(testId);
} else {
return Promise.resolve(getState().testVersions[testId].data);
}
};
export const stateFetchTestValues = setState => (testId, versionId) => {
setState((prevState, props) => {
const newTestValues = prevState.testValues;
if (!newTestValues[testId]) {
newTestValues[testId] = {};
}
newTestValues[testId][versionId] = createStateEntry(statusTypes.LOADING);
return { testValues: newTestValues };
});
const onSuccess = data => {
setState((prevState, props) => {
const newTestValues = prevState.testValues;
newTestValues[testId][versionId] = createStateEntry(
statusTypes.FULFILED,
data
);
return { testValues: newTestValues };
});
return Promise.resolve(data);
};
const onError = error => {
setState((prevState, props) => {
const newTestValues = prevState.testValues;
newTestValues[testId][versionId] = createStateEntry(statusTypes.FAILED);
return {
testValues: newTestValues,
error: {
message: error.message,
refresh: () => {
stateClearError(setState)();
return stateFetchTestValues(setState)(testId, versionId);
}
}
};
});
// return Promise.reject(error);
};
return apiFetchTestValues(testId, versionId)(onSuccess, onError);
};
export const stateRemoveTestValues = setState => (testId, versionId) => {
setState((prevState, props) => {
const newTestValues = prevState.testValues;
if (!newTestValues[testId]) {
newTestValues[testId] = {};
}
newTestValues[testId][versionId] = createStateEntry(statusTypes.EMPTY);
return { testValues: newTestValues };
});
};
export const stateClearError = setState => () => setState({ error: null });
export const stateSetActiveTest = setState => testId =>
setState({ activeTestId: testId });
export const stateSetGraphMeta = setState => meta =>
setState((prevState, props) => {
const newGraphMeta = prevState.graphMeta;
Object.keys(meta).forEach(key => {
newGraphMeta[key] = meta[key];
});
return { graphMeta: newGraphMeta };
});
|
SemaiCZE/perf-data-visualizer
|
src/utils/stateModifiers.js
|
JavaScript
|
mit
| 4,263 |
const webpack = require('webpack')
module.exports = {
devtool: 'cheap-eval-source-map',
entry: {
main: [
'./src/app.js',
'webpack/hot/only-dev-server',
'webpack-dev-server/client?http://127.0.0.1:8888',
],
},
devServer: {
historyApiFallback: true,
disableHostCheck: true,
host: '127.0.0.1',
port: 8888,
inline: true,
hot: true,
proxy: {
'/user/*': {
target: 'http://127.0.0.1:3000',
secure: false,
},
'/api/*': {
target: 'http://127.0.0.1:3000',
secure: false,
},
},
},
plugins: [
// new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
},
}),
],
}
|
879479119/Github-Mobile
|
config/webpack.dev.config.js
|
JavaScript
|
mit
| 808 |
// invalidate for unsupported browsers
var isIE = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) !== null ? parseFloat( RegExp.$1 ) : false;
if (isIE&&isIE<9) { (function(){return; }()) } // return if SVG API is not supported
// svgTransform examples
// rotation around shape center point
var svgRotate = document.getElementById('svgRotate');
var rotateBtn = document.getElementById('rotateBtn');
var svgr1 = svgRotate.getElementsByTagName('path')[0];
var svgr2 = svgRotate.getElementsByTagName('path')[1];
var svgTween11 = KUTE.to(svgr1, { transform: {rotateZ: 360} }, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
// var svgTween11 = KUTE.to(svgr1, { rotateZ: 360}, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
var svgTween12 = KUTE.to(svgr2, { svgTransform: { translate: 580, rotate: 360 } }, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
rotateBtn.addEventListener('click', function(){
!svgTween11.playing && svgTween11.start();
!svgTween12.playing && svgTween12.start();
}, false);
// rotation around shape's parent center point
var svgRotate1 = document.getElementById('svgRotate1');
var rotateBtn1 = document.getElementById('rotateBtn1');
var svgr11 = svgRotate1.getElementsByTagName('path')[0];
var svgr21 = svgRotate1.getElementsByTagName('path')[1];
var bb = svgr21.getBBox();
var translation = [580, 0];
var svgBB = svgr21.ownerSVGElement.getBBox();
var svgOriginX = (svgBB.width * 50 / 100) - translation[0];
var svgOriginY = (svgBB.height * 50 / 100)- translation[1];
var svgTween111 = KUTE.to(svgr11, { transform: {rotateZ: 360} }, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
var svgTween121 = KUTE.to(svgr21, { svgTransform: { translate: translation, rotate: 360 } }, { transformOrigin: [svgOriginX, svgOriginY], yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
rotateBtn1.addEventListener('click', function(){
!svgTween111.playing && svgTween111.start();
!svgTween121.playing && svgTween121.start();
}, false);
// translate
var svgTranslate = document.getElementById('svgTranslate');
var translateBtn = document.getElementById('translateBtn');
var svgt1 = svgTranslate.getElementsByTagName('path')[0];
var svgt2 = svgTranslate.getElementsByTagName('path')[1];
var svgTween21 = KUTE.to(svgt1, { transform: {translateX: 580} }, {yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
var svgTween22 = KUTE.to(svgt2, { svgTransform: { translate: [0,0] } }, {yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
translateBtn.addEventListener('click', function(){
!svgTween21.playing && svgTween21.start();
!svgTween22.playing && svgTween22.start();
}, false);
// skews in chain
var svgSkew = document.getElementById('svgSkew');
var skewBtn = document.getElementById('skewBtn');
var svgsk1 = svgSkew.getElementsByTagName('path')[0];
var svgsk2 = svgSkew.getElementsByTagName('path')[1];
var svgTween31 = KUTE.to(svgsk1, { transform: {skew: [-15,0]} }, { duration: 1500, easing: "easingCubicInOut"});
var svgTween311 = KUTE.to(svgsk1, { transform: {skew: [-15,15]} }, { duration: 2500, easing: "easingCubicInOut"});
var svgTween313 = KUTE.to(svgsk1, { transform: {skew: [0, 0]} }, { duration: 1500, easing: "easingCubicInOut"});
var svgTween32 = KUTE.to(svgsk2, {svgTransform: { translate: 580, skewX: -15 } }, { transformOrigin: '50% 50%', duration: 1500, easing: "easingCubicInOut"});
var svgTween322 = KUTE.to(svgsk2, {svgTransform: { translate: 580, skewY: 15 } }, { transformOrigin: '50% 50%', duration: 2500, easing: "easingCubicInOut"});
var svgTween323 = KUTE.to(svgsk2, {svgTransform: { translate: 580, skewY: 0, skewX: 0 } }, { transformOrigin: '50% 50%', duration: 1500, easing: "easingCubicInOut"});
try{
svgTween31.chain(svgTween311);
svgTween311.chain(svgTween313);
svgTween32.chain(svgTween322);
svgTween322.chain(svgTween323);
}catch(e){
console.error(e+"TweenBase doesn\'t support chain method")
}
skewBtn.addEventListener('click', function(){
!svgTween31.playing && !svgTween311.playing && !svgTween313.playing && svgTween31.start();
!svgTween32.playing && !svgTween322.playing && !svgTween323.playing && svgTween32.start();
}, false);
// scale
var svgScale = document.getElementById('svgScale');
var scaleBtn = document.getElementById('scaleBtn');
var svgs1 = svgScale.getElementsByTagName('path')[0];
var svgs2 = svgScale.getElementsByTagName('path')[1];
var svgTween41 = KUTE.to(svgs1, { transform: {scale3d: [1.5,1.5,1] } }, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
var svgTween42 = KUTE.to(svgs2, { svgTransform: { translate: 580, scale: 0.5,} }, {transformOrigin: '50% 50%', yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
scaleBtn.addEventListener('click', function(){
!svgTween41.playing && svgTween41.start();
!svgTween42.playing && svgTween42.start();
}, false);
// mixed transforms
var svgMixed = document.getElementById('svgMixed');
var mixedBtn = document.getElementById('mixedBtn');
var svgm1 = svgMixed.getElementsByTagName('path')[0];
var svgm2 = svgMixed.getElementsByTagName('path')[1];
var svgTween51 = KUTE.to(svgm1, { // a regular CSS3 transform without svg plugin, works in modern browsers only, EXCEPT IE/Edge
transform: {
translateX: 250,
scale3d: [1.5,1.5,1],
rotateZ: 320,
skewX: -15
}
}, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
var svgTween52 = KUTE.to(svgm2, {
svgTransform: {
translate: 830,
scale: 1.5,
rotate: 320,
skewX: -15
}
}, { yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
mixedBtn.addEventListener('click', function(){
!svgTween51.playing && svgTween51.start();
!svgTween52.playing && svgTween52.start();
}, false);
// chained transforms
var svgChained = document.getElementById('svgChained');
var chainedBtn = document.getElementById('chainedBtn');
var svgc = svgChained.getElementsByTagName('path')[0];
var svgcTransform = svgc.getAttribute('transform');
var resetSVGTransform = function(){
svgc.setAttribute('transform',svgcTransform);
};
var svgTween6 = KUTE.fromTo(svgc,
{ // from
svgTransform: {
translate: 0,
scale: 0.5,
rotate: 45,
// skewX: 0
},
},
{ // to
svgTransform: {
translate: 450,
scale: 1.5,
rotate: 360,
// skewX: -45
}
},
{transformOrigin: [256,256], complete: resetSVGTransform, yoyo: true, repeat: 1, duration: 1500, easing: "easingCubicOut"});
chainedBtn.addEventListener('click', function(){
!svgTween6.playing && svgTween6.start();
}, false);
|
thednp/kute.js
|
demo/assets/js/svgTransform.js
|
JavaScript
|
mit
| 6,763 |
import 'store';
export default class AudioRecorder {
constructor(container) {
this.container = container;
this.interval = 120;
}
addAudioPlayerCounter(emitter, player) {
let $container = $(this.container);
let activityId = $container.data('id');
let playerCounter = store.get("activity_id_" + activityId + "_playing_counter");
if (!playerCounter) {
playerCounter = 0;
}
if (!(player && player.playing)) {
return false;
}
if (playerCounter >= this.interval) {
emitter.emit('watching', {watchTime: this.interval}).then(() => {
}).catch((error) => {
console.error(error);
});
playerCounter = 0;
} else if (player.playing) {
playerCounter++;
}
store.set("activity_id_" + activityId + "_playing_counter", playerCounter);
}
}
|
richtermark/SMEAGOnline
|
app/Resources/static-src/app/js/activity/audio/audio-recorder.js
|
JavaScript
|
mit
| 834 |
// http://www.robertpenner.com/Easing/easing_demo.html
var PI = Math.PI,
pow = Math.pow,
sin = Math.sin;
var Easing = {
swing: function (t) {
return ( -Math.cos(t * PI) / 2 ) + 0.5;
},
/**
* Uniform speed between points.
*/
easeNone: function (t) {
return t;
},
/**
* Begins slowly and accelerates towards end. (quadratic)
*/
easeIn: function (t) {
return t * t;
},
/**
* Begins quickly and decelerates towards end. (quadratic)
*/
easeOut: function (t) {
return ( 2 - t) * t;
},
/**
* Begins slowly and decelerates towards end. (quadratic)
*/
easeBoth: function (t) {
return (t *= 2) < 1 ?
.5 * t * t :
.5 * (1 - (--t) * (t - 2));
},
/**
* Begins slowly and accelerates towards end. (quartic)
*/
easeInStrong: function (t) {
return t * t * t * t;
},
/**
* Begins quickly and decelerates towards end. (quartic)
*/
easeOutStrong: function (t) {
return 1 - (--t) * t * t * t;
},
/**
* Begins slowly and decelerates towards end. (quartic)
*/
easeBothStrong: function (t) {
return (t *= 2) < 1 ?
.5 * t * t * t * t :
.5 * (2 - (t -= 2) * t * t * t);
},
/**
* Snap in elastic effect.
*/
elasticIn: function (t) {
var p = .3, s = p / 4;
if (t === 0 || t === 1) return t;
return -(pow(2, 10 * (t -= 1)) * sin((t - s) * (2 * PI) / p));
},
/**
* Snap out elastic effect.
*/
elasticOut:function (t) {
var p = .3, s = p / 4;
if (t === 0 || t === 1) return t;
return pow(2, -10 * t) * sin((t - s) * (2 * PI) / p) + 1;
},
/**
* Snap both elastic effect.
*/
elasticBoth: function (t) {
var p = .45, s = p / 4;
if (t === 0 || t === 1) return t;
if (t < 1) {
return -.5 * (pow(2, 10 * (t -= 1)) *
sin((t - s) * (2 * PI) / p));
}
return pow(2, -10 * (t -= 1)) *
sin((t - s) * (2 * PI) / p) * .5 + 1;
},
/**
* Backtracks slightly, then reverses direction and moves to end.
*/
backIn: function (t) {
if(t === 1) return t;
var BACK_CONST = 1.70158;
return t * t * ((BACK_CONST + 1) * t - BACK_CONST);
},
/**
* Overshoots end, then reverses and comes back to end.
*/
backOut:function (t) {
var BACK_CONST = 1.70158;
return (t -= 1) * t * ((BACK_CONST + 1) * t + BACK_CONST) + 1;
},
/**
* Backtracks slightly, then reverses direction, overshoots end,
* then reverses and comes back to end.
*/
backBoth: function (t) {
var BACK_CONST = 1.70158;
if ((t *= 2 ) < 1) {
return .5 * (t * t * (((BACK_CONST *= (1.525)) + 1) * t - BACK_CONST));
}
return .5 * ((t -= 2) * t * (((BACK_CONST *= (1.525)) + 1) * t + BACK_CONST) + 2);
},
/**
* Bounce off of start.
*/
bounceIn:function (t) {
return 1 - Easing.bounceOut(1 - t);
},
/**
* Bounces off end.
*/
bounceOut:function (t) {
var s = 7.5625, r;
if (t < (1 / 2.75)) {
r = s * t * t;
}
else if (t < (2 / 2.75)) {
r = s * (t -= (1.5 / 2.75)) * t + .75;
}
else if (t < (2.5 / 2.75)) {
r = s * (t -= (2.25 / 2.75)) * t + .9375;
}
else {
r = s * (t -= (2.625 / 2.75)) * t + .984375;
}
return r;
},
/**
* Bounces off start and end.
*/
bounceBoth:function (t) {
if (t < .5) {
return Easing.bounceIn(t * 2) * .5;
}
return Easing.bounceOut(t * 2 - 1) * .5 + .5;
}
};
|
caochangxi/HMWKWebViewHandler
|
ht-for-web-6/guide/plugin/form/examples/easing.js
|
JavaScript
|
mit
| 3,840 |
/* ========================================
* ExpressWorks: Step 05 - Stylish
*
* Author : Maurizio Aru
* Created : 2017.04.13
* ========================================
*
* SINTAX: node my_app.js PORT
*
*/
var express = require('express');
var path = require('path');
var stylus = require('stylus');
var PORT = Number(process.argv[2]);
// check comandline params
if (process.argv < 3){
console.error('Missing boot parameters!');
return;
}
var app = express();
app.use(stylus.middleware(__dirname + '/public'));
app.use(express.static(__dirname + '/public'));
/*
app.get('/', function(request, response){
response.end(200, 'OK');
});
*/
app.listen(PORT);
console.log('Server listening on port ' + PORT);
console.log('[CTRL+C] to close');
|
ginopc/FreeCodeCamp
|
ExpressWorks/05-stylish_css.js
|
JavaScript
|
mit
| 769 |
var isPlask = require('is-plask');
module.exports = isPlask ? require('./PlaskVideo') : require('./HTMLVideo');
|
pex-gl/pex-video
|
index.js
|
JavaScript
|
mit
| 113 |
/**
* [description]
* @return {[type]} [description]
*/
window.$MR.Utils = (function($, $MR) {
'use strict';
var _idCounter,
ua,
transitionend,
animationend,
hasCookie,
getCookie,
setCookie,
deleteCookie,
getStorageItem,
setStorageItem,
uniqueId,
extend,
template,
where;
_idCounter = 0;
ua = function() {
var userAgent = window.navigator.userAgent.toLowerCase(),
ua = 'other';
if (/android/.test(userAgent)) {
ua = 'android';
if(!(/chrome/.test(userAgent))) {
$('html').addClass('android');
if (/android 2/.test(userAgent)) {
ua = 'android2';
$('html').addClass('android2');
}
} else {
$('html').addClass('chrome');
}
} else if (/ipod|iphone|ipad/.test(userAgent)) {
ua ='ios';
$('html').addClass('ios');
} else if (/msie/.test(userAgent)) {
ua = 'ie';
$('html').addClass('ie');
}
return ua;
};
transitionend = function() {
var fakeElement = document.createElement('fakeelement'),
transitionendEvents = {
webkitTransition: 'webkitTransitionEnd',
transition: 'transitionend',
oTransition: 'oTransitionEnd'
},
transitionend;
if (Object.keys) {
Object.keys(transitionendEvents).forEach(function(key) {
if (fakeElement.style[key] !== undefined && !transitionend) {
transitionend = transitionendEvents[key];
return false;
}
});
}
return transitionend;
};
animationend = function() {
var fakeElement = document.createElement('fakeelement'),
animationendEvents = {
webkitAnimation: 'webkitAnimationEnd',
animation: 'animationend',
oAnimation: 'oAnimationEnd'
},
animationend;
if (Object.keys) {
Object.keys(animationendEvents).forEach(function(key) {
if (fakeElement.style[key] !== undefined && !animationend) {
animationend = animationendEvents[key];
return false;
}
});
}
return animationend;
};
hasCookie = function(name, options) {
var _hasCookie = (this.getCookie(name, options) !== null) ? true : false;
return _hasCookie;
};
getCookie = function(name, options) {
var ret = null,
_options = options || {},
_regexp,
_cookie,
_name = name,
_label;
if (_options.delimiter) {
_name = name.split(_options.delimiter)[0];
_label = name.split(_options.delimiter)[1];
_regexp = _name + '\\=(?:.*?)' + _label + '\\=(.*?)(?:\\' + _options.delimiter + '|\\;|$)';
} else {
_regexp = _name + '\\=(.*?)(?:\\;|$)';
}
_cookie = decodeURIComponent(document.cookie).match(new RegExp(_regexp));
if (_cookie && _cookie.length > 1) {
ret = _cookie[1];
}
return ret;
};
setCookie = function(name, value, options) {
var _options = options || {},
_regexp,
_cookie,
_name = name,
_label,
_value = '',
_path = 'path=/;',
_expire = '';
if (_options.delimiter) {
_name = name.split(_options.delimiter)[0];
_label = name.split(_options.delimiter)[1];
}
_regexp = new RegExp(_name + '\\=(.*?)(?:\\;|$)');
_cookie = decodeURIComponent(document.cookie).match(_regexp);
if (_options.path) {
_path = 'path=' + _options.path + ';';
}
if (_options.expire) {
_expire = 'expires=' + new Date(_options.expire).toGMTString() + ';';
}
if (_options.delimiter) {
if (_cookie && _cookie.length > 1) {
_value = _cookie[1].replace(new RegExp(_label + '\\=(.*?)(?:\\' + _options.delimiter + '|\\;|$)'), '');
}
if (value) {
if (_value) {
_value += _options.delimiter;
}
_value = _value + (_label + '=' + value);
}
} else {
_name = name;
_value = value;
}
document.cookie = _name + '=' + encodeURIComponent(_value) + ';' + _path + _expire;
return encodeURIComponent(document.cookie);
};
deleteCookie = function(name, options) {
var _options = options || {};
if (!_options.delimiter) {
_options = $.extend(true, {}, {
expire: '1970/1/1'
});
}
return this.setCookie(name, '', _options);
};
getStorageItem = function(key) {
var result = {
error: false,
data: null
};
if (window.localStorage) {
try {
result.data = window.localStorage.getItem(key);
} catch(e) {
result.error = true;
return result;
}
}
return result;
};
setStorageItem = function(key, value) {
var result = {
error: false
};
if (window.localStorage) {
try {
window.localStorage.setItem(key, value);
} catch(e) {
result.error = true;
}
}
return result;
};
uniqueId = function(prefix) {
var id = ++_idCounter + '';
return prefix ? prefix + id : id;
};
extend = function(Super, Sub) {
var TmpSuper = function() {},
SubConstrutor,
SubPrototype,
Constructor;
if (typeof Sub === 'object') {
SubConstrutor = Sub._create || function() {};
SubPrototype = Sub;
} else {
SubConstrutor = Sub;
SubPrototype = Sub.prototype;
}
Constructor = function() {
var args = Array.prototype.slice.call(arguments);
Super.apply(this, args);
SubConstrutor.apply(this, args);
};
TmpSuper.prototype = Super.prototype;
Constructor.prototype = new TmpSuper();
$.extend(Constructor.prototype, SubPrototype);
return Constructor;
};
template = function (tmpl, data) {
var _settings, _methods;
_settings = {
nomatch: /(.)^/,
evaluate: /<\%(.+?)\%>/g,
interpolate: /<\%\=(.+?)\%>/g,
escaper: /\\|'|\r|\n|\t|\u2028|\u2029/g
};
_methods = {
render: function () {
var regexp, index, source;
index = 0;
source = [];
regexp = new RegExp([
(_settings.interpolate || _settings.nomatch).source,
(_settings.evaluate || _settings.nomatch).source
].join('|') + '|$', 'g');
tmpl.replace(regexp, function (match, interpolate, evaluate, offset) {
source.push('__t.push(\'' + tmpl.slice(index, offset).replace(_settings.escaper, '') + '\');');
if (interpolate) {
source.push('__t.push(' + interpolate + ');');
}
if (evaluate) {
source.push(evaluate);
}
index = offset + match.length;
return match;
});
if (index === 0) {
source.push('__t.push(\'' + tmpl + '\');');
}
source = 'var __t=[];with(__d||{}){' + source.join('\n') + '};return __t.join(\'\');';
return new Function ('$', '__d', source).apply(null, [$, data]);
}
};
return _methods.render();
};
where = function(array, attrs) {
var result = {
indexes: [],
values: []
};
$.each(array, function(i, obj) {
var isValid = true,
key;
for (key in attrs) {
if (obj[key] !== attrs[key]) {
isValid = false;
break;
}
}
if (isValid) {
result.indexes.push(i);
result.values.push(obj);
}
});
if (result.indexes.length <= 0) {
result = null;
}
return result;
};
return {
ua: ua(),
transitionend: transitionend(),
animationend: animationend(),
hasCookie: hasCookie,
getCookie: getCookie,
setCookie: setCookie,
deleteCookie: deleteCookie,
getStorageItem: getStorageItem,
setStorageItem: setStorageItem,
uniqueId: uniqueId,
extend: extend,
template: template,
where: where
};
})(jQuery, window.$MR);
|
yamoo/mr.js
|
src/utils.js
|
JavaScript
|
mit
| 9,396 |
/**
Linear Gradient
==============================
Short-hand helper for adding a linear gradient to your component.
- @param {String} sideOrCorner
- @param {String} top
- @param {String} bottom
- @param {String} base (optional)
- @returns {Object} css linear gradient declaration
Spread the declaration into your component class:
------------------------------
myComponentClass: {
...linearGradient(red, blue),
}
*/
function linearGradient (sideOrCorner, top, bottom, base) {
return {
background: `linear-gradient(to bottom, ${top}, ${bottom}) ${base}`,
};
}
// Vertical Gradient
function gradientVertical (top, bottom, base) {
return linearGradient('to bottom', top, bottom, base);
}
// Horizontal Gradient
function gradientHorizontal (top, bottom, base) {
return linearGradient('to right', top, bottom, base);
}
module.exports = {
gradientHorizontal,
gradientVertical,
};
|
matthieugayon/keystone
|
admin/client/App/elemental/utils.js
|
JavaScript
|
mit
| 905 |
'use strict';
const fs = require('fs');
const zlib = require('zlib');
const Tag = require('./lib/base_tag');
/**
* The NBT class
* @see http://minecraft.gamepedia.com/NBT_Format
*/
class NBT {
constructor() {
this.root = {};
}
/**
* Load from buffer
* @param {Buffer} buff The buffer to load from
* @param {(err?: Error) => void} callback The callback to call when done
*/
loadFromBuffer(buff, callback) {
try {
this._buff = buff;
let offset = 0;
while (offset < buff.length) {
const wrapper = Tag.getNextTag(buff, offset);
const tag = wrapper.tag;
const len = wrapper.length;
this.root[tag.id] = tag;
offset += len;
}
} catch (e) {
return callback(e);
}
callback();
}
/**
* Load from compressed buffer
* @param {Buffer} buff The buffer to load from
* @param {(err?: Error) => void} callback The callback to call when done
*/
loadFromZlibCompressedBuffer(buff, callback) {
zlib.unzip(buff, (err, buff) => {
if (err) {
return callback(err);
}
this.loadFromBuffer(buff, callback);
});
}
/**
* Write to compressed buffer
* @param {(err?: Error, buff?: Buffer) => void} callback The callback to
* call when done
* @param {'gzip'|'deflate'} [method='gzip'] The compression method to use
*/
writeToCompressedBuffer(callback, method = 'gzip') {
try {
const _buff = this.writeToBuffer();
zlib[method](_buff, callback);
} catch (e) {
return callback(e);
}
}
/**
* Write to buffer
* @return {Buffer} The buffer
*/
writeToBuffer() {
const buffLength = this.calcBufferLength();
const buff = new Buffer(buffLength);
let len = 0;
for (const key in this.root) {
if (!this.root.hasOwnProperty(key)) continue;
const object = this.root[key];
buff.writeUInt8(object.getTypeId(), len);
const nameBuff = new Buffer(object.id, 'utf8');
nameBuff.copy(buff, len + 1 + 2);
buff.writeUInt16BE(nameBuff.length, len + 1);
len += object.writeBuffer(buff, len + 1 + 2 + nameBuff.length);
len += (1 + 2 + nameBuff.length);
}
return buff;
}
/**
* Select a tag
* @param {string} tagName the tag name in root
* @return {BaseTag|null} The tag which matches `tagName`
*/
select(tagName) {
if (!this.root || !Object.keys(this.root).length) return null;
if (undefined === this.root[tagName]) return null;
return this.root[tagName];
}
/**
* Alias for `select()`
* @param {string} tagName the tag name in root
* @return {BaseTag|null} The tag which matches `tagName`
*/
get(tagName) {
return this.select(tagName);
}
/**
* Get root object's length
* @return {number} root length
*/
count() {
if (!this.root) return null;
return Object.keys(this.root).length;
}
/**
* Get root's keys
* @return {string[]} root's keys
*/
keys() {
if (!this.root) return null;
return Object.keys(this.root);
}
/**
* Inspect
* @return {string} Inspect string
*/
inspect() {
return `<NBT ${JSON.stringify(this.keys())} >`;
}
/**
* toString
* @return {string} String
*/
toString() {
return JSON.stringify(this.toJSON(), true, 2);
}
/**
* Load NBT structure from file
* @param {string} filename NBT filename
* @param {(err?: Error) => void} callback callback function
*/
loadFromFile(filename, callback) {
// eslint-disable-next-line node/prefer-promises/fs
fs.readFile(filename, (err, buff) => {
if (err) {
return callback(err);
}
this.loadFromBuffer(buff, callback);
});
}
/**
* Load NBT structure from zlib compressed file
* @param {string} filename NBT filename
* @param {(err?: Error) => void} callback callback function
*/
loadFromZlibCompressedFile(filename, callback) {
// eslint-disable-next-line node/prefer-promises/fs
fs.readFile(filename, (err, buff) => {
if (err) {
return callback(err);
}
this.loadFromZlibCompressedBuffer(buff, callback);
});
}
/**
* Write NBT structure to file
* @param {string} filename NBT filename
* @param {(err?: Error) => void} callback callback function
*/
writeToFile(filename, callback) {
try {
// eslint-disable-next-line node/prefer-promises/fs
fs.writeFile(filename, this.writeToBuffer(), callback);
} catch (e) {
return callback(e);
}
}
/**
* Write NBT structure to zlib compressed file
* @param {string} filename NBT filename
* @param {(err?: Error) => void} callback callback function
* @param {'gzip'|'deflate'} [method='gzip'] The compression method to use
*/
writeToCompressedFile(filename, callback, method = 'gzip') {
this.writeToCompressedBuffer((err, buff) => {
if (err) return callback(err);
// eslint-disable-next-line node/prefer-promises/fs
fs.writeFile(filename, buff, callback);
}, method);
}
/**
* Calculate buffer length
* @return {number} buffer length
*/
calcBufferLength() {
let len = 0;
for (const key in this.root) {
if (!this.root.hasOwnProperty(key)) continue;
// child type id for 1 byte, child name length for 2 bytes and child
// name for (child name length) byte(s).
len += 1;
len += 2;
len += Buffer.byteLength(this.root[key].id, 'utf8');
// add the child body's length
len += this.root[key].calcBufferLength();
}
return len;
}
/**
* toJSON
* @return {Object} JSON object
*/
toJSON() {
const res = {};
for (const key in this.root) {
if (!this.root.hasOwnProperty(key)) continue;
res[key] = this.root[key].toJSON();
}
return res;
}
}
NBT.Tags = require('./lib/tags');
module.exports = NBT;
|
BoogeeDoo/mcnbt
|
nbt.js
|
JavaScript
|
mit
| 5,960 |
/**
* HTTP API endpoints.
*/
var express = require('express');
var predictionApi = require('./prediction');
var forecastApi = require('./forecast');
var router = express.Router();
// mounting APIs
router.use('/predictions', predictionApi);
router.use('/forecasts', forecastApi);
module.exports = router;
|
watstock/api
|
lib/routes/api/index.js
|
JavaScript
|
mit
| 310 |
UI.body.data = { title: "hello world" };
Template.Page.submit = function (e, values, form) {
console.log('submit!');
console.log(arguments);
console.log(this);
};
|
yubozhao/iron-component
|
examples/form/client/app.js
|
JavaScript
|
mit
| 170 |
function WHCreateCookie(name, value, days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = name+"="+value+expires+"; path=/";
}
function WHReadCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
window.onload = WHCheckCookies;
function WHCheckCookies() {
if(WHReadCookie('cookies_accepted') != 'T') {
var message_container = document.createElement('div');
message_container.id = 'cookies-message-container';
var html_code = '<div id="cookies-message" style="padding: 10px 0px; font-size: 14px; line-height: 22px; border-bottom: 1px solid #D3D0D0; text-align: center; position: fixed; bottom: 0px; background-color: #EFEFEF; width: 100%; z-index: 999;">Ta strona używa ciasteczek (cookies), dzięki którym nasz serwis może działać lepiej. <a href="http://wszystkoociasteczkach.pl" target="_blank">Dowiedz się więcej</a><a href="javascript:WHCloseCookiesWindow();" id="accept-cookies-checkbox" name="accept-cookies" style="background-color: #00AFBF; padding: 5px 10px; color: #FFF; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; display: inline-block; margin-left: 10px; text-decoration: none; cursor: pointer;">Rozumiem</a></div>';
message_container.innerHTML = html_code;
document.body.appendChild(message_container);
}
}
function WHCloseCookiesWindow() {
WHCreateCookie('cookies_accepted', 'T', 365);
document.getElementById('cookies-message-container').removeChild(document.getElementById('cookies-message'));
}
|
Aldor007/mkaciuba.pl
|
src/Aldor/InftechBundle/Resources/public/js/cookies.js
|
JavaScript
|
mit
| 1,885 |
// Your app's entry point. Every MedTantra projects requires 'src/app.js',
// which both the server and browser will import.
//
// In this file, you'll do two things:
//
// 1. Import `kit/config`, and configure your app. In this example, I'm
// adding a custom Redux reducer that acts as a simple counter, and enabling
// a built-in GraphQL server that imports a schema for a simple message.
//
// 2. Export the root React component that goes between <div id="main"/>
// in the server-side HTML.
// ----------------------
// IMPORTS
/* MedTantra */
// Config API, for adding reducers and configuring our MedTantra app
import config from 'kit/config';
/* App */
// Example counter reducer. This simply increments the counter by +1
import counterReducer from 'src/reducers/counter';
// Main component -- i.e. the 'root' React component in our app
import Main from 'src/components/main';
// Init global styles. These will be added to the resulting CSS automatically
// without any class hashing. Use this to include default or framework CSS.
import './styles.global.css';
// ----------------------
/* REDUCERS */
// Add our custom `counter` reducer. This must follow the shape
// {state, reducer()}, otherwise it will throw an error
config.addReducer('counter', counterReducer);
// Set our server config, by checking `SERVER` -- this code path will be
// eliminated by Webpack in the browser, so we can safely add this.
if (SERVER) {
/* GRAPHQL */
// If we're running on the server, create a built-in GraphQL server using
// custom schema. By default, this will bind to /graphql -- POST will
// handle GraphQL requests; GET will display the GraphiQL query interface
//
// Apollo will attempt to connect to /graphql automatically. We'll run
// this only on the server, to avoid the bloat of loading unnecessary GraphQL
// schema and types on the client
config.enableGraphQLServer(require('src/graphql/schema').default);
/* CUSTOM ROUTES */
// We can add custom routes to the web server easily, by using
// `config.add<Get|Post|Put|Patch>Route()`. Note: These are server routes only.
config.addGetRoute('/test', async ctx => {
ctx.body = 'Hello from your MedTantra route.';
});
/* CUSTOM 404 HANDLER */
// By default, if the server gets a route request that results in a 404,
// it will set `ctx.status = 404` but continue to render the <NotFound>
// block as normal. If we want to add our own custom handler, we can use
// `config.set404Handler()` as below.
//
// Note: This only applies to SERVER routes. On the client, the
// <NotFound> block will *always* run.
config.set404Handler((ctx, store) => {
// For demo purposes, let's get a JSON dump of the current Redux state
// to see that we can expect its contents
const stateDump = JSON.stringify(store.getState());
// Explicitly set the return status to 404. This is done for us by
// default if we don't have a custom 404 handler, but left to the function
// otherwise (since we might not always want to return a 404)
ctx.status = 404;
// Set the body
ctx.body = `This route does not exist on the server - Redux dump: ${stateDump}`;
});
}
// In app.js, we need to export the root component we want to mount as the
// starting point to our app. We'll just export the `<Main>` component.
export default Main;
|
Mahi22/MedTantra
|
src/app.js
|
JavaScript
|
mit
| 3,383 |
var app = angular.module('app.file', []);
app.config(function ($stateProvider) {
$stateProvider.state('app.files', {
url: '/files',
abstract: true,
template: '<ui-view></ui-view>'
}).state('app.files.list', {
url: '/list',
templateUrl: 'lib/modules/file/views/list.html',
controllerAs: 'ctrl',
controller: function (Container, containers) {
this.containers = containers;
this.addContainer = function () {
var name = window.prompt('Container name?');
if (name !== null) {
Container.createContainer({
name: name
}).$promise.then(function(){
console.log('name', name);
}).catch(function(err){
console.log('err', err);
});
}
}
},
resolve: {
containers: function (Container) {
return Container.getContainers().$promise;
}
}
}).state('app.files.upload', {
url: '/upload/:container',
templateUrl: 'lib/modules/file/views/upload.html',
resolve: {
containers: function (Container) {
return Container.getContainers().$promise;
},
container: function ($stateParams, Container) {
return Container.getContainer({
container: $stateParams.container
}).$promise;
},
files: function ($stateParams, Container) {
return Container.getFiles({
container: $stateParams.container
}).$promise;
}
},
controller: function ($stateParams, File, containers, container) {
this.container = container;
this.upload = {
container: $stateParams.container,
file: {}
};
this.containerList = containers.map(function(container){
return {
value: container.name,
label: container.name
}
});
this.schema = {
type: 'object',
properties: {
container: {
type: 'string',
format: 'uiselect',
title: 'Container',
items: this.containerList
},
file: {
type: 'file',
title: 'File'
}
}
};
this.form = [{
key: 'container'
}, {
key: 'file',
type: 'file'
}, {
type: 'submit',
title: 'Submit'
}];
this.onSubmit = function () {
console.log('this.upload', this.upload);
File.upload(this.upload, function (yay) {
console.log('yay', yay);
}, function (nay) {
console.log('nay', nay);
});
};
},
controllerAs: 'ctrl'
}).state('app.files.container', {
url: '/container/:container',
templateUrl: 'lib/modules/file/views/container.html',
resolve: {
container: function ($stateParams, Container) {
return Container.getContainer({
container: $stateParams.container
}).$promise;
},
files: function ($stateParams, Container) {
return Container.getFiles({
container: $stateParams.container
}).$promise;
}
},
controller: function (container, files) {
this.container = container;
this.files = files;
},
controllerAs: 'ctrl'
}).state('app.files.file', {
url: '/container/:container/files/:file',
templateUrl: 'lib/modules/file/views/file.html',
resolve: {
container: function ($stateParams, Container) {
return Container.getContainer({
container: $stateParams.container
}).$promise;
},
file: function ($stateParams, Container) {
return Container.getFile({
container: $stateParams.container,
file: $stateParams.file
}).$promise;
}
},
controller: function (container, file) {
this.container = container;
this.file = file;
},
controllerAs: 'ctrl'
}).state('app.files.download', {
url: '/container/:container/download/:file',
template: '<pre>{{ctrl.download}}</pre>',
resolve: {
download: function ($stateParams, Container) {
return Container.download({
container: $stateParams.container,
file: $stateParams.file,
res: {}
}).$promise;
}
},
controller: function (download) {
this.download = download;
},
controllerAs: 'ctrl'
});
});
|
beeman/loopback-angular-integrations
|
client/lib/modules/file/config/file.config.js
|
JavaScript
|
mit
| 4,371 |
module.exports = transformer;
var fs = require('fs'),
moment = require('moment'),
path = require('path');
var timePattern = /^(atime|birthtime|ctime|mtime)(\s*\|\s*(.+))?/;
/**
* Based on a template string, where variables `{basename}` and `{extname}` can
* be used as placeholders, return a function that will be invoked with a file name
* to be transformed.
* @param {string} template the template string to use for renaming
*/
function transformer(template) {
'use strict';
/**
* Function that will be invoked during the transformation process. For a
* given file, it will return a new string for that file name. The placeholders
* {basename} and {extname} can be used to extract the base file name and
* extension name from the original file to be used in the transformed name.
* @param {string} file the file name to be transformed
* @param {number} [index] the index of the file being processed
*/
return function (file, index) {
if (template) {
// Replace any placeholders
file = path.join(path.dirname(file), template.replace(/\{([^}]+)}/g, function (match, token) {
var base = path.basename(file);
var timeMatch;
var extIndex = base.lastIndexOf('.');
if (token === 'basename') {
return extIndex === -1 ? base : base.substring(0, extIndex);
}
else if (token === 'extname') {
return extIndex === -1 ? '' : base.substring(extIndex + 1);
}
else if (token === 'index') {
return index;
}
else if ((timeMatch = timePattern.exec(token))) {
return moment(fs.statSync(file)[timeMatch[1]]).format(timeMatch[3]);
}
return match;
}));
}
return file;
}
}
|
nsand/newid
|
lib/transformer.js
|
JavaScript
|
mit
| 1,662 |
var NotificationType = {
Info : "INFO",
Success : "SUCCESS",
Warning : "WARNING",
Error : "ERROR"
};
var NotificationCenter = function() {
// default time to show notification (3 seconds)
var time = 3000;
return {
// get type object for specified type
getTypeObject: function(type) {
if (NotificationType.Success == type) {
return { nclass: "notification-success", laclass: "loading-indicator-success" };
} else if (NotificationType.Warning == type) {
return { nclass: "notification-warning", laclass: "loading-indicator-warning" };
} else if (NotificationType.Error == type) {
return { nclass: "notification-error", laclass: "loading-indicator-error" };
} else {
return { nclass: "notification-info", laclass: "loading-indicator-info" };
}
},
// creates loading indicator
createLoadingIndicator: function(typeObj, parent) {
var main = Util.createElement("div", null, "notification-loading loading-indicator", null, parent);
var spinner = Util.createElement("div", null, "spinner", null, main);
var mask = Util.createElement("div", null, "mask", null, spinner);
var maskCircle = Util.createElement("div", null, "masked-circle " + typeObj.laclass, null, mask);
return main;
},
// creates text node and adds text to it
createTextNode: function(msg, parent) {
return Util.createElement("td", null, "notification-content-table-cell", msg, parent);
},
// creates control panel with up to 2 buttons
createControlPanel: function(ok, cancel, notification) {
NotificationCenter.removeActionHandlers(notification);
if (ok || cancel) {
var a = Util.createElement("div", null, "notification-control-panel", null, notification.controlNode);
if (ok) {
notification.controlNode.ok = Util.createElement("a", null, "notification-control", "Ok", a);
notification.controlNode.okHandler = function() {
if (notification.timeout) {
clearTimeout(notification.timeout);
}
NotificationCenter.hide(notification);
ok.call(this);
};
Util.addEventListener(notification.controlNode.ok, "click", notification.controlNode.okHandler);
}
if (cancel) {
notification.controlNode.cancel = Util.createElement("a", null, "notification-control", "Cancel", a);
notification.controlNode.cancelHandler = function() {
if (notification.timeout) {
clearTimeout(notification.timeout);
}
NotificationCenter.hide(notification);
cancel.call(this);
}
Util.addEventListener(notification.controlNode.cancel, "click", notification.controlNode.cancelHandler);
}
return a;
} else {
return null;
}
},
// remove all action handlers
removeActionHandlers: function(notification) {
if (!notification || !notification.controlNode)
return;
if (notification.controlNode.okHandler) {
Util.removeEventListener(notification.controlNode.ok, "click", notification.controlNode.okHandler);
}
if (notification.controlNode.cancelHandler) {
Util.removeEventListener(notification.controlNode.cancel, "click", notification.controlNode.cancelHandler);
}
},
setHideTimeout: function(notification, timeout) {
if (notification.timeout) {
clearTimeout(notification.timeout);
}
if (!timeout || timeout >= 0) {
notification.timeout = setTimeout(function() {NotificationCenter.hide(notification);}, ((timeout)?timeout:time));
}
},
change: function(notification, type, message, timeout, showLoad, okHandler, cancelHandler) {
if (!notification) {
throw ("Notification object is undefined");
}
var typeObj = NotificationCenter.getTypeObject(type);
// change type
notification.element.className = "notification"+" "+typeObj.nclass;
// change message
notification.textNode.innerHTML = message;
// change loading
notification.loadNode.innerHTML = "";
if (showLoad)
NotificationCenter.createLoadingIndicator(typeObj, notification.loadNode);
// change okHandler and cancelHandler
notification.controlNode.innerHTML = "";
NotificationCenter.createControlPanel(okHandler, cancelHandler, notification);
// change timeout
NotificationCenter.setHideTimeout(notification, timeout);
return false;
},
create: function(type, message, timeout, showLoad, okHandler, cancelHandler, parent) {
var notification = {};
var typeObj = NotificationCenter.getTypeObject(type);
// build the html of the notification
notification.parent = parent;
notification.element = Util.createElement("div", null, "notification " + typeObj.nclass, null, parent);
var table = Util.createElement("table", null, "notification-content-table", null, notification.element);
var tr = Util.createElement("tr", null, "", null, table);
// 0. spinner (loading indicator)
notification.loadNode = Util.createElement("td", null, "notification-content-table-cell", null, tr);
if (showLoad) {
NotificationCenter.createLoadingIndicator(typeObj, notification.loadNode);
}
// 1. text (message)
notification.textNode = NotificationCenter.createTextNode(message, tr);
// 2. controls
notification.controlNode = Util.createElement("td", null, "notification-content-table-cell", null, tr);
NotificationCenter.createControlPanel(okHandler, cancelHandler, notification);
return notification;
},
show: function(type, message, timeout, showLoad, okHandler, cancelHandler, parent) {
var t = NotificationCenter.create(type, message, timeout, showLoad, okHandler, cancelHandler, parent);
NotificationCenter.setHideTimeout(t, timeout);
NotificationCenter.fadeIn(t.element);
return t;
},
hide: function(notification) {
if (!notification.parent)
throw ("Parent for notifications is undefined");
if (!notification)
return;
NotificationCenter.removeActionHandlers(notification);
NotificationCenter.fadeOut(notification.element, function() {
notification.parent.removeChild(notification.element);
});
},
/* fade out */
fadeOut: function(element, callback) {
var op = 1;
element.style.opacity = op;
var timer = setInterval(function () {
if (op <= 0.1) {
clearInterval(timer);
Util.removeClass(element, "on");
Util.addClass(element, "off");
if (callback)
callback.call(this);
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op -= op * 0.1;
}, 12);
},
/* fade in */
fadeIn: function(element, callback) {
var op = 0.1;
element.style.opacity = op;
Util.removeClass(element, "off");
Util.addClass(element, "on");
var timer = setInterval(function () {
if (op >= 1) {
clearInterval(timer);
if (callback)
callback.call(this);
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op += op * 0.1;
}, 12);
}
}
}();
|
sadikovi/graphanalytics
|
resources/scripts/notificationcenter.js
|
JavaScript
|
mit
| 8,636 |
(function(angular) {
'use strict';
angular.module('jjp.practical-forms')
.directive('pfEmail', ['pfConfig', function(pfConfig) {
return pfConfig.baseDirective('email');
}]);
}(window.angular));
|
jjprogramsllc/practical-form.js
|
src/components/Email/email.js
|
JavaScript
|
mit
| 207 |
import React, { Component } from 'react';
import AppBar from 'material-ui/AppBar';
import IconButton from 'material-ui/IconButton';
import NavigationClose from 'material-ui/svg-icons/navigation/close';
export default class AppTopBar extends Component {
render() {
return (
<div>
<AppBar
title="Title"
iconElementLeft={
<IconButton>
<NavigationClose />
</IconButton>
}
/>
</div>
);
}
}
|
blowsys/reservo
|
src/app/core/molecules/app-bar/index.js
|
JavaScript
|
mit
| 603 |
// jQuery code
$(document).ready(function () {
});
//Angular code
(function (){
angular.module('hotelbApp').controller('hotelReservation', ['$scope', '$window', function($scope, $window) {
//Properties
this.reservation = new reservationObj();
var tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
var dayAfterTomorrow = new Date();
dayAfterTomorrow.setDate(tomorrow.getDate() + 1);
//Scope variables
$scope.today = new Date();
$scope.showAction;
$scope.validCheckInDate = true;
$scope.validCheckOutDate = true;
$scope.specialRequests=["Breakfast in the room", "Dinner on the roof ", "Romantic visit of the city"];
$scope.checkInTime = ["00:00", "01:00","02:00"];
$scope.checkOutTime = ["00:00", "01:00","02:00"];
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
$scope.dateOptions = {
dateDisabled: disabled,
formatYear: 'yyyy',
maxDate: new Date(2020, 5, 22),
minDate: new Date(),
startingDay: 1
};
$scope.checkInDate = {
opened: false
};
$scope.checkOutDate = {
opened: false
};
$scope.openCheckInDate = function() {
$scope.checkInDate.opened = true;
};
$scope.openCheckOutDate = function() {
$scope.checkOutDate.opened = true;
};
this.reservation.construct(0,"Dee","Dee","Dee","Dee", "Dee", "Dee", 12345, 1, 0, 933333333, "r@rc.om", "standard", tomorrow, dayAfterTomorrow, $scope.checkInTime[0], $scope.checkOutTime[0], [], "", 50)
this.validateDates = function ()
{
//cehckning data AAAA-MM-DD
$scope.validCheckInDate=true;
$scope.validCheckOutDate=true;
var currentDate = new Date();
if(this.reservation.getCheckInDate() < currentDate && $scope.validCheckInDate)
{
//$("#checkInDate").removeClass("ng-valid").addClass("ng-invalid");
$scope.validCheckInDate=false;
console.log("1: "+$scope.validCheckInDate);
}
if(this.reservation.getCheckOutDate() <= currentDate && $scope.validCheckOutDate)
{
//$("#checkOutDate").removeClass("ng-valid").addClass("ng-invalid");
$scope.validCheckOutDate=false;
console.log("2: "+$scope.validCheckOutDate);
}
if(this.reservation.getCheckOutDate() <= this.reservation.getCheckInDate() && $scope.validCheckInDate && $scope.validCheckOutDate)
{
$("#checkInDate").removeClass("ng-valid").addClass("ng-invalid");
$("#checkOutDate").removeClass("ng-valid").addClass("ng-invalid");
$scope.validCheckInDate=false;
$scope.validCheckOutDate=false;
console.log("3: "+$scope.validCheckOutDate);
}
if($scope.validCheckInDate && $scope.validCheckOutDate)
{
$("#checkInDate").removeClass("ng-invalid").addClass("ng-valid");
$("#checkOutDate").removeClass("ng-invalid").addClass("ng-valid");
var dayBetween = calculateNumberDays(this.reservation.getCheckInDate(), this.reservation.getCheckOutDate());
this.reservation.setTotalPrice(dayBetween*50);
}
}
this.specialReqMng = function (indexChecked)
{
if($("#specialReq"+indexChecked).is(":checked"))
{
this.reservation.addSpecialRequests($scope.specialRequests[indexChecked]);
}
else
{
this.reservation.removeSpecialRequests($scope.specialRequests[indexChecked]);
}
}
this.insertReservation = function ()
{
console.log(this.reservation);
if(this.reservation.validate().length==0) {
alert(this.reservation.toString());
this.reservation = new reservationObj();
$scope.reservationManagement.$setPristine();
$scope.$parent.showAction=0;
}
else {showErrors(this.reservation.validate());}
}
}]);
angular.module('hotelbApp').directive("hotelReservationForm", function (){
return {
restrict: 'E',
templateUrl:"view/templates/hotel-reservation-form.html",
controller:function(){
},
controllerAs: 'hotelReservationForm'
};
});
})();
//Own code
function disabled(data) {
var date = data.date,
mode = data.mode;
return mode === 'day' && (date.getDay() === 0 || date.getDay() === 6);
}
|
vatio123/Agora
|
public_html/js/controller/hotelReservationCtrl.js
|
JavaScript
|
mit
| 4,196 |
var express = require('express');
var router = express.Router();
router.get('/', function (req, res) {
res.render('index');
});
/**
* Expose variables to all routes
*/
router.use(function (req, res, next) {
// Pass the entire session through to the frontend
// We dont have session. Yet...
// res.locals.session = req.session;
res.locals.data = {};
// get
for(var item in req.query) {
if(req.query.hasOwnProperty(item)) {
res.locals.data[item] = req.query[item];
}
}
// post
for(var item in req.body) {
if(req.body.hasOwnProperty(item)) {
res.locals.data[item] = req.body[item];
}
}
next();
});
var items = [
{
'titleno':'DN31258',
'abr': 'AC08178',
'state': 'Allocated',
'caseworker': 'John Smith'
},
{
'titleno':'DN95674',
'abr': 'AA16893',
'state': 'Unallocated',
'caseworker': null
},
{
'titleno':'DN72309',
'abr': 'AG13851',
'state': 'Deferred',
'caseworker': 'Mary Smith'
},
{
'titleno':'DN10501',
'abr': 'AG15172',
'state': 'Deferred',
'caseworker': 'Jack Jones'
}
]
router.get('/search/results_return', function (req, res) {
// get the titleNo and abr passed in
var titleNo = req.query.titleNo.toUpperCase();
var abr = req.query.abr.toUpperCase();
// results, first is allocated to John smith, second is
// unallocated, third is tied to the second, third is tied
// to the first and fifth is unallocated on its own
result = null
for (i = 0; i < items.length; i++) {
if ((abr == items[i]['abr']) && (titleNo == items[i]['titleno'])) {
result = items[i];
if (items[i]['caseworker'] == null) {
result['caseworker'] = 'N/A'
}
}
}
res.render('search/results_return', {'result': result});
});
router.get('/search/results_obtain', function (req, res) {
// get the titleNo and abr passed in
var abr = req.query.abr.toUpperCase();
// results, first is allocated to John smith, second is
// unallocated, third is tied to the second, third is tied
// to the first and fifth is unallocated on its own
result = null
for (i = 0; i < items.length; i++) {
if (abr === items[i]['abr']) {
result = items[i];
if (items[i]['caseworker'] == null) {
result['caseworker'] = 'N/A'
}
}
}
res.render('search/results_obtain', {'result': result});
});
router.get('/search/result_worklist', function (req, res) {
var titleNo = req.query.titleNo;
var abr = req.query.ABR;
item = {
'titleNo': titleNo,
'abr': abr
}
res.render('search/result_worklist', {'item': item});
});
router.get('/search/return', function (req, res) {
var titleNo = req.query.titleNo;
res.render('search/return', {'titleNo': titleNo});
});
router.get('/choose-categories/obtain', function (req, res) {
var cat = req.query.cat_choice;
res.render('choose-categories/obtain', {'cat': cat})
})
module.exports = router;
|
LandRegistry/workflow-prototype
|
app/routes.js
|
JavaScript
|
mit
| 3,026 |
var PREFIX = location.href
.replace(/[?#].*$/, '')
.replace(/\/index.html$/i, '/');
var cache = {};
function getKey(key) {
return PREFIX + '?' + key;
}
exports.set = function (key, value) {
key = getKey(key);
if (value == null) {
value = '';
} else {
value += '';
}
cache[key] = value;
try {
localStorage[key] = value;
} catch (e) {}
};
exports.get = function (key, noCache) {
key = getKey(key);
try {
return noCache ? localStorage[key] : cache[key] || localStorage[key];
} catch (e) {}
return cache[key];
};
|
avwo/whistle
|
biz/webui/htdocs/src/js/storage.js
|
JavaScript
|
mit
| 556 |
'use strict';
angular.module('sites').controller('SitesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Sites',
function($scope, $stateParams, $location, Authentication, Sites) {
$scope.authentication = Authentication;
$scope.create = function() {
var site = new Sites({
title: this.title,
content: this.content
});
site.$save(function(response) {
$location.path('sites/' + response._id);
$scope.title = '';
$scope.content = '';
}, function(errorResponse) {
$scope.error = errorResponse.data.message;
});
};
$scope.remove = function(site) {
if (site) {
site.$remove();
for (var i in $scope.sites) {
if ($scope.sites[i] === site) {
$scope.sites.splice(i, 1);
}
}
} else {
$scope.site.$remove(function() {
$location.path('sites');
});
}
};
$scope.update = function() {
var site = $scope.site;
site.$update(function() {
$location.path('sites/' + site._id);
}, function(errorResponse) {
$scope.error = errorResponse.data.message;
});
};
$scope.find = function() {
$scope.sites = Sites.query();
};
$scope.findOne = function() {
$scope.site = Sites.get({
siteId: $stateParams.siteId
});
};
}
]);
|
neilhanekom/afrupro
|
modules/sites/client/controllers/sites.client.controller.js
|
JavaScript
|
mit
| 1,267 |
import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
model() {
return this.store.findAll('person').catch(
(error) => {
return [Ember.Object.create({ error })];
}
);
}
});
|
gsrai/Pool-Request
|
app/routes/admin.js
|
JavaScript
|
mit
| 331 |
/**
* @file 页面骨架
* @author paulwang007(12900985@qq.com)
*/
import Vue from 'vue';
import Skeleton from './Search.skeleton.vue';
export default new Vue({
components: {
Skeleton
},
template: '<skeleton />'
});
|
lavas-ui/uiframe
|
src/pages/search/entry-skeleton.js
|
JavaScript
|
mit
| 241 |
import Perf from 'react-addons-perf';
if (typeof window !== 'undefined') {
window.Perf = Perf;
console.log('start perf');
Perf.start();
setTimeout(() => {
console.log('stop perf');
Perf.stop();
console.log(Perf.printWasted());
console.log(Perf.printOperations());
}, 5000);
}
|
angeloocana/tic-tac-toe-ai
|
src/performance.js
|
JavaScript
|
mit
| 303 |