SamanthaNguyen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/329530 )
Change subject: Remove unused script, make description more i18n-friendly ...................................................................... Remove unused script, make description more i18n-friendly Bug: T154106 Change-Id: Ib82a8afdb972b33028d034bfaa67ee6d2666de16 --- M i18n/en.json D resources/js/twitter.js M skin.json 3 files changed, 3 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Gamepress refs/changes/30/329530/1 diff --git a/i18n/en.json b/i18n/en.json index 95ee620..616857d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2,6 +2,7 @@ "@metadata": { "authors": [] }, + "gamepress-desc": "Easy-to-use gaming-oriented skin", "gamepress-back-to-top": "Back to top ↑", "gamepress-navigation": "* mainpage|mainpage-description\n\n** faqpage|faq\n\n** recentchanges-url|recentchanges", "gamepress-prefooter-1": "", diff --git a/resources/js/twitter.js b/resources/js/twitter.js deleted file mode 100644 index 6f0e2e7..0000000 --- a/resources/js/twitter.js +++ /dev/null @@ -1,137 +0,0 @@ -JQTWEET = { - // Configuration - user: 'envato', // twitter username - numTweets: 3, // number of tweets to display - appendTo: '#jstwitter', // id/class of HTML elemnt to append tweets to (don't change unless You know what You're doing) - - // core function of jqtweet - loadTweets: function() { - $.ajax({ - url: 'http://api.twitter.com/1/statuses/user_timeline.json/', - type: 'GET', - dataType: 'jsonp', - data: { - screen_name: JQTWEET.user, - include_rts: true, - count: JQTWEET.numTweets, - include_entities: true - }, - success: function(data, textStatus, xhr) { - var html = '<div class="tweet">TWEET_TEXT<div class="time">AGO</div>'; - // append tweets into page - for (var i = 0; i < data.length; i++) { - $(JQTWEET.appendTo).append( - html.replace('TWEET_TEXT', JQTWEET.ify.clean(data[i].text)) - .replace(/USER/g, data[i].user.screen_name) - .replace('AGO', JQTWEET.timeAgo(data[i].created_at)) - .replace(/ID/g, data[i].id_str) - ); - } - } - }); - }, - - /** - * relative time calculator FROM TWITTER - * @param {string} twitter date string returned from Twitter API - * @return {string} relative time like "2 minutes ago" - */ - timeAgo: function(dateString) { - var rightNow = new Date(); - var then = new Date(dateString); - - if ($.browser.msie) { - // IE can't parse these crazy Ruby dates - then = Date.parse(dateString.replace(/( \+)/, ' UTC$1')); - } - - var diff = rightNow - then; - - var second = 1000, - minute = second * 60, - hour = minute * 60, - day = hour * 24, - week = day * 7; - - if (isNaN(diff) || diff < 0) { - return ''; // return blank string if unknown - } - - if (diff < second * 2) { - // within 2 seconds - return 'right now'; - } - - if (diff < minute) { - return Math.floor(diff / second) + ' seconds ago'; - } - - if (diff < minute * 2) { - return 'about 1 minute ago'; - } - - if (diff < hour) { - return Math.floor(diff / minute) + ' minutes ago'; - } - - if (diff < hour * 2) { - return 'about 1 hour ago'; - } - - if (diff < day) { - return Math.floor(diff / hour) + ' hours ago'; - } - - if (diff > day && diff < day * 2) { - return 'yesterday'; - } - - if (diff < day * 365) { - return Math.floor(diff / day) + ' days ago'; - } else { - return 'over a year ago'; - } - }, // timeAgo() - - /** - * The Twitalinkahashifyer! - * http://www.dustindiaz.com/basement/ify.html - * Eg: - * ify.clean('your tweet text'); - */ - ify: { - link: function( tweet ) { - return tweet.replace( /\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g, function( link, m1, m2, m3, m4 ) { - var http = m2.match( /w/ ) ? 'http://' : ''; - return '<a class="twtr-hyperlink" target="_blank" href="' + http + m1 + '">' + ( ( m1.length > 25 ) ? m1.substr( 0, 24 ) + '...' : m1 ) + '</a>' + m4; - } ); - }, - - at: function( tweet ) { - return tweet.replace( /\B[@@]([a-zA-Z0-9_]{1,20})/g, function( m, username ) { - return '<a target="_blank" class="twtr-atreply" href="http://twitter.com/intent/user?screen_name=' + username + '">@' + username + '</a>'; - } ); - }, - - list: function( tweet ) { - return tweet.replace(/\B[@@]([a-zA-Z0-9_]{1,20}\/\w+)/g, function( m, userlist ) { - return '<a target="_blank" class="twtr-atreply" href="http://twitter.com/' + userlist + '">@' + userlist + '</a>'; - } ); - }, - - hash: function( tweet ) { - return tweet.replace( /(^|\s+)#(\w+)/gi, function( m, before, hash ) { - return before + '<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23' + hash + '">#' + hash + '</a>'; - } ); - }, - - clean: function( tweet ) { - return this.hash( this.at( this.list( this.link( tweet ) ) ) ); - } - } // ify -}; - -$( document ).ready( function() { - // start jqtweet! - JQTWEET.loadTweets(); -}); \ No newline at end of file diff --git a/skin.json b/skin.json index cb66590..88c10cd 100644 --- a/skin.json +++ b/skin.json @@ -1,6 +1,6 @@ { "name": "Gamepress", - "version": "1.0.8", + "version": "1.0.9", "author": [ "[http://webtuts.pl/themes/ Aleksandra Łączek]", "Jack Phoenix", @@ -8,7 +8,7 @@ ], "url": "https://www.mediawiki.org/wiki/Skin:Gamepress", "license-name": "GPL-2.0+", - "description": "Easy-to-use gaming-oriented skin", + "descriptionmsg": "gamepress-desc", "type": "skin", "ValidSkinNames": { "gamepress": "Gamepress" -- To view, visit https://gerrit.wikimedia.org/r/329530 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib82a8afdb972b33028d034bfaa67ee6d2666de16 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Gamepress Gerrit-Branch: master Gerrit-Owner: SamanthaNguyen <samanthanguyen1...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits