1var blBookmarks; 2blBookmarks = (function() { 3 var blBookmarks, deliciousBookmarks, diggBookmarks, diigoBookmarks, facebookBookmarks, facebookHeightBookmarks, hatenaBookmarks, hatenaHeightBookmarks, outputBookMarks, redditBookmarks, twitterBookmarks, twitterHeightBookmarks, mixicheckBookmarks, mixiiine2Bookmarks; 4 var __merge, __slice, __bind, __uncurry_this, __async_call; 5 var baseDetectingBrowser, ieDetectingBrowser, isIE; 6 var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }, __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (__hasProp.call(this, i) && this[i] === item) return i; } return -1; }; 7 8 __slice = Array.prototype.slice; 9 10 __bind = Function.prototype.bind || function(_obj){ 11 var _this, _args; 12 _this = this; 13 _args = __slice.call(arguments, 1); 14 return function(){ 15 var _arg; 16 _arg = __slice.call(arguments); 17 return _this.apply(_obj, _args.concat(_arg)); 18 }; 19 }; 20 21 __uncurry_this = __bind.call(__bind, Function.prototype.call); 22 23 __async_call = function(){ 24 var _slice, _bind, _apply; 25 _slice = __uncurry_this(__slice); 26 _bind = __uncurry_this(__bind); 27 _apply = __uncurry_this(Function.prototype.apply); 28 29 return typeof setImmediate === "function"? function(){ 30 var _args; 31 _args = _slice(arguments); 32 setImmediate( _apply( _bind, null, _args)); 33 }: typeof MessageChannel === "function"? function(){ 34 var ch, queue; 35 ch = new MessageChannel(); 36 queue = []; 37 ch.port1.onmessage = function(){ queue.shift()(); }; 38 return function(){ 39 var _args; 40 _args = _slice(arguments); 41 queue.push(_apply(_bind, null, _args)); 42 ch.port2.postMessage(0); 43 }; 44 }(): function(){ 45 var _args; 46 _args = _slice(arguments); 47 setTimeout(_apply(_bind, null, _args), 0); 48 }; 49 }(); 50 51 /* 52 base detecting browser::super 53 */ 54 baseDetectingBrowser = (function() { 55 function baseDetectingBrowser(){ 56 // constructor 57 var _this; 58 59 this.isBrowser = false; 60 this.version = null; 61 this.options = { 62 navigator:null, 63 browser_name:null, 64 version_scrap_string:null 65 }; 66 67 _this = this; 68 _this._set_navigator(); 69 _this._set_browser(); 70 _this.set_version(); 71 72 } 73 74 baseDetectingBrowser.prototype._set_navigator = function(){ 75 this.options.navigator = window.navigator; 76 }; 77 78 /* 79 override 80 default::lower case 81 */ 82 83 baseDetectingBrowser.prototype.set_browser_name = function(){ 84 this.options.browser_name = null; 85 }; 86 87 /* 88 overide 89 default::lower case 90 */ 91 baseDetectingBrowser.prototype._get_ua = function(){ 92 return this.options.navigator.userAgent.toLowerCase(); 93 }; 94 95 baseDetectingBrowser.prototype._set_browser = function(){ 96 var _browser_name, _this, _options, ua; 97 98 _this = this; 99 _options = _this.options; 100 _this.set_browser_name(); 101 _browser_name = _options.browser_name; 102 103 ua = _this._get_ua(); 104 105 if( _browser_name !== null){ 106 if( ua.indexOf( _browser_name ) !== -1 ){ 107 this.isBrowser = true; 108 } 109 } 110 }; 111 112 /* 113 override 114 */ 115 baseDetectingBrowser.prototype.set_version = function(){ 116 var _options, ua, _scrap_string, match, _this; 117 _this = this; 118 if(_this.isBrowser === true){ 119 _this.set_version_scrap_string(); 120 _options = _this.options; 121 _scrap_string = _options.version_scrap_string; 122 if( _scrap_string !== null){ 123 ua = _this._get_ua(); 124 match = ua.match(_scrap_string); 125 if(match !== null){ 126 this.version = parseFloat(match[1].replace("_", ".")); 127 } 128 } 129 } 130 }; 131 132 /* 133 override 134 */ 135 baseDetectingBrowser.prototype.set_version_scrap_string = function(){ 136 this.options.version_scrap_string = null; 137 }; 138 139 return baseDetectingBrowser; 140 })(); 141 142 /* 143 ie 144 */ 145 ieDetectingBrowser = (function() { 146 __extends(ieDetectingBrowser, baseDetectingBrowser); 147 148 function ieDetectingBrowser() { 149 ieDetectingBrowser.__super__.constructor.apply(this, arguments); 150 } 151 152 ieDetectingBrowser.prototype.set_browser_name = function(){ 153 this.options.browser_name = "msie"; 154 }; 155 156 ieDetectingBrowser.prototype.set_version_scrap_string = function(){ 157 this.options.version_scrap_string = /msie\s([^\s]*)/; 158 }; 159 return ieDetectingBrowser; 160 })(); 161 162 isIE = new ieDetectingBrowser(); 163 164 __merge = function(destination, source) { 165 var key, value; 166 for (key in source) { 167 value = source[key]; 168 if (source.hasOwnProperty(key) === true) destination[key] = source[key]; 169 } 170 return destination; 171 }; 172 173 /* 174 # ããã¯ãã¼ã¯è¡¨ç¤ºå¦çã¯ã©ã¹:super 175 */ 176 177 outputBookMarks = (function() { 178 function outputBookMarks() { 179 this.opts = {}; 180 this.script_options = {}; 181 this.api_id = null; 182 } 183 184 outputBookMarks.prototype.default_options = { 185 base_url: "", 186 index: null, 187 element: null, 188 media_key: "", 189 url: "", 190 subject: "", 191 blog_url: "" 192 }; 193 194 outputBookMarks.prototype.default_scrpipt_options = { 195 id: null, 196 element: "script", 197 type: "text/javascript", 198 async: true, 199 charaset: "utf-8", 200 src: null, 201 style_tag: null 202 }; 203 204 /* 205 # åºåç¨ãªãã·ã§ã³å¤ã®åæå¤ãè¨å®::ãªã¼ãã©ã¤ã 206 */ 207 208 outputBookMarks.prototype.get_html_options = function() { 209 var _this, _opts, _img; 210 _this = this; 211 _opts = _this.opts; 212 _img = _this.get_icon_img(); 213 return { 214 url: _opts.url, 215 subject: _opts.subject, 216 img: _img, 217 title: "" 218 }; 219 }; 220 221 /* 222 # åºåç¨HTMLãè¨å®::ãªã¼ãã©ã¤ã 223 */ 224 225 outputBookMarks.prototype.get_html = function(html_options) { 226 var _this, img, title, url; 227 _this = this; 228 url = _this.escape_html(html_options.url); 229 img = _this.escape_html(html_options.img); 230 title = _this.escape_html(html_options.title); 231 return "<a href=\"" + url + "\" target=\"_blank\"><img src=\"" + img + "\" alt=\"" + title + "\" title=\"" + title + "\" border=\"0\" hspace=\"1\"></a>"; 232 }; 233 234 /* 235 # Scriptç¨è¨å®::ãªã¼ãã¼ã©ã¤ã 236 */ 237 238 outputBookMarks.prototype.set_script_options = function() { 239 this.script_options.src = null; 240 }; 241 242 /* 243 # Api IDç¨è¨å®::ãªã¼ãã¼ã©ã¤ã 244 */ 245 outputBookMarks.prototype.set_api_id = function() { 246 this.api_id = null; 247 }; 248 249 outputBookMarks.prototype.get_script_options = function() { 250 var _this; 251 _this = this; 252 _this.set_api_id(); 253 _this.set_script_options(); 254 return __merge( _this.default_scrpipt_options, _this.script_options); 255 }; 256 257 outputBookMarks.prototype.add_script = function() { 258 var _this, id_element, s, script, script_options; 259 _this = this; 260 script_options = _this.get_script_options(); 261 id_element = document.getElementById(script_options.id); 262 if ((id_element === null) && (script_options.src !== null)) { 263 script = document.createElement(script_options.element); 264 script.type = script_options.type; 265 script.async = script_options.async; 266 script.charaset = script_options.charaset; 267 script.src = script_options.src; 268 script.setAttribute("id", script_options.id); 269 s = document.getElementsByTagName('script')[0]; 270 s.parentNode.insertBefore(script, s); 271 if (script_options.hasOwnProperty("style_tag") === true && script_options.style_tag !== "" && script_options.style_tag !== null) { 272 _this.add_style(script_options.id, script_options.style_tag); 273 } 274 } 275 }; 276 277 outputBookMarks.prototype.reload_script = function() { 278 var _this, id_element, script_options; 279 _this = this; 280 script_options = _this.get_script_options(); 281 id_element = document.getElementById(script_options.id); 282 if ( id_element === null) { 283 _this.add_script(); 284 } else { 285 _this.remove_script(id_element); 286 _this.add_script(); 287 } 288 }; 289 290 outputBookMarks.prototype.remove_script = function(obj) { 291 var obj_parent; 292 obj_parent = obj.parentNode; 293 obj_parent.removeChild(obj); 294 }; 295 296 outputBookMarks.prototype.add_style = function(script_id, tags) { 297 var id_element, sheet, style, style_id, tags_list; 298 if( isIE.isBrowser === true ){ 299 sheet = document.createStyleSheet(); 300 tags_list = tags.split("{").join(",").split("}").join("").split(","); 301 sheet.addRule(tags_list[0], tags_list[1]); 302 }else{ 303 style_id = "" + script_id + "_style"; 304 id_element = document.getElementById(style_id); 305 if (id_element !== null) { 306 style = document.createElement("style"); 307 style.setAttribute("type", "text/css"); 308 style.setAttribute("id", style_id); 309 document.getElementsByTagName("head")[0].appendChild(style); 310 style.sheet.insertRule(tags, style.sheet.cssRules.length); 311 } 312 } 313 }; 314 315 outputBookMarks.prototype.get_icon_img = function() { 316 var _opts, img; 317 _opts = this.opts; 318 img = "" + _opts.blog_url + "/_common/img/bookmark/" + _opts.media_key + "_ico.gif"; 319 return img; 320 }; 321 322 outputBookMarks.prototype.escape_html = function(str) { 323 var obj; 324 obj = document.createElement("pre"); 325 if (typeof obj.textContent !== "undefined") { 326 obj.textContent = str; 327 } else { 328 obj.innerText = str; 329 } 330 return obj.innerHTML; 331 }; 332 333 outputBookMarks.prototype.get = function(options) { 334 var _this, _html_options, html; 335 _this = this; 336 if (options === null) options = {}; 337 this.opts = __merge(_this.default_options, options); 338 _html_options = _this.get_html_options(); 339 html = _this.get_html(_html_options); 340 return html; 341 }; 342 343 outputBookMarks.prototype.add_external_script = function(src) { 344 var script; 345 script = document.createElement("script"); 346 script.type = "text/javascript"; 347 script.src = src; 348 document.getElementsByTagName("head")[0].appendChild(script); 349 }; 350 351 return outputBookMarks; 352 353 })(); 354 355 /* 356 # hatena 357 */ 358 359 hatenaBookmarks = (function() { 360 361 __extends(hatenaBookmarks, outputBookMarks); 362 363 function hatenaBookmarks() { 364 hatenaBookmarks.__super__.constructor.apply(this, arguments); 365 } 366 367 hatenaBookmarks.prototype.get_html_options = function() { 368 var _opts; 369 _opts = this.opts; 370 return { 371 url: _opts.url, 372 subject: _opts.subject, 373 img: null, 374 title: "ãã®ã¨ã³ããªã¼ãã¯ã¦ãªããã¯ãã¼ã¯ã«è¿½å " 375 }; 376 }; 377 378 hatenaBookmarks.prototype.get_html = function(html_options) { 379 return '<a href="https://b.hatena.ne.jp/entry/' + html_options.url + '" class="hatena-bookmark-button" data-hatena-bookmark-title="' + html_options.subject + '" data-hatena-bookmark-layout="standard-balloon" data-hatena-bookmark-lang="ja" title="' + html_options.title + '"><img src="https://b.st-hatena.com/images/entry-button/[email protected]" alt="' + html_options.title + '" width="20" height="20" style="border: none;" /></a>'; 380 }; 381 382 hatenaBookmarks.prototype.set_script_options = function() { 383 this.script_options = { 384 id: "hatena-js", 385 src: "https://b.st-hatena.com/js/bookmark_button.js", 386 charset: "utf-8", 387 async: "async" 388 }; 389 }; 390 391 return hatenaBookmarks; 392 393 })(); 394 395 /* 396 # hatena type height. 397 */ 398 399 hatenaHeightBookmarks = (function() { 400 401 __extends(hatenaHeightBookmarks, outputBookMarks); 402 403 function hatenaHeightBookmarks() { 404 hatenaHeightBookmarks.__super__.constructor.apply(this, arguments); 405 } 406 407 hatenaHeightBookmarks.prototype.get_html_options = function() { 408 var _opts; 409 _opts = this.opts; 410 return { 411 url: _opts.url, 412 subject: _opts.subject, 413 img: null, 414 title: "ãã®ã¨ã³ããªã¼ãã¯ã¦ãªããã¯ãã¼ã¯ã«è¿½å " 415 }; 416 }; 417 418 hatenaHeightBookmarks.prototype.get_html = function(html_options) { 419 return '<a href="https://b.hatena.ne.jp/entry/' + html_options.url + '" class="hatena-bookmark-button" data-hatena-bookmark-title="' + html_options.subject + '" data-hatena-bookmark-layout="vertical-balloon" data-hatena-bookmark-lang="ja" title="' + html_options.title + '"><img src="https://b.st-hatena.com/images/entry-button/[email protected]" alt="'+ html_options.title +'" width="20" height="20" style="border: none;" /></a>'; 420 }; 421 422 hatenaHeightBookmarks.prototype.set_script_options = function() { 423 this.script_options = { 424 id: "hatena-js", 425 src: "https://b.st-hatena.com/js/bookmark_button.js", 426 charset: "utf-8", 427 async: "async" 428 }; 429 }; 430 431 return hatenaHeightBookmarks; 432 433 })(); 434 435 /* 436 # facebook type width. 437 */ 438 439 facebookBookmarks = (function() { 440 441 __extends(facebookBookmarks, outputBookMarks); 442 443 function facebookBookmarks() { 444 facebookBookmarks.__super__.constructor.apply(this, arguments); 445 } 446 447 facebookBookmarks.prototype.get_html_options = function() { 448 return { 449 url: this.opts.url, 450 subject: null, 451 img: null, 452 title: null 453 }; 454 }; 455 456 facebookBookmarks.prototype.get_html = function(html_options) { 457 return "<div class=\"fb-like\" layout=\"button_count\" data-href=\"" + html_options.url + "\" data-send=\"false\" data-width=\"120\" data-show-faces=\"false\"></div>"; 458 }; 459 460 facebookBookmarks.prototype.set_api_id = function() { 461 this.api_id = 220204588075146; 462 }; 463 464 facebookBookmarks.prototype.set_script_options = function() { 465 var src; 466 src= "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.6&appId=" + this.api_id; 467 this.script_options = { 468 id: "facebook-jssdk", 469 src: src 470 }; 471 }; 472 return facebookBookmarks; 473 474 })(); 475 476 /* 477 # facebook type height. 478 */ 479 480 facebookHeightBookmarks = (function() { 481 482 __extends(facebookHeightBookmarks, facebookBookmarks); 483 484 function facebookHeightBookmarks() { 485 facebookHeightBookmarks.__super__.constructor.apply(this, arguments); 486 } 487 488 facebookHeightBookmarks.prototype.get_html = function(html_options) { 489 return "<div class=\"fb-like\" layout=\"box_count\" data-href=\"" + html_options.url + "\" data-send=\"false\" data-width=\"120\" data-show-faces=\"false\"></div>"; 490 }; 491 492 return facebookHeightBookmarks; 493 494 })(); 495 496 /* 497 # twitter 498 */ 499 500 twitterBookmarks = (function() { 501 502 __extends(twitterBookmarks, outputBookMarks); 503 504 function twitterBookmarks() { 505 twitterBookmarks.__super__.constructor.apply(this, arguments); 506 } 507 508 twitterBookmarks.prototype.get_html_options = function() { 509 var _opts; 510 _opts = this.opts; 511 return { 512 url: _opts.url, 513 subject: _opts.subject, 514 img: null, 515 title: null 516 }; 517 }; 518 519 twitterBookmarks.prototype.get_html = function(html_options) { 520 return "<a href=\"https://twitter.com/share\" class=\"twitter-share-button twitter-share-button-width\" data-url=\"" + html_options.url + "\" data-lang=\"ja\" data-text=\"" + html_options.subject + "\"></a>"; 521 }; 522 523 twitterBookmarks.prototype.set_script_options = function() { 524 var protocol, src; 525 protocol = /^http:/.test(document.location)?"http":"https"; 526 src = protocol + "://platform.twitter.com/widgets.js"; 527 this.script_options = { 528 id: "twitter-wjs", 529 src: src 530 //style_tag: "iframe.twitter-share-button-width { width: 110px!important;padding-left:2px;}" 531 }; 532 }; 533 534 return twitterBookmarks; 535 536 })(); 537 538 /* 539 # twitter type height. 540 */ 541 542 twitterHeightBookmarks = (function() { 543 544 __extends(twitterHeightBookmarks, twitterBookmarks); 545 546 function twitterHeightBookmarks() { 547 twitterHeightBookmarks.__super__.constructor.apply(this, arguments); 548 } 549 550 twitterHeightBookmarks.prototype.get_html = function(html_options) { 551 return "<a href=\"https://twitter.com/share\" class=\"twitter-share-button twitter-share-button-height\" data-url=\"" + html_options.url + "\" data-lang=\"ja\" data-text=\"" + html_options.subject + "\" data-count=\"vertical\"></a>"; 552 }; 553 554 return twitterHeightBookmarks; 555 556 })(); 557 558 /* 559 # delicious 560 */ 561 562 deliciousBookmarks = (function() { 563 564 __extends(deliciousBookmarks, outputBookMarks); 565 566 function deliciousBookmarks() { 567 deliciousBookmarks.__super__.constructor.apply(this, arguments); 568 } 569 570 deliciousBookmarks.p
570rototype.get_html_options = function() { 571 var _this, _opts, title, url, img; 572 _this = this; 573 _opts = _this.opts; 574 title = encodeURIComponent(_opts.subject); 575 url = "http://del.icio.us/post?url=" + _opts.url + "&title=" + title; 576 img = _this.get_icon_img(); 577 return { 578 url: url, 579 subject: null, 580 img: img, 581 title: "ã¨ã³ããªãDeliciousã«è¿½å ãã" 582 }; 583 }; 584 585 return deliciousBookmarks; 586 587 })(); 588 589 /* 590 # reddit 591 */ 592 593 redditBookmarks = (function() { 594 595 __extends(redditBookmarks, outputBookMarks); 596 597 function redditBookmarks() { 598 redditBookmarks.__super__.constructor.apply(this, arguments); 599 } 600 601 redditBookmarks.prototype.get_html_options = function() { 602 var _this, _opts, title, url, img; 603 _this = this; 604 _opts = _this.opts; 605 title = encodeURIComponent(_opts.subject); 606 url = "http://reddit.com/submit?url=" + _opts.url + "&title=" + title; 607 img = _this.get_icon_img(); 608 return { 609 url: url, 610 subject: null, 611 img: img, 612 title: "reddit" 613 }; 614 }; 615 616 return redditBookmarks; 617 618 })(); 619 620 /* 621 # digg 622 */ 623 624 diggBookmarks = (function() { 625 626 __extends(diggBookmarks, outputBookMarks); 627 628 function diggBookmarks() { 629 diggBookmarks.__super__.constructor.apply(this, arguments); 630 } 631 632 diggBookmarks.prototype.get_html_options = function() { 633 var _this, _opts, title, url, img; 634 _this = this; 635 _opts = _this.opts; 636 title = encodeURIComponent(_opts.subject); 637 url = "http://digg.com/submit?phase=2&url=" + _opts.url + "&title=" + title; 638 img = _this.get_icon_img(); 639 return { 640 url: url, 641 subject: null, 642 img: img, 643 title: "Digg" 644 }; 645 }; 646 647 return diggBookmarks; 648 649 })(); 650 651 /* 652 # diigo 653 */ 654 655 diigoBookmarks = (function() { 656 657 __extends(diigoBookmarks, outputBookMarks); 658 659 function diigoBookmarks() { 660 diigoBookmarks.__super__.constructor.apply(this, arguments); 661 } 662 663 diigoBookmarks.prototype.get_html_options = function() { 664 var _this, _opts, title, url; 665 _this = this; 666 _opts = _this.opts; 667 title = encodeURIComponent(this.opts.subject); 668 url = "http://www.diigo.com/post?url=" + _opts.url + "&title=" + title; 669 return { 670 url: url, 671 subject: null, 672 img: "https://www.diigo.com/images/ii_blue.gif", 673 title: "Add to diigo" 674 }; 675 }; 676 677 return diigoBookmarks; 678 679 })(); 680 681 /* 682 # mixicheck 683 */ 684 685 mixicheckBookmarks = (function() { 686 687 __extends(mixicheckBookmarks, outputBookMarks); 688 689 function mixicheckBookmarks() { 690 mixicheckBookmarks.__super__.constructor.apply(this, arguments); 691 } 692 693 mixicheckBookmarks.prototype.get_html_options = function() { 694 var _opts, url, subject; 695 _opts = this.opts; 696 url = _opts.url; 697 subject = _opts.subject; 698 return { 699 url: url, 700 subject: subject, 701 img: null, 702 title: null 703 }; 704 }; 705 706 mixicheckBookmarks.prototype.get_html = function(html_options) { 707 return "<iframe src=\"" + this.opts.blog_url + "/bookmarks_iframe.html#url=" + html_options.url + "#media=mixicheck\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:60px; height:21px;\" allowTransparency=\"true\"></iframe>"; 708 }; 709 return mixicheckBookmarks; 710 711 })(); 712 713 mixiiine2Bookmarks = (function() { 714 715 __extends(mixiiine2Bookmarks, outputBookMarks); 716 717 function mixiiine2Bookmarks() { 718 mixiiine2Bookmarks.__super__.constructor.apply(this, arguments); 719 } 720 721 mixiiine2Bookmarks.prototype.get_html_options = function() { 722 return { 723 url: this.opts.url, 724 subject: null, 725 img: null, 726 title: null 727 }; 728 }; 729 730 mixiiine2Bookmarks.prototype.get_html = function(html_options) { 731 return "<iframe src=\"" + this.opts.blog_url + "/bookmarks_iframe.html#url=" + html_options.url + "#media=mixiiine2\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:140px; height:21px;\" allowTransparency=\"true\"></iframe>"; 732 }; 733 734 return mixiiine2Bookmarks; 735 736 })(); 737 738 739 function blBookmarks(options) { 740 var _opts; 741 if (options === null) options = {}; 742 this.opts = _opts = __merge(this.default_options, options); 743 this.appendBalloonBox(); 744 this.opts.bookmark_button_img = _opts.blog_url + _opts.bookmark_button_img; 745 this.opts.bookmark_services = this.conversion_bookmark_services_string(_opts.bookmark_services, _opts.conversion_bookmark_services_string_list); 746 } 747 748 blBookmarks.prototype.default_options = { 749 blog_url: "", 750 bookmark_services: [], 751 order_bookmark_services: ["hatena", "hatenaHeight", "facebook", "facebookHeight", "twitter", "twitterHeight", "livedoor", "delicious", "reddit", "digg", "diigo", "mixicheck", "mixiiine2", "mixiiine1"], 752 conversion_bookmark_services_string_list: { 753 "ha": "hatena", 754 "hah": "hatenaHeight", 755 "de": "delicious", 756 "re": "reddit", 757 "dig": "digg", 758 "dii": "diigo", 759 "tw": "twitter", 760 "twh": "twitterHeight", 761 "fb": "facebook", 762 "fbh": "facebookHeight", 763 "mi2": "mixiiine2", 764 "mi": "mixicheck" 765 }, 766 sns_box_class: "sns_box", 767 bookmark_button_class:"seesaaBookmarks", 768 now_push_elem: null, 769 init_sns_list: ["hatena", "hatenaHeight", "facebook", "facebookHeight", "twitter", "twitterHeight"], 770 height_sns_list: ["hatenaHeight", "facebookHeight", "twitterHeight"], 771 add_init_script_list: ["hatena", "hatenaHeight", "facebook", "facebookHeight", "twitter", "twitterHeight", "mixicheck"], 772 balloon_elem: "balloonBox", 773 balloon_close_elem: "balloonClose", 774 bookmark_button_elem: "bookmark_button", 775 bookmark_button_img: "/_common/img/bookmark/bookmark.gif", 776 base_tag: "div", 777 base_elem: "bookmark", 778 data_url: "data-url", 779 data_subject: "data-subject", 780 balloon:null, 781 timer:null, 782 stop_time: 5000, 783 sns_list: { 784 hatena: hatenaBookmarks, 785 hatenaHeight: hatenaHeightBookmarks, 786 facebook: facebookBookmarks, 787 facebookHeight: facebookHeightBookmarks, 788 twitter: twitterBookmarks, 789 twitterHeight: twitterHeightBookmarks, 790 delicious: deliciousBookmarks, 791 reddit: redditBookmarks, 792 digg: diggBookmarks, 793 diigo: diigoBookmarks, 794 mixicheck: mixicheckBookmarks, 795 mixiiine2: mixiiine2Bookmarks 796 } 797 }; 798 799 blBookmarks.prototype.exe = function() { 800 var _this, class_list; 801 _this = this; 802 __async_call(function(){ 803 if( isIE.isBrowser === true && isIE.version === 6){} else { 804 //if (this.userAgent.indexOf("msie") !== -1 && this.appVersion.indexOf("msie 6.") !== -1) {} else { 805 class_list = this.get_class_list(this.opts.base_tag, this.opts.base_elem); 806 this.add_scripts_init(); 807 if(this.opts.bookmark_services.length > 0){ 808 this.drow_bookmarks(class_list); 809 } 810 } 811 }, _this); 812 }; 813 814 blBookmarks.prototype.conversion_bookmark_services_string = function(bookmark_services, conversion_bookmark_services_string_list) { 815 var response_bookmark_services, bookmark_service, conversion_bookmark, i, _len, order_bookmark_services; 816 response_bookmark_services = []; 817 order_bookmark_services = this.opts.order_bookmark_services;
818 for(i = 0, _len = bookmark_services.length; i < _len; i++){ 819 bookmark_service = bookmark_services[i]; 820 if( conversion_bookmark_services_string_list.hasOwnProperty(bookmark_service) === true){ 821 conversion_bookmark = conversion_bookmark_services_string_list[bookmark_service]; 822 }else{ 823 conversion_bookmark = bookmark_service; 824 } 825 if( __indexOf.call(order_bookmark_services, conversion_bookmark) >= 0 && __indexOf.call(response_bookmark_services, conversion_bookmark) < 0){ 826 response_bookmark_services.push(conversion_bookmark); 827 } 828 } 829 return response_bookmark_services; 830 }; 831 832 blBookmarks.prototype.sort_bookmark_services = function(bookmark_services, order_bookmark_services) { 833 var key, response_bookmark_services, _i, _len; 834 response_bookmark_services = []; 835 for (_i = 0, _len = order_bookmark_services.length; _i < _len; _i++) { 836 key = order_bookmark_services[_i]; 837 if (__indexOf.call(bookmark_services, key) >= 0) { 838 response_bookmark_services.push(key); 839 } 840 } 841 return response_bookmark_services; 842 }; 843 844 blBookmarks.prototype.add_scripts_init = function() { 845 var bookmark_list, bookmark_process, key, _i, _len, _ref; 846 bookmark_list = __merge({}, this.opts.sns_list); 847 _ref = this.opts.add_init_script_list; 848 for (_i = 0, _len = _ref.length; _i < _len; _i++) { 849 key = _ref[_i]; 850 bookmark_process = new bookmark_list[key](); 851 if ("add_script" in bookmark_process) bookmark_process.add_script(); 852 } 853 }; 854 855 blBookmarks.prototype.drow_bookmarks = function(class_list) { 856 var bookmark_button_obj, bookmark_services, element, height_obj_height, height_sns_list, init_sns_list, key, opts, sns_obj, subject, url, _i, _j, _len, _len2, _fragment; 857 opts = this.opts; 858 bookmark_services = this.opts.bookmark_services; 859 init_sns_list = this.opts.init_sns_list; 860 height_sns_list = opts.height_sns_list; 861 _fragment = document.createDocumentFragment(); 862 for (_i = 0, _len = class_list.length; _i < _len; _i++) { 863 element = class_list[_i]; 864 url = element.getAttribute(opts.data_url); 865 subject = element.getAttribute(opts.data_subject); 866 height_obj_height = null; 867 for (_j = 0, _len2 = init_sns_list.length; _j < _len2; _j++) { 868 key = init_sns_list[_j]; 869 if (__indexOf.call(bookmark_services, key) >= 0) { 870 sns_obj = this.sns_object(key, url, subject); 871 if (sns_obj !== null) { 872 _fragment.appendChild(sns_obj); 873 if (height_obj_height === null) { 874 if (__indexOf.call(height_sns_list, key) >= 0) { 875 height_obj_height = sns_obj.offsetHeight; 876 } 877 } 878 } 879 } 880 } 881 882 if(this.get_append_bookmark_flag() === true){ 883 bookmark_button_obj = this.bookmark_button(); 884 if (height_obj_height !== null) { 885 bookmark_button_obj.style.height = "63px"; 886 } 887 _fragment.appendChild(bookmark_button_obj); 888 } 889 element.appendChild(_fragment); 890 } 891 }; 892 893 blBookmarks.prototype.get_append_bookmark_flag = function(){ 894 var init_sns_list, sns_list, bookmark_services, key; 895 init_sns_list = this.opts.init_sns_list; 896 bookmark_services = this.opts.bookmark_services; 897 sns_list = []; 898 for (var _i = 0, _len = bookmark_services.length; _i < _len; _i++) { 899 key = bookmark_services[_i]; 900 if (__indexOf.call(init_sns_list, key) >= 0) { 901 } else { 902 return true; 903 } 904 } 905 return false; 906 }; 907 908 blBookmarks.prototype.sns_object = function(key, url, subject) { 909 var element, html, opts, sns_class, sns_list, sns_obj; 910 opts = this.opts; 911 sns_list = opts.sns_list; 912 if (sns_list.hasOwnProperty(key) === true) { 913 sns_obj = new sns_list[key](); 914 html = sns_obj.get({ 915 blog_url: opts.blog_url, 916 media_key: key, 917 url: url, 918 subject: subject 919 }); 920 if (html !== null) { 921 element = document.createElement("div"); 922 sns_class = "" + opts.sns_box_class + " " + key + "Bookmark"; 923 if(element.getAttribute("className") !== null){ 924 element.setAttribute("className", sns_class); 925 } else { 926 element.setAttribute("class", sns_class); 927 } 928 element.innerHTML = html; 929 return element; 930 } else { 931 return null; 932 } 933 934 } else { 935 return null; 936 } 937 }; 938 939 blBookmarks.prototype.balloon_timer = function(flag) { 940 var opts; 941 opts = this.opts; 942 if (flag === true) { 943 this.timerID = setTimeout(function() { 944 if (opts.balloon !== null) { 945 opts.balloon.style.display = "none"; 946 opts.now_push_elem = null; 947 } 948 }, opts.stop_time); 949 return; 950 } else { 951 clearTimeout(this.timerID); 952 return; 953 } 954 }; 955 956 blBookmarks.prototype.push_bookmark_button = function(self) {
957 var element, init_sns_list, key, obj, opts, parent, selfHeight, selfX, selfY, sns_list, sns_obj, subject, url, _i, _len, _this, bookmark_services, _obj; 958 bookmark_services = this.opts.bookmark_services; 959 this.balloon_timer(false); 960 opts = this.opts; 961 _this = this; 962 parent = self.parentNode; 963 url = parent.getAttribute(opts.data_url); 964 subject = parent.getAttribute(opts.data_subject); 965 if (opts.balloon === null) { 966 opts.balloon = document.getElementById(opts.balloon_elem); 967 } 968 opts.balloon.innerHTML = ""; 969 if (opts.now_push_elem === self) { 970 opts.balloon.style.display = "none"; 971 opts.now_push_elem = null; 972 } else { 973 if(isIE.isBrowser === true && isIE.version < 8){ 974 selfY = self.offsetTop - 10; 975 selfX = self.offsetLeft; 976 obj = self; 977 while (obj = obj.offsetParent) { 978 selfX += obj.offsetLeft; 979 selfY += obj.offsetTop; 980 selfHeight += obj.offsetHeight; 981 } 982 } else if( isIE.isBrowser === true && isIE.version === 9){ 983 obj = self; 984 selfY = self.offsetTop - 10; 985 selfX = self.offsetLeft; 986 while (obj = obj.offsetParent) { 987 selfY += obj.offsetTop; 988 selfX += obj.offsetLeft; 989 } 990 } else { 991 selfX = self.offsetLeft; 992 selfY = self.offsetTop - 10; 993 if(self.offsetParent !== document.body){ 994 obj = self.offsetParent; 995 while(true){ 996 selfY += obj.offsetTop; 997 selfX += obj.offsetLeft; 998 if(obj.offsetParent === document.body){ 999 break; 1000 }else{ 1001 obj = obj.offsetParent; 1002 } 1003 } 1004 } 1005 1006 } 1007 selfHeight = self.offsetHeight; 1008 1009 element = document.createElement("div"); 1010 element.innerHTML = " <div id=\"" + opts.balloon_close_elem + "\">x</div>"; 1011 init_sns_list = this.opts.init_sns_list; 1012 sns_list = this.opts.sns_list; 1013 for (_i = 0, _len = bookmark_services.length; _i < _len; _i++) { 1014 key = bookmark_services[_i]; 1015 if (__indexOf.call(init_sns_list, key) >= 0) {} else { 1016 if(isIE.isBrowser === true && isIE.version < 8){ 1017 sns_obj = null; 1018 } else { 1019 sns_obj = this.sns_object(key, url, subject); 1020 } 1021 if (sns_obj != null) { 1022 element.appendChild(sns_obj); 1023 if (sns_list.hasOwnProperty(key) === true) { 1024 _obj = new sns_list[key](); 1025 _obj.reload_script(); 1026 } 1027 } 1028 } 1029 } 1030 opts.balloon.appendChild(element); 1031 opts.balloon.style.top = selfY + selfHeight + "px"; 1032 opts.balloon.style.left = selfX + "px"; 1033 opts.balloon_close = document.getElementById(opts.balloon_close_elem); 1034 this.balloon_timer(true); 1035 opts.balloon.style.display = "block"; 1036 opts.now_push_elem = self; 1037 opts.balloon_close.onclick = function() { 1038 _this.push_balloon_close(self); 1039 _this.balloon_timer(false); 1040 }; 1041 opts.balloon.onmouseout = function() { 1042 _this.balloon_timer(true); 1043 }; 1044 opts.balloon.onmouseover = function() { 1045 _this.balloon_timer(false); 1046 }; 1047 } 1048 }; 1049 1050 blBookmarks.prototype.push_balloon_close = function(self) { 1051 var balloon, opts, _this; 1052 opts = this.opts; 1053 _this = this; 1054 balloon = document.getElementById(opts.balloon_elem); 1055 balloon.innerHTML = ""; 1056 balloon.style.display = "none"; 1057 self.onclick = function() { 1058 _this.push_bookmark_button(self); 1059 }; 1060 }; 1061 1062 blBookmarks.prototype.bookmark_button = function() { 1063 var element, opts, self; 1064 self = this; 1065 opts = this.opts; 1066 element = document.createElement("div"); 1067 if(isIE.isBrowser === true && isIE.version < 8){ 1068 element.setAttribute("className", opts.bookmark_button_class); 1069 } else { 1070 element.setAttribute("class", opts.bookmark_button_class); 1071 } 1072 element.onclick = function() { 1073 self.push_bookmark_button(this); 1074 }; 1075 element.style.position = "relative"; 1076 // element.style.height = "80px"; 1077 element.innerHTML = "<img style=\"position:absolute; bottom:0;\" src=\"" + opts.bookmark_button_img + "\" alt=\"ããã¯ãã¼ã¯ãã¿ã³\">"; 1078 return element; 1079 }; 1080 1081 blBookmarks.prototype.appendBalloonBox = function() { 1082 var element, objBody, opts, balloon_elem; 1083 opts = this.opts; 1084 balloon_elem = opts.balloon_elem; 1085 element = document.getElementById(balloon_elem); 1086 if(!element){ 1087 element = document.createElement("div");
1088 element.id = balloon_elem; 1089 element.style.display = "none"; 1090 objBody = document.getElementsByTagName("body").item(0); 1091 objBody.appendChild(element); 1092 } 1093 }; 1094 1095 blBookmarks.prototype.get_class_list = function(tag, elem) { 1096 var class_list, element, elements, _i, _len; 1097 class_list = []; 1098 elements = document.getElementsByTagName(tag); 1099 for (_i = 0, _len = elements.length; _i < _len; _i++) { 1100 element = elements[_i]; 1101 if (element.className === elem) class_list.push(element); 1102 } 1103 return class_list; 1104 }; 1105 1106 return blBookmarks; 1107 1108 })();
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.