<commit_before>/******************************************************************************
Class Editor

A class for managing the editor.
******************************************************************************/
function Editor(battlemap){
	this.battlemap = battlemap;
	this.zones = [];
	this.currentZone = null;
	this.pointer = new Pointer(this.battlemap, 4, "#09f", "#05d");
	this.bindEvents();
	this.dragging = false;
	this.dblclick= false;
}

Editor.prototype = {
	get pointStroke(){
		return this._pointStroke;
	},
	set pointStroke(val){
		this._pointStroke = val;
		this.triggerUpdate();
	},

	get pointFill(){
		return this._pointFill;
	},
	set pointFill(val){
		this._pointFill = val;
		this.triggerUpdate();
	}
}

Editor.prototype.bindEvents = function(){
	$(this.pointer).mouseup($.proxy(this.mouseupHandler, this));
	$(this.pointer).mousedown($.proxy(this.mousedownHandler, this));
	$(this.pointer).dblclick($.proxy(this.dblclickHandler, this));
}

Editor.prototype.triggerUpdate = function(){
	$(this).trigger('prop-update', undefined);
}

Editor.prototype.mouseupHandler = function(ev){
	this.dragging = false;
}

Editor.prototype.mousedownHandler = function(ev){
	this.dragging = true;

	setTimeout($.proxy(function() {
		if (this.dragging == false && this.dblclick == false){
			if(this.currentZone == null){
				this.currentZone = new EditZone(this.battlemap, this);
			}

			var zone = this.currentZone;
			if (zone.getPoint(this.pointer.position.x, this.pointer.position.y) == null){
				this.currentZone.addPoint(this.pointer.position.x, this.pointer.position.y);
			} else {
				console.log('Already got a point.');
			}
		} else {
			this.dblclick = false;
		}
	}, this), 200);
}

Editor.prototype.dblclickHandler = function(ev){
	console.log("dblclick");
	this.dblclick = true;
}

/******************************************************************************
Class EditZone

A class for managing the editor.
******************************************************************************/
function EditZone(battlemap, editor){
	this.battlemap = battlemap;
	this.editor = editor;
	this.points = new Array();
	this.zone = new CombatZone(this.battlemap, {path: "Mz"});
}

EditZone.prototype.p2s = function(x, y){
	return "" + x + "," + y;
}

EditZone.prototype.addPoint = function(x, y){
	var point = new Point(this.battlemap, x, y);
	this.points.push(point);

	//this.updateZone();

	return point;
}

EditZone.prototype.getPoint = function(x, y){
	var found = null;
	$(this.points).each(function(index, point) {
		if (point != null && point.position.x == x && point.position.y == y){
			found = point;
			return false;
		}
	});

	console.log(found);
	return found;
}

EditZone.prototype.updateZone = function(){
	for (var key in this.points){
		var pos = this.points[key].position

		this.zone.setPath("Mz")
	}
}

/******************************************************************************
Class Pointer

A simple class the represents the svg element acting as our pointer on the
battlemap grid.

Events
* mouseup - The mouseup event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousedown - The mousedown event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousemove - The mousemove event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

Properties
* transform :: string() - The transform string used by the internal svg element.

* position :: {x, y, rawX, rawY} - Represents the position of the pointer. The
			x,y properties are in cell coordinates, while rawX,rawY are in page
			coordinates.

* offset :: {x, y} - Object with x and y parameters. Represents the offset from
			page coordinates.

 * svgElement :: Object() - The underlying svg element
******************************************************************************/
function Pointer(battlemap, size, fill, stroke) {
	this.battlemap = battlemap;
	this.position = {x: 0, y: 0, rawX: 0, rawY: 0};

	// Set offset
	var offset_ = $(this.battlemap.actionElem).offset();
	this.offset = {x: offset_.left, y: offset_.top};

	// Build svg element
	//this.svgElement = this.battlemap.toolPaper.circle(0, 0, size);
	this.svgElement = this.battlemap.svgPaper.circle(0, 0, size);

	if (typeof fill !== 'undefined'){
		this.svgElement.attr("fill", fill);
	}

	if (typeof stroke !== 'undefined'){
		this.svgElement.attr("stroke", stroke);
	}

	this.bindEvents();
}

Pointer.prototype = {
	get transform(){
		return this._transform
	},

	set transform(val){
		var trans = Raphael.parseTransformString(val);
		this.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
	}
}

Pointer.prototype.bindEvents = function(){
	$(this.battlemap.actionElem).mouseup($.proxy(this.mouseupHandler, this));
	$(this.battlemap.actionElem).mousedown($.proxy(this.mousedownHandler, this));
	$(this.battlemap.actionElem).dblclick($.proxy(this.dblclickHandler, this));
	$(this.battlemap.actionElem).mousemove($.proxy(this.mousemoveHandler, this));
	$(this.battlemap).bind("viewChanged", $.proxy(this.mousemoveHandler, this));
}

Pointer.prototype.mouseupHandler = function(ev){
	$(this).trigger('mouseup', ev);
}

Pointer.prototype.mousedownHandler = function(ev){
	$(this).trigger('mousedown', ev);
}

Pointer.prototype.dblclickHandler = function(ev){
	$(this).trigger('dblclick', ev);
}

Pointer.prototype.mousemoveHandler = function(ev){
	if (typeof ev.pageX == 'undefined'){
		ev.pageX = this.position.rawX;
	}
	if (typeof ev.pageY == 'undefined'){
		ev.pageY = this.position.rawY;
	}

	// handle our special logic
	this.position.rawX = ev.pageX;
	this.position.rawY = ev.pageY;
	var cell = this.battlemap.getNearestCell(ev.pageX - this.offset.x, ev.pageY - this.offset.y);
	this.position.x = cell[0];
	this.position.y = cell[1];
	this.transform = this.battlemap.getTransformString(cell[0], cell[1]);

	// trigger our mousemove event
	$(this).trigger('mousemove', ev);
}

/******************************************************************************
Class Point

A simple class the represents a user-interactable point on the grid.

Events
* mouseup - The mouseup event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousedown - The mousedown event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousemove - The mousemove event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

Properties
* position :: {x, y, rawX, rawY} - Represents the position of the pointer. The
			x,y properties are in cell coordinates, while rawX,rawY are in page
			coordinates.

 * svgElement :: Object() - The underlying svg element
******************************************************************************/
function Point(battlemap, posX, posY, size, fill, stroke) {
	this.battlemap = battlemap;
	this._position = {x: 0, y:0};

	// Build svg element
	if (typeof size == 'undefined'){
		size = 3;
	}
	this.size = size;
	//this.svgElement = this.battlemap.toolPaper.circle(0, 0, size);
	this.svgElement = this.battlemap.svgPaper.circle(0, 0, size);

	if (typeof fill == 'undefined'){
		fill = "#777";
	}
	this.fillColor = fill;

	if (typeof stroke == 'undefined'){
		stroke = "#777";
	}
	this.strokeColor = stroke;

	if ((typeof posX !== 'undefined') && (typeof posY !== 'undefined')){
		this.position = {x: posX, y: posY};
	}

	$(this.battlemap).bind("viewChanged", {context: this}, this.moveHandler);
}

Point.prototype = {
	get position(){
		return this._position;
	},
	set position(val){
		this._position.x = val.x;
		this._position.y = val.y;

		var trans = Raphael.parseTransformString(this.battlemap.getTransformString(val.x, val.y));
		this.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
	},

	get size(){
		return this._size;
	},
	set size(val){
		if (typeof val !== 'undefined'){
			//TODO: Update the size of the SVG Element
			this._size = val;
		}
	},

	get strokeColor(){
		return this._strokeColor;
	},
	set strokeColor(val){
		if (typeof val !== 'undefined'){
			this._strokeColor = val;
			this.svgElement.attr("stroke", val);
		}
	},

	get fillColor(){
		return this._fillColor;
	},
	set fillColor(val){
		if (typeof val !== 'undefined'){
			this._fillColor = val;
			this.svgElement.attr("fill", val);
		}
	}
}

Point.prototype.moveHandler = function(ev){
	var context = ev.data.context;
	var trans = Raphael.parseTransformString(context.battlemap.getTransformString(context.position.x, context.position.y));
	context.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
}

// ----------------------------------------------------------------------------

$().ready(function(){
	addColorPicker('.grid', 'grid_color');
	addColorPicker('.map', 'map_color');

	// Grid Line Color editor
	$('#grid_color').val(rgb2Hex(battleMap.gridlineColor));
	$('#grid_alpha').val(getAlphaFromRGBA(battleMap.gridlineColor));
	$('#grid_color').change(function(){
		var color = color2Hex($('#grid_color').val());
		var alpha = $('#grid_alpha').val();
		battleMap.gridlineColor = hex2rgb(color, alpha);
		battleMap.drawGrid();
	});
	$('#grid_color').blur(function(){
		var color = color2Hex($('#grid_color').val());
		var alpha = $('#grid_alpha').val();
		battleMap.gridlineColor = hex2rgb(color, alpha);
		battleMap.drawGrid();
	});
	$('#grid_alpha').change(function(){
		$('#grid_color').change();
	});
	$('#grid_alpha').bind('input', function(){
		$('#grid_color').change();
	});
	$('#grid_color').change();

	// Background Color editor
	$('#map_color').val(rgb2Hex(battleMap.backgroundColor));
	$('#map_color').change(function(){
		var color = color2Hex($('#map_color').val());
		battleMap.backgroundColor = color;
	});
	$('#map_color').blur(function(){
		var color = color2Hex($('#map_color').val());
		battleMap.backgroundColor = color;
	});
	$('#map_color').change();

	// Create an editor
	window.editor = new Editor(battleMap);
});

<commit_msg>The editor is now (partially) functional. Creates new zones, and correctly finishes those zones on either doubleclick or clicking on the start point. Double click ends the zone with a moveto, clicking on the starting point ends on a line.<commit_after>/******************************************************************************
Class Editor

A class for managing the editor.
******************************************************************************/
function Editor(battlemap){
	this.battlemap = battlemap;
	this.zones = [];
	this.currentZone = null;
	this.pointer = new Pointer(this.battlemap, 4, "#09f", "#05d");
	this.bindEvents();
	this.dragging = false;
	this.dblclick= false;
}

Editor.prototype = {
	get pointStroke(){
		return this._pointStroke;
	},
	set pointStroke(val){
		this._pointStroke = val;
		this.triggerUpdate();
	},

	get pointFill(){
		return this._pointFill;
	},
	set pointFill(val){
		this._pointFill = val;
		this.triggerUpdate();
	}
}

Editor.prototype.bindEvents = function(){
	$(this.pointer).mouseup($.proxy(this.mouseupHandler, this));
	$(this.pointer).mousedown($.proxy(this.mousedownHandler, this));
	$(this.pointer).dblclick($.proxy(this.dblclickHandler, this));
}

Editor.prototype.triggerUpdate = function(){
	$(this).trigger('prop-update', undefined);
}

Editor.prototype.mouseupHandler = function(ev){
	this.dragging = false;
}

Editor.prototype.mousedownHandler = function(ev){
	this.dragging = true;

	setTimeout($.proxy(function() {
		if (this.dragging == false && this.dblclick == false){
			if(this.currentZone == null){
				this.currentZone = new EditZone(this.battlemap, this);
			}

			var zone = this.currentZone;
			var startPos = null;
			if (this.currentZone.points.length > 0){
				var startPos = this.currentZone.points[0].position;
			}
			var currentPos = this.pointer.position;

			this.currentZone.addPoint(currentPos.x, currentPos.y);
			if (startPos != null && startPos.x == currentPos.x &&
				startPos.y == currentPos.y) {
				// Clicking on the first point closes the zone.
				this.currentZone.finishZone();
			}
		} else {
			this.dblclick = false;
		}
	}, this), 200);
}

Editor.prototype.dblclickHandler = function(ev){
	console.log("dblclick");
	this.dblclick = true;

	// Doubleclicking finished the zone with a moveTo.
	this.currentZone.addPoint(this.pointer.position.x, this.pointer.position.y);
	this.currentZone.finishZone(true);
}

/******************************************************************************
Class EditZone

A class for managing the editor.
******************************************************************************/
function EditZone(battlemap, editor){
	this.battlemap = battlemap;
	this.editor = editor;
	this.points = new Array();
	this.zone = new CombatZone(this.battlemap, {path: "Mz"});
	this.finishPrefix = "L";
}

EditZone.prototype.p2s = function(x, y){
	return "" + x + "," + y;
}

EditZone.prototype.addPoint = function(x, y){
	var point = new Point(this.battlemap, x, y);
	this.points.push(point);

	this.updateZone();

	return point;
}

EditZone.prototype.getPoint = function(x, y){
	var found = null;
	$(this.points).each(function(index, point) {
		if (point != null && point.position.x == x && point.position.y == y){
			found = point;
			return false;
		}
	});

	console.log(found);
	return found;
}

EditZone.prototype.updateZone = function(){
	var pathArray = new Array();
	var totalPoints = this.points.length;
	var finishPrefix = this.finishPrefix;
	$(this.points).each(function(index, point){
		if (index == 0)
		{
			// We're the starting point.
			pathArray.push("M" + point.position.x + "," + point.position.y);
		} else if (index == totalPoints - 1){
			// We're the last point.
			pathArray.push(finishPrefix + point.position.x + "," + point.position.y);
		} else {
			pathArray.push("L" + point.position.x + "," + point.position.y);
		}
	});

	console.log(pathArray.join(" ") + " z");

	this.zone.setPath("M " + pathArray.join(" ") + " z")
}

EditZone.prototype.finishZone = function(moveTo){
	if (typeof moveTo !== 'undefined'){
		// Change this.finishPrefix from L (default) to M.
		this.finishPrefix = "M";
		console.log("moveTo!");
	}

	// Finish the path with a line/moveto back to the starting point.
	var point = new Point(this.battlemap, this.points[0].position.x, this.points[0].position.y);
	this.points.push(point);

	this.updateZone();

	// We're done with this zone, so inform the editor we've gone away now.
	this.editor.currentZone = null;
}

/******************************************************************************
Class Pointer

A simple class the represents the svg element acting as our pointer on the
battlemap grid.

Events
* mouseup - The mouseup event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousedown - The mousedown event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousemove - The mousemove event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

Properties
* transform :: string() - The transform string used by the internal svg element.

* position :: {x, y, rawX, rawY} - Represents the position of the pointer. The
			x,y properties are in cell coordinates, while rawX,rawY are in page
			coordinates.

* offset :: {x, y} - Object with x and y parameters. Represents the offset from
			page coordinates.

 * svgElement :: Object() - The underlying svg element
******************************************************************************/
function Pointer(battlemap, size, fill, stroke) {
	this.battlemap = battlemap;
	this.position = {x: 0, y: 0, rawX: 0, rawY: 0};

	// Set offset
	var offset_ = $(this.battlemap.actionElem).offset();
	this.offset = {x: offset_.left, y: offset_.top};

	// Build svg element
	//this.svgElement = this.battlemap.toolPaper.circle(0, 0, size);
	this.svgElement = this.battlemap.svgPaper.circle(0, 0, size);

	if (typeof fill !== 'undefined'){
		this.svgElement.attr("fill", fill);
	}

	if (typeof stroke !== 'undefined'){
		this.svgElement.attr("stroke", stroke);
	}

	this.bindEvents();
}

Pointer.prototype = {
	get transform(){
		return this._transform
	},

	set transform(val){
		var trans = Raphael.parseTransformString(val);
		this.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
	}
}

Pointer.prototype.bindEvents = function(){
	$(this.battlemap.actionElem).mouseup($.proxy(this.mouseupHandler, this));
	$(this.battlemap.actionElem).mousedown($.proxy(this.mousedownHandler, this));
	$(this.battlemap.actionElem).dblclick($.proxy(this.dblclickHandler, this));
	$(this.battlemap.actionElem).mousemove($.proxy(this.mousemoveHandler, this));
	$(this.battlemap).bind("viewChanged", $.proxy(this.mousemoveHandler, this));
}

Pointer.prototype.mouseupHandler = function(ev){
	$(this).trigger('mouseup', ev);
}

Pointer.prototype.mousedownHandler = function(ev){
	$(this).trigger('mousedown', ev);
}

Pointer.prototype.dblclickHandler = function(ev){
	$(this).trigger('dblclick', ev);
}

Pointer.prototype.mousemoveHandler = function(ev){
	if (typeof ev.pageX == 'undefined'){
		ev.pageX = this.position.rawX;
	}
	if (typeof ev.pageY == 'undefined'){
		ev.pageY = this.position.rawY;
	}

	// handle our special logic
	this.position.rawX = ev.pageX;
	this.position.rawY = ev.pageY;
	var cell = this.battlemap.getNearestCell(ev.pageX - this.offset.x, ev.pageY - this.offset.y);
	this.position.x = cell[0];
	this.position.y = cell[1];
	this.transform = this.battlemap.getTransformString(cell[0], cell[1]);

	// trigger our mousemove event
	$(this).trigger('mousemove', ev);
}

/******************************************************************************
Class Point

A simple class the represents a user-interactable point on the grid.

Events
* mouseup - The mouseup event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousedown - The mousedown event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

* mousemove - The mousemove event from the battlemap canvas. This is for your
			convienence; it allows you to treat the pointer object as the
			object recieving click events.

Properties
* position :: {x, y, rawX, rawY} - Represents the position of the pointer. The
			x,y properties are in cell coordinates, while rawX,rawY are in page
			coordinates.

 * svgElement :: Object() - The underlying svg element
******************************************************************************/
function Point(battlemap, posX, posY, size, fill, stroke) {
	this.battlemap = battlemap;
	this._position = {x: 0, y:0};

	// Build svg element
	if (typeof size == 'undefined'){
		size = 3;
	}
	this.size = size;
	//this.svgElement = this.battlemap.toolPaper.circle(0, 0, size);
	this.svgElement = this.battlemap.svgPaper.circle(0, 0, size);

	if (typeof fill == 'undefined'){
		fill = "#777";
	}
	this.fillColor = fill;

	if (typeof stroke == 'undefined'){
		stroke = "#777";
	}
	this.strokeColor = stroke;

	if ((typeof posX !== 'undefined') && (typeof posY !== 'undefined')){
		this.position = {x: posX, y: posY};
	}

	$(this.battlemap).bind("viewChanged", {context: this}, this.moveHandler);
}

Point.prototype = {
	get position(){
		return this._position;
	},
	set position(val){
		this._position.x = val.x;
		this._position.y = val.y;

		var trans = Raphael.parseTransformString(this.battlemap.getTransformString(val.x, val.y));
		this.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
	},

	get size(){
		return this._size;
	},
	set size(val){
		if (typeof val !== 'undefined'){
			//TODO: Update the size of the SVG Element
			this._size = val;
		}
	},

	get strokeColor(){
		return this._strokeColor;
	},
	set strokeColor(val){
		if (typeof val !== 'undefined'){
			this._strokeColor = val;
			this.svgElement.attr("stroke", val);
		}
	},

	get fillColor(){
		return this._fillColor;
	},
	set fillColor(val){
		if (typeof val !== 'undefined'){
			this._fillColor = val;
			this.svgElement.attr("fill", val);
		}
	}
}

Point.prototype.moveHandler = function(ev){
	var context = ev.data.context;
	var trans = Raphael.parseTransformString(context.battlemap.getTransformString(context.position.x, context.position.y));
	context.svgElement.transform("T" + trans[1][1] + "," + trans[1][2]);
}

// ----------------------------------------------------------------------------

$().ready(function(){
	addColorPicker('.grid', 'grid_color');
	addColorPicker('.map', 'map_color');

	// Grid Line Color editor
	$('#grid_color').val(rgb2Hex(battleMap.gridlineColor));
	$('#grid_alpha').val(getAlphaFromRGBA(battleMap.gridlineColor));
	$('#grid_color').change(function(){
		var color = color2Hex($('#grid_color').val());
		var alpha = $('#grid_alpha').val();
		battleMap.gridlineColor = hex2rgb(color, alpha);
		battleMap.drawGrid();
	});
	$('#grid_color').blur(function(){
		var color = color2Hex($('#grid_color').val());
		var alpha = $('#grid_alpha').val();
		battleMap.gridlineColor = hex2rgb(color, alpha);
		battleMap.drawGrid();
	});
	$('#grid_alpha').change(function(){
		$('#grid_color').change();
	});
	$('#grid_alpha').bind('input', function(){
		$('#grid_color').change();
	});
	$('#grid_color').change();

	// Background Color editor
	$('#map_color').val(rgb2Hex(battleMap.backgroundColor));
	$('#map_color').change(function(){
		var color = color2Hex($('#map_color').val());
		battleMap.backgroundColor = color;
	});
	$('#map_color').blur(function(){
		var color = color2Hex($('#map_color').val());
		battleMap.backgroundColor = color;
	});
	$('#map_color').change();

	// Create an editor
	window.editor = new Editor(battleMap);
});

<|endoftext|>


<commit_before>Package.describe({
    name: "ajduke:bootstrap-tokenfield",
    summary: "A jQuery tag/token input plugin for Twitter's Bootstrap, repackaged for Meteor.",
    version: "0.2.0",
    git: " https://github.com/ajduke/meteor-bootstrap-tokenfield.git"
});

Package.on_use(function (api) {
    api.use('ian:bootstrap-3@1.0.3', 'client');

    api.add_files('lib/bootstrap-tokenfield/dist/bootstrap-tokenfield.min.js', 'client');
    api.add_files('lib/bootstrap-tokenfield/dist/css/tokenfield-typeahead.min.css', 'client');
    api.add_files('lib/bootstrap-tokenfield/dist/css/bootstrap-tokenfield.min.css', 'client');
});

<commit_msg>version bumped<commit_after>Package.describe({
    name: "ajduke:bootstrap-tokenfield",
    summary: "A jQuery tag/token input plugin for Twitter's Bootstrap, repackaged for Meteor.",
    version: "0.3.0",
    git: " https://github.com/ajduke/meteor-bootstrap-tokenfield.git"
});

Package.on_use(function (api) {
    api.use('ian:bootstrap-3@1.0.3', 'client');

    api.add_files('lib/bootstrap-tokenfield/dist/bootstrap-tokenfield.min.js', 'client');
    api.add_files('lib/bootstrap-tokenfield/dist/css/tokenfield-typeahead.min.css', 'client');
    api.add_files('lib/bootstrap-tokenfield/dist/css/bootstrap-tokenfield.min.css', 'client');
});

<|endoftext|>


<commit_before>import BzBoardClient from '../lib/BzBoardClient'
import Immutable from 'immutable';
import { combineReducers } from 'redux';
import {
  BUGS_UPDATE, FILTER_CREATE,
  FILTER_UPDATE, FILTER_REMOVE,
  LABEL_BUG
} from '../actions';

/* State Structure:
{
  bugs: Map({
    1: {
      id: 1,
      ...
      label: labelName, // Mutable
      filters: [1, 2]
    }
  }),
  filters: Map({
    1: {
      id: 1,
      ...
    }
  })
}
*/

function bugFromJson (hash, action) {
  // TODO: no need to keep the whole bug object, it's really huge
  let bug = Object.assign({}, hash);
  bug.filters = new Set([action.filter.uid]);
  let label = /\[(fxsync)\]/.exec(hash.whiteboard);
  bug.label = label ? label[1] : null;
  return bug;
}

function bugs (state = Immutable.Map(), action) {
  switch (action.type) {
  case FILTER_UPDATE:
  case FILTER_REMOVE:
    return Immutable.Map(state.reduce((obj, bug) => {
      bug.filters.remove(action.filter.uid);
      if(bug.filters.size > 0) {
        obj[bug.id] = bug;
      }
      return obj;
    }, {}));
  case BUGS_UPDATE:
    return state.mergeWith((a, b) => {
      a.filters = new Set([...a.filters, ...b.filters]);
      return a;
    }, Immutable.Map(action.bugs.reduce((obj, bug) => {
        bug = bugFromJson(bug, action);
        obj[bug.id] = bug;
        return obj;
    }, {})));
  case LABEL_BUG:
    state.get(action.bugId).label = action.newLabel;
  default:
    return state;
  }
}

function filters (state = Immutable.Map(), action) {
  switch (action.type) {
  case FILTER_CREATE:
    BzBoardClient.addFilter(action.filter);
    return state.set(action.filter.uid, action.filter);
  case FILTER_UPDATE:
    BzBoardClient.updateFilter(action.filter);
    return state.set(action.filter.uid, action.filter);
  case FILTER_REMOVE:
    BzBoardClient.removeFilter(action.filter.uid);
    return state.delete(action.filter.uid);
  default:
    return state;
  }
}

const rootReducer = combineReducers({
  filters,
  bugs
});

export default rootReducer;
<commit_msg>Fixed delete column<commit_after>import BzBoardClient from '../lib/BzBoardClient'
import Immutable from 'immutable';
import { combineReducers } from 'redux';
import {
  BUGS_UPDATE, FILTER_CREATE,
  FILTER_UPDATE, FILTER_REMOVE,
  LABEL_BUG
} from '../actions';

/* State Structure:
{
  bugs: Map({
    1: {
      id: 1,
      ...
      label: labelName, // Mutable
      filters: [1, 2]
    }
  }),
  filters: Map({
    1: {
      id: 1,
      ...
    }
  })
}
*/

function bugFromJson (hash, action) {
  // TODO: no need to keep the whole bug object, it's really huge
  let bug = Object.assign({}, hash);
  bug.filters = new Set([action.filter.uid]);
  let label = /\[(fxsync)\]/.exec(hash.whiteboard);
  bug.label = label ? label[1] : null;
  return bug;
}

function bugs (state = Immutable.Map(), action) {
  switch (action.type) {
  case FILTER_UPDATE:
  case FILTER_REMOVE:
    return Immutable.Map(state.reduce((obj, bug) => {
      bug.filters.remove(action.filter.uid);
      if(bug.filters.size > 0) {
        obj[bug.id] = bug;
      }
      return obj;
    }, {}));
  case BUGS_UPDATE:
    return state.mergeWith((a, b) => {
      a.filters = new Set([...a.filters, ...b.filters]);
      return a;
    }, Immutable.Map(action.bugs.reduce((obj, bug) => {
        bug = bugFromJson(bug, action);
        obj[bug.id] = bug;
        return obj;
    }, {})));
  case LABEL_BUG:
    state.get(action.bugId).label = action.newLabel;
  default:
    return state;
  }
}

function filters (state = Immutable.Map(), action) {
  switch (action.type) {
  case FILTER_CREATE:
    BzBoardClient.addFilter(action.filter);
    return state.set(action.filter.uid, action.filter);
  case FILTER_UPDATE:
    BzBoardClient.updateFilter(action.filter);
    return state.set(action.filter.uid, action.filter);
  case FILTER_REMOVE:
    BzBoardClient.removeFilter(action.uid);
    return state.delete(action.uid);
  default:
    return state;
  }
}

const rootReducer = combineReducers({
  filters,
  bugs
});

export default rootReducer;
<|endoftext|>


<commit_before>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-behaviours',
  name: 'zimme:collection-behaviours',
  summary: 'Define and attach behaviours for collections',
  version: '0.1.6-rc.0'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'mongo',
    'underscore'
  ]);

  api.use('matb33:collection-hooks@0.7.6');

  api.use([
    'aldeed:autoform@2.0.0 || 3.0.0 || 4.0.0-rc10',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.addFiles([
    'collection-behaviour.coffee',
    'mongo.coffee'
  ]);

  api.addFiles([
    'behaviours/timestampable.coffee',
    'behaviours/softremovable.coffee'
  ]);

  api.export('CollectionBehaviours');
});
<commit_msg>Version bump<commit_after>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-behaviours',
  name: 'zimme:collection-behaviours',
  summary: 'Define and attach behaviours for collections',
  version: '0.1.6-rc.1'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'mongo',
    'underscore'
  ]);

  api.use('matb33:collection-hooks@0.7.6');

  api.use([
    'aldeed:autoform@2.0.0 || 3.0.0 || 4.0.0-rc10',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.addFiles([
    'collection-behaviour.coffee',
    'mongo.coffee'
  ]);

  api.addFiles([
    'behaviours/timestampable.coffee',
    'behaviours/softremovable.coffee'
  ]);

  api.export('CollectionBehaviours');
});
<|endoftext|>


<commit_before>Package.describe({
    name: "socialize:base-model",
    summary: "A model for all other models to inherit from ",
    version: "0.2.0",
});

Package.onUse(function(api) {
    api.versionsFrom("1.0.2.1");

    api.use(["meteor", "mongo", "underscore"]);

    api.use([
        "socialize:server-time@0.1.1", "tmeasday:publish-with-relations@0.2.0", "aldeed:simple-schema@1.3.2",
        "aldeed:collection2@2.3.3", "matb33:collection-hooks@0.7.13", "meteorhacks:unblock@1.1.0"
    ]);

    api.imply(["meteor", "mongo", "underscore"]);

    api.imply([
        "tmeasday:publish-with-relations@0.2.0", "aldeed:simple-schema@1.3.2",
        "aldeed:collection2@2.3.3", "matb33:collection-hooks@0.7.13", "meteorhacks:unblock@1.1.0"
    ]);

    api.addFiles(["base-model.js", "security.js"]);

    api.export("BaseModel");
});

<commit_msg>bump version<commit_after>Package.describe({
    name: "socialize:base-model",
    summary: "A model for all other models to inherit from ",
    version: "0.2.1",
});

Package.onUse(function(api) {
    api.versionsFrom("1.0.2.1");

    api.use(["meteor", "mongo", "underscore"]);

    api.use([
        "socialize:server-time@0.1.1", "tmeasday:publish-with-relations@0.2.0", "aldeed:simple-schema@1.3.2",
        "aldeed:collection2@2.3.3", "matb33:collection-hooks@0.7.13", "meteorhacks:unblock@1.1.0"
    ]);

    api.imply(["meteor", "mongo", "underscore"]);

    api.imply([
        "tmeasday:publish-with-relations@0.2.0", "aldeed:simple-schema@1.3.2",
        "aldeed:collection2@2.3.3", "matb33:collection-hooks@0.7.13", "meteorhacks:unblock@1.1.0"
    ]);

    api.addFiles(["base-model.js", "security.js"]);

    api.export("BaseModel");
});

<|endoftext|>


<commit_before>ContactManager.Views.Contacts = Backbone.View.extend({
  template: _.template($('#tpl-contacts').html()),

  render: function() {
    var html = this.template();
    this.$el.html(html);
    return this;
  }
});
<commit_msg>Render all contacts in contacts view<commit_after>ContactManager.Views.Contacts = Backbone.View.extend({
  template: _.template($('#tpl-contacts').html()),

  renderOne: function(contact) {
    var itemView = new ContactManager.Views.Contact({model: contact});
    this.$('.contacts-container').append(itemView.render().$el);
  },

  render: function() {
    var html = this.template();
    this.$el.html(html);

    this.collection.each(this.renderOne, this);

    return this;
  }
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'constellation:theme-opaque',
  version: '0.4.6',
  summary: 'Opaque theme plugin for Constellation',
  git: 'https://github.com/JackAdams/constellation-theme-opaque.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use('constellation:console@1.4.6', 'client');

  api.addFiles('theme-opaque.css','client');
  api.addFiles('theme-opaque.js','client');

  api.imply('constellation:console');
});

Package.onTest(function(api) {
  api.use('tinytest');
});
<commit_msg>Updated dependencies<commit_after>Package.describe({
  name: 'constellation:theme-opaque',
  version: '0.4.7',
  summary: 'Opaque theme plugin for Constellation',
  git: 'https://github.com/JackAdams/constellation-theme-opaque.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use('constellation:console@1.4.7', 'client');

  api.addFiles('theme-opaque.css','client');
  api.addFiles('theme-opaque.js','client');

  api.imply('constellation:console');
});

Package.onTest(function(api) {
  api.use('tinytest');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Controller class for dynamic layouts.',
  version: '1.0.0-pre3',
  git: 'https://github.com/eventedmind/iron-controller.git'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  api.use('underscore');

  // reactivity
  api.use('tracker');

  // reactive state variables
  api.use('reactive-dict');

  api.use('templating');

  api.use('iron:core@1.0.0-pre3');
  api.imply('iron:core');

  api.use('iron:layout@1.0.0-pre3');
  api.use('iron:dynamic-template@1.0.0-pre3');

  api.add_files('lib/wait_list.js', 'client');
  api.add_files('lib/controller.js');
  api.add_files('lib/controller_server.js', 'server');
  api.add_files('lib/controller_client.js', 'client');
});

Package.on_test(function (api) {
  api.use('iron:controller');
  api.use('iron:layout');
  api.use('tinytest');
  api.use('test-helpers');
  api.use('tracker');
  api.use('templating');

  api.add_files('test/controller_test.html', 'client');
  api.add_files('test/wait_list_test.js', 'client');
  api.add_files('test/controller_test.js', 'client');
});
<commit_msg>bump version to 1.0.0-pre4<commit_after>Package.describe({
  summary: 'Controller class for dynamic layouts.',
  version: '1.0.0-pre4',
  git: 'https://github.com/eventedmind/iron-controller.git'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  api.use('underscore');

  // reactivity
  api.use('tracker');

  // reactive state variables
  api.use('reactive-dict');

  api.use('templating');

  api.use('iron:core@1.0.0-pre4');
  api.imply('iron:core');

  api.use('iron:layout@1.0.0-pre4');
  api.use('iron:dynamic-template@1.0.0-pre4');

  api.add_files('lib/wait_list.js', 'client');
  api.add_files('lib/controller.js');
  api.add_files('lib/controller_server.js', 'server');
  api.add_files('lib/controller_client.js', 'client');
});

Package.on_test(function (api) {
  api.use('iron:controller');
  api.use('iron:layout');
  api.use('tinytest');
  api.use('test-helpers');
  api.use('tracker');
  api.use('templating');

  api.add_files('test/controller_test.html', 'client');
  api.add_files('test/wait_list_test.js', 'client');
  api.add_files('test/controller_test.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Model layer for Meteor',
  version: '0.11.0',
  name: 'jagi:astronomy',
  git: 'https://github.com/jagi/meteor-astronomy.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use('mongo');
  api.use('minimongo');
  api.use('underscore');
  api.use('ejson');

  api.addFiles('lib/core/global.js', ['client', 'server']);
  api.addFiles('lib/core/config.js', ['client', 'server']);
  api.addFiles('lib/core/utils.js', ['client', 'server']);
  api.addFiles('lib/core/events.js', ['client', 'server']);
  api.addFiles('lib/core/event.js', ['client', 'server']);
  api.addFiles('lib/core/base_class.js', ['client', 'server']);
  api.addFiles('lib/core/schema.js', ['client', 'server']);
  api.addFiles('lib/core/module.js', ['client', 'server']);
  api.addFiles('lib/core/constructor.js', ['client', 'server']);
  api.addFiles('lib/core/class.js', ['client', 'server']);

  // Events module.
  api.addFiles('lib/modules/events/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/events/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/events/module.js', ['client', 'server']);

  // Types module.
  api.addFiles('lib/modules/types/global.js', ['client', 'server']);
  api.addFiles('lib/modules/types/utils.js', ['client', 'server']);
  api.addFiles('lib/modules/types/type.js', ['client', 'server']);
  api.addFiles('lib/modules/types/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/types/module.js', ['client', 'server']);

  // Indexes module.
  api.addFiles('lib/modules/indexes/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/indexes/module.js', ['client', 'server']);

  // Fields module.
  api.addFiles('lib/modules/fields/utils.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/module.js', ['client', 'server']);

  // Methods module.
  api.addFiles('lib/modules/methods/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/methods/module.js', ['client', 'server']);

  // EJSON module.
  api.addFiles('lib/modules/ejson/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/ejson/module.js', ['client', 'server']);

  api.export(['Astro', 'Astronomy'], ['client', 'server']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('jagi:astronomy@0.10.5');

  api.addFiles('test/ejson.js', ['client', 'server']);
  api.addFiles('test/events.js', ['client', 'server']);
  api.addFiles('test/fields.js', ['client', 'server']);
  api.addFiles('test/methods.js', ['client', 'server']);
  api.addFiles('test/types.js', ['client', 'server']);
});
<commit_msg>v0.12.0<commit_after>Package.describe({
  summary: 'Model layer for Meteor',
  version: '0.12.0',
  name: 'jagi:astronomy',
  git: 'https://github.com/jagi/meteor-astronomy.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use('mongo');
  api.use('minimongo');
  api.use('underscore');
  api.use('ejson');

  api.addFiles('lib/core/global.js', ['client', 'server']);
  api.addFiles('lib/core/config.js', ['client', 'server']);
  api.addFiles('lib/core/utils.js', ['client', 'server']);
  api.addFiles('lib/core/events.js', ['client', 'server']);
  api.addFiles('lib/core/event.js', ['client', 'server']);
  api.addFiles('lib/core/base_class.js', ['client', 'server']);
  api.addFiles('lib/core/schema.js', ['client', 'server']);
  api.addFiles('lib/core/module.js', ['client', 'server']);
  api.addFiles('lib/core/constructor.js', ['client', 'server']);
  api.addFiles('lib/core/class.js', ['client', 'server']);

  // Events module.
  api.addFiles('lib/modules/events/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/events/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/events/module.js', ['client', 'server']);

  // Types module.
  api.addFiles('lib/modules/types/global.js', ['client', 'server']);
  api.addFiles('lib/modules/types/utils.js', ['client', 'server']);
  api.addFiles('lib/modules/types/type.js', ['client', 'server']);
  api.addFiles('lib/modules/types/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/types/module.js', ['client', 'server']);

  // Indexes module.
  api.addFiles('lib/modules/indexes/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/indexes/module.js', ['client', 'server']);

  // Fields module.
  api.addFiles('lib/modules/fields/utils.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/fields/module.js', ['client', 'server']);

  // Methods module.
  api.addFiles('lib/modules/methods/init_class.js', ['client', 'server']);
  api.addFiles('lib/modules/methods/module.js', ['client', 'server']);

  // EJSON module.
  api.addFiles('lib/modules/ejson/init_module.js', ['client', 'server']);
  api.addFiles('lib/modules/ejson/module.js', ['client', 'server']);

  api.export(['Astro', 'Astronomy'], ['client', 'server']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('jagi:astronomy@0.10.5');

  api.addFiles('test/ejson.js', ['client', 'server']);
  api.addFiles('test/events.js', ['client', 'server']);
  api.addFiles('test/fields.js', ['client', 'server']);
  api.addFiles('test/methods.js', ['client', 'server']);
  api.addFiles('test/types.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
	summary: "A Simplified HTTP client (forked for platform independence)",
	version: "2.51.0",
	git: "https://github.com/froatsnook/meteor-request.git",
	name: "froatsnook:request"
});

Npm.depends({
	"request": "2.51.0"
})

Package.onUse(function(api) {
	api.versionsFrom('METEOR@0.9.0.1');
	api.use('underscore','server');
	api.addFiles('server/lib/meteor-request.js','server');
	api.export('request','server');
});

Package.onTest(function(api) {
    api.use("tinytest");
    api.use("froatsnook:request");

    api.addFiles("test/request-tests.js");
});
<commit_msg>Bump version to 2.51.1.<commit_after>Package.describe({
	summary: "A Simplified HTTP client (forked for platform independence)",
	version: "2.51.1",
	git: "https://github.com/froatsnook/meteor-request.git",
	name: "froatsnook:request"
});

Npm.depends({
	"request": "2.51.0"
})

Package.onUse(function(api) {
	api.versionsFrom('METEOR@0.9.0.1');
	api.use('underscore','server');
	api.addFiles('server/lib/meteor-request.js','server');
	api.export('request','server');
});

Package.onTest(function(api) {
    api.use("tinytest");
    api.use("froatsnook:request");

    api.addFiles("test/request-tests.js");
});
<|endoftext|>


<commit_before>import Axios from 'axios';
const axios = Axios.create({ timeout: 30000 });
import buildURL from 'axios/lib/helpers/buildURL.js';
import combineURLs from 'axios/lib/helpers/combineURLs.js';
import axiosRetry from 'axios-retry';
import LS from 'lib/wallet/localStorage';
import { showError } from 'widgets/modals/flash';
import { translate } from 'lib/i18n';
import { eddsa } from 'elliptic';
const ec = new eddsa('ed25519');
import crypto from 'crypto';
import seeds from 'lib/wallet/seeds';

axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay, shouldResetTimeout: true });

const URLS = [
  process.env.SITE_URL,
  process.env.API_BTC_URL,
  process.env.API_BCH_URL,
  process.env.API_BSV_URL,
  process.env.API_LTC_URL,
  process.env.API_ETH_URL,
  process.env.API_XRP_URL,
  process.env.API_XLM_URL,
  process.env.API_EOS_URL,
  process.env.API_DOGE_URL,
  process.env.API_DASH_URL,
  process.env.API_XMR_URL,
  process.env.API_BSC_URL,
  process.env.API_ADA_URL,
  process.env.API_ETC_URL,
  process.env.API_SOL_URL,
  process.env.API_AVAX_URL,
  process.env.API_TRX_URL,
];

axios.interceptors.request.use((config) => {
  if (config.intercepted === true) {
    return config;
  }
  if (config.baseURL) {
    config.url = combineURLs(config.baseURL, config.url);
    delete config.baseURL;
  }
  if (!URLS.some((item) => config.url.startsWith(item))) {
    config.intercepted = true;
    return config;
  }
  if (!config.method) {
    config.method = 'get';
  }

  if ((config.seed && config.id !== false) || config.id === true) {
    // object spread not supported
    config.params = Object.assign({
      id: LS.getId(),
    }, config.params);
  }

  if (config.params) {
    config.url = buildURL(config.url, config.params);
    delete config.params;
  }

  const date = (new Date()).toUTCString();
  config.headers = config.headers || {};
  config.headers['X-Release'] = process.env.RELEASE;
  config.headers['X-Date'] = date;

  if (config.seed) {
    const secret = seeds.get(config.seed);
    const privateKey = ec.keyFromSecret(secret);

    const body = config.data && JSON.stringify(config.data);
    const base = [
      config.method,
      config.url,
      date,
      process.env.RELEASE,
    ];
    if (config.method !== 'get' && body) {
      base.push(crypto.createHash('sha256').update(body).digest().toString('hex'));
    }
    const signature = privateKey.sign(Buffer.from(base.join(' '))).toHex();
    config.headers['Signature'] = signature;
  }

  config.intercepted = true;
  return config;
});

function request(config = {}) {
  return axios.request(config)
    .then((response) => {
      return response.data;
    })
    .catch((err) => {
      // TODO handle 401
      if (config.disableDefaultCatch) {
        throw err;
      }
      if (err.response) {
        const error = new Error(err.response.data.error || err.response.data.message || err.response.data);
        error.status = err.response.status;
        error.url = err.config.url;
        error.method = err.config.method;
        throw error;
      } else if (err.request) {
        if (!config.hideFlashError) {
          showError({ message: translate('Request timeout. Please check your internet connection.') });
        }
        throw err;
      } else {
        throw err;
      }
    });
}

export default request;
<commit_msg>fix(app): undefined response data<commit_after>import Axios from 'axios';
const axios = Axios.create({ timeout: 30000 });
import buildURL from 'axios/lib/helpers/buildURL.js';
import combineURLs from 'axios/lib/helpers/combineURLs.js';
import axiosRetry from 'axios-retry';
import LS from 'lib/wallet/localStorage';
import { showError } from 'widgets/modals/flash';
import { translate } from 'lib/i18n';
import { eddsa } from 'elliptic';
const ec = new eddsa('ed25519');
import crypto from 'crypto';
import seeds from 'lib/wallet/seeds';

axiosRetry(axios, { retries: 3, retryDelay: axiosRetry.exponentialDelay, shouldResetTimeout: true });

const URLS = [
  process.env.SITE_URL,
  process.env.API_BTC_URL,
  process.env.API_BCH_URL,
  process.env.API_BSV_URL,
  process.env.API_LTC_URL,
  process.env.API_ETH_URL,
  process.env.API_XRP_URL,
  process.env.API_XLM_URL,
  process.env.API_EOS_URL,
  process.env.API_DOGE_URL,
  process.env.API_DASH_URL,
  process.env.API_XMR_URL,
  process.env.API_BSC_URL,
  process.env.API_ADA_URL,
  process.env.API_ETC_URL,
  process.env.API_SOL_URL,
  process.env.API_AVAX_URL,
  process.env.API_TRX_URL,
];

axios.interceptors.request.use((config) => {
  if (config.intercepted === true) {
    return config;
  }
  if (config.baseURL) {
    config.url = combineURLs(config.baseURL, config.url);
    delete config.baseURL;
  }
  if (!URLS.some((item) => config.url.startsWith(item))) {
    config.intercepted = true;
    return config;
  }
  if (!config.method) {
    config.method = 'get';
  }

  if ((config.seed && config.id !== false) || config.id === true) {
    // object spread not supported
    config.params = Object.assign({
      id: LS.getId(),
    }, config.params);
  }

  if (config.params) {
    config.url = buildURL(config.url, config.params);
    delete config.params;
  }

  const date = (new Date()).toUTCString();
  config.headers = config.headers || {};
  config.headers['X-Release'] = process.env.RELEASE;
  config.headers['X-Date'] = date;

  if (config.seed) {
    const secret = seeds.get(config.seed);
    const privateKey = ec.keyFromSecret(secret);

    const body = config.data && JSON.stringify(config.data);
    const base = [
      config.method,
      config.url,
      date,
      process.env.RELEASE,
    ];
    if (config.method !== 'get' && body) {
      base.push(crypto.createHash('sha256').update(body).digest().toString('hex'));
    }
    const signature = privateKey.sign(Buffer.from(base.join(' '))).toHex();
    config.headers['Signature'] = signature;
  }

  config.intercepted = true;
  return config;
});

function request(config = {}) {
  return axios.request(config)
    .then((response) => {
      return response.data;
    })
    .catch((err) => {
      // TODO handle 401
      if (config.disableDefaultCatch) {
        throw err;
      }
      if (err.response) {
        const error = err.response.data
          ? new Error(err.response.data.error || err.response.data.message || err.response.data)
          : new Error('Network Error');
        error.status = err.response.status;
        error.url = err.config.url;
        error.method = err.config.method;
        throw error;
      } else if (err.request) {
        if (!config.hideFlashError) {
          showError({ message: translate('Request timeout. Please check your internet connection.') });
        }
        throw err;
      } else {
        throw err;
      }
    });
}

export default request;
<|endoftext|>


<commit_before>Package.describe({
	name:"lepozepo:cloudinary",
	summary: "Upload files to Cloudinary",
	version:"3.0.2",
	git:"https://github.com/Lepozepo/cloudinary"
});

Npm.depends({
	cloudinary: "1.0.8",
	"stream-buffers":"0.2.5"
});

Package.on_use(function (api){
	//Need service-configuration to use Meteor.method
	api.use(["underscore@1.0.0", "ejson@1.0.0","service-configuration@1.0.0","lepozepo:streams@0.2.0"], ["client", "server"]);

	api.use(["matb33:collection-hooks@0.7.3"], ["client", "server"],{weak:true});

	api.use(["ui@1.0.0","templating@1.0.0","spacebars@1.0.0"], "client");

	//Image manipulation
	api.add_files("lib/cloudinary.standalone.js","client");

	api.add_files("client/blocks.html", "client");
	api.add_files("client/helpers.js", "client");
	api.add_files("client/controllers.js","client");
	api.add_files("client/collections.js", "client");
	api.add_files("client/functions.js", "client");
	api.add_files("server.js", "server");

	//Allow user access to Cloudinary server-side
	api.export && api.export("Cloudinary","server");
	api.export && api.export("_cloudinary","client");
	api.export && api.export("C","client");
});
<commit_msg>Version bump<commit_after>Package.describe({
	name:"lepozepo:cloudinary",
	summary: "Upload files to Cloudinary",
	version:"3.0.3",
	git:"https://github.com/Lepozepo/cloudinary"
});

Npm.depends({
	cloudinary: "1.0.8",
	"stream-buffers":"0.2.5"
});

Package.on_use(function (api){
	//Need service-configuration to use Meteor.method
	api.use(["underscore@1.0.0", "ejson@1.0.0","service-configuration@1.0.0","lepozepo:streams@0.2.0"], ["client", "server"]);

	api.use(["matb33:collection-hooks@0.7.3"], ["client", "server"],{weak:true});

	api.use(["ui@1.0.0","templating@1.0.0","spacebars@1.0.0"], "client");

	//Image manipulation
	api.add_files("lib/cloudinary.standalone.js","client");

	api.add_files("client/blocks.html", "client");
	api.add_files("client/helpers.js", "client");
	api.add_files("client/controllers.js","client");
	api.add_files("client/collections.js", "client");
	api.add_files("client/functions.js", "client");
	api.add_files("server.js", "server");

	//Allow user access to Cloudinary server-side
	api.export && api.export("Cloudinary","server");
	api.export && api.export("_cloudinary","client");
	api.export && api.export("C","client");
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "Mongoid inspired model architecture",
  version: "0.9.5",
  git: "https://github.com/Exygy/minimongoid.git"
});

Package.on_use(function (api) {
  api.versionsFrom("METEOR@0.9.0");
  var both = ['client', 'server'];
  api.use(['underscore', "mrt:underscore-string-latest@2.3.3", 'coffeescript'], both);
  files = [
    'lib/relation.coffee',
    'lib/has_many_relation.coffee',
    'lib/has_and_belongs_to_many_relation.coffee',
    'lib/minimongoid.coffee'
  ];
  api.add_files(files, both);
});

Package.on_test(function (api) {
  var both = ['client', 'server'];
  api.use(["kaptron:minimongoid", 'tinytest', 'coffeescript'], both);
  api.add_files('tests/models.coffee', both);
  api.add_files('tests/server_tests.coffee', ['server']);
  api.add_files('tests/model_tests.coffee', both);
});
<commit_msg>upgrade dependency on underscore.string to the official version<commit_after>Package.describe({
  summary: "Mongoid inspired model architecture",
  version: "0.9.5",
  git: "https://github.com/Exygy/minimongoid.git"
});

Package.on_use(function (api) {
  api.versionsFrom("METEOR@0.9.0");
  var both = ['client', 'server'];
  api.use(['underscore', "underscorestring:underscore.string", 'coffeescript'], both);
  files = [
    'lib/relation.coffee',
    'lib/has_many_relation.coffee',
    'lib/has_and_belongs_to_many_relation.coffee',
    'lib/minimongoid.coffee'
  ];
  api.add_files(files, both);
});

Package.on_test(function (api) {
  var both = ['client', 'server'];
  api.use(["kaptron:minimongoid", 'tinytest', 'coffeescript'], both);
  api.add_files('tests/models.coffee', both);
  api.add_files('tests/server_tests.coffee', ['server']);
  api.add_files('tests/model_tests.coffee', both);
});
<|endoftext|>


<commit_before>'use strict';

// Load requirements
const assign = require('deep-assign'),
      path = require('path'),
      fs = require('fs');

// Helper utilities
module.exports = {

  assignDefaults: function(opts) {
    return assign(require('./defaults'), opts);
  },

  getMethods: function(obj) {

    let ignore = ['config', 'getMethods'];

    return Object.getOwnPropertyNames(obj).filter((property) => {
      return ( typeof obj[property] === 'function' && ! ignore.includes(property) );
    });
  },

  pad: function(n, width) {
    n = n.toString();
    return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
  },

  clean: function(str) {
    return str.replace(/[^a-z0-9\s\.-]+/gmi, ' ')
              .replace(/[\s|\.]+/gmi, ' ')
              .replace(/\s/gmi, '.');
  },

  getCodecs: function(streams) {

    let codecs = {video: {}, audio: {}};

    streams.forEach((data) => {
      if ( data.codec_type === 'video' ) {
        codecs.video = {
          codec: data.codec_name.replace('h', 'x'),
          resolution: data.height + 'p',
          depth: data.bits_per_raw_sample + 'bit'
        };
      } else if ( data.codec_type === 'audio' ) {
        codecs.audio = {
          codec: data.codec_name,
          channels: data.channels + '.1'
        };
      }
    });

    return codecs;
  },

  buildDir: function(file, target) {

    let basename = './';

    if ( target && path.isAbsolute(target) ) {
      basename = target;
    } else {
      basename = path.dirname(file) + ( target ? '/' + target : '' );
    }

    // Create the directory if needed
    if ( ! fs.existsSync(basename) ) {
      fs.mkdirSync(basename);
    }

    return basename;
  },

  buildName: function(pattern, file, options, metadata, details) {

    // Variables
    let regex = /(%(\.)?([a-z]{1,2}))/gmi,
        codecs = this.getCodecs(metadata.streams),
        str = pattern,
        m;

    // Build data object
    let replacements = {
      t: details.name,
      n: ( details.type === 'show' ? details.show.name : '' ) || null,
      y: ( details.type === 'show' ? details.show.year : details.year ) || null,
      ex: options.format,
      vc: ( options.video.codec === 'copy' ? codecs.video.codec : options.video.codec.replace('lib', '').replace('h', 'x') ),
      r: codecs.video.resolution || null,
      vd: codecs.video.depth || null,
      ac: codecs.audio.codec || null,
      ad: codecs.audio.channels || null,
      ss: this.pad(details.season || '0', 2),
      s: details.season || '0',
      ee: this.pad(details.season || '0', 2),
      e: details.episode || '0'
    };

    // Are there any custom replacements in options
    if ( typeof options.replacements === 'object' ) {
      replacements = assign(replacements, options.replacements);
    }

    // Find available replacements in pattern
    while ( ( m = regex.exec(pattern) ) !== null ) {

      // This is necessary to avoid infinite loops with zero-width matches
      if ( m.index === regex.lastIndex ) { regex.lastIndex++; }

      m.forEach((match, i) => { // jshint ignore:line
        let val = replacements[m[3]];
        str = str.replace(m[1], ( m[2] !== undefined ? this.clean(val) : val ));
      });
    }

    // Sample suffix
    if ( options.preview ) {
      str.replace('.' + replacements.ex, '-sample.' + replacements.ex);
    }

    // Clean and send it back
    return this.clean(str);
  }

};
<commit_msg>Add helpers to engine utils<commit_after>'use strict';

// Load requirements
const assign = require('deep-assign'),
      path = require('path'),
      fs = require('fs');

// Load modules
const utils = require('../utils');

// Helper utilities
module.exports = {

  assignDefaults: function(opts) {
    return assign(require('./data/defaults'), opts);
  },

  // ucfirst
  capitalize: function(str) {
    return str.charAt(0).toUpperCase() + str.slice(1);
  },

  // Gets a stream title from the metadata
  getStreamTitle: function(stream) {
    return stream.title || stream.tags ? stream.tags.title : undefined;
  },

  // Format stream language
  normalizeStreamLanguage: function(stream) {
    let lang = stream.language || stream.tags ? stream.tags.language : undefined;
    return utils.normalizeLanguage(lang);
  },

  // Creates a standard naming convention for audio tracks
  getFormatedChannels: function(channels) {

    if ( channels === 1 ) {
      return 'Mono';
    } else if ( channels === 2 ) {
      return 'Stereo';
    } else if ( channels % 2 ) {
      return channels + '.0 Channel';
    } else {
      return (channels - 1) + '.1 Channel';
    }
  },

  getMethods: function(obj) {

    let ignore = ['config', 'getMethods'];

    return Object.getOwnPropertyNames(obj).filter((property) => {
      return ( typeof obj[property] === 'function' && ! ignore.includes(property) );
    });
  },

  pad: function(n, width) {
    n = n.toString();
    return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;
  },

  clean: function(str) {
    return str.replace(/[^a-z0-9\s\.-]+/gmi, ' ')
              .replace(/[\s|\.]+/gmi, ' ')
              .replace(/\s/gmi, '.');
  },

  getCodecs: function(streams) {

    let codecs = {video: {}, audio: {}};

    streams.forEach((data) => {
      if ( data.codec_type === 'video' ) {
        codecs.video = {
          codec: data.codec_name.replace('h', 'x'),
          resolution: data.height + 'p',
          depth: data.bits_per_raw_sample + 'bit'
        };
      } else if ( data.codec_type === 'audio' ) {
        codecs.audio = {
          codec: data.codec_name,
          channels: this.getFormatedChannels(data.channels).replace(/[^0-9\.]+/ig, '')
        };
      }
    });

    return codecs;
  },

  buildDir: function(file, target) {

    let basename = './';

    if ( target && path.isAbsolute(target) ) {
      basename = target;
    } else {
      basename = path.dirname(file) + ( target ? '/' + target : '' );
    }

    // Create the directory if needed
    if ( ! fs.existsSync(basename) ) {
      fs.mkdirSync(basename);
    }

    return basename;
  },

  buildName: function(pattern, file, options, metadata, details) {

    // Variables
    let regex = /(%(\.)?([a-z]{1,2}))/gmi,
        codecs = this.getCodecs(metadata.streams),
        str = pattern,
        m;

    // Build data object
    let replacements = {
      t: details.name,
      n: ( details.type === 'show' ? details.show.name : '' ) || null,
      y: ( details.type === 'show' ? details.show.year : details.year ) || null,
      ex: options.format,
      vc: ( options.video.codec === 'copy' ? codecs.video.codec : options.video.codec.replace('lib', '').replace('h', 'x') ),
      r: codecs.video.resolution || null,
      vd: codecs.video.depth || null,
      ac: codecs.audio.codec || null,
      ad: codecs.audio.channels || null,
      ss: this.pad(details.season || '0', 2),
      s: details.season || '0',
      ee: this.pad(details.season || '0', 2),
      e: details.episode || '0'
    };

    // Are there any custom replacements in options
    if ( typeof options.replacements === 'object' ) {
      replacements = assign(replacements, options.replacements);
    }

    // Find available replacements in pattern
    while ( ( m = regex.exec(pattern) ) !== null ) {

      // This is necessary to avoid infinite loops with zero-width matches
      if ( m.index === regex.lastIndex ) { regex.lastIndex++; }

      m.forEach((match, i) => { // jshint ignore:line
        let val = replacements[m[3]];
        str = str.replace(m[1], ( m[2] !== undefined ? this.clean(val) : val ));
      });
    }

    // Sample suffix
    if ( options.preview ) {
      str.replace('.' + replacements.ex, '-sample.' + replacements.ex);
    }

    // Clean and send it back
    return this.clean(str);
  }

};
<|endoftext|>


<commit_before>Package.describe({
  name: 'peerlibrary:peerdb-migrations',
  summary: "PeerDB migrations.",
  version: '1.1.0',
  git: 'https://github.com/peerlibrary/meteor-peerdb-migrations.git'
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@1.8.1');

  // Core dependencies.
  api.use([
    'coffeescript@2.4.1',
    'ecmascript',
    'underscore',
    'minimongo',
    'logging'
  ], 'server');

  // 3rd party dependencies.
  api.use([
    'peerlibrary:assert@0.3.0',
    'peerlibrary:directcollection@0.9.0',
    'peerlibrary:peerdb@0.27.0'
  ], 'server');

  api.addFiles([
    'server.coffee'
  ], 'server');
});

Package.onTest(function (api) {
  api.versionsFrom('METEOR@1.8.1');

  // Core dependencies.
  api.use([
    'coffeescript@2.4.1',
    'ecmascript',
    'tinytest',
    'test-helpers',
    'underscore',
    'random',
    'logging',
    'ejson',
    'mongo'
  ], 'server');

  // Internal dependencies.
  api.use([
    'peerlibrary:peerdb-migrations'
  ]);

  // 3rd party dependencies.
  api.use([
    'peerlibrary:assert@0.3.0',
    'peerlibrary:directcollection@0.9.0',
    'peerlibrary:peerdb@0.27.0'
  ]);

  api.addFiles([
    'tests_migrations.coffee'
  ], 'server');
});
<commit_msg>Version bump.<commit_after>Package.describe({
  name: 'peerlibrary:peerdb-migrations',
  summary: "PeerDB migrations.",
  version: '1.1.1',
  git: 'https://github.com/peerlibrary/meteor-peerdb-migrations.git'
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@1.8.1');

  // Core dependencies.
  api.use([
    'coffeescript@2.4.1',
    'ecmascript',
    'underscore',
    'minimongo',
    'logging'
  ], 'server');

  // 3rd party dependencies.
  api.use([
    'peerlibrary:assert@0.3.0',
    'peerlibrary:directcollection@0.9.0',
    'peerlibrary:peerdb@0.27.0'
  ], 'server');

  api.addFiles([
    'server.coffee'
  ], 'server');
});

Package.onTest(function (api) {
  api.versionsFrom('METEOR@1.8.1');

  // Core dependencies.
  api.use([
    'coffeescript@2.4.1',
    'ecmascript',
    'tinytest',
    'test-helpers',
    'underscore',
    'random',
    'logging',
    'ejson',
    'mongo'
  ], 'server');

  // Internal dependencies.
  api.use([
    'peerlibrary:peerdb-migrations'
  ]);

  // 3rd party dependencies.
  api.use([
    'peerlibrary:assert@0.3.0',
    'peerlibrary:directcollection@0.9.0',
    'peerlibrary:peerdb@0.27.0'
  ]);

  api.addFiles([
    'tests_migrations.coffee'
  ], 'server');
});
<|endoftext|>


<commit_before>import React from 'react-native';
import Colors from '../../Colors';
import AppTextInput from './AppTextInput';
import AppbarSecondary from './AppbarSecondary';
import AppbarTouchable from './AppbarTouchable';
import AppbarIcon from './AppbarIcon';

const {
	StyleSheet
} = React;

const styles = StyleSheet.create({
	input: {
		flex: 1,
		fontSize: 16,
		lineHeight: 24,
		color: Colors.black,
		backgroundColor: 'transparent'
	},
	icon: {
		color: Colors.fadedBlack
	}
});

export default class SearchBar extends React.Component {
	constructor(props) {
		super(props);

		this.state = {
			inputText: '',
			showClear: false
		};
	}

	_handleChange = e => {
		const text = e.nativeEvent.text;

		if (text) {
			if (!this.state.showClear) {
				this.setState({
					showClear: true
				});
			}
		} else {
			if (this.state.showClear) {
				this.setState({
					showClear: false
				});
			}
		}

		this.props.onChangeSearch(text);
	};

	_handleClearInput = () => {
		if (this._input) {
			this._input.setNativeProps({ text: '' });
		}

		this.setState({
			showClear: false
		});

		this.props.onChangeSearch('');
	};

	render() {
		return (
			<AppbarSecondary {...this.props}>
				<AppbarTouchable type='secondary' onPress={this.props.onBack}>
					<AppbarIcon name='arrow-back' style={styles.icon} />
				</AppbarTouchable>

				<AppTextInput
					ref={c => (this._input = c)}
					autoFocus={this.props.autoFocus}
					onChange={this._handleChange}
					placeholder={this.props.placeholder}
					placeholderTextColor='rgba(0, 0, 0, 0.5)'
					onFocus={this.props.onFocus}
					onBlur={this.props.onBlur}
					style={styles.input}
				/>

				{this.state.showClear ?
					<AppbarTouchable type='secondary' onPress={this._handleClearInput}>
						<AppbarIcon name='close' style={styles.icon} />
					</AppbarTouchable> :
					null
				}
			</AppbarSecondary>
		);
	}
}

SearchBar.propTypes = {
	onBack: React.PropTypes.func.isRequired,
	onChangeSearch: React.PropTypes.func.isRequired,
	onFocus: React.PropTypes.func,
	onBlur: React.PropTypes.func,
	placeholder: React.PropTypes.string,
	autoFocus: React.PropTypes.bool
};
<commit_msg>Refactor the SearchBar component<commit_after>/* @flow */

import React, { Component, PropTypes } from 'react';
import ReactNative from 'react-native';
import Colors from '../../Colors';
import AppTextInput from './AppTextInput';
import AppbarSecondary from './AppbarSecondary';
import AppbarTouchable from './AppbarTouchable';
import AppbarIcon from './AppbarIcon';

const {
	StyleSheet
} = ReactNative;

const styles = StyleSheet.create({
	input: {
		flex: 1,
		fontSize: 16,
		lineHeight: 24,
		color: Colors.black,
		backgroundColor: 'transparent'
	},
	icon: {
		color: Colors.fadedBlack
	}
});

type Props = {
	onBack: Function;
	onChangeSearch: Function;
	onFocus?: Function;
	onBlur?: Function;
	placeholder?: string;
	autoFocus?: boolean;
}

type State = {
	query: string;
}

export default class SearchBar extends Component<void, Props, State> {
	static propTypes = {
		onBack: PropTypes.func.isRequired,
		onChangeSearch: PropTypes.func.isRequired,
		onFocus: PropTypes.func,
		onBlur: PropTypes.func,
		placeholder: PropTypes.string,
		autoFocus: PropTypes.bool
	};

	state: State = {
		query: '',
	};

	_handleChange: Function = query => {
		this.setState({
			query
		});

		this.props.onChangeSearch(query);
	};

	_handleClearInput: Function = () => {
		this.setState({
			query: ''
		});

		this.props.onChangeSearch('');
	};

	render() {
		return (
			<AppbarSecondary {...this.props}>
				{this.props.onBack ?
					<AppbarTouchable type='secondary' onPress={this.props.onBack}>
						<AppbarIcon name='arrow-back' style={styles.icon} />
					</AppbarTouchable> :
					<AppbarIcon name='search' style={styles.icon} />
				}

				<AppTextInput
					value={this.state.query}
					autoFocus={this.props.autoFocus}
					onChangeText={this._handleChange}
					placeholder={this.props.placeholder}
					placeholderTextColor='rgba(0, 0, 0, 0.5)'
					onFocus={this.props.onFocus}
					onBlur={this.props.onBlur}
					style={styles.input}
				/>

				{this.state.query ?
					<AppbarTouchable type='secondary' onPress={this._handleClearInput}>
						<AppbarIcon name='close' style={styles.icon} />
					</AppbarTouchable> :
					null
				}
			</AppbarSecondary>
		);
	}
}
<|endoftext|>


<commit_before>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-behaviours',
  name: 'zimme:collection-behaviours',
  summary: 'Define and attach behaviours for collections',
  version: '0.1.6-rc.1'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'mongo',
    'underscore'
  ]);

  api.use('matb33:collection-hooks@0.7.6');

  api.use([
    'aldeed:autoform@2.0.0 || 3.0.0 || 4.0.0',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.addFiles([
    'collection-behaviour.coffee',
    'mongo.coffee'
  ]);

  api.addFiles([
    'behaviours/timestampable.coffee',
    'behaviours/softremovable.coffee'
  ]);

  api.export('CollectionBehaviours');
});
<commit_msg>Version bump<commit_after>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-behaviours',
  name: 'zimme:collection-behaviours',
  summary: 'Define and attach behaviours for collections',
  version: '0.1.6'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'mongo',
    'underscore'
  ]);

  api.use('matb33:collection-hooks@0.7.6');

  api.use([
    'aldeed:autoform@2.0.0 || 3.0.0 || 4.0.0',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.addFiles([
    'collection-behaviour.coffee',
    'mongo.coffee'
  ]);

  api.addFiles([
    'behaviours/timestampable.coffee',
    'behaviours/softremovable.coffee'
  ]);

  api.export('CollectionBehaviours');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Routing specifically designed for Meteor',
  version: '0.9.0'
});

Package.on_use(function (api) {
  api.use('reactive-dict@1.0.0', ['client', 'server']);
  api.use('deps@1.0.0', ['client', 'server']);
  api.use('underscore@1.0.0', ['client', 'server']);
  api.use('ejson@1.0.0', ['client', 'server']);
  api.use('jquery@1.0.0', 'client');
  api.use('webapp@1.0.0', 'server');

  // default ui manager
  // use unordered: true becuase of circular dependency

  // for helpers
  api.use('ui@1.0.0', 'client');

  // gives us dynamic layouts
  api.use('iron:layout@0.3.0');

  // in case they have the old version that was
  // automigrated from atmosphere.
  api.use('cmather:iron-router@0.8.2', {weak: true});

  api.add_files('lib/utils.js', ['client', 'server']);
  api.add_files('lib/route.js', ['client', 'server']);
  api.add_files('lib/route_controller.js', ['client', 'server']);
  api.add_files('lib/router.js', ['client', 'server']);

  api.add_files('lib/client/location.js', 'client');
  api.add_files('lib/client/router.js', 'client');
  api.add_files('lib/client/wait_list.js', 'client');
  api.add_files('lib/client/hooks.js', 'client');
  api.add_files('lib/client/route_controller.js', 'client');
  api.add_files('lib/client/ui/helpers.js', 'client');

  api.add_files('lib/server/route_controller.js', 'server');
  api.add_files('lib/server/router.js', 'server');

  api.add_files('lib/version_conflict_error.js');

  Npm.depends({connect: '2.9.0'});

  api.export('RouteController', ['client', 'server']);
  api.export('Route', ['client', 'server']);
  api.export('Router', ['client', 'server']);
  api.export('IronLocation', 'client');

  api.export('Utils', ['client', 'server'], {testOnly: true});
  api.export('IronRouter', ['client', 'server'], {testOnly: true});
  api.export('WaitList', 'client', {testOnly: true});
});

