update smarteditor
This commit is contained in:
parent
3302649c3c
commit
6145459b5d
37 changed files with 6429 additions and 7953 deletions
|
|
@ -1,13 +1,11 @@
|
||||||
function get_editor_wr_content()
|
function get_editor_wr_content() {
|
||||||
{
|
return oEditors.getById['wr_content'].getIR();;
|
||||||
return oEditors.getById['wr_content'].getIR();;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function put_editor_wr_content(content)
|
function put_editor_wr_content(content) {
|
||||||
{
|
oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]);
|
||||||
oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]);
|
//oEditors.getById["wr_content"].exec("SET_IR", [""]);
|
||||||
//oEditors.getById["wr_content"].exec("SET_IR", [""]);
|
oEditors.getById["wr_content"].exec("PASTE_HTML", [content]);
|
||||||
oEditors.getById["wr_content"].exec("PASTE_HTML", [content]);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
bUseVerticalResizer: true,
|
bUseVerticalResizer: true,
|
||||||
bUseModeChanger: true,
|
bUseModeChanger: true,
|
||||||
bSkipXssFilter: true,
|
bSkipXssFilter: true,
|
||||||
aAdditionalFontList : editorAdditionalFontList,
|
aAdditionalFontList: editorAdditionalFontList,
|
||||||
fOnBeforeUnload: function () {
|
fOnBeforeUnload: function () {
|
||||||
// unload
|
// unload
|
||||||
}
|
}
|
||||||
|
|
@ -21,13 +21,13 @@
|
||||||
const extraFont = document.head.querySelector('#extra_font');
|
const extraFont = document.head.querySelector('#extra_font');
|
||||||
if (extraFont) {
|
if (extraFont) {
|
||||||
const fontStyle = extraFont.textContent || extraFont.innerText;
|
const fontStyle = extraFont.textContent || extraFont.innerText;
|
||||||
|
|
||||||
const editorDocument = oEditors.getById[get_id].getWYSIWYGDocument();
|
const editorDocument = oEditors.getById[get_id].getWYSIWYGDocument();
|
||||||
const editorHead = editorDocument.getElementsByTagName("head")[0];
|
const editorHead = editorDocument.getElementsByTagName("head")[0];
|
||||||
const editorStyle = editorDocument.createElement("style");
|
const editorStyle = editorDocument.createElement("style");
|
||||||
editorStyle.appendChild(editorDocument.createTextNode(fontStyle));
|
editorStyle.appendChild(editorDocument.createTextNode(fontStyle));
|
||||||
editorHead.appendChild(editorStyle);
|
editorHead.appendChild(editorStyle);
|
||||||
|
|
||||||
const iframes = document.getElementsByTagName('iframe');
|
const iframes = document.getElementsByTagName('iframe');
|
||||||
for (let i = 0; i < iframes.length; i++) {
|
for (let i = 0; i < iframes.length; i++) {
|
||||||
if (iframes[i].src.indexOf('SmartEditor2Skin.html') !== -1) {
|
if (iframes[i].src.indexOf('SmartEditor2Skin.html') !== -1) {
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ function editor_html($id, $content, $is_dhtml_editor = true)
|
||||||
|
|
||||||
if ($is_dhtml_editor && $js) {
|
if ($is_dhtml_editor && $js) {
|
||||||
$html .= "\n<script src=\"{$editor_url}/js/service/HuskyEZCreator.js\"></script>";
|
$html .= "\n<script src=\"{$editor_url}/js/service/HuskyEZCreator.js\"></script>";
|
||||||
$html .= "\n<script>let g5_editor_url = \"{$editor_url}\", oEditors = [], ed_nonce = \"{ft_nonce_create('smarteditor')}\";let editorAdditionalFontList = [";
|
$html .= "\n<script>var g5_editor_url = '" . $editor_url . "', oEditors = [], ed_nonce = '" . ft_nonce_create('smarteditor') . "', editorAdditionalFontList = [";
|
||||||
|
|
||||||
$sql = "SELECT * FROM {$g5['font_table']} ORDER BY font_name ASC";
|
$sql = "SELECT * FROM {$g5['font_table']} ORDER BY font_name ASC";
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
|
|
||||||
|
|
@ -44,10 +44,10 @@ function editor_html($id, $content, $is_dhtml_editor = true)
|
||||||
$addFontList[] = "['{$font_family}', '{$font_name}']";
|
$addFontList[] = "['{$font_family}', '{$font_name}']";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($addFontList) > 0) {
|
if (count($addFontList) > 0) {
|
||||||
$html .= implode(",", $addFontList);
|
$html .= implode(",", $addFontList);
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "];</script>";
|
$html .= "];</script>";
|
||||||
$html .= "\n<script src=\"{$editor_url}/config.js\"></script>";
|
$html .= "\n<script src=\"{$editor_url}/config.js\"></script>";
|
||||||
$html .= "\n<script>";
|
$html .= "\n<script>";
|
||||||
|
|
|
||||||
|
|
@ -15,137 +15,137 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined') window.nhn = {};
|
if (typeof window.nhn == 'undefined') window.nhn = {};
|
||||||
if (!nhn.husky) nhn.husky = {};
|
if (!nhn.husky) nhn.husky = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains application creation helper function, which would load up an HTML(Skin) file and then execute a specified create function.
|
* @fileOverview This file contains application creation helper function, which would load up an HTML(Skin) file and then execute a specified create function.
|
||||||
* @name HuskyEZCreator.js
|
* @name HuskyEZCreator.js
|
||||||
*/
|
*/
|
||||||
nhn.husky.EZCreator = new (function(){
|
nhn.husky.EZCreator = new (function () {
|
||||||
this.nBlockerCount = 0;
|
this.nBlockerCount = 0;
|
||||||
|
|
||||||
this.createInIFrame = function(htOptions){
|
this.createInIFrame = function (htOptions) {
|
||||||
if(arguments.length == 1){
|
if (arguments.length == 1) {
|
||||||
var oAppRef = htOptions.oAppRef;
|
var oAppRef = htOptions.oAppRef;
|
||||||
var elPlaceHolder = htOptions.elPlaceHolder;
|
var elPlaceHolder = htOptions.elPlaceHolder;
|
||||||
var sSkinURI = htOptions.sSkinURI;
|
var sSkinURI = htOptions.sSkinURI;
|
||||||
var fCreator = htOptions.fCreator;
|
var fCreator = htOptions.fCreator;
|
||||||
var fOnAppLoad = htOptions.fOnAppLoad;
|
var fOnAppLoad = htOptions.fOnAppLoad;
|
||||||
var bUseBlocker = htOptions.bUseBlocker;
|
var bUseBlocker = htOptions.bUseBlocker;
|
||||||
var htParams = htOptions.htParams || null;
|
var htParams = htOptions.htParams || null;
|
||||||
}else{
|
} else {
|
||||||
// for backward compatibility only
|
// for backward compatibility only
|
||||||
var oAppRef = arguments[0];
|
var oAppRef = arguments[0];
|
||||||
var elPlaceHolder = arguments[1];
|
var elPlaceHolder = arguments[1];
|
||||||
var sSkinURI = arguments[2];
|
var sSkinURI = arguments[2];
|
||||||
var fCreator = arguments[3];
|
var fCreator = arguments[3];
|
||||||
var fOnAppLoad = arguments[4];
|
var fOnAppLoad = arguments[4];
|
||||||
var bUseBlocker = arguments[5];
|
var bUseBlocker = arguments[5];
|
||||||
var htParams = arguments[6];
|
var htParams = arguments[6];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bUseBlocker) nhn.husky.EZCreator.showBlocker();
|
if (bUseBlocker) nhn.husky.EZCreator.showBlocker();
|
||||||
|
|
||||||
var attachEvent = function(elNode, sEvent, fHandler){
|
var attachEvent = function (elNode, sEvent, fHandler) {
|
||||||
if(elNode.addEventListener){
|
if (elNode.addEventListener) {
|
||||||
elNode.addEventListener(sEvent, fHandler, false);
|
elNode.addEventListener(sEvent, fHandler, false);
|
||||||
}else{
|
} else {
|
||||||
elNode.attachEvent("on"+sEvent, fHandler);
|
elNode.attachEvent("on" + sEvent, fHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!elPlaceHolder){
|
if (!elPlaceHolder) {
|
||||||
alert("Placeholder is required!");
|
alert("Placeholder is required!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(typeof(elPlaceHolder) != "object")
|
if (typeof (elPlaceHolder) != "object")
|
||||||
elPlaceHolder = document.getElementById(elPlaceHolder);
|
elPlaceHolder = document.getElementById(elPlaceHolder);
|
||||||
|
|
||||||
var elIFrame, nEditorWidth, nEditorHeight;
|
var elIFrame, nEditorWidth, nEditorHeight;
|
||||||
|
|
||||||
|
|
||||||
try{
|
|
||||||
elIFrame = document.createElement("<IFRAME frameborder=0 scrolling=no>");
|
|
||||||
}catch(e){
|
|
||||||
elIFrame = document.createElement("IFRAME");
|
|
||||||
elIFrame.setAttribute("frameborder", "0");
|
|
||||||
elIFrame.setAttribute("scrolling", "no");
|
|
||||||
}
|
|
||||||
|
|
||||||
elIFrame.style.width = "1px";
|
|
||||||
elIFrame.style.height = "1px";
|
|
||||||
elPlaceHolder.parentNode.insertBefore(elIFrame, elPlaceHolder.nextSibling);
|
|
||||||
|
|
||||||
attachEvent(elIFrame, "load", function(){
|
|
||||||
fCreator = elIFrame.contentWindow[fCreator] || elIFrame.contentWindow.createSEditor2;
|
|
||||||
|
|
||||||
// top.document.title = ((new Date())-window.STime);
|
|
||||||
// window.STime = new Date();
|
|
||||||
|
|
||||||
try{
|
|
||||||
|
|
||||||
nEditorWidth = elIFrame.contentWindow.document.body.scrollWidth || "500px";
|
|
||||||
nEditorHeight = elIFrame.contentWindow.document.body.scrollHeight + 12;
|
|
||||||
elIFrame.style.width = "100%";
|
|
||||||
elIFrame.style.height = nEditorHeight+ "px";
|
|
||||||
elIFrame.contentWindow.document.body.style.margin = "0";
|
|
||||||
}catch(e){
|
|
||||||
nhn.husky.EZCreator.hideBlocker(true);
|
|
||||||
elIFrame.style.border = "5px solid red";
|
|
||||||
elIFrame.style.width = "500px";
|
|
||||||
elIFrame.style.height = "500px";
|
|
||||||
alert("Failed to access "+sSkinURI);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var oApp = fCreator(elPlaceHolder, htParams); // oEditor
|
|
||||||
|
|
||||||
|
|
||||||
oApp.elPlaceHolder = elPlaceHolder;
|
try {
|
||||||
|
elIFrame = document.createElement("<IFRAME frameborder=0 scrolling=no>");
|
||||||
|
} catch (e) {
|
||||||
|
elIFrame = document.createElement("IFRAME");
|
||||||
|
elIFrame.setAttribute("frameborder", "0");
|
||||||
|
elIFrame.setAttribute("scrolling", "no");
|
||||||
|
}
|
||||||
|
|
||||||
oAppRef[oAppRef.length] = oApp;
|
elIFrame.style.width = "1px";
|
||||||
if(!oAppRef.getById) oAppRef.getById = {};
|
elIFrame.style.height = "1px";
|
||||||
|
elPlaceHolder.parentNode.insertBefore(elIFrame, elPlaceHolder.nextSibling);
|
||||||
if(elPlaceHolder.id) oAppRef.getById[elPlaceHolder.id] = oApp;
|
|
||||||
|
|
||||||
oApp.run({fnOnAppReady:fOnAppLoad});
|
attachEvent(elIFrame, "load", function () {
|
||||||
|
fCreator = elIFrame.contentWindow[fCreator] || elIFrame.contentWindow.createSEditor2;
|
||||||
// top.document.title += ", "+((new Date())-window.STime);
|
|
||||||
nhn.husky.EZCreator.hideBlocker();
|
|
||||||
});
|
|
||||||
// window.STime = new Date();
|
|
||||||
elIFrame.src = sSkinURI;
|
|
||||||
this.elIFrame = elIFrame;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.showBlocker = function(){
|
|
||||||
if(this.nBlockerCount<1){
|
|
||||||
var elBlocker = document.createElement("DIV");
|
|
||||||
elBlocker.style.position = "absolute";
|
|
||||||
elBlocker.style.top = 0;
|
|
||||||
elBlocker.style.left = 0;
|
|
||||||
elBlocker.style.backgroundColor = "#FFFFFF";
|
|
||||||
elBlocker.style.width = "100%";
|
|
||||||
|
|
||||||
document.body.appendChild(elBlocker);
|
// top.document.title = ((new Date())-window.STime);
|
||||||
|
// window.STime = new Date();
|
||||||
nhn.husky.EZCreator.elBlocker = elBlocker;
|
|
||||||
}
|
|
||||||
|
|
||||||
nhn.husky.EZCreator.elBlocker.style.height = Math.max(document.body.scrollHeight, document.body.clientHeight)+"px";
|
try {
|
||||||
|
|
||||||
this.nBlockerCount++;
|
nEditorWidth = elIFrame.contentWindow.document.body.scrollWidth || "500px";
|
||||||
};
|
nEditorHeight = elIFrame.contentWindow.document.body.scrollHeight + 12;
|
||||||
|
elIFrame.style.width = "100%";
|
||||||
this.hideBlocker = function(bForce){
|
elIFrame.style.height = nEditorHeight + "px";
|
||||||
if(!bForce){
|
elIFrame.contentWindow.document.body.style.margin = "0";
|
||||||
if(--this.nBlockerCount > 0) return;
|
} catch (e) {
|
||||||
}
|
nhn.husky.EZCreator.hideBlocker(true);
|
||||||
|
elIFrame.style.border = "5px solid red";
|
||||||
this.nBlockerCount = 0;
|
elIFrame.style.width = "500px";
|
||||||
|
elIFrame.style.height = "500px";
|
||||||
if(nhn.husky.EZCreator.elBlocker) nhn.husky.EZCreator.elBlocker.style.display = "none";
|
alert("Failed to access " + sSkinURI);
|
||||||
}
|
return;
|
||||||
})();
|
}
|
||||||
|
|
||||||
|
var oApp = fCreator(elPlaceHolder, htParams); // oEditor
|
||||||
|
|
||||||
|
|
||||||
|
oApp.elPlaceHolder = elPlaceHolder;
|
||||||
|
|
||||||
|
oAppRef[oAppRef.length] = oApp;
|
||||||
|
if (!oAppRef.getById) oAppRef.getById = {};
|
||||||
|
|
||||||
|
if (elPlaceHolder.id) oAppRef.getById[elPlaceHolder.id] = oApp;
|
||||||
|
|
||||||
|
oApp.run({ fnOnAppReady: fOnAppLoad });
|
||||||
|
|
||||||
|
// top.document.title += ", "+((new Date())-window.STime);
|
||||||
|
nhn.husky.EZCreator.hideBlocker();
|
||||||
|
});
|
||||||
|
// window.STime = new Date();
|
||||||
|
elIFrame.src = sSkinURI;
|
||||||
|
this.elIFrame = elIFrame;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.showBlocker = function () {
|
||||||
|
if (this.nBlockerCount < 1) {
|
||||||
|
var elBlocker = document.createElement("DIV");
|
||||||
|
elBlocker.style.position = "absolute";
|
||||||
|
elBlocker.style.top = 0;
|
||||||
|
elBlocker.style.left = 0;
|
||||||
|
elBlocker.style.backgroundColor = "#FFFFFF";
|
||||||
|
elBlocker.style.width = "100%";
|
||||||
|
|
||||||
|
document.body.appendChild(elBlocker);
|
||||||
|
|
||||||
|
nhn.husky.EZCreator.elBlocker = elBlocker;
|
||||||
|
}
|
||||||
|
|
||||||
|
nhn.husky.EZCreator.elBlocker.style.height = Math.max(document.body.scrollHeight, document.body.clientHeight) + "px";
|
||||||
|
|
||||||
|
this.nBlockerCount++;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.hideBlocker = function (bForce) {
|
||||||
|
if (!bForce) {
|
||||||
|
if (--this.nBlockerCount > 0) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.nBlockerCount = 0;
|
||||||
|
|
||||||
|
if (nhn.husky.EZCreator.elBlocker) nhn.husky.EZCreator.elBlocker.style.display = "none";
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
|
||||||
|
|
@ -15,112 +15,112 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
function createSEditor2(elIRField, htParams, elSeAppContainer){
|
function createSEditor2(elIRField, htParams, elSeAppContainer) {
|
||||||
if(!window.$Jindo){
|
if (!window.$Jindo) {
|
||||||
parent.document.body.innerHTML="진도 프레임웍이 필요합니다.<br>\n<a href='http://dev.naver.com/projects/jindo/download'>http://dev.naver.com/projects/jindo/download</a>에서 Jindo 1.5.3 버전의 jindo.min.js를 다운로드 받아 /js 폴더에 복사 해 주세요.\n(아직 Jindo 2 는 지원하지 않습니다.)";
|
parent.document.body.innerHTML = "진도 프레임웍이 필요합니다.<br>\n<a href='http://dev.naver.com/projects/jindo/download'>http://dev.naver.com/projects/jindo/download</a>에서 Jindo 1.5.3 버전의 jindo.min.js를 다운로드 받아 /js 폴더에 복사 해 주세요.\n(아직 Jindo 2 는 지원하지 않습니다.)";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var elAppContainer = (elSeAppContainer || jindo.$("smart_editor2"));
|
var elAppContainer = (elSeAppContainer || jindo.$("smart_editor2"));
|
||||||
var elEditingArea = jindo.$$.getSingle("DIV.husky_seditor_editing_area_container", elAppContainer);
|
var elEditingArea = jindo.$$.getSingle("DIV.husky_seditor_editing_area_container", elAppContainer);
|
||||||
var oWYSIWYGIFrame = jindo.$$.getSingle("IFRAME.se2_input_wysiwyg", elEditingArea);
|
var oWYSIWYGIFrame = jindo.$$.getSingle("IFRAME.se2_input_wysiwyg", elEditingArea);
|
||||||
var oIRTextarea = elIRField?elIRField:jindo.$$.getSingle("TEXTAREA.blind", elEditingArea);
|
var oIRTextarea = elIRField ? elIRField : jindo.$$.getSingle("TEXTAREA.blind", elEditingArea);
|
||||||
var oHTMLSrc = jindo.$$.getSingle("TEXTAREA.se2_input_htmlsrc", elEditingArea);
|
var oHTMLSrc = jindo.$$.getSingle("TEXTAREA.se2_input_htmlsrc", elEditingArea);
|
||||||
var oTextArea = jindo.$$.getSingle("TEXTAREA.se2_input_text", elEditingArea);
|
var oTextArea = jindo.$$.getSingle("TEXTAREA.se2_input_text", elEditingArea);
|
||||||
|
|
||||||
if(!htParams){
|
|
||||||
htParams = {};
|
|
||||||
htParams.fOnBeforeUnload = null;
|
|
||||||
}
|
|
||||||
htParams.elAppContainer = elAppContainer; // 에디터 UI 최상위 element 셋팅
|
|
||||||
htParams.oNavigator = jindo.$Agent().navigator(); // navigator 객체 셋팅
|
|
||||||
htParams.I18N_LOCALE = htParams.I18N_LOCALE || "ko_KR";
|
|
||||||
|
|
||||||
var oEditor = new nhn.husky.HuskyCore(htParams);
|
if (!htParams) {
|
||||||
oEditor.registerPlugin(new nhn.husky.CorePlugin(htParams?htParams.fOnAppLoad:null));
|
htParams = {};
|
||||||
oEditor.registerPlugin(new nhn.husky.StringConverterManager());
|
htParams.fOnBeforeUnload = null;
|
||||||
if(htParams.bSkipXssFilter !== true){
|
}
|
||||||
// 보안 필터링 플러그인 (TODO:소스분리 및 블랙리스트 옵션 추가)
|
htParams.elAppContainer = elAppContainer; // 에디터 UI 최상위 element 셋팅
|
||||||
oEditor.registerPlugin({
|
htParams.oNavigator = jindo.$Agent().navigator(); // navigator 객체 셋팅
|
||||||
_rxFilter:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*?>/gi,
|
htParams.I18N_LOCALE = htParams.I18N_LOCALE || "ko_KR";
|
||||||
$ON_REGISTER_CONVERTERS : function() {
|
|
||||||
var fXssFilter = jindo.$Fn(function(sHtml){
|
|
||||||
return sHtml.replace(this._rxFilter, "");
|
|
||||||
}, this).bind();
|
|
||||||
this.oApp.exec("ADD_CONVERTER",["HTMLSrc_TO_IR", fXssFilter]);
|
|
||||||
this.oApp.exec("ADD_CONVERTER",["IR_TO_DB", fXssFilter]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
var htDimension = {
|
var oEditor = new nhn.husky.HuskyCore(htParams);
|
||||||
nMinHeight:205,
|
oEditor.registerPlugin(new nhn.husky.CorePlugin(htParams ? htParams.fOnAppLoad : null));
|
||||||
nMinWidth:parseInt(elIRField.style.minWidth, 10)||570,
|
oEditor.registerPlugin(new nhn.husky.StringConverterManager());
|
||||||
nHeight:elIRField.style.height||elIRField.offsetHeight,
|
if (htParams.bSkipXssFilter !== true) {
|
||||||
nWidth:elIRField.style.width||elIRField.offsetWidth
|
// 보안 필터링 플러그인 (TODO:소스분리 및 블랙리스트 옵션 추가)
|
||||||
};
|
oEditor.registerPlugin({
|
||||||
|
_rxFilter: /<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*?>/gi,
|
||||||
var htConversionMode = {
|
$ON_REGISTER_CONVERTERS: function () {
|
||||||
bUseVerticalResizer : htParams.bUseVerticalResizer,
|
var fXssFilter = jindo.$Fn(function (sHtml) {
|
||||||
bUseModeChanger : htParams.bUseModeChanger
|
return sHtml.replace(this._rxFilter, "");
|
||||||
};
|
}, this).bind();
|
||||||
|
this.oApp.exec("ADD_CONVERTER", ["HTMLSrc_TO_IR", fXssFilter]);
|
||||||
var aAdditionalFontList = htParams.aAdditionalFontList;
|
this.oApp.exec("ADD_CONVERTER", ["IR_TO_DB", fXssFilter]);
|
||||||
|
}
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaManager("WYSIWYG", oIRTextarea, htDimension, htParams.fOnBeforeUnload, elAppContainer));
|
});
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_WYSIWYG(oWYSIWYGIFrame)); // Tab Editor 모드
|
}
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_HTMLSrc(oHTMLSrc)); // Tab HTML 모드
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_TEXT(oTextArea)); // Tab Text 모드
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_EditingModeChanger(elAppContainer, htConversionMode)); // 모드간 변경(Editor, HTML, Text)
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_PasteHandler()); // WYSIWYG Paste Handler
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.HuskyRangeManager(oWYSIWYGIFrame));
|
|
||||||
oEditor.registerPlugin(new nhn.husky.Utils());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_UtilPlugin());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyler());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_Toolbar(elAppContainer));
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.Hotkey()); // 단축키
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaVerticalResizer(elAppContainer, htConversionMode)); // 편집영역 리사이즈
|
|
||||||
oEditor.registerPlugin(new nhn.husky.DialogLayerManager());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.ActiveLayerManager());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyleGetter()); // 커서 위치 스타일 정보 가져오기
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("P")); // 엔터 시 처리, 현재는 P로 처리
|
var htDimension = {
|
||||||
|
nMinHeight: 205,
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_ColorPalette(elAppContainer)); // 색상 팔레트
|
nMinWidth: parseInt(elIRField.style.minWidth, 10) || 570,
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontColor(elAppContainer)); // 글자색
|
nHeight: elIRField.style.height || elIRField.offsetHeight,
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_BGColor(elAppContainer)); // 글자배경색
|
nWidth: elIRField.style.width || elIRField.offsetWidth
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontNameWithLayerUI(elAppContainer, aAdditionalFontList)); // 글꼴종류
|
};
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontSizeWithLayerUI(elAppContainer)); // 글꼴크기
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_LineStyler());
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_ExecCommand(oWYSIWYGIFrame));
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_LineHeightWithLayerUI(elAppContainer)); // 줄간격
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_Quote(elAppContainer)); // 인용구
|
var htConversionMode = {
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_Hyperlink(elAppContainer)); // 링크
|
bUseVerticalResizer: htParams.bUseVerticalResizer,
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_SCharacter(elAppContainer)); // 특수문자
|
bUseModeChanger: htParams.bUseModeChanger
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_FindReplacePlugin(elAppContainer)); // 찾기/바꾸기
|
};
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableCreator(elAppContainer)); // 테이블 생성
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableEditor(elAppContainer)); // 테이블 편집
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableBlockStyler(elAppContainer)); // 테이블 스타일
|
|
||||||
if(nhn.husky.SE2M_AttachQuickPhoto){
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_AttachQuickPhoto(elAppContainer)); // 사진
|
|
||||||
}
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.MessageManager(oMessageMap, htParams.I18N_LOCALE));
|
var aAdditionalFontList = htParams.aAdditionalFontList;
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_QuickEditor_Common(elAppContainer)); // 퀵에디터 공통(표, 이미지)
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2B_CSSLoader()); // CSS lazy load
|
|
||||||
if(window.frameElement){
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_OuterIFrameControl(elAppContainer, 100));
|
|
||||||
}
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE_ToolbarToggler(elAppContainer, htParams.bUseToolbar));
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2M_Accessibility(elAppContainer, htParams.I18N_LOCALE)); // 에디터내의 웹접근성 관련 기능모음 플러그인
|
|
||||||
|
|
||||||
oEditor.registerPlugin(new nhn.husky.SE2B_Customize_ToolBar(elAppContainer)); // 2.3 버젼에 있는 툴바 이용
|
|
||||||
|
|
||||||
return oEditor;
|
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaManager("WYSIWYG", oIRTextarea, htDimension, htParams.fOnBeforeUnload, elAppContainer));
|
||||||
}
|
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_WYSIWYG(oWYSIWYGIFrame)); // Tab Editor 모드
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_HTMLSrc(oHTMLSrc)); // Tab HTML 모드
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_TEXT(oTextArea)); // Tab Text 모드
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_EditingModeChanger(elAppContainer, htConversionMode)); // 모드간 변경(Editor, HTML, Text)
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_PasteHandler()); // WYSIWYG Paste Handler
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.HuskyRangeManager(oWYSIWYGIFrame));
|
||||||
|
oEditor.registerPlugin(new nhn.husky.Utils());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_UtilPlugin());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyler());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_Toolbar(elAppContainer));
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.Hotkey()); // 단축키
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaVerticalResizer(elAppContainer, htConversionMode)); // 편집영역 리사이즈
|
||||||
|
oEditor.registerPlugin(new nhn.husky.DialogLayerManager());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.ActiveLayerManager());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyleGetter()); // 커서 위치 스타일 정보 가져오기
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("P")); // 엔터 시 처리, 현재는 P로 처리
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_ColorPalette(elAppContainer)); // 색상 팔레트
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_FontColor(elAppContainer)); // 글자색
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_BGColor(elAppContainer)); // 글자배경색
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_FontNameWithLayerUI(elAppContainer, aAdditionalFontList)); // 글꼴종류
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_FontSizeWithLayerUI(elAppContainer)); // 글꼴크기
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_LineStyler());
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_ExecCommand(oWYSIWYGIFrame));
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_LineHeightWithLayerUI(elAppContainer)); // 줄간격
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_Quote(elAppContainer)); // 인용구
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_Hyperlink(elAppContainer)); // 링크
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_SCharacter(elAppContainer)); // 특수문자
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_FindReplacePlugin(elAppContainer)); // 찾기/바꾸기
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_TableCreator(elAppContainer)); // 테이블 생성
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_TableEditor(elAppContainer)); // 테이블 편집
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_TableBlockStyler(elAppContainer)); // 테이블 스타일
|
||||||
|
if (nhn.husky.SE2M_AttachQuickPhoto) {
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_AttachQuickPhoto(elAppContainer)); // 사진
|
||||||
|
}
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.MessageManager(oMessageMap, htParams.I18N_LOCALE));
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_QuickEditor_Common(elAppContainer)); // 퀵에디터 공통(표, 이미지)
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2B_CSSLoader()); // CSS lazy load
|
||||||
|
if (window.frameElement) {
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_OuterIFrameControl(elAppContainer, 100));
|
||||||
|
}
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE_ToolbarToggler(elAppContainer, htParams.bUseToolbar));
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2M_Accessibility(elAppContainer, htParams.I18N_LOCALE)); // 에디터내의 웹접근성 관련 기능모음 플러그인
|
||||||
|
|
||||||
|
oEditor.registerPlugin(new nhn.husky.SE2B_Customize_ToolBar(elAppContainer)); // 2.3 버젼에 있는 툴바 이용
|
||||||
|
|
||||||
|
return oEditor;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,17 @@ nhn.husky.SE2M_Configuration = nhn.husky.SE2M_Configuration || {};
|
||||||
* CSS LazyLoad를 위한 경로
|
* CSS LazyLoad를 위한 경로
|
||||||
*/
|
*/
|
||||||
nhn.husky.SE2M_Configuration.SE2B_CSSLoader = {
|
nhn.husky.SE2M_Configuration.SE2B_CSSLoader = {
|
||||||
sCSSBaseURI : "css"
|
sCSSBaseURI: "css"
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 편집영역 설정
|
* 편집영역 설정
|
||||||
*/
|
*/
|
||||||
nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
|
nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
|
||||||
sCSSBaseURI : "css", // smart_editor2_inputarea.html 파일의 상대경로
|
sCSSBaseURI: "css", // smart_editor2_inputarea.html 파일의 상대경로
|
||||||
sBlankPageURL : "smart_editor2_inputarea.html",
|
sBlankPageURL: "smart_editor2_inputarea.html",
|
||||||
sBlankPageURL_EmulateIE7 : "smart_editor2_inputarea_ie8.html",
|
sBlankPageURL_EmulateIE7: "smart_editor2_inputarea_ie8.html",
|
||||||
aAddtionalEmulateIE7 : [] // IE8 default 사용, IE9 ~ 선택적 사용
|
aAddtionalEmulateIE7: [] // IE8 default 사용, IE9 ~ 선택적 사용
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,119 +49,119 @@ nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
|
||||||
* sTitleElementId : 제목에 해당하는 input 요소의 id.
|
* sTitleElementId : 제목에 해당하는 input 요소의 id.
|
||||||
*/
|
*/
|
||||||
nhn.husky.SE2M_Configuration.SE2M_Accessibility = {
|
nhn.husky.SE2M_Configuration.SE2M_Accessibility = {
|
||||||
ed_nonce : (typeof parent.ed_nonce !='undefined') ? parent.ed_nonce : '',
|
ed_nonce: (typeof parent.ed_nonce != 'undefined') ? parent.ed_nonce : '',
|
||||||
sBeforeElementId : '',
|
sBeforeElementId: '',
|
||||||
sNextElementId : '',
|
sNextElementId: '',
|
||||||
sTitleElementId : ''
|
sTitleElementId: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 링크 기능 옵션
|
* 링크 기능 옵션
|
||||||
*/
|
*/
|
||||||
nhn.husky.SE2M_Configuration.SE2M_Hyperlink = {
|
nhn.husky.SE2M_Configuration.SE2M_Hyperlink = {
|
||||||
bAutolink : true // 자동링크기능 사용여부(기본값:true)
|
bAutolink: true // 자동링크기능 사용여부(기본값:true)
|
||||||
};
|
};
|
||||||
|
|
||||||
nhn.husky.SE2M_Configuration.Quote = {
|
nhn.husky.SE2M_Configuration.Quote = {
|
||||||
sImageBaseURL : 'http://static.se2.naver.com/static/img'
|
sImageBaseURL: 'http://static.se2.naver.com/static/img'
|
||||||
};
|
};
|
||||||
|
|
||||||
nhn.husky.SE2M_Configuration.SE2M_ColorPalette = {
|
nhn.husky.SE2M_Configuration.SE2M_ColorPalette = {
|
||||||
bUseRecentColor : false
|
bUseRecentColor: false
|
||||||
};
|
};
|
||||||
|
|
||||||
nhn.husky.SE2B_Customize_ToolBar = jindo.$Class(/** @lends nhn.husky.SE2B_Customize_ToolBar */{
|
nhn.husky.SE2B_Customize_ToolBar = jindo.$Class(/** @lends nhn.husky.SE2B_Customize_ToolBar */{
|
||||||
name : "SE2B_Customize_ToolBar",
|
name: "SE2B_Customize_ToolBar",
|
||||||
/**
|
/**
|
||||||
* @constructs
|
* @constructs
|
||||||
* @param {Object} oAppContainer 에디터를 구성하는 컨테이너
|
* @param {Object} oAppContainer 에디터를 구성하는 컨테이너
|
||||||
*/
|
*/
|
||||||
$init : function(oAppContainer) {
|
$init: function (oAppContainer) {
|
||||||
this._assignHTMLElements(oAppContainer);
|
this._assignHTMLElements(oAppContainer);
|
||||||
},
|
},
|
||||||
$BEFORE_MSG_APP_READY : function(){
|
$BEFORE_MSG_APP_READY: function () {
|
||||||
this._addEventMoreButton();
|
this._addEventMoreButton();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @description DOM엘리먼트를 수집하는 메소드
|
|
||||||
* @param {Object} oAppContainer 툴바 포함 에디터를 감싸고 있는 div 엘리먼트
|
|
||||||
*/
|
|
||||||
_assignHTMLElements : function(oAppContainer) {
|
|
||||||
this.oAppContainer = oAppContainer;
|
|
||||||
this.elTextToolBarArea = jindo.$$.getSingle("div.se2_tool");
|
|
||||||
this.elTextMoreButton = jindo.$$.getSingle("button.se2_text_tool_more", this.elTextToolBarArea);
|
|
||||||
this.elTextMoreButtonParent = this.elTextMoreButton.parentNode;
|
|
||||||
this.welTextMoreButtonParent = jindo.$Element(this.elTextMoreButtonParent);
|
|
||||||
this.elMoreLayer = jindo.$$.getSingle("div.se2_sub_text_tool");
|
|
||||||
},
|
|
||||||
|
|
||||||
_addEventMoreButton : function (){
|
/**
|
||||||
this.oApp.registerBrowserEvent(this.elTextMoreButton, "click", "EVENT_CLICK_EXPAND_VIEW");
|
* @private
|
||||||
this.oApp.registerBrowserEvent(this.elMoreLayer, "click", "EVENT_CLICK_EXPAND_VIEW");
|
* @description DOM엘리먼트를 수집하는 메소드
|
||||||
},
|
* @param {Object} oAppContainer 툴바 포함 에디터를 감싸고 있는 div 엘리먼트
|
||||||
|
*/
|
||||||
$ON_EVENT_CLICK_EXPAND_VIEW : function(weEvent){
|
_assignHTMLElements: function (oAppContainer) {
|
||||||
this.oApp.exec("TOGGLE_EXPAND_VIEW", [this.elTextMoreButton]);
|
this.oAppContainer = oAppContainer;
|
||||||
weEvent.stop();
|
this.elTextToolBarArea = jindo.$$.getSingle("div.se2_tool");
|
||||||
},
|
this.elTextMoreButton = jindo.$$.getSingle("button.se2_text_tool_more", this.elTextToolBarArea);
|
||||||
|
this.elTextMoreButtonParent = this.elTextMoreButton.parentNode;
|
||||||
$ON_TOGGLE_EXPAND_VIEW : function(){
|
this.welTextMoreButtonParent = jindo.$Element(this.elTextMoreButtonParent);
|
||||||
if(!this.welTextMoreButtonParent.hasClass("active")){
|
this.elMoreLayer = jindo.$$.getSingle("div.se2_sub_text_tool");
|
||||||
this.oApp.exec("SHOW_EXPAND_VIEW");
|
},
|
||||||
} else {
|
|
||||||
this.oApp.exec("HIDE_EXPAND_VIEW");
|
_addEventMoreButton: function () {
|
||||||
}
|
this.oApp.registerBrowserEvent(this.elTextMoreButton, "click", "EVENT_CLICK_EXPAND_VIEW");
|
||||||
},
|
this.oApp.registerBrowserEvent(this.elMoreLayer, "click", "EVENT_CLICK_EXPAND_VIEW");
|
||||||
|
},
|
||||||
$ON_CHANGE_EDITING_MODE : function(sMode){
|
|
||||||
if(sMode != "WYSIWYG"){
|
$ON_EVENT_CLICK_EXPAND_VIEW: function (weEvent) {
|
||||||
this.elTextMoreButton.disabled =true;
|
this.oApp.exec("TOGGLE_EXPAND_VIEW", [this.elTextMoreButton]);
|
||||||
this.welTextMoreButtonParent.removeClass("active");
|
weEvent.stop();
|
||||||
this.oApp.exec("HIDE_EXPAND_VIEW");
|
},
|
||||||
}else{
|
|
||||||
this.elTextMoreButton.disabled =false;
|
$ON_TOGGLE_EXPAND_VIEW: function () {
|
||||||
}
|
if (!this.welTextMoreButtonParent.hasClass("active")) {
|
||||||
},
|
this.oApp.exec("SHOW_EXPAND_VIEW");
|
||||||
|
} else {
|
||||||
$AFTER_SHOW_ACTIVE_LAYER : function(){
|
this.oApp.exec("HIDE_EXPAND_VIEW");
|
||||||
this.oApp.exec("HIDE_EXPAND_VIEW");
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
$AFTER_SHOW_DIALOG_LAYER : function(){
|
$ON_CHANGE_EDITING_MODE: function (sMode) {
|
||||||
this.oApp.exec("HIDE_EXPAND_VIEW");
|
if (sMode != "WYSIWYG") {
|
||||||
},
|
this.elTextMoreButton.disabled = true;
|
||||||
|
this.welTextMoreButtonParent.removeClass("active");
|
||||||
$ON_SHOW_EXPAND_VIEW : function(){
|
this.oApp.exec("HIDE_EXPAND_VIEW");
|
||||||
this.welTextMoreButtonParent.addClass("active");
|
} else {
|
||||||
this.elMoreLayer.style.display = "block";
|
this.elTextMoreButton.disabled = false;
|
||||||
},
|
}
|
||||||
|
},
|
||||||
$ON_HIDE_EXPAND_VIEW : function(){
|
|
||||||
this.welTextMoreButtonParent.removeClass("active");
|
$AFTER_SHOW_ACTIVE_LAYER: function () {
|
||||||
this.elMoreLayer.style.display = "none";
|
this.oApp.exec("HIDE_EXPAND_VIEW");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
$AFTER_SHOW_DIALOG_LAYER: function () {
|
||||||
* CHANGE_EDITING_MODE모드 이후에 호출되어야 함.
|
this.oApp.exec("HIDE_EXPAND_VIEW");
|
||||||
* WYSIWYG 모드가 활성화되기 전에 호출이 되면 APPLY_FONTCOLOR에서 에러 발생.
|
},
|
||||||
*/
|
|
||||||
$ON_RESET_TOOLBAR : function(){
|
$ON_SHOW_EXPAND_VIEW: function () {
|
||||||
if(this.oApp.getEditingMode() !== "WYSIWYG"){
|
this.welTextMoreButtonParent.addClass("active");
|
||||||
return;
|
this.elMoreLayer.style.display = "block";
|
||||||
}
|
},
|
||||||
//스펠체크 닫기
|
|
||||||
this.oApp.exec("END_SPELLCHECK");
|
$ON_HIDE_EXPAND_VIEW: function () {
|
||||||
//열린 팝업을 닫기 위해서
|
this.welTextMoreButtonParent.removeClass("active");
|
||||||
this.oApp.exec("DISABLE_ALL_UI");
|
this.elMoreLayer.style.display = "none";
|
||||||
this.oApp.exec("ENABLE_ALL_UI");
|
},
|
||||||
//글자색과 글자 배경색을 제외한 세팅
|
|
||||||
this.oApp.exec("RESET_STYLE_STATUS");
|
/**
|
||||||
this.oApp.exec("CHECK_STYLE_CHANGE");
|
* CHANGE_EDITING_MODE모드 이후에 호출되어야 함.
|
||||||
//최근 사용한 글자색 셋팅.
|
* WYSIWYG 모드가 활성화되기 전에 호출이 되면 APPLY_FONTCOLOR에서 에러 발생.
|
||||||
this.oApp.exec("APPLY_FONTCOLOR", ["#000000"]);
|
*/
|
||||||
//더보기 영역 닫기.
|
$ON_RESET_TOOLBAR: function () {
|
||||||
this.oApp.exec("HIDE_EXPAND_VIEW");
|
if (this.oApp.getEditingMode() !== "WYSIWYG") {
|
||||||
}
|
return;
|
||||||
});
|
}
|
||||||
|
//스펠체크 닫기
|
||||||
|
this.oApp.exec("END_SPELLCHECK");
|
||||||
|
//열린 팝업을 닫기 위해서
|
||||||
|
this.oApp.exec("DISABLE_ALL_UI");
|
||||||
|
this.oApp.exec("ENABLE_ALL_UI");
|
||||||
|
//글자색과 글자 배경색을 제외한 세팅
|
||||||
|
this.oApp.exec("RESET_STYLE_STATUS");
|
||||||
|
this.oApp.exec("CHECK_STYLE_CHANGE");
|
||||||
|
//최근 사용한 글자색 셋팅.
|
||||||
|
this.oApp.exec("APPLY_FONTCOLOR", ["#000000"]);
|
||||||
|
//더보기 영역 닫기.
|
||||||
|
this.oApp.exec("HIDE_EXPAND_VIEW");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -27,102 +27,102 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
* @pluginDesc 에디터를 싸고 있는 iframe 사이즈 조절을 담당하는 플러그인
|
* @pluginDesc 에디터를 싸고 있는 iframe 사이즈 조절을 담당하는 플러그인
|
||||||
*/
|
*/
|
||||||
nhn.husky.SE_OuterIFrameControl = $Class({
|
nhn.husky.SE_OuterIFrameControl = $Class({
|
||||||
name : "SE_OuterIFrameControl",
|
name: "SE_OuterIFrameControl",
|
||||||
oResizeGrip : null,
|
oResizeGrip: null,
|
||||||
|
|
||||||
$init : function(oAppContainer){
|
$init: function (oAppContainer) {
|
||||||
// page up, page down, home, end, left, up, right, down
|
// page up, page down, home, end, left, up, right, down
|
||||||
this.aHeightChangeKeyMap = [-100, 100, 500, -500, -1, -10, 1, 10];
|
this.aHeightChangeKeyMap = [-100, 100, 500, -500, -1, -10, 1, 10];
|
||||||
|
|
||||||
this._assignHTMLObjects(oAppContainer);
|
|
||||||
|
|
||||||
//키보드 이벤트
|
this._assignHTMLObjects(oAppContainer);
|
||||||
this.$FnKeyDown = $Fn(this._keydown, this);
|
|
||||||
if(this.oResizeGrip){
|
|
||||||
this.$FnKeyDown.attach(this.oResizeGrip, "keydown");
|
|
||||||
}
|
|
||||||
|
|
||||||
//마우스 이벤트
|
|
||||||
if(!!jindo.$Agent().navigator().ie){
|
|
||||||
this.$FnMouseDown = $Fn(this._mousedown, this);
|
|
||||||
this.$FnMouseMove = $Fn(this._mousemove, this);
|
|
||||||
this.$FnMouseMove_Parent = $Fn(this._mousemove_parent, this);
|
|
||||||
this.$FnMouseUp = $Fn(this._mouseup, this);
|
|
||||||
|
|
||||||
if(this.oResizeGrip){
|
|
||||||
this.$FnMouseDown.attach(this.oResizeGrip, "mousedown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_assignHTMLObjects : function(oAppContainer){
|
//키보드 이벤트
|
||||||
oAppContainer = jindo.$(oAppContainer) || document;
|
this.$FnKeyDown = $Fn(this._keydown, this);
|
||||||
|
if (this.oResizeGrip) {
|
||||||
|
this.$FnKeyDown.attach(this.oResizeGrip, "keydown");
|
||||||
|
}
|
||||||
|
|
||||||
this.oResizeGrip = cssquery.getSingle(".husky_seditor_editingArea_verticalResizer", oAppContainer);
|
//마우스 이벤트
|
||||||
|
if (!!jindo.$Agent().navigator().ie) {
|
||||||
this.elIFrame = window.frameElement;
|
this.$FnMouseDown = $Fn(this._mousedown, this);
|
||||||
this.welIFrame = $Element(this.elIFrame);
|
this.$FnMouseMove = $Fn(this._mousemove, this);
|
||||||
},
|
this.$FnMouseMove_Parent = $Fn(this._mousemove_parent, this);
|
||||||
|
this.$FnMouseUp = $Fn(this._mouseup, this);
|
||||||
|
|
||||||
$ON_MSG_APP_READY : function(){
|
if (this.oResizeGrip) {
|
||||||
this.oApp.exec("SE_FIT_IFRAME", []);
|
this.$FnMouseDown.attach(this.oResizeGrip, "mousedown");
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
$ON_MSG_EDITING_AREA_SIZE_CHANGED : function(){
|
_assignHTMLObjects: function (oAppContainer) {
|
||||||
this.oApp.exec("SE_FIT_IFRAME", []);
|
oAppContainer = jindo.$(oAppContainer) || document;
|
||||||
},
|
|
||||||
|
|
||||||
$ON_SE_FIT_IFRAME : function(){
|
this.oResizeGrip = cssquery.getSingle(".husky_seditor_editingArea_verticalResizer", oAppContainer);
|
||||||
this.elIFrame.style.height = document.body.offsetHeight+"px";
|
|
||||||
},
|
|
||||||
|
|
||||||
$AFTER_RESIZE_EDITING_AREA_BY : function(ipWidthChange, ipHeightChange){
|
|
||||||
this.oApp.exec("SE_FIT_IFRAME", []);
|
|
||||||
},
|
|
||||||
|
|
||||||
_keydown : function(oEvent){
|
|
||||||
var oKeyInfo = oEvent.key();
|
|
||||||
|
|
||||||
// 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down
|
this.elIFrame = window.frameElement;
|
||||||
if(oKeyInfo.keyCode >= 33 && oKeyInfo.keyCode <= 40){
|
this.welIFrame = $Element(this.elIFrame);
|
||||||
this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", []);
|
},
|
||||||
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, this.aHeightChangeKeyMap[oKeyInfo.keyCode-33]]);
|
|
||||||
this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", []);
|
|
||||||
|
|
||||||
oEvent.stop();
|
$ON_MSG_APP_READY: function () {
|
||||||
}
|
this.oApp.exec("SE_FIT_IFRAME", []);
|
||||||
},
|
},
|
||||||
|
|
||||||
_mousedown : function(oEvent){
|
|
||||||
this.iStartHeight = oEvent.pos().clientY;
|
|
||||||
this.iStartHeightOffset = oEvent.pos().layerY;
|
|
||||||
|
|
||||||
this.$FnMouseMove.attach(document, "mousemove");
|
$ON_MSG_EDITING_AREA_SIZE_CHANGED: function () {
|
||||||
this.$FnMouseMove_Parent.attach(parent.document, "mousemove");
|
this.oApp.exec("SE_FIT_IFRAME", []);
|
||||||
|
},
|
||||||
this.$FnMouseUp.attach(document, "mouseup");
|
|
||||||
this.$FnMouseUp.attach(parent.document, "mouseup");
|
|
||||||
|
|
||||||
this.iStartHeight = oEvent.pos().clientY;
|
$ON_SE_FIT_IFRAME: function () {
|
||||||
this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]);
|
this.elIFrame.style.height = document.body.offsetHeight + "px";
|
||||||
},
|
},
|
||||||
|
|
||||||
_mousemove : function(oEvent){
|
$AFTER_RESIZE_EDITING_AREA_BY: function (ipWidthChange, ipHeightChange) {
|
||||||
var iHeightChange = oEvent.pos().clientY - this.iStartHeight;
|
this.oApp.exec("SE_FIT_IFRAME", []);
|
||||||
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
|
},
|
||||||
},
|
|
||||||
|
|
||||||
_mousemove_parent : function(oEvent){
|
_keydown: function (oEvent) {
|
||||||
var iHeightChange = oEvent.pos().pageY - (this.welIFrame.offset().top + this.iStartHeight);
|
var oKeyInfo = oEvent.key();
|
||||||
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
|
|
||||||
},
|
|
||||||
|
|
||||||
_mouseup : function(oEvent){
|
// 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down
|
||||||
this.$FnMouseMove.detach(document, "mousemove");
|
if (oKeyInfo.keyCode >= 33 && oKeyInfo.keyCode <= 40) {
|
||||||
this.$FnMouseMove_Parent.detach(parent.document, "mousemove");
|
this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", []);
|
||||||
this.$FnMouseUp.detach(document, "mouseup");
|
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, this.aHeightChangeKeyMap[oKeyInfo.keyCode - 33]]);
|
||||||
this.$FnMouseUp.detach(parent.document, "mouseup");
|
this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", []);
|
||||||
|
|
||||||
this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]);
|
oEvent.stop();
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
|
||||||
|
_mousedown: function (oEvent) {
|
||||||
|
this.iStartHeight = oEvent.pos().clientY;
|
||||||
|
this.iStartHeightOffset = oEvent.pos().layerY;
|
||||||
|
|
||||||
|
this.$FnMouseMove.attach(document, "mousemove");
|
||||||
|
this.$FnMouseMove_Parent.attach(parent.document, "mousemove");
|
||||||
|
|
||||||
|
this.$FnMouseUp.attach(document, "mouseup");
|
||||||
|
this.$FnMouseUp.attach(parent.document, "mouseup");
|
||||||
|
|
||||||
|
this.iStartHeight = oEvent.pos().clientY;
|
||||||
|
this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_mousemove: function (oEvent) {
|
||||||
|
var iHeightChange = oEvent.pos().clientY - this.iStartHeight;
|
||||||
|
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_mousemove_parent: function (oEvent) {
|
||||||
|
var iHeightChange = oEvent.pos().pageY - (this.welIFrame.offset().top + this.iStartHeight);
|
||||||
|
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
|
||||||
|
},
|
||||||
|
|
||||||
|
_mouseup: function (oEvent) {
|
||||||
|
this.$FnMouseMove.detach(document, "mousemove");
|
||||||
|
this.$FnMouseMove_Parent.detach(parent.document, "mousemove");
|
||||||
|
this.$FnMouseUp.detach(document, "mouseup");
|
||||||
|
this.$FnMouseUp.detach(parent.document, "mouseup");
|
||||||
|
|
||||||
|
this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -17,32 +17,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
// Sample plugin. Use CTRL+T to toggle the toolbar
|
// Sample plugin. Use CTRL+T to toggle the toolbar
|
||||||
nhn.husky.SE_ToolbarToggler = $Class({
|
nhn.husky.SE_ToolbarToggler = $Class({
|
||||||
name : "SE_ToolbarToggler",
|
name: "SE_ToolbarToggler",
|
||||||
bUseToolbar : true,
|
bUseToolbar: true,
|
||||||
|
|
||||||
$init : function(oAppContainer, bUseToolbar){
|
|
||||||
this._assignHTMLObjects(oAppContainer, bUseToolbar);
|
|
||||||
},
|
|
||||||
|
|
||||||
_assignHTMLObjects : function(oAppContainer, bUseToolbar){
|
$init: function (oAppContainer, bUseToolbar) {
|
||||||
oAppContainer = jindo.$(oAppContainer) || document;
|
this._assignHTMLObjects(oAppContainer, bUseToolbar);
|
||||||
|
},
|
||||||
this.toolbarArea = cssquery.getSingle(".se2_tool", oAppContainer);
|
|
||||||
|
_assignHTMLObjects: function (oAppContainer, bUseToolbar) {
|
||||||
//설정이 없거나, 사용하겠다고 표시한 경우 block 처리
|
oAppContainer = jindo.$(oAppContainer) || document;
|
||||||
if( typeof(bUseToolbar) == 'undefined' || bUseToolbar === true){
|
|
||||||
this.toolbarArea.style.display = "block";
|
this.toolbarArea = cssquery.getSingle(".se2_tool", oAppContainer);
|
||||||
}else{
|
|
||||||
this.toolbarArea.style.display = "none";
|
//설정이 없거나, 사용하겠다고 표시한 경우 block 처리
|
||||||
}
|
if (typeof (bUseToolbar) == 'undefined' || bUseToolbar === true) {
|
||||||
},
|
this.toolbarArea.style.display = "block";
|
||||||
|
} else {
|
||||||
$ON_MSG_APP_READY : function(){
|
this.toolbarArea.style.display = "none";
|
||||||
this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
$ON_SE_TOGGLE_TOOLBAR : function(){
|
$ON_MSG_APP_READY: function () {
|
||||||
this.toolbarArea.style.display = (this.toolbarArea.style.display == "none")?"block":"none";
|
this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
|
||||||
this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
|
},
|
||||||
}
|
|
||||||
|
$ON_SE_TOGGLE_TOOLBAR: function () {
|
||||||
|
this.toolbarArea.style.display = (this.toolbarArea.style.display == "none") ? "block" : "none";
|
||||||
|
this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,25 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined'){window.nhn = {};}
|
if (typeof window.nhn == 'undefined') { window.nhn = {}; }
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
||||||
* @name husky_SE2B_Lang_en_US.js
|
* @name husky_SE2B_Lang_en_US.js
|
||||||
* @ unescape
|
* @ unescape
|
||||||
*/
|
*/
|
||||||
var oMessageMap_en_US = {
|
var oMessageMap_en_US = {
|
||||||
'SE_EditingAreaManager.onExit' : 'Contents have been changed.',
|
'SE_EditingAreaManager.onExit': 'Contents have been changed.',
|
||||||
'SE_Color.invalidColorCode' : 'Enter the correct color code. \n\n ex) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
'SE_Color.invalidColorCode': 'Enter the correct color code. \n\n ex) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
||||||
'SE_Hyperlink.invalidURL' : 'You have entered an incorrect URL.',
|
'SE_Hyperlink.invalidURL': 'You have entered an incorrect URL.',
|
||||||
'SE_FindReplace.keywordMissing' : 'Enter the word you wish to find.',
|
'SE_FindReplace.keywordMissing': 'Enter the word you wish to find.',
|
||||||
'SE_FindReplace.keywordNotFound' : 'The word does not exist.',
|
'SE_FindReplace.keywordNotFound': 'The word does not exist.',
|
||||||
'SE_FindReplace.replaceAllResultP1' : 'A total of ',
|
'SE_FindReplace.replaceAllResultP1': 'A total of ',
|
||||||
'SE_FindReplace.replaceAllResultP2' : ' matching contents have been changed.',
|
'SE_FindReplace.replaceAllResultP2': ' matching contents have been changed.',
|
||||||
'SE_FindReplace.notSupportedBrowser' : 'Function cannot be used in the browser you are currently using. \n\nSorry for the inconvenience.',
|
'SE_FindReplace.notSupportedBrowser': 'Function cannot be used in the browser you are currently using. \n\nSorry for the inconvenience.',
|
||||||
'SE_FindReplace.replaceKeywordNotFound' : 'No word to change.',
|
'SE_FindReplace.replaceKeywordNotFound': 'No word to change.',
|
||||||
'SE_LineHeight.invalidLineHeight' : 'Incorrect value.',
|
'SE_LineHeight.invalidLineHeight': 'Incorrect value.',
|
||||||
'SE_Footnote.defaultText' : 'Enter footnote details.',
|
'SE_Footnote.defaultText': 'Enter footnote details.',
|
||||||
'SE.failedToLoadFlash' : 'The function cannot be used because flash has been blocked.',
|
'SE.failedToLoadFlash': 'The function cannot be used because flash has been blocked.',
|
||||||
'SE2M_EditingModeChanger.confirmTextMode' : 'The contents remain, but editing effects, including fonts, and attachments, \n\nsuch as images, will disappear when changed to text mode. \n\n Make changes?',
|
'SE2M_EditingModeChanger.confirmTextMode': 'The contents remain, but editing effects, including fonts, and attachments, \n\nsuch as images, will disappear when changed to text mode. \n\n Make changes?',
|
||||||
'SE2M_FontNameWithLayerUI.sSampleText' : 'ABCD'
|
'SE2M_FontNameWithLayerUI.sSampleText': 'ABCD'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,25 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined'){window.nhn = {};}
|
if (typeof window.nhn == 'undefined') { window.nhn = {}; }
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
||||||
* @name husky_SE2B_Lang_ja_JP.js
|
* @name husky_SE2B_Lang_ja_JP.js
|
||||||
* @ unescape
|
* @ unescape
|
||||||
*/
|
*/
|
||||||
var oMessageMap_ja_JP = {
|
var oMessageMap_ja_JP = {
|
||||||
'SE_EditingAreaManager.onExit' : '内容が変更されました。',
|
'SE_EditingAreaManager.onExit': '内容が変更されました。',
|
||||||
'SE_Color.invalidColorCode' : 'カラーコードを正しく入力してください。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
'SE_Color.invalidColorCode': 'カラーコードを正しく入力してください。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
||||||
'SE_Hyperlink.invalidURL' : '入力したURLが正しくありません。',
|
'SE_Hyperlink.invalidURL': '入力したURLが正しくありません。',
|
||||||
'SE_FindReplace.keywordMissing' : 'お探しの単語を入力してください。',
|
'SE_FindReplace.keywordMissing': 'お探しの単語を入力してください。',
|
||||||
'SE_FindReplace.keywordNotFound' : 'お探しの単語がありません。',
|
'SE_FindReplace.keywordNotFound': 'お探しの単語がありません。',
|
||||||
'SE_FindReplace.replaceAllResultP1' : '一致する内容が計',
|
'SE_FindReplace.replaceAllResultP1': '一致する内容が計',
|
||||||
'SE_FindReplace.replaceAllResultP2' : '件変わりました。',
|
'SE_FindReplace.replaceAllResultP2': '件変わりました。',
|
||||||
'SE_FindReplace.notSupportedBrowser' : '現在ご使用中のブラウザーではご利用いただけない機能です。\n\nご不便をおかけしまして申し訳ございません。',
|
'SE_FindReplace.notSupportedBrowser': '現在ご使用中のブラウザーではご利用いただけない機能です。\n\nご不便をおかけしまして申し訳ございません。',
|
||||||
'SE_FindReplace.replaceKeywordNotFound' : '変更される単語がありません。',
|
'SE_FindReplace.replaceKeywordNotFound': '変更される単語がありません。',
|
||||||
'SE_LineHeight.invalidLineHeight' : '誤った値です。',
|
'SE_LineHeight.invalidLineHeight': '誤った値です。',
|
||||||
'SE_Footnote.defaultText' : '脚注内容を入力してください。',
|
'SE_Footnote.defaultText': '脚注内容を入力してください。',
|
||||||
'SE.failedToLoadFlash' : 'フラッシュが遮断されているため、この機能は使用できません。',
|
'SE.failedToLoadFlash': 'フラッシュが遮断されているため、この機能は使用できません。',
|
||||||
'SE2M_EditingModeChanger.confirmTextMode' : 'テキストモードに切り換えると、作成された内容は維持されますが、\n\nフォント等の編集効果と画像等の添付内容が消えることになります。\n\n切り換えますか?',
|
'SE2M_EditingModeChanger.confirmTextMode': 'テキストモードに切り換えると、作成された内容は維持されますが、\n\nフォント等の編集効果と画像等の添付内容が消えることになります。\n\n切り換えますか?',
|
||||||
'SE2M_FontNameWithLayerUI.sSampleText' : 'あいうえお'
|
'SE2M_FontNameWithLayerUI.sSampleText': 'あいうえお'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,25 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined'){window.nhn = {};}
|
if (typeof window.nhn == 'undefined') { window.nhn = {}; }
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
||||||
* @name husky_SE2B_Lang_ko_KR.js
|
* @name husky_SE2B_Lang_ko_KR.js
|
||||||
* @ unescape
|
* @ unescape
|
||||||
*/
|
*/
|
||||||
var oMessageMap = {
|
var oMessageMap = {
|
||||||
'SE_EditingAreaManager.onExit' : '내용이 변경되었습니다.',
|
'SE_EditingAreaManager.onExit': '내용이 변경되었습니다.',
|
||||||
'SE_Color.invalidColorCode' : '색상 코드를 올바르게 입력해 주세요. \n\n 예) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
'SE_Color.invalidColorCode': '색상 코드를 올바르게 입력해 주세요. \n\n 예) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
||||||
'SE_Hyperlink.invalidURL' : '입력하신 URL이 올바르지 않습니다.',
|
'SE_Hyperlink.invalidURL': '입력하신 URL이 올바르지 않습니다.',
|
||||||
'SE_FindReplace.keywordMissing' : '찾으실 단어를 입력해 주세요.',
|
'SE_FindReplace.keywordMissing': '찾으실 단어를 입력해 주세요.',
|
||||||
'SE_FindReplace.keywordNotFound' : '찾으실 단어가 없습니다.',
|
'SE_FindReplace.keywordNotFound': '찾으실 단어가 없습니다.',
|
||||||
'SE_FindReplace.replaceAllResultP1' : '일치하는 내용이 총 ',
|
'SE_FindReplace.replaceAllResultP1': '일치하는 내용이 총 ',
|
||||||
'SE_FindReplace.replaceAllResultP2' : '건 바뀌었습니다.',
|
'SE_FindReplace.replaceAllResultP2': '건 바뀌었습니다.',
|
||||||
'SE_FindReplace.notSupportedBrowser' : '현재 사용하고 계신 브라우저에서는 사용하실수 없는 기능입니다.\n\n이용에 불편을 드려 죄송합니다.',
|
'SE_FindReplace.notSupportedBrowser': '현재 사용하고 계신 브라우저에서는 사용하실수 없는 기능입니다.\n\n이용에 불편을 드려 죄송합니다.',
|
||||||
'SE_FindReplace.replaceKeywordNotFound' : '바뀔 단어가 없습니다',
|
'SE_FindReplace.replaceKeywordNotFound': '바뀔 단어가 없습니다',
|
||||||
'SE_LineHeight.invalidLineHeight' : '잘못된 값입니다.',
|
'SE_LineHeight.invalidLineHeight': '잘못된 값입니다.',
|
||||||
'SE_Footnote.defaultText' : '각주내용을 입력해 주세요',
|
'SE_Footnote.defaultText': '각주내용을 입력해 주세요',
|
||||||
'SE.failedToLoadFlash' : '플래시가 차단되어 있어 해당 기능을 사용할 수 없습니다.',
|
'SE.failedToLoadFlash': '플래시가 차단되어 있어 해당 기능을 사용할 수 없습니다.',
|
||||||
'SE2M_EditingModeChanger.confirmTextMode' : '텍스트 모드로 전환하면 작성된 내용은 유지되나, \n\n글꼴 등의 편집효과와 이미지 등의 첨부내용이 모두 사라지게 됩니다.\n\n전환하시겠습니까?',
|
'SE2M_EditingModeChanger.confirmTextMode': '텍스트 모드로 전환하면 작성된 내용은 유지되나, \n\n글꼴 등의 편집효과와 이미지 등의 첨부내용이 모두 사라지게 됩니다.\n\n전환하시겠습니까?',
|
||||||
'SE2M_FontNameWithLayerUI.sSampleText' : '가나다라'
|
'SE2M_FontNameWithLayerUI.sSampleText': '가나다라'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,25 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined'){window.nhn = {};}
|
if (typeof window.nhn == 'undefined') { window.nhn = {}; }
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
||||||
* @name husky_SE2B_Lang_zh_CN.js
|
* @name husky_SE2B_Lang_zh_CN.js
|
||||||
* @ unescape
|
* @ unescape
|
||||||
*/
|
*/
|
||||||
var oMessageMap_zh_CN = {
|
var oMessageMap_zh_CN = {
|
||||||
'SE_EditingAreaManager.onExit' : '内容有了变化。',
|
'SE_EditingAreaManager.onExit': '内容有了变化。',
|
||||||
'SE_Color.invalidColorCode' : '请你输入正确的色相代码。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
'SE_Color.invalidColorCode': '请你输入正确的色相代码。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
||||||
'SE_Hyperlink.invalidURL' : '你输入的URL不符条件。',
|
'SE_Hyperlink.invalidURL': '你输入的URL不符条件。',
|
||||||
'SE_FindReplace.keywordMissing' : '请你输入要找的词汇。',
|
'SE_FindReplace.keywordMissing': '请你输入要找的词汇。',
|
||||||
'SE_FindReplace.keywordNotFound' : '没有词汇符合条件。',
|
'SE_FindReplace.keywordNotFound': '没有词汇符合条件。',
|
||||||
'SE_FindReplace.replaceAllResultP1' : '符合条件的内容改编为',
|
'SE_FindReplace.replaceAllResultP1': '符合条件的内容改编为',
|
||||||
'SE_FindReplace.replaceAllResultP2' : '件',
|
'SE_FindReplace.replaceAllResultP2': '件',
|
||||||
'SE_FindReplace.notSupportedBrowser' : '这是你现在使用的浏览器不可支持的功能。\n\n麻烦你很道歉。',
|
'SE_FindReplace.notSupportedBrowser': '这是你现在使用的浏览器不可支持的功能。\n\n麻烦你很道歉。',
|
||||||
'SE_FindReplace.replaceKeywordNotFound' : '没有词汇要改变。',
|
'SE_FindReplace.replaceKeywordNotFound': '没有词汇要改变。',
|
||||||
'SE_LineHeight.invalidLineHeight' : '这是有问题的值。',
|
'SE_LineHeight.invalidLineHeight': '这是有问题的值。',
|
||||||
'SE_Footnote.defaultText' : '请你输入脚注内容。',
|
'SE_Footnote.defaultText': '请你输入脚注内容。',
|
||||||
'SE.failedToLoadFlash' : 'flash被隔绝,不能使用该功能。',
|
'SE.failedToLoadFlash': 'flash被隔绝,不能使用该功能。',
|
||||||
'SE2M_EditingModeChanger.confirmTextMode' : '转换为text模式就能维持制作内容,\n\n但字体等编辑效果和图像等附件内容都会消失。\n\n你还要继续吗?',
|
'SE2M_EditingModeChanger.confirmTextMode': '转换为text模式就能维持制作内容,\n\n但字体等编辑效果和图像等附件内容都会消失。\n\n你还要继续吗?',
|
||||||
'SE2M_FontNameWithLayerUI.sSampleText' : 'ABCD'
|
'SE2M_FontNameWithLayerUI.sSampleText': 'ABCD'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,25 @@ You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
if(typeof window.nhn=='undefined'){window.nhn = {};}
|
if (typeof window.nhn == 'undefined') { window.nhn = {}; }
|
||||||
/**
|
/**
|
||||||
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
* @fileOverview This file contains a message mapping(Korean), which is used to map the message code to the actual message
|
||||||
* @name husky_SE2B_Lang_zh_TW.js
|
* @name husky_SE2B_Lang_zh_TW.js
|
||||||
* @ unescape
|
* @ unescape
|
||||||
*/
|
*/
|
||||||
var oMessageMap_zh_TW = {
|
var oMessageMap_zh_TW = {
|
||||||
'SE_EditingAreaManager.onExit' : '內容已被更改。',
|
'SE_EditingAreaManager.onExit': '內容已被更改。',
|
||||||
'SE_Color.invalidColorCode' : '請輸入正確的顔色代碼。\n\n例子)#000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
'SE_Color.invalidColorCode': '請輸入正確的顔色代碼。\n\n例子)#000000, #FF0000, #FFFFFF, #ffffff, ffffff',
|
||||||
'SE_Hyperlink.invalidURL' : '輸錯URL',
|
'SE_Hyperlink.invalidURL': '輸錯URL',
|
||||||
'SE_FindReplace.keywordMissing' : '請輸入要查詢的單詞。',
|
'SE_FindReplace.keywordMissing': '請輸入要查詢的單詞。',
|
||||||
'SE_FindReplace.keywordNotFound' : '要查詢的單詞不存在。',
|
'SE_FindReplace.keywordNotFound': '要查詢的單詞不存在。',
|
||||||
'SE_FindReplace.replaceAllResultP1' : '一致的內容總有',
|
'SE_FindReplace.replaceAllResultP1': '一致的內容總有',
|
||||||
'SE_FindReplace.replaceAllResultP2' : '件已被更改。',
|
'SE_FindReplace.replaceAllResultP2': '件已被更改。',
|
||||||
'SE_FindReplace.notSupportedBrowser' : '當前的浏覽器上無法使用此功能。\n\n很抱歉給你添麻煩了。',
|
'SE_FindReplace.notSupportedBrowser': '當前的浏覽器上無法使用此功能。\n\n很抱歉給你添麻煩了。',
|
||||||
'SE_FindReplace.replaceKeywordNotFound' : '要更改的詞彙不存在。',
|
'SE_FindReplace.replaceKeywordNotFound': '要更改的詞彙不存在。',
|
||||||
'SE_LineHeight.invalidLineHeight' : '爲有錯誤的值。',
|
'SE_LineHeight.invalidLineHeight': '爲有錯誤的值。',
|
||||||
'SE_Footnote.defaultText' : '請輸入注腳內容。',
|
'SE_Footnote.defaultText': '請輸入注腳內容。',
|
||||||
'SE.failedToLoadFlash' : 'Flash被屏蔽,導致無法使用此功能。',
|
'SE.failedToLoadFlash': 'Flash被屏蔽,導致無法使用此功能。',
|
||||||
'SE2M_EditingModeChanger.confirmTextMode' : '如轉換爲文本模式,雖然維持已寫成的內容,\n\n但字號等編輯效果和圖像等附加內容都會被消失。\n\n是否轉換?',
|
'SE2M_EditingModeChanger.confirmTextMode': '如轉換爲文本模式,雖然維持已寫成的內容,\n\n但字號等編輯效果和圖像等附加內容都會被消失。\n\n是否轉換?',
|
||||||
'SE2M_FontNameWithLayerUI.sSampleText' : 'ABCD'
|
'SE2M_FontNameWithLayerUI.sSampleText': 'ABCD'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,106 +1,106 @@
|
||||||
/**
|
/**
|
||||||
* @use 간단 포토 업로드용으로 제작되었습니다.
|
* @use 간단 포토 업로드용으로 제작되었습니다.
|
||||||
* @author cielo
|
* @author cielo
|
||||||
* @See nhn.husky.SE2M_Configuration
|
* @See nhn.husky.SE2M_Configuration
|
||||||
* @ 팝업 마크업은 SimplePhotoUpload.html과 SimplePhotoUpload_html5.html이 있습니다.
|
* @ 팝업 마크업은 SimplePhotoUpload.html과 SimplePhotoUpload_html5.html이 있습니다.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nhn.husky.SE2M_AttachQuickPhoto = jindo.$Class({
|
nhn.husky.SE2M_AttachQuickPhoto = jindo.$Class({
|
||||||
name : "SE2M_AttachQuickPhoto",
|
name: "SE2M_AttachQuickPhoto",
|
||||||
|
|
||||||
$init : function(){},
|
$init: function () { },
|
||||||
|
|
||||||
$ON_MSG_APP_READY : function(){
|
$ON_MSG_APP_READY: function () {
|
||||||
this.oApp.exec("REGISTER_UI_EVENT", ["photo_attach", "click", "ATTACHPHOTO_OPEN_WINDOW"]);
|
this.oApp.exec("REGISTER_UI_EVENT", ["photo_attach", "click", "ATTACHPHOTO_OPEN_WINDOW"]);
|
||||||
},
|
},
|
||||||
|
|
||||||
$LOCAL_BEFORE_FIRST : function(sMsg){
|
$LOCAL_BEFORE_FIRST: function (sMsg) {
|
||||||
if(!!this.oPopupMgr){ return; }
|
if (!!this.oPopupMgr) { return; }
|
||||||
// Popup Manager에서 사용할 param
|
// Popup Manager에서 사용할 param
|
||||||
this.htPopupOption = {
|
this.htPopupOption = {
|
||||||
oApp : this.oApp,
|
oApp: this.oApp,
|
||||||
sName : this.name,
|
sName: this.name,
|
||||||
bScroll : false,
|
bScroll: false,
|
||||||
sProperties : "",
|
sProperties: "",
|
||||||
sUrl : ""
|
sUrl: ""
|
||||||
};
|
};
|
||||||
this.oPopupMgr = nhn.husky.PopUpManager.getInstance(this.oApp);
|
this.oPopupMgr = nhn.husky.PopUpManager.getInstance(this.oApp);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 포토 웹탑 오픈
|
* 포토 웹탑 오픈
|
||||||
*/
|
*/
|
||||||
$ON_ATTACHPHOTO_OPEN_WINDOW : function(){
|
$ON_ATTACHPHOTO_OPEN_WINDOW: function () {
|
||||||
this.htPopupOption.sUrl = this.makePopupURL();
|
this.htPopupOption.sUrl = this.makePopupURL();
|
||||||
//this.htPopupOption.sProperties = "left=0,top=0,width=640,height=459,scrollbars=yes,location=no,status=0,resizable=no";
|
//this.htPopupOption.sProperties = "left=0,top=0,width=640,height=459,scrollbars=yes,location=no,status=0,resizable=no";
|
||||||
this.htPopupOption.sProperties = "left="+(screen.width-640)/2+", top="+(screen.height-459)/2+",width=640,height=459,scrollbars=yes,location=no,status=0,resizable=no";
|
this.htPopupOption.sProperties = "left=" + (screen.width - 640) / 2 + ", top=" + (screen.height - 459) / 2 + ",width=640,height=459,scrollbars=yes,location=no,status=0,resizable=no";
|
||||||
|
|
||||||
this.oPopupWindow = this.oPopupMgr.openWindow(this.htPopupOption);
|
this.oPopupWindow = this.oPopupMgr.openWindow(this.htPopupOption);
|
||||||
|
|
||||||
// 처음 로딩하고 IE에서 커서가 전혀 없는 경우
|
// 처음 로딩하고 IE에서 커서가 전혀 없는 경우
|
||||||
// 복수 업로드시에 순서가 바뀜
|
// 복수 업로드시에 순서가 바뀜
|
||||||
this.oApp.exec('FOCUS');
|
this.oApp.exec('FOCUS');
|
||||||
return (!!this.oPopupWindow ? true : false);
|
return (!!this.oPopupWindow ? true : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 서비스별로 팝업에 parameter를 추가하여 URL을 생성하는 함수
|
* 서비스별로 팝업에 parameter를 추가하여 URL을 생성하는 함수
|
||||||
* nhn.husky.SE2M_AttachQuickPhoto.prototype.makePopupURL로 덮어써서 사용하시면 됨.
|
* nhn.husky.SE2M_AttachQuickPhoto.prototype.makePopupURL로 덮어써서 사용하시면 됨.
|
||||||
*/
|
*/
|
||||||
makePopupURL : function(){
|
makePopupURL: function () {
|
||||||
//var sPopupUrl = "./photo_uploader/popup/photo_uploader.html";
|
//var sPopupUrl = "./photo_uploader/popup/photo_uploader.html";
|
||||||
var sPopupUrl = "./photo_uploader/popup/index.html";
|
var sPopupUrl = "./photo_uploader/popup/index.html";
|
||||||
return sPopupUrl;
|
return sPopupUrl;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 팝업에서 호출되는 메세지.
|
* 팝업에서 호출되는 메세지.
|
||||||
*/
|
*/
|
||||||
$ON_SET_PHOTO : function(aPhotoData){
|
$ON_SET_PHOTO: function (aPhotoData) {
|
||||||
var sContents,
|
var sContents,
|
||||||
aPhotoInfo,
|
aPhotoInfo,
|
||||||
htData;
|
htData;
|
||||||
|
|
||||||
if( !aPhotoData ){
|
if (!aPhotoData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
sContents = "";
|
sContents = "";
|
||||||
for(var i = 0; i <aPhotoData.length; i++){
|
for (var i = 0; i < aPhotoData.length; i++) {
|
||||||
htData = aPhotoData[i];
|
htData = aPhotoData[i];
|
||||||
|
|
||||||
if(!htData.sAlign){
|
if (!htData.sAlign) {
|
||||||
htData.sAlign = "";
|
htData.sAlign = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
aPhotoInfo = {
|
aPhotoInfo = {
|
||||||
sName : htData.sFileName || "",
|
sName: htData.sFileName || "",
|
||||||
sOriginalImageURL : htData.sFileURL,
|
sOriginalImageURL: htData.sFileURL,
|
||||||
bNewLine : htData.bNewLine || false
|
bNewLine: htData.bNewLine || false
|
||||||
};
|
};
|
||||||
|
|
||||||
sContents += this._getPhotoTag(aPhotoInfo);
|
sContents += this._getPhotoTag(aPhotoInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.oApp.exec("PASTE_HTML", [sContents]); // 위즐 첨부 파일 부분 확인
|
this.oApp.exec("PASTE_HTML", [sContents]); // 위즐 첨부 파일 부분 확인
|
||||||
}catch(e){
|
} catch (e) {
|
||||||
// upload시 error발생에 대해서 skip함
|
// upload시 error발생에 대해서 skip함
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @use 일반 포토 tag 생성
|
* @use 일반 포토 tag 생성
|
||||||
*/
|
*/
|
||||||
_getPhotoTag : function(htPhotoInfo){
|
_getPhotoTag: function (htPhotoInfo) {
|
||||||
// id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test
|
// id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test
|
||||||
var sTag = '<img src="{=sOriginalImageURL}" title="{=sName}" >';
|
var sTag = '<img src="{=sOriginalImageURL}" title="{=sName}" >';
|
||||||
if(htPhotoInfo.bNewLine){
|
if (htPhotoInfo.bNewLine) {
|
||||||
sTag += '<br style="clear:both;">';
|
sTag += '<br style="clear:both;">';
|
||||||
}
|
}
|
||||||
sTag = jindo.$Template(sTag).process(htPhotoInfo);
|
sTag = jindo.$Template(sTag).process(htPhotoInfo);
|
||||||
|
|
||||||
return sTag;
|
return sTag;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
direction: inherit;
|
direction: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fileinput-button span {
|
.fileinput-button span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,18 @@
|
||||||
.fileupload-buttonbar .toggle {
|
.fileupload-buttonbar .toggle {
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-animated .progress-bar,
|
.progress-animated .progress-bar,
|
||||||
.progress-animated .bar {
|
.progress-animated .bar {
|
||||||
background: url("../img/progressbar.gif") !important;
|
background: url("../img/progressbar.gif") !important;
|
||||||
filter: none;
|
filter: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fileupload-process {
|
.fileupload-process {
|
||||||
float: right;
|
float: right;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fileupload-processing .fileupload-process,
|
.fileupload-processing .fileupload-process,
|
||||||
.files .processing .preview {
|
.files .processing .preview {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -31,25 +34,30 @@
|
||||||
background: url("../img/loading.gif") center no-repeat;
|
background: url("../img/loading.gif") center no-repeat;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files audio,
|
.files audio,
|
||||||
.files video {
|
.files video {
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
|
|
||||||
.fileupload-buttonbar .toggle,
|
.fileupload-buttonbar .toggle,
|
||||||
.files .toggle,
|
.files .toggle,
|
||||||
.files .btn span {
|
.files .btn span {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files .name {
|
.files .name {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files audio,
|
.files audio,
|
||||||
.files video {
|
.files video {
|
||||||
max-width: 80px;
|
max-width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files img,
|
.files img,
|
||||||
.files canvas {
|
.files canvas {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fileinput-button input {
|
.fileinput-button input {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|
|
||||||
|
|
@ -10,90 +10,210 @@
|
||||||
* http://www.opensource.org/licenses/MIT
|
* http://www.opensource.org/licenses/MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
body {margin:0;padding:0;overflow-x:hidden}
|
body {
|
||||||
body,input,textarea,select,button,table{font-family:'돋움',Dotum,Helvetica,sans-serif;font-size:12px}
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
#pop_header{height:26px;padding:14px 0 0 20px;border-bottom:1px solid #ededeb;background:#f4f4f3}
|
overflow-x: hidden
|
||||||
#pop_header h1{color:#333;font-size:14px;letter-spacing:-1px;margin:0;padding:0}
|
|
||||||
|
|
||||||
.content_container{padding:5px 10px}
|
|
||||||
|
|
||||||
.swfupload{OUTLINE-WIDTH: 0px; OUTLINE-STYLE: none; OUTLINE-COLOR: invert}
|
|
||||||
|
|
||||||
.pop_container .drag_area{overflow:hidden;overflow-y:auto;position:relative;width:100%;height:250px;margin-top:4px;border:1px solid #eceff2}
|
|
||||||
.pop_container .blind{visibility:hidden;position:absolute;line-height:0}
|
|
||||||
.pop_container .drag_area .bg{position:absolute;top:0;left:0;width:100%;height:250px;background: #fdfdfd url(../../../img/photoQuickPopup/bg_drag_image.png) 50% 50% no-repeat;}
|
|
||||||
.pop_container .drag_area .showbg{display:block}
|
|
||||||
.pop_container .drag_area .hidebg{display:none}
|
|
||||||
|
|
||||||
ul.sortable{margin:0;padding:0;*zoom:1}
|
|
||||||
ul.sortable:after{display:block;clear:both;content:""}
|
|
||||||
|
|
||||||
.sortable > li{
|
|
||||||
list-style:none;
|
|
||||||
float: left;
|
|
||||||
width: 110px;
|
|
||||||
height:110px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-align: center;
|
|
||||||
margin: 4px 3px; border: 1px solid #DDDDDD;padding:1px; cursor: move;
|
|
||||||
background: #ffffff;
|
|
||||||
}
|
}
|
||||||
.sortable > li:hover, .sortable > li.ui-sortable-helper{border:2px solid #E58524;padding:0;}
|
|
||||||
|
|
||||||
.sortable > li > div{
|
body,
|
||||||
background: #f7f7f7;
|
input,
|
||||||
color:#808080;
|
textarea,
|
||||||
margin:0;
|
select,
|
||||||
font-size:11px;
|
button,
|
||||||
height:106px;
|
table {
|
||||||
width:100%;
|
font-family: '돋움', Dotum, Helvetica, sans-serif;
|
||||||
overflow: hidden;
|
font-size: 12px
|
||||||
white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis;
|
|
||||||
position:relative;
|
|
||||||
}
|
}
|
||||||
.sortable > li > div > img{margin:3px;}
|
|
||||||
.sortable > li > div .delete_img{position:absolute;top:0;right:0px;display:none}
|
#pop_header {
|
||||||
.sortable > li:hover > div .delete_img{display:block;cursor:pointer}
|
height: 26px;
|
||||||
.sortable > li.placeholder{
|
padding: 14px 0 0 20px;
|
||||||
border: dashed 2px #ccc;background-color:#FFF;padding:0;
|
border-bottom: 1px solid #ededeb;
|
||||||
|
background: #f4f4f3
|
||||||
|
}
|
||||||
|
|
||||||
|
#pop_header h1 {
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
letter-spacing: -1px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_container {
|
||||||
|
padding: 5px 10px
|
||||||
|
}
|
||||||
|
|
||||||
|
.swfupload {
|
||||||
|
OUTLINE-WIDTH: 0px;
|
||||||
|
OUTLINE-STYLE: none;
|
||||||
|
OUTLINE-COLOR: invert
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop_container .drag_area {
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 250px;
|
||||||
|
margin-top: 4px;
|
||||||
|
border: 1px solid #eceff2
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop_container .blind {
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
line-height: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop_container .drag_area .bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 250px;
|
||||||
|
background: #fdfdfd url(../../../img/photoQuickPopup/bg_drag_image.png) 50% 50% no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop_container .drag_area .showbg {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
.pop_container .drag_area .hidebg {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sortable {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
*zoom: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.sortable:after {
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
content: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li {
|
||||||
|
list-style: none;
|
||||||
|
float: left;
|
||||||
|
width: 110px;
|
||||||
|
height: 110px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
margin: 4px 3px;
|
||||||
|
border: 1px solid #DDDDDD;
|
||||||
|
padding: 1px;
|
||||||
|
cursor: move;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li:hover,
|
||||||
|
.sortable>li.ui-sortable-helper {
|
||||||
|
border: 2px solid #E58524;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li>div {
|
||||||
|
background: #f7f7f7;
|
||||||
|
color: #808080;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 11px;
|
||||||
|
height: 106px;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li>div>img {
|
||||||
|
margin: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li>div .delete_img {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0px;
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li:hover>div .delete_img {
|
||||||
|
display: block;
|
||||||
|
cursor: pointer
|
||||||
|
}
|
||||||
|
|
||||||
|
.sortable>li.placeholder {
|
||||||
|
border: dashed 2px #ccc;
|
||||||
|
background-color: #FFF;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-success {
|
.btn-success {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #5cb85c;
|
background-color: #5cb85c;
|
||||||
border-color: #4cae4c;
|
border-color: #4cae4c;
|
||||||
}
|
}
|
||||||
.btn:hover, .btn:focus {
|
|
||||||
color: #333;
|
.btn:hover,
|
||||||
text-decoration: none;
|
.btn:focus {
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success {
|
|
||||||
color: #fff;
|
.btn-success:hover,
|
||||||
background-color: #47a447;
|
.btn-success:focus,
|
||||||
border-color: #398439;
|
.btn-success:active,
|
||||||
|
.btn-success.active,
|
||||||
|
.open .dropdown-toggle.btn-success {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #47a447;
|
||||||
|
border-color: #398439;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seletion_explain {
|
||||||
|
margin: 10px 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.drag_explain {
|
||||||
|
position: relative;
|
||||||
|
height: 36px
|
||||||
|
}
|
||||||
|
|
||||||
|
.drag_explain p {
|
||||||
|
padding: 12px 0 0 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file_selet_group {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn_group {
|
||||||
|
text-align: center
|
||||||
}
|
}
|
||||||
.seletion_explain{margin:10px 0}
|
|
||||||
.drag_explain{position:relative;height:36px}
|
|
||||||
.drag_explain p {padding:12px 0 0 0;margin:0;}
|
|
||||||
.file_selet_group{position:absolute;top:0;right:0}
|
|
||||||
.btn_group{text-align:center}
|
|
||||||
|
|
@ -2,66 +2,62 @@
|
||||||
<html lang="ko">
|
<html lang="ko">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||||
<title>사진 첨부하기 :: SmartEditor2</title>
|
<title>사진 첨부하기 :: SmartEditor2</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<!-- Generic page styles -->
|
<!-- Generic page styles -->
|
||||||
<link rel="stylesheet" href="css/style.css?v=140715">
|
<link rel="stylesheet" href="css/style.css?v=140715">
|
||||||
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
|
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
|
||||||
<link rel="stylesheet" href="css/jquery.fileupload.css">
|
<link rel="stylesheet" href="css/jquery.fileupload.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container pop_container">
|
<div class="container pop_container">
|
||||||
<!-- header -->
|
<!-- header -->
|
||||||
<div id="pop_header">
|
<div id="pop_header">
|
||||||
<h1>사진 첨부하기</h1>
|
<h1>사진 첨부하기</h1>
|
||||||
</div>
|
|
||||||
<!-- //header -->
|
|
||||||
<div class="content_container">
|
|
||||||
<div class="drag_explain">
|
|
||||||
<p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
|
|
||||||
<div class="file_selet_group">
|
|
||||||
<span class="btn btn-success fileinput-button">
|
|
||||||
<span>파일선택</span>
|
|
||||||
<!-- The file input field used as target for the file upload widget -->
|
|
||||||
<input id="fileupload" type="file" name="files[]" multiple accept="image/*">
|
|
||||||
</span>
|
|
||||||
<button type="button" class="btn btn-danger delete" id="all_remove_btn">
|
|
||||||
<span>전체삭제</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="drag_area" id="drag_area">
|
|
||||||
<ul class="sortable" id="sortable">
|
|
||||||
</ul>
|
|
||||||
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
|
|
||||||
</div>
|
|
||||||
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
|
|
||||||
<div class="btn_group">
|
|
||||||
<button type="button" class="btn" id="img_upload_submit">
|
|
||||||
<span>등록</span>
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn" id="close_w_btn">
|
|
||||||
<span>취소</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- //header -->
|
||||||
|
<div class="content_container">
|
||||||
|
<div class="drag_explain">
|
||||||
|
<p>마우스로 드래그하여 순서를 바꿀수 있습니다.</p>
|
||||||
|
<div class="file_selet_group">
|
||||||
|
<span class="btn btn-success fileinput-button">
|
||||||
|
<span>파일선택</span>
|
||||||
|
<!-- The file input field used as target for the file upload widget -->
|
||||||
|
<input id="fileupload" type="file" name="files[]" multiple accept="image/*">
|
||||||
|
</span>
|
||||||
|
<button type="button" class="btn btn-danger delete" id="all_remove_btn">
|
||||||
|
<span>전체삭제</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="drag_area" id="drag_area">
|
||||||
|
<ul class="sortable" id="sortable">
|
||||||
|
</ul>
|
||||||
|
<em class="blind">마우스로 드래그해서 이미지를 추가해주세요.</em><span id="guide_text" class="bg hidebg"></span>
|
||||||
|
</div>
|
||||||
|
<div class="seletion_explain">이미지는 한번에 10개까지 선택할수 있습니다.</div>
|
||||||
|
<div class="btn_group">
|
||||||
|
<button type="button" class="btn" id="img_upload_submit">
|
||||||
|
<span>등록</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn" id="close_w_btn">
|
||||||
|
<span>취소</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
||||||
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
|
||||||
<script src="./js/jquery.iframe-transport.js"></script>
|
<script src="./js/jquery.iframe-transport.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="./swfupload/swfupload.js?v=210625-1329"></script>
|
<!-- The basic File Upload plugin -->
|
||||||
<script type="text/javascript" src="./swfupload/jquery.swfupload.js?v=210625-1329"></script>
|
<script src="./js/jquery.fileupload.js?v=210625-1329"></script>
|
||||||
|
<script src="./js/basic.js?v=210625-1329"></script>
|
||||||
<!-- The basic File Upload plugin -->
|
|
||||||
<script src="./js/jquery.fileupload.js?v=210625-1329"></script>
|
|
||||||
|
|
||||||
<script src="./js/basic.js?v=210625-1329"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,347 +1,347 @@
|
||||||
jQuery.fn.bindAll = function (options) {
|
jQuery.fn.bindAll = function (options) {
|
||||||
var $this = this;
|
var $this = this;
|
||||||
jQuery.each(options, function (key, val) {
|
jQuery.each(options, function (key, val) {
|
||||||
$this.bind(key, val);
|
$this.bind(key, val);
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(function ($) {
|
jQuery(function ($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ed_nonce = '';
|
var ed_nonce = '';
|
||||||
|
|
||||||
if (!!opener && !!opener.window && !!opener.window.nhn) {
|
if (!!opener && !!opener.window && !!opener.window.nhn) {
|
||||||
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
|
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change this to the location of your server-side upload handler:
|
// Change this to the location of your server-side upload handler:
|
||||||
var gnu = {
|
var gnu = {
|
||||||
url: './php/?_nonce=' + ed_nonce,
|
url: './php/?_nonce=' + ed_nonce,
|
||||||
container_el: 'body',
|
container_el: 'body',
|
||||||
dreg_area: '#drag_area',
|
dreg_area: '#drag_area',
|
||||||
dreg_area_list: '#drag_area > ul',
|
dreg_area_list: '#drag_area > ul',
|
||||||
progress_bar: '#progress .progress-bar',
|
progress_bar: '#progress .progress-bar',
|
||||||
filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
|
filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
|
||||||
files: [],
|
files: [],
|
||||||
file_limit: 10, //한번에 올릴수 파일갯수 제한
|
file_limit: 10, //한번에 올릴수 파일갯수 제한
|
||||||
imgw: 100,
|
imgw: 100,
|
||||||
imgh: 70,
|
imgh: 70,
|
||||||
file_api_support: !!(window.ProgressEvent && window.FileReader),
|
file_api_support: !!(window.ProgressEvent && window.FileReader),
|
||||||
$elTextGuide: $("#guide_text"),
|
$elTextGuide: $("#guide_text"),
|
||||||
init: function () {
|
init: function () {
|
||||||
$(this.dreg_area_list).sortable({
|
$(this.dreg_area_list).sortable({
|
||||||
'cursor': 'pointer',
|
'cursor': 'pointer',
|
||||||
'placeholder': 'placeholder'
|
'placeholder': 'placeholder'
|
||||||
});
|
});
|
||||||
$(this.dreg_area_list).disableSelection();
|
$(this.dreg_area_list).disableSelection();
|
||||||
if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
|
if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
|
||||||
},
|
},
|
||||||
file_push: function (file) {
|
file_push: function (file) {
|
||||||
var othis = this,
|
var othis = this,
|
||||||
last = othis.files.length;
|
last = othis.files.length;
|
||||||
|
|
||||||
othis.files.push(file);
|
othis.files.push(file);
|
||||||
},
|
},
|
||||||
_readymodebg: function () {
|
_readymodebg: function () {
|
||||||
if (this.file_api_support) {
|
if (this.file_api_support) {
|
||||||
var sClass = this.$elTextGuide.attr('class');
|
var sClass = this.$elTextGuide.attr('class');
|
||||||
if (sClass.indexOf('hidebg') > 0) {
|
if (sClass.indexOf('hidebg') > 0) {
|
||||||
this.$elTextGuide.removeClass('hidebg');
|
this.$elTextGuide.removeClass('hidebg');
|
||||||
this.$elTextGuide.addClass('showbg');
|
this.$elTextGuide.addClass('showbg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_startmodebg: function () {
|
_startmodebg: function () {
|
||||||
if (this.file_api_support) {
|
if (this.file_api_support) {
|
||||||
var sClass = this.$elTextGuide.attr('class');
|
var sClass = this.$elTextGuide.attr('class');
|
||||||
if (sClass.indexOf('hidebg') < 0) {
|
if (sClass.indexOf('hidebg') < 0) {
|
||||||
this.$elTextGuide.removeClass('showbg');
|
this.$elTextGuide.removeClass('showbg');
|
||||||
this.$elTextGuide.addClass('hidebg');
|
this.$elTextGuide.addClass('hidebg');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_delete: function (e) {
|
_delete: function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var othis = gnu,
|
var othis = gnu,
|
||||||
$button = $(e.currentTarget),
|
$button = $(e.currentTarget),
|
||||||
delete_url = $button.attr("data-delete");
|
delete_url = $button.attr("data-delete");
|
||||||
if (delete_url) {
|
if (delete_url) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: othis.url + "&del=1&file=" + delete_url
|
url: othis.url + "&del=1&file=" + delete_url
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$button.parents('li.sort_list').fadeOut(300, function () {
|
$button.parents('li.sort_list').fadeOut(300, function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
var $dreg_area = $(othis.dreg_area_list);
|
var $dreg_area = $(othis.dreg_area_list);
|
||||||
$dreg_area.sortable('refresh');
|
$dreg_area.sortable('refresh');
|
||||||
if (!$dreg_area.children('li').length) othis._readymodebg();
|
if (!$dreg_area.children('li').length) othis._readymodebg();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_add: function (e, data, preload) {
|
_add: function (e, data, preload) {
|
||||||
var othis = this;
|
var othis = this;
|
||||||
othis._startmodebg();
|
othis._startmodebg();
|
||||||
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
|
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
|
||||||
$.each(data.files, function (index, file) {
|
$.each(data.files, function (index, file) {
|
||||||
if (!preload && !othis.filter.test(file.type)) {
|
if (!preload && !othis.filter.test(file.type)) {
|
||||||
var agent = navigator.userAgent.toLowerCase();
|
var agent = navigator.userAgent.toLowerCase();
|
||||||
var msg = '';
|
var msg = '';
|
||||||
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1)? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다.":"이미지만 허용합니다.";
|
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) ? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다." : "이미지만 허용합니다.";
|
||||||
data.context.remove();
|
data.context.remove();
|
||||||
alert(msg);
|
alert(msg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var node = $('<div/>')
|
var node = $('<div/>')
|
||||||
.append($('<span/>').text(file.name))
|
.append($('<span/>').text(file.name))
|
||||||
.append($('<span/>').addClass("delete_img").attr({ "data-delete": file.name, "data-url": file.url }).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")),
|
.append($('<span/>').addClass("delete_img").attr({ "data-delete": file.name, "data-url": file.url }).html("<img src='./img/system_delete.png' alt='삭제' title='삭제' >")),
|
||||||
$img = "<img src='./img/loading.gif' class='pre_thumb' />",
|
$img = "<img src='./img/loading.gif' class='pre_thumb' />",
|
||||||
size_text = '';
|
size_text = '';
|
||||||
|
|
||||||
if (preload && preload != 'swfupload') {
|
if (preload && preload != 'swfupload') {
|
||||||
var ret = othis.get_ratio(file.width, file.height),
|
var ret = othis.get_ratio(file.width, file.height),
|
||||||
size_text = file.width + " x " + file.height;
|
size_text = file.width + " x " + file.height;
|
||||||
$img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
|
$img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!index) {
|
if (!index) {
|
||||||
node.prepend('<br>')
|
node.prepend('<br>')
|
||||||
.prepend($img);
|
.prepend($img);
|
||||||
if (size_text) {
|
if (size_text) {
|
||||||
node.append('<br>')
|
node.append('<br>')
|
||||||
.append($('<span/>').text(size_text))
|
.append($('<span/>').text(size_text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node.appendTo(data.context);
|
node.appendTo(data.context);
|
||||||
node.find(".delete_img").on("click", othis._delete);
|
node.find(".delete_img").on("click", othis._delete);
|
||||||
});
|
});
|
||||||
$(othis.dreg_area_list).sortable('refresh');
|
$(othis.dreg_area_list).sortable('refresh');
|
||||||
},
|
},
|
||||||
get_file_all: function () {
|
get_file_all: function () {
|
||||||
var othis = this,
|
var othis = this,
|
||||||
oDate = new Date();
|
oDate = new Date();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
// Uncomment the following to send cross-domain cookies:
|
// Uncomment the following to send cross-domain cookies:
|
||||||
//xhrFields: {withCredentials: true},
|
//xhrFields: {withCredentials: true},
|
||||||
//url: $('#fileupload').fileupload('option', 'url'),
|
//url: $('#fileupload').fileupload('option', 'url'),
|
||||||
url: this.url + "&t=" + oDate.getTime(),
|
url: this.url + "&t=" + oDate.getTime(),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
context: $('#fileupload')[0]
|
context: $('#fileupload')[0]
|
||||||
}).always(function () {
|
}).always(function () {
|
||||||
//$(this).removeClass('fileupload-processing');
|
//$(this).removeClass('fileupload-processing');
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
$.each(result.files, function (index, data) {
|
$.each(result.files, function (index, data) {
|
||||||
var tmp = { files: [] };
|
var tmp = { files: [] };
|
||||||
tmp.files[0] = data;
|
tmp.files[0] = data;
|
||||||
othis._add($.Event('add'), tmp, 'preload');
|
othis._add($.Event('add'), tmp, 'preload');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
_processalways: function (e, data) {
|
_processalways: function (e, data) {
|
||||||
var index = data.index,
|
var index = data.index,
|
||||||
file = data.files[index],
|
file = data.files[index],
|
||||||
node = $(data.context.children()[index]);
|
node = $(data.context.children()[index]);
|
||||||
if (file.error) {
|
if (file.error) {
|
||||||
node
|
node
|
||||||
.append('<br>')
|
.append('<br>')
|
||||||
.append($('<span class="text-danger"/>').text(file.error));
|
.append($('<span class="text-danger"/>').text(file.error));
|
||||||
}
|
}
|
||||||
if (index + 1 === data.files.length) {
|
if (index + 1 === data.files.length) {
|
||||||
data.context.find('button')
|
data.context.find('button')
|
||||||
.text('Upload')
|
.text('Upload')
|
||||||
.prop('disabled', !!data.files.error);
|
.prop('disabled', !!data.files.error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
obj_to_arr: function (obj) {
|
obj_to_arr: function (obj) {
|
||||||
var array = $.map(obj, function (value, index) {
|
var array = $.map(obj, function (value, index) {
|
||||||
return [value];
|
return [value];
|
||||||
});
|
});
|
||||||
return array;
|
return array;
|
||||||
},
|
},
|
||||||
_done: function (e, data) {
|
_done: function (e, data) {
|
||||||
var othis = this;
|
var othis = this;
|
||||||
$.each(data.result.files, function (index, file) {
|
$.each(data.result.files, function (index, file) {
|
||||||
if (file.url && !file.error) {
|
if (file.url && !file.error) {
|
||||||
var ret = othis.get_ratio(file.width, file.height),
|
var ret = othis.get_ratio(file.width, file.height),
|
||||||
node = $(data.context.children()[index]),
|
node = $(data.context.children()[index]),
|
||||||
size_text = file.width + " x " + file.height,
|
size_text = file.width + " x " + file.height,
|
||||||
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
|
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
|
||||||
link = $('<a>')
|
link = $('<a>')
|
||||||
.attr('target', '_blank')
|
.attr('target', '_blank')
|
||||||
.prop('href', file.url);
|
.prop('href', file.url);
|
||||||
node
|
node
|
||||||
//.wrap(link)
|
//.wrap(link)
|
||||||
.append('<br>')
|
.append('<br>')
|
||||||
.append($('<span/>').text(size_text))
|
.append($('<span/>').text(size_text))
|
||||||
.find("img.pre_thumb").attr({ "src": file.url, "width": ret['width'], "height": ret['height'] })
|
.find("img.pre_thumb").attr({ "src": file.url, "width": ret['width'], "height": ret['height'] })
|
||||||
.end().find(".delete_img").attr({ "data-delete": file.name, "data-url": file.url });
|
.end().find(".delete_img").attr({ "data-delete": file.name, "data-url": file.url });
|
||||||
} else if (file.error) {
|
} else if (file.error) {
|
||||||
var error = $('<span class="text-danger"/>').text(file.error);
|
var error = $('<span class="text-danger"/>').text(file.error);
|
||||||
$(data.context.children()[index])
|
$(data.context.children()[index])
|
||||||
.append('<br>')
|
.append('<br>')
|
||||||
.append(error);
|
.append(error);
|
||||||
}
|
}
|
||||||
othis.file_push(file);
|
othis.file_push(file);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
get_ratio: function (width, height) {
|
get_ratio: function (width, height) {
|
||||||
var ratio = 0,
|
var ratio = 0,
|
||||||
ret_img = [];
|
ret_img = [];
|
||||||
if (!width || !height) {
|
if (!width || !height) {
|
||||||
ret_img['width'] = this.imgw;
|
ret_img['width'] = this.imgw;
|
||||||
ret_img['height'] = this.imgh;
|
ret_img['height'] = this.imgh;
|
||||||
return ret_img;
|
return ret_img;
|
||||||
}
|
}
|
||||||
if (width > this.imgw) {
|
if (width > this.imgw) {
|
||||||
ratio = this.imgw / width;
|
ratio = this.imgw / width;
|
||||||
height = height * ratio;
|
height = height * ratio;
|
||||||
width = this.imgw;
|
width = this.imgw;
|
||||||
}
|
}
|
||||||
if (height > this.imgh) {
|
if (height > this.imgh) {
|
||||||
ratio = this.imgh / height;
|
ratio = this.imgh / height;
|
||||||
width = width * ratio;
|
width = width * ratio;
|
||||||
height = this.imgh;
|
height = this.imgh;
|
||||||
}
|
}
|
||||||
ret_img['width'] = parseInt(width);
|
ret_img['width'] = parseInt(width);
|
||||||
ret_img['height'] = parseInt(height);
|
ret_img['height'] = parseInt(height);
|
||||||
return ret_img;
|
return ret_img;
|
||||||
},
|
},
|
||||||
setPhotoToEditor: function (oFileInfo) {
|
setPhotoToEditor: function (oFileInfo) {
|
||||||
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
|
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
|
||||||
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
|
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
|
||||||
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
|
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
|
||||||
//본문에 바로 tag를 넣는 방법 (oFileInfo는 String으로 <img src=....> )
|
//본문에 바로 tag를 넣는 방법 (oFileInfo는 String으로 <img src=....> )
|
||||||
//opener.nhn.husky.PopUpManager.setCallback(window, 'PASTE_HTML', [oFileInfo]);
|
//opener.nhn.husky.PopUpManager.setCallback(window, 'PASTE_HTML', [oFileInfo]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#fileupload').fileupload({
|
$('#fileupload').fileupload({
|
||||||
url: gnu.url,
|
url: gnu.url,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
container_el: gnu.container_el,
|
container_el: gnu.container_el,
|
||||||
dropZone: $(gnu.dreg_area),
|
dropZone: $(gnu.dreg_area),
|
||||||
autoUpload: true,
|
autoUpload: true,
|
||||||
sequentialUploads: true,
|
sequentialUploads: true,
|
||||||
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
|
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
|
||||||
// Enable image resizing, except for Android and Opera,
|
// Enable image resizing, except for Android and Opera,
|
||||||
// which actually support image resizing, but fail to
|
// which actually support image resizing, but fail to
|
||||||
// send Blob objects via XHR requests:
|
// send Blob objects via XHR requests:
|
||||||
disableImageResize: true,
|
disableImageResize: true,
|
||||||
limit_filesLength: gnu.file_limit
|
limit_filesLength: gnu.file_limit
|
||||||
}).on('fileuploadadd', function (e, data) {
|
}).on('fileuploadadd', function (e, data) {
|
||||||
gnu._add(e, data);
|
gnu._add(e, data);
|
||||||
}).on('fileuploadprocessalways', function (e, data) {
|
}).on('fileuploadprocessalways', function (e, data) {
|
||||||
gnu._processalways(e, data);
|
gnu._processalways(e, data);
|
||||||
}).on('fileuploaddone', function (e, data) {
|
}).on('fileuploaddone', function (e, data) {
|
||||||
|
|
||||||
gnu._done(e, data);
|
gnu._done(e, data);
|
||||||
|
|
||||||
}).on('fileuploadfail', function (e, data) {
|
}).on('fileuploadfail', function (e, data) {
|
||||||
$.each(data.files, function (index, file) {
|
$.each(data.files, function (index, file) {
|
||||||
var error = $('<span class="text-danger"/>').text('File upload failed.');
|
var error = $('<span class="text-danger"/>').text('File upload failed.');
|
||||||
$(data.context.children()[index])
|
$(data.context.children()[index])
|
||||||
.append('<br>')
|
.append('<br>')
|
||||||
.append(error);
|
.append(error);
|
||||||
});
|
});
|
||||||
}).prop('disabled', !$.support.fileInput)
|
}).prop('disabled', !$.support.fileInput)
|
||||||
.parent().addClass($.support.fileInput ? undefined : 'disabled');
|
.parent().addClass($.support.fileInput ? undefined : 'disabled');
|
||||||
|
|
||||||
gnu.init();
|
gnu.init();
|
||||||
|
|
||||||
var listeners = {
|
var listeners = {
|
||||||
data: {},
|
data: {},
|
||||||
log: false,
|
log: false,
|
||||||
swfuploadLoaded: function (event) {
|
swfuploadLoaded: function (event) {
|
||||||
if (this.log) $('.log', this).append('<li>Loaded</li>');
|
if (this.log) $('.log', this).append('<li>Loaded</li>');
|
||||||
},
|
},
|
||||||
fileQueued: function (event, file) {
|
fileQueued: function (event, file) {
|
||||||
if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
|
if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
|
||||||
// start the upload once it is queued
|
// start the upload once it is queued
|
||||||
// but only if this queue is not disabled
|
// but only if this queue is not disabled
|
||||||
if (!$('input[name=disabled]:checked', this).length) {
|
if (!$('input[name=disabled]:checked', this).length) {
|
||||||
$(this).swfupload('startUpload');
|
$(this).swfupload('startUpload');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fileQueueError: function (event, file, errorCode, message) {
|
fileQueueError: function (event, file, errorCode, message) {
|
||||||
switch (errorCode) {
|
switch (errorCode) {
|
||||||
case -100:
|
case -100:
|
||||||
alert("파일을 " + message + "개 이하로 선택해주세요.");
|
alert("파일을 " + message + "개 이하로 선택해주세요.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
|
if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
|
||||||
},
|
},
|
||||||
fileDialogStart: function (event) {
|
fileDialogStart: function (event) {
|
||||||
if (this.log) $('.log', this).append('<li>File dialog start</li>');
|
if (this.log) $('.log', this).append('<li>File dialog start</li>');
|
||||||
},
|
},
|
||||||
fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
|
fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
|
||||||
if (this.log) $('.log', this).append('<li>File dialog complete</li>');
|
if (this.log) $('.log', this).append('<li>File dialog complete</li>');
|
||||||
},
|
},
|
||||||
uploadStart: function (event, file) {
|
uploadStart: function (event, file) {
|
||||||
listeners.data.files = $.makeArray(file);
|
listeners.data.files = $.makeArray(file);
|
||||||
gnu._add(event, listeners.data, 'swfupload');
|
gnu._add(event, listeners.data, 'swfupload');
|
||||||
if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
|
if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
|
||||||
},
|
},
|
||||||
uploadProgress: function (event, file, bytesLoaded) {
|
uploadProgress: function (event, file, bytesLoaded) {
|
||||||
if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
|
if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
|
||||||
},
|
},
|
||||||
uploadSuccess: function (event, file, serverData) {
|
uploadSuccess: function (event, file, serverData) {
|
||||||
listeners.data.result = jQuery.parseJSON(serverData);
|
listeners.data.result = jQuery.parseJSON(serverData);
|
||||||
gnu._done(event, listeners.data);
|
gnu._done(event, listeners.data);
|
||||||
if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
|
if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
|
||||||
|
|
||||||
},
|
},
|
||||||
uploadComplete: function (event, file) {
|
uploadComplete: function (event, file) {
|
||||||
if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
|
if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
|
||||||
// upload has completed, lets try the next one in the queue
|
// upload has completed, lets try the next one in the queue
|
||||||
// but only if this queue is not disabled
|
// but only if this queue is not disabled
|
||||||
if (!$('input[name=disabled]:checked', this).length) {
|
if (!$('input[name=disabled]:checked', this).length) {
|
||||||
$(this).swfupload('startUpload');
|
$(this).swfupload('startUpload');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadError: function (event, file, errorCode, message) {
|
uploadError: function (event, file, errorCode, message) {
|
||||||
if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
|
if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$(gnu.container_el).bindAll(listeners);
|
$(gnu.container_el).bindAll(listeners);
|
||||||
/* listeners이벤트 */
|
/* listeners이벤트 */
|
||||||
|
|
||||||
$(gnu.dreg_area).bind('drop dragover', function (e) {
|
$(gnu.dreg_area).bind('drop dragover', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
|
if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
|
||||||
});
|
});
|
||||||
$("#all_remove_btn").bind("click", function (e) {
|
$("#all_remove_btn").bind("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if ($(gnu.dreg_area_list).children().length) {
|
if ($(gnu.dreg_area_list).children().length) {
|
||||||
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
|
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
|
||||||
$(gnu.dreg_area_list).find(".delete_img").each(function (i) {
|
$(gnu.dreg_area_list).find(".delete_img").each(function (i) {
|
||||||
$(this).trigger("click");
|
$(this).trigger("click");
|
||||||
});
|
});
|
||||||
$(gnu.dreg_area_list).sortable('refresh');
|
$(gnu.dreg_area_list).sortable('refresh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#img_upload_submit").bind("click", function (e) {
|
$("#img_upload_submit").bind("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var aResult = [], j = 0;
|
var aResult = [], j = 0;
|
||||||
$(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
|
$(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
|
||||||
if (!$(this).attr("data-url")) return true;
|
if (!$(this).attr("data-url")) return true;
|
||||||
aResult[j] = [];
|
aResult[j] = [];
|
||||||
aResult[j]['bNewLine'] = 'true';
|
aResult[j]['bNewLine'] = 'true';
|
||||||
aResult[j]['sAlign'] = '';
|
aResult[j]['sAlign'] = '';
|
||||||
aResult[j]['sFileName'] = $(this).attr("data-delete");
|
aResult[j]['sFileName'] = $(this).attr("data-delete");
|
||||||
aResult[j]['sFileURL'] = $(this).attr("data-url");
|
aResult[j]['sFileURL'] = $(this).attr("data-url");
|
||||||
j++;
|
j++;
|
||||||
});
|
});
|
||||||
if (aResult.length) {
|
if (aResult.length) {
|
||||||
gnu.setPhotoToEditor(aResult);
|
gnu.setPhotoToEditor(aResult);
|
||||||
aResult = null;
|
aResult = null;
|
||||||
}
|
}
|
||||||
window.close();
|
window.close();
|
||||||
});
|
});
|
||||||
$("#close_w_btn").bind("click", function (e) {
|
$("#close_w_btn").bind("click", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.close();
|
window.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -13,160 +13,160 @@
|
||||||
/* global define, window */
|
/* global define, window */
|
||||||
|
|
||||||
(function (factory) {
|
(function (factory) {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// Register as an anonymous AMD module:
|
// Register as an anonymous AMD module:
|
||||||
define([
|
define([
|
||||||
'jquery',
|
'jquery',
|
||||||
'./jquery.fileupload'
|
'./jquery.fileupload'
|
||||||
], factory);
|
], factory);
|
||||||
} else {
|
} else {
|
||||||
// Browser globals:
|
// Browser globals:
|
||||||
factory(
|
factory(
|
||||||
window.jQuery
|
window.jQuery
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}(function ($) {
|
}(function ($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var originalAdd = $.blueimp.fileupload.prototype.options.add;
|
var originalAdd = $.blueimp.fileupload.prototype.options.add;
|
||||||
|
|
||||||
// The File Upload Processing plugin extends the fileupload widget
|
// The File Upload Processing plugin extends the fileupload widget
|
||||||
// with file processing functionality:
|
// with file processing functionality:
|
||||||
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
||||||
|
|
||||||
options: {
|
options: {
|
||||||
// The list of processing actions:
|
// The list of processing actions:
|
||||||
processQueue: [
|
processQueue: [
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
action: 'log',
|
action: 'log',
|
||||||
type: 'debug'
|
type: 'debug'
|
||||||
}
|
|
||||||
*/
|
|
||||||
],
|
|
||||||
add: function (e, data) {
|
|
||||||
var $this = $(this);
|
|
||||||
data.process(function () {
|
|
||||||
return $this.fileupload('process', data);
|
|
||||||
});
|
|
||||||
originalAdd.call(this, e, data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
processActions: {
|
|
||||||
/*
|
|
||||||
log: function (data, options) {
|
|
||||||
console[options.type](
|
|
||||||
'Processing "' + data.files[data.index].name + '"'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
},
|
|
||||||
|
|
||||||
_processFile: function (data, originalData) {
|
|
||||||
var that = this,
|
|
||||||
dfd = $.Deferred().resolveWith(that, [data]),
|
|
||||||
chain = dfd.promise();
|
|
||||||
this._trigger('process', null, data);
|
|
||||||
$.each(data.processQueue, function (i, settings) {
|
|
||||||
var func = function (data) {
|
|
||||||
if (originalData.errorThrown) {
|
|
||||||
return $.Deferred()
|
|
||||||
.rejectWith(that, [originalData]).promise();
|
|
||||||
}
|
|
||||||
return that.processActions[settings.action].call(
|
|
||||||
that,
|
|
||||||
data,
|
|
||||||
settings
|
|
||||||
);
|
|
||||||
};
|
|
||||||
chain = chain.pipe(func, settings.always && func);
|
|
||||||
});
|
|
||||||
chain
|
|
||||||
.done(function () {
|
|
||||||
that._trigger('processdone', null, data);
|
|
||||||
that._trigger('processalways', null, data);
|
|
||||||
})
|
|
||||||
.fail(function () {
|
|
||||||
that._trigger('processfail', null, data);
|
|
||||||
that._trigger('processalways', null, data);
|
|
||||||
});
|
|
||||||
return chain;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Replaces the settings of each processQueue item that
|
|
||||||
// are strings starting with an "@", using the remaining
|
|
||||||
// substring as key for the option map,
|
|
||||||
// e.g. "@autoUpload" is replaced with options.autoUpload:
|
|
||||||
_transformProcessQueue: function (options) {
|
|
||||||
var processQueue = [];
|
|
||||||
$.each(options.processQueue, function () {
|
|
||||||
var settings = {},
|
|
||||||
action = this.action,
|
|
||||||
prefix = this.prefix === true ? action : this.prefix;
|
|
||||||
$.each(this, function (key, value) {
|
|
||||||
if ($.type(value) === 'string' &&
|
|
||||||
value.charAt(0) === '@') {
|
|
||||||
settings[key] = options[
|
|
||||||
value.slice(1) || (prefix ? prefix +
|
|
||||||
key.charAt(0).toUpperCase() + key.slice(1) : key)
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
settings[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
processQueue.push(settings);
|
|
||||||
});
|
|
||||||
options.processQueue = processQueue;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Returns the number of files currently in the processsing queue:
|
|
||||||
processing: function () {
|
|
||||||
return this._processing;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Processes the files given as files property of the data parameter,
|
|
||||||
// returns a Promise object that allows to bind callbacks:
|
|
||||||
process: function (data) {
|
|
||||||
var that = this,
|
|
||||||
options = $.extend({}, this.options, data);
|
|
||||||
if (options.processQueue && options.processQueue.length) {
|
|
||||||
this._transformProcessQueue(options);
|
|
||||||
if (this._processing === 0) {
|
|
||||||
this._trigger('processstart');
|
|
||||||
}
|
|
||||||
$.each(data.files, function (index) {
|
|
||||||
var opts = index ? $.extend({}, options) : options,
|
|
||||||
func = function () {
|
|
||||||
if (data.errorThrown) {
|
|
||||||
return $.Deferred()
|
|
||||||
.rejectWith(that, [data]).promise();
|
|
||||||
}
|
|
||||||
return that._processFile(opts, data);
|
|
||||||
};
|
|
||||||
opts.index = index;
|
|
||||||
that._processing += 1;
|
|
||||||
that._processingQueue = that._processingQueue.pipe(func, func)
|
|
||||||
.always(function () {
|
|
||||||
that._processing -= 1;
|
|
||||||
if (that._processing === 0) {
|
|
||||||
that._trigger('processstop');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return this._processingQueue;
|
|
||||||
},
|
|
||||||
|
|
||||||
_create: function () {
|
|
||||||
this._super();
|
|
||||||
this._processing = 0;
|
|
||||||
this._processingQueue = $.Deferred().resolveWith(this)
|
|
||||||
.promise();
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
add: function (e, data) {
|
||||||
|
var $this = $(this);
|
||||||
|
data.process(function () {
|
||||||
|
return $this.fileupload('process', data);
|
||||||
|
});
|
||||||
|
originalAdd.call(this, e, data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
});
|
processActions: {
|
||||||
|
/*
|
||||||
|
log: function (data, options) {
|
||||||
|
console[options.type](
|
||||||
|
'Processing "' + data.files[data.index].name + '"'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
},
|
||||||
|
|
||||||
|
_processFile: function (data, originalData) {
|
||||||
|
var that = this,
|
||||||
|
dfd = $.Deferred().resolveWith(that, [data]),
|
||||||
|
chain = dfd.promise();
|
||||||
|
this._trigger('process', null, data);
|
||||||
|
$.each(data.processQueue, function (i, settings) {
|
||||||
|
var func = function (data) {
|
||||||
|
if (originalData.errorThrown) {
|
||||||
|
return $.Deferred()
|
||||||
|
.rejectWith(that, [originalData]).promise();
|
||||||
|
}
|
||||||
|
return that.processActions[settings.action].call(
|
||||||
|
that,
|
||||||
|
data,
|
||||||
|
settings
|
||||||
|
);
|
||||||
|
};
|
||||||
|
chain = chain.pipe(func, settings.always && func);
|
||||||
|
});
|
||||||
|
chain
|
||||||
|
.done(function () {
|
||||||
|
that._trigger('processdone', null, data);
|
||||||
|
that._trigger('processalways', null, data);
|
||||||
|
})
|
||||||
|
.fail(function () {
|
||||||
|
that._trigger('processfail', null, data);
|
||||||
|
that._trigger('processalways', null, data);
|
||||||
|
});
|
||||||
|
return chain;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Replaces the settings of each processQueue item that
|
||||||
|
// are strings starting with an "@", using the remaining
|
||||||
|
// substring as key for the option map,
|
||||||
|
// e.g. "@autoUpload" is replaced with options.autoUpload:
|
||||||
|
_transformProcessQueue: function (options) {
|
||||||
|
var processQueue = [];
|
||||||
|
$.each(options.processQueue, function () {
|
||||||
|
var settings = {},
|
||||||
|
action = this.action,
|
||||||
|
prefix = this.prefix === true ? action : this.prefix;
|
||||||
|
$.each(this, function (key, value) {
|
||||||
|
if ($.type(value) === 'string' &&
|
||||||
|
value.charAt(0) === '@') {
|
||||||
|
settings[key] = options[
|
||||||
|
value.slice(1) || (prefix ? prefix +
|
||||||
|
key.charAt(0).toUpperCase() + key.slice(1) : key)
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
settings[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
processQueue.push(settings);
|
||||||
|
});
|
||||||
|
options.processQueue = processQueue;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Returns the number of files currently in the processsing queue:
|
||||||
|
processing: function () {
|
||||||
|
return this._processing;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Processes the files given as files property of the data parameter,
|
||||||
|
// returns a Promise object that allows to bind callbacks:
|
||||||
|
process: function (data) {
|
||||||
|
var that = this,
|
||||||
|
options = $.extend({}, this.options, data);
|
||||||
|
if (options.processQueue && options.processQueue.length) {
|
||||||
|
this._transformProcessQueue(options);
|
||||||
|
if (this._processing === 0) {
|
||||||
|
this._trigger('processstart');
|
||||||
|
}
|
||||||
|
$.each(data.files, function (index) {
|
||||||
|
var opts = index ? $.extend({}, options) : options,
|
||||||
|
func = function () {
|
||||||
|
if (data.errorThrown) {
|
||||||
|
return $.Deferred()
|
||||||
|
.rejectWith(that, [data]).promise();
|
||||||
|
}
|
||||||
|
return that._processFile(opts, data);
|
||||||
|
};
|
||||||
|
opts.index = index;
|
||||||
|
that._processing += 1;
|
||||||
|
that._processingQueue = that._processingQueue.pipe(func, func)
|
||||||
|
.always(function () {
|
||||||
|
that._processing -= 1;
|
||||||
|
if (that._processing === 0) {
|
||||||
|
that._trigger('processstop');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return this._processingQueue;
|
||||||
|
},
|
||||||
|
|
||||||
|
_create: function () {
|
||||||
|
this._super();
|
||||||
|
this._processing = 0;
|
||||||
|
this._processingQueue = $.Deferred().resolveWith(this)
|
||||||
|
.promise();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -12,203 +12,203 @@
|
||||||
/* global define, window, document */
|
/* global define, window, document */
|
||||||
|
|
||||||
(function (factory) {
|
(function (factory) {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (typeof define === 'function' && define.amd) {
|
if (typeof define === 'function' && define.amd) {
|
||||||
// Register as an anonymous AMD module:
|
// Register as an anonymous AMD module:
|
||||||
define(['jquery'], factory);
|
define(['jquery'], factory);
|
||||||
} else {
|
} else {
|
||||||
// Browser globals:
|
// Browser globals:
|
||||||
factory(window.jQuery);
|
factory(window.jQuery);
|
||||||
}
|
}
|
||||||
}(function ($) {
|
}(function ($) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// Helper variable to create unique names for the transport iframes:
|
// Helper variable to create unique names for the transport iframes:
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
|
|
||||||
// The iframe transport accepts four additional options:
|
// The iframe transport accepts four additional options:
|
||||||
// options.fileInput: a jQuery collection of file input fields
|
// options.fileInput: a jQuery collection of file input fields
|
||||||
// options.paramName: the parameter name for the file form data,
|
// options.paramName: the parameter name for the file form data,
|
||||||
// overrides the name property of the file input field(s),
|
// overrides the name property of the file input field(s),
|
||||||
// can be a string or an array of strings.
|
// can be a string or an array of strings.
|
||||||
// options.formData: an array of objects with name and value properties,
|
// options.formData: an array of objects with name and value properties,
|
||||||
// equivalent to the return data of .serializeArray(), e.g.:
|
// equivalent to the return data of .serializeArray(), e.g.:
|
||||||
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
||||||
// options.initialIframeSrc: the URL of the initial iframe src,
|
// options.initialIframeSrc: the URL of the initial iframe src,
|
||||||
// by default set to "javascript:false;"
|
// by default set to "javascript:false;"
|
||||||
$.ajaxTransport('iframe', function (options) {
|
$.ajaxTransport('iframe', function (options) {
|
||||||
if (options.async) {
|
if (options.async) {
|
||||||
// javascript:false as initial iframe src
|
// javascript:false as initial iframe src
|
||||||
// prevents warning popups on HTTPS in IE6:
|
// prevents warning popups on HTTPS in IE6:
|
||||||
/*jshint scripturl: true */
|
/*jshint scripturl: true */
|
||||||
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
|
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
|
||||||
/*jshint scripturl: false */
|
/*jshint scripturl: false */
|
||||||
form,
|
form,
|
||||||
iframe,
|
iframe,
|
||||||
addParamChar;
|
addParamChar;
|
||||||
return {
|
return {
|
||||||
send: function (_, completeCallback) {
|
send: function (_, completeCallback) {
|
||||||
form = $('<form style="display:none;"></form>');
|
form = $('<form style="display:none;"></form>');
|
||||||
form.attr('accept-charset', options.formAcceptCharset);
|
form.attr('accept-charset', options.formAcceptCharset);
|
||||||
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
||||||
// XDomainRequest only supports GET and POST:
|
// XDomainRequest only supports GET and POST:
|
||||||
if (options.type === 'DELETE') {
|
if (options.type === 'DELETE') {
|
||||||
options.url = options.url + addParamChar + '_method=DELETE';
|
options.url = options.url + addParamChar + '_method=DELETE';
|
||||||
options.type = 'POST';
|
options.type = 'POST';
|
||||||
} else if (options.type === 'PUT') {
|
} else if (options.type === 'PUT') {
|
||||||
options.url = options.url + addParamChar + '_method=PUT';
|
options.url = options.url + addParamChar + '_method=PUT';
|
||||||
options.type = 'POST';
|
options.type = 'POST';
|
||||||
} else if (options.type === 'PATCH') {
|
} else if (options.type === 'PATCH') {
|
||||||
options.url = options.url + addParamChar + '_method=PATCH';
|
options.url = options.url + addParamChar + '_method=PATCH';
|
||||||
options.type = 'POST';
|
options.type = 'POST';
|
||||||
}
|
}
|
||||||
// IE versions below IE8 cannot set the name property of
|
// IE versions below IE8 cannot set the name property of
|
||||||
// elements that have already been added to the DOM,
|
// elements that have already been added to the DOM,
|
||||||
// so we set the name along with the iframe HTML markup:
|
// so we set the name along with the iframe HTML markup:
|
||||||
counter += 1;
|
counter += 1;
|
||||||
iframe = $(
|
iframe = $(
|
||||||
'<iframe src="' + initialIframeSrc +
|
'<iframe src="' + initialIframeSrc +
|
||||||
'" name="iframe-transport-' + counter + '"></iframe>'
|
'" name="iframe-transport-' + counter + '"></iframe>'
|
||||||
).bind('load', function () {
|
).bind('load', function () {
|
||||||
var fileInputClones,
|
var fileInputClones,
|
||||||
paramNames = $.isArray(options.paramName) ?
|
paramNames = $.isArray(options.paramName) ?
|
||||||
options.paramName : [options.paramName];
|
options.paramName : [options.paramName];
|
||||||
iframe
|
iframe
|
||||||
.unbind('load')
|
.unbind('load')
|
||||||
.bind('load', function () {
|
.bind('load', function () {
|
||||||
var response;
|
var response;
|
||||||
// Wrap in a try/catch block to catch exceptions thrown
|
// Wrap in a try/catch block to catch exceptions thrown
|
||||||
// when trying to access cross-domain iframe contents:
|
// when trying to access cross-domain iframe contents:
|
||||||
try {
|
try {
|
||||||
response = iframe.contents();
|
response = iframe.contents();
|
||||||
// Google Chrome and Firefox do not throw an
|
// Google Chrome and Firefox do not throw an
|
||||||
// exception when calling iframe.contents() on
|
// exception when calling iframe.contents() on
|
||||||
// cross-domain requests, so we unify the response:
|
// cross-domain requests, so we unify the response:
|
||||||
if (!response.length || !response[0].firstChild) {
|
if (!response.length || !response[0].firstChild) {
|
||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
response = undefined;
|
response = undefined;
|
||||||
}
|
|
||||||
// The complete callback returns the
|
|
||||||
// iframe content document as response object:
|
|
||||||
completeCallback(
|
|
||||||
200,
|
|
||||||
'success',
|
|
||||||
{'iframe': response}
|
|
||||||
);
|
|
||||||
// Fix for IE endless progress bar activity bug
|
|
||||||
// (happens on form submits to iframe targets):
|
|
||||||
$('<iframe src="' + initialIframeSrc + '"></iframe>')
|
|
||||||
.appendTo(form);
|
|
||||||
window.setTimeout(function () {
|
|
||||||
// Removing the form in a setTimeout call
|
|
||||||
// allows Chrome's developer tools to display
|
|
||||||
// the response result
|
|
||||||
form.remove();
|
|
||||||
}, 0);
|
|
||||||
});
|
|
||||||
form
|
|
||||||
.prop('target', iframe.prop('name'))
|
|
||||||
.prop('action', options.url)
|
|
||||||
.prop('method', options.type);
|
|
||||||
if (options.formData) {
|
|
||||||
$.each(options.formData, function (index, field) {
|
|
||||||
$('<input type="hidden"/>')
|
|
||||||
.prop('name', field.name)
|
|
||||||
.val(field.value)
|
|
||||||
.appendTo(form);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (options.fileInput && options.fileInput.length &&
|
|
||||||
options.type === 'POST') {
|
|
||||||
fileInputClones = options.fileInput.clone();
|
|
||||||
// Insert a clone for each file input field:
|
|
||||||
options.fileInput.after(function (index) {
|
|
||||||
return fileInputClones[index];
|
|
||||||
});
|
|
||||||
if (options.paramName) {
|
|
||||||
options.fileInput.each(function (index) {
|
|
||||||
$(this).prop(
|
|
||||||
'name',
|
|
||||||
paramNames[index] || options.paramName
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// Appending the file input fields to the hidden form
|
|
||||||
// removes them from their original location:
|
|
||||||
form
|
|
||||||
.append(options.fileInput)
|
|
||||||
.prop('enctype', 'multipart/form-data')
|
|
||||||
// enctype must be set as encoding for IE:
|
|
||||||
.prop('encoding', 'multipart/form-data');
|
|
||||||
// Remove the HTML5 form attribute from the input(s):
|
|
||||||
options.fileInput.removeAttr('form');
|
|
||||||
}
|
|
||||||
form.submit();
|
|
||||||
// Insert the file input fields at their original location
|
|
||||||
// by replacing the clones with the originals:
|
|
||||||
if (fileInputClones && fileInputClones.length) {
|
|
||||||
options.fileInput.each(function (index, input) {
|
|
||||||
var clone = $(fileInputClones[index]);
|
|
||||||
// Restore the original name and form properties:
|
|
||||||
$(input)
|
|
||||||
.prop('name', clone.prop('name'))
|
|
||||||
.attr('form', clone.attr('form'));
|
|
||||||
clone.replaceWith(input);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
form.append(iframe).appendTo(document.body);
|
|
||||||
},
|
|
||||||
abort: function () {
|
|
||||||
if (iframe) {
|
|
||||||
// javascript:false as iframe src aborts the request
|
|
||||||
// and prevents warning popups on HTTPS in IE6.
|
|
||||||
// concat is used to avoid the "Script URL" JSLint error:
|
|
||||||
iframe
|
|
||||||
.unbind('load')
|
|
||||||
.prop('src', initialIframeSrc);
|
|
||||||
}
|
|
||||||
if (form) {
|
|
||||||
form.remove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
// The complete callback returns the
|
||||||
}
|
// iframe content document as response object:
|
||||||
});
|
completeCallback(
|
||||||
|
200,
|
||||||
// The iframe transport returns the iframe content document as response.
|
'success',
|
||||||
// The following adds converters from iframe to text, json, html, xml
|
{ 'iframe': response }
|
||||||
// and script.
|
);
|
||||||
// Please note that the Content-Type for JSON responses has to be text/plain
|
// Fix for IE endless progress bar activity bug
|
||||||
// or text/html, if the browser doesn't include application/json in the
|
// (happens on form submits to iframe targets):
|
||||||
// Accept header, else IE will show a download dialog.
|
$('<iframe src="' + initialIframeSrc + '"></iframe>')
|
||||||
// The Content-Type for XML responses on the other hand has to be always
|
.appendTo(form);
|
||||||
// application/xml or text/xml, so IE properly parses the XML response.
|
window.setTimeout(function () {
|
||||||
// See also
|
// Removing the form in a setTimeout call
|
||||||
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
|
// allows Chrome's developer tools to display
|
||||||
$.ajaxSetup({
|
// the response result
|
||||||
converters: {
|
form.remove();
|
||||||
'iframe text': function (iframe) {
|
}, 0);
|
||||||
return iframe && $(iframe[0].body).text();
|
});
|
||||||
},
|
form
|
||||||
'iframe json': function (iframe) {
|
.prop('target', iframe.prop('name'))
|
||||||
return iframe && $.parseJSON($(iframe[0].body).text());
|
.prop('action', options.url)
|
||||||
},
|
.prop('method', options.type);
|
||||||
'iframe html': function (iframe) {
|
if (options.formData) {
|
||||||
return iframe && $(iframe[0].body).html();
|
$.each(options.formData, function (index, field) {
|
||||||
},
|
$('<input type="hidden"/>')
|
||||||
'iframe xml': function (iframe) {
|
.prop('name', field.name)
|
||||||
var xmlDoc = iframe && iframe[0];
|
.val(field.value)
|
||||||
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
|
.appendTo(form);
|
||||||
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
|
});
|
||||||
$(xmlDoc.body).html());
|
|
||||||
},
|
|
||||||
'iframe script': function (iframe) {
|
|
||||||
return iframe && $.globalEval($(iframe[0].body).text());
|
|
||||||
}
|
}
|
||||||
|
if (options.fileInput && options.fileInput.length &&
|
||||||
|
options.type === 'POST') {
|
||||||
|
fileInputClones = options.fileInput.clone();
|
||||||
|
// Insert a clone for each file input field:
|
||||||
|
options.fileInput.after(function (index) {
|
||||||
|
return fileInputClones[index];
|
||||||
|
});
|
||||||
|
if (options.paramName) {
|
||||||
|
options.fileInput.each(function (index) {
|
||||||
|
$(this).prop(
|
||||||
|
'name',
|
||||||
|
paramNames[index] || options.paramName
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Appending the file input fields to the hidden form
|
||||||
|
// removes them from their original location:
|
||||||
|
form
|
||||||
|
.append(options.fileInput)
|
||||||
|
.prop('enctype', 'multipart/form-data')
|
||||||
|
// enctype must be set as encoding for IE:
|
||||||
|
.prop('encoding', 'multipart/form-data');
|
||||||
|
// Remove the HTML5 form attribute from the input(s):
|
||||||
|
options.fileInput.removeAttr('form');
|
||||||
|
}
|
||||||
|
form.submit();
|
||||||
|
// Insert the file input fields at their original location
|
||||||
|
// by replacing the clones with the originals:
|
||||||
|
if (fileInputClones && fileInputClones.length) {
|
||||||
|
options.fileInput.each(function (index, input) {
|
||||||
|
var clone = $(fileInputClones[index]);
|
||||||
|
// Restore the original name and form properties:
|
||||||
|
$(input)
|
||||||
|
.prop('name', clone.prop('name'))
|
||||||
|
.attr('form', clone.attr('form'));
|
||||||
|
clone.replaceWith(input);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
form.append(iframe).appendTo(document.body);
|
||||||
|
},
|
||||||
|
abort: function () {
|
||||||
|
if (iframe) {
|
||||||
|
// javascript:false as iframe src aborts the request
|
||||||
|
// and prevents warning popups on HTTPS in IE6.
|
||||||
|
// concat is used to avoid the "Script URL" JSLint error:
|
||||||
|
iframe
|
||||||
|
.unbind('load')
|
||||||
|
.prop('src', initialIframeSrc);
|
||||||
|
}
|
||||||
|
if (form) {
|
||||||
|
form.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// The iframe transport returns the iframe content document as response.
|
||||||
|
// The following adds converters from iframe to text, json, html, xml
|
||||||
|
// and script.
|
||||||
|
// Please note that the Content-Type for JSON responses has to be text/plain
|
||||||
|
// or text/html, if the browser doesn't include application/json in the
|
||||||
|
// Accept header, else IE will show a download dialog.
|
||||||
|
// The Content-Type for XML responses on the other hand has to be always
|
||||||
|
// application/xml or text/xml, so IE properly parses the XML response.
|
||||||
|
// See also
|
||||||
|
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
|
||||||
|
$.ajaxSetup({
|
||||||
|
converters: {
|
||||||
|
'iframe text': function (iframe) {
|
||||||
|
return iframe && $(iframe[0].body).text();
|
||||||
|
},
|
||||||
|
'iframe json': function (iframe) {
|
||||||
|
return iframe && $.parseJSON($(iframe[0].body).text());
|
||||||
|
},
|
||||||
|
'iframe html': function (iframe) {
|
||||||
|
return iframe && $(iframe[0].body).html();
|
||||||
|
},
|
||||||
|
'iframe xml': function (iframe) {
|
||||||
|
var xmlDoc = iframe && iframe[0];
|
||||||
|
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
|
||||||
|
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
|
||||||
|
$(xmlDoc.body).html());
|
||||||
|
},
|
||||||
|
'iframe script': function (iframe) {
|
||||||
|
return iframe && $.globalEval($(iframe[0].body).text());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -10,521 +10,521 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (factory) {
|
(function (factory) {
|
||||||
if (typeof define === "function" && define.amd) {
|
if (typeof define === "function" && define.amd) {
|
||||||
// Register as an anonymous AMD module:
|
// Register as an anonymous AMD module:
|
||||||
define(["jquery"], factory);
|
define(["jquery"], factory);
|
||||||
} else {
|
} else {
|
||||||
// Browser globals:
|
// Browser globals:
|
||||||
factory(jQuery);
|
factory(jQuery);
|
||||||
|
}
|
||||||
|
}(function ($, undefined) {
|
||||||
|
|
||||||
|
var uuid = 0,
|
||||||
|
slice = Array.prototype.slice,
|
||||||
|
_cleanData = $.cleanData;
|
||||||
|
$.cleanData = function (elems) {
|
||||||
|
for (var i = 0, elem; (elem = elems[i]) != null; i++) {
|
||||||
|
try {
|
||||||
|
$(elem).triggerHandler("remove");
|
||||||
|
// http://bugs.jquery.com/ticket/8235
|
||||||
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
}(function( $, undefined ) {
|
_cleanData(elems);
|
||||||
|
};
|
||||||
|
|
||||||
var uuid = 0,
|
$.widget = function (name, base, prototype) {
|
||||||
slice = Array.prototype.slice,
|
var fullName, existingConstructor, constructor, basePrototype,
|
||||||
_cleanData = $.cleanData;
|
// proxiedPrototype allows the provided prototype to remain unmodified
|
||||||
$.cleanData = function( elems ) {
|
// so that it can be used as a mixin for multiple widgets (#8876)
|
||||||
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
proxiedPrototype = {},
|
||||||
try {
|
namespace = name.split(".")[0];
|
||||||
$( elem ).triggerHandler( "remove" );
|
|
||||||
// http://bugs.jquery.com/ticket/8235
|
|
||||||
} catch( e ) {}
|
|
||||||
}
|
|
||||||
_cleanData( elems );
|
|
||||||
};
|
|
||||||
|
|
||||||
$.widget = function( name, base, prototype ) {
|
name = name.split(".")[1];
|
||||||
var fullName, existingConstructor, constructor, basePrototype,
|
fullName = namespace + "-" + name;
|
||||||
// proxiedPrototype allows the provided prototype to remain unmodified
|
|
||||||
// so that it can be used as a mixin for multiple widgets (#8876)
|
|
||||||
proxiedPrototype = {},
|
|
||||||
namespace = name.split( "." )[ 0 ];
|
|
||||||
|
|
||||||
name = name.split( "." )[ 1 ];
|
if (!prototype) {
|
||||||
fullName = namespace + "-" + name;
|
prototype = base;
|
||||||
|
base = $.Widget;
|
||||||
|
}
|
||||||
|
|
||||||
if ( !prototype ) {
|
// create selector for plugin
|
||||||
prototype = base;
|
$.expr[":"][fullName.toLowerCase()] = function (elem) {
|
||||||
base = $.Widget;
|
return !!$.data(elem, fullName);
|
||||||
}
|
};
|
||||||
|
|
||||||
// create selector for plugin
|
$[namespace] = $[namespace] || {};
|
||||||
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
|
existingConstructor = $[namespace][name];
|
||||||
return !!$.data( elem, fullName );
|
constructor = $[namespace][name] = function (options, element) {
|
||||||
};
|
// allow instantiation without "new" keyword
|
||||||
|
if (!this._createWidget) {
|
||||||
|
return new constructor(options, element);
|
||||||
|
}
|
||||||
|
|
||||||
$[ namespace ] = $[ namespace ] || {};
|
// allow instantiation without initializing for simple inheritance
|
||||||
existingConstructor = $[ namespace ][ name ];
|
// must use "new" keyword (the code above always passes args)
|
||||||
constructor = $[ namespace ][ name ] = function( options, element ) {
|
if (arguments.length) {
|
||||||
// allow instantiation without "new" keyword
|
this._createWidget(options, element);
|
||||||
if ( !this._createWidget ) {
|
}
|
||||||
return new constructor( options, element );
|
};
|
||||||
}
|
// extend with the existing constructor to carry over any static properties
|
||||||
|
$.extend(constructor, existingConstructor, {
|
||||||
|
version: prototype.version,
|
||||||
|
// copy the object used to create the prototype in case we need to
|
||||||
|
// redefine the widget later
|
||||||
|
_proto: $.extend({}, prototype),
|
||||||
|
// track widgets that inherit from this widget in case this widget is
|
||||||
|
// redefined after a widget inherits from it
|
||||||
|
_childConstructors: []
|
||||||
|
});
|
||||||
|
|
||||||
// allow instantiation without initializing for simple inheritance
|
basePrototype = new base();
|
||||||
// must use "new" keyword (the code above always passes args)
|
// we need to make the options hash a property directly on the new instance
|
||||||
if ( arguments.length ) {
|
// otherwise we'll modify the options hash on the prototype that we're
|
||||||
this._createWidget( options, element );
|
// inheriting from
|
||||||
}
|
basePrototype.options = $.widget.extend({}, basePrototype.options);
|
||||||
};
|
$.each(prototype, function (prop, value) {
|
||||||
// extend with the existing constructor to carry over any static properties
|
if (!$.isFunction(value)) {
|
||||||
$.extend( constructor, existingConstructor, {
|
proxiedPrototype[prop] = value;
|
||||||
version: prototype.version,
|
return;
|
||||||
// copy the object used to create the prototype in case we need to
|
}
|
||||||
// redefine the widget later
|
proxiedPrototype[prop] = (function () {
|
||||||
_proto: $.extend( {}, prototype ),
|
var _super = function () {
|
||||||
// track widgets that inherit from this widget in case this widget is
|
return base.prototype[prop].apply(this, arguments);
|
||||||
// redefined after a widget inherits from it
|
},
|
||||||
_childConstructors: []
|
_superApply = function (args) {
|
||||||
});
|
return base.prototype[prop].apply(this, args);
|
||||||
|
};
|
||||||
|
return function () {
|
||||||
|
var __super = this._super,
|
||||||
|
__superApply = this._superApply,
|
||||||
|
returnValue;
|
||||||
|
|
||||||
basePrototype = new base();
|
this._super = _super;
|
||||||
// we need to make the options hash a property directly on the new instance
|
this._superApply = _superApply;
|
||||||
// otherwise we'll modify the options hash on the prototype that we're
|
|
||||||
// inheriting from
|
|
||||||
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
|
||||||
$.each( prototype, function( prop, value ) {
|
|
||||||
if ( !$.isFunction( value ) ) {
|
|
||||||
proxiedPrototype[ prop ] = value;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
proxiedPrototype[ prop ] = (function() {
|
|
||||||
var _super = function() {
|
|
||||||
return base.prototype[ prop ].apply( this, arguments );
|
|
||||||
},
|
|
||||||
_superApply = function( args ) {
|
|
||||||
return base.prototype[ prop ].apply( this, args );
|
|
||||||
};
|
|
||||||
return function() {
|
|
||||||
var __super = this._super,
|
|
||||||
__superApply = this._superApply,
|
|
||||||
returnValue;
|
|
||||||
|
|
||||||
this._super = _super;
|
returnValue = value.apply(this, arguments);
|
||||||
this._superApply = _superApply;
|
|
||||||
|
|
||||||
returnValue = value.apply( this, arguments );
|
this._super = __super;
|
||||||
|
this._superApply = __superApply;
|
||||||
|
|
||||||
this._super = __super;
|
return returnValue;
|
||||||
this._superApply = __superApply;
|
};
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
constructor.prototype = $.widget.extend(basePrototype, {
|
||||||
|
// TODO: remove support for widgetEventPrefix
|
||||||
|
// always use the name + a colon as the prefix, e.g., draggable:start
|
||||||
|
// don't prefix for widgets that aren't DOM-based
|
||||||
|
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
|
||||||
|
}, proxiedPrototype, {
|
||||||
|
constructor: constructor,
|
||||||
|
namespace: namespace,
|
||||||
|
widgetName: name,
|
||||||
|
widgetFullName: fullName
|
||||||
|
});
|
||||||
|
|
||||||
return returnValue;
|
// If this widget is being redefined then we need to find all widgets that
|
||||||
};
|
// are inheriting from it and redefine all of them so that they inherit from
|
||||||
})();
|
// the new version of this widget. We're essentially trying to replace one
|
||||||
});
|
// level in the prototype chain.
|
||||||
constructor.prototype = $.widget.extend( basePrototype, {
|
if (existingConstructor) {
|
||||||
// TODO: remove support for widgetEventPrefix
|
$.each(existingConstructor._childConstructors, function (i, child) {
|
||||||
// always use the name + a colon as the prefix, e.g., draggable:start
|
var childPrototype = child.prototype;
|
||||||
// don't prefix for widgets that aren't DOM-based
|
|
||||||
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
|
|
||||||
}, proxiedPrototype, {
|
|
||||||
constructor: constructor,
|
|
||||||
namespace: namespace,
|
|
||||||
widgetName: name,
|
|
||||||
widgetFullName: fullName
|
|
||||||
});
|
|
||||||
|
|
||||||
// If this widget is being redefined then we need to find all widgets that
|
// redefine the child widget using the same prototype that was
|
||||||
// are inheriting from it and redefine all of them so that they inherit from
|
// originally used, but inherit from the new version of the base
|
||||||
// the new version of this widget. We're essentially trying to replace one
|
$.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto);
|
||||||
// level in the prototype chain.
|
});
|
||||||
if ( existingConstructor ) {
|
// remove the list of existing child constructors from the old constructor
|
||||||
$.each( existingConstructor._childConstructors, function( i, child ) {
|
// so the old child constructors can be garbage collected
|
||||||
var childPrototype = child.prototype;
|
delete existingConstructor._childConstructors;
|
||||||
|
} else {
|
||||||
|
base._childConstructors.push(constructor);
|
||||||
|
}
|
||||||
|
|
||||||
// redefine the child widget using the same prototype that was
|
$.widget.bridge(name, constructor);
|
||||||
// originally used, but inherit from the new version of the base
|
};
|
||||||
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
|
|
||||||
});
|
|
||||||
// remove the list of existing child constructors from the old constructor
|
|
||||||
// so the old child constructors can be garbage collected
|
|
||||||
delete existingConstructor._childConstructors;
|
|
||||||
} else {
|
|
||||||
base._childConstructors.push( constructor );
|
|
||||||
}
|
|
||||||
|
|
||||||
$.widget.bridge( name, constructor );
|
$.widget.extend = function (target) {
|
||||||
};
|
var input = slice.call(arguments, 1),
|
||||||
|
inputIndex = 0,
|
||||||
|
inputLength = input.length,
|
||||||
|
key,
|
||||||
|
value;
|
||||||
|
for (; inputIndex < inputLength; inputIndex++) {
|
||||||
|
for (key in input[inputIndex]) {
|
||||||
|
value = input[inputIndex][key];
|
||||||
|
if (input[inputIndex].hasOwnProperty(key) && value !== undefined) {
|
||||||
|
// Clone objects
|
||||||
|
if ($.isPlainObject(value)) {
|
||||||
|
target[key] = $.isPlainObject(target[key]) ?
|
||||||
|
$.widget.extend({}, target[key], value) :
|
||||||
|
// Don't extend strings, arrays, etc. with objects
|
||||||
|
$.widget.extend({}, value);
|
||||||
|
// Copy everything else by reference
|
||||||
|
} else {
|
||||||
|
target[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return target;
|
||||||
|
};
|
||||||
|
|
||||||
$.widget.extend = function( target ) {
|
$.widget.bridge = function (name, object) {
|
||||||
var input = slice.call( arguments, 1 ),
|
var fullName = object.prototype.widgetFullName || name;
|
||||||
inputIndex = 0,
|
$.fn[name] = function (options) {
|
||||||
inputLength = input.length,
|
var isMethodCall = typeof options === "string",
|
||||||
key,
|
args = slice.call(arguments, 1),
|
||||||
value;
|
returnValue = this;
|
||||||
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
|
||||||
for ( key in input[ inputIndex ] ) {
|
|
||||||
value = input[ inputIndex ][ key ];
|
|
||||||
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
|
|
||||||
// Clone objects
|
|
||||||
if ( $.isPlainObject( value ) ) {
|
|
||||||
target[ key ] = $.isPlainObject( target[ key ] ) ?
|
|
||||||
$.widget.extend( {}, target[ key ], value ) :
|
|
||||||
// Don't extend strings, arrays, etc. with objects
|
|
||||||
$.widget.extend( {}, value );
|
|
||||||
// Copy everything else by reference
|
|
||||||
} else {
|
|
||||||
target[ key ] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
|
|
||||||
$.widget.bridge = function( name, object ) {
|
// allow multiple hashes to be passed on init
|
||||||
var fullName = object.prototype.widgetFullName || name;
|
options = !isMethodCall && args.length ?
|
||||||
$.fn[ name ] = function( options ) {
|
$.widget.extend.apply(null, [options].concat(args)) :
|
||||||
var isMethodCall = typeof options === "string",
|
options;
|
||||||
args = slice.call( arguments, 1 ),
|
|
||||||
returnValue = this;
|
|
||||||
|
|
||||||
// allow multiple hashes to be passed on init
|
if (isMethodCall) {
|
||||||
options = !isMethodCall && args.length ?
|
this.each(function () {
|
||||||
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
var methodValue,
|
||||||
options;
|
instance = $.data(this, fullName);
|
||||||
|
if (!instance) {
|
||||||
|
return $.error("cannot call methods on " + name + " prior to initialization; " +
|
||||||
|
"attempted to call method '" + options + "'");
|
||||||
|
}
|
||||||
|
if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
|
||||||
|
return $.error("no such method '" + options + "' for " + name + " widget instance");
|
||||||
|
}
|
||||||
|
methodValue = instance[options].apply(instance, args);
|
||||||
|
if (methodValue !== instance && methodValue !== undefined) {
|
||||||
|
returnValue = methodValue && methodValue.jquery ?
|
||||||
|
returnValue.pushStack(methodValue.get()) :
|
||||||
|
methodValue;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.each(function () {
|
||||||
|
var instance = $.data(this, fullName);
|
||||||
|
if (instance) {
|
||||||
|
instance.option(options || {})._init();
|
||||||
|
} else {
|
||||||
|
$.data(this, fullName, new object(options, this));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if ( isMethodCall ) {
|
return returnValue;
|
||||||
this.each(function() {
|
};
|
||||||
var methodValue,
|
};
|
||||||
instance = $.data( this, fullName );
|
|
||||||
if ( !instance ) {
|
|
||||||
return $.error( "cannot call methods on " + name + " prior to initialization; " +
|
|
||||||
"attempted to call method '" + options + "'" );
|
|
||||||
}
|
|
||||||
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
|
|
||||||
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
|
|
||||||
}
|
|
||||||
methodValue = instance[ options ].apply( instance, args );
|
|
||||||
if ( methodValue !== instance && methodValue !== undefined ) {
|
|
||||||
returnValue = methodValue && methodValue.jquery ?
|
|
||||||
returnValue.pushStack( methodValue.get() ) :
|
|
||||||
methodValue;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.each(function() {
|
|
||||||
var instance = $.data( this, fullName );
|
|
||||||
if ( instance ) {
|
|
||||||
instance.option( options || {} )._init();
|
|
||||||
} else {
|
|
||||||
$.data( this, fullName, new object( options, this ) );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue;
|
$.Widget = function ( /* options, element */) { };
|
||||||
};
|
$.Widget._childConstructors = [];
|
||||||
};
|
|
||||||
|
|
||||||
$.Widget = function( /* options, element */ ) {};
|
$.Widget.prototype = {
|
||||||
$.Widget._childConstructors = [];
|
widgetName: "widget",
|
||||||
|
widgetEventPrefix: "",
|
||||||
|
defaultElement: "<div>",
|
||||||
|
options: {
|
||||||
|
disabled: false,
|
||||||
|
|
||||||
$.Widget.prototype = {
|
// callbacks
|
||||||
widgetName: "widget",
|
create: null
|
||||||
widgetEventPrefix: "",
|
},
|
||||||
defaultElement: "<div>",
|
_createWidget: function (options, element) {
|
||||||
options: {
|
element = $(element || this.defaultElement || this)[0];
|
||||||
disabled: false,
|
this.element = $(element);
|
||||||
|
this.uuid = uuid++;
|
||||||
|
this.eventNamespace = "." + this.widgetName + this.uuid;
|
||||||
|
this.options = $.widget.extend({},
|
||||||
|
this.options,
|
||||||
|
this._getCreateOptions(),
|
||||||
|
options);
|
||||||
|
|
||||||
// callbacks
|
this.bindings = $();
|
||||||
create: null
|
this.hoverable = $();
|
||||||
},
|
this.focusable = $();
|
||||||
_createWidget: function( options, element ) {
|
|
||||||
element = $( element || this.defaultElement || this )[ 0 ];
|
|
||||||
this.element = $( element );
|
|
||||||
this.uuid = uuid++;
|
|
||||||
this.eventNamespace = "." + this.widgetName + this.uuid;
|
|
||||||
this.options = $.widget.extend( {},
|
|
||||||
this.options,
|
|
||||||
this._getCreateOptions(),
|
|
||||||
options );
|
|
||||||
|
|
||||||
this.bindings = $();
|
if (element !== this) {
|
||||||
this.hoverable = $();
|
$.data(element, this.widgetFullName, this);
|
||||||
this.focusable = $();
|
this._on(true, this.element, {
|
||||||
|
remove: function (event) {
|
||||||
|
if (event.target === element) {
|
||||||
|
this.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.document = $(element.style ?
|
||||||
|
// element within the document
|
||||||
|
element.ownerDocument :
|
||||||
|
// element is window or document
|
||||||
|
element.document || element);
|
||||||
|
this.window = $(this.document[0].defaultView || this.document[0].parentWindow);
|
||||||
|
}
|
||||||
|
|
||||||
if ( element !== this ) {
|
this._create();
|
||||||
$.data( element, this.widgetFullName, this );
|
this._trigger("create", null, this._getCreateEventData());
|
||||||
this._on( true, this.element, {
|
this._init();
|
||||||
remove: function( event ) {
|
},
|
||||||
if ( event.target === element ) {
|
_getCreateOptions: $.noop,
|
||||||
this.destroy();
|
_getCreateEventData: $.noop,
|
||||||
}
|
_create: $.noop,
|
||||||
}
|
_init: $.noop,
|
||||||
});
|
|
||||||
this.document = $( element.style ?
|
|
||||||
// element within the document
|
|
||||||
element.ownerDocument :
|
|
||||||
// element is window or document
|
|
||||||
element.document || element );
|
|
||||||
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
|
|
||||||
}
|
|
||||||
|
|
||||||
this._create();
|
destroy: function () {
|
||||||
this._trigger( "create", null, this._getCreateEventData() );
|
this._destroy();
|
||||||
this._init();
|
// we can probably remove the unbind calls in 2.0
|
||||||
},
|
// all event bindings should go through this._on()
|
||||||
_getCreateOptions: $.noop,
|
this.element
|
||||||
_getCreateEventData: $.noop,
|
.unbind(this.eventNamespace)
|
||||||
_create: $.noop,
|
// 1.9 BC for #7810
|
||||||
_init: $.noop,
|
// TODO remove dual storage
|
||||||
|
.removeData(this.widgetName)
|
||||||
|
.removeData(this.widgetFullName)
|
||||||
|
// support: jquery <1.6.3
|
||||||
|
// http://bugs.jquery.com/ticket/9413
|
||||||
|
.removeData($.camelCase(this.widgetFullName));
|
||||||
|
this.widget()
|
||||||
|
.unbind(this.eventNamespace)
|
||||||
|
.removeAttr("aria-disabled")
|
||||||
|
.removeClass(
|
||||||
|
this.widgetFullName + "-disabled " +
|
||||||
|
"ui-state-disabled");
|
||||||
|
|
||||||
destroy: function() {
|
// clean up events and states
|
||||||
this._destroy();
|
this.bindings.unbind(this.eventNamespace);
|
||||||
// we can probably remove the unbind calls in 2.0
|
this.hoverable.removeClass("ui-state-hover");
|
||||||
// all event bindings should go through this._on()
|
this.focusable.removeClass("ui-state-focus");
|
||||||
this.element
|
},
|
||||||
.unbind( this.eventNamespace )
|
_destroy: $.noop,
|
||||||
// 1.9 BC for #7810
|
|
||||||
// TODO remove dual storage
|
|
||||||
.removeData( this.widgetName )
|
|
||||||
.removeData( this.widgetFullName )
|
|
||||||
// support: jquery <1.6.3
|
|
||||||
// http://bugs.jquery.com/ticket/9413
|
|
||||||
.removeData( $.camelCase( this.widgetFullName ) );
|
|
||||||
this.widget()
|
|
||||||
.unbind( this.eventNamespace )
|
|
||||||
.removeAttr( "aria-disabled" )
|
|
||||||
.removeClass(
|
|
||||||
this.widgetFullName + "-disabled " +
|
|
||||||
"ui-state-disabled" );
|
|
||||||
|
|
||||||
// clean up events and states
|
widget: function () {
|
||||||
this.bindings.unbind( this.eventNamespace );
|
return this.element;
|
||||||
this.hoverable.removeClass( "ui-state-hover" );
|
},
|
||||||
this.focusable.removeClass( "ui-state-focus" );
|
|
||||||
},
|
|
||||||
_destroy: $.noop,
|
|
||||||
|
|
||||||
widget: function() {
|
option: function (key, value) {
|
||||||
return this.element;
|
var options = key,
|
||||||
},
|
parts,
|
||||||
|
curOption,
|
||||||
|
i;
|
||||||
|
|
||||||
option: function( key, value ) {
|
if (arguments.length === 0) {
|
||||||
var options = key,
|
// don't return a reference to the internal hash
|
||||||
parts,
|
return $.widget.extend({}, this.options);
|
||||||
curOption,
|
}
|
||||||
i;
|
|
||||||
|
|
||||||
if ( arguments.length === 0 ) {
|
if (typeof key === "string") {
|
||||||
// don't return a reference to the internal hash
|
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
||||||
return $.widget.extend( {}, this.options );
|
options = {};
|
||||||
}
|
parts = key.split(".");
|
||||||
|
key = parts.shift();
|
||||||
|
if (parts.length) {
|
||||||
|
curOption = options[key] = $.widget.extend({}, this.options[key]);
|
||||||
|
for (i = 0; i < parts.length - 1; i++) {
|
||||||
|
curOption[parts[i]] = curOption[parts[i]] || {};
|
||||||
|
curOption = curOption[parts[i]];
|
||||||
|
}
|
||||||
|
key = parts.pop();
|
||||||
|
if (arguments.length === 1) {
|
||||||
|
return curOption[key] === undefined ? null : curOption[key];
|
||||||
|
}
|
||||||
|
curOption[key] = value;
|
||||||
|
} else {
|
||||||
|
if (arguments.length === 1) {
|
||||||
|
return this.options[key] === undefined ? null : this.options[key];
|
||||||
|
}
|
||||||
|
options[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( typeof key === "string" ) {
|
this._setOptions(options);
|
||||||
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
|
||||||
options = {};
|
|
||||||
parts = key.split( "." );
|
|
||||||
key = parts.shift();
|
|
||||||
if ( parts.length ) {
|
|
||||||
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
|
|
||||||
for ( i = 0; i < parts.length - 1; i++ ) {
|
|
||||||
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
|
|
||||||
curOption = curOption[ parts[ i ] ];
|
|
||||||
}
|
|
||||||
key = parts.pop();
|
|
||||||
if ( arguments.length === 1 ) {
|
|
||||||
return curOption[ key ] === undefined ? null : curOption[ key ];
|
|
||||||
}
|
|
||||||
curOption[ key ] = value;
|
|
||||||
} else {
|
|
||||||
if ( arguments.length === 1 ) {
|
|
||||||
return this.options[ key ] === undefined ? null : this.options[ key ];
|
|
||||||
}
|
|
||||||
options[ key ] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this._setOptions( options );
|
return this;
|
||||||
|
},
|
||||||
|
_setOptions: function (options) {
|
||||||
|
var key;
|
||||||
|
|
||||||
return this;
|
for (key in options) {
|
||||||
},
|
this._setOption(key, options[key]);
|
||||||
_setOptions: function( options ) {
|
}
|
||||||
var key;
|
|
||||||
|
|
||||||
for ( key in options ) {
|
return this;
|
||||||
this._setOption( key, options[ key ] );
|
},
|
||||||
}
|
_setOption: function (key, value) {
|
||||||
|
this.options[key] = value;
|
||||||
|
|
||||||
return this;
|
if (key === "disabled") {
|
||||||
},
|
this.widget()
|
||||||
_setOption: function( key, value ) {
|
.toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!value)
|
||||||
this.options[ key ] = value;
|
.attr("aria-disabled", value);
|
||||||
|
this.hoverable.removeClass("ui-state-hover");
|
||||||
|
this.focusable.removeClass("ui-state-focus");
|
||||||
|
}
|
||||||
|
|
||||||
if ( key === "disabled" ) {
|
return this;
|
||||||
this.widget()
|
},
|
||||||
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
|
|
||||||
.attr( "aria-disabled", value );
|
|
||||||
this.hoverable.removeClass( "ui-state-hover" );
|
|
||||||
this.focusable.removeClass( "ui-state-focus" );
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
enable: function () {
|
||||||
},
|
return this._setOption("disabled", false);
|
||||||
|
},
|
||||||
|
disable: function () {
|
||||||
|
return this._setOption("disabled", true);
|
||||||
|
},
|
||||||
|
|
||||||
enable: function() {
|
_on: function (suppressDisabledCheck, element, handlers) {
|
||||||
return this._setOption( "disabled", false );
|
var delegateElement,
|
||||||
},
|
instance = this;
|
||||||
disable: function() {
|
|
||||||
return this._setOption( "disabled", true );
|
|
||||||
},
|
|
||||||
|
|
||||||
_on: function( suppressDisabledCheck, element, handlers ) {
|
// no suppressDisabledCheck flag, shuffle arguments
|
||||||
var delegateElement,
|
if (typeof suppressDisabledCheck !== "boolean") {
|
||||||
instance = this;
|
handlers = element;
|
||||||
|
element = suppressDisabledCheck;
|
||||||
|
suppressDisabledCheck = false;
|
||||||
|
}
|
||||||
|
|
||||||
// no suppressDisabledCheck flag, shuffle arguments
|
// no element argument, shuffle and use this.element
|
||||||
if ( typeof suppressDisabledCheck !== "boolean" ) {
|
if (!handlers) {
|
||||||
handlers = element;
|
handlers = element;
|
||||||
element = suppressDisabledCheck;
|
element = this.element;
|
||||||
suppressDisabledCheck = false;
|
delegateElement = this.widget();
|
||||||
}
|
} else {
|
||||||
|
// accept selectors, DOM elements
|
||||||
|
element = delegateElement = $(element);
|
||||||
|
this.bindings = this.bindings.add(element);
|
||||||
|
}
|
||||||
|
|
||||||
// no element argument, shuffle and use this.element
|
$.each(handlers, function (event, handler) {
|
||||||
if ( !handlers ) {
|
function handlerProxy() {
|
||||||
handlers = element;
|
// allow widgets to customize the disabled handling
|
||||||
element = this.element;
|
// - disabled as an array instead of boolean
|
||||||
delegateElement = this.widget();
|
// - disabled class as method for disabling individual parts
|
||||||
} else {
|
if (!suppressDisabledCheck &&
|
||||||
// accept selectors, DOM elements
|
(instance.options.disabled === true ||
|
||||||
element = delegateElement = $( element );
|
$(this).hasClass("ui-state-disabled"))) {
|
||||||
this.bindings = this.bindings.add( element );
|
return;
|
||||||
}
|
}
|
||||||
|
return (typeof handler === "string" ? instance[handler] : handler)
|
||||||
|
.apply(instance, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
$.each( handlers, function( event, handler ) {
|
// copy the guid so direct unbinding works
|
||||||
function handlerProxy() {
|
if (typeof handler !== "string") {
|
||||||
// allow widgets to customize the disabled handling
|
handlerProxy.guid = handler.guid =
|
||||||
// - disabled as an array instead of boolean
|
handler.guid || handlerProxy.guid || $.guid++;
|
||||||
// - disabled class as method for disabling individual parts
|
}
|
||||||
if ( !suppressDisabledCheck &&
|
|
||||||
( instance.options.disabled === true ||
|
|
||||||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
|
||||||
.apply( instance, arguments );
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy the guid so direct unbinding works
|
var match = event.match(/^(\w+)\s*(.*)$/),
|
||||||
if ( typeof handler !== "string" ) {
|
eventName = match[1] + instance.eventNamespace,
|
||||||
handlerProxy.guid = handler.guid =
|
selector = match[2];
|
||||||
handler.guid || handlerProxy.guid || $.guid++;
|
if (selector) {
|
||||||
}
|
delegateElement.delegate(selector, eventName, handlerProxy);
|
||||||
|
} else {
|
||||||
|
element.bind(eventName, handlerProxy);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
_off: function (element, eventName) {
|
||||||
eventName = match[1] + instance.eventNamespace,
|
eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
|
||||||
selector = match[2];
|
element.unbind(eventName).undelegate(eventName);
|
||||||
if ( selector ) {
|
},
|
||||||
delegateElement.delegate( selector, eventName, handlerProxy );
|
|
||||||
} else {
|
|
||||||
element.bind( eventName, handlerProxy );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_off: function( element, eventName ) {
|
_delay: function (handler, delay) {
|
||||||
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
|
function handlerProxy() {
|
||||||
element.unbind( eventName ).undelegate( eventName );
|
return (typeof handler === "string" ? instance[handler] : handler)
|
||||||
},
|
.apply(instance, arguments);
|
||||||
|
}
|
||||||
|
var instance = this;
|
||||||
|
return setTimeout(handlerProxy, delay || 0);
|
||||||
|
},
|
||||||
|
|
||||||
_delay: function( handler, delay ) {
|
_hoverable: function (element) {
|
||||||
function handlerProxy() {
|
this.hoverable = this.hoverable.add(element);
|
||||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
this._on(element, {
|
||||||
.apply( instance, arguments );
|
mouseenter: function (event) {
|
||||||
}
|
$(event.currentTarget).addClass("ui-state-hover");
|
||||||
var instance = this;
|
},
|
||||||
return setTimeout( handlerProxy, delay || 0 );
|
mouseleave: function (event) {
|
||||||
},
|
$(event.currentTarget).removeClass("ui-state-hover");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
_hoverable: function( element ) {
|
_focusable: function (element) {
|
||||||
this.hoverable = this.hoverable.add( element );
|
this.focusable = this.focusable.add(element);
|
||||||
this._on( element, {
|
this._on(element, {
|
||||||
mouseenter: function( event ) {
|
focusin: function (event) {
|
||||||
$( event.currentTarget ).addClass( "ui-state-hover" );
|
$(event.currentTarget).addClass("ui-state-focus");
|
||||||
},
|
},
|
||||||
mouseleave: function( event ) {
|
focusout: function (event) {
|
||||||
$( event.currentTarget ).removeClass( "ui-state-hover" );
|
$(event.currentTarget).removeClass("ui-state-focus");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_focusable: function( element ) {
|
_trigger: function (type, event, data) {
|
||||||
this.focusable = this.focusable.add( element );
|
var prop, orig,
|
||||||
this._on( element, {
|
callback = this.options[type];
|
||||||
focusin: function( event ) {
|
|
||||||
$( event.currentTarget ).addClass( "ui-state-focus" );
|
|
||||||
},
|
|
||||||
focusout: function( event ) {
|
|
||||||
$( event.currentTarget ).removeClass( "ui-state-focus" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
_trigger: function( type, event, data ) {
|
data = data || {};
|
||||||
var prop, orig,
|
event = $.Event(event);
|
||||||
callback = this.options[ type ];
|
event.type = (type === this.widgetEventPrefix ?
|
||||||
|
type :
|
||||||
|
this.widgetEventPrefix + type).toLowerCase();
|
||||||
|
// the original event may come from any element
|
||||||
|
// so we need to reset the target on the new event
|
||||||
|
event.target = this.element[0];
|
||||||
|
|
||||||
data = data || {};
|
// copy original event properties over to the new event
|
||||||
event = $.Event( event );
|
orig = event.originalEvent;
|
||||||
event.type = ( type === this.widgetEventPrefix ?
|
if (orig) {
|
||||||
type :
|
for (prop in orig) {
|
||||||
this.widgetEventPrefix + type ).toLowerCase();
|
if (!(prop in event)) {
|
||||||
// the original event may come from any element
|
event[prop] = orig[prop];
|
||||||
// so we need to reset the target on the new event
|
}
|
||||||
event.target = this.element[ 0 ];
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// copy original event properties over to the new event
|
this.element.trigger(event, data);
|
||||||
orig = event.originalEvent;
|
return !($.isFunction(callback) &&
|
||||||
if ( orig ) {
|
callback.apply(this.element[0], [event].concat(data)) === false ||
|
||||||
for ( prop in orig ) {
|
event.isDefaultPrevented());
|
||||||
if ( !( prop in event ) ) {
|
}
|
||||||
event[ prop ] = orig[ prop ];
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.element.trigger( event, data );
|
$.each({ show: "fadeIn", hide: "fadeOut" }, function (method, defaultEffect) {
|
||||||
return !( $.isFunction( callback ) &&
|
$.Widget.prototype["_" + method] = function (element, options, callback) {
|
||||||
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
if (typeof options === "string") {
|
||||||
event.isDefaultPrevented() );
|
options = { effect: options };
|
||||||
}
|
}
|
||||||
};
|
var hasOptions,
|
||||||
|
effectName = !options ?
|
||||||
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
method :
|
||||||
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
options === true || typeof options === "number" ?
|
||||||
if ( typeof options === "string" ) {
|
defaultEffect :
|
||||||
options = { effect: options };
|
options.effect || defaultEffect;
|
||||||
}
|
options = options || {};
|
||||||
var hasOptions,
|
if (typeof options === "number") {
|
||||||
effectName = !options ?
|
options = { duration: options };
|
||||||
method :
|
}
|
||||||
options === true || typeof options === "number" ?
|
hasOptions = !$.isEmptyObject(options);
|
||||||
defaultEffect :
|
options.complete = callback;
|
||||||
options.effect || defaultEffect;
|
if (options.delay) {
|
||||||
options = options || {};
|
element.delay(options.delay);
|
||||||
if ( typeof options === "number" ) {
|
}
|
||||||
options = { duration: options };
|
if (hasOptions && $.effects && $.effects.effect[effectName]) {
|
||||||
}
|
element[method](options);
|
||||||
hasOptions = !$.isEmptyObject( options );
|
} else if (effectName !== method && element[effectName]) {
|
||||||
options.complete = callback;
|
element[effectName](options.duration, options.easing, callback);
|
||||||
if ( options.delay ) {
|
} else {
|
||||||
element.delay( options.delay );
|
element.queue(function (next) {
|
||||||
}
|
$(this)[method]();
|
||||||
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
|
if (callback) {
|
||||||
element[ method ]( options );
|
callback.call(element[0]);
|
||||||
} else if ( effectName !== method && element[ effectName ] ) {
|
}
|
||||||
element[ effectName ]( options.duration, options.easing, callback );
|
next();
|
||||||
} else {
|
});
|
||||||
element.queue(function( next ) {
|
}
|
||||||
$( this )[ method ]();
|
};
|
||||||
if ( callback ) {
|
});
|
||||||
callback.call( element[ 0 ] );
|
|
||||||
}
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +1,2 @@
|
||||||
<?php
|
<?php
|
||||||
include_once("../../../../../../common.php");
|
include_once("../../../../../../common.php");
|
||||||
|
|
|
||||||
|
|
@ -11,50 +11,51 @@
|
||||||
*/
|
*/
|
||||||
include_once("./_common.php");
|
include_once("./_common.php");
|
||||||
|
|
||||||
if( !function_exists('json_encode') ) {
|
if (!function_exists('json_encode')) {
|
||||||
@include_once("./JSON.php");
|
@include_once("./JSON.php");
|
||||||
function json_encode($data) {
|
function json_encode($data)
|
||||||
$json = new Services_JSON();
|
{
|
||||||
return( $json->encode($data) );
|
$json = new Services_JSON();
|
||||||
}
|
return ($json->encode($data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ini_set('gd.jpeg_ignore_warning', 1);
|
@ini_set('gd.jpeg_ignore_warning', 1);
|
||||||
|
|
||||||
$ym = date('ym', G5_SERVER_TIME);
|
$ym = date('ym', G5_SERVER_TIME);
|
||||||
|
|
||||||
$data_dir = G5_DATA_PATH.'/editor/'.$ym.'/';
|
$data_dir = G5_DATA_PATH . '/editor/' . $ym . '/';
|
||||||
$data_url = G5_DATA_URL.'/editor/'.$ym.'/';
|
$data_url = G5_DATA_URL . '/editor/' . $ym . '/';
|
||||||
|
|
||||||
@mkdir($data_dir, G5_DIR_PERMISSION);
|
@mkdir($data_dir, G5_DIR_PERMISSION);
|
||||||
@chmod($data_dir, G5_DIR_PERMISSION);
|
@chmod($data_dir, G5_DIR_PERMISSION);
|
||||||
|
|
||||||
if(!function_exists('ft_nonce_is_valid')){
|
if (!function_exists('ft_nonce_is_valid')) {
|
||||||
include_once('../../../editor.lib.php');
|
include_once('../../../editor.lib.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_editor_upload = false;
|
$is_editor_upload = false;
|
||||||
|
|
||||||
if( isset($_GET['_nonce']) && ft_nonce_is_valid( $_GET['_nonce'] , 'smarteditor' ) ){
|
if (isset($_GET['_nonce']) && ft_nonce_is_valid($_GET['_nonce'], 'smarteditor')) {
|
||||||
$is_editor_upload = true;
|
$is_editor_upload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( $is_editor_upload ) {
|
if ($is_editor_upload) {
|
||||||
|
|
||||||
run_event('smarteditor_photo_upload', $data_dir, $data_url);
|
|
||||||
|
|
||||||
require('UploadHandler.php');
|
run_event('smarteditor_photo_upload', $data_dir, $data_url);
|
||||||
$options = array(
|
|
||||||
'upload_dir' => $data_dir,
|
|
||||||
'upload_url' => $data_url,
|
|
||||||
// This option will disable creating thumbnail images and will not create that extra folder.
|
|
||||||
// However, due to this, the images preview will not be displayed after upload
|
|
||||||
'image_versions' => array()
|
|
||||||
);
|
|
||||||
|
|
||||||
$upload_handler = new UploadHandler($options);
|
require('UploadHandler.php');
|
||||||
|
$options = array(
|
||||||
|
'upload_dir' => $data_dir,
|
||||||
|
'upload_url' => $data_url,
|
||||||
|
// This option will disable creating thumbnail images and will not create that extra folder.
|
||||||
|
// However, due to this, the images preview will not be displayed after upload
|
||||||
|
'image_versions' => []
|
||||||
|
);
|
||||||
|
|
||||||
|
$upload_handler = new UploadHandler($options);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('files'=>array('0'=>array('error'=>'정상적인 업로드가 아닙니다.'))));
|
echo json_encode(array('files' => array('0' => array('error' => $_GET['_nonce']))));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
|
|
@ -1,203 +0,0 @@
|
||||||
/*
|
|
||||||
A simple class for displaying file information and progress
|
|
||||||
Note: This is a demonstration only and not part of SWFUpload.
|
|
||||||
Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Constructor
|
|
||||||
// file is a SWFUpload file object
|
|
||||||
// targetID is the HTML element id attribute that the FileProgress HTML structure will be added to.
|
|
||||||
// Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements
|
|
||||||
function FileProgress(file, targetID) {
|
|
||||||
this.fileProgressID = file.id;
|
|
||||||
|
|
||||||
this.opacity = 100;
|
|
||||||
this.height = 0;
|
|
||||||
|
|
||||||
|
|
||||||
this.fileProgressWrapper = document.getElementById(this.fileProgressID);
|
|
||||||
if (!this.fileProgressWrapper) {
|
|
||||||
this.fileProgressWrapper = document.createElement("div");
|
|
||||||
this.fileProgressWrapper.className = "progressWrapper";
|
|
||||||
this.fileProgressWrapper.id = this.fileProgressID;
|
|
||||||
|
|
||||||
this.fileProgressElement = document.createElement("div");
|
|
||||||
this.fileProgressElement.className = "progressContainer";
|
|
||||||
|
|
||||||
var progressCancel = document.createElement("a");
|
|
||||||
progressCancel.className = "progressCancel";
|
|
||||||
progressCancel.href = "#";
|
|
||||||
progressCancel.style.visibility = "hidden";
|
|
||||||
progressCancel.appendChild(document.createTextNode(" "));
|
|
||||||
|
|
||||||
var progressText = document.createElement("div");
|
|
||||||
progressText.className = "progressName";
|
|
||||||
progressText.appendChild(document.createTextNode(file.name));
|
|
||||||
|
|
||||||
var progressBar = document.createElement("div");
|
|
||||||
progressBar.className = "progressBarInProgress";
|
|
||||||
|
|
||||||
var progressStatus = document.createElement("div");
|
|
||||||
progressStatus.className = "progressBarStatus";
|
|
||||||
progressStatus.innerHTML = " ";
|
|
||||||
|
|
||||||
this.fileProgressElement.appendChild(progressCancel);
|
|
||||||
this.fileProgressElement.appendChild(progressText);
|
|
||||||
this.fileProgressElement.appendChild(progressStatus);
|
|
||||||
this.fileProgressElement.appendChild(progressBar);
|
|
||||||
|
|
||||||
this.fileProgressWrapper.appendChild(this.fileProgressElement);
|
|
||||||
|
|
||||||
document.getElementById(targetID).appendChild(this.fileProgressWrapper);
|
|
||||||
} else {
|
|
||||||
this.fileProgressElement = this.fileProgressWrapper.firstChild;
|
|
||||||
this.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.height = this.fileProgressWrapper.offsetHeight;
|
|
||||||
this.setTimer(null);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
FileProgress.prototype.setTimer = function (timer) {
|
|
||||||
this.fileProgressElement["FP_TIMER"] = timer;
|
|
||||||
};
|
|
||||||
FileProgress.prototype.getTimer = function (timer) {
|
|
||||||
return this.fileProgressElement["FP_TIMER"] || null;
|
|
||||||
};
|
|
||||||
|
|
||||||
FileProgress.prototype.reset = function () {
|
|
||||||
this.fileProgressElement.className = "progressContainer";
|
|
||||||
|
|
||||||
this.fileProgressElement.childNodes[2].innerHTML = " ";
|
|
||||||
this.fileProgressElement.childNodes[2].className = "progressBarStatus";
|
|
||||||
|
|
||||||
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
|
|
||||||
this.fileProgressElement.childNodes[3].style.width = "0%";
|
|
||||||
|
|
||||||
this.appear();
|
|
||||||
};
|
|
||||||
|
|
||||||
FileProgress.prototype.setProgress = function (percentage) {
|
|
||||||
this.fileProgressElement.className = "progressContainer green";
|
|
||||||
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
|
|
||||||
this.fileProgressElement.childNodes[3].style.width = percentage + "%";
|
|
||||||
|
|
||||||
this.appear();
|
|
||||||
};
|
|
||||||
FileProgress.prototype.setComplete = function () {
|
|
||||||
this.fileProgressElement.className = "progressContainer blue";
|
|
||||||
this.fileProgressElement.childNodes[3].className = "progressBarComplete";
|
|
||||||
this.fileProgressElement.childNodes[3].style.width = "";
|
|
||||||
|
|
||||||
var oSelf = this;
|
|
||||||
this.setTimer(setTimeout(function () {
|
|
||||||
oSelf.disappear();
|
|
||||||
}, 10000));
|
|
||||||
};
|
|
||||||
FileProgress.prototype.setError = function () {
|
|
||||||
this.fileProgressElement.className = "progressContainer red";
|
|
||||||
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
|
||||||
this.fileProgressElement.childNodes[3].style.width = "";
|
|
||||||
|
|
||||||
var oSelf = this;
|
|
||||||
this.setTimer(setTimeout(function () {
|
|
||||||
oSelf.disappear();
|
|
||||||
}, 5000));
|
|
||||||
};
|
|
||||||
FileProgress.prototype.setCancelled = function () {
|
|
||||||
this.fileProgressElement.className = "progressContainer";
|
|
||||||
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
|
||||||
this.fileProgressElement.childNodes[3].style.width = "";
|
|
||||||
|
|
||||||
var oSelf = this;
|
|
||||||
this.setTimer(setTimeout(function () {
|
|
||||||
oSelf.disappear();
|
|
||||||
}, 2000));
|
|
||||||
};
|
|
||||||
FileProgress.prototype.setStatus = function (status) {
|
|
||||||
this.fileProgressElement.childNodes[2].innerHTML = status;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Show/Hide the cancel button
|
|
||||||
FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
|
|
||||||
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
|
|
||||||
if (swfUploadInstance) {
|
|
||||||
var fileID = this.fileProgressID;
|
|
||||||
this.fileProgressElement.childNodes[0].onclick = function () {
|
|
||||||
swfUploadInstance.cancelUpload(fileID);
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
FileProgress.prototype.appear = function () {
|
|
||||||
if (this.getTimer() !== null) {
|
|
||||||
clearTimeout(this.getTimer());
|
|
||||||
this.setTimer(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.fileProgressWrapper.filters) {
|
|
||||||
try {
|
|
||||||
this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100;
|
|
||||||
} catch (e) {
|
|
||||||
// If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
|
|
||||||
this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.fileProgressWrapper.style.opacity = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fileProgressWrapper.style.height = "";
|
|
||||||
|
|
||||||
this.height = this.fileProgressWrapper.offsetHeight;
|
|
||||||
this.opacity = 100;
|
|
||||||
this.fileProgressWrapper.style.display = "";
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fades out and clips away the FileProgress box.
|
|
||||||
FileProgress.prototype.disappear = function () {
|
|
||||||
|
|
||||||
var reduceOpacityBy = 15;
|
|
||||||
var reduceHeightBy = 4;
|
|
||||||
var rate = 30; // 15 fps
|
|
||||||
|
|
||||||
if (this.opacity > 0) {
|
|
||||||
this.opacity -= reduceOpacityBy;
|
|
||||||
if (this.opacity < 0) {
|
|
||||||
this.opacity = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.fileProgressWrapper.filters) {
|
|
||||||
try {
|
|
||||||
this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
|
|
||||||
} catch (e) {
|
|
||||||
// If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
|
|
||||||
this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.fileProgressWrapper.style.opacity = this.opacity / 100;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.height > 0) {
|
|
||||||
this.height -= reduceHeightBy;
|
|
||||||
if (this.height < 0) {
|
|
||||||
this.height = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.fileProgressWrapper.style.height = this.height + "px";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.height > 0 || this.opacity > 0) {
|
|
||||||
var oSelf = this;
|
|
||||||
this.setTimer(setTimeout(function () {
|
|
||||||
oSelf.disappear();
|
|
||||||
}, rate));
|
|
||||||
} else {
|
|
||||||
this.fileProgressWrapper.style.display = "none";
|
|
||||||
this.setTimer(null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1,378 +0,0 @@
|
||||||
/*
|
|
||||||
@author romeojks (romeojks@gmail.com)
|
|
||||||
@version 0.1
|
|
||||||
@brief 파일 업로드 관련
|
|
||||||
*/
|
|
||||||
|
|
||||||
function swfUploadPreLoad() {
|
|
||||||
var self = this;
|
|
||||||
var loading = function () {
|
|
||||||
document.getElementById("divLoadingContent").style.display = "";
|
|
||||||
|
|
||||||
var longLoad = function () {
|
|
||||||
document.getElementById("divLoadingContent").style.display = "none";
|
|
||||||
document.getElementById("divLongLoading").style.display = "";
|
|
||||||
};
|
|
||||||
this.customSettings.loadingTimeout = setTimeout(function () {
|
|
||||||
longLoad.call(self)
|
|
||||||
},
|
|
||||||
15 * 1000
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.customSettings.loadingTimeout = setTimeout(function () {
|
|
||||||
loading.call(self);
|
|
||||||
},
|
|
||||||
1*1000
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function swfUploadLoaded() {
|
|
||||||
var self = this;
|
|
||||||
clearTimeout(this.customSettings.loadingTimeout);
|
|
||||||
document.getElementById("divLoadingContent").style.display = "none";
|
|
||||||
document.getElementById("divLongLoading").style.display = "none";
|
|
||||||
document.getElementById("divAlternateContent").style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function swfUploadLoadFailed() {
|
|
||||||
clearTimeout(this.customSettings.loadingTimeout);
|
|
||||||
document.getElementById("divLoadingContent").style.display = "none";
|
|
||||||
document.getElementById("divLongLoading").style.display = "none";
|
|
||||||
document.getElementById("divAlternateContent").style.display = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function fileQueued(file) {
|
|
||||||
try {
|
|
||||||
var obj = document.getElementById(this.customSettings.fileListAreaID);
|
|
||||||
var filename = file.name;
|
|
||||||
|
|
||||||
if (filename.length > 20) {
|
|
||||||
filename = filename.substr(0,20) + "...";
|
|
||||||
};
|
|
||||||
|
|
||||||
var text = filename + " (대기중...)";
|
|
||||||
var value = last_bf_no + file.index;
|
|
||||||
var opt_obj = new Option(text, value, true, true);
|
|
||||||
obj.options[obj.options.length] = opt_obj;
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function fileQueueError(file, errorCode, message) {
|
|
||||||
try {
|
|
||||||
switch (errorCode) {
|
|
||||||
case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED :
|
|
||||||
alert(message == 0 ? "더이상 업로드 할 수 없습니다." : (message == file_upload_limit ? file_upload_limit + "개 까지만 업로드 할 수 있습니다." : file_upload_limit + "개 까지만 업로드 할 수 있습니다.\n\n" + "현재 " + message + "개 남았습니다."));
|
|
||||||
break;
|
|
||||||
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT :
|
|
||||||
alert("업로드 가능한 파일 용량(" + file_size_limit + ")을 초과했습니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE :
|
|
||||||
alert("파일 사이즈가 '0' 입니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE :
|
|
||||||
alert("파일 타입이 올바르지 않습니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + getfilesize(file.size) + ", Message: " + message);
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function fileDialogComplete(numFilesSelected, numFilesQueued) {
|
|
||||||
try {
|
|
||||||
this.startUpload();
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploadStart(file) {
|
|
||||||
try {
|
|
||||||
if ((sum_filesize + file.size) > getfilesize1(file_allsize_limit)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploadProgress(file, bytesLoaded, bytesTotal) {
|
|
||||||
try {
|
|
||||||
var obj = document.getElementById(this.customSettings.fileListAreaID);
|
|
||||||
var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
|
|
||||||
var filename = file.name;
|
|
||||||
|
|
||||||
if (filename.length > 20) {
|
|
||||||
filename = filename.substr(0,20) + "...";
|
|
||||||
};
|
|
||||||
|
|
||||||
var text = filename + " (" + percent + " %)";
|
|
||||||
var bf_position = last_bf_no + file.index;
|
|
||||||
|
|
||||||
obj.options[bf_position].text = text;
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploadSuccess(file, serverData) {
|
|
||||||
try {
|
|
||||||
var obj = document.getElementById(this.customSettings.fileListAreaID);
|
|
||||||
var bf_position = last_bf_no + file.index;
|
|
||||||
var params = {
|
|
||||||
"bo_table" : bo_table,
|
|
||||||
"wr_id" : wr_id,
|
|
||||||
"w" : w,
|
|
||||||
"bf_position" : bf_position+1
|
|
||||||
};
|
|
||||||
|
|
||||||
var url = swfupload_path + "/get_file_info.php";
|
|
||||||
$.ajax({
|
|
||||||
type: 'post',
|
|
||||||
url: url,
|
|
||||||
data: params,
|
|
||||||
success : after_upload_success = function(req) {
|
|
||||||
var file = eval('('+req+')');
|
|
||||||
var file_size = (file.bf_filesize / 1024).toFixed(1);
|
|
||||||
var text = file.bf_source + " (" + getfilesize(file.bf_filesize) + ")";
|
|
||||||
var value = file.bf_no + "|" + file.bf_source + "|" + file.bf_file + "|" + file.bf_filesize + "|" + file.bf_width + "|" + file.bf_type;
|
|
||||||
obj.options[bf_position].text = text;
|
|
||||||
obj.options[bf_position].value = value;
|
|
||||||
eval("preview(file.bf_file)");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sum_filesize = sum_filesize + file.size;
|
|
||||||
document.getElementById("uploader_status").innerHTML = "문서첨부제한 : " + getfilesize(sum_filesize) + " / " + file_allsize_limit + "<br />파일제한크기 : " + file_size_limit + " (허용확장자 : " + file_types_description + ")";
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploadError(file, errorCode, message) {
|
|
||||||
try {
|
|
||||||
switch (errorCode) {
|
|
||||||
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR :
|
|
||||||
alert("네트워크 에러가 발생하였습니다. 관리자에게 문의하세요.\n\n" + "File name: " + file.name);
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED :
|
|
||||||
alert("파일 업로드가 실패하였습니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.IO_ERROR :
|
|
||||||
alert("입출력 에러가 발생하였습니다.\n\n" + "다른 프로그램에서 이 파일(" + file.name + ")을 사용중인지 확인하세요.");
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR :
|
|
||||||
alert("보안 에러가 발생하였습니다. 관리자에게 문의하세요.\n\n" + "File name: " + file.name);
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED :
|
|
||||||
alert("업로드 가능한 파일 용량(" + file_size_limit + ")을 초과했습니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED :
|
|
||||||
alert("업로드 가능한 총파일 용량(" + file_allsize_limit + ")을 초과했습니다.\n\n" + "File name: " + file.name + ", File size: " + getfilesize(file.size));
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED :
|
|
||||||
// If there aren't any files left (they were all cancelled) disable the cancel button
|
|
||||||
if (this.getStats().files_queued === 0) {
|
|
||||||
document.getElementById(this.customSettings.cancelButtonId).disabled = true;
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED :
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
alert("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + getfilesize(file.size) + ", Message: " + message);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function uploadComplete(file) {
|
|
||||||
/*if (this.getStats().files_queued === 0) {
|
|
||||||
document.getElementById(this.customSettings.cancelButtonId).disabled = true;
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
function getfilesize(size) {
|
|
||||||
if (!size) {
|
|
||||||
return "0 Byte";
|
|
||||||
};
|
|
||||||
if (size < 1024) {
|
|
||||||
return (size + " Byte");
|
|
||||||
} else if (size > 1024 && size < 1024 *1024) {
|
|
||||||
return (size / 1024).toFixed(1) + " KB";
|
|
||||||
} else {
|
|
||||||
return (size / (1024*1024)).toFixed(2) + " MB";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getfilesize1(size) {
|
|
||||||
var file_size = size.split(" ");
|
|
||||||
if (!file_size[0]) {
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
if (file_size[1] == "MB") {
|
|
||||||
return (file_size[0] * (1024*1024));
|
|
||||||
} else if (file_size[1] == "KB") {
|
|
||||||
return (file_size[0] * 1024);
|
|
||||||
} else {
|
|
||||||
return (file_size[0]);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_file() {
|
|
||||||
try {
|
|
||||||
var obj = document.getElementById("uploaded_file_list");
|
|
||||||
var url = swfupload_path + "/file_delete.php";
|
|
||||||
for (var i=0; i<obj.options.length; i++) {
|
|
||||||
if (obj.options[i].selected == true) {
|
|
||||||
var file = get_file_info(obj.options[i].value);
|
|
||||||
var params = {
|
|
||||||
"bo_table" : bo_table,
|
|
||||||
"wr_id" : wr_id,
|
|
||||||
"bf_no" : file.bf_no,
|
|
||||||
"w" : w,
|
|
||||||
"board_file_path" : board_file_path
|
|
||||||
};
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: 'post',
|
|
||||||
url: url,
|
|
||||||
data: params,
|
|
||||||
success : eval("delete_file_complete")
|
|
||||||
});
|
|
||||||
|
|
||||||
sum_filesize = sum_filesize - file.bf_filesize;
|
|
||||||
document.getElementById("uploader_status").innerHTML = "문서첨부제한 : " + getfilesize(sum_filesize) + " / " + file_allsize_limit + "<br />파일제한크기 : " + file_size_limit + " (허용확장자 : " + file_types_description + ")";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function delete_file_complete() {
|
|
||||||
try {
|
|
||||||
var obj = document.getElementById("uploaded_file_list");
|
|
||||||
for (var i=0; i<obj.options.length; i++) {
|
|
||||||
if (obj.options[i].selected == true) {
|
|
||||||
op = obj.options[i];
|
|
||||||
obj.removeChild(op);
|
|
||||||
last_bf_no--;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
if (obj.options.length) {
|
|
||||||
obj.options[obj.options.length-1].selected = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
eval("preview()");
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function preview(thumb) {
|
|
||||||
try {
|
|
||||||
if (!thumb) {
|
|
||||||
var file = get_file_info(document.getElementById("uploaded_file_list").value);
|
|
||||||
var thumb = file.bf_file;
|
|
||||||
}
|
|
||||||
|
|
||||||
var pattern = /\.(jpg|png|gif|webp)$/i;
|
|
||||||
if (pattern.test(thumb)) {
|
|
||||||
var thumb_kind = "img";
|
|
||||||
} else {
|
|
||||||
var thumb_kind = "etc";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (thumb && thumb_kind == "img") {
|
|
||||||
document.getElementById("image_preview").innerHTML = "<img src=" + board_file_path + "/" + thumb + " width=" + thumb_width + " height=" + thumb_height + ">";
|
|
||||||
} else if (thumb && thumb_kind == "etc") {
|
|
||||||
document.getElementById("image_preview").innerHTML = "<img src=" + board_skin_path + "/img/icon_etc.gif" + " width=" + thumb_width + " height=" + thumb_height + ">";
|
|
||||||
} else {
|
|
||||||
document.getElementById("image_preview").innerHTML = "미리보기";
|
|
||||||
};
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function file_to_editor() {
|
|
||||||
try {
|
|
||||||
var files_list = document.getElementById("uploaded_file_list");
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
if (!files_list.value) {
|
|
||||||
alert('파일을 선택해주세요.');
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var i=0; i<files_list.options.length; i++) {
|
|
||||||
if (files_list.options[i].selected == true) {
|
|
||||||
var file = get_file_info(files_list.options[i].value);
|
|
||||||
var path = board_file_path + '/' + file.bf_file;
|
|
||||||
|
|
||||||
var pattern = /\.(jpg|png|gif|webp)$/i;
|
|
||||||
if (pattern.test(file.bf_file)) {
|
|
||||||
if (wr_id) {
|
|
||||||
html = "{이미지:" + file.bf_no + "}";
|
|
||||||
} else {
|
|
||||||
html = "{이미지:" + i + "}";
|
|
||||||
}
|
|
||||||
html2 = "<img src='"+path+"'>";
|
|
||||||
} else {
|
|
||||||
alert("이미지만 삽입 할 수 있습니다.");
|
|
||||||
//path = "download.php?bo_table=" + bo_table + "&filename=" + file.bf_file + "&filesource=" + file.bf_source + "";
|
|
||||||
//html += "<a href=\"" + path + "\">" + file.bf_source + "</a><br/>\n";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
insert_editor(html2);
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function insert_editor(html) {
|
|
||||||
try {
|
|
||||||
ed_wr_content.insertContents(html);
|
|
||||||
/*
|
|
||||||
if (typeof(ed_wr_content) != "undefined")
|
|
||||||
if (geditor_wr_content.get_mode() == "WYSIWYG") {
|
|
||||||
document.getElementById("geditor_wr_content_frame").contentWindow.document.body.focus();
|
|
||||||
geditor_wr_content.get_range();
|
|
||||||
html = html + "<br />";
|
|
||||||
} else if (geditor_wr_content.get_mode() == "TEXT") {
|
|
||||||
html = html + "\n";
|
|
||||||
} else {
|
|
||||||
html = html + "<br />";
|
|
||||||
}
|
|
||||||
geditor_wr_content.insert_editor(html);
|
|
||||||
} else {
|
|
||||||
document.getElementById("wr_content").value += html + "\n";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_file_info(val) {
|
|
||||||
try {
|
|
||||||
var arr = val.split('|');
|
|
||||||
var ret = {"bf_no":arr[0], "bf_source":arr[1], "bf_file":arr[2], "bf_filesize":arr[3], "bf_width":arr[4], "bf_type":arr[5]};
|
|
||||||
return ret;
|
|
||||||
} catch (ex) {
|
|
||||||
this.debug(ex);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
/*
|
|
||||||
* SWFUpload jQuery Plugin v1.0.0
|
|
||||||
*
|
|
||||||
* Copyright (c) 2009 Adam Royle
|
|
||||||
* Licensed under the MIT license.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function($){
|
|
||||||
|
|
||||||
var defaultHandlers = [
|
|
||||||
'swfupload_preload_handler',
|
|
||||||
'swfupload_load_failed_handler',
|
|
||||||
'swfupload_loaded_handler',
|
|
||||||
'file_dialog_start_handler',
|
|
||||||
'file_queued_handler',
|
|
||||||
'file_queue_error_handler',
|
|
||||||
'file_dialog_complete_handler',
|
|
||||||
'upload_resize_start_handler',
|
|
||||||
'upload_start_handler',
|
|
||||||
'upload_progress_handler',
|
|
||||||
'upload_error_handler',
|
|
||||||
'upload_success_handler',
|
|
||||||
'upload_complete_handler',
|
|
||||||
'mouse_click_handler',
|
|
||||||
'mouse_out_handler',
|
|
||||||
'mouse_over_handler',
|
|
||||||
'queue_complete_handler'
|
|
||||||
];
|
|
||||||
var additionalHandlers = [];
|
|
||||||
|
|
||||||
$.fn.swfupload = function(){
|
|
||||||
var args = $.makeArray(arguments);
|
|
||||||
return this.each(function(){
|
|
||||||
var swfu;
|
|
||||||
if (args.length == 1 && typeof(args[0]) == 'object') {
|
|
||||||
swfu = $(this).data('__swfu');
|
|
||||||
if (!swfu) {
|
|
||||||
var settings = args[0];
|
|
||||||
var $magicUploadControl = $(this);
|
|
||||||
var handlers = [];
|
|
||||||
$.merge(handlers, defaultHandlers);
|
|
||||||
$.merge(handlers, additionalHandlers);
|
|
||||||
$.each(handlers, function(i, v){
|
|
||||||
var eventName = v.replace(/_handler$/, '').replace(/_([a-z])/g, function(){ return arguments[1].toUpperCase(); });
|
|
||||||
settings[v] = function() {
|
|
||||||
var event = $.Event(eventName);
|
|
||||||
$magicUploadControl.trigger(event, $.makeArray(arguments));
|
|
||||||
return !event.isDefaultPrevented();
|
|
||||||
};
|
|
||||||
});
|
|
||||||
$(this).data('__swfu', new SWFUpload(settings));
|
|
||||||
}
|
|
||||||
} else if (args.length > 0 && typeof(args[0]) == 'string') {
|
|
||||||
var methodName = args.shift();
|
|
||||||
swfu = $(this).data('__swfu');
|
|
||||||
if (swfu && swfu[methodName]) {
|
|
||||||
swfu[methodName].apply(swfu, args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.swfupload = {
|
|
||||||
additionalHandlers: function() {
|
|
||||||
if (arguments.length === 0) {
|
|
||||||
return additionalHandlers.slice();
|
|
||||||
} else {
|
|
||||||
$(arguments).each(function(i, v){
|
|
||||||
$.merge(additionalHandlers, $.makeArray(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
defaultHandlers: function() {
|
|
||||||
return defaultHandlers.slice();
|
|
||||||
},
|
|
||||||
getInstance: function(el) {
|
|
||||||
return $(el).data('__swfu');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,99 +0,0 @@
|
||||||
/*
|
|
||||||
Queue Plug-in
|
|
||||||
|
|
||||||
Features:
|
|
||||||
*Adds a cancelQueue() method for cancelling the entire queue.
|
|
||||||
*All queued files are uploaded when startUpload() is called.
|
|
||||||
*If false is returned from uploadComplete then the queue upload is stopped.
|
|
||||||
If false is not returned (strict comparison) then the queue upload is continued.
|
|
||||||
*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
|
|
||||||
Set the event handler with the queue_complete_handler setting.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var SWFUpload;
|
|
||||||
if (typeof(SWFUpload) === "function") {
|
|
||||||
SWFUpload.queue = {};
|
|
||||||
|
|
||||||
SWFUpload.prototype.initSettings = (function (oldInitSettings) {
|
|
||||||
return function () {
|
|
||||||
if (typeof(oldInitSettings) === "function") {
|
|
||||||
oldInitSettings.call(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.queueSettings = {};
|
|
||||||
|
|
||||||
this.queueSettings.queue_cancelled_flag = false;
|
|
||||||
this.queueSettings.queue_upload_count = 0;
|
|
||||||
|
|
||||||
this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
|
|
||||||
this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
|
|
||||||
this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
|
|
||||||
this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
|
|
||||||
|
|
||||||
this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
|
|
||||||
};
|
|
||||||
})(SWFUpload.prototype.initSettings);
|
|
||||||
|
|
||||||
SWFUpload.prototype.startUpload = function (fileID) {
|
|
||||||
this.queueSettings.queue_cancelled_flag = false;
|
|
||||||
this.callFlash("StartUpload", [fileID]);
|
|
||||||
};
|
|
||||||
|
|
||||||
SWFUpload.prototype.cancelQueue = function () {
|
|
||||||
this.queueSettings.queue_cancelled_flag = true;
|
|
||||||
this.stopUpload();
|
|
||||||
|
|
||||||
var stats = this.getStats();
|
|
||||||
while (stats.files_queued > 0) {
|
|
||||||
this.cancelUpload();
|
|
||||||
stats = this.getStats();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SWFUpload.queue.uploadStartHandler = function (file) {
|
|
||||||
var returnValue;
|
|
||||||
if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
|
|
||||||
returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
// To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
|
|
||||||
returnValue = (returnValue === false) ? false : true;
|
|
||||||
|
|
||||||
this.queueSettings.queue_cancelled_flag = !returnValue;
|
|
||||||
|
|
||||||
return returnValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
SWFUpload.queue.uploadCompleteHandler = function (file) {
|
|
||||||
var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
|
|
||||||
var continueUpload;
|
|
||||||
|
|
||||||
if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
|
|
||||||
this.queueSettings.queue_upload_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof(user_upload_complete_handler) === "function") {
|
|
||||||
continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
|
|
||||||
} else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
|
|
||||||
// If the file was stopped and re-queued don't restart the upload
|
|
||||||
continueUpload = false;
|
|
||||||
} else {
|
|
||||||
continueUpload = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (continueUpload) {
|
|
||||||
var stats = this.getStats();
|
|
||||||
if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
|
|
||||||
this.startUpload();
|
|
||||||
} else if (this.queueSettings.queue_cancelled_flag === false) {
|
|
||||||
console.debug('ydfsdfgsdfgsdfg');
|
|
||||||
this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
|
|
||||||
this.queueSettings.queue_upload_count = 0;
|
|
||||||
} else {
|
|
||||||
this.queueSettings.queue_cancelled_flag = false;
|
|
||||||
this.queueSettings.queue_upload_count = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Binary file not shown.
Loading…
Reference in a new issue