<commit_before>import StringBuffer from 'discourse/mixins/string-buffer';

// Helper class for rendering a button
export var Button = function(action, label, icon, opts) {
  this.action = action;
  this.label = label;

  if (typeof icon === "object") {
    this.opts = icon;
  } else {
    this.icon = icon;
  }
  this.opts = this.opts || opts || {};
};

function animateHeart($elem, start, end, complete) {
  $elem.stop()
       .css('textIndent', start)
       .animate({ textIndent: end }, {
          complete: complete,
          step: function(now) {
            $(this).css('transform','scale('+now+')');
          },
          duration: 150
        }, 'linear');
}

Button.prototype.render = function(buffer) {
  var opts = this.opts;

  var label = I18n.t(this.label);

  buffer.push("<button aria-label=\"" + label +"\" " + "title=\"" + label + "\"");
  if (opts.disabled) { buffer.push(" disabled"); }
  if (opts.className) { buffer.push(" class=\"" + opts.className + "\""); }
  if (opts.shareUrl) { buffer.push(" data-share-url=\"" + opts.shareUrl + "\""); }
  if (opts.postNumber) { buffer.push(" data-post-number=\"" + opts.postNumber + "\""); }
  buffer.push(" data-action=\"" + this.action + "\">");
  if (this.icon) { buffer.push(""); }
  if (opts.textLabel) { buffer.push(I18n.t(opts.textLabel)); }
  if (opts.innerHTML) { buffer.push(opts.innerHTML); }
  buffer.push("</button>");
};

var hiddenButtons;

var PostMenuView = Discourse.View.extend(StringBuffer, {
  tagName: 'section',
  classNames: ['post-menu-area', 'clearfix'],

  rerenderTriggers: [
    'post.deleted_at',
    'post.like_count',
    'post.reply_count',
    'post.showRepliesBelow',
    'post.can_delete',
    'post.bookmarked',
    'post.shareUrl',
    'post.topic.deleted_at',
    'post.replies.length',
    'post.wiki',
    'post.post_type',
    'collapsed'],

  _collapsedByDefault: function() {
    this.set('collapsed', true);
  }.on('init'),

  renderString: function(buffer) {
    var post = this.get('post');

    buffer.push("");
    this.renderReplies(post, buffer);
    this.renderButtons(post, buffer);
    this.renderAdminPopup(post, buffer);
    buffer.push("");
  },

  // Delegate click actions
  click: function(e) {
    var $target = $(e.target),
        action = $target.data('action') || $target.parent().data('action');

    if (!action) return;
    var handler = this["click" + action.capitalize()];
    if (!handler) return;

    handler.call(this, this.get('post'));
  },

  // Replies Button
  renderReplies: function(post, buffer) {
    if (!post.get('showRepliesBelow')) return;

    var reply_count = post.get('reply_count');
    buffer.push("<button class='show-replies' data-action='replies'>");
    buffer.push("" + reply_count + "");
    buffer.push(I18n.t("post.has_replies", { count: reply_count }));

    var icon = (this.get('post.replies.length') > 0) ? 'fa-chevron-up' : 'fa-chevron-down';
    return buffer.push("</button>");
  },

  renderButtons: function(post, buffer) {
    var self = this,
        allButtons = [],
        visibleButtons = [];

    if (typeof hiddenButtons === "undefined") {
      if (!Em.isEmpty(Discourse.SiteSettings.post_menu_hidden_items)) {
        hiddenButtons = Discourse.SiteSettings.post_menu_hidden_items.split('|');
      } else {
        hiddenButtons = [];
      }
    }

    if (post.get("bookmarked")) {
      hiddenButtons.removeObject("bookmark");
    }

    var yours = post.get('yours');
    Discourse.SiteSettings.post_menu.split("|").forEach(function(i) {
      var creator = self["buttonFor" + i.replace(/\+/, '').capitalize()];
      if (creator) {
        var button = creator.call(self, post);
        if (button) {
          allButtons.push(button);
          if ((yours && button.opts.alwaysShowYours) ||
              (post.get('wiki') && button.opts.alwaysShowWiki) ||
              (hiddenButtons.indexOf(i) === -1)) {
            visibleButtons.push(button);
          }
        }
      }
    });

    // Only show ellipsis if there is more than one button hidden
    if (!this.get('collapsed') || (allButtons.length <= visibleButtons.length + 1)) {
      visibleButtons = allButtons;
    } else {
      visibleButtons.splice(visibleButtons.length - 1, 0, this.buttonForShowMoreActions(post));
    }

    var callbacks = PostMenuView._registerButtonCallbacks;
    if (callbacks) {
      _.each(callbacks, function(callback) {
        callback.apply(self, [visibleButtons]);
      });
    }

    buffer.push('
');
    visibleButtons.forEach(function (b) {
      b.render(buffer);
    });
    buffer.push("
");
  },

  clickReplies: function() {
    if (this.get('post.replies.length') > 0) {
      this.set('post.replies', []);
    } else {
      this.get('post').loadReplies();
    }
  },

  // Delete button
  buttonForDelete: function(post) {
    var label, icon;

    if (post.get('post_number') === 1) {
      // If it's the first post, the delete/undo actions are related to the topic
      var topic = post.get('topic');
      if (topic.get('deleted_at')) {
        if (!topic.get('details.can_recover')) { return; }
        label = "topic.actions.recover";
        icon = "undo";
      } else {
        if (!topic.get('details.can_delete')) { return; }
        label = "topic.actions.delete";
        icon = "trash-o";
      }

    } else {
      // The delete actions target the post iteself
      if (post.get('deleted_at') || post.get('user_deleted')) {
        if (!post.get('can_recover')) { return; }
        label = "post.controls.undelete";
        icon = "undo";
      } else {
        if (!post.get('can_delete')) { return; }
        label = "post.controls.delete";
        icon = "trash-o";
      }
    }
    var action = (icon === 'trash-o') ? 'delete' : 'recover';
    var opts;
    if (icon === "trash-o"){
      opts = {className: 'delete'};
    }
    return new Button(action, label, icon, opts);
  },

  clickRecover: function(post) {
    this.get('controller').send('recoverPost', post);
  },

  clickDelete: function(post) {
    this.get('controller').send('deletePost', post);
  },

  // Like button
  buttonForLike: function(post) {
    var likeAction = post.get('actionByName.like');
    if (!likeAction) { return; }

    var className = likeAction.get('acted') ? 'has-like' : 'like';
    if (likeAction.get('canToggle')) {
      var descKey = likeAction.get('acted') ? 'post.controls.undo_like' : 'post.controls.like';
      return new Button('like', descKey, 'heart', {className: className});
    } else if (likeAction.get('acted')) {
      return new Button('like', 'post.controls.has_liked', 'heart', {className: className, disabled: true});
    }
  },

  clickLike: function(post) {
    var $heart = this.$('.fa-heart'),
        controller = this.get('controller'),
        $likeButton = this.$('button[data-action=like]');

    var acted = post.get('actionByName.like.acted');
    if (acted) {
      controller.send('toggleLike', post);
      $likeButton.removeClass('has-like').addClass('like');
    } else {
      var scale = [1.0, 1.5];
      animateHeart($heart, scale[0], scale[1], function() {
        animateHeart($heart, scale[1], scale[0], function() {
          controller.send('toggleLike', post);
          $likeButton.removeClass('like').addClass('has-like');
        });
      });
    }
  },

  // Flag button
  buttonForFlag: function(post) {
    if (Em.isEmpty(post.get('flagsAvailable'))) return;
    return new Button('flag', 'post.controls.flag', 'flag');
  },

  clickFlag: function(post) {
    this.get('controller').send('showFlags', post);
  },

  // Edit button
  buttonForEdit: function(post) {
    if (!post.get('can_edit')) return;
    return new Button('edit', 'post.controls.edit', 'pencil', {
      alwaysShowYours: true,
      alwaysShowWiki: true
    });
  },

  clickEdit: function(post) {
    this.get('controller').send('editPost', post);
  },

  // Share button
  buttonForShare: function(post) {
    if (!Discourse.User.current()) return;
    var options = {
      shareUrl: post.get('shareUrl'),
      postNumber: post.get('post_number')
    };
    return new Button('share', 'post.controls.share', 'link', options);
  },

  // Reply button
  buttonForReply: function() {
    if (!this.get('controller.model.details.can_create_post')) return;
    var options = {className: 'create'};

    if(!Discourse.Mobile.mobileView) {
      options.textLabel = 'topic.reply.title';
    }

    return new Button('reply', 'post.controls.reply', 'reply', options);
  },

  clickReply: function(post) {
    this.get('controller').send('replyToPost', post);
  },

  // Bookmark button
  buttonForBookmark: function(post) {
    if (!Discourse.User.current()) return;

    var iconClass = 'read-icon',
        buttonClass = 'bookmark',
        tooltip = 'bookmarks.not_bookmarked';

    if (post.get('bookmarked')) {
      iconClass += ' bookmarked';
      buttonClass += ' bookmarked';
      tooltip = 'bookmarks.created';
    }

    return new Button('bookmark', tooltip, {className: buttonClass, innerHTML: "
"});
  },

  clickBookmark: function(post) {
    this.get('controller').send('toggleBookmark', post);
  },

  buttonForAdmin: function() {
    if (!Discourse.User.currentProp('canManageTopic')) { return; }
    return new Button('admin', 'post.controls.admin', 'wrench');
  },

  renderAdminPopup: function(post, buffer) {
    if (!Discourse.User.currentProp('canManageTopic')) { return; }

    var isWiki = post.get('wiki'),
        wikiIcon = '',
        wikiText = isWiki ? I18n.t('post.controls.unwiki') : I18n.t('post.controls.wiki');

    var isModerator = post.get('post_type') === Discourse.Site.currentProp('post_types.moderator_action'),
        postTypeIcon = '',
        postTypeText = isModerator ? I18n.t('post.controls.revert_to_regular') : I18n.t('post.controls.convert_to_moderator');

    var rebakePostIcon = '',
        rebakePostText = I18n.t('post.controls.rebake');

    var unhidePostIcon = '',
        unhidePostText = I18n.t('post.controls.unhide');

    var html = '
' +
                 '
' + I18n.t('admin_title') + '
' +
                 '
' +
                   '
' + wikiIcon + wikiText + '
' +
                   (Discourse.User.currentProp('staff') ? '
' + postTypeIcon + postTypeText + '
' : '') +
                   '
' + rebakePostIcon + rebakePostText + '
' +
                   (post.hidden ? '
' + unhidePostIcon + unhidePostText + '
' : '') +
                 '
' +
               '
';

    buffer.push(html);
  },

  clickAdmin: function() {
    var $postAdminMenu = this.$(".post-admin-menu");
    $postAdminMenu.show();
    $("html").on("mouseup.post-admin-menu", function() {
      $postAdminMenu.hide();
      $("html").off("mouseup.post-admin-menu");
    });
  },

  clickToggleWiki: function() {
    this.get('controller').send('toggleWiki', this.get('post'));
  },

  clickTogglePostType: function () {
    this.get("controller").send("togglePostType", this.get("post"));
  },

  clickRebakePost: function () {
    this.get("controller").send("rebakePost", this.get("post"));
  },

  clickUnhidePost: function () {
    this.get("controller").send("unhidePost", this.get("post"));
  },

  buttonForShowMoreActions: function() {
    return new Button('showMoreActions', 'show_more', 'ellipsis-h');
  },

  clickShowMoreActions: function() {
    this.set('collapsed', false);
  }

});

PostMenuView.reopenClass({
  registerButton: function(callback){
    this._registerButtonCallbacks = this._registerButtonCallbacks || [];
    this._registerButtonCallbacks.push(callback);
  }
});

export default PostMenuView;
<commit_msg>FIX: denote that we are not collapsed if no buttons are hidden<commit_after>import StringBuffer from 'discourse/mixins/string-buffer';

// Helper class for rendering a button
export var Button = function(action, label, icon, opts) {
  this.action = action;
  this.label = label;

  if (typeof icon === "object") {
    this.opts = icon;
  } else {
    this.icon = icon;
  }
  this.opts = this.opts || opts || {};
};

function animateHeart($elem, start, end, complete) {
  $elem.stop()
       .css('textIndent', start)
       .animate({ textIndent: end }, {
          complete: complete,
          step: function(now) {
            $(this).css('transform','scale('+now+')');
          },
          duration: 150
        }, 'linear');
}

Button.prototype.render = function(buffer) {
  var opts = this.opts;

  var label = I18n.t(this.label);

  buffer.push("<button aria-label=\"" + label +"\" " + "title=\"" + label + "\"");
  if (opts.disabled) { buffer.push(" disabled"); }
  if (opts.className) { buffer.push(" class=\"" + opts.className + "\""); }
  if (opts.shareUrl) { buffer.push(" data-share-url=\"" + opts.shareUrl + "\""); }
  if (opts.postNumber) { buffer.push(" data-post-number=\"" + opts.postNumber + "\""); }
  buffer.push(" data-action=\"" + this.action + "\">");
  if (this.icon) { buffer.push(""); }
  if (opts.textLabel) { buffer.push(I18n.t(opts.textLabel)); }
  if (opts.innerHTML) { buffer.push(opts.innerHTML); }
  buffer.push("</button>");
};

var hiddenButtons;

var PostMenuView = Discourse.View.extend(StringBuffer, {
  tagName: 'section',
  classNames: ['post-menu-area', 'clearfix'],

  rerenderTriggers: [
    'post.deleted_at',
    'post.like_count',
    'post.reply_count',
    'post.showRepliesBelow',
    'post.can_delete',
    'post.bookmarked',
    'post.shareUrl',
    'post.topic.deleted_at',
    'post.replies.length',
    'post.wiki',
    'post.post_type',
    'collapsed'],

  _collapsedByDefault: function() {
    this.set('collapsed', true);
  }.on('init'),

  renderString: function(buffer) {
    var post = this.get('post');

    buffer.push("");
    this.renderReplies(post, buffer);
    this.renderButtons(post, buffer);
    this.renderAdminPopup(post, buffer);
    buffer.push("");
  },

  // Delegate click actions
  click: function(e) {
    var $target = $(e.target),
        action = $target.data('action') || $target.parent().data('action');

    if (!action) return;
    var handler = this["click" + action.capitalize()];
    if (!handler) return;

    handler.call(this, this.get('post'));
  },

  // Replies Button
  renderReplies: function(post, buffer) {
    if (!post.get('showRepliesBelow')) return;

    var reply_count = post.get('reply_count');
    buffer.push("<button class='show-replies' data-action='replies'>");
    buffer.push("" + reply_count + "");
    buffer.push(I18n.t("post.has_replies", { count: reply_count }));

    var icon = (this.get('post.replies.length') > 0) ? 'fa-chevron-up' : 'fa-chevron-down';
    return buffer.push("</button>");
  },

  renderButtons: function(post, buffer) {
    var self = this,
        allButtons = [],
        visibleButtons = [];

    if (typeof hiddenButtons === "undefined") {
      if (!Em.isEmpty(Discourse.SiteSettings.post_menu_hidden_items)) {
        hiddenButtons = Discourse.SiteSettings.post_menu_hidden_items.split('|');
      } else {
        hiddenButtons = [];
      }
    }

    if (post.get("bookmarked")) {
      hiddenButtons.removeObject("bookmark");
    }

    var yours = post.get('yours');
    Discourse.SiteSettings.post_menu.split("|").forEach(function(i) {
      var creator = self["buttonFor" + i.replace(/\+/, '').capitalize()];
      if (creator) {
        var button = creator.call(self, post);
        if (button) {
          allButtons.push(button);
          if ((yours && button.opts.alwaysShowYours) ||
              (post.get('wiki') && button.opts.alwaysShowWiki) ||
              (hiddenButtons.indexOf(i) === -1)) {
            visibleButtons.push(button);
          }
        }
      }
    });

    // Only show ellipsis if there is more than one button hidden
    // if there are no more buttons, we are not collapsed
    var collapsed = this.get('collapsed');
    if (!collapsed || (allButtons.length <= visibleButtons.length + 1)) {
      visibleButtons = allButtons;
      if (collapsed) { this.set('collapsed', false); }
    } else {
      visibleButtons.splice(visibleButtons.length - 1, 0, this.buttonForShowMoreActions(post));
    }

    var callbacks = PostMenuView._registerButtonCallbacks;
    if (callbacks) {
      _.each(callbacks, function(callback) {
        callback.apply(self, [visibleButtons]);
      });
    }

    buffer.push('
');
    visibleButtons.forEach(function (b) {
      b.render(buffer);
    });
    buffer.push("
");
  },

  clickReplies: function() {
    if (this.get('post.replies.length') > 0) {
      this.set('post.replies', []);
    } else {
      this.get('post').loadReplies();
    }
  },

  // Delete button
  buttonForDelete: function(post) {
    var label, icon;

    if (post.get('post_number') === 1) {
      // If it's the first post, the delete/undo actions are related to the topic
      var topic = post.get('topic');
      if (topic.get('deleted_at')) {
        if (!topic.get('details.can_recover')) { return; }
        label = "topic.actions.recover";
        icon = "undo";
      } else {
        if (!topic.get('details.can_delete')) { return; }
        label = "topic.actions.delete";
        icon = "trash-o";
      }

    } else {
      // The delete actions target the post iteself
      if (post.get('deleted_at') || post.get('user_deleted')) {
        if (!post.get('can_recover')) { return; }
        label = "post.controls.undelete";
        icon = "undo";
      } else {
        if (!post.get('can_delete')) { return; }
        label = "post.controls.delete";
        icon = "trash-o";
      }
    }
    var action = (icon === 'trash-o') ? 'delete' : 'recover';
    var opts;
    if (icon === "trash-o"){
      opts = {className: 'delete'};
    }
    return new Button(action, label, icon, opts);
  },

  clickRecover: function(post) {
    this.get('controller').send('recoverPost', post);
  },

  clickDelete: function(post) {
    this.get('controller').send('deletePost', post);
  },

  // Like button
  buttonForLike: function(post) {
    var likeAction = post.get('actionByName.like');
    if (!likeAction) { return; }

    var className = likeAction.get('acted') ? 'has-like' : 'like';
    if (likeAction.get('canToggle')) {
      var descKey = likeAction.get('acted') ? 'post.controls.undo_like' : 'post.controls.like';
      return new Button('like', descKey, 'heart', {className: className});
    } else if (likeAction.get('acted')) {
      return new Button('like', 'post.controls.has_liked', 'heart', {className: className, disabled: true});
    }
  },

  clickLike: function(post) {
    var $heart = this.$('.fa-heart'),
        controller = this.get('controller'),
        $likeButton = this.$('button[data-action=like]');

    var acted = post.get('actionByName.like.acted');
    if (acted) {
      controller.send('toggleLike', post);
      $likeButton.removeClass('has-like').addClass('like');
    } else {
      var scale = [1.0, 1.5];
      animateHeart($heart, scale[0], scale[1], function() {
        animateHeart($heart, scale[1], scale[0], function() {
          controller.send('toggleLike', post);
          $likeButton.removeClass('like').addClass('has-like');
        });
      });
    }
  },

  // Flag button
  buttonForFlag: function(post) {
    if (Em.isEmpty(post.get('flagsAvailable'))) return;
    return new Button('flag', 'post.controls.flag', 'flag');
  },

  clickFlag: function(post) {
    this.get('controller').send('showFlags', post);
  },

  // Edit button
  buttonForEdit: function(post) {
    if (!post.get('can_edit')) return;
    return new Button('edit', 'post.controls.edit', 'pencil', {
      alwaysShowYours: true,
      alwaysShowWiki: true
    });
  },

  clickEdit: function(post) {
    this.get('controller').send('editPost', post);
  },

  // Share button
  buttonForShare: function(post) {
    if (!Discourse.User.current()) return;
    var options = {
      shareUrl: post.get('shareUrl'),
      postNumber: post.get('post_number')
    };
    return new Button('share', 'post.controls.share', 'link', options);
  },

  // Reply button
  buttonForReply: function() {
    if (!this.get('controller.model.details.can_create_post')) return;
    var options = {className: 'create'};

    if(!Discourse.Mobile.mobileView) {
      options.textLabel = 'topic.reply.title';
    }

    return new Button('reply', 'post.controls.reply', 'reply', options);
  },

  clickReply: function(post) {
    this.get('controller').send('replyToPost', post);
  },

  // Bookmark button
  buttonForBookmark: function(post) {
    if (!Discourse.User.current()) return;

    var iconClass = 'read-icon',
        buttonClass = 'bookmark',
        tooltip = 'bookmarks.not_bookmarked';

    if (post.get('bookmarked')) {
      iconClass += ' bookmarked';
      buttonClass += ' bookmarked';
      tooltip = 'bookmarks.created';
    }

    return new Button('bookmark', tooltip, {className: buttonClass, innerHTML: "
"});
  },

  clickBookmark: function(post) {
    this.get('controller').send('toggleBookmark', post);
  },

  buttonForAdmin: function() {
    if (!Discourse.User.currentProp('canManageTopic')) { return; }
    return new Button('admin', 'post.controls.admin', 'wrench');
  },

  renderAdminPopup: function(post, buffer) {
    if (!Discourse.User.currentProp('canManageTopic')) { return; }

    var isWiki = post.get('wiki'),
        wikiIcon = '',
        wikiText = isWiki ? I18n.t('post.controls.unwiki') : I18n.t('post.controls.wiki');

    var isModerator = post.get('post_type') === Discourse.Site.currentProp('post_types.moderator_action'),
        postTypeIcon = '',
        postTypeText = isModerator ? I18n.t('post.controls.revert_to_regular') : I18n.t('post.controls.convert_to_moderator');

    var rebakePostIcon = '',
        rebakePostText = I18n.t('post.controls.rebake');

    var unhidePostIcon = '',
        unhidePostText = I18n.t('post.controls.unhide');

    var html = '
' +
                 '
' + I18n.t('admin_title') + '
' +
                 '
' +
                   '
' + wikiIcon + wikiText + '
' +
                   (Discourse.User.currentProp('staff') ? '
' + postTypeIcon + postTypeText + '
' : '') +
                   '
' + rebakePostIcon + rebakePostText + '
' +
                   (post.hidden ? '
' + unhidePostIcon + unhidePostText + '
' : '') +
                 '
' +
               '
';

    buffer.push(html);
  },

  clickAdmin: function() {
    var $postAdminMenu = this.$(".post-admin-menu");
    $postAdminMenu.show();
    $("html").on("mouseup.post-admin-menu", function() {
      $postAdminMenu.hide();
      $("html").off("mouseup.post-admin-menu");
    });
  },

  clickToggleWiki: function() {
    this.get('controller').send('toggleWiki', this.get('post'));
  },

  clickTogglePostType: function () {
    this.get("controller").send("togglePostType", this.get("post"));
  },

  clickRebakePost: function () {
    this.get("controller").send("rebakePost", this.get("post"));
  },

  clickUnhidePost: function () {
    this.get("controller").send("unhidePost", this.get("post"));
  },

  buttonForShowMoreActions: function() {
    return new Button('showMoreActions', 'show_more', 'ellipsis-h');
  },

  clickShowMoreActions: function() {
    this.set('collapsed', false);
  }

});

PostMenuView.reopenClass({
  registerButton: function(callback){
    this._registerButtonCallbacks = this._registerButtonCallbacks || [];
    this._registerButtonCallbacks.push(callback);
  }
});

export default PostMenuView;
<|endoftext|>


<commit_before>var Promise = require( 'bluebird' )
    , path    = require( 'path' )
    , async   = require( 'async' )
    , fs      = require( 'fs');

/**
 * Finds a frontend and backend seed and determines
 * whether or not we can use Bower or NPM
 *
 * @return {Promise}
 * @api public
 */

exports.findAvailableCommands = function ( ) {
    return new Promise( function( resolve, reject ) {
        get()
            .then( function( locations ) {
                var useNPM    = false
                  , useBower  = false;

                if ( locations.length > 1 ) {
                    useNPM    = true;
                    useBower  = true;
                } else if ( locations.length < 1 ) {
                    lib.utils.fail( 'Couldn\'t find any CleverStack seeds within ' + process.cwd( ) );
                } else {
                    useNPM    = locations[ 0 ].name === "backend";
                    useBower  = locations[ 0 ].name === "frontend";
                }

                var _locations = locations.filter( function( location ) {
                    return ( useNPM && useBower ) || ( useNPM && location.name === "backend" ) || ( useBower && location.name === "frontend" );
                });

                resolve( [ _locations, useNPM, useBower ] );
            })
            .catch( function( err ) {
                reject( err );
            });
    });
}

/**
 * Finds seed locations within CWD
 *
 * @return {Promise}
 * @api public
 */
var find = exports.find = function() {
    return new Promise( function( resolve, reject ) {
        var cwd      = process.cwd();

        lib.utils.running( 'Finding seeds to target...' );
        lib.utils.info( '  Finding seeds to target...' );

        async.waterfall(
            [
                function readDir( callback ) {
                    fs.readdir( cwd, callback );
                },

                function isSeedInCurrentDirectory( list, callback ) {
                    if ( program.verbose ) {
                        lib.utils.info( [ '  Checking ', cwd, ' for seeds to target...' ].join( '' ) );
                    }

                    var packageJson = list.indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ cwd, 'package.json' ].join( path.sep ) ) ) : false
                      , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                      , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                      , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                    if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {

                        lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed)...' ].join( '' ) );

                        callback( null, list, {
                            path: cwd,
                            type: isNodeSeed ? 'backend' : 'frontend'
                        });
                    } else {
                        callback( null, list, false );
                    }
                },

                function walkChildren( list, seedFound, callback ) {
                    var newList = [];

                    if ( !!seedFound ) {
                        newList.push( seedFound );
                    } else {
                        if ( program.verbose ) {
                            lib.utils.info( [ '    Walking through folders in ', cwd, ' to find seeds to target...' ].join( '' ) );
                        }

                        list.forEach( function( p ) {
                            var thePath = path.resolve( path.join( cwd, p ) )
                              , stats   = fs.statSync( thePath );

                            if ( !!stats.isDirectory() ) {
                                var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1
                                            ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) )
                                            : false
                                  , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                                  , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                                  , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                                if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {
                                    lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed) in ', thePath ,'...' ].join( '' ) );

                                    newList.push({
                                        path: thePath,
                                        type: isNodeSeed ? 'backend' : 'frontend'
                                    });
                                }
                            }
                        });
                    }

                    callback( null, newList );
                },

                function reverseMatchIfStillNotFound( list, callback ) {
                    var behind  = cwd.split( path.sep )
                      , found   = false
                      , newList = [];

                    if ( list.length > 0 ) {
                        callback( null, list );
                    } else {
                        if ( program.verbose ) {
                            lib.utils.info( [ '    Traversing the tree backwards from ', cwd, ' to find seeds to target...' ].join( '' ) );
                        }

                        async.until(
                            function() {
                                return behind.length < 2 || found === true;
                            },
                            function ( next ) {
                                var thePath = behind.join( path.sep )
                                    , stats = fs.statSync( thePath );

                                if ( !!stats.isDirectory() ) {
                                    var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) ) : false
                                      , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                                      , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                                      , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                                    if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {
                                        lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed) in ', thePath ,'...' ].join( '' ) );

                                        newList.push({
                                            path: thePath,
                                            type: isNodeSeed ? 'backend' : 'frontend'
                                        });

                                        found = true;
                                    } else {
                                        behind.pop();
                                    }
                                } else {
                                    behind.pop();
                                }

                                next();
                            },
                            function ( err ) {
                                if ( !!err ) {
                                    callback( err );
                                } else if ( !newList.length ) {
                                    callback( 'Couldn\'t find a seed directory within ' + cwd );
                                } else {
                                    callback( null, newList );
                                }
                            }
                        );
                    }
                }
            ],
            function( err, res ) {
                !!err ? reject( err ) : resolve( res );
            }
        );
    });
}

/**
 * Finds seed locations and returns an object with common properties
 *
 * @param  {Boolean} [useCWD=false] - Whether or not we should use process.cwd()
 * @return {Promise}
 * @api public
 */

var get = exports.get = function( useCWD, fn ) {
    return new Promise( function( resolve, reject ) {
        if ( typeof useCWD === "function" ) {
            fn      = useCWD;
            useCWD  = false;
        }

        find()
            .then( function( foundProjects ) {
                var projects         = []
                  , projectTemplates = {
                        backend: {
                            name: 'backend',
                            modulePath: 'modules'
                        },
                        frontend: {
                            name: 'frontend',
                            modulePath: path.join( 'app', 'modules' )
                        }
                    };

                foundProjects.forEach( function( proj ) {

                    if ( projectTemplates.hasOwnProperty( proj.type ) ) {

                        projectTemplates[ proj.type ].moduleDir = proj.path;
                        projectTemplates[ proj.type ].useCWD    = useCWD;

                        projects.push( projectTemplates[ proj.type ] );
                    }

                });

                resolve( projects );
            })
            .catch(function( err ) {
                reject( err );
            });
    });
}<commit_msg>refactor(verbose): Only output seed locations in verbose mode<commit_after>var Promise = require( 'bluebird' )
    , path    = require( 'path' )
    , async   = require( 'async' )
    , fs      = require( 'fs');

/**
 * Finds a frontend and backend seed and determines
 * whether or not we can use Bower or NPM
 *
 * @return {Promise}
 * @api public
 */

exports.findAvailableCommands = function ( ) {
    return new Promise( function( resolve, reject ) {
        get()
            .then( function( locations ) {
                var useNPM    = false
                  , useBower  = false;

                if ( locations.length > 1 ) {
                    useNPM    = true;
                    useBower  = true;
                } else if ( locations.length < 1 ) {
                    lib.utils.fail( 'Couldn\'t find any CleverStack seeds within ' + process.cwd( ) );
                } else {
                    useNPM    = locations[ 0 ].name === "backend";
                    useBower  = locations[ 0 ].name === "frontend";
                }

                var _locations = locations.filter( function( location ) {
                    return ( useNPM && useBower ) || ( useNPM && location.name === "backend" ) || ( useBower && location.name === "frontend" );
                });

                resolve( [ _locations, useNPM, useBower ] );
            })
            .catch( function( err ) {
                reject( err );
            });
    });
}

/**
 * Finds seed locations within CWD
 *
 * @return {Promise}
 * @api public
 */
var find = exports.find = function() {
    return new Promise( function( resolve, reject ) {
        var cwd      = process.cwd();

        lib.utils.running( 'Finding seeds to target...' );

        if ( program.verbose ) {
            lib.utils.info( '  Finding seeds to target...' );
        }

        async.waterfall(
            [
                function readDir( callback ) {
                    fs.readdir( cwd, callback );
                },

                function isSeedInCurrentDirectory( list, callback ) {
                    if ( program.verbose ) {
                        lib.utils.info( [ '  Checking ', cwd, ' for seeds to target...' ].join( '' ) );
                    }

                    var packageJson = list.indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ cwd, 'package.json' ].join( path.sep ) ) ) : false
                      , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                      , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                      , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                    if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {

                        if ( program.verbose ) {
                            lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed)...' ].join( '' ) );
                        }

                        callback( null, list, {
                            path: cwd,
                            type: isNodeSeed ? 'backend' : 'frontend'
                        });
                    } else {
                        callback( null, list, false );
                    }
                },

                function walkChildren( list, seedFound, callback ) {
                    var newList = [];

                    if ( !!seedFound ) {
                        newList.push( seedFound );
                    } else {
                        if ( program.verbose ) {
                            lib.utils.info( [ '    Walking through folders in ', cwd, ' to find seeds to target...' ].join( '' ) );
                        }

                        list.forEach( function( p ) {
                            var thePath = path.resolve( path.join( cwd, p ) )
                              , stats   = fs.statSync( thePath );

                            if ( !!stats.isDirectory() ) {
                                var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) ) : false
                                  , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                                  , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                                  , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                                if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {

                                    if ( program.verbose ) {
                                        lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed) in ', thePath ,'...' ].join( '' ) );
                                    }

                                    newList.push({
                                        path: thePath,
                                        type: isNodeSeed ? 'backend' : 'frontend'
                                    });
                                }
                            }
                        });
                    }

                    callback( null, newList );
                },

                function reverseMatchIfStillNotFound( list, callback ) {
                    var behind  = cwd.split( path.sep )
                      , found   = false
                      , newList = [];

                    if ( list.length > 0 ) {
                        callback( null, list );
                    } else {
                        if ( program.verbose ) {
                            lib.utils.info( [ '    Traversing the tree backwards from ', cwd, ' to find seeds to target...' ].join( '' ) );
                        }

                        async.until(
                            function() {
                                return behind.length < 2 || found === true;
                            },
                            function ( next ) {
                                var thePath = behind.join( path.sep )
                                    , stats = fs.statSync( thePath );

                                if ( !!stats.isDirectory() ) {
                                    var packageJson = fs.readdirSync( thePath ).indexOf( 'package.json' ) !== -1 ? require( path.resolve( [ thePath, 'package.json' ].join( path.sep ) ) ) : false
                                      , isCleverStack = !!packageJson && !!packageJson.author && !!packageJson.author.name &&  packageJson.author.name.toLowerCase() === 'cleverstack'
                                      , isNodeSeed = isCleverStack && packageJson.name === 'node-seed'
                                      , isAngularSeed = isCleverStack && packageJson.name === 'angular-seed';

                                    if ( isCleverStack && ( isNodeSeed || isAngularSeed ) ) {
                                        lib.utils.success( [ '    Found CleverStack ', ( isNodeSeed ? 'Backend (node' : 'Frontend (angular' ), '-seed) in ', thePath ,'...' ].join( '' ) );

                                        newList.push({
                                            path: thePath,
                                            type: isNodeSeed ? 'backend' : 'frontend'
                                        });

                                        found = true;
                                    } else {
                                        behind.pop();
                                    }
                                } else {
                                    behind.pop();
                                }

                                next();
                            },
                            function ( err ) {
                                if ( !!err ) {
                                    callback( err );
                                } else if ( !newList.length ) {
                                    callback( 'Couldn\'t find a seed directory within ' + cwd );
                                } else {
                                    callback( null, newList );
                                }
                            }
                        );
                    }
                }
            ],
            function( err, res ) {
                !!err ? reject( err ) : resolve( res );
            }
        );
    });
}

/**
 * Finds seed locations and returns an object with common properties
 *
 * @param  {Boolean} [useCWD=false] - Whether or not we should use process.cwd()
 * @return {Promise}
 * @api public
 */

var get = exports.get = function( useCWD, fn ) {
    return new Promise( function( resolve, reject ) {
        if ( typeof useCWD === "function" ) {
            fn      = useCWD;
            useCWD  = false;
        }

        find()
            .then( function( foundProjects ) {
                var projects         = []
                  , projectTemplates = {
                        backend: {
                            name: 'backend',
                            modulePath: 'modules'
                        },
                        frontend: {
                            name: 'frontend',
                            modulePath: path.join( 'app', 'modules' )
                        }
                    };

                foundProjects.forEach( function( proj ) {

                    if ( projectTemplates.hasOwnProperty( proj.type ) ) {

                        projectTemplates[ proj.type ].moduleDir = proj.path;
                        projectTemplates[ proj.type ].useCWD    = useCWD;

                        projects.push( projectTemplates[ proj.type ] );
                    }

                });

                resolve( projects );
            })
            .catch(function( err ) {
                reject( err );
            });
    });
}<|endoftext|>


<commit_before>var RepoUtils = require('./repo');

/**
 * Create a new branch with the given name.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {String} name
 * @return {Promise<RepositoryState>}
 */
