<commit_before>var photongx = (function() {
    $.fn.preload = function() {
        this.each(function(){
            // Check if url starts with /
            if (this[0] == '/') {
                //console.log(String(this));
                $('')[0].src = this;
            }
        });
    }
    $(window).on("debouncedresize", function(event) {
        setColumnwidth();
        /*
        $container.isotope({
            itemSelector: '.item',
            resizable: false, // disable normal resizing
            animationEngine: 'css' // We want css, or no animation at all
        });
        */
            $('.item').wookmark({
                container: $('.items'),
                autoResize: false,
                offset: 6
            });
    });

    var slideshow = false;
    var $container = $('.items');
    var currentimage = 0;
    var slideshowtimer;
    var interval = 3000;

    // calculate and set optimal column size
    var setColumnwidth = function() {
        var docwidth = $(document).width();
        var cwidth = 0;
        var columns = 0;
        // Decide on the best column width depending on docwidth
        // people with huge screens can tolerate more columns
        if (docwidth > 2500)
            columns = 5;
        else if (docwidth > 1900)
            columns = 4;
        else if (docwidth > 1000)
            columns = 3;
        else if (docwidth >= 790)
            columns = 2;
        else if (docwidth < 790)
            columns = 1;

        // also subtract 3*columns, since every item got 6 px margin, 3 on each side
        cwidth = (docwidth / columns) - (4*columns);
        $('.item').css('max-width', cwidth + 'px');
        $('.item img').css('width', cwidth + 'px');
        console.log('Decided on ', columns, ' columns with docwidth ', docwidth);
    }

    setColumnwidth();

    $container.imagesLoaded(function( $images, $proper, $broken ) {
        /*
        $container.isotope({
            itemSelector: '.item',
            resizable: false, // disable normal resizing
            animationEngine: 'css' // We want css, or no animation at all
        });
        */
        $('.item').wookmark({
            container: $('.items'),
            autoResize: false,
            offset: 6
        });

        // We are loaded, so hide the spinner
        $('.spinner').addClass('hidden');
    });

    window.addEventListener("popstate", function (evt) {
        var base_parts = window.location.href.split("/");
        var path_end = base_parts[base_parts.length-2];
        if (path_end == parseInt(path_end)) {
            currentimage = path_end;
            navigateImage(currentimage);
        }
        else {
            // Assume we got an url that doesn't show an image
            hideLB();
        }
    });

    $('.lb').click(function(e) {
        // Show spinner
        $('#spinner').removeClass('hidden');

        //prevent default action (hyperlink)
        e.preventDefault();

        //Get clicked link href
        var image_href = $(this).attr("href");

        // Save the current image
        currentimage = parseInt($(this).attr('id').split('-')[1]);

        history.pushState(null, null, window.location.href + currentimage + "/");

        /*
        If the lightbox window HTML already exists in document,
        change the img src to to match the href of whatever link was clicked

        If the lightbox window HTML doesn't exists, create it and insert it.
        (This will only happen the first time around)
        */

        createLB();

        setLBimage(image_href);

        showLB();
    });

    this.createLB = function() {
        if ($('#lightbox').length == 0) { // #lightbox does not exist
            //create HTML markup for lightbox window
            var lightbox =
            '
' +
                '
' +
                '' +
                '' +
                '
' +
                '

' +
                    '
' + //insert clicked link's href into img src
                        '' +
                    '
' +
                '

' +
            '
';

            //insert lightbox HTML into page
            $('body').append(lightbox);

            // Run the set here to, to trigger click
            $('#next').bind('click', function(e) {
                // Reset timer so we don't doubleskip
                if (slideshow) {
                    pause();
                    play();
                }
                $(document).trigger("next_image");
                return false;
            });
            // Handle clicks on the prev link
            $('#prev').bind('click', function(e) {
                if (slideshow) {
                    // Reset timer so we don't doubleskip
                    pause();
                    play();
                }
                $(document).trigger("prev_image");
                return false;
            });

            // Handle clicks on the fs link
            $('#goFS').bind('click', function(e) {
                e.preventDefault();
                goFS();
                return false;
            });

            // Handle clicks on the play link
            $('#play').bind('click', function(e) {
                if($('#play i').hasClass('icon-play')) {
                    play();
                }else {
                    pause();
                }
                e.preventDefault();
                return false;
            });

            // Handle all clicks in lb-mode
            $('#lightbox').bind('click', function(e) {
                var target = $(e.target);
                var id = target.attr('id');
                hideLB();
                return false;
            });
        }
    }

    var setLBimage = function(image_href) {
        /* ANIM slideshow */
        if(slideshow) {

            $('#img-front').css('opacity', 0).bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
                $('#content').html('');
                $('#img-front').css('opacity', 0.999).bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
                    $('#img-front').css('opacity', 1);
                });

            });
        }else {
            $('#img-front').attr('src', image_href);
        }

        // Count the viewing
        $.getJSON('/photongx/api/img/click/', { 'img':image_href}, function(data) {
            //console.log(data);
        });
        // TODO scrollto background pos img

    };
    this.showLB = function() {
        $('#content').imagesLoaded(function( $images, $proper, $broken ) {
            // effects for background
            $('.items').addClass('backgrounded');
            //show lightbox window - you could use .show('fast') for a transition
            $('#lightbox').removeClass('hidden').show();
            // We are loaded, so hide the spinner
            $('.spinner').addClass('hidden');
            $('#img-front').css('opacity', 1);
        });
    };

    var hideLB = function() {
        if($('#goFS i').hasClass('icon-resize-small')) {
            document.cancelFullScreen();
        }
        // effects for background
        $('.items').removeClass('backgrounded');
        //$('#lightbox').hide();
        $('#lightbox').hide();
        // Stop any running slideshow;
        pause();

        // Push away image number path
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        history.pushState(null, null, base);
    };

    document.cancelFullScreen = document.webkitExitFullscreen || document.mozCancelFullScreen || document.exitFullscreen;

    var goFS = function(e) {
        if($('#goFS i').hasClass('icon-fullscreen')) {

            var elem = document.getElementById('lightbox');

            if (elem.requestFullScreen) {
                elem.requestFullScreen();
            } else if (elem.mozRequestFullScreen) {
                elem.mozRequestFullScreen();
            } else if (elem.webkitRequestFullScreen) {
                elem.webkitRequestFullScreen();
            }
            elem.onwebkitfullscreenchange = onFullScreenExit;
            elem.onmozfullscreenchange = onFullScreenExit;

            $('#goFS i').removeClass('icon-fullscreen').addClass('icon-resize-small');
        }else {
            document.cancelFullScreen();
            $('#goFS i').removeClass('icon-resize-small').addClass('icon-fullscreen');
        }
    }
    var onFullScreenExit = function() {
        console.log('onFSExit');
        //$('#goFS i').removeClass('icon-resize-small').addClass('icon-fullscreen');
    }

    // Slideshow
    var play = function() {
        $('#play i').removeClass('icon-play').addClass('icon-pause');
        slideshow = true;
        slideshowtimer = setInterval(function(){ $(document).trigger("next_image"); }, interval);
    }
    // Slideshow
    var pause = function() {
        $('#play i').removeClass('icon-pause').addClass('icon-play');
        slideshow = false;
        window.clearInterval(slideshowtimer);
    }

    // Clamp skip to images available
    var clampSkip = function (c) {
        if (c == 0) {
            // we are at the start, figure out the amount of items and
            // go to the end
            c = $('.item').length;
        }else if (c > ($('.item').length)) {
            c = 1; // Lua starts at 1 :)
        }

        return c;
    }
    // Function responsible for swapping the current lightbox image
    // it wraps on start and end, and preloads 3 images in the current
    // scrolling direction
    this.navigateImage = function(c) {
        var image_href = $('#image-'+c).attr('href');
        setLBimage(image_href);

        var cone = c+1, ctwo = c+2 , cthree = c+3;
        // We are going backwards
        if (c - currentimage) {
            cone = c-1, ctwo = c-2, cthree = c-3;
        }
        // Only load 1 image, faster swapping
        $([
            $('#image-'+String(parseInt(cone))).attr('href'),
            ]).preload();

            //$('#image-'+String(parseInt(ctwo))).attr('href'),
            //$('#image-'+String(parseInt(cthree))).attr('href')
        currentimage = c;
    }

    $(document).on('next_image', function (evt) {
        var image_num = clampSkip(currentimage + 1);
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        else
            base = window.location.href;
        history.pushState(null, null, base + image_num + "/");
        navigateImage(image_num);
    });

    $(document).on('prev_image', function (evt) {
        var image_num = clampSkip(currentimage - 1);
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        else
            base = window.location.href;
        history.pushState(null, null, base + image_num + "/");
        navigateImage(image_num);
    });

    $(document).keydown(function(e){
        if (evt.shiftKey || evt.altKey || evt.ctrlKey) return true;
        if (e.keyCode == 27) {
            hideLB();
            return false;
        }
        else if (e.keyCode == 37 || e.keyCode == 39) {
            if (slideshow) {
                // Reset timer so we don't doubleskip
                pause();
                play();
            }
            if (e.keyCode == 37) {
                $(document).trigger("prev_image");
            }
            else if (e.keyCode == 39) {
                $(document).trigger("next_image");
            }
            return false;
        }
        else if (e.keyCode == 70) {
            goFS();
        }
        else if (e.keyCode == 32) {
            $('#play').click();
        }
    });
    return this;
});
<commit_msg>evt -> e<commit_after>var photongx = (function() {
    $.fn.preload = function() {
        this.each(function(){
            // Check if url starts with /
            if (this[0] == '/') {
                //console.log(String(this));
                $('')[0].src = this;
            }
        });
    }
    $(window).on("debouncedresize", function(event) {
        setColumnwidth();
        /*
        $container.isotope({
            itemSelector: '.item',
            resizable: false, // disable normal resizing
            animationEngine: 'css' // We want css, or no animation at all
        });
        */
            $('.item').wookmark({
                container: $('.items'),
                autoResize: false,
                offset: 6
            });
    });

    var slideshow = false;
    var $container = $('.items');
    var currentimage = 0;
    var slideshowtimer;
    var interval = 3000;

    // calculate and set optimal column size
    var setColumnwidth = function() {
        var docwidth = $(document).width();
        var cwidth = 0;
        var columns = 0;
        // Decide on the best column width depending on docwidth
        // people with huge screens can tolerate more columns
        if (docwidth > 2500)
            columns = 5;
        else if (docwidth > 1900)
            columns = 4;
        else if (docwidth > 1000)
            columns = 3;
        else if (docwidth >= 790)
            columns = 2;
        else if (docwidth < 790)
            columns = 1;

        // also subtract 3*columns, since every item got 6 px margin, 3 on each side
        cwidth = (docwidth / columns) - (4*columns);
        $('.item').css('max-width', cwidth + 'px');
        $('.item img').css('width', cwidth + 'px');
        console.log('Decided on ', columns, ' columns with docwidth ', docwidth);
    }

    setColumnwidth();

    $container.imagesLoaded(function( $images, $proper, $broken ) {
        /*
        $container.isotope({
            itemSelector: '.item',
            resizable: false, // disable normal resizing
            animationEngine: 'css' // We want css, or no animation at all
        });
        */
        $('.item').wookmark({
            container: $('.items'),
            autoResize: false,
            offset: 6
        });

        // We are loaded, so hide the spinner
        $('.spinner').addClass('hidden');
    });

    window.addEventListener("popstate", function (evt) {
        var base_parts = window.location.href.split("/");
        var path_end = base_parts[base_parts.length-2];
        if (path_end == parseInt(path_end)) {
            currentimage = path_end;
            navigateImage(currentimage);
        }
        else {
            // Assume we got an url that doesn't show an image
            hideLB();
        }
    });

    $('.lb').click(function(e) {
        // Show spinner
        $('#spinner').removeClass('hidden');

        //prevent default action (hyperlink)
        e.preventDefault();

        //Get clicked link href
        var image_href = $(this).attr("href");

        // Save the current image
        currentimage = parseInt($(this).attr('id').split('-')[1]);

        history.pushState(null, null, window.location.href + currentimage + "/");

        /*
        If the lightbox window HTML already exists in document,
        change the img src to to match the href of whatever link was clicked

        If the lightbox window HTML doesn't exists, create it and insert it.
        (This will only happen the first time around)
        */

        createLB();

        setLBimage(image_href);

        showLB();
    });

    this.createLB = function() {
        if ($('#lightbox').length == 0) { // #lightbox does not exist
            //create HTML markup for lightbox window
            var lightbox =
            '
' +
                '
' +
                '' +
                '' +
                '
' +
                '

' +
                    '
' + //insert clicked link's href into img src
                        '' +
                    '
' +
                '

' +
            '
';

            //insert lightbox HTML into page
            $('body').append(lightbox);

            // Run the set here to, to trigger click
            $('#next').bind('click', function(e) {
                // Reset timer so we don't doubleskip
                if (slideshow) {
                    pause();
                    play();
                }
                $(document).trigger("next_image");
                return false;
            });
            // Handle clicks on the prev link
            $('#prev').bind('click', function(e) {
                if (slideshow) {
                    // Reset timer so we don't doubleskip
                    pause();
                    play();
                }
                $(document).trigger("prev_image");
                return false;
            });

            // Handle clicks on the fs link
            $('#goFS').bind('click', function(e) {
                e.preventDefault();
                goFS();
                return false;
            });

            // Handle clicks on the play link
            $('#play').bind('click', function(e) {
                if($('#play i').hasClass('icon-play')) {
                    play();
                }else {
                    pause();
                }
                e.preventDefault();
                return false;
            });

            // Handle all clicks in lb-mode
            $('#lightbox').bind('click', function(e) {
                var target = $(e.target);
                var id = target.attr('id');
                hideLB();
                return false;
            });
        }
    }

    var setLBimage = function(image_href) {
        /* ANIM slideshow */
        if(slideshow) {

            $('#img-front').css('opacity', 0).bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
                $('#content').html('');
                $('#img-front').css('opacity', 0.999).bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function(){
                    $('#img-front').css('opacity', 1);
                });

            });
        }else {
            $('#img-front').attr('src', image_href);
        }

        // Count the viewing
        $.getJSON('/photongx/api/img/click/', { 'img':image_href}, function(data) {
            //console.log(data);
        });
        // TODO scrollto background pos img

    };
    this.showLB = function() {
        $('#content').imagesLoaded(function( $images, $proper, $broken ) {
            // effects for background
            $('.items').addClass('backgrounded');
            //show lightbox window - you could use .show('fast') for a transition
            $('#lightbox').removeClass('hidden').show();
            // We are loaded, so hide the spinner
            $('.spinner').addClass('hidden');
            $('#img-front').css('opacity', 1);
        });
    };

    var hideLB = function() {
        if($('#goFS i').hasClass('icon-resize-small')) {
            document.cancelFullScreen();
        }
        // effects for background
        $('.items').removeClass('backgrounded');
        //$('#lightbox').hide();
        $('#lightbox').hide();
        // Stop any running slideshow;
        pause();

        // Push away image number path
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        history.pushState(null, null, base);
    };

    document.cancelFullScreen = document.webkitExitFullscreen || document.mozCancelFullScreen || document.exitFullscreen;

    var goFS = function(e) {
        if($('#goFS i').hasClass('icon-fullscreen')) {

            var elem = document.getElementById('lightbox');

            if (elem.requestFullScreen) {
                elem.requestFullScreen();
            } else if (elem.mozRequestFullScreen) {
                elem.mozRequestFullScreen();
            } else if (elem.webkitRequestFullScreen) {
                elem.webkitRequestFullScreen();
            }
            elem.onwebkitfullscreenchange = onFullScreenExit;
            elem.onmozfullscreenchange = onFullScreenExit;

            $('#goFS i').removeClass('icon-fullscreen').addClass('icon-resize-small');
        }else {
            document.cancelFullScreen();
            $('#goFS i').removeClass('icon-resize-small').addClass('icon-fullscreen');
        }
    }
    var onFullScreenExit = function() {
        console.log('onFSExit');
        //$('#goFS i').removeClass('icon-resize-small').addClass('icon-fullscreen');
    }

    // Slideshow
    var play = function() {
        $('#play i').removeClass('icon-play').addClass('icon-pause');
        slideshow = true;
        slideshowtimer = setInterval(function(){ $(document).trigger("next_image"); }, interval);
    }
    // Slideshow
    var pause = function() {
        $('#play i').removeClass('icon-pause').addClass('icon-play');
        slideshow = false;
        window.clearInterval(slideshowtimer);
    }

    // Clamp skip to images available
    var clampSkip = function (c) {
        if (c == 0) {
            // we are at the start, figure out the amount of items and
            // go to the end
            c = $('.item').length;
        }else if (c > ($('.item').length)) {
            c = 1; // Lua starts at 1 :)
        }

        return c;
    }
    // Function responsible for swapping the current lightbox image
    // it wraps on start and end, and preloads 3 images in the current
    // scrolling direction
    this.navigateImage = function(c) {
        var image_href = $('#image-'+c).attr('href');
        setLBimage(image_href);

        var cone = c+1, ctwo = c+2 , cthree = c+3;
        // We are going backwards
        if (c - currentimage) {
            cone = c-1, ctwo = c-2, cthree = c-3;
        }
        // Only load 1 image, faster swapping
        $([
            $('#image-'+String(parseInt(cone))).attr('href'),
            ]).preload();

            //$('#image-'+String(parseInt(ctwo))).attr('href'),
            //$('#image-'+String(parseInt(cthree))).attr('href')
        currentimage = c;
    }

    $(document).on('next_image', function (evt) {
        var image_num = clampSkip(currentimage + 1);
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        else
            base = window.location.href;
        history.pushState(null, null, base + image_num + "/");
        navigateImage(image_num);
    });

    $(document).on('prev_image', function (evt) {
        var image_num = clampSkip(currentimage - 1);
        var base_parts = window.location.href.split("/");
        if (base_parts[base_parts.length-2] == currentimage)
            base = base_parts.slice(0, base_parts.length - 2).join("/") + "/";
        else
            base = window.location.href;
        history.pushState(null, null, base + image_num + "/");
        navigateImage(image_num);
    });

    $(document).keydown(function(e){
        if (e.shiftKey || e.altKey || e.ctrlKey) return true;
        if (e.keyCode == 27) {
            hideLB();
            return false;
        }
        else if (e.keyCode == 37 || e.keyCode == 39) {
            if (slideshow) {
                // Reset timer so we don't doubleskip
                pause();
                play();
            }
            if (e.keyCode == 37) {
                $(document).trigger("prev_image");
            }
            else if (e.keyCode == 39) {
                $(document).trigger("next_image");
            }
            return false;
        }
        else if (e.keyCode == 70) {
            goFS();
        }
        else if (e.keyCode == 32) {
            $('#play').click();
        }
    });
    return this;
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'ibmcloud:bluemix',
  version: '1.0.3',
  summary: 'IBM Bluemix OAuth flow',
  git: 'https://github.com/oneibmcloud/bluemix.git',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.use('oauth2@1.0.0', ['client', 'server']);
  api.use('oauth@1.0.0', ['client', 'server']);
  api.use('http@1.0.0', ['server']);
  api.use('underscore@1.0.0', 'client');
  api.use('templating@1.0.0', 'client');
  api.use('random@1.0.0', 'client');
  api.use('service-configuration@1.0.0', ['client', 'server']);

  api.export('Bluemix');

  api.addFiles(['bluemix_configure.html', 'bluemix_configure.js'], 'client');

  api.addFiles('bluemix_server.js', 'server');
  api.addFiles('bluemix_client.js', 'client');
});
<commit_msg>change the version to 1.0.4<commit_after>Package.describe({
  name: 'ibmcloud:bluemix',
  version: '1.0.4',
  summary: 'IBM Bluemix OAuth flow',
  git: 'https://github.com/oneibmcloud/bluemix.git',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.use('oauth2@1.0.0', ['client', 'server']);
  api.use('oauth@1.0.0', ['client', 'server']);
  api.use('http@1.0.0', ['server']);
  api.use('underscore@1.0.0', 'client');
  api.use('templating@1.0.0', 'client');
  api.use('random@1.0.0', 'client');
  api.use('service-configuration@1.0.0', ['client', 'server']);

  api.export('Bluemix');

  api.addFiles(['bluemix_configure.html', 'bluemix_configure.js'], 'client');

  api.addFiles('bluemix_server.js', 'server');
  api.addFiles('bluemix_client.js', 'client');
});
<|endoftext|>


