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:
Saqib Razzaq 2016-07-14 06:05:04 -07:00
parent 4577e6352d
commit ae8c328d22

View file

@ -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);