<commit_before>/*
 * @copyright 2014 CoNWeT Lab., Universidad Politécnica de Madrid
 * @license Apache v2 (http://www.apache.org/licenses/)
 */

module.exports = function(grunt) {

  'use strict';

  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    banner: ' * @version <%= pkg.version %>\n' +
            ' * \n' +
            ' * @copyright 2014 <%= pkg.author %>\n' +
            ' * @license <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
            ' */',

    compress: {
      widget: {
        options: {
          mode: 'zip',
          archive: 'build/<%= pkg.vendor %>_<%= pkg.name %>_<%= pkg.version %>-dev.wgt'
        },
        files: [
          {expand: true, src: ['config.xml', 'index.html', 'js/**/*', 'css/**/*'], cwd: 'src'},
          {expand: true, src: ['adapter.js'], dest: 'lib', cwd: 'src/bower_components/adapter.js/samples/web/js'},

        ]
      }
    },

    jasmine: {
      src: ['src/js/*.js'],
      options: {
        specs: 'src/test/js/*Spec.js',
        helpers: ['src/test/helpers/*.js'],
        vendor: ['node_modules/jquery/dist/jquery.js',
                'src/lib/js/jquery.dataTables.js',
                'node_modules/jasmine-jquery/lib/jasmine-jquery.js']
      }
    },

    replace: {
      version: {
        src: ['src/config.xml'],
        overwrite: true,
        replacements: [{
          from: /version=\"[0-9]+\.[0-9]+\.[0-9]+(-dev)?\"/g,
          to: 'version="<%= pkg.version %>"'
        }]
      }
    },

    clean: ['build'],

    jshint: {
      all: ['src/js/**/*', 'src/test/**/*', 'Gruntfile.js', '!src/test/fixtures/']
    }

  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-text-replace');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-compress');
  grunt.loadNpmTasks('grunt-contrib-jshint');

  grunt.registerTask('zip', 'compress:widget');
  grunt.registerTask('version', ['replace:version']);

  grunt.registerTask('default', ['jshint', 'version', 'jasmine', 'zip']);
};
<commit_msg>Gruntfile.js now adds all needed files to the compressed widget file<commit_after>/*
 * @copyright 2014 CoNWeT Lab., Universidad Politécnica de Madrid
 * @license Apache v2 (http://www.apache.org/licenses/)
 */

module.exports = function(grunt) {

  'use strict';

  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),

    banner: ' * @version <%= pkg.version %>\n' +
            ' * \n' +
            ' * @copyright 2014 <%= pkg.author %>\n' +
            ' * @license <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
            ' */',

    compress: {
      widget: {
        options: {
          mode: 'zip',
          archive: 'build/<%= pkg.vendor %>_<%= pkg.name %>_<%= pkg.version %>-dev.wgt'
        },
        files: [
          {expand: true, src: ['config.xml', 'index.html', 'js/**/*', 'css/**/*', 'images/**/*'], cwd: 'src'},
          {expand: true, src: ['js/adapter.js'], dest: 'lib', cwd: 'src/bower_components/adapter.js/samples/web'},
          {expand: true, src: ['css/bootstrap.min.css', 'js/bootstrap.min.js'], dest:'lib', cwd: 'src/bower_components/bootstrap/dist'},
          {expand: true, src: ['ekko-lightbox.min.css'], dest:'lib/css', cwd: 'src/bower_components/ekko-lightbox/dist'},
          {expand: true, src: ['ekko-lightbox.min.js'], dest:'lib/js', cwd: 'src/bower_components/ekko-lightbox/dist'},
          {expand: true, src: ['jquery.min.js'], dest:'lib/js', cwd: 'src/bower_components/jquery/dist'},
          {expand: true, src: ['js/kurento-utils.js'], dest:'lib', cwd: 'src/bower_components/kurento-utils'},
        ]
      }
    },

    jasmine: {
      src: ['src/js/*.js'],
      options: {
        specs: 'src/test/js/*Spec.js',
        helpers: ['src/test/helpers/*.js'],
        vendor: ['node_modules/jquery/dist/jquery.js',
                'src/lib/js/jquery.dataTables.js',
                'node_modules/jasmine-jquery/lib/jasmine-jquery.js']
      }
    },

    replace: {
      version: {
        src: ['src/config.xml'],
        overwrite: true,
        replacements: [{
          from: /version=\"[0-9]+\.[0-9]+\.[0-9]+(-dev)?\"/g,
          to: 'version="<%= pkg.version %>"'
        }]
      }
    },

    clean: ['build'],

    jshint: {
      all: ['src/js/**/*', 'src/test/**/*', 'Gruntfile.js', '!src/test/fixtures/']
    }

  });

  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-text-replace');
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-compress');

  grunt.registerTask('zip', 'compress:widget');
  grunt.registerTask('version', ['replace:version']);

  grunt.registerTask('default', ['version', 'zip']);
};
<|endoftext|>


<commit_before>/**
 * grunt-check-dependencies
 * https://github.com/mzgol/grunt-check-dependencies
 *
 * Author Michał Gołębiowski <m.goleb@gmail.com>
 * Licensed under the MIT license.
 */

'use strict';

// Disable options that don't work in Node.js 0.10.
// Gruntfile.js & tasks/*.js are the only non-transpiled files.
/* eslint-disable no-var, object-shorthand, prefer-arrow-callback, prefer-const,
 prefer-spread, prefer-reflect, prefer-template */

var fs = require('fs');
var assert = require('assert');

var newNode;
try {
    assert.strictEqual(eval('(() => 2)()'), 2); // eslint-disable-line no-eval
    newNode = true;
} catch (e) {
    newNode = false;
}

var transformRelativePath = function transformRelativePath(filepath) {
    return newNode ? filepath : 'dist/' + filepath;
};

module.exports = function (grunt) {
    require('time-grunt')(grunt);

    grunt.initConfig({
        clean: {
            test: {
                src: [
                    'dist',
                    'test/*-copy',
                ],
            },
        },

        copy: {
            nonGenerated: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        src: [
                            'test/**/*',
                            '!test/**/*.js',
                        ],
                        dest: 'dist',
                    },
                ],
            },
        },

        babel: {
            options: {
                sourceMap: 'inline',
                sourceRoot: __dirname,
                retainLines: true,

                whitelist: [
                    // If a comment doesn't indicate otherwise, all commented out transformers
                    // would transpile features not available in latest stable Node.js yet
                    // so we can't use them as we don't transpile in latest Node.

                    'es6.arrowFunctions',
                    'es6.blockScoping',
                    'es6.classes',
                    'es6.constants',
//                    'es6.destructuring',
                    'es6.forOf',
//                    'es6.modules',
//                    'es6.parameters',
                    'es6.properties.computed',
                    'es6.properties.shorthand',
//                    'es6.spread',
//                    'es6.tailCall',
                    'es6.templateLiterals',
//                    'es6.regex.unicode',
//                    'es6.regex.sticky',
                    'strict',
                ],

                loose: [
                    // Speed up for-of on arrays by not using the iterator directly.
                    'es6.forOf',
                ],
            },
            all: {
                files: [
                    {
                        expand: true,
                        src: [
                            '*.js',
                            'tasks/**/*.js',
                            'src/**/*.js',
                            'test/**/*.js',
                        ],
                        dest: 'dist',
                    },
                ],
            },
        },

        eslint: {
            all: {
                src: [
                    '*.js',
                    'tasks',
                    'test',
                ],
            },
        },

        // Configuration to be run (and tested).
        checkDependencies: {
            ok: {
                options: {
                    packageDir: transformRelativePath('test/ok/'),
                },
            },
            notOk: {
                options: {
                    packageDir: transformRelativePath('test/not-ok/'),
                },
            },
            notOkCopyInstall: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                    install: true,
                },
            },
            notOkCopyInstallContinue: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                    install: true,
                    continue: true,
                },
            },
            notOkCopy: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                },
            },
        },

        // Unit tests.
        mochaTest: {
            all: {
                options: {
                    reporter: 'spec',
                },
                src: [transformRelativePath('test/*.js')],
            },
        },
    });

    // Load all grunt tasks matching the `grunt-*` pattern.
    require('load-grunt-tasks')(grunt);

    // Actually load this plugin's task(s).
    if (fs.existsSync(__dirname + '/dist')) {
        grunt.loadTasks('tasks');
    }

    grunt.registerTask('lint', [
        'eslint',
    ]);

    // In modern Node.js we just use the non-transpiled source as it makes it easier to debug;
    // in older version we transpile (but keep the lines).
    grunt.registerTask('build', [
        'copy:nonGenerated',
        'babel',
    ]);

    grunt.registerTask('test', ['mochaTest']);

    // By default, lint and run all tests.
    grunt.registerTask('default', [
        'clean',
        'lint',
        'build',
        'test',
    ]);
};
<commit_msg>Don't transpile files compatible with older Nodes<commit_after>/**
 * grunt-check-dependencies
 * https://github.com/mzgol/grunt-check-dependencies
 *
 * Author Michał Gołębiowski <m.goleb@gmail.com>
 * Licensed under the MIT license.
 */