function create(repoState, driver, name) {
    throw new Error('Repofs: Not implemented');
}

/**
 * Remove the given branch from the repository.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {Branch} branch to remove
 * @return {Promise<RepositoryState>}
 */
function remove(repoState, driver, branch) {
    throw new Error('Repofs: Not implemented');
}

/**
 * Merge a branch/commit into a branch, and update that branch's tree.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {Branch | SHA} from The branch to merge from, or a commit SHA
 * @param {Branch} into The branch to merge into, receives the new
 * commit. Must be clean
 * @param {String} [options.message] Merge commit message
 * @return {Promise<RepositoryState, ERRORS.CONFLICT>} Fails with
 * CONFLICT error if automatic merge is not possible
 */
function merge(repoState, driver, from, into, options) {
    var intoWK = repoState.getWorkingStateForBranch(into);
    var fromWK = repoState.getWorkingStateForBranch(into);
    if(!fromWK.isClean() || !intoWK.isClean()) {
        throw new Error(['Cannot merge from',
                         from.getFullName(),
                         'into',
                         into.getFullName(),
                         'with pending changes'].join(' '));
    }

    driver.merge(from, into, {
        message: options.message
    })
    .then(function fetchTree() {
        return RepoUtils.fetchTree(repoState, driver, into);
    }); // Can fail with ERRORS.CONFLICT
}

module.exports = {
    remove: remove,
    create: create,
    merge: merge
};
<commit_msg>Implement branch delete and create<commit_after>var immutable = require('immutable');
var RepoUtils = require('./repo');

/**
 * Create a new branch with the given name.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {String} name
 * @return {Promise<RepositoryState>}
 */
function create(repoState, driver, name) {
    return driver.createBranch(repoState.getCurrentBranch(), name)
    // Update list of branches
    .then(function (createdBranch) {
        var branches = repoState.getBranches();
        branches = branches.push(createdBranch);
        return repoState.set('branches', branches);
    });
}

