mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
more minor tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8695b62a02
commit
4e76cbbb60
32
ui/data.js
32
ui/data.js
@ -656,8 +656,12 @@ function loadFileImages(path, callback){
|
|||||||
|
|
||||||
callback != null && callback()
|
callback != null && callback()
|
||||||
})
|
})
|
||||||
|
.fail(function(){
|
||||||
|
console.error('ERROR LOADING:', path)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadFile(data_path, image_path, callback){
|
function loadFile(data_path, image_path, callback){
|
||||||
// CEF
|
// CEF
|
||||||
return $.getJSON(data_path)
|
return $.getJSON(data_path)
|
||||||
@ -695,8 +699,12 @@ function loadFile(data_path, image_path, callback){
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.fail(function(){
|
||||||
|
console.error('ERROR LOADING:', data_path)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function saveFile(name){
|
function saveFile(name){
|
||||||
// CEF
|
// CEF
|
||||||
if(window.CEF_dumpJSON != null){
|
if(window.CEF_dumpJSON != null){
|
||||||
@ -716,7 +724,7 @@ function saveFile(name){
|
|||||||
|
|
||||||
function openImage(){
|
function openImage(){
|
||||||
// CEF
|
// CEF
|
||||||
if(window.CEF_dumpJSON != null){
|
if(window.CEF_runSystem != null){
|
||||||
// XXX if path is not present try and open the biggest preview...
|
// XXX if path is not present try and open the biggest preview...
|
||||||
return CEF_runSystem(IMAGES[getImageGID()].path)
|
return CEF_runSystem(IMAGES[getImageGID()].path)
|
||||||
|
|
||||||
@ -727,22 +735,20 @@ function openImage(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XXX need revision...
|
||||||
function loadDir(path){
|
function loadDir(path){
|
||||||
// CEF
|
return loadFile(path +'/data.json')
|
||||||
if(window.CEF_loadDir != null){
|
.fail(function(){
|
||||||
var dir = CEF_loadDir(path)
|
loadFile(path +'/.ImageGrindCache/data.json')
|
||||||
IMAGES = dir.images
|
.fail(function(){
|
||||||
DATA = dir.data
|
// XXX load separate images...
|
||||||
MARKED = dir.marked
|
// XXX
|
||||||
loadData()
|
})
|
||||||
|
})
|
||||||
// PhoneGap
|
|
||||||
} else if(false) {
|
|
||||||
// XXX
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Image caching...
|
* Image caching...
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -343,19 +343,10 @@ $(function(){
|
|||||||
|
|
||||||
// we have an image file...
|
// we have an image file...
|
||||||
if((DATA_ATTR + '_IMAGES_FILE') in localStorage){
|
if((DATA_ATTR + '_IMAGES_FILE') in localStorage){
|
||||||
loadFileImages(localStorage[DATA_ATTR + '_IMAGES_FILE'])
|
var loading = loadFileImages(localStorage[DATA_ATTR + '_IMAGES_FILE'])
|
||||||
.done(function(){
|
.done(function(){
|
||||||
DATA = loadLocalStorageData()
|
DATA = loadLocalStorageData()
|
||||||
loadData()
|
loadData()
|
||||||
|
|
||||||
// XXX this will reload everything...
|
|
||||||
if('MARKED' in localStorage){
|
|
||||||
loadLocalStorageMarks()
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX stub...
|
|
||||||
//centerView(focusImage($('.image').first()), 'css')
|
|
||||||
updateImages()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -370,17 +361,21 @@ $(function(){
|
|||||||
IMAGES = DATA.images
|
IMAGES = DATA.images
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
var loading = $.Deferred().resolve()
|
||||||
// XXX this will reload everything...
|
|
||||||
if('MARKED' in localStorage){
|
|
||||||
loadLocalStorageMarks()
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX stub...
|
|
||||||
//centerView(focusImage($('.image').first()), 'css')
|
|
||||||
updateImages()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loading
|
||||||
|
.done(function(){
|
||||||
|
// XXX this will reload everything...
|
||||||
|
if('MARKED' in localStorage){
|
||||||
|
loadLocalStorageMarks()
|
||||||
|
}
|
||||||
|
|
||||||
|
// XXX stub...
|
||||||
|
//centerView(focusImage($('.image').first()), 'css')
|
||||||
|
updateImages()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user