• 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.Mention.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 Suwon Chae * * 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. */ yobi.Mention = function(htOptions) { var htVar = {}; var htElement = {}; /** * Initialize * * @param {Hash Table} htOptions */ function _init(htOptions){ _initVar(htOptions); _initElement(); _attachEvent(); } /** * Initialize Variables * * @param {Hash Table} htOptions */ function _initVar(htOptions) { htVar = htOptions || {}; // set htVar as htOptions htVar.doesNotDataLoaded = true; htVar.nKeyupEventGenerator = null; htVar.sMentionText = null; } /** * Initialize Element variables */ function _initElement() { if (!htVar.target) { if (window.console) { console.error("mention form element targeting doesn't exist!") } return; } htElement.welTarget = $(htVar.target); } /** * attachEvent */ function _attachEvent() { htElement.welTarget.on("keypress", _onKeyInput); if (jQuery.browser.mozilla){ htElement.welTarget.on("focus", _startKeyupEventGenerator); htElement.welTarget.on("blur", _stopKeyupEventGenerator); } } /** * Event handler on KeyInput event * * @param {Event} eEvt */ function _onKeyInput(eEvt){ eEvt = eEvt || window.event; var charCode = eEvt.which || eEvt.keyCode; if(charCode === 64 || charCode === 35 || charCode === 58) { // 64 = @, 35 = #, 58 = : if(htVar.doesNotDataLoaded) { _findMentionList(); } } } function _startKeyupEventGenerator(){ if (htVar.nKeyupEventGenerator){ clearInterval(htVar.nKeyupEventGenerator); } htVar.nKeyupEventGenerator = setInterval( function(){ if (htVar.sMentionText != htElement.welTarget.val()){ htElement.welTarget.trigger("keyup"); htVar.sMentionText = htElement.welTarget.val(); } } ,100); } function _stopKeyupEventGenerator(){ if (htVar.nKeyupEventGenerator){ clearInterval(htVar.nKeyupEventGenerator); htVar.nKeyupEventGenerator = null; } } /** * Find Userlist */ function _findMentionList(){ _onLoadUserList(); } function _onLoadUserList(){ htVar.doesNotDataLoaded = false; var searchPending; var emojis = [ { name: "+1", content: "👍" }, { name: "heart", content: "â¤ī¸ī¸" }, { name: "wink", content: "😘" }, { name: "smile", content: "🙂" }, { name: "confused", content: "😕" }, { name: "check", content: "✅" }, { name: "hooray", content: "🎉" }, { name: "sad", content: "đŸ˜ĸ" }, { name: "-1", content: "👎" }, { name: "tada", content: "🎉" }, { name: "x", content: "❌" }, { name: "o", content: "⭕" }, { name: "face smile", content: "😄" }, { name: "face smile kiss", content: "😙" }, { name: "face kissing", content: "😗" }, { name: "face astonished", content: "😲" }, { name: "face angry", content: "😠" }, { name: "face scream", content: "😱" }, { name: "face cry", content: "đŸ˜ĸ" }, { name: "face neutral", content: "😐" }, { name: "face heart", content: "😍" }, { name: "question?", content: "❓" }, { name: "!", content: "â—ī¸" }, { name: "bangbang!", content: "â€ŧī¸" }, { name: "beer", content: "đŸē" }, { name: "icecream", content: "đŸĻ" }, { name: "korea", content: "🇰🇷" }, { name: "us america", content: "đŸ‡ē🇸" }, { name: "fr", content: "đŸ‡Ģ🇷" }, { name: "cn china", content: "đŸ‡¨đŸ‡ŗ" }, { name: "+100", content: "đŸ’¯" }, { name: "heavy check", content: "âœ”ī¸"}, { name: "+plus", content: "➕"}, { name: "-minus", content: "âž–ī¸"}, { name: "cactus", content: "đŸŒĩī¸"}, { name: "animal cat", content: "🐈"}, { name: "clover", content: "🍀"}, { name: "vī¸", content: "âœŒī¸"}, { name: "lock", content: "🔒"}, { name: "unlock", content: "🔓"}, { name: "idea bulb", content: "💡"}, { name: "bomb", content: "đŸ’Ŗ"}, { name: "calendar", content: "📆"}, { name: "date", content: "📅"}, { name: "chicken", content: "🐔"}, { name: "mushroom", content: "🍄"}, { name: "moneybag", content: "💰"}, { name: "money dollar", content: "đŸ’ĩ"}, { name: "envelope", content: "âœ‰ī¸"}, { name: "chart upward", content: "📈"}, { name: "chart downward", content: "📉"}, { name: "택배 parcel", content: "đŸ“Ļ"}, { name: "ë°•ėˆ˜ clap", content: "👏"}, { name: "game joker", content: "🃏"}, { name: "game cards", content: "🎴"}, { name: "game die", content: "🎲"}, { name: "tea", content: "đŸĩ"}, { name: "coffee", content: "☕"}, { name: "crystal", content: "🔮"}, { name: "taxi", content: "🚕"}, { name: "bus", content: "🚌"}, { name: "train", content: "🚋"}, { name: "warn", content: "âš ī¸"}, { name: "star", content: "⭐"}, { name: "phone", content: "â˜Žī¸"}, ]; htElement.welTarget .atwho({ at: "@", limit: 10, displayTpl: "<li data-value='@${loginid}'><img style='width:20px;height:20px;' src='${image}'> ${name} <small>${loginid}</small></li>", suspendOnComposing: false, searchKey: "searchText", insertTpl: "@${loginid}", callbacks: { remoteFilter: function(query, callback) { NProgress.start(); clearTimeout(searchPending); searchPending = setTimeout(function () { $.getJSON(htVar.url, { query: query, mentionType: "user" }, function (data) { NProgress.done(); callback(data.result) }); }, 300); } } }) .atwho({ at: ":", limit: 10, displayTpl: "<li>${content} <small>${name}</small></li>", insertTpl: "${content}", data: emojis }) .atwho({ at: "#", limit: 10, displayTpl: "<li data-value='#${issueNo}'><small>#${issueNo}</small> ${title}</li>", suspendOnComposing: false, insertTpl: "#${issueNo}", callbacks: { remoteFilter: function(query, callback) { NProgress.start(); $.getJSON(htVar.url, {query: query, mentionType: "issue"}, function(data) { NProgress.done(); callback(data.result) }); }, sorter: function(query, items, searchKey) { var item, i, len, results; if (!query) { return items; } results = []; for (i = 0, len = items.length; i < len; i++) { item = items[i]; if (item.issueNo === query) { item.atwhoOrder = 0; } else { var issueNoIndexOf = item.issueNo.toLowerCase().indexOf(query.toLowerCase()); item.atwhoOrder = i + 1 + Math.pow(10, issueNoIndexOf) + ((issueNoIndexOf > -1) ? 0 : Math.pow(100, item.title.toLowerCase().indexOf(query.toLowerCase()))); } results.push(item); } return results.sort(function(a, b) { return a.atwhoOrder - b.atwhoOrder; }); } } }) .atwho("run"); } _init(htOptions || {}); };

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

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