framework4 icon indicating copy to clipboard operation
framework4 copied to clipboard

default_root Error

Open KangGeunSu opened this issue 5 years ago • 3 comments

hello, I'm testing 'default_root'.

I think this part is wrong

utils.js

function $urlremap(text) {
	var pos = text[0] === 'h' ? 6 : 5;
	return REG_URLEXT.test(text) ? text : ((text[0] === 'h' ? 'href' : 'src') + '="' + CONF.default_root + (text[pos] === '/' ? text.substring(pos + 1) : **text**));
}

function $urlremap(text) << text is href="@{R.url}img/icon.png" var pos = text[0] === 'h' ? 6 : 5; << pos is 6 return ..... (text[pos] === '/' ? text.substring(pos + 1) : text) <<< text[pos] is @ => false valus is text

but text is href="@{R.url}img/icon.png" I think you should cut off 'href or src' of 'text'.

return ..... (text[pos] === '/' ? text.substring(pos + 1) : text.substring(pos))

Thank you!

KangGeunSu avatar Aug 19 '21 00:08 KangGeunSu

Fixed. The framework will skip paths starting with external links or with a ViewEngine command.

  • Try it $ npm install total4

petersirka avatar Aug 20 '21 12:08 petersirka

It wasn't what I wanted.

default_root is null main page uri /

default_root is kgs main page uri /kgs

this is good

But 'js' or 'css' doesn't seem to be called '/js/kgs.js'.

Shouldn't it be called 'kgs/js/kgs.js'?

My method is called like this: kgs/js/kgs.js

Also, 'flow' is applied.(Except for 'theme'..., need some correction) I'm sorry if you feel bad..

Thank you

KangGeunSu avatar Aug 23 '21 07:08 KangGeunSu

Please, make a simple example that I can test and where will be the mentioned issue.

petersirka avatar Aug 23 '21 08:08 petersirka