some cleaning
This commit is contained in:
parent
8cb7ce12c5
commit
2abd32a8ad
|
@ -115,7 +115,6 @@ cat $HOME/.zen/game/players/${PLAYER}/G1PalPay/${PLAYER}.duniter.history.json |
|
|||
## GET @ in JSON INLINE
|
||||
while read LINE; do
|
||||
|
||||
echo "MATCHING IN COMMENT"
|
||||
echo "${LINE}"
|
||||
JSON=${LINE}
|
||||
TXIDATE=$(echo $JSON | jq -r .date)
|
||||
|
@ -124,7 +123,6 @@ while read LINE; do
|
|||
TXIAMOUNTUD=$(echo $JSON | jq -r .amountUD)
|
||||
COMMENT=$(echo $JSON | jq -r .comment)
|
||||
|
||||
echo ">>> TODO CHECK TX HAPPENS LAST 24H (WHAT IS TXIDATE=$TXIDATE FORMAT ??)"
|
||||
[[ $(cat ~/.zen/game/players/${PLAYER}/.atdate) -ge $TXIDATE ]] \
|
||||
&& echo "PalPay $TXIDATE from $TXIPUBKEY ALREADY TREATED - continue" \
|
||||
&& continue
|
||||
|
|
|
@ -525,8 +525,8 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||
FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1)
|
||||
[[ ${FEEDNS} ]] \
|
||||
&& IRSS=$(ipfs add -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \
|
||||
&& echo "Publishing ${PLAYER}_feed: /ipfs/${IRSS}" \
|
||||
&& ipfs --timeout 180s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \
|
||||
&& echo "Publishing ${PLAYER}_feed: /ipns/${FEEDNS} => /ipfs/${IRSS}" \
|
||||
&& ipfs --timeout 300s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \
|
||||
|| echo ">>>>> ERROR ${PLAYER}_feed IPNS KEY NOT FOUND - ERROR"
|
||||
|
||||
fi
|
||||
|
@ -570,10 +570,10 @@ for PLAYER in ${PLAYERONE[@]}; do
|
|||
|
||||
## IPFS PLAYER TW #
|
||||
mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}
|
||||
# /ipfs/${TW}
|
||||
# /ipfs/${TW} = /TW/${PLAYER}/index.html
|
||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${TW}'\" />${TODATE}:${PLAYER}" \
|
||||
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/index.html
|
||||
# /ipns/${ASTRONAUTENS}
|
||||
# /ipns/${ASTRONAUTENS} = /TW/${PLAYER}/_index.html
|
||||
echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipns/${ASTRONAUTENS}'\" />${PLAYER}" \
|
||||
> ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_${REGLAT}_${REGLON}/_${SECLAT}_${SECLON}/_${LAT}_${LON}/TW/${PLAYER}/_index.html
|
||||
## IPNS UMAP _index.html ##
|
||||
|
|
|
@ -75,7 +75,7 @@ mkdir -p ~/.zen/tmp/${MOATS}
|
|||
|
||||
## SEND PLAYER LAST KNOW TW
|
||||
TW=$(ipfs add -Hq ${INDEX} | tail -n 1)
|
||||
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Ciao ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='${myIPFSGW}/ipfs/${TW}'>TW ARCHIVE</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE"
|
||||
${MY_PATH}/../tools/mailjet.sh "${PLAYER}" "<html><body><h1>Ciao ${PLAYER},</h1> Your TW is unplugged from Astroport : <a href='/ipfs/${TW}'>TW (${TW})</a>.<br>$(cat ~/.zen/game/players/${PLAYER}/secret.june)<br><h3>May the force be with you.</h3></body></html>" "BYE BYE MESSAGE"
|
||||
|
||||
echo "PLAYER IPNS KEYS UNPLUGED"
|
||||
echo "#######################"
|
||||
|
|
|
@ -101,7 +101,7 @@ for UMAP in ${unique_combined[@]}; do
|
|||
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
echo "## IPFS GET YESTERDATENS"
|
||||
mkdir ~/.zen/tmp/${MOATS}/${UMAP}
|
||||
ipfs --timeout 180s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
|
||||
ipfs --timeout 300s get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/
|
||||
if [[ $? != 0 ]]; then
|
||||
echo "(╥☁╥ ) swarm online memory empty (╥☁╥ )"
|
||||
# Try retieve memory from UPlanet Zen Memory
|
||||
|
@ -458,7 +458,7 @@ for UMAP in ${unique_combined[@]}; do
|
|||
|
||||
echo "PUBLISHING ${TODATE} UMAPROOT : ${myIPFS}/ipfs/${UMAPROOT}"
|
||||
|
||||
ipfs --timeout 180s name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
|
||||
ipfs --timeout 300s name publish --key=${TODATE}${G1PUB} /ipfs/${UMAPROOT}
|
||||
end=`date +%s`
|
||||
echo "(UMAP) ${UMAP} ${TODATE} PUBLISH time was "`expr $end - $start` seconds.
|
||||
|
||||
|
|
|
@ -19,17 +19,20 @@ SALT="$1"
|
|||
PEPPER="$2"
|
||||
PLAYER="$3"
|
||||
PSEUDO="$4"
|
||||
[[ $PSEUDO == "" ]] && PSEUDO="Anonymous"
|
||||
|
||||
## Fill UP TW with VIDEO URL or UMAP NS
|
||||
URL="$5"
|
||||
[[ $URL == "" ]] && URL="_URL_"
|
||||
|
||||
## UPLANET SECTOR
|
||||
## UPLANET UMAP
|
||||
LAT="$6"
|
||||
[[ $LAT == "" ]] && LAT="0.00"
|
||||
LON="$7"
|
||||
[[ $LON == "" ]] && LON="0.00"
|
||||
|
||||
################################################################################
|
||||
YOU=$(myIpfsApi);
|
||||
LIBRA=$(head -n 2 ${MY_PATH}/../A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
|
||||
################################################################################
|
||||
## LIST TW MODELS
|
||||
################################################################################
|
||||
|
@ -58,22 +61,22 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
|
|||
[[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]] \
|
||||
&& [[ -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
|
||||
&& echo "TW FOUND ENTER 'yes' TO RESET TW. HIT ENTER TO KEEP IT." \
|
||||
&& read ENTER \
|
||||
&& [[ $ENTER != "" ]] && rm ~/.zen/tmp/${MOATS}/TW/index.html
|
||||
&& read ENTER
|
||||
|
||||
# EXTEND SEARCH IN WEB2.0
|
||||
#~ [[ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]] \
|
||||
#~ && echo "Trying curl on $LIBRA" \
|
||||
#~ && curl -m 30 -so ~/.zen/tmp/${MOATS}/TW/index.html "$LIBRA/ipns/${ASTRONAUTENS}"
|
||||
if [[ $ENTER != "" ]]; then
|
||||
|
||||
# BACKUP tiddlers
|
||||
tiddlywiki --load ~/.zen/tmp/${MOATS}/TW/index.html --output ~/.zen/tmp \
|
||||
--render '.' 'backup.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[!is[system]]'
|
||||
rm ~/.zen/tmp/${MOATS}/TW/index.html
|
||||
echo ">> Tiddlers Backup : ~/.zen/tmp/backup.json"
|
||||
fi
|
||||
|
||||
#############################################
|
||||
## AUCUN RESULTAT
|
||||
if [ ! -s ~/.zen/tmp/${MOATS}/TW/index.html ]; then
|
||||
|
||||
# COPY TW TEMPLATE
|
||||
[[ ${LON} && ${LAT} ]] \
|
||||
&& cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html \
|
||||
|| cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
|
||||
cp ${MY_PATH}/../templates/twuplanet.html ~/.zen/tmp/${MOATS}/TW/index.html
|
||||
|
||||
else
|
||||
#############################################
|
||||
|
@ -144,13 +147,6 @@ PLAYER=${PLAYER,,}
|
|||
PASS=$(echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}" | tail -c-5)
|
||||
|
||||
############################################################
|
||||
######### TODO Ajouter d'autres clefs IPNS, GPG ?
|
||||
# MOANS=$(ipfs key gen moa_${PLAYER})
|
||||
# MOAKEYFILE=$(${MY_PATH}/give_me_keystore_filename.py "moa_${PLAYER}")
|
||||
# echo "Coffre personnel multimedia journalisé dans votre 'Astroport' (amis de niveau 3)"
|
||||
# echo "Votre clef moa_${PLAYER} <=> $MOANS ($MOAKEYFILE)"; sleep 2
|
||||
############################################################
|
||||
|
||||
${MY_PATH}/../tools/keygen -t duniter -o ~/.zen/tmp/${MOATS}/secret.dunikey "$SALT" "$PEPPER"
|
||||
|
||||
G1PUB=$(cat ~/.zen/tmp/${MOATS}/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
|
||||
|
@ -168,28 +164,12 @@ echo "PEPPER=\"$PEPPER\"" >> ~/.zen/game/players/${PLAYER}/secret.june
|
|||
## MOVE ${MOATS} secret.dunikey IN PLAYER DIRECTORY
|
||||
mv ~/.zen/tmp/${MOATS}/secret.dunikey ~/.zen/game/players/${PLAYER}/
|
||||
|
||||
# PLAYER=geg-la_debrouille@super.chez-moi.com
|
||||
YUSER=$(echo ${PLAYER} | cut -d '@' -f1) # YUSER=geg-la_debrouille
|
||||
LYUSER=($(echo "$YUSER" | sed 's/[^a-zA-Z0-9]/\ /g')) # LYUSER=(geg la debrouille)
|
||||
CLYUSER=$(printf '%s\n' "${LYUSER[@]}" | tac | tr '\n' '.' ) # CLYUSER=debrouille.la.geg.
|
||||
YOMAIN=$(echo ${PLAYER} | cut -d '@' -f 2) # YOMAIN=super.chez-moi.com
|
||||
# echo "NEXT STYLE GW : https://ipfs.$CLYUSER$YOMAIN.$(myHostName)"
|
||||
# echo "MY PLAYER API GW : $(myPlayerApiGw)"
|
||||
|
||||
NID="${myIPFS}"
|
||||
#~ WID="https://ipfs.$CLYUSER$YOMAIN.$(myHostName)/api" ## Next Generation API # TODO PLAYER IPFS Docker entrance
|
||||
#~ WID="https://ipfs.$(myHostName)/api"
|
||||
#~ WID="https://ipfs.$(myHostName)/api"
|
||||
WID="${myAPI}" ## https://ipfs.libra.copylaradio.com
|
||||
|
||||
USALT=$(echo "$SALT" | jq -Rr @uri)
|
||||
UPEPPER=$(echo "$PEPPER" | jq -Rr @uri)
|
||||
DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
|
||||
|
||||
[[ $isLAN ]] && NID="http://ipfs.localhost:8080" \
|
||||
&& WID="http://ipfs.localhost:5001"
|
||||
|
||||
|
||||
# Create ${PLAYER} "IPNS Key"
|
||||
ipfs key rm ${PLAYER} >/dev/null 2>&1
|
||||
${MY_PATH}/../tools/keygen -t ipfs -o ~/.zen/game/players/${PLAYER}/secret.player "$SALT" "$PEPPER"
|
||||
|
@ -200,7 +180,6 @@ mkdir -p ~/.zen/game/players/${PLAYER}/ipfs/G1SSB # Prepare astrXbian sub-datast
|
|||
qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.png "$G1PUB" ## Check by VISA.print.sh
|
||||
cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/ipfs/QR.png
|
||||
echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.pubkey # G1SSB NOTATION (astrXbian compatible)
|
||||
|
||||
qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png "$myLIBRA/ipns/${ASTRONAUTENS}"
|
||||
|
||||
############################################################################
|
||||
|
@ -208,6 +187,10 @@ qrencode -s 12 -o ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png "$myLIBRA/ip
|
|||
#~ secFromDunikey=$(cat ~/.zen/game/players/${PLAYER}/secret.dunikey | grep "sec" | cut -d ' ' -f2)
|
||||
#~ echo "$secFromDunikey" > ~/.zen/tmp/${MOATS}/${PSEUDO}.sec
|
||||
|
||||
USALT=$(echo "$SALT" | jq -Rr @uri)
|
||||
UPEPPER=$(echo "$PEPPER" | jq -Rr @uri)
|
||||
DISCO="/?salt=${USALT}&pepper=${UPEPPER}"
|
||||
|
||||
## PGP ENCODING SALT/PEPPER API ACCESS
|
||||
echo "${DISCO}" > ~/.zen/tmp/${MOATS}/topgp
|
||||
cat ~/.zen/tmp/${MOATS}/topgp | gpg --symmetric --armor --batch --passphrase "$PASS" -o ~/.zen/tmp/${MOATS}/gpg.${PSEUDO}.asc
|
||||
|
@ -543,8 +526,7 @@ echo " "
|
|||
echo "* AstroID : with PASS : $PASS"
|
||||
echo "${NID}/ipns/${ASTRONAUTENS}#AstroID"
|
||||
echo
|
||||
echo "* UMap : registration at ${LAT}, ${LON}
|
||||
${myIPFS}${URL}"
|
||||
echo "* UMap : registration at ${LAT}, ${LON}"
|
||||
echo
|
||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
echo ""
|
||||
|
|
15
command.sh
15
command.sh
|
@ -42,7 +42,7 @@ echo 'PRESS ENTER... '; read
|
|||
|
||||
## CREATE AND OR CONNECT USER
|
||||
PS3=' ____ Select ___ ? '
|
||||
players=( "CREATE PLAYER" "IMPORT PLAYER" "PRINT QRCARD" $(ls ~/.zen/game/players | grep "@" 2>/dev/null))
|
||||
players=( "CREATE PLAYER" "PRINT QRCARD" $(ls ~/.zen/game/players | grep "@" 2>/dev/null))
|
||||
## MULTIPLAYER
|
||||
|
||||
select fav in "${players[@]}"; do
|
||||
|
@ -85,23 +85,12 @@ select fav in "${players[@]}"; do
|
|||
echo "'Longitude ?'"
|
||||
read LON
|
||||
[[ ${LON} == "" ]] && LON="0.00"
|
||||
echo "${MY_PATH}/RUNTIME/VISA.new.sh" "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "_URL_" "${LAT}" "${LON}"
|
||||
${MY_PATH}/RUNTIME/VISA.new.sh "${PPASS}" "${NPASS}" "${EMAIL}" "UPlanet" "_URL_" "${LAT}" "${LON}"
|
||||
fav=$(cat ~/.zen/tmp/PSEUDO 2>/dev/null) && rm ~/.zen/tmp/PSEUDO
|
||||
echo "Astronaute $fav bienvenue sur UPlanet..."
|
||||
exit
|
||||
;;
|
||||
"IMPORT PLAYER")
|
||||
echo "'Secret 1'"
|
||||
read SALT
|
||||
echo "'Secret 2'"
|
||||
read PEPPER
|
||||
echo "'Adresse Email'"
|
||||
read EMAIL
|
||||
${MY_PATH}/RUNTIME/VISA.new.sh "$SALT" "$PEPPER" "$EMAIL"
|
||||
fav=$(cat ~/.zen/tmp/PSEUDO 2>/dev/null) && rm ~/.zen/tmp/PSEUDO
|
||||
echo "Astronaute $fav WELCOME"
|
||||
exit
|
||||
;;
|
||||
"")
|
||||
echo "Choix obligatoire. exit"
|
||||
exit
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ipfs
|
||||
# Required-Start: $local_fs $remote_fs $network $syslog $named
|
||||
# Required-Stop: $local_fs $remote_fs $network $syslog $named
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Should-Start: ipfs daemon
|
||||
# Should-Stop: ipfs daemon
|
||||
# Short-Description: Starts the ipfs daemon
|
||||
# Description: ipfs daemon is managing swarm filesystem
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Dylan Powers <dylan.kyle.powers@gmail.com
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
|
||||
DESC="ipfs daemon"
|
||||
NAME=ipfs
|
||||
DAEMON=/usr/local/bin/ipfs
|
||||
DAEMON_ARGS="daemon --enable-pubsub-experiment --enable-namesys-pubsub --enable-gc"
|
||||
PIDFILE=/var/run/$NAME.pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
||||
IPFS_PATH=/home/xbian/.ipfs
|
||||
IPFS_USER=xbian
|
||||
# Exit if the package is not installed
|
||||
[ -x "$DAEMON" ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
|
||||
# and status_of_proc is working.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start() {
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test >/dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \
|
||||
--background --chuid $IPFS_USER --no-close \
|
||||
--exec /usr/bin/env IPFS_PATH="$IPFS_PATH" $DAEMON 2>>/var/log/ipfs.log 1>/dev/null \
|
||||
-- $DAEMON_ARGS \
|
||||
|| return 2
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop() {
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
|
||||
# Delete the pid
|
||||
rm -f $PIDFILE
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
restart)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
|
@ -1,14 +0,0 @@
|
|||
[Unit]
|
||||
Description=IPFS daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=_USER
|
||||
ExecStart=/usr/local/bin/ipfs daemon --enable-pubsub-experiment --enable-namesys-pubsub --routing=dhtclient --enable-gc
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
CPUAccounting=true
|
||||
CPUQuota=60%
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
[{"created":"20221101210835141","text":"","tags":"","title":"$:/language/Docs/Types/video/mp4","modified":"20221101210954532","description":"MP4","group":"video","name":"video/mp4","group-sort":"3"}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
[{"text":"_PLAYERSFEED_","tags":"","title":"$:/plugins/astroport/lightbeams/state/subscriptions"}]
|
|
@ -1 +0,0 @@
|
|||
[{"text":"{\n \"tiddlers\": {\n \"$:/plugins/felixhayashi/hotzone/config.js\": {\n \"title\": \"$:/plugins/felixhayashi/hotzone/config.js\",\n \"text\": \"/*\\\\\\n\\ntitle: $:/plugins/felixhayashi/hotzone/config.js\\ntype: application/javascript\\nmodule-type: library\\n\\n@preserve\\n\\n\\\\*/\\n(function(){\\\"use strict\\\";exports.config={classNames:{storyRiver:\\\"tc-story-river\\\",tiddlerFrame:\\\"tc-tiddler-frame\\\",tiddlerTitle:\\\"tc-title\\\"},references:{userConfig:\\\"$:/config/hotzone/focusOffset\\\",focussedTiddlerStore:\\\"$:/temp/focussedTiddler\\\"},checkbackTime:$tw.utils.getAnimationDuration()}})();\",\n \"type\": \"application/javascript\",\n \"module-type\": \"library\"\n },\n \"$:/plugins/felixhayashi/hotzone/hotzone.js\": {\n \"title\": \"$:/plugins/felixhayashi/hotzone/hotzone.js\",\n \"text\": \"/*\\\\\\n\\ntitle: $:/plugins/felixhayashi/hotzone/hotzone.js\\ntype: application/javascript\\nmodule-type: startup\\n\\n@preserve\\n\\n\\\\*/\\n(function(){\\\"use strict\\\";exports.name=\\\"hotzone\\\";exports.platforms=[\\\"browser\\\"];exports.after=[\\\"story\\\"];exports.synchronous=true;exports.startup=function(){var t=require(\\\"$:/plugins/felixhayashi/hotzone/config.js\\\").config;var e=null;var i=document.getElementsByClassName(t.classNames.storyRiver)[0];var r=$tw.wiki.getTiddlerData(t.references.userConfig,{});var s=isNaN(parseInt(r.focusOffset))?150:parseInt(r.focusOffset);var a=function(e,i,r){if(!(e instanceof Element))return;if(!$tw.utils.hasClass(e,t.classNames.tiddlerFrame))return;var s=e.getElementsByClassName(t.classNames.tiddlerTitle)[0];if(s){var a=s.innerText||s.textContent;return a.trim()}};var n=function(e,i){$tw.wiki.addTiddler(new $tw.Tiddler({title:t.references.focussedTiddlerStore,text:e},$tw.wiki.getModificationFields()));if(i){var r=document.getElementsByClassName(\\\"hzone-focus\\\")[0];if(r){$tw.utils.removeClass(r,\\\"hzone-focus\\\")}$tw.utils.addClass(i,\\\"hzone-focus\\\")}};var l=function(){var r=$tw.wiki.getTiddler(\\\"$:/StoryList\\\");if(r&&r.fields.list.length){var l=null;var o=Number.MAX_VALUE;var f=i.children;var u=t.classNames.tiddlerFrame;for(var d=f.length;d--;){if($tw.utils.hasClass(f[d],u)){var c=f[d].getBoundingClientRect();var v=Math.min(Math.abs(s-c.top),Math.abs(s-c.bottom));if(v<o){l=f[d];o=v}}}var w=a(l);if(w!==e&&$tw.wiki.getTiddler(w)){e=w;n(e,l);return}}else if(e){e=\\\"\\\";n(e)}};var o=function(t){var e;var i=false;return function(r,s){var a=this;if(i&&!s){}else{i=s;if(e!=null){clearTimeout(e)}e=setTimeout((function(){e=null;i=false;t.apply(a)}),r)}}};var f=o(l);var u=function(t){if(t[\\\"$:/HistoryList\\\"]){if(!$tw.wiki.tiddlerExists(\\\"$:/HistoryList\\\"))return;var e=$tw.wiki.getTiddler(\\\"$:/HistoryList\\\").fields[\\\"current-tiddler\\\"];var i=$tw.wiki.getTiddlerList(\\\"$:/StoryList\\\");var r=i.indexOf(e)>=0;if(!r)return;f($tw.utils.getAnimationDuration()+10,true)}else if(t[\\\"$:/StoryList\\\"]){f($tw.utils.getAnimationDuration()+10,true)}};var d=function(t){f(300,false)};$tw.wiki.addEventListener(\\\"change\\\",u);window.addEventListener(\\\"scroll\\\",d,false);d()}})();\",\n \"type\": \"application/javascript\",\n \"module-type\": \"startup\"\n },\n \"$:/plugins/felixhayashi/hotzone/Configuration\": {\n \"title\": \"$:/plugins/felixhayashi/hotzone/Configuration\",\n \"text\": \"Please see the [[GitHub page|https://github.com/felixhayashi/TW5-HotZone]] for more information on the options.\\n\\nSave and reload the wiki to activate changes.\\n\\n<table>\\n <tr>\\n <th align=\\\"left\\\">Focus offset:</th>\\n <td><$edit-text tiddler=\\\"$:/config/hotzone/focusOffset\\\" tag=\\\"input\\\" default=\\\"71px\\\" /></td>\\n </tr>\\n</table>\"\n },\n \"$:/temp/focussedTiddler\": {\n \"title\": \"$:/temp/focussedTiddler\"\n },\n \"$:/plugins/felixhayashi/hotzone/License\": {\n \"title\": \"$:/plugins/felixhayashi/hotzone/License\",\n \"text\": \"This code is released under the BSD license. For the exact terms visit:\\n\\nhttps://github.com/felixhayashi/TW5-HotZone/blob/master/LICENSE\"\n },\n \"$:/plugins/felixhayashi/hotzone/Readme\": {\n \"title\": \"$:/plugins/felixhayashi/hotzone/Readme\",\n \"text\": \"Please visit the [[GitHub page|https://github.com/felixhayashi/TW5-HotZone]] for more information.\"\n }\n }\n}","type":"application/json","author":"Felix Küppers","core-version":">=5.1.5","dependents":"","description":"HotZone – Be notified when tiddlers are scrolled into view","list":"Configuration License Readme","name":"hotzone","plugin-type":"plugin","released":"","source":"https://github.com/felixhayashi/TW5-HotZone","title":"$:/plugins/felixhayashi/hotzone","version":"0.0.3"}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue