Initial commit
[2ch-be.git] / artist / include / header.php
blob829b4c6f5a3dc4b861c21ef30bab4608b2892009
1 <head>
2 <meta charset="UTF-8">
3 <meta http-equiv="X-UA-Compatible" content="IE=edge">
4 <meta name="viewport" content="width=device-width, initial-scale=1">
5 <title>Artist Page</title>
6 <link rel="stylesheet" href="css/bootstrap.css">
7 <link rel="stylesheet" href="css/astyle.css">
8 <script src="js/jquery-1.9.1.js"></script>
9 <script src="js/bootstrap.js"></script>
12 <script>
13 $(document).ready(function(){
14 $("[name=modalClose]").click(function(){
15 $(".alert").remove();
16 });
17 });
19 $(document).on('submit', '#categoryForm', function(){
20 //hide the notification messages
21 $('#success, #error').fadeOut();
23 //show the loading image
24 $(".alert").remove();
25 var val = $('input[name=category]').val();
26 var str = $('#categoryForm').serialize();
27 $('.formloader').css({'background':'#F9F9F9 url("http://russoil.eu/images/load.gif") no-repeat center', 'opacity':.5, width:$(this).parent().width(), height:$(".modal-content").height(), position:'absolute', top:0});
30 //process
31 $.ajax({type:'POST', url: 'ajax/ajax.php', data: str,
33 success:function(response) {
34 if(response.a=='success'){
35 //success message
36 if(!$("#categoryPanelDiv").is(":visible"))
38 $("#categoryPanelDiv").removeClass("hidden");
40 $("#categoryForm").prepend('<div class="alert alert-success" id="alert">The '+val+' is successfully added</div>');
41 $('input[type=text]').val('');
42 $("#categoryList").append('<a class="list-group-item" href="?art&cat='+val+'">'+val+'</a>')
43 $("select[name=class]").append('<option value="'+response.b+'">'+val+'</option>')
44 }else{
45 $("#categoryForm").prepend('<div class="alert alert-warning" id="alert">An error occured. Please contact the admin.</div>');
46 $('.formloader').remove();
49 //remove the loading image
50 $('.formloader').remove();
51 }});
53 //stop the process
54 return false;
55 });
56 </script>
57 </head>