tweking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-01-31 20:57:04 +03:00
parent 6e56333d49
commit e3fb0ab5d1
5 changed files with 70 additions and 21 deletions

View File

@ -157,6 +157,7 @@ VERSION := $(APP_VERSION)
DATE := $(strip $(shell date "+%Y%m%d%H%M"))
COMMIT := $(strip $(shell git rev-parse HEAD))
# less...
#
LESSC := npx lessc

View File

@ -1,5 +1,13 @@
<!DOCTYPE html>
<html>
<!--
XXX this file is way out of sync...
-->
<style>
@ -54,7 +62,10 @@
<script src="../../lib/jli.js"></script>
<script src="ig-image-graph.js"></script>
<script
data-main="ig-image-graph"
src="../../node_modules/requirejs/require.js"></script>
<script>
@ -153,7 +164,7 @@ var start = function(){
//document.body.appendChild(makeWaveform(document.getElementById('input'), 'color', 'normalized'))
document.body.appendChild(makeWaveform(document.getElementById('input')))
document.body.appendChild(makeWaveform('../images/splash-800x500.jpg'))
document.body.appendChild(makeWaveform('../../images/splash-800x500.jpg'))
}
@ -164,20 +175,20 @@ var start = function(){
<body>
<img id="input" src="../images/splash-800x500.jpg" onload="start()"/>
<img id="input" src="../../images/splash-800x500.jpg" onload="start()"/>
<br>
<ig-image-graph
graph="histogram"
src="../images/splash-800x500.jpg"
src="../../images/splash-800x500.jpg"
mode="color"
color="normalized"
style="width: 600px; height: 300px"></ig-image-graph>
<ig-image-graph
graph="waveform"
src="../images/splash-800x500.jpg"
src="../../images/splash-800x500.jpg"
mode="color"
color="normalized" ></ig-image-graph>

View File

@ -1,7 +1,24 @@
/**********************************************************************
*
* Web Component defining an image waveform/histogram view widget.
*
*
* Example:
* <script>
* require('nib/object')
* require('ig-image-graph')
* ...
* </script>
* ...
* <ig-image-graph
* graph="histogram"
* src="../images/splash-800x500.jpg"
* mode="color"
* color="normalized"
* style="width: 600px; height: 300px"></ig-image-graph>
*
*
* XXX add docs and examples -- canvas-waveform.html is out outdated...
* XXX add worker support...
*
**********************************************************************/

View File

@ -1,5 +1,16 @@
/**********************************************************************
*
* Keyboard handler
*
* This provides language layout independent way to handle keyboard
* control based on the base English language keys.
*
*
*
* Non-US English punctuation
* Difene a new layout then overload SHIFT_KEYS and regenerate
* UNSHIFT_KEYS via:
* UNSHIFT_KEYS = reverseDict(SHIFT_KEYS)
*
*
**********************************************************************/
@ -10,6 +21,17 @@
var object = require('lib/object')
/*********************************************************************/
// Helpers...
var reverseDict =
module.reverseDict =
function(dict, res={}){
for(var k in dict){
res[dict[k]] = k }
return res }
/*********************************************************************/
@ -73,6 +95,10 @@ module.SPECIAL_KEYS = {
186: ';', 222: '\'',
188: ',', 190: '.', 191: '/',
}
// build a reverse map of SPECIAL_KEYS
var KEY_CODES =
module.KEY_CODES = {}
reverseDict(SPECIAL_KEYS)
var SHIFT_KEYS =
@ -89,24 +115,15 @@ module.SHIFT_KEYS = {
';': ':', '\'': '"',
',': '<', '.': '>', '/': '?',
}
var UNSHIFT_KEYS =
module.UNSHIFT_KEYS = {}
for(var k in SHIFT_KEYS){
UNSHIFT_KEYS[SHIFT_KEYS[k]] = k }
// build a reverse map of SPECIAL_KEYS
var KEY_CODES =
module.KEY_CODES = {}
for(var k in SPECIAL_KEYS){
KEY_CODES[SPECIAL_KEYS[k]] = k }
module.UNSHIFT_KEYS =
reverseDict(SHIFT_KEYS)
// This is used to identify and correct key notation...
// NOTE: the keys here are intentionally lowercase...
var SPECIAL_KEY_ALTERNATIVE_TITLES = {
var SPECIAL_KEY_ALTERNATIVE_TITLES =
module.SPECIAL_KEY_ALTERNATIVE_TITLES = {
1: '#1', 2: '#2', 3: '#3', 4: '#4', 5: '#5',
6: '#6', 7: '#7', 8: '#8', 9: '#9', 0: '#0',
@ -126,7 +143,8 @@ var SPECIAL_KEY_ALTERNATIVE_TITLES = {
windows: 'Win',
}
var SPECIAL_KEYS_DICT = {}
var SPECIAL_KEYS_DICT =
module.SPECIAL_KEYS_DICT = {}
for(var k in SPECIAL_KEYS){
SPECIAL_KEYS_DICT[SPECIAL_KEYS[k].toLowerCase()] = SPECIAL_KEYS[k] }

View File

@ -44,7 +44,7 @@
"v8-compile-cache": "^2.2.0",
"wildglob": "^0.1.1"
},
"dependencies-disabled": {
"-dependencies": {
"openseadragon": "^2.4.1",
"flickrapi": "^0.3.28",
"pouchdb": "^7.2.2",
@ -59,11 +59,13 @@
"less": "^3.13.1",
"rcedit": "^3.0.0"
},
"-devDependencies": {
},
"bin": {
"ig": "ig.js"
},
"scripts": {
"start": "echo Use 'make run' instead of npm start..."
},
"vim-cfg": " vim:set ts=2 sw=2 expandtab : "
"-vim-cfg": " vim:set ts=2 sw=2 expandtab : "
}