I am working on SharePoint online 2013. and i add a new Discussion Board App inside my Team site collection. now i name the new app as "News & Announcement", so i was expecting that the defualt link label to create new item will be changed from "new discussion" to "new news & announcements". but unfortunatly this is not the case. so now my App is labeled as "News & Announcements", while its create link is labeled as "new discussion". as follow:-
so now i tried writing the following script to override that label :-
<script>
$( document ).ready(function() {
var interval = setInterval(adjustlabel, 3000);
$('.ms-heroCommandLink span:last').text('New News & Announcments');
function adjustlabel() {
$('.ms-heroCommandLink span:last').text('New News & Announcments');
}
});
</script>
here is the markup for the link (as shown inside firefox )
side note i provide a timer because user can chose to reload the view (ajax-based request). Now the above script did not work , but when i edit my page i have noted that the link got the new label, but if i save my Page, the label will return back to "new discussion" ! so can anyone adivce on this please? why the script worked only when the page is on edit mode??