Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addpreviewevents(context) {
- $("a[class^='ref|']", context).mouseenter(
- function(e){
- var ainfo = $(this).attr("class").split('|');
- var previewelement = $("<div></div>").addClass('reflinkpreview').attr({
- id: "preview" + $(this).attr("class"),
- style: "left:" + (e.pageX + 50) + "px;display:none"});
- if ( $('#postform [name=board]').val() == ainfo[1] && $('#reply' + ainfo[3]).length && (($('#thumb' + ainfo[3]).length && $('#thumb' + ainfo[3] + " img:first-child").attr("src").lastIndexOf("thumb") != -1) || !$('#thumb' + ainfo[3]).length)) {
- var isonpage = true;
- previewelement.html($("#reply" + ainfo[3]).parents("table").html());
- }
- else {
- $.get(ku_boardspath + '/ajax.php?act=read&board=' + ainfo[1] + '&thread=' + ainfo[2] + '&post=' + ainfo[3] + '&single',{},
- function (responseText, textStatus) {
- if(textStatus != "success") {
- alert('wut');
- }
- else {
- if (responseText) {
- previewelement.html(responseText).toggle("normal");
- }
- else {
- previewelement.html(_("something went wrong (blank response)")).toggle("normal");
- }
- }
- });
- }
- previewelement.insertBefore($(this));
- if(isonpage) previewelement.toggle("normal");
- }).mouseleave(
- function(e){
- var previewelement = ($("div [id='preview"+$(this).attr("class")+"']"));
- if (previewelement.length) {
- previewelement.remove();
- }
- }).click(
- function(e){
- var ainfo = $(this).attr("class").split('|');
- return highlight(ainfo[3], true);
- });
- }
Add Comment
Please, Sign In to add comment