- .append(\r
- $(document.createElement("input"))\r
- .attr({\r
- id: "nitdoc-github-repo-field",\r
- type: "text"\r
- })\r
- )\r
- .append(\r
- $(document.createElement("label"))\r
- .attr("for", "nitdoc-github-branch-field")\r
- .append("Branch")\r
- )\r
- .append(\r
- $(document.createElement("input"))\r
- .attr({\r
- id: "nitdoc-github-branch-field",\r
- type: "text"\r
- })\r
- )\r
- .append(\r
- $(document.createElement("button"))\r
- .addClass("nitdoc-github-button")\r
- .append(\r
- $(document.createElement("img"))\r
- .attr("src", "resources/icons/github-icon.png")\r
- ).append("Sign In")\r
- .click(function() {\r
- var login = $('#nitdoc-github-login-field').val();\r
- var password = $('#nitdoc-github-password-field').val();\r
- var repo = $('#nitdoc-github-repo-field').val();\r
- var branch = $('#nitdoc-github-branch-field').val();\r
- if(!login || !password || !repo || !branch) {\r
- ModalBox.open("Sign in error", "Please enter your GitHub username, password, repository and branch.", true);\r
- } else {\r
- var user = UI.tryLogin(login, password, repo, branch);\r
- if(user == "error:login") {\r
- ModalBox.open("Sign in error", "The username, password, repo or branch you entered is incorrect.", true);\r
- } else if(user == "error:sha") {\r
- ModalBox.open("Base commit not found", "The provided GitHub repository must contains the base commit '" + UI.origin.sha + "'", true);\r
- } else if(user == "error:profile") {\r
- ModalBox.open("Incomplete GitHub profile", "Please set your public name and email in your <a href='https://github.com/settings/profile'>GitHub profile</a>.<br/><br/>Your public profile informations are used to sign-off your commits.", true);\r
- } else {\r
- UI.activate(user);\r
- LoginBox.displayLogout(UI.origin, user);\r
- }\r
- }\r
- return false;\r
- })\r
- )\r
- $(".nitdoc-github-li-img").attr("src", "resources/icons/github-icon.png");\r
- this.loginBoxContent.empty()\r
- this.loginBoxContent.append(panel);\r
+ this.content.append(\r
+ $("<form/>")\r
+ .keyup($.proxy(this._doFormChange, this))\r
+ .append(\r
+ $("<label/>")\r
+ .attr("for", "nitdoc-github-login-field")\r
+ .append(this.options.usernameTxt)\r
+ )\r
+ .append(\r
+ $("<input/>")\r
+ .attr({\r
+ id: "nitdoc-github-login-field",\r
+ type: "text"\r
+ })\r
+ )\r
+ .append(\r
+ $("<label/>")\r
+ .attr("for", "nitdoc-github-password-field")\r
+ .append(this.options.passwordTxt)\r
+ )\r
+ .append(\r
+ $("<input/>")\r
+ .attr({\r
+ id: "nitdoc-github-password-field",\r
+ type: "password"\r
+ })\r
+ )\r
+ .append(\r
+ $("<label/>")\r
+ .attr("for", "nitdoc-github-repo-field")\r
+ .append(this.options.repoTxt)\r
+ )\r
+ .append(\r
+ $("<input/>")\r
+ .attr({\r
+ id: "nitdoc-github-repo-field",\r
+ type: "text"\r
+ })\r
+ )\r
+ .append(\r
+ $("<label/>")\r
+ .attr("for", "nitdoc-github-branch-field")\r
+ .append(this.options.branchTxt)\r
+ )\r
+ .append(\r
+ $("<input/>")\r
+ .attr({\r
+ id: "nitdoc-github-branch-field",\r
+ type: "text"\r
+ })\r
+ )\r
+ .append(\r
+ $("<button/>")\r
+ .addClass("nitdoc-github-button")\r
+ .attr("disabled", "disabled")\r
+ .append(\r
+ $("<img/>")\r
+ .attr("src", this.options.icon)\r
+ ).text(this.options.signinTxt)\r
+ .click($.proxy(this._doClickLogin, this))\r
+ )\r
+ );\r
+ $(".nitdoc-github-li-img").attr("src", this.options.icon);\r