Questions tagged [tritium]

A transformation language for XML-friendly files.

Tritium is a simple transformation language used for data manipulations. Tritium fundamentally changes the way sites are delivered to multiple devices by focusing development effort on front-end programming that creates amazing experiences. The result is super fast programming and rapid iteration on critical mobile projects. Most developers and designers familiar with CSS or JQuery learn Tritium in a few hours. Developers use their choice of editor to write Tritium code and use a Rails-like development flow using the management console.

Source: http://www.moovweb.com/developers/moovwebsdk

62 questions
2
votes
2 answers

In Tritium, what are the differences between CSS and XPath selectors?

What are the advantages / disadvantages of the two different selectors? Should I use one over the other?
gregorygtseng
  • 851
  • 4
  • 12
2
votes
1 answer

In Tritium, what does the yield() function do?

I'm looking at the examples on the Tritium API website, and I don't understand what the yield() function does. http://tritium.io/simple-mobile/1.0.224#yield()%20Text Can someone explain these examples? # first example @func XMLNode.foo { $a =…
gregorygtseng
  • 851
  • 4
  • 12
2
votes
1 answer

Changing the style properties via Tritium

Newbie question, I'm working on a simple scenario: Changing the background color and the text of a giving element on my page using Tritium. My page looks like this:
juanca
  • 353
  • 1
  • 9
2
votes
3 answers

Absolutizing an image url with a ".."

I have an HTML document I'm transforming with an image whose source url looks like this: "../foo/bar/baz.png" I'm using a tritium function to absolutize image source urls, but the ".." seems to be stumping it. It's prepending the hostname, etc, but…
1_2_3_Reapeater
  • 266
  • 1
  • 10
2
votes
1 answer

Issues Remixing TechCrunch

While going through the sample tutorials on how to remix a website (I chose TechCrunch), I noticed the image transformation: $$("img") { attribute("src", "http://www.montessoricats.com/buddha-scottish-fold-its-magic.jpg") } only seemed to apply…
2
votes
1 answer

What is the mappings.ts file and how should it be set up in Tritium?

I'm using the Moovweb SDK and using Tritium. I want my mobile site to behave like my desktop site. I have different URLs pointing to my homepage. Should I use regex? A common element? And what's the best syntax for matching the path?
Currin Berdine
  • 287
  • 1
  • 10
2
votes
2 answers

How do I add a query parameter to a URL?

What's the best practice for adding a query parameter to a URL in Tritium (Moovweb SDK)? Looking for something that works where you don't know if the URL has a "?" and other query parameters already.
Currin Berdine
  • 287
  • 1
  • 10
1
vote
1 answer

How to handle spectial characters in Tritium

I'm working on a Spanish site using MoovWeb & Tritium but I am having issues with special characters. For a content, wherever there are special characters, it always jumbles them up and show blocks or question-mark character. I don't have access to…
YoGi
  • 11
  • 3
1
vote
1 answer

Using Moovweb only some of the inline styles are being removed

So I am working in a very old site that is table heavy - everything has been converted to divs, and inside of main.ts I have tried removing the inline styles because the function remove_all_styles() is not working. @func XMLNode.remove_all_styles()…
nykc
  • 175
  • 12
1
vote
1 answer

How to include external CSS in moovweb project

I want to include JQuery mobile CSS in moovweb project [http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css.] The project is not created using Jquery Mobile template. I know to insert an external js file , say: insert("script", type:…
ambikanair
  • 4,004
  • 11
  • 43
  • 83
1
vote
2 answers

How do I create a redirect from mobile to desktop site?

When a user lands on m.example-site.com/hello I would like to redirect them to hello.com/example. How can I best accomplish this when using Moovweb? (Ideally it'd provide the fastest user experience.)
Currin Berdine
  • 287
  • 1
  • 10
1
vote
1 answer

Building a jQuery Mobile App using Moovweb, jQuery mobile and Phonegap

I am building my mobile site using Moovweb SDK. I would like to transform my mobile site into a jQuery Mobile Web App. Is there a way to do this with Tritium language? Are there any Tritium libraries that support jQuery Mobile? Next, I would like…
mmb124
  • 51
  • 1
1
vote
1 answer

In Tritium, what's the difference between add_class and attribute

I can use add_class("classname") to add a class attribute to one of my elements, but I can also use attribute("class", "classname") to do the same. What's the difference between the two functions? Any gotchas?
gregorygtseng
  • 851
  • 4
  • 12
1
vote
1 answer

In Tritium, is there a way to assign an id based on child number?

I have a table with a series of rows. I want to change them into divs, but maintain (somehow) their positional information. At the moment, this is what I'm doing: $("./tr[1]") { add_class("mw_old_row_1") } $("./tr[2]") { …
gregorygtseng
  • 851
  • 4
  • 12
1
vote
2 answers

In Tritium, how can I force a link to go to the desktop site?

I'm working on mobilizing a website with the Moovweb SDK, but there are sections that I do not want to alter for mobile. How do I force these links to point to the original desktop site?
gregorygtseng
  • 851
  • 4
  • 12