Package.on_test(function (api) {
  api.use('iron:router', ['client', 'server']);
  api.use('tinytest', ['client', 'server']);
  api.use('test-helpers', ['client', 'server']);
  api.use('reactive-dict', ['client', 'server']);

  api.add_files('test/test_helpers.js', ['client', 'server']);

  // client and server
  api.add_files('test/both/route.js', ['client', 'server']);
  api.add_files('test/both/route_controller.js', ['client', 'server']);
  api.add_files('test/both/router.js', ['client', 'server']);
  api.add_files('test/both/utils.js', ['client', 'server']);

  // server only
  api.add_files('test/server/router.js', 'server');

  // client only
  api.add_files('test/client/mocks.js', 'client');
  api.add_files('test/client/router.js', 'client');
  api.add_files('test/client/route_controller.js', 'client');
  api.add_files('test/client/wait_list.js', 'client');
});
<commit_msg>add underscore to test block<commit_after>Package.describe({
  summary: 'Routing specifically designed for Meteor',
  version: '0.9.0'
});

Package.on_use(function (api) {
  api.use('reactive-dict@1.0.0', ['client', 'server']);
  api.use('deps@1.0.0', ['client', 'server']);
  api.use('underscore@1.0.0', ['client', 'server']);
  api.use('ejson@1.0.0', ['client', 'server']);
  api.use('jquery@1.0.0', 'client');
  api.use('webapp@1.0.0', 'server');

  // default ui manager
  // use unordered: true becuase of circular dependency

  // for helpers
  api.use('ui@1.0.0', 'client');

  // gives us dynamic layouts
  api.use('iron:layout@0.3.0');

  // in case they have the old version that was
  // automigrated from atmosphere.
  api.use('cmather:iron-router@0.8.2', {weak: true});

  api.add_files('lib/utils.js', ['client', 'server']);
  api.add_files('lib/route.js', ['client', 'server']);
  api.add_files('lib/route_controller.js', ['client', 'server']);
  api.add_files('lib/router.js', ['client', 'server']);

  api.add_files('lib/client/location.js', 'client');
  api.add_files('lib/client/router.js', 'client');
  api.add_files('lib/client/wait_list.js', 'client');
  api.add_files('lib/client/hooks.js', 'client');
  api.add_files('lib/client/route_controller.js', 'client');
  api.add_files('lib/client/ui/helpers.js', 'client');

  api.add_files('lib/server/route_controller.js', 'server');
  api.add_files('lib/server/router.js', 'server');

  api.add_files('lib/version_conflict_error.js');

  Npm.depends({connect: '2.9.0'});

  api.export('RouteController', ['client', 'server']);
  api.export('Route', ['client', 'server']);
  api.export('Router', ['client', 'server']);
  api.export('IronLocation', 'client');

  api.export('Utils', ['client', 'server'], {testOnly: true});
  api.export('IronRouter', ['client', 'server'], {testOnly: true});
  api.export('WaitList', 'client', {testOnly: true});
});

