update smarteditor

This commit is contained in:
Amberstone 2024-09-22 15:53:38 +09:00
parent 3302649c3c
commit 6145459b5d
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
37 changed files with 6429 additions and 7953 deletions

View file

@ -1,13 +1,11 @@
function get_editor_wr_content()
{
return oEditors.getById['wr_content'].getIR();;
function get_editor_wr_content() {
return oEditors.getById['wr_content'].getIR();;
}
function put_editor_wr_content(content)
{
oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]);
//oEditors.getById["wr_content"].exec("SET_IR", [""]);
oEditors.getById["wr_content"].exec("PASTE_HTML", [content]);
function put_editor_wr_content(content) {
oEditors.getById["wr_content"].exec("SET_CONTENTS", [""]);
//oEditors.getById["wr_content"].exec("SET_IR", [""]);
oEditors.getById["wr_content"].exec("PASTE_HTML", [content]);
return;
}
return;
}

View file

@ -12,7 +12,7 @@
bUseVerticalResizer: true,
bUseModeChanger: true,
bSkipXssFilter: true,
aAdditionalFontList : editorAdditionalFontList,
aAdditionalFontList: editorAdditionalFontList,
fOnBeforeUnload: function () {
// unload
}
@ -21,13 +21,13 @@
const extraFont = document.head.querySelector('#extra_font');
if (extraFont) {
const fontStyle = extraFont.textContent || extraFont.innerText;
const editorDocument = oEditors.getById[get_id].getWYSIWYGDocument();
const editorHead = editorDocument.getElementsByTagName("head")[0];
const editorStyle = editorDocument.createElement("style");
editorStyle.appendChild(editorDocument.createTextNode(fontStyle));
editorHead.appendChild(editorStyle);
const iframes = document.getElementsByTagName('iframe');
for (let i = 0; i < iframes.length; i++) {
if (iframes[i].src.indexOf('SmartEditor2Skin.html') !== -1) {

View file

@ -30,8 +30,8 @@ function editor_html($id, $content, $is_dhtml_editor = true)
if ($is_dhtml_editor && $js) {
$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";
$result = sql_query($sql);
@ -44,10 +44,10 @@ function editor_html($id, $content, $is_dhtml_editor = true)
$addFontList[] = "['{$font_family}', '{$font_name}']";
}
if (count($addFontList) > 0) {
if (count($addFontList) > 0) {
$html .= implode(",", $addFontList);
}
$html .= "];</script>";
$html .= "\n<script src=\"{$editor_url}/config.js\"></script>";
$html .= "\n<script>";

View file

@ -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
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 = {};
/**
* @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
*/
nhn.husky.EZCreator = new (function(){
this.nBlockerCount = 0;
nhn.husky.EZCreator = new (function () {
this.nBlockerCount = 0;
this.createInIFrame = function(htOptions){
if(arguments.length == 1){
var oAppRef = htOptions.oAppRef;
var elPlaceHolder = htOptions.elPlaceHolder;
var sSkinURI = htOptions.sSkinURI;
var fCreator = htOptions.fCreator;
var fOnAppLoad = htOptions.fOnAppLoad;
var bUseBlocker = htOptions.bUseBlocker;
var htParams = htOptions.htParams || null;
}else{
// for backward compatibility only
var oAppRef = arguments[0];
var elPlaceHolder = arguments[1];
var sSkinURI = arguments[2];
var fCreator = arguments[3];
var fOnAppLoad = arguments[4];
var bUseBlocker = arguments[5];
var htParams = arguments[6];
}
this.createInIFrame = function (htOptions) {
if (arguments.length == 1) {
var oAppRef = htOptions.oAppRef;
var elPlaceHolder = htOptions.elPlaceHolder;
var sSkinURI = htOptions.sSkinURI;
var fCreator = htOptions.fCreator;
var fOnAppLoad = htOptions.fOnAppLoad;
var bUseBlocker = htOptions.bUseBlocker;
var htParams = htOptions.htParams || null;
} else {
// for backward compatibility only
var oAppRef = arguments[0];
var elPlaceHolder = arguments[1];
var sSkinURI = arguments[2];
var fCreator = arguments[3];
var fOnAppLoad = arguments[4];
var bUseBlocker = arguments[5];
var htParams = arguments[6];
}
if(bUseBlocker) nhn.husky.EZCreator.showBlocker();
if (bUseBlocker) nhn.husky.EZCreator.showBlocker();
var attachEvent = function(elNode, sEvent, fHandler){
if(elNode.addEventListener){
elNode.addEventListener(sEvent, fHandler, false);
}else{
elNode.attachEvent("on"+sEvent, fHandler);
}
}
var attachEvent = function (elNode, sEvent, fHandler) {
if (elNode.addEventListener) {
elNode.addEventListener(sEvent, fHandler, false);
} else {
elNode.attachEvent("on" + sEvent, fHandler);
}
}
if(!elPlaceHolder){
alert("Placeholder is required!");
return;
}
if (!elPlaceHolder) {
alert("Placeholder is required!");
return;
}
if(typeof(elPlaceHolder) != "object")
elPlaceHolder = document.getElementById(elPlaceHolder);
if (typeof (elPlaceHolder) != "object")
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;
if(!oAppRef.getById) oAppRef.getById = {};
if(elPlaceHolder.id) oAppRef.getById[elPlaceHolder.id] = oApp;
elIFrame.style.width = "1px";
elIFrame.style.height = "1px";
elPlaceHolder.parentNode.insertBefore(elIFrame, elPlaceHolder.nextSibling);
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%";
attachEvent(elIFrame, "load", function () {
fCreator = elIFrame.contentWindow[fCreator] || elIFrame.contentWindow.createSEditor2;
document.body.appendChild(elBlocker);
nhn.husky.EZCreator.elBlocker = elBlocker;
}
// top.document.title = ((new Date())-window.STime);
// window.STime = new Date();
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";
}
})();
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;
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";
}
})();

View file

@ -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
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
function createSEditor2(elIRField, htParams, elSeAppContainer){
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 는 지원하지 않습니다.)";
return;
}
function createSEditor2(elIRField, htParams, elSeAppContainer) {
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 는 지원하지 않습니다.)";
return;
}
var elAppContainer = (elSeAppContainer || jindo.$("smart_editor2"));
var elEditingArea = jindo.$$.getSingle("DIV.husky_seditor_editing_area_container", elAppContainer);
var oWYSIWYGIFrame = jindo.$$.getSingle("IFRAME.se2_input_wysiwyg", elEditingArea);
var oIRTextarea = elIRField?elIRField:jindo.$$.getSingle("TEXTAREA.blind", elEditingArea);
var oHTMLSrc = jindo.$$.getSingle("TEXTAREA.se2_input_htmlsrc", 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 elAppContainer = (elSeAppContainer || jindo.$("smart_editor2"));
var elEditingArea = jindo.$$.getSingle("DIV.husky_seditor_editing_area_container", elAppContainer);
var oWYSIWYGIFrame = jindo.$$.getSingle("IFRAME.se2_input_wysiwyg", elEditingArea);
var oIRTextarea = elIRField ? elIRField : jindo.$$.getSingle("TEXTAREA.blind", elEditingArea);
var oHTMLSrc = jindo.$$.getSingle("TEXTAREA.se2_input_htmlsrc", elEditingArea);
var oTextArea = jindo.$$.getSingle("TEXTAREA.se2_input_text", elEditingArea);
var oEditor = new nhn.husky.HuskyCore(htParams);
oEditor.registerPlugin(new nhn.husky.CorePlugin(htParams?htParams.fOnAppLoad:null));
oEditor.registerPlugin(new nhn.husky.StringConverterManager());
if(htParams.bSkipXssFilter !== true){
// 보안 필터링 플러그인 (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,
$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]);
}
});
}
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 htDimension = {
nMinHeight:205,
nMinWidth:parseInt(elIRField.style.minWidth, 10)||570,
nHeight:elIRField.style.height||elIRField.offsetHeight,
nWidth:elIRField.style.width||elIRField.offsetWidth
};
var htConversionMode = {
bUseVerticalResizer : htParams.bUseVerticalResizer,
bUseModeChanger : htParams.bUseModeChanger
};
var aAdditionalFontList = htParams.aAdditionalFontList;
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()); // 커서 위치 스타일 정보 가져오기
var oEditor = new nhn.husky.HuskyCore(htParams);
oEditor.registerPlugin(new nhn.husky.CorePlugin(htParams ? htParams.fOnAppLoad : null));
oEditor.registerPlugin(new nhn.husky.StringConverterManager());
if (htParams.bSkipXssFilter !== true) {
// 보안 필터링 플러그인 (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,
$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]);
}
});
}
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)); // 줄간격
var htDimension = {
nMinHeight: 205,
nMinWidth: parseInt(elIRField.style.minWidth, 10) || 570,
nHeight: elIRField.style.height || elIRField.offsetHeight,
nWidth: elIRField.style.width || elIRField.offsetWidth
};
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)); // 사진
}
var htConversionMode = {
bUseVerticalResizer: htParams.bUseVerticalResizer,
bUseModeChanger: htParams.bUseModeChanger
};
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 버젼에 있는 툴바 이용
var aAdditionalFontList = htParams.aAdditionalFontList;
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;
}

