Notebook - Welcome to Notebook

Contact/Report Bugs
You can contact me at: bkenwright@xbdev.net












Right click context menu using jQuery UI link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 8 4 styles github min css link rel stylesheet href https swisnl github io jQuery contextMenu dist jquery contextMenu css script src https cdnjs cloudflare com ajax libs jquery 1 11 3 jquery min js script script src https swisnl github io jQuery contextMenu dist jquery contextMenu js script span style position absolute left 100px top 40px border 1px solid blue background color yellow padding 20px class context menu one btn btn neutral right click me span manually force show the context menu button onclick showcontext Click button script document body style height 300px function Context Menu with Sub Menu contextMenu selector context menu one callback function key options var m clicked key window console console log m alert m items edit name Edit icon edit cut name Cut icon cut sep1 quit name Quit icon quit sep2 fold1 name Sub group items fold1 key1 name Foo bar fold2 name Sub group 2 items fold2 key1 name alpha fold2 key2 name bravo fold2 key3 name charlie fold1 key3 name delta fold1a name Other group items fold1a key1 name echo fold1a key2 name foxtrot fold1a key3 name golf function showcontext make button open the menu or context menu one contextMenu or context menu one trigger contextmenu context menu one contextMenu x 400 y 100 console log ready script Right click context menu disable and the highlighted word is printed ref https swisnl github io jQuery contextMenu demo keeping contextmenu open html link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 8 4 styles github min css link rel stylesheet href https swisnl github io jQuery contextMenu dist jquery contextMenu css script src https cdnjs cloudflare com ajax libs jquery 1 11 3 jquery min js script script src https swisnl github io jQuery contextMenu dist jquery contextMenu js script span class context menu one btn btn neutral right click me span textarea style width 100 height 100 class context menu one btn btn neutral once upon a time textarea script document body style height 300px function getSelectionText var text if window getSelection text window getSelection toString else if document selection document selection type Control text document selection createRange text return text document querySelector textarea addEventListener contextmenu function e e preventDefault console log document getSelection getSelectionText let mousePosition mousePosition x e pageX mousePosition y e pageY context menu one contextMenu x mousePosition x y mousePosition y build the function Context Menu with Sub Menu contextMenu selector context menu one callback function key options var m clicked key window console console log m alert m items edit name Edit icon edit cut name Cut icon cut sep1 quit name Quit icon quit sep2 fold1 name Sub group items fold1 key1 name Foo bar fold2 name Sub group 2 items fold2 key1 name alpha fold2 key2 name bravo fold2 key3 name charlie fold1 key3 name delta fold1a name Other group items fold1a key1 name echo fold1a key2 name foxtrot fold1a key3 name golf console log ready script Right click context menu dynamically built created at runtime ref http swisnl github io jQuery contextMenu docs html build link rel stylesheet href cdnjs cloudflare com ajax libs highlight js 8 4 styles github min css link rel stylesheet href https swisnl github io jQuery contextMenu dist jquery contextMenu css script src https cdnjs cloudflare com ajax libs jquery 1 11 3 jquery min js script script src https swisnl github io jQuery contextMenu dist jquery contextMenu js script span class context menu one btn btn neutral right click me span textarea style width 100 height 100 class context menu one btn btn neutral once upon a time textarea script document body style height 300px async function selectTextCursor ta var startPosition ta selectionStart endPosition ta selectionEnd while A Za z0 9 test ta value charAt startPosition startPosition 0 startPosition while A Za z0 9 test ta value charAt endPosition endPosition ta value length endPosition ta selectionStart startPosition 1 ta selectionEnd endPosition console log ta selectionStart function getSelectionText var text if window getSelection text window getSelection toString else if document selection document selection type Control text document selection createRange text return text uses the cursor position const getTheWord selectionStart value let arr value split let sum 0 for let i 0 i arr length i sum arr i length 1 if sum selectionStart return arr i prevent the default document querySelector textarea addEventListener contextmenu async function e e preventDefault console log context selectTextCursor e target console log window getSelection toString window getSelection toString return let selWord getSelectionText let selWord getTheWord e target selectionStart e target value console log selWord selWord if selWord length 0 return return showing showing if showing return let mousePosition mousePosition x e clientX mousePosition y e clientY let word selWord let url https api datamuse com words ml word max 5 let p await fetch url let ret await p json console log url url word word ret ret console log word word let syn name Synonyms items for let i 0 i ret length i let key syn ret i word let val name ret i word syn items key val console log syn syn let myitems edit name Edit icon edit cut name Cut icon cut sep1 quit name Quit icon quit sep2 word name Word word fold1a syn if ret length 0 delete myitems fold1a let ff callback function key options var m clicked key console log m console log split m split if key split length 1 if key split 0 syn console log replacing word var replace key split 1 var textarea e target var len textarea value length var start textarea selectionStart var end textarea selectionEnd var sel textarea value substring start end Here we are replacing the selected text with this one textarea value textarea value substring 0 start replace textarea value substring end len return true items myitems contextMenu selector context menu one reposition false hideOnSecondTrigger true build function triggerElement e console log building context menu console log myitems myitems return ff x mousePosition x y mousePosition y events show function options console log options options Add class to the menu this addClass currently showing menu Show an alert with the selector of the menu if confirm Open menu with selector options selector true return true else Prevent the menu to be shown return false console log Menu show hide function options if confirm Hide menu with selector options selector true return true else Prevent the menu to be hidden return false console log Menu hide contextMenu destroy activated function options if confirm Hide menu with selector options selector true console log Menu Activated events context menu one contextMenu context menu one contextMenu x mousePosition x y mousePosition y async console log ready script Right click context menu dynamically built created at runtime ref http swisnl github io jQuery contextMenu docs html build style ctxmenu position fixed background ghostwhite color black cursor pointer border 1px black solid ctxmenu p padding 0 1rem margin 0 ctxmenu p hover background black color ghostwhite style textarea style width 100 height 100 class context menu one btn btn neutral once upon a time textarea script document body style height 300px function changeword e newword console log changeword this e var textarea document getElementsByTagName textarea 0 var len textarea value length var start textarea selectionStart var end textarea selectionEnd var sel textarea value substring start end Here we are replacing the selected text with this one textarea value textarea value substring 0 start newword textarea value substring end len document getElementById ctxmenu remove async function selectTextCursor ta var startPosition ta selectionStart endPosition ta selectionEnd while A Za z0 9 test ta value charAt startPosition startPosition 0 startPosition while A Za z0 9 test ta value charAt endPosition endPosition ta value length endPosition ta selectionStart startPosition 1 ta selectionEnd endPosition console log ta selectionStart function getSelectionText var text if window getSelection text window getSelection toString else if document selection document selection type Control text document selection createRange text return text prevent the default document querySelector textarea addEventListener contextmenu async function e e preventDefault console log context selectTextCursor e target let selWord getSelectionText let menu document createElement div menu id ctxmenu menu style top e pageY 10 px left e pageX 40 px menu onmouseleave ctxmenu outerHTML menu innerHTML p Option1 p p Option2 p p Option3 p p Option4 p document body appendChild menu let mousePosition mousePosition x e clientX mousePosition y e clientY let word selWord let url https api datamuse com words ml word max 5 let p await fetch url let ret await p json console log url url word word ret ret console log word word let options p Synonyms p for let i 0 i ret length i options p onclick changeword this ret i word ret i word p menu innerHTML options async console log ready script

