var pointers = require('../pointers.es6.js');
var AccountClaimer = require('../accountClaimer.js');
var $osf = require('osfHelpers');

// NodeActions is needed for rendering recent logs in nodelists (e.g. regsitrations and forks
// pages
require('../project.js');

var node = window.contextVars.node;


new pointers.PointerDisplay('#showLinks');

if (!window.contextVars.currentUser.isContributor) {
    new AccountClaimer('.contributor-unregistered');
}

if (node.isPublic && node.piwikSiteID) {
    $osf.trackPiwik(node.piwikHost, node.piwikSiteID);
}

// Works only with anchors with the id of the element that bootstrap uses
// Buffer is the amount to leave on top
function replaceAnchorScroll (buffer){
	buffer = buffer || 100;
	$(document).on('click', 'a[href^="#"]', function(event){
		if(!$(this).attr('data-model') && $(this).attr('href') !== "#") {
			event.preventDefault();
			// get location of the target
			var target = $(this).attr('href'),
			    offset = $(target).offset();
			$(window).scrollTop(offset.top-buffer);
		}
	});
}

$(document).ready(function(){
    replaceAnchorScroll();
});


$.getJSON(node.urls.api, function(data) {
    $('body').trigger('nodeLoad', data);
});

@@ -701,17 +701,20 @@
 uffer)%7B%0A
-%09
+    
 buffer =
@@ -729,17 +729,20 @@
 %7C%7C 100;%0A
-%09
+    
 $(docume
@@ -790,18 +790,24 @@
 event)%7B%0A
-%09%09
+        
 if(!$(th
@@ -864,19 +864,28 @@
  %22#%22) %7B%0A
-%09%09%09
+            
 event.pr
@@ -900,19 +900,28 @@
 ault();%0A
-%09%09%09
+            
 // get l
@@ -942,19 +942,28 @@
  target%0A
-%09%09%09
+            
 var targ
@@ -989,19 +989,28 @@
 href'),%0A
-%09%09%09
+            
     offs
@@ -1038,11 +1038,20 @@
 ();%0A
-%09%09%09
+            
 $(wi
@@ -1090,13 +1090,22 @@
 r);%0A
-%09%09%7D%0A%09
+        %7D%0A    
 %7D);%0A

Replace tabs with spaces