Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 4 files changed
  • 0 comments
  • 1 contributor

Showing 4 changed files with 38 additions and 5 deletions. Show diff stats Hide diff stats

  1. +3 0  Makefile
  2. +18 0 index.html
  3. +16 4 js/script.js
  4. +1 1  js/script.min.js
3  Makefile
... ... @@ -0,0 +1,3 @@
  1 +all:
  2 + uglifyjs --no-copyright js/script.js > js/script.min.js
  3 + uglifyjs --no-copyright js/libs/ecmascript5.compatibility.js > js/libs/ecmascript5.compatibility.min.js
18 index.html
@@ -109,6 +109,24 @@
109 109 <a href="${link_to_all}">All items&hellip;</a>
110 110 </ul>
111 111 </script>
  112 + <script id="tmpl_links_block_github" type="text/x-jquery-tmpl">
  113 + <span class="service_title">${name}</span>
  114 + <ul>
  115 + {{each(i, item) items}}
  116 + <li title="${item.description}">
  117 + ${item.title}.
  118 + ({{each(j, url_item) item.urls}}
  119 + <a href="${url_item.url}">${url_item.title}</a>
  120 + {{if j < item.urls.length - 1}}
  121 + /
  122 + {{/if}}
  123 + {{/each}})
  124 + <span class="item_data">${item.date}</span>
  125 + </li>
  126 + {{/each}}
  127 + <a href="${link_to_all}">All items&hellip;</a>
  128 + </ul>
  129 + </script>
112 130
113 131 <!-- Yandex.Metrika counter -->
114 132 <div style="display:none;"><script type="text/javascript">
20 js/script.js
@@ -46,16 +46,26 @@ var App = {
46 46 name: 'Github repositories:',
47 47 link_to_all: 'http://github.com/msoap',
48 48 items: github_data.data.map(function(i) {
  49 +
  50 + var urls = [];
  51 + if (i.homepage.length) {
  52 + urls.push({title: "home", url: i.homepage})
  53 + };
  54 + urls.push({title: "repository", url: i.html_url});
  55 + if (i.has_wiki) {
  56 + urls.push({title: "wiki", url: i.html_url + '/wiki'})
  57 + };
  58 +
49 59 return {
50 60 title: i.description,
51 61 description: i.description,
52   - url: i.html_url,
  62 + urls: urls,
53 63 date: new Date(i.updated_at).toLocaleDateString()
54 64 };
55 65 })
56 66 };
57 67
58   - App.render_any('div#github', vars);
  68 + App.render_any('div#github', vars, "script#tmpl_links_block_github");
