mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
reworked filename handling...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
71c4259746
commit
3efc6fb05e
@ -227,7 +227,8 @@ module.FileSystemInfo = core.ImageGridFeatures.Feature({
|
||||
// NOTE: this will also manage .location.from
|
||||
var FileSystemLoaderActions = actions.Actions({
|
||||
config: {
|
||||
'image-file-pattern': '*+(jpg|jpeg|png|svg|JPG|JPEG|PNG|svg)',
|
||||
// XXX BUG: for some reason this does not match/see '.jpg' filename...
|
||||
'image-file-pattern': '*.@(jpg|jpeg|png|svg|JPG|JPEG|PNG|svg)',
|
||||
|
||||
'image-file-read-stat': true,
|
||||
'image-file-skip-previews': false,
|
||||
@ -2165,10 +2166,10 @@ var FileSystemWriterActions = actions.Actions({
|
||||
var img_name = pathlib.basename(img.path || (img.name + img.ext))
|
||||
|
||||
// get best preview...
|
||||
var from = decodeURI(
|
||||
(img.base_path || base_dir)
|
||||
var from = (img.base_path || base_dir)
|
||||
+'/'
|
||||
+ that.images.getBestPreview(gid, size).url)
|
||||
+ that.images.getBestPreview(gid, size).url
|
||||
|
||||
|
||||
// XXX see if we need to make a preview (sharp)
|
||||
// XXX
|
||||
|
||||
@ -465,6 +465,9 @@ module.ImagesPrototype = {
|
||||
[img.base_path || path, img.path].join('/')
|
||||
: util.path2url(img.path)
|
||||
},
|
||||
// NOTE: actual URL decoding and encoding is not done here to keep
|
||||
// things consistent, rather it is done the the latest possible
|
||||
// stage, in images._loadImagePreviewURL(..)
|
||||
// XXX see: ribbons.js for details...
|
||||
// XXX this is the same (in part) as .getImagePath(..)
|
||||
getBestPreview: function(gid, size, img_data, full_path){
|
||||
@ -484,8 +487,7 @@ module.ImagesPrototype = {
|
||||
}
|
||||
|
||||
var s
|
||||
// XXX not sure about encodeURI(..) here...
|
||||
var url = encodeURI(util.path2url(img_data.path))
|
||||
var url = img_data.path
|
||||
var preview_size = 'Original'
|
||||
var p = Infinity
|
||||
var previews = img_data.preview || {}
|
||||
@ -499,9 +501,8 @@ module.ImagesPrototype = {
|
||||
}
|
||||
}
|
||||
return {
|
||||
//url: normalizePath(url),
|
||||
url: (full_path && img_data.base_path ?
|
||||
util.path2url(img_data.base_path) + '/'
|
||||
img_data.base_path + '/'
|
||||
: '')
|
||||
+ url,
|
||||
size: preview_size
|
||||
|
||||
@ -1596,7 +1596,6 @@ var RibbonsPrototype = {
|
||||
if(old_gid != gid
|
||||
// the new preview (p_url) is different to current...
|
||||
// NOTE: this may not work correctly for relative urls...
|
||||
//|| image.css('background-image').indexOf(encodeURI(p_url)) < 0){
|
||||
|| image.css('background-image').indexOf(util.path2url(p_url)) < 0){
|
||||
// sync load...
|
||||
if(sync){
|
||||
|
||||
@ -201,7 +201,7 @@ function(path){
|
||||
//.map(encodeURIComponent)
|
||||
.join('/')
|
||||
// NOTE: keep '%' the first...
|
||||
//.replace(/%/g, '%25')
|
||||
.replace(/%/g, '%25')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/&/g, '%26'))
|
||||
}
|
||||
|
||||
@ -1777,11 +1777,10 @@ var BrowserPrototype = {
|
||||
// .menu()
|
||||
// -> this
|
||||
//
|
||||
// Trigger menu event on pattern item...
|
||||
// Select and trigger menu event on selected item...
|
||||
// .menu(pattern)
|
||||
// -> this
|
||||
//
|
||||
// NOTE: pattern is .select(..) compatible pattern.
|
||||
menu: function(){
|
||||
arguments[0] instanceof Function ?
|
||||
this.dom.on('menu', arguments[0])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user