diff --git a/assets/img/favicon.ico b/assets/img/favicon.ico deleted file mode 100644 index 40b40ed3..00000000 Binary files a/assets/img/favicon.ico and /dev/null differ diff --git a/assets/img/pre.png b/assets/img/pre.png deleted file mode 100644 index 7f48517b..00000000 Binary files a/assets/img/pre.png and /dev/null differ diff --git a/build.xml b/build.xml new file mode 100644 index 00000000..acc5ccb9 --- /dev/null +++ b/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + Builds, tests, and runs the project SimpleBlog. + + + diff --git a/build/web/META-INF/MANIFEST.MF b/build/web/META-INF/MANIFEST.MF new file mode 100644 index 00000000..59499bce --- /dev/null +++ b/build/web/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/build/web/WEB-INF/classes/.netbeans_automatic_build b/build/web/WEB-INF/classes/.netbeans_automatic_build new file mode 100644 index 00000000..e69de29b diff --git a/build/web/WEB-INF/classes/.netbeans_update_resources b/build/web/WEB-INF/classes/.netbeans_update_resources new file mode 100644 index 00000000..e69de29b diff --git a/build/web/WEB-INF/classes/Controller/DBMSController.class b/build/web/WEB-INF/classes/Controller/DBMSController.class new file mode 100644 index 00000000..c076fcea Binary files /dev/null and b/build/web/WEB-INF/classes/Controller/DBMSController.class differ diff --git a/build/web/WEB-INF/classes/Controller/postController.class b/build/web/WEB-INF/classes/Controller/postController.class new file mode 100644 index 00000000..14a39c39 Binary files /dev/null and b/build/web/WEB-INF/classes/Controller/postController.class differ diff --git a/build/web/WEB-INF/classes/Controller/posting.class b/build/web/WEB-INF/classes/Controller/posting.class new file mode 100644 index 00000000..1f3a9437 Binary files /dev/null and b/build/web/WEB-INF/classes/Controller/posting.class differ diff --git a/build/web/WEB-INF/classes/model/Post.class b/build/web/WEB-INF/classes/model/Post.class new file mode 100644 index 00000000..7b19761c Binary files /dev/null and b/build/web/WEB-INF/classes/model/Post.class differ diff --git a/build/web/WEB-INF/classes/view/postView.class b/build/web/WEB-INF/classes/view/postView.class new file mode 100644 index 00000000..c974cea8 Binary files /dev/null and b/build/web/WEB-INF/classes/view/postView.class differ diff --git a/build/web/WEB-INF/faces-config.xml b/build/web/WEB-INF/faces-config.xml new file mode 100644 index 00000000..f1c10fb1 --- /dev/null +++ b/build/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/build/web/WEB-INF/sun-web.xml b/build/web/WEB-INF/sun-web.xml new file mode 100644 index 00000000..1ac7af40 --- /dev/null +++ b/build/web/WEB-INF/sun-web.xml @@ -0,0 +1,11 @@ + + + + + + + Keep a copy of the generated servlet class' java code. + + + + diff --git a/build/web/WEB-INF/web.xml b/build/web/WEB-INF/web.xml new file mode 100644 index 00000000..c5e7c738 --- /dev/null +++ b/build/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/build/web/admin_page.xhtml b/build/web/admin_page.xhtml new file mode 100644 index 00000000..9cadcc0a --- /dev/null +++ b/build/web/admin_page.xhtml @@ -0,0 +1,16 @@ + + + + Simple Blog - Admin Page + + + + + + + + + + diff --git a/build/web/client_template.xhtml b/build/web/client_template.xhtml new file mode 100644 index 00000000..7907943f --- /dev/null +++ b/build/web/client_template.xhtml @@ -0,0 +1,18 @@ + + + + + + title + + + + content + + + + jscript + + + diff --git a/build/web/editor_page.xhtml b/build/web/editor_page.xhtml new file mode 100644 index 00000000..bd9ab282 --- /dev/null +++ b/build/web/editor_page.xhtml @@ -0,0 +1,16 @@ + + + + Simple Blog - Editor Page + + + + + + + + + + diff --git a/build/web/gfv3ee6.dpf b/build/web/gfv3ee6.dpf new file mode 100644 index 00000000..e69de29b diff --git a/build/web/index.xhtml b/build/web/index.xhtml new file mode 100644 index 00000000..f83adbd6 --- /dev/null +++ b/build/web/index.xhtml @@ -0,0 +1,56 @@ + + + + Simple Blog + +
+
+ +
+
+
+ + + + + + + + +
diff --git a/build/web/new_post.xhtml b/build/web/new_post.xhtml new file mode 100644 index 00000000..76a1a126 --- /dev/null +++ b/build/web/new_post.xhtml @@ -0,0 +1,53 @@ + + + + Simple Blog - New Post + + +
+ + +