<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import {Tabs, Tab, ButtonToolbar, Button, FormControl,
	FormGroup, ControlLabel, HelpBlock, Modal,
	Form,Checkbox} from 'react-bootstrap';
import ReactAddonsLinkedStateMixin from 'react-addons-linked-state-mixin';
import {AgGridReact} from 'ag-grid-react';
import LoginForm from './login-form';
import ConnectionTable from './tables/connection-table';
import SampleTable from './tables/sample-table';
import OrderTable from './tables/order-table';
import OrderForm from './order-form';
import PositionTable from './tables/position-table';
import TradeTable from './tables/trade-table';
import AccountTable from './tables/account-table';
import TickerControl from './ticker-control';
import StrategyTab from './strategy-tab';
import BacktestTab from './backtest-tab';
// load (Polyfill) EventSource, in case browser does not support it...
require('eventsource-polyfill');

var AlertBox = React.createClass( {
    ok() {
	this.props.ok();
    },
    clear() {
	this.props.clear();
    },
    render() {
	return (<Modal show={this.props.show}>
		<Modal.Header>
		</Modal.Header>
		<Modal.Body>
		<FormControl componentClass="textarea"
		value={this.props.text} />
		<Button
		onClick={this.ok}>
		OK
		</Button>
		<Button
		onClick={this.clear}>
		Clear
		</Button>
		</Modal.Body>
		</Modal>);
    }
});

var SubscribeBox = React.createClass( {
    getInitialState() {
	return {
	    source: this.connect()
	}
    },
    componentDidMount() {
    },
    connect() {
	var source = new EventSource(this.props.url);

	var obj = this;
	$.each(this.props.event, function(k, v) {
	    source.addEventListener(k, v);
	});
	source.onerror = function(e) {
	    obj.props.onerror(e);
	};
	return source;
    },
    reconnect(callback) {
	console.log("reconnect", this.state.source.readyState);
	if (this.state.source.readyState == EventSource.CLOSED) {
	    console.log("closed");
	    var source = this.connect();
	    this.setState({source: source});
	}
	console.log("callback");
	callback();
    },
    render() {
        return null;
    }
});

