mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Delete resize_image addon -- please use Photoswipe instead
This commit is contained in:
parent
658ca421f4
commit
1f054af288
5 changed files with 0 additions and 350 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
|
|
@ -1,53 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<addon version="0.2">
|
|
||||||
<title xml:lang="ko">본문내 이미지 조절 애드온</title>
|
|
||||||
<title xml:lang="jp">本文内イメージリーサイズアドオン</title>
|
|
||||||
<title xml:lang="zh-CN">内容区图片缩放插件</title>
|
|
||||||
<title xml:lang="en">Image Resizer</title>
|
|
||||||
<title xml:lang="vi">Thay đổi cỡ hình ảnh</title>
|
|
||||||
<title xml:lang="es">Imagen de control add-on bonmunnae</title>
|
|
||||||
<title xml:lang="ru">Аддон редактирования размера картинки в тексте</title>
|
|
||||||
<title xml:lang="ge">Image-Add-on bonmunnae</title>
|
|
||||||
<title xml:lang="zh-TW">圖片縮放</title>
|
|
||||||
<description xml:lang="ko">
|
|
||||||
본문내에 삽입된 이미지의 크기를 본문크기에 맞게 하고 클릭시 원본을 보여주는 애드온입니다.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="jp">
|
|
||||||
本文内に挿入されたイメージのサイズを本文の幅サイズに合わせてリーサイズし、クリックした時、オリジナルサイズのイメージを表示します。
|
|
||||||
</description>
|
|
||||||
<description xml:lang="zh-CN">
|
|
||||||
自动调整主题内容区内的图片大小,点击将显示原始大小的插件。
|
|
||||||
</description>
|
|
||||||
<description xml:lang="vi">
|
|
||||||
Addon này sẽ lấy lại kích thước nguyên bản của hình ảnh trong bài viết hoặc bình luận khi bạn bấm vào hình.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="en">
|
|
||||||
This addon resizes images inserted in the article. When clicked, the original images are shown.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="es">
|
|
||||||
La imagen corporal se inserta dentro del cuerpo para que se adapte al tamaño de la muestra original cuando hago clic en los add-ons.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="ru">
|
|
||||||
Аддон, изменяющий размер картинки к размеру текста, при клике на картинку, появляется полное изображение.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="ge">
|
|
||||||
Body Bild eingefügt im Inneren des Körpers zu passen die Größe des Originals zeigen, wenn ich darauf klicke auf das Add-ons.
|
|
||||||
</description>
|
|
||||||
<description xml:lang="zh-TW">
|
|
||||||
自動調整文章内的圖片大小,點擊圖片後會顯示原始大小。
|
|
||||||
</description>
|
|
||||||
<version>RX_VERSION</version>
|
|
||||||
<date>RX_CORE</date>
|
|
||||||
|
|
||||||
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
|
|
||||||
<name xml:lang="ko">NAVER</name>
|
|
||||||
<name xml:lang="vi">NAVER</name>
|
|
||||||
<name xml:lang="jp">NAVER</name>
|
|
||||||
<name xml:lang="zh-CN">NAVER</name>
|
|
||||||
<name xml:lang="es">NAVER</name>
|
|
||||||
<name xml:lang="ge">NAVER</name>
|
|
||||||
<name xml:lang="ru">NAVER</name>
|
|
||||||
<name xml:lang="en">NAVER</name>
|
|
||||||
<name xml:lang="zh-TW">NAVER</name>
|
|
||||||
</author>
|
|
||||||
</addon>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
.rhymix_content, .xe_content img{max-width:100%;height:auto !important}
|
|
||||||
|
|
@ -1,268 +0,0 @@
|
||||||
/**
|
|
||||||
* @brief 화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경
|
|
||||||
**/
|
|
||||||
(function($){
|
|
||||||
|
|
||||||
var xScreen = null;
|
|
||||||
|
|
||||||
// 슬라이드를 위한 블랙 스크린을 만들거나 반환하는 함수
|
|
||||||
function getScreen() {
|
|
||||||
var body = $(document.body);
|
|
||||||
var controls, imgframe, closebtn, prevbtn, nextbtn;
|
|
||||||
// 스크린이 없으면 스크린을 만든다.
|
|
||||||
if (!xScreen) {
|
|
||||||
// 검은 스크린
|
|
||||||
xScreen = $("<div>")
|
|
||||||
.attr("id","xe_gallery_screen")
|
|
||||||
.css({
|
|
||||||
position:"fixed",
|
|
||||||
display:"none",
|
|
||||||
backgroundColor:"black",
|
|
||||||
zIndex:500,
|
|
||||||
opacity:0.7
|
|
||||||
});
|
|
||||||
|
|
||||||
// 이미지를 보여주고 컨트롤 버튼을 다룰 레이어
|
|
||||||
controls = $("<div>")
|
|
||||||
.attr("id","xe_gallery_controls")
|
|
||||||
.css({
|
|
||||||
position:"fixed",
|
|
||||||
display:"none",
|
|
||||||
overflow:"hidden",
|
|
||||||
zIndex:510
|
|
||||||
});
|
|
||||||
|
|
||||||
// 이전 버튼
|
|
||||||
prevbtn = $('<button type="button" id="xe_gallery_prevbtn" />')
|
|
||||||
.css({
|
|
||||||
left: "10px",
|
|
||||||
backgroundPosition: "0 -64px"
|
|
||||||
})
|
|
||||||
.click(function(){xScreen.xePrev()})
|
|
||||||
.appendTo(controls);
|
|
||||||
|
|
||||||
// 닫기 버튼
|
|
||||||
closebtn = $('<button type="button" id="xe_gallery_closebtn" />')
|
|
||||||
.css({
|
|
||||||
top: "10px",
|
|
||||||
backgroundPosition: "0 0"
|
|
||||||
})
|
|
||||||
.click(function(){xScreen.xeHide()})
|
|
||||||
.appendTo(controls);
|
|
||||||
|
|
||||||
// 다음 버튼
|
|
||||||
nextbtn = $('<button type="button" id="xe_gallery_nextbtn" />')
|
|
||||||
.attr("id", "xe_gallery_nextbtn")
|
|
||||||
.css({
|
|
||||||
right: "10px",
|
|
||||||
backgroundPosition: "0 -128px"
|
|
||||||
})
|
|
||||||
.click(function(){xScreen.xeNext()})
|
|
||||||
.appendTo(controls);
|
|
||||||
|
|
||||||
// 버튼 공통 속성
|
|
||||||
controls.find(">button")
|
|
||||||
.css({
|
|
||||||
position : "absolute",
|
|
||||||
width : "64px",
|
|
||||||
height : "64px",
|
|
||||||
zIndex : 530,
|
|
||||||
cursor : "pointer",
|
|
||||||
border : 0,
|
|
||||||
margin : 0,
|
|
||||||
padding : 0,
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
backgroundImage: "url(" + request_uri + "addons/resize_image/btn.png)",
|
|
||||||
backgroundRepeat: "no-repeat",
|
|
||||||
opacity: ".5",
|
|
||||||
filter: "alpha(opacity=50)"
|
|
||||||
})
|
|
||||||
.mouseover(function(){
|
|
||||||
$(this).css({
|
|
||||||
opacity: "1",
|
|
||||||
filter: "alpha(opacity=100)"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.mouseout(function(){
|
|
||||||
$(this).css({
|
|
||||||
opacity: ".5",
|
|
||||||
filter: "alpha(opacity=50)"
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.focus(function(){
|
|
||||||
$(this).trigger('mouseover');
|
|
||||||
})
|
|
||||||
.blur(function(){
|
|
||||||
$(this).trigger('mouseout');
|
|
||||||
})
|
|
||||||
;
|
|
||||||
|
|
||||||
// 이미지 홀더
|
|
||||||
imgframe = $(new Image());
|
|
||||||
imgframe
|
|
||||||
.attr("id", "xe_gallery_holder")
|
|
||||||
.css({
|
|
||||||
border: '5px solid white',
|
|
||||||
zindex: 520,
|
|
||||||
maxWidth: 'none',
|
|
||||||
borderRadius: '5px',
|
|
||||||
boxShadow: '0 0 10px #000'
|
|
||||||
})
|
|
||||||
.appendTo(controls).draggable();
|
|
||||||
|
|
||||||
body.append(xScreen).append(controls);
|
|
||||||
|
|
||||||
imgframe.bind('load', function(){
|
|
||||||
var clientWidth = $(window).width();
|
|
||||||
var clientHeight = $(window).height();
|
|
||||||
imgframe.css({
|
|
||||||
left : clientWidth/2 - imgframe.width()/2 + "px",
|
|
||||||
top : clientHeight/2 - imgframe.height()/2 + "px"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// xScreen 객체를 확장한다.
|
|
||||||
xScreen.xeShow = function() {
|
|
||||||
var clientWidth = $(window).width();
|
|
||||||
var clientHeight = $(window).height();
|
|
||||||
$("#xe_gallery_controls,#xe_gallery_screen").show().css({
|
|
||||||
top : 0,
|
|
||||||
right : 0,
|
|
||||||
bottom : 0,
|
|
||||||
left : 0
|
|
||||||
});
|
|
||||||
$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top", Math.round(clientHeight/2 - 32) + "px");
|
|
||||||
this.xeMove(0);
|
|
||||||
};
|
|
||||||
xScreen.xeHide = function(event) {
|
|
||||||
xScreen.hide();
|
|
||||||
controls.hide();
|
|
||||||
};
|
|
||||||
xScreen.xePrev = function() {
|
|
||||||
this.xeMove(-1);
|
|
||||||
};
|
|
||||||
xScreen.xeNext = function() {
|
|
||||||
this.xeMove(1);
|
|
||||||
};
|
|
||||||
xScreen.xeMove = function(val) {
|
|
||||||
var clientWidth = $(window).width();
|
|
||||||
var clientHeight = $(window).height();
|
|
||||||
this.index += val;
|
|
||||||
prevbtn.css("visibility", (this.index>0)?"visible":"hidden");
|
|
||||||
nextbtn.css("visibility", (this.index<this.list.size()-1)?"visible":"hidden");
|
|
||||||
//textyle 이미지 리사이즈 처리
|
|
||||||
var src = this.list.eq(this.index).attr("rawsrc");
|
|
||||||
if(!src) src = this.list.eq(this.index).attr("src");
|
|
||||||
|
|
||||||
imgframe.attr("src", src).removeAttr('width').removeAttr('height');
|
|
||||||
if(imgframe.width() > 0) {
|
|
||||||
imgframe.css({
|
|
||||||
left : clientWidth/2 - imgframe.width()/2 + "px",
|
|
||||||
top : clientHeight/2 - imgframe.height()/2 + "px"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
closebtn.css({
|
|
||||||
left : clientWidth/2 - 32 + "px",
|
|
||||||
top : "10px"
|
|
||||||
}).focus();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 스크린을 닫는 상황
|
|
||||||
$(document).keydown(function(e){
|
|
||||||
if(e.which == 27){
|
|
||||||
xScreen.xeHide();
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
controls = $("#xe_gallery_controls");
|
|
||||||
imgframe = $("#xe_gallery_holder");
|
|
||||||
closebtn = $("#xe_gallery_closebtn");
|
|
||||||
prevbtn = $("#xe_gallery_prevbtn");
|
|
||||||
nextbtn = $("#xe_gallery_nextbtn");
|
|
||||||
}
|
|
||||||
return xScreen;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이미지 슬라이드를 보는 함수
|
|
||||||
function slideshow(event) {
|
|
||||||
var container = $(this).closest('.rhymix_content, .xe_content');
|
|
||||||
var imglist = container.find("img[rel=xe_gallery]");
|
|
||||||
var currentIdx = $.inArray($(this).get(0), imglist.get());
|
|
||||||
var xScreen = getScreen();
|
|
||||||
|
|
||||||
// 스크린을 보여주고
|
|
||||||
xScreen.list = imglist;
|
|
||||||
xScreen.index = currentIdx;
|
|
||||||
xScreen.xeShow();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Window Load */
|
|
||||||
$(window).load(function(){
|
|
||||||
var regx_skip = /(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;
|
|
||||||
var regx_allow_i6pngfix = /(?:common\/tpl\/images\/blank\.gif$)/i;
|
|
||||||
/**
|
|
||||||
* 본문 폭 구하기 위한 개체
|
|
||||||
* IE6에서 본문폭을 넘는 이미지가 있으면 그 크기로 구해지는 문제 우회용
|
|
||||||
**/
|
|
||||||
var dummy = $('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 리사이즈 실행 함수
|
|
||||||
**/
|
|
||||||
function doResize(contentWidth, count) {
|
|
||||||
// 재시도 회수 제한
|
|
||||||
if(!count) count = 0;
|
|
||||||
if(count >= 10) return;
|
|
||||||
|
|
||||||
var $img = this;
|
|
||||||
var beforSize = {'width':$img.width(), 'height':$img.height()};
|
|
||||||
|
|
||||||
// 이미지 사이즈를 구하지 못했을 때 재시도
|
|
||||||
if(!beforSize.width || !beforSize.height) {
|
|
||||||
setTimeout(function() {
|
|
||||||
doResize.call($img, contentWidth, ++count)
|
|
||||||
}, 200);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 리사이즈 필요 없으면 리턴
|
|
||||||
if(beforSize.width <= contentWidth) return;
|
|
||||||
|
|
||||||
var resize_ratio = contentWidth / beforSize.width;
|
|
||||||
|
|
||||||
$img
|
|
||||||
.removeAttr('width').removeAttr('height')
|
|
||||||
.css({
|
|
||||||
'width':contentWidth,
|
|
||||||
'height':parseInt(beforSize.height * resize_ratio, 10)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.rhymix_content, .xe_content').each(function() {
|
|
||||||
var contentWidth = dummy.appendTo(this).width();
|
|
||||||
dummy.remove();
|
|
||||||
if(!contentWidth) return;
|
|
||||||
|
|
||||||
$('img', this).each(function() {
|
|
||||||
var $img = $(this);
|
|
||||||
var imgSrc = $img.attr('src');
|
|
||||||
if(regx_skip.test(imgSrc) && !regx_allow_i6pngfix.test(imgSrc)) return;
|
|
||||||
$img.attr('rel', 'xe_gallery');
|
|
||||||
doResize.call($img, contentWidth);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* live 이벤트로 적용 (image_gallery 컴포넌트와의 호환 위함) */
|
|
||||||
$(this).on('mouseover', 'img[rel=xe_gallery]', function() {
|
|
||||||
var $img = $(this);
|
|
||||||
if(!$img.parent('a').length && !$img.attr('onclick')) {
|
|
||||||
$img.css('cursor', 'pointer').click(slideshow);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
<?php
|
|
||||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
|
||||||
|
|
||||||
if(!defined('__XE__'))
|
|
||||||
{
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @file resize_image.addon.php
|
|
||||||
* @author NAVER (developers@xpressengine.com)
|
|
||||||
* @brief Add-on to resize images in the body
|
|
||||||
*/
|
|
||||||
if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler())
|
|
||||||
{
|
|
||||||
if(Mobile::isFromMobilePhone())
|
|
||||||
{
|
|
||||||
Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Context::loadJavascriptPlugin('ui');
|
|
||||||
Context::loadFile(array('./addons/resize_image/js/resize_image.js', 'body', '', null), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* End of file resize_image.addon.php */
|
|
||||||
/* Location: ./addons/resize_image/resize_image.addon.php */
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue