diff --git a/common/js/common.js b/common/js/common.js
index c24f1e1dc..907165384 100644
--- a/common/js/common.js
+++ b/common/js/common.js
@@ -9,13 +9,14 @@
**/
String.prototype.getQuery = function(key) {
var idx = this.indexOf('?');
- if(idx == -1) return;
+ if(idx == -1) return null;
var query_string = this.substr(idx+1, this.length);
var args = {}
query_string.replace(/([^=]+)=([^&]*)(&|$)/g, function() { args[arguments[1]] = arguments[2]; });
var q = args[key];
if(typeof(q)=="undefined") q = "";
+
return q;
}
diff --git a/common/js/tree_menu.js b/common/js/tree_menu.js
index a0355ed88..1b8f2e562 100644
--- a/common/js/tree_menu.js
+++ b/common/js/tree_menu.js
@@ -113,6 +113,7 @@ function drawTreeMenu(oXml, callback_func, resopnse_tags, null_func, param) {
if(manual_select_node_srl) manualSelectNode(menu_id, manual_select_node_srl);
}
+ return null;
}
// 페이지 랜더링 중에 메뉴의 html이 완성되었을때 window.onload event 후에 그리기 재시도를 하게 될 함수
diff --git a/common/js/x.js b/common/js/x.js
index 9429be894..dc2f90356 100644
--- a/common/js/x.js
+++ b/common/js/x.js
@@ -20,7 +20,7 @@ else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){
xIE6=xUA.indexOf('msie 6')!=-1;
}
else if(document.layers){xNN4=true;}
-xMac=xUA.indexOf('mac')!=-1;
+var xMac=xUA.indexOf('mac')!=-1;
// (element, event(without 'on'), event listener(function name)[, caption])
function xAddEventListener(e,eT,eL,cap)
@@ -313,7 +313,7 @@ function xHeight(e,h)
}
}
h-=(pt+pb+bt+bb);
- if(isNaN(h)||h<0) return;
+ if(isNaN(h)||h<0) return null;
else e.style.height=h+'px';
}
h=e.offsetHeight;
@@ -325,9 +325,10 @@ function xHeight(e,h)
return h;
}
-function xHex(n, digits, prefix)
+function xHex(sn, digits, prefix)
{
- var p = '', n = Math.ceil(n);
+ var p = '';
+ var n = Math.ceil(sn);
if (prefix) p = prefix;
n = n.toString(16);
for (var i=0; i < digits - n.length; ++i) {
@@ -449,18 +450,6 @@ function xParent(e, bNode)
return p;
}
-function xParentChain(e,delim,bNode)
-{
- if (!(e=xGetElementById(e))) return;
- var lim=100, s = "", d = delim || "\n";
- while(e) {
- s += xName(e) + ', ofsL:'+e.offsetLeft + ', ofsT:'+e.offsetTop + d;
- e = xParent(e,bNode);
- if (!lim--) break;
- }
- return s;
-}
-
function xPreventDefault(e)
{
if (e && e.preventDefault) e.preventDefault()
@@ -602,7 +591,7 @@ function xWidth(e,w)
}
}
w-=(pl+pr+bl+br);
- if(isNaN(w)||w<0) return;
+ if(isNaN(w)||w<0) return null;
else e.style.width=w+'px';
}
w=e.offsetWidth;
diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js
index 5161ffb6a..373646a58 100644
--- a/common/js/xml_handler.js
+++ b/common/js/xml_handler.js
@@ -38,10 +38,12 @@ function xml_response_filter(oXml, callback_func, response_tags, callback_func_a
var ret_obj = oXml.toZMsgObject(xmlDoc, response_tags);
if(ret_obj["error"]!=0) {
alert(ret_obj["message"]);
- return;
+ return null;
}
callback_func(ret_obj, response_tags, callback_func_arg, fo_obj);
+
+ return null;
}
// xml handler
diff --git a/common/js/xml_js_filter.js b/common/js/xml_js_filter.js
index 362285119..f92c628a4 100644
--- a/common/js/xml_js_filter.js
+++ b/common/js/xml_js_filter.js
@@ -188,6 +188,8 @@ function XmlJsFilterExecuteFilter(filter, value) {
return !isNaN(value);
break;
}
+
+ return null;
}
function XmlJsFilterAlertMsg(target, msg_code, minlength, maxlength) {
@@ -281,6 +283,8 @@ function XmlJsFilterProc(confirm_msg) {
return true;
}
exec_xml(this.module, this.act, params, this.user_func, response, params, this.fo_obj);
+
+ return null;
}
// form proc
diff --git a/modules/editor/components/poll/icon.gif b/modules/editor/components/poll/icon.gif
new file mode 100644
index 000000000..255d8fec5
Binary files /dev/null and b/modules/editor/components/poll/icon.gif differ
diff --git a/modules/editor/components/poll/info.xml b/modules/editor/components/poll/info.xml
new file mode 100644
index 000000000..cd723d840
--- /dev/null
+++ b/modules/editor/components/poll/info.xml
@@ -0,0 +1,8 @@
+
+
+ 설문조사 컴포넌트
+
+ 제로
+ 글 작성시에 설문조사를 첨부하실 수 있습니다. 설문조사 컴포넌트는 설문조사 모듈의 설정에 영향을 받습니다.
+
+
diff --git a/modules/editor/components/poll/lang/ko.lang.php b/modules/editor/components/poll/lang/ko.lang.php
new file mode 100644
index 000000000..206a3f156
--- /dev/null
+++ b/modules/editor/components/poll/lang/ko.lang.php
@@ -0,0 +1,16 @@
+
+ * @brief 위지윅에디터(editor) 모듈 > 설문조사 컴포넌트의 언어팩
+ **/
+
+ $lang->survey_title = "제목";
+ $lang->survey_item = "항목";
+ $lang->survey_stop_date = "종료 일자";
+ $lang->survey_chk_count = "선택항목 수";
+
+ $lang->cmd_add_survey = "설문 추가";
+ $lang->cmd_del_survey = "설문 제거";
+ $lang->cmd_add_item = "항목 추가";
+?>
diff --git a/modules/editor/components/poll/poll.class.php b/modules/editor/components/poll/poll.class.php
new file mode 100644
index 000000000..e8ed772c4
--- /dev/null
+++ b/modules/editor/components/poll/poll.class.php
@@ -0,0 +1,36 @@
+upload_target_srl = $upload_target_srl;
+ $this->component_path = $component_path;
+ }
+
+ /**
+ * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
+ **/
+ function getPopupContent() {
+ // 템플릿을 미리 컴파일해서 컴파일된 소스를 return
+ $tpl_path = $this->component_path.'tpl';
+ $tpl_file = 'popup.html';
+
+ require_once("./classes/template/TemplateHandler.class.php");
+ $oTemplate = new TemplateHandler();
+ return $oTemplate->compile($tpl_path, $tpl_file);
+ }
+
+ }
+?>
diff --git a/modules/editor/components/poll/tpl/popup.css b/modules/editor/components/poll/tpl/popup.css
new file mode 100644
index 000000000..91794b678
--- /dev/null
+++ b/modules/editor/components/poll/tpl/popup.css
@@ -0,0 +1,122 @@
+@charset "utf-8";
+
+.editor_window {
+ width:500px;
+ clear:both;
+}
+
+.editor_title {
+ font-size:10pt;
+ font-weight:bold;
+ clear:both;
+ height:20px;
+ background-color:#555555;
+ color:#EFEFEF;
+ vertical-align:middle;
+ padding-top:5px;
+ border-bottom:1px solid #000000;
+ text-align:center;
+}
+
+.survey_header {
+ border:1px solid #888888;
+ background-color:#EFEFEF;
+ margin:5px;
+ padding:5px;
+ font-weight:bold;
+}
+
+.survey_box {
+ border:1px solid #888888;
+ height:140px;
+ margin:5px;
+ padding:5px;
+}
+
+.title_box {
+ background-color:#EFEFEF;
+ border:1px solid #DDDDDD;
+ padding-top:4px;
+ height:22px;
+ clear:both;
+}
+
+.item_box {
+ height:22px;
+ clear:both;
+ padding-top:3px;
+ margin-bottom:3px;
+ border-bottom:1px solid #DDDDDD;
+}
+
+.header {
+ float:left;
+ width:60px;
+ clear:left;
+ text-align:left;
+ font-weight:bold;
+ font-size:9pt;
+ padding:2px 0px 0px 20px;
+ height:20px;
+}
+
+.sub_header {
+ float:left;
+ width:60px;
+ clear:left;
+ text-align:left;
+ font-size:9pt;
+ padding:2px 0px 0px 20px;
+ height:20px;
+}
+
+.body {
+ float:left;
+ text-align:left;
+ font-size:9pt;
+ height:20px;
+}
+
+.sub_button_area {
+ padding:3px 20px 3px 0px;
+ clear:both;
+ height:25px;
+}
+
+.sub_button_area div {
+ float:left;
+ padding-right:10px;
+ margin-right:10px;
+ height:20px;
+}
+
+.editor_input {
+ width:335px;
+ border:1px solid #AAAAAA;
+ font-size:9pt;
+ height:13px;
+}
+
+.editor_small_input {
+ width:50px;
+ border:1px solid #AAAAAA;
+ font-size:9pt;
+ height:13px;
+}
+
+
+.editor_button_area {
+ border-top:1px solid #AAAAAA;
+ text-align:center;
+ background-color:#EEEEEE;
+ padding:10px 0px 2px 0px;
+ clear:both;
+ height:25px;
+}
+
+.editor_button {
+ background-color:#FFFFFF;
+ border:1px solid #AAAAAA;
+ height:17px;
+ font-size:9pt;
+}
diff --git a/modules/editor/components/poll/tpl/popup.html b/modules/editor/components/poll/tpl/popup.html
new file mode 100644
index 000000000..bde8a546e
--- /dev/null
+++ b/modules/editor/components/poll/tpl/popup.html
@@ -0,0 +1,64 @@
+
+
+
+
diff --git a/modules/editor/components/poll/tpl/popup.js b/modules/editor/components/poll/tpl/popup.js
new file mode 100644
index 000000000..5e65b2710
--- /dev/null
+++ b/modules/editor/components/poll/tpl/popup.js
@@ -0,0 +1,103 @@
+/**
+ * popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
+ * 있으면 가져와서 원하는 곳에 삽입
+ **/
+var survey_index = 1;
+function setSurvey() {
+ var obj = xCreateElement("div");
+ var source = xGetElementById("survey_source");
+ xInnerHtml(obj, xInnerHtml(source));
+ obj.id = "survey_"+survey_index;
+ obj.className = "survey_box";
+ obj.style.display = "block";
+
+ source.parentNode.insertBefore(obj, source);
+}
+
+/**
+ * 부모창의 위지윅에디터에 데이터를 삽입
+ **/
+function insertSurvey() {
+ if(typeof(opener)=="undefined") return;
+
+ var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
+ opener.editorReplaceHTML(iframe_obj, link);
+
+ opener.focus();
+ window.close();
+}
+
+xAddEventListener(window, "load", setSurvey);
+
+/**
+ * 새 설문 추가
+ **/
+function doSurveyAdd() {
+ var obj = xCreateElement("div");
+ var source = xGetElementById("survey_source");
+ if(survey_index+1>3) return null;
+ survey_index++;
+ xInnerHtml(obj, xInnerHtml(source));
+ obj.id = "survey_"+survey_index;
+ obj.className = "survey_box";
+ obj.style.display = "block";
+
+ source.parentNode.insertBefore(obj, source);
+
+ setFixedPopupSize();
+
+ return null;
+}
+
+/**
+ * 항목 삭제
+ **/
+function doSurveyDelete(obj) {
+ var pobj = obj.parentNode.parentNode.parentNode;
+ var tmp_arr = pobj.id.split('_');
+ var index = tmp_arr[1];
+ if(index==1) return;
+
+ pobj.parentNode.removeChild(pobj);
+
+ var obj_list = xGetElementsByClassName('survey_box');
+ for(var i=0;i$/i,'');
- if(!html) return "";
-
return html;
}
diff --git a/modules/editor/tpl/js/uploader.js b/modules/editor/tpl/js/uploader.js
index 558b43662..bcff59dae 100755
--- a/modules/editor/tpl/js/uploader.js
+++ b/modules/editor/tpl/js/uploader.js
@@ -155,7 +155,6 @@ function editor_remove_file(upload_target_srl) {
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
- var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?act=procFileDelete&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl;
// iframe에 url을 보내버림
@@ -192,7 +191,6 @@ function editor_insert_file(upload_target_srl) {
var fo_obj = obj;
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value;
- var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?module=file&act=procFileDownload&file_srl="+file_srl+"&sid="+sid;
openComponent("url_link", upload_target_srl, url);
}