Skip to content

Commit

Permalink
Move ids file to svg subdirectory, since it's SVG specific.
Browse files Browse the repository at this point in the history
  • Loading branch information
artasparks committed Jun 9, 2016
1 parent 7898257 commit 99a30a9
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 178 deletions.
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/board.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ glift.displays.board.Display.prototype = {
var svg = this.svg_;
var divId = this.divId();
var svglib = glift.displays.svg;
var idGen = glift.displays.ids.generator(divId);
var idGen = glift.displays.svg.ids.gen(divId);
var goBox = env.goBoardBox;
if (svg === null) {
throw new Error('Base SVG object not initialized.');
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/board_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ goog.require('glift.displays.svg');
* fill color and a border.
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.orientation.BoundingBox} goBox The bounding box of the go board.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/board_labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ goog.require('glift.displays.board');
* on the raw board (rather than on stones).
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ goog.require('glift.displays.board');
* Create transparent buttons that overlay each intersection.
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
*/
glift.displays.board.buttons = function(svg, idGen, boardPoints) {
Expand Down
8 changes: 5 additions & 3 deletions src/glift-ui/displays/board/intersections.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ glift.displays.board.Intersections = function(
this.theme = theme;
this.rotation = rotation;
this.boardPoints = boardPoints;
this.idGen = glift.displays.ids.generator(this.divId);
this.idGen = glift.displays.svg.ids.gen(this.divId);

/**
* Defined during events.
Expand Down Expand Up @@ -261,11 +261,13 @@ glift.displays.board.Intersections.prototype = {
var child = children[i]
var pt = child.data();
var starpoint =
this.svg.child(idGen.starpointGroup()).child(idGen.starpoint(pt))
this.svg.child(idGen.starpointGroup()).child(idGen.starpoint(
/** @type {!glift.Point} */ (pt)))
if (starpoint) {
starpoint.setAttr('opacity', 1).updateAttrInDom('opacity');
}
var line = this.svg.child(idGen.lineGroup()).child(idGen.line(pt))
var line = this.svg.child(idGen.lineGroup()).child(idGen.line(
/** @type {!glift.Point} */ (pt)))
if (line) {
line.setAttr('opacity', 1).updateAttrInDom('opacity');
}
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ goog.require('glift.displays.board');
* on the raw board (rather than on stones).
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/marks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* container.
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
*/
glift.displays.board.markContainer = function(svg, idGen) {
svg.append(glift.displays.svg.group().setId(idGen.markGroup()));
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/board/starpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* points are used
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down
4 changes: 2 additions & 2 deletions src/glift-ui/displays/board/stones.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* all exist at the time of GoBoard creation.
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down Expand Up @@ -32,7 +32,7 @@ glift.displays.board.stones = function(svg, idGen, boardPoints, theme) {
* only created if the theme has a shadow.
*
* @param {!glift.displays.svg.SvgObj} svg Base svg obj
* @param {!glift.displays.ids.Generator} idGen The ID generator for SVG.
* @param {!glift.displays.svg.IdGenerator} idGen The ID generator for SVG.
* @param {!glift.displays.BoardPoints} boardPoints Board points object.
* @param {!glift.themes.base} theme The theme object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/glift-ui/displays/icons/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ glift.displays.icons.IconBar = function(options) {
this.vertMargin = this.theme.icons.vertMargin;
this.horzMargin = this.theme.icons.horzMargin;
this.svg = undefined; // initialized by draw
this.idGen = glift.displays.ids.generator(this.divId);
this.idGen = glift.displays.svg.ids.gen(this.divId);

// Data related to tool tips.
this.tooltipTimer = undefined;
Expand Down
6 changes: 3 additions & 3 deletions src/glift-ui/displays/icons/icon_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ glift.displays.icons.IconSelector.prototype = {
.setId(columnId + '_svg')
.setAttr('height', '100%')
.setAttr('width', '100%');
var idGen = glift.displays.ids.generator(columnId);
var idGen = glift.displays.svg.ids.gen(columnId);
var container = svglib.group().setId(idGen.iconGroup());
svg.append(container);
for (var i = 0, len = transforms.length; i < len; i++) {
Expand Down Expand Up @@ -121,7 +121,7 @@ glift.displays.icons.IconSelector.prototype = {
var svglib = glift.displays.svg;
for (var i = 0; i < this.iconList.length; i++) {
var svg = this.svgColumnList[i];
var idGen = glift.displays.ids.generator(this.columnIdList[i]);
var idGen = glift.displays.svg.ids.gen(this.columnIdList[i]);
var iconColumn = this.iconList[i];
var container = svglib.group().setId(idGen.buttonGroup());
svg.append(container);
Expand Down Expand Up @@ -150,7 +150,7 @@ glift.displays.icons.IconSelector.prototype = {

setIconEvents: function(eventName, func) {
for (var i = 0; i < this.iconList.length; i++) {
var idGen = glift.displays.ids.generator(this.columnIdList[i]);
var idGen = glift.displays.svg.ids.gen(this.columnIdList[i]);
for (var j = 0; j < this.iconList[i].length; j++) {
var icon = this.iconList[i][j];
var buttonId = idGen.button(icon.iconName);
Expand Down
159 changes: 0 additions & 159 deletions src/glift-ui/displays/ids.js

This file was deleted.

Loading

0 comments on commit 99a30a9

Please sign in to comment.