b2r/chaikaã¹ãã³ã®smorgas-lego-exãã¤ã¡ã´ãã«å¯¾å¿ãããæ¹æ³ã®è¦æ¸2
以åsmorgas-lego-exの画像ポップアップをイメぴたに対応させる方法ãã¡ã¢ããããä¹
ãã¶ãã«smorgas-lego-exãæ´æ°ãããç»åãã¤ã³ã©ã¤ã³ã§åãè¾¼ãæ©è½ãä»ãã¦ããã®ã§ãåãè¾¼ã¿ç»åã®æ¹ãã¤ã¡ã´ãã«å¯¾å¿ãããã
ãªãã¡ã©ã«é¢ãã¦ã¯ååã®è¨äºã¨åãã
åãè¾¼ã¿ç»åã®URLèªèã¯general.jsãªã®ã§ããããæ¸ãæããããsmorgas-lego-ex 20100125ãã®å ´åã¯general.jsã®1009è¡ç®ã¨1010è¡ç®ã®éã«3è¡ã»ã©æ¿å
¥ï¼ã³ã¡ã³ãè¡ãé¤ãï¼ã
ãã¼ã¸ã§ã³ãå¤ãã£ãæã«ãæ¤ç´¢ãããããããã¡ãã£ã¨åå¾ãåºç¯å²ã«ã³ãããã¦ãããè¦ã¥ãããã©æ°ã«ããªãã
â»è¿½è¨ï¼ã¤ãã§ãªã®ã§ãåãè¾¼ãã 縮å°ç»åãã¯ãªãã¯ã§æ¡å¤§ãããå
ã«æ»ããããã«ãããæ¹æ³ã¯ã¡ãã£ã¨å¼·å¼ã ãã©ã
/** ç»åã»åç»ãã¤ã³ã©ã¤ã³è¡¨ç¤ºãã */ embedImage : function(contextNode, popup, noCheck) { var bodies = ResNodes.getBodies(contextNode, popup); var tmp_str, org_str; if (Alt_enableShowBeIcon) for (var i = 0, n = bodies.length; i < n; i++) { var e = bodies.items(i); tmp_str = org_str = e.innerHTML; tmp_str = tmp_str.replace(/sssp:\/\/(\S+)/, '<img src="http://$1">'); if (tmp_str != org_str) e.innerHTML = tmp_str; } var is_group = SkinPref.getBool("enableEmbedImageGroup", Alt_enableEmbedImageGroup); var f = OutlinkPopup.onMouseOver.bind(OutlinkPopup); var outLinkItems = ResNodes.getOutLinks(contextNode); for (var i = 0, n = outLinkItems.length; i < n; i++) { var node = outLinkItems.items(i); if (ImagePopup.isImage(node.href)) { if (!noCheck) { var is_gro = ImagePopup.isImageGrotesque(ResNodes.getIndexByBody(node.parentNode)); if (is_gro) continue; } // if (!node.nextSibling || node.nextSibling.className != "embed") { if (!node.getAttribute("is_embed")) { if (!Alt_enableEmbedImageWithPopup) node.setAttribute("no_popup", true); // ãããã¢ãããç¡å¹å // node.onmouseover = null; // ãããã¢ãããç¡å¹å var container = _doc.createElement("DIV"); container.className = (is_group) ? "embedLast" : "embedInline"; var img = _doc.createElement("IMG"); img.className = "embedImage"; /** â½ããããâ½ **/ /* ã¤ã¡ã´ãç»ååã込㿠*/ if(node.href.match(/(http:\/\/imepita\.jp)(\/\d{8}\/\d{6})/i)){ img.src = RegExp.$1 + '/image' + RegExp.$2 ; }else /** â³ããã¾ã§â³ **/ img.src = node.href; // img.addEventListener("error", function() { container.className = "embedError"; }, false); /** â½ããããâ½ **/ /* åãè¾¼ã¿ç»åãã¯ãªãã¯ã§æ¡å¤§/ç¸®å° */ img.setAttribute("onclick","if(this.className=='embedImage'){this.className='embedImageLarge';}else{this.className='embedImage';}"); // æ¡å¤§æã«ç»åãã¯ã¿åºããªãããã«ããããã°ãstyle-my.cssã«ä»¥ä¸ã®ä¸è¡ã追è¨ã // img.embedImageLarge { max-width:100%; } /** â³ããã¾ã§â³ **/ container.appendChild(img); if (is_group) { if (node.parentNode.lastChild.className != "embedGroup") { var box = _doc.createElement("DIV"); box.className = "embedGroup"; node.parentNode.appendChild(box); } node.parentNode.lastChild.appendChild(container); } else { node.parentNode.insertBefore(container, node.nextSibling); } node.setAttribute("is_embed", true); } } else { if (!node.getAttribute("is_embed")) { // if (!Alt_enableEmbedImageWithPopup) node.setAttribute("no_popup", true); // ãããã¢ãããç¡å¹å var e = VideoPopup.getElement(node.href, true); if (e) { var container = _doc.createElement("DIV"); container.className = (is_group) ? "embedLast" : "embedInline"; container.appendChild(e); if (is_group) { if (node.parentNode.lastChild.className != "embedGroup") { var box = _doc.createElement("DIV"); box.className = "embedGroup"; node.parentNode.appendChild(box); } node.parentNode.lastChild.appendChild(container); } else { node.parentNode.insertBefore(container, node.nextSibling); } node.setAttribute("is_embed", true); } } } } },