more tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-12-12 04:29:55 +03:00
parent 903105efb7
commit aab3a04cb6
4 changed files with 15 additions and 3 deletions

View File

@ -275,6 +275,7 @@ module.makeImageSeqOrNameCmp = function(data, get, seq){
/*********************************************************************/
// XXX depends on jli.quoteRegExp(..)
var ImagesClassPrototype =
module.ImagesClassPrototype = {
// XXX populate the image doc better...
@ -284,7 +285,8 @@ module.ImagesClassPrototype = {
var images = new this()
// XXX stub...
var i = 0
var base_pattern = base ? RegExp('^' + base) : null
//var base_pattern = base ? RegExp('^' + base) : null
var base_pattern = base ? RegExp('^' + quoteRegExp(base)) : null
data.forEach(function(path){
var gid = hash('I'+i)
// XXX populate the image doc better...

View File

@ -1193,6 +1193,10 @@ function assyncCall(func){
return _func
}
// Quote a string and convert to RegExp to match self literally.
function quoteRegExp(str){
return str.replace(/([\.\\\/\(\)\[\]\$\*\+\-\{\}\@\^\&\?\<\>])/g, '\\$1')
}
/**********************************************************************

View File

@ -36,10 +36,12 @@ var quoteWS = function(str){
// Quote a string and convert to RegExp to match self literally.
// XXX this depends on jli.quoteRegExp(..)
function toRegExp(str){
return RegExp('^'
// quote regular expression chars...
+str.replace(/([\.\\\/\(\)\[\]\$\*\+\-\{\}\@\^\&\?\<\>])/g, '\\$1')
+quoteRegExp(str)
//+str.replace(/([\.\\\/\(\)\[\]\$\*\+\-\{\}\@\^\&\?\<\>])/g, '\\$1')
+'$')
}

View File

@ -1006,8 +1006,10 @@ actions.Actions({
// move to a more logical spot...
'max-key-repeat-rate': 0,
// Theme to set on startup...
'theme': null,
// Supported themes...
'themes': [
'gray',
'dark',
@ -3717,7 +3719,9 @@ module.AppControl = ImageGridFeatures.Feature({
if(this.images){
var img = this.images[this.current]
win.title = 'ImageGrid.Viewer: '+ (img.name || img.path)
win.title = 'ImageGrid.Viewer: '
+ (img.name
|| img.path.replace(/\.[\\\/]/, ''))
}
}],
],