PageSourceSearch

https://uejf.org/wp-content/themes/lifeline2/assets/js/tweets.js?ver=3.7.1

js uejf.org collected 2026-10-02 11:51:06 UTC 3,144 bytes, 112 lines download raw bytes

1
2
3(function ($) {
4    "use strict";
5    var lifeline2 = {
6	count: 0,
7	tweets: function (options, selector) {
8
9	    options.action = 'lifeline2_ajax_callback';
10
11	    $.ajax({
12		url: ajaxurl,
13		type: 'POST',
14		data: options,
15		dataType: "json",
16		success: function (res) {
17
18		    var reply = res;
19		    var html = '';
20                if (options.template === 'blockquote') {
21                    $.each(reply, function (k, element) {
22                        if(element.user != undefined) {
23                        var date = new Date(element.created_at);
24                        html += '<div class="tweet"><blockquote><i class="fa fa-twitter"></i>';html += '<a href="' + element.user.url + '">@' + element.user.name + '</a>';
25                        html += element.text;
26                        html += '</blockquote></div>';
27                        } else {
28                        html += '<div class="tweeterror alert alert-danger">Invalid Twitter API Details</div>';
29                        }
30                });
31            }
32		    $(selector).html(html);
33
34
35		}
36	    });
37
38	},
39    };
40
41    $.fn.tweets = function (options) {
42
43	var settings = {
44	    screen_name: 'wordpress',
45	    count: 3,
46	    template: 'blockquote'
47	};
48	options = $.extend(settings, options);
49
50	lifeline2.tweets(options, this);
51    };
52
53    function timeSince(date) {
54
55	var seconds = Math.floor((new Date() - date) / 1000);
56
57	var interval = Math.floor(seconds / 31536000);
58
59	if (interval > 1) {
60	    return interval + " years";
61	}
62	interval = Math.floor(seconds / 2592000);
63	if (interval > 1) {
64	    return interval + " months";
65	}
66	interval = Math.floor(seconds / 86400);
67	if (interval > 1) {
68	    return interval + " days";
69	}
70	interval = Math.floor(seconds / 3600);
71	if (interval > 1) {
72	    return interval + " hours";
73	}
74	interval = Math.floor(seconds / 60);
75	if (interval > 1) {
76	    return interval + " minutes";
77	}
78	return Math.floor(seconds) + " seconds";
79    }
80
81    function link_conversion(text) {
82	var replaceText, replacedText, replacePattern1, replacePattern2;
83
84	replacePattern1 = /(\b(https?):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;
85	replacedText = text.replace(replacePattern1, '</h3><a class="colored-link-1" title="$1" href="$1" target="_blank">$1</a>');
86
87	replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
88	replacedText = replacedText.replace(replacePattern2, '$1</h3><a class="colored-link-1" href="http://$2" target="_blank">$2</a>');
89
90
91	return replacedText;
92    }
93
94    function link_conversion1(text) {
95	var replaceText, replacedText, replacePattern1, replacePattern2;
96
97	replacePattern1 = /(\b(https?):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;
98	replacedText = text.replace(replacePattern1, '<a class="primary-color" title="$1" href="$1" target="_blank">$1</a>');
99
100	replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
101	replacedText = replacedText.replace(replacePattern2, '$1<a class="primary-color" href="http://$2" target="_blank">$2</a>');
102
103
104	return replacedText;
105    }
106
107
108})(jQuery);
109
110
111
112

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.