/**
 * Remove the given branch from the repository.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {Branch} branch to remove
 * @return {Promise<RepositoryState>}
 */
function remove(repoState, driver, branch) {
    return driver.deleteBranch(branch)
    .then(function () {
        var branches = repoState.getBranches();
        branches = branches.filter(function (br) {
            return immutable.is(br, branch);
        });
        return repoState.set('branches', branches);
    });
}

/**
 * Merge a branch/commit into a branch, and update that branch's tree.
 * @param {RepositoryState} repoState
 * @param {Driver} driver
 * @param {Branch | SHA} from The branch to merge from, or a commit SHA
 * @param {Branch} into The branch to merge into, receives the new
 * commit. Must be clean
 * @param {String} [options.message] Merge commit message
 * @return {Promise<RepositoryState, ERRORS.CONFLICT>} Fails with
 * CONFLICT error if automatic merge is not possible
 */
function merge(repoState, driver, from, into, options) {
    var intoWK = repoState.getWorkingStateForBranch(into);
    var fromWK = repoState.getWorkingStateForBranch(from);
    if(!fromWK.isClean() || !intoWK.isClean()) {
        throw new Error(['Cannot merge from',
                         from.getFullName(),
                         'into',
                         into.getFullName(),
                         'with pending changes'].join(' '));
    }

    driver.merge(from, into, {
        message: options.message
    })
    .then(function fetchTree() {
        return RepoUtils.fetchTree(repoState, driver, into);
    }); // Can fail with ERRORS.CONFLICT
}

module.exports = {
    remove: remove,
    create: create,
    merge: merge
};
<|endoftext|>


<commit_before>
var mysql = require('mysql'),
    query = require('./query');

function Database () {
    this.connection = null;
}

/**
 * Connect to database with provided user name and password.
 *
 * @param {Object} mysql connection options
 * @param {Function} callback
 * @return {Object} connection instance
 * @api public
 */

Database.prototype.connect = function (options, cb) {
    options.typeCast = false;
    options.multipleStatements = true;
    this.connection = mysql.createConnection(options);
    this.connection.connect(function (err) {
        // if (err) return cb(new DbError(err));
        if (err) return cb(err);
        cb(null);
    });
}

/**
 * Check if the connected user has permissions
 * for the specified schema.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the user has permissions or not
 * @api public
 */

Database.prototype.grants = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('show-grants', c.config.user);
    c.query(sql, function (err, rows) {
        if (err) return cb(err);
        for (var i=0; i < rows.length; i++) {
            var data = rows[i]['Grants for '+c.config.user+'@localhost'],
                regex = new RegExp('.*`'+schema+'`\\.*.*');
            if (regex.test(data)) {
                return cb(null, true);
            }
        }
        return cb(null, false);
    });
}

/**
 * Check if the specified schema exists.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the schema exists or not
 * @api public
 */

Database.prototype.exists = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('show-schemas', schema);
    c.query(sql, function (err, rows) {
        if (err) return cb(err);
        if (rows.length) return cb(null, true);
        cb(null, false);
    });
}

/**
 * Check if the specified schema is empty.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the schema is empty or not
 * @api public
 */

Database.prototype.empty = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('show-tables', schema);
    c.query(sql, function (err, rows) {
        if (err) return cb(err);
        if (rows.length) return cb(null, false);
        cb(null, true);
    });
}

/**
 * Set schema to be used for now on.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @api public
 */

Database.prototype.use = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('use', schema);
    c.query(sql, function (err, rows) {
        if (err) return cb(new DbError(err));
        c.config.database = schema;
        cb();
    });
}

exports = module.exports = new Database();

function DbError (err) {
    if (err instanceof Error) {
        switch (err.code) {
            case 'ER_ACCESS_DENIED_ERROR':
                this.message = 'Non existing database or user! '+
                                'Misspelled username or password!';
                break;
            case 'ER_DBACCESS_DENIED_ERROR':
                this.message = err.message.replace('ER_DBACCESS_DENIED_ERROR: ', '');
                break;
            default: return err; // throw raw mysql error
        }
    } else if ('string' === typeof err) {
        this.name = 'DatabaseError';
        switch (err) {
            case 'connection': this.message = 'Missing database connection!';
                break;
            default: this.message = 'Database error!'; break;
        }
    }
}
DbError.prototype = new Error();
DbError.prototype.constructor = DbError;
<commit_msg>Use Client inside connect and empty methods<commit_after>
var Client = require('./client'),
    query = require('./query');

function Database () {
    this.client = null;
}

/**
 * Connect to database with provided user name and password.
 *
 * @param {Object} mysql connection options
 * @param {Function} callback
 * @return {Object} connection instance
 * @api public
 */

Database.prototype.connect = function (config, cb) {
    this.client = new Client(config);

    var options = config.mysql || config.pg;
    this.client.connect(options, cb);
}

/**
 * Check if the connected user has permissions
 * for the specified schema.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the user has permissions or not
 * @api public
 */

Database.prototype.grants = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('show-grants', c.config.user);
    c.query(sql, function (err, rows) {
        if (err) return cb(err);
        for (var i=0; i < rows.length; i++) {
            var data = rows[i]['Grants for '+c.config.user+'@localhost'],
                regex = new RegExp('.*`'+schema+'`\\.*.*');
            if (regex.test(data)) {
                return cb(null, true);
            }
        }
        return cb(null, false);
    });
}

/**
 * Check if the specified schema exists.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the schema exists or not
 * @api public
 */

Database.prototype.exists = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('show-schemas', schema);
    c.query(sql, function (err, rows) {
        if (err) return cb(err);
        if (rows.length) return cb(null, true);
        cb(null, false);
    });
}

/**
 * Check if the specified schema is empty.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @return {Boolean} whether the schema is empty or not
 * @api public
 */

Database.prototype.empty = function (schema, cb) {
    if (!this.client.connection) return cb(new DbError('connection'));
    var sql = query.replace('show-tables', schema);
    this.client.query(sql, function (err, rows) {
        if (err) return cb(err);
        if (rows.length) return cb(null, false);
        cb(null, true);
    });
}

/**
 * Set schema to be used for now on.
 *
 * @param {String} schema name
 * @param {Function} callback
 * @api public
 */

Database.prototype.use = function (schema, cb) {
    if (!this.connection) return cb(new DbError('connection'));
    var c = this.connection,
        sql = query.replace('use', schema);
    c.query(sql, function (err, rows) {
        if (err) return cb(new DbError(err));
        c.config.database = schema;
        cb();
    });
}

exports = module.exports = new Database();

function DbError (err) {
    if (err instanceof Error) {
        switch (err.code) {
            case 'ER_ACCESS_DENIED_ERROR':
                this.message = 'Non existing database or user! '+
                                'Misspelled username or password!';
                break;
            case 'ER_DBACCESS_DENIED_ERROR':
                this.message = err.message.replace('ER_DBACCESS_DENIED_ERROR: ', '');
                break;
            default: return err; // throw raw mysql error
        }
    } else if ('string' === typeof err) {
        this.name = 'DatabaseError';
        switch (err) {
            case 'connection': this.message = 'Missing database connection!';
                break;
            default: this.message = 'Database error!'; break;
        }
    }
}
DbError.prototype = new Error();
DbError.prototype.constructor = DbError;
<|endoftext|>


<commit_before>module.exports = {
   /*"installedPackages":{
      "xmlName":"InstalledPackage",
      "children":{

      }
   },*/
   "labels":{
      "xmlName":"CustomLabels",
      "children":{
         "customLabels":"CustomLabel"
      }
   },
   "staticresources":{
      "xmlName":"StaticResource",
      "children":{

      }
   },
   "scontrols":{
      "xmlName":"Scontrol",
      "children":{

      }
   },
   "components":{
      "xmlName":"ApexComponent",
      "children":{

      }
   },
   "pages":{
      "xmlName":"ApexPage",
      "children":{

      }
   },
   "queues":{
      "xmlName":"Queue",
      "children":{

      }
   },
   "objects":{
      "xmlName":"CustomObject",
      "children":{
         "actionOverrides":"ActionOverride",
         "fields":"CustomField",
         "businessProcesses":"BusinessProcess",
         "recordTypes":"RecordType",
         "webLinks":"WebLink",
         "validationRules":"ValidationRule",
         "namedFilters":"NamedFilter",
         "sharingReasons":"SharingReason",
         "listViews":"ListView",
         "fieldSets":"FieldSet",
         "sharingRecalculations":"SharingRecalculation",
         "compactLayouts":"CompactLayout"
      }
   },
   "reportTypes":{
      "xmlName":"ReportType",
      "children":{

      }
   },
   "reports":{
      "xmlName":"Report",
      "children":{

      }
   },
   "dashboards":{
      "xmlName":"Dashboard",
      "children":{

      }
   },
   "analyticSnapshots":{
      "xmlName":"AnalyticSnapshot",
      "children":{

      }
   },
   "layouts":{
      "xmlName":"Layout",
      "children":{

      }
   },
   "portals":{
      "xmlName":"Portal",
      "children":{

      }
   },
   "documents":{
      "xmlName":"Document",
      "children":{

      }
   },
   "weblinks":{
      "xmlName":"CustomPageWebLink",
      "children":{

      }
   },
   "quickActions":{
      "xmlName":"QuickAction",
      "children":{

      }
   },
   "flexipages":{
      "xmlName":"FlexiPage",
      "children":{

      }
   },
   "tabs":{
      "xmlName":"CustomTab",
      "children":{

      }
   },
   "customApplicationComponents":{
      "xmlName":"CustomApplicationComponent",
      "children":{

      }
   },
   "applications":{
      "xmlName":"CustomApplication",
      "children":{

      }
   },
   "letterhead":{
      "xmlName":"Letterhead",
      "children":{

      }
   },
   "email":{
      "xmlName":"EmailTemplate",
      "children":{

      }
   },
   "workflows":{
      "xmlName":"Workflow",
      "children":{
         "alerts":"WorkflowAlert",
         "tasks":"WorkflowTask",
         "outboundMessages":"WorkflowOutboundMessage",
         "fieldUpdates":"WorkflowFieldUpdate",
         "rules":"WorkflowRule",
         "emailRecipients":"WorkflowEmailRecipient",
         "timeTriggers":"WorkflowTimeTrigger",
         "actionReferences":"WorkflowActionReference"
      }
   },
   "assignmentRules":{
      "xmlName":"AssignmentRules",
      "children":{

      }
   },
   "autoResponseRules":{
      "xmlName":"AutoResponseRules",
      "children":{

      }
   },
   "escalationRules":{
      "xmlName":"EscalationRules",
      "children":{

      }
   },
   "roles":{
      "xmlName":"Role",
      "children":{

      }
   },
   "groups":{
      "xmlName":"Group",
      "children":{

      }
   },
   "postTemplates":{
      "xmlName":"PostTemplate",
      "children":{

      }
   },
   "approvalProcesses":{
      "xmlName":"ApprovalProcess",
      "children":{

      }
   },
   "homePageComponents":{
      "xmlName":"HomePageComponent",
      "children":{

      }
   },
   "homePageLayouts":{
      "xmlName":"HomePageLayout",
      "children":{

      }
   },
   "objectTranslations":{
      "xmlName":"CustomObjectTranslation",
      "children":{

      }
   },
   "flows":{
      "xmlName":"Flow",
      "children":{

      }
   },
   "classes":{
      "xmlName":"ApexClass",
      "children":{

      }
   },
   "triggers":{
      "xmlName":"ApexTrigger",
      "children":{

      }
   },
   "profiles":{
      "xmlName":"Profile",
      "children":{

      }
   },
   "permissionsets":{
      "xmlName":"PermissionSet",
      "children":{

      }
   },
   "datacategorygroups":{
      "xmlName":"DataCategoryGroup",
      "children":{

      }
   },
   "remoteSiteSettings":{
      "xmlName":"RemoteSiteSetting",
      "children":{

      }
   },
   "authproviders":{
      "xmlName":"AuthProvider",
      "children":{

      }
   },
   "leadSharingRules":{
      "xmlName":"LeadSharingRules",
      "children":{

      }
   },
   "campaignSharingRules":{
      "xmlName":"CampaignSharingRules",
      "children":{

      }
   },
   "caseSharingRules":{
      "xmlName":"CaseSharingRules",
      "children":{

      }
   },
   "contactSharingRules":{
      "xmlName":"ContactSharingRules",
      "children":{

      }
   },
   "opportunitySharingRules":{
      "xmlName":"OpportunitySharingRules",
      "children":{

      }
   },
   "accountSharingRules":{
      "xmlName":"AccountSharingRules",
      "children":{

      }
   },
   "customObjectSharingRules":{
      "xmlName":"CustomObjectSharingRules",
      "children":{

      }
   },
   "communities":{
      "xmlName":"Community",
      "children":{

      }
   },
   "callCenters":{
      "xmlName":"CallCenter",
      "children":{

      }
   },
   "connectedApps":{
      "xmlName":"ConnectedApp",
      "children":{

      }
   },
   "samlssoconfigs":{
      "xmlName":"SamlSsoConfig",
      "children":{

      }
   },
   "synonymDictionaries":{
      "xmlName":"SynonymDictionary",
      "children":{

      }
   },
   "settings":{
      "xmlName":"Settings",
      "children":{

      }
   },
   "aura":{
      "xmlName":"AuraDefinitionBundle",
      "children":{

      }
   },
   "SharingRules":{
      "xmlName":"SharingRules",
      "children":{
         "sharingTerritoryRules":"SharingTerritoryRule"
      }
   }
};<commit_msg>Fix #6<commit_after>module.exports = {
   /*"installedPackages":{
      "xmlName":"InstalledPackage",
      "children":{
      }
   },*/
   "labels":{
      "xmlName":"CustomLabels",
      "children":{
         "CustomLabels":"CustomLabel"
      }
   },
   "staticresources":{
      "xmlName":"StaticResource",
      "children":{

      }
   },
   "scontrols":{
      "xmlName":"Scontrol",
      "children":{

      }
   },
   "components":{
      "xmlName":"ApexComponent",
      "children":{

      }
   },
   "customMetadata":{
      "xmlName":"CustomMetadata",
      "children":{

      }
   },
   "globalValueSets":{
      "xmlName":"GlobalValueSet",
      "children":{

      }
   },
   "globalValueSetTranslations":{
      "xmlName":"GlobalValueSetTranslation",
      "children":{

      }
   },
   "standardValueSets":{
      "xmlName":"StandardValueSet",
      "children":{

      }
   },
   "pages":{
      "xmlName":"ApexPage",
      "children":{

      }
   },
   "queues":{
      "xmlName":"Queue",
      "children":{

      }
   },
   "objects":{
      "xmlName":"CustomObject",
      "children":{
         "actionOverrides":{"typeName":"ActionOverride","name":"actionName"},
         "fields":{"typeName":"CustomField","name":"fullName"},
         "businessProcesses":{"typeName":"BusinessProcess","name":"fullName"},
         "recordTypes":{"typeName":"RecordType","name":"fullName"},
         "webLinks":{"typeName":"WebLink","name":"fullName"},
         "validationRules":{"typeName":"ValidationRule","name":"fullName"},
         "namedFilters":{"typeName":"NamedFilter","name":"fullName"},
         "sharingReasons":{"typeName":"SharingReason","name":"fullName"},
         "listViews":{"typeName":"ListView","name":"fullName"},
         "fieldSets":{"typeName":"FieldSet","name":"fullName"},
         "compactLayouts":{"typeName":"WorkflowAlert","name":"fullName"}
      }
   },
   "reportTypes":{
      "xmlName":"ReportType",
      "children":{

      }
   },
   "reports":{
      "xmlName":"Report",
      "children":{

      }
   },
   "dashboards":{
      "xmlName":"Dashboard",
      "children":{

      }
   },
   "analyticSnapshots":{
      "xmlName":"AnalyticSnapshot",
      "children":{

      }
   },
   "layouts":{
      "xmlName":"Layout",
      "children":{

      }
   },
   "portals":{
      "xmlName":"Portal",
      "children":{

      }
   },
   "documents":{
      "xmlName":"Document",
      "children":{

      }
   },
   "weblinks":{
      "xmlName":"CustomPageWebLink",
      "children":{

      }
   },
   "quickActions":{
      "xmlName":"QuickAction",
      "children":{

      }
   },
   "flexipages":{
      "xmlName":"FlexiPage",
      "children":{

      }
   },
   "tabs":{
      "xmlName":"CustomTab",
      "children":{

      }
   },
   "customApplicationComponents":{
      "xmlName":"CustomApplicationComponent",
      "children":{

      }
   },
   "applications":{
      "xmlName":"CustomApplication",
      "children":{

      }
   },
   "letterhead":{
      "xmlName":"Letterhead",
      "children":{

      }
   },
   "email":{
      "xmlName":"EmailTemplate",
      "children":{

      }
   },
   "workflows":{
      "xmlName":"Workflow",
      "children":{
         "alerts":{"typeName":"WorkflowAlert","name":"fullName"},
         "tasks":{"typeName" : "WorkflowTask", "name" : "fullName"},
         "outboundMessages":{"typeName" : "WorkflowOutboundMessage","name" : "fullName"},
         "fieldUpdates":{"typeName" : "WorkflowFieldUpdate", "name" : "fullName"},
         "rules":{"typeName" : "WorkflowRule", "name" : "fullName"},
         "emailRecipients":{"typeName" : "WorkflowEmailRecipient", "name" : "fullName"},
         "timeTriggers":{"typeName" : "WorkflowTimeTrigger", "name" : "fullName"},
         "actionReferences":{"typeName" : "WorkflowActionReference", "name" : "fullName"}
      }
   },
   "assignmentRules":{
      "xmlName":"AssignmentRules",
      "children":{

      }
   },
   "autoResponseRules":{
      "xmlName":"AutoResponseRules",
      "children":{

      }
   },
   "escalationRules":{
      "xmlName":"EscalationRules",
      "children":{

      }
   },
   "roles":{
      "xmlName":"Role",
      "children":{

      }
   },
   "groups":{
      "xmlName":"Group",
      "children":{

      }
   },
   "postTemplates":{
      "xmlName":"PostTemplate",
      "children":{

      }
   },
   "approvalProcesses":{
      "xmlName":"ApprovalProcess",
      "children":{

      }
   },
   "homePageComponents":{
      "xmlName":"HomePageComponent",
      "children":{

      }
   },
   "homePageLayouts":{
      "xmlName":"HomePageLayout",
      "children":{

      }
   },
   "objectTranslations":{
      "xmlName":"CustomObjectTranslation",
      "children":{

      }
   },
   "flows":{
      "xmlName":"Flow",
      "children":{

      }
   },
   "classes":{
      "xmlName":"ApexClass",
      "children":{

      }
   },
   "triggers":{
      "xmlName":"ApexTrigger",
      "children":{

      }
   },
   "profiles":{
      "xmlName":"Profile",
      "children":{

      }
   },
   "permissionsets":{
      "xmlName":"PermissionSet",
      "children":{

      }
   },
   "datacategorygroups":{
      "xmlName":"DataCategoryGroup",
      "children":{

      }
   },
   "remoteSiteSettings":{
      "xmlName":"RemoteSiteSetting",
      "children":{

      }
   },
   "authproviders":{
      "xmlName":"AuthProvider",
      "children":{

      }
   },
   "leadSharingRules":{
      "xmlName":"LeadSharingRules",
      "children":{

      }
   },
   "campaignSharingRules":{
      "xmlName":"CampaignSharingRules",
      "children":{

      }
   },
   "caseSharingRules":{
      "xmlName":"CaseSharingRules",
      "children":{

      }
   },
   "contactSharingRules":{
      "xmlName":"ContactSharingRules",
      "children":{

      }
   },
   "opportunitySharingRules":{
      "xmlName":"OpportunitySharingRules",
      "children":{

      }
   },
   "accountSharingRules":{
      "xmlName":"AccountSharingRules",
      "children":{

      }
   },
   "customObjectSharingRules":{
      "xmlName":"CustomObjectSharingRules",
      "children":{

      }
   },
   "communities":{
      "xmlName":"Community",
      "children":{

      }
   },
   "callCenters":{
      "xmlName":"CallCenter",
      "children":{

      }
   },
   "connectedApps":{
      "xmlName":"ConnectedApp",
      "children":{

      }
   },
   "samlssoconfigs":{
      "xmlName":"SamlSsoConfig",
      "children":{

      }
   },
   "synonymDictionaries":{
      "xmlName":"SynonymDictionary",
      "children":{

      }
   },
   "settings":{
      "xmlName":"Settings",
      "children":{

      }
   },
   "aura":{
      "xmlName":"AuraDefinitionBundle",
      "children":{

      }
   },
   "sharingRules":{
      "xmlName":"SharingRules",
      "children":{
         "sharingTerritoryRules":"SharingTerritoryRule",
         "sharingOwnerRules":"SharingOwnerRule",
         "sharingCriteriaRules":"SharingCriteriaRule"
      }
   },
   "contentassets":{
      "xmlName":"ContentAsset",
      "children":{

      }
   },
   "networks":{
      "xmlName":"Network",
      "children":{

      }
   },
   "siteDotComSites":{
      "xmlName":"SiteDotCom",
      "children":{

      }
   },
   "flowDefinitions":{
      "xmlName":"FlowDefinition",
      "children":{

      }
   },
   "matchingRules":{
      "xmlName":"MatchingRules",
      "children":{

      }
   }
};
<|endoftext|>


