added Cookie Comments : if you are typing a comment and leave halfway without adding comment, whenever you come back (upto 10 days) your comment will still be there in comment box waiting for you to finish
This commit is contained in:
parent
4577e6352d
commit
ae8c328d22
1 changed files with 16 additions and 0 deletions
|
@ -210,6 +210,22 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
var current_video = "{$video.videoid}",
|
||||
cookieToSave = 'comment_data_u'+userid+"v"+current_video,
|
||||
commentDataCheck = $.cookie(cookieToSave);
|
||||
|
||||
if (commentDataCheck !== null) {
|
||||
$('#comment_box').val(commentDataCheck);
|
||||
}
|
||||
$('#comment_box').on('keyup', function() {
|
||||
var comment_data = $('#comment_box').val();
|
||||
$.cookie(cookieToSave, comment_data, { expires : 10, path : "/" });
|
||||
});
|
||||
|
||||
$('#add_comment_button').on("click",function(){
|
||||
$.cookie(cookieToSave, null, { path : "/" });
|
||||
});
|
||||
|
||||
var playlist_total = "{$total_items}";
|
||||
$('#playlist-pull').on("click",function(){
|
||||
var __this = $(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue