core 0.1.37
Rewrites javascript to the correct domain.
The rewrite js function ensures that all javascript points to the correct domain - rewriting anything from a regular desktop link to a modified link. For example, the domain example.com will be rewritten as m.example.com on a mobile site in the javascript.
rewrite_js()
Rewrites links to point to the correct domain.
The rewrite link function takes links on the regular site and rewrites them to modified links. On a mobile site, you do not want the links to point to the desktop site. This function fixes that. For most projects, link rewriting is done automatically via the "rewrite_links()" function found in html.ts. In the example below, we rewrite the links with the class "internal" so that they remain on the Moovweb site.
$(".//a[@class='internal']") { attribute("href") { value() { rewrite_link() } } } rewrite_link()