<commit_before>/* return parent n of HTMLitem item */
function parents(item, n) {
    for(var i = 0; i < n; i++) {
        item = item.parentNode;
    }
    return item;
}

/* given a comment spacer, return the spacer for the next comment */
function getNextSpacer(curr) {
    var parent = parents(curr, 6);
    var next_thing = parent.nextSibling.nextSibling
    var next_spacer = undefined;

    if(next_thing != null && next_thing.getAttribute("class") == "athing") {
        next_spacer = next_thing
            .children[0]
            .children[0]
            .children[0]
            .children[0]
            .children[0]
            .children[0];
    }
    return next_spacer;
}

/* collapse comment and subcomments corresponding to the pressed collapse button */
function collapse(event) {
    var item = event.target;
    var spacer = parents(item,4).children[0].children[0];
    var spacer_width = Number(spacer.getAttribute("width"));
	var text = parents(item,2).nextSibling.nextSibling;

    if(item.getAttribute("collapsed") == "true") {
    	item.innerHTML = "[-]";
	    item.setAttribute("collapsed",false);

    	/* show this items comment */
    	text.style.display = "initial";

	    /* sometimes replies are next to, rather than inside the comment */
	    if(text.nextSibling != null && text.nextSibling.getAttribute("class") == "reply") {
	    	text.nextSibling.style.display = "initial";
	    }

    	/* show child comments */
    	while(spacer_width < Number(getNextSpacer(spacer).getAttribute("width"))) {
    		var comment;
    		spacer = getNextSpacer(spacer);
		    comment = parents(spacer,6);

		    /* show only if this item collapsed it */
		    if(comment.getAttribute("collapser") == item.id) {
			    comment.style.display = "initial";
			    comment.removeAttribute("collapser");
			}
    	}

    } else {
	    item.innerHTML = "[+]";
	    item.setAttribute("collapsed",true);

	    /* hide this items comment */
	    text.style.display = "none";

	    /* sometimes replies are next to, rather than inside the comment */
	    if(text.nextSibling != null && text.nextSibling.getAttribute("class") == "reply") {
	    	text.nextSibling.style.display = "none";
	    }

	    /* hide child comments */
	    while(spacer_width < Number(getNextSpacer(spacer).getAttribute("width"))) {
	    	var comment;
	        spacer = getNextSpacer(spacer);
		    comment = parents(spacer,6);
		    comment.style.display = "none";
		    comment.setAttribute("collapser", item.id);
	    }
	}
}

/* initialize collapse buttons */
comments = [];
rows = document.getElementsByClassName("comhead");
rows = Array.prototype.filter.call(rows, function (item) {
    if(item.className == "comhead") {
        return item;
    }
});

for(var i = 0;i < rows.length; i++) {
    var button = document.createElement("A");
    var textNode = document.createTextNode("[-]");
    button.setAttribute("id", "collapse-" + i);
    button.setAttribute("href", "javascript:void(0)");
    button.appendChild(textNode);
    rows[i].insertBefore(button, rows[i].childNodes[0]);
    button.addEventListener('click',collapse);
    button.setAttribute("collapsed",false);
}
<commit_msg>fixed bug where collapser attributes would be overriden by collapsing a greater parent<commit_after>/* return parent n of HTMLitem item */
function parents(item, n) {
    for(var i = 0; i < n; i++) {
        item = item.parentNode;
    }
    return item;
}

/* given a comment spacer, return the spacer for the next comment */
function getNextSpacer(curr) {
    var parent = parents(curr, 6);
    var next_thing = parent.nextSibling.nextSibling
    var next_spacer = undefined;

    if(next_thing != null && next_thing.getAttribute("class") == "athing") {
        next_spacer = next_thing
            .children[0]
            .children[0]
            .children[0]
            .children[0]
            .children[0]
            .children[0];
    }
    return next_spacer;
}

/* collapse comment and subcomments corresponding to the pressed collapse button */
function collapse(event) {
    var item = event.target;
    var spacer = parents(item,4).children[0].children[0];
    var spacer_width = Number(spacer.getAttribute("width"));
	var text = parents(item,2).nextSibling.nextSibling;

    if(item.getAttribute("collapsed") == "true") {
    	item.innerHTML = "[-]";
	    item.setAttribute("collapsed",false);

    	/* show this items comment */
    	text.style.display = "initial";

	    /* sometimes replies are next to, rather than inside the comment */
	    if(text.nextSibling != null && text.nextSibling.getAttribute("class") == "reply") {
	    	text.nextSibling.style.display = "initial";
	    }

    	/* show child comments */
    	while(spacer_width < Number(getNextSpacer(spacer).getAttribute("width"))) {
    		var comment;
    		spacer = getNextSpacer(spacer);
		    comment = parents(spacer,6);

		    /* show only if this item collapsed it */
		    if(comment.getAttribute("collapser") == item.id) {
			    comment.style.display = "initial";
			    comment.removeAttribute("collapser");
			}
    	}

    } else {
	    item.innerHTML = "[+]";
	    item.setAttribute("collapsed",true);

	    /* hide this items comment */
	    text.style.display = "none";

	    /* sometimes replies are next to, rather than inside the comment */
	    if(text.nextSibling != null && text.nextSibling.getAttribute("class") == "reply") {
	    	text.nextSibling.style.display = "none";
	    }

	    /* hide child comments */
	    while(spacer_width < Number(getNextSpacer(spacer).getAttribute("width"))) {
	    	var comment;
	        spacer = getNextSpacer(spacer);
		    comment = parents(spacer,6);
		    comment.style.display = "none";
		    if(!comment.getAttribute("collapser")) {
			    comment.setAttribute("collapser", item.id);
		    }
	    }
	}
}

/* initialize collapse buttons */
comments = [];
rows = document.getElementsByClassName("comhead");
rows = Array.prototype.filter.call(rows, function (item) {
    if(item.className == "comhead") {
        return item;
    }
});

for(var i = 0;i < rows.length; i++) {
    var button = document.createElement("A");
    var textNode = document.createTextNode("[-]");
    button.setAttribute("id", "collapse-" + i);
    button.setAttribute("href", "javascript:void(0)");
    button.appendChild(textNode);
    rows[i].insertBefore(button, rows[i].childNodes[0]);
    button.addEventListener('click',collapse);
    button.setAttribute("collapsed",false);
}
<|endoftext|>


