mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 12:20:08 +00:00
disabled clipboard events in browser, added nw.js triggering, still not sure if we actually need them...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
56626a3480
commit
219726e71b
@ -148,6 +148,9 @@ var BrowserPrototype = {
|
|||||||
'/',
|
'/',
|
||||||
'A',
|
'A',
|
||||||
|
|
||||||
|
'C',
|
||||||
|
'V',
|
||||||
|
'X',
|
||||||
],
|
],
|
||||||
|
|
||||||
Enter: 'stopFullPathEdit!',
|
Enter: 'stopFullPathEdit!',
|
||||||
@ -168,6 +171,10 @@ var BrowserPrototype = {
|
|||||||
'Esc',
|
'Esc',
|
||||||
'/',
|
'/',
|
||||||
'A',
|
'A',
|
||||||
|
|
||||||
|
'C',
|
||||||
|
'V',
|
||||||
|
'X',
|
||||||
],
|
],
|
||||||
|
|
||||||
Enter: 'action!',
|
Enter: 'action!',
|
||||||
@ -1239,23 +1246,33 @@ var BrowserPrototype = {
|
|||||||
})
|
})
|
||||||
.keyup(function(){
|
.keyup(function(){
|
||||||
var e = $(this)
|
var e = $(this)
|
||||||
|
// clear the list on edit...
|
||||||
if(e.attr('contenteditable') && e.text() != dom.attr('orig-path')){
|
if(e.attr('contenteditable') && e.text() != dom.attr('orig-path')){
|
||||||
dom.find('.list').empty()
|
dom.find('.list').empty()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// handle paste...
|
/* XXX
|
||||||
|
// Handle copy/paste...
|
||||||
|
//
|
||||||
|
// Make the whole widget support copy/paste of current path.
|
||||||
|
//
|
||||||
|
// NOTE: on nw.js mode this will handle this via keyboard
|
||||||
|
// directly, skipping the events and their quirks...
|
||||||
|
//
|
||||||
// XXX does not work on IE yet...
|
// XXX does not work on IE yet...
|
||||||
// XXX do we handle other types???
|
// XXX do we handle other types???
|
||||||
// ...try an get the path of anything...
|
// ...try and get the path of anything, including files, dirs, etc...
|
||||||
// XXX seems not to work until we cycle any of the editable
|
// XXX seems not to work until we cycle any of the editable
|
||||||
// controls (filter/path), and then it still is on and
|
// controls (filter/path), and then it still is on and
|
||||||
// off...
|
// off...
|
||||||
.on('paste', function(){
|
// XXX does not work with ':not([contenteditable])' and kills
|
||||||
|
// copy/paste on editable fields without...
|
||||||
|
// XXX do we bother with these??
|
||||||
|
.on('paste', ':not([contenteditable])', function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
that.paste()
|
that.paste()
|
||||||
})
|
})
|
||||||
// XXX handle copy...
|
// XXX does not work...
|
||||||
/* XXX
|
|
||||||
.on('cut copy', function(){
|
.on('cut copy', function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
that.copy()
|
that.copy()
|
||||||
@ -1281,6 +1298,25 @@ var BrowserPrototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// nw.js copy/paste handling...
|
||||||
|
//
|
||||||
|
// XXX not sure if we actually need these...
|
||||||
|
if(NW){
|
||||||
|
// override copy...
|
||||||
|
BrowserPrototype.keyboard.General.C = {
|
||||||
|
ctrl: 'copy!',
|
||||||
|
}
|
||||||
|
BrowserPrototype.keyboard.General.X = 'C'
|
||||||
|
|
||||||
|
// override paste...
|
||||||
|
BrowserPrototype.keyboard.General.V = {
|
||||||
|
ctrl: 'paste!',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var Browser =
|
var Browser =
|
||||||
module.Browser =
|
module.Browser =
|
||||||
object.makeConstructor('Browser',
|
object.makeConstructor('Browser',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user