Closed DarkKnight1992 closed 6 years ago
Hi @DarkKnight1992,
can you show me your implementation of area
in view?
i would love to but what do you need exactly ?
this is one map area all the coords are converted to NaN
I need to see code before rendering. Otherwise: can you create a simple example?
`
`
hope this helps
lemme know if this is enough, or you would need something else
BTW: I have tested <map
in views and it has been rendered correctly.
its happening maybe because we are using angular for front end instead total view engine ?
The problem can be in Angular.... Try to look into the source-code directly whether contains NaN
. Open Network
tab in Web Developer Tools and check the response.
BTW: recover Total.js config
to default
because your paths are bad.
the response is correct. What do you mean the paths are bad ?
Remove all bad records:
directory-public : ../../public --> BAD
directory-views : ../../public --> BAD
allow-compile-css : false
allow-compile-html : false
allow-compile-js : false
static-url : ../../public --> BAD
static-url-css : ../../public --> BAD
static-url-download : ../../public --> BAD
static-url-font : ../../public --> BAD
static-url-image : ../../public --> BAD
static-url-js : ../../public --> BAD
static-url-video : ../../public --> BAD
directory-*
+ static-*
can't contain this phrase ../
or ./
So if the response is correct the problem will be on client-side scripting.
so do you mean the pubic directory has to be relative to the controller and can't be anywhere else ? But that doesn't make much sense it doesn't give the freedom to structure the application well and use babel for es6 support either. Do you mean trying to structure the backend and frontend in the different directories is a bad way to stucture the application in total js ?
we are migrating the site from php to node js and everything was working fine up until now
You can use own structure, but you need to keep rules. All directories start from app root so you can't use ../
or ./
because you will be outside of app root. The problem is in different OS.
// Default
directory-public : /public/
// means --> /some/path/yourapp/public/
// If you want to use another directory in APP ROOT then use:
directory-public : /shared/
// means --> /some/path/yourapp/shared/
// If you want to use another directory outside of APP ROOT then use:
directory-public : ~/absolute/path/on/your/server/
// means --> /absolute/path/on/your/server/
// I don't recommend it because this paths will use packages and modules
So my recommendation:
public
directory or in virtualized app
directorythat's make a lot of sense lemme try that
well there is another problem our backend is in src/server/debug.js and will compile to server/release.js after transpiling with babel and providing directory-public /public is considered to be at the root of debug or release is there a way to get the server root in the config file ?
root
is according to the location of debug.js
or release.js
. In other words: root
is process.cwd()
--> current working directory.
root
can't be defined in config file because Total.js reads config
from app root. I need more info for thinking.
Look here maybe you'll find info:
the problem is because to the directory structure, when i implemented the code according to totaljs structure in the image maps worked fine
in these examples again server can't be transpiled from es6 to es5 since node doesn't support all features of es6 as it is. This makes the use to es6 next to impossible then
directory structure for development public src/server/controllers src/server/definitons src/server/views
debug.js `const options = {};
options.directory = process.cwd() + "/src/server/";
require('total.js').http('debug', options);`
config directory-public : ../../public/ allow-compile-css : false allow-compile-html : false allow-compile-js : false static-url : ../../public static-url-css : ../../public static-url-download : ../../public static-url-font : ../../public static-url-image : ../../public static-url-js : ../../public static-url-video : ../../public
I don't use ES6, but if it works then OK 👍 and if no, then I don't know...
total js is fine and not causing any problem it the map resize, i have fixed it now everything works great with babel and es6. Thanks for the great framework 👍
Great! 👍 💯
Hi, In our application we are using Html image maps, for rendering world map but since totaljs is handling all the css, js, html its messing up the coordinates
<area shape="circle" class="maphilighted masterTooltip" title="Faroe Islands" coords="NaN,NaN,NaN">
I have tried disabling css, js, html compression and handling but its not working properly. Our config file looks like this but total is still handling all the static files.
directory-public : ../../public directory-views : ../../public allow-compile-css : false allow-compile-html : false allow-compile-js : false static-url : ../../public static-url-css : ../../public static-url-download : ../../public static-url-font : ../../public static-url-image : ../../public static-url-js : ../../public static-url-video : ../../public
Any help we will really appreciated.