git ssb

16+

cel / patchfoo



Commit 5a8a31c7e4523ef4de4c20e28443f9ea18961ce4

Allow specifying img_base without prefix

cel committed on 11/16/2017, 4:01:43 PM
Parent: 3652f333b559c988ab93f1454a240588b47a598f

Files changed

lib/app.jschanged
lib/render.jschanged
lib/app.jsView
@@ -33,9 +33,9 @@
3333 var base = conf.base || '/'
3434 this.opts = {
3535 base: base,
3636 blob_base: conf.blob_base || conf.img_base || base,
37- img_base: conf.img_base || base,
37 + img_base: conf.img_base || (base + 'image/'),
3838 emoji_base: conf.emoji_base || (base + 'emoji/'),
3939 encode_msgids: conf.encode_msgids == null ? true : Boolean(conf.encode_msgids),
4040 }
4141
lib/render.jsView
@@ -145,9 +145,9 @@
145145 Render.prototype.imageUrl = function (ref) {
146146 var m = /^blobstore:(.*)/.exec(ref)
147147 if (m) ref = m[1]
148148 ref = ref.replace(/#/, '%23')
149- return this.opts.img_base + 'image/' + ref
149 + return this.opts.img_base + ref
150150 }
151151
152152 Render.prototype.getImageAlt = function (id, fallback) {
153153 var link = this._mentionsByLink[id]

Built with git-ssb-web