aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-08-30 12:46:25 +0700
committerGravatar Ugnich Anton2013-08-30 12:46:25 +0700
commite1d907ac56fcfe5c380ef781530488c799a1f477 (patch)
tree5c3c4e88960995f19df41e9f0a52e82681e0fe1d
parentc449c1fe8b43f41714fe0cd87bdacf03a68587fe (diff)
PNG support
-rw-r--r--nbproject/build-impl.xml9
-rw-r--r--src/java/com/juick/http/www/PageTemplates.java6
-rw-r--r--src/java/com/juick/http/www/UserThread.java18
3 files changed, 21 insertions, 12 deletions
diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml
index ada51c23..a21325e8 100644
--- a/nbproject/build-impl.xml
+++ b/nbproject/build-impl.xml
@@ -532,6 +532,9 @@ exists or setup the property manually. For example like this:
<ant antfile="${project.com_juick}/build.xml" inheritall="false" target="jar">
<property name="deploy.on.save" value="false"/>
</ant>
+ <ant antfile="${project.com_juick_json}/build.xml" inheritall="false" target="jar">
+ <property name="deploy.on.save" value="false"/>
+ </ant>
<ant antfile="${project.com_juick_server}/build.xml" inheritall="false" target="jar">
<property name="deploy.on.save" value="false"/>
</ant>
@@ -543,6 +546,9 @@ exists or setup the property manually. For example like this:
<ant antfile="${project.com_juick}/build.xml" inheritall="false" target="jar">
<property name="deploy.on.save" value="false"/>
</ant>
+ <ant antfile="${project.com_juick_json}/build.xml" inheritall="false" target="jar">
+ <property name="deploy.on.save" value="false"/>
+ </ant>
<ant antfile="${project.com_juick_server}/build.xml" inheritall="false" target="jar">
<property name="deploy.on.save" value="false"/>
</ant>
@@ -696,6 +702,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${reference.com_juick.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${reference.com_juick_server.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${reference.com_juick_xmpp.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${reference.com_juick_json.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${libs.JSON.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
@@ -704,6 +711,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${reference.com_juick.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${reference.com_juick_server.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${reference.com_juick_xmpp.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
+ <copyfiles files="${reference.com_juick_json.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.JSON.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
@@ -1070,6 +1078,7 @@ exists or setup the property manually. For example like this:
-->
<target depends="init" name="deps-clean" unless="no.deps">
<ant antfile="${project.com_juick}/build.xml" inheritall="false" target="clean"/>
+ <ant antfile="${project.com_juick_json}/build.xml" inheritall="false" target="clean"/>
<ant antfile="${project.com_juick_server}/build.xml" inheritall="false" target="clean"/>
<ant antfile="${project.com_juick_xmpp}/build.xml" inheritall="false" target="clean"/>
</target>
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java
index 10c02a80..f2326b3e 100644
--- a/src/java/com/juick/http/www/PageTemplates.java
+++ b/src/java/com/juick/http/www/PageTemplates.java
@@ -434,10 +434,10 @@ public class PageTemplates {
out.print(" <div class=\"msg-txt\">" + txt + "</div>");
if (msg.AttachmentType != null) {
- if (msg.AttachmentType.equals("jpg")) {
- out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/photos-1024/" + msg.MID + ".jpg\"><img src=\"//i.juick.com/photos-512/" + msg.MID + ".jpg\" alt=\"\"/></a></div>");
- } else {
+ if (msg.AttachmentType.equals("mp4")) {
out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "\"><a href=\"//i.juick.com/video/" + msg.MID + ".mp4\" onclick=\"inlinevideo(" + msg.MID + "); return false\"><img src=\"//i.juick.com/thumbs/" + msg.MID + ".jpg\" alt=\"\"/></a></div></div>");
+ } else {
+ out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/photos-1024/" + msg.MID + "." + msg.AttachmentType + "\"><img src=\"//i.juick.com/photos-512/" + msg.MID + "." + msg.AttachmentType + "\" alt=\"\"/></a></div>");
}
}
diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java
index 22914e54..3ba5c96b 100644
--- a/src/java/com/juick/http/www/UserThread.java
+++ b/src/java/com/juick/http/www/UserThread.java
@@ -133,10 +133,10 @@ public class UserThread {
out.println(" <div class=\"msg-txt\">" + txt + "</div>");
if (msg.AttachmentType != null) {
- if (msg.AttachmentType.equals("jpg")) {
- out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + mid + ".jpg\"><img src=\"//i.juick.com/photos-512/" + mid + ".jpg\" alt=\"\"/></a></div>");
- } else {
+ if (msg.AttachmentType.equals("mp4")) {
out.println(" <div class=\"msg-media\"><div id=\"video-" + mid + "\"><a href=\"//i.juick.com/video/" + mid + ".mp4\" onclick=\"inlinevideo(" + mid + "); return false\"><img src=\"//i.juick.com/thumbs/" + mid + ".jpg\" alt=\"\"/></a></div></div>");
+ } else {
+ out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + mid + "." + msg.AttachmentType + "\"><img src=\"//i.juick.com/photos-512/" + mid + "." + msg.AttachmentType + "\" alt=\"\"/></a></div>");
}
}
@@ -295,10 +295,10 @@ public class UserThread {
}
out.println("\">");
if (msg.AttachmentType != null) {
- if (msg.AttachmentType.equals("jpg")) {
- out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + msg.MID + "-" + msg.RID + ".jpg\"><img src=\"//i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div>");
- } else {
+ if (msg.AttachmentType.equals("mp4")) {
out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><a href=\"//i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\" onclick=\"inlinevideo('" + msg.MID + "-" + msg.RID + "'); return false\"><img src=\"//i.juick.com/thumbs/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div></div>");
+ } else {
+ out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + msg.MID + "-" + msg.RID + "." + msg.AttachmentType + "\"><img src=\"//i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + "." + msg.AttachmentType + "\" alt=\"\"/></a></div>");
}
}
out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\" alt=\"" + msg.User.UName + "\"/></a></div>");
@@ -334,10 +334,10 @@ public class UserThread {
out.print(" <li id=\"" + msg.RID + "\" class=\"msg\">");
if (msg.AttachmentType != null) {
- if (msg.AttachmentType.equals("jpg")) {
- out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + msg.MID + "-" + msg.RID + ".jpg\"><img src=\"//i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div>");
- } else {
+ if (msg.AttachmentType.equals("mp4")) {
out.println(" <div class=\"msg-media\"><div id=\"video-" + msg.MID + "-" + msg.RID + "\"><a href=\"//i.juick.com/video/" + msg.MID + "-" + msg.RID + ".mp4\" onclick=\"inlinevideo('" + msg.MID + "-" + msg.RID + "'); return false\"><img src=\"//i.juick.com/thumbs/" + msg.MID + "-" + msg.RID + ".jpg\" alt=\"\"/></a></div></div>");
+ } else {
+ out.println(" <div class=\"msg-media\"><a href=\"//i.juick.com/p/" + msg.MID + "-" + msg.RID + "." + msg.AttachmentType + "\"><img src=\"//i.juick.com/photos-512/" + msg.MID + "-" + msg.RID + "." + msg.AttachmentType + "\" alt=\"\"/></a></div>");
}
}
out.println(" <div class=\"msg-avatar\"><a href=\"/" + msg.User.UName + "/\"><img src=\"//i.juick.com/a/" + msg.User.UID + ".png\"></a></div>");