From 005c030d794d87603ca4d5dd49c60a9aa03cc6e6 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 14 Dec 2016 02:06:50 +0300 Subject: [PATCH] added ribbon count to ribbon status indicator... Signed-off-by: Alex A. Naanou --- ui (gen4)/css/layout.less | 9 +++++++- ui (gen4)/features/ui-status.js | 37 +++++++++++++++++++++------------ ui (gen4)/ui.js | 1 + 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ui (gen4)/css/layout.less b/ui (gen4)/css/layout.less index 244ddf04..c07c2c16 100755 --- a/ui (gen4)/css/layout.less +++ b/ui (gen4)/css/layout.less @@ -1394,7 +1394,7 @@ stretching in width... */ opacity: 0.6; } */ -.overlay-info .ribbon-number[base] { +.overlay-info .ribbon-index[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 @@ -1402,6 +1402,13 @@ stretching in width... */ //border-bottom: solid 2px yellow; box-shadow: 0 -2px 0 0 yellow inset; } +.overlay-info .ribbon-count { + opacity: 0.3; + font-size: small; +} +.overlay-info .ribbon-count:before { + content: "/"; +} /* changes */ .overlay-info .changes { diff --git a/ui (gen4)/features/ui-status.js b/ui (gen4)/features/ui-status.js index b1431b99..96b02cfe 100755 --- a/ui (gen4)/features/ui-status.js +++ b/ui (gen4)/features/ui-status.js @@ -187,25 +187,36 @@ var StatusBarActions = actions.Actions({ var n = (this.data && this.data.ribbon_order.length > 0) ? this.data.getRibbonOrder(gid || this.current) : '-' + var t = this.data ? this.data.ribbon_order.length : null // make an element... if(typeof(item) == typeof('str')){ item = $('') - .addClass('ribbon-number') - .attr('info', 'Current ribbon (click to edit)') - .makeEditable() - .on('edit-done', function(_, text){ - that.focusRibbon(text == '*' ? that.base : parseInt(text)) - }) - .focus(function(){ - $(this).selectText() - }) - .blur(function(){ - that.updateStatusBar() - }) + .addClass('ribbon-index') + .append($('') + .addClass('ribbon-number') + .attr('info', 'Current ribbon (click to edit)') + .makeEditable() + .on('edit-done', function(_, text){ + that.focusRibbon(text == '*' ? that.base : parseInt(text)) + }) + .focus(function(){ + $(this).selectText() + }) + .blur(function(){ + that.updateStatusBar() + })) + .append($('') + .addClass('ribbon-count') + .attr('info', 'Number of ribbons')) } - item.html(n) + item + .find('.ribbon-number') + .html(n) + .end() + .find('.ribbon-count') + .html(t || '') // flag the base ribbon... // NOTE: for some reason can't get jQuery .prop(..)/.removeProp(..) diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 279ca6cd..c13d3aed 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -113,6 +113,7 @@ $(function(){ 'experiments', //'-commandline', + //'-ui-partial-ribbons', // XXX BUG: disabling features on this level does not // work, yet works deeper down...