Skip to content
Permalink
Browse files

Updates for 1.5.0 libs (done) and examples (wip)

  • Loading branch information...
aisera-mikowski committed May 14, 2019
1 parent 04b6eec commit e0b39d09a5ced2141a46796a69b81873e5c0a476
@@ -2,6 +2,7 @@
.coveralls.yml
.git
.idea
run
CODE_OF_CONDUCT.html
README*.html
build
@@ -15,4 +16,3 @@ js/vendor
lib/xhi_state.json
node_modules
npm-debug.log
package-lock.json
@@ -538,14 +538,14 @@ Patches can be created as follows:

```bash
cd js/vendor
cp jquery-3.3.1.js jquery-3.3.1.js.O
cp jquery-3.4.1.js jquery-3.4.1.js.O
# Now change jquery-3.3.1.js as required
# Now change jquery-3.4.1.js as required
# And create the diff
cd ../..
diff -u js/vendor/jquery-3.3.1.js.O js/vendor/jquery-3.3.1.js \
> patch/jquery-3.3.1.patch
diff -u js/vendor/jquery-3.4.1.js.O js/vendor/jquery-3.4.1.js
> patch/jquery-3.4.1.patch
```

---
@@ -12,12 +12,13 @@ set -u;

# This hack is to get around Mac's (c) 2007 version of Bash!
# _appLink=$( readlink -f -- "${0}" );
_readLinkFn(){ perl -MCwd -e 'print Cwd::abs_path shift' "$1"; }
_readLinkFn(){ perl -MCwd -e 'print Cwd::abs_path shift' "$1";}

_appName=$( basename $0 );
_appLink=$( _readLinkFn "${0}" );
_binDir=$( cd "${_appLink%/*}" && echo "${PWD}" );
_makedocExe=''; # or "${_binDir}/make_doc";
# _makedocExe="${_binDir}/make_doc";
_makedocExe='';

## == BEGIN Process changed documents =====================================
if [ -x "${_makedocExe}" ]; then
@@ -4,26 +4,21 @@
// used by core.js. Replace {XXX-config-matrix-XXX} with the
// output of this file to test basic function.
//
/*global xhi*/

/*global xhi,require, process*/
'use strict';

global[ 'xhi' ] = require( '../js/xhi/00_root.js' );
require( '../js/xhi/01_util.js' );

var
keyMatrix = require( process.argv[2] ),
srcMap = keyMatrix.defaultValueMatrix,
keyMap = keyMatrix.keyMap,
aMap = xhi._00_root_._makeInstanceFn_( 'rekey' ),

solveMap
aMap = xhi._00_root_._makeInstanceFn_( 'rekey' ),
utilObj = xhi._01_util_._makeInstanceFn_( aMap ),
solveMap = utilObj._makeRekeyMap_( srcMap, keyMap ),
solveStr = utilObj._safeJsonStringify_( solveMap, '_error_')
;

xhi._01_util_._makeInstanceFn_( aMap );

// Remove unused configs
delete srcMap.snippetStr;

solveMap = aMap._01_util_._makeRekeyMap_( srcMap, keyMap )

console.log( JSON.stringify( solveMap ) );
console.log( solveStr );
29 bin/xhi
@@ -1,12 +1,12 @@
#!/usr/bin/env node
/* vim: set ft=javascript: */
// == BEGIN SCRIPT xhi - the hi_score cli life-stage tool ==============
/*
* Purpose : Run hi_score lifecycle tools
* Example : See xhi help
* Author : Michael S. Mikowski - mike.mikowski@gmail.com
*
*/
// == BEGIN SCRIPT xhi - the hi_score cli life-stage tool ==============
// == BEGIN MODULE SCOPE VARIABLES =====================================
'use strict';
var
@@ -38,16 +38,16 @@ var
// Set paths
fqOrigDirname = process.cwd(),
fqProjDirname = pathObj.dirname( fqBinDirname ),
fqRunDirname = fqProjDirname + '/run',

fqBuildDirname = fqProjDirname + '/build',
fqHookFilename = fqProjDirname + '/.git/hooks/pre-commit',
fqLibDirname = fqProjDirname + '/lib',
fqModuleDirname = fqProjDirname + '/node_modules',
fqPkgFilename = fqProjDirname + '/package.json',
fqStateFilename = fqLibDirname + '/xhi_state.json',
fqBuildDirname = fqProjDirname + '/build',
fqHookFilename = fqProjDirname + '/.git/hooks/pre-commit',
fqLibDirname = fqProjDirname + '/lib',
fqModuleDirname = fqProjDirname + '/node_modules',
fqPkgFilename = fqProjDirname + '/package.json',
fqStateFilename = fqRunDirname + '/xhi_state.json',

// Set data
binPathMap = {}, // List of required external executables
jsonDataMap = {}, // Map of JSON read from files
minVersionInt = 8, // minimum Node version

