diff --git a/ui/editor.js b/ui/editor.js index 9162998f..c3d98f7f 100755 --- a/ui/editor.js +++ b/ui/editor.js @@ -48,7 +48,10 @@ var toggleEditor = createCSSClassToggler( $('.viewer') .append(makeSidePanel('left')) .append(makeSidePanel('right')) - .append(_setupPanel(makeEditorControls('.current.image')) + .append(_setupPanel(openGroupedPanels([ + 'Edit: Filters', + 'Edit: Snapshots' + ])) //.draggable('option', 'snap', '.viewer') .css({ // prevent the editor from moving under @@ -58,16 +61,8 @@ var toggleEditor = createCSSClassToggler( top: '50px', left: '5px', })) - // XXX add handlers for saving data to images... - // XXX - // setup the event to update the editor... - .on('focusingImage', function(){ - if(toggleEditor('?') == 'on'){ - // XXX save previous settings if changes... - // XXX - reloadControls('.current.image') - } - }) + // XXX add handlers for saving data to images... + // XXX // show the editor... } else { ed.show() diff --git a/ui/experiments/panels.html b/ui/experiments/panels.html index 8cd72efe..1f8c6b8b 100755 --- a/ui/experiments/panels.html +++ b/ui/experiments/panels.html @@ -69,9 +69,11 @@ $(function(){ makeSubPanel('Test Sub Panel B', $('

Panel B

'), panel, true) makeSubPanel('Test Sub Panel C', $('

Panel C

'), panel, false) - - makeFilterPanel(panel, '.moo') - makeSnapshotsPanel(panel, '.moo') + openGroupedPanels([ + 'Edit: Filters', + 'Edit: Snapshots' + ], + panel) makeSubPanel('Test Sub Panel D', $('

Panel D

')) .parents('.panel') @@ -81,7 +83,7 @@ $(function(){ }) - makePanelController('Test Sub Panel E', + Panel('Test Sub Panel E', function(){ return $('

Panel E

') }, diff --git a/ui/lib/editor.js b/ui/lib/editor.js index f6f091a9..d1948970 100755 --- a/ui/lib/editor.js +++ b/ui/lib/editor.js @@ -248,94 +248,122 @@ function makeLogRange(text, filter, target){ /********************************************************************** -* Panels... +* Constructors... */ -function makeFilterPanel(parent, target, open){ - return makeSubPanel('Edit: Filters', - $('
') - .append($('
') - //.append(makeLogRange('Gamma:', 'gamma', target)) - .append(makeLogRange('Brightness:', 'brightness', target)) - .append(makeLogRange('Contrast:', 'contrast', target)) - .append(makeLogRange('Saturation:', 'saturate', target)) - .append(makeAbsRange('Hue:', 'hue-rotate', target, - -180, 180, 0, 0.5, function(v){ return v+'deg' })) - .append(makeAbsRange('Grayscale:', 'grayscale', target)) - .append(makeAbsRange('Invert:', 'invert', target)) - .append(makeAbsRange('Sepia:', 'sepia', target)) - .sortable({ - axis: 'y', - }) - .on('sortstop', function(){ - // update image filter order... - var img = $(target) - img.css('-webkit-filter', sortFilterStr(img.css('-webkit-filter'))) - })) - .append($('
')) - .append('Reset: ') - .append($('') - .click(function(){ - $('.reset').click() - })) - .append($('') - .click(function(){ - sortFilterSliders(DEFAULT_FILTER_ORDER) - })) - .append($('') - .click(function(){ - $('.reset').click() - sortFilterSliders(DEFAULT_FILTER_ORDER) - })) - .children(), - parent, open) -} - -function makeSnapshotsPanel(parent, target, open){ - return makeSubPanel('Edit: Snapshots', - $('
') - .append($('
')) - .append($('
')) - .append($('') + .click(function(){ + $('.reset').click() + })) + .append($('') + .click(function(){ + sortFilterSliders(DEFAULT_FILTER_ORDER) + })) + .append($('') + .click(function(){ + $('.reset').click() + sortFilterSliders(DEFAULT_FILTER_ORDER) + })) + .children() } -// XXX add panel update events to help save settings... -function makeEditorControls(target){ - - var panel = makePanel() - - // filters... - makeFilterPanel(panel, target) - - // snapshots... - makeSnapshotsPanel(panel, target) - - return panel +function buildSnapshotsUI(target){ + return $('
') + .append($('
')) + .append($('
')) + .append($('