• Log in
  • RESOURCES
  • Guides
  • API
  • FAQ
  • Recent Changes
  • Report Issue

  • ABOUT
  • About Wikirate
  • Community
  • Data
  • Impact
search
arrow_back_ios
Companies
Metrics
Data points
Sources
Topics
Datasets
Projects
Research Groups
Company Groups
arrow_forward_ios

user profile tab script

history edit build
function isTheSameUser()
{
  var userName = $('#logging').find('a').first().html();
  var profilePageName = getProfilePageName();
  if(userName==profilePageName)
    return true;
  return false;
}
function getProfilePageName()
{
  return $('#main').find('div').first().attr('data-card-name');
}
wagn.slotReady(function(slot) {
    slot.find( "#tabs" ).tabs();
    var sameUser = isTheSameUser();
    slot.find('#user-profile-analyses').find(".search-no-results").each(function(){
      if($(this).find(".empty-profile-tab").length>0)
        return;
      var $div = $("<div>", { class: "empty-profile-tab"});
      if(sameUser)        
        $div.append("<span>You haven't created any Overviews.</span>")
      else
        $div.append("<span>"+getProfilePageName()+" hasn't edited any Overviews.</span>")
      $(this).append($div);
    });

    slot.find('#user-profile-note').find(".search-no-results").each(function(){
      if($(this).find(".empty-profile-tab").length>0)
        return;
      var $div = $("<div>", { class: "empty-profile-tab"});
      if(sameUser)        
        $div.append("<span>You haven't created any Notes. Start a <a href='[[/new/Note]]'>New Note</a></span>")
      else
        $div.append("<span>"+getProfilePageName()+" hasn't created any Notes.</span>")
      $(this).append($div);
    });

    slot.find('#user-profile-source').find(".search-no-results").each(function(){
      if($(this).find(".empty-profile-tab").length>0)
        return;
      var $div = $("<div>", { class: "empty-profile-tab"});
      if(sameUser)        
        $div.append("<span>You haven't created any Sources. Start a <a href=''>New Source</a></span>")
      else
        $div.append("<span>"+getProfilePageName()+" hasn't created any Sources.</span>")
      $(this).append($div);
    });
  });

Wikirate, an initiative of Wikirate International e.V., is an open data platform powered by its community.

legal

Wikirate Policies Privacy Policy Terms of Use Impressum

contact

Contact us on Wikirate international Subscribe for Updates

follow us


b&w_logoCreated with Sketch.
Unless otherwise indicated, Wikirate's content is licensed under CC BY 4.0, and the database infrastructure under CC BY-SA 4.0.