Advertisement
Technical_13

viewZee appendCredits() patch

Jun 17th, 2019
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     /**
  2.      * show Credits on User-Page
  3.      * */
  4.     function appendCredits() {
  5.         var creditsURL = new String(baseURL + "/credits/");
  6.         //read credits using ajax
  7.         $.ajax({
  8.             url: creditsURL,
  9.             success: function(data){
  10.                 //get dom of credits
  11.                 var credits = $(data).find("#munzee-holder");
  12.  
  13.                 var creditsHtml = $(credits).html();
  14.                 //some replacements
  15.                 creditsHtml = creditsHtml.replaceAll("col-lg-2","col-lg-1");
  16.                 creditsHtml = creditsHtml.replaceAll("<h3",'<div style="width: 42px; padding-top: 5px; text-align: center; font-size: 12px; font-weight: bold;"');
  17.                 creditsHtml = creditsHtml.replaceAll("</h3","</div");
  18.                 creditsHtml = '<ul class="list-inline tooltip-holder text-center">' + creditsHtml + '</ul>';
  19.                 creditsHtml = '<div class="clearfix"></div> <div id="myCredits" class="panel-heading" style="margin: 15px; background-color: #333333;">Credits for ' + logonUsername + '</div><div style="margin: 30px;">' + creditsHtml + '</div>';
  20.                 creditsHtml = creditsHtml.replaceAll( '<img ', '<img style="max-width: 42px; max-height: 42px;"' );
  21.  
  22.                 //append credits in new container
  23.                 $($(".col-md-12")[2]).append( creditsHtml ).change();
  24.             }
  25.         }); //$.ajax
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement