diff --git a/assets/css/screen.css b/assets/css/screen.css index 1d8fdf3..84ee96e 100644 --- a/assets/css/screen.css +++ b/assets/css/screen.css @@ -233,7 +233,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; diff --git a/assets/js/comment.js b/assets/js/comment.js new file mode 100644 index 0000000..7d6a8aa --- /dev/null +++ b/assets/js/comment.js @@ -0,0 +1,42 @@ +var http = createRequestObject(); +function createRequestObject(){ + var obj; + var browser = navigator.appName; + if(browser == "Microsoft Internet Explorer"){ + obj = new ActiveXObject("Microsoft.XMLHTTP"); + } else { + obj = new XMLHttpRequest(); + } + return obj; +} +function sendRequest(id){ + var uname = document.getElementById('Nama').value; + var comment = document.getElementById('Komentar').value; + var email = document.getElementById('Email').value; + var QueryString = 'comment.php?id='+id+'&nama='+uname+'&komentar='+comment+'&email='+email; + http.open('GET', QueryString); + if (uname && comment && email){ + if (validateEmail(email)){ + http.onreadystatechange = handleResponse; + http.send(null); + } else { + alert("Format email salah"); + } + } else { + alert("Form harus diisi semua"); + } +} +function handleResponse(){ + if (http.readyState == 4){ + var response = http.responseText; + if (response != ''){ + document.getElementById('listcomment').innerHTML = response; + } else { + document.getElementById('listcomment').innerHTML = 'wrong'; + } + } +} +function validateEmail(email){ + var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; + return re.test(email); +} \ No newline at end of file diff --git a/assets/js/jquery.min.js b/assets/js/jquery.min.js deleted file mode 100644 index 16ad06c..0000000 --- a/assets/js/jquery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.2 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+"
"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e| t |