';
break;
case 'horizontal':
if(a.imgUrl){
imgCode = '
';
}
code = '
'+
'
';
code += imgCode;
if(a.label) code += ''+a.label+'';
code += '
';
break;
default:
error('ãããªviewç¥ãããã'+a.view);
}
return code;
}
function toImgUrl(super_kind){
var HFotoTbl = {
tw: '20180803102713',
fb: '20180803102707',
hb: '20180803102710',
line: '20180803102711',
pocket: '20180803102712',
feedly: '20180803102708',
hate_blo: '20180803102709',
note: '20180821103319'
};
var hf_id = HFotoTbl[super_kind];
if(!hf_id){
log('ãã®super kind:'+super_kind+'ã®ã¯ã¦ãªãã©ãIDãç»é²ããã¦ãªããã');
return null;
}
return hfid2url(hf_id);
}
var HFDayRE = /^\d{8}/;
function hfid2url(hf_id){
var sa = HFDayRE.exec(hf_id);
return 'https://cdn-ak.f.st-hatena.com/images/fotolife/f/fromdusktildawn/'+
sa[0] + '/' + hf_id + '.png';
}
function setButton(a){
var pos = isString( a.pos ) ? $(a.pos) : a.pos;
a.imgUrl = toImgUrl(a.superKind);
var html = makeButtonHtml(a);
var meth = a.insertMethod;
if(!meth) meth = 'after';
pos[meth](html);
$('#'+a.id).on('click',function(){
window.location.href = a.url;
});
}
function asurePrefix(a){
if(!a.prefix){
var random = Math.floor( Math.random() * 110000000000000 );
a.prefix = 'random-'+random+'-';
}
}
function setSocialBts(a, defs){
var title = getPageTitle(a.title);
var url = getPageUrl();
if(!a.insertMethod) a.insertMethod = 'after';
var b = $.extend(true, {}, a);
asurePrefix(b);
var i=0;
b.title = encodeURIComponent(title);
b.url = encodeURIComponent(url);
var pos = b.pos;
var id;
defs.forEach(function(def){
var c = $.extend(true, {}, b);
var kind = def[0];
c.label = def[1];
id = c.id = c.prefix + kind;
c.pos = pos;
c.kind = kind;
var superKind = SuperKindTbl[kind];
c.superKind = superKind ? superKind : kind;
var site = SITE_NAME;
if(site == 'fromd.hateblo.jp') site = 'www.furomuda.com';
switch(kind){
case 'tw':
c.url = 'http://twitter.com/share?url=' + c.url +
'&text='+c.title+encodeURIComponent(' @fromdusktildawn ')+
'&related=fromdusktildawn';
break;
case 'fb':
c.url = 'https://www.facebook.com/sharer/sharer.php?u='+c.url;
break;
case 'hb':
c.url = 'http://b.hatena.ne.jp/add?mode=confirm&url=' + c.url +
'&title='+c.title;
break;
case 'line':
c.url = 'https://social-plugins.line.me/lineit/share?url='+c.url;
break;
case 'pocket':
c.url = 'http://getpocket.com/edit?url='+c.url+
'&title='+c.title;
break;
case 'twFollow':
c.url = "https://twitter.com/intent/follow?screen_name=fromdusktildawn";
break;
case 'hbFollow':
c.url = "http://b.hatena.ne.jp/fromdusktildawn/";
break;
case 'fbPage':
c.url = 'https://www.facebook.com/furomuda/';
break;
case 'fbGroup':
c.url = "https://www.facebook.com/groups/426678561170457/";
break;
case 'hate_blo':
c.url = "https://blog.hatena.ne.jp/fromdusktildawn/"+ site + "/subscribe";
break;
case 'note':
c.url = 'https://note.mu/fromdusktildawn';
break;
case 'feedly':
c.url = 'https://feedly.com/i/subscription/feed/'+
encodeURIComponent('https://'+site+'/feed');
break;
default:
console.log('ãããªkindããããã:'+kind);
}
setButton(c);
if(c.insertMethod == 'after'){
pos = '#'+id;
}
});
return id;
}
function make2ColButtons(a, ldef, rdef){
var col_ids = make2ColFrame(a);
var lpos = '#'+col_ids.l;
var rpos = '#'+col_ids.r;
a.pos = lpos;
setSocialBts(a, ldef);
a.pos = rpos;
setSocialBts(a, rdef);
return col_ids.frame_id;
}
function make2ColFrame(a){
asurePrefix(a);
var LEFT_SUFFIX='-left-cell';
var RIGHT_SUFFIX='-right-cell';
var prefix = a.prefix;
var frame_id = prefix+'-frame';
var left_id = prefix+LEFT_SUFFIX;
var right_id = prefix+RIGHT_SUFFIX;
var frame = '
';
$(a.pos).after(frame);
return {l: left_id, r: right_id, frame: frame_id};
}
// PCä¾åã®ã³ã¼ãï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
var archiveEntries = $(".archive-entry");
if(archiveEntries.length){
archiveEntries.each(function(){
var archiveEntry = $(this)
var entryTitleLink = archiveEntry.find(".entry-title-link");
var entryHref = entryTitleLink.attr("href")
var entryDescription = archiveEntry.find(".entry-description");
var bookmarkHtml = "
"
entryTitleLink.append(bookmarkHtml);
var readMoreHtml = "
ãã£ã¨èªã";
entryDescription.append(readMoreHtml);
var bookmarkCounter = archiveEntry.find(".bookmark-widget-counter");
bookmarkCounter.hide();
var starContainer = archiveEntry.find(".star-container");
var bigBookmarkCounter = archiveEntry.find(".big-bookmark-counter");
starContainer.insertAfter(bigBookmarkCounter);
function makeStarCountBig(){
var starCount = archiveEntry.find(".hatena-star-inner-count");
if(starCount.length){
starCount.css('font-size','140%');
} else {
setTimeout(makeStarCountBig,300);
}
}
makeStarCountBig();
});
// ãã©ãã¼ãã¦ããããã¿ã³ããµã¤ããã¼ã«è¨ç½®
var btPos = '.profile-description';
var startPos = 'my-buttons-pos';
$(btPos).after(
'
'
);
twPos = '#'+startPos;
var last_id = setSocialBts({pos: twPos}, [
['twFollow', 'ãã©ãã¼ãã'],
['note', 'ãã©ãã¼ãã'],
['hate_blo', 'èªè
ã«ãªã'],
['feedly', 'è³¼èªãã'],
['hbFollow', 'ãã©ãã¼ãã'],
['fbPage', 'facebookãã¼ã¸'],
['fbGroup', 'facebookã°ã«ã¼ã']
]);
var paddingBottomId = 'my-padding-bottom-id';
$('#'+ last_id).after(
'
'
);
var pos = $('#main-inner');
var img_url = hfid2url('20201008224538');
//var img_url = hfid2url('20201003093324');
//var img_url = "https://storage.googleapis.com/hateblog/img/prj/book/learning/learning_blog_top.png";
pos.before(
'
'
);
/*
var free_a_begin = '
';
var book_a_begin = '';
pos.before(
''+
''+
''+
free_a_begin+
''+
' | '+
''+
'ãµããã æ¬ã®ã¬ãããªï¼ç« åãç¡æã®Webè¨äºã¨ãã¦èªãã¾ãï¼
'+
free_a_begin+
'ç¡æçãèªãã«ã¯ãããã¯ãªãã¯'+
' | '+
'
'+
''+
''+
book_a_begin+
'æ¬ã§èªã¿ããæ¹ã¯ãããã¯ãªãã¯'+
' |
'+
'
'
);
*/
} else {
var title = $(".entry-header .entry-title a");
if(title) {
var titleHref = title.attr("href")
var bookmarkHtml = "
"
var entryTitle =title.parent();
entryTitle.append(bookmarkHtml);
entryTitle.css('font-size','150%');
function addHeadStar(){
var starCountCheck = $(".entry-footer .hatena-star-star-container .hatena-star-inner-count");
if(starCountCheck.length){
var starContainer = $(".entry-footer .hatena-star-star-container");
if(starContainer){
var starCount = starContainer.find(".hatena-star-inner-count");
starCount.css('font-size','24px');
var starClone = starContainer.clone(true,true);
var bigBookmarkCounter = title.parent().find(".big-bookmark-counter");
starClone.insertAfter(bigBookmarkCounter);
starCount = starClone.find(".hatena-star-inner-count");
starCount.on('click',function(){
alert('âãä»ãã人ã®ä¸è¦§ãè¦ãã«ã¯ããã®è¨äºã®ä¸é¨ã®âæ°ãã¯ãªãã¯ãã¦ãã ããã');
$("html,body").animate({scrollTop:$('.entry-footer .hatena-star-star-container').offset().top-100});
});
var bt = starClone.find(".hatena-star-add-button");
bt.on('click',function(){
alert('âãä»ããã«ã¯ããã®è¨äºã®ä¸é¨ã®ãâ+ããã¿ã³ãã¯ãªãã¯ãã¦ãã ããã');
$("html,body").animate({scrollTop:$('.entry-footer .hatena-star-star-container').offset().top-100});
});
} else{
setTimeout(addHeadStar,300);
}
} else {
setTimeout(addHeadStar,300);
}
}
addHeadStar();
procSpecialMarkers();
var param = {
pos: 'footer.entry-footer p.entry-footer-section',
title: title.text()
}
make2ColButtons(param,
[
['tw', 'ãã®è¨äºããã¤ã¼ããã'],
['hb', 'ãã®è¨äºãããã¯ãã¼ã¯ãã'],
['pocket', 'ãã®è¨äºãå¾ã§èªã']
],
[
['fb', 'ãã®è¨äºãã·ã§ã¢ãã'],
['line', 'ãã®è¨äºãLINEã§éã']
]
);
// ãã©ãã¼ãã¦ããããã¿ã³ãä¸é¨ã«è¨ç½®
param = {
pos: 'footer.entry-footer div.social-buttons'
};
var frame_id = make2ColButtons(param,
[
['twFollow', 'ãã©ãã¼ãã'],
['hate_blo', 'èªè
ã«ãªã'],
['hbFollow', 'ãã©ãã¼ãã'],
['fbGroup', 'facebookã°ã«ã¼ã']
],
[
['note', 'ãã©ãã¼ãã'],
['feedly', 'è³¼èªãã'],
['fbPage', 'facebookãã¼ã¸']
]
);
}
}
// è¨äºä¸è¦§ãã¼ã¸ã¨ãåä½è¡¨ç¤ºãã¼ã¸ã®ä¸¡æ¹ã«å
±éããã³ã¼ã ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼
var d = $('div.date a time');
d.css({
'color': '#aaa',
'font-weight': 'normal'
});
if(IS_ANNEX){
var link = $('h1#title a'); // ããã°ã¿ã¤ãã«ã®ãªã³ã¯
link.attr("href", 'https://www.furomuda.com/');
}
})