Skip to content
Permalink
Browse files

Prepare 1.7.3 release prep; see README for details

  • Loading branch information...
aisera-mikowski committed Sep 17, 2019
1 parent e0c8744 commit a7065927e54ad68af74b9055af3bac981fafa912
@@ -40,6 +40,12 @@ Version 1.7.2 enhancements:
- (x) `xhi/05_02_css_base.js` Remove unused code from CSS module
- (x) `lib/xhi_06`, `lib/xhi_13` Adjust to start and stop `server/index.js`

Version 1.7.3 enhancements:
- (x) `js/app-tb02/tb02.07_shell.js` Fix audio on chrome over http by
appending audio elments to body.
- (x) `js/xhi/01_util` and tests: replace `makePadNumStr` to `makePadStr`
- (x) Eslint fixes in ~20 files for redundant global symbols

---
## Quick start
On Mac, Ubuntu Linux, or WSL please follow these steps.
@@ -4,7 +4,7 @@
// used by core.js. Replace {XXX-config-matrix-XXX} with the
// output of this file to test basic function.
//
/*global xhi,require, process*/
/*global xhi*/
'use strict';

global[ 'xhi' ] = require( '../js/xhi/00_root.js' );
@@ -626,7 +626,7 @@ function makeXhiObj () {
build_rec_table = state_matrix.build_rec_table || [],
stage_status_map = state_matrix.stage_status_map || {},

build_id = xhiUtilObj._makePadNumStr_( state_matrix.build_idx, 7 )
build_id = xhiUtilObj._makePadStr_( state_matrix.build_idx, 7, 0 )
;

return {
@@ -23,7 +23,7 @@ tb02._05_css_ = (function () {

__p = __util._makeReplaceFn_( '_p_', aKey ),
configMap = {
_base_list_ : [
_shell_list_ : [
{ _selector_str_ : __p( '*' ),
_rule_map_ : {
_box_sizing_ : '_border_box_',
@@ -260,6 +260,9 @@ tb02._05_css_ = (function () {
_text_align_ : '_center_'
}
},
{ _selector_str_ : __p( '.{_p_}-_shell_audio_' ),
_rule_map_ : { _display_ : '_none_' }
},
{ _selector_str_ : __p( '.{_p_}-_shell_bomb_' ),
_rule_map_ : {
_position_ : '_absolute_',
@@ -270,7 +273,7 @@ tb02._05_css_ = (function () {
_border_width_ : '_d125rem_',
_height_ : [ '1.25emm' ],
_line_height_ : [ '1em' ],
_padding_ : [['_d25rem_', '_spc_rem_01_' ]],
_padding_ : [[ '_d25rem_', '_spc_rem_01_' ]],
_font_family_ : '_font_family_mono_',
_box_shadow_ : '_shdw_09_',
_color_ : '_txt_inv_hex_',
@@ -312,8 +315,8 @@ tb02._05_css_ = (function () {

_sub_ : 'sub',

__moz_none_ : '-moz-none',
_underscore_border_ : [[ '_d125rem_', '_solid_', '_txt_dk_hex_' ]]
__moz_none_ : '-moz-none',
_underscore_border_ : [[ '_d125rem_', '_solid_', '_txt_dk_hex_' ]]
}
},
stateMap = {
@@ -483,7 +486,7 @@ tb02._05_css_ = (function () {
xhiCSS._setVsheet_({
_vsheet_id_ : '_shell_',
_mode_str_ : '_add_',
_selector_list_ : configMap._base_list_
_selector_list_ : configMap._shell_list_
});

palette_map = initPaletteMap.call(
@@ -22,35 +22,35 @@ tb02._07_shell_ = (function ( $ ) {
sub$Fn = $[ vMap._gevent_ ][ vMap._subscribe_ ],

// Set num symbols
__0 = nMap._0_,

__0 = nMap._0_,

configMap = {
// language=TEXT (intellij)
_main_tmplt_ : pFn(
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" '
+ 'class="{_p_}-_shell_bg_svg_" '
+ 'viewbox="0 0 100 100" preserveAspectRatio="none">'
+ '<path d="M 0,0 40,100 0,100 M 100,0 60,100 100,100"></path>'
'<div class="{_p_}-_shell_audio_"></div>'
+ '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" '
+ 'class="{_p_}-_shell_bg_svg_" '
+ 'viewbox="0 0 100 100" preserveAspectRatio="none">'
+ '<path d="M 0,0 40,100 0,100 M 100,0 60,100 100,100"></path>'
+ '</svg>'
+ '<div class="{_p_}-_shell_title_">TypeB'
+ '<span class="{_p_}-_x_down_">o</span>mb'
+ '<span class="{_p_}-_x_release_">beta</span>'
+ '<span class="{_p_}-_x_down_">o</span>mb'
+ '<span class="{_p_}-_x_release_">beta</span>'
+ '</div>'
+ '<div class="{_p_}-_shell_subtext_"></div>'
+ '<div class="{_p_}-_shell_hi_score_">High Score</div>'
+ '<div class="{_p_}-_shell_level_">'
+ '<div class="{_p_}-_shell_level_label_">Level</div>'
+ '<div class="{_p_}-_shell_level_count_"></div>'
+ '<div class="{_p_}-_shell_level_label_">Level</div>'
+ '<div class="{_p_}-_shell_level_count_"></div>'
+ '</div>'
+ '<div class="{_p_}-_shell_lives_">'
+ '<div class="{_p_}-_shell_lives_count_"></div>'
+ '<div class="{_p_}-_shell_lives_gfx_"></div>'
+ '<div class="{_p_}-_shell_lives_count_"></div>'
+ '<div class="{_p_}-_shell_lives_gfx_"></div>'
+ '</div>'
+ '<div class="{_p_}-_shell_typebox_"></div>'
+ '<div class="{_p_}-_shell_score_">'
+ '<div class="{_p_}-_shell_score_label_">Score</div>'
+ '<div class="{_p_}-_shell_score_int_"></div>'
+ '<div class="{_p_}-_shell_score_">'
+ '<div class="{_p_}-_shell_score_label_">Score</div>'
+ '<div class="{_p_}-_shell_score_int_"></div>'
+ '</div>'
),
_bomb_html_ : pFn(
@@ -75,6 +75,8 @@ tb02._07_shell_ = (function ( $ ) {
_fadeout_ms_ : 5000,
_whoosh_ms_ : 1000
},
stateMap = { _is_user_init_ : false },

$Map, playSoundFn, animateExplodeFn
;
// == . END MODULE SCOPE VARIABLES ==================================
@@ -86,6 +88,7 @@ tb02._07_shell_ = (function ( $ ) {
// BEGIN DOM method /set$MapFn/
function set$MapFn ( $body ) {
var
$audio = $body[ vMap._find_ ]( pFn( '.{_p_}-_shell_audio_' ) ),
$hi_score = $body[ vMap._find_ ]( pFn( '.{_p_}-_shell_hi_score_' ) ),
$level = $body[ vMap._find_ ]( pFn( '.{_p_}-_shell_level_' ) ),
$lives = $body[ vMap._find_ ]( pFn( '.{_p_}-_shell_lives_' ) ),
@@ -94,11 +97,12 @@ tb02._07_shell_ = (function ( $ ) {
$title = $body[ vMap._find_ ]( pFn( '.{_p_}-_shell_title_' ) ),
$sell_fields = $( [
$hi_score[ vMap._get_ ]( __0 ),
$title[ vMap._get_ ]( __0 ),
$subtext[ vMap._get_ ]( __0 )
$title[ vMap._get_ ]( __0 ),
$subtext[ vMap._get_ ]( __0 )
] );

$Map = {
_$audio_ : $audio,
_$body_ : $body,
_$bg_svg_ : $body[ vMap._find_ ](
pFn( '.{_p_}-_shell_bg_svg_' )
@@ -141,21 +145,20 @@ tb02._07_shell_ = (function ( $ ) {
is_init_done = false
;


// BEGIN initSoundFn
function initSoundFn () {
var i, name_count, sound_name;
var i, name_count, sound_name, sound_obj;
if ( is_init_done ) { return; }
is_init_done = true;

name_count = sound_name_list[ vMap._length_ ];

for ( i = __0; i < name_count; i++ ) {
sound_name = sound_name_list[ i ];
sound_obj_map[ sound_name ] = new Audio(
'sound/' + sound_name + '.mp3'
);
sound_name = sound_name_list[ i ];
sound_obj = new Audio();
sound_obj.src = 'sound/' + sound_name + '.mp3';
sound_obj_map[ sound_name ] = sound_obj;
$Map._$audio_.append( sound_obj );
}
is_init_done = true;
}
// . END initSoundFn

@@ -164,15 +167,24 @@ tb02._07_shell_ = (function ( $ ) {
var sound_obj;

// initialize if required
if ( ! is_init_done ) { initSoundFn(); }
if ( ! is_init_done ) {
return initSoundFn();
}

sound_obj = sound_obj_map[ sound_name ];
if ( !sound_obj ) {
throw '_sound_name_not_known_';
return logFn( '_error_', '_sound_not_found_', sound_name );
}

if ( sound_obj.readyState !== 4 ) {
return logFn( '_notice_', '_sound_not_ready_', sound_name );
}

sound_obj.pause();
sound_obj.currentTime = __0;
sound_obj.play();
return sound_obj.play().catch(function () {
logFn( '_error_', '_unexpected_audio_error_', arguments );
});
}
// . END play_sound_fn

@@ -234,6 +246,13 @@ tb02._07_shell_ = (function ( $ ) {

// == BEGIN EVENT HANDLERS ==========================================
// BEGIN browser-event handlers
function onClickBodyFn () {
if ( ! stateMap._is_user_init_ ) {
playSoundFn( 'click' );
stateMap._is_user_init_ = true;
}
}

function onChangeLevelFn ( event_obj ) {
var level_str = $( this )[ vMap._val_ ]();
event_obj[ vMap._preventDefault_ ]();
@@ -446,8 +465,9 @@ tb02._07_shell_ = (function ( $ ) {
set$MapFn( $body );

// Begin browser event bindings
$body[ vMap._on_ ]( vMap._keypress_, onKeypressFn );
$body[ vMap._on_ ]( vMap._keydown_, onKeydownFn );
$body[ vMap._on_ ]( vMap._click_, onClickBodyFn );
$body[ vMap._on_ ]( vMap._keypress_, onKeypressFn );
$body[ vMap._on_ ]( vMap._keydown_, onKeydownFn );
// . End browser event bindings

// Begin model event bindings
@@ -8,7 +8,7 @@
* Requires : ---
*
*/
/*global xhi, module */
/*global*/
var xhi = {};
// == BEGIN MODULE xhi._00_root_ =======================================
xhi._00_root_ = (function () {
@@ -124,6 +124,7 @@ xhi._00_root_ = (function () {
_show_ : 'show',
_slice_ : 'slice',
_sort_ : 'sort',
_space_ : ' ',
_splice_ : 'splice',
_split_ : 'split',
_src_ : 'src',

0 comments on commit a706592

Please sign in to comment.
You can’t perform that action at this time.