|
@@ -1,4 +1,16 @@
|
|
|
+setup.mediaPathRawToString = function(rawPath:ImagePath){
|
|
|
+ if(typeof rawPath === "string")
|
|
|
+ return rawPath;
|
|
|
+ if(Array.isArray(rawPath)){
|
|
|
+ const string:string = rawPath[0].toString();
|
|
|
+ const max:number = +rawPath[1];
|
|
|
+ return string.replace('#',rand(1,max).toString());
|
|
|
+ }
|
|
|
+ console.error('Unsupported type in setup.mediaPathRawToString:',rawPath,typeof rawPath);
|
|
|
+}
|
|
|
+
|
|
|
setup.mediaPath = function(rawPath:string){
|
|
|
+ rawPath = setup.mediaPathRawToString(rawPath);
|
|
|
if(rawPath.substring(0,6) == 'https:' || rawPath.substring(0,5) == 'http:')
|
|
|
return rawPath;
|
|
|
|
|
@@ -7,6 +19,7 @@ setup.mediaPath = function(rawPath:string){
|
|
|
}
|
|
|
|
|
|
setup.mediaPathImage = function(rawPath:string){
|
|
|
+ rawPath = setup.mediaPathRawToString(rawPath);
|
|
|
if(rawPath.substring(0,6) == 'https:' || rawPath.substring(0,5) == 'http:')
|
|
|
return rawPath;
|
|
|
|