Package.on_test(function (api) {
  api.use('iron:router', ['client', 'server']);
  api.use('tinytest', ['client', 'server']);
  api.use('test-helpers', ['client', 'server']);
  api.use('reactive-dict', ['client', 'server']);
  api.use('underscore');

  api.add_files('test/test_helpers.js', ['client', 'server']);

  // client and server
  api.add_files('test/both/route.js', ['client', 'server']);
  api.add_files('test/both/route_controller.js', ['client', 'server']);
  api.add_files('test/both/router.js', ['client', 'server']);
  api.add_files('test/both/utils.js', ['client', 'server']);

  // server only
  api.add_files('test/server/router.js', 'server');

  // client only
  api.add_files('test/client/mocks.js', 'client');
  api.add_files('test/client/router.js', 'client');
  api.add_files('test/client/route_controller.js', 'client');
  api.add_files('test/client/wait_list.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Accounts Templates unstyled.",
    version: "0.9.5",
    name: "splendido:accounts-templates-unstyled",
    git: "https://github.com/splendido/accounts-templates-unstyled.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.5",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_unstyled.css"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-unstyled",
        "splendido:accounts-templates-core@0.9.5",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<commit_msg>patch release - Bump to version 0.9.6<commit_after>Package.describe({
    summary: "Accounts Templates unstyled.",
    version: "0.9.6",
    name: "splendido:accounts-templates-unstyled",
    git: "https://github.com/splendido/accounts-templates-unstyled.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@0.9.2.2");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.6",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_unstyled.css"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-unstyled",
        "splendido:accounts-templates-core@0.9.6",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<|endoftext|>


<commit_before>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Carefully Designed Client Side Router for Meteor',
  version: '1.0.1',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use('underscore');
  api.use('tracker');
  api.use('reactive-dict');

  api.use('meteorhacks:fast-render@2.0.0', ['client', 'server'], {weak: true});

  api.addFiles('client/vendor/page.js', 'client');
  api.addFiles('client/vendor/query.js', 'client');
  api.addFiles('client/router.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/route.js', 'server');
  api.addFiles('server/_init.js', 'server');

  api.addFiles('server/plugins/fast-render.js', 'server');

  api.export('FlowRouter');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('meteorhacks:flow-router');
  api.use('practicalmeteor:sinon');

  api.addFiles('test/client/_helpers.js', 'client');
  api.addFiles('test/server/_helpers.js', 'server');

  api.addFiles('test/client/loader.spec.js', 'client');
  api.addFiles('test/client/router.test.js', 'client');
  api.addFiles('test/client/router.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');
});
<commit_msg>Version bump to 1.0.2<commit_after>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Carefully Designed Client Side Router for Meteor',
  version: '1.0.2',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use('underscore');
  api.use('tracker');
  api.use('reactive-dict');

  api.use('meteorhacks:fast-render@2.0.0', ['client', 'server'], {weak: true});

  api.addFiles('client/vendor/page.js', 'client');
  api.addFiles('client/vendor/query.js', 'client');
  api.addFiles('client/router.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/route.js', 'server');
  api.addFiles('server/_init.js', 'server');

  api.addFiles('server/plugins/fast-render.js', 'server');

  api.export('FlowRouter');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('meteorhacks:flow-router');
  api.use('practicalmeteor:sinon');

  api.addFiles('test/client/_helpers.js', 'client');
  api.addFiles('test/server/_helpers.js', 'server');

  api.addFiles('test/client/loader.spec.js', 'client');
  api.addFiles('test/client/router.test.js', 'client');
  api.addFiles('test/client/router.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');
});
<|endoftext|>


<commit_before>/*jshint -W117, -W097 */
'use strict';

Package.describe({
  name: 'velocity:core',
  summary: 'Velocity, a Meteor specific test-runner',
  version: '1.0.0-rc.5',
  git: 'https://github.com/xolvio/velocity.git',
  debugOnly: true
});

Npm.depends({
  'chokidar': '0.10.1',
  'lodash': '2.4.1',
  'glob': '4.0.6',
  'mkdirp': '0.5.0',
  'rsync': '0.3.0',
  'fs-extra': '0.12.0',
  'freeport': '1.0.3'
});

Package.on_use(function (api) {

  var SERVER = 'server',
      CLIENT = 'client',
      BOTH = [CLIENT, SERVER];

  api.versionsFrom('METEOR@1.0');
  api.use('mongo');
  api.use('check');
  api.use('http');
  api.use('retry');

  api.add_files('collections.js', BOTH);

  api.export('Velocity', BOTH);
  api.export('VelocityTestFiles', BOTH);
  api.export('VelocityFixtureFiles', BOTH);
  api.export('VelocityTestReports', BOTH);
  api.export('VelocityAggregateReports', BOTH);
  api.export('VelocityLogs', BOTH);
  api.export('VelocityMirrors', BOTH);

  api.add_files('lib/meteor/files.js', SERVER);
  api.add_files('core.js', SERVER);
  api.add_files(['lib/FileCopier.js'], SERVER);
  api.add_files('clientFileSync.js', CLIENT);

  // Assets
  api.add_files([
    'default-fixture.js'
  ], SERVER, {isAsset: true});
});
<commit_msg>change version to 0.3.0 while rc issue is sorted out<commit_after>/*jshint -W117, -W097 */
'use strict';

Package.describe({
  name: 'velocity:core',
  summary: 'Velocity, a Meteor specific test-runner',
  version: '0.3.0',
  git: 'https://github.com/xolvio/velocity.git',
  debugOnly: true
});

Npm.depends({
  'chokidar': '0.10.1',
  'lodash': '2.4.1',
  'glob': '4.0.6',
  'mkdirp': '0.5.0',
  'rsync': '0.3.0',
  'fs-extra': '0.12.0',
  'freeport': '1.0.3'
});

Package.on_use(function (api) {

  var SERVER = 'server',
      CLIENT = 'client',
      BOTH = [CLIENT, SERVER];

  api.versionsFrom('METEOR@1.0');
  api.use('mongo');
  api.use('check');
  api.use('http');
  api.use('retry');

  api.add_files('collections.js', BOTH);

  api.export('Velocity', BOTH);
  api.export('VelocityTestFiles', BOTH);
  api.export('VelocityFixtureFiles', BOTH);
  api.export('VelocityTestReports', BOTH);
  api.export('VelocityAggregateReports', BOTH);
  api.export('VelocityLogs', BOTH);
  api.export('VelocityMirrors', BOTH);

  api.add_files('lib/meteor/files.js', SERVER);
  api.add_files('core.js', SERVER);
  api.add_files(['lib/FileCopier.js'], SERVER);
  api.add_files('clientFileSync.js', CLIENT);

  // Assets
  api.add_files([
    'default-fixture.js'
  ], SERVER, {isAsset: true});
});
<|endoftext|>


<commit_before>

Package.describe({
  'name': 'newspring:apollos-core',
  'version': '0.1.25',
  'summary': 'The main Apollos namespace and utilities for all apollos packages.',
  'git': 'https://github.com/NewSpring/newspring-core.git'
});