'use strict';

// Disable options that don't work in Node.js 0.10.
// Gruntfile.js & tasks/*.js are the only non-transpiled files.
/* eslint-disable no-var, object-shorthand, prefer-arrow-callback, prefer-const,
 prefer-spread, prefer-reflect, prefer-template */

var fs = require('fs');
var assert = require('assert');

var newNode;
try {
    assert.strictEqual(eval('(() => 2)()'), 2); // eslint-disable-line no-eval
    newNode = true;
} catch (e) {
    newNode = false;
}

var transformRelativePath = function transformRelativePath(filepath) {
    return newNode ? filepath : 'dist/' + filepath;
};

module.exports = function (grunt) {
    require('time-grunt')(grunt);

    grunt.initConfig({
        clean: {
            test: {
                src: [
                    'dist',
                    'test/*-copy',
                ],
            },
        },

        copy: {
            nonGenerated: {
                files: [
                    {
                        expand: true,
                        dot: true,
                        src: [
                            'test/**/*',
                            '!test/**/*.js',
                        ],
                        dest: 'dist',
                    },
                ],
            },
        },

        babel: {
            options: {
                sourceMap: 'inline',
                sourceRoot: __dirname,
                retainLines: true,

                whitelist: [
                    // If a comment doesn't indicate otherwise, all commented out transformers
                    // would transpile features not available in latest stable Node.js yet
                    // so we can't use them as we don't transpile in latest Node.

                    'es6.arrowFunctions',
                    'es6.blockScoping',
                    'es6.classes',
                    'es6.constants',
//                    'es6.destructuring',
                    'es6.forOf',
//                    'es6.modules',
//                    'es6.parameters',
                    'es6.properties.computed',
                    'es6.properties.shorthand',
//                    'es6.spread',
//                    'es6.tailCall',
                    'es6.templateLiterals',
//                    'es6.regex.unicode',
//                    'es6.regex.sticky',
                    'strict',
                ],

                loose: [
                    // Speed up for-of on arrays by not using the iterator directly.
                    'es6.forOf',
                ],
            },
            all: {
                files: [
                    {
                        expand: true,
                        src: [
                            'src/**/*.js',
                            'test/**/*.js',
                        ],
                        dest: 'dist',
                    },
                ],
            },
        },

        eslint: {
            all: {
                src: [
                    '*.js',
                    'tasks',
                    'test',
                ],
            },
        },

        // Configuration to be run (and tested).
        checkDependencies: {
            ok: {
                options: {
                    packageDir: transformRelativePath('test/ok/'),
                },
            },
            notOk: {
                options: {
                    packageDir: transformRelativePath('test/not-ok/'),
                },
            },
            notOkCopyInstall: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                    install: true,
                },
            },
            notOkCopyInstallContinue: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                    install: true,
                    continue: true,
                },
            },
            notOkCopy: {
                options: {
                    packageDir: transformRelativePath('test/not-ok-install-copy/'),
                },
            },
        },

        // Unit tests.
        mochaTest: {
            all: {
                options: {
                    reporter: 'spec',
                },
                src: [transformRelativePath('test/*.js')],
            },
        },
    });

    // Load all grunt tasks matching the `grunt-*` pattern.
    require('load-grunt-tasks')(grunt);

    // Actually load this plugin's task(s).
    if (fs.existsSync(__dirname + '/dist')) {
        grunt.loadTasks('tasks');
    }

    grunt.registerTask('lint', [
        'eslint',
    ]);

    // In modern Node.js we just use the non-transpiled source as it makes it easier to debug;
    // in older version we transpile (but keep the lines).
    grunt.registerTask('build', [
        'copy:nonGenerated',
        'babel',
    ]);

    grunt.registerTask('test', ['mochaTest']);

    // By default, lint and run all tests.
    grunt.registerTask('default', [
        'clean',
        'lint',
        'build',
        'test',
    ]);
};
<|endoftext|>


<commit_before>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),

    clean: {
      build: ["<%=pkg.public%>", "<%=pkg.assets%>css", "<%=pkg.assets%>bower_components", "<%=pkg.assets%>index.html"],
      mvn: ["<%=pkg.assets%>", "<%=pkg.public%>sass"]
    },

    copy: {
      build: {
        files: [
          {
            cwd: "<%=pkg.assets%>",
            expand: true,
            src: ["**"],
            dest: "<%=pkg.public%>"
          }
        ]
      },
      run: {
        files: [
          {
            cwd: "<%=pkg.public%>",
            expand: true,
            src: ["bower_components/**", "css/**", "index.html"],
            dest: "<%=pkg.assets%>"
          }
        ]
      }
    },

    "bower-install-simple": {
      options: {
        directory: "<%=pkg.public%>bower_components"
      },
      build: {
        options: {
          production: true,
          forceLatest: true
        }
      }
    },

    wiredep: {
      options: {
        color: true,
        directory: "<%=pkg.public%>bower_components",
        fileTypes: {
          html: {
            block: /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi,
            detect: {
              js: /<script.*src=['"]([^'"]+)/gi,
              css: /<link.*href=['"]([^'"]+)/gi
            },
            replace: {
              js: '<script src="{{filePath}}" charset="utf-8"></script>',
              css: '<link rel="stylesheet" href="{{filePath}}" />'
            }
          }
        }
      },
      target: {
        src: ["<%=pkg.public%>index.html"]
      }
    },

    includeSource: {
      options: {
        basePath: "<%=pkg.public%>",
        duplicates: false,
        debug: true
      },
      target: {
        files: {
          "<%=pkg.public%>index.html": "<%=pkg.public%>index.tem.html"
        }
      }
    },

    watch: {
      scripts: {
        files: ["*.js", "*.json"],
        options: {
          livereload: true
        }
      },
      markup: {
        files: ["*.html"],
        options: {
          livereload: true
        }
      },
      stylesheets: {
        files: ["*.css"],
        options: {
          livereload: true
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 8080,
          base: "src/main/webapp/assets",
          keepalive: true
        }
      }
    },

    ngAnnotate: {
      main: {
        files: [{
          cwd: "<%=pkg.public%>",
          expand: true,
          ext: "css",
          src: ['modules/**/*.js'],
          dest: "<%=pkg.public%>"
        }]
      }
    },

    sass: {
      options: {
        sourceMap: false,
        imagePath: "../images"
      },
      dist: {
        files: [{
          cwd: "<%=pkg.public%>/scss",
          expand: true,
          src: ['*.scss'],
          ext: ".css",
          dest: "<%=pkg.public%>/css"
        }]
      }
    }
  });

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks("grunt-contrib-connect");
  grunt.loadNpmTasks("grunt-include-source");
  grunt.loadNpmTasks("grunt-wiredep");
  grunt.loadNpmTasks("grunt-bower-install-simple");
  grunt.loadNpmTasks("grunt-contrib-copy");
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-ng-annotate");
  grunt.loadNpmTasks("grunt-sass");

  grunt.registerTask("mvn", [
    "clean:build",
    "copy:build",
    "bower-install-simple:build",
    "includeSource:target",
    "wiredep:target",
    "ngAnnotate:main"
  ]);

  grunt.registerTask("build", [
    "clean:build",
    "copy:build",
    "sass",
    "bower-install-simple:build",
    "includeSource:target",
    "wiredep:target",
    "ngAnnotate:main"
  ]);

  grunt.registerTask("jetty", ["build", "copy:run"]);
  grunt.registerTask("run", ["build", "copy:run", "connect", "watch"]);
};<commit_msg>Fix issue<commit_after>module.exports = function (grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),

    clean: {
      build: ["<%=pkg.public%>", "<%=pkg.assets%>css", "<%=pkg.assets%>bower_components", "<%=pkg.assets%>index.html"],
      mvn: ["<%=pkg.public%>"]
    },

    copy: {
      build: {
        files: [
          {
            cwd: "<%=pkg.assets%>",
            expand: true,
            src: ["**"],
            dest: "<%=pkg.public%>"
          }
        ]
      },
      run: {
        files: [
          {
            cwd: "<%=pkg.public%>",
            expand: true,
            src: ["bower_components/**", "css/**", "index.html"],
            dest: "<%=pkg.assets%>"
          }
        ]
      }
    },

    "bower-install-simple": {
      options: {
        directory: "<%=pkg.public%>bower_components"
      },
      build: {
        options: {
          production: true,
          forceLatest: true
        }
      }
    },

    wiredep: {
      options: {
        color: true,
        directory: "<%=pkg.public%>bower_components",
        fileTypes: {
          html: {
            block: /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi,
            detect: {
              js: /<script.*src=['"]([^'"]+)/gi,
              css: /<link.*href=['"]([^'"]+)/gi
            },
            replace: {
              js: '<script src="{{filePath}}" charset="utf-8"></script>',
              css: '<link rel="stylesheet" href="{{filePath}}" />'
            }
          }
        }
      },
      target: {
        src: ["<%=pkg.public%>index.html"]
      }
    },

    includeSource: {
      options: {
        basePath: "<%=pkg.public%>",
        duplicates: false,
        debug: true
      },
      target: {
        files: {
          "<%=pkg.public%>index.html": "<%=pkg.public%>index.tem.html"
        }
      }
    },

    watch: {
      scripts: {
        files: ["*.js", "*.json"],
        options: {
          livereload: true
        }
      },
      markup: {
        files: ["*.html"],
        options: {
          livereload: true
        }
      },
      stylesheets: {
        files: ["*.css"],
        options: {
          livereload: true
        }
      }
    },

    connect: {
      server: {
        options: {
          port: 8080,
          base: "src/main/webapp/assets",
          keepalive: true
        }
      }
    },

    ngAnnotate: {
      main: {
        files: [{
          cwd: "<%=pkg.public%>",
          expand: true,
          ext: "css",
          src: ['modules/**/*.js'],
          dest: "<%=pkg.public%>"
        }]
      }
    },

    sass: {
      options: {
        sourceMap: false,
        imagePath: "../images"
      },
      dist: {
        files: [{
          cwd: "<%=pkg.public%>/scss",
          expand: true,
          src: ['*.scss'],
          ext: ".css",
          dest: "<%=pkg.public%>/css"
        }]
      }
    }
  });

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks("grunt-contrib-connect");
  grunt.loadNpmTasks("grunt-include-source");
  grunt.loadNpmTasks("grunt-wiredep");
  grunt.loadNpmTasks("grunt-bower-install-simple");
  grunt.loadNpmTasks("grunt-contrib-copy");
  grunt.loadNpmTasks("grunt-contrib-clean");
  grunt.loadNpmTasks("grunt-ng-annotate");
  grunt.loadNpmTasks("grunt-sass");

  grunt.registerTask("mvn", [
    "clean:mvn",
    "copy:build",
    "bower-install-simple:build",
    "includeSource:target",
    "wiredep:target",
    "ngAnnotate:main"
  ]);

  grunt.registerTask("build", [
    "clean:build",
    "copy:build",
    "sass",
    "bower-install-simple:build",
    "includeSource:target",
    "wiredep:target",
    "ngAnnotate:main"
  ]);

  grunt.registerTask("jetty", ["build", "copy:run"]);
  grunt.registerTask("run", ["build", "copy:run", "connect", "watch"]);
};<|endoftext|>