@@ -602,15 +602,13 @@ function checkNodeVersionFn () {
function makePostObj () {
return {
applyPatchFn : applyPatchFn,
binPathMap : binPathMap, // -- ?
flowObj : flowObj, // 02 setup
grepFileFn : grepFileFn, // 02 setup, 06 lint
psObj : psObj, // 06 dev_start
shellJsObj : shellJsObj, // 11 build
uglifyCssObj : uglifyCssObj, // 11 build
uglifyJsObj : uglifyJsObj, // 11 build
writePkgFileFn : writePkgFileFn, // 05 upgrade
writeStateFileFn : writeStateFileFn // 05 upgrade
writePkgFileFn : writePkgFileFn // 05 upgrade
};
}
// . END utility /makePostObj/
@@ -726,7 +724,6 @@ function mainFn () {
bound_fn, prefix_str
;


// Create command table from config
commandTable = makeCommandTable( package_matrix.xhi_commandTable );

@@ -857,7 +854,13 @@ function mainFn () {
fsObj.stat( fqStateFilename, function ( error_obj ) {
var scratch_str;
if ( error_obj ) {
scratch_str = JSON.stringify( emptyStateMatrix, null, ' ' );
try {
fsObj.mkdirSync( fqRunDirname );
}
catch ( ignore ) {
console.log( fqRunDirname + ' exists.' );
}
scratch_str = JSON.stringify( emptyStateMatrix, null, 2 );
fsObj.writeFile(
fqStateFilename, scratch_str, { encoding : 'utf8' },
initReadFn.bind({ then_fn : mainFn })
@@ -0,0 +1 @@
# Client Browser JavaScript
@@ -13,7 +13,7 @@
'js/vendor/taffy-2.7.3.js',
'js/vendor/pcss-1.4.6.js',
'js/vendor/pcss.cfg-1.4.6.js',
'js/vendor/jquery-3.3.1.js',
'js/vendor/jquery-3.4.1.js',
'js/plugin/jquery.deferred.whenAll-1.0.0.js',
'js/vendor/jquery.event.dragscroll-1.0.0.js',
'js/vendor/jquery.event.gevent-1.1.6.js',
@@ -13,7 +13,7 @@
'js/vendor/taffy-2.7.3.js',
'js/vendor/pcss-1.4.6.js',
'js/vendor/pcss.cfg-1.4.6.js',
'js/vendor/jquery-3.3.1.js',
'js/vendor/jquery-3.4.1.js',
'js/plugin/jquery.deferred.whenAll-1.0.0.js',
'js/vendor/jquery.event.dragscroll-1.0.0.js',
'js/vendor/jquery.event.gevent-1.1.6.js',
@@ -122,14 +122,8 @@ tb02._02_data_ = (function () {
'{ name : "Henery" };'
]
],

// A list of indicies of recently used words (set in initModule)
wordSetIdxList,

// Utility methods

// Public methods
getWord, initModule, getBigBombWord
wordSetIdxList
;
// == . END MODULE SCOPE VARIABLES ==================================

@@ -146,7 +140,7 @@ tb02._02_data_ = (function () {
// come from the highest level (max_set_idx), wherease if
// weight_ratio = __0 random distribution should occur.
//
getWord = function ( max_set_idx, weight_ratio ) {
function getWord ( max_set_idx, weight_ratio ) {
var
dice_ratio = vMap._makeRandomNumFn_(),
set_idx, word_idx_map, word_idx, word_count, word_str
@@ -173,13 +167,13 @@ tb02._02_data_ = (function () {

// Return selected word
return word_str;
};
}
// . END public method /getWord/

// BEGIN public method /initModule/
// Purpose: Shuffles the words in the data and initializes indicies
//
initModule = function () {
function initModule () {
var
set_count = wordSetList[ vMap._length_ ],
i, word_list, word_count
@@ -195,14 +189,14 @@ tb02._02_data_ = (function () {
word_count = word_list[ vMap._length_ ];
wordSetIdxList[ i ] = { _idx_ : __0, _count_ : word_count };
}
};
}
// . END public method /initModule/

// START public method /getBigBomb/
getBigBombWord = function () {
function getBigBombWord () {
var idx = Math.floor( Math.random()*bigBombWordList.length + 1 );
return bigBombWordList[ idx ];
};
}
// . END public method /getBigBomb/
return {
_getWord_ : getWord,
@@ -412,9 +412,9 @@ tb02._03_model_ = (function ( $ ) {
// We lookup symbols outside of the loop as this is time critical.
//
runTimeTick = (function () {
var tick_ms, run_fn;
var tick_ms;

run_fn = function () {
function runFn () {
var
mode_str = stateMap._mode_str_,
new_ms, elapsed_ms, adj_ticktime_ms;
@@ -432,10 +432,10 @@ tb02._03_model_ = (function ( $ ) {
// Compensate for elapsed time since the last invocation
adj_ticktime_ms = configMap._timetick_ms_ - elapsed_ms;

stateMap._tick_toid_ = __setTo( run_fn, adj_ticktime_ms );
stateMap._tick_toid_ = __setTo( runFn, adj_ticktime_ms );
tick_ms = new_ms;
};
return run_fn;
}
return runFn;
}());
// . END utility method /runTimeTick/
// == . END UTILITY METHODS ==========================================
@@ -50,7 +50,7 @@ tb02._05_css_ = (function () {
__webkit_user_select_ : '_none_',
__moz_user_select_ : '__moz_none_',
__o_user_select_ : '_none_',
_user_select_ : '_none_',
_user_select_ : '_none_'

// TODO 2017-09-25 msm : Consider adding-back these keys.
// We can set the key list using xhiCSS._initModule_()
@@ -423,19 +423,19 @@ tb02._05_css_ = (function () {
var
idx = __util._castInt_( arg_idx, 0 ),
palette_map_list = aMap._05_02_css_base_._paletteMapList_,
palette_idx = stateMap._palette_idx_,
palette_count = palette_map_list[ vMap._length_ ],
palette_mixin_map;
palette_idx, palette_mixin_map;

// Return current palette index if request is out of range
// or matches existing.
if ( idx === palette_idx || idx > palette_count || idx < __0 ) {
return palette_idx;
if ( idx === stateMap._palette_idx_ || idx > palette_count || idx < __0 ) {
return stateMap._palette_idx_;
}

// Get the mixin map for the requested idx. If no map exists,
// use the first palette map (0).
palette_idx = idx;

palette_mixin_map = palette_map_list[ palette_idx ];
if ( ! palette_mixin_map ) {
palette_idx = __0;

0 comments on commit e0b39d0

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