nu async function e e preventDefault console log context selectTextCursor e target console log window getSelection toString window getSelection toString return let selWord getSelectionText let selWord getTheWord e target selectionStart e target value console log selWord selWord if selWord length 0 return return showing showing if showing return let mousePosition mousePosition x e clientX mousePosition y e clientY let word selWord let url https api datamuse com words ml word max 5 let p await fetch url let ret await p json console log url url word word ret ret console log word word let syn name Synonyms items for let i 0 i ret length i let key syn ret i word let val name ret i word syn items key val console log syn syn let myitems edit name Edit icon edit cut name Cut icon cut sep1 quit name Quit icon quit sep2 word name Word word fold1a syn if ret length 0 delete myitems fold1a let ff callback function key options var m clicked key console log m console log split m split if key split length 1 if key split 0 syn console log replacing word var replace key split 1 var textarea e target var len textarea value length var start textarea selectionStart var end textarea selectionEnd var sel textarea value substring start end Here we are replacing the selected text with this one textarea value textarea value substring 0 start replace textarea value substring end len return true items myitems contextMenu selector context menu one reposition false hideOnSecondTrigger true build function triggerElement e console log building context menu console log myitems myitems return ff x mousePosition x y mousePosition y events show function options console log options options Add class to the menu this addClass currently showing menu Show an alert with the selector of the menu if confirm Open menu with selector options selector true return true else Prevent the menu to be shown return false console log Menu show hide function options if confirm Hide menu with selector options selector true return true else Prevent the menu to be hidden return false console log Menu hide contextMenu destroy activated function options if confirm Hide menu with selector options selector true console log Menu Activated events context menu one contextMenu context menu one contextMenu x mousePosition x y mousePosition y async console log ready script Right click context menu dynamically built created at runtime ref http swisnl github io jQuery contextMenu docs html build style ctxmenu position fixed background ghostwhite color black cursor pointer border 1px black solid ctxmenu p padding 0 1rem margin 0 ctxmenu p hover background black color ghostwhite style textarea style width 100 height 100 class context menu one btn btn neutral once upon a time textarea script document body style height 300px function changeword e newword console log changeword this e var textarea document getElementsByTagName textarea 0 var len textarea value length var start textarea selectionStart var end textarea selectionEnd var sel textarea value substring start end Here we are replacing the selected text with this one textarea value textarea value substring 0 start newword textarea value substring end len document getElementById ctxmenu remove async function selectTextCursor ta var startPosition ta selectionStart endPosition ta selectionEnd while A Za z0 9 test ta value charAt startPosition startPosition 0 startPosition while A Za z0 9 test ta value charAt endPosition endPosition ta value length endPosition ta selectionStart startPosition 1 ta selectionEnd endPosition console log ta selectionStart function getSelectionText var text if window getSelection text window getSelection toString else if document selection document selection type Control text document selection createRange text return text prevent the default document querySelector textarea addEventListener contextmenu async function e e preventDefault console log context selectTextCursor e target let selWord getSelectionText let menu document createElement div menu id ctxmenu menu style top e pageY 10 px left e pageX 40 px menu onmouseleave ctxmenu outerHTML menu innerHTML p Option1 p p Option2 p p Option3 p p Option4 p document body appendChild menu let mousePosition mousePosition x e clientX mousePosition y e clientY let word selWord let url https api datamuse com words ml word max 5 let p await fetch url let ret await p json console log url url word word ret ret console log word word let options p Synonyms p for let i 0 i ret length i options p onclick changeword this ret i word ret i word p menu innerHTML options async console log ready script

2dracecargame
3dplot
a4print
about
acejs
acejs2
acejs3
aessecurity
angularjs
animbackgroundimage
aseformat
assert
asteroidsjs
backgrounds01
backgrounds02
backgrounds03
barnsleyfern
base26
base64
bib
binary
bodypix
bouncy
box2dweb
breakoutjs
browserversion
buslanes
busybutton
bvhreader
calendar
candycrush
candycrush2
canvas
canvas2
canvas3
canvasmandelbrot
canvasmandelbrot2
canvasnumbers
canvaszoom
capsule
changingimages
chaosgame
chaosrandom
chaosrandomhisto
chaosrandomhisto2
chatgptusingopenai
chatgptusingopenai2
chatgptusingopenai3
checkboxtoggle
chinesetiles
classes
classfeatures
clipboardbutton
clonenode
codedropdown
codemirror
codemirror2
collada
colorpick
columnresizer
contextmenu
convnet
cookiebanner
countdown
countdown2
countdown3
crop
css3dbarchart
css3dbarchart2
css3dbook
css3dscene
csscube
csscube2
csscube3
csscubevideos
cssfilelist
csshas
csspulse
cssresizeaspect
cssspin
csszooming
csvtoarray
curleffect
customcheckbox
d3datamap
d3js
d3js10
d3js11
d3js2
d3js3
d3js4
d3js5
d3js6
d3js7
d3js8
d3js9
d3jsanimatedgrid
d3jsarctransition
d3jsarctransition2
d3jsaxis
d3jsaxischanging
d3jsbars
d3jsbrushing
d3jsbuslanes
d3jsbuslanes2
d3jscalendar
d3jscheat
d3jsclock
d3jscloudmap
d3jscogs
d3jscolors
d3jscovid
d3jscovid2
d3jscovid3
d3jsdashboard
d3jsdashboard2
d3jsdashboard3
d3jsdatakeyfunction
d3jsdensity
d3jsdragresizing
d3jsdragresizing2
d3jseach
d3jsease
d3jsevents
d3jsflower
d3jsforcegroups
d3jsforces
d3jsforces2
d3jsfractaltree
d3jsgeo
d3jsgroupbars
d3jsgroups
d3jsheatmap
d3jshex
d3jshierarchies
d3jshierarchies2
d3jshistogram
d3jshistogram2
d3jshistogram3
d3jshistogram4
d3jsinterpolate
d3jsjoin
d3jskmean
d3jskmean2
d3jsline
d3jsline2
d3jsline3
d3jsline4
d3jslinetransition
d3jslinetransition0
d3jslinetransition2
d3jsmaplocations
d3jsmaps
d3jsmaps2
d3jsmaps3
d3jsmisc
d3jsmisc2
d3jsmodule
d3jsmodulecolor
d3jsmultistyles
d3jsnobel
d3jsoverlappinggraphs
d3jspanel
d3jspie
d3jspieinterpolate
d3jssankey
d3jssankey2
d3jsscatter
d3jsshapes
d3jsslider
d3jsspending
d3jsspending2
d3jsspiralplot
d3jsspirograph
d3jssquare
d3jsstack
d3jsstackedbar
d3jsstackedbar2
d3jssunburst
d3jssunmoon
d3jssvglines
d3jssymbols
d3jstimelines
d3jsuk
d3jsvoronoi
d3scatterplot
d3timeline
d3timeline2
datalist
datamuse
date
dblclickhighlight
deviceorientation
dictionaryapi
dockermenu
doodlepad
downloadgif
dragdroplistitems
dragrotateresizediv
dragrotateresizediv2
dragrotateresizediv3
dragrotateresizediv4
dragrotateresizefontsize
dragselectbrush
drawlinesdiv
dropdown
dualquaternionimages
dynamicgrid
easefunctions
easeinterpolate3dplots
echart
echart2
echart3
encapsulation
epubviewer
errorstack
excalidraw
excalidraw2
excalidraw3
excalidraw5
expandable
faker
fetchplus
fileupload
fixedtopbar
fluiddynamics
fluiddynamics2
fluiddynamics3
fluidsmokedynamics
fluidsmokedynamics2
fonts
fonts2
footerbar
fractalmaze
fractalmaze2
fractalnoiseimage
fractals
fractals2
fractaltree
freesvg
fresnel
froggerjs
gantt
gifgiphyapi
gifhex
gltffromscratch
gradients
griditems
griditems2
griditems3
griditems4
gridworms
heat
hexview
hexview2
highlight
icons
icons2
iframes
ik
imagetracertosvg
imgur
inputfile
invadersjs
ipynb
ipynb2
ipynb3
ipynb4
isbn13
isbn2
jpghex
jquery
jquery2
jqueryui
jqueryui2
jsdraganddrop
jsfire
jslint
jsobfuscate
jsraytracer
jstree
jstree2
jszip
jszipimages
jszipread
keyframes
l2dwidget
lda
leftmenu
less
less2
lineargradientimage
linenumbers
loadimagefromfile
makepdf
maps
markdown
markdown2
markdownalerts
markdownalerts2
markdownbookmarks
markovimage
markovpixelblocks
mathjax
matrices
matsandvects
mazegamejs
md2tex
metrotiles
metrowindows
milestones
minkowski2dboxes
misc
misc2
modules
myipdetails
mymodplotly
neataptic
networkstructures
networkstructures2
neural_network_drawshape
neural_network_plot_in_vs_out
neuralnetworkarrays
neuralnetworkblocks
neuralnetworksinewave
neuralnetworksnolibs
neuralnetworkvisualization
number
obj
objtojson
openaiimages
opencv
opencv2
opencv3
opencv4
opencv5
outline
p2
p5fractalleaf
p5fractalshape
p5js
p5js2
p5js3
p5jsanimatedcover
p5mengercube
p5snowflakes
palindrome
panel
parallax
paste
paste2
pasteimgfromurl
pdfjs
pdfjs2
pdfkit
pdfkit2
pdfkit3
pdfkit4
pdfkit5
pdfkit6
pdfmake
pdfmake2
pdfmake3
pdfmake4
pdfmake5
pdfmake6
perlin
perlin2
perlin3
perspective
pexels
pixelgridpattern
playground
plotly
plotlynoise
plotlyranddist
plyloader
plyloader2
pngtxtencoder
pongjs
pptxgenjs
prettycode
prism
prn
problems
progress
pseudorandom
px2svg
python
quotes
racergame
random
randomcalcpie
randomgenerator
randomprofilepatterns
randomsinhistogram
randomstring
rating
rayambient
raymonte
raymonteprogressive
raymonteprogressive2
raymontewarmstart
reexpcross
reexpcross2
regex
regexbib
regexpfixbib
regexpmultiline
repeatwordsregexp
resizabletable
resizabletable2
revealjs
revealjs2
revealjsmulti
ritalanguage
ritalanguage2
ritalanguage3
rotateimg
rough
rsapublicprivatekeys
rss
rss2
sankey
scrappingsvg
scrolltext
scrolltext2
scrollwidth
sdf2dcanvas
sdfboxinboxtwist
sdfchessbishop
sdfchessking
sdfchessknight
sdfchesspawn
sdfchessqueen
sdfchessrook
sdfhollowbox
setintervalexception
shareurl
shuffle
sidecomment
similarity
simplehighlighter
simpleplatformgamejs
sinecanvas
sliderpopout
slides
smileys
snowfall
snowman
sound
soundsignal
sphererayintersection
springs
sqljs
steganography
stereogram
stringmatching
sudoku
sudoku2
sudoku3
svg
svgchaos
svgdragresize
svgdragresize2
svgdragresize3
svgdragrotate
svgdrawing
svglines
svglines2
svglines3
svglines4
svglines5
svglinesmandelbrot
svgpathsdragrotate
svgpathsdragrotateresize
svgpie
svgpie2
svgpie3
svgpiepath
svgpiepath2
svgrandomfaces
symbols
synaptic
synaptic2
synonyms
tablerotatecells
tablerotatecells2
tablerotatecells3
tablerotatecells3b
tablerotatecells4
tables
tablezebra
tabularjs
tabularjs2
tabulatordownload
tagcanvas
tensorflowgan
tensorflowjs
tensorflowjsbasic
tensorflowjscnn
tensorflowjssinewave
tensorflowjssound
tensorflowmobilenet
tetrahedronfractal
tetrahedronfractalfolding
tetris
textarea
textareaauto
textareadiv
textareadiv2
textmaskimage
theirorthere
thesaurus
threejs
threejs2
threejs3
threejs4
threejsgltf
threejstokyo
tiles
toaster
tooltip
transition
transitionexpandabledropdown
treeview
treeview2
tricks
tshirt
tshirt2
tshirt3
turningpages
unsplash
urlblob
urlblob2
userdefinepoints
vector
videos
videos2
visualsort
vue
w2ui
w2uientertextdialog
webcam
webgl
webgl2
webgl3
webgl4
webgl5
webglbasic1
webglbasic2
webglcube
webglfov
webglfrustum
webgljson
webglleaves
webgllighting
webglorthographic
webglpoints1
webglpoints2
webglpoints3
webglsquare
webgltexture1
webgltexture2
webgltexture3
webgltransforms
webgltriangle
webgpu
webgpu10
webgpu11
webgpu12
webgpu13
webgpu14
webgpu15
webgpu16
webgpu17
webgpu2
webgpu3
webgpu4
webgpu5
webgpu6
webgpu7
webgpu8
webgpu9
webgpubars
webgpubuffers
webgpubuffers2
webgpucellnoise
webgpuclouds
webgpuclydescope
webgpucompute
webgpucubemap
webgpucubemap2
webgpudeferred
webgpudepth
webgpudof
webgpudrops
webgpuetha
webgpufire
webgpufractalcubes
webgpuglassrain
webgpugltf
webgpugltf2
webgpugrass
webgpugrid
webgpukernel
webgpukleinian
webgpulabupdates
webgpulighting
webgpumandelbrot
webgpumeta3d
webgpumetaballs
webgpumouse
webgpunoise
webgpunormalmapping
webgpuobj
webgpuparallax
webgpuparallax2
webgpuparallax3
webgpuparallaxshadow
webgpuparallaxshadow2
webgpupixel
webgpuquad
webgpuray1
webgpuraytracing
webgpuraytracing2
webgpushadowmaps
webgpushadowmaps2
webgpusierpinski2d
webgpusierpinski3d
webgpusinusoid
webgpussao
webgpustadiumobj
webgpuswirl
webgputestpipe3
webgputoon
webgputopology
webgputt
webgpuvolcloud
webgpuwater
webgpuwireframe
webgpuwireframe2
webpcanvas
webworkers
webxr
webxr2
wiggly
wikipedia