// User\r
var userB64 = null;\r
+var userName = "";\r
+var password = "";\r
var sessionStarted = false;\r
var editComment = 0;\r
var currentfileContent = '';\r
setCookie("logginNitdoc", base64.encode(userName+':'+password+':'+repoName+':'+branchName), 1);\r
$('#loginGit').val("");\r
$('#passwordGit').val("");\r
+ reloadComment();\r
}\r
} \r
else\r
// Show commit button\r
$(this).next().next().next().show();\r
// Add text in edit box\r
- if($(this).next().val() == ""){ $(this).next().val(adapt); }\r
+ if($(this).next().val() == "" || $(this).next().val() != adapt){ $(this).next().val(adapt); }\r
// Resize edit box \r
$(this).next().height($(this).next().prop("scrollHeight"));\r
// Select it\r
preElement = $(this); \r
});\r
\r
+ $("#dropBranches").change(function () { \r
+ $("#dropBranches option:selected").each(function () {\r
+ if(branchName != $(this).text()){\r
+ branchName = $(this).text();\r
+ }\r
+ });\r
+ $.when(updateCookie(userName, password, repoName, branchName)).done(function(){\r
+ reloadComment();\r
+ });\r
+ });\r
});\r
\r
/* Parse current URL and return anchor name */\r
}\r
\r
function displayLogginModal(){\r
- if ($('.popover').is(':hidden')) { $('.popover').show(); }\r
+ if ($('.popover').is(':hidden')) { \r
+ if(sessionStarted){ getListBranches(); }\r
+ $('.popover').show(); \r
+ }\r
else { $('.popover').hide(); } \r
updateDisplaying();\r
}\r
$('#lbrepositoryGit').hide();\r
$('#lbbranchGit').hide(); \r
$('#branchGit').hide();\r
+ $('#listBranches').show();\r
$("#liGitHub").attr("class", "current");\r
$("#imgGitHub").attr("src", "resources/icons/github-icon-w.png");\r
$('#nickName').text(userName); \r
$('#githubAccount').attr("href", "https://github.com/"+userName);\r
$('#logginMessage').css({'display' : 'block'});\r
$('#logginMessage').css({'text-align' : 'center'});\r
- $('.popover').css({'height' : '80px'}); \r
+ $('.popover').css({'height' : '120px'});\r
$('#signIn').text("Sign out"); \r
sessionStarted = true;\r
reloadComment();\r
$('#lbrepositoryGit').show();\r
$('#lbbranchGit').show(); \r
$('#branchGit').show(); \r
+ $('#listBranches').hide();\r
}\r
}\r
\r
document.cookie = c_name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';\r
}\r
\r
+function updateCookie(user, pwd, repo, branch){\r
+ if(checkCookie()){\r
+ branchName = branch;\r
+ setCookie("logginNitdoc", base64.encode(user+':'+pwd+':'+repo+':'+branch), 1);\r
+ }\r
+}\r
+\r
function getCookie(c_name)\r
{\r
var c_value = document.cookie;\r
{\r
cookie = base64.decode(cookie);\r
userName = cookie.split(':')[0];\r
+ password = cookie.split(':')[1];\r
repoName = cookie.split(':')[2]; \r
branchName = cookie.split(':')[3];\r
return true;\r
if (textC != ""){ element.text(textC); }\r
}\r
}\r
+\r
+// Get list of branches\r
+function getListBranches()\r
+{\r
+ cleanListBranches();\r
+ $.ajax({\r
+ beforeSend: function (xhr) { \r
+ if ($("#login").val() != ""){ xhr.setRequestHeader ("Authorization", userB64); }\r
+ },\r
+ type: "GET", \r
+ url: "https://api.github.com/repos/"+userName+"/"+githubRepo+"/branches", \r
+ async:false,\r
+ dataType:'json',\r
+ success: function(success)\r
+ { \r
+ for(var branch in success) { \r
+ var selected = '';\r
+ if(branchName == success[branch].name){\r
+ selected = 'selected';\r
+ }\r
+ $('#dropBranches').append('<option value="" '+ selected +'>' + success[branch].name + '</option>');\r
+ }\r
+ }\r
+ });\r
+}\r
+\r
+// Delete all option in the list\r
+function cleanListBranches(){\r
+ $('#dropBranches').children("option").remove();\r
+}
var custom_items = ""
if self._opt_custom_menu_items.value != null then custom_items = self._opt_custom_menu_items.value.as(not null)
- var action_bar = "<header><nav class='main'><ul>{custom_items}<li class=\"current\">Overview</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
+ var action_bar = "<header><nav class='main'><ul>{custom_items}<li class=\"current\">Overview</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"><div id=\"listBranches\"><label id=\"lbBranches\">Branch </label><select id=\"dropBranches\" name=\"dropBranches\" tabindex=\"1\" class=\"dropdown\"></select></div></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
var custom_title = "Nitdoc"
if self._opt_custom_title.value != null then custom_title = self._opt_custom_title.value.as(not null)
assert mod isa MMSrcModule
if not mod.require_doc(self) then continue
self.filename = mod.html_name
- action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">{mod.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
+ action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">{mod.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"><div id=\"listBranches\"><label id=\"lbBranches\">Branch </label><select id=\"dropBranches\" name=\"dropBranches\" tabindex=\"1\" class=\"dropdown\"></select></div>/div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
clear
addGithubInformation
addCommitForm
for c in mainmod.local_classes do
if not c.require_doc(self) then continue
self.filename = c.html_name
- action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li>{c.global.intro.mmmodule.toplevel_owner.html_link(self)}</li><li class=\"current\">{c.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
+ action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li>{c.global.intro.mmmodule.toplevel_owner.html_link(self)}</li><li class=\"current\">{c.name}</li><li><a href='full-index.html'>Full Index</a></li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"><div id=\"listBranches\"><label id=\"lbBranches\">Branch </label><select id=\"dropBranches\" name=\"dropBranches\" tabindex=\"1\" class=\"dropdown\"></select></div></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
clear
addGithubInformation
addCommitForm
end
self.filename = "fullindex"
- action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">Full Index</li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
+ action_bar = "<header><nav class='main'><ul>{custom_items}<li><a href='./index.html'>Overview</a></li><li class=\"current\">Full Index</li><li><a href=\"help.html\">Help</a></li><li id=\"liGitHub\" class=\"\"><a id=\"logGitHub\" class=\"btn\" ><img id=\"imgGitHub\" src=\"resources/icons/github-icon.png\" /></a><div class=\"popover bottom\"><div class=\"arrow\"></div><div><label id=\"lbloginGit\" for=\"login\">Username</label><input id=\"loginGit\" type=\"text\" name=\"login\"><label id=\"logginMessage\" >Hello <a id=\"githubAccount\" ><strong id=\"nickName\"></strong></a></label></div><div><label id=\"lbpasswordGit\" for=\"password\">Password</label><input id=\"passwordGit\" type=\"password\" name=\"password\"><div id=\"listBranches\"><label id=\"lbBranches\">Branch </label><select id=\"dropBranches\" name=\"dropBranches\" tabindex=\"1\" class=\"dropdown\"></select></div></div><div><label id=\"lbrepositoryGit\" for=\"repository\">Repository</label><input id=\"repositoryGit\" type=\"text\" name=\"repository\"></div><div><label id=\"lbbranchGit\" for=\"branch\">Branch</label><input id=\"branchGit\" type=\"text\" name=\"branch\"></div><div id=\"divlogIn\"><a id=\"signIn\" >Sign In</a></div></div></li></ul></nav></header>\n"
clear
addGithubInformation
addCommitForm