Another Asia bug - red/green


#1

In Asia, red means up, and green means down. What’s the easiest way of putting in a config switch to opengamma to change this?


#2

There is a solution that can be put in the pom.xml. By tweaking the css when maven package runs (ie during the stage where the web directory is copied across).

This will create a one off change that will allow you to switch the colours/directions around but not add any logic to special case the Asia colour situation.

By adding this to the pom, you can swap the arrows around.

<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
  <execution>
    <id>analytics-restrictions</id>
    <phase>package</phase>
    <goals>
      <goal>replace</goal>
    </goals>
    <configuration>
      <file>webapps/web-engine/prototype/common/classes/og.common.classes.OG-icon.og-icon-tick.css</file>
      <regex>true</regex>
      <replacements>
        <replacement>
          <!-- Replace at end of file-->
          <token>\\z</token>
          <!-- Add in the replacement text that we need-->
          <value>
            .OG-icon.og-icon-tick-up:after {
              background-position: -43px -47px;
            }
            .OG-icon.og-icon-tick-down:after {
              background-position: -53px -47px;
            }
          </value>
        </replacement>
      </replacements>
    </configuration>
  </execution>
</executions>
</plugin>

You will also need to invert the images, but as they are in a css sprite you may need to adjust the positions a few pixels. The css below can be added and should cover all cross browser issues, but possibly not older IE

-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
filter: FlipH;
-ms-filter: "FlipH";


#3

Thanks. I’ll take a look at doing that.