css 및 js 호출순서 조정기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2009-03-06 05:33:56 +00:00
parent 4f380d9c48
commit 61851f1dfe
2149 changed files with 109090 additions and 18689 deletions

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon version="0.2">
<title xml:lang="ko">위키 링크 애드온</title>
<title xml:lang="zh-CN">维基链接插件</title>
<title xml:lang="zh-TW">維基百科</title>
<title xml:lang="jp">wikiリンクアドオン</title>
<description xml:lang="ko">
위키 링크를 추가해주는 애드온.
</description>
<description xml:lang="zh-CN">
给维基模块添加链接的插件。
</description>
<description xml:lang="zh-TW">
維基百科控件。
</description>
<description xml:lang="jp">
wikiリンクを追加するアドオン
</description>
<version>0.1</version>
<date>2009-02-03</date>
<author email_address="haneul0318@gmail.com" link="http://blog.nzeo.com">
<name xml:lang="ko">haneul</name>
<name xml:lang="zh-CN">haneul</name>
<name xml:lang="zh-TW">haneul</name>
<name xml:lang="jp">haneul</name>
</author>
</addon>

View file

@ -0,0 +1,14 @@
<?php
if(!defined("__ZBXE__")) exit();
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC" && Context::get('act')=='dispWikiEditPage' ) {
$module_info = Context::get('module_info');
if(!$module_info->module) return;
if($module_info->module != 'wiki') return;
Context::loadJavascriptPlugin('hotkeys');
Context::addJsFile('./addons/wiki_link/wikilink.js');
Context::addCssFile('./addons/wiki_link/wikilink.css');
$footer = "<div id='link'> <div class='linkForm'>Link Target: <input type='text' id='linktarget' class='inputTypeText w100' /><a href='#' onclick='setText(); return false;'>AddLink</a></div></div>";
Context::addHtmlFooter($footer);
}
?>

View file

@ -0,0 +1,4 @@
#link { display: none; }
#link .linkForm { margin-left: 10px; margin-top: 10px; }
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 5px; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }

View file

@ -0,0 +1,45 @@
function openWikiLinkDialog()
{
var link = jQuery("#link");
link.css('display', 'block');
var target = xGetElementById('linktarget');
target.value = "";
try{
link.dialog({height:100});
}
catch(e)
{
link.dialog("open");
}
}
function setText() {
var target = xGetElementById('linktarget');
if(!target.value || target.value.trim() == '') return;
var text = target.value;
text.replace(/&/ig,'&amp;').replace(/</ig,'&lt;').replace(/>/ig,'&gt;');
var url = request_uri.setQuery('mid',current_mid).setQuery('entry',text);
var link = "<a href=\""+url+"\" ";
link += ">"+text+"</a>";
var iframe_obj = editorGetIFrame(1)
editorReplaceHTML(iframe_obj, link);
jQuery("#link").dialog("close");
}
function addShortCutForWiki()
{
var iframe_obj = editorGetIFrame(1);
if(jQuery.os.Mac)
{
jQuery(iframe_obj.contentWindow.document).bind('keydown', "ALT+SPACE", function(evt) { openWikiLinkDialog(); });
}
else
{
jQuery(iframe_obj.contentWindow.document).bind('keydown', "CTRL+SPACE", function(evt) { openWikiLinkDialog(); });
}
jQuery(document).bind('keydown',"CTRL+ALT+SPACE", function(evt) {} );
}
xAddEventListener(window, 'load', addShortCutForWiki);