mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 01:40:08 +00:00
now export history items are unique...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
42ead16808
commit
06244ddbbe
@ -3507,20 +3507,37 @@ var FileSystemWriterUIActions = actions.Actions({
|
||||
|
||||
exportHistoryPush: ['- File/',
|
||||
function(settings){
|
||||
settings = settings
|
||||
|| this.config['export-settings']
|
||||
//settings = settings
|
||||
// || this.config['export-settings']
|
||||
var l = this.config['export-history-length'] || 50
|
||||
var history =
|
||||
this.config['export-history'] =
|
||||
this.config['export-history'] || []
|
||||
// add...
|
||||
settings
|
||||
&& history.push(Object.assign(
|
||||
if(settings){
|
||||
// set .date...
|
||||
settings = Object.assign(
|
||||
JSON.parse(JSON.stringify( settings )),
|
||||
{
|
||||
date: Date.timeStamp(true),
|
||||
}))
|
||||
// trim the history...
|
||||
{ date: Date.timeStamp(true) })
|
||||
// remove all identical settings from history...
|
||||
var keys_l = Object.keys(settings).length
|
||||
for(var i=history.length-1; i >= 0; i--){
|
||||
var item = history[i]
|
||||
if(keys_l != Object.keys(item).length){
|
||||
continue }
|
||||
var match = true
|
||||
for(var k in settings){
|
||||
// ignore .date...
|
||||
if(k == 'date'){
|
||||
continue }
|
||||
if(item[k] != settings[k]){
|
||||
match = false
|
||||
break } }
|
||||
match
|
||||
&& history.splice(i, 1) }
|
||||
// add...
|
||||
history.push(settings) }
|
||||
// trim the history list to length...
|
||||
history.length > l
|
||||
&& history.splice(0, history.length - l) }],
|
||||
clearExportHistory: ['- File/Clear export history',
|
||||
|
||||
4
Viewer/package-lock.json
generated
4
Viewer/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ImageGrid.Viewer.g4",
|
||||
"version": "4.0.11a",
|
||||
"version": "4.0.13a",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ImageGrid.Viewer.g4",
|
||||
"version": "4.0.11a",
|
||||
"version": "4.0.13a",
|
||||
"dependencies": {
|
||||
"app-module-path": "*",
|
||||
"async-json": "0.0.2",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ImageGrid.Viewer.g4",
|
||||
"main": "index.html",
|
||||
"version": "4.0.12a",
|
||||
"version": "4.0.13a",
|
||||
"author": "Alex A. Naanou <alex.nanou@gmail.com> (https://github.com/flynx)",
|
||||
"contributors": [],
|
||||
"repository": "github:flynx/ImageGrid",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user