From 37420412510b3da96c2556be684ffd865a1cf9c4 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:04:55 +0900 Subject: [PATCH 1/7] Belum sesuai spek, tak ada konfirmasi masukan email dan tidak menggunakan ajax --- WBD2/.classpath | 10 + WBD2/.project | 23 ++ WBD2/.settings/org.eclipse.jdt.core.prefs | 11 + WBD2/.settings/org.eclipse.m2e.core.prefs | 4 + WBD2/bin/AllControl.class | Bin 0 -> 7387 bytes WBD2/bin/CookieHelper.class | Bin 0 -> 2182 bytes WBD2/bin/comments/Comment.class | Bin 0 -> 2094 bytes WBD2/bin/mysql/Connect.class | Bin 0 -> 1242 bytes WBD2/bin/mysql/SQLStatements.class | Bin 0 -> 10809 bytes WBD2/bin/posts/Post.class | Bin 0 -> 1825 bytes WBD2/bin/users/User.class | Bin 0 -> 2230 bytes WBD2/pom.xml | 72 +++++ WBD2/src/main/java/AllControl.java | 290 ++++++++++++++++++++ WBD2/src/main/java/CookieHelper.java | 55 ++++ WBD2/src/main/java/comments/Comment.java | 84 ++++++ WBD2/src/main/java/mysql/Connect.java | 34 +++ WBD2/src/main/java/mysql/SQLStatements.java | 277 +++++++++++++++++++ WBD2/src/main/java/posts/Post.java | 68 +++++ WBD2/src/main/java/users/User.java | 88 ++++++ WBD2/src/main/webapp/UserList.xhtml | 73 +++++ WBD2/src/main/webapp/WEB-INF/web.xml | 46 ++++ WBD2/src/main/webapp/Who.xhtml | 0 WBD2/src/main/webapp/WrongPass.xhtml | 0 WBD2/src/main/webapp/addpost.xhtml | 24 ++ WBD2/src/main/webapp/admin.xhtml | 36 +++ WBD2/src/main/webapp/editor.xhtml | 34 +++ WBD2/src/main/webapp/editpost.xhtml | 25 ++ WBD2/src/main/webapp/guestpost.xhtml | 37 +++ WBD2/src/main/webapp/home.xhtml | 27 ++ WBD2/src/main/webapp/login.xhtml | 20 ++ WBD2/src/main/webapp/main.xhtml | 15 + WBD2/src/main/webapp/ownerhome.xhtml | 28 ++ WBD2/src/main/webapp/post.xhtml | 35 +++ 33 files changed, 1416 insertions(+) create mode 100644 WBD2/.classpath create mode 100644 WBD2/.project create mode 100644 WBD2/.settings/org.eclipse.jdt.core.prefs create mode 100644 WBD2/.settings/org.eclipse.m2e.core.prefs create mode 100644 WBD2/bin/AllControl.class create mode 100644 WBD2/bin/CookieHelper.class create mode 100644 WBD2/bin/comments/Comment.class create mode 100644 WBD2/bin/mysql/Connect.class create mode 100644 WBD2/bin/mysql/SQLStatements.class create mode 100644 WBD2/bin/posts/Post.class create mode 100644 WBD2/bin/users/User.class create mode 100644 WBD2/pom.xml create mode 100644 WBD2/src/main/java/AllControl.java create mode 100644 WBD2/src/main/java/CookieHelper.java create mode 100644 WBD2/src/main/java/comments/Comment.java create mode 100644 WBD2/src/main/java/mysql/Connect.java create mode 100644 WBD2/src/main/java/mysql/SQLStatements.java create mode 100644 WBD2/src/main/java/posts/Post.java create mode 100644 WBD2/src/main/java/users/User.java create mode 100644 WBD2/src/main/webapp/UserList.xhtml create mode 100644 WBD2/src/main/webapp/WEB-INF/web.xml create mode 100644 WBD2/src/main/webapp/Who.xhtml create mode 100644 WBD2/src/main/webapp/WrongPass.xhtml create mode 100644 WBD2/src/main/webapp/addpost.xhtml create mode 100644 WBD2/src/main/webapp/admin.xhtml create mode 100644 WBD2/src/main/webapp/editor.xhtml create mode 100644 WBD2/src/main/webapp/editpost.xhtml create mode 100644 WBD2/src/main/webapp/guestpost.xhtml create mode 100644 WBD2/src/main/webapp/home.xhtml create mode 100644 WBD2/src/main/webapp/login.xhtml create mode 100644 WBD2/src/main/webapp/main.xhtml create mode 100644 WBD2/src/main/webapp/ownerhome.xhtml create mode 100644 WBD2/src/main/webapp/post.xhtml diff --git a/WBD2/.classpath b/WBD2/.classpath new file mode 100644 index 00000000..357f6fbf --- /dev/null +++ b/WBD2/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/WBD2/.project b/WBD2/.project new file mode 100644 index 00000000..208ef8dd --- /dev/null +++ b/WBD2/.project @@ -0,0 +1,23 @@ + + + WBD2 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/WBD2/.settings/org.eclipse.jdt.core.prefs b/WBD2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..7341ab16 --- /dev/null +++ b/WBD2/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/WBD2/.settings/org.eclipse.m2e.core.prefs b/WBD2/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/WBD2/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/WBD2/bin/AllControl.class b/WBD2/bin/AllControl.class new file mode 100644 index 0000000000000000000000000000000000000000..cc3d10446f071206cbcb7c8c18b8f5b10140a0b2 GIT binary patch literal 7387 zcmb7J33yc175+~$$qd7Vz_8e`gaj}ofe-{2B#ML(VK50uAPU;rA$cSNlbJ9xfhcXQ zEw=8h-Dzv9wwCUNmJBGZOIxkl#V&TY`@ZjsU8Mhc%goC#*p`pHci(;Yo%5gnEce{x z$>$z;5Wot#I*2ksxGj-rPbIVIR3eCgV9M^;zF12lmK5mC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fl0vXDSD!ym@wLp4;;73WMc$_J!ofn_1@PZ6a4o{J$iUPi>b^md`q$ z44-}G>!gye&P1{{Sd^bTqa%Vw9!F7~Z6hsI)@1LAj;QQ~Eaz;+on%k;7Inmw-LX3F z7`NOc%I-5AO|l!wSIQtn1*rlaeoi#jb%YRRaoH3`x#{FuwzhQWV(c7@s!_filrGQn z)`l(F*WHSpltRQ1Z5mkEVFbh{R{{AZHIrY>WK}b%)XV^!TWHDJcHs?{V{A+<_#B{q*RYW-5umA@ zfd~g~eR8P!$!uZQc!k;$Hk=x}!t_ltV@f*2poa3$?Pyie!+1;(2|ViyGUo*u@de@i z;0H421xXSlRR`p$3o`Euvfu@o@CA`$a%%6dj4XITrU)`!2V}_wS@s24@q*0yg76~r z16lEc%oAjx4#;yCWEE?!uiG_}`Ru8YWnU29|1}`}SIBrlRtd6J2PCViP{W3AMmD_} z$@+ruKcEJL#k%PQ$q{6`4v1VbQmnaZuYY7gOE(&+fA8}_W$}`6c6sIQ@ow2?l3t-7 quX*(ysMt=A8`VZJm;$F2jcSh@sPwo|?QsK@9yd_w@ojZbFa7`<9t8vd literal 0 HcmV?d00001 diff --git a/WBD2/bin/mysql/Connect.class b/WBD2/bin/mysql/Connect.class new file mode 100644 index 0000000000000000000000000000000000000000..4c9acbf01c0a8b8e283da3a7251d5ea6673bb854 GIT binary patch literal 1242 zcmaJ>TT|0O6#kYLQesL=00FVw(Y8vX;FaQqt1m@I>(tS=ZL*d?o76N#eDxRUjDVvv zj&IKRqa4qs5o^mho$j7JdoJHO=iB`J_2nCYWjs>Q!w|2%YrLr%8?NIB(^n8>Nbd0i zZdAEbF`kt7NXyV?l^tFa40_@3WzqL+r;=x2Cc{L*bZbT{*q&83|3tK1hb;P5ZO8WS zGepvv5`(&RXo|W|cMSz`hLIqs#8G@&IK5+tZn&0E5kXQzKhzj>(!DKPOZ{LN*3gSS zm8A0;Mlr@PP~-a|tb}4Sq|%xH!b%iuM?7xU%EEij%hjMh*W}d__iT9%l~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O8qNyZ4y($xSy^emxQL9*FotUZ#dG;$>=hLq4Vk4onU2ff}Yp zJN3{rfPEev!JkEqIdVI22jICA;rtqnpsyn*zk!#N-$YmUEwnCo;f}j-_uY`=Z__S|GF?4wAYC}}rUn0Ut`&7U0P7MRn~IVY>a_$4aWudtQXY(Py7=mc6IDsh$@ zs#;Nnkq2v*>%3uTL*%xhJw-FPE^=wyUosRBSBnY#pqmKjSoG3o(FGv^6nZs<=*f~i0L*Kgvb*zeJd9s_R25&1u$ zLpY9&&>tmsyf237Hg;)^9p>i)zaCL2y0K!Dm?W{APZK4IUaTH=5OgFJ zeMtJ{$tjwdLlGcO7E}6xcm&UZrf}tuFE|JD8j9P3UNN<>l`Ip}G^k}_1~!FwrO>~t ztdl*(0DYz1Q{*~KXHS7%REOZ{kJ(0sJS;CJx`Ms%I|A`|4o9cFyaP<$1?qoBG*2L! z?;)D+qk5dg)hBW12iU@Yh+hOhz#6CN4MC174;l`?az?fCY z1{3_?j>3@L;v5zl9mmsn!DO|HoDxcHA`Z2gF@V}!AtLZ9S2^V7QPgp?UHrbCqyF|_ zRYy0J5mXRw;qD>-B`c>7b`Ohrzv0|J=nbV|wF-`HgK8CUvAuuj6|=bf_uE1|{BdJ1 zOUp`hQU~Du3>1e$I6AhM!i}HFJyeQ@dKh$llqjZ3;ipL=fd2_CKr2NltwE3X9du*& zVZ2)mqqjuR5&yUCjDB0p(eH@gwAJu6t%j4(WpF>?M&IE_{CWSd67LdJ{H@+WUWNUG zdM&yruk?T)&eC%jMFfRM)t-}dbsitMpY-Hk%^bKAuDirsQIF$rjOO9LiZuQ=mBuxq INz5nue|-UxiU0rr literal 0 HcmV?d00001 diff --git a/WBD2/bin/posts/Post.class b/WBD2/bin/posts/Post.class new file mode 100644 index 0000000000000000000000000000000000000000..ec39544384f0dd29180b0bdd578303c7d31c5b1f GIT binary patch literal 1825 zcmbW1+fEZv6o&ulk=8+u1)&uRDzw9)ARx%09Ev1O8Z{~DeQ75+1Y6S%K82S)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EmYP7u~jSP2! zXm${PA)@e1X~d);&IsVu7Lw*fq=iXyA{u~~B;I-AT_EpCqF*FZisO{VTW$O7;L$tx zF(S%pn)eRr)eKh>trV_u7166}Tt%sw#VkjONtUx%M$JDk_d6FM$hF(0iQFTR+$luv=qgm$IBwv7SVvOGtFNIR zy~5r6v{Wq{O6Ga?l+26lDw$W2z1-H!bPJ#TibR2pS9n2YvzW&MU)Zp&c9Z`B zzEEWz+Y#zL($Rd3FFB8J{}sRM9=^smkMS+O1Kt3B4p8d= literal 0 HcmV?d00001 diff --git a/WBD2/pom.xml b/WBD2/pom.xml new file mode 100644 index 00000000..7c7c7246 --- /dev/null +++ b/WBD2/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + WBD2 + WBD2 + 0.0.1-SNAPSHOT + war + + + junit + junit + 3.8.1 + test + + + com.sun.faces + jsf-api + 2.1.7 + + + com.sun.faces + jsf-impl + 2.1.7 + + + javax.servlet + javax.servlet-api + 3.0.1 + + + mysql + mysql-connector-java + 5.1.23 + + + javax.servlet + jstl + 1.2 + + + javax.servlet.jsp + javax.servlet.jsp-api + 2.2.1 + provided + + + javax.el + javax.el-api + 2.2.1 + provided + + + javax.servlet.jsp.jstl + jstl-api + 1.2 + provided + + + + WBD2 + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.1 + + 1.7 + 1.7 + + + + + \ No newline at end of file diff --git a/WBD2/src/main/java/AllControl.java b/WBD2/src/main/java/AllControl.java new file mode 100644 index 00000000..c56fcd1f --- /dev/null +++ b/WBD2/src/main/java/AllControl.java @@ -0,0 +1,290 @@ + + +import java.io.IOException; +import java.io.Serializable; +import java.sql.SQLException; + +import posts.Post; +import users.User; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.SessionScoped; +import javax.faces.context.FacesContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import comments.Comment; + +import mysql.SQLStatements; + +@ManagedBean(name = "allControl", eager = true) +@SessionScoped + +public class AllControl implements Serializable{ + private static final long serialVersionUID = 1L; + + private Post CurrentPost; + private int PostID; + private User CurrentUser; + private String Date; + private SQLStatements s; + private String message; + private Comment lel; + + public AllControl(){ + CurrentPost = new Post(); + CurrentUser = new User(); + s = new SQLStatements(); + } + + public String showPost(){ + try { + CallThePage(); + if(CurrentUser.getAuth()=="Guest"){ + return "guestpost"; + } + else{ + return "post"; + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return Home(); + } + + } + + public String Home(){ + PostID= 0; + message = ""; + if(CurrentUser.getAuth().equals("Administrator")){ + return "admin"; + } + else if (CurrentUser.getAuth().equals("Owner")){ + return "ownerhome"; + } + else if (CurrentUser.getAuth().equals("Editor")) { + return "editor"; + } + else { + return "home"; + } + } + public String Login() { + message = ""; + try { + if(s.IsUserExist(CurrentUser.getName()) && s.isPassword(CurrentUser.getName(), CurrentUser.getPass())){ + setCurrentUser(s.SelectUser(CurrentUser.getName(), CurrentUser.getPass())); + setCookie(); + message = ""; + return Home(); + } + else { + if (s.IsUserExist(CurrentUser.getName())){ + message = "Incorect Password"; + } + else{ + message = "User doesn't exist"; + } + return "login"; + } + + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return Home(); + } + + } + private void setCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + Cookie cookieUser = new Cookie("username", CurrentUser.getName()); + Cookie cookiePassword = new Cookie("password", CurrentUser.getPass()); + + cookieUser.setMaxAge(100000); + cookiePassword.setMaxAge(100000); + + HttpServletResponse servletResponse = (HttpServletResponse) (fc + .getExternalContext().getResponse()); + servletResponse.addCookie(cookieUser); + servletResponse.addCookie(cookiePassword); + } + + public String Logout(){ + CurrentUser = new User(); + deleteCookie(); + return Home(); + } + private void deleteCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + Cookie cookieUser = new Cookie("username", null); + Cookie cookiePassword = new Cookie("password", null); + + cookieUser.setMaxAge(0); + cookiePassword.setMaxAge(0); + + HttpServletResponse servletResponse = (HttpServletResponse) (fc + .getExternalContext().getResponse()); + servletResponse.addCookie(cookieUser); + servletResponse.addCookie(cookiePassword); + } + + public void setCurrentUser(User U){ + CurrentUser = new User(); + CurrentUser.setId(U.getId()); + CurrentUser.setName(U.getName()); + CurrentUser.setPass(U.getPass()); + CurrentUser.setEmail(U.getEmail()); + CurrentUser.setAuth(U.getAuth()); + } + + public User getCurrentUser(){ + return CurrentUser; + } + + public void setCurrentPost(Post P){ + CurrentPost.setId(P.getId()); + CurrentPost.setTitle(P.getTitle()); + CurrentPost.setDate(P.getDate()); + CurrentPost.setContent(P.getContent()); + CurrentPost.setStatus(P.getStatus()); + } + + public Post getCurrentPost(){ + return CurrentPost; + } + + public void CallThePage() throws SQLException{ + setCurrentPost(s.GetPost(PostID)); + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public int getPostID() { + return PostID; + } + + public void setPostID(int postID) { + PostID = postID; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public void checkCookie() { + FacesContext fc = FacesContext.getCurrentInstance(); + + HttpServletRequest servletRequest = (HttpServletRequest) (fc + .getExternalContext().getRequest()); + Cookie cookies[] = servletRequest.getCookies(); + CurrentPost = new Post(); + CurrentUser = new User(); + lel = new Comment(); + s = new SQLStatements(); + + if (cookies != null) { + for (int i = 0; i < cookies.length; i++) { + String cookieName = cookies[i].getName(); + String cookieValue = cookies[i].getValue(); + + if (cookieName.equals("username")){ + CurrentUser.setName(cookieValue); + } + if (cookieName.equals("password")){ + CurrentUser.setPass(cookieValue); + } + } + try { + setCurrentUser(s.SelectUser(CurrentUser.getName(), CurrentUser.getPass())); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + try { + FacesContext.getCurrentInstance().getExternalContext() + .redirect(Home()+".jsf"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public Comment getLel() { + return lel; + } + + public void setLel(Comment lel) { + this.lel = lel; + } + + public void addComment(){ + lel.setPostId(Integer.toString(PostID)); + try { + s.AddComment(lel); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + lel = new Comment(); + } + public void userComment(){ + lel.setPostId(Integer.toString(PostID)); + lel.setName(CurrentUser.getName()); + lel.setEmail(CurrentUser.getEmail()); + try { + s.AddComment(lel); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + lel = new Comment(); + } + + public void addNewPost(){ + CurrentPost.setStatus("Unpublished"); + try { + s.AddPost(CurrentPost); + message="Post has been made"; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + CurrentPost = new Post(); + } + + public String editPostInit(){ + try { + CallThePage(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return "editpost"; + } + + public void editPost(){ + try { + s.EditPost(CurrentPost.getId(), CurrentPost); + message="Post has been changed"; + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/WBD2/src/main/java/CookieHelper.java b/WBD2/src/main/java/CookieHelper.java new file mode 100644 index 00000000..022b4879 --- /dev/null +++ b/WBD2/src/main/java/CookieHelper.java @@ -0,0 +1,55 @@ +import javax.faces.context.FacesContext; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class CookieHelper { + public void setCookie(String name, String value,int expiry) { + + FacesContext facesContext = FacesContext.getCurrentInstance(); + + HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); + Cookie cookie = null; + + Cookie[] userCookies = request.getCookies(); + if (userCookies != null && userCookies.length > 0 ) { + for (int i = 0; i < userCookies.length; i++) { + if (userCookies[i].getName().equals(name)) { + cookie = userCookies[i]; + break; + } + } + } + + if (cookie != null) { + cookie.setValue(value); + } else { + cookie = new Cookie(name, value); + cookie.setPath(request.getContextPath()); + } + + cookie.setMaxAge(expiry); + + HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); + response.addCookie(cookie); + } + + public Cookie getCookie(String name) { + + FacesContext facesContext = FacesContext.getCurrentInstance(); + + HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); + Cookie cookie = null; + + Cookie[] userCookies = request.getCookies(); + if (userCookies != null && userCookies.length > 0 ) { + for (int i = 0; i < userCookies.length; i++) { + if (userCookies[i].getName().equals(name)) { + cookie = userCookies[i]; + return cookie; + } + } + } + return null; + } +} diff --git a/WBD2/src/main/java/comments/Comment.java b/WBD2/src/main/java/comments/Comment.java new file mode 100644 index 00000000..313b9caa --- /dev/null +++ b/WBD2/src/main/java/comments/Comment.java @@ -0,0 +1,84 @@ +package comments; + +public class Comment { + private int Id; + private String Name; + private String Email; + private String Date; + private String Content; + private String postId; + + public Comment(){ + setId(0); + setName(null); + setEmail(null); + setDate(null); + setContent(null); + setPostId(null); + } + public Comment(int I, String N, String E, String D, String C, String P){ + setId(I); + setName(N); + setEmail(E); + setDate(D); + setContent(C); + setPostId(P); + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getEmail() { + return Email; + } + + public void setEmail(String email) { + Email = email; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public String getContent() { + return Content; + } + + public void setContent(String content) { + Content = content; + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + + public String getPostId() { + return postId; + } + + public void setPostId(String postId) { + this.postId = postId; + } + + public void setComment(int I, String N, String E, String D, String C, String P){ + setId(I); + setName(N); + setEmail(E); + setDate(D); + setContent(C); + setPostId(P); + } +} diff --git a/WBD2/src/main/java/mysql/Connect.java b/WBD2/src/main/java/mysql/Connect.java new file mode 100644 index 00000000..f1f876d2 --- /dev/null +++ b/WBD2/src/main/java/mysql/Connect.java @@ -0,0 +1,34 @@ +package mysql; + +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.Driver; + +import java.sql.DriverManager; +import java.sql.SQLException; + +import javax.faces.bean.ApplicationScoped; +import javax.faces.bean.ManagedBean; + +@ManagedBean(name = "connect", eager = true) +@ApplicationScoped +public class Connect { + private String dbname = "wbd2"; + + public Connect() throws SQLException{ + makeConnection(); + } + + private Connection c; + + public Connection makeConnection() throws SQLException { + if (c == null) { + new Driver(); + // buat koneksi + c = (Connection) DriverManager.getConnection( + "jdbc:mysql://localhost/"+dbname, + "root", + ""); + } + return c; + } +} diff --git a/WBD2/src/main/java/mysql/SQLStatements.java b/WBD2/src/main/java/mysql/SQLStatements.java new file mode 100644 index 00000000..f5b607bc --- /dev/null +++ b/WBD2/src/main/java/mysql/SQLStatements.java @@ -0,0 +1,277 @@ +package mysql; + +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.Statement; + +import comments.Comment; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.RequestScoped; + +import posts.Post; +import users.User; +import mysql.Connect; + + +@ManagedBean(name = "dbStatement", eager = true) +@RequestScoped +public class SQLStatements { + private Statement statement; + + public void SQLStatement() throws SQLException{ + makeStatement(); + } + + public Statement makeStatement() throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + statement = (Statement) conn.createStatement(); + return statement; + } + public void AddUser(User U) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into user (Name, Password, Email, Authority) " + + "values (\""+U.getName()+"\", \""+U.getPass()+"\", \""+U.getEmail()+"\", \""+U.getAuth()+"\");"); + } + public void DeleteUser(int id) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from user " + + "where id = \"" +id+ "\";"); + } + public void EditUser(int id, User U) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("update user " + + "set Name = \"" +U.getName() +"\"," + + "Password = \"" +U.getPass() +"\"," + + "Email = \"" +U.getEmail() +"\"," + + "Authority = \""+U.getAuth() +"\" " + +"where id = \""+U.getId()+"\";"); + } + public void AddPost(Post P) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into Posts (Title, Date, Content, Status) " + + "values (\""+P.getTitle()+"\", \""+P.getDate()+"\", \""+P.getContent()+"\", \""+P.getStatus()+"\");"); + } + public void EditPost(int id, Post P) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("update Posts " + + "set Title = \"" +P.getTitle() +"\"," + + "Date = \"" +P.getDate() +"\"," + + "Content = \"" +P.getContent() +"\"," + + "Status = \""+P.getStatus() +"\" " + +"where id = \""+P.getId()+"\";"); + } + public void DeletePost(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from Posts " + + "where id = \"" +id+ "\";"); + } + public void AddComment(Comment C) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("insert into Comments (Name, Email, Date, Content, PostID) " + + "values (\""+C.getName()+"\", \""+C.getEmail()+"\", \""+C.getDate()+"\", \""+C.getContent()+"\", \""+C.getPostId()+"\" );"); + } + public void DeleteComment(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + statement.execute("delete from Comments " + + "where id = \"" +id+ "\";"); + } + + public List GetPosts() throws SQLException { + + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Post ah; + try (ResultSet rs = statement.executeQuery("select * from Posts;")) { + while(rs.next()) { + ah = new Post(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + Out.add(ah); + } + } + return Out; + } + public List GetComments(String id) throws SQLException{ + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Comment ah = new Comment(); + try (ResultSet rs = statement.executeQuery("select * from Comments where PostID = \""+id+"\";")) { + while(rs.next()) { + ah.setComment(rs.getInt("id"),rs.getString("Name"),rs.getString("Email"),rs.getString("Date"),rs.getString("Content"),Integer.toString(rs.getInt("PostID"))); + Out.add(ah); + } + } + return Out; + } + public List GetUser() throws SQLException { + List Out = new ArrayList(); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + User ah; + try (ResultSet rs = statement.executeQuery("select * from User;")) { + while(rs.next()) { + ah = new User(rs.getInt("id"),rs.getString("Name"),rs.getString("Password"),rs.getString("Email"),rs.getString("Authority")); + Out.add(ah); + } + } + return Out; + } + public List PickPublishedPost() throws SQLException{ + List Out = new ArrayList(Arrays.asList(new Post())); + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + try (ResultSet rs = statement.executeQuery("select * from posts where Status = 'Published';")) { + while(rs != null && rs.next()) { + Post ah = new Post(); + ah.setPost(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + Out.add(ah); + } + } + return Out; + } + + public Post GetPost(int id) throws SQLException { + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + Post ah = new Post(); + try (ResultSet rs = statement.executeQuery("select * from Posts where id = \""+id+"\";")) { + while(rs.next()) { + ah.setPost(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status")); + } + } + return ah; + } + public boolean IsUserExist(String Name) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + String xname = null; + String query = "SELECT * FROM User WHERE Name=\"" + Name + "\";"; + ResultSet rs = statement.executeQuery(query); + while(rs.next()){ + xname = rs.getString("name"); + } + return xname!=null; + } + + public boolean isPassword(String Name, String Password) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + String pass = null; + String query = "SELECT Password FROM User WHERE Name=\"" + Name + "\";"; + ResultSet rs = statement.executeQuery(query); + while(rs.next()){ + pass = rs.getString("Password"); + } + return (pass.equals(Password)); + } + + public User SelectUser(String Name, String Password) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + User ah = new User(); + try (ResultSet rs = statement.executeQuery("select * from User where Name = \""+Name+"\" AND Password = \""+Password+"\";")) { + while(rs.next()) { + ah = new User(rs.getInt("id"),rs.getString("Name"),rs.getString("Password"),rs.getString("Email"),rs.getString("Authority")); + } + } + return ah; + } + + public List PostComments(int ID) throws SQLException{ + Connect c = new Connect(); + Connection conn = c.makeConnection(); + if (conn == null){ + throw new SQLException("Can't get database connection"); + } + statement = (Statement) conn.createStatement(); + List Out = new ArrayList(); + Comment ah; + try (ResultSet rs = statement.executeQuery("select * from Comments where PostID = \""+ID+"\";")) { + while(rs.next()) { + ah = new Comment(rs.getInt("id"),rs.getString("Title"),rs.getString("Date"),rs.getString("Content"),rs.getString("Status"),Integer.toString(rs.getInt("PostID"))); + Out.add(ah); + } + } + return Out; + } + +} diff --git a/WBD2/src/main/java/posts/Post.java b/WBD2/src/main/java/posts/Post.java new file mode 100644 index 00000000..e4803167 --- /dev/null +++ b/WBD2/src/main/java/posts/Post.java @@ -0,0 +1,68 @@ +package posts; + +public class Post { + private int Id; + private String Title; + private String Date; + private String Content; + private String Status; + + public Post(){ + setId(0); + setTitle(""); + setDate(""); + setContent(""); + setStatus(""); + } + public Post(int id, String T, String D, String C, String S){ + this.setId(id); + setTitle(T); + setDate(D); + setContent(C); + setStatus(S); + } + + public String getTitle() { + return Title; + } + + public void setTitle(String title) { + Title = title; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public String getContent() { + return Content; + } + + public void setContent(String content) { + Content = content; + } + public String getStatus() { + return Status; + } + public void setStatus(String status) { + Status = status; + } + public int getId() { + return Id; + } + public void setId(int id) { + Id = id; + } + public void setPost(int id, String T, String D, String C, String S){ + setId(id); + setTitle(T); + setDate(D); + setContent(C); + setStatus(S); + } + +} diff --git a/WBD2/src/main/java/users/User.java b/WBD2/src/main/java/users/User.java new file mode 100644 index 00000000..e504dd67 --- /dev/null +++ b/WBD2/src/main/java/users/User.java @@ -0,0 +1,88 @@ +package users; + +import java.sql.SQLException; + +import javax.faces.bean.ManagedBean; +import javax.faces.bean.RequestScoped; + +import mysql.SQLStatements; + +@ManagedBean(name = "user", eager = true) +@RequestScoped +public class User { + private int Id; + private String Name; + private String Pass; + private String Email; + private String Auth; + + public User(){ + setId(0); + setName(""); + setPass(""); + setEmail(""); + setAuth("Guest"); + } + + public User(int I, String N, String P, String E, String A){ + setId(I); + setName(N); + setPass(P); + setEmail(E); + setAuth(A); + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getPass() { + return Pass; + } + + public void setPass(String pass) { + Pass = pass; + } + + public String getEmail() { + return Email; + } + + public void setEmail(String email) { + Email = email; + } + + public String getAuth() { + return Auth; + } + + public void setAuth(String auth) { + Auth = auth; + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + public void newUser(){ + User L = new User(); + L.setName(Name); + L.setPass(Pass); + L.setEmail(Email); + L.setAuth(Auth); + SQLStatements s = new SQLStatements(); + try { + s.AddUser(L); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/WBD2/src/main/webapp/UserList.xhtml b/WBD2/src/main/webapp/UserList.xhtml new file mode 100644 index 00000000..97b35b57 --- /dev/null +++ b/WBD2/src/main/webapp/UserList.xhtml @@ -0,0 +1,73 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + + +
+

