require(["jquery","xwiki-meta"],function(a,b){a(document).on("focus","#reference-value",function(){a(this).select()});a(document).on("click","#button-inout",function(){var c=a("#button-inout");var f=a("#reference-value");var d=b.documentReference.relativeTo(b.documentReference.getRoot());var e=b.documentReference;if(c.hasClass("btn-info")){f.val(d);c.removeClass("btn-info").addClass("btn-default");c.attr("title","Display the page reference for all wikis")}else{f.val(e);c.removeClass("btn-default").addClass("btn-info");c.attr("title","Display the page reference only for this wiki")}});a(document).on("click","#button-paste",function(){a("#reference-value").select();document.execCommand("copy");new XWiki.widgets.Notification("Reference copied to clipboard","info")})});