<commit_before>define(function(require) {
  'use strict';

  var PF = require('js/app/obj');
  var logger = PF.logger.get('root/js/apps/user/profile/controller');

  PF.module('UserApp.Profile', function(Profile, PF, Backbone, Marionette, $, _) {
    Profile.controller = {
      show_user_profile: function() {
        var up_promise = PF.request('userapp:entities:userprofile');
        up_promise.then(function(up) {
          logger.debug('PF.UserApp.Profile.contoller.show_user_profile -- profile view for: ' + JSON.stringify(up));
          var Views = require('js/apps/user/profile/views');
          logger.debug('PF.UserApp.Profile.contoller.show_user_profile -- 2');
          var view = new Views.UserProfile({ model: up });
          logger.debug('PF.UserApp.Profile.contoller.show_user_profile -- 3');
          // TODO: view.on('logout-clicked', function() { ... });
          PF.region_main.show(view);
        });
      }
    };
  });

  return PF.UserApp.Profile.controller;
});
<commit_msg>client user app - logout working<commit_after>define(function(require) {
  'use strict';

  var PF = require('js/app/obj');
  var logger = PF.logger.get('root/js/apps/user/profile/controller');

  PF.module('UserApp.Profile', function(Profile, PF, Backbone, Marionette, $, _) {
    Profile.controller = {
      show_user_profile: function() {
        var up_promise = PF.request('userapp:entities:userprofile');
        up_promise.then(function(up) {
          logger.debug('PF.UserApp.Profile.contoller.show_user_profile -- showing: ' + JSON.stringify(up));
          var Views = require('js/apps/user/profile/views');
          var view = new Views.UserProfile({ model: up });
          view.on('logout-clicked', function() {
            logger.debug('Logging out');
            $.get('/api/user/logout', function(resp_data, textStatus, jqXhr) {
              PF.trigger('home:show');
            });
          });
          PF.region_main.show(view);
        });
      }
    };
  });

  return PF.UserApp.Profile.controller;
});
<|endoftext|>


