Initial commit
[2ch-be.git] / dev-test / rewrite / include / footer.php
blob579a22944959d0224e3c5ebadc4b6e4469558e7f
1 <!--jquery stuff-->
2 <script src="<?php echo $livesitePath ?>js/jquery.min.js"></script>
3 <script src="<?php echo $livesitePath ?>js/bootstrap.min.js"></script>
4 <script src="<?php echo $livesitePath ?>js/jquery.validate.min.js"></script>
5 <script src="<?php echo $livesitePath ?>js/script.js"></script>
6 <script src="<?php echo $livesitePath ?>js/effect.js"></script>
7 <script src="<?php echo $livesitePath ?>js/dropdown-enhancement.js"></script>
9 <script>
10 $(document).ready(function(){
11 $('input[type="checkbox"]').change(function(){
12 var bool=0;
13 if($(this).is(":checked")){
14 bool = 1;
15 }else{
16 bool = 0;
18 $.ajax({
19 type: "POST",
20 url: "noti.php",
21 data: { toggle: bool }
23 .done(function( msg ) {
24 });
25 });
26 });
27 </script>
29 <script>
30 $(document).ready(function(){
31 var parentLink;
33 $('#emoji li img').click(function(){
34 var emoji = $(this).data("alt");
35 console.log(emoji);
36 $('textarea[name="msg"]').val(function(_,val){
37 return val + emoji;
38 });
39 });
41 $('.destroy').click(function(){
42 parentLink = $(this);
43 $("#delmsg").show();
44 });
46 $('#deleteM').click(function(){
47 $(parentLink).closest('.deleteForm').submit();
48 });
49 });
50 </script>
51 <?php
52 if(basename($_SERVER['PHP_SELF'])=='message.php'){
53 // echo $messages[1];
54 if($messages[1]=="FALSE"){
55 if(isset($_GET['d'])){ ?>
56 <script type="text/javascript">
57 $(document).ready(function(){
58 var content = false;
59 var scrollT = false;
60 var load = 0;
61 $('#pageMessage2, #pageMessage').scroll(function(){
63 if($('#pageMessage2, #pageMessage').scrollTop() == 0 && !content && !scrollT){
64 scrollT = true;
65 if(load==0){
66 load = load + 4;
67 }else{
68 load = load + load;
70 var firstMsg = $('.panel').first();
71 var message = $.ajax({
72 url: "loadM.php",
73 method: "POST",
74 datatype: "json",
75 data: { load : load, data : <?php echo $_GET['d'] ?>}
76 });
78 message.done(function(data) {
79 scrollT = false;
80 $('#pageMessage2, #pageMessage').prepend(data.array);
81 $('#pageMessage2, #pageMessage').scrollTop(firstMsg.offset().top);
82 if(data.breaker || data.start==0){
83 $('#pageMessage2, #pageMessage').prepend("<div id=\"status\" class=\"col-md-12 alert alert-warning\" style=\"text-align:center;\"><small>End of Conversation</small></div>");
84 content = true;
86 });
88 });
89 });
90 $(document).ajaxSend(function() {
91 $('#pageMessage2, #pageMessage').prepend("<div id=\"load\" class=\"col-md-12 alert alert-info loadIng\" style=\"text-align:center;\"><small>Loading..</small></div>");
92 }).ajaxComplete(function() {
93 $('.loadIng').hide();
94 });
95 </script>
96 <?php
101 </body>
102 </html>