Package.onUse(function(api) {

  api.versionsFrom('1.0.3.1');
  api.use('meteor-platform@=1.2.2');
  api.use('http@=1.1.0');
  api.use('reactive-var@=1.0.5');
  api.use('accounts-password@=1.1.1');
  api.use('cfs:http-methods@=0.0.28');
  api.use('bjwiley2:server-watch@=0.0.6');
  api.use('aldeed:collection2@=2.3.3');
  api.use('meteorhacks:flow-router@1.9.0');
  api.use('meteorhacks:flow-layout@1.3.0', 'client');
  api.use('velocityjs:velocityjs@=1.2.1', 'client');
  api.use('raix:handlebar-helpers@0.2.4', 'client');
  api.use('arillo:flow-router-helpers@0.1.6', 'client');

  api.addFiles('lib/lib/lib/_vars.js');
  api.addFiles('lib/lib/lib/debug.js');
  api.addFiles('lib/lib/lib/regex.js');
  api.addFiles('lib/lib/lib/utilities.js');
  api.addFiles('lib/lib/__abstract/campuses.js');
  api.addFiles('lib/lib/__abstract/groups.js');
  api.addFiles('lib/lib/__abstract/locations.js');
  api.addFiles('lib/lib/collections/_helpers.js');
  api.addFiles('lib/lib/collections/geoJSON.js');
  api.addFiles('lib/lib/collections/group.js');
  api.addFiles('lib/lib/collections/groupLocation.js');
  api.addFiles('lib/lib/collections/groupMember.js');
  api.addFiles('lib/lib/collections/location.js');
  api.addFiles('lib/lib/collections/people.js');
  api.addFiles('lib/lib/collections/queuedApiRequest.js');
  api.addFiles('lib/lib/collections/user.js');
  api.addFiles('lib/lib/routes/lib/api.js');
  api.addFiles('lib/lib/routes/lib/states.js');
  api.addFiles('lib/lib/accounts.js');
  api.addFiles('lib/lib/apollos.js');

  api.addFiles('lib/client/lib/components/lib/_lookup.js', 'client');
  api.addFiles('lib/client/lib/components/lib/helpers.js', 'client');
  api.addFiles('lib/client/lib/components/_vars.js', 'client');
  api.addFiles('lib/client/lib/components/base.js', 'client');
  api.addFiles('lib/client/lib/components/component.js', 'client');
  api.addFiles('lib/client/lib/apollos.js', 'client');
  api.addFiles('lib/client/helpers/media-query.js', 'client');
  api.addFiles('lib/client/helpers/pathForState.js', 'client');
  api.addFiles('lib/client/stylesheets/keyboard.css', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.forgot-password.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.reset-password.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.signin.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/_vars.js', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.forgot-password.js', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.reset-password.js', 'client');
  api.addFiles('lib/client/templates/cards/on-board/components/profile.signin.js', 'client');
  api.addFiles('lib/client/templates/cards/on-board/states/profile.forgot-password.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/states/profile.reset-password.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/states/profile.signin.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/apollos.profile.onboard.html', 'client');
  api.addFiles('lib/client/templates/cards/on-board/_vars.js', 'client');
  api.addFiles('lib/client/templates/cards/on-board/apollos.profile.onBoard.js', 'client');
  api.addFiles('lib/client/templates/components/controls/number-keyboard.html', 'client');
  api.addFiles('lib/client/templates/components/controls/progress.html', 'client');
  api.addFiles('lib/client/templates/components/controls/toggle.html', 'client');
  api.addFiles('lib/client/templates/components/controls/_vars.js', 'client');
  api.addFiles('lib/client/templates/components/controls/number-keyboard.js', 'client');
  api.addFiles('lib/client/templates/components/controls/progress.js', 'client');
  api.addFiles('lib/client/templates/components/controls/toggle.js', 'client');
  api.addFiles('lib/client/templates/components/forms/checkbox.html', 'client');
  api.addFiles('lib/client/templates/components/forms/inputs.html', 'client');
  api.addFiles('lib/client/templates/components/forms/_vars.js', 'client');
  api.addFiles('lib/client/templates/components/forms/checkbox.js', 'client');
  api.addFiles('lib/client/templates/components/forms/input.js', 'client');
  api.addFiles('lib/client/templates/objects/nav/nav.html', 'client');
  api.addFiles('lib/client/templates/objects/nav/_vars.js', 'client');
  api.addFiles('lib/client/templates/objects/nav/nav.js', 'client');

  api.addFiles('lib/lib/routes/server/_vars.js', 'server');
  api.addFiles('lib/lib/routes/server/api.js', 'server');
  api.addFiles('lib/server/lib/_entityHelpers.js', 'server');
  api.addFiles('lib/server/lib/group.js', 'server');
  api.addFiles('lib/server/lib/groupLocation.js', 'server');
  api.addFiles('lib/server/lib/groupMember.js', 'server');
  api.addFiles('lib/server/lib/location.js', 'server');
  api.addFiles('lib/server/lib/observe.js', 'server');
  api.addFiles('lib/server/lib/person.js', 'server');
  api.addFiles('lib/server/lib/translate.js', 'server');
  api.addFiles('lib/server/lib/user.js', 'server');

  api.export('Apollos');
});

<commit_msg>die package.js die<commit_after><|endoftext|>


<commit_before>/* globals marked */
import DS from 'ember-data';

export default
DS.Model.extend({
  score: DS.attr(),
  exemplary: DS.attr(),
  pros: DS.attr(),
  cons: DS.attr(),
  notes: DS.attr(),
  published: DS.attr(),
  createdAt: DS.attr(),
  updatedAt: DS.attr(),
  submission: DS.belongsTo('submission'),
  assessor: DS.belongsTo('assessor'),

  createdAtDisplay: function () {
    return this.get('createdAtMoment').format('l LT');
  }.property('createdAtMoment'),

  createdAtMoment: function () {
    return moment(this.get('createdAt'));
  }.property('createdAt'),

  updatedAtDisplay: function () {
    return moment(this.get('updatedAt')).format('l LT');
  }.property('updatedAt'),

  notesDisplay: function () {
    var renderer = new marked.Renderer();
    var notes_value = this.get('notes');
      if(notes_value) {
      return marked(notes_value, {renderer: renderer});
    }else{
      return '';
    }
  }.property('notes'),

  prosDisplay: function () {
    var renderer = new marked.Renderer();
    return marked(this.get('pros'), {renderer: renderer});
  }.property('pros'),

  consDisplay: function () {
    var renderer = new marked.Renderer();
    return marked(this.get('cons'), {renderer: renderer});
  }.property('cons'),

  clearExemplaryFlag: function () {
    if (this.get('score') !== 3) {
      this.set('exemplary', false);
    }
  }.observes('score')
});
<commit_msg>Need to be careful to handle NULL pros/cons/notes<commit_after>/* globals marked */
import DS from 'ember-data';

export default
DS.Model.extend({
  score: DS.attr(),
  exemplary: DS.attr(),
  pros: DS.attr(),
  cons: DS.attr(),
  notes: DS.attr(),
  published: DS.attr(),
  createdAt: DS.attr(),
  updatedAt: DS.attr(),
  submission: DS.belongsTo('submission'),
  assessor: DS.belongsTo('assessor'),

  createdAtDisplay: function () {
    return this.get('createdAtMoment').format('l LT');
  }.property('createdAtMoment'),

  createdAtMoment: function () {
    return moment(this.get('createdAt'));
  }.property('createdAt'),

  updatedAtDisplay: function () {
    return moment(this.get('updatedAt')).format('l LT');
  }.property('updatedAt'),

  notesDisplay: function () {
    var renderer = new marked.Renderer();
    var notes_value = this.get('notes') || '';
    return marked(notes_value, {renderer: renderer});
  }.property('notes'),

  prosDisplay: function () {
    var renderer = new marked.Renderer();
    var text = this.get('pros') || '';
    return marked(text, {renderer: renderer});
  }.property('pros'),

  consDisplay: function () {
    var renderer = new marked.Renderer();
    var text = this.get('cons') || '';
    return marked(text, {renderer: renderer});
  }.property('cons'),

  clearExemplaryFlag: function () {
    if (this.get('score') !== 3) {
      this.set('exemplary', false);
    }
  }.observes('score')
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'practicalmeteor:wkwebview',
  version: '0.1.2',
  summary: 'Use the significantly better and faster WKWebView in mobile apps on iOS 8+.',
  git: 'https://github.com/practicalmeteor/meteor-wkwebview',
  documentation: 'README.md'
});

Cordova.depends({
  // the cordova plugin built by Meteor Core team that "emulates a server" on
  // the mobile device. Serving the files and checking for the HCP updates.
  //'com.meteor.cordova-update': 'https://github.com/practicalmeteor/com.meteor.cordova-update/tarball/a7e98f27a26b727288da81dcfd8047eccb5f6036',
  'com.telerik.plugins.wkwebview': 'https://github.com/practicalmeteor/WKWebView/tarball/4a1d577dc790cd8e2156c389a73506d22deff98c'
});

//meteor add cordova:com.meteor.cordova-update@https://github.com/practicalmeteor/com.meteor.cordova-update/tarball/a7e98f27a26b727288da81dcfd8047eccb5f6036

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use(['coffeescript', 'practicalmeteor:loglevel@1.2.0_1']);

  api.addFiles('wkwebview.coffee');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:loglevel@1.2.0_1', 'tinytest', 'practicalmeteor:wkwebview']);

  api.addFiles('wkwebview-tests.coffee', 'client');
});
<commit_msg>package update that points to my github repo<commit_after>Package.describe({
  name: 'howon:forked:practicalmeteor:wkwebview',
  version: '0.1.2',
  summary: 'Use the significantly better and faster WKWebView in mobile apps on iOS 8+.',
  git: 'https://github.com/woniesong92/meteor-wkwebview.git',
  documentation: 'README.md'
});

Cordova.depends({
  // the cordova plugin built by Meteor Core team that "emulates a server" on
  // the mobile device. Serving the files and checking for the HCP updates.
  // 'com.meteor.cordova-update': 'https://github.com/practicalmeteor/com.meteor.cordova-update/tarball/a7e98f27a26b727288da81dcfd8047eccb5f6036',
  // 'com.telerik.plugins.wkwebview': 'https://github.com/practicalmeteor/WKWebView/tarball/4a1d577dc790cd8e2156c389a73506d22deff98c'
  // ------------------------------------------------------------------
  // HOWON ADDED A PATCH: replace disableScroll with some hack
  // ------------------------------------------------------------------

  'com.telerik.plugins.wkwebview': 'https://github.com/woniesong92/WKWebView/tarball/9fe975f2648d2215d97920385605d51e90b8f4ed'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');

  api.use(['coffeescript', 'practicalmeteor:loglevel@1.2.0_1']);

  api.addFiles('wkwebview.coffee');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:loglevel@1.2.0_1', 'tinytest', 'practicalmeteor:wkwebview']);

  api.addFiles('wkwebview-tests.coffee', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'heaven7:wsl-translations',
  version: '0.0.1',
  summary: 'Translations package',
  git: 'https://github.com/heaven7/wsl-translations.git',
  documentation: 'README.md'
});

both = ['client','server'];

Package.onUse(function(api) {
    api.versionsFrom('1.1.0.2');
    api.addFiles('package-tap.i18n', both);

    api.use([
        'heaven7:wsl-core',
        'heaven7:wsl-i18n'
    ], both);

    api.imply('heaven7:wsl-i18n');

    api.addFiles([

        // wsl-theme-base
        'i18n/wsl-theme-base/de.i18n.json',
        'i18n/wsl-theme-base/en.i18n.json',
        'i18n/wsl-theme-base/es.i18n.json',

        // wsl-useraccounts
        'i18n/wsl-useraccounts/de.i18n.json',
        'i18n/wsl-useraccounts/en.i18n.json',
        'i18n/wsl-useraccounts/es.i18n.json'
    ], both);

});
<commit_msg>file load order<commit_after>Package.describe({
  name: 'heaven7:wsl-translations',
  version: '0.0.1',
  summary: 'Translations package',
  git: 'https://github.com/heaven7/wsl-translations.git',
  documentation: 'README.md'
});

both = ['client','server'];

Package.onUse(function(api) {
    api.versionsFrom('1.1.0.2');

    api.use([
        'heaven7:wsl-core',
        'heaven7:wsl-i18n'
    ], both);

    api.imply('heaven7:wsl-i18n');
    api.addFiles('package-tap.i18n', both);

    api.addFiles([

         // wsl-theme-base
         'i18n/wsl-theme-base/de.i18n.json',
         'i18n/wsl-theme-base/en.i18n.json',
         'i18n/wsl-theme-base/es.i18n.json',

         // wsl-useraccounts
         'i18n/wsl-useraccounts/de.i18n.json',
         'i18n/wsl-useraccounts/en.i18n.json',
         'i18n/wsl-useraccounts/es.i18n.json'
    ], both);

});
<|endoftext|>