<commit_before>//credit NAMO
const moment = require('moment-timezone');
const version = require('./package.json').version;
var skill = (client, member) => {
//-----------------------------------------------------------------------------------------settting
var guild = member.guild;
let ser = client.guilds.find("name", "個人的現實");
var d = member.joinedAt;
//-----------------------------------------------------------------A function converting to HK time
function toTimeZone(d, zone) {
 var format = 'YYYY/MM/DD HH:mm:ss';
 return moment(d, format).tz(zone).format(format);
};
//--------------------------------------------------------------------------------console log event
console.log(`
    >Guild Event<
Member : (${member.user.username}) Joined.
At : ${toTimeZone(d, "Asia/Hong_Kong")}
From : ${member.guild.name}`);
//---------------------------------------------------------------------------------for other server
if (guild.id != '191539621119655936') {
	guild.channels.find('type', 'text').send(`Welcome ${member.user.username} Joined Our Server.\nUse Command \`/help\` To Open The Help List`);
	return;
}
//------------------------------------------------------------------------------add r1 (first role)
var r1 = guild.roles.find("name", "科學");
//------------------------------------------------------------------------------random num function
	function GetRandomInt(MinInt, MaxInt) {
		var x = Math.floor((Math.random() * MaxInt) + MinInt);
		return x;
	};
//-----------------------------------------------------------------------------random gen r2 and r3
	var RandomInt = GetRandomInt(1, 38);
	var SRandomInt = GetRandomInt(1, 4);
//------------------------------------------------------------------------------------r2 role array
	var ArrayLevel = [	"Level 1 - 無能力者",
						"Level 2 - 異能力者",
						"Level 3 - 強能力者",
						"Level 4 - 大能力者"];
//------------------------------------------------------------------------------------r2 Logic Gate
	switch(SRandomInt)
	{
		case 1 : var r2 = guild.roles.find("name", ArrayLevel[0]);break;
		case 2 : var r2 = guild.roles.find("name", ArrayLevel[1]);break;
		case 3 : var r2 = guild.roles.find("name", ArrayLevel[2]);break;
		case 4 : var r2 = guild.roles.find("name", ArrayLevel[3]);break;
	};
//------------------------------------------------------------------------------------r3 role array
	var ArraySkill = [	"解析不能 - Unknown",
				"透視能力 - Clairvoyance",
				"預知能力 - Far vision",
				"視覺妨害 - Dummy Check",
				"偏光能力 - Trick Art",
				"定溫保存 - Thermal Hand",
				"火炎放出 - Fire throwe",
				"肉體再生 - Automatic Reverse",
				"肉體變化 - Metamorphose",
				"能力追蹤 - AIM Stalker",
				"多才能力 - Dual Skill",
				"擴散代理 - Diffusion Ghost",
				"真相不明 - Counter Stop",
				"空間移動 - Teleporter",
				"座標移動 - Move Point",
				"死角移動 - Kill Point",
				"電擊使 - Electro Master",
				"缺陷電氣 - Radio Noise",
				"超電磁砲 - Railgun",
				"原子崩壞 - Melt Down",
				"氮氣裝甲 - Offense Armour",
				"氮氣爆槍 - Bomber Lance",
				"空力使 - Aero Hand",
				"風力使 - Aero Shooter",
				"空氣氣球 - Air bag",
				"念動力- Telekinesis",
				"氣力絕緣 - Insulation",
				"水流操作 - Hydrohand",
				"微細構築 - Micro Tekurasu Char",
				"衝擊擴散- Finely constructed",
				"讀心能力 - Psychometry",
				"認證穿刺 - Malicious Fake",
				"意見解析 - Skill Polygraph",
				"念話能力 - Telepath",
				"心理定規 - Major Heart",
				"心理穿孔 - Mental Stinger",
				"精神感應 - Telepathy",
				"心理掌握 - Mental Out"]
//------------------------------------------------------------------------------------r3 Logic Gate
	switch(RandomInt)
	{
		case 1 :		var r3 = guild.roles.find("name", ArraySkill[0]);break;
		case 2 :		var r3 = guild.roles.find("name", ArraySkill[1]);break;
		case 3 :		var r3 = guild.roles.find("name", ArraySkill[2]);break;
		case 4 :		var r3 = guild.roles.find("name", ArraySkill[3]);break;
		case 5 :		var r3 = guild.roles.find("name", ArraySkill[4]);break;
		case 6 :		var r3 = guild.roles.find("name", ArraySkill[5]);break;
		case 7 :		var r3 = guild.roles.find("name", ArraySkill[6]);break;
		case 8 :		var r3 = guild.roles.find("name", ArraySkill[7]);break;
		case 9 :		var r3 = guild.roles.find("name", ArraySkill[8]);break;
		case 10 :		var r3 = guild.roles.find("name", ArraySkill[9]);break;
		case 11 :		var r3 = guild.roles.find("name", ArraySkill[10]);break;
		case 12 :		var r3 = guild.roles.find("name", ArraySkill[11]);break;
		case 13 :		var r3 = guild.roles.find("name", ArraySkill[12]);break;
		case 14 :		var r3 = guild.roles.find("name", ArraySkill[13]);break;
		case 15 :		var r3 = guild.roles.find("name", ArraySkill[14]);break;
		case 16 :		var r3 = guild.roles.find("name", ArraySkill[15]);break;
		case 17 :		var r3 = guild.roles.find("name", ArraySkill[16]);break;
		case 18 :		var r3 = guild.roles.find("name", ArraySkill[17]);break;
		case 19 :		var r3 = guild.roles.find("name", ArraySkill[18]);break;
		case 20 :		var r3 = guild.roles.find("name", ArraySkill[19]);break;
		case 21 :		var r3 = guild.roles.find("name", ArraySkill[20]);break;
		case 22 :		var r3 = guild.roles.find("name", ArraySkill[21]);break;
		case 23 :		var r3 = guild.roles.find("name", ArraySkill[22]);break;
		case 24 :		var r3 = guild.roles.find("name", ArraySkill[23]);break;
		case 25 :		var r3 = guild.roles.find("name", ArraySkill[24]);break;
		case 26 :		var r3 = guild.roles.find("name", ArraySkill[25]);break;
		case 27 :		var r3 = guild.roles.find("name", ArraySkill[26]);break;
		case 28 :		var r3 = guild.roles.find("name", ArraySkill[27]);break;
		case 29 :		var r3 = guild.roles.find("name", ArraySkill[28]);break;
		case 30 :		var r3 = guild.roles.find("name", ArraySkill[29]);break;
		case 31 :		var r3 = guild.roles.find("name", ArraySkill[30]);break;
		case 32 :		var r3 = guild.roles.find("name", ArraySkill[31]);break;
		case 33 :		var r3 = guild.roles.find("name", ArraySkill[32]);break;
		case 34 :		var r3 = guild.roles.find("name", ArraySkill[33]);break;
		case 35 :		var r3 = guild.roles.find("name", ArraySkill[34]);break;
		case 36 :		var r3 = guild.roles.find("name", ArraySkill[35]);break;
		case 37 :		var r3 = guild.roles.find("name", ArraySkill[36]);break;
		case 38 :		var r3 = guild.roles.find("name", ArraySkill[37]);break;
	};
//-----------------------------------------------------------all result process and welcome message
if(!(r2 == guild.roles.find("name", ArrayLevel[0]))){
	member.addRole(r1).then(member.addRole(r2)).then(member.addRole(r3));

	guild.channels.find('type', 'text').send(`🔊  Welcome \*\*${member.user.username}\*\* ( ${r2.name} ) Joined Our Server.\n🔸  Your Skill is : \`${r3.name}\` ${r3}
	\*\*\_\_                                                                              ⚠Warning⚠                                                                             \_\_\*\*
	Please Follow The \*\*NAMO Protocol (Revised) Regulations\*\* Or You Will Get Kick By <@347782166811377667>\n
	\n                                                 🔸🔹🔸\*\*\_\_   (NAMO Protocol [1.5])   \_\_\*\*🔸🔹🔸\n                                                Use Command : /register To Register Your Identity
\`                                       If you do not choose to register, you will not be able to access some of the campus area.\``);
} else {
	member.addRole(r1).then(member.addRole(r2));

	guild.channels.find('type', 'text').send(`🔊  Welcome \*\*${member.user.username}\*\* ( ${r2.name} ) Joined Our Server.\n🔸  Your Skill is : \`NULL\`
	\*\*\_\_                                                                              ⚠Warning⚠                                                                             \_\_\*\*
	Please Follow The \*\*NAMO Protocol (Revised) Regulations\*\* Or You Will Get Kick By <@347782166811377667>\n
	\n                                                 🔸🔹🔸\*\*\_\_   (NAMO Protocol [1.5])   \_\_\*\*🔸🔹🔸\n                                                Use Command : /register To Register Your Identity
\`                                       If you do not choose to register, you will not be able to access some of the campus area.\``);
}
//-------------------------------------------------------------------send message to MISAKA-NETWORK
ser.channels.get('347618456335548427').send({embed: {
	color: 10158080,
	description: '\_\_' + '------ α Lyrae DownLink ' + version + ' ------' + '\_\_\n' + 'Major Event : '  + '\`' + member.user.username + '\`' + ' Joined' + '\nAt : ' + toTimeZone(d, "Asia/Hong_Kong") + '\nFrom : ' + guild.name +
	'\n--- \*\*NAMO Protocol (Revised) Regulations [1.22]\*\* --- \n(ADDING AUTO ROLES)' +
	'\n\`\`\`' + r1.id + ' (' + r1.name + ')' +
	'\n' + r2.id + ' (' + r2.name + ')' +
	'\n' + r3.id + ' (' + r3.name + ')' + '\`\`\`'
}});
ser.channels.get('359923471029108747').send(`Guild Event (guildmember.join) Trigger \nAt: ${toTimeZone(d, "Asia/Hong_Kong")}, By: ${member.user.username}`)
}
exports.skill = skill;
<commit_msg>Fix Base Function<commit_after>//credit NAMO
const moment = require('moment-timezone');
const version = require('./package.json').version;
var skill = (client, member) => {
//-----------------------------------------------------------------------------------------settting
var guild = member.guild;
let ser = client.guilds.find("name", "個人的現實");
var d = member.joinedAt;
//-----------------------------------------------------------------A function converting to HK time
function toTimeZone(d, zone) {
 var format = 'YYYY/MM/DD HH:mm:ss';
 return moment(d, format).tz(zone).format(format);
};
//--------------------------------------------------------------------------------console log event
console.log(`
    >Guild Event<
Member : (${member.user.username}) Joined.
At : ${toTimeZone(d, "Asia/Hong_Kong")}
From : ${member.guild.name}`);
//---------------------------------------------------------------------------------for other server
if (guild.id != '191539621119655936') {
	guild.channels.find('type', 'text').send(`Welcome ${member.user.username} Joined Our Server.\nUse Command \`/help\` To Open The Help List`);
	return;
}
//------------------------------------------------------------------------------add r1 (first role)
var r1 = guild.roles.find("name", "科學");
//------------------------------------------------------------------------------random num function
	function GetRandomInt(MinInt, MaxInt) {
		var x = Math.floor((Math.random() * MaxInt) + MinInt);
		return x;
	};
//-----------------------------------------------------------------------------random gen r2 and r3
	var RandomInt = GetRandomInt(1, 38);
	var SRandomInt = GetRandomInt(1, 5);
//------------------------------------------------------------------------------------r2 role array
	var ArrayLevel = [
		"Level 0 - 無能力者",
		"Level 1 - 低能力者",
		"Level 2 - 異能力者",
		"Level 3 - 強能力者",
		"Level 4 - 大能力者"
	];
//------------------------------------------------------------------------------------r2 Logic Gate
	switch(SRandomInt)
	{
		case 1 : var r2 = guild.roles.find("name", ArrayLevel[0]);break;
		case 2 : var r2 = guild.roles.find("name", ArrayLevel[1]);break;
		case 3 : var r2 = guild.roles.find("name", ArrayLevel[2]);break;
		case 4 : var r2 = guild.roles.find("name", ArrayLevel[3]);break;
		case 5 : var r2 = guild.roles.find("name", ArrayLevel[4]);break;
	};
//------------------------------------------------------------------------------------r3 role array
	var ArraySkill = [	"解析不能 - Unknown",
				"透視能力 - Clairvoyance",
				"預知能力 - Far vision",
				"視覺妨害 - Dummy Check",
				"偏光能力 - Trick Art",
				"定溫保存 - Thermal Hand",
				"火炎放出 - Fire throwe",
				"肉體再生 - Automatic Reverse",
				"肉體變化 - Metamorphose",
				"能力追蹤 - AIM Stalker",
				"多才能力 - Dual Skill",
				"擴散代理 - Diffusion Ghost",
				"真相不明 - Counter Stop",
				"空間移動 - Teleporter",
				"座標移動 - Move Point",
				"死角移動 - Kill Point",
				"電擊使 - Electro Master",
				"缺陷電氣 - Radio Noise",
				"超電磁砲 - Railgun",
				"原子崩壞 - Melt Down",
				"氮氣裝甲 - Offense Armour",
				"氮氣爆槍 - Bomber Lance",
				"空力使 - Aero Hand",
				"風力使 - Aero Shooter",
				"空氣氣球 - Air bag",
				"念動力- Telekinesis",
				"氣力絕緣 - Insulation",
				"水流操作 - Hydrohand",
				"微細構築 - Micro Tekurasu Char",
				"衝擊擴散- Finely constructed",
				"讀心能力 - Psychometry",
				"認證穿刺 - Malicious Fake",
				"意見解析 - Skill Polygraph",
				"念話能力 - Telepath",
				"心理定規 - Major Heart",
				"心理穿孔 - Mental Stinger",
				"精神感應 - Telepathy",
				"心理掌握 - Mental Out"]
//------------------------------------------------------------------------------------r3 Logic Gate
	switch(RandomInt)
	{
		case 1 :		var r3 = guild.roles.find("name", ArraySkill[0]);break;
		case 2 :		var r3 = guild.roles.find("name", ArraySkill[1]);break;
		case 3 :		var r3 = guild.roles.find("name", ArraySkill[2]);break;
		case 4 :		var r3 = guild.roles.find("name", ArraySkill[3]);break;
		case 5 :		var r3 = guild.roles.find("name", ArraySkill[4]);break;
		case 6 :		var r3 = guild.roles.find("name", ArraySkill[5]);break;
		case 7 :		var r3 = guild.roles.find("name", ArraySkill[6]);break;
		case 8 :		var r3 = guild.roles.find("name", ArraySkill[7]);break;
		case 9 :		var r3 = guild.roles.find("name", ArraySkill[8]);break;
		case 10 :		var r3 = guild.roles.find("name", ArraySkill[9]);break;
		case 11 :		var r3 = guild.roles.find("name", ArraySkill[10]);break;
		case 12 :		var r3 = guild.roles.find("name", ArraySkill[11]);break;
		case 13 :		var r3 = guild.roles.find("name", ArraySkill[12]);break;
		case 14 :		var r3 = guild.roles.find("name", ArraySkill[13]);break;
		case 15 :		var r3 = guild.roles.find("name", ArraySkill[14]);break;
		case 16 :		var r3 = guild.roles.find("name", ArraySkill[15]);break;
		case 17 :		var r3 = guild.roles.find("name", ArraySkill[16]);break;
		case 18 :		var r3 = guild.roles.find("name", ArraySkill[17]);break;
		case 19 :		var r3 = guild.roles.find("name", ArraySkill[18]);break;
		case 20 :		var r3 = guild.roles.find("name", ArraySkill[19]);break;
		case 21 :		var r3 = guild.roles.find("name", ArraySkill[20]);break;
		case 22 :		var r3 = guild.roles.find("name", ArraySkill[21]);break;
		case 23 :		var r3 = guild.roles.find("name", ArraySkill[22]);break;
		case 24 :		var r3 = guild.roles.find("name", ArraySkill[23]);break;
		case 25 :		var r3 = guild.roles.find("name", ArraySkill[24]);break;
		case 26 :		var r3 = guild.roles.find("name", ArraySkill[25]);break;
		case 27 :		var r3 = guild.roles.find("name", ArraySkill[26]);break;
		case 28 :		var r3 = guild.roles.find("name", ArraySkill[27]);break;
		case 29 :		var r3 = guild.roles.find("name", ArraySkill[28]);break;
		case 30 :		var r3 = guild.roles.find("name", ArraySkill[29]);break;
		case 31 :		var r3 = guild.roles.find("name", ArraySkill[30]);break;
		case 32 :		var r3 = guild.roles.find("name", ArraySkill[31]);break;
		case 33 :		var r3 = guild.roles.find("name", ArraySkill[32]);break;
		case 34 :		var r3 = guild.roles.find("name", ArraySkill[33]);break;
		case 35 :		var r3 = guild.roles.find("name", ArraySkill[34]);break;
		case 36 :		var r3 = guild.roles.find("name", ArraySkill[35]);break;
		case 37 :		var r3 = guild.roles.find("name", ArraySkill[36]);break;
		case 38 :		var r3 = guild.roles.find("name", ArraySkill[37]);break;
	};
//-----------------------------------------------------------all result process and welcome message
if(!(r2 == guild.roles.find("name", ArrayLevel[0]))){
	member.addRole(r1).then(member.addRole(r2)).then(member.addRole(r3));

	guild.channels.find('type', 'text').send(`🔊  Welcome \*\*${member.user.username}\*\* ( ${r2.name} ) Joined Our Server.\n🔸  Your Skill is : \`${r3.name}\` ${r3}
	\*\*\_\_                                                                              ⚠Warning⚠                                                                             \_\_\*\*
	Please Follow The \*\*NAMO Protocol (Revised) Regulations\*\* Or You Will Get Kick By <@347782166811377667>\n
	\n                                                 🔸🔹🔸\*\*\_\_   (NAMO Protocol [1.5])   \_\_\*\*🔸🔹🔸\n                                                Use Command : /register To Register Your Identity
\`                                       If you do not choose to register, you will not be able to access some of the campus area.\``);
} else {
	member.addRole(r1).then(member.addRole(r2));

	guild.channels.find('type', 'text').send(`🔊  Welcome \*\*${member.user.username}\*\* ( ${r2.name} ) Joined Our Server.\n🔸  Your Skill is : \`NULL\`
	\*\*\_\_                                                                              ⚠Warning⚠                                                                             \_\_\*\*
	Please Follow The \*\*NAMO Protocol (Revised) Regulations\*\* Or You Will Get Kick By <@347782166811377667>\n
	\n                                                 🔸🔹🔸\*\*\_\_   (NAMO Protocol [1.5])   \_\_\*\*🔸🔹🔸\n                                                Use Command : /register To Register Your Identity
\`                                       If you do not choose to register, you will not be able to access some of the campus area.\``);
}
//-------------------------------------------------------------------send message to MISAKA-NETWORK
ser.channels.get('347618456335548427').send({embed: {
	color: 10158080,
	description: '\_\_' + '------ α Lyrae DownLink ' + version + ' ------' + '\_\_\n' + 'Major Event : '  + '\`' + member.user.username + '\`' + ' Joined' + '\nAt : ' + toTimeZone(d, "Asia/Hong_Kong") + '\nFrom : ' + guild.name +
	'\n--- \*\*NAMO Protocol (Revised) Regulations [1.22]\*\* --- \n(ADDING AUTO ROLES)' +
	'\n\`\`\`' + r1.id + ' (' + r1.name + ')' +
	'\n' + r2.id + ' (' + r2.name + ')' +
	'\n' + r3.id + ' (' + r3.name + ')' + '\`\`\`'
}});
ser.channels.get('359923471029108747').send(`Guild Event (guildmember.join) Trigger \nAt: ${toTimeZone(d, "Asia/Hong_Kong")}, By: ${member.user.username}`)
}
exports.skill = skill;
<|endoftext|>


