[kune-commits] r1808 - in trunk/src/main/java: cc/kune/core/public cc/kune/core/server/manager/file cc/kune/gspace/client/actions cc/kune/gspace/client/armor/resources com/google/wave/splash/web/template

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Mar 30 15:12:37 CEST 2012


Author: vjrj_
Date: 2012-03-30 15:12:37 +0200 (Fri, 30 Mar 2012)
New Revision: 1808

Modified:
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
   trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java
   trunk/src/main/java/cc/kune/gspace/client/armor/resources/gSpaceArmor.css
   trunk/src/main/java/com/google/wave/splash/web/template/Templates.java
Log:
Some path fix, and a css fix.

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2012-03-30 11:26:03 UTC (rev 1807)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2012-03-30 13:12:37 UTC (rev 1808)
@@ -896,6 +896,11 @@
   padding: 0 2px;
 }
 
+
+button.k-btn-go-up {
+  margin-right: 5px;
+}
+
 .k-sn-mainpanel .x-btn button:hover,.k-sn-mainpanel button:hover,button.k-button:hover,button.gwt-Button:hover
   {
   border: 1px orange solid;
@@ -1592,4 +1597,5 @@
   right: 0 !important;
   top: 0 !important;
   width: auto !important;
-}
\ No newline at end of file
+}
+

Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java	2012-03-30 11:26:03 UTC (rev 1807)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java	2012-03-30 13:12:37 UTC (rev 1808)
@@ -79,8 +79,8 @@
     InputStream in = null;
     File icon = null;
     for (final String path : resourceBases) {
-      final String fileName = path + (path.endsWith(File.separator) ? "" : File.separator) + filename;
-      final File file = new File(fileName);
+      final String pathAndfilename = path + (path.endsWith(File.separator) ? "" : File.separator) + filename;
+      final File file = new File(pathAndfilename);
       if (file.exists()) {
         icon = file;
         break;

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java	2012-03-30 11:26:03 UTC (rev 1807)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GoParentContainerBtn.java	2012-03-30 13:12:37 UTC (rev 1808)
@@ -71,7 +71,7 @@
       final CoreResources res, final Session session, final String typeRoot) {
     super(action);
     this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).withStyles(
-        "k-btn-min, k-fl");
+        "k-btn-min, k-fl, k-btn-go-up");
     this.withId(GO_PARENT_ID);
     final StateAbstractDTO state = session.getCurrentState();
     if (!session.isCurrentStateAContent()) {

Modified: trunk/src/main/java/cc/kune/gspace/client/armor/resources/gSpaceArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/resources/gSpaceArmor.css	2012-03-30 11:26:03 UTC (rev 1807)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/resources/gSpaceArmor.css	2012-03-30 13:12:37 UTC (rev 1808)
@@ -167,7 +167,7 @@
   -webkit-border-bottom-right-radius: 4px;
   -moz-border-radius-bottomright: 4px;
   border-bottom-right-radius: 4px;
-  padding: 1px 7px 0 7px;
+  padding: 3px 7px 0 5px;
   overflow: hidden;
   border-collapse: separate;
 }

Modified: trunk/src/main/java/com/google/wave/splash/web/template/Templates.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/web/template/Templates.java	2012-03-30 11:26:03 UTC (rev 1807)
+++ trunk/src/main/java/com/google/wave/splash/web/template/Templates.java	2012-03-30 13:12:37 UTC (rev 1808)
@@ -21,6 +21,7 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentMap;
 import java.util.logging.Logger;
@@ -31,6 +32,7 @@
 import org.mvel2.templates.TemplateCompiler;
 import org.mvel2.templates.TemplateRuntime;
 import org.mvel2.templates.util.TemplateTools;
+import org.waveprotocol.box.server.CoreSettings;
 
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
@@ -38,6 +40,7 @@
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
+import com.google.inject.name.Named;
 import com.google.wave.splash.text.Markup;
 
 /**
@@ -55,13 +58,13 @@
   private static final Logger LOG = Logger.getLogger(Templates.class.getName());
   public static final String MOBILE_TEMPLATE = "mobile_client.html";
   public static final String PERMALINK_WAVE_TEMPLATE = "permalink_client.html";
-
+  private static final String TEMPLATES_LOCATION = "others/splash/";
   public static final String WAVE_NOT_FOUND_TEMPLATE = "wave_not_found.html.fragment";
 
   private final Markup markup;
+  private String prefix;
 
   private final boolean productionMode = true;
-
   /**
    * file name of template -> compiled template lazy cache.
    */
@@ -73,8 +76,19 @@
   });
 
   @Inject
-  public Templates(final Markup markup) {
+  public Templates(final Markup markup,
+      @Named(CoreSettings.RESOURCE_BASES) final List<String> resourceBases) {
     this.markup = markup;
+    for (final String path : resourceBases) {
+      final String prefix = path + (path.endsWith(File.separator) ? "" : File.separator);
+      final String pathAndfilename = prefix + TEMPLATES_LOCATION + Templates.BLIP_TEMPLATE;
+      final File file = new File(pathAndfilename);
+      if (file.exists()) {
+        this.prefix = prefix;
+        break;
+      }
+    }
+    Preconditions.checkArgument(prefix != null, "Could not find templates");
   }
 
   private CompiledTemplate loadTemplate(final String template) {
@@ -109,8 +123,7 @@
 
     FileInputStream stream = null;
     try {
-      stream = new FileInputStream(new File((productionMode ? "/usr/share/kune/webapp"
-          : "src/main/webapp") + "/others/splash/" + file));
+      stream = new FileInputStream(new File(prefix + TEMPLATES_LOCATION + file));
     } catch (final FileNotFoundException e) {
       LOG.info("Could not find resource named: " + file);
     }




More information about the kune-commits mailing list