<commit_before>
(function () {

	this.Coloriss = (function () {

		function Coloriss (color) {
			this.color = color;
		};

		Coloriss.prototype.hex = function (dash) {
			var hex = dash ? '#' : '';
			//
		};

		Coloriss.prototype.rgb = function () {
			var a, r, g, b;

			this.alpha = a = this.color >> 24;
			this.red = r = 0xFF & (this.color >> 16);
			this.green = g = 0xFF & (this.color >> 8);
			this.blue = b = 0xFF & this.color;
			return {a:a, r:r, g:g, b:b};
		};

		Coloriss.prototype.red = function () {
			return this.red;
		}

		Coloriss.prototype.grey = function () {
			return (this.red + this.green + this.blue) / 3;
		};

		var toHex = function (val) {
			n = parseInt(val, 10);

			if (isNaN(n)) return null;

			n = Math.max(0, Math.min(n, 255));
			return "0123456789ABCDEF".charAt((n - n % 16) / 16)
				+ "0123456789ABCDEF".charAt(n % 16);
		}

		return Coloriss;

	})();

})();
<commit_msg>adding getter methods<commit_after>
(function () {

	this.Coloriss = (function () {

		function Coloriss (color) {
			this.color = color;
		};

		Coloriss.prototype.hex = function (dash) {
			var hex = dash ? '#' : '';
			//
		};

		Coloriss.prototype.rgb = function () {
			var a, r, g, b;

			this.alpha = a = this.color >> 24;
			this.red = r = 0xFF & (this.color >> 16);
			this.green = g = 0xFF & (this.color >> 8);
			this.blue = b = 0xFF & this.color;
			return {a:a, r:r, g:g, b:b};
		};

		Coloriss.prototype.red = function () {
			return this.red;
		};

		Coloriss.prototype.green = function () {
			return this.green;
		};

		Coloriss.prototype.blue = function () {
			return this.blue;
		};

		Coloriss.prototype.grey = function () {
			return (this.red + this.green + this.blue) / 3;
		};

		var toHex = function (val) {
			n = parseInt(val, 10);

			if (isNaN(n)) return null;

			n = Math.max(0, Math.min(n, 255));
			return "0123456789ABCDEF".charAt((n - n % 16) / 16)
				+ "0123456789ABCDEF".charAt(n % 16);
		}

		return Coloriss;

	})();

})();
<|endoftext|>


<commit_before>'use strict';

module.exports = {
  client: {
    lib: {
      css: [
        'public/lib/bootstrap/dist/css/bootstrap.min.css',
        'public/lib/bootstrap/dist/css/bootstrap-theme.min.css',
        'public/lib/angular-material/angular-material.min.css',
        'public/lib/components-font-awesome/css/font-awesome.min.css',
        'public/lib/ng-tags-input/ng-tags-input.min.css',
        'public/lib/angular-moment-picker/dist/angular-moment-picker.min.css',
        'public/lib/textAngular/dist/textAngular.min.css',
        'public/lib/angular-toastr/dist/angular-toastr.min.css',
        'public/lib/ng-dialog/css/ngDialog.min.css',
        'public/lib/ng-dialog/css/ngDialog-theme-default.min.css',
        'public/lib/angucomplete-alt/angucomplete-alt.min.css',
        'public/lib/simple-line-icons/css/simple-line-icons.min.css',
        'public/lib/angular-loading-bar/build/loading-bar.min.css'
      ],
      js: [
        'public/lib/jquery/dist/jquery.min.js',
        'public/lib/angular/angular.min.js',
        'public/lib/angular-resource/angular-resource.min.js',
        'public/lib/angular-animate/angular-animate.min.js',
        'public/lib/angular-messages/angular-messages.min.js',
        'public/lib/angular-sanitize/angular-sanitize.min.js',
        'public/lib/angular-ui-router/release/angular-ui-router.min.js',
        'public/lib/angular-socket-io/socket.min.js',
        'public/lib/angular-touch/angular-touch.min.js',
        'public/lib/angular-ui-utils/ui-utils.min.js',
        'public/lib/angular-bootstrap/ui-bootstrap-tpls.min.js',
        'public/lib/angular-bootstrap/ui.bootstrap.materialPicker.js',
        'public/lib/angular-file-upload/angular-file-upload.min.js',
        'public/lib/angular-strap/dist/angular-strap.min.js',
        'public/lib/angular-strap/dist/angular-strap.tpl.min.js',
        'public/lib/angular-strap/dist/angular-strap.compat.min.js',
        'public/lib/angular-aria/angular-aria.min.js',
        'public/lib/angular-material/angular-material.min.js',
        'public/lib/angular-ui-switch/angular-ui-switch.min.js',
        'public/lib/angular-elastic/elastic.min.js',
        'public/lib/angular-webstorage/angular-webstorage.min.js',
        'public/lib/chart.js/dist/Chart.min.js',
        'public/lib/angular-chart.js/dist/angular-chart.min.js',
        'public/lib/ng-tags-input/ng-tags-input.min.js',
        'public/lib/underscore/underscore.min.js',
        'public/lib/moment/moment.js',
        'public/lib/moment-timezone/moment-timezone.min.js',
        'public/lib/angular-moment/angular-moment.min.js',
        'public/lib/angular-moment-picker/dist/angular-moment-picker.min.js',
        'public/lib/owasp-password-strength-test/owasp-password-strength-test.js',
        'public/lib/ngInfiniteScroll/build/ng-infinite-scroll.min.js',
        'public/lib/textAngular/dist/textAngular-rangy.min.js',
        'public/lib/textAngular/dist/textAngular-sanitize.min.js',
        'public/lib/textAngular/dist/textAngular.min.js',
        'public/lib/textAngular/dist/textAngularSetup.min.js',
        'public/lib/angular-toastr/dist/angular-toastr.tpls.min.js',
        'public/lib/ng-dialog/js/ngDialog.min.js',
        'public/lib/angucomplete-alt/angucomplete-alt.min.js',
        'public/lib/angular-loading-bar/build/loading-bar.min.js',
        'public/lib/angular-breadcrumb/dist/angular-breadcrumb.min.js',
        'public/lib/angular-socialshare/dist/angular-socialshare.min.js'
      ]
    },
    css: 'public/dist/application.min.css',
    js: 'public/dist/application.min.js'
  }
};
<commit_msg>Commited from lenh at Thu, Aug 17, 2017  2:44:21 PM<commit_after>'use strict';

module.exports = {
  client: {
    lib: {
      css: [
        'public/lib/bootstrap/dist/css/bootstrap.min.css',
        'public/lib/bootstrap/dist/css/bootstrap-theme.min.css',
        'public/lib/angular-material/angular-material.min.css',
        'public/lib/components-font-awesome/css/font-awesome.min.css',
        'public/lib/ng-tags-input/ng-tags-input.min.css',
        'public/lib/angular-moment-picker/dist/angular-moment-picker.min.css',
        'public/lib/textAngular/dist/textAngular.min.css',
        'public/lib/angular-toastr/dist/angular-toastr.min.css',
        'public/lib/ng-dialog/css/ngDialog.min.css',
        'public/lib/ng-dialog/css/ngDialog-theme-default.min.css',
        'public/lib/angucomplete-alt/angucomplete-alt.min.css',
        'public/lib/simple-line-icons/css/simple-line-icons.min.css',
        'public/lib/angular-loading-bar/build/loading-bar.min.css'
      ],
      js: [
        'public/lib/jquery/dist/jquery.min.js',
        'public/lib/angular/angular.js',
        'public/lib/angular-resource/angular-resource.js',
        'public/lib/angular-animate/angular-animate.js',
        'public/lib/angular-messages/angular-messages.js',
        'public/lib/angular-sanitize/angular-sanitize.js',
        'public/lib/angular-socket-io/socket.js',
        'public/lib/angular-touch/angular-touch.js',
        'public/lib/angular-ui-router/release/angular-ui-router.js',
        'public/lib/angular-ui-utils/ui-utils.js',
        'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
        'public/lib/angular-bootstrap/ui.bootstrap.materialPicker.js',
        'public/lib/angular-strap/dist/angular-strap.js',
        'public/lib/angular-strap/dist/angular-strap.tpl.js',
        'public/lib/angular-strap/dist/angular-strap.compat.js',
        'public/lib/angular-file-upload/angular-file-upload.js',
        'public/lib/angular-aria/angular-aria.js',
        'public/lib/angular-material/angular-material.js',
        'public/lib/angular-ui-switch/angular-ui-switch.js',
        'public/lib/angular-elastic/elastic.js',
        'public/lib/angular-webstorage/angular-webstorage.js',
        'public/lib/chart.js/dist/Chart.js',
        'public/lib/angular-chart.js/dist/angular-chart.js',
        'public/lib/ng-tags-input/ng-tags-input.js',
        'public/lib/underscore/underscore.js',
        'public/lib/moment/moment.js',
        'public/lib/moment-timezone/moment-timezone.js',
        'public/lib/angular-moment/angular-moment.js',
        'public/lib/angular-moment-picker/dist/angular-moment-picker.js',
        'public/lib/owasp-password-strength-test/owasp-password-strength-test.js',
        'public/lib/ngInfiniteScroll/build/ng-infinite-scroll.js',
        'public/lib/textAngular/dist/textAngular-rangy.min.js',
        'public/lib/textAngular/dist/textAngular-sanitize.min.js',
        'public/lib/textAngular/dist/textAngular.js',
        'public/lib/textAngular/dist/textAngularSetup.js',
        'public/lib/angular-toastr/dist/angular-toastr.tpls.js',
        'public/lib/ng-dialog/js/ngDialog.min.js',
        'public/lib/angucomplete-alt/angucomplete-alt.js',
        'public/lib/angular-loading-bar/build/loading-bar.js',
        'public/lib/angular-breadcrumb/dist/angular-breadcrumb.min.js',
        'public/lib/angular-socialshare/dist/angular-socialshare.js'
      ]
    },
    css: 'public/dist/application.min.css',
    js: 'public/dist/application.min.js'
  }
};
<|endoftext|>