-

+ +
+
+

Tambah Post

+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + +
diff --git a/build/web/post.xhtml b/build/web/post.xhtml new file mode 100644 index 00000000..d359fc4b --- /dev/null +++ b/build/web/post.xhtml @@ -0,0 +1,126 @@ + + + + + +
+ +
+
+ +

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! …

    +
  • +
+
+
+ +
+ +
+ +======= + 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_title}

+
+
+ +
+
+

#{Pages.current_content}

+ + +

Komentar

+ +
+
+ + + + + + + +
+ +

+ + + +
+
+
    + +
    + +
    + +
+
+
+ +
+
+ + + + + + +>>>>>>> 11656e32d318010d842163d5cab9dbaa7526e757 + +
diff --git a/build/web/resources/css/cssLayout.css b/build/web/resources/css/cssLayout.css new file mode 100644 index 00000000..a1871473 --- /dev/null +++ b/build/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/build/web/resources/css/default.css b/build/web/resources/css/default.css new file mode 100644 index 00000000..6cbc3d18 --- /dev/null +++ b/build/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/assets/css/screen.css b/build/web/resources/css/screen.css similarity index 97% rename from assets/css/screen.css rename to build/web/resources/css/screen.css index 1d8fdf3b..c433f593 100644 --- a/assets/css/screen.css +++ b/build/web/resources/css/screen.css @@ -1,6 +1,3 @@ -@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 { @@ -50,7 +47,7 @@ h1 { } h2 { - font-size: 45px; + font-size: 35px; padding-bottom: 25px; } @@ -106,14 +103,14 @@ header#teaser h1 { /* Links ================================================== */ a { - color: #F40034; + 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: #F40034; + color: #FF0000; } /* Layout @@ -161,6 +158,7 @@ a:hover { } #logo { float: left; + } .nav-primary { float: right; @@ -233,7 +231,7 @@ div.cover > img { } /* Contains the time, title and subtitle for an article */ .art-header-inner { - position: fixed; + position: relative; top: 300px; left: 50%; margin-left: -490px; @@ -292,7 +290,6 @@ div.cover > img { line-height: 1.5; } .art-body-inner a:hover { - border-bottom: 1px solid #F40034; padding-bottom:2px; } .art-body-inner ul, @@ -375,6 +372,8 @@ div.cover > img { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; + position: relative; + top: 40px; } @@ -410,14 +409,14 @@ div.cover > img { font-size: 12px; line-height: 20px; letter-spacing: 2px; - text-transform: uppercase; color: #999; } .art-list-title a { color: #000; + cursor: pointer; } .art-list-title a:hover { - color: #F40034; + color: #3403F7; } .art-list-item p { width: 65%; @@ -426,6 +425,13 @@ div.cover > img { margin-bottom: 0; font-size: 16px; line-height: 24px; + text-align: justify; +} + +.art-list-item .editable { + position: relative; + left: 30%; + cursor: pointer; } @@ -840,11 +846,11 @@ hr.featured-article:after { } #contact-area textarea { - height: 90px; + height: 250px; } #contact-area textarea:focus, #contact-area input:focus { - border: 2px solid #900; + border: 2px solid #0084B4; } #contact-area input.submit-button { @@ -852,10 +858,19 @@ hr.featured-article:after { } +#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; -} \ No newline at end of file +}.default { + +} diff --git a/build/web/resources/js/app.js b/build/web/resources/js/app.js new file mode 100644 index 00000000..66276cd1 --- /dev/null +++ b/build/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/build/web/resources/js/fittext.js b/build/web/resources/js/fittext.js new file mode 100644 index 00000000..035baa36 --- /dev/null +++ b/build/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/build/web/resources/js/formValidation.js b/build/web/resources/js/formValidation.js new file mode 100644 index 00000000..5093fe53 --- /dev/null +++ b/build/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/build/web/resources/js/getdatabase.js b/build/web/resources/js/getdatabase.js new file mode 100644 index 00000000..d4869c6e --- /dev/null +++ b/build/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@\"]+)*)|(\".+\"))@((\[[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/build/web/resources/js/post.js b/build/web/resources/js/post.js new file mode 100644 index 00000000..c14e3a51 --- /dev/null +++ b/build/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/build/web/resources/js/respond.min.js b/build/web/resources/js/respond.min.js new file mode 100644 index 00000000..b7fe2f47 --- /dev/null +++ b/build/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/build/web/template.xhtml b/build/web/template.xhtml new file mode 100644 index 00000000..6a9deebe --- /dev/null +++ b/build/web/template.xhtml @@ -0,0 +1,54 @@ + + + + + + + + + + + Simple Blog + + + + +
+ + + + + + +
+ + +
Ψ
+ + +
+
+
+ +
+ + diff --git a/nbproject/ant-deploy.xml b/nbproject/ant-deploy.xml new file mode 100644 index 00000000..2d5f8778 --- /dev/null +++ b/nbproject/ant-deploy.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 00000000..ac0cfefe --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.web.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.war + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at +<netbeans_installation>/java<version>/ant/extra folder. +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + Must select a file in the IDE or set jsp.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. + + + Launching ${browse.url} + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/faces-config.NavData b/nbproject/faces-config.NavData new file mode 100644 index 00000000..127677b3 --- /dev/null +++ b/nbproject/faces-config.NavData @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 00000000..adbef8ea --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=11ab5885 +build.xml.script.CRC32=bedf25f1 +build.xml.stylesheet.CRC32=651128d4@1.68.1.1 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=11ab5885 +nbproject/build-impl.xml.script.CRC32=22799c1c +nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 00000000..3eb5e59e --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,17 @@ +<<<<<<< HEAD +deploy.ant.properties.file=C:\\Users\\Jonathan\\AppData\\Roaming\\NetBeans\\8.0\\config\\GlassFishEE6\\Properties\\gfv3-389264140.properties +j2ee.platform.is.jsr109=true +j2ee.server.domain=C:/Users/Jonathan/AppData/Roaming/NetBeans/8.0/config/GF_4.0/domain1 +j2ee.server.home=C:/Program Files/glassfish-4.0/glassfish +j2ee.server.instance=[C:\\Program Files\\glassfish-4.0\\glassfish;C:\\Program Files\\glassfish-4.0\\glassfish\\domains\\domain1]deployer:gfv3ee6:localhost:4848 +j2ee.server.middleware=C:/Program Files/glassfish-4.0 +user.properties.file=C:\\Users\\Jonathan\\AppData\\Roaming\\NetBeans\\8.0\\build.properties +======= +deploy.ant.properties.file=C:\\Users\\Asus\\AppData\\Roaming\\NetBeans\\8.0.1\\config\\GlassFishEE6\\Properties\\gfv3-165012094.properties +j2ee.platform.is.jsr109=true +j2ee.server.domain=C:/Users/Asus/kevhndomain +j2ee.server.home=C:/Program Files/glassfish/glassfish +j2ee.server.instance=[C:\\Program Files\\glassfish\\glassfish;C:\\Users\\Asus\\kevhndomain]deployer:gfv3ee6wc:localhost:4848 +j2ee.server.middleware=C:/Program Files/glassfish +user.properties.file=C:\\Users\\Asus\\AppData\\Roaming\\NetBeans\\8.0.1\\build.properties +>>>>>>> 11656e32d318010d842163d5cab9dbaa7526e757 diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 00000000..6807a2ba --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 00000000..5435b63b --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,184 @@ +<<<<<<< HEAD +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +# Files to be excluded from distribution war +dist.archive.excludes= +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +includes=** +j2ee.compile.on.save=true +j2ee.copy.static.files.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7-web +j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api-osgi.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=SimpleBlog.war +web.docbase.dir=web +webinf.dir=web/WEB-INF +======= +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=true +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +auxiliary.org-netbeans-modules-projectapi.jsf_2e_language=Facelets +build.classes.dir=${build.web.dir}/WEB-INF/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +build.web.dir=${build.dir}/web +build.web.excludes=${build.classes.excludes} +client.urlPart= +compile.jsps=false +conf.dir=${source.root}/conf +debug.classpath=${build.classes.dir}:${javac.classpath} +debug.test.classpath=\ + ${run.test.classpath} +display.browser=true +# Files to be excluded from distribution war +dist.archive.excludes= +dist.dir=dist +dist.ear.war=${dist.dir}/${war.ear.name} +dist.javadoc.dir=${dist.dir}/javadoc +dist.war=${dist.dir}/${war.name} +endorsed.classpath=\ + ${libs.javaee-endorsed-api-6.0.classpath} +excludes= +includes=** +j2ee.compile.on.save=true +j2ee.copy.static.files.on.save=true +j2ee.deploy.on.save=true +j2ee.platform=1.7-web +j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar +j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar +j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar +j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar +j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar +j2ee.platform.wsit.classpath= +j2ee.server.type=gfv3ee6 +jar.compress=false +javac.classpath=\ + ${libs.PostgreSQLDriver.classpath} +# Space-separated list of extra javac options +javac.compilerargs= +javac.debug=true +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +lib.dir=${web.docbase.dir}/WEB-INF/lib +no.dependencies=false +persistence.xml.dir=${conf.dir} +platform.active=default_platform +resource.dir=setup +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): +runmain.jvmargs= +source.encoding=UTF-8 +source.root=src +src.dir=${source.root}/java +test.src.dir=test +war.content.additional= +war.ear.name=${war.name} +war.name=SimpleBlog.war +web.docbase.dir=web +webinf.dir=web/WEB-INF +>>>>>>> 11656e32d318010d842163d5cab9dbaa7526e757 diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 00000000..d8c666ef --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.web.project + + + SimpleBlog + 1.6.5 + + + ${libs.PostgreSQLDriver.classpath} + WEB-INF/lib + + + + + + + + + + + + diff --git a/reference/addcomment.php b/reference/addcomment.php new file mode 100644 index 00000000..2a91581a --- /dev/null +++ b/reference/addcomment.php @@ -0,0 +1,94 @@ +diff($start); + + $format = array(); + if($interval->y !== 0) { + $format[] = "%y TAHUN"; + } + if($interval->m !== 0) { + $format[] = "%m BULAN"; + } + if($interval->d !== 0) { + $format[] = "%d HARI"; + } + if($interval->h !== 0) { + $format[] = "%h JAM"; + } + if($interval->i !== 0) { + $format[] = "%i MENIT"; + } + if($interval->s !== 0) { + if(!count($format)) { + return "BARU SAJA"; + } else { + $format[] = "%s DETIK"; + } + } + + if(count($format) > 1) { + $format = array_shift($format)." dan ".array_shift($format); + } else { + $format = array_pop($format); + } + + return $interval->format($format." YANG LALU"); +} + //creating connection to database + $link = mysqli_connect('localhost', 'kevhnmay94', "", 'simpleblog'); + $nama = mysqli_escape_string($link, $_POST['nama']); + $email = mysqli_escape_string($link, $_POST['email']); + $id = mysqli_escape_string($link, $_POST['pid']); + $komentar = mysqli_escape_string($link, $_POST['komentar']); + date_default_timezone_set('Asia/Jakarta'); + $tanggal = date("Y-m-d H:i:s"); + + $query = "INSERT INTO `comments`(`pid`, `name`, `date`, `comment`, `email`) + VALUES ($id,'$nama','$tanggal','$komentar','$email')"; + + //insert these data to database + if(!mysqli_query($link, $query)) + { + die('Error ' + mysqli_errno($link)); + } + + //tampilkan data ke screen + $query = "SELECT * FROM `comments` WHERE pid=$id ORDER BY date DESC"; + if(!($results = mysqli_query($link, $query))) + { + die('Error ' + mysqli_errno($link)); + } + + foreach($results as $result) + { + ?> +
  • +
    +

    + +
    +
    +

    +
  • + \ No newline at end of file diff --git a/reference/deletePost.php b/reference/deletePost.php new file mode 100644 index 00000000..d3756a9b --- /dev/null +++ b/reference/deletePost.php @@ -0,0 +1,21 @@ +entry has been deleted."; + + //close connection with database + mysqli_close($con); + header('Location: index.php'); +?> \ No newline at end of file diff --git a/reference/editPost.php b/reference/editPost.php new file mode 100644 index 00000000..2b4651d8 --- /dev/null +++ b/reference/editPost.php @@ -0,0 +1,144 @@ +' with '\n' + /* $query = "UPDATE `posts` SET `content`= REPLACE (`konten`, '
    ', '\n')"; + if(!mysqli_query($link, $query)) + { + die('Error : ' . mysqli_errno($link)); + } */ + + //retrieve data from database + $query = "SELECT * FROM `posts` WHERE `id` = $id"; + if(!($results = mysqli_query($link, $query))) + { + die('Error ' . mysqli_errno($link)); + } + $results = $results->fetch_assoc(); + + //reverse date format + $retrieved = $results['date']; + $date = DateTime::createFromFormat('Y-m-d', $retrieved); + + echo" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple Blog | Edit Post + + + + + +
    + + + + +
    + + +

    -

    + +
    +
    +

    Edit Post

    + +
    +
    + + + + + + + + format('d-m-Y') . "\" id=\"Tanggal\" required=\"\" placeholder=\"format: dd-mm-yyyy\"> +
    + +
    + + + +
    +
    +
    +
    + +
    + + + +
    + + + + + + + + + + "; + + mysqli_close($link); +?> diff --git a/reference/getdatabase.php b/reference/getdatabase.php new file mode 100644 index 00000000..10d76fa1 --- /dev/null +++ b/reference/getdatabase.php @@ -0,0 +1,79 @@ +diff($start); + + $format = array(); + if($interval->y !== 0) { + $format[] = "%y TAHUN"; + } + if($interval->m !== 0) { + $format[] = "%m BULAN"; + } + if($interval->d !== 0) { + $format[] = "%d HARI"; + } + if($interval->h !== 0) { + $format[] = "%h JAM"; + } + if($interval->i !== 0) { + $format[] = "%i MENIT"; + } + if($interval->s !== 0) { + if(!count($format)) { + return "BARU SAJA"; + } else { + $format[] = "%s DETIK"; + } + } + + if(count($format) > 1) { + $format = array_shift($format)." dan ".array_shift($format); + } else { + $format = array_pop($format); + } + + return $interval->format($format." YANG LALU"); +} + + //get data from info_comment + $link = mysqli_connect('localhost', 'kevhnmay94', "", 'simpleblog'); + $id = mysqli_real_escape_string($link, $_GET['id']); + $query = "SELECT * FROM `comments` WHERE pid = $id ORDER BY date DESC"; + + if(!($results = mysqli_query($link, $query))) + { + die('Error ' + mysqli_errno($link)); + } + + foreach ($results as $row) + { +?> +
  • +
    +

    + +
    +
    +

    +
  • + \ No newline at end of file diff --git a/index.html b/reference/index.html similarity index 96% rename from index.html rename to reference/index.html index 07cff0ba..bd59c695 100644 --- a/index.html +++ b/reference/index.html @@ -1,114 +1,115 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Simple Blog - - - - - -
    - - - -
    -
    - -
    -
    - - - -
    - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simple Blog + + + + + +
    + + + +
    +
    + +
    +
    + + + +
    + + + + + + + + \ No newline at end of file diff --git a/reference/index.php b/reference/index.php new file mode 100644 index 00000000..cc86142d --- /dev/null +++ b/reference/index.php @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Simple Blog + + + + + +
    + + + +
    +
    + +
    +
    + + + +
    + + + + + + + + diff --git a/reference/insert_database.php b/reference/insert_database.php new file mode 100644 index 00000000..a87ebf61 --- /dev/null +++ b/reference/insert_database.php @@ -0,0 +1,52 @@ +"; + echo "Tanggal : ",$tanggal, "
    "; + echo "Konten: ",$konten, "
    "; + + // Check connection + if (mysqli_connect_errno()) + { + echo "Failed to connect to MySQL
    "; + } + else + { + //Insert form values into database + if(!$update) + { + $query = "INSERT INTO `posts` (`id`, `title`, `date`, `content`) + VALUES (NULL, '$judul', '$tanggal', '$konten');"; + } + else + { + $query = "UPDATE `posts` + SET `title`='$judul',`date`='$tanggal',`content`='$konten' + WHERE id = $id"; + } + + if (!mysqli_query($con,$query)) + { + die('Error: ' . mysqli_error($con)); + } + + echo "1 record added"; + + } + + mysqli_close($con); + + //Redirect to index.php + header('Location: index.php'); + ?> \ No newline at end of file diff --git a/new_post.html b/reference/new_post.html similarity index 84% rename from new_post.html rename to reference/new_post.html index fc4e18ee..d267f466 100644 --- a/new_post.html +++ b/reference/new_post.html @@ -38,10 +38,8 @@
    @@ -51,18 +49,19 @@

    -

    -

    Tambah Post

    +

    Tambah Post

    -
    + - + - + +
    -
    - +
    +
    @@ -96,6 +95,7 @@

    Tambah Post

    + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +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 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 | <?php echo $result['title']; ?> + + + + + +
    + + + +
    + +
    +
    + +

    +

    +
    +
    + +
    +
    +

    + + +

    Komentar

    + +
    +
    + id="pid"> + + + + + + +
    + +
    + + + +
    +
    +
      + +
      + +
      + +
    +
    +
    + +
    + + + +
    + + + + + + + + + + + \ 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 + +
    +
    + +
    +
    +
    + + + + + + + + +
    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 @@ + + + + + +
    + +
    +
    + +

    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! …

      +
    • +
    +
    +
    + +
    + +
    + +======= + 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_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@\"]+)*)|(\".+\"))@((\[[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 + + + + +
    + + + + + + +
    + + +
    Ψ
    + + +
    +
    +
    + +
    + +