Permalink
Browse files

use babel-presets-latest

  • Loading branch information...
1 parent 659d8f3 commit 0b7d70880920f1704052f6e1422a9c6848c310e3 @Diablohu committed Nov 16, 2016
View
@@ -25,6 +25,7 @@
"babel-core": "^6.0.12",
"babel-plugin-transform-es3-member-expression-literals": "^6.1.18",
"babel-plugin-transform-minify-booleans": "^6.1.18",
+ "babel-preset-latest": "^6.16.0",
"babel-preset-stage-0": "^6.1.18",
"gulp": "^3.9.0",
"gulp-babel": "^6.0.0",
Oops, something went wrong.
View
@@ -8972,91 +8972,85 @@ TablelistShips.prototype.append_item = function (ship_data, header_index) {
return tr;
};
-TablelistShips.prototype.append_all_items = function () {
- function _do(i, j) {
- var _this15 = this;
+TablelistShips.prototype.create_title_checkbox = function (checkbox_id, index) {
+ return $('<input type="checkbox" id="' + checkbox_id + '"/>').prop('disabled', _g.data['ship_type_order'][index]['donotcompare'] ? !0 : !1).data('ships', $()).on({
+ 'change': function change() {
+ checkbox.data('ships').filter(':visible').each(function (_index, element) {
+ $(element).data('checkbox').prop('checked', checkbox.prop('checked')).trigger('change', [!0]);
+ });
+ },
+ 'docheck': function docheck() {
+ var trs = checkbox.data('ships').filter(':visible'),
+ checked = trs.filter('[compare-checked=true]');
+ if (!checked.length) {
+ checkbox.prop({
+ 'checked': !1,
+ 'indeterminate': !1
+ });
+ } else if (checked.length < trs.length) {
+ checkbox.prop({
+ 'checked': !1,
+ 'indeterminate': !0
+ });
+ } else {
+ checkbox.prop({
+ 'checked': !0,
+ 'indeterminate': !1
+ });
+ }
+ }
+ });
+};
+TablelistShips.prototype.append_all_items = function () {
+ var _do = function _do(i, j) {
if (_g.data.ship_id_by_type[i]) {
if (!j) {
- var k;
-
- var _index;
-
- (function () {
- var data_shiptype = void 0,
- checkbox = void 0;
+ var data_shiptype = void 0,
+ _checkbox = void 0;
- if (_typeof(_g.ship_type_order[i]) == 'object') {
- data_shiptype = _g.data.ship_types[_g.ship_type_order[i][0]];
- } else {
- data_shiptype = _g.data.ship_types[_g.ship_type_order[i]];
- }
-
- var checkbox_id = Tablelist.genId();
-
- _this15.last_item = $('<tr class="typetitle" data-trindex="' + _this15.trIndex + '">' + '<th colspan="' + (_this15.columns.length + 1) + '">' + '<label class="checkbox" for="' + checkbox_id + '">' + _g.data['ship_type_order'][i]['name']['zh_cn'] + (_g.data['ship_type_order'][i]['name']['zh_cn'] == data_shiptype['full_zh'] ? '<small>[' + data_shiptype['code'] + ']</small>' : '') + '</label></th></tr>').appendTo(_this15.dom.tbody);
- _this15.trIndex++;
+ if (_typeof(_g.ship_type_order[i]) == 'object') {
+ data_shiptype = _g.data.ship_types[_g.ship_type_order[i][0]];
+ } else {
+ data_shiptype = _g.data.ship_types[_g.ship_type_order[i]];
+ }
- k = 0;
+ var checkbox_id = Tablelist.genId();
- while (k < _this15.flexgrid_empty_count) {
- _index = _this15.trIndex + _g.data.ship_id_by_type[i].length + k;
+ undefined.last_item = $('<tr class="typetitle" data-trindex="' + undefined.trIndex + '">' + '<th colspan="' + (undefined.columns.length + 1) + '">' + '<label class="checkbox" for="' + checkbox_id + '">' + _g.data['ship_type_order'][i]['name']['zh_cn'] + (_g.data['ship_type_order'][i]['name']['zh_cn'] == data_shiptype['full_zh'] ? '<small>[' + data_shiptype['code'] + ']</small>' : '') + '</label></th></tr>').appendTo(undefined.dom.tbody);
+ undefined.trIndex++;
- $('<tr class="empty" data-trindex="' + _index + '" data-shipid/>').appendTo(_this15.dom.tbody);
- k++;
- }
+ var k = 0;
+ while (k < undefined.flexgrid_empty_count) {
+ var _index = undefined.trIndex + _g.data.ship_id_by_type[i].length + k;
+ $('<tr class="empty" data-trindex="' + _index + '" data-shipid/>').appendTo(undefined.dom.tbody);
+ k++;
+ }
- checkbox = $('<input type="checkbox" id="' + checkbox_id + '"/>').prop('disabled', _g.data['ship_type_order'][i]['donotcompare'] ? !0 : !1).on({
- 'change': function change() {
- checkbox.data('ships').filter(':visible').each(function (index, element) {
- $(element).data('checkbox').prop('checked', checkbox.prop('checked')).trigger('change', [!0]);
- });
- },
- 'docheck': function docheck() {
- var trs = checkbox.data('ships').filter(':visible'),
- checked = trs.filter('[compare-checked=true]');
- if (!checked.length) {
- checkbox.prop({
- 'checked': !1,
- 'indeterminate': !1
- });
- } else if (checked.length < trs.length) {
- checkbox.prop({
- 'checked': !1,
- 'indeterminate': !0
- });
- } else {
- checkbox.prop({
- 'checked': !0,
- 'indeterminate': !1
- });
- }
- }
- }).data('ships', $()).prependTo(_this15.last_item.find('th'));
+ _checkbox = undefined.create_title_checkbox(checkbox_id, i);
- _this15.header_checkbox[i] = checkbox;
- })();
+ undefined.header_checkbox[i] = _checkbox;
}
- this.append_item(_g.data.ships[_g.data.ship_id_by_type[i][j]], i);
+ undefined.append_item(_g.data.ships[_g.data.ship_id_by_type[i][j]], i);
setTimeout(function () {
if (j >= _g.data.ship_id_by_type[i].length - 1) {
- this.trIndex += this.flexgrid_empty_count;
+ undefined.trIndex += undefined.flexgrid_empty_count;
_do(i + 1, 0);
} else {
_do(i, j + 1);
}
- }.bind(this), 0);
+ }, 0);
} else {
- this.mark_high();
- this.thead_redraw();
- _frame.app_main.loaded('tablelist_' + this._index, !0);
+ undefined.mark_high();
+ undefined.thead_redraw();
+ _frame.app_main.loaded('tablelist_' + undefined._index, !0);
- delete this.last_item;
+ delete undefined.last_item;
}
- }
- _do = _do.bind(this);
+ };
+
_do(0, 0);
};
Oops, something went wrong.
@@ -292,22 +292,8 @@
}
// <script>
- } else if (typeof window !== "undefined" || typeof self !== "undefined") {
- // Prefer window over self for add-on scripts. Use self for
- // non-windowed contexts.
- var global = typeof window !== "undefined" ? window : self;
-
- // Get the `window` object, save the previous Q global
- // and initialize Q as a global.
- var previousQ = global.Q;
- global.Q = definition();
-
- // Add a noConflict function so Q can be removed from the
- // global namespace.
- global.Q.noConflict = function () {
- global.Q = previousQ;
- return this;
- };
+ } else if (typeof self !== "undefined") {
+ self.Q = definition();
} else {
throw new Error("This environment was not anticipated by Q. Please file a bug.");
@@ -2273,10 +2259,6 @@ Promise.prototype.nodeify = function (nodeback) {
}
};
-Q.noConflict = function() {
- throw new Error("Q.noConflict only works when Q is used as a global");
-};
-
// All code before this point will be filtered from stack traces.
var qEndingLine = captureLine();
Oops, something went wrong.
View
@@ -49,7 +49,7 @@ function parseKoalaJS(){
};
-gulp.task('WhoCallsTheFleet-js-base', function(){
+gulp.task('js-base', function(){
return gulp.src(parseKoalaJS( rootSource, 'js-base.js' ))
.pipe(concat('js-base.js'))
.pipe(uglify())
@@ -71,7 +71,7 @@ gulp.task('WhoCallsTheFleet-js-base', function(){
.pipe(gulp.dest( path.join( root, 'app', 'assets' ) ));
});
-gulp.task('WhoCallsTheFleet-js-app', function(){
+gulp.task('js-app', function(){
return gulp.src(parseKoalaJS( rootSource, 'js-app.js' ))
.pipe(concat('js-app.js'))
.pipe(babel({
@@ -80,8 +80,7 @@ gulp.task('WhoCallsTheFleet-js-app', function(){
'compact': false,
'ast': false,
"presets": [
- "es2015",
- "stage-0"
+ rootRequire('babel-preset-latest')
],
"plugins": [
"transform-minify-booleans"
@@ -91,14 +90,14 @@ gulp.task('WhoCallsTheFleet-js-app', function(){
.pipe(gulp.dest( path.join( root, 'app', 'assets' ) ));
});
-gulp.task('WhoCallsTheFleet-js-output', function(){
+gulp.task('js-output', function(){
return gulp.src(parseKoalaJS( rootOutput, 'js-source', 'output.js' ))
.pipe(concat('output.js'))
//.pipe(uglify())
.pipe(gulp.dest( path.join( rootOutput, 'js-output' ) ));
});
-gulp.task('WhoCallsTheFleet-Web-js', function(){
+gulp.task('Web-js', function(){
return gulp.src(parseKoalaJS( rootOutput, 'assets-source', 'js.js' ))
.pipe(concat('js.js'))
.pipe(babel({
@@ -107,8 +106,8 @@ gulp.task('WhoCallsTheFleet-Web-js', function(){
'compact': false,
'ast': false,
"presets": [
- "es2015",
- "stage-0"
+ rootRequire('babel-preset-latest')//,
+ //"stage-0"
],
"plugins": [
"transform-minify-booleans"
@@ -120,7 +119,7 @@ gulp.task('WhoCallsTheFleet-Web-js', function(){
.pipe(gulp.dest( path.join( rootOutput, 'assets-output' ) ));
});
-gulp.task('WhoCallsTheFleet-Web-js-libs', function(){
+gulp.task('Web-js-libs', function(){
return gulp.src(parseKoalaJS( rootOutput, 'assets-source', 'libs.js' ))
.pipe(concat('libs.js'))
.pipe(gulp.dest( path.join( rootOutput, 'assets-output' ) ))
@@ -129,7 +128,7 @@ gulp.task('WhoCallsTheFleet-Web-js-libs', function(){
.pipe(gulp.dest( path.join( rootOutput, 'assets-output' ) ));
});
-gulp.task('WhoCallsTheFleet-Web-js-lib-canvas', function(){
+gulp.task('Web-js-lib-canvas', function(){
return gulp.src(parseKoalaJS( rootOutput, 'assets-source', 'lib.canvas.js' ))
.pipe(concat('lib.canvas.js'))
.pipe(gulp.dest( path.join( rootOutput, 'assets-output' ) ))
@@ -138,7 +137,7 @@ gulp.task('WhoCallsTheFleet-Web-js-lib-canvas', function(){
.pipe(gulp.dest( path.join( rootOutput, 'assets-output' ) ));
});
-gulp.task('WhoCallsTheFleet-css-app', function(){
+gulp.task('css-app', function(){
let f = path.join( rootSource, 'css-app.less' );
return gulp.src(f)
.pipe(watchLess(f, {verbose: true}, function(){
@@ -168,7 +167,7 @@ gulp.task('WhoCallsTheFleet-css-app', function(){
*/
});
-gulp.task('WhoCallsTheFleet-css-base', function(){
+gulp.task('css-base', function(){
let f = path.join( rootSource, 'css-base.less' );
return gulp.src(f)
.pipe(watchLess(f, {verbose: true}, function(){
@@ -187,7 +186,7 @@ gulp.task('WhoCallsTheFleet-css-base', function(){
*/
});
-gulp.task('WhoCallsTheFleet-Web-css', function(){
+gulp.task('Web-css', function(){
let f = path.join( rootOutput, 'assets-source', 'css.less' );
return gulp.src(f)
.pipe(watchLess(f, {verbose: true}, function(){
@@ -267,50 +266,50 @@ function lessCompile( file, outputPath, options ){
}
}
-gulp.task('WhoCallsTheFleet-watch', function(){
+gulp.task('watch', function(){
gulp.watch(
path.join( rootSource, 'js-app', '**/*.js' ),
- ['WhoCallsTheFleet-js-app', 'WhoCallsTheFleet-Web-js']
+ ['js-app', 'Web-js']
);
gulp.watch(
path.join( rootSource, 'KanColle-JS-Kit', '**/*.js' ),
- ['WhoCallsTheFleet-js-app', 'WhoCallsTheFleet-Web-js']
+ ['js-app', 'Web-js']
);
gulp.watch(
path.join( rootSource, 'nw.js-base-framework', '**/*.js' ),
- ['WhoCallsTheFleet-js-base', 'WhoCallsTheFleet-js-app', 'WhoCallsTheFleet-Web-js']
+ ['js-base', 'js-app', 'Web-js']
);
gulp.watch(
path.join( rootSource, 'libs', '**/*.js' ),
- ['WhoCallsTheFleet-js-app', 'WhoCallsTheFleet-Web-js-libs']
+ ['js-app', 'Web-js-libs']
);
gulp.watch(
path.join( rootSource, 'js-app', 'canvas', '**/*.js' ),
- ['WhoCallsTheFleet-Web-js-lib-canvas']
+ ['Web-js-lib-canvas']
);
//gulp.watch(
// path.join( rootSource, '**/*.js' ),
- // ['WhoCallsTheFleet-js-base', 'WhoCallsTheFleet-js-app', 'WhoCallsTheFleet-Web-js', 'WhoCallsTheFleet-Web-js-libs']
+ // ['js-base', 'js-app', 'Web-js', 'Web-js-libs']
// );
gulp.watch(
path.join( rootOutput, 'js-source', '**/*.js' ),
- ['WhoCallsTheFleet-js-output']
+ ['js-output']
);
//gulp.watch(
// path.join( rootSource, '**/*.less' ),
- // ['WhoCallsTheFleet-css-app', 'WhoCallsTheFleet-css-base', 'WhoCallsTheFleet-Web-css']
+ // ['css-app', 'css-base', 'Web-css']
// );
});
gulp.task('default',[
- 'WhoCallsTheFleet-js-base',
- 'WhoCallsTheFleet-js-app',
- 'WhoCallsTheFleet-js-output',
- 'WhoCallsTheFleet-Web-js',
- 'WhoCallsTheFleet-Web-js-libs',
- 'WhoCallsTheFleet-Web-js-lib-canvas',
- 'WhoCallsTheFleet-css-base',
- 'WhoCallsTheFleet-css-app',
- 'WhoCallsTheFleet-Web-css',
- 'WhoCallsTheFleet-watch'
+ 'js-base',
+ 'js-app',
+ 'js-output',
+ 'Web-js',
+ 'Web-js-libs',
+ 'Web-js-lib-canvas',
+ 'css-base',
+ 'css-app',
+ 'Web-css',
+ 'watch'
]);
View
@@ -57,4 +57,4 @@
// @koala-prepend "js-app/elements/tablelist-entities.js"
// @koala-prepend "js-app/elements/tablelist-entities-full.js"
// @koala-prepend "js-app/elements/tablelist-equipments-full.js"
-// @koala-prepend "js-app/elements/tablelist-ships-full.js"
+// @koala-prepend "js-app/elements/tablelist-ships-full.js"
Oops, something went wrong.

0 comments on commit 0b7d708

Please sign in to comment.