function publish() {
    $.get("/ping");
}

var data = [];

var SpTraderApp = React.createClass({
    getInitialState() {
	var l = this;
	$.getJSON("/login-info", function(d) {
	    if (parseInt(d.status) != -1) {
		l.setState({showLoginForm: false});
		l.fillTables();
	    }
	    if (d.connected != undefined) {
		l.setState({connection_info: d.connected});
	    }
	    if (d.account_info != undefined) {
		l.setState({account_info: d.account_info});
	    }
	    if (d.account_fields != undefined) {
	    	l.setState({account_fields: d.account_fields});
	    }
	    if (d.strategy_list != undefined) {
	    	l.setState({strategy_list: d.strategy_list});
	    }
	    if (d.strategy_data != undefined) {
	    	l.setState({strategy_data: d.strategy_data});
	    }
	    if (d.strategy_headers != undefined) {
	    	l.setState({strategy_headers: d.strategy_headers});
	    }
	    l.setState({info: d.info});
	});

	return {
	    log: '',
	    loginLabel: '',
	    account_info: {},
	    connection_info: {},
	    showLoginForm: true,
	    showOrderForm: false,
	    showAlertBox: false,
	    alertText: '',
	    tickers: [],
	    orders: [],
	    trades: [],
	    positions: [],
	    account_fields: [],
	    strategy_info: {},
	    strategy_data: {},
	    strategy_headers: {},
	    strategy_list: []
	};
    },
    submitModal(data) {
	this._subscribe_box.reconnect(function() {
	    $.post('/login', data);
	});
    },
    logout() {
	$.get("/logout");
	this.setState({loginLabel: '',
		       showLoginForm: true});
    },
    onerror(event) {
	if (!this.state.showLoginForm) {
	    this.setState({loginLabel: 'Connection broken',
			   showLoginForm: true});
	}
    },
    addToLog(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
    },
    loginReply(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
	if (parseInt(data.ret_code) != 0) {
	    this.setState({loginLabel: data.ret_msg});
	} else {
	    this.setState({showLoginForm: false});
	}
    },
    connectedReply(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
	var conn_info = this.state.connection_info;
	var host_type = parseInt(data.host_type);
	var con_status = parseInt(data.con_status);
	conn_info[host_type] = con_status;
	this.setState({conn_info: conn_info})
	if (parseInt(host_type) == 80 &&
	    parseInt(con_status) == 2) {
	    this.fillTables();
	}
    },
    fillTables() {
	var l = this;
	$.getJSON("/account-info");
	$.getJSON("/ticker/list", function(d) {
	    l.setState({tickers: d.data});
	});
	$.getJSON("/order/list", function(d) {
	    l.setState({orders: d.data});
	});
	$.getJSON("/trade/list", function(d) {
	    l.setState({trades: d.data});
	});
    },
    showOrderForm(event) {
	this.setState({showOrderForm: true});
    },
    hideOrderForm(event) {
	this.setState({showOrderForm: false});
    },
    hideAlertBox(event) {
	this.setState({showAlertBox: false});
    },
    clearAlertBox(event) {
	this.setState({alertText: ""});
    },
    orderFailed(event) {
	this.setState({alertText: this.state.alertText + "\n" +
		       JSON.stringify(event.data),
		       showAlertBox: true});
    },
    submitOrder(data) {
	console.log(data);
	$.post('/order/add', data);
	this.setState({showOrderForm: false});
    },
    accountInfoPush(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({account_info: data.data});
    },
    updateTickers(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({tickers: data.data});
    },
    updateTrades(event) {
	var data = JSON.parse(event.data).data;
	var d = this.state.trades;
	var found = false;
	console.log(data);
	for (var i =0; i < d.length; i++) {
	    if (d[i].IntOrderNo == data.IntOrderNo) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    d.push(data);
	}
	this.setState({trades: d});
    },
    updateOrders(event) {
	var data = JSON.parse(event.data).data;
	console.log(data);
	var d = this.state.orders;
	var found = false;
	for (var i =0; i < d.length; i++) {
	    if (parseInt(d[i].IntOrderNo) == parseInt(data.IntOrderNo)) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    console.log("order added");
	    d.push(data);
	}
	console.log("orders", d);
	this.setState({orders: d});
    },
    updatePositions(event) {
	var data = JSON.parse(event.data).data;
	console.log(data);
	var d = this.state.positions;
	var found = false;
	for (var i =0; i < d.length; i++) {
	    if (d[i].ProdCode == data.ProdCode) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    console.log("position added");
	    d.push(data);
	}
	console.log("position", d);
	this.setState({positions: d});
    },
    strategyStatus(event) {
	var data = JSON.parse(event.data);
	console.log(data);
	var d = this.state.strategy_info;
	if (d[data['strategy']] == undefined) {
	    d[data['strategy']] = {};
	}
	d[data['strategy']][data['id']] =
	    {status: data['status'],
	     comment: data['comment']};
	console.log(d);
	this.setState({strategy_info: d});
    },
    render() {
	var events = {
	    "ping" : this.addToLog,
	    "LoginReply" : this.loginReply,
	    "ConnectedReply" : this.connectedReply,
	    "OrderRequestFailed" : this.orderFailed,
	    "OrderReport" : this.updateOrders,
	    "OrderBeforeSendReport" : this.addToLog,
	    "AccountLoginReply" : this.addToLog,
	    "AccountInfoPush" : this.accountInfoPush,
	    "AccountPositionPush" : this.updatePositions,
	    "UpdatedAccountPositionPush" : this.addToLog,
	    "UpdatedAccountBalancePush" : this.addToLog,
	    "TradeReport" : this.updateTrades,
	    "PriceUpdate" : this.addToLog,
	    "TickerUpdate" : this.updateTickers,
	    "PswChangeReply" : this.addToLog,
	    "ProductListByCodeReply" : this.addToLog,
	    "InstrumentListReply" : this.addToLog,
	    "BusinessDateReply" : this.addToLog,
	    "MMOrderBeforeSendReport" : this.addToLog,
	    "MMOrderRequestFailed" : this.addToLog,
	    "QuoteRequestReceived" : this.addToLog,
	    "LocalStrategyStatus" : this.strategyStatus
	}
	return(

	    	<SubscribeBox url="/log/subscribe" event={events}
	       onerror={this.onerror}
	       ref={(c) => this._subscribe_box = c}
	       />

		<Tabs id="tabs">
		<Tab eventKey={1} title="Account" >
		<LoginForm show={this.state.showLoginForm}
	    label={this.state.loginLabel}
	    data={this.state.info}
	    onSubmit={this.submitModal}/>
		<Button bsStyle="success" onClick={this.logout}>Logout</Button>
		<ConnectionTable data={this.state.connection_info}/>
		<Tabs id="tab1">
		<Tab eventKey={1} title="Account" >
		<AccountTable
	    fields={this.state.account_fields}
	    data={this.state.account_info} />
		</Tab>
		<Tab eventKey={2} title="Order" >
		<AlertBox show={this.state.showAlertBox}
	    text={this.state.alertText}
	    ok={this.hideAlertBox}
	    clear={this.clearAlertBox} />
		<OrderForm show={this.state.showOrderForm}
	    onSubmit={this.submitOrder}
	    onCancel={this.hideOrderForm}/>

		<Button bsStyle="success" onClick={this.showOrderForm}>Show Order Form</Button>
		<OrderTable data={this.state.orders} />
		</Tab>
		<Tab eventKey={3} title="Position" >
		<PositionTable data={this.state.positions} />
		</Tab>
		<Tab eventKey={4} title="Trade" >
		<TradeTable data={this.state.trades}/>
		</Tab>
		<Tab eventKey={5} title="Ticker" >
		<TickerControl tickers={this.state.tickers}/>
		</Tab>
		</Tabs>
		</Tab>
		<Tab eventKey={2} title="Strategy" >
		<StrategyTab info={this.state.strategy_info}
	       strategylist={this.state.strategy_list}
	       headers={this.state.strategy_headers}
	       data={this.state.strategy_data}
	       />
		</Tab>
		<Tab eventKey={3} title="Backtest" >
	       <BacktestTab strategylist={this.state.strategy_list}
	       headers={this.state.strategy_headers}
	       data={this.state.strategy_data}
	       />
		</Tab>
		<Tab eventKey={4} title="Scratchpad">
		<ButtonToolbar>
		<Button bsStyle="success" onClick={publish}>Ping</Button>
		</ButtonToolbar>
		<FormControl componentClass="textarea" value={this.state.log} />
	       <SampleTable/>
           <Form inline horizontal className="backtest-control">
	       <Button onClick={this.backtest}>Backtest</Button>
	                      <Checkbox inline>Upload</Checkbox>
	                      <FormControl
	                  type='file' label='Upload' accept='.txt'/>
	                      </Form>
		</Tab>
	       </Tabs>

	)
    }
});

ReactDOM.render(
    <SpTraderApp />,
    document.getElementById('test')
);
<commit_msg>es6-ize classes<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import {Tabs, Tab, ButtonToolbar, Button, FormControl,
	FormGroup, ControlLabel, HelpBlock, Modal,
	Form,Checkbox} from 'react-bootstrap';
import ReactAddonsLinkedStateMixin from 'react-addons-linked-state-mixin';
import {AgGridReact} from 'ag-grid-react';
import LoginForm from './login-form';
import ConnectionTable from './tables/connection-table';
import SampleTable from './tables/sample-table';
import OrderTable from './tables/order-table';
import OrderForm from './order-form';
import PositionTable from './tables/position-table';
import TradeTable from './tables/trade-table';
import AccountTable from './tables/account-table';
import TickerControl from './ticker-control';
import StrategyTab from './strategy-tab';
import BacktestTab from './backtest-tab';
// load (Polyfill) EventSource, in case browser does not support it...
require('eventsource-polyfill');

class AlertBox extends React.Component {
    ok() {
	this.props.ok();
    }
    clear() {
	this.props.clear();
    }
    render() {
	return (<Modal show={this.props.show}>
		<Modal.Header>
		</Modal.Header>
		<Modal.Body>
		<FormControl componentClass="textarea"
		value={this.props.text} />
		<Button
		onClick={this.ok.bind(this)}>
		OK
		</Button>
		<Button
		onClick={this.clear.bind(this)}>
		Clear
		</Button>
		</Modal.Body>
		</Modal>);
    }
}

class SubscribeBox extends React.Component {
    constructor(props) {
	super(props);
	this.state = {
	    source: this.connect()
	}
    }
    connect() {
	var source = new EventSource(this.props.url);

	var obj = this;
	$.each(this.props.event, function(k, v) {
	    source.addEventListener(k, v);
	});
	source.onerror = function(e) {
	    obj.props.onerror(e);
	};
	return source;
    }
    reconnect(callback) {
	console.log("reconnect", this.state.source.readyState);
	if (this.state.source.readyState == EventSource.CLOSED) {
	    console.log("closed");
	    var source = this.connect();
	    this.setState({source: source});
	}
	console.log("callback");
	callback();
    }
    render() {
        return null;
    }
}

