1<?php $pagestart=microtime(get_as_float);
2/*
3
4Kajukkk
5========
6Dokuwiki template Kajukk
7
8Another DokuWiki responsive template using Twitter Bootstrap & font awesome. Supports for togglable dark theme to save energy of mobile phone. Supports various plugins like disqus, shoturl, avatar and searchformgoto.
9
10 * @link     https://github.com/dryoo/dokuwiki-template-kajukkk
11 * @author   S.C. Yoo <dryoo@live.com>
12 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
13
14Related/supported plugins
15-------------------------
16  * Avatar      https://www.dokuwiki.org/plugin:avatar
17  * Disqus      https://www.dokuwiki.org/plugin:disqus
18  * Shorturl    https://www.dokuwiki.org/plugin:shorturl
19  * Searchformgoto      https://www.dokuwiki.org/plugin:searchformgoto
20
21
22References
23----------
24  * https://www.dokuwiki.org/devel:localization#template_localization
25  * http://getbootstrap.com/
26  * http://www.torrentreactor.net/
27
28*/
29
30if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
31@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
32
33header('X-UA-Compatible: IE=edge');
34
35// 애드센스처리
36if (($ACT=="show")||($ACT=="showtag")) $noadsense=false; else $noadsense=true;
37if (p_get_metadata($ID,"adult")) $noadsense=true;
38?>
39<!DOCTYPE HTML>
40<!--[if lt IE 9]>  <html class="ie"> <![endif]-->
41<!--[if gte IE 9]>  <html> <![endif]-->
42<!--[if !IE]><!-->
43<html lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js"> <!--<![endif]-->
44<head>
45    <meta charset="utf-8">
46    <title><?php echo (p_get_first_heading($ID))?p_get_first_heading($ID):strrchr(':'.$INFO['id'],":"); ?><?php if (strrchr(':'.$INFO['id'],":")!=":".$conf['start']) echo ' - '.p_get_first_heading(':'.$INFO['namespace'].':'.$conf['start']).' - '.strip_tags($conf['title']); else echo ' - '.strip_tags($conf['tagline']) ?></title>
47    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
48    <link href="<?php echo tpl_getMediaFile(array("bs/bootstrap.min.css")); ?>" rel="stylesheet">
49
50    <?php tpl_metaheaders() ?>
51    <meta name="description" content="<?php $_desc=p_get_metadata($ID,"description"); if ($_desc !=null) echo preg_replace( "/\r|\n/", "", mb_substr(htmlspecialchars(strip_tags($_desc['abstract'])),0,60,"utf-8")); ?>" >
52    <!-- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">-->
53
54	<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
55    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/v4-shims.css">
56
57    <meta name="viewport" content="width=device-width, initial-scale=1">
58    <meta http-equiv="X-UA-Compatible" content="IE=edge">
59    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
60    <?php tpl_includeFile('meta.html') ?>
61    <?php echo preg_replace( "/\r|\n/", "",tpl_getConf('google_analytics')); ?>
62    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
63    <!-- <script src="<?php echo tpl_getMediaFile(array("js/respond.min.js")); ?>" type="text/javascript"></script>-->
64    <!--[if lt IE 9]>
65      <script src="<?php echo tpl_getMediaFile(array("js/html5shiv.js")); ?>" type="text/javascript"></script>
66          <![endif]-->
67    <?php if (tpl_getConf('debug')): ?>
68<!-- <script async src="//developers.kakao.com/sdk/js/kakao.min.js"></script> -->
69
70
71    <?php endif;?>
72
73<?php if (($ACT!="edit")): ?>
74    <!-------------------------------자동 광고 -------------------------------->
75<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
76<script>
77     (adsbygoogle = window.adsbygoogle || []).push({
78          google_ad_client: "ca-pub-2592234474265189",
79          enable_page_level_ads: true
80     });
81</script>
82<!-------------------------------/자동 광고 -------------------------------->
83<?php endif;?>
84</head>
85<body class="<?php echo (get_doku_pref('dark', 0)==1)?'dark':''?>" >
86<div class="dokuwiki clearfix ">
87    <div id="sidebar_bg"></div>
88    <div id="nav_bg"></div>
89  	<nav id="dokuwiki__nav">
90    <!-- Nav page start-->
91       	    <?php //if (tpl_getConf('debug')) @include('shortcut.php') /* Shortcut */ ?>
92             <?php tpl_include_page(":nav", 1, 1) ?>
93    <!-- Nav page end-->
94    </nav>
95    <div id="dokuwiki__top" class="mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'showSidebar' : '';
96        ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>"  >
97
98        <?php tpl_flush(); ?>
99
100        <header class="titlebar nav-down clearfix">
101            <div class="btn_left" href=""><i class="fa fa-bars"></i></div>
102
103            <div class="btn_right" href="" style=""><i class="fa fa-info-circle"></i></div>
104            <a class="btn_titlebar  pull-left"   href="<?php echo DOKU_URL?>"><?php echo strip_tags($conf['title'])?></a>
105
106
107
108
109
110
111            <?php // mobile-alt tablet-alt laptop desktop ?>
112            <?php if (tpl_getConf('debug')): ?>
113            <a class="btn_titlebar pull-right" href="/tech/" style="">
114				<i class="fa fa-mobile-alt phone"></i>
115				<i class="fa fa-tablet-alt tablet"></i>
116				<i class="fa fa-laptop desktop"></i>
117				<i class="fa fa-desktop wide"></i>
118			 </a>
119            <a class="btn_titlebar pull-right" href="/med/" style=""><i class="fa fa-medkit"></i></a>
120            <a class="btn_titlebar pull-right" href="/game/" style=""><i class="fa fa-gamepad"></i></a>
121            <?php endif ?>
122						<?php if (!plugin_isdisabled('searchformgoto')) {
123				$searchformgoto = &plugin_load('helper','searchformgoto');
124				$searchformgoto->gotoform();
125				} else { tpl_searchform(); }
126			?>
127						 <?php  if(!plugin_isdisabled('randompage')) {?>
128                <a href="?do=randompage" class=" btn_titlebar " title="<?php echo tpl_getLang('randompage')?>"><i class="fa fa-random"></i></a>
129            <?php    }?>
130        </header>
131
132        <div class="core clearfix" >
133            <?php ds_html_msgarea(); /* occasional error and info messages */ ?>
134            <?php /* google adsense RESPONSIVE 윗쪽 */
135               if  (!$noadsense) echo preg_replace( "/\r|\n/", "",tpl_getConf('google_adsense')); ?>
136
137        <div id="dokuwiki__content">
138            <?php tpl_bs_breadcrumbs() ?>
139            <?php if ($ACT=="show") tpl_include_page(tpl_getConf('nsheader'),true,true);   /* page header */ ?>
140
141<?php if ((auth_quickaclcheck($ID) >= AUTH_EDIT)&&($ACT=="show")): ?>
142
143<div class="alert alert-info alert-dismissible" role="alert">
144  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
145  <strong><?php echo strip_tags($conf['tagline']) ?></strong><?php echo tpl_getLang('haspermeditpage');?>
146</div>
147<?php endif; ?>
148   <?php if(($ACT!="search"))tpl_button_a('edit','pencil','','editmain btn btn-danger pull-right  noprint ');?>
149            <!-- wikipage start -->
150            <?php  //  도쿠위키의 검색결과를 가로채서 구글 CSE ...출력
151                    // hijack dokuwiki search
152            if ($ACT=="search"&&tpl_getConf('debug')  ) {?>
153            <h1>"<?php echo noNS($ID); ?>"에 대한 검색 결과</h1>
154                    <script>
155                      (function() {
156                        var cx = '015553187907637026800:6qohwwzkdqo';
157                        var gcse = document.createElement('script');
158                        gcse.type = 'text/javascript';
159                        gcse.async = true;
160                        gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
161                            '//cse.google.com/cse.js?cx=' + cx;
162                        var s = document.getElementsByTagName('script')[0];
163                        s.parentNode.insertBefore(gcse, s);
164                      })();
165                    </script>
166                       <gcse:searchresults-only></gcse:searchresults-only>
167
168            <?php }
169                else
170                tpl_content(true); ?>
171            <!-- wikipage stop -->
172            <div class="clearer"></div>
173            <!-- Usage as a class -->
174
175            <?php /*Backlinks 참조문서 출력*/  if  ((ft_backlinks($ID)!=null) && (strrchr(':'.$INFO['id'],":")!=":".$conf['start']) &&  (($ACT=='edit') or ($ACT=='preview') or ($ACT=="show") ) ) print '<h2>'.$lang['btn_backlink'].'</h2>'.p_render('xhtml',p_get_instructions('{{backlinks>.}}'),$info);?>
176<?php /*
177            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
178            <!-- 일치하는 컨텐츠 -->
179            <ins class="adsbygoogle"
180                 style="display:block"
181                 data-ad-client="ca-pub-2592234474265189"
182                 data-ad-slot="6886466908"
183                 data-ad-format="autorelaxed"></ins>
184            <script>
185            (adsbygoogle = window.adsbygoogle || []).push({});
186            </script>
187    */?>
188
189            <?php if (tpl_getConf('debug')): ?>
190                      <?php /************** SNS *************/
191                        //$_url=rawurlencode(wl($ID,'',true));
192                        $_url=$sURL;
193                        $_title= p_get_metadata($ID,"title");
194                        $_tags=@implode(' #',p_get_metadata($ID, 'subject', METADATA_DONT_RENDER));
195                        $_tags=($_tags)?" #".$_tags:null;
196
197                        //$_txt= " $_title ".wl($ID,'',true)." #".strip_tags($conf['title']).$_tags;
198                        $_txt= " $_title ".$_url." #".strip_tags($conf['title']).$_tags;
199
200                      ?>
201            <!--          <div class="text-center noprint">
202                      <i class="fa fa-hand-o-right"></i>
203                      <a href="#" class="btn-circle btn-primary slideTextUp" onclick="sendsns('facebook','<?php echo $_url; ?>','txt');return false;" title="페북펌"><div><i class="fa fa-facebook"></i></div><div>페북푸기</div></a>
204                      <a href="#" class="btn-circle btn-info slideTextUp" onclick="sendsns('twitter','<?php //echo $_url; ?>','<?php echo $_txt;?>');return false;" title="트윗펌"><div><i class="fa fa-twitter"></i></div><div>트윗푸기</div></a>
205
206                      <a href="#" class="btn-circle btn-warning slideTextUp" onclick="sendsns('kakaotalk','<?php echo $_url; ?>','<?php echo $_txt;?>');return false;" title="카톡펌"><div>Kakao</div><div>카톡푸기</div></a>
207                    <a href="#" class="btn-circle btn-success slideTextUp" onclick="sendsns('band','<?php //echo $_url; ?>','<?php echo $_txt;?>');return false;" title="밴드펌"><div>Band</div><div>밴드푸기</div></a>
208                    <i class="fa fa-hand-o-left"></i>
209                    </div> -->
210            <?php endif; ?>
211            <?php /*미니문법설명*/ if (tpl_getConf('debug') && (($ACT=='edit')or ($ACT=='preview'))) print p_render('xhtml',p_get_instructions('
212^  **초미니 문법 설명**  (혹은 [[:syntax]]참조하세요)  ||||
213^강조| %%**굵게**%%| %%//기울임//%% | %%__밑줄__%%|
214^제목| ======제목1단계|=====제목2단계|====제목3단계 (뒤는 자동)|
215^목록| _*_  공백과 총알 한개 (점목록)|_-_ 공백과 빼기 (번호목록)||
216^연결| %%[[두개의 대괄호로 연결]]%%| %%URL%% 혹은 %%[[URL]]%%| %%[[URL|표시될 이름]]%%|
217^표| %%|셀 내용1|셀 내용2|%% | %%^제목내용1^제목내용2^%% |테이블 끝에 공백이 오면 안됩니다|
218'),$info);?>
219
220
221
222        <?php /* google adsense RESPONSIVE 아래 */
223          if  (!$noadsense) echo preg_replace( "/\r|\n/", "",tpl_getConf('google_adsense')); ?>
224
225            <?php if ($ACT=="show" ||$ACT=="edit"): ?>
226            <div class="noprint">
227                <?php   /* Short URL*/
228                    if (!plugin_isdisabled("shorturl") && (auth_quickaclcheck($ID) >= AUTH_READ) && ($INFO['exists'])):
229                        $shorturl = plugin_load('helper', 'shorturl');
230                        //$sURL= DOKU_URL.$shorturl->autoGenerateShortUrl($ID);
231                        print $shorturl->shorturlPrintLink($ID);
232                        ?>
233                <?php endif  /* Short URL*/?>
234            </div>
235            <?php endif?>
236
237
238            <?php   if (($ACT=="show")||($ACT=="edit")||($ACT=="preview")) tpl_license('badge', false, false, true); // license button, no wrapper ?>
239            <div class="docInfo text-muted">
240            <?php echo tpl_pagesize($ID) ?>
241            <?php tpl_pageinfo() ?>
242          <?php    $contributors =$INFO['meta']['contributor'];// p_get_metadata($ID, 'contributor' );
243      if ($contributors!=null)    {
244         //$contributors=array_unique(array_diff_assoc($contributors,array_unique($contributors)));
245         foreach(array_unique($contributors) as $userid=>$usernick){
246             if ( strtolower($userid)=="v_l" ||  strtolower($userid)=="vaslor" )
247             {
248                 //echo '<a href="https://plus.google.com/102990262307362184016?rel=author"  rel="publisher">'.$usernick.'</a> ';
249                  echo  '<a href="/user/'.$userid.'">'.$usernick.'</a> ';
250             } else
251             {
252                 echo  '<a href="/user/'.$userid.'">'.$usernick.'</a> ';
253             }
254
255
256         //    $_contributors.="[[:user:".$userid."|".$usernick."]]  "; // [[:user:id|name]]으로 링크형성
257         }
258
259        // print '<dt>작성자</dt><dd>'.p_render('xhtml',p_get_instructions($_contributors),$info).'</dd>';
260    }?>
261
262
263            </div>
264
265
266            <?php tpl_includeFile('pagefooter.html') ?>
267            <?php include('tpl_footer.php') ?>
268
269        <?php tpl_flush(); ?>
270
271    </div> <!-- dokuwiki__content -->
272            <?php  /* *************디스커즈 disqus************* */
273            if($ACT == 'show' &&  (strrchr(':'.$INFO['id'],":")!=":".$conf['start']) ){
274                $disqus = &plugin_load('syntax','disqus');
275                if($disqus) echo $disqus->_disqus('vln');
276            }
277            ?>
278     <script id="dsq-count-scr" src="//vln.disqus.com/count.js" async></script>
279
280    <!-- ********** sidebar ********** -->
281      <aside><div id="dokuwiki__aside" class="lsb sidebar">
282        <?php tpl_logo();?>     <div class="clearfix"></div>
283        <?php tpl_title();?>
284		<?php $today=':오늘:'.date("n월_j일");  if (page_exists($today)) {
285            echo "<div class='text-center'>";
286	       print p_render('xhtml',p_get_instructions('오늘은 [['.$today.']]'),$info);
287            echo "</div>";
288}
289?>
290        <div class="tools text-center">
291         <?php tpl_flush() ?>
292            <?php if ($INFO['userinfo']!=""): /* If logged-in */?>
293            <?php tpl_button_a('edit','pencil','','btn-info btn-circle slideTextUp');?>
294            <a href="#" class="btn-circle btn-danger slideTextUp" data-target="#myModal"  data-toggle="modal"     title="Add new page"><div><i class="fa fa-plus"></i></div><div><?php echo tpl_getLang('newpage')?></div></a>
295            <?php endif; ?>
296
297            <?php tpl_button_a('history','history','','btn-primary btn-circle slideTextUp');?>
298            <?php  if(!plugin_isdisabled('randompage')) {?>
299                <a href="?do=randompage" class="btn-circle btn-success slideTextUp" title="<?php echo tpl_getLang('randompage')?>"><div><i class="fa fa-random"></i></div><div><?php echo tpl_getLang('randompage')?></div></a>
300            <?php    }?>
301            <a href="#" class="btn-circle btn-danger slideTextUp lightsaving" onclick="tpl_toggleLight();return false;" title="<?php echo tpl_getLang('energysaving')?>"><div><i class="fa fa-lightbulb-o"></i></div><div><?php echo tpl_getLang('energysaving')?></div></a>
302
303            <?php tpl_button_a('login','sign-in','','btn-warning btn-circle slideTextUp');?>
304            <?php if ($INFO['userinfo']!=""): /* If logged-in */?>
305                 <?php tpl_button_a('media','image','','btn-primary btn-circle slideTextUp');?>
306                 <?php //tpl_button_a('backlink','link','','btn-primary btn-circle slideTextUp');?>
307                 <?php //tpl_button_a('subscribe','envelope','','btn-primary btn-circle slideTextUp');?>
308                 <?php //tpl_button_a('recent','spinner','','btn-primary btn-circle slideTextUp');?>
309                 <?php tpl_button_a('admin','cog','','btn-default btn-circle slideTextUp');?>
310            <?php endif; ?>
311    		<?php if (!plugin_isdisabled('move') && ($INFO['isadmin'])) {?>
312    				<a href="?do=admin&page=move_main" class="btn-circle btn-default slideTextUp" title="<?php echo tpl_getLang('movepage') ?>"><div><i class="fa fa-bolt"></i></div><div><?php echo tpl_getLang('movepage') ?></div></a>
313            <?php  }         ?>
314            <a href="#" class="btn-circle btn-danger slideTextUp" data-target="#helpModal"  data-toggle="modal" title="<?php echo tpl_getLang('help')?>"><div><i class="fa fa-question"></i></div><div><?php echo tpl_getLang('help')?></div></a>
315         </div>
316
317        <div class="content">
318            <?php tpl_includeFile('sidebarheader.html') ?>
319            <?php tpl_include_page($conf['sidebar'], 1, 1) /* Default Sidebar*/?>
320            <?php tpl_include_page(tpl_getConf('lsb'),1,1) /* Bottom Sidebar */ ?>
321            <?php tpl_includeFile('sidebarfooter.html') ?>
322        </div>
323    </div> </aside>
324                   </div> <!-- core -->
325	</div></div><!-- /.dokuwiki -->
326
327<aside>
328<!-- Modal -->
329<div class="modal fade noprint" id="helpModal" tabindex="-1" role="dialog" aria-labelledby="helpModalLabel" aria-hidden="true">
330  <div class="modal-dialog">
331    <div class="modal-content">
332      <div class="modal-header">
333        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
334        <h4 class="modal-title" id="helpModalLabel"><?php echo tpl_getLang('help')?></h4>
335
336
337      </div>
338      <div class="modal-body">
339       <?php tpl_include_page(tpl_getConf('help'),true,true);   /* help page  */ ?>
340
341      </div>
342      <div class="modal-footer">
343        <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $lang['js']['mediaclose'] ?></button>
344      </div>
345    </div>
346  </div>
347</div>
348
349
350
351
352<!-- NEW page Modal -->
353<div class="modal fade noprint" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
354  <div class="modal-dialog ">
355    <div class="modal-content">
356      <div class="modal-header ">
357        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
358        <h4 class="modal-title" id="myModalLabel"><?php echo tpl_getLang('createnewpage')?></h4>
359      </div>
360      <div class="modal-body">
361        <form class="uk-form-horizontal" action="<?php echo  tpl_basedir()?>newpage.php">
362          <input type="text" hidden name="DOKU_URL" value="<?php echo DOKU_URL?>">
363          <input type="text" hidden name="ns" value="<?php echo $INFO['namespace']?>">
364          <label class="label-control text-capitalize"><?php echo tpl_getLang('pagename')?></label><br>
365          <input class="form-control" id="newpageid" name="title" type="text" required placeholder="<?php echo tpl_getLang('pagename')?>">      <br>
366          <label class="label-control text-capitalize">선택하세요</label><br>
367          <?php //echo tpl_getLang('namespacedesc') ?>
368
369         <!-- <code>이름공간:페이지이름</code> 형식으로 입력함으로써 새 페이지가 특정한 이름공간에 위치하도록 할 수 있습니다. 아니면, 아래의 단추에서 고르세요. -->
370          <div class="radio">
371            <label>
372              <input type="radio"  name="do" value="root"  <?php echo ($INFO['namespace']=="")?"checked":""?>   >
373              <b>최상위(루트)</b>에 새 문서를 만듭니다.
374              <?php //echo tpl_getLang('namespacedesc1') ?>
375            </label>
376          </div>
377          <div class="radio">
378            <label>
379              <input type="radio" name="do" value="ns"  <?php echo ($INFO['namespace']=="")?"disabled":"checked"?>    >
380              <?php printf (tpl_getLang('namespacedesc2'),$INFO['namespace'] ) ?>
381            </label>
382          </div>
383          <?php if (tpl_getConf('debug')):?>
384             <div class="radio">
385            <label>
386              <input type="radio" name="do" value="namu"      >
387              <b>나무위키</b>의 문서를 변환한 뒤 편집합니다. (CC BY-NC-SA 2.0 Kr)
388              <?php //printf (tpl_getLang('namespacedesc2'),$INFO['namespace'] ) ?>
389            </label>
390          </div>        <!--
391           <div class="radio">
392            <label>
393              <input type="radio" name="do" value="enha"      >
394              <b>엔하위키미러</b>의 문서를 변환한 뒤 편집합니다. (CC BY-NC-SA 2.0 Kr)
395              <?php //printf (tpl_getLang('namespacedesc2'),$INFO['namespace'] ) ?>
396            </label>
397          </div>-->
398          <?php endif;?>
399          <div class="btn-group pull-right ">
400            <input type="submit" class="btn btn-primary " value="<?php echo $lang['btn_create'] ?>">
401            <button type="button" class="btn btn-warning" data-dismiss="modal"><?php echo $lang['btn_cancel']?></button>
402          </div>
403          <div class="clearfix"></div>
404          <input type="text" hidden name="back" value="<?php echo $ID?>">
405        </form>
406
407      </div>
408
409    </div>
410  </div>
411</div> <!--NEW page  Modal -->
412</aside>
413    <script  src="<?php echo tpl_getMediaFile(array("bs/bootstrap.min.js")); ?>" type="text/javascript"></script>
414<script>
415
416jQuery(document).ready(function()
417{
418	jQuery(".dokuwiki table").addClass( "table" );
419    <?php  if (($ACT=="edit")||($ACT=="preview")): /* 편집툴바 조작 */?>
420        jQuery("#tool__bar").addClass( "btn-group" );
421        jQuery(".dokuwiki .toolbutton").addClass( "btn btn-default btn-sm" );
422        jQuery(".dokuwiki .editButtons button").addClass( "btn btn-default" );
423        jQuery("#edbtn__save").addClass( "btn-primary");
424        jQuery("#edbtn__preview").addClass( "btn-success");
425    <?php endif ?>
426    <?php  if (($ACT=="login")): /* 로그인 조작 */?>
427        jQuery("#dw__login").addClass( "form-group" );
428        jQuery("#dw__login input.edit").addClass( "form-control" );
429        jQuery("#dw__login button").addClass( "btn btn-default btn-primary" );
430    <?php endif ?>
431    //jQuery(".tags span a").addClass( "badge" );
432    jQuery(".dokuwiki .secedit button").addClass("btn btn-default btn-xs pull-right");
433     /*   [CSS+Javascript] 간단한 Back to top 버튼 넣기   */
434     jQuery('body').append('<div id="toTop"><i class="fa fa-angle-double-up fa-2x"></i></div>');
435     jQuery("#toTop").bind("click", function () {window.open('#dokuwiki__top','_self',false);});
436     //jQuery("#toTop").bind("click", function () {jQuery("body").animate({ scrollTop: 0 }, 200);});
437
438     jQuery(window).scroll(function () {
439		if (jQuery(this).scrollTop() > 100) {
440				jQuery('#toTop').fadeIn();
441			} else {
442				jQuery('#toTop').fadeOut();
443			}
444		});    /*   http://blog.readiz.com/134  */
445});
446
447
448// Hide Header on on scroll down
449// http://jsfiddle.net/s6mLJ/9063/
450var didScroll;
451var lastScrollTop = 0;
452var delta = 5;
453var navbarHeight = jQuery('header').outerHeight();
454
455jQuery(window).scroll(function(event){
456    didScroll = true;
457});
458
459setInterval(function() {
460    if (didScroll) {
461        hasScrolled();
462        didScroll = false;
463    }
464}, 250);
465
466function hasScrolled() {
467    var st = jQuery(this).scrollTop();
468
469    // Make sure they scroll more than delta
470    if(Math.abs(lastScrollTop - st) <= delta)
471        return;
472
473    // If they scrolled down and are past the navbar, add class .nav-up.
474    // This is necessary so you never see what is "behind" the navbar.
475    if (st > lastScrollTop && st > navbarHeight){
476        // Scroll Down
477        jQuery('header').removeClass('nav-down').addClass('nav-up');
478    } else {
479        // Scroll Up
480        if(st + jQuery(window).height() < jQuery(document).height()) {
481            jQuery('header').removeClass('nav-up').addClass('nav-down');
482        }
483    }
484
485    lastScrollTop = st;
486}
487</script>
488 <?php if (tpl_getConf('debug')): ?>
489<!--<script async src="<?php echo tpl_getMediaFile(array("js/sendsns.js")); ?>" type="text/javascript"></script>    -->
490    <?php endif;?>
491<div id="spot-im-root"></div>
492<?php /* spot-im community widget */ //echo tpl_getConf('spot-im')?>
493
494<?php /* server processing time */ ?>
495
496<div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
497<div id="screen__mode" class="no"></div><?php /* helper to detect CSS media query in script.js */ ?>
498  <?php printf("<p class='text-center small text-muted noprint'>%.3f seconds in processing this page on this powerful server.</p>",(microtime(get_as_float)-$pagestart));?>
499</body>
500</html>
501