59 69 });
60 70 },
61 71
@@ -176,7 +186,9 @@ var App = {
176 186 },
177 187
178 188 // -------- render any block ---------
179   - render_any: function(where_selector, vars) {
180   - $("script#tmpl_links_block").tmpl(vars).appendTo(where_selector);
  189 + render_any: function(where_selector, vars, template) {
  190 + if (! template)
  191 + template = "script#tmpl_links_block";
  192 + $(template).tmpl(vars).appendTo(where_selector);
181 193 }
182 194 };
2  js/script.min.js
... ... @@ -1 +1 @@
1   -"use strict",$(function(){App.init()});var App={init:function(){$("div#navbar ul.nav li a").click(App.on_click_navbar),setTimeout(App.on_init_set_active,10),App.on_init_render_github(),App.on_init_render_delicious(),App.on_init_render_lastfm(),App.on_init_render_fotkiyandexru(),App.on_init_render_twitter(),App.on_init_render_linkedin()},on_init_set_active:function(){var a=document.location.hash.replace(/^#/,"");a.length&&$("div#"+a).length&&($("div#navbar ul.nav li").removeClass("active"),$("div#navbar ul.nav li a[href=#"+a+"]").parent("li").addClass("active"))},on_click_navbar:function(){$(this).parents("ul").find("li").removeClass("active"),$(this).parent("li").addClass("active")},on_init_render_github:function(){$.getJSON("https://api.github.com/users/msoap/repos?callback=?",{format:"json"},function(a){var b={name:"Github repositories:",link_to_all:"http://github.com/msoap",items:a.data.map(function(a){return{title:a.description,description:a.description,url:a.html_url,date:(new Date(a.updated_at)).toLocaleDateString()}})};App.render_any("div#github",b)})},on_init_render_delicious:function(){$.getJSON("http://feeds.delicious.com/v2/json/msoap?callback=?",{},function(a){var b={name:"Last delicious links:",link_to_all:"http://delicious.com/msoap",items:a.map(function(a){return{title:a.d,description:a.n,url:a.u,date:(new Date(a.dt)).toLocaleDateString()}})};App.render_any("div#delicious",b)})},on_init_render_lastfm:function(){$.getJSON("http://ws.audioscrobbler.com/2.0/?callback=?",{method:"user.getRecentTracks",format:"json",user:"msoap",api_key:"f013c46eeee32be481c90eb2c79378c5"},function(a){var b={without_url:!0,name:"Recently Listened Tracks:",link_to_all:"http://www.lastfm.ru/user/msoap",items:a.recenttracks.track.map(function(a){return{title:a.name,description:[a.artist["#text"],a.album["#text"]].join(" / "),url:a.url,date:a.date?(new Date(a.date.uts*1e3)).toLocaleDateString():(new Date).toLocaleDateString()}})};App.render_any("div#lastfm",b)})},on_init_render_fotkiyandexru:function(){$.getJSON("http://api-fotki.yandex.ru/api/users/msoap/photos/?callback=?",{limit:10,format:"json"},function(a){var b={without_url:!0,name:"Last photos:",link_to_all:"http://fotki.yandex.ru/users/msoap/",items:a.entries.filter(function(a,b){return b<15?!0:!1}).map(function(a){return{title:a.title,description:a.description,url:a.links.alternate,date:(new Date(a.published)).toLocaleDateString()}})};App.render_any("div#fotkiyandexru",b)})},on_init_render_twitter:function(){$.getJSON("https://api.twitter.com/1/statuses/user_timeline.json?callback=?",{include_entities:"false",include_rts:"false",screen_name:"msoap",count:10},function(a){var b={without_url:!0,name:"Last twits, one twit per year:)",link_to_all:"http://twitter.com/msoap",items:a.map(function(a){return{title:a.text,description:"",url:"http://twitter.com/#!/msoap/status/"+a.id_str,date:(new Date(a.created_at)).toLocaleDateString()}})};App.render_any("div#twitter",b)})},on_init_render_linkedin:function(){$("div#linkedin_div").append('<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/mudrik" data-format="click" data-related="false"></script>'),$("div#linkedin_div").one("mouseenter mouseleave",function(){$("span.IN-widget a.li-connect-link").append('<span style="color: black; font-size: 70%; text-decoration: none;">Linkedin<span>'),$(this).unbind("mouseenter mouseleave")})},render_any:function(a,b){$("script#tmpl_links_block").tmpl(b).appendTo(a)}};
  1 +"use strict";$(function(){App.init()});var App={init:function(){$("div#navbar ul.nav li a").click(App.on_click_navbar),setTimeout(App.on_init_set_active,10),App.on_init_render_github(),App.on_init_render_delicious(),App.on_init_render_lastfm(),App.on_init_render_fotkiyandexru(),App.on_init_render_twitter(),App.on_init_render_linkedin()},on_init_set_active:function(){var a=document.location.hash.replace(/^#/,"");a.length&&$("div#"+a).length&&($("div#navbar ul.nav li").removeClass("active"),$("div#navbar ul.nav li a[href=#"+a+"]").parent("li").addClass("active"))},on_click_navbar:function(){$(this).parents("ul").find("li").removeClass("active"),$(this).parent("li").addClass("active")},on_init_render_github:function(){$.getJSON("https://api.github.com/users/msoap/repos?callback=?",{format:"json"},function(a){var b={name:"Github repositories:",link_to_all:"http://github.com/msoap",items:a.data.map(function(a){var b=[];return a.homepage.length&&b.push({title:"home",url:a.homepage}),b.push({title:"repository",url:a.html_url}),a.has_wiki&&b.push({title:"wiki",url:a.html_url+"/wiki"}),{title:a.description,description:a.description,urls:b,date:(new Date(a.updated_at)).toLocaleDateString()}})};App.render_any("div#github",b,"script#tmpl_links_block_github")})},on_init_render_delicious:function(){$.getJSON("http://feeds.delicious.com/v2/json/msoap?callback=?",{},function(a){var b={name:"Last delicious links:",link_to_all:"http://delicious.com/msoap",items:a.map(function(a){return{title:a.d,description:a.n,url:a.u,date:(new Date(a.dt)).toLocaleDateString()}})};App.render_any("div#delicious",b)})},on_init_render_lastfm:function(){$.getJSON("http://ws.audioscrobbler.com/2.0/?callback=?",{method:"user.getRecentTracks",format:"json",user:"msoap",api_key:"f013c46eeee32be481c90eb2c79378c5"},function(a){var b={without_url:!0,name:"Recently Listened Tracks:",link_to_all:"http://www.lastfm.ru/user/msoap",items:a.recenttracks.track.map(function(a){return{title:a.name,description:[a.artist["#text"],a.album["#text"]].join(" / "),url:a.url,date:a.date?(new Date(a.date.uts*1e3)).toLocaleDateString():(new Date).toLocaleDateString()}})};App.render_any("div#lastfm",b)})},on_init_render_fotkiyandexru:function(){$.getJSON("http://api-fotki.yandex.ru/api/users/msoap/photos/?callback=?",{limit:10,format:"json"},function(a){var b={without_url:!0,name:"Last photos:",link_to_all:"http://fotki.yandex.ru/users/msoap/",items:a.entries.filter(function(a,b){return b<15?!0:!1}).map(function(a){return{title:a.title,description:a.description,url:a.links.alternate,date:(new Date(a.published)).toLocaleDateString()}})};App.render_any("div#fotkiyandexru",b)})},on_init_render_twitter:function(){$.getJSON("https://api.twitter.com/1/statuses/user_timeline.json?callback=?",{include_entities:"false",include_rts:"false",screen_name:"msoap",count:10},function(a){var b={without_url:!0,name:"Last twits, one twit per year:)",link_to_all:"http://twitter.com/msoap",items:a.map(function(a){return{title:a.text,description:"",url:"http://twitter.com/#!/msoap/status/"+a.id_str,date:(new Date(a.created_at)).toLocaleDateString()}})};App.render_any("div#twitter",b)})},on_init_render_linkedin:function(){$("div#linkedin_div").append('<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script><script type="IN/MemberProfile" data-id="http://www.linkedin.com/in/mudrik" data-format="click" data-related="false"></script>'),$("div#linkedin_div").one("mouseenter mouseleave",function(){$("span.IN-widget a.li-connect-link").append('<span style="color: black; font-size: 70%; text-decoration: none;">Linkedin<span>'),$(this).unbind("mouseenter mouseleave")})},render_any:function(a,b,c){c||(c="script#tmpl_links_block"),$(c).tmpl(b).appendTo(a)}};

No commit comments for this range

Something went wrong with that request. Please try again.