function publish() {
    $.get("/ping");
}

var data = [];

var SpTraderApp = React.createClass({
    getInitialState() {
	var l = this;
	$.getJSON("/login-info", function(d) {
	    if (parseInt(d.status) != -1) {
		l.setState({showLoginForm: false});
		l.fillTables();
	    }
	    if (d.connected != undefined) {
		l.setState({connection_info: d.connected});
	    }
	    if (d.account_info != undefined) {
		l.setState({account_info: d.account_info});
	    }
	    if (d.account_fields != undefined) {
	    	l.setState({account_fields: d.account_fields});
	    }
	    if (d.strategy_list != undefined) {
	    	l.setState({strategy_list: d.strategy_list});
	    }
	    if (d.strategy_data != undefined) {
	    	l.setState({strategy_data: d.strategy_data});
	    }
	    if (d.strategy_headers != undefined) {
	    	l.setState({strategy_headers: d.strategy_headers});
	    }
	    l.setState({info: d.info});
	});

	return {
	    log: '',
	    loginLabel: '',
	    account_info: {},
	    connection_info: {},
	    showLoginForm: true,
	    showOrderForm: false,
	    showAlertBox: false,
	    alertText: '',
	    tickers: [],
	    orders: [],
	    trades: [],
	    positions: [],
	    account_fields: [],
	    strategy_info: {},
	    strategy_data: {},
	    strategy_headers: {},
	    strategy_list: []
	};
    },
    submitModal(data) {
	this._subscribe_box.reconnect(function() {
	    $.post('/login', data);
	});
    },
    logout() {
	$.get("/logout");
	this.setState({loginLabel: '',
		       showLoginForm: true});
    },
    onerror(event) {
	if (!this.state.showLoginForm) {
	    this.setState({loginLabel: 'Connection broken',
			   showLoginForm: true});
	}
    },
    addToLog(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
    },
    loginReply(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
	if (parseInt(data.ret_code) != 0) {
	    this.setState({loginLabel: data.ret_msg});
	} else {
	    this.setState({showLoginForm: false});
	}
    },
    connectedReply(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({log: this.state.log + event.data + "\n"});
	var conn_info = this.state.connection_info;
	var host_type = parseInt(data.host_type);
	var con_status = parseInt(data.con_status);
	conn_info[host_type] = con_status;
	this.setState({conn_info: conn_info})
	if (parseInt(host_type) == 80 &&
	    parseInt(con_status) == 2) {
	    this.fillTables();
	}
    },
    fillTables() {
	var l = this;
	$.getJSON("/account-info");
	$.getJSON("/ticker/list", function(d) {
	    l.setState({tickers: d.data});
	});
	$.getJSON("/order/list", function(d) {
	    l.setState({orders: d.data});
	});
	$.getJSON("/trade/list", function(d) {
	    l.setState({trades: d.data});
	});
    },
    showOrderForm(event) {
	this.setState({showOrderForm: true});
    },
    hideOrderForm(event) {
	this.setState({showOrderForm: false});
    },
    hideAlertBox(event) {
	this.setState({showAlertBox: false});
    },
    clearAlertBox(event) {
	this.setState({alertText: ""});
    },
    orderFailed(event) {
	this.setState({alertText: this.state.alertText + "\n" +
		       JSON.stringify(event.data),
		       showAlertBox: true});
    },
    submitOrder(data) {
	console.log(data);
	$.post('/order/add', data);
	this.setState({showOrderForm: false});
    },
    accountInfoPush(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({account_info: data.data});
    },
    updateTickers(event) {
	data = JSON.parse(event.data);
	console.log(data);
	this.setState({tickers: data.data});
    },
    updateTrades(event) {
	var data = JSON.parse(event.data).data;
	var d = this.state.trades;
	var found = false;
	console.log(data);
	for (var i =0; i < d.length; i++) {
	    if (d[i].IntOrderNo == data.IntOrderNo) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    d.push(data);
	}
	this.setState({trades: d});
    },
    updateOrders(event) {
	var data = JSON.parse(event.data).data;
	console.log(data);
	var d = this.state.orders;
	var found = false;
	for (var i =0; i < d.length; i++) {
	    if (parseInt(d[i].IntOrderNo) == parseInt(data.IntOrderNo)) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    console.log("order added");
	    d.push(data);
	}
	console.log("orders", d);
	this.setState({orders: d});
    },
    updatePositions(event) {
	var data = JSON.parse(event.data).data;
	console.log(data);
	var d = this.state.positions;
	var found = false;
	for (var i =0; i < d.length; i++) {
	    if (d[i].ProdCode == data.ProdCode) {
		d[i] = data;
		found = true;
	    }
	}
	if (!found) {
	    console.log("position added");
	    d.push(data);
	}
	console.log("position", d);
	this.setState({positions: d});
    },
    strategyStatus(event) {
	var data = JSON.parse(event.data);
	console.log(data);
	var d = this.state.strategy_info;
	if (d[data['strategy']] == undefined) {
	    d[data['strategy']] = {};
	}
	d[data['strategy']][data['id']] =
	    {status: data['status'],
	     comment: data['comment']};
	console.log(d);
	this.setState({strategy_info: d});
    },
    render() {
	var events = {
	    "ping" : this.addToLog,
	    "LoginReply" : this.loginReply,
	    "ConnectedReply" : this.connectedReply,
	    "OrderRequestFailed" : this.orderFailed,
	    "OrderReport" : this.updateOrders,
	    "OrderBeforeSendReport" : this.addToLog,
	    "AccountLoginReply" : this.addToLog,
	    "AccountInfoPush" : this.accountInfoPush,
	    "AccountPositionPush" : this.updatePositions,
	    "UpdatedAccountPositionPush" : this.addToLog,
	    "UpdatedAccountBalancePush" : this.addToLog,
	    "TradeReport" : this.updateTrades,
	    "PriceUpdate" : this.addToLog,
	    "TickerUpdate" : this.updateTickers,
	    "PswChangeReply" : this.addToLog,
	    "ProductListByCodeReply" : this.addToLog,
	    "InstrumentListReply" : this.addToLog,
	    "BusinessDateReply" : this.addToLog,
	    "MMOrderBeforeSendReport" : this.addToLog,
	    "MMOrderRequestFailed" : this.addToLog,
	    "QuoteRequestReceived" : this.addToLog,
	    "LocalStrategyStatus" : this.strategyStatus
	}
	return(

	    	<SubscribeBox url="/log/subscribe" event={events}
	       onerror={this.onerror}
	       ref={(c) => this._subscribe_box = c}
	       />

		<Tabs id="tabs">
		<Tab eventKey={1} title="Account" >
		<LoginForm show={this.state.showLoginForm}
	    label={this.state.loginLabel}
	    data={this.state.info}
	    onSubmit={this.submitModal}/>
		<Button bsStyle="success" onClick={this.logout}>Logout</Button>
		<ConnectionTable data={this.state.connection_info}/>
		<Tabs id="tab1">
		<Tab eventKey={1} title="Account" >
		<AccountTable
	    fields={this.state.account_fields}
	    data={this.state.account_info} />
		</Tab>
		<Tab eventKey={2} title="Order" >
		<AlertBox show={this.state.showAlertBox}
	    text={this.state.alertText}
	    ok={this.hideAlertBox}
	    clear={this.clearAlertBox} />
		<OrderForm show={this.state.showOrderForm}
	    onSubmit={this.submitOrder}
	    onCancel={this.hideOrderForm}/>

		<Button bsStyle="success" onClick={this.showOrderForm}>Show Order Form</Button>
		<OrderTable data={this.state.orders} />
		</Tab>
		<Tab eventKey={3} title="Position" >
		<PositionTable data={this.state.positions} />
		</Tab>
		<Tab eventKey={4} title="Trade" >
		<TradeTable data={this.state.trades}/>
		</Tab>
		<Tab eventKey={5} title="Ticker" >
		<TickerControl tickers={this.state.tickers}/>
		</Tab>
		</Tabs>
		</Tab>
		<Tab eventKey={2} title="Strategy" >
		<StrategyTab info={this.state.strategy_info}
	       strategylist={this.state.strategy_list}
	       headers={this.state.strategy_headers}
	       data={this.state.strategy_data}
	       />
		</Tab>
		<Tab eventKey={3} title="Backtest" >
	       <BacktestTab strategylist={this.state.strategy_list}
	       headers={this.state.strategy_headers}
	       data={this.state.strategy_data}
	       />
		</Tab>
		<Tab eventKey={4} title="Scratchpad">
		<ButtonToolbar>
		<Button bsStyle="success" onClick={publish}>Ping</Button>
		</ButtonToolbar>
		<FormControl componentClass="textarea" value={this.state.log} />
	       <SampleTable/>
           <Form inline horizontal className="backtest-control">
	       <Button onClick={this.backtest}>Backtest</Button>
	                      <Checkbox inline>Upload</Checkbox>
	                      <FormControl
	                  type='file' label='Upload' accept='.txt'/>
	                      </Form>
		</Tab>
	       </Tabs>

	)
    }
});

ReactDOM.render(
    <SpTraderApp />,
    document.getElementById('test')
);
<|endoftext|>


<commit_before>Package.describe({
  name: 'dpankros:bootstrap-alerts',
  version: '1.0',
  // Brief, one-line summary of the package.
  summary: 'Bootstrap3 alerts with categories and auto-dismiss',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/dpankros/meteor-bootstrap-alerts',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.1');
  api.use([
    'ecmascript',
    'livedata',
    'underscore',
    'deps',
    'templating',
    'ui',
    'blaze',
    'ejson',
    'reactive-var',
    'reactive-dict',
    'random',
    'jquery',
    'dpankros:timer'
  ], 'client');

  api.imply('dpankros:timer');

  api.addFiles([
    'bootstrap-alerts.html',
    'bootstrap-alerts.js'
  ], 'client');

  api.export([
    'AlertCategory',
    'BootstrapAlert'
  ],
  'client');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('dpankros:bootstrap-alerts');
  //api.addFiles('bootstrap-alerts-tests.js');
});
<commit_msg>updated version number<commit_after>Package.describe({
  name: 'dpankros:bootstrap-alerts',
  version: '1.0.0',
  // Brief, one-line summary of the package.
  summary: 'Bootstrap3 alerts with categories and auto-dismiss',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/dpankros/meteor-bootstrap-alerts',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.1');
  api.use([
    'ecmascript',
    'livedata',
    'underscore',
    'deps',
    'templating',
    'ui',
    'blaze',
    'ejson',
    'reactive-var',
    'reactive-dict',
    'random',
    'jquery',
    'dpankros:timer'
  ], 'client');

  api.imply('dpankros:timer');

  api.addFiles([
    'bootstrap-alerts.html',
    'bootstrap-alerts.js'
  ], 'client');

  api.export([
    'AlertCategory',
    'BootstrapAlert'
  ],
  'client');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('dpankros:bootstrap-alerts');
  //api.addFiles('bootstrap-alerts-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
    documentation: "README.md",
    summary: "Base model with type-checking and constraint validation",
    git: "https://github.com/ericching/js-base-model.git"
});

