-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request to update "default_root" #26
Comments
Thank you so much. |
Tested after confirmation. Hmm.... example.zip/authorization_rw-> node_modules/total4/utils.js Can't I just change this part? return REG_URLEXT.test(text) ? text : ((text[0] === 'h' ? 'href' : 'src') + '="' + CONF.default_root + (text[pos] === '/' ? text.substring(pos + 1) : text)); Because 'text' is appended with 'href or src' at the end. Sorry for my lack of explanation. |
I have changed the functionality to this: function $urlremap(text) {
var pos = text[0] === 'h' ? 6 : 5;
var url = text.substring(pos, text.length - 1);
return REG_URLEXT.test(url) ? text : ((text[0] === 'h' ? 'href' : 'src') + '="' + CONF.default_root + (text[pos] === '/' ? text.substring(pos + 1) : text));
} The current functionality is good. |
If no, returning unaltered text results in 2 "href or src" due to preceding "((text[0] === 'h' ? 'href' : 'src') + '=". |
Can you create a small example with that problem? Just download |
Can't make it right now... I can't remember what was inappropriate for
With the example above, we will make the best example. I like flow!! |
<a href="javascript:something()">
<a href="#home">
<a href="@{url}"> var str = '<a href="' + str + '">'; and that's not good. |
If you have any problematic example, then send me it. |
I checked it over the weekend. I mostly write FLOW. As a result, now seems to be the case. It seems appropriate to modify the flow in the current state. I will try more FLOW and reopen in FLOW. Thank you very much. |
How are you planning to do this? var str = '<image width="150" height="150" xlink:href="{0}img/theme{1}.png" />'.format(url, common.theme || 'white')); |
Yes, there was a bug with
|
I made an example using totaljs(git)/example/authorization.
example.zip
Common fixes
./views/homepage.html
<script src="https://cdn.componentator.com/spa.min@17.js"></script>
->
<script src="/js/spa.min@17.js"></script>
<link rel="stylesheet" href="//cdn.componentator.com/spa.min@17.css" />
->
<link rel="stylesheet" href="/css/spa.min@17.css" />
add
->
<script src="/js/ui.js"></script>
->
<link rel="stylesheet" href="/css/ui.css" />
File add
./public/js/
-> spa.min@17.js
-> ui.js
./public/css/
-> spa.min@17.css
-> ui.css
Compare two files
example.zip/authorization
-> total4 original
example.zip/authorization_rw
-> node_modules/total4/utils.js
const REG_URLEXT = /(https|http|wss|ws|file):\/\/|\/\/[a-z0-9]|[a-z]:|@\{|/i;
(Line 96)->
const REG_URLEXT = /(https|http|wss|ws|file):\/\/|\/\/[a-z0-9]|[a-z]:/i;
return REG_URLEXT.test(text) ? text : ((text[0] === 'h' ? 'href' : 'src') + '="' + CONF.default_root + (text[pos] === '/' ? text.substring(pos + 1) : text));
(Line 2551)->
return REG_URLEXT.test(text) ? text : ((text[0] === 'h' ? 'href' : 'src') + '="' + CONF.default_root + (text[pos] === '/' ? text.substring(pos + 1) : text.substring(pos)));
config
Issues
example.zip/authorization
-> Call
http://localhost:8000/css/spa.min@17.css
-> No "default_root" when calling "js" or "css".
example.zip/authorization_rw
-> Call
http://localhost:8000/total/css/spa.min@17.css
-> There is a "default_root" when calling "js" or "css".
Please help me to use "default_root"
Thank you
The text was updated successfully, but these errors were encountered: