• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account Log out
  • Favorite
  • Project
  • Recent History
Loading...
  • Log in
  • Sign up
kadrians / Testing_for_YONA star
  • Project homeH
  • CodeC
  • IssueI 1
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB 2
  • Files
  • Commit
  • Branches
Testing_for_YONAsourcepublicjavascriptscommonyobi.ui.Dialog.js
Download as .zip file
File name
Commit message
Commit date
bin
Yona 1.16.0 Upload
02-04
lib
Yona 1.16.0 Upload
02-04
share/doc/api
Yona 1.16.0 Upload
02-04
source
Source Code Upload
02-04
README.md
Yona 1.16.0 Upload
02-04
File name
Commit message
Commit date
app
Source Code Upload
02-04
conf
Source Code Upload
02-04
docs
Source Code Upload
02-04
lib
Source Code Upload
02-04
project
Source Code Upload
02-04
public
Source Code Upload
02-04
support-script
Source Code Upload
02-04
test
Source Code Upload
02-04
.gitignore
Source Code Upload
02-04
.mailmap
Source Code Upload
02-04
.travis.yml
Source Code Upload
02-04
AUTHORS
Source Code Upload
02-04
LICENSE
Source Code Upload
02-04
NOTICE
Source Code Upload
02-04
README.md
Source Code Upload
02-04
build.sbt
Source Code Upload
02-04
dev.sh
Source Code Upload
02-04
dist.sh
Source Code Upload
02-04
is-alive-bot.sh
Source Code Upload
02-04
minify-js.sh
Source Code Upload
02-04
restart.sh
Source Code Upload
02-04
File name
Commit message
Commit date
bootstrap
Source Code Upload
02-04
help
Source Code Upload
02-04
images
Source Code Upload
02-04
javascripts
Source Code Upload
02-04
stylesheets
Source Code Upload
02-04
compiler.jar
Source Code Upload
02-04
File name
Commit message
Commit date
common
Source Code Upload
02-04
lib
Source Code Upload
02-04
service
Source Code Upload
02-04
template
Source Code Upload
02-04
yona-common.js
Source Code Upload
02-04
yona-layout.js
Source Code Upload
02-04
yona-lib.js
Source Code Upload
02-04
File name
Commit message
Commit date
yobi.Attachments.js
Source Code Upload
02-04
yobi.CodeCommentBlock.js
Source Code Upload
02-04
yobi.CodeCommentBox.js
Source Code Upload
02-04
yobi.Comment.js
Source Code Upload
02-04
yobi.CommentForm.js
Source Code Upload
02-04
yobi.Common.js
Source Code Upload
02-04
yobi.Files.js
Source Code Upload
02-04
yobi.Interval.js
Source Code Upload
02-04
yobi.LoginDialog.js
Source Code Upload
02-04
yobi.Markdown.js
Source Code Upload
02-04
yobi.Mention.js
Source Code Upload
02-04
yobi.OriginalMessage.js
Source Code Upload
02-04
yobi.Pagination.js
Source Code Upload
02-04
yobi.ShortcutKey.js
Source Code Upload
02-04
yobi.WatcherList.js
Source Code Upload
02-04
yobi.ui.Calendar.js
Source Code Upload
02-04
yobi.ui.Dialog.js
Source Code Upload
02-04
yobi.ui.Dropdown.js
Source Code Upload
02-04
yobi.ui.Mergely.js
Source Code Upload
02-04
yobi.ui.Select2.js
Source Code Upload
02-04
yobi.ui.Tabs.js
Source Code Upload
02-04
yobi.ui.Toast.js
Source Code Upload
02-04
yobi.ui.Typeahead.js
Source Code Upload
02-04
yona.CommentAttachmentsUpdate.js
Source Code Upload
02-04
yona.KeyControl.js
Source Code Upload
02-04
yona.ReceiverList.js
Source Code Upload
02-04
yona.Sha1.js
Source Code Upload
02-04
yona.SubComment.js
Source Code Upload
02-04
yona.Subtask.js
Source Code Upload
02-04
yona.Tasklist.js
Source Code Upload
02-04
yona.TitleHeadAutoCompletion.js
Source Code Upload
02-04
yona.Usermenu.js
Source Code Upload
02-04
Nell 02-04 2600fe6 Source Code Upload UNIX
Raw Open in browser Change history
/** * Yobi, Project Hosting SW * * Copyright 2013 NAVER Corp. * http://yobi.io * * @author Jihan Kim * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @example * var oDialog = new yobi.ui.Dialog("#yobiDialog") * oDialog.show("메시지"); * * @require bootstrap-modal.js */ (function(ns){ var oNS = $yobi.createNamespace(ns); oNS.container[oNS.name] = function(sContainer, htOptions){ var htVar = {}; var htElement = {}; /** * @param {String} sContainer * @param {Hash Table} htOptions */ function _init(sContainer, htOptions){ _initVar(htOptions); _initElement(sContainer); _attachEvent(); } /** * @param htOptions * @private */ function _initVar(htOptions){ htVar.sDefaultButton = '<button type="button" class="ybtn ybtn-info" data-dismiss="modal">' + Messages("button.confirm") + '</button>'; htVar.sTplCustomButton = '<button type="button" class="ybtn ${class}">${text}</button>'; htVar.bAutoFocusOnLastButton = (typeof htOptions.bAutoFocusOnLastButton !== "undefined") ? htOptions.bAutoFocusOnLastButton : true; } /** * @param {String} sContainer */ function _initElement(sContainer){ htElement.welContainer = $(sContainer).clone(); htElement.welMessage = htElement.welContainer.find(".msg"); htElement.welDescription = htElement.welContainer.find(".desc"); htElement.welButtons = htElement.welContainer.find(".buttons"); htElement.welContainer.modal({ "show": false }); } function _attachEvent(){ htElement.welContainer.on("shown", _onShownDialog); htElement.welContainer.on("hidden", _onHiddenDialog); htElement.welContainer.on("click", "button.ybtn", _onClickButton); } /** * @param {String} sMessage */ function showDialog(sMessage, sDescription, htOptions){ htVar.fOnAfterShow = htOptions.fOnAfterShow; htVar.fOnAfterHide = htOptions.fOnAfterHide; htVar.fOnClickButton = htOptions.fOnClickButton; // 커스텀 버튼 옵션이 있으면 버튼을 생성하고, 아니면 기본 버튼만 제공한다 var sButtonHTML = htOptions.aButtonLabels ? _getCustomButtons(htOptions) : htVar.sDefaultButton; htElement.welButtons.html(sButtonHTML); htElement.welMessage.html($yobi.nl2br(sMessage)); htElement.welDescription.html($yobi.nl2br(sDescription || "")); htElement.welContainer.modal("show"); } /** * @param htOptions * @returns {string} * @private */ function _getCustomButtons(htOptions){ var aButtonsHTML = []; var aButtonLabels = htOptions.aButtonLabels; var aButtonStyles = htOptions.aButtonStyles || []; for(var i = 0, nLength = aButtonLabels.length; i < nLength; i++){ aButtonsHTML.push($yobi.tmpl(htVar.sTplCustomButton, { "text" : aButtonLabels[i], "class": aButtonStyles[i] || (aButtonStyles.length === 0 && i === nLength-1 ? "ybtn-primary" : "ybtn-default") })); } return aButtonsHTML.join(""); } /** * @param weEvt * @private */ function _onClickButton(weEvt){ if(typeof htVar.fOnClickButton === "function"){ var bResult = htVar.fOnClickButton({ "weEvt" : weEvt, "nButtonIndex": $(this).index() }); // fOnClickButton 이 false 를 반환하는 경우 if(bResult === false){ return false; } } hideDialog(); } function hideDialog(){ htElement.welContainer.modal("hide"); } function _onShownDialog(){ if(typeof htVar.fOnAfterShow == "function"){ htVar.fOnAfterShow(); } if(htVar.bAutoFocusOnLastButton){ htElement.welButtons.find(".ybtn-primary:last,button:last").focus(); } } function _onHiddenDialog(){ htElement.welMessage.html(""); if(typeof htVar.fOnAfterHide == "function"){ htVar.fOnAfterHide(); } } _init(sContainer, htOptions || {}); return { "show": showDialog, "hide": hideDialog }; }; })("yobi.ui.Dialog");

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
login with Google Sign in with Google
Reset password | Sign up