<commit_before>module.exports = function (grunt) {

    var env= process.env.NODE_ENV || 'dev'

    var buildOptions = {
        dev: {
            sass: {
                style: 'compressed'
            },
            uglify: {
                sourceMap: true,
                compress: {
                    drop_debugger: false
                },
                mangle: false
            }
        },
        production: {
            sass: {
                style: 'compressed'
            },
            uglify: {
                compress: {
                    drop_console: true
                }
            }
        }
    };

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        express: {
            default: {
                options: {
                    port: 3000,
                    script: 'app.js',
                    node_env: env
                }
            }
        },
        sass: {
            options: buildOptions[env].sass,
            dist: {
                files: {
                    'public/stylesheets/style.min.css': 'public/stylesheets/style.scss'
                }
            }
        },
        ngAnnotate: {
            dist: {
                files: {
                    'public/javascripts/app.min.js': [
                        'public/javascripts/app.js',
                        'public/javascripts/controllers/*.js',
                        'public/javascripts/services/*.js'
                    ]
                }
            }
        },
        uglify: {
            default: {
                options: buildOptions[env].uglify,
                files: {
                    'public/javascripts/app.min.js': 'public/javascripts/app.min.js'
                }
            }
        },
        watch: {
            css: {
                files: '**/*.scss',
                tasks: ['sass']
            },
            js: {
                files: ['public/javascripts/controllers/*.js', 'public/javascripts/services/*.js', 'app.js'],
                tasks: ['ngAnnotate', 'uglify:default']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-express-server');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-ng-annotate');
    grunt.loadNpmTasks('grunt-sass');
    grunt.registerTask('build', ['ngAnnotate', 'uglify:default', 'sass']);
    grunt.registerTask('server', ['build', 'express:default']);
    grunt.registerTask('dev', ['build', 'watch']);
};<commit_msg>Fix Gruntfile issues<commit_after>module.exports = function (grunt) {

    var env= process.env.NODE_ENV || 'development'

    var buildOptions = {
        development: {
            express: {
                server: {
                    options: {
                        port: 3000,
                        script: 'app.js'
                    }
                }
            },
            sass: {
                style: 'compressed'
            },
            uglify: {
                sourceMap: true,
                compress: {
                    drop_debugger: false
                },
                mangle: false
            }
        },
        production: {
            express: {
                server: {
                    options: {
                        port: 3000,
                        script: 'app.js',
                        node_env: "production"
                    }
                }
            },
            sass: {
                style: 'compressed'
            },
            uglify: {
                compress: {
                    drop_console: true
                }
            }
        }
    };

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        express: buildOptions[env].express,
        sass: {
            options: buildOptions[env].sass,
            dist: {
                files: {
                    'public/stylesheets/style.min.css': 'public/stylesheets/style.scss'
                }
            }
        },
        ngAnnotate: {
            dist: {
                files: {
                    'public/javascripts/app.min.js': [
                        'public/javascripts/app.js',
                        'public/javascripts/controllers/*.js',
                        'public/javascripts/services/*.js'
                    ]
                }
            }
        },
        uglify: {
            default: {
                options: buildOptions[env].uglify,
                files: {
                    'public/javascripts/app.min.js': 'public/javascripts/app.min.js'
                }
            }
        },
        watch: {
            css: {
                files: '**/*.scss',
                tasks: ['sass']
            },
            js: {
                files: ['public/javascripts/controllers/*.js', 'public/javascripts/services/*.js', 'app.js'],
                tasks: ['ngAnnotate', 'uglify:default']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-express-server');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-ng-annotate');
    grunt.loadNpmTasks('grunt-sass');
    grunt.registerTask('build', ['ngAnnotate', 'uglify:default', 'sass']);
    grunt.registerTask('server', ['build', 'express:server']);
    grunt.registerTask('dev', ['build', 'watch']);
};<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {
  [
    'grunt-contrib-jshint',
    'grunt-contrib-watch',
    'grunt-mozilla-addon-sdk'
  ].forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    watch: {
      all: {
        files: [
          'lib/main.js',
          'data/page-mod/*.js'
        ],
        tasks: ['jshint']
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'lib/main.js',
        'data/page-mod/*.js'
      ]
    },
    //Define a mozilla addon-sdk to download and use
    'mozilla-addon-sdk': {
      '1_16': {
        options: {
          revision: '1.16',
          dest_dir: 'build_tools/'
        }
      }
    },
    'mozilla-cfx-xpi': {
      'stable': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          dist_dir: 'tmp/dist-stable',
          command: 'xpi',
          arguments: '--strip-sdk' // builds smaller xpis
        }
      }
    },
    'mozilla-cfx': {
      'run_stable': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          command: 'run',
          arguments: '-p ~/.local/addon_profile/default'
        }
      },
      'run_nightly': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          command: 'run',
          arguments: '-b /mnt/sdb1/firefox/firefox -p ~/.local/addon_profile/nightly'
        }
      }
    }
  });

  grunt.registerTask('default', ['jshint', 'watch']);
  grunt.registerTask('release', ['mozilla-cfx-xpi']);
  grunt.registerTask('pre-release', ['mozilla-cfx:run_stable']);
};

<commit_msg>added linting to pre-release task<commit_after>'use strict';

module.exports = function (grunt) {
  [
    'grunt-contrib-jshint',
    'grunt-contrib-watch',
    'grunt-mozilla-addon-sdk'
  ].forEach(grunt.loadNpmTasks);

  grunt.initConfig({
    watch: {
      all: {
        files: [
          'lib/main.js',
          'data/page-mod/*.js'
        ],
        tasks: ['jshint']
      }
    },
    jshint: {
      options: {
        jshintrc: '.jshintrc'
      },
      all: [
        'lib/main.js',
        'data/page-mod/*.js'
      ]
    },
    //Define a mozilla addon-sdk to download and use
    'mozilla-addon-sdk': {
      '1_16': {
        options: {
          revision: '1.16',
          dest_dir: 'build_tools/'
        }
      }
    },
    'mozilla-cfx-xpi': {
      'stable': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          dist_dir: 'tmp/dist-stable',
          command: 'xpi',
          arguments: '--strip-sdk' // builds smaller xpis
        }
      }
    },
    'mozilla-cfx': {
      'run_stable': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          command: 'run',
          arguments: '-p ~/.local/addon_profile/default'
        }
      },
      'run_nightly': {
        options: {
          'mozilla-addon-sdk': '1_16',
          extension_dir: '.',
          command: 'run',
          arguments: '-b /mnt/sdb1/firefox/firefox -p ~/.local/addon_profile/nightly'
        }
      }
    }
  });

  grunt.registerTask('default', ['jshint', 'watch']);
  grunt.registerTask('release', ['mozilla-cfx-xpi']);
  grunt.registerTask('pre-release', ['jshint', 'mozilla-cfx:run_stable']);
};

<|endoftext|>


<commit_before>var localStorage = require("global/window").localStorage
var document = require("global/document")
var Delegator = require("dom-delegator")
var HashRouter = require("hash-router")
var Dom = require("jsonml-stringify/dom")

var template = require("./template.js")
var App = require("./app.js")

// configure Dom rendered
var dom = Dom([
    require("jsonml-stringify/plugins/loose"),
    require("jsonml-stringify/plugins/fragment"),
    require("jsonml-stringify/plugins/observ")
])

// Read from db
var storedState = localStorage.getItem("todomvc-jsonml")
var initialState = storedState ? JSON.parse(storedState) : []

// Inputs
var delegator = Delegator()
var router = HashRouter()

// Get app to generate view model from inputs
var viewModel = App(initialState, {
    delegator: delegator,
    router: router
})

// Renderer
var tree = template(viewModel)
// Render the tree
var elem = dom(tree)
document.body.appendChild(elem)

// Store to db
viewModel.todos(function (tuple) {
    localStorage.setItem("todomvc-jsonml",
        JSON.stringify(tuple.array.map(function (todo) {
            return todo.toJSON()
        })))
})
<commit_msg>minor fix<commit_after>var localStorage = require("global/window").localStorage
var document = require("global/document")
var Delegator = require("dom-delegator")
var HashRouter = require("hash-router")
var Dom = require("jsonml-stringify/dom")

var template = require("./template.js")
var App = require("./app.js")

// configure Dom rendered
var dom = Dom([
    require("jsonml-stringify/plugins/loose"),
    require("jsonml-stringify/plugins/fragment"),
    require("jsonml-stringify/plugins/observ")
])

// Read from db
var storedState = localStorage.getItem("todomvc-jsonml")
var initialState = storedState ? JSON.parse(storedState) : []

// Inputs
var delegator = Delegator()
var router = HashRouter()

// Get app to generate view model from inputs
var viewModel = App(initialState, {
    delegator: delegator,
    router: router
})

// Renderer
var tree = template(viewModel)
// Render the tree
var elem = dom(tree)
document.body.appendChild(elem)

// Store to db
viewModel.todos(function (todos) {
    localStorage.setItem("todomvc-jsonml",
        JSON.stringify(todos.toJSON()))
})
<|endoftext|>