View file

@ -26,17 +26,17 @@ nhn.husky.SE2M_Configuration = nhn.husky.SE2M_Configuration || {};
* CSS LazyLoad를 위한 경로
*/
nhn.husky.SE2M_Configuration.SE2B_CSSLoader = {
sCSSBaseURI : "css"
sCSSBaseURI: "css"
};
/**
* 편집영역 설정
*/
nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
sCSSBaseURI : "css", // smart_editor2_inputarea.html 파일의 상대경로
sBlankPageURL : "smart_editor2_inputarea.html",
sBlankPageURL_EmulateIE7 : "smart_editor2_inputarea_ie8.html",
aAddtionalEmulateIE7 : [] // IE8 default 사용, IE9 ~ 선택적 사용
sCSSBaseURI: "css", // smart_editor2_inputarea.html 파일의 상대경로
sBlankPageURL: "smart_editor2_inputarea.html",
sBlankPageURL_EmulateIE7: "smart_editor2_inputarea_ie8.html",
aAddtionalEmulateIE7: [] // IE8 default 사용, IE9 ~ 선택적 사용
};
/**
@ -49,119 +49,119 @@ nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
* sTitleElementId : 제목에 해당하는 input 요소의 id.
*/
nhn.husky.SE2M_Configuration.SE2M_Accessibility = {
ed_nonce : (typeof parent.ed_nonce !='undefined') ? parent.ed_nonce : '',
sBeforeElementId : '',
sNextElementId : '',
sTitleElementId : ''
ed_nonce: (typeof parent.ed_nonce != 'undefined') ? parent.ed_nonce : '',
sBeforeElementId: '',
sNextElementId: '',
sTitleElementId: ''
};
/**
* 링크 기능 옵션
*/
nhn.husky.SE2M_Configuration.SE2M_Hyperlink = {
bAutolink : true // 자동링크기능 사용여부(기본값:true)
bAutolink: true // 자동링크기능 사용여부(기본값:true)
};
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 = {
bUseRecentColor : false
bUseRecentColor: false
};
nhn.husky.SE2B_Customize_ToolBar = jindo.$Class(/** @lends nhn.husky.SE2B_Customize_ToolBar */{
name : "SE2B_Customize_ToolBar",
/**
* @constructs
* @param {Object} oAppContainer 에디터를 구성하는 컨테이너
*/
$init : function(oAppContainer) {
this._assignHTMLElements(oAppContainer);
},
$BEFORE_MSG_APP_READY : function(){
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");
},
name: "SE2B_Customize_ToolBar",
/**
* @constructs
* @param {Object} oAppContainer 에디터를 구성하는 컨테이너
*/
$init: function (oAppContainer) {
this._assignHTMLElements(oAppContainer);
},
$BEFORE_MSG_APP_READY: function () {
this._addEventMoreButton();
},
_addEventMoreButton : function (){
this.oApp.registerBrowserEvent(this.elTextMoreButton, "click", "EVENT_CLICK_EXPAND_VIEW");
this.oApp.registerBrowserEvent(this.elMoreLayer, "click", "EVENT_CLICK_EXPAND_VIEW");
},
$ON_EVENT_CLICK_EXPAND_VIEW : function(weEvent){
this.oApp.exec("TOGGLE_EXPAND_VIEW", [this.elTextMoreButton]);
weEvent.stop();
},
$ON_TOGGLE_EXPAND_VIEW : function(){
if(!this.welTextMoreButtonParent.hasClass("active")){
this.oApp.exec("SHOW_EXPAND_VIEW");
} else {
this.oApp.exec("HIDE_EXPAND_VIEW");
}
},
$ON_CHANGE_EDITING_MODE : function(sMode){
if(sMode != "WYSIWYG"){
this.elTextMoreButton.disabled =true;
this.welTextMoreButtonParent.removeClass("active");
this.oApp.exec("HIDE_EXPAND_VIEW");
}else{
this.elTextMoreButton.disabled =false;
}
},
$AFTER_SHOW_ACTIVE_LAYER : function(){
this.oApp.exec("HIDE_EXPAND_VIEW");
},
$AFTER_SHOW_DIALOG_LAYER : function(){
this.oApp.exec("HIDE_EXPAND_VIEW");
},
$ON_SHOW_EXPAND_VIEW : function(){
this.welTextMoreButtonParent.addClass("active");
this.elMoreLayer.style.display = "block";
},
$ON_HIDE_EXPAND_VIEW : function(){
this.welTextMoreButtonParent.removeClass("active");
this.elMoreLayer.style.display = "none";
},
/**
* CHANGE_EDITING_MODE모드 이후에 호출되어야 .
* WYSIWYG 모드가 활성화되기 전에 호출이 되면 APPLY_FONTCOLOR에서 에러 발생.
*/
$ON_RESET_TOOLBAR : function(){
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");
}
});
/**
* @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");
this.oApp.registerBrowserEvent(this.elMoreLayer, "click", "EVENT_CLICK_EXPAND_VIEW");
},
$ON_EVENT_CLICK_EXPAND_VIEW: function (weEvent) {
this.oApp.exec("TOGGLE_EXPAND_VIEW", [this.elTextMoreButton]);
weEvent.stop();
},
$ON_TOGGLE_EXPAND_VIEW: function () {
if (!this.welTextMoreButtonParent.hasClass("active")) {
this.oApp.exec("SHOW_EXPAND_VIEW");
} else {
this.oApp.exec("HIDE_EXPAND_VIEW");
}
},
$ON_CHANGE_EDITING_MODE: function (sMode) {
if (sMode != "WYSIWYG") {
this.elTextMoreButton.disabled = true;
this.welTextMoreButtonParent.removeClass("active");
this.oApp.exec("HIDE_EXPAND_VIEW");
} else {
this.elTextMoreButton.disabled = false;
}
},
$AFTER_SHOW_ACTIVE_LAYER: function () {
this.oApp.exec("HIDE_EXPAND_VIEW");
},
$AFTER_SHOW_DIALOG_LAYER: function () {
this.oApp.exec("HIDE_EXPAND_VIEW");
},
$ON_SHOW_EXPAND_VIEW: function () {
this.welTextMoreButtonParent.addClass("active");
this.elMoreLayer.style.display = "block";
},
$ON_HIDE_EXPAND_VIEW: function () {
this.welTextMoreButtonParent.removeClass("active");
this.elMoreLayer.style.display = "none";
},
/**
* CHANGE_EDITING_MODE모드 이후에 호출되어야 .
* WYSIWYG 모드가 활성화되기 전에 호출이 되면 APPLY_FONTCOLOR에서 에러 발생.
*/
$ON_RESET_TOOLBAR: function () {
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");
}
});

View file

@ -27,102 +27,102 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* @pluginDesc 에디터를 싸고 있는 iframe 사이즈 조절을 담당하는 플러그인
*/
nhn.husky.SE_OuterIFrameControl = $Class({
name : "SE_OuterIFrameControl",
oResizeGrip : null,
name: "SE_OuterIFrameControl",
oResizeGrip: null,
$init : function(oAppContainer){
// page up, page down, home, end, left, up, right, down
this.aHeightChangeKeyMap = [-100, 100, 500, -500, -1, -10, 1, 10];
this._assignHTMLObjects(oAppContainer);
$init: function (oAppContainer) {
// page up, page down, home, end, left, up, right, down
this.aHeightChangeKeyMap = [-100, 100, 500, -500, -1, -10, 1, 10];
//키보드 이벤트
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");
}
}
},
this._assignHTMLObjects(oAppContainer);
_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);
this.elIFrame = window.frameElement;
this.welIFrame = $Element(this.elIFrame);
},
//마우스 이벤트
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);
$ON_MSG_APP_READY : function(){
this.oApp.exec("SE_FIT_IFRAME", []);
},
if (this.oResizeGrip) {
this.$FnMouseDown.attach(this.oResizeGrip, "mousedown");
}
}
},
$ON_MSG_EDITING_AREA_SIZE_CHANGED : function(){
this.oApp.exec("SE_FIT_IFRAME", []);
},
_assignHTMLObjects: function (oAppContainer) {
oAppContainer = jindo.$(oAppContainer) || document;
$ON_SE_FIT_IFRAME : function(){
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();
this.oResizeGrip = cssquery.getSingle(".husky_seditor_editingArea_verticalResizer", oAppContainer);
// 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down
if(oKeyInfo.keyCode >= 33 && oKeyInfo.keyCode <= 40){
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", []);
this.elIFrame = window.frameElement;
this.welIFrame = $Element(this.elIFrame);
},
oEvent.stop();
}
},
_mousedown : function(oEvent){
this.iStartHeight = oEvent.pos().clientY;
this.iStartHeightOffset = oEvent.pos().layerY;
$ON_MSG_APP_READY: function () {
this.oApp.exec("SE_FIT_IFRAME", []);
},
this.$FnMouseMove.attach(document, "mousemove");
this.$FnMouseMove_Parent.attach(parent.document, "mousemove");
this.$FnMouseUp.attach(document, "mouseup");
this.$FnMouseUp.attach(parent.document, "mouseup");
$ON_MSG_EDITING_AREA_SIZE_CHANGED: function () {
this.oApp.exec("SE_FIT_IFRAME", []);
},
this.iStartHeight = oEvent.pos().clientY;
this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]);
},
$ON_SE_FIT_IFRAME: function () {
this.elIFrame.style.height = document.body.offsetHeight + "px";
},
_mousemove : function(oEvent){
var iHeightChange = oEvent.pos().clientY - this.iStartHeight;
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
},
$AFTER_RESIZE_EDITING_AREA_BY: function (ipWidthChange, ipHeightChange) {
this.oApp.exec("SE_FIT_IFRAME", []);
},
_mousemove_parent : function(oEvent){
var iHeightChange = oEvent.pos().pageY - (this.welIFrame.offset().top + this.iStartHeight);
this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]);
},
_keydown: function (oEvent) {
var oKeyInfo = oEvent.key();
_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");
// 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down
if (oKeyInfo.keyCode >= 33 && oKeyInfo.keyCode <= 40) {
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", []);
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]);
}
});

