Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2502] Some Titanium label properties not supported by Titanium JSS

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionWon't Fix
Resolution Date2013-08-01T00:33:24.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, font, ios, jss, klist, rplist
ReporterJames K
AssigneeBlain Hamon
Created2011-04-15T03:21:24.000+0000
Updated2017-03-20T17:53:51.000+0000

Description

The JSS parser seems to have issues when it encounters curly braces:

font:{fontSize:15, fontWeight:'bold'};

shadowOffset:{x:0, y:1};

The first line can be rewritten in JSS using CSS syntax as follows:

font-size:15;
font-weight:'bold';

This seems to be magically understood by Titanium.

But the CSS equivalent for shadows does not work:

text-shadow: 0 1 #6E7983;

The parser also requires JSS properties to be separated by semi-colons and not by commas, which means properties can't simply be cut and pasted from code files into JSS files. Not sure if this is by design, but it's a bit of a hassle.

Comments

  1. Stephen Tramer 2011-04-15

    Maybe also affects android?

  2. Dawson Toth 2011-04-15

    I just verified that this also does not work on Android, and I collected some relevant logs.

    If necessary, I can split off an Android ticket.

    Tested On

    BROKEN on Android Device Samsung Epic 4G running Android 2.2
    BROKEN on iPhone Simulator 4.3
    BROKEN with Titanium Mobile 1.6.2 (03/30/11 17:25 0243d42...)
    BROKEN with Titanium Mobile 1.7.0 (04/05/11 10:30 731db9c...)

    Relevant Logs

    Regardless of the platform, the following syntax errors show up in the build logs:

       Syntax error at 'LexToken(LBRACE,' {',1,106)'
       Syntax error at 'LexToken(S,' ',1,111)'
       Syntax error at 'LexToken(S,' ',1,117)'
       

    On Android, these errors show up right after "[INFO] Copying platform-specific files ..." and on iOS right after "[INFO] iPhone simulated device: iphone".

    Associated Helpdesk Ticket

    http://support.appcelerator.com/tickets/MAK-12868-443">http://support.appcelerator.com/tickets/MAK-12868-443

  3. Chris Barber 2013-08-01

    JSS is like CSS and CSS does not allow values to be "objects" with curly braces. Furthermore, Titanium does not support shadowOffset or text-shadow and probably never will. Consider using Alloy.

JSON Source