Package.on_use(function (api) {
    api.use('underscore', ['client', 'server']);

    api.add_files('src/baseModel.js', ['client', 'server']);

    if (typeof api.export !== 'undefined') {
        api.export('BaseModel', ['client', 'server']);
    }
});

Package.on_test(function (api) {
    api.add_files('test/baseModelTest.js', ['client', 'server']);
});
<commit_msg>Add version to package.js<commit_after>Package.describe({
    documentation: "README.md",
    summary: "Base model with type-checking and constraint validation",
    git: "https://github.com/ericching/js-base-model.git",
    version: "0.2.5"
});

Package.on_use(function (api) {
    api.use('underscore', ['client', 'server']);

    api.add_files('src/baseModel.js', ['client', 'server']);

    if (typeof api.export !== 'undefined') {
        api.export('BaseModel', ['client', 'server']);
    }
});

Package.on_test(function (api) {
    api.add_files('test/baseModelTest.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>_RELEASE_VERSION="1.3.1"

Package.describe({
  name: "houston:admin",
  summary: "A zero-config Meteor Admin",
  version: _RELEASE_VERSION,
  git: "https://github.com/gterrono/houston.git"
});

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

  //////////////////////////////////////////////////////////////////
  // Meteor-provided packages
  //////////////////////////////////////////////////////////////////
  api.use('deps@1.0.0', ['client', 'server']);
  api.use('coffeescript@1.0.0', ['client', 'server']);
  api.use('accounts-base@1.0.0', ['client', 'server']);  // ?optional
  api.use('accounts-password@1.0.0', ['client', 'server']);
  api.use('templating@1.0.0', 'client');  // ?optional
  api.use('check@1.0.0', 'client');
  api.use('spacebars@1.0.0', 'client');

  //////////////////////////////////////////////////////////////////
  // Third-party package dependencies
  //////////////////////////////////////////////////////////////////
  api.use('iron:router@1.0.1', 'client');
  api.use('tmeasday:paginated-subscription@0.2.4', 'client');

  //////////////////////////////////////////////////////////////////
  // internal files
  //////////////////////////////////////////////////////////////////
  // load html first, https://github.com/meteor/meteor/issues/282
  api.add_files([
    // views
    'client/admin_login.html', 'client/db_view.html',
    'client/collection_view.html', 'client/document_view.html',
    'client/admin_change_password.html', 'client/custom_template_view.html',
    // partials
    'client/partials/admin_nav.html',
    'client/partials/flash_message.html',
    'client/partials/custom_actions.html',
    // layout
    'client/master_layout.html',
    'client/third-party/collapse.js.html',
    'client/third-party/bootstrap.html',
    'client/style.css.html'
    ],
  'client');

  api.add_files(['lib/collections.coffee',
                 'lib/shared.coffee',
                 'lib/menu.coffee'],
                ['client', 'server']);

  api.add_files([
    // shared
    'client/lib/shared.coffee',
    // shared partials
    'client/partials/admin_nav.coffee',
    'client/partials/flash_message.coffee',
    'client/partials/custom_actions.coffee',
    // view logic
    'client/custom_template_view.coffee', 'client/admin_login.coffee',
    'client/collection_view.coffee', 'client/document_view.coffee',
    'client/admin_change_password.coffee', 'client/db_view.coffee',
    // router
    'client/router.coffee'
    ],
  'client');

  api.add_files(['server/publications.coffee', 'server/exports.coffee', 'server/methods.coffee'], 'server');
});
<commit_msg>bumped version to 1.3.2<commit_after>_RELEASE_VERSION = "1.3.2"

Package.describe({
  name: "houston:admin",
  summary: "A zero-config Meteor Admin",
  version: _RELEASE_VERSION,
  git: "https://github.com/gterrono/houston.git"
});

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

  //////////////////////////////////////////////////////////////////
  // Meteor-provided packages
  //////////////////////////////////////////////////////////////////
  api.use('deps@1.0.0', ['client', 'server']);
  api.use('coffeescript@1.0.0', ['client', 'server']);
  api.use('accounts-base@1.0.0', ['client', 'server']);  // ?optional
  api.use('accounts-password@1.0.0', ['client', 'server']);
  api.use('templating@1.0.0', 'client');  // ?optional
  api.use('check@1.0.0', 'client');
  api.use('spacebars@1.0.0', 'client');

  //////////////////////////////////////////////////////////////////
  // Third-party package dependencies
  //////////////////////////////////////////////////////////////////
  api.use('iron:router@1.0.1', 'client');
  api.use('tmeasday:paginated-subscription@0.2.4', 'client');

  //////////////////////////////////////////////////////////////////
  // internal files
  //////////////////////////////////////////////////////////////////
  // load html first, https://github.com/meteor/meteor/issues/282
  api.add_files([
    // views
    'client/admin_login.html', 'client/db_view.html',
    'client/collection_view.html', 'client/document_view.html',
    'client/admin_change_password.html', 'client/custom_template_view.html',
    // partials
    'client/partials/admin_nav.html',
    'client/partials/flash_message.html',
    'client/partials/custom_actions.html',
    // layout
    'client/master_layout.html',
    'client/third-party/collapse.js.html',
    'client/third-party/bootstrap.html',
    'client/style.css.html'
    ],
  'client');

  api.add_files(['lib/collections.coffee',
                 'lib/shared.coffee',
                 'lib/menu.coffee'],
                ['client', 'server']);

  api.add_files([
    // shared
    'client/lib/shared.coffee',
    // shared partials
    'client/partials/admin_nav.coffee',
    'client/partials/flash_message.coffee',
    'client/partials/custom_actions.coffee',
    // view logic
    'client/custom_template_view.coffee', 'client/admin_login.coffee',
    'client/collection_view.coffee', 'client/document_view.coffee',
    'client/admin_change_password.coffee', 'client/db_view.coffee',
    // router
    'client/router.coffee'
    ],
  'client');

  api.add_files(['server/publications.coffee', 'server/exports.coffee', 'server/methods.coffee'], 'server');
});
<|endoftext|>


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

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

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

    var packages = [
        'heaven7:wsl-core@0.0.1',
        'tap:i18n@1.5.1',
        'tap:i18n-ui@0.4.1'
    ];

    api.use(packages, both);
    api.imply(packages);

    api.use('session', 'client');

    api.addFiles('lib/both/i18n.js', both);
});
<commit_msg>update packages, meteor v1.2<commit_after>Package.describe({
  name: 'heaven7:wsl-i18n',
  version: '0.0.2',
  summary: 'I18n package',
  git: 'https://github.com/heaven7/wsl-i18n.git',
  documentation: 'README.md'
});

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

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

    var packages = [
        'heaven7:wsl-core@0.0.1',
        'tap:i18n@1.7.0',
        'tap:i18n-ui@0.7.0'
    ];

    api.use(packages, both);
    api.imply(packages);

    api.use('session', 'client');

    api.addFiles('lib/both/i18n.js', both);
});
<|endoftext|>


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

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

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

    var packages =
        [
            'meteor-platform',
            'standard-app-packages',
            'service-configuration',
            'multiply:iron-router-progress@1.0.1',
            'matb33:collection-hooks@0.7.14',
            'aldeed:collection2@2.3.3',
            'aldeed:autoform@5.5.0',
            'aldeed:simple-schema@1.3.3',
            'dburles:mongo-collection-instances@0.3.4',
            'dburles:collection-helpers@1.0.3',
            'raix:handlebar-helpers@0.2.3',
            'reactive-var',
            'meteorhacks:npm',
            'http',
            'email',
            'mrt:moment@1.7.0',
            'coffeescript',
            'templating',
            'msavin:mongol'
        ];

    api.use(packages);
    api.imply(packages);

    api.addFiles([,
        'lib/core.js',
        'lib/router.js',
        'lib/schemas.js',
        'lib/callbacks.js'
    ], both);

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

    api.addFiles([
        'lib/client/helpers.js'
    ], 'client');

    api.export([
        'Schemas',
        'WSL'
    ]);

});
<commit_msg>roles package<commit_after>Package.describe({
  name: 'heaven7:wsl-core',
  version: '0.0.1',
  summary: 'Core functionality package',
  git: 'https://github.com/heaven7/wsl-core.git',
  documentation: 'README.md'
});

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

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

    var packages =
        [
            'meteor-platform',
            'standard-app-packages',
            'service-configuration',
            'multiply:iron-router-progress@1.0.1',
            'matb33:collection-hooks@0.7.14',
            'aldeed:collection2@2.3.3',
            'aldeed:autoform@5.5.0',
            'aldeed:simple-schema@1.3.3',
            'dburles:mongo-collection-instances@0.3.4',
            'dburles:collection-helpers@1.0.3',
            'raix:handlebar-helpers@0.2.3',
            'reactive-var',
            'alanning:roles',
            'meteorhacks:npm',
            'http',
            'email',
            'mrt:moment@1.7.0',
            'coffeescript',
            'templating',
            'msavin:mongol'
        ];

    api.use(packages);
    api.imply(packages);

    api.addFiles([,
        'lib/core.js',
        'lib/router.js',
        'lib/schemas.js',
        'lib/callbacks.js'
    ], both);

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

    api.addFiles([
        'lib/client/helpers.js'
    ], 'client');

    api.export([
        'Schemas',
        'WSL'
    ]);

});
<|endoftext|>


<commit_before>Package.describe({
  name: 'jagi:astronomy-softremove-behavior',
  version: '2.0.4',
  summary: 'Soft remove behavior for Meteor Astronomy',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

Npm.depends({
  lodash: '4.13.1'
});

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

  api.use([
    'ecmascript',
    'es5-shim',
    'jagi:astronomy@2.0.0'
  ], ['client', 'server']);

  api.mainModule('lib/main.js', ['client', 'server']);
});<commit_msg>Bump version to 2.0.5<commit_after>Package.describe({
  name: 'jagi:astronomy-softremove-behavior',
  version: '2.0.5',
  summary: 'Soft remove behavior for Meteor Astronomy',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

Npm.depends({
  lodash: '4.16.6'
});

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

  api.use([
    'ecmascript',
    'es5-shim',
    'jagi:astronomy@2.2.4'
  ], ['client', 'server']);

  api.mainModule('lib/main.js', ['client', 'server']);
});<|endoftext|>


<commit_before>Package.describe({
	name: 'nathantreid:css-modules-mss-compiler',
	version: '0.0.1',
	// Brief, one-line summary of the package.
	summary: 'CSS modules MSS compiler.',
	// URL to the Git repository containing the source code for this package.
	git: 'https://github.com/nathantreid/meteor-css-modules-mss-compiler.git',
	// By default, Meteor will default to using README.md for documentation.
	// To avoid submitting documentation, set this field to null.
	documentation: 'README.md'
});

Package.onUse(function (api) {
	api.versionsFrom('1.2.0.1');
	api.use([
		'ecmascript',
		'nathantreid:css-modules-import-path-helpers@0.0.1'
	]);

	api.addFiles([
		'css-modules-js-template.js',
		'css-processor.js',
		'css-modules-compiler.js'
	]);

	api.export("ImportPathHelpers");
	api.export("CssModulesCompiler");
});

Npm.depends({
	'css-modules-loader-core': '1.0.0'
});
<commit_msg>version bump<commit_after>Package.describe({
	name: 'nathantreid:css-modules-mss-compiler',
	version: '0.0.2',
	// Brief, one-line summary of the package.
	summary: 'CSS modules MSS compiler.',
	// URL to the Git repository containing the source code for this package.
	git: 'https://github.com/nathantreid/meteor-css-modules-mss-compiler.git',
	// By default, Meteor will default to using README.md for documentation.
	// To avoid submitting documentation, set this field to null.
	documentation: 'README.md'
});

Package.onUse(function (api) {
	api.versionsFrom('1.2.0.1');
	api.use([
		'ecmascript',
		'nathantreid:css-modules-import-path-helpers@0.0.1'
	]);

	api.addFiles([
		'css-modules-js-template.js',
		'css-processor.js',
		'css-modules-compiler.js'
	]);

	api.export("ImportPathHelpers");
	api.export("CssModulesCompiler");
});

Npm.depends({
	'css-modules-loader-core': '1.0.0'
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "Angular video player directive",
  version: "0.0.5",
  name: 'harellevy:videogular',
  git: "https://github.com/harellevy/videogular-meteor.git"
});

Package.onUse(function (api) {
  api.versionsFrom('0.9.0');
  api.use('urigo:angular@0.7.2', 'client');
  api.use('angularjs:angular-sanitize@1.3.6', 'client');

  // Load angular-file-upload lib.
  api.addFiles('lib/bower_components/videogular/videogular.min.js', 'client');

  // Support for old versions of angular-meteor
  api.addFiles('init.js', 'client');
});

Package.onTest(function (api) {
  api.use('tinytest');

  api.use('harellevy:videogular');

  api.addFiles('harellevy:videogular-meteor-tests.js', 'client');
});
<commit_msg>videogular with minimal tests, 1st working release<commit_after>Package.describe({
  summary: "Angular video player directive",
  version: "0.0.5",
  name: 'harellevy:videogular',
  git: "https://github.com/harellevy/meteor-videogular.git"
});

Package.onUse(function (api) {
  api.versionsFrom('0.9.0');
  api.use('urigo:angular@0.7.2', 'client');
  api.use('angularjs:angular-sanitize@1.3.6', 'client');

  // Load angular-file-upload lib.
  api.addFiles('lib/bower_components/videogular/videogular.min.js', 'client');

  // Support for old versions of angular-meteor
  api.addFiles('init.js', 'client');
});

Package.onTest(function (api) {
  api.use('tinytest');

  api.use('harellevy:videogular');

  api.addFiles('harellevy:videogular-meteor-tests.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: "practicalmeteor:underscore-deep",
  summary: "_.deep - get the value of a nested property.",
  version: "0.9.0",
  git: "https://github.com/practicalmeteor/meteor-underscore-deep"
});

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

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

  api.addFiles('underscore-deep.coffee');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:underscore-deep', 'spacejamio:munit']);

  api.addFiles('tests/underscore-deep-test.coffee');
});
<commit_msg>Depend on munit 2.1.1<commit_after>Package.describe({
  name: "practicalmeteor:underscore-deep",
  summary: "_.deep - get the value of a nested property.",
  version: "0.9.0",
  git: "https://github.com/practicalmeteor/meteor-underscore-deep"
});

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

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

  api.addFiles('underscore-deep.coffee');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:underscore-deep', 'spacejamio:munit@2.1.1']);

  api.addFiles('tests/underscore-deep-test.coffee');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'End to End debugging for Meteor apps',
  version: '0.0.1',
  git: 'https://github.com/meteorhacks/kadira-debug',
  name: "meteorhacks:kadira-debug",
  debugOnly: true
});

Package.onUse(function (api) {
  configure(api);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest');
});

function configure(api) {
  api.export(['KadiraDebug']);

  api.versionsFrom('1.0');
  api.use('blaze');
  api.use('templating');
  api.use('underscore');
  api.use('random');
  api.use('session');
  api.use('reload');
  api.use('mongo');
  api.use('tracker');
  api.use('meteorhacks:flow-router@0.0.16 || 1.0.0', {weak:true});
  api.use('iron:router@1.0.0', {weak:true});

  api.addFiles('lib/client/store.js', 'client');

  api.addFiles('lib/client/providers/blaze.js', 'client');
  api.addFiles('lib/client/providers/flow_router.js', 'client');
  api.addFiles('lib/client/providers/iron_router.js', 'client');
  api.addFiles('lib/client/providers/ddp.js', 'client');
  api.addFiles('lib/client/providers/hcr.js', 'client');

  api.addFiles('lib/client/connect.js', 'client');

  api.addFiles('lib/server/connect.js', 'server');
}<commit_msg>Update the version<commit_after>Package.describe({
  summary: 'Full Stack Debugging Solution for Meteor',
  version: '1.0.0',
  git: 'https://github.com/meteorhacks/kadira-debug',
  name: "meteorhacks:kadira-debug",
  debugOnly: true
});

Package.onUse(function (api) {
  configure(api);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest');
});

function configure(api) {
  api.export(['KadiraDebug']);

  api.versionsFrom('1.0');
  api.use('blaze');
  api.use('templating');
  api.use('underscore');
  api.use('random');
  api.use('session');
  api.use('reload');
  api.use('mongo');
  api.use('tracker');
  api.use('meteorhacks:flow-router@0.0.16 || 1.0.0', {weak:true});
  api.use('iron:router@1.0.0', {weak:true});

  api.addFiles('lib/client/store.js', 'client');

  api.addFiles('lib/client/providers/blaze.js', 'client');
  api.addFiles('lib/client/providers/flow_router.js', 'client');
  api.addFiles('lib/client/providers/iron_router.js', 'client');
  api.addFiles('lib/client/providers/ddp.js', 'client');
  api.addFiles('lib/client/providers/hcr.js', 'client');

  api.addFiles('lib/client/connect.js', 'client');

  api.addFiles('lib/server/connect.js', 'server');
}<|endoftext|>


<commit_before>Package.describe({
  summary: 'Reaction Rental Products - Enable rental and for-hire products',
  name: 'getoutfitted:reaction-rental-products',
  version: '0.2.0',
  git: 'https://github.com/getoutfitted/reaction-rental-products.git'
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@1.2.1');
  api.use('templating');
  api.use('underscore');
  api.use('ecmascript');
  api.use('random');
  api.use('momentjs:moment@2.10.6');
  api.use('momentjs:twix@0.7.0');
  api.use('matb33:collection-hooks');
  api.use('meteor-platform@1.2.1');
  api.use('reactioncommerce:core@0.9.5');
  api.use('reactioncommerce:reaction-inventory');
  api.use('aldeed:collection2@2.5.0');
  api.use('aldeed:simple-schema@1.3.3');
  api.use('aldeed:template-extension@4.0.0');
  api.use('aldeed:autoform@5.7.1');
  api.use('rajit:bootstrap3-datepicker@1.4.1', ['client']);
  // api.use('reactioncommerce:reaction-factories');

  api.imply('momentjs:moment'); // Make moment available to all packages
  api.imply('momentjs:twix'); // Make moment twix available to all packages
  api.addFiles('lib/rentalProducts.js');
  api.addFiles([
    'server/register.js'
  ], ['server']); // register as a reaction package

  api.addFiles([
    'server/methods/rentalProducts.js',
    'server/methods/orders.js',
    'server/methods/cart.js',
    'server/hooks.js'
  ], ['server']);

  api.addFiles([
    'common/common.js',
    'common/schemas/inventoryVariants.js',
    'common/schemas/rentalProducts.js', // Schema for rental products
    'common/schemas/rentalShops.js',
    'common/schemas/orders.js',
    'common/schemas/cart.js',
    'common/collections.js',
    'common/hooks.js',
    'common/routes.js'
  ], ['client', 'server']);

  // Helpers
  api.addFiles([
    'client/helpers/products.js'
  ], ['client']);

  // templates
  api.addFiles([
    // admin
    'client/templates/dashboard/settings/rentalShopSettings.html',
    'client/templates/dashboard/settings/rentalShopSettings.js',
    'client/templates/dashboard/rentalProducts/productList.html',
    'client/templates/dashboard/rentalProducts/productList.js',
    'client/templates/dashboard/rentalProducts/availability/availability.html',
    'client/templates/dashboard/rentalProducts/availability/availability.js',
    // customer facing
    'client/templates/cart/cartDrawer/rentalCartDrawer.html',
    'client/templates/products/productGrid/productGrid.html',
    'client/templates/products/productGrid/productGrid.js',
    'client/templates/products/productDetail/rentalProductDetail.html',
    'client/templates/products/productDetail/rentalProductDetail.js',
    'client/templates/products/productDetail/variant/variant.html',
    'client/templates/products/productDetail/variant/variant.js',
    'client/templates/products/productDetail/variant/variantForm/rentalVariantForm.html',
    'client/templates/products/productDetail/variant/variantForm/rentalVariantForm.js',
    'client/templates/products/productDetail/variant/variantForm/childVariant/rentalChildVariant.html',
    'client/templates/products/productDetail/variant/variantForm/childVariant/rentalChildVariant.js',
    'client/datepicker.html',
    'client/datepicker.js',
    'client/templates.js'
  ], ['client']);

  // Generating data
  // api.addFiles('server/factories.js', 'server');
});

Package.onTest(function (api) {
  api.use('underscore');
  api.use('random');
  api.use('momentjs:moment');
  api.use('momentjs:twix');
  api.use('sanjo:jasmine@0.15.2');
  api.use('dburles:factory@0.3.10');
  api.use('velocity:html-reporter@0.9.1');
  api.use('velocity:console-reporter@0.1.4');

  api.use('reactioncommerce:core');
  api.use('reactioncommerce:reaction-factories');
  api.use('reactioncommerce:bootstrap-theme');
  api.use('getoutfitted:reaction-rental-products'); // Add our own package as a dep for testing!

  api.addFiles('server/factories.js', 'server');
  api.addFiles('tests/jasmine/server/integration/rentalProducts.js', 'server');
  api.addFiles('tests/jasmine/server/integration/orders.js', 'server');
  api.addFiles('tests/jasmine/server/integration/cart.js', 'server');
});
<commit_msg>bump version<commit_after>Package.describe({
  summary: 'Reaction Rental Products - Enable rental and for-hire products',
  name: 'getoutfitted:reaction-rental-products',
  version: '0.2.0',
  git: 'https://github.com/getoutfitted/reaction-rental-products.git'
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@1.2.1');
  api.use('templating');
  api.use('underscore');
  api.use('ecmascript');
  api.use('random');
  api.use('momentjs:moment@2.10.6');
  api.use('momentjs:twix@0.7.0');
  api.use('matb33:collection-hooks');
  api.use('meteor-platform@1.2.1');
  api.use('reactioncommerce:core@0.11.0');
  api.use('reactioncommerce:reaction-inventory');
  api.use('aldeed:collection2@2.5.0');
  api.use('aldeed:simple-schema@1.3.3');
  api.use('aldeed:template-extension@4.0.0');
  api.use('aldeed:autoform@5.7.1');
  api.use('rajit:bootstrap3-datepicker@1.4.1', ['client']);
  // api.use('reactioncommerce:reaction-factories');

  api.imply('momentjs:moment'); // Make moment available to all packages
  api.imply('momentjs:twix'); // Make moment twix available to all packages
  api.addFiles('lib/rentalProducts.js');
  api.addFiles([
    'server/register.js'
  ], ['server']); // register as a reaction package

  api.addFiles([
    'server/methods/rentalProducts.js',
    'server/methods/orders.js',
    'server/methods/cart.js',
    'server/hooks.js'
  ], ['server']);

  api.addFiles([
    'common/common.js',
    'common/schemas/inventoryVariants.js',
    'common/schemas/rentalProducts.js', // Schema for rental products
    'common/schemas/rentalShops.js',
    'common/schemas/orders.js',
    'common/schemas/cart.js',
    'common/collections.js',
    'common/hooks.js',
    'common/routes.js'
  ], ['client', 'server']);

  // Helpers
  api.addFiles([
    'client/helpers/products.js'
  ], ['client']);

  // templates
  api.addFiles([
    // admin
    'client/templates/dashboard/settings/rentalShopSettings.html',
    'client/templates/dashboard/settings/rentalShopSettings.js',
    'client/templates/dashboard/rentalProducts/productList.html',
    'client/templates/dashboard/rentalProducts/productList.js',
    'client/templates/dashboard/rentalProducts/availability/availability.html',
    'client/templates/dashboard/rentalProducts/availability/availability.js',
    // customer facing
    'client/templates/cart/cartDrawer/rentalCartDrawer.html',
    'client/templates/products/productGrid/productGrid.html',
    'client/templates/products/productGrid/productGrid.js',
    'client/templates/products/productDetail/rentalProductDetail.html',
    'client/templates/products/productDetail/rentalProductDetail.js',
    'client/templates/products/productDetail/variant/variant.html',
    'client/templates/products/productDetail/variant/variant.js',
    'client/templates/products/productDetail/variant/variantForm/rentalVariantForm.html',
    'client/templates/products/productDetail/variant/variantForm/rentalVariantForm.js',
    'client/templates/products/productDetail/variant/variantForm/childVariant/rentalChildVariant.html',
    'client/templates/products/productDetail/variant/variantForm/childVariant/rentalChildVariant.js',
    'client/datepicker.html',
    'client/datepicker.js',
    'client/templates.js'
  ], ['client']);

  // Generating data
  // api.addFiles('server/factories.js', 'server');
});

Package.onTest(function (api) {
  api.use('underscore');
  api.use('random');
  api.use('momentjs:moment');
  api.use('momentjs:twix');
  api.use('sanjo:jasmine@0.15.2');
  api.use('dburles:factory@0.3.10');
  api.use('velocity:html-reporter@0.9.1');
  api.use('velocity:console-reporter@0.1.4');

  api.use('reactioncommerce:core');
  api.use('reactioncommerce:reaction-factories');
  api.use('reactioncommerce:bootstrap-theme');
  api.use('getoutfitted:reaction-rental-products'); // Add our own package as a dep for testing!

  api.addFiles('server/factories.js', 'server');
  api.addFiles('tests/jasmine/server/integration/rentalProducts.js', 'server');
  api.addFiles('tests/jasmine/server/integration/orders.js', 'server');
  api.addFiles('tests/jasmine/server/integration/cart.js', 'server');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'tomi:upload-server',
  summary: 'Upload server for Meteor. Allows to save and serve files from arbitrary directory',
  version: '1.3.4_3',
  git: 'https://github.com/tomitrescak/meteor-tomi-upload-server.git'
});

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

//  api.use('iron:router@1.0.3');
  api.use(['webapp', 'routepolicy'], 'server');

  api.addFiles('upload_server.js', ['server']);
  api.addFiles('router.js');

  // Export the object 'UploadServer' to packages or apps that use this package.
  api.export('UploadServer', 'server');
});

//Package.onTest(function(api) {
//  api.use('tinytest');
//  api.use('tomi:upload-server');
//  api.addFiles('upload-server-tests.js');
//});

Npm.depends({
  formidable: '1.0.15',
  imagemagick: '0.1.3',
  connect: '2.7.10'
})
<commit_msg>update formidable for Node 6.x compat<commit_after>Package.describe({
  name: 'tomi:upload-server',
  summary: 'Upload server for Meteor. Allows to save and serve files from arbitrary directory',
  version: '1.3.4_3',
  git: 'https://github.com/tomitrescak/meteor-tomi-upload-server.git'
});

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

//  api.use('iron:router@1.0.3');
  api.use(['webapp', 'routepolicy'], 'server');

  api.addFiles('upload_server.js', ['server']);
  api.addFiles('router.js');

  // Export the object 'UploadServer' to packages or apps that use this package.
  api.export('UploadServer', 'server');
});

//Package.onTest(function(api) {
//  api.use('tinytest');
//  api.use('tomi:upload-server');
//  api.addFiles('upload-server-tests.js');
//});

Npm.depends({
  formidable: '1.0.17',
  imagemagick: '0.1.3',
  connect: '2.7.10'
})
<|endoftext|>


<commit_before>Package.describe({
    name: 'smaltcreation:autoform-input-addon-icon',
    version: '1.0.0',
    summary: 'Input with bootstrap addon and custom icon for autoform'
});

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

    // Packages
    api.use([
        'underscore',
        'templating',
        'aldeed:autoform@5.3.2'
    ], 'client');

    // Files
    api.addFiles([
        'autoform-intl-tel-input.html',
        'autoform-intl-tel-input.js'
    ], 'client');
});
<commit_msg>Add compitablity with autoform 6<commit_after>Package.describe({
    name: 'smaltcreation:autoform-input-addon-icon',
    version: '1.0.0',
    summary: 'Input with bootstrap addon and custom icon for autoform'
});

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

    // Packages
    api.use([
        'underscore',
        'templating',
        'aldeed:autoform'
    ], 'client');

    // Files
    api.addFiles([
        'autoform-intl-tel-input.html',
        'autoform-intl-tel-input.js'
    ], 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'aramk:dropdown',
  summary: 'A reactive dropdown widget',
  version: '0.5.1',
  git: 'https://github.com/aramk/meteor-dropdown.git'
});

Package.on_use(function(api) {
  api.versionsFrom('METEOR@0.9.0');
  api.use(['templating', 'underscore', 'jquery'], 'client');
  api.use([
    'semantic:ui-css@2.0.8',
    'aldeed:autoform@5.1.2',
    'urbanetic:utility@1.0.0'
  ], 'client', {weak: true});
  api.add_files([
    'src/dropdown.html',
    'src/dropdown.js'
  ], 'client');
});
<commit_msg>Version 0.5.2<commit_after>Package.describe({
  name: 'aramk:dropdown',
  summary: 'A reactive dropdown widget',
  version: '0.5.2',
  git: 'https://github.com/aramk/meteor-dropdown.git'
});

Package.on_use(function(api) {
  api.versionsFrom('METEOR@0.9.0');
  api.use(['templating', 'underscore', 'jquery'], 'client');
  api.use([
    'semantic:ui-css@2.0.8',
    'aldeed:autoform@5.1.2',
    'urbanetic:utility@1.2.0'
  ], 'client', {weak: true});
  api.add_files([
    'src/dropdown.html',
    'src/dropdown.js'
  ], 'client');
});
<|endoftext|>


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

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

  api.use('jagi:astronomy@0.10.4');
  api.use('jagi:reactive-map@0.2.1');
  api.use('underscore');
  api.use('ui');

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles('lib/module/global.js', ['client', 'server']);
  api.addFiles('lib/module/error.js', ['client', 'server']);
  api.addFiles('lib/module/utils.js', ['client', 'server']);
  api.addFiles('lib/module/validator_definition.js', ['client', 'server']);
  api.addFiles('lib/module/validator.js', ['client', 'server']);
  api.addFiles('lib/module/init_module.js', ['client', 'server']);
  api.addFiles('lib/module/init_class.js', ['client', 'server']);
  api.addFiles('lib/module/init_instance.js', ['client', 'server']);
  api.addFiles('lib/module/module.js', ['client', 'server']);

  // Type validators.
  api.addFiles('lib/validators/type/string.js', ['client', 'server']);
  api.addFiles('lib/validators/type/number.js', ['client', 'server']);
  api.addFiles('lib/validators/type/boolean.js', ['client', 'server']);
  api.addFiles('lib/validators/type/array.js', ['client', 'server']);
  api.addFiles('lib/validators/type/object.js', ['client', 'server']);
  api.addFiles('lib/validators/type/date.js', ['client', 'server']);
  api.addFiles('lib/validators/type/email.js', ['client', 'server']);

  // Existence validators.
  api.addFiles('lib/validators/existence/required.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/null.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/not_null.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/has.js', ['client', 'server']);

  // Size validators.
  api.addFiles('lib/validators/size/length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/min_length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/max_length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/gt.js', ['client', 'server']);
  api.addFiles('lib/validators/size/gte.js', ['client', 'server']);
  api.addFiles('lib/validators/size/lt.js', ['client', 'server']);
  api.addFiles('lib/validators/size/lte.js', ['client', 'server']);

  // Comparison validators.
  api.addFiles('lib/validators/comparison/choice.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/unique.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/equal.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/equal_to.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/regexp.js', ['client', 'server']);

  // Logical operators.
  api.addFiles('lib/validators/logical/and.js', ['client', 'server']);
  api.addFiles('lib/validators/logical/or.js', ['client', 'server']);

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

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('insecure');
  api.use('jagi:astronomy-validators@0.10.4');

  api.addFiles('test/validators.js', ['client', 'server']);
});
<commit_msg>Bump version to 0.10.5<commit_after>Package.describe({
  name: 'jagi:astronomy-validators',
  version: '0.10.5',
  summary: 'Validators for Meteor Astronomy',
  git: 'https://github.com/jagi/meteor-astronomy-validators.git'
});

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

  api.use('jagi:astronomy@0.10.4');
  api.use('jagi:reactive-map@0.2.1');
  api.use('underscore');
  api.use('ui');

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles('lib/module/global.js', ['client', 'server']);
  api.addFiles('lib/module/error.js', ['client', 'server']);
  api.addFiles('lib/module/utils.js', ['client', 'server']);
  api.addFiles('lib/module/validator_definition.js', ['client', 'server']);
  api.addFiles('lib/module/validator.js', ['client', 'server']);
  api.addFiles('lib/module/init_module.js', ['client', 'server']);
  api.addFiles('lib/module/init_class.js', ['client', 'server']);
  api.addFiles('lib/module/init_instance.js', ['client', 'server']);
  api.addFiles('lib/module/module.js', ['client', 'server']);

  // Type validators.
  api.addFiles('lib/validators/type/string.js', ['client', 'server']);
  api.addFiles('lib/validators/type/number.js', ['client', 'server']);
  api.addFiles('lib/validators/type/boolean.js', ['client', 'server']);
  api.addFiles('lib/validators/type/array.js', ['client', 'server']);
  api.addFiles('lib/validators/type/object.js', ['client', 'server']);
  api.addFiles('lib/validators/type/date.js', ['client', 'server']);
  api.addFiles('lib/validators/type/email.js', ['client', 'server']);

  // Existence validators.
  api.addFiles('lib/validators/existence/required.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/null.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/not_null.js', ['client', 'server']);
  api.addFiles('lib/validators/existence/has.js', ['client', 'server']);

  // Size validators.
  api.addFiles('lib/validators/size/length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/min_length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/max_length.js', ['client', 'server']);
  api.addFiles('lib/validators/size/gt.js', ['client', 'server']);
  api.addFiles('lib/validators/size/gte.js', ['client', 'server']);
  api.addFiles('lib/validators/size/lt.js', ['client', 'server']);
  api.addFiles('lib/validators/size/lte.js', ['client', 'server']);

  // Comparison validators.
  api.addFiles('lib/validators/comparison/choice.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/unique.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/equal.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/equal_to.js', ['client', 'server']);
  api.addFiles('lib/validators/comparison/regexp.js', ['client', 'server']);

  // Logical operators.
  api.addFiles('lib/validators/logical/and.js', ['client', 'server']);
  api.addFiles('lib/validators/logical/or.js', ['client', 'server']);

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

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('insecure');
  api.use('jagi:astronomy-validators@0.10.4');

  api.addFiles('test/validators.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "Client and server middleware support inspired by Connect.",
  version: "1.0.3",
  git: "https://github.com/eventedmind/iron-middleware-stack"
});

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

  api.use('underscore');

  api.use('iron:core@1.0.3');
  api.imply('iron:core');

  api.use('iron:url@1.0.3');

  api.add_files('lib/handler.js');
  api.add_files('lib/middleware_stack.js');
  api.export('Handler', {testOnly: true});
});

