Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x.done(function (result) {
- // result is an SP.List because that is what we passed to resolve()!
- var htmlText = "";
- for (var i = 0; i < result.users.length; i++) {
- var user = result.users[i];
- if (htmlText !== "") { htmlText += "; "; }
- htmlText += '<a href="/_layouts/15/userdisp.aspx?ID=' + user.get_id().toString() + '&RootFolder=*">' + user.get_title() + '</a>';
- }
- // finally! send the result to our callback
- return callback(htmlText);
- });
- x.done(function (result) {
- // result is an SP.List because that is what we passed to resolve()!
- var htmlText = "";
- for (var i = 0; i < result.users.length; i++) {
- var user = result.users[i];
- if (htmlText !== "") { htmlText += "; "; }
- htmlText += '<a href="'+_spPageContextInfo.webServerRelativeUrl+'/_layouts/15/userdisp.aspx?ID=' + user.get_id().toString() + '&RootFolder=*">' + user.get_title() + '</a>';
- }
- // finally! send the result to our callback
- return callback(htmlText);
- });
- var changeLink=function(){
- if($('div.sputility-readonly a').length ===1){
- //console.log('href set. clearing interval');
- clearInterval(timerInterval);
- $('div.sputility-readonly a').each(function(){
- var oldhref=$(this).attr('href');
- //console.log(oldhref);
- $(this).attr('href','/sites/site_collection/sub_site'+oldhref);
- //console.log('new href '+$(this).attr('href'));
- });
- }
- else{
- //console.log('href not set yet');
- }
- };
- timerInterval=setInterval(changeLink,100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement