remove some unused js
This commit is contained in:
parent
dbfe88dae5
commit
599350cc6c
|
@ -68,11 +68,6 @@
|
|||
_stepper();
|
||||
_slimScroll();
|
||||
_bgimage();
|
||||
_widget_flickr();
|
||||
_widget_twitter();
|
||||
_widget_facebook();
|
||||
_widget_dribbble();
|
||||
_widget_media();
|
||||
|
||||
/** Bootstrap Tooltip **/
|
||||
jQuery("a[data-toggle=tooltip], button[data-toggle=tooltip], span[data-toggle=tooltip]").tooltip();
|
||||
|
@ -2036,231 +2031,6 @@
|
|||
|
||||
|
||||
|
||||
/** Flickr Widget
|
||||
<div class="widget-flickr clearfix lightbox margin-bottom-60" data-id="37304598@N02" data-limit="16" data-plugin-options='{"delegate": "a", "gallery": {"enabled": true}}'></div>
|
||||
**************************************************************** **/
|
||||
function _widget_flickr() {
|
||||
var _container = jQuery('.widget-flickr');
|
||||
|
||||
if(_container.length > 0) {
|
||||
|
||||
loadScript(plugin_path + 'widget.jflickr/jflickrfeed.min.js', function() {
|
||||
|
||||
if(jQuery().jflickrfeed) {
|
||||
if(jQuery('.widget-flickr')) {
|
||||
|
||||
/** **/
|
||||
_container.each(function() {
|
||||
var _t = jQuery(this),
|
||||
_id = _t.attr('data-id'),
|
||||
_limit = _t.attr('data-limit') || 14;
|
||||
|
||||
_t.jflickrfeed({
|
||||
limit: parseInt(_limit),
|
||||
qstrings: {
|
||||
id: _id
|
||||
},
|
||||
itemTemplate: '<li>'+
|
||||
'<a href="{{image}}" title="{{title}}">' +
|
||||
'<img src="{{image_s}}" alt="{{title}}" width="63" height="63" />' +
|
||||
'</a>' +
|
||||
'</li>'
|
||||
}, function(data) {
|
||||
_lightbox();
|
||||
});
|
||||
|
||||
});
|
||||
/** **/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Twitter Widget
|
||||
**************************************************************** **/
|
||||
function _widget_twitter() {
|
||||
var _container = jQuery(".widget-twitter");
|
||||
|
||||
if(_container.length > 0) {
|
||||
|
||||
loadScript(plugin_path + 'widget.twittie/twittie.min.js', function() {
|
||||
|
||||
if(jQuery().twittie) {
|
||||
// jQuery('.example1 .tweet').twittie({
|
||||
// dateFormat: '%b. %d, %Y',
|
||||
// template: '{{tweet}} <div class="date">{{date}}</div>',
|
||||
// count: 1,
|
||||
// loadingText: 'Loading!'
|
||||
// });
|
||||
|
||||
_container.each(function() {
|
||||
var _t = jQuery(this),
|
||||
_php = _t.attr('data-php'), // PHP Script Path
|
||||
_usr = _t.attr('data-username'), // Twitter Username
|
||||
_lmt = _t.attr('data-limit') || 3, // Tweets Limit
|
||||
|
||||
_url = _php + "?username=" + _usr + "&limit=" + _lmt;
|
||||
|
||||
jQuery.getJSON(_url, function(tweets){
|
||||
_t.html(format_twitter(tweets));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function format_twitter(twitt) {
|
||||
var statusHTML = [];
|
||||
|
||||
for(var i=0; i<twitt.length; i++) {
|
||||
var username = twitt[i].user.screen_name;
|
||||
|
||||
var status = twitt[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
|
||||
return '<a href="'+url+'" target="_blank">'+url+'</a>';
|
||||
}).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
|
||||
return reply.charAt(0)+'<a href="http://twitter.com/'+reply.substring(1)+'" target="_blank">'+reply.substring(1)+'</a>';
|
||||
});
|
||||
|
||||
statusHTML.push('<li><i class="fa fa-twitter"></i><span>'+status+'</span><small><a href="http://twitter.com/'+username+'/statuses/'+twitt[i].id_str+'" target="_blank">'+relative_time(twitt[i].created_at)+'</a></small></li>');
|
||||
}
|
||||
|
||||
return statusHTML.join('');
|
||||
}
|
||||
|
||||
|
||||
function relative_time(time_value) {
|
||||
var values = time_value.split(" "),
|
||||
parsed_date = Date.parse(time_value),
|
||||
relative_to = (arguments.length > 1) ? arguments[1] : new Date(),
|
||||
delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
|
||||
|
||||
time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
|
||||
delta = delta + (relative_to.getTimezoneOffset() * 60);
|
||||
|
||||
if (delta < 60) {
|
||||
return 'less than a minute ago';
|
||||
} else if(delta < 120) {
|
||||
return 'about a minute ago';
|
||||
} else if(delta < (60*60)) {
|
||||
return (parseInt(delta / 60)).toString() + ' minutes ago';
|
||||
} else if(delta < (120*60)) {
|
||||
return 'about an hour ago';
|
||||
} else if(delta < (24*60*60)) {
|
||||
return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
|
||||
} else if(delta < (48*60*60)) {
|
||||
return '1 day ago';
|
||||
} else {
|
||||
return (parseInt(delta / 86400)).toString() + ' days ago';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Facebook Widget
|
||||
<div class="fb-like" data-href="http://www.stepofweb.com" data-layout="button" data-action="like" data-show-faces="false" data-share="false"></div>
|
||||
**************************************************************** **/
|
||||
function _widget_facebook() {
|
||||
|
||||
/** Like & Share Button
|
||||
************************ **/
|
||||
var _container_1 = jQuery('div.fb-like');
|
||||
var _container_2 = jQuery('div.fb-share-button');
|
||||
|
||||
if(_container_1.length > 0 || _container_2.length > 0) {
|
||||
|
||||
jQuery('body').append('<div id="fb-root"></div>');
|
||||
|
||||
(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** Dribbble Widget
|
||||
**************************************************************** **/
|
||||
function _widget_dribbble() {
|
||||
var _container = jQuery(".widget-dribbble");
|
||||
|
||||
if(_container.length > 0) {
|
||||
|
||||
loadScript(plugin_path + 'widget.dribbble/jribbble.min.js', function() {
|
||||
|
||||
var _token = _container.attr('data-token') || 'f688ac519289f19ce5cebc1383c15ad5c02bd58205cd83c86cbb0ce09170c1b4', // demo default
|
||||
_target = _container.attr('data-target') || '_blank',
|
||||
_shots = _container.attr('data-shots') || 2046896; // demo default
|
||||
|
||||
jQuery.jribbble.setToken(_token);
|
||||
|
||||
jQuery.jribbble.shots(_shots).rebounds().then(function(res) {
|
||||
var html = [];
|
||||
|
||||
res.forEach(function(shot) {
|
||||
html.push('<li>');
|
||||
html.push('<a href="' + shot.html_url + '" target="' + _target + '">');
|
||||
html.push('<img class="img-responsive" src="' + shot.images.normal + '" alt="image">');
|
||||
html.push('</a></li>');
|
||||
});
|
||||
|
||||
_container.html(html.join(''));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** Media Widget [mediaelement plugin]
|
||||
**************************************************************** **/
|
||||
function _widget_media() {
|
||||
var _container = jQuery(".widget-media");
|
||||
|
||||
if(_container.length > 0) {
|
||||
|
||||
loadScript(plugin_path + 'widget.mediaelementbuild/mediaelement-and-player.min.js', function() {
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** **************************************************************************************************************** **/
|
||||
/** **************************************************************************************************************** **/
|
||||
/** **************************************************************************************************************** **/
|
||||
|
|
Loading…
Reference in New Issue