View file

@ -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
nhn.husky.SE_ToolbarToggler = $Class({
name : "SE_ToolbarToggler",
bUseToolbar : true,
$init : function(oAppContainer, bUseToolbar){
this._assignHTMLObjects(oAppContainer, bUseToolbar);
},
name: "SE_ToolbarToggler",
bUseToolbar: true,
_assignHTMLObjects : function(oAppContainer, bUseToolbar){
oAppContainer = jindo.$(oAppContainer) || document;
this.toolbarArea = cssquery.getSingle(".se2_tool", oAppContainer);
//설정이 없거나, 사용하겠다고 표시한 경우 block 처리
if( typeof(bUseToolbar) == 'undefined' || bUseToolbar === true){
this.toolbarArea.style.display = "block";
}else{
this.toolbarArea.style.display = "none";
}
},
$ON_MSG_APP_READY : function(){
this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
},
$ON_SE_TOGGLE_TOOLBAR : function(){
this.toolbarArea.style.display = (this.toolbarArea.style.display == "none")?"block":"none";
this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
}
$init: function (oAppContainer, bUseToolbar) {
this._assignHTMLObjects(oAppContainer, bUseToolbar);
},
_assignHTMLObjects: function (oAppContainer, bUseToolbar) {
oAppContainer = jindo.$(oAppContainer) || document;
this.toolbarArea = cssquery.getSingle(".se2_tool", oAppContainer);
//설정이 없거나, 사용하겠다고 표시한 경우 block 처리
if (typeof (bUseToolbar) == 'undefined' || bUseToolbar === true) {
this.toolbarArea.style.display = "block";
} else {
this.toolbarArea.style.display = "none";
}
},
$ON_MSG_APP_READY: function () {
this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
},
$ON_SE_TOGGLE_TOOLBAR: function () {
this.toolbarArea.style.display = (this.toolbarArea.style.display == "none") ? "block" : "none";
this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
}
});

View file

@ -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
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
* @name husky_SE2B_Lang_en_US.js
* @ unescape
*/
var oMessageMap_en_US = {
'SE_EditingAreaManager.onExit' : 'Contents have been changed.',
'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_FindReplace.keywordMissing' : 'Enter the word you wish to find.',
'SE_FindReplace.keywordNotFound' : 'The word does not exist.',
'SE_FindReplace.replaceAllResultP1' : 'A total of ',
'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.replaceKeywordNotFound' : 'No word to change.',
'SE_LineHeight.invalidLineHeight' : 'Incorrect value.',
'SE_Footnote.defaultText' : 'Enter footnote details.',
'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_FontNameWithLayerUI.sSampleText' : 'ABCD'
};
'SE_EditingAreaManager.onExit': 'Contents have been changed.',
'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_FindReplace.keywordMissing': 'Enter the word you wish to find.',
'SE_FindReplace.keywordNotFound': 'The word does not exist.',
'SE_FindReplace.replaceAllResultP1': 'A total of ',
'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.replaceKeywordNotFound': 'No word to change.',
'SE_LineHeight.invalidLineHeight': 'Incorrect value.',
'SE_Footnote.defaultText': 'Enter footnote details.',
'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_FontNameWithLayerUI.sSampleText': 'ABCD'
};

View file

@ -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
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
* @name husky_SE2B_Lang_ja_JP.js
* @ unescape
*/
var oMessageMap_ja_JP = {
'SE_EditingAreaManager.onExit' : '内容が変更されました。',
'SE_Color.invalidColorCode' : 'カラーコードを正しく入力してください。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL' : '入力したURLが正しくありません。',
'SE_FindReplace.keywordMissing' : 'お探しの単語を入力してください。',
'SE_FindReplace.keywordNotFound' : 'お探しの単語がありません。',
'SE_FindReplace.replaceAllResultP1' : '一致する内容が計',
'SE_FindReplace.replaceAllResultP2' : '件変わりました。',
'SE_FindReplace.notSupportedBrowser' : '現在ご使用中のブラウザーではご利用いただけない機能です。\n\nご不便をおかけしまして申し訳ございません。',
'SE_FindReplace.replaceKeywordNotFound' : '変更される単語がありません。',
'SE_LineHeight.invalidLineHeight' : '誤った値です。',
'SE_Footnote.defaultText' : '脚注内容を入力してください。',
'SE.failedToLoadFlash' : 'フラッシュが遮断されているため、この機能は使用できません。',
'SE2M_EditingModeChanger.confirmTextMode' : 'テキストモードに切り換えると、作成された内容は維持されますが、\n\nフォント等の編集効果と画像等の添付内容が消えることになります。\n\n切り換えますか',
'SE2M_FontNameWithLayerUI.sSampleText' : 'あいうえお'
};
'SE_EditingAreaManager.onExit': '内容が変更されました。',
'SE_Color.invalidColorCode': 'カラーコードを正しく入力してください。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL': '入力したURLが正しくありません。',
'SE_FindReplace.keywordMissing': 'お探しの単語を入力してください。',
'SE_FindReplace.keywordNotFound': 'お探しの単語がありません。',
'SE_FindReplace.replaceAllResultP1': '一致する内容が計',
'SE_FindReplace.replaceAllResultP2': '件変わりました。',
'SE_FindReplace.notSupportedBrowser': '現在ご使用中のブラウザーではご利用いただけない機能です。\n\nご不便をおかけしまして申し訳ございません。',
'SE_FindReplace.replaceKeywordNotFound': '変更される単語がありません。',
'SE_LineHeight.invalidLineHeight': '誤った値です。',
'SE_Footnote.defaultText': '脚注内容を入力してください。',
'SE.failedToLoadFlash': 'フラッシュが遮断されているため、この機能は使用できません。',
'SE2M_EditingModeChanger.confirmTextMode': 'テキストモードに切り換えると、作成された内容は維持されますが、\n\nフォント等の編集効果と画像等の添付内容が消えることになります。\n\n切り換えますか',
'SE2M_FontNameWithLayerUI.sSampleText': 'あいうえお'
};

View file

@ -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
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
* @name husky_SE2B_Lang_ko_KR.js
* @ unescape
*/
var oMessageMap = {
'SE_EditingAreaManager.onExit' : '내용이 변경되었습니다.',
'SE_Color.invalidColorCode' : '색상 코드를 올바르게 입력해 주세요. \n\n 예) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL' : '입력하신 URL이 올바르지 않습니다.',
'SE_FindReplace.keywordMissing' : '찾으실 단어를 입력해 주세요.',
'SE_FindReplace.keywordNotFound' : '찾으실 단어가 없습니다.',
'SE_FindReplace.replaceAllResultP1' : '일치하는 내용이 총 ',
'SE_FindReplace.replaceAllResultP2' : '건 바뀌었습니다.',
'SE_FindReplace.notSupportedBrowser' : '현재 사용하고 계신 브라우저에서는 사용하실수 없는 기능입니다.\n\n이용에 불편을 드려 죄송합니다.',
'SE_FindReplace.replaceKeywordNotFound' : '바뀔 단어가 없습니다',
'SE_LineHeight.invalidLineHeight' : '잘못된 값입니다.',
'SE_Footnote.defaultText' : '각주내용을 입력해 주세요',
'SE.failedToLoadFlash' : '플래시가 차단되어 있어 해당 기능을 사용할 수 없습니다.',
'SE2M_EditingModeChanger.confirmTextMode' : '텍스트 모드로 전환하면 작성된 내용은 유지되나, \n\n글꼴 등의 편집효과와 이미지 등의 첨부내용이 모두 사라지게 됩니다.\n\n전환하시겠습니까?',
'SE2M_FontNameWithLayerUI.sSampleText' : '가나다라'
};
'SE_EditingAreaManager.onExit': '내용이 변경되었습니다.',
'SE_Color.invalidColorCode': '색상 코드를 올바르게 입력해 주세요. \n\n 예) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL': '입력하신 URL이 올바르지 않습니다.',
'SE_FindReplace.keywordMissing': '찾으실 단어를 입력해 주세요.',
'SE_FindReplace.keywordNotFound': '찾으실 단어가 없습니다.',
'SE_FindReplace.replaceAllResultP1': '일치하는 내용이 총 ',
'SE_FindReplace.replaceAllResultP2': '건 바뀌었습니다.',
'SE_FindReplace.notSupportedBrowser': '현재 사용하고 계신 브라우저에서는 사용하실수 없는 기능입니다.\n\n이용에 불편을 드려 죄송합니다.',
'SE_FindReplace.replaceKeywordNotFound': '바뀔 단어가 없습니다',
'SE_LineHeight.invalidLineHeight': '잘못된 값입니다.',
'SE_Footnote.defaultText': '각주내용을 입력해 주세요',
'SE.failedToLoadFlash': '플래시가 차단되어 있어 해당 기능을 사용할 수 없습니다.',
'SE2M_EditingModeChanger.confirmTextMode': '텍스트 모드로 전환하면 작성된 내용은 유지되나, \n\n글꼴 등의 편집효과와 이미지 등의 첨부내용이 모두 사라지게 됩니다.\n\n전환하시겠습니까?',
'SE2M_FontNameWithLayerUI.sSampleText': '가나다라'
};

View file

@ -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
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
* @name husky_SE2B_Lang_zh_CN.js
* @ unescape
*/
var oMessageMap_zh_CN = {
'SE_EditingAreaManager.onExit' : '内容有了变化。',
'SE_Color.invalidColorCode' : '请你输入正确的色相代码。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL' : '你输入的URL不符条件。',
'SE_FindReplace.keywordMissing' : '请你输入要找的词汇。',
'SE_FindReplace.keywordNotFound' : '没有词汇符合条件。',
'SE_FindReplace.replaceAllResultP1' : '符合条件的内容改编为',
'SE_FindReplace.replaceAllResultP2' : '件',
'SE_FindReplace.notSupportedBrowser' : '这是你现在使用的浏览器不可支持的功能。\n\n麻烦你很道歉。',
'SE_FindReplace.replaceKeywordNotFound' : '没有词汇要改变。',
'SE_LineHeight.invalidLineHeight' : '这是有问题的值。',
'SE_Footnote.defaultText' : '请你输入脚注内容。',
'SE.failedToLoadFlash' : 'flash被隔绝不能使用该功能。',
'SE2M_EditingModeChanger.confirmTextMode' : '转换为text模式就能维持制作内容\n\n但字体等编辑效果和图像等附件内容都会消失。\n\n你还要继续吗',
'SE2M_FontNameWithLayerUI.sSampleText' : 'ABCD'
};
'SE_EditingAreaManager.onExit': '内容有了变化。',
'SE_Color.invalidColorCode': '请你输入正确的色相代码。 \n\n 例) #000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL': '你输入的URL不符条件。',
'SE_FindReplace.keywordMissing': '请你输入要找的词汇。',
'SE_FindReplace.keywordNotFound': '没有词汇符合条件。',
'SE_FindReplace.replaceAllResultP1': '符合条件的内容改编为',
'SE_FindReplace.replaceAllResultP2': '件',
'SE_FindReplace.notSupportedBrowser': '这是你现在使用的浏览器不可支持的功能。\n\n麻烦你很道歉。',
'SE_FindReplace.replaceKeywordNotFound': '没有词汇要改变。',
'SE_LineHeight.invalidLineHeight': '这是有问题的值。',
'SE_Footnote.defaultText': '请你输入脚注内容。',
'SE.failedToLoadFlash': 'flash被隔绝不能使用该功能。',
'SE2M_EditingModeChanger.confirmTextMode': '转换为text模式就能维持制作内容\n\n但字体等编辑效果和图像等附件内容都会消失。\n\n你还要继续吗',
'SE2M_FontNameWithLayerUI.sSampleText': 'ABCD'
};

View file

@ -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
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
* @name husky_SE2B_Lang_zh_TW.js
* @ unescape
*/
var oMessageMap_zh_TW = {
'SE_EditingAreaManager.onExit' : '內容已被更改。',
'SE_Color.invalidColorCode' : '請輸入正確的顔色代碼。\n\n例子#000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL' : '輸錯URL',
'SE_FindReplace.keywordMissing' : '請輸入要查詢的單詞。',
'SE_FindReplace.keywordNotFound' : '要查詢的單詞不存在。',
'SE_FindReplace.replaceAllResultP1' : '一致的內容總有',
'SE_FindReplace.replaceAllResultP2' : '件已被更改。',
'SE_FindReplace.notSupportedBrowser' : '當前的浏覽器上無法使用此功能。\n\n很抱歉給你添麻煩了。',
'SE_FindReplace.replaceKeywordNotFound' : '要更改的詞彙不存在。',
'SE_LineHeight.invalidLineHeight' : '爲有錯誤的值。',
'SE_Footnote.defaultText' : '請輸入注腳內容。',
'SE.failedToLoadFlash' : 'Flash被屏蔽導致無法使用此功能。',
'SE2M_EditingModeChanger.confirmTextMode' : '如轉換爲文本模式,雖然維持已寫成的內容,\n\n但字號等編輯效果和圖像等附加內容都會被消失。\n\n是否轉換',
'SE2M_FontNameWithLayerUI.sSampleText' : 'ABCD'
'SE_EditingAreaManager.onExit': '內容已被更改。',
'SE_Color.invalidColorCode': '請輸入正確的顔色代碼。\n\n例子#000000, #FF0000, #FFFFFF, #ffffff, ffffff',
'SE_Hyperlink.invalidURL': '輸錯URL',
'SE_FindReplace.keywordMissing': '請輸入要查詢的單詞。',
'SE_FindReplace.keywordNotFound': '要查詢的單詞不存在。',
'SE_FindReplace.replaceAllResultP1': '一致的內容總有',
'SE_FindReplace.replaceAllResultP2': '件已被更改。',
'SE_FindReplace.notSupportedBrowser': '當前的浏覽器上無法使用此功能。\n\n很抱歉給你添麻煩了。',
'SE_FindReplace.replaceKeywordNotFound': '要更改的詞彙不存在。',
'SE_LineHeight.invalidLineHeight': '爲有錯誤的值。',
'SE_Footnote.defaultText': '請輸入注腳內容。',
'SE.failedToLoadFlash': 'Flash被屏蔽導致無法使用此功能。',
'SE2M_EditingModeChanger.confirmTextMode': '如轉換爲文本模式,雖然維持已寫成的內容,\n\n但字號等編輯效果和圖像等附加內容都會被消失。\n\n是否轉換',
'SE2M_FontNameWithLayerUI.sSampleText': 'ABCD'
};

File diff suppressed because one or more lines are too long

View file

@ -1,106 +1,106 @@
/**
* @use 간단 포토 업로드용으로 제작되었습니다.
* @author cielo
* @See nhn.husky.SE2M_Configuration
* @ 팝업 마크업은 SimplePhotoUpload.html과 SimplePhotoUpload_html5.html이 있습니다.
*/
nhn.husky.SE2M_AttachQuickPhoto = jindo.$Class({
name : "SE2M_AttachQuickPhoto",
$init : function(){},
$ON_MSG_APP_READY : function(){
this.oApp.exec("REGISTER_UI_EVENT", ["photo_attach", "click", "ATTACHPHOTO_OPEN_WINDOW"]);
},
$LOCAL_BEFORE_FIRST : function(sMsg){
if(!!this.oPopupMgr){ return; }
// Popup Manager에서 사용할 param
this.htPopupOption = {
oApp : this.oApp,
sName : this.name,
bScroll : false,
sProperties : "",
sUrl : ""
};
this.oPopupMgr = nhn.husky.PopUpManager.getInstance(this.oApp);
},
/**
* 포토 웹탑 오픈
*/
$ON_ATTACHPHOTO_OPEN_WINDOW : function(){
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="+(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);
// 처음 로딩하고 IE에서 커서가 전혀 없는 경우
// 복수 업로드시에 순서가 바뀜
this.oApp.exec('FOCUS');
return (!!this.oPopupWindow ? true : false);
},
/**
* 서비스별로 팝업에 parameter를 추가하여 URL을 생성하는 함수
* nhn.husky.SE2M_AttachQuickPhoto.prototype.makePopupURL로 덮어써서 사용하시면 .
*/
makePopupURL : function(){
//var sPopupUrl = "./photo_uploader/popup/photo_uploader.html";
var sPopupUrl = "./photo_uploader/popup/index.html";
return sPopupUrl;
},
/**
* 팝업에서 호출되는 메세지.
*/
$ON_SET_PHOTO : function(aPhotoData){
var sContents,
aPhotoInfo,
htData;
if( !aPhotoData ){
return;
}
try{
sContents = "";
for(var i = 0; i <aPhotoData.length; i++){
htData = aPhotoData[i];
if(!htData.sAlign){
htData.sAlign = "";
}
aPhotoInfo = {
sName : htData.sFileName || "",
sOriginalImageURL : htData.sFileURL,
bNewLine : htData.bNewLine || false
};
sContents += this._getPhotoTag(aPhotoInfo);
}
this.oApp.exec("PASTE_HTML", [sContents]); // 위즐 첨부 파일 부분 확인
}catch(e){
// upload시 error발생에 대해서 skip함
return false;
}
},
/**
* @use 일반 포토 tag 생성
*/
_getPhotoTag : function(htPhotoInfo){
// id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test
var sTag = '<img src="{=sOriginalImageURL}" title="{=sName}" >';
if(htPhotoInfo.bNewLine){
sTag += '<br style="clear:both;">';
}
sTag = jindo.$Template(sTag).process(htPhotoInfo);
return sTag;
}
});
/**
* @use 간단 포토 업로드용으로 제작되었습니다.
* @author cielo
* @See nhn.husky.SE2M_Configuration
* @ 팝업 마크업은 SimplePhotoUpload.html과 SimplePhotoUpload_html5.html이 있습니다.
*/
nhn.husky.SE2M_AttachQuickPhoto = jindo.$Class({
name: "SE2M_AttachQuickPhoto",
$init: function () { },
$ON_MSG_APP_READY: function () {
this.oApp.exec("REGISTER_UI_EVENT", ["photo_attach", "click", "ATTACHPHOTO_OPEN_WINDOW"]);
},
$LOCAL_BEFORE_FIRST: function (sMsg) {
if (!!this.oPopupMgr) { return; }
// Popup Manager에서 사용할 param
this.htPopupOption = {
oApp: this.oApp,
sName: this.name,
bScroll: false,
sProperties: "",
sUrl: ""
};
this.oPopupMgr = nhn.husky.PopUpManager.getInstance(this.oApp);
},
/**
* 포토 웹탑 오픈
*/
$ON_ATTACHPHOTO_OPEN_WINDOW: function () {
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=" + (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);
// 처음 로딩하고 IE에서 커서가 전혀 없는 경우
// 복수 업로드시에 순서가 바뀜
this.oApp.exec('FOCUS');
return (!!this.oPopupWindow ? true : false);
},
/**
* 서비스별로 팝업에 parameter를 추가하여 URL을 생성하는 함수
* nhn.husky.SE2M_AttachQuickPhoto.prototype.makePopupURL로 덮어써서 사용하시면 .
*/
makePopupURL: function () {
//var sPopupUrl = "./photo_uploader/popup/photo_uploader.html";
var sPopupUrl = "./photo_uploader/popup/index.html";
return sPopupUrl;
},
/**
* 팝업에서 호출되는 메세지.
*/
$ON_SET_PHOTO: function (aPhotoData) {
var sContents,
aPhotoInfo,
htData;
if (!aPhotoData) {
return;
}
try {
sContents = "";
for (var i = 0; i < aPhotoData.length; i++) {
htData = aPhotoData[i];
if (!htData.sAlign) {
htData.sAlign = "";
}
aPhotoInfo = {
sName: htData.sFileName || "",
sOriginalImageURL: htData.sFileURL,
bNewLine: htData.bNewLine || false
};
sContents += this._getPhotoTag(aPhotoInfo);
}
this.oApp.exec("PASTE_HTML", [sContents]); // 위즐 첨부 파일 부분 확인
} catch (e) {
// upload시 error발생에 대해서 skip함
return false;
}
},
/**
* @use 일반 포토 tag 생성
*/
_getPhotoTag: function (htPhotoInfo) {
// id와 class는 썸네일과 연관이 많습니다. 수정시 썸네일 영역도 Test
var sTag = '<img src="{=sOriginalImageURL}" title="{=sName}" >';
if (htPhotoInfo.bNewLine) {
sTag += '<br style="clear:both;">';
}
sTag = jindo.$Template(sTag).process(htPhotoInfo);
return sTag;
}
});

View file

@ -17,6 +17,7 @@
font-size: inherit;
direction: inherit;
}
.fileinput-button span {
display: none;
}

View file

@ -14,15 +14,18 @@
.fileupload-buttonbar .toggle {
margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
background: url("../img/progressbar.gif") !important;
filter: none;
}
.fileupload-process {
float: right;
display: none;
}
.fileupload-processing .fileupload-process,
.files .processing .preview {
display: block;
@ -31,25 +34,30 @@
background: url("../img/loading.gif") center no-repeat;
background-size: contain;
}
.files audio,
.files video {
max-width: 300px;
}
@media (max-width: 767px) {
.fileupload-buttonbar .toggle,
.files .toggle,
.files .btn span {
display: none;
}
.files .name {
width: 80px;
word-wrap: break-word;
}
.files audio,
.files video {
max-width: 80px;
}
.files img,
.files canvas {
max-width: 100%;

View file

@ -14,6 +14,7 @@
position: relative;
overflow: hidden;
}
.fileinput-button input {
position: absolute;
top: 0;

View file

@ -10,90 +10,210 @@
* http://www.opensource.org/licenses/MIT
*/
body {margin:0;padding:0;overflow-x:hidden}
body,input,textarea,select,button,table{font-family:'돋움',Dotum,Helvetica,sans-serif;font-size:12px}
#pop_header{height:26px;padding:14px 0 0 20px;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;
body {
margin: 0;
padding: 0;
overflow-x: hidden
}
.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;
body,
input,
textarea,
select,
button,
table {
font-family: '돋움', Dotum, Helvetica, sans-serif;
font-size: 12px
}
.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;
#pop_header {
height: 26px;
padding: 14px 0 0 20px;
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 {
display: inline-block;
margin-bottom: 0;
font-weight: 400;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 12px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
display: inline-block;
margin-bottom: 0;
font-weight: 400;
text-align: center;
vertical-align: middle;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
padding: 6px 12px;
font-size: 12px;
line-height: 1.42857143;
border-radius: 4px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn-success {
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
color: #fff;
background-color: #5cb85c;
border-color: #4cae4c;
}
.btn:hover, .btn:focus {
color: #333;
text-decoration: none;
.btn:hover,
.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;
background-color: #47a447;
border-color: #398439;
.btn-success:hover,
.btn-success:focus,
.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}

View file

@ -2,66 +2,62 @@
<html lang="ko">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>사진 첨부하기 :: SmartEditor2</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css?v=140715">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>사진 첨부하기 :: SmartEditor2</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css?v=140715">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
</head>
<body>
<div class="container pop_container">
<!-- header -->
<div id="pop_header">
<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 class="container pop_container">
<!-- header -->
<div id="pop_header">
<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>
<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>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="./js/jquery.iframe-transport.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>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="./js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="./swfupload/swfupload.js?v=210625-1329"></script>
<script type="text/javascript" src="./swfupload/jquery.swfupload.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>
<!-- 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>
</html>
</html>

View file

@ -1,347 +1,347 @@
jQuery.fn.bindAll = function (options) {
var $this = this;
jQuery.each(options, function (key, val) {
$this.bind(key, val);
});
return this;
}
jQuery(function ($) {
'use strict';
var ed_nonce = '';
if (!!opener && !!opener.window && !!opener.window.nhn) {
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
}
// Change this to the location of your server-side upload handler:
var gnu = {
url: './php/?_nonce=' + ed_nonce,
container_el: 'body',
dreg_area: '#drag_area',
dreg_area_list: '#drag_area > ul',
progress_bar: '#progress .progress-bar',
filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
files: [],
file_limit: 10, //한번에 올릴수 파일갯수 제한
imgw: 100,
imgh: 70,
file_api_support: !!(window.ProgressEvent && window.FileReader),
$elTextGuide: $("#guide_text"),
init: function () {
$(this.dreg_area_list).sortable({
'cursor': 'pointer',
'placeholder': 'placeholder'
});
$(this.dreg_area_list).disableSelection();
if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
},
file_push: function (file) {
var othis = this,
last = othis.files.length;
othis.files.push(file);
},
_readymodebg: function () {
if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class');
if (sClass.indexOf('hidebg') > 0) {
this.$elTextGuide.removeClass('hidebg');
this.$elTextGuide.addClass('showbg');
}
}
},
_startmodebg: function () {
if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class');
if (sClass.indexOf('hidebg') < 0) {
this.$elTextGuide.removeClass('showbg');
this.$elTextGuide.addClass('hidebg');
}
}
},
_delete: function (e) {
e.preventDefault();
var othis = gnu,
$button = $(e.currentTarget),
delete_url = $button.attr("data-delete");
if (delete_url) {
$.ajax({
url: othis.url + "&del=1&file=" + delete_url
}).done(function (result) {
});
}
$button.parents('li.sort_list').fadeOut(300, function () {
$(this).remove();
var $dreg_area = $(othis.dreg_area_list);
$dreg_area.sortable('refresh');
if (!$dreg_area.children('li').length) othis._readymodebg();
});
},
_add: function (e, data, preload) {
var othis = this;
othis._startmodebg();
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
$.each(data.files, function (index, file) {
if (!preload && !othis.filter.test(file.type)) {
var agent = navigator.userAgent.toLowerCase();
var msg = '';
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1)? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다.":"이미지만 허용합니다.";
data.context.remove();
alert(msg);
return true;
}
var node = $('<div/>')
.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='삭제' >")),
$img = "<img src='./img/loading.gif' class='pre_thumb' />",
size_text = '';
if (preload && preload != 'swfupload') {
var ret = othis.get_ratio(file.width, file.height),
size_text = file.width + " x " + file.height;
$img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
}
if (!index) {
node.prepend('<br>')
.prepend($img);
if (size_text) {
node.append('<br>')
.append($('<span/>').text(size_text))
}
}
node.appendTo(data.context);
node.find(".delete_img").on("click", othis._delete);
});
$(othis.dreg_area_list).sortable('refresh');
},
get_file_all: function () {
var othis = this,
oDate = new Date();
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
//url: $('#fileupload').fileupload('option', 'url'),
url: this.url + "&t=" + oDate.getTime(),
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
//$(this).removeClass('fileupload-processing');
}).done(function (result) {
$.each(result.files, function (index, data) {
var tmp = { files: [] };
tmp.files[0] = data;
othis._add($.Event('add'), tmp, 'preload');
});
});
},
_processalways: function (e, data) {
var index = data.index,
file = data.files[index],
node = $(data.context.children()[index]);
if (file.error) {
node
.append('<br>')
.append($('<span class="text-danger"/>').text(file.error));
}
if (index + 1 === data.files.length) {
data.context.find('button')
.text('Upload')
.prop('disabled', !!data.files.error);
}
},
obj_to_arr: function (obj) {
var array = $.map(obj, function (value, index) {
return [value];
});
return array;
},
_done: function (e, data) {
var othis = this;
$.each(data.result.files, function (index, file) {
if (file.url && !file.error) {
var ret = othis.get_ratio(file.width, file.height),
node = $(data.context.children()[index]),
size_text = file.width + " x " + file.height,
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
link = $('<a>')
.attr('target', '_blank')
.prop('href', file.url);
node
//.wrap(link)
.append('<br>')
.append($('<span/>').text(size_text))
.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 });
} else if (file.error) {
var error = $('<span class="text-danger"/>').text(file.error);
$(data.context.children()[index])
.append('<br>')
.append(error);
}
othis.file_push(file);
});
},
get_ratio: function (width, height) {
var ratio = 0,
ret_img = [];
if (!width || !height) {
ret_img['width'] = this.imgw;
ret_img['height'] = this.imgh;
return ret_img;
}
if (width > this.imgw) {
ratio = this.imgw / width;
height = height * ratio;
width = this.imgw;
}
if (height > this.imgh) {
ratio = this.imgh / height;
width = width * ratio;
height = this.imgh;
}
ret_img['width'] = parseInt(width);
ret_img['height'] = parseInt(height);
return ret_img;
},
setPhotoToEditor: function (oFileInfo) {
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
//본문에 바로 tag를 넣는 방법 (oFileInfo는 String으로 <img src=....> )
//opener.nhn.husky.PopUpManager.setCallback(window, 'PASTE_HTML', [oFileInfo]);
}
}
}
$('#fileupload').fileupload({
url: gnu.url,
dataType: 'json',
container_el: gnu.container_el,
dropZone: $(gnu.dreg_area),
autoUpload: true,
sequentialUploads: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: true,
limit_filesLength: gnu.file_limit
}).on('fileuploadadd', function (e, data) {
gnu._add(e, data);
}).on('fileuploadprocessalways', function (e, data) {
gnu._processalways(e, data);
}).on('fileuploaddone', function (e, data) {
gnu._done(e, data);
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index, file) {
var error = $('<span class="text-danger"/>').text('File upload failed.');
$(data.context.children()[index])
.append('<br>')
.append(error);
});
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
gnu.init();
var listeners = {
data: {},
log: false,
swfuploadLoaded: function (event) {
if (this.log) $('.log', this).append('<li>Loaded</li>');
},
fileQueued: function (event, file) {
if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
// start the upload once it is queued
// but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload');
}
},
fileQueueError: function (event, file, errorCode, message) {
switch (errorCode) {
case -100:
alert("파일을 " + message + "개 이하로 선택해주세요.");
break;
}
if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
},
fileDialogStart: function (event) {
if (this.log) $('.log', this).append('<li>File dialog start</li>');
},
fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
if (this.log) $('.log', this).append('<li>File dialog complete</li>');
},
uploadStart: function (event, file) {
listeners.data.files = $.makeArray(file);
gnu._add(event, listeners.data, 'swfupload');
if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
},
uploadProgress: function (event, file, bytesLoaded) {
if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
},
uploadSuccess: function (event, file, serverData) {
listeners.data.result = jQuery.parseJSON(serverData);
gnu._done(event, listeners.data);
if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
},
uploadComplete: function (event, file) {
if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
// upload has completed, lets try the next one in the queue
// but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload');
}
},
uploadError: function (event, file, errorCode, message) {
if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
}
};
$(gnu.container_el).bindAll(listeners);
/* listeners이벤트 */
$(gnu.dreg_area).bind('drop dragover', function (e) {
e.preventDefault();
if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
});
$("#all_remove_btn").bind("click", function (e) {
e.preventDefault();
if ($(gnu.dreg_area_list).children().length) {
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
$(gnu.dreg_area_list).find(".delete_img").each(function (i) {
$(this).trigger("click");
});
$(gnu.dreg_area_list).sortable('refresh');
}
}
});
$("#img_upload_submit").bind("click", function (e) {
e.preventDefault();
var aResult = [], j = 0;
$(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
if (!$(this).attr("data-url")) return true;
aResult[j] = [];
aResult[j]['bNewLine'] = 'true';
aResult[j]['sAlign'] = '';
aResult[j]['sFileName'] = $(this).attr("data-delete");
aResult[j]['sFileURL'] = $(this).attr("data-url");
j++;
});
if (aResult.length) {
gnu.setPhotoToEditor(aResult);
aResult = null;
}
window.close();
});
$("#close_w_btn").bind("click", function (e) {
e.preventDefault();
window.close();
});
});
jQuery.fn.bindAll = function (options) {
var $this = this;
jQuery.each(options, function (key, val) {
$this.bind(key, val);
});
return this;
}
jQuery(function ($) {
'use strict';
var ed_nonce = '';
if (!!opener && !!opener.window && !!opener.window.nhn) {
ed_nonce = opener.window.nhn.husky.SE2M_Configuration.SE2M_Accessibility.ed_nonce;
}
// Change this to the location of your server-side upload handler:
var gnu = {
url: './php/?_nonce=' + ed_nonce,
container_el: 'body',
dreg_area: '#drag_area',
dreg_area_list: '#drag_area > ul',
progress_bar: '#progress .progress-bar',
filter: /^(image\/bmp|image\/gif|image\/jpg|image\/jpeg|image\/png|image\/webp)$/i,
files: [],
file_limit: 10, //한번에 올릴수 파일갯수 제한
imgw: 100,
imgh: 70,
file_api_support: !!(window.ProgressEvent && window.FileReader),
$elTextGuide: $("#guide_text"),
init: function () {
$(this.dreg_area_list).sortable({
'cursor': 'pointer',
'placeholder': 'placeholder'
});
$(this.dreg_area_list).disableSelection();
if (this.file_api_support) this.$elTextGuide.removeClass("hidebg").addClass("showbg");
},
file_push: function (file) {
var othis = this,
last = othis.files.length;
othis.files.push(file);
},
_readymodebg: function () {
if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class');
if (sClass.indexOf('hidebg') > 0) {
this.$elTextGuide.removeClass('hidebg');
this.$elTextGuide.addClass('showbg');
}
}
},
_startmodebg: function () {
if (this.file_api_support) {
var sClass = this.$elTextGuide.attr('class');
if (sClass.indexOf('hidebg') < 0) {
this.$elTextGuide.removeClass('showbg');
this.$elTextGuide.addClass('hidebg');
}
}
},
_delete: function (e) {
e.preventDefault();
var othis = gnu,
$button = $(e.currentTarget),
delete_url = $button.attr("data-delete");
if (delete_url) {
$.ajax({
url: othis.url + "&del=1&file=" + delete_url
}).done(function (result) {
});
}
$button.parents('li.sort_list').fadeOut(300, function () {
$(this).remove();
var $dreg_area = $(othis.dreg_area_list);
$dreg_area.sortable('refresh');
if (!$dreg_area.children('li').length) othis._readymodebg();
});
},
_add: function (e, data, preload) {
var othis = this;
othis._startmodebg();
data.context = $('<li/>').addClass("sort_list").appendTo(this.dreg_area_list);
$.each(data.files, function (index, file) {
if (!preload && !othis.filter.test(file.type)) {
var agent = navigator.userAgent.toLowerCase();
var msg = '';
msg = (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) ? "익스플로러 환경에서는 gif, png, jpg 파일만 \n전송할 수 있습니다." : "이미지만 허용합니다.";
data.context.remove();
alert(msg);
return true;
}
var node = $('<div/>')
.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='삭제' >")),
$img = "<img src='./img/loading.gif' class='pre_thumb' />",
size_text = '';
if (preload && preload != 'swfupload') {
var ret = othis.get_ratio(file.width, file.height),
size_text = file.width + " x " + file.height;
$img = "<img src='" + file.url + "' width='" + ret['width'] + "' height='" + ret['height'] + "' class='pre_thumb' />";
}
if (!index) {
node.prepend('<br>')
.prepend($img);
if (size_text) {
node.append('<br>')
.append($('<span/>').text(size_text))
}
}
node.appendTo(data.context);
node.find(".delete_img").on("click", othis._delete);
});
$(othis.dreg_area_list).sortable('refresh');
},
get_file_all: function () {
var othis = this,
oDate = new Date();
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
//url: $('#fileupload').fileupload('option', 'url'),
url: this.url + "&t=" + oDate.getTime(),
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
//$(this).removeClass('fileupload-processing');
}).done(function (result) {
$.each(result.files, function (index, data) {
var tmp = { files: [] };
tmp.files[0] = data;
othis._add($.Event('add'), tmp, 'preload');
});
});
},
_processalways: function (e, data) {
var index = data.index,
file = data.files[index],
node = $(data.context.children()[index]);
if (file.error) {
node
.append('<br>')
.append($('<span class="text-danger"/>').text(file.error));
}
if (index + 1 === data.files.length) {
data.context.find('button')
.text('Upload')
.prop('disabled', !!data.files.error);
}
},
obj_to_arr: function (obj) {
var array = $.map(obj, function (value, index) {
return [value];
});
return array;
},
_done: function (e, data) {
var othis = this;
$.each(data.result.files, function (index, file) {
if (file.url && !file.error) {
var ret = othis.get_ratio(file.width, file.height),
node = $(data.context.children()[index]),
size_text = file.width + " x " + file.height,
//$img = "<img src='"+file.url+"' width='"+ret['width']+"' height='"+ret['height']+"' />",
link = $('<a>')
.attr('target', '_blank')
.prop('href', file.url);
node
//.wrap(link)
.append('<br>')
.append($('<span/>').text(size_text))
.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 });
} else if (file.error) {
var error = $('<span class="text-danger"/>').text(file.error);
$(data.context.children()[index])
.append('<br>')
.append(error);
}
othis.file_push(file);
});
},
get_ratio: function (width, height) {
var ratio = 0,
ret_img = [];
if (!width || !height) {
ret_img['width'] = this.imgw;
ret_img['height'] = this.imgh;
return ret_img;
}
if (width > this.imgw) {
ratio = this.imgw / width;
height = height * ratio;
width = this.imgw;
}
if (height > this.imgh) {
ratio = this.imgh / height;
width = width * ratio;
height = this.imgh;
}
ret_img['width'] = parseInt(width);
ret_img['height'] = parseInt(height);
return ret_img;
},
setPhotoToEditor: function (oFileInfo) {
if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);
//본문에 바로 tag를 넣는 방법 (oFileInfo는 String으로 <img src=....> )
//opener.nhn.husky.PopUpManager.setCallback(window, 'PASTE_HTML', [oFileInfo]);
}
}
}
$('#fileupload').fileupload({
url: gnu.url,
dataType: 'json',
container_el: gnu.container_el,
dropZone: $(gnu.dreg_area),
autoUpload: true,
sequentialUploads: true,
acceptFileTypes: /(\.|\/)(gif|jpe?g|bmp|png|webp)$/i,
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: true,
limit_filesLength: gnu.file_limit
}).on('fileuploadadd', function (e, data) {
gnu._add(e, data);
}).on('fileuploadprocessalways', function (e, data) {
gnu._processalways(e, data);
}).on('fileuploaddone', function (e, data) {
gnu._done(e, data);
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index, file) {
var error = $('<span class="text-danger"/>').text('File upload failed.');
$(data.context.children()[index])
.append('<br>')
.append(error);
});
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
gnu.init();
var listeners = {
data: {},
log: false,
swfuploadLoaded: function (event) {
if (this.log) $('.log', this).append('<li>Loaded</li>');
},
fileQueued: function (event, file) {
if (this.log) $('.log', this).append('<li>File queued - ' + file.name + '</li>');
// start the upload once it is queued
// but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload');
}
},
fileQueueError: function (event, file, errorCode, message) {
switch (errorCode) {
case -100:
alert("파일을 " + message + "개 이하로 선택해주세요.");
break;
}
if (this.log) $('.log', this).append('<li>File queue error - ' + message + '</li>');
},
fileDialogStart: function (event) {
if (this.log) $('.log', this).append('<li>File dialog start</li>');
},
fileDialogComplete: function (event, numFilesSelected, numFilesQueued) {
if (this.log) $('.log', this).append('<li>File dialog complete</li>');
},
uploadStart: function (event, file) {
listeners.data.files = $.makeArray(file);
gnu._add(event, listeners.data, 'swfupload');
if (this.log) $('.log', this).append('<li>Upload start - ' + file.name + '</li>');
},
uploadProgress: function (event, file, bytesLoaded) {
if (this.log) $('.log', this).append('<li>Upload progress - ' + bytesLoaded + '</li>');
},
uploadSuccess: function (event, file, serverData) {
listeners.data.result = jQuery.parseJSON(serverData);
gnu._done(event, listeners.data);
if (this.log) $('.log', this).append('<li>Upload success - ' + file.name + '</li>');
},
uploadComplete: function (event, file) {
if (this.log) $('.log', this).append('<li>Upload complete - ' + file.name + '</li>');
// upload has completed, lets try the next one in the queue
// but only if this queue is not disabled
if (!$('input[name=disabled]:checked', this).length) {
$(this).swfupload('startUpload');
}
},
uploadError: function (event, file, errorCode, message) {
if (this.log) $('.log', this).append('<li>Upload error - ' + message + '</li>');
}
};
$(gnu.container_el).bindAll(listeners);
/* listeners이벤트 */
$(gnu.dreg_area).bind('drop dragover', function (e) {
e.preventDefault();
if (!gnu.file_api_support && e.type == 'drop') alert("브라우저가 드래그 앤 드랍을 지원하지 않습니다.");
});
$("#all_remove_btn").bind("click", function (e) {
e.preventDefault();
if ($(gnu.dreg_area_list).children().length) {
if (confirm("추가한 이미지가 있습니다.정말 삭제 하시겠습니까?")) {
$(gnu.dreg_area_list).find(".delete_img").each(function (i) {
$(this).trigger("click");
});
$(gnu.dreg_area_list).sortable('refresh');
}
}
});
$("#img_upload_submit").bind("click", function (e) {
e.preventDefault();
var aResult = [], j = 0;
$(gnu.dreg_area_list).find(".delete_img").each(function (i, f) {
if (!$(this).attr("data-url")) return true;
aResult[j] = [];
aResult[j]['bNewLine'] = 'true';
aResult[j]['sAlign'] = '';
aResult[j]['sFileName'] = $(this).attr("data-delete");
aResult[j]['sFileURL'] = $(this).attr("data-url");
j++;
});
if (aResult.length) {
gnu.setPhotoToEditor(aResult);
aResult = null;
}
window.close();
});
$("#close_w_btn").bind("click", function (e) {
e.preventDefault();
window.close();
});
});

