mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 11:50:07 +00:00
added experimental image commenting, still not full implemented...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3fbb161de6
commit
d020318fe7
@ -616,6 +616,8 @@ var KEYBOARD_CONFIG = {
|
|||||||
// marking...
|
// marking...
|
||||||
ctrl: 'invert-marks',
|
ctrl: 'invert-marks',
|
||||||
},
|
},
|
||||||
|
// XXX this is not permanent...
|
||||||
|
C: doc('Edit image comment', imageCommentDialog),
|
||||||
P: {
|
P: {
|
||||||
default: doc('Show options',
|
default: doc('Show options',
|
||||||
function(){ toggleOptionsUI() }),
|
function(){ toggleOptionsUI() }),
|
||||||
|
|||||||
30
ui/ui.js
30
ui/ui.js
@ -382,6 +382,7 @@ var FIELD_TYPES = {
|
|||||||
// format:
|
// format:
|
||||||
// string
|
// string
|
||||||
// XXX add datalist option...
|
// XXX add datalist option...
|
||||||
|
// XXX make this textarea compatible...
|
||||||
text: {
|
text: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
text: null,
|
text: null,
|
||||||
@ -962,6 +963,7 @@ function sortImagesDialog(message){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XXX get EXIF...
|
||||||
function showImageInfo(){
|
function showImageInfo(){
|
||||||
var gid = getImageGID(getImage())
|
var gid = getImageGID(getImage())
|
||||||
var r = getRibbonIndex(getRibbon())
|
var r = getRibbonIndex(getRibbon())
|
||||||
@ -972,6 +974,8 @@ function showImageInfo(){
|
|||||||
flipped = flipped == null ? '' : ', flipped '+flipped+'ly'
|
flipped = flipped == null ? '' : ', flipped '+flipped+'ly'
|
||||||
var order = DATA.order.indexOf(gid)
|
var order = DATA.order.indexOf(gid)
|
||||||
var name = data.path.split('/').pop()
|
var name = data.path.split('/').pop()
|
||||||
|
var comment = data.comment
|
||||||
|
comment = comment == null ? '' : comment
|
||||||
|
|
||||||
alert('<div>'+
|
alert('<div>'+
|
||||||
'<h2>"'+ name +'"</h2>'+
|
'<h2>"'+ name +'"</h2>'+
|
||||||
@ -984,11 +988,37 @@ function showImageInfo(){
|
|||||||
'<tr><td>Position (ribbon): </td><td>'+ (DATA.ribbons[r].indexOf(gid)+1) +
|
'<tr><td>Position (ribbon): </td><td>'+ (DATA.ribbons[r].indexOf(gid)+1) +
|
||||||
'/'+ DATA.ribbons[r].length +'</td></tr>'+
|
'/'+ DATA.ribbons[r].length +'</td></tr>'+
|
||||||
'<tr><td>Position (global): </td><td>'+ (order+1) +'/'+ DATA.order.length +'</td></tr>'+
|
'<tr><td>Position (global): </td><td>'+ (order+1) +'/'+ DATA.order.length +'</td></tr>'+
|
||||||
|
'<tr><td colspan="2"><hr></td></tr>'+
|
||||||
|
'<tr><td>Comment: </td><td class="comment">'+ comment +'</td></tr>'+
|
||||||
'</table>'+
|
'</table>'+
|
||||||
'</div>')
|
'</div>')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XXX use a text area instead of a text field...
|
||||||
|
function imageCommentDialog(){
|
||||||
|
var gid = getImageGID()
|
||||||
|
var data = IMAGES[gid]
|
||||||
|
var name = data.path.split('/').pop().split('.')[0]
|
||||||
|
var comment = data.comment
|
||||||
|
comment = comment == null ? '' : comment
|
||||||
|
|
||||||
|
return formDialog(null, name +' Comment:',
|
||||||
|
{'': comment},
|
||||||
|
'Save',
|
||||||
|
'imageCommentDialog')
|
||||||
|
.done(function(res){
|
||||||
|
comment = res['']
|
||||||
|
if(comment.trim() == ''){
|
||||||
|
delete data.comment
|
||||||
|
} else {
|
||||||
|
data.comment = comment
|
||||||
|
}
|
||||||
|
IMAGES_UPDATED.push(gid)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* vim:set ts=4 sw=4 nowrap : */
|
* vim:set ts=4 sw=4 nowrap : */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user