Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruppler committed Jun 25, 2016
2 parents 2cb0992 + c7349eb commit 49d663f
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 164 deletions.
1 change: 1 addition & 0 deletions css/board.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
opacity: 0;
border-radius: 0.25vmin;
box-shadow: $shadow1;
transform: translateX(100%);
transition: all $time-smooth $natural;
}
}
Expand Down
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/style.css

Large diffs are not rendered by default.

72 changes: 9 additions & 63 deletions dist/js/app.js

Large diffs are not rendered by default.

64 changes: 34 additions & 30 deletions dist/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,31 @@ The **share** menu in the upper-right corner allows you to do the following:
- Unless a road is built


- Embed code generator
- In the share menu
- Open new window (embed.html#C0mpr3s5edPTN)
- Resize window to set iframe aspect ratio
- Aspect ratio inputs update onResize
- Embed code updates onResize
- Fluid size
- Export board as .png
- Redraw board using canvas


- Edit Mode Improvements
- Automatic line numbers
- Insert line numbers after Enter keypress
- Insert if missing
- Correct if wrong
- Automatically insert closing braces and quotes
- [], "", {}
- Auto formatting
- Styles
- Verbose
- Insert all stone types (before place, after slide)
- Insert all slide and drop counts
- Minimal
- Opposite of Verbose
- Pad line numbers
- Pad between plies based on longest move.ply1
- Automatically insert Tak marks (')
- "Tak" detection
- Board.find_road(player, ply)
- Highlight squares composing road
- Board.possible_plys(player)


- Sidebar menu
Expand All @@ -80,6 +98,15 @@ The **share** menu in the upper-right corner allows you to do the following:
- About (readme.html)


- Embed code generator
- In the share menu
- Open new window (embed.html#C0mpr3s5edPTN)
- Resize window to set iframe aspect ratio
- Aspect ratio inputs update onResize
- Embed code updates onResize
- Fluid size


- Editing via GUI (i.e. easy mode)
- Allow for easy live transcription and puzzle completion
- Toggle switch, or enabled only if result is blank?
Expand All @@ -91,29 +118,6 @@ The **share** menu in the upper-right corner allows you to do the following:
- Inputs provide options or format validation


- Edit Mode Improvements
- Automatic line numbers
- Insert line numbers after Enter keypress
- Insert if missing
- Correct if wrong
- Automatically insert closing braces and quotes
- [], "", {}
- Auto formatting
- Styles
- Verbose
- Insert all stone types (before place, after slide)
- Insert all slide and drop counts
- Minimal
- Opposite of Verbose
- Pad line numbers
- Pad between plies based on longest move.ply1
- Automatically insert Tak marks (')
- "Tak" detection
- Board.find_road(player, ply)
- Highlight squares composing road
- Board.possible_plys(player)


## Legal
© 2016 Craig Laparo

Expand Down
52 changes: 26 additions & 26 deletions js/app/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ define(['app/config', 'app/messages', 'i18n!nls/main', 'lodash'], function (conf

Piece.prototype.render = function () {
var that = this
, square = this.square
, location, captive_offset = 6;

if (this.board.defer_render) {
Expand Down Expand Up @@ -195,13 +196,35 @@ define(['app/config', 'app/messages', 'i18n!nls/main', 'lodash'], function (conf
this.$captive.css('transform', 'translateY('+(-captive_offset*(this.height - 1)/0.075) + '%)');
} else {
this.$view.removeClass('immovable');
this.$captive.css('transform', 'none');
this.$captive.css('transform', '');
}

if (this.square && !this.$view.closest('html').length) {
this.board.$pieces.place(this.$view);
}

square.$view.removeClass('p1 p2').addClass('p'+this.player);
_.each(direction_name, function (dn, d) {
if (square.neighbors[d]) {
if (
that.stone != 'S' &&
square.neighbors[d].piece &&
square.neighbors[d].piece.player == that.player &&
square.neighbors[d].piece.stone != 'S'
) {
square.$view.addClass(dn);
square.neighbors[d].$view.addClass(direction_name[opposite_direction[d]]);
} else {
square.$view.removeClass(dn);
square.neighbors[d].$view.removeClass(direction_name[opposite_direction[d]]);
}
} else if (that.stone != 'S') {
square.$view.addClass(dn);
} else {
square.$view.removeClass(dn);
}
});

this.needs_updated = false;

return this.$view;
Expand Down Expand Up @@ -241,7 +264,7 @@ define(['app/config', 'app/messages', 'i18n!nls/main', 'lodash'], function (conf
return new Piece(that.board, player);
})
),
false, true
false
);
};

Expand All @@ -263,34 +286,11 @@ define(['app/config', 'app/messages', 'i18n!nls/main', 'lodash'], function (conf
piece.row_i = this.row_i;
piece.set_captives(captives || piece.captives);
piece.render();

if (this.$view) {
this.$view.addClass('p'+piece.player);
_.each(direction_name, function (dn, d) {
if (that.neighbors[d]) {
if (
piece.stone != 'S' &&
that.neighbors[d].piece &&
that.neighbors[d].piece.player == piece.player &&
that.neighbors[d].piece.stone != 'S'
) {
that.$view.addClass(dn);
that.neighbors[d].$view.addClass(direction_name[opposite_direction[d]]);
} else {
that.$view.removeClass(dn);
that.neighbors[d].$view.removeClass(direction_name[opposite_direction[d]]);
}
} else if (piece.stone != 'S') {
that.$view.addClass(dn);
} else {
that.$view.removeClass(dn);
}
})
}
} else if (previous_piece) {
previous_piece.render();

if (this.$view) {
this.$view.removeClass(_.values(direction_name).join(' '));
_.each(direction_name, function (dn, d) {
if (that.neighbors[d]) {
that.$view.removeClass(dn);
Expand Down
2 changes: 1 addition & 1 deletion js/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

define(['lodash'], function (_) {
return {
play_speed: 45
play_speed: 40
};
});
25 changes: 15 additions & 10 deletions js/app/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,22 +428,27 @@ define(['app/grammar', 'app/messages', 'i18n!nls/main', 'lodash', 'lzstring'], f
return this;
};

Game.prototype.parse = function (string, is_compressed) {
var decompressed, header, body, i, file, tag, missing_tags, tps;
Game.prototype.parse = function (input, is_from_URL) {
var plaintext, header, body, i, file, tag, missing_tags, tps;

if (is_compressed) {
decompressed = decompress(string);
if (decompressed == this.ptn) {
if (is_from_URL) {
if (/^[A-Za-z0-9$+-]+$/.test(input)) {
plaintext = decompress(input);
} else {
plaintext = decodeURIComponent(input);
input = compress(plaintext);
}
if (plaintext == this.ptn) {
return false;
} else {
this.ptn = decompressed;
this.ptn_compressed = string;
this.ptn = plaintext;
this.ptn_compressed = input;
}
} else if (string == this.ptn) {
} else if (input == this.ptn) {
return false;
} else {
this.ptn = string;
this.ptn_compressed = compress(string);
this.ptn = input;
this.ptn_compressed = compress(input);
}

_.invokeMap(this.callbacks_start, 'call', this, this);
Expand Down
3 changes: 2 additions & 1 deletion js/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ requirejs({locale: navigator.language}, [
' ' + game.config.date
: ''
)
+ '.ptn'
+ '.ptn',
true
);
}).attr('title', t.Download);

Expand Down
64 changes: 34 additions & 30 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,31 @@ The **share** menu in the upper-right corner allows you to do the following:
- Unless a road is built


- Embed code generator
- In the share menu
- Open new window (embed.html#C0mpr3s5edPTN)
- Resize window to set iframe aspect ratio
- Aspect ratio inputs update onResize
- Embed code updates onResize
- Fluid size
- Export board as .png
- Redraw board using canvas


- Edit Mode Improvements
- Automatic line numbers
- Insert line numbers after Enter keypress
- Insert if missing
- Correct if wrong
- Automatically insert closing braces and quotes
- [], "", {}
- Auto formatting
- Styles
- Verbose
- Insert all stone types (before place, after slide)
- Insert all slide and drop counts
- Minimal
- Opposite of Verbose
- Pad line numbers
- Pad between plies based on longest move.ply1
- Automatically insert Tak marks (')
- "Tak" detection
- Board.find_road(player, ply)
- Highlight squares composing road
- Board.possible_plys(player)


- Sidebar menu
Expand All @@ -80,6 +98,15 @@ The **share** menu in the upper-right corner allows you to do the following:
- About (readme.html)


- Embed code generator
- In the share menu
- Open new window (embed.html#C0mpr3s5edPTN)
- Resize window to set iframe aspect ratio
- Aspect ratio inputs update onResize
- Embed code updates onResize
- Fluid size


- Editing via GUI (i.e. easy mode)
- Allow for easy live transcription and puzzle completion
- Toggle switch, or enabled only if result is blank?
Expand All @@ -91,29 +118,6 @@ The **share** menu in the upper-right corner allows you to do the following:
- Inputs provide options or format validation


- Edit Mode Improvements
- Automatic line numbers
- Insert line numbers after Enter keypress
- Insert if missing
- Correct if wrong
- Automatically insert closing braces and quotes
- [], "", {}
- Auto formatting
- Styles
- Verbose
- Insert all stone types (before place, after slide)
- Insert all slide and drop counts
- Minimal
- Opposite of Verbose
- Pad line numbers
- Pad between plies based on longest move.ply1
- Automatically insert Tak marks (')
- "Tak" detection
- Board.find_road(player, ply)
- Highlight squares composing road
- Board.possible_plys(player)


## Legal
© 2016 Craig Laparo

Expand Down

0 comments on commit 49d663f

Please sign in to comment.