차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| tech:lightbox_in_dokuwiki [2014/05/14 08:30] – V_L | tech:lightbox_in_dokuwiki [2019/03/24 14:43] (현재) – V_L | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| + | {{tag> | ||
| + | ======도쿠위키에 라이트 박스 넣기 (Lightbox In Dokuwiki)====== | ||
| + | |||
| + | 도쿠위키에서는 그림을 마우스로 클릭하면 새 페이지가 열립니다. | ||
| + | |||
| + | 대신 그림을 확대 혹은 적절한 크기로 조절하여 **팝업**으로 보여주는 것이 **Lightbox** 이다. | ||
| + | |||
| + | 원래 이런 일을 해주는 플러긴이 있다. | ||
| + | <WRAP center round box 60%> | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | 그런데, 표시되는 모든 그림을 가로채기 때문에, **링크 버튼으로 사용할 때에도 | ||
| + | |||
| + | 그래서 , 직접 도쿠위키를 고쳐서 해보았다. | ||
| + | |||
| + | 관련 라이브러리는 이미 오픈소스 공개된 것들이 많이 있다. | ||
| + | |||
| + | 사용한 Lightbox 라이브러리는 | ||
| + | |||
| + | <WRAP center round box 60%> | ||
| + | http:// | ||
| + | </ | ||
| + | |||
| + | 이다. | ||
| + | |||
| + | 라이브러리의 사용법은 간단한다. | ||
| + | |||
| + | 파일을 받아서 적당히 설치 한 뒤.. (이 경우 **vaslor.net/ | ||
| + | **lightbox_plus.js** 파일에 실행 퍼미션을 주고.. | ||
| + | |||
| + | 스킨의 헤더에 자바스크립트 링크를 넣고, | ||
| + | |||
| + | < | ||
| + | |||
| + | 각 이미지의 링크에는 **rel=" | ||
| + | 혹은 그룹뷰 기능도 되도록 하려면, **rel=" | ||
| + | |||
| + | <code html> <a href=" | ||
| + | </ | ||
| + | |||
| + | 이미지 링크에 rel=" | ||
| + | |||
| + | 도쿠위키 설치된 곳의 **inc/ | ||
| + | |||
| + | 1176줄 정도되는 곳에 보면 **function internalmedia** 가 있다. | ||
| + | |||
| + | 한줄을 빼고 두 줄을 추가한다. | ||
| + | |||
| + | <code php> | ||
| + | function internalmedia ($src, $title=NULL, | ||
| + | $height=NULL, | ||
| + | global $ID; | ||
| + | list($src, | ||
| + | resolve_mediaid(getNS($ID), | ||
| + | |||
| + | $noLink = false; | ||
| + | $render = ($linking == ' | ||
| + | $link = $this-> | ||
| + | |||
| + | list($ext, | ||
| + | if(substr($mime, | ||
| + | // | ||
| + | | ||
| + | | ||
| + | |||
| + | }elseif($mime == ' | ||
| + | // don't link flash movies | ||
| + | $noLink = true; | ||
| + | }else{ | ||
| + | // add file icons | ||
| + | $class = preg_replace('/ | ||
| + | $link[' | ||
| + | $link[' | ||
| + | } | ||
| + | |||
| + | if($hash) $link[' | ||
| + | |||
| + | //markup non existing files | ||
| + | if (!$exists) { | ||
| + | $link[' | ||
| + | } | ||
| + | |||
| + | //output formatted | ||
| + | if ($linking == ' | ||
| + | else $this-> | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | 마찬가지로 외부 파일도 할 수 있다. 바로 다음에 있는 **function externalmedia**를 수정한다. | ||
| + | |||
| + | 한 줄만 추가한다. | ||
| + | |||
| + | <code php> | ||
| + | $height=NULL, | ||
| + | list($src, | ||
| + | $noLink = false; | ||
| + | $render = ($linking == ' | ||
| + | $link = $this-> | ||
| + | |||
| + | $link[' | ||
| + | |||
| + | list($ext, | ||
| + | if(substr($mime, | ||
| + | // link only jpeg images | ||
| + | // if ($ext != ' | ||
| + | | ||
| + | }elseif($mime == ' | ||
| + | // don't link flash movies | ||
| + | $noLink = true; | ||
| + | }else{ | ||
| + | // add file icons | ||
| + | $class = preg_replace('/ | ||
| + | $link[' | ||
| + | } | ||
| + | |||
| + | if($hash) $link[' | ||
| + | |||
| + | //output formatted | ||
| + | if ($linking == ' | ||
| + | else $this-> | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | 예쁘게 나오지 않는 것은 **CSS**가 제대로 먹지 않기 때문이다. | ||
| + | 사용하는 템플리트에 | ||
| + | |||
| + | <code css># | ||
| + | background-color: | ||
| + | padding: 10px; | ||
| + | border-bottom: | ||
| + | border-right: | ||
| + | } | ||
| + | # | ||
| + | color: #333; | ||
| + | background-color: | ||
| + | font-size: 90%; | ||
| + | text-align: center; | ||
| + | border-bottom: | ||
| + | border-right: | ||
| + | } | ||
| + | # | ||
| + | border: 1px solid white; | ||
| + | } | ||
| + | # | ||
| + | #overlay { | ||
| + | background-color: | ||
| + | opacity: 0.5; | ||
| + | } | ||
| + | * html # | ||
| + | * html #overlay { | ||
| + | background-color: | ||
| + | filter: Alpha(opacity=50); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | {{ http:// | ||
| + | {{image> | ||
| + | |||
| + | ALERT “Adora Belle” RC1 이후 갑자기 기본 템플릿에서 그림이 표시가 안되는 현상이 있었다. | ||
| + | |||
| + | basic.css 의 img 태그에 | ||
| + | |||
| + | --- // | ||
| + | |||
| + | * 출처: [[http:// | ||
| + | |||
| + | =====Gallery plugin===== | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | 라이트박스로 표시되길 원하는 그림의 링크에 '' | ||
| + | |||
| + | ^ 누구나 수정하실 수 있다. | ||
| + | |||