added save status indicator + some ui tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-09 00:10:11 +03:00
parent daa462184b
commit 4d3fb9b46a
3 changed files with 43 additions and 12 deletions

View File

@ -1283,6 +1283,19 @@ stretching in width... */
opacity: 0.6; opacity: 0.6;
} }
*/ */
.overlay-info .ribbon-number[base] {
/* NOTE: we are using shadow instead of a border or underline
here as we need to control both the uniform shading and
placement without overcomplicating things when having
to compensate for alignment... */
//border-bottom: solid 2px yellow;
box-shadow: 0 -2px 0 0 yellow inset;
}
/* changes */
.overlay-info .changes {
cursor: default;
}
/* gid */ /* gid */
.overlay-info .gid { .overlay-info .gid {

View File

@ -133,7 +133,8 @@ module.GLOBAL_KEYBOARD = {
R: { R: {
default: 'rotateCW', default: 'rotateCW',
shift: 'reverseImages', shift: 'reverseImages',
ctrl: 'reload!', ctrl: 'loadNewImages!',
'ctrl+alt': 'reload!',
'ctrl+shift': 'F5', 'ctrl+shift': 'F5',
}, },
L: 'rotateCCW', L: 'rotateCCW',

View File

@ -56,6 +56,7 @@ var StatusBarActions = actions.Actions({
'status-bar-items': [ 'status-bar-items': [
'index', 'index',
'ribbon', 'ribbon',
'changes',
'gid', 'gid',
'path', 'path',
@ -100,7 +101,7 @@ var StatusBarActions = actions.Actions({
// not-editable... // not-editable...
$('<span>') $('<span>')
.addClass('position') .addClass('position')
.attr('info', 'Image position (click to toggle ribbon/global)') .attr('info', 'Image number (click to toggle ribbon/global)')
// toggle index state... // toggle index state...
.click(function(){ .click(function(){
that.toggleStatusBarIndexMode() that.toggleStatusBarIndexMode()
@ -109,7 +110,7 @@ var StatusBarActions = actions.Actions({
// editable... // editable...
: $('<span>') : $('<span>')
.addClass('position editable') .addClass('position editable')
.attr('info', 'Image position (click to edit)') .attr('info', 'Image number (click to edit)')
.makeEditable() .makeEditable()
// select image when done... // select image when done...
.on('edit-done', function(_, text){ .on('edit-done', function(_, text){
@ -143,7 +144,7 @@ var StatusBarActions = actions.Actions({
})) }))
.append($('<span>') .append($('<span>')
.addClass('length') .addClass('length')
.attr('info', 'Image position (click to toggle ribbon/global)') .attr('info', 'Image count (click to toggle ribbon/global)')
// toggle index state... // toggle index state...
.click(function(){ .click(function(){
that.toggleStatusBarIndexMode() that.toggleStatusBarIndexMode()
@ -186,12 +187,6 @@ var StatusBarActions = actions.Actions({
var n = (this.data && this.data.ribbon_order.length > 0) ? var n = (this.data && this.data.ribbon_order.length > 0) ?
this.data.getRibbonOrder(gid || this.current) this.data.getRibbonOrder(gid || this.current)
: '-' : '-'
// flag the base ribbon...
n += (this.data
&& this.data.base
&& this.data.getRibbon(gid) == this.base) ?
'*'
: ''
// make an element... // make an element...
if(typeof(item) == typeof('str')){ if(typeof(item) == typeof('str')){
@ -210,7 +205,29 @@ var StatusBarActions = actions.Actions({
}) })
} }
item.text(n) item.html(n)
// flag the base ribbon...
// NOTE: for some reason can't get jQuery .prop(..)/.removeProp(..)
// to work here...
if(this.data && this.data.base
&& this.data.getRibbon(gid) == this.base){
item[0].setAttribute('base', '')
} else {
item[0].removeAttribute('base')
}
return item
},
changes: function(item, gid, img){
if(typeof(item) == typeof('str')){
item = $('<span>')
.addClass('changes')
.attr('info', 'Unsaved changes')
}
item.text(this.changes !== false ? '*' : '')
return item return item
}, },
@ -504,7 +521,7 @@ module.StatusBar = core.ImageGridFeatures.Feature({
function(){ function(){
this.toggleStatusBar(this.config['status-bar-mode']) this.toggleStatusBar(this.config['status-bar-mode'])
}], }],
['focusImage clear', ['focusImage clear markChanged',
function(){ function(){
this.updateStatusBar() this.updateStatusBar()
}], }],