<commit_before>/*
  	author: david.bass at wwu dot edu
	date: 10 July 2013
	goal: remove non-controlled-vocabulary links from the description area of our CONTENTdm v6 system.
	copyright WWU 2013
	license: GNU Affero General Public License - https://www.gnu.org/licenses/agpl-3.0.html
	
	test: http://jsfiddle.net/JF2Ad/1/
	
*/


$(document).ready(function () {
    // do not execute the link-remover on search results pages or landing pages
    var currentUrl = document.URL;
    var isSearchPage = currentUrl.indexOf('/cdm/search');
	var isLandingPage = currentUrl.indexOf('/cdm/landingpage');
	
    if ((isSearchPage == -1) && (isLandingPage == -1)) {
        $("a.body_link_11:visible").each(function () {
            // ignore any links without an href; those are the list of collections used in advanced search 

            var $t = $(this);
            var this_link = $(this).attr("href");
            this_link = $.trim(this_link);
            var link_has_slashes = 0;
            link_has_slashes = this_link.indexOf('//');

            if (link_has_slashes == -1) {
                // this link does not go to an external site, so continue checking the other criteria

                var cv_link = 0;
                cv_link = this_link.indexOf('/mode/exact');

                if (cv_link == -1) {
                    // this is not a Controlled-Vocabulary link
                    // if it's not a date or year link, then remove the link
                   
                    // MatchDate (e.g. 2006-12-01)
                    var YMDdateRegex = /(\d{4}\-\d{1,2}\-\d{1,2})/gm;
                    var isYMD = this_link.match(YMDdateRegex);
                    if (isYMD != null) {
                        // do not remove this link; it is a YMD
                        return;
                    }<commit_msg>changed selector to prevent compoundobject navigation (next/prev page and 'content' tab) links from being disabled.<commit_after>/*
  	author: david.bass at wwu dot edu
	date: 10 July 2013
	goal: remove non-controlled-vocabulary links from the description area of our CONTENTdm v6 system.
	copyright WWU 2013
	license: GNU Affero General Public License - https://www.gnu.org/licenses/agpl-3.0.html
	
	test: http://jsfiddle.net/JF2Ad/1/
	
*/


$(document).ready(function () {
    // do not execute the link-remover on search results pages or landing pages
    var currentUrl = document.URL;
    var isSearchPage = currentUrl.indexOf('/cdm/search');
	var isLandingPage = currentUrl.indexOf('/cdm/landingpage');
	
    if ((isSearchPage == -1) && (isLandingPage == -1)) {
        $("a.body_link_11:visible").not(".co-page-link").each(function () {        	
            // ignore any links without an href; those are the list of collections used in advanced search 

            var $t = $(this);
            var this_link = $(this).attr("href");
            this_link = $.trim(this_link);
            var link_has_slashes = 0;
            link_has_slashes = this_link.indexOf('//');

            if (link_has_slashes == -1) {
                // this link does not go to an external site, so continue checking the other criteria

                var cv_link = 0;
                cv_link = this_link.indexOf('/mode/exact');

                if (cv_link == -1) {
                    // this is not a Controlled-Vocabulary link
                    // if it's not a date or year link, then remove the link
                   
                    // MatchDate (e.g. 2006-12-01)
                    var YMDdateRegex = /(\d{4}\-\d{1,2}\-\d{1,2})/gm;
                    var isYMD = this_link.match(YMDdateRegex);
                    if (isYMD != null) {
                        // do not remove this link; it is a YMD
                        return;
                    }
{'fraction_non_alphanumeric': 0.11251980982567353, 'fraction_numerical': 0.01901743264659271, 'mean_word_length': 1.7642335766423358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1269643', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1060, 'n_words': 332}