|
30 | 30 |
|
31 | 31 | function initTooltipster(element, umProfileStore, displayUserCard) { |
32 | 32 | /*replaced to use standard jquery tooltip since plugin was failing */ |
33 | | - $(document).tooltip({ |
34 | | - items:'.user-mention, .vendor-participant', |
35 | | - tooltipClass: 'tooltipster-default', |
36 | | - content: function(callback) { |
37 | | - var userUrl = $(this).attr('href')+"?quick=1"; |
38 | | - if(umProfileStore.hasOwnProperty(userUrl)){ |
39 | | - callback(umProfileStore[userUrl]) |
40 | | - //displayUserCard(instance, umProfileStore[userUrl]); |
41 | | - // load from cache |
42 | | - } |
43 | | - else { |
44 | | - $.get(userUrl, function(data) { |
45 | | - umProfileStore[userUrl] = data; |
46 | | - callback(data); |
47 | | - }); |
48 | | - } |
49 | | - } |
50 | | - }); |
| 33 | + |
| 34 | + // Temporarily commenting out this code until we can figure out why the wrong user's |
| 35 | + // info is sometimes displayed when users hover over (for example) "@Fred" in posts on |
| 36 | + // the case page: |
| 37 | + |
| 38 | + // $(document).tooltip({ |
| 39 | + // items:'.user-mention, .vendor-participant', |
| 40 | + // tooltipClass: 'tooltipster-default', |
| 41 | + // content: function(callback) { |
| 42 | + // var userUrl = $(this).attr('href')+"?quick=1"; |
| 43 | + // if(umProfileStore.hasOwnProperty(userUrl)){ |
| 44 | + // callback(umProfileStore[userUrl]) |
| 45 | + // //displayUserCard(instance, umProfileStore[userUrl]); |
| 46 | + // // load from cache |
| 47 | + // } |
| 48 | + // else { |
| 49 | + // $.get(userUrl, function(data) { |
| 50 | + // umProfileStore[userUrl] = data; |
| 51 | + // callback(data); |
| 52 | + // }); |
| 53 | + // } |
| 54 | + // } |
| 55 | + // }); |
| 56 | + |
51 | 57 | } |
52 | 58 |
|
53 | 59 | function onBeforeUnload(e) { |
@@ -320,50 +326,50 @@ $(document).ready(function() { |
320 | 326 | }); |
321 | 327 |
|
322 | 328 | $(document).on("submit", "#postform", function(event) { |
323 | | - // Get some values from elements on the page: |
324 | | - event.preventDefault(); |
325 | | - var content = simplemde.value(); |
326 | | - console.log(content) |
327 | | - if (content == "") { |
328 | | - return false; |
329 | | - } |
330 | | - var paginate_by = $("#paginate_by").text(); |
331 | | - $('#sendbutton').prop('disabled', true); |
332 | | - var $form = $( this ); |
333 | | - var url = $(this).attr( "action" ); |
334 | | - var csrftoken = getCookie('csrftoken'); |
335 | | - var data = {'content': content, 'csrfmiddlewaretoken': csrftoken, 'paginate_by': paginate_by}; |
336 | | - var reload_pinned = false; |
337 | | - if ($("#reply_to").length) { |
338 | | - data["reply_to"] = $("#reply_to").val(); |
339 | | - if ($("#reply_to").attr("name") == "reply_to_pinned") { |
340 | | - reload_pinned = true; |
341 | | - data["pinned"] = 1; |
342 | | - } |
343 | | - } |
344 | | - // Send the data using post |
345 | | - var posting = $.post( url, data ); |
346 | | - |
347 | | - // Put the results in a div |
348 | | - posting.done(function( data ) { |
349 | | - simplemde.value(""); |
350 | | - var reload_type = "#allposts"; |
351 | | - if (reload_pinned) { |
352 | | - reload_type = "#pinnedposts"; |
353 | | - } |
354 | | - $('#sendbutton').prop('disabled', false); |
355 | | - $(reload_type).empty().append( data ); |
356 | | - $(reload_type).foundation(); |
357 | | - /* reload plugins */ |
358 | | - $('html, body').animate({scrollTop:$(reload_type).offset().bottom}, 'slow'); |
359 | | - initTooltipster(".user-mention:not(.tooltipstered)", umProfileStore, displayUserCard); |
360 | | - /* remove reply if present */ |
361 | | - if (document.contains(document.getElementById("reply_to"))) { |
362 | | - document.getElementById("reply_to").remove(); |
363 | | - } |
364 | | - //$( "#post_reply" ).slideToggle( "slow", function() { |
365 | | - //}); |
366 | | - }); |
| 329 | + // Get some values from elements on the page: |
| 330 | + event.preventDefault(); |
| 331 | + var content = simplemde.value(); |
| 332 | + console.log(content) |
| 333 | + if (content == "") { |
| 334 | + return false; |
| 335 | + } |
| 336 | + var paginate_by = $("#paginate_by").text(); |
| 337 | + $('#sendbutton').prop('disabled', true); |
| 338 | + var $form = $( this ); |
| 339 | + var url = $(this).attr( "action" ); |
| 340 | + var csrftoken = getCookie('csrftoken'); |
| 341 | + var data = {'content': content, 'csrfmiddlewaretoken': csrftoken, 'paginate_by': paginate_by}; |
| 342 | + var reload_pinned = false; |
| 343 | + if ($("#reply_to").length) { |
| 344 | + data["reply_to"] = $("#reply_to").val(); |
| 345 | + if ($("#reply_to").attr("name") == "reply_to_pinned") { |
| 346 | + reload_pinned = true; |
| 347 | + data["pinned"] = 1; |
| 348 | + } |
| 349 | + } |
| 350 | + // Send the data using post |
| 351 | + var posting = $.post( url, data ); |
| 352 | + |
| 353 | + // Put the results in a div |
| 354 | + posting.done(function( data ) { |
| 355 | + simplemde.value(""); |
| 356 | + var reload_type = "#allposts"; |
| 357 | + if (reload_pinned) { |
| 358 | + reload_type = "#pinnedposts"; |
| 359 | + } |
| 360 | + $('#sendbutton').prop('disabled', false); |
| 361 | + $(reload_type).empty().append( data ); |
| 362 | + $(reload_type).foundation(); |
| 363 | + /* reload plugins */ |
| 364 | + $('html, body').animate({scrollTop:$(reload_type).offset().bottom}, 'slow'); |
| 365 | + initTooltipster(".user-mention:not(.tooltipstered)", umProfileStore, displayUserCard); |
| 366 | + /* remove reply if present */ |
| 367 | + if (document.contains(document.getElementById("reply_to"))) { |
| 368 | + document.getElementById("reply_to").remove(); |
| 369 | + } |
| 370 | + //$( "#post_reply" ).slideToggle( "slow", function() { |
| 371 | + //}); |
| 372 | + }); |
367 | 373 |
|
368 | 374 | }); |
369 | 375 |
|
@@ -445,30 +451,30 @@ $(document).ready(function() { |
445 | 451 |
|
446 | 452 |
|
447 | 453 | $(document).on('click', '.reply-to-post', function() { |
448 | | - var post = $(this).parent().parent().parent().find('.post_author'); |
449 | | - var lines = post.text().trim(); /*.split('\n');*/ |
450 | | - var post_id = $(this).attr("post_id"); |
451 | | - /*$("#post_reply").slideToggle( "slow", function() {});*/ |
452 | | - $('html, body').animate({scrollTop:$(document).height()}, 'slow'); |
453 | | - /*var newpost = lines.map(function(element) { return '> ' + element; }); |
454 | | - simplemde.value(newpost.join('\n'));*/ |
455 | | - if ($(this).hasClass("pinned")) { |
456 | | - $('<input>', { |
457 | | - type: 'hidden', |
458 | | - id: 'reply_to', |
459 | | - name: 'reply_to_pinned', |
460 | | - value: post_id |
461 | | - }).appendTo('#postform'); |
462 | | - |
463 | | - } else { |
464 | | - $('<input>', { |
465 | | - type: 'hidden', |
466 | | - id: 'reply_to', |
467 | | - name: 'reply_to', |
468 | | - value: post_id |
469 | | - }).appendTo('#postform'); |
470 | | - } |
471 | | - simplemde.value('@'+lines); |
| 454 | + var post = $(this).parent().parent().parent().find('.post_author'); |
| 455 | + var lines = post.text().trim(); /*.split('\n');*/ |
| 456 | + var post_id = $(this).attr("post_id"); |
| 457 | + /*$("#post_reply").slideToggle( "slow", function() {});*/ |
| 458 | + $('html, body').animate({scrollTop:$(document).height()}, 'slow'); |
| 459 | + /*var newpost = lines.map(function(element) { return '> ' + element; }); |
| 460 | + simplemde.value(newpost.join('\n'));*/ |
| 461 | + if ($(this).hasClass("pinned")) { |
| 462 | + $('<input>', { |
| 463 | + type: 'hidden', |
| 464 | + id: 'reply_to', |
| 465 | + name: 'reply_to_pinned', |
| 466 | + value: post_id |
| 467 | + }).appendTo('#postform'); |
| 468 | + |
| 469 | + } else { |
| 470 | + $('<input>', { |
| 471 | + type: 'hidden', |
| 472 | + id: 'reply_to', |
| 473 | + name: 'reply_to', |
| 474 | + value: post_id |
| 475 | + }).appendTo('#postform'); |
| 476 | + } |
| 477 | + simplemde.value('@'+lines); |
472 | 478 | }); |
473 | 479 |
|
474 | 480 |
|
|
0 commit comments