-
Tambah Post
+
Tambah Post
-
@@ -96,6 +95,7 @@
Tambah Post
+
-
-
-
Simple Blog | Apa itu Simple Blog?
-
-
-
-
-
-
-
-
- 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
-
-
-
- Nama:
-
-
- Email:
-
-
- Komentar:
-
-
-
-
-
-
-
-
-
- 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! …
-
-
-
-
- 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! …
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Simple Blog | Apa itu Simple Blog?
+
+
+
+
+
+
+
+
+ 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
+
+
+
+ Nama:
+
+
+ Email:
+
+
+ Komentar:
+
+
+
+
+
+
+
+
+
+ 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! …
+
+
+
+
+ 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
diff --git a/reference/post.php b/reference/post.php
new file mode 100644
index 00000000..8d068535
--- /dev/null
+++ b/reference/post.php
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+fetch_assoc();
+ $retrieved = $result['date'];
+ $date = DateTime::createFromFormat('Y-m-d', $retrieved);
+
+ //retrieve data from database (info_comment)
+ $query1 = "SELECT * FROM `comments` WHERE pid = $id";
+ if(!($results1 = mysqli_query($link, $query1)))
+ {
+ die('Error ' . mysqli_errno($link));
+ }
+?>
+
+
Simple Blog |
+
+
+
+
+
+
+
+
+ Kevhn's- Blog
+
+
+
+
+
+
+
+
+
+
+
+
+
Komentar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/setup/glassfish-resources.xml b/setup/glassfish-resources.xml
new file mode 100644
index 00000000..e3eca45a
--- /dev/null
+++ b/setup/glassfish-resources.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF
new file mode 100644
index 00000000..59499bce
--- /dev/null
+++ b/src/conf/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/src/java/Controller/DBMSController.java b/src/java/Controller/DBMSController.java
new file mode 100644
index 00000000..0df0aa79
--- /dev/null
+++ b/src/java/Controller/DBMSController.java
@@ -0,0 +1,64 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Controller;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author Jonathan
+ */
+public class DBMSController {
+ private Connection c;
+ private Statement stmt;
+
+
+ public DBMSController(String DatabaseName,String Username,String Password){
+ try {
+ c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/"+DatabaseName,Username,Password);
+ stmt = c.createStatement();
+ c.setAutoCommit(false);
+ } catch (SQLException ex) {
+ Logger.getLogger(DBMSController.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
+ public ResultSet ExecuteSQL(String Query){
+ ResultSet ret = null;
+ try {
+ ret = stmt.executeQuery(Query);
+ } catch (SQLException ex) {
+ Logger.getLogger(DBMSController.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return ret;
+ }
+
+ public int ExecuteUpdate(String Query){
+ int ret = -1;
+ try {
+ ret = stmt.executeUpdate(Query);
+ } catch (SQLException ex) {
+ Logger.getLogger(DBMSController.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return ret;
+ }
+
+ public void CloseConnection(){
+ try {
+ stmt.close();
+ c.commit();
+ c.close();
+ } catch (SQLException ex) {
+ Logger.getLogger(DBMSController.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+}
diff --git a/src/java/Controller/postController.java b/src/java/Controller/postController.java
new file mode 100644
index 00000000..96cc3b56
--- /dev/null
+++ b/src/java/Controller/postController.java
@@ -0,0 +1,31 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Controller;
+
+import javax.inject.Named;
+import javax.enterprise.context.Dependent;
+
+/**
+ *
+ * @author Jonathan
+ */
+
+public class postController {
+ /**
+ * List of Attributes
+ */
+ private model.Post model;
+ private view.postView view;
+
+
+
+ /**
+ * Creates a new instance of postController
+ */
+ public postController() {
+ }
+
+}
diff --git a/src/java/Controller/posting.java b/src/java/Controller/posting.java
new file mode 100644
index 00000000..f6c381b1
--- /dev/null
+++ b/src/java/Controller/posting.java
@@ -0,0 +1,20 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package Controller;
+
+/**
+ *
+ * @author Jonathan
+ */
+public class posting {
+
+ /**
+ * Creates a new instance of posting
+ */
+ public posting() {
+ }
+
+}
diff --git a/src/java/basisdata/logindata.java b/src/java/basisdata/logindata.java
new file mode 100644
index 00000000..38900d48
--- /dev/null
+++ b/src/java/basisdata/logindata.java
@@ -0,0 +1,162 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package basisdata;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.faces.bean.SessionScoped;
+import javax.inject.Named;
+
+/**
+ *
+ * @author steve
+ */
+@Named(value = "logindata")
+@SessionScoped
+public class logindata {
+ private String role;
+ private String nama;
+ private String namaAsli;
+ private String email;
+ private String password;
+ private final String url = "jdbc:postgresql://localhost:5432/simpleblog";
+ private final String databaseUser = "postgresql";
+ private final String databasePassword = "persib";
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public String getNama() {
+ return nama;
+ }
+
+ public void setNama(String nama) {
+ this.nama = nama;
+ }
+
+ public String getNamaAsli() {
+ return namaAsli;
+ }
+
+ public void setNamaAsli(String namaAsli) {
+ this.namaAsli = namaAsli;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+
+
+ /**
+ * Creates a new instance of logindata
+ */
+ public logindata() {
+ }
+
+ // Mengembalikan ID dari role user tertentu dalam bentuk integer
+ public int ConvertRoleToID() {
+ int role_id = 9999;
+
+ switch (role) {
+ case "Owner":
+ role_id = 0;
+ break;
+ case "Editor":
+ role_id = 1;
+ break;
+ case "Admin":
+ role_id = 2;
+ break;
+ case "Guest":
+ role_id = 3;
+ break;
+ }
+
+ return role_id;
+ }
+
+ public String register() {
+ Statement statement;
+ // Buat container perintah query ke koneksi drive
+ try (
+ // Konek ke drive jdbc postgresql
+ Connection connection = DriverManager.getConnection(url,databaseUser,databasePassword)) {
+ // Buat container perintah query ke koneksi drive
+ statement = connection.createStatement();
+ // Insert data nama, email, dan role ke basis data
+ int role_id = ConvertRoleToID(); // Konversi role dari string ke integer
+ if (role_id != 9999) { // ID role terbentuk
+ String insertDataQuery = "INSERT INTO user(username,realname,role,email) VALUES (" + nama + "," + namaAsli + "," + role_id + "," + email;
+ statement.executeUpdate(insertDataQuery);
+ }
+
+ statement.close();
+ } catch (SQLException ex) {
+ Logger.getLogger(logindata.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ return "registered";
+ }
+
+ public String login() throws SQLException{
+ // Penanda apakah username dan password valid atau tidak
+ boolean ValidAccount = false;
+
+ Statement statement;
+ ResultSet record;
+ // Buat container perintah query ke koneksi drive
+ try ( // Konek ke drive jdbc postgresql
+ Connection connection = DriverManager.getConnection(url,databaseUser,databasePassword)) {
+ // Buat container perintah query ke koneksi drive
+ statement = connection.createStatement();
+ // Search data username dan role pada database untuk validasi data yang dimasukkan
+ record = statement.executeQuery("SELECT * FROM user");
+ while (record.next()) {
+ String value_username = record.getString("username");
+ String value_password = record.getString("password");
+
+ // data yang dimasukkan dengan di database sesuai
+ if (value_username.equals(nama)) {
+ if (value_password.equals(password)) {
+ ValidAccount = true;
+ }
+ }
+ }
+ }
+ statement.close();
+ record.close();
+
+ if (ValidAccount) { // Akun valid, asumsi user terkait sudah pernah login sebelumnya
+ return "successLogin";
+ }
+ else {
+ return "failedLogin";
+ }
+ }
+}
diff --git a/src/java/model/Post.java b/src/java/model/Post.java
new file mode 100644
index 00000000..57ccb7e7
--- /dev/null
+++ b/src/java/model/Post.java
@@ -0,0 +1,86 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package model;
+
+import java.sql.Date;
+
+/**
+ *
+ * @author Jonathan
+ */
+public class Post {
+ /**
+ * Lists of attribute
+ */
+ private String title;
+ private int id;
+ private String content;
+ private String owner;
+ private boolean publish;
+ private Date date;
+ private boolean softDelete;
+
+ /**
+ * Setter and getter of attribute
+ * @return
+ */
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ public boolean isPublish() {
+ return publish;
+ }
+
+ public void setPublish(boolean publish) {
+ this.publish = publish;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public boolean isSoftDelete() {
+ return softDelete;
+ }
+
+ public void setSoftDelete(boolean softDelete) {
+ this.softDelete = softDelete;
+ }
+}
diff --git a/src/java/simpleblog/databaseController/CommentsController.java b/src/java/simpleblog/databaseController/CommentsController.java
new file mode 100644
index 00000000..315dd72e
--- /dev/null
+++ b/src/java/simpleblog/databaseController/CommentsController.java
@@ -0,0 +1,25 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package simpleblog.databaseController;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+/**
+ *
+ * @author kevhnmay94
+ */
+@ManagedBean
+@RequestScoped
+public class CommentsController {
+
+ /**
+ * Creates a new instance of CommentsController
+ */
+ public CommentsController() {
+ }
+
+}
diff --git a/src/java/simpleblog/databaseController/PagesController.java b/src/java/simpleblog/databaseController/PagesController.java
new file mode 100644
index 00000000..dd8fdd6d
--- /dev/null
+++ b/src/java/simpleblog/databaseController/PagesController.java
@@ -0,0 +1,209 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package simpleblog.databaseController;
+
+import java.sql.Connection;
+import java.sql.Date;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.util.ArrayList;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+/**
+ *
+ * @author kevhnmay94
+ */
+@ManagedBean(name="Pages")
+@RequestScoped
+public class PagesController {
+
+ public class Page
+ {
+ int id;
+ String title;
+ String content;
+ String owner;
+ Date date;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+
+ }
+ private ArrayList
pagelist;
+ private String current_title;
+ private String current_date;
+ private String current_content;
+ private String current_owner;
+ private int current_id;
+ private final Connection c;
+
+ public String getCurrent_owner() {
+ return current_owner;
+ }
+
+ public void setCurrent_owner(String current_owner) {
+ this.current_owner = current_owner;
+ }
+
+ public int getCurrent_id() {
+ return current_id;
+ }
+
+ public void setCurrent_id(int current_id) {
+ this.current_id = current_id;
+ }
+
+ public String getCurrent_title() {
+ return current_title;
+ }
+
+ public void setCurrent_title(String current_title) {
+ this.current_title = current_title;
+ }
+
+ public String getCurrent_date() {
+ return current_date;
+ }
+
+ public void setCurrent_date(String current_date) {
+ this.current_date = current_date;
+ }
+
+ public String getCurrent_content() {
+ return current_content;
+ }
+
+ public void setCurrent_content(String current_content) {
+ this.current_content = current_content;
+ }
+
+ public ArrayList getPagelist() {
+ return pagelist;
+ }
+
+ /**
+ * Creates a new instance of PagesController
+ * @throws java.lang.Exception
+ */
+ public PagesController() throws Exception {
+ Class.forName("org.postgresql.Driver");
+ c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/simpleblog","root", "");
+ }
+
+ public void listPost() throws Exception
+ {
+ String query = "SELECT * FROM public.pages WHERE publish=true AND"
+ + "soft_delete=false";
+ Statement s = c.createStatement();
+ ResultSet rs = s.executeQuery(query);
+ while(rs.next())
+ {
+ Page p = new Page();
+ p.setTitle(rs.getString("title"));
+ p.setContent(rs.getString("content"));
+ p.setOwner(rs.getString("owner"));
+ p.setId(rs.getInt("id"));
+ p.setDate(rs.getDate("date"));
+ pagelist.add(p);
+ }
+ }
+
+ public void newPost() throws Exception
+ {
+ String query = "INSERT INTO public.pages (title,content,owner,date) "
+ + "('" + current_title + "','" + current_content + "','"
+ + current_owner + "','" + current_date +"')";
+ Statement s = c.createStatement();
+ s.executeUpdate(query);
+ }
+
+ public void editPost(int id) throws Exception
+ {
+ String query = "SELECT * FROM public.pages WHERE id=" + id;
+ Statement s = c.createStatement();
+ ResultSet rs = s.executeQuery(query);
+ rs.first();
+ current_title = rs.getString("title");
+ current_content = rs.getString("content");
+ current_date = rs.getString("date");
+ current_id = id;
+ }
+
+ public void updatePost() throws Exception
+ {
+ String query = "UPDATE public.pages SET title='"+current_title +"', "
+ + "content='" + current_content + "', date=" + current_date + " WHERE "
+ + "ID=" + current_id;
+ Statement s = c.createStatement();
+ s.executeUpdate(query);
+ c.close();
+ }
+
+ public void softdeletePost(int id) throws Exception
+ {
+ String query = "UPDATE public.pages SET soft_delete=true WHERE "
+ + "ID=" + current_id;
+ Statement s = c.createStatement();
+ s.executeUpdate(query);
+ c.close();
+ }
+
+ public void deletePost(int id) throws Exception
+ {
+ String query = "DELETE FROM public.pages WHERE id=" + id;
+ Statement s = c.createStatement();
+ s.executeUpdate(query);
+ c.close();
+ }
+
+ public void publishPost(int id) throws Exception
+ {
+ String query = "UPDATE public.pages SET publish=true WHERE id=" + id;
+ Statement s = c.createStatement();
+ s.executeUpdate(query);
+ c.close();
+ }
+}
diff --git a/src/java/simpleblog/databaseController/UserController.java b/src/java/simpleblog/databaseController/UserController.java
new file mode 100644
index 00000000..400d2608
--- /dev/null
+++ b/src/java/simpleblog/databaseController/UserController.java
@@ -0,0 +1,25 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package simpleblog.databaseController;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+/**
+ *
+ * @author kevhnmay94
+ */
+@ManagedBean(eager=true)
+@SessionScoped
+public class UserController {
+
+ /**
+ * Creates a new instance of UserController
+ */
+ public UserController() {
+ }
+
+}
diff --git a/src/java/simpleblog/validator/TanggalValidator.java b/src/java/simpleblog/validator/TanggalValidator.java
new file mode 100644
index 00000000..75275dae
--- /dev/null
+++ b/src/java/simpleblog/validator/TanggalValidator.java
@@ -0,0 +1,50 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package simpleblog.validator;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.FacesValidator;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+//import java.sql.Date;
+/**
+ *
+ * @author Asus
+ */
+@FacesValidator("TanggalValidator")
+public class TanggalValidator implements Validator {
+
+ @Override
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
+ if (value == null) {
+ return;
+ }
+
+ DateFormat df = new SimpleDateFormat("dd-mm-yyyy");
+ Date d;
+ try {
+ d = df.parse((String) value);
+ } catch (ParseException ex) {
+ throw new ValidatorException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, "Format tanggal dd-mm-yyy", null));
+ }
+
+ Date e = new Date();
+ if (e.after(d)) {
+
+ throw new ValidatorException(new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, "Tanggal tidak boleh kurang dari tanggal sekarang.", null));
+ }
+ }
+
+
+}
diff --git a/src/java/view/postView.java b/src/java/view/postView.java
new file mode 100644
index 00000000..2cd3b1d5
--- /dev/null
+++ b/src/java/view/postView.java
@@ -0,0 +1,20 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package view;
+
+/**
+ *
+ * @author Jonathan
+ */
+public class postView {
+
+ /**
+ * Creates a new instance of postView
+ */
+ public postView() {
+ }
+
+}
diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml
new file mode 100644
index 00000000..f1c10fb1
--- /dev/null
+++ b/web/WEB-INF/faces-config.xml
@@ -0,0 +1,29 @@
+
+
+<<<<<<< HEAD
+
+ Post
+ model.Post
+ session
+
+ postView
+ view.postView
+ session
+
+
+ postController
+ Controller.postController
+ session
+
+
+ posting
+ Controller.posting
+ session
+
+=======
+
+>>>>>>> 11656e32d318010d842163d5cab9dbaa7526e757
+
diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml
new file mode 100644
index 00000000..c5e7c738
--- /dev/null
+++ b/web/WEB-INF/web.xml
@@ -0,0 +1,24 @@
+
+
+
+ javax.faces.PROJECT_STAGE
+ Development
+
+
+ Faces Servlet
+ javax.faces.webapp.FacesServlet
+ 1
+
+
+ Faces Servlet
+ /faces/*
+
+
+
+ 30
+
+
+
+ faces/index.xhtml
+
+
diff --git a/web/admin_page.xhtml b/web/admin_page.xhtml
new file mode 100644
index 00000000..9cadcc0a
--- /dev/null
+++ b/web/admin_page.xhtml
@@ -0,0 +1,16 @@
+
+
+
+ Simple Blog - Admin Page
+
+
+
+
+
+
+
+
+
+
diff --git a/web/client_template.xhtml b/web/client_template.xhtml
new file mode 100644
index 00000000..7907943f
--- /dev/null
+++ b/web/client_template.xhtml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ title
+
+
+
+ content
+
+
+
+ jscript
+
+
+
diff --git a/web/edit_post.xhtml b/web/edit_post.xhtml
new file mode 100644
index 00000000..7907943f
--- /dev/null
+++ b/web/edit_post.xhtml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ title
+
+
+
+ content
+
+
+
+ jscript
+
+
+
diff --git a/web/editor_page.xhtml b/web/editor_page.xhtml
new file mode 100644
index 00000000..bd9ab282
--- /dev/null
+++ b/web/editor_page.xhtml
@@ -0,0 +1,16 @@
+
+
+
+ Simple Blog - Editor Page
+
+
+
+
+
+
+
+
+
+
diff --git a/web/index.xhtml b/web/index.xhtml
new file mode 100644
index 00000000..f83adbd6
--- /dev/null
+++ b/web/index.xhtml
@@ -0,0 +1,56 @@
+
+
+
+ Simple Blog
+
+
+
+
+
+
+
+
+ #{item.content}
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/new_post.xhtml b/web/new_post.xhtml
new file mode 100644
index 00000000..76a1a126
--- /dev/null
+++ b/web/new_post.xhtml
@@ -0,0 +1,53 @@
+
+
+
+ Simple Blog - New Post
+
+
+
+
+
+ -
+
+
+
+
Tambah Post
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/post.xhtml b/web/post.xhtml
new file mode 100644
index 00000000..d359fc4b
--- /dev/null
+++ b/web/post.xhtml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
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
+
+
+
+ Nama:
+
+
+ Email:
+
+
+ Komentar:
+
+
+
+
+
+
+
+
+
+ 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! …
+
+
+
+
+ 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! …
+
+
+
+
+
+
+
+
+
+=======
+ template="./template.xhtml"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
+ Simple Blog - #{Pages.current_title}
+
+
+
+
+
+
+
+
#{Pages.current_content}
+
+
+
Komentar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+>>>>>>> 11656e32d318010d842163d5cab9dbaa7526e757
+
+
diff --git a/web/resources/css/cssLayout.css b/web/resources/css/cssLayout.css
new file mode 100644
index 00000000..a1871473
--- /dev/null
+++ b/web/resources/css/cssLayout.css
@@ -0,0 +1,61 @@
+
+#top {
+ position: relative;
+ //background-color: #036fab;
+ color: white;
+ padding: 5px;
+ margin: 0px 0px 10px 0px;
+}
+
+#bottom {
+ position: relative;
+ //background-color: #c2dfef;
+ padding: 5px;
+ margin: 10px 0px 0px 0px;
+}
+
+#left {
+ float: left;
+ //background-color: #ece3a5;
+ padding: 5px;
+ width: 150px;
+}
+
+#right {
+ float: right;
+ //background-color: #ece3a5;
+ padding: 5px;
+ width: 150px;
+}
+
+.center_content {
+ position: relative;
+ background-color: #dddddd;
+ padding: 5px;
+}
+
+.left_content {
+ //background-color: #dddddd;
+ padding: 5px;
+ margin-left: 170px;
+}
+
+.right_content {
+ background-color: #dddddd;
+ padding: 5px;
+ margin: 0px 170px 0px 170px;
+}
+
+#top a:link, #top a:visited {
+ color: white;
+ font-weight : bold;
+ text-decoration: none;
+}
+
+#top a:link:hover, #top a:visited:hover {
+ color: black;
+ font-weight : bold;
+ text-decoration : underline;
+}
+
+
diff --git a/web/resources/css/default.css b/web/resources/css/default.css
new file mode 100644
index 00000000..6cbc3d18
--- /dev/null
+++ b/web/resources/css/default.css
@@ -0,0 +1,29 @@
+body {
+ background-color: #ffffff;
+ font-size: 12px;
+ font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
+ color: #000000;
+ margin: 10px;
+}
+
+h1 {
+ font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
+ border-bottom: 1px solid #AFAFAF;
+ font-size: 16px;
+ font-weight: bold;
+ margin: 0px;
+ padding: 0px;
+ color: #D20005;
+}
+
+a:link, a:visited {
+ color: #045491;
+ font-weight : bold;
+ text-decoration: none;
+}
+
+a:link:hover, a:visited:hover {
+ color: #045491;
+ font-weight : bold;
+ text-decoration : underline;
+}
diff --git a/web/resources/css/screen.css b/web/resources/css/screen.css
new file mode 100644
index 00000000..c433f593
--- /dev/null
+++ b/web/resources/css/screen.css
@@ -0,0 +1,876 @@
+/* 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: 35px;
+ 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: #3403F7;
+ 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: #FF0000;
+}
+
+/* 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: relative;
+ 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 {
+ 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;
+ position: relative;
+ top: 40px;
+}
+
+
+/* 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;
+ color: #999;
+}
+.art-list-title a {
+ color: #000;
+ cursor: pointer;
+}
+.art-list-title a:hover {
+ color: #3403F7;
+}
+.art-list-item p {
+ width: 65%;
+ float: left;
+ margin-left: 5%;
+ margin-bottom: 0;
+ font-size: 16px;
+ line-height: 24px;
+ text-align: justify;
+}
+
+.art-list-item .editable {
+ position: relative;
+ left: 30%;
+ cursor: pointer;
+}
+
+
+/* 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: 250px;
+}
+
+#contact-area textarea:focus, #contact-area input:focus {
+ border: 2px solid #0084B4;
+}
+
+#contact-area input.submit-button {
+ width: 100px;
+
+}
+
+#contact-area #errormsg{
+ position:relative;
+ left:115px;
+ color: #FF0000;
+ font-size:medium;
+}
+
+label {
+ float: left;
+ text-align: right;
+ margin-right: 15px;
+ width: 100px;
+ padding-top: 5px;
+}.default {
+
+}
diff --git a/web/resources/js/app.js b/web/resources/js/app.js
new file mode 100644
index 00000000..66276cd1
--- /dev/null
+++ b/web/resources/js/app.js
@@ -0,0 +1,144 @@
+var isMobile;
+
+// Identify if visitor on mobile with lame sniffing to remove parallaxing title
+if( navigator.userAgent.match(/Android/i) ||
+ navigator.userAgent.match(/webOS/i) ||
+ navigator.userAgent.match(/iPhone/i) ||
+ navigator.userAgent.match(/iPod/i) ||
+ navigator.userAgent.match(/iPad/i) ||
+ navigator.userAgent.match(/BlackBerry/)
+){
+ isMobile = true;
+}
+
+$(document).ready(function() {
+
+ // Global vars
+ var $artHeaderInner = $('.art-header-inner');
+ var $artHeader = $('.art-header');
+ var $artTitle = $('.art-title');
+ var $artSubtitle = $('.art-subtitle');
+ var $artTime = $('.art-time');
+ var artTitleFontSize = parseInt($artTitle.css('font-size'));
+ var $nav = $('.nav');
+ var windowScroll;
+
+ // Apply Fittext to article titles to make it scale responsively in a smooth fashion
+ $artTitle.fitText(1, { minFontSize: '34px' });
+
+ // Identify if visitor has a large enough viewport for parallaxing title
+ function isLargeViewport() {
+ if($nav.css('position') == "relative") {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ // If large viewport and not mobile, parallax the title
+ if(!isMobile) {
+ $(window).scroll(function() {
+ if(isLargeViewport()) {
+ slidingTitle();
+ }
+ });
+ }
+
+ // Window gets large enough, need to recalc all parallaxing title values
+ $(window).resize(function() {
+ if(isLargeViewport()) {
+ slidingTitle();
+ }
+ });
+
+ // Functional parallaxing calculations
+ function slidingTitle() {
+ //Get scroll position of window
+ windowScroll = $(this).scrollTop();
+
+ //Slow scroll of .art-header-inner scroll and fade it out
+ $artHeaderInner.css({
+ 'margin-top' : -(windowScroll/3)+"px",
+ 'opacity' : 1-(windowScroll/550)
+ });
+
+ //Slowly parallax the background of .art-header
+ $artHeader.css({
+ 'background-position' : 'center ' + (-windowScroll/8)+"px"
+ });
+
+ //Fade the .nav out
+ $nav.css({
+ 'opacity' : 1-(windowScroll/400)
+ });
+ }
+
+ // Link to top of page without changing URL
+ $('.back-to-top a').click(function(e) {
+ e.preventDefault();
+ $(window).scrollTop(0);
+ })
+
+ // Cover image of the header
+ var $postImage = $('img[alt="cover"]');
+ if ( $postImage.length ) {
+ var postImageURL = $postImage.attr('src');
+ $('.art-header').css('background-image','url(' + postImageURL + ')');
+ $('.art-header').css('background-size','100%');
+
+ // Change color scheme to white
+ $('#logo h1').css('color','white');
+ $('.art-title').css('color','white');
+ $('.art-subtitle').css('color','white');
+ $('.art-time').css('color','white');
+ $('.nav-primary li a').css('color','white');
+
+ // Add Text Shadows
+ $('.art-title').css('text-shadow','3px 3px 0 rgba(0,0,0,0.1), -1px -1px 0 rgba(0,0,0,0.1), 1px -1px 0 rgba(0,0,0,0.1), -1px 1px 0 rgba(0,0,0,0.1), 1px 1px 0 rgba(0,0,0,0.1)');
+ $('.art-subtitle').css('text-shadow','3px 3px 0 rgba(0,0,0,0.1), -1px -1px 0 rgba(0,0,0,0.1), 1px -1px 0 rgba(0,0,0,0.1), -1px 1px 0 rgba(0,0,0,0.1), 1px 1px 0 rgba(0,0,0,0.1)');
+ $('.art-time').css('text-shadow','3px 3px 0 rgba(0,0,0,0.1), -1px -1px 0 rgba(0,0,0,0.1), 1px -1px 0 rgba(0,0,0,0.1), -1px 1px 0 rgba(0,0,0,0.1), 1px 1px 0 rgba(0,0,0,0.1)');
+
+ }
+ $postImage.remove();
+
+ // Subtitles
+ var $subtitle = $('span[id="subtitle"]');
+ if ( $subtitle.length ) {
+ var subtitleText = $('#subtitle').text();
+ $('.art-subtitle').html(subtitleText);
+
+ }
+ $subtitle.remove();
+
+ // Make punctuation smarter
+ jQuery.fn.smarten = (function() {
+
+ function smartenNode(node) {
+ if (node.nodeType === 3) {
+ node.data = node.data
+ .replace(/(^|[-\u2014/(\[{"\s])'/g, "$1\u2018") // Opening singles
+ .replace(/'/g, "\u2019") // Closing singles & apostrophes
+ .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1\u201c") // Opening doubles
+ .replace(/"/g, "\u201d") // Closing doubles
+ .replace(/--/g, "\u2013") // En dashes
+ .replace(/---/g, "\u2014") // Em dashes
+ .replace(/\.{3}/g, "\u2026"); // Ellipsis
+ } else if (node.nodeType === 1) {
+ if (node = node.firstChild) do {
+ smartenNode(node);
+ } while (node = node.nextSibling);
+ }
+ }
+
+ return function() {
+ return this.each(function(){
+ smartenNode(this);
+ });
+ };
+
+ }());
+
+ // Instantiation
+ $('article').smarten();
+
+});
\ No newline at end of file
diff --git a/web/resources/js/fittext.js b/web/resources/js/fittext.js
new file mode 100644
index 00000000..035baa36
--- /dev/null
+++ b/web/resources/js/fittext.js
@@ -0,0 +1,46 @@
+/*global jQuery */
+/*!
+* FitText.js 1.0
+*
+* Copyright 2011, Dave Rupert http://daverupert.com
+* Released under the WTFPL license
+* http://sam.zoy.org/wtfpl/
+*
+* Date: Thu May 05 14:23:00 2011 -0600
+*/
+$(document).ready(function() {
+
+(function( $ ){
+
+ $.fn.fitText = function( kompressor, options ) {
+
+ // Setup options
+ var compressor = kompressor || 1,
+ settings = $.extend({
+ 'minFontSize' : Number.NEGATIVE_INFINITY,
+ 'maxFontSize' : Number.POSITIVE_INFINITY
+ }, options);
+
+ return this.each(function(){
+
+ // Store the object
+ var $this = $(this);
+
+ // Resizer() resizes items based on the object width divided by the compressor * 10
+ var resizer = function () {
+ $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
+ };
+
+ // Call once to set.
+ resizer();
+
+ // Call on resize. Opera debounces their resize by default.
+ $(window).on('resize', resizer);
+
+ });
+
+ };
+
+})( jQuery );
+
+});
\ No newline at end of file
diff --git a/web/resources/js/formValidation.js b/web/resources/js/formValidation.js
new file mode 100644
index 00000000..5093fe53
--- /dev/null
+++ b/web/resources/js/formValidation.js
@@ -0,0 +1,41 @@
+function Validation()
+{
+ var tanggal = document.getElementById('Tanggal').value;
+ document.getElementById('errormsg').innerHTML="";
+ var tanggal1 = parseDate(tanggal);
+ if(tanggal1 === null)
+ {
+ return false;
+ }
+ else
+ {
+ var tanggal2 = new Date();
+ var result = tanggal1 > tanggal2;
+ if(result)
+ {
+ var tanggal_reverse = tanggal.split("-").reverse().join("-");
+ document.getElementById('Tanggal').value=tanggal_reverse;
+ return true;
+ }
+ else
+ {
+ document.getElementById('errormsg').innerHTML="*Tanggal sudah lewat. Masukkan tanggal yang valid.";
+ return false;
+ }
+ }
+}
+
+function parseDate(str) {
+ var m = str.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);
+ var tanggal3;
+ if(m)
+ {
+ var tanggal3 = new Date(m[3],m[2]-1,m[1]-(-1));
+ }
+ else
+ {
+ document.getElementById("errormsg").innerHTML="*format tanggal salah. (format:dd-mm-yyyy)";
+ var tanggal3 = null;
+ }
+ return tanggal3;
+}
\ No newline at end of file
diff --git a/web/resources/js/getdatabase.js b/web/resources/js/getdatabase.js
new file mode 100644
index 00000000..d4869c6e
--- /dev/null
+++ b/web/resources/js/getdatabase.js
@@ -0,0 +1,91 @@
+/* function addcomment(id)
+{
+ var content = document.getElementById('ajaxcontent');
+ var nama = document.getElementById('nama').value;
+ var komentar = document.getElementById('komentar').value;
+ var email = document.getElementById('email').value;
+
+ xmlhttp.onreadystatechange = function()
+ {
+ if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
+ {
+ content.innerHTML = xmlhttp.responseText;
+ }
+ };
+
+ xmlhttp.open("GET","addcomment.php?id="+id+"&nama="+nama+"&komentar="+komentar+"&email="+email,true);
+ xmlhttp.send();
+} */
+
+function ajaxRequest(){
+ var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
+ if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
+ for (var i=0; i()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+ if(email != "")
+ {
+ var valid = regex.test(email);
+ var errormessage = document.getElementById('errormsg');
+
+ if(valid)
+ {
+ errormessage.innerHTML="";
+ var xmlhttp = new ajaxRequest();
+ var content = document.getElementById('ajaxcontent');
+ var nama = encodeURIComponent(document.getElementById('nama').value);
+ var komentar = encodeURIComponent(document.getElementById('komentar').value);
+ var id = encodeURIComponent(document.getElementById('pid').value);
+ console.log(id);
+ var email2 = encodeURIComponent(email);
+ xmlhttp.onreadystatechange = function()
+ {
+ if(xmlhttp.readyState == 4 && ((xmlhttp.status == 200) || (window.location.href.indexOf("http")==-1)))
+ {
+ content.innerHTML = xmlhttp.responseText;
+ }
+ };
+
+ xmlhttp.open("POST","addcomment.php",true);
+ xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
+ xmlhttp.send("nama="+nama+"&komentar="+komentar+"&email="+email+"&pid="+id);
+
+ }
+ else
+ {
+ errormessage.innerHTML="Format email tidak valid";
+ }
+ }
+}
+
diff --git a/web/resources/js/post.js b/web/resources/js/post.js
new file mode 100644
index 00000000..c14e3a51
--- /dev/null
+++ b/web/resources/js/post.js
@@ -0,0 +1,12 @@
+function hapus(id)
+{
+ var konfirmasi = confirm('Apakah anda yakin menghapus post ini?');
+ if(konfirmasi)
+ {
+ var formObjects = document.forms['post'];
+ var formElements = formObjects.elements['id'];
+ formElements.value = id.substring(1);
+ formObjects.action = "deletePost.php";
+ formObjects.submit();
+ }
+}
\ No newline at end of file
diff --git a/web/resources/js/respond.min.js b/web/resources/js/respond.min.js
new file mode 100644
index 00000000..b7fe2f47
--- /dev/null
+++ b/web/resources/js/respond.min.js
@@ -0,0 +1,2 @@
+/*! Respond.js v1.0.1pre: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
+(function(e,h){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=h;if(h){return}var u=e.document,r=u.documentElement,i=[],k=[],p=[],o={},g=30,f=u.getElementsByTagName("head")[0]||r,b=f.getElementsByTagName("link"),d=[],a=function(){var B=b,w=B.length,z=0,y,x,A,v;for(;z=F.minw)&&(!F.maxw||F.maxw&&D<=F.maxw)){if(!z[F.media]){z[F.media]=[]}z[F.media].push(k[F.rules])}}for(var y in p){if(p[y]&&p[y].parentNode===f){f.removeChild(p[y])}}for(var y in z){var G=u.createElement("style"),A=z[y].join("\n");G.type="text/css";G.media=y;if(G.styleSheet){G.styleSheet.cssText=A}else{G.appendChild(u.createTextNode(A))}C.appendChild(G);p.push(G)}f.insertBefore(C,B.nextSibling)},n=function(v,x){var w=c();if(!w){return}w.open("GET",v,true);w.onreadystatechange=function(){if(w.readyState!=4||w.status!=200&&w.status!=304){return}x(w.responseText)};if(w.readyState==4){return}w.send(null)},c=(function(){var v=false;try{v=new XMLHttpRequest()}catch(w){v=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return v}})();a();respond.update=a;function s(){j(true)}if(e.addEventListener){e.addEventListener("resize",s,false)}else{if(e.attachEvent){e.attachEvent("onresize",s)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));
\ No newline at end of file
diff --git a/web/template.xhtml b/web/template.xhtml
new file mode 100644
index 00000000..6a9deebe
--- /dev/null
+++ b/web/template.xhtml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+ Simple Blog
+
+
+
+
+
+
+
+
+