Skip to content

Commit

Permalink
* Version 3.5.2
Browse files Browse the repository at this point in the history
- Revised mobile layout and content style.
- New file structure for easier data moving.
- Added data lookup system, just need to click on lookup text.
- Improved data summary and split items into 4 types.
- Faster data export engine.
- Fixed ~150 entries (total 520+)
- Removed old features and some unused code.
- Added JavaFX detection (#26).
- Simplified highlight markup.
- Fix some searching, sorting, viewing, update checking, and data management bugs.
  • Loading branch information
Sheep-y committed Nov 18, 2016
2 parents 02950f2 + 2c5b8fb commit cf267fc
Show file tree
Hide file tree
Showing 47 changed files with 2,456 additions and 1,627 deletions.
47 changes: 23 additions & 24 deletions README.md
@@ -1,8 +1,8 @@
# 4e Compendium Downloader #

![Screenshot of program](https://raw.githubusercontent.com/Sheep-y/trpg-dnd-4e-db/master/res/img/History%20-%20v3.5%20viewer.png)
## Version 3.5.2 ##

Version 3.5.1
![Screenshot of program](https://raw.githubusercontent.com/Sheep-y/trpg-dnd-4e-db/master/res/img/History%20-%20v3.5%20viewer.png)

This app can be used to reterives and locally stores entries from online 4e [D&D Compendium](http://www.wizards.com/dndinsider/compendium/database.aspx).
<br/>
Expand All @@ -25,37 +25,36 @@ This is a fan-made project and does not come with copyrighted data.
### Fixing compendium errors ###

Let's face it, the official compendium has errors.

I cannot update the official compendium, but I can update this downloader's data export.
In this version, over 370 entries has been corrected:

* 151 items missing power frequency. (e.g. Dantrag's Bracers, many energy weapons, dragon orbs, light sources etc.)
* 79 empty glossaries, delisted. (e.g. male, female, fang titan drake, etc.)
* 67 entries without "published" record. (e.g. Granny's Grief, Dreamheart, Deck of Many Things etc.)
* 35 entries that says "basic melee attack" instead of "melee basic attack" (or ranged). (e.g. Bane's Tactics, Feral Armor, Dancing Weapon, Kobold Piker etc.)
* 28 entries with formatting issues, such as content cut in the middle (Mirror of Deception), "published" not properly formatted (Drow Poison), putting level and group role together (Trapped Chest) etc.
* 12 skills missing "Imporvising with (this skill)" subtitle. (Arcana, Bluff, Diplomacy, etc.)
* 2 typos ("bit points", wrong power keyword) - I remember seeing others. Let me know!
This downloader fixes over 520 entries during export:

* 152 items missing power frequency. (Dantrag's Bracers, many energy weapons, dragon orbs, light sources etc.)
* The downloader logs 153 fixes. One of them - Arrow of Fate - is a duplicate.
* 79 empty glossaries, removed. (male, female, fang titan drake, etc.)
* 68 entries without "published" record. (Granny's Grief, Dreamheart, Deck of Many Things etc.)
* 60 entries moved to correct category. (Superior implements, Assassin's poisons, and Consumable wondrous)
* 35 entries that wrongly says "basic melee attack". (Bane's Tactics, Feral Armor, Dancing Weapon, Kobold Piker etc.)
* 21 entries with other inconsistent content. (Winged Armor type, Xenda-Dran Array tier, etc.)
* 21 entries with formatting issues. (Mirror of Deception, Silver Hands of Power, etc.)
* 15 entries with missing/wrong content. (Kord's Relentlessness, Rings of the Akarot etc.)
* 4 typos. (Cambion Stalwart "bit points", Fifth Sword of Tyr power keyword, Primal Grove "grp", Rubble Topple "Singe")
* 84 entries with missing/wrong listing data not caused by above issues. (Wild Elf, Enlarge Familiar, some traps etc.)
* In addition, over a hundred artifacts and item sets are manually classified.

If you find similar mistakes that aren't fixed, please [file an issue](https://github.com/Sheep-y/trpg-dnd-4e-db/issues/).

## Source code and building ##

* Viewer source code is in html folder.
* Downloader source code is in java folder, and use libraries in java_lib folder.
* Both use resources at the root (license) and/or in the resource folder.
* Use Ant (build.xml) to compile both downloader and viewer into an executable jar.
* The jar can also be extracted to a new folder; use Ant to move the extracted files back to original structure.

Part of the build process uses the [CocoDoc](https://github.com/Sheep-y/CocoDoc/) app builder, which is bundled and must run in GUI.
Try to use 64 bits java runtime; 32 bits may stackoverfow on js minify, but won't affect functionality.
* Both use resources at the root (license) and in the resource folder.
* Use Ant (build.xml) to compile viewer and then downloader into an executable jar.
* The jar can also be extracted to a new project folder; use Ant to move the extracted files back to original structure.

If you use an IDE, be careful not to export data to project folder.
Otherwise, it can take a long time for the IDE to scan all the data files.
The viewer is built with [CocoDoc](https://github.com/Sheep-y/CocoDoc/) app builder, which is bundled and must run in GUI.

Note that this program use sqljet to access sqlite database, but the data cannot be read by other SQLite libraries.
I understand that the file format didn't change, so it should be a sqljet issue, which is discontinued.
Since I cannot find an equally light alternative and I haven't had other issues, I'm keeping it and hoping someone can find what's wrong someday.
Sqljet is used to access sqlite database, but the data cannot be read by other SQLite libraries.
It may be a sqljet issue.
Since it is very light and has no other issues, I'm keeping it and hoping someone can find what's wrong someday.

<small>
Code, documentations, and related resources are open source and licensed under <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">GNU AGPL v3</a>. <br/>
Expand Down
14 changes: 5 additions & 9 deletions html/action_about.html
Expand Up @@ -38,7 +38,6 @@ <h1 class='i18n'> action.about.h_license </h1>
<p class='i18n'> action.about.p_license </p>
<p>
<button class='i18n' onclick='od.gui.go("license")'> action.license.link_text </button>
<button class='i18n' onclick='od.action.about.show_source()'> action.about.a_source </button>
<a class='button i18n' href='https://github.com/Sheep-y/trpg-dnd-4e-db'> action.about.a_github </a>
<button class='i18n' href='mailto:your.sheepy@gmail.com' accesskey="9" > action.about.a_email </button>
</p>
Expand Down Expand Up @@ -162,7 +161,10 @@ <h2> 3.5<sup>th</sup> Version </h2>
<h1 class='i18n'> action.about.h_version_history </h1>
<p class="i18n"> action.about.lbl_english_only </p>
<dl>
<dt> 3.5.1 <time>2016-07-30</time> </dt>
<dt> 3.5.2 <time>2016-11-19</time> </dt>
<dd> Multi-thread export, reduce file count from 25k to 1.8k, linkify entry names, split items into four categories, show type of items (artifact, tattoo, standard), show theme prerequisite, show background benefits, split race ability, share favicon between viewer and downloader, internal lookup, keyboard next/prev. </dd>

<dt> 3.5.1 <time>2016-07-31</time> </dt>
<dd> Implement paging, fix all category list and some search bugs, update entry style and mobile layout, and 370+ entry corrections. </dd>

<dt> 3.5.0 <time>2016-07-20</time> </dt>
Expand All @@ -189,7 +191,7 @@ <h1 class='i18n'> action.about.h_version_history </h1>
</article>
</div>

<header role="navigation">
<header role="banner">
<button class='i18n' onclick='od.gui.go("list")' accesskey='1'> action.list.link_text </button>
<h1 class="i18n"> action.about.title </h1>
<button class='i18n' onclick='scrollTo(0,0)'> gui.top </button>
Expand Down Expand Up @@ -230,12 +232,6 @@ <h1 class="i18n"> action.license.title </h1>
_.l.saveLocale( lang );
od.gui.l10n();
},

"show_source" : function act_about_show_source () {
// Chrome and Mozilla series (Firefox, SeaMonkey, Web) support view-source.
if ( ! /\b(Gecko\/|Chrome\/)/.test( navigator.userAgent ) ) return alert( _.l( 'action.about.lbl_source_manual' ) );
location.href = "view-source:" + location.href;
}
};

od.action.license = {
Expand Down
117 changes: 64 additions & 53 deletions html/action_list.html
Expand Up @@ -52,6 +52,7 @@
#act_list_pnl_category button var {
float: right;
font-weight: normal;
font-size: 10pt;
}
/* Result list */
#act_list_lbl_showing {
Expand Down Expand Up @@ -88,39 +89,15 @@
cursor: pointer;
color: red;
}
/* Big screen: Move search buttons to the right of search box */
@media (min-width: 768px) {
#act_list_pnl_term {
float: left;
margin-right: -320px;
margin-top: 10px;
padding-right: 320px;
width: calc( 100% - 10px );
}
#act_list_txt_search {
font-size: 120%;
width: 100%;
}
#act_list_tbl_search {
float: right;
margin-left: 0;
width: 300px;
}
#act_list_tbl_search td button {
width: 50%;
}
}
@media (min-width: 910px) {
#act_list_pnl_category button { max-width: 300px; }
/* 1024 cut point: try to fit four button and switch to vertical list */
@media (min-width: 1024px) {
#act_list_pnl_category button { max-width: 220px; }
}
/* Small screen: Show only selected cat */
@media (max-width: 909px) {
@media (max-width: 1023px) {
#act_list_pnl_category button {
font-size: 100%;
width: 33.3%;
width: 25%;
}
.rpg { display: none; }

#act_list_table {
display : block;
width : 100% !important;
Expand Down Expand Up @@ -166,6 +143,41 @@
text-align: right;
}
}
/* 1270 cut point: hide icon */
@media (min-width: 1270px) {
#act_list_pnl_category button { max-width: 250px; }
}
@media (max-width: 1269px) {
.rpg { display: none; }
}
/* 768 cut point: Move search buttons to bottom of search box */
@media (min-width: 767px) {
#act_list_pnl_term {
float: left;
margin-right: -320px;
margin-top: 10px;
padding-right: 320px;
width: calc( 100% - 10px );
}
#act_list_txt_search {
font-size: 120%;
width: 100%;
}
#act_list_tbl_search {
float: right;
margin-left: 0;
width: 300px;
}
#act_list_tbl_search td button {
width: 50%;
}
}
@media (max-width: 768px) {
#act_list_pnl_category button {
font-size: 100%;
width: 33.3%;
}
}
<?coco-end?></style>
<style id="style_dynamic"></style>

Expand All @@ -191,7 +203,7 @@
<div id='act_list_pnl_list' contextmenu="menu_view"></div>
</div>

<header role="navigation">
<header role="banner">
<button class='i18n' onclick='od.gui.go("about")'> action.about.link_text </button>
<h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
<button class='i18n' onclick='scrollTo(0,0)'> gui.top </button>
Expand All @@ -204,6 +216,7 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
'url' : /^list\b/,
'last_url' : null,
'last_cat' : null,
'last_scrollY' : 0,

'initialize' : function act_list_init () {
// Set initial search state (e.g. button pressed status)
Expand All @@ -228,6 +241,11 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
this.build_category( od.action.list.parse_action_id );
else
od.data.load_catalog( od.action.list.parse_action_id );
setTimeout( function(){ window.scrollTo( 0, action.last_scrollY ); }, 0 );
},

'cleanup': function act_list_cleanup () {
od.action.list.last_scrollY = window.pageYOffset;
},

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -263,6 +281,7 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
*/
'a_category' : function act_list_a_category ( cat ) {
var action = od.action.list;
od.gui.page = 0;
action.set_search_category( cat ? od.data.get( cat ) : "" );
action.search();
_( '#act_list_txt_search' )[0].focus();
Expand All @@ -289,19 +308,12 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
* @param {Event} evt Event object.
*/
'table_click' : function act_list_table_click ( evt ) {
// If user clicked on check box, ignore.
if ( ! evt || evt.target.tagName === 'INPUT' ) return;

// Find the row that user clicked.
var e = evt.target;
while ( e && e.tagName !== 'TR' ) e = e.parentNode;
if ( ! e ) return;

// Find category and id and trigger navigation
var cat = od.action.list.category;
if ( ! cat ) cat = od.data.get( e.getAttribute( 'data-category' ) );
var id = od.config.id( e.getAttribute('data-id') );
od.gui.go( "view=" + encodeURIComponent( cat.name + '.' + id ) );
_.noDef( evt );
var tr = _.parent( evt.target, '#act_list_pnl_list tr' );
if ( ! tr ) return;

var id = tr.getAttribute( 'data-id' );
if ( id ) od.gui.go( "view=" + encodeURIComponent( id ) );
},

'set_search_category' : function act_list_set_search_category ( cat ) {
Expand Down Expand Up @@ -401,15 +413,15 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
total += txt;
if ( counts ) {
var c = counts[ cat.name ];
txt = _.l( 'action.list.lbl_count', '%1/%2', c === undefined ? '--' : ~~c, cat.count );
txt = ~~c ? _.l( 'action.list.lbl_count', '%1', c === undefined ? '--' : ~~c, cat.count ) : '';
}
_.attr( _( dom[ cat.name ], 'var' ), 'text', txt );
} );
// Update total count
var txt = total;
if ( counts ) {
var c = counts[ '' ];
txt = _.l( 'action.list.lbl_count', '%1/%2', c === undefined ? '--' : ~~c, total );
txt = ~~c ? _.l( 'action.list.lbl_count', '%1', c === undefined ? '--' : ~~c, total ) : '';
}
_.attr( _( dom[ '' ], 'var' ), 'text', txt );
},
Expand Down Expand Up @@ -498,7 +510,7 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
table[0].parentNode.removeChild( table[0] );
}
table = _.create( 'table', { 'id': 'act_list_table', 'aria-label' : _.l( 'action.list.search_result', 'Result' ) } );
var head_row = _.create( 'tr' ), head = _.create( 'thead' ), css = '@media (max-width: 909px) {';
var head_row = _.create( 'tr' ), head = _.create( 'thead' ), css = '@media (max-width: 1023px) {';
table.appendChild( head );
head.appendChild( head_row );

