1/* 2 * ê³µíµ ìëµì½ë, ë¡ì¼ì¼ ë©ìì§, íê²½ì¤ì ìµì ë°ì´í°ë¥¼ ì ì¥íë ê°ì²´ 3 */ 4var _RESP_CODE = {}; 5var _MESSAGES = {}; 6var _CFG = {}; 7 8/* 9 * app object definition 10 */ 11var app = {}; 12 13app.loginSession = {}; 14app.onAppInit = function () {}; 15app.onPageInit = function () {}; 16 17/* 18 * ê³µíµë°ì´í°ë¥¼ 모ë ë¡ë© (ê°ë³ì ì¼ë¡ ë¡ë©íë ¤ë©´ ìë í¨ì ì¬ì©) 19 */ 20app.loadCommonData = function() { 21 var ajaxReq = new AjaxRequest(); 22 ajaxReq.setUrl("/commonApi/commonData"); 23 ajaxReq.setType("get"); 24 ajaxReq.setSuccess(function(data, status){ 25 _RESP_CODE = data.extra.responseCode; 26 _MESSAGES = data.extra.messages; 27 _CFG = data.extra.configurations; 28 }); 29 ajaxReq.setError(function(request, status, err){ 30 notify("Failed to load common data."); 31 }); 32 return ajaxReq.request(); 33}; 34 35/* 36 * ê³µíµ ìëµì½ë ë°ì´í°ë¥¼ ë¡ë© 37 */ 38app.loadResponseCode = function() { 39 var ajaxReq = new AjaxRequest(); 40 ajaxReq.setUrl("/commonApi/commonData/responseCode"); 41 ajaxReq.setType("get"); 42 ajaxReq.setSuccess(function(data, status){ 43 _RESP_CODE = data.extra.responseCode; 44 }); 45 ajaxReq.setError(function(request, status, err){ 46 notify("Failed to load response code."); 47 }); 48 return ajaxReq.request(); 49}; 50 51/* 52 * ë¡ì¼ì¼ ë©ìì§ ë°ì´í°ë¥¼ ë¡ë© 53 */ 54app.loadMessages = function () { 55 var ajaxReq = new AjaxRequest(); 56 ajaxReq.setUrl("/commonApi/commonData/messages"); 57 ajaxReq.setType("get"); 58 ajaxReq.setSuccess(function(data, status){ 59 _MESSAGES = data.extra.messages; 60 }); 61 ajaxReq.setError(function(request, status, err){ 62 notify("Failed to load message data."); 63 }); 64 return ajaxReq.request(); 65}; 66 67/* 68 * ë©ìì§ ë°ì´í°ë¥¼ ë¶ë¬ìì ê°ì²´ì ì ì¥íë í¨ì 69 */ 70app.loadConfigurations = function () { 71 var ajaxReq = new AjaxRequest(); 72 ajaxReq.setUrl("/commonApi/commonData/configurations"); 73 ajaxReq.setType("get"); 74 ajaxReq.setSuccess(function(data, status){ 75 _CFG = data.extra.configurations; 76 }); 77 ajaxReq.setError(function(request, status, err){ 78 notify("Failed to load configurations data."); 79 }); 80 return ajaxReq.request(); 81}; 82 83/* 84 * ë¡ê·¸ì¸ì¸ì ì 보를 ë¡ë© 85 */ 86app.loadLoginSession = function() { 87 var ajaxReq = new AjaxRequest(); 88 ajaxReq.setUrl("/commonApi/users/loginSession"); 89 ajaxReq.setType("get"); 90 ajaxReq.setHeaders({ 91 loginToken : $.cookie("loginToken") 92 }); 93 ajaxReq.setSuccess(function(data, status){ 94 app.loginSession.userId = data.extra.user_id; 95 app.loginSession.name = data.extra.name; 96 app.loginSession.loginId = data.extra.login_id; 97 app.loginSession.remoteIp = data.extra.remote_ip; 98 app.loginSession.createdAt = data.extra.created_at; 99 }); 100 ajaxReq.setError(function(request, status, err){ 101 notify("Failed to load common data."); 102 }); 103 return ajaxReq.request(); 104}; 105 106/* 107 * ë¡ê·¸ì¸ ì²ë¦¬ 108 */ 109app.loginProcess = function(loginId, passwd, options, successCallback, failCallback) { 110 if (typeof(options.autoLogin) == "undefined") options.autoLogin = false; 111 112 var ajaxReq = new AjaxRequest(); 113 ajaxReq.setUrl("/commonApi/users/login"); 114 ajaxReq.setType("post"); 115 ajaxReq.setDataType("json"); 116 ajaxReq.setData({ 117 loginId : loginId, 118 passwd : passwd, 119 autoLogin : (options.autoLogin == true) ? "Y" : "N" 120 }); 121 ajaxReq.setSuccess(function(data, status){ 122 if (data.returnCode == _RESP_CODE.OK.code) { 123 var loginToken = data.extra.loginToken; 124 125 // loginTokenì ì¿ í¤ì ì ì¥ 126 if (options.autoLogin == true) 127 $.cookie("loginToken", loginToken, { expires: (_CFG.autoLoginTokenExpirePeriod / 86400), path: '/' }); 128 else 129 $.cookie("loginToken", loginToken, { path: '/' }); 130 131 // success callback 132 if (typeof(successCallback) === "function") successCallback(data); 133 } else { 134 // fail callback 135 if (typeof(failCallback) === "function") failCallback(data); 136 } 137 }); 138 ajaxReq.setError(function(request, status, err){ 139 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 140 141 // callback 142 if (typeof(failCallback) === "function") failCallback(data); 143 }); 144 ajaxReq.request(); 145}; 146 147/* 148 * ìì ë¡ê·¸ì¸ ì²ë¦¬ 149 */ 150app.socialLoginProcess = function(userId, successCallback, failCallback) { 151 var ajaxReq = new AjaxRequest(); 152 ajaxReq.setUrl("/commonApi/users/socialLogin"); 153 ajaxReq.setType("post"); 154 ajaxReq.setDataType("json"); 155 ajaxReq.setData({ 156 userId : userId 157 }); 158 ajaxReq.setSuccess(function(data, status){ 159 if (data.returnCode == _RESP_CODE.OK.code) { 160 var loginToken = data.extra.loginToken; 161 162 // loginTokenì ì¿ í¤ì ì ì¥ 163 $.cookie("loginToken", loginToken, { expires: 1, path: '/' }); 164 165 // success callback 166 if (typeof(successCallback) === "function") successCallback(data); 167 } else { 168 // fail callback 169 if (typeof(failCallback) === "function") failCallback(data); 170 } 171 }); 172 ajaxReq.setError(function(request, status, err){ 173 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 174 175 // callback 176 if (typeof(failCallback) === "function") failCallback(data); 177 }); 178 ajaxReq.request(); 179}; 180 181/* 182 * ë¡ê·¸ìì ì²ë¦¬ 183 */ 184app.logoutProcess = function(callback) { 185 var ajaxReq = new AjaxRequest(); 186 ajaxReq.setUrl("/commonApi/users/logout"); 187 ajaxReq.setType("get"); 188 ajaxReq.setDataType("json"); 189 ajaxReq.setHeaders({ 190 loginToken : $.cookie("loginToken") 191 }); 192 ajaxReq.setSuccess(function(data, status){ 193 if (data.returnCode == _RESP_CODE.OK.code) { 194 // ë¡ê·¸ì¸í í° ì ë³´ ìì 195 $.removeCookie("loginToken", { path: '/' }); 196 197 // success callback 198 if (typeof(callback) === "function") callback(data); 199 } else { 200 notify(data.returnMsg); 201 } 202 }); 203 ajaxReq.setError(function(request, status, err){ 204 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 205 }); 206 ajaxReq.request(); 207}; 208 209/* 210 * í´ëí° ì¸ì¦ë²í¸ ë°ê¸ 211 */ 212app.createCertificatedNumber = function(mphone, callback) { 213 var ajaxReq = new AjaxRequest(); 214 ajaxReq.setUrl("/commonApi/users/certificatedNumber"); 215 ajaxReq.setType("post"); 216 ajaxReq.setDataType("json"); 217 ajaxReq.setData({ 218 mphone : mphone 219 }); 220 ajaxReq.setSuccess(function(data, status){ 221 if (data.returnCode == _RESP_CODE.OK.code) { 222 // success callback 223 if (typeof(callback) === "function") 224 callback(data.extra.mphone, data.extra.hashKey); 225 } else { 226 notify(data.returnMsg); 227 } 228 }); 229 ajaxReq.setError(function(request, status, err){ 230 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 231 }); 232 ajaxReq.request(); 233}; 234 235/* 236 * ë©ìì§ ë°ì´í°ìì ì¹íí´ì¼ í 문ìì´ì ì¹ííë¤. 237 * message : ë©ìì§ ì본 í ì¤í¸ 238 * tags[] : ì¹íí íê·¸ 239 * replacements[] : ì¹íí ê° 240 */ 241app.replaceMessageText = function(messageText, tags, replacements) { 242 var returnMessageText = messageText; 243 244 for(var i=0; i<tags.length; i++) 245 { 246 returnMessageText = returnMessageText.replace(tags[i], replacements[i]); 247 } 248 249 return returnMessageText; 250}; 251 252/* 253 * í í릿 htmlìì ì¹íí´ì¼ í 문ìì´ì ì¹ííë¤. 254 * template : ë©ìì§ ì본 í ì¤í¸ 255 * tags[] : ì¹íí íê·¸ 256 * replacements[] : ì¹íí ê° 257 */ 258app.replaceTemplate = function(templateId, tags, replacements) { 259 var returnTemplate = $("#"+templateId).html(); 260 261 for(var i=0; i<tags.length; i++) 262 { 263 returnTemplate = replaceAll(returnTemplate, tags[i], replacements[i]); 264 } 265 266 return returnTemplate; 267}; 268 269/* 270 * htmlìì¤ìì ì¹íí´ì¼ í 문ìì´ì ì¹ííë¤. 271 * html : ë©ìì§ ì본 í ì¤í¸ 272 * tags[] : ì¹íí íê·¸ 273 * replacements[] : ì¹íí ê° 274 */ 275app.replaceHtml = function(html, tags, replacements) { 276 var returnHtml = html; 277 278 for(var i=0; i<tags.length; i++) 279 { 280 returnHtml = replaceAll(returnHtml, tags[i], replacements[i]); 281 } 282 283 return returnHtml; 284}; 285 286/*
287 * ìëµì½ëë¡ ìëµë°ì´í°ë¥¼ 리í´íë¤. 288 */ 289app.responseByCode = function(code) { 290 var response = false; 291 292 $.each(_RESP_CODE, function(index, item) { 293 if (item.code === code) response = item; 294 }); 295 296 return response; 297}; 298 299/* 300 * íì¼ì ë¡ë ì»´í¬ëí¸ ì´ê¸°í í¨ì 301 * options 302 * - maxFiles : ìµë 303 */ 304app.initFileUploadComponent = function(selector, session, options, callback) { 305 // ì´ê¸°íí DOMì´ ìì¼ë©´ ìë¬ 306 if ($(selector).length == 0) 307 { 308 console.error("íì¼ì ë¡ë ì´ê¸°í ì¤ë¥ : ì´ê¸°íí ê°ì²´ë¥¼ ì°¾ì ì ììµëë¤ ["+selector+"]"); 309 return; 310 } 311 312 // optional ì ë³´ ê¸°ë³¸ê° 313 if (typeof(options) === "undefined") { 314 var options = {}; 315 } 316 317 if (typeof(options.maxFiles) === "undefined") options.maxFiles = _CFG.uploadFiles.countMax; 318 if (typeof(options.maxFilesize) === "undefined") options.maxFilesize = _CFG.uploadFiles.uploadSizeLimit / 1024 / 1024; 319 320 if (typeof(groupId) === "undefined") groupId = ""; 321 if (typeof(options) === "undefined") options = {}; 322 if (typeof(session) === "undefined") { 323 console.error("íì¼ì ë¡ë ì´ê¸°í ì¤ë¥ : form sessionê°ì´ ëë½ëììµëë¤."); 324 return; 325 } 326 327 // default settings 328 var dropzoneDefaultOptions = { 329 url: '/commonApi/files/uploadDropzone', 330 autoProcessQueue: true, 331 //parallelUploads: 2, 332 maxFiles: options.maxFiles, 333 maxFilesize: options.maxFilesize, 334 //acceptedFiles: '*/*', 335 addRemoveLinks: true, 336 uploadMultiple : false, // request í ë²ì íì¼ ì¬ë¬ê°ì© ì ë¡ë í ì§ ì¬ë¶ 337 success : function (file, response) { 338 var response = jQuery.parseJSON(response); 339 var result = response.extra.result; 340 341 if (result.code == _RESP_CODE.OK.code) { 342 file.previewElement.appendChild(Dropzone.createElement("<input type='hidden' name='id' value='" + result.id + "'/>")); 343 } else { 344 file.previewElement.remove(); 345 346 var r = responseByCode(result.code); 347 notify(r.message); 348 } 349 }, 350 error : function(file, errorMessage) { 351 notify(errorMessage); 352 setTimeout(function(){ 353 file.previewElement.remove(); 354 }, 500); 355 }, 356 params : function () { 357 return { 358 session : session, 359 useThumbnail : (_CFG.uploadFiles.useThumbnail == true) ? "Y" : "N", 360 thumbnailWidth : _CFG.uploadFiles.thumbnailSize[0], 361 thumbnailHeight : _CFG.uploadFiles.thumbnailSize[1], 362 useImageResize : (_CFG.uploadFiles.useImageResize == true) ? "Y" : "N", 363 maxImageResizeLength : _CFG.uploadFiles.maxImageResizeLength 364 } 365 }, 366 removedfile : function(file) { 367 368 // ì ë¡ë ìë¬ì¸ íì¼ì´ë©´ ê·¸ë¥ ìì í¨ 369 if (file.status === "error") 370 { 371 file.previewElement.remove(); 372 } 373 else 374 { 375 // ì ìì ì¸ íì¼ì´ë©´ ìë²ì ìì ìì² 376 var id = file.previewElement.querySelector("input[name=id]").value; 377 378 var ajaxReq = new AjaxRequest(); 379 ajaxReq.setUrl("/commonApi/files/deleteDropzone"); 380 ajaxReq.setType("post"); 381 ajaxReq.setDataType("json"); 382 ajaxReq.setData({ 383 id : id, 384 session : session 385 }); 386 ajaxReq.setSuccess(function(data, status){ 387 if (data.returnCode == _RESP_CODE.OK.code) { 388 file.previewElement.remove(); 389 notify("ìì ëììµëë¤."); 390 } else { 391 notify(data.returnMsg); 392 } 393 }); 394 ajaxReq.setError(function(request, status, err){ 395 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 396 }); 397 ajaxReq.request(); 398 } 399 } 400 }; 401 402 // ì ë¡ë ì»´í¬ëí¸ ì´ê¸°í 403 var dropzoneInstance = new Dropzone(selector, dropzoneDefaultOptions); 404 405 // ì½ë°± í¨ì í¸ì¶ 406 if (typeof(callback) === "function") callback(); 407 408 return dropzoneInstance; 409}; 410 411 /* 412 * ì¹ìëí° ì´ê¸°í í¨ì 413 * selector : string 414 */ 415app.initEditor = function(editorName, selector, formSession, options) { 416 417 // ìµì 418 if (typeof(options) == "undefined") options = {}; 419 if (typeof(options.toolbarType) == "undefined") options.toolbarType = "full"; 420 if (typeof(options.height) == "undefined") options.height = 400; 421 if (typeof(options.maxHeight) == "undefined") options.maxHeight = 400; 422 423 // í´ë° íì ì ì 424 var toolbarDef = {}; 425 if (options.toolbarType == "full") 426 { 427 toolbarDef = { 428 toolbarButtons : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', '|', 'alignLeft', 'alignCenter', 'alignRight', 'outdent', 'indent', 'insertHR', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable', 'undo', 'redo', 'selectAll', 'html'], 429 toolbarButtonsMD : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', '|', 'align', 'outdent', 'indent', 'insertHR', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable', 'undo', 'redo', 'selectAll', 'html'], 430 toolbarButtonsSM : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', '|', 'align', 'outdent', 'indent', 'insertHR', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable', 'undo', 'redo', 'selectAll', 'html'], 431 toolbarButtonsXS : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', 'align', 'outdent', 'indent', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable'] 432 } 433 } 434 if (options.toolbarType == "small") 435 { 436 toolbarDef = { 437 toolbarButtons : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', 'align', 'outdent', 'indent', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable'], 438 toolbarButtonsMD : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', 'align', 'outdent', 'indent', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable'], 439 toolbarButtonsSM : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', 'align', 'outdent', 'indent', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable'], 440 toolbarButtonsXS : ['bold', 'fontFamily', 'fontSize', 'italic', 'underline', 'textColor', 'strikeThrough', 'emoticons', 'align', 'outdent', 'indent', 'insertLink', 'customImageUpload', 'insertVideo', 'insertTable'], 441 } 442 } 443 444 // 커ì¤í ì´ë¯¸ì§ ì ë¡ë ë²í¼ ì¶ê° 445 FroalaEditor.DefineIcon('customImageUpload', { NAME: 'customImageUpload'}); 446 FroalaEditor.RegisterCommand('customImageUpload', { 447 // Button title. 448 title: 'ì´ë¯¸ì§ ì½ì ', 449 450 icon: "<i class='xi-image-o' style='font-size:20px;'></i>", 451 452 // Save the button action into undo stack. 453 undo: true, 454 455 // Focus inside the editor before the callback. 456 focus: true, 457 458 // Show the button on mobile or not. 459 showOnMobile: true, 460 461 // Refresh the buttons state after the callback. 462 refreshAfterCallback: true, 463 464 // ë²í¼í´ë¦ì í¸ì¶ ì½ë°±í¨ì ì ì 465 callback: function () { 466 window.open("/commonApi/files/customEditorImageUploader?editorName="+editorName+"&formSession="+formSession, "editorImageUploader", "width=800, height=400, scrolbars=Y"); 467 }, 468 469 // Called when the button state might have changed. 470 refresh: function ($btn) { 471 // The current context is the editor instance.
472 console.log (this.selection.element()); 473 } 474 }); 475 476 var editor = new FroalaEditor(selector, { 477 key : _CFG.froalaLicenseKey, 478 attribution: false, 479 language : 'ko', 480 imageDefaultDisplay : 'inline', 481 height : options.height, 482 heightMax : options.maxHeight, 483 imageAddNewLine : true, 484 imageSplitHTML : true, 485 imageAllowedTypes : ['jpeg', 'jpg', 'png', 'gif'], 486 imageDefaultWidth : 0, 487 fontFamily : { 488 "ë§ì ê³ ë": 'ë§ì ê³ ë', 489 "굴림": '굴림' 490 }, 491 toolbarSticky: false, 492 quickInsertEnabled: false, 493 imagePasteProcess: true, 494 pasteAllowLocalImages: true, 495 pastePlain: false, 496 imageEditButtons : ['imageAlign', 'imageRemove', 'imageLink', 'imageSize'], // imageReplace 497 toolbarButtons : toolbarDef.toolbarButtons, 498 toolbarButtonsMD : toolbarDef.toolbarButtonsMD, 499 toolbarButtonsSM : toolbarDef.toolbarButtonsSD, 500 toolbarButtonsXS : toolbarDef.toolbarButtonsXD, 501 502 /* 503 * image upload options 504 */ 505 // Set the image upload parameter. 506 imageUploadParam: 'file', 507 508 // Set the image upload URL. 509 imageUploadURL: '/commonApi/files/uploadEditorImage', 510 511 // Additional upload params. 512 imageUploadParams: {}, 513 514 // Set request type. 515 imageUploadMethod: 'POST', 516 517 // Set max image size to 5MB. 518 imageMaxSize: 5 * 1024 * 1024, 519 520 // Allow to upload PNG and JPG. 521 imageAllowedTypes: ['jpeg', 'jpg', 'png'], 522 523 /* 524 * video upload options 525 */ 526 videoUploadParam: 'file', 527 videoUploadURL: '/commonApi/files/uploadEditorImage', 528 videoUploadMethod: 'POST', 529 videoMaxSize: 1024 * 1024 * 50, 530 videoAllowedTypes: ['mp4'], 531 532 events: { 533 'image.beforeUpload': function (images) { 534 535 }, 536 'image.uploaded': function (response) { 537 538 }, 539 'image.inserted': function ($img, response) { 540 $img.css("width", "auto"); 541 $img.css("max-width", "100%"); 542 }, 543 'image.replaced': function ($img, response) { 544 545 }, 546 'image.error': function (error, response) { 547 notify("ì´ë¯¸ì§ ì ë¡ë ì¤ë¥ì ëë¤."); 548 }, 549 'video.inserted': function ($video) { 550 $video.find("video").css("width", "100%"); 551 $video.find("video").css("max-width", "870px"); 552 } 553 } 554 }); 555 556 return editor; 557}; 558 559/* 560 * 커ì¤í ì´ë¯¸ì§ ì ë¡ëë¡ ìëí°ì ì´ë¯¸ì§ë¥¼ ì½ì íìë ì½ë°± í¨ì 561 */ 562app.onInsertEditorImage = function(editorName, imageUrls) { 563 /* 564 * ì´ë¯¸ì§ë¥¼ ê°ë³ì ì¼ë¡ íëì© ì½ì íë©´ ì½ì ììê° ì ë§ì¼ë¯ë¡ image.insert ë©ìë를 ì¬ì©íì§ ìê³ 565 * htmlì ì§ì ë§ë¤ì´ ì¬ë¬ê°ì ì´ë¯¸ì§ë¥¼ í ë²ì ì½ì íë¤. 566 */ 567 var html = []; 568 $.each(imageUrls, function(index, imageUrl){ 569 html.push("<p style='text-align:center;'><img src='"+imageUrl+"' class='fr-fic fr-dii'></p>"); 570 }); 571 572 editors[editorName].html.insert(html.join(""), true); 573} 574 575/* 576 * 첨ë¶íì¼ ëª©ë¡ì ì½ì´ì íë©´ì ì¶ë ¥ 577 */ 578app.loadFileList = function (selector, groupId) { 579 var ajaxReq = new AjaxRequest(); 580 ajaxReq.setUrl("/commonApi/files/groupList"); 581 ajaxReq.setType("get"); 582 ajaxReq.setData({ 583 groupId : groupId 584 }); 585 ajaxReq.setSuccess(function(data, status){ 586 if (data.returnCode == _RESP_CODE.OK.code) { 587 var template = ""; 588 589 if (data.extra.files.length > 0) { 590 $.each(data.extra.files, function(index, item) { 591 // ì본 ì´ë¯¸ì§ ê²½ë¡ 592 var originalImageSrc = ""; 593 if (item.imageSrc !== "") originalImageSrc = item.imageSrc; 594 595 // ì¸ë¤ì¼ ì´ë¯¸ì§ ê²½ë¡ 596 var src = ""; 597 if (item.thumbnailSrc !== "") src = item.thumbnailSrc; 598 else if (item.imageSrc !== "") src = item.imageSrc; 599 600 // ì¬ì©ì¬ë¶ ì²´í¬ 601 var checked = ""; 602 if (item.usable === "Y") checked = "checked"; 603 604 // íê·¸ ì¹í 605 template += app.replaceTemplate("uploadListCellTemplate", [ 606 "{#id}", "{#seq}", "{#src}", "{#filename}", "{#filesize}", "{#primary}", "{#checked}" 607 ], [ 608 item.id, item.seq, src, item.filename_origin, item.filesize, item.is_primary, checked 609 ]); 610 }); 611 612 // íì¼ëª©ë¡ ì½ì 613 selector.html(template); 614 } else { 615 // íì¼ìì ë©ìì§ ì½ì 616 template = "<p class='noFilesComment'>"+_MESSAGES.COMM["ì ë¡ëëíì¼ì´ììµëë¤"]+"</p>"; 617 selector.html(template); 618 } 619 } else { 620 notify(data.returnMsg); 621 } 622 }); 623 ajaxReq.setError(function(request, status, err){ 624 notify(_MESSAGES.COMM["ìììëì¤ë¥ê°ë°ìíììµëë¤"]); 625 }); 626 ajaxReq.request(); 627}; 628 629/* 630 * ê°ì²´ì ìì를 ë³ê²½í ë 631 */ 632app.changeDOMSeqAjax = function (listObj, requestUrl, callback) { 633 var uidArray = []; 634 635 listObj.find(".seqControlCell").each(function () { 636 var uid = $(this).attr("data-seq-uid");
637 uidArray.push(uid); 638 }); 639 640 var ajaxReq = new AjaxRequest(); 641 ajaxReq.setUrl(requestUrl); 642 ajaxReq.setType("get"); 643 ajaxReq.setData({ 644 seqTokens : uidArray.join(",") 645 }); 646 ajaxReq.setSuccess(function(data, status){ 647 if (typeof(callback) == "function") 648 callback(data); 649 }); 650 ajaxReq.setError(function(request, status, err){ 651 notify("ìì를 ë³ê²½í ì ììµëë¤. ì ìíì ë¤ì ìëí´ì£¼ì¸ì."); 652 }); 653 ajaxReq.request(); 654} 655 656/* 657 * íì ì°½ ë«ê¸° 658 */ 659app.closePopup = function(popupId, noToday) { 660 $("#popup_"+popupId).remove(); 661 662 // íì ì´ ì¬ë¬ê° ë ¸ì¶ëì´ ìì ê²½ì° ëª¨ë íì ì´ ë«íë©´ ì¤ë²ë ì´ divë ìì íë¤. 663 if ($(".mainLayerPopup").length == 0) 664 { 665 $("#popupContainerOverlay").remove(); 666 } 667 668 // ì¤ë ë ì´ì ë³´ì§ ì기를 í´ë¦íì ê²½ì°ìë ì¿ í¤ë¥¼ ì ì¥íë¤. 669 if (noToday == true) 670 { 671 var ajaxReq = new AjaxRequest(); 672 ajaxReq.setUrl("/web/popup/noToday"); 673 ajaxReq.setType("post"); 674 ajaxReq.setData({ 675 id : popupId 676 }); 677 ajaxReq.setSuccess(function(data, status){ 678 }); 679 ajaxReq.request(); 680 } 681} 682 683/* 684 * íì´ì§ ë¡ë 685 * dimmerOpacity : dimmer ë¶í¬ëª ë (default : 0.6) 686 */ 687app.showPageLoader = function(dimmerOpacity) { 688 var paramDimmerOpacity = (dimmerOpacity == undefined) ? 0.6 : dimmerOpacity; 689 690 var html = "<div class='pageLoader' style='background-color:rgba(0,0,0,"+paramDimmerOpacity+")'>" + 691 "<div><i class='xi-spinner-3 xi-spin'></i></div>" + 692 "</div>"; 693 694 $("body").remove(".pageLoader"); 695 $("body").append(html); 696 697} 698 699app.hidePageLoader = function() { 700 $("body .pageLoader").remove(); 701} 702 703/* 704 * dropzoneì dropzone í´ëì¤ë¥¼ ê°ì§ DOMê°ì²´ë¥¼ ìëì¼ë¡ ì°¾ìì ì´ê¸°í íë¯ë¡ ì´ë¥¼ disabledìí¨ë¤. 705 */ 706Dropzone.autoDiscover = false; 707 708/* 709 * íì´ì§ ì´ê¸°í 710 */ 711$(document).ready(function () { 712 /* 713 * ê³µíµ ë°ì´í° ë¡ë©. 714 * ë¡ë©ì´ ëëë©´ onPageInití¨ì í¸ì¶ 715 */ 716 var promise1 = app.loadCommonData(); 717 var promise2 = app.loadLoginSession(); 718 719 $.when(promise1, promise2).done(function(){ 720 if (typeof(app) != "undefined") 721 { 722 if (typeof(app.onAppInit) === "function") app.onAppInit(); 723 724 if (typeof(app.onPageInit) === "function") app.onPageInit(); 725 } 726 else 727 { 728 console.error("app object is not defined."); 729 } 730 }); 731}); 732
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.