<commit_before>/*global module:false*/
module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON( 'package.json' ),
		meta: {
			banner: '/*! Ractive - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* <%= pkg.description %>\n\n' +
				'* <%= pkg.homepage %>\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n' +
				'\n' +
				'/*jslint eqeq: true, plusplus: true */\n' +
				'/*global document, HTMLElement */\n' +
				'\n\n',
			wrapper: {
				start: '(function ( global ) {\n\n' +
						'\'use strict\';\n\n',
				end: '\n\n// export\n' +
						'if ( typeof module !== "undefined" && module.exports ) module.exports = Ractive // Common JS\n' +
						'else if ( typeof define === "function" && define.amd ) define( function () { return Ractive } ) // AMD\n' +
						'else { global.Ractive = Ractive }\n\n' +
						'}( this ));'
			}
		},
		lint: {
			files: ['grunt.js', 'src/**/*.js'] // TODO add tests
		},
		qunit: {
			files: [ 'test/core.html', 'test/compile.html', 'test/render.html' ]
		},
		clean: {
			files: [ 'build/**/*' ]
		},
		concat: {
			runtime: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/types.js', 'src/Views.js', 'src/events.js', 'src/formatters.js', 'src/ViewModel.js', 'src/DomViews.js', 'src/TextViews.js', 'src/extend.js', 'src/modifyArray.js', 'src/easing.js', 'src/animate.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.runtime.js'
			},
			full: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/types.js', 'src/Views.js', 'src/events.js', 'src/compile.js', 'src/tokenize.js', 'src/formatters.js', 'src/ViewModel.js', 'src/DomViews.js', 'src/TextViews.js', 'src/extend.js', 'src/modifyArray.js', 'src/easing.js', 'src/animate.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.js'
			},
			runtime_legacy: {
				src: [ 'src/legacy.js', '<%= concat.runtime.dest %>' ],
				dest: 'build/Ractive-legacy.runtime.js'
			},
			full_legacy: {
				src: [ 'src/legacy.js', '<%= concat.full.dest %>' ],
				dest: 'build/Ractive-legacy.js'
			}
		},
		watch: {
			files: ['<config:lint.files>', 'package.json'],
			tasks: ['concat','min']
		},
		jshint: {
			options: {
				jshintrc: '.jshintrc'
			}
		},
		uglify: {
			runtime: {
				src: ['<%= concat.runtime.dest %>'],
				dest: 'build/Ractive.runtime.min.js'
			},
			full: {
				src: ['<%= concat.full.dest %>'],
				dest: 'build/Ractive.min.js'
			},
			runtime_legacy: {
				src: ['<%= concat.runtime_legacy.dest %>'],
				dest: 'build/Ractive-legacy.runtime.min.js'
			},
			full_legacy: {
				src: ['<%= concat.full_legacy.dest %>'],
				dest: 'build/Ractive-legacy.min.js'
			}
		},
		copy: {
			release: {
				files: [{
					expand: true,
					cwd: 'build/',
					src: [ '**/*' ],
					dest: 'release/<%= pkg.version %>/'
				}]
			},
			link: {
				files: {
					'Ractive.js': 'build/Ractive.js'
				}
			}
		}
	});

	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-copy' );

	// Default task.
	grunt.registerTask('default', [ 'jshint', 'qunit', 'clean', 'concat', 'uglify' ]);

	grunt.registerTask( 'release', [ 'default', 'copy' ] );

};
<commit_msg>added _private.js and interpolators.js to build<commit_after>/*global module:false*/
module.exports = function(grunt) {

	// Project configuration.
	grunt.initConfig({
		pkg: grunt.file.readJSON( 'package.json' ),
		meta: {
			banner: '/*! Ractive - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
				'* <%= pkg.description %>\n\n' +
				'* <%= pkg.homepage %>\n' +
				'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
				' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n' +
				'\n' +
				'/*jslint eqeq: true, plusplus: true */\n' +
				'/*global document, HTMLElement */\n' +
				'\n\n',
			wrapper: {
				start: '(function ( global ) {\n\n' +
						'\'use strict\';\n\n',
				end: '\n\n// export\n' +
						'if ( typeof module !== "undefined" && module.exports ) module.exports = Ractive // Common JS\n' +
						'else if ( typeof define === "function" && define.amd ) define( function () { return Ractive } ) // AMD\n' +
						'else { global.Ractive = Ractive }\n\n' +
						'}( this ));'
			}
		},
		lint: {
			files: ['grunt.js', 'src/**/*.js'] // TODO add tests
		},
		qunit: {
			files: [ 'test/core.html', 'test/compile.html', 'test/render.html' ]
		},
		clean: {
			files: [ 'build/**/*' ]
		},
		concat: {
			runtime: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_private.js', 'src/types.js', 'src/Views.js', 'src/events.js', 'src/formatters.js', 'src/ViewModel.js', 'src/DomViews.js', 'src/TextViews.js', 'src/extend.js', 'src/modifyArray.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.runtime.js'
			},
			full: {
				options: {
					banner: '<%= meta.banner %><%= meta.wrapper.start %>',
					footer: '<%= meta.wrapper.end %>'
				},
				src: [ 'src/Ractive.js', 'src/_private.js', 'src/types.js', 'src/Views.js', 'src/events.js', 'src/compile.js', 'src/tokenize.js', 'src/formatters.js', 'src/ViewModel.js', 'src/DomViews.js', 'src/TextViews.js', 'src/extend.js', 'src/modifyArray.js', 'src/easing.js', 'src/animate.js', 'src/interpolators.js', 'src/namespaces.js' ],
				dest: 'build/Ractive.js'
			},
			runtime_legacy: {
				src: [ 'src/legacy.js', '<%= concat.runtime.dest %>' ],
				dest: 'build/Ractive-legacy.runtime.js'
			},
			full_legacy: {
				src: [ 'src/legacy.js', '<%= concat.full.dest %>' ],
				dest: 'build/Ractive-legacy.js'
			}
		},
		watch: {
			files: ['<config:lint.files>', 'package.json'],
			tasks: ['concat','min']
		},
		jshint: {
			options: {
				jshintrc: '.jshintrc'
			}
		},
		uglify: {
			runtime: {
				src: ['<%= concat.runtime.dest %>'],
				dest: 'build/Ractive.runtime.min.js'
			},
			full: {
				src: ['<%= concat.full.dest %>'],
				dest: 'build/Ractive.min.js'
			},
			runtime_legacy: {
				src: ['<%= concat.runtime_legacy.dest %>'],
				dest: 'build/Ractive-legacy.runtime.min.js'
			},
			full_legacy: {
				src: ['<%= concat.full_legacy.dest %>'],
				dest: 'build/Ractive-legacy.min.js'
			}
		},
		copy: {
			release: {
				files: [{
					expand: true,
					cwd: 'build/',
					src: [ '**/*' ],
					dest: 'release/<%= pkg.version %>/'
				}]
			},
			link: {
				files: {
					'Ractive.js': 'build/Ractive.js'
				}
			}
		}
	});

	grunt.loadNpmTasks( 'grunt-contrib-jshint' );
	grunt.loadNpmTasks( 'grunt-contrib-clean' );
	grunt.loadNpmTasks( 'grunt-contrib-qunit' );
	grunt.loadNpmTasks( 'grunt-contrib-concat' );
	grunt.loadNpmTasks( 'grunt-contrib-uglify' );
	grunt.loadNpmTasks( 'grunt-contrib-copy' );

	// Default task.
	grunt.registerTask('default', [ 'jshint', 'qunit', 'clean', 'concat', 'uglify' ]);

	grunt.registerTask( 'release', [ 'default', 'copy' ] );

};
<|endoftext|>


<commit_before>var path = require('path');

// -- Globals ------------------------------------------------------------------
var ROOT = process.cwd();

// -- Config -------------------------------------------------------------------
module.exports = function(grunt) {
    grunt.initConfig({

        pkg: grunt.file.readJSON('.alloy.json'),

        'api-build': {
            'src': 'temp',
            'dist': path.join(ROOT, 'api'),
            'theme': path.join(ROOT, '<%= pkg.dependencies["alloy-apidocs-theme"].folder %>'),
            'aui-version': '<%= pkg["version"] %>'
        },

        'api-include': {
            'all': {
                'src': ['temp/alloy-ui/src/*/js/*.js'],
                'repo': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>')
            }
        },

        'api-push': {
            'src': path.join(ROOT, 'api'),
            'dist': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>', 'api'),
            'repo': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>'),
            'branch': 'gh-pages',
            'remote': 'origin'
        },

        'api-watch': {
            'src': [path.join(ROOT, 'src'), path.join(ROOT, '<%= pkg.dependencies.yui3.folder %>', 'src')],
            'theme': path.join(ROOT, '<%= pkg.dependencies["alloy-apidocs-theme"].folder %>'),
            'aui-version': '<%= pkg["version"] %>'
        },

        build: {
            yui: {
                'src': path.join(ROOT, '<%= pkg.dependencies.yui3.folder %>', 'src'),
                'dist': path.join(ROOT, 'build'),
                'cache': true,
                'coverage': false,
                'lint': false,
                'replace-yuivar': 'Y',
                'replace-version': '<%= pkg["yuiversion"] %>',
            },
            aui: {
                'src': path.join(ROOT, 'src'),
                'dist': path.join(ROOT, 'build'),
                'cache': false,
                'coverage': true,
                'istanbul': true,
                'lint': false,
                'replace-yuivar': 'A',
                'replace-version': '<%= pkg["version"] %>',
            }
        },

        cdn: {
            combine: true,
            comboBase: 'http://cdn.alloyui.com/combo/combo.php?',
            filter: 'min',
            root: '../<%= pkg["version"] %>/'
        },

        copy: {
            api: {
                files: [
                    {
                        cwd: path.join('<%= pkg.dependencies.yui3.folder %>', 'src/'),
                        src: '**',
                        dest: 'temp/yui3/src/',
                        expand: true
                    },
                    {
                        cwd: 'src/',
                        src: '**',
                        dest: 'temp/alloy-ui/src/',
                        expand: true
                    }
                ]
            }
        },

        compress: {
            zip: {
                options: {
                    mode: 'zip',
                    pretty: true
                },
                files: [
                    {
                        src: [
                            'build/**',
                            'demos/**',
                            'src/**',
                            'LICENSE.md',
                            'README.md',
                            '.alloy.json',
                            '!.DS_Store'
                        ]
                    }
                ]
            }
        },

        clean: {
            api: [
                'api', 'temp'
            ],
            zip: [
                'alloy-<%= pkg["version"] %>.zip',
                'cdn-alloy-<%= pkg["version"] %>.zip'
            ]
        },

        create: {
            name: 'aui-test'
        },

        cssbeautifier : {
            files : [
                'src/**/*.css',
                '!src/aui-css/css/*.css'
            ]
        },

        init: {
            dependencies: '<%= pkg.dependencies %>'
        },

        jsbeautifier: {
            files: [
                'src/**/*.js',
                'grunt/*.js',
                '!src/aui-base/js/aui-aliases.js',
                '!src/aui-base/js/aui-loader.js',
                '!src/yui/js/*.js'
            ],
            options: {
                config: '.jsbeautifyrc'
            }
        },

        jshint: {
            aui: ['*.js', 'src/**/js/*.js'],
            options: {
                jshintrc: '.jshintrc'
            }
        },

        test: {
            coverage: false
        },

        watch: {
            'src': ROOT,
            'replace-yuivar': 'A',
            'replace-version': '<%= pkg["version"] %>'
        },

        zip: {
            cdn: {
                name: 'cdn-alloy-<%= pkg["version"] %>.zip'
            },
            release: {
                name: 'alloy-<%= pkg["version"] %>.zip'
            }
        }
    });

    grunt.loadTasks('tasks');

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-cssbeautifier');
    grunt.loadNpmTasks('grunt-jsbeautifier');

    grunt.registerTask('api', ['copy:api', 'api-include', 'api-build']);
    grunt.registerTask('api-deploy', ['api', 'api-push', 'clean:api']);
    grunt.registerTask('format', ['cssbeautifier', 'jsbeautifier']);
    grunt.registerTask('lint', ['jshint']);
    grunt.registerTask('release', ['clean:zip', 'all', 'zip:release']);
    grunt.registerTask('release-cdn', ['clean:zip', 'all', 'cdn', 'zip:cdn', 'build:aui']);
};<commit_msg>AUI-1296 Grunt "all" task does not exist anymore<commit_after>var path = require('path');

// -- Globals ------------------------------------------------------------------
var ROOT = process.cwd();

// -- Config -------------------------------------------------------------------
module.exports = function(grunt) {
    grunt.initConfig({

        pkg: grunt.file.readJSON('.alloy.json'),

        'api-build': {
            'src': 'temp',
            'dist': path.join(ROOT, 'api'),
            'theme': path.join(ROOT, '<%= pkg.dependencies["alloy-apidocs-theme"].folder %>'),
            'aui-version': '<%= pkg["version"] %>'
        },

        'api-include': {
            'all': {
                'src': ['temp/alloy-ui/src/*/js/*.js'],
                'repo': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>')
            }
        },

        'api-push': {
            'src': path.join(ROOT, 'api'),
            'dist': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>', 'api'),
            'repo': path.join(ROOT, '<%= pkg.dependencies["alloyui.com"].folder %>'),
            'branch': 'gh-pages',
            'remote': 'origin'
        },

        'api-watch': {
            'src': [path.join(ROOT, 'src'), path.join(ROOT, '<%= pkg.dependencies.yui3.folder %>', 'src')],
            'theme': path.join(ROOT, '<%= pkg.dependencies["alloy-apidocs-theme"].folder %>'),
            'aui-version': '<%= pkg["version"] %>'
        },

        build: {
            yui: {
                'src': path.join(ROOT, '<%= pkg.dependencies.yui3.folder %>', 'src'),
                'dist': path.join(ROOT, 'build'),
                'cache': true,
                'coverage': false,
                'lint': false,
                'replace-yuivar': 'Y',
                'replace-version': '<%= pkg["yuiversion"] %>',
            },
            aui: {
                'src': path.join(ROOT, 'src'),
                'dist': path.join(ROOT, 'build'),
                'cache': false,
                'coverage': true,
                'istanbul': true,
                'lint': false,
                'replace-yuivar': 'A',
                'replace-version': '<%= pkg["version"] %>',
            }
        },

        cdn: {
            combine: true,
            comboBase: 'http://cdn.alloyui.com/combo/combo.php?',
            filter: 'min',
            root: '../<%= pkg["version"] %>/'
        },

        copy: {
            api: {
                files: [
                    {
                        cwd: path.join('<%= pkg.dependencies.yui3.folder %>', 'src/'),
                        src: '**',
                        dest: 'temp/yui3/src/',
                        expand: true
                    },
                    {
                        cwd: 'src/',
                        src: '**',
                        dest: 'temp/alloy-ui/src/',
                        expand: true
                    }
                ]
            }
        },

        compress: {
            zip: {
                options: {
                    mode: 'zip',
                    pretty: true
                },
                files: [
                    {
                        src: [
                            'build/**',
                            'demos/**',
                            'src/**',
                            'LICENSE.md',
                            'README.md',
                            '.alloy.json',
                            '!.DS_Store'
                        ]
                    }
                ]
            }
        },

        clean: {
            api: [
                'api', 'temp'
            ],
            zip: [
                'alloy-<%= pkg["version"] %>.zip',
                'cdn-alloy-<%= pkg["version"] %>.zip'
            ]
        },

        create: {
            name: 'aui-test'
        },

        cssbeautifier : {
            files : [
                'src/**/*.css',
                '!src/aui-css/css/*.css'
            ]
        },

        init: {
            dependencies: '<%= pkg.dependencies %>'
        },

        jsbeautifier: {
            files: [
                'src/**/*.js',
                'grunt/*.js',
                '!src/aui-base/js/aui-aliases.js',
                '!src/aui-base/js/aui-loader.js',
                '!src/yui/js/*.js'
            ],
            options: {
                config: '.jsbeautifyrc'
            }
        },

        jshint: {
            aui: ['*.js', 'src/**/js/*.js'],
            options: {
                jshintrc: '.jshintrc'
            }
        },

        test: {
            coverage: false
        },

        watch: {
            'src': ROOT,
            'replace-yuivar': 'A',
            'replace-version': '<%= pkg["version"] %>'
        },

        zip: {
            cdn: {
                name: 'cdn-alloy-<%= pkg["version"] %>.zip'
            },
            release: {
                name: 'alloy-<%= pkg["version"] %>.zip'
            }
        }
    });

    grunt.loadTasks('tasks');

    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-cssbeautifier');
    grunt.loadNpmTasks('grunt-jsbeautifier');

    grunt.registerTask('api', ['copy:api', 'api-include', 'api-build']);
    grunt.registerTask('api-deploy', ['api', 'api-push', 'clean:api']);
    grunt.registerTask('format', ['cssbeautifier', 'jsbeautifier']);
    grunt.registerTask('lint', ['jshint']);
    grunt.registerTask('release', ['clean:zip', 'build', 'zip:release']);
    grunt.registerTask('release-cdn', ['clean:zip', 'build', 'cdn', 'zip:cdn', 'build:aui']);
};<|endoftext|>