Skip to content

Commit

Permalink
SITE: added an examples folder to store the various useful examples o…
Browse files Browse the repository at this point in the history
…f actions on the website
  • Loading branch information
Asimov4 committed Apr 7, 2012
1 parent 225c024 commit efa18b1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
File renamed without changes.
71 changes: 71 additions & 0 deletions SITE/examples/example_unrollcomments.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

/*
This examples illustrates the unroll comments function
sources:
- http://www.9lessons.info/2009/12/display-collapsed-comments-like.html
- http://jsfiddle.net/clemsos/HFqST/22/
*/

?>

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>

<script>
// var BASE URL = 'http://refresh.org';
var ACTIONS_URL = 'http://refresh.nouvelingenieur.fr/index.php';

$('.speccom').click(function() {

var url = ACTIONS_URL + $(this).attr("href");

// show that is working
$('.loader').html('Loading posts from : ' + url);

// load posts
$.ajax(
{
url: url,
success: function(rep)
{
$('.placeholder').html(rep);
}
});



return false;

});
</script>

<style media="screen" type="text/css">
.newsformcomment {
padding:10px;
border:solid 1px #ccc;
margin: 30px 5px;
width: 300px
}
</style>

</head>


<body>

<a class='speccom' href="?action=unrollcomment&amp;order=0&amp;thread_id=27#a27">
<span class="newslinkcomment_roll">2 comments</span>
</a>


<div class='loader'></div>

<div class="newsformcomment">

<p>Here goes the comments</p>
</div>

</body>
</html>

0 comments on commit efa18b1

Please sign in to comment.