<commit_before>// Generated on 2014-05-26 using generator-angular 0.8.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['bowerInstall']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: true
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9030,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= yeoman.app %>'
          ]
        }
      },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/{,*/}*.js'
      ],
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    bowerInstall: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath: '<%= yeoman.app %>/'
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/{,*/}*.js',
            '<%= yeoman.dist %>/styles/{,*/}*.css',
            '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/styles/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>']
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    cssmin: {
      options: {
        //root: '<%= yeoman.app %>'
      }
    },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ngmin tries to make the code safe for minification automatically by
    // using the Angular long form for dependency injection. It doesn't work on
    // things like resolve or inject so those have to be done manually.
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'fonts/*'
          ]
        },{
          expand: true,
          dot: true,
          flatten: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>/fonts',
          src: [
           'bower_components/font-awesome/fonts/*'
          ]
        },{
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css',
    //         '<%= yeoman.app %>/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    // Test settings
    karma: {
      unit: {
        configFile: 'karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'bowerInstall',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'bowerInstall',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<commit_msg>fix indent<commit_after>// Generated on 2014-05-26 using generator-angular 0.8.0
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: {
      // configurable paths
      app: require('./bower.json').appPath || 'app',
      dist: 'dist'
    },

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['bowerInstall']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: true
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      styles: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['newer:copy:styles', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9030,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          base: [
            '.tmp',
            '<%= yeoman.app %>'
          ]
        }
      },
      test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },
      dist: {
        options: {
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: [
        'Gruntfile.js',
        '<%= yeoman.app %>/scripts/{,*/}*.js'
      ],
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    bowerInstall: {
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath: '<%= yeoman.app %>/'
      }
    },

    // Renames files for browser caching purposes
    rev: {
      dist: {
        files: {
          src: [
            '<%= yeoman.dist %>/scripts/{,*/}*.js',
            '<%= yeoman.dist %>/styles/{,*/}*.css',
            '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
            '<%= yeoman.dist %>/styles/fonts/*'
          ]
        }
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on rev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>']
      }
    },

    // The following *-min tasks produce minified files in the dist folder
    cssmin: {
      options: {
        //root: '<%= yeoman.app %>'
      }
    },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ngmin tries to make the code safe for minification automatically by
    // using the Angular long form for dependency injection. It doesn't work on
    // things like resolve or inject so those have to be done manually.
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'fonts/*'
          ]
        },{
          expand: true,
          dot: true,
          flatten: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>/fonts',
          src: [
            'bower_components/font-awesome/fonts/*'
          ]
        },{
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'copy:styles'
      ],
      test: [
        'copy:styles'
      ],
      dist: [
        'copy:styles',
        'imagemin',
        'svgmin'
      ]
    },

    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css',
    //         '<%= yeoman.app %>/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    // Test settings
    karma: {
      unit: {
        configFile: 'karma.conf.js',
        singleRun: true
      }
    }
  });

  grunt.registerTask('serve', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'bowerInstall',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'bowerInstall',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'rev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};
<|endoftext|>


<commit_before>// Configuration
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: '<json:package.json>',

        htmlhint: {
            all: {
                options: {
                    'tagname-lowercase': true,
                    'attr-lowercase': true,
                    'doctype-first': true,
                    'tag-pair': true,
                    'spec-char-escape': true,
                    'id-unique': true,
                    'img-alt-require': true,
                    'doctype-html5': true,
                    'id-class-value': true,
                    'style-disabled': true
                },
                src: ['*.html']
            }
        },

        jshint: {
            all: ['Gruntfile.js',
                  'scripts/main.js']
        },

        favicons: {
            options: {
                'trueColor': false,
                'precomposed': true,
                'appleTouchBackgroundColor': "auto",
                'windowsTile': true,
                'coast': false,
                'tileBlackWhite': true,
                'tileColor': "auto"
            },
            deploy: {
                src: 'favicon-source.png',
                dest: 'dist/'
            }
        },

        clean: {
            deploy: ['dist']
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,
                    middleware: function(connect, options) {
                        return[
                            require('connect-livereload')(),
                            connect.static(options.base),
                            connect.directory(options.base)
                        ];
                    }
                }
            }
        },

        watch: {
            options: {
                atBegin: true,
                livereload: true
            },
            icons: {
                files: 'fontello.json',
                tasks: ['fontello:build'],
                options: {
                    spawn: false
                }
            },
            html: {
                files: '*.html',
                tasks: [],
                options: {
                    spawn: false
                }
            },
            js: {
                files: ['scripts/main.js'],
                tasks: ['concat:dev'],
                options: {
                    spawn: false
                }
            },
            scss: {
                files: 'scss/**/*.scss',
                tasks: ['sass:dev'],
                options: {
                    spawn: false
                }
            }
        },

        modernizr: {
            'devFile' : 'scripts/modernizr/modernizr.js',
            'outputFile' : 'dist/scripts/modernizr/modernizr.js',
            'extra' : {
                'shiv' : false,
                'printshiv' : true,
                'load' : false,
                'mq' : true,
                'cssclasses' : true
            },
            'extensibility' : {
                'addtest' : false,
                'prefixed' : false,
                'teststyles' : false,
                'testprops' : false,
                'testallprops' : false,
                'hasevents' : false,
                'prefixes' : false,
                'domprefixes' : false
            },
            'uglify' : true,
            'tests' : [],
            // parseFiles = true: crawl all *.js, *.css, *.scss files;
            // override by defining "files" array
            'parseFiles' : true,
            'files' : ['scss/**/*.scss',
                       'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                       'scripts/magnific-popup/src/css/main.scss',
                       'scripts/jquery-cycle2/*.js',
                       'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                       'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                       'scripts/gmaps/gmaps.js',
                       'scripts/*.js'],
            'matchCommunityTests' : false,
            'customTests' : [],
            'excludeFiles' : ['Gruntfile.js', '*.json']
        },

        concat: {
            dev: {
                src: ['scripts/helpers/log.js',
                      'scripts/accessifyhtml5-amd/accessifyhtml5.js',
                      'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                      'scripts/jquery-cycle2/jquery.cycle2.core.js',
                      'scripts/jquery-cycle2/jquery.cycle2.autoheight.js',
                      'scripts/jquery-cycle2/jquery.cycle2.caption.js',
                      'scripts/jquery-cycle2/jquery.cycle2.command.js',
                      'scripts/jquery-cycle2/jquery.cycle2.hash.js',
                      'scripts/jquery-cycle2/jquery.cycle2.loader.js',
                      'scripts/jquery-cycle2/jquery.cycle2.pager.js',
                      'scripts/jquery-cycle2/jquery.cycle2.prevnext.js',
                      'scripts/jquery-cycle2/jquery.cycle2.progressive.js',
                      'scripts/jquery-cycle2/jquery.cycle2.tmpl.js',
                      'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                      'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                      'scripts/gmaps/gmaps.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            },
            deploy: {
                src: ['scripts/accessifyhtml5-amd/accessifyhtml5.js',
                      'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                      'scripts/jquery-cycle2/jquery.cycle2.core.js',
                      'scripts/jquery-cycle2/jquery.cycle2.autoheight.js',
                      'scripts/jquery-cycle2/jquery.cycle2.caption.js',
                      'scripts/jquery-cycle2/jquery.cycle2.command.js',
                      'scripts/jquery-cycle2/jquery.cycle2.hash.js',
                      'scripts/jquery-cycle2/jquery.cycle2.loader.js',
                      'scripts/jquery-cycle2/jquery.cycle2.pager.js',
                      'scripts/jquery-cycle2/jquery.cycle2.prevnext.js',
                      'scripts/jquery-cycle2/jquery.cycle2.progressive.js',
                      'scripts/jquery-cycle2/jquery.cycle2.tmpl.js',
                      'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                      'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                      'scripts/gmaps/gmaps.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            }
        },

        uglify: {
            deploy: {
                src: 'scripts/master.js',
                dest: 'dist/scripts/master.js'
            }
        },

        sass: {
            dev: {
                options: {
                    sourcemap: false,
                    style: 'nested',
                    precision: 5
                },
                files: [{
                    expand: true,
                    cwd: 'scss',
                    src: ['*.scss'],
                    dest: 'styles',
                    ext: '.css'
                }]
            },
            deploy: {
                options: {
                    sourcemap: false,
                    style: 'compressed',
                    precision: 5
                },
                files: [{
                    expand: true,
                    cwd: 'scss',
                    src: ['*.scss'],
                    dest: 'dist/styles',
                    ext: '.css'
                }]
            }
        },

        imagemin: {
            deploy: {
                options: {
                    optimizationLevel: 1,
                    progressive: false
                },
                files: [
                    {
                        expand: true,
                        cwd: '.',
                        src: ['img/**/*.png', 'img/**/*.jpg'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        copy: {
            deploy: {
                files: [
                    {
                        src: ['.htaccess',
                              'robots.txt',
                              'scripts/jquery/jquery.min.js',
                              'scripts/helpers/boxsizing.htc',
                              'font/*',
                              '*.html'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        hashres: {
            options: {
                encoding: 'utf-8',
                fileNameFormat: '${hash}.${ext}',
                renameFiles: true
            },
            deploy: {
                src: ['dist/styles/master.css',
                      'dist/styles/oldie.css',
                      'dist/scripts/master.js'],
                dest: 'dist/*.html',

            }
        },

        // To use this for target-based includes, e.g. to include Piwik snippet:
        // <!--(if target deploy)><!(endif)-->
        // → github.com/changer/grunt-targethtml
        targethtml: {
            deploy: {
                files: [{
                    expand: true,
                    src: ['*.html'],
                    dest: 'dist/'
                }],
            }
        },

        fontello: {
            options: {
                config: 'fontello.json',
                zip: 'scripts/',
                fonts: 'font/',
                styles: 'scss/fontello/',
                sass: true,
                force: true
            },
            build: {
                config: 'fontello.json',
                fonts: 'font/',
                styles: 'scss/fontello/'
            }
        }
    });
    // Load required tasks
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-favicons');
    grunt.loadNpmTasks('grunt-fontello');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-modernizr');
    grunt.loadNpmTasks('grunt-targethtml');
    // Default
    grunt.registerTask('default', ['connect', 'watch']);
    // Testing
    grunt.registerTask('test', ['htmlhint', 'jshint']);
    // Deployment
    grunt.registerTask('deploy', ['clean:deploy', 'fontello:build', 'copy:deploy', 'concat:deploy', 'sass:deploy', 'uglify', 'imagemin:deploy', 'favicons:deploy', 'modernizr', 'targethtml:deploy', 'hashres:deploy']);
};
<commit_msg>This should make the watch task less prone to errors.<commit_after>// Configuration
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: '<json:package.json>',

        htmlhint: {
            all: {
                options: {
                    'tagname-lowercase': true,
                    'attr-lowercase': true,
                    'doctype-first': true,
                    'tag-pair': true,
                    'spec-char-escape': true,
                    'id-unique': true,
                    'img-alt-require': true,
                    'doctype-html5': true,
                    'id-class-value': true,
                    'style-disabled': true
                },
                src: ['*.html']
            }
        },

        jshint: {
            all: ['Gruntfile.js',
                  'scripts/main.js']
        },

        favicons: {
            options: {
                'trueColor': false,
                'precomposed': true,
                'appleTouchBackgroundColor': "auto",
                'windowsTile': true,
                'coast': false,
                'tileBlackWhite': true,
                'tileColor': "auto"
            },
            deploy: {
                src: 'favicon-source.png',
                dest: 'dist/'
            }
        },

        clean: {
            deploy: ['dist']
        },

        connect: {
            livereload: {
                options: {
                    port: 9001,
                    middleware: function(connect, options) {
                        return[
                            require('connect-livereload')(),
                            connect.static(options.base),
                            connect.directory(options.base)
                        ];
                    }
                }
            }
        },

        watch: {
            icons: {
                files: 'fontello.json',
                tasks: ['fontello:build', 'sass:dev'],
                options: {
                    atBegin: true,
                    livereload: true,
                    spawn: false
                }
            },
            html: {
                files: '*.html',
                tasks: [],
                options: {
                    atBegin: true,
                    livereload: true,
                    spawn: false
                }
            },
            js: {
                files: ['scripts/main.js'],
                tasks: ['concat:dev'],
                options: {
                    atBegin: true,
                    livereload: true,
                    spawn: false
                }
            },
            scss: {
                files: 'scss/**/*.scss',
                tasks: ['sass:dev'],
                options: {
                    atBegin: true,
                    livereload: false,
                    spawn: true
                }
            },
            css: {
                files: 'styles/*.css',
                tasks: [],
                options: {
                    atBegin: false,
                    livereload: true,
                    spawn: false
                }
            }
        },

        modernizr: {
            'devFile' : 'scripts/modernizr/modernizr.js',
            'outputFile' : 'dist/scripts/modernizr/modernizr.js',
            'extra' : {
                'shiv' : false,
                'printshiv' : true,
                'load' : false,
                'mq' : true,
                'cssclasses' : true
            },
            'extensibility' : {
                'addtest' : false,
                'prefixed' : false,
                'teststyles' : false,
                'testprops' : false,
                'testallprops' : false,
                'hasevents' : false,
                'prefixes' : false,
                'domprefixes' : false
            },
            'uglify' : true,
            'tests' : [],
            // parseFiles = true: crawl all *.js, *.css, *.scss files;
            // override by defining "files" array
            'parseFiles' : true,
            'files' : ['scss/**/*.scss',
                       'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                       'scripts/magnific-popup/src/css/main.scss',
                       'scripts/jquery-cycle2/*.js',
                       'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                       'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                       'scripts/gmaps/gmaps.js',
                       'scripts/*.js'],
            'matchCommunityTests' : false,
            'customTests' : [],
            'excludeFiles' : ['Gruntfile.js', '*.json']
        },

        concat: {
            dev: {
                src: ['scripts/helpers/log.js',
                      'scripts/accessifyhtml5-amd/accessifyhtml5.js',
                      'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                      'scripts/jquery-cycle2/jquery.cycle2.core.js',
                      'scripts/jquery-cycle2/jquery.cycle2.autoheight.js',
                      'scripts/jquery-cycle2/jquery.cycle2.caption.js',
                      'scripts/jquery-cycle2/jquery.cycle2.command.js',
                      'scripts/jquery-cycle2/jquery.cycle2.hash.js',
                      'scripts/jquery-cycle2/jquery.cycle2.loader.js',
                      'scripts/jquery-cycle2/jquery.cycle2.pager.js',
                      'scripts/jquery-cycle2/jquery.cycle2.prevnext.js',
                      'scripts/jquery-cycle2/jquery.cycle2.progressive.js',
                      'scripts/jquery-cycle2/jquery.cycle2.tmpl.js',
                      'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                      'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                      'scripts/gmaps/gmaps.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            },
            deploy: {
                src: ['scripts/accessifyhtml5-amd/accessifyhtml5.js',
                      'scripts/magnific-popup/dist/jquery.magnific-popup.js',
                      'scripts/jquery-cycle2/jquery.cycle2.core.js',
                      'scripts/jquery-cycle2/jquery.cycle2.autoheight.js',
                      'scripts/jquery-cycle2/jquery.cycle2.caption.js',
                      'scripts/jquery-cycle2/jquery.cycle2.command.js',
                      'scripts/jquery-cycle2/jquery.cycle2.hash.js',
                      'scripts/jquery-cycle2/jquery.cycle2.loader.js',
                      'scripts/jquery-cycle2/jquery.cycle2.pager.js',
                      'scripts/jquery-cycle2/jquery.cycle2.prevnext.js',
                      'scripts/jquery-cycle2/jquery.cycle2.progressive.js',
                      'scripts/jquery-cycle2/jquery.cycle2.tmpl.js',
                      'scripts/jquery-accessible-tabs/js/jquery.syncheight.js',
                      'scripts/jquery-accessible-tabs/js/jquery.tabs.js',
                      'scripts/gmaps/gmaps.js',
                      'scripts/main.js'],
                dest: 'scripts/master.js'
            }
        },

        uglify: {
            deploy: {
                src: 'scripts/master.js',
                dest: 'dist/scripts/master.js'
            }
        },

        sass: {
            dev: {
                options: {
                    sourcemap: false,
                    style: 'nested',
                    precision: 5
                },
                files: [{
                    expand: true,
                    cwd: 'scss',
                    src: ['*.scss'],
                    dest: 'styles',
                    ext: '.css'
                }]
            },
            deploy: {
                options: {
                    sourcemap: false,
                    style: 'compressed',
                    precision: 5
                },
                files: [{
                    expand: true,
                    cwd: 'scss',
                    src: ['*.scss'],
                    dest: 'dist/styles',
                    ext: '.css'
                }]
            }
        },

        imagemin: {
            deploy: {
                options: {
                    optimizationLevel: 1,
                    progressive: false
                },
                files: [
                    {
                        expand: true,
                        cwd: '.',
                        src: ['img/**/*.png', 'img/**/*.jpg'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        copy: {
            deploy: {
                files: [
                    {
                        src: ['.htaccess',
                              'robots.txt',
                              'scripts/jquery/jquery.min.js',
                              'scripts/helpers/boxsizing.htc',
                              'font/*',
                              '*.html'],
                        dest: 'dist/'
                    }
                ]
            }
        },

        hashres: {
            options: {
                encoding: 'utf-8',
                fileNameFormat: '${hash}.${ext}',
                renameFiles: true
            },
            deploy: {
                src: ['dist/styles/master.css',
                      'dist/styles/oldie.css',
                      'dist/scripts/master.js'],
                dest: 'dist/*.html',

            }
        },

        // To use this for target-based includes, e.g. to include Piwik snippet:
        // <!--(if target deploy)><!(endif)-->
        // → github.com/changer/grunt-targethtml
        targethtml: {
            deploy: {
                files: [{
                    expand: true,
                    src: ['*.html'],
                    dest: 'dist/'
                }],
            }
        },

        fontello: {
            options: {
                config: 'fontello.json',
                zip: 'scripts/',
                fonts: 'font/',
                styles: 'scss/fontello/',
                sass: true,
                force: true
            },
            build: {
                config: 'fontello.json',
                fonts: 'font/',
                styles: 'scss/fontello/'
            }
        }
    });
    // Load required tasks
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-connect');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-favicons');
    grunt.loadNpmTasks('grunt-fontello');
    grunt.loadNpmTasks('grunt-hashres');
    grunt.loadNpmTasks('grunt-htmlhint');
    grunt.loadNpmTasks('grunt-modernizr');
    grunt.loadNpmTasks('grunt-targethtml');
    // Default
    grunt.registerTask('default', ['connect', 'watch']);
    // Testing
    grunt.registerTask('test', ['htmlhint', 'jshint']);
    // Deployment
    grunt.registerTask('deploy', ['clean:deploy', 'fontello:build', 'copy:deploy', 'concat:deploy', 'sass:deploy', 'uglify', 'imagemin:deploy', 'favicons:deploy', 'modernizr', 'targethtml:deploy', 'hashres:deploy']);
};
<|endoftext|>


<commit_before>var os = require('os');
var grunt = require('grunt');
var path = require('path');
var pkg = require('./package.json');

require('load-grunt-tasks')(grunt);

module.exports = function(grunt) {
    var files = ['./index.js', './Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'];
    var buildOutputFile = os.platform() !== 'win32' ? 'logdna' : 'logdna.exe';

    grunt.initConfig({
        lineremover: {
            nukebrowser: {
                files: {
                    'node_modules/ws/package.json': path.join('node_modules', 'ws', 'package.json')
                }
                , options: {
                    exclusionPattern: /browser/
                }
            }
        }, exec: {
            nexe: { cmd: 'nexe -i index.js -o ' + buildOutputFile + ' -f -t ~/tmp -r 5.9.0', maxBuffer: 20000 * 1024 }
            , save_version: 'echo ' + pkg.version + ' > version'
            , fpm_osxpkg: 'fpm -s dir -t osxpkg --osxpkg-identifier-prefix com.logdna -n logdna-cli -v ' + pkg.version + ' --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , sign_pkg: 'productsign --sign "Developer ID Installer: Answerbook, Inc. (TT7664HMU3)" logdna-cli-' + pkg.version + '.pkg logdna-cli.pkg'
            , verify_pkg: 'spctl -a -t install -vv logdna-cli.pkg'
            , rm_unsignedpkg: 'rm logdna-cli-' + pkg.version + '.pkg'
            , install_pkg: 'sudo installer -verbose -pkg logdna-cli.pkg -target /'
            , gzip_macbin: 'gzip -kf ./logdna'
            , upload_macbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/mac/logdna.gz'
            , upload_macver: 'aws s3 cp ./version s3://repo.logdna.com/mac/version'
            , upload_pkg: 'aws s3 cp ./logdna-cli.pkg s3://repo.logdna.com/mac/logdna-cli.pkg'
            , fpm_rpm: 'fpm -s dir -t rpm -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , fpm_deb: 'fpm -s dir -t deb -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f --deb-no-default-config-files ./logdna=/usr/local/logdna/bin/logdna'
            , cp_rpm: 'cp -f logdna-cli-' + pkg.version + '-1.x86_64.rpm logdna-cli.rpm'
            , cp_deb: 'cp -f logdna-cli_' + pkg.version + '_amd64.deb logdna-cli.deb'
            , gzip_linuxbin: 'gzip -f ./logdna'
            , upload_linuxbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/linux/logdna.gz'
            , upload_linuxver: 'aws s3 cp ./version s3://repo.logdna.com/linux/version'
            , upload_rpm: 'aws s3 cp ./logdna-cli.rpm s3://repo.logdna.com/linux/logdna-cli.rpm'
            , upload_deb: 'aws s3 cp ./logdna-cli.deb s3://repo.logdna.com/linux/logdna-cli.deb'
            , choco: 'pushd .\\.builds\\windows & cpack'
            , choco_deb: 'cd ./.builds/windows & ls -al & choco pack'
        }, copy: {
            nuspec: {
                files: [{
                    src: './logdna.nuspec'
                    , dest: './.builds/windows/'
                }]
            }, winexe: {
                files: [{
                    src: './logdna.exe'
                    , dest: './.builds/windows/tools/'
                }]
            }
        }, eslint: {
            target: files
            , options: {
                configFile: '.eslintrc'
                , fix: true
            }
        }
    });
    grunt.registerTask('test', ['eslint']);
    grunt.registerTask('build', ['lineremover', 'exec:nexe', 'exec:save_version']);
    grunt.registerTask('linux', ['build', 'exec:fpm_rpm', 'exec:fpm_deb', 'exec:cp_rpm', 'exec:cp_deb', 'exec:gzip_linuxbin', 'exec:upload_linuxbin', 'exec:upload_linuxver', 'exec:upload_rpm', 'exec:upload_deb']);
    grunt.registerTask('mac', ['build', 'exec:fpm_osxpkg', 'exec:sign_pkg', 'exec:rm_unsignedpkg', 'exec:gzip_macbin', 'exec:upload_macbin', 'exec:upload_macver', 'exec:upload_pkg']); // 'exec:verify_pkg', 'exec:install_pkg'
    grunt.registerTask('windows', ['build', 'copy:nuspec', 'copy:winexe', 'exec:choco_deb']);
};
<commit_msg>CircleCI Config for LogDNA CLI<commit_after>var os = require('os');
var grunt = require('grunt');
var path = require('path');
var pkg = require('./package.json');

require('load-grunt-tasks')(grunt);

module.exports = function(grunt) {
    var files = ['./index.js', './Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'];
    var buildOutputFile = os.platform() !== 'win32' ? 'logdna' : 'logdna.exe';

    grunt.initConfig({
        lineremover: {
            nukebrowser: {
                files: {
                    'node_modules/ws/package.json': path.join('node_modules', 'ws', 'package.json')
                }
                , options: {
                    exclusionPattern: /browser/
                }
            }
        }, exec: {
            nexe: { cmd: 'nexe -i index.js -o ' + buildOutputFile + ' -f -t ~/tmp -r 5.9.0', maxBuffer: 20000 * 1024 }
            , save_version: 'echo ' + pkg.version + ' > version'
            , fpm_osxpkg: 'fpm -s dir -t osxpkg --osxpkg-identifier-prefix com.logdna -n logdna-cli -v ' + pkg.version + ' --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , sign_pkg: 'productsign --sign "Developer ID Installer: Answerbook, Inc. (TT7664HMU3)" logdna-cli-' + pkg.version + '.pkg logdna-cli.pkg'
            , verify_pkg: 'spctl -a -t install -vv logdna-cli.pkg'
            , rm_unsignedpkg: 'rm logdna-cli-' + pkg.version + '.pkg'
            , install_pkg: 'sudo installer -verbose -pkg logdna-cli.pkg -target /'
            , gzip_macbin: 'gzip -kf ./logdna'
            , upload_macbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/mac/logdna.gz'
            , upload_macver: 'aws s3 cp ./version s3://repo.logdna.com/mac/version'
            , upload_pkg: 'aws s3 cp ./logdna-cli.pkg s3://repo.logdna.com/mac/logdna-cli.pkg'
            , fpm_rpm: 'fpm -s dir -t rpm -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f ./logdna=/usr/local/logdna/bin/logdna'
            , fpm_deb: 'fpm -s dir -t deb -n logdna-cli -v ' + pkg.version + ' --license MIT --vendor "Answerbook, Inc." --description "LogDNA CLI for Linux" --url http://logdna.com/ -m "<help@logdna.com>" --post-install ./scripts/post-install -f --deb-no-default-config-files ./logdna=/usr/local/logdna/bin/logdna'
            , cp_rpm: 'cp -f logdna-cli-' + pkg.version + '-1.x86_64.rpm logdna-cli.rpm'
            , cp_deb: 'cp -f logdna-cli_' + pkg.version + '_amd64.deb logdna-cli.deb'
            , gzip_linuxbin: 'gzip -f ./logdna'
            , upload_linuxbin: 'aws s3 cp ./logdna.gz s3://repo.logdna.com/linux/logdna.gz'
            , upload_linuxver: 'aws s3 cp ./version s3://repo.logdna.com/linux/version'
            , upload_rpm: 'aws s3 cp ./logdna-cli.rpm s3://repo.logdna.com/linux/logdna-cli.rpm'
            , upload_deb: 'aws s3 cp ./logdna-cli.deb s3://repo.logdna.com/linux/logdna-cli.deb'
            , choco: 'pushd .\\.builds\\windows & cpack'
            , choco_deb: 'cd .builds/windows & ls -al & choco pack'
        }, copy: {
            nuspec: {
                files: [{
                    src: './logdna.nuspec'
                    , dest: './.builds/windows/'
                }]
            }, winexe: {
                files: [{
                    src: './logdna.exe'
                    , dest: './.builds/windows/tools/'
                }]
            }
        }, eslint: {
            target: files
            , options: {
                configFile: '.eslintrc'
                , fix: true
            }
        }
    });
    grunt.registerTask('test', ['eslint']);
    grunt.registerTask('build', ['lineremover', 'exec:nexe', 'exec:save_version']);
    grunt.registerTask('linux', ['build', 'exec:fpm_rpm', 'exec:fpm_deb', 'exec:cp_rpm', 'exec:cp_deb', 'exec:gzip_linuxbin', 'exec:upload_linuxbin', 'exec:upload_linuxver', 'exec:upload_rpm', 'exec:upload_deb']);
    grunt.registerTask('mac', ['build', 'exec:fpm_osxpkg', 'exec:sign_pkg', 'exec:rm_unsignedpkg', 'exec:gzip_macbin', 'exec:upload_macbin', 'exec:upload_macver', 'exec:upload_pkg']); // 'exec:verify_pkg', 'exec:install_pkg'
    grunt.registerTask('windows', ['build', 'copy:nuspec', 'copy:winexe', 'exec:choco_deb']);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  'use strict';

  require('jit-grunt')(grunt, {
    buildcontrol: 'grunt-build-control',
    htmllint: 'grunt-html'
  });

  require('time-grunt')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    less: {
      core: {
        options: {
          outputSourceFiles: true,
          sourceMap: true,
          sourceMapFilename: 'html/assets/app/css/style.css.map',
          sourceMapURL: 'style.css.map',
          strictMath: true
        },
        files: {
          'html/assets/app/css/style.css': 'less/style.less'
        }
      }
    },
    postcss: {
      options: {
        map: true,
        processors: [
          require('autoprefixer')
        ]
      },
      core: {
        src: 'html/assets/app/css/*.css'
      }
    },
    csscomb: {
      options: {
        config: 'less/.csscomb.json'
      },
      core: {
        src: 'html/assets/app/css/style.css',
        dest: 'html/assets/app/css/style.css'
      }
    },
    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      core: {
        src: 'html/assets/app/css/style.css'
      }
    },
    cssmin: {
      options: {
        advanced: false,
        keepSpecialComments: '*',
        sourceMap: true
      },
      core: {
        expand: true,
        cwd: 'html/assets/app/css',
        src: ['*.css', '!*.min.css'],
        dest: 'html/assets/app/css',
        ext: '.min.css'
      }
    },
    eslint: {
      options: {
        configFile: 'js/.eslintrc'
      },
      target: 'js/*.js'
    },
    jscs: {
      options: {
        config: 'js/.jscsrc'
      },
      grunt: {
        src: 'Gruntfile.js'
      },
      core: {
        src: 'js/*.js'
      }
    },
    concat: {
      core: {
        src: [
          'js/main.js'
        ],
        dest: 'html/assets/app/js/application.js'
      }
    },
    uglify: {
      options: {
        compress: {
          warnings: false
        },
        preserveComments: 'some'
      },
      core: {
        src: '<%= concat.core.dest %>',
        dest: 'html/assets/app/js/application.min.js'
      }
    },
    copy: {
      assets: {
        expand: true,
        src: 'assets/**',
        dest: 'html'
      },
      packages: {
        files: [
          {
            expand: true,
            cwd: 'node_modules/jquery/dist',
            src: '*',
            dest: 'html/assets/vendor/jquery'
          },
          {
            expand: true,
            cwd: 'node_modules/jquery.scrollto',
            src: '*.js',
            dest: 'html/assets/vendor/jquery.scrollto'
          },
          {
            expand: true,
            cwd: 'node_modules/slick-carousel/slick',
            src: '*',
            dest: 'html/assets/vendor/slick'
          },
          {
            expand: true,
            cwd: 'node_modules/dotdotdot/src/js',
            src: '*',
            dest: 'html/assets/vendor/jquery.dotdotdot'
          }
        ]
      }
    },
    env: {
      build: {
        JEKYLL_ENV: grunt.option('environment') || 'development'
      }
    },
    jekyll: {
      options: {
        config: '_config.yml'
      },
      build: {},
      serve: {
        options: {
          incremental: true,
          serve: true
        }
      },
      watch: {
        options: {
          incremental: true,
          watch: true
        }
      }
    },
    htmllint: {
      src: 'dist/**/*.html'
    },
    _htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          minifyCSS: true,
          minifyJS: true,
          removeAttributeQuotes: true,
          removeComments: true
        },
        expand: true,
        cwd: 'dist',
        src: '**/*.html',
        dest: 'dist'
      }
    },
    _watch: {
      configFiles: {
        options: {
          reload: true
        },
        files: ['Gruntfile.js', 'package.json']
      },
      html: {
        files: 'dist/**/*.html',
        tasks: ['htmllint', 'htmlmin']
      },
      js: {
        files: 'js/*.js',
        tasks: 'js'
      },
      less: {
        files: 'less/**/*.less',
        tasks: 'css'
      }
    },
    concurrent: {
      options: {
        logConcurrentOutput: true
      },
      watch: ['_watch', 'jekyll:watch'],
      serve: ['_watch', 'jekyll:serve']
    },
    buildcontrol: {
      options: {
        commit: true,
        push: true
      },
      carconcierge: {
        options: {
          remote: 'ssh://carconci@sha17.tlh.ro:22222/home/carconci/public_html',
          branch: 'master'
        }
      },
      pages: {
        options: {
          remote: 'git@github.com:eos-code-lab/carconcierge.git',
          branch: 'gh-pages'
        }
      }
    },
    clean: {
      options: {
        force: true
      },
      assets: 'html/assets',
      dist: 'dist'
    }
  });

  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.renameTask('htmlmin', '_htmlmin');

  grunt.registerTask('htmlmin', function () {
    // grunt.task.requires('env');

    if (process.env.JEKYLL_ENV === 'production') {
      grunt.task.run('_htmlmin');
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.renameTask('watch', '_watch');

  grunt.registerTask('watch', ['env', 'concurrent:watch']);
  grunt.registerTask('serve', ['env', 'concurrent:serve']);

  grunt.registerTask('assets', 'copy');
  grunt.registerTask('css', ['less', 'postcss', 'csscomb', 'csslint', 'cssmin']);
  grunt.registerTask('js', ['eslint', 'jscs', 'concat', 'uglify']);
  grunt.registerTask('html', ['jekyll:build', 'htmllint', 'htmlmin']);

  grunt.registerTask('build', ['env', 'assets', 'css', 'js', 'html']);
  grunt.registerTask('test', ['clean', 'build']);
  grunt.registerTask('deploy', 'buildcontrol');

  grunt.registerTask('default', 'build');
};
<commit_msg>Updated build control config<commit_after>module.exports = function (grunt) {
  'use strict';

  require('jit-grunt')(grunt, {
    buildcontrol: 'grunt-build-control',
    htmllint: 'grunt-html'
  });

  require('time-grunt')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    less: {
      core: {
        options: {
          outputSourceFiles: true,
          sourceMap: true,
          sourceMapFilename: 'html/assets/app/css/style.css.map',
          sourceMapURL: 'style.css.map',
          strictMath: true
        },
        files: {
          'html/assets/app/css/style.css': 'less/style.less'
        }
      }
    },
    postcss: {
      options: {
        map: true,
        processors: [
          require('autoprefixer')
        ]
      },
      core: {
        src: 'html/assets/app/css/*.css'
      }
    },
    csscomb: {
      options: {
        config: 'less/.csscomb.json'
      },
      core: {
        src: 'html/assets/app/css/style.css',
        dest: 'html/assets/app/css/style.css'
      }
    },
    csslint: {
      options: {
        csslintrc: 'less/.csslintrc'
      },
      core: {
        src: 'html/assets/app/css/style.css'
      }
    },
    cssmin: {
      options: {
        advanced: false,
        keepSpecialComments: '*',
        sourceMap: true
      },
      core: {
        expand: true,
        cwd: 'html/assets/app/css',
        src: ['*.css', '!*.min.css'],
        dest: 'html/assets/app/css',
        ext: '.min.css'
      }
    },
    eslint: {
      options: {
        configFile: 'js/.eslintrc'
      },
      target: 'js/*.js'
    },
    jscs: {
      options: {
        config: 'js/.jscsrc'
      },
      grunt: {
        src: 'Gruntfile.js'
      },
      core: {
        src: 'js/*.js'
      }
    },
    concat: {
      core: {
        src: [
          'js/main.js'
        ],
        dest: 'html/assets/app/js/application.js'
      }
    },
    uglify: {
      options: {
        compress: {
          warnings: false
        },
        preserveComments: 'some'
      },
      core: {
        src: '<%= concat.core.dest %>',
        dest: 'html/assets/app/js/application.min.js'
      }
    },
    copy: {
      assets: {
        expand: true,
        src: 'assets/**',
        dest: 'html'
      },
      packages: {
        files: [
          {
            expand: true,
            cwd: 'node_modules/jquery/dist',
            src: '*',
            dest: 'html/assets/vendor/jquery'
          },
          {
            expand: true,
            cwd: 'node_modules/jquery.scrollto',
            src: '*.js',
            dest: 'html/assets/vendor/jquery.scrollto'
          },
          {
            expand: true,
            cwd: 'node_modules/slick-carousel/slick',
            src: '*',
            dest: 'html/assets/vendor/slick'
          },
          {
            expand: true,
            cwd: 'node_modules/dotdotdot/src/js',
            src: '*',
            dest: 'html/assets/vendor/jquery.dotdotdot'
          }
        ]
      }
    },
    env: {
      build: {
        JEKYLL_ENV: grunt.option('environment') || 'development'
      }
    },
    jekyll: {
      options: {
        config: '_config.yml'
      },
      build: {},
      serve: {
        options: {
          incremental: true,
          serve: true
        }
      },
      watch: {
        options: {
          incremental: true,
          watch: true
        }
      }
    },
    htmllint: {
      src: 'dist/**/*.html'
    },
    _htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          minifyCSS: true,
          minifyJS: true,
          removeAttributeQuotes: true,
          removeComments: true
        },
        expand: true,
        cwd: 'dist',
        src: '**/*.html',
        dest: 'dist'
      }
    },
    _watch: {
      configFiles: {
        options: {
          reload: true
        },
        files: ['Gruntfile.js', 'package.json']
      },
      html: {
        files: 'dist/**/*.html',
        tasks: ['htmllint', 'htmlmin']
      },
      js: {
        files: 'js/*.js',
        tasks: 'js'
      },
      less: {
        files: 'less/**/*.less',
        tasks: 'css'
      }
    },
    concurrent: {
      options: {
        logConcurrentOutput: true
      },
      watch: ['_watch', 'jekyll:watch'],
      serve: ['_watch', 'jekyll:serve']
    },
    buildcontrol: {
      options: {
        commit: true,
        push: true
      },
      carconcierge: {
        options: {
          remote: 'ssh://carconci@sha17.tlh.ro:22222/home/carconci/public_html',
          branch: 'master'
        }
      }
    },
    clean: {
      options: {
        force: true
      },
      assets: 'html/assets',
      dist: 'dist'
    }
  });

  grunt.loadNpmTasks('grunt-contrib-htmlmin');
  grunt.renameTask('htmlmin', '_htmlmin');

  grunt.registerTask('htmlmin', function () {
    // grunt.task.requires('env');

    if (process.env.JEKYLL_ENV === 'production') {
      grunt.task.run('_htmlmin');
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.renameTask('watch', '_watch');

  grunt.registerTask('watch', ['env', 'concurrent:watch']);
  grunt.registerTask('serve', ['env', 'concurrent:serve']);

  grunt.registerTask('assets', 'copy');
  grunt.registerTask('css', ['less', 'postcss', 'csscomb', 'csslint', 'cssmin']);
  grunt.registerTask('js', ['eslint', 'jscs', 'concat', 'uglify']);
  grunt.registerTask('html', ['jekyll:build', 'htmllint', 'htmlmin']);

  grunt.registerTask('build', ['env', 'assets', 'css', 'js', 'html']);
  grunt.registerTask('test', ['clean', 'build']);
  grunt.registerTask('deploy', 'buildcontrol');

  grunt.registerTask('default', 'build');
};
<|endoftext|>


<commit_before>// folder-create-menu.js

jQuery(function($) {
    $('#create-menu').one('click', function() {
        $.ajax({
            type: 'GET',
            url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
            xhrFields: calli.withCredentials,
            dataType: 'json',
            success: function(data) {
                var ul = $('#create-menu-more');
                var section;
                $(data.rows).each(function(){
                    if (section != this[4]) {
                        if (section) {
                            ul.append('

');
                        }
                        section = this[4];
                        var header = $('

');
                        header.text(section);
                        ul.append(header);
                    }
                    var li = $('

');
                    var a = $('');
                    a.attr('href', this[0]);
                    a.text(this[1]);
                    if (this[2]) {
                        a.attr('title', this[2]);
                    }
                    if (this[3]) {
                        var img = $('');
                        img.attr('src', this[3]);
                        a.prepend(' ');
                        a.prepend(img);
                    }
                    li.append(a);
                    ul.append(li);
                });
            }
        });
        return true;
    });
});
<commit_msg>Add wait cursor when loading folder create menu<commit_after>// folder-create-menu.js

jQuery(function($) {
    $('#create-menu').one('click', function() {
        var wait = calli.wait();
        $.ajax({
            type: 'GET',
            url: $('#create-menu-json')[0].href + encodeURIComponent(calli.getUserIri()),
            xhrFields: calli.withCredentials,
            dataType: 'json',
            success: function(data) {
                var ul = $('#create-menu-more');
                var section;
                $(data.rows).each(function(){
                    if (section != this[4]) {
                        if (section) {
                            ul.append('

');
                        }
                        section = this[4];
                        var header = $('

');
                        header.text(section);
                        ul.append(header);
                    }
                    var li = $('

');
                    var a = $('');
                    a.attr('href', this[0]);
                    a.text(this[1]);
                    if (this[2]) {
                        a.attr('title', this[2]);
                    }
                    if (this[3]) {
                        var img = $('');
                        img.attr('src', this[3]);
                        a.prepend(' ');
                        a.prepend(img);
                    }
                    li.append(a);
                    ul.append(li);
                });
                wait.over();
            }
        });
        return true;
    });
});
<|endoftext|>


<commit_before>var fs = require('fs');
var jison = require('jison');

module.exports = function (grunt) {
  grunt.initConfig({
    pkg:   grunt.file.readJSON('package.json'),

    meta: {
      version: '0.0.1',
      banner: '/*! Terraformer JS - <%= meta.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
        '*   https://github.com/esri/terraformer-wkt-parser\n' +
        '*   Copyright (c) <%= grunt.template.today("yyyy") %> Esri, Inc.\n' +
        '*   Licensed MIT */'
    },

    uglify: {
      options: {
        report: 'gzip'
      },
      wkt: {
        src: ["terraformer-wkt-parser.js"],
        dest: 'terraformer-wkt-parser.min.js'
      }
    },

    vows: {
      all: {
        options: {
          reporter: "spec",
          verbose: true,
          silent: false,
          colors: true
        },
        src: [ "test/*.js" ]
      }
    },
/*
    jasmine: {
      coverage: {
        src: [
          "terraformer-wkt-parser.js"
        ],
        options: {
          specs: 'spec/*Spec.js',
          helpers: 'spec/*Helpers.js',
          //keepRunner: true,
          outfile: 'SpecRunner.html',
          template: require('grunt-template-jasmine-istanbul'),
          templateOptions: {
            coverage: './coverage/coverage.json',
            report: './coverage',
            thresholds: {
              lines: 75,
              statements: 75,
              branches: 75,
              functions: 75
            }
          }
        }
      }
    },
*/
    jasmine_node: {
      options: {
        forceExit: true,
        match: '.',
        matchall: false,
        extensions: 'js',
        specNameMatcher: 'Spec',
        helperNameMatcher: 'Helpers'
      },
      all: ['spec/']
    }
  });

  grunt.registerTask('wkt-parser', 'Building WKT Parser', function() {
    var grammar = fs.readFileSync('./src/wkt.yy', 'utf8');

    var wrapper = fs.readFileSync('./src/module-source.js', 'utf8');

    var Parser = jison.Parser;
    var parser = new Parser(grammar);

    // generate source, ready to be written to disk
    var parserSource = parser.generate({ moduleType: "js" });

    wrapper = wrapper.replace('"SOURCE";', parserSource);

    fs.writeFileSync("./terraformer-wkt-parser.js", wrapper, "utf8");

    grunt.log.write('Files created.\n');
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks("grunt-vows");
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-jasmine-node');

  grunt.registerTask('test', [ 'wkt-parser', 'vows', 'jasmine', 'jasmine_node' ]);
  grunt.registerTask('default', [ 'wkt-parser', 'vows', 'jasmine', 'jasmine_node', 'uglify' ]);
};<commit_msg>uncomment jasmine<commit_after>var fs = require('fs');
var jison = require('jison');

module.exports = function (grunt) {
  grunt.initConfig({
    pkg:   grunt.file.readJSON('package.json'),

    meta: {
      version: '0.0.1',
      banner: '/*! Terraformer JS - <%= meta.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
        '*   https://github.com/esri/terraformer-wkt-parser\n' +
        '*   Copyright (c) <%= grunt.template.today("yyyy") %> Esri, Inc.\n' +
        '*   Licensed MIT */'
    },

    uglify: {
      options: {
        report: 'gzip'
      },
      wkt: {
        src: ["terraformer-wkt-parser.js"],
        dest: 'terraformer-wkt-parser.min.js'
      }
    },

    vows: {
      all: {
        options: {
          reporter: "spec",
          verbose: true,
          silent: false,
          colors: true
        },
        src: [ "test/*.js" ]
      }
    },

    jasmine: {
      coverage: {
        src: [
          "terraformer-wkt-parser.js"
        ],
        options: {
          specs: 'spec/*Spec.js',
          helpers: 'spec/*Helpers.js',
          //keepRunner: true,
          outfile: 'SpecRunner.html',
          template: require('grunt-template-jasmine-istanbul'),
          templateOptions: {
            coverage: './coverage/coverage.json',
            report: './coverage',
            thresholds: {
              lines: 75,
              statements: 75,
              branches: 75,
              functions: 75
            }
          }
        }
      }
    },

    jasmine_node: {
      options: {
        forceExit: true,
        match: '.',
        matchall: false,
        extensions: 'js',
        specNameMatcher: 'Spec',
        helperNameMatcher: 'Helpers'
      },
      all: ['spec/']
    }
  });

  grunt.registerTask('wkt-parser', 'Building WKT Parser', function() {
    var grammar = fs.readFileSync('./src/wkt.yy', 'utf8');

    var wrapper = fs.readFileSync('./src/module-source.js', 'utf8');

    var Parser = jison.Parser;
    var parser = new Parser(grammar);

    // generate source, ready to be written to disk
    var parserSource = parser.generate({ moduleType: "js" });

    wrapper = wrapper.replace('"SOURCE";', parserSource);

    fs.writeFileSync("./terraformer-wkt-parser.js", wrapper, "utf8");

    grunt.log.write('Files created.\n');
  });

  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks("grunt-vows");
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-jasmine-node');

  grunt.registerTask('test', [ 'wkt-parser', 'vows', 'jasmine', 'jasmine_node' ]);
  grunt.registerTask('default', [ 'wkt-parser', 'vows', 'jasmine', 'jasmine_node', 'uglify' ]);
};<|endoftext|>


<commit_before>module.exports = function (grunt) {
    grunt.initConfig({
        'saucelabs-mocha': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    urls: ['http://zordius.github.io/with-promise/'],
                    testname: 'Mocha Unit Test for with-promise',
                    sauceConfig: {
                        tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
                        public: 'public'
                    },
                    tunneled: false,
                    detailedError: true,
                    concurrency: 2,
                    throttled: 3,
                    maxPollRetries: 3,
                    maxRetries: 2,
                    'max-duration': 300,
                    browsers: [
                        {browserName: 'chrome'},
                        {browserName: 'firefox'},
                        {browserName: 'safari', version: 10, platform: 'OS X 10.12'},
                        {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
                        {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
                        {browserName: 'MicrosoftEdge', version: 14, platform: 'Windows 10'},
                        {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
                        {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
                        {browserName: 'internet explorer', version: 9, platform: 'Windows 7'}
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-saucelabs');
    grunt.registerTask('default', ['saucelabs-mocha']);
};
<commit_msg>try to fix firefox<commit_after>module.exports = function (grunt) {
    grunt.initConfig({
        'saucelabs-mocha': {
            all: {
                options: {
                    build: process.env.TRAVIS_JOB_ID,
                    urls: ['http://zordius.github.io/with-promise/'],
                    testname: 'Mocha Unit Test for with-promise',
                    sauceConfig: {
                        tags: [process.env.TRAVIS_JOB_ID, process.env.TRAVIS_COMMIT, 'withPromise', 'mocha'],
                        public: 'public'
                    },
                    tunneled: false,
                    detailedError: true,
                    concurrency: 2,
                    throttled: 3,
                    maxPollRetries: 3,
                    maxRetries: 2,
                    'max-duration': 300,
                    browsers: [
                        {browserName: 'chrome'},
                        {browserName: 'firefox', platform: 'Linux'},
                        {browserName: 'safari', version: 10, platform: 'OS X 10.12'},
                        {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
                        {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
                        {browserName: 'MicrosoftEdge', version: 14, platform: 'Windows 10'},
                        {browserName: 'internet explorer', version: 11, platform: 'Windows 8.1'},
                        {browserName: 'internet explorer', version: 10, platform: 'Windows 8'},
                        {browserName: 'internet explorer', version: 9, platform: 'Windows 7'}
                    ]
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-saucelabs');
    grunt.registerTask('default', ['saucelabs-mocha']);
};
<|endoftext|>


<commit_before>/*
 * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
 */

define([], function () {
   var SMConstants = {
        TIMEOUT : 600 * 1000,
        IMAGE_PREFIX_ID : "image",
        PACKAGE_PREFIX_ID : "package",
        CLUSTER_PREFIX_ID : "cluster",
        SERVER_PREFIX_ID : "server",
        BAREMETAL_PREFIX_ID : "baremetal",
        SM_PREFIX_ID : "sm",
        BM_PREFIX_ID : "bm",
        DHCP_HOST_PREFIX_ID : "dhcp_host",
        DHCP_SUBNET_PREFIX_ID : "dhcp_subnet",

        CATEGORY_IMAGE : "image",
        CATEGORY_PACKAGE : "package",

        SM_API_SERVER : "sm-api-server",
        DFLT_SERVER_IP : "127.0.0.1",

        ROLES_ARRAY : ["config", "openstack", "control", "compute", "collector", "webui", "database", "storage-compute", "storage-master", "toragent", "tsn"],
        ROLES_OBJECTS : [
            {"id": "config", "text": "Config"},
            {"id": "openstack", "text": "Openstack"},
            {"id": "control", "text": "Control"},
            {"id": "compute", "text": "Compute"},
            {"id": "collector", "text": "Collector"},
            {"id": "webui", "text": "Webui"},
            {"id": "database", "text": "Database"},
            {"id": "storage-compute", "text": "Storage Compute"},
            {"id": "storage-master", "text": "Storage Master"},
            {"id": "toragent", "text": "TOR Agent"},
            {"id": "tsn", "text": "TSN"}
        ],

        INTERFACE_TYPE_PHYSICAL : "physical",
        INTERFACE_TYPE_BOND : "bond",
        INTERFACE_TYPE_SUB : "subinterface",

        STATES : [
            {"id": "enable", "text": "Enable"},
            {"id": "disable", "text": "Disable"}
        ],

        STATES_YES_NO : [
            {"id": "yes", "text": "Yes"},
            {"id": "no", "text": "No"}
        ],

        IPMI_INTERFACE_TYPES : [
            {
                id: "lan",
                text: "Lan"
            },
            {
                id: "lanplus",
                text: "Lanplus"
            }
        ],

        INTERFACE_TYPES : [
            {
                text: "physical",
                value: "physical"
            },
            {
                text: "bond",
                value: "bond"
            }
        ],

        FLAGS : [
            {"id": "False", "text": "False"},
            {"id": "True", "text": "True"}
        ],

        FLAGS_TRUE_FALSE_BOOLEAN_TYPE : [
            {"id": false, "text": "False"},
            {"id": true, "text": "True"}
        ],

        FLAGS_RADIO : [
            {"label": "False", "value": "False"},
            {"label": "True", "value": "True"}
        ],

        STATES_YES_NO_RADIO : [
            {"label": "Yes", "value": "yes"},
            {"label": "No", "value": "no"}
        ],
        STATES_ENABLE_DISABLE_RADIO : [
            {"label": "Enable", "value": "enable"},
            {"label": "Disable", "value": "disable"}
        ],

        STORAGE_SCOPE : [
            {"id": "global", "text": "Global"},
            {"id": "local", "text": "Local"}
        ],

        OVS_PROTOCOLS : [
            {"id": "tcp", "text": "TCP"},
            {"id": "pssl", "text": "pssl"}
        ],

        KEYSTONE_VERSIONS : [
            {"id": "v2.0", "text": "v2.0"},
            {"id": "v3", "text": "v3"}
        ],

        get : function () {
            var args = arguments;
            return cowu.getValueFromTemplate(args)
        },

        SERVERS_STATE_PROCESSOR : "computeServerStates",

        URL_TAG_NAMES : "/sm/tags/names",
        URL_OBJ_DETAILS : "/sm/objects/details/",
        URL_SERVER_IPMI_INFO : "/sm/server/ipmiinfo/",
        URL_OBJECTS : "/sm/objects/",
        URL_TAG_VALUES : "/sm/tags/values/",
        URL_SERVER_PROVISION : "/sm/server/provision",
        URL_SERVER_PROVISION : "/sm/server/provision",
        URL_OBJ_CLUSTER_ID : "/sm/objects/cluster?id=",
        URL_OBJ_SERVER_ID : "/sm/objects/server?id=",
        URL_OBJ_SERVER_MAC_ADDRESS : "/sm/objects/server?mac_address=",
        URL_SERVER_REIMAGE : "/sm/server/reimage",
        URL_OBJ_IMAGE_ID : "/sm/objects/image?id=",
        URL_OBJ_DHCP_HOST_ID : "/sm/objects/dhcp_host?host_fqdn=",
        URL_OBJ_DHCP_SUBNET_ID : "/sm/objects/dhcp_subnet?subnet_address=",
        URL_BAREMETAL_SERVER : "/api/tenants/config/baremetal-details",
        URL_BAREMETAL_ADD : "/api/tenants/config/baremetal",
        URL_NETWORKS : "/api/admin/config/get-data?type=virtual-network",
        URL_PHYSICAL_INTERFACES : "/api/tenants/config/physical-interfaces/",
        URL_PHYSICAL_INTERFACE : "/api/tenants/config/physical-interface/",
        URL_DELETE_PORT : "/api/tenants/config/delete-port/",
        URL_CREATE_PORT : "/api/tenants/config/create-port",
        URL_PORTS : "/api/tenants/config/ports",
        URL_VM : "/api/tenants/config/li-virtual-machine",
        URL_PHYSICAL_ROUTERS_LIST : "/api/tenants/config/physical-routers-list",
        URL_MAP_VIRTUAL_MACHINE_REFS : "/api/tenants/config/map-virtual-machine-refs/",
        SM_SERVER_MONITORING_INFO_URL : "/sm/server/monitoring/info?{0}",
        SM_SERVER_MONITORING_INFO_SUMMARY_URL : "/sm/server/monitoring/info/summary?{0}",
        SM_SERVER_MONITORING_CONFIG_URL : "/sm/server/monitoring/config",
        SM_SERVER_INVENTORY_INFO_URL : "/sm/server/inventory/info?{0}",
        URL_RUN_INVENTORY : "/sm/run_inventory",
        URL_CHASSIS_ID : "/sm/chassis/ids",

        CACHED_TAG_COLORS : {},
        MONITORING_CONFIG : {},

        URL_HASH_SM_CLUSTERS : "setting_sm_clusters",
        URL_HASH_SM_SERVERS : "setting_sm_servers",
        URL_HASH_BM_SERVERS : "config_pd_baremetal",

        KEY_CONFIGURE_VALIDATION : "configureValidation",
        KEY_EDIT_TAGS_VALIDATION : "editTagsValidation",
        KEY_ADD_VALIDATION : "addValidation",
        KEY_REIMAGE_VALIDATION : "reimageValidation",
        KEY_PROVISION_VALIDATION : "provisionValidation",

        TMPL_BAREMETAL_PAGE_DETAIL : "baremetal-detail-page-template",
        TMPL_DELETE_IMAGE : "sm-delete-image-template",
        TMPL_DELETE_PACKAGE : "sm-delete-package-template",
        TMPL_DELETE_DHCP_HOST : "sm-delete-dhcp-host-template",
        TMPL_DELETE_DHCP_SUBNET : "sm-delete-dhcp-subnet-template",
        TMPL_TAGS : "sm-tags-template",

        IMAGE_TYPES : ["ubuntu", "centos", "redhat", "esxi5.1", "esxi5.5", "fedora"],
        PACKAGE_TYPES : ["contrail-ubuntu-package", "contrail-centos-package", "contrail-storage-ubuntu-package"],

        TMPL_BM_EDIT_FORM : "bm-edit-form-template",

        URL_TAGGED_SERVERS : "/#p=setting_sm_servers&q[tag][{{params.tag}}]={{key}}",

        UCID_PREFIX_SM : "server-manager",
        UCID_PREFIX_LISTS : "lists",
        UCID_PREFIX_UVES : "uves",

        UCID_PREFIX_SM_LISTS : this.UCID_PREFIX_SM + ":" + this.UCID_PREFIX_LISTS + ":",
        UCID_PREFIX_SM_UVES : this.UCID_PREFIX_SM + ":" + this.UCID_PREFIX_UVES + ":",

        UCID_ALL_CLUSTER_LIST : this.UCID_PREFIX_SM_LISTS + "all-clusters",
        UCID_CLUSTER_SERVER_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:servers",

        UCID_ALL_SERVER_LIST : this.UCID_PREFIX_SM_LISTS + "all-servers",
        UCID_ALL_SERVER_MONITORING_LIST : this.UCID_PREFIX_SM_LISTS + "all-server-monitoring",
        UCID_ALL_SERVER_MONITORING_SUMMARY_LIST : this.UCID_PREFIX_SM_LISTS + "all-server-monitoring-summary",
        UCID_CLUSTER_SERVER_MONITORING_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:all-server-monitoring",
        UCID_CLUSTER_SERVER_MONITORING_SUMMARY_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:all-server-monitoring-summary",

        UCID_SERVER_INVENTORY_UVE : this.UCID_PREFIX_SM_UVES + "{0}:inventory",
        UCID_SERVER_MONITORING_UVE : this.UCID_PREFIX_SM_UVES + "{0}:monitoring",

        UCID_ALL_IMAGE_LIST : this.UCID_PREFIX_SM_LISTS + "all-images",
        UCID_ALL_PACKAGE_LIST : this.UCID_PREFIX_SM_LISTS + "all-packages",

        UMID_SERVER_INVENTORY_UVE : "uve:{0}:inventory",
        UMID_SERVER_MONITORING_UVE : "uve:{0}:monitoring",

        TYPE_OVS : "ovs"

    };

    return SMConstants;

});
<commit_msg>Closes-Bug: #1659644 Added the ability to add the global_controller role through SM UI<commit_after>/*
 * Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
 */

define([], function () {
   var SMConstants = {
        TIMEOUT : 600 * 1000,
        IMAGE_PREFIX_ID : "image",
        PACKAGE_PREFIX_ID : "package",
        CLUSTER_PREFIX_ID : "cluster",
        SERVER_PREFIX_ID : "server",
        BAREMETAL_PREFIX_ID : "baremetal",
        SM_PREFIX_ID : "sm",
        BM_PREFIX_ID : "bm",
        DHCP_HOST_PREFIX_ID : "dhcp_host",
        DHCP_SUBNET_PREFIX_ID : "dhcp_subnet",

        CATEGORY_IMAGE : "image",
        CATEGORY_PACKAGE : "package",

        SM_API_SERVER : "sm-api-server",
        DFLT_SERVER_IP : "127.0.0.1",

        ROLES_ARRAY : ["config", "openstack", "control", "compute", "collector", "webui", "database", "storage-compute", "storage-master", "toragent", "tsn", "global_controller"],
        ROLES_OBJECTS : [
            {"id": "config", "text": "Config"},
            {"id": "openstack", "text": "Openstack"},
            {"id": "control", "text": "Control"},
            {"id": "compute", "text": "Compute"},
            {"id": "collector", "text": "Collector"},
            {"id": "webui", "text": "Webui"},
            {"id": "database", "text": "Database"},
            {"id": "storage-compute", "text": "Storage Compute"},
            {"id": "storage-master", "text": "Storage Master"},
            {"id": "toragent", "text": "TOR Agent"},
            {"id": "tsn", "text": "TSN"},
            {"id": "global_controller", "text": "Global Controller"}
        ],

        INTERFACE_TYPE_PHYSICAL : "physical",
        INTERFACE_TYPE_BOND : "bond",
        INTERFACE_TYPE_SUB : "subinterface",

        STATES : [
            {"id": "enable", "text": "Enable"},
            {"id": "disable", "text": "Disable"}
        ],

        STATES_YES_NO : [
            {"id": "yes", "text": "Yes"},
            {"id": "no", "text": "No"}
        ],

        IPMI_INTERFACE_TYPES : [
            {
                id: "lan",
                text: "Lan"
            },
            {
                id: "lanplus",
                text: "Lanplus"
            }
        ],

        INTERFACE_TYPES : [
            {
                text: "physical",
                value: "physical"
            },
            {
                text: "bond",
                value: "bond"
            }
        ],

        FLAGS : [
            {"id": "False", "text": "False"},
            {"id": "True", "text": "True"}
        ],

        FLAGS_TRUE_FALSE_BOOLEAN_TYPE : [
            {"id": false, "text": "False"},
            {"id": true, "text": "True"}
        ],

        FLAGS_RADIO : [
            {"label": "False", "value": "False"},
            {"label": "True", "value": "True"}
        ],

        STATES_YES_NO_RADIO : [
            {"label": "Yes", "value": "yes"},
            {"label": "No", "value": "no"}
        ],
        STATES_ENABLE_DISABLE_RADIO : [
            {"label": "Enable", "value": "enable"},
            {"label": "Disable", "value": "disable"}
        ],

        STORAGE_SCOPE : [
            {"id": "global", "text": "Global"},
            {"id": "local", "text": "Local"}
        ],

        OVS_PROTOCOLS : [
            {"id": "tcp", "text": "TCP"},
            {"id": "pssl", "text": "pssl"}
        ],

        KEYSTONE_VERSIONS : [
            {"id": "v2.0", "text": "v2.0"},
            {"id": "v3", "text": "v3"}
        ],

        get : function () {
            var args = arguments;
            return cowu.getValueFromTemplate(args)
        },

        SERVERS_STATE_PROCESSOR : "computeServerStates",

        URL_TAG_NAMES : "/sm/tags/names",
        URL_OBJ_DETAILS : "/sm/objects/details/",
        URL_SERVER_IPMI_INFO : "/sm/server/ipmiinfo/",
        URL_OBJECTS : "/sm/objects/",
        URL_TAG_VALUES : "/sm/tags/values/",
        URL_SERVER_PROVISION : "/sm/server/provision",
        URL_SERVER_PROVISION : "/sm/server/provision",
        URL_OBJ_CLUSTER_ID : "/sm/objects/cluster?id=",
        URL_OBJ_SERVER_ID : "/sm/objects/server?id=",
        URL_OBJ_SERVER_MAC_ADDRESS : "/sm/objects/server?mac_address=",
        URL_SERVER_REIMAGE : "/sm/server/reimage",
        URL_OBJ_IMAGE_ID : "/sm/objects/image?id=",
        URL_OBJ_DHCP_HOST_ID : "/sm/objects/dhcp_host?host_fqdn=",
        URL_OBJ_DHCP_SUBNET_ID : "/sm/objects/dhcp_subnet?subnet_address=",
        URL_BAREMETAL_SERVER : "/api/tenants/config/baremetal-details",
        URL_BAREMETAL_ADD : "/api/tenants/config/baremetal",
        URL_NETWORKS : "/api/admin/config/get-data?type=virtual-network",
        URL_PHYSICAL_INTERFACES : "/api/tenants/config/physical-interfaces/",
        URL_PHYSICAL_INTERFACE : "/api/tenants/config/physical-interface/",
        URL_DELETE_PORT : "/api/tenants/config/delete-port/",
        URL_CREATE_PORT : "/api/tenants/config/create-port",
        URL_PORTS : "/api/tenants/config/ports",
        URL_VM : "/api/tenants/config/li-virtual-machine",
        URL_PHYSICAL_ROUTERS_LIST : "/api/tenants/config/physical-routers-list",
        URL_MAP_VIRTUAL_MACHINE_REFS : "/api/tenants/config/map-virtual-machine-refs/",
        SM_SERVER_MONITORING_INFO_URL : "/sm/server/monitoring/info?{0}",
        SM_SERVER_MONITORING_INFO_SUMMARY_URL : "/sm/server/monitoring/info/summary?{0}",
        SM_SERVER_MONITORING_CONFIG_URL : "/sm/server/monitoring/config",
        SM_SERVER_INVENTORY_INFO_URL : "/sm/server/inventory/info?{0}",
        URL_RUN_INVENTORY : "/sm/run_inventory",
        URL_CHASSIS_ID : "/sm/chassis/ids",

        CACHED_TAG_COLORS : {},
        MONITORING_CONFIG : {},

        URL_HASH_SM_CLUSTERS : "setting_sm_clusters",
        URL_HASH_SM_SERVERS : "setting_sm_servers",
        URL_HASH_BM_SERVERS : "config_pd_baremetal",

        KEY_CONFIGURE_VALIDATION : "configureValidation",
        KEY_EDIT_TAGS_VALIDATION : "editTagsValidation",
        KEY_ADD_VALIDATION : "addValidation",
        KEY_REIMAGE_VALIDATION : "reimageValidation",
        KEY_PROVISION_VALIDATION : "provisionValidation",

        TMPL_BAREMETAL_PAGE_DETAIL : "baremetal-detail-page-template",
        TMPL_DELETE_IMAGE : "sm-delete-image-template",
        TMPL_DELETE_PACKAGE : "sm-delete-package-template",
        TMPL_DELETE_DHCP_HOST : "sm-delete-dhcp-host-template",
        TMPL_DELETE_DHCP_SUBNET : "sm-delete-dhcp-subnet-template",
        TMPL_TAGS : "sm-tags-template",

        IMAGE_TYPES : ["ubuntu", "centos", "redhat", "esxi5.1", "esxi5.5", "fedora"],
        PACKAGE_TYPES : ["contrail-ubuntu-package", "contrail-centos-package", "contrail-storage-ubuntu-package"],

        TMPL_BM_EDIT_FORM : "bm-edit-form-template",

        URL_TAGGED_SERVERS : "/#p=setting_sm_servers&q[tag][{{params.tag}}]={{key}}",

        UCID_PREFIX_SM : "server-manager",
        UCID_PREFIX_LISTS : "lists",
        UCID_PREFIX_UVES : "uves",

        UCID_PREFIX_SM_LISTS : this.UCID_PREFIX_SM + ":" + this.UCID_PREFIX_LISTS + ":",
        UCID_PREFIX_SM_UVES : this.UCID_PREFIX_SM + ":" + this.UCID_PREFIX_UVES + ":",

        UCID_ALL_CLUSTER_LIST : this.UCID_PREFIX_SM_LISTS + "all-clusters",
        UCID_CLUSTER_SERVER_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:servers",

        UCID_ALL_SERVER_LIST : this.UCID_PREFIX_SM_LISTS + "all-servers",
        UCID_ALL_SERVER_MONITORING_LIST : this.UCID_PREFIX_SM_LISTS + "all-server-monitoring",
        UCID_ALL_SERVER_MONITORING_SUMMARY_LIST : this.UCID_PREFIX_SM_LISTS + "all-server-monitoring-summary",
        UCID_CLUSTER_SERVER_MONITORING_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:all-server-monitoring",
        UCID_CLUSTER_SERVER_MONITORING_SUMMARY_LIST : this.UCID_PREFIX_SM_LISTS + "{0}:all-server-monitoring-summary",

        UCID_SERVER_INVENTORY_UVE : this.UCID_PREFIX_SM_UVES + "{0}:inventory",
        UCID_SERVER_MONITORING_UVE : this.UCID_PREFIX_SM_UVES + "{0}:monitoring",

        UCID_ALL_IMAGE_LIST : this.UCID_PREFIX_SM_LISTS + "all-images",
        UCID_ALL_PACKAGE_LIST : this.UCID_PREFIX_SM_LISTS + "all-packages",

        UMID_SERVER_INVENTORY_UVE : "uve:{0}:inventory",
        UMID_SERVER_MONITORING_UVE : "uve:{0}:monitoring",

        TYPE_OVS : "ovs"

    };

    return SMConstants;

});
<|endoftext|>