View file

@ -13,160 +13,160 @@
/* global define, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload'
], factory);
} else {
// Browser globals:
factory(
window.jQuery
);
}
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload'
], factory);
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(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
// with file processing functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
// The File Upload Processing plugin extends the fileupload widget
// with file processing functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The list of processing actions:
processQueue: [
/*
{
action: 'log',
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();
options: {
// The list of processing actions:
processQueue: [
/*
{
action: 'log',
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();
}
});
}));

View file

@ -12,203 +12,203 @@
/* global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
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 iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
};
}
});
// 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());
// 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 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());
}
}
});
}));

View file

@ -10,521 +10,521 @@
*/
(function (factory) {
if (typeof define === "function" && define.amd) {
// Register as an anonymous AMD module:
define(["jquery"], factory);
} else {
// Browser globals:
factory(jQuery);
if (typeof define === "function" && define.amd) {
// Register as an anonymous AMD module:
define(["jquery"], factory);
} else {
// Browser globals:
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,
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 ) {}
}
_cleanData( elems );
};
$.widget = function (name, base, prototype) {
var fullName, existingConstructor, constructor, basePrototype,
// 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];
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// 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];
fullName = namespace + "-" + name;
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if (!prototype) {
prototype = base;
base = $.Widget;
}
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[":"][fullName.toLowerCase()] = function (elem) {
return !!$.data(elem, fullName);
};
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[namespace] = $[namespace] || {};
existingConstructor = $[namespace][name];
constructor = $[namespace][name] = function (options, element) {
// allow instantiation without "new" keyword
if (!this._createWidget) {
return new constructor(options, element);
}
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if (arguments.length) {
this._createWidget(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
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( 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: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// 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;
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// 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;
this._superApply = _superApply;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply(this, arguments);
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
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;
};
})();
});
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
});
// 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.
if (existingConstructor) {
$.each(existingConstructor._childConstructors, function (i, child) {
var childPrototype = child.prototype;
// 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.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// 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);
}
// redefine the child widget using the same prototype that was
// 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.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 ) {
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.bridge = function (name, object) {
var fullName = object.prototype.widgetFullName || name;
$.fn[name] = function (options) {
var isMethodCall = typeof options === "string",
args = slice.call(arguments, 1),
returnValue = this;
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = slice.call( arguments, 1 ),
returnValue = this;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.widget.extend.apply(null, [options].concat(args)) :
options;
// allow multiple hashes to be passed on init
options = !isMethodCall && args.length ?
$.widget.extend.apply( null, [ options ].concat(args) ) :
options;
if (isMethodCall) {
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));
}
});
}
if ( isMethodCall ) {
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;
};
};
return returnValue;
};
};
$.Widget = function ( /* options, element */) { };
$.Widget._childConstructors = [];
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_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);
// callbacks
create: null
},
_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 = $();
this.hoverable = $();
this.focusable = $();
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if (element !== this) {
$.data(element, this.widgetFullName, this);
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 ) {
$.data( element, this.widgetFullName, this );
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 );
}
this._create();
this._trigger("create", null, this._getCreateEventData());
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function () {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind(this.eventNamespace)
// 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");
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
// 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
this.bindings.unbind(this.eventNamespace);
this.hoverable.removeClass("ui-state-hover");
this.focusable.removeClass("ui-state-focus");
},
_destroy: $.noop,
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function () {
return this.element;
},
widget: function() {
return this.element;
},
option: function (key, value) {
var options = key,
parts,
curOption,
i;
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if (arguments.length === 0) {
// don't return a reference to the internal hash
return $.widget.extend({}, this.options);
}
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if (typeof key === "string") {
// 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;
}
}
if ( typeof key === "string" ) {
// 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);
this._setOptions( options );
return this;
},
_setOptions: function (options) {
var key;
return this;
},
_setOptions: function( options ) {
var key;
for (key in options) {
this._setOption(key, options[key]);
}
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function (key, value) {
this.options[key] = value;
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if (key === "disabled") {
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");
}
if ( key === "disabled" ) {
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;
},
return this;
},
enable: function () {
return this._setOption("disabled", false);
},
disable: function () {
return this._setOption("disabled", true);
},
enable: function() {
return this._setOption( "disabled", false );
},
disable: function() {
return this._setOption( "disabled", true );
},
_on: function (suppressDisabledCheck, element, handlers) {
var delegateElement,
instance = this;
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if (typeof suppressDisabledCheck !== "boolean") {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if (!handlers) {
handlers = element;
element = this.element;
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
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
// accept selectors, DOM elements
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each(handlers, function (event, handler) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - 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);
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - 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
if (typeof handler !== "string") {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match(/^(\w+)\s*(.*)$/),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if (selector) {
delegateElement.delegate(selector, eventName, handlerProxy);
} else {
element.bind(eventName, handlerProxy);
}
});
},
var match = event.match( /^(\w+)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function (element, eventName) {
eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
element.unbind(eventName).undelegate(eventName);
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
},
_delay: function (handler, delay) {
function handlerProxy() {
return (typeof handler === "string" ? instance[handler] : handler)
.apply(instance, arguments);
}
var instance = this;
return setTimeout(handlerProxy, delay || 0);
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function (element) {
this.hoverable = this.hoverable.add(element);
this._on(element, {
mouseenter: function (event) {
$(event.currentTarget).addClass("ui-state-hover");
},
mouseleave: function (event) {
$(event.currentTarget).removeClass("ui-state-hover");
}
});
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function (element) {
this.focusable = this.focusable.add(element);
this._on(element, {
focusin: function (event) {
$(event.currentTarget).addClass("ui-state-focus");
},
focusout: function (event) {
$(event.currentTarget).removeClass("ui-state-focus");
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function (type, event, data) {
var prop, orig,
callback = this.options[type];
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event(event);
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 || {};
event = $.Event( event );
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 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if (orig) {
for (prop in orig) {
if (!(prop in event)) {
event[prop] = orig[prop];
}
}
}
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger(event, data);
return !($.isFunction(callback) &&
callback.apply(this.element[0], [event].concat(data)) === false ||
event.isDefaultPrevented());
}
};
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
$.each({ show: "fadeIn", hide: "fadeOut" }, function (method, defaultEffect) {
$.Widget.prototype["_" + method] = function (element, options, callback) {
if (typeof options === "string") {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if (typeof options === "number") {
options = { duration: options };
}
hasOptions = !$.isEmptyObject(options);
options.complete = callback;
if (options.delay) {
element.delay(options.delay);
}
if (hasOptions && $.effects && $.effects.effect[effectName]) {
element[method](options);
} else if (effectName !== method && element[effectName]) {
element[effectName](options.duration, options.easing, callback);
} else {
element.queue(function (next) {
$(this)[method]();
if (callback) {
callback.call(element[0]);
}
next();
});
}
};
});
}));

View file

@ -1,2 +1,2 @@
<?php
include_once("../../../../../../common.php");
<?php
include_once("../../../../../../common.php");

View file

@ -11,50 +11,51 @@
*/
include_once("./_common.php");
if( !function_exists('json_encode') ) {
@include_once("./JSON.php");
function json_encode($data) {
$json = new Services_JSON();
return( $json->encode($data) );
}
if (!function_exists('json_encode')) {
@include_once("./JSON.php");
function json_encode($data)
{
$json = new Services_JSON();
return ($json->encode($data));
}
}
@ini_set('gd.jpeg_ignore_warning', 1);
$ym = date('ym', G5_SERVER_TIME);
$data_dir = G5_DATA_PATH.'/editor/'.$ym.'/';
$data_url = G5_DATA_URL.'/editor/'.$ym.'/';
$data_dir = G5_DATA_PATH . '/editor/' . $ym . '/';
$data_url = G5_DATA_URL . '/editor/' . $ym . '/';
@mkdir($data_dir, G5_DIR_PERMISSION);
@chmod($data_dir, G5_DIR_PERMISSION);
if(!function_exists('ft_nonce_is_valid')){
include_once('../../../editor.lib.php');
if (!function_exists('ft_nonce_is_valid')) {
include_once('../../../editor.lib.php');
}
$is_editor_upload = false;
if( isset($_GET['_nonce']) && ft_nonce_is_valid( $_GET['_nonce'] , 'smarteditor' ) ){
$is_editor_upload = true;
if (isset($_GET['_nonce']) && ft_nonce_is_valid($_GET['_nonce'], 'smarteditor')) {
$is_editor_upload = true;
}
if( $is_editor_upload ) {
run_event('smarteditor_photo_upload', $data_dir, $data_url);
if ($is_editor_upload) {
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' => array()
);
run_event('smarteditor_photo_upload', $data_dir, $data_url);
$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 {
echo json_encode(array('files'=>array('0'=>array('error'=>'정상적인 업로드가 아닙니다.'))));
exit;
}
echo json_encode(array('files' => array('0' => array('error' => $_GET['_nonce']))));
exit;
}

View file

@ -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 = "&nbsp;";
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 = "&nbsp;";
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);
}
};

View file

@ -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);
};
}

View file

@ -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);

View file

@ -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;
}
}
};
}