• 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_YONAsourcepublicjavascriptscommonyona.Usermenu.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
$(function () { /* Set side navigation */ // Also, see index.scala.html for home page menu sliding actions !! var $sidebar = $("#mySidenav"); var viewSize = window.parent === window ? $(window).width() : $(window.parent).width(); var PIXEL_CRITERIA_FOR_SMALL_DEVICE = 720; // Criteria to distinguish small devices var SIDE_BAR_DEFAULT_WIDTH = "360px"; if ($(".gnb-usermenu-dropdown").length !== 0) { $.get(UsermenuUrl) .done(function (data) { $("#usermenu-tab-content-list").html(data); iniNaviUserMenu(); afterUsermenuLoaded(); }) .fail(function (data) { console.log("Usermenu loading failed: " + data); }); } afterUsermenuLoaded(); function iniNaviUserMenu() { $(document).on("keypress.openFavorite", function openFavoriteMenuWithShortcutKey(event) { if (isShortcutKeyPressed(event)) { event.preventDefault(); openSidebar($sidebar); updateStar(); } }); $("#main").on("click.main", function (event) { if ($sidebar.width() !== 0 && $(event.target).parents("#mySidenav").length == 0) { closeSidebar($sidebar); } }); $("#sidebar-open-btn").on("click.usermenu", function (event) { event.stopPropagation(); if ($sidebar.width() !== 0) { closeSidebar($sidebar); } else { openSidebar($sidebar); updateStar(); } }); } function afterUsermenuLoaded() { // used for new project list ui $(".right-menu").on("click.tab", ".myProjectList, a[href='#recentlyVisited'], a[href='#createdByMe'], a[href='#watching'], a[href='#joinmember']", function () { updateStar(); setTimeout(function focusToProjectSearchInput() { var $projectSearch = $('.project-search'); var $orgSearch = $('.org-search'); if (viewSize > PIXEL_CRITERIA_FOR_SMALL_DEVICE) { $projectSearch.focus(); } if (!$projectSearch.val()) { $projectSearch.val($orgSearch.val()); } $orgSearch.val(""); }, 200); }); $('.myOrganizationList').on("click.orgList", function focusToOrgSearchInput() { setTimeout(function () { var $projectSearch = $('.project-search'); var $orgSearch = $('.org-search'); if (viewSize > PIXEL_CRITERIA_FOR_SMALL_DEVICE) { $orgSearch.focus(); } $orgSearch.val($projectSearch.val()); $projectSearch.val(""); }, 200); }); // search by keyword $(".search-input") .on("keyup.search", function (event) { var value = $(this).val().toLowerCase().trim(); if (value !== "" || event.which === 8) { // 8: backspace $(".user-li").each(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) !== -1); }); $(".org-li").each(function () { $(this).toggle($(this).text().toLowerCase().indexOf(value) !== -1); }); } }) .on("keydown.moveCursorFromInputform", function (e) { switch (e.keyCode) { case 27: // ESC $('.project-search').blur(); closeSidebar($sidebar); break; default: break; } }); $(".project-list > .star-project, .project-breadcrumb > .user-project-list") .on("click.toggleProjectFavorite", function toggleProjectFavorite(e) { e.stopPropagation(); var that = $(this); $.post(UsermenuToggleFavoriteProjectUrl + that.data("projectId")) .done(function (data) { if (data.favored) { that.find('i').addClass("starred"); } else { that.find('i').removeClass("starred"); } }) .fail(function (data) { $yobi.alert("Update failed: " + JSON.parse(data.responseText).reason); }); }); $(".favorite-issue") .on("click.toggleProjectFavorite", function toggleProjectFavorite(e) { e.stopPropagation(); var that = $(this); $.post(UsermenuToggleFavoriteIssueUrl + that.data("issueId")) .done(function (data) { if (data.favored) { that.find('i').addClass("starred"); } else { that.find('i').removeClass("starred"); } $yobi.notify(Messages(data.message), 3000); }) .fail(function (data) { $yobi.alert("Update failed: " + JSON.parse(data.responseText).reason); }); }); $(".user-ul > .user-li, .project-ul > .user-li") .on("click.project", function (e) { e.preventDefault(); e.stopPropagation(); var location = $(this).data('location'); if (e.metaKey || e.ctrlKey || e.shiftKey) { return window.location = location; } if (window.self.name !== 'mainFrame') { if ($("#mainFrame").length > 0) { window.open(location, 'mainFrame'); } else { window.open(location, '_blank'); } } else { window.open(location, 'mainFrame'); } $(".user-ul > .user-li, .project-ul > .user-li").removeClass("selected"); $(this).addClass("selected"); }); $(".org-list > .star-org") .on("click.org", function toggleOrgFavorite(e) { e.stopPropagation(); var that = $(this); $.post(UsermenuToggleFoveriteOrganizationUrl + that.data("organizationId")) .done(function (data) { if (data.favored) { that.find('i').addClass("starred"); } else { that.find('i').removeClass("starred"); } }) .fail(function (data) { $yobi.alert("Update failed: " + JSON.parse(data.responseText).reason); }); }); $(".all-orgs") .on("click.allOrgs", function () { var $li = $(this).closest("li").find(".hide").toggle("fast"); }); $(".sub-project-counter").each(function (item) { var $this = $(this); var counter = $this.closest(".org-li").find(".project-ul > .user-li").length || ""; $this.text(counter); }); } function isShortcutKeyPressed(event) { return (!event.metaKey && (event.which === 102 || event.which === 12601)) // keycode => 102: f, 12623: ㄹ && $(':focus').length === 0; // avoid already somewhere focused state } function closeSidebar($sidebar) { $sidebar.width("0").css("border", "none"); $(".main-stream").removeClass("span8").addClass("span12"); } function openSidebar($sidebar) { // 720px is a criteria to distinguish small devices if (viewSize > PIXEL_CRITERIA_FOR_SMALL_DEVICE) { $sidebar.width(SIDE_BAR_DEFAULT_WIDTH).css("border", "1px solid #ccc"); $(".search-input").focus(); } else { $sidebar.width("100vw").css("border", "1px solid #ccc"); } $(".main-stream").removeClass("span12").addClass("span8"); } // This method intended to sync sub tab list of projects function updateStar() { $.get(UsermenuGetFoveriteProjectsUrl) .done(function (data) { $(".star-project").each(function () { var $this = $(this); if (data.projectIds.indexOf($this.data("projectId")) !== -1) { $this.find("i").addClass("starred"); } else { $this.find("i").removeClass("starred"); } }); }); } });

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

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