DataTable Example

+ + + + Name + #{U.name} + + + Pass + #{U.pass} + + + Email + #{U.email} + + + Authority + #{U.auth} + + + Delete? + + + + +

Add User

+
+ + + + + + + + + + + + + + + + + + + + + +
Name :
Password :
Email :
Authority :
+
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/WEB-INF/web.xml b/WBD2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..e9d6ebc3 --- /dev/null +++ b/WBD2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,46 @@ + + + + WBD2 + + + + javax.faces.PROJECT_STAGE + Development + + + + + faces/main.xhtml + + + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + + + Faces Servlet + /faces/* + + + Faces Servlet + *.jsf + + + Faces Servlet + *.faces + + + Faces Servlet + *.xhtml + + + \ No newline at end of file diff --git a/WBD2/src/main/webapp/Who.xhtml b/WBD2/src/main/webapp/Who.xhtml new file mode 100644 index 00000000..e69de29b diff --git a/WBD2/src/main/webapp/WrongPass.xhtml b/WBD2/src/main/webapp/WrongPass.xhtml new file mode 100644 index 00000000..e69de29b diff --git a/WBD2/src/main/webapp/addpost.xhtml b/WBD2/src/main/webapp/addpost.xhtml new file mode 100644 index 00000000..ccc3e949 --- /dev/null +++ b/WBD2/src/main/webapp/addpost.xhtml @@ -0,0 +1,24 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +

Add Post

+ Title :
+ Date :
+ Content :
+ +

#{allControl.message}

+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/admin.xhtml b/WBD2/src/main/webapp/admin.xhtml new file mode 100644 index 00000000..c636f1e6 --- /dev/null +++ b/WBD2/src/main/webapp/admin.xhtml @@ -0,0 +1,36 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + + +
+ +

+ +

+

#{P.date}

+

#{P.content}

+

#{P.status}

+ + + + +
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/editor.xhtml b/WBD2/src/main/webapp/editor.xhtml new file mode 100644 index 00000000..666379f7 --- /dev/null +++ b/WBD2/src/main/webapp/editor.xhtml @@ -0,0 +1,34 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+ +

+ +

+

#{P.date}

+

#{P.content}

+

#{P.status}

+ + + + +
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/editpost.xhtml b/WBD2/src/main/webapp/editpost.xhtml new file mode 100644 index 00000000..6a6031a8 --- /dev/null +++ b/WBD2/src/main/webapp/editpost.xhtml @@ -0,0 +1,25 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +

Add Post

+ Title :
+ Date :
+ Content :
+ Status :
+ +

#{allControl.message}

+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/guestpost.xhtml b/WBD2/src/main/webapp/guestpost.xhtml new file mode 100644 index 00000000..3288b978 --- /dev/null +++ b/WBD2/src/main/webapp/guestpost.xhtml @@ -0,0 +1,37 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+

#{allControl.currentPost.title}

+

#{allControl.currentPost.date}

+

#{allControl.currentPost.content}

+
+

Comments

+ +

#{C.name}

+

#{C.email}

+

#{C.date}

+

#{C.content}

+ +
+
+

Add Comment

+ Name :
+ Email :
+ Date :
+ Content :
+ +
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/home.xhtml b/WBD2/src/main/webapp/home.xhtml new file mode 100644 index 00000000..65e6886b --- /dev/null +++ b/WBD2/src/main/webapp/home.xhtml @@ -0,0 +1,27 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+ +

+ +

+

#{P.date}

+

#{P.content}

+
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/login.xhtml b/WBD2/src/main/webapp/login.xhtml new file mode 100644 index 00000000..2a928554 --- /dev/null +++ b/WBD2/src/main/webapp/login.xhtml @@ -0,0 +1,20 @@ + + + + + Simple Blog + + + +

Login Page

+ +
+ Enter your username and password

+ Username : + Password : + + #{allControl.message} +
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/main.xhtml b/WBD2/src/main/webapp/main.xhtml new file mode 100644 index 00000000..7f22c098 --- /dev/null +++ b/WBD2/src/main/webapp/main.xhtml @@ -0,0 +1,15 @@ + + + + + + Hoya! + + + + + \ No newline at end of file diff --git a/WBD2/src/main/webapp/ownerhome.xhtml b/WBD2/src/main/webapp/ownerhome.xhtml new file mode 100644 index 00000000..7ec9ec94 --- /dev/null +++ b/WBD2/src/main/webapp/ownerhome.xhtml @@ -0,0 +1,28 @@ + + + + + Simple Blog + + + +

Simple Blog

+ + +
+ +

+ +

+

#{P.date}

+

#{P.content}

+
+ +
+
+
+ \ No newline at end of file diff --git a/WBD2/src/main/webapp/post.xhtml b/WBD2/src/main/webapp/post.xhtml new file mode 100644 index 00000000..26682b13 --- /dev/null +++ b/WBD2/src/main/webapp/post.xhtml @@ -0,0 +1,35 @@ + + + + + Simple Blog + + + +

Simple Blog

+ +
+

#{allControl.currentPost.title}

+

#{allControl.currentPost.date}

+

#{allControl.currentPost.content}

+
+

Comments

+ +

#{C.name}

+

#{C.email}

+

#{C.date}

+

#{C.content}

+ +
+
+

Add Comment

+ Date :
+ Content :
+ +
+
+ \ No newline at end of file From e1fedc5f5851ba179b55ccb109b48b0a526a77e1 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:20:32 +0900 Subject: [PATCH 2/7] Delete index.html --- index.html | 114 ----------------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index 07cff0ba..00000000 --- a/index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog - - - - - -
- - - -
-
- -
-
- - - -
- - - - - - - - \ No newline at end of file From c2bb30b3851d101dddd480749a2200c9a86476b3 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:21:07 +0900 Subject: [PATCH 3/7] Delete new_post.html --- new_post.html | 111 -------------------------------------------------- 1 file changed, 111 deletions(-) delete mode 100644 new_post.html diff --git a/new_post.html b/new_post.html deleted file mode 100644 index fc4e18ee..00000000 --- a/new_post.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog | Tambah Post - - - - - -
- - - -
- - -

-

- -
-
-

Tambah Post

- -
-
- - - - - - -
- - - -
-
-
-
- -
- - - -
- - - - - - - - \ No newline at end of file From 8d1390372d78d9c8b35ac4e5cd0cecf63876a597 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:21:19 +0900 Subject: [PATCH 4/7] Delete post.html --- post.html | 140 ------------------------------------------------------ 1 file changed, 140 deletions(-) delete mode 100644 post.html diff --git a/post.html b/post.html deleted file mode 100644 index c0b6f9e6..00000000 --- a/post.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog | Apa itu Simple Blog? - - - - - -
- - - -
- -
-
- -

Apa itu Simple Blog?

-

-
-
- -
-
-
-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis aliquam minus consequuntur amet nulla eius, neque beatae, nostrum possimus, officiis eaque consectetur. Sequi sunt maiores dolore, illum quidem eos explicabo! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam consequuntur consequatur molestiae saepe sed, incidunt sunt inventore minima voluptatum adipisci hic, est ipsa iste. Nobis, aperiam provident quae. Reprehenderit, iste.

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores animi tenetur nam delectus eveniet iste non culpa laborum provident minima numquam excepturi rem commodi, officia accusamus eos voluptates obcaecati. Possimus?

- -
- -

Komentar

- -
-
- - - - - - -
- - - -
-
- -
    -
  • -
    -

    Jems

    -
    2 menit lalu
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    -
  • - -
  • -
    -

    Kave

    -
    1 jam lalu
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis repudiandae quae natus quos alias eos repellendus a obcaecati cupiditate similique quibusdam, atque omnis illum, minus ex dolorem facilis tempora deserunt! …

    -
  • -
-
-
- -
- - - -
- - - - - - - - \ No newline at end of file From 0f95c673f899113c4053a4f4bb5c2e227130fae0 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:23:10 +0900 Subject: [PATCH 5/7] Delete screen.css --- assets/css/screen.css | 861 ------------------------------------------ 1 file changed, 861 deletions(-) delete mode 100644 assets/css/screen.css diff --git a/assets/css/screen.css b/assets/css/screen.css deleted file mode 100644 index 1d8fdf3b..00000000 --- a/assets/css/screen.css +++ /dev/null @@ -1,861 +0,0 @@ -@import url(http://fonts.googleapis.com/css?family=Open+Sans); -@import url(http://fonts.googleapis.com/css?family=Questrial); - -/* Reset & Basics (Inspired by E. Meyers) -================================================== */ -html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, cite, code, em, img, small, strong, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, embed, figure, figcaption, footer, header, hgroup, menu, nav, section, summary, time, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; } -article, aside, details, figcaption, figure, footer, header, hgroup, menu, time, nav, section { - display: block; } -html, body, .wrapper { - min-height: 100%; -} - - -/* Body -================================================== */ -html, body { - height: 100%; -} -.wrapper { - min-height: 100%; -} -body { - overflow-x: hidden; - font: 17px/28px ff-meta-serif-web-pro, "Georgia", serif; - color: #333; - background: #fff; -} - - -/* Typography -================================================== */ -h1, h2, h3, h4, h5, h6 { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-weight: normal; - text-transform: uppercase; - font-weight: 700; - color: #000; - text-rendering: optimizeLegibility; -} - -h1 { - font-size: 50px; - padding-bottom: 30px; -} - -h2 { - font-size: 45px; - padding-bottom: 25px; -} - -h3 { - font-size: 40px; - padding-bottom: 20px; -} - -h4 { - font-size: 35px; - padding-bottom: 15px; -} - -h5 { - font-size: 30px; - padding-bottom: 10px; -} - -p { - margin: 0 0 28px 0; -} - -strong { - font-weight: bold; -} -em { - font-style: italic; -} -sup { - line-height: 0; -} - -small { - font-size: 70%; -} - -cite { - font-size: 80%; - font-style: italic; - } - -/* Teaser -================================================== */ - -header#teaser h1 { - text-transform: none !important; - color: #333; - font-size: 28px !important; - font-weight: 300 !important; -} - - -/* Links -================================================== */ -a { - color: #F40034; - text-decoration: none; - -webkit-transition: color .2s ease-in-out; - -moz-transition: color .2s ease-in-out; - transition: color .2s ease-in-out; -} -a:hover { - color: #F40034; -} - -/* Layout -================================================== */ -/* White container that is the "page" */ -.wrapper { - max-width: 1500px; - margin: 0 auto; - background: #fff; -} - -/* Containers to keep content to a set width */ -.nav, -.art-header-inner, -.footer, -.art-list, -.abt, -.fourohfour { - width: 980px; -} -.nav, -.art-body-inner, -.footer, -.art-list, -.abt, -.fourohfour { - position: relative; - margin: 0 auto; -} - -/* Nav -================================================== */ -.nav { - position: absolute; - top: 0; - left: 50%; - height: 70px; - padding-top: 40px; - margin-left: -490px; /* Half width of nav */ - border-bottom: 1px solid #333; - z-index: 2; -} -.nav.fixed { - position: fixed; -} -#logo { - float: left; -} -.nav-primary { - float: right; -} -.nav-primary li { - display: inline-block; - margin-left: 10px; - font-weight: 500; -} -#logo h1, -.nav-primary li, -.nav-primary li a { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-weight: 700; - font-size: 13px; - line-height: 30px; - color: #000; - text-transform: uppercase; -} - -#logo h1 { - height: 30px; - margin-left: 0px; - letter-spacing: 1px; - font-family: 'Questrial', sans-serif; - font-size: 30px; -} - -#logo h1 span{ - color: #F40034 !important; -} - -.nav li:first-child { - margin-left: 0; /* Remove left margin from the first nav li */ -} - -/* Home Page -================================================== */ - -div#home {} - -#home > div.cover { - max-width: 980px; - margin: 0px auto; - /*padding-top: 110px;*/ -} - -div.cover { - -} - -div.cover > img { - width: 100%; - height: 100%; -} - - -/* Article -================================================== */ -.art { - margin-top: -131px; -} -/* Header */ -.art-header { - height: 900px; - /* Background image is defined in the post */ - background-position: top center; - background-attachment: fixed; - overflow: hidden; -} -/* Contains the time, title and subtitle for an article */ -.art-header-inner { - position: fixed; - top: 300px; - left: 50%; - margin-left: -490px; -} -.art-time, -.art-title, -.art-subtitle { - text-align: center; - text-transform: uppercase; -} -.art-time { - font-size: 14px; - line-height: 1.8; - letter-spacing: 4px; -} -.art-title { - font-size: 100px; - line-height: .9; - letter-spacing: -2px; - width: 100%; -} -.art-subtitle { - margin-top: 4px; - font-size: 14px; - line-height: 1.3; - letter-spacing: 4px; -} - -/* If small header, make few adjustments */ -.small .art-title { - font-size: 70px; - line-height: 65px; -} -.small.art-header-inner { - top: 320px; -} - -/* Body */ -.art-body { - position: relative; - width: 100%; - background: #fff; - z-index: 100; - -webkit-box-shadow: 0 -3px 3px rgba(0,0,0,.2); - -moz-box-shadow: 0 -3px 3px rgba(0,0,0,.2); - box-shadow: 0 -3px 3px rgba(0,0,0,.2); -} -.art-body-inner { - font-family: Georgia,Cambria,"Times New Roman",Times,serif; - max-width: 640px; - padding: 80px 0 50px; - letter-spacing: 0.01rem; - font-weight: 400; - font-style: normal; - font-size: 21px; - line-height: 1.5; -} -.art-body-inner a:hover { - border-bottom: 1px solid #F40034; - padding-bottom:2px; -} -.art-body-inner ul, -.art-body-inner ol { /* For lists in the article body */ - margin-bottom: 26px; -} -.art-body-inner ul li { - list-style: disc; -} - -.art-body-inner mark { - background-color: #fdffb6; - padding: 2px; - -webkit-box-shadow: #fdffb6 0 0 5px; - -moz-box-shadow: #fdffb6 0 0 5px; - box-shadow: #fdffb6 0 0 5px; -} - -.art-body-inner blockquote { - font-size: 16px; - background: #f9f9f9; - border-left: 10px solid #ccc; - margin: 1.5em 10px; - padding: 0.5em 10px; - quotes: "\201C""\201D""\2018""\2019"; -} - -.art-body-inner blockquote p:first-child:before { - color: #ccc; - content: "“"; - font-size: 4em; - line-height: 0.1em; - margin-right: 0.25em; - vertical-align: -0.4em; -} - -.art-body-inner blockquote p { - margin-bottom: 1.5em; -} - -.art-body-inner blockquote p:last-child { - margin-bottom: 0; -} - - -.dropcap { /* First character on articles */ - float: left; - margin: 47px 10px 20px 0; - font-size: 100px; - line-height: 0; -} -.art-subhead { /* Subheads are used to break up sections of an article */ - margin: 60px 0 15px; - font-size: 20px; - line-height: 28px; - letter-spacing: 3px; -} -.callout { /* Callouts are like large pullquotes */ - font-weight: bold; -} -.art-body-inner img { - max-width: 100%; - max-height: 600px; - margin-bottom: 26px; -} -.art-body-inner img.center { - display: block; - margin-left: auto; - margin-right: auto; -} -.art-body-inner .art-reference { - font-size: 80%; - color: #999; - margin-top: 50px; -} - -/* For simple, white background posts */ -.simple .art-body { - background: none; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; -} - - -/* List of Articles -================================================== */ -.art-list { - padding: 120px 0 0; -} -.art-list-body { - position: relative; - overflow: hidden; -} -.art-list-item { - padding: 40px 0; - list-style: none; - overflow: hidden; - border-bottom: 1px solid #ccc; -} -.art-list-item:last-child { - border-bottom: none; -} -.art-list-title { - font-size: 26px; - line-height: 26px; - font-weight: 700; -} -.art-list-item-title-and-time { - float: left; - width: 30%; - margin-bottom: 10px; -} -.art-list-time { - font-size: 12px; - line-height: 20px; - letter-spacing: 2px; - text-transform: uppercase; - color: #999; -} -.art-list-title a { - color: #000; -} -.art-list-title a:hover { - color: #F40034; -} -.art-list-item p { - width: 65%; - float: left; - margin-left: 5%; - margin-bottom: 0; - font-size: 16px; - line-height: 24px; -} - - -/* Footer -================================================== */ -.footer { - padding: 30px 0 40px; - overflow: hidden; - border-top: 1px solid #ccc; -} -.footer, -.footer a { - font-family: "proxima-nova", "helvetica neue", "helvetica", sans-serif; - font-size: 13px; - text-transform: uppercase; - color: #777; -} -.footer a:hover { - color: #000; -} -.back-to-top, -.footer-nav, -.offsite-links { - width: 45%; - float: left; -} -.psi { - width:10%; - float:left; - text-align: center; -} -.footer-nav { - text-align: center; -} -.offsite-links { - text-align: right; -} -.footer .twitter-link:hover { - color: #0084B4; -} -.footer .instagram-link:hover { - color: #3F729B; -} -.footer .github-link:hover { - color: #c5376d; -} -.footer .caffein8-link:hover{ - color: black; -} -.footer .rss-link:hover { - color: #e85d24; -} -/* Remove prev & next links on loop */ -.art-list + .footer .footer-nav, -.abt + .footer .footer-nav { - text-indent: -9999px; - text-align: left; -} - - -/* White Reverse Theme -================================================== */ -/* Nav */ -.nav.white { - border-bottom-color: #fff; - border-bottom-color: rgba(255,255,255,.3); -} -.nav.white li a, -.nav.white li, -.nav.white #logo h1 { - color: #fff; - text-shadow: 0 0 8px rgba(0,0,0,.5); -} -.nav.white #logo h1 { - background-position: top center; -} - -nav.pagination{ - text-align: right; - padding-bottom: 25px; -} -/* Art header */ -.art-header.white { - background-color: #111; -} -.art-header.white .art-time, -.art-header.white .art-title, -.art-header.white .art-subtitle { - color: #fff; - text-shadow: 0 0 8px rgba(0,0,0,.5); -} - - -/* About page -================================================== */ -.abt { - padding: 200px 0 100px; - list-style: none; -} -.abt .abt-header { - font-size: 140px; - line-height: 1; - text-transform: none; -} -.abt .abt-subheader { - font-size: 24px; - font-style: italic; - text-transform: none; - color: #777; -} -.abt-body { - -moz-column-count: 2; - -moz-column-gap: 20px; - -webkit-column-count: 2; - -webkit-column-gap: 20px; - margin-bottom: 28px; -} -.abt-signoff { - line-height: 1.3; - font-style: italic; - color: #777; -} - -/* 404 page -================================================== */ -.fourohfour { - padding: 240px 0 100px; - text-align: center; -} - -/* Code -================================================== */ - -code, tt { -background: #ededee; -color: #3C4043; -font-size: 90%; -padding: 1px 3px; -} - -pre { - width: 92%; - overflow: auto; - margin: 2rem 0; - padding: 1rem 0.8rem 1rem 1.2rem; - color: #3f3b36; - border: 1px solid #ccc; - border-left: 1rem solid #ccc; - font: lighter 1.2rem/2rem monospace; - background: url(/assets/img/pre.png) repeat 0 -0.9rem; - background-size: 1px 4rem; -} - -pre code, tt { -font-size: inherit; -white-space: -moz-pre-wrap; -white-space: pre-wrap; -background: transparent; -border: none; -padding: 0; -} - - -.gist { - font-size: 14px; -} - - -/* Responsive -================================================== */ -@media only screen and (max-width: 1080px) { - /* Set all of the 980 containers to flexible width */ - .nav, - .art-body-inner, - .art-header-inner, - .footer, - .art-list, - .abt, - .fourohfour { - width: 90%; - } - .nav, - .art-header-inner { - margin-left: -45%; - } -} - -@media only screen and (max-width: 1024px) { - /* Everything becomes scrolling and non-fading */ - .nav, - .nav.fixed { - position: relative; - opacity: 1 !important; /* Important to override JS values */ - display: inline-block; - } - .art-header-inner { - position: relative; - top: 0 !important; /* Important to override JS values */ - margin-top: 240px !important; /* Important to override JS values */ - opacity: 1 !important; /* Important to override JS values */ - } - /* Articles no longer have fixed heights */ - .art-header { - height: auto; - padding-bottom: 100px; - background-size: cover !important; - background-attachment: scroll; - } - /* Remove bottom space out if articles doesn't have a background */ - .simple .art-header { - padding-bottom: 0; - } - .art-list { - padding-top: 0; - } - .abt { - padding: 40px 0; - } - .fourohfour { - padding: 80px 0 60px; - } -} - -@media only screen and (max-width: 780px) { - .art-body-inner ul, - .art-body-inner ol { - margin-left: 20px; - } - .art-title { - letter-spacing: 0; - } - .art-subtitle, - .art-time { - font-size: 12px; - } - .nav { - padding-top: 25px; - height: 55px; - } - .art-list-item-title-and-time, - .art-list-item p { - float: none; - width: auto; - margin-left: 0; - } - .abt-body { - -moz-column-count: 1; - -webkit-column-count: 1; - } -} - -@media only screen and (max-width: 500px) { - .nav-primary li { - margin-left: 10px; - } - .nav #logo h1 { - font-size: 16px; - letter-spacing: -1px; - } - .nav li a { - font-size: 12px; - } - .art-header { - padding-bottom: 50px; - } - .art-header-inner { - margin-top: 190px !important; - } - .art-body-inner { - padding-top: 30px; - } - body { - font-size: 15px; - line-height: 24px; - } - p { - margin-bottom: 24px; - } - .footer { - padding: 10px 0 20px; - } - .back-to-top, - .footer-nav { - width: 50%; - } - .back-to-top { - text-align: left; - } - .footer-nav { - text-align: right; - } - .offsite-links { - float: left; - width: 100%; - text-align: left; - } - .offsite-links a { - font-size: 12px; - } - .art-list + .footer .footer-nav { - display: none; - } - .abt .abt-header { - font-size: 80px; - } - .abt .abt-subheader { - font-size: 18px; - } -} - - -/* Misc -================================================== */ -::selection { - background: #000; - color: #fff; -} -::-moz-selection { - background: #000; - color: #fff; -} -img.left { - float: left; - margin-right: 20px; -} -img.right { - float: right; - margin-left: 20px; -} -/* Clearfixing pile */ -.nav:before, -.art-body-inner:before, -.footer:before, -.art-list:before { - content:""; - display:table; -} -.nav:after, -.art-body-inner:after, -.footer:after, -.art-list:after { - clear:both; -} -.nav, -.art-body-inner, -.footer, -.art-list { - zoom:1; /* For IE 6/7 (trigger hasLayout) */ -} - - -@-webkit-keyframes le-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} -@-moz-keyframes le-fade { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -.art-header-inner { - -webkit-animation: le-fade .5s 0 1 ease-out; - -moz-animation: le-fade .5s 0 1 ease-out; -} - -.art-list, -.nav, -.abt, -.art-body { - -webkit-animation: le-fade .5s 0s 1 ease-out; - -moz-animation: le-fade .5s 0s 1 ease-out; -} - -hr.featured-article { - padding: 0; - border: none; - border-top: medium double #bbb; - color: #bbb; - text-align: center; -} -hr.featured-article:after { - content: "✭ Featured Article ✭"; - display: inline-block; - position: relative; - top: -0.8em; - font-size: 1.2em; - padding: 0 0.6em; - background: white; -} - -/* FORM */ - -#contact-area { - width: 600px; - margin-top: 25px; -} - -#contact-area input, #contact-area textarea { - padding: 5px; - width: 471px; - font-family: Helvetica, sans-serif; - margin: 0px 0px 10px 0px; - border: 2px solid #ccc; -} - -#contact-area textarea { - height: 90px; -} - -#contact-area textarea:focus, #contact-area input:focus { - border: 2px solid #900; -} - -#contact-area input.submit-button { - width: 100px; - -} - -label { - float: left; - text-align: right; - margin-right: 15px; - width: 100px; - padding-top: 5px; -} \ No newline at end of file From 6659ca905c53a6089a56b295fd17c208826f6d04 Mon Sep 17 00:00:00 2001 From: Binanda Date: Tue, 2 Dec 2014 07:23:24 +0900 Subject: [PATCH 6/7] Delete favicon.ico --- assets/img/favicon.ico | Bin 799 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 assets/img/favicon.ico diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico deleted file mode 100644 index 40b40ed345847af1db325abe295a4d7c33cc51d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 799 zcmZ?wbhEHbRA5kGc$UeqZ{NPZfB)9j)^6Us`Olv}|Ni~^`SWLYcXw)Ps)K`rqod=Z zMT^$0Ti4v&eCN)c-@kvqef!qi+dDKg^!@wyU%q@%RaG@NH($Pd`GN%tl9G}xUc6XR zQu6E9FLibGuV25udiCn{>(}4Ee~*cY`SIh2tE=m-UAqn)I`rbji{9SeckkZKojdp0 zvuEz^?gtJWP*G9YxN+mzvuFMM{GL2{qNu1iW5$g8_wN@K6&V>BZQHi(@#DvNd3lzW zmLEQRxPANf_U+p*UAlDo^y%p6==k{fH*el_bab?~wpLVBeE$47J3IUC-Mhxd#!Hqg z@$m34Gc(J{$+Z^ zfgzJY2V@Q?P8it#H)J+7x3spkcXW1jck-(-hw?JH@v`)EtEXqoo}E5zdY96i*(uFN zj0-Y3q?&aXr)xJUr*kZjNcUQi$uByGv)MHxowvt!Rt9@B(;SH=f#c~~U98q~HZ(=d zNo?X+@6f5SID?ZlQ)UiZror)R3hjJv=A>l?%&`{^ew41l*Dk;$_GoTkf%6J>Eil=TJ#E=(?aY;SM|LZ4G}!4c(8v)yZsj{E+;CCD xp^pWP3S4uv5|&mxacW8Syewc*%yzV+uO-MJ;ZQ Date: Tue, 2 Dec 2014 07:23:33 +0900 Subject: [PATCH 7/7] Delete pre.png --- assets/img/pre.png | Bin 78 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 assets/img/pre.png diff --git a/assets/img/pre.png b/assets/img/pre.png deleted file mode 100644 index 7f48517bff0b683fdb0065a1863a20657fd71c05..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 78 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfx!3HGlw@oMqQlg$Njv*Y^lM@mW9waO<{P_QW beUvbR+c8_#2`U~MKm`n*u6{1-oD!M