Simplified GitHub publish dialog
This commit is contained in:
parent
8cf9fc8fb8
commit
134fddc4aa
@ -153,13 +153,13 @@
|
||||
<div class="sub-menu collapse collapse-save-as clearfix">
|
||||
<ul class="nav">
|
||||
<li><a class="action-download-md" href="#"><i
|
||||
class="icon-download"></i> Export as Markdown</a></li>
|
||||
class="icon-download"></i> As Markdown</a></li>
|
||||
<li><a class="action-download-html" href="#"><i
|
||||
class="icon-download"></i> Export as HTML</a></li>
|
||||
class="icon-download"></i> As HTML</a></li>
|
||||
<li><a class="action-download-template" href="#"><i
|
||||
class="icon-download"></i> Export using template</a></li>
|
||||
class="icon-download"></i> Using template</a></li>
|
||||
<li><a class="action-download-pdf" href="#"><i
|
||||
class="icon-download"></i> Export as PDF</a></li>
|
||||
class="icon-download"></i> As PDF</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -624,18 +624,10 @@
|
||||
</div>
|
||||
<div class="form-group modal-publish-github">
|
||||
<label class="col-sm-4 control-label"
|
||||
for="input-publish-github-reponame">Repository</label>
|
||||
for="input-publish-github-repo">Repository</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" id="input-publish-github-reponame"
|
||||
placeholder="repository-name" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group modal-publish-github">
|
||||
<label class="col-sm-4 control-label"
|
||||
for="input-publish-github-username">Username (optional)</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" id="input-publish-github-username"
|
||||
placeholder="username" class="form-control">
|
||||
<input type="text" id="input-publish-github-repo"
|
||||
placeholder="Repository name or URL" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group modal-publish-github">
|
||||
|
@ -19,13 +19,17 @@ define([
|
||||
|
||||
githubProvider.newPublishAttributes = function(event) {
|
||||
var publishAttributes = {};
|
||||
publishAttributes.repository = utils.getInputTextValue("#input-publish-github-reponame", event);
|
||||
publishAttributes.username = utils.getInputTextValue("#input-publish-github-username");
|
||||
publishAttributes.repository = utils.getInputTextValue("#input-publish-github-repo", event);
|
||||
publishAttributes.branch = utils.getInputTextValue("#input-publish-github-branch", event);
|
||||
publishAttributes.path = utils.getInputTextValue("#input-publish-file-path", event);
|
||||
if(event.isPropagationStopped()) {
|
||||
return undefined;
|
||||
}
|
||||
var parsedRepository = publishAttributes.repository.match(/[\/:]?([^\/:]+)\/([^\/]+?)(?:\.git)?$/);
|
||||
if(parsedRepository) {
|
||||
publishAttributes.repository = parsedRepository[2];
|
||||
publishAttributes.username = parsedRepository[1];
|
||||
}
|
||||
return publishAttributes;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user