Skip to content

Commit

Permalink
- Removed echo of token in circleci config and updated nwjs version.
Browse files Browse the repository at this point in the history
nw-app:
- Added xsd xmlns to Readme component versions.

page-editor:
- Now it is possible to edit confidences of Property, TextEquiv, Coords and Baseline.
- Added support for other region types: ImageRegion, SeparatorRegion and CustomRegion.
- Fixed disablings of All mode.
- Fixed bug in lower right panel when exiting property modal.
- Removed the property tags.

page-canvas:
- Exporting isValidCoords function.
- Changes to support other region types: ImageRegion, SeparatorRegion and CustomRegion.

page2svg.xslt, svg2page.xslt:
- Support for CustomRegion.
  • Loading branch information
mauvilsa committed Mar 17, 2020
1 parent 6110d08 commit f373096
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 75 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
docker:
- image: cibuilds/github:0.12.0
environment:
VERSION_NWJS: v0.35.1
VERSION_NWJS: v0.44.4
steps:
- checkout
- run:
Expand All @@ -24,7 +24,6 @@ jobs:
cp -r *.md css examples html js node_modules package.json xsd xslt nw-page-editor-win-x64
mkdir artifacts
zip -qr artifacts/nw-page-editor-win-x64.zip nw-page-editor-win-x64
echo ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./artifacts/
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ./artifacts/
workflows:
version: 2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

nw-page-editor - Simple app for visual editing of Page XML files.

Version: 2020.03.03
Version: 2020.03.17


# Description
Expand Down
12 changes: 3 additions & 9 deletions css/page-editor.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* CSS styles for nw-page-editor.
*
* @version $Version: 2019.08.12$
* @version $Version: 2020.03.17$
* @author Mauricio Villegas <mauvilsa@upv.es>
* @copyright Copyright(c) 2015-present, Mauricio Villegas <mauvilsa@upv.es>
* @license MIT License
Expand Down Expand Up @@ -162,10 +162,10 @@ body {

#drawer .radio-set {
float: right;
width: 35%;
width: 45%;
}
#drawer .radio-set:first-of-type {
width: 65%;
width: 55%;
}

#table-rows input,
Expand Down Expand Up @@ -199,7 +199,6 @@ body {
.hide-text-edit #textinfo,
.hide-img image,
.hide-marker-start #xpg_polystart > polygon,
.hide-prop-tag .prop-tag,
.hide-text-reg .TextRegion > .TextEquiv,
.hide-text-line .TextLine > .TextEquiv,
.hide-text-word .Word > .TextEquiv,
Expand All @@ -217,11 +216,6 @@ body {
stroke-opacity: 0;
}

.prop-tag {
fill: red;
font-weight: bold;
}

#xpg.highlight .selectable-member .Coords,
#xpg.highlight .editable .Coords {
fill-opacity: 0.5;
Expand Down
19 changes: 14 additions & 5 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
- Main HTML file of nw-page-editor.
-
- @version $Version: 2019.07.25$
- @version $Version: 2020.03.17$
- @author Mauricio Villegas <mauricio_ville@yahoo.com>
- @copyright Copyright(c) 2015-present, Mauricio Villegas <mauricio_ville@yahoo.com>
- @license MIT License
Expand Down Expand Up @@ -91,8 +91,15 @@
<label id="wordMode"><input class="mousetrap" type="radio" name="mode1" value="word"/> Word</label>
<label id="glyphMode"><input class="mousetrap" type="radio" name="mode1" value="glyph"/> Glyph</label>
<label id="tabMode"><input class="mousetrap" type="radio" name="mode1" value="table"/> Table</label>
<label id="groupMode"><input class="mousetrap" type="radio" name="mode1" value="table"/> Group</label>
<label id="allMode"><input class="mousetrap" type="radio" name="mode1" value="page"/> All</label>
<label id="groupMode"><input class="mousetrap" type="radio" name="mode1" value="group"/> Group</label>
<label id="otherMode"><input class="mousetrap" type="radio" name="mode1" value="other"/>
<select id="other-region-type" name="other-region-type">
<option value="ImageRegion" selected="">ImageRegion</option>
<option value="SeparatorRegion">SeparatorRegion</option>
<option value="CustomRegion">CustomRegion</option>
</select>
</label>
<label id="allMode"><input class="mousetrap" type="radio" name="mode1" value="all"/> All</label>
</div>
</fieldset>
<fieldset id="newPropsFieldset">
Expand Down Expand Up @@ -169,7 +176,6 @@
<label id="hide-text-edit"><input class="mousetrap" type="checkbox" checked=""/> Lower pane</label>
<label id="hide-img"><input class="mousetrap" type="checkbox" checked=""/> Image</label>
<label id="hide-marker-start"><input class="mousetrap" type="checkbox"/> Coords/Baseline start markers</label>
<label id="hide-prop-tag"><input class="mousetrap" type="checkbox"/> Property tag</label>
<div class="visibility-set">
Region:
<label id="hide-text-reg"><input class="mousetrap" type="checkbox"/> text</label>
Expand Down Expand Up @@ -209,8 +215,11 @@
<div id="prop-modal" class="modal">
<div class="modal-content">
<span class="close">&#215;</span>
<h3>Properties for <span id="props-target"></span></h3>
<h2><span id="props-target"></span></h2>
<h3>Properties</h3>
<div id="props"></div>
<h3>Confidences</h3>
<div id="confs"></div>
</div>
</div>
<div id="readme-modal" class="modal">
Expand Down
3 changes: 2 additions & 1 deletion js/nw-app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* NW.js app functionality for nw-page-editor.
*
* @version $Version: 2020.03.03$
* @version $Version: 2020.03.17$
* @author Mauricio Villegas <mauricio_ville@yahoo.com>
* @copyright Copyright(c) 2015-present, Mauricio Villegas <mauricio_ville@yahoo.com>
* @license MIT License
Expand Down Expand Up @@ -64,6 +64,7 @@ $(window).on('load', function () {
ver.node = process.versions.node;
ver.chromium = process.versions.chromium;
ver.nw = process.versions.nw;
ver.xsd = pageCanvas.cfg.pagexmlns;
ver['nw-page-editor'] = nw.App.manifest.version;
return ver;
};
Expand Down
11 changes: 6 additions & 5 deletions js/page-canvas.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Javascript library for viewing and interactive editing of Page XMLs.
*
* @version $Version: 2019.09.05$
* @version $Version: 2020.03.17$
* @author Mauricio Villegas <mauricio_ville@yahoo.com>
* @copyright Copyright(c) 2015-present, Mauricio Villegas <mauricio_ville@yahoo.com>
* @license MIT License
Expand All @@ -23,7 +23,7 @@
'use strict';

var
version = '$Version: 2019.09.05$'.replace(/^\$Version. (.*)\$/,'$1');
version = '$Version: 2020.03.17$'.replace(/^\$Version. (.*)\$/,'$1');

/// Set PageCanvas global object ///
if ( ! global.PageCanvas )
Expand Down Expand Up @@ -1047,7 +1047,7 @@
sibl = elem.siblings('g'),
isword = elem.hasClass('Word'),
isline = elem.hasClass('TextLine'),
isreg = elem.hasClass('TextRegion');
isreg = elem.is('.TextRegion, .ImageRegion, .SeparatorRegion, .CustomRegion');

if ( isword ) {
var lineid = elem.closest('.TextLine').attr('id');
Expand Down Expand Up @@ -1202,7 +1202,7 @@
self.mode.allSelect = function ( textedit ) {
return textedit ?
self.mode.text( '.TextRegion, .TextLine, .Word, .Glyph', '> .TextEquiv > .Unicode', createSvgText ):
self.mode.select( '.TextRegion, .TextLine, .Word, .Glyph' ); };
self.mode.select( '.TextRegion, .ImageRegion, .SeparatorRegion, .CustomRegion, .TextLine, .Word, .Glyph' ); };
self.mode.regionSelect = function ( textedit ) {
return textedit ?
self.mode.text( '.TextRegion:not(.TableCell)', '> .TextEquiv > .Unicode', createSvgText, ':not(.TextRegion) > .Coords, .TableCell > .Coords' ):
Expand Down Expand Up @@ -2423,7 +2423,7 @@ console.log(reg[0]);
id = '',
num = parent.children(elem_selector).length+1,
sibl = parent.children(),
siblprev = sibl.filter('.Property, .Coords, .PageImage, '+elem_selector),
siblprev = sibl.filter('.Property, .PageImage, .Foreground, .TextRegion, .ImageRegion, .CustomRegion, .TextLine, .Word, .Glyph'),
elem = $(document.createElementNS(self.util.sns,'polygon'))
.addClass('Coords'),
g = $(document.createElementNS(self.util.sns,'g'))
Expand Down Expand Up @@ -2531,6 +2531,7 @@ console.log(reg[0]);
}
return true;
}
self.util.isValidCoords = isValidCoords;

/**
* Finishes the creation of a Coords element (SVG g+polygon).
Expand Down
Loading

0 comments on commit f373096

Please sign in to comment.