Package.on_test(function (api) {
  api.use('iron:middleware-stack');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/handler_test.js');
  api.add_files('test/middleware_stack_test.js');
});
<commit_msg>bump version<commit_after>Package.describe({
  summary: "Client and server middleware support inspired by Connect.",
  version: "1.0.4",
  git: "https://github.com/eventedmind/iron-middleware-stack"
});

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

  api.use('underscore');

  api.use('iron:core@1.0.4');
  api.imply('iron:core');

  api.use('iron:url@1.0.4');

  api.add_files('lib/handler.js');
  api.add_files('lib/middleware_stack.js');
  api.export('Handler', {testOnly: true});
});

Package.on_test(function (api) {
  api.use('iron:middleware-stack');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/handler_test.js');
  api.add_files('test/middleware_stack_test.js');
});
<|endoftext|>


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

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

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

    var packages = [
        'heaven7:wsl-core@0.0.3_1',
        'heaven7:wsl-translations@0.0.3',
        'tap:i18n@1.7.0',
        'tap:i18n-ui@0.7.0',
        'gwendall:autoform-i18n@0.1.9_1'
    ];

    api.use(packages, both);
    api.imply(packages);

    api.use('session', 'client');

    api.addFiles('lib/both/i18n.js', both);

    api.export([
        'i18n'
    ]);
});
<commit_msg>v0.0.3_1<commit_after>Package.describe({
  name: 'heaven7:wsl-i18n',
  version: '0.0.3_1',
  summary: 'I18n package',
  git: 'https://github.com/heaven7/wsl-i18n.git',
  documentation: 'README.md'
});

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

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

    var packages = [
        'heaven7:wsl-core@0.0.3_1',
        'heaven7:wsl-translations@0.0.3',
        'tap:i18n@1.7.0',
        'tap:i18n-ui@0.7.0',
        'gwendall:autoform-i18n@0.1.9_1'
    ];

    api.use(packages, both);
    api.imply(packages);

    api.use('session', 'client');

    api.addFiles('lib/both/i18n.js', both);

    api.export([
        'i18n'
    ]);
});
<|endoftext|>


<commit_before>/* global Package */
Package.describe({
    name: 'socialize:messaging',
    summary: 'A social messaging package',
    version: '1.0.0',
    git: 'https://github.com/copleykj/socialize-messaging.git',
});

Package.onUse(function _(api) {
    api.versionsFrom('1.3');

    api.use([
        'check', 'socialize:user-model@1.0.0', 'socialize:user-presence@1.0.0', 'socialize:server-time@1.0.0',
    ]);

    api.mainModule('server.js', 'server');
    api.mainModule('common.js');
});
<commit_msg>remove server-time dep, its a base-model dep now<commit_after>/* global Package */
Package.describe({
    name: 'socialize:messaging',
    summary: 'A social messaging package',
    version: '1.0.0',
    git: 'https://github.com/copleykj/socialize-messaging.git',
});

Package.onUse(function _(api) {
    api.versionsFrom('1.3');

    api.use([
        'check', 'socialize:user-model@1.0.0', 'socialize:user-presence@1.0.0',
    ]);

    api.mainModule('server.js', 'server');
    api.mainModule('common.js');
});
<|endoftext|>


<commit_before>Package.describe({
    name: 'chrisdubya:foundation-apps',
    summary: 'Foundation Apps Wrapper for Meteor.',
    version: '1.0.2',
    git: 'https://github.com/chrisdubya/foundation-apps-meteor',
    documentation: 'meteor-README.md'
});

Npm.depends({
    'motion-ui': '1.1.0'
});

Package.onUse(function(api) {
    api.versionsFrom('1.2.1');
    api.imply('fourseven:scss@3.4.1');
    api.use(['ecmascript', 'jquery', 'fourseven:scss@3.4.1'], 'client');
    api.addFiles('.npm/package/node_modules/motion-ui/dist/motion-ui.css', 'client');
    api.addFiles('.npm/package/node_modules/motion-ui/dist/motion-ui.js', 'client');
    api.addFiles('dist/js/foundation-apps.js', 'client');
    api.addFiles('dist/js/foundation-apps-templates.js', 'client');
    api.addFiles([

        'scss/foundation.scss',
        'scss/_global.scss',
        'scss/_includes.scss',
        'scss/_settings.scss',

        'scss/components/_accordion.scss',
        'scss/components/_action-sheet.scss',
        'scss/components/_block-list.scss',
        'scss/components/_button-group.scss',
        'scss/components/_button.scss',
        'scss/components/_card.scss',
        'scss/components/_extras.scss',
        'scss/components/_forms.scss',
        'scss/components/_grid.scss',
        'scss/components/_iconic.scss',
        'scss/components/_label.scss',
        'scss/components/_list.scss',
        'scss/components/_menu-bar.scss',
        'scss/components/_modal.scss',
        'scss/components/_motion.scss',
        'scss/components/_notification.scss',
        'scss/components/_off-canvas.scss',
        'scss/components/_panel.scss',
        'scss/components/_popup.scss',
        'scss/components/_switch.scss',
        'scss/components/_tabs.scss',
        'scss/components/_title-bar.scss',
        'scss/components/_typography.scss',
        'scss/components/_utilities.scss',

        'scss/helpers/_breakpoints.scss',
        'scss/helpers/_functions.scss',
        'scss/helpers/_images.scss',
        'scss/helpers/_mixins.scss',

        'scss/vendor/_normalize.scss'

    ], 'client', {
        isImport: true
    });
});
<commit_msg>updated package.js<commit_after>Package.describe({
    name: 'chrisdubya:foundation-apps',
    summary: 'Foundation Apps Wrapper for Meteor.',
    version: '1.0.2',
    git: 'https://github.com/chrisdubya/foundation-apps',
    documentation: 'meteor-README.md'
});

Npm.depends({
    'motion-ui': '1.1.0'
});

Package.onUse(function(api) {
    api.versionsFrom('1.2.1');
    api.imply('fourseven:scss@3.4.1');
    api.use(['ecmascript', 'jquery', 'fourseven:scss@3.4.1'], 'client');
    api.addFiles('.npm/package/node_modules/motion-ui/dist/motion-ui.css', 'client');
    api.addFiles('.npm/package/node_modules/motion-ui/dist/motion-ui.js', 'client');
    api.addFiles('dist/js/foundation-apps.js', 'client');
    api.addFiles('dist/js/foundation-apps-templates.js', 'client');
    api.addFiles([

        'scss/foundation.scss',
        'scss/_global.scss',
        'scss/_includes.scss',
        'scss/_settings.scss',

        'scss/components/_accordion.scss',
        'scss/components/_action-sheet.scss',
        'scss/components/_block-list.scss',
        'scss/components/_button-group.scss',
        'scss/components/_button.scss',
        'scss/components/_card.scss',
        'scss/components/_extras.scss',
        'scss/components/_forms.scss',
        'scss/components/_grid.scss',
        'scss/components/_iconic.scss',
        'scss/components/_label.scss',
        'scss/components/_list.scss',
        'scss/components/_menu-bar.scss',
        'scss/components/_modal.scss',
        'scss/components/_motion.scss',
        'scss/components/_notification.scss',
        'scss/components/_off-canvas.scss',
        'scss/components/_panel.scss',
        'scss/components/_popup.scss',
        'scss/components/_switch.scss',
        'scss/components/_tabs.scss',
        'scss/components/_title-bar.scss',
        'scss/components/_typography.scss',
        'scss/components/_utilities.scss',

        'scss/helpers/_breakpoints.scss',
        'scss/helpers/_functions.scss',
        'scss/helpers/_images.scss',
        'scss/helpers/_mixins.scss',

        'scss/vendor/_normalize.scss'

    ], 'client', {
        isImport: true
    });
});
<|endoftext|>


<commit_before>Package.describe({
  name: "tmeasday:presence",
  summary: "A package to help track users' presence",
  version: "1.0.0",
  git: "https://github.com/dburles/meteor-presence.git"
});

Package.onUse(function (api) {
  api.add_files('lib/common.js', ['client', 'server']);
  api.add_files('lib/client.js', 'client');
  api.add_files('lib/server.js', 'server');

  api.export('Presences', ['client', 'server']);
  api.export('Presence', ['client', 'server']);
});
<commit_msg>version bump<commit_after>Package.describe({
  name: "tmeasday:presence",
  summary: "A package to help track users' presence",
  version: "1.0.1",
  git: "https://github.com/dburles/meteor-presence.git"
});

Package.onUse(function (api) {
  api.add_files('lib/common.js', ['client', 'server']);
  api.add_files('lib/client.js', 'client');
  api.add_files('lib/server.js', 'server');

  api.export('Presences', ['client', 'server']);
  api.export('Presence', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'mfq:upload-cover-image',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: '',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/MFQ/upload-cover-image-meteor',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.0.2');
  api.use('ecmascript');
  api.addFiles('upload-cover-image.js');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('mfq:upload-cover-image');
  api.addFiles('upload-cover-image-tests.js');
});
<commit_msg>basic setuped<commit_after>Package.describe({
  name: 'mfq:upload-cover-image',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: 'Simply upload cover image package for meteor',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/MFQ/upload-cover-image-meteor',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

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

Package.onUse(function(api) {
  api.versionsFrom('1.2.0.2');
  api.use('ecmascript');

  // Adding dependencies
  api.use(['underscore', 'accounts-base', 'accounts-password'], both);
  api.use(['jquery', 'templating', 'mizzao:bootstrap-3@3.2.0_1'], client);

  // Adding package files
  api.addFiles([], client);

  api.addFiles([], both);

  api.addFiles([
    "lib/server/cover_image_updator.js"
  ], server);

  api.addFiles('upload-cover-image.js');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');

  api.use('mfq:upload-cover-image');
  api.addFiles('upload-cover-image-tests.js');
});
<|endoftext|>