Expand All @@ -513,6 +525,7 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
action.sort_asc = action.sort_field === f ? ! action.sort_asc : true;
_.attr( '#act_list_pnl_list th span', 'text', '⇅' );
lbl.textContent = action.sort_asc ? '↓' : '↑';
od.gui.page = 0;
action.sort_field = f;
action.show_list();
action.update_action_id();
Expand Down Expand Up @@ -603,17 +616,15 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
if ( ! line ) continue;

var cat_name = line._category.name, id = line[ idField ];
html += '<tr data-id="' + _.escHtml( id ) + '"';
if ( ! action.category ) html += ' data-category="' + _.escHtml( cat_name ) + '"';
html += '>';
var cells = '';
for ( var j = 1 ; j < cl ; j++ ) { // Note: Very intensive loop.
html += '<tr data-id="' + _.escHtml( id ) + '">';
var cells = '<td><a href="?view=' + id + '">' + line.Name + '</a>';
for ( var j = 2 ; j < cl ; j++ ) { // Note: Very intensive loop.
var d = line[ col[ j ] ] || '';
cells += '<td>' + ( d.text ? d.text : d );
}
html += gui.highlight( cells );
}
od.action.view.siblings = data.map( function( e ) { return e._category.name + '.' + e.ID });
od.action.view.siblings = data.map( function( e ) { return e.ID });
}

action.update_paging();
Expand All @@ -631,7 +642,7 @@ <h1 id='act_list_h_title' class='i18n'>action.list.title</h1>
var action = od.action.list, gui = od.gui;
var count = action.data.length;
var title = _.l( 'action.list.lbl_page', '%1/%2', gui.page + 1, gui.total_page );
_('#act_view_h_title')[0].textContent = title;
_('#act_list_h_title')[0].textContent = title;
od.gui.update_title();

if ( count <= gui.row_per_page ) {
Expand Down

0 comments on commit cf267fc

Please sign in to comment.