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">
|
<div class="sub-menu collapse collapse-save-as clearfix">
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li><a class="action-download-md" href="#"><i
|
<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
|
<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
|
<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
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -624,18 +624,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group modal-publish-github">
|
<div class="form-group modal-publish-github">
|
||||||
<label class="col-sm-4 control-label"
|
<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">
|
<div class="col-sm-7">
|
||||||
<input type="text" id="input-publish-github-reponame"
|
<input type="text" id="input-publish-github-repo"
|
||||||
placeholder="repository-name" class="form-control">
|
placeholder="Repository name or URL" 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">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group modal-publish-github">
|
<div class="form-group modal-publish-github">
|
||||||
|
@ -19,13 +19,17 @@ define([
|
|||||||
|
|
||||||
githubProvider.newPublishAttributes = function(event) {
|
githubProvider.newPublishAttributes = function(event) {
|
||||||
var publishAttributes = {};
|
var publishAttributes = {};
|
||||||
publishAttributes.repository = utils.getInputTextValue("#input-publish-github-reponame", event);
|
publishAttributes.repository = utils.getInputTextValue("#input-publish-github-repo", event);
|
||||||
publishAttributes.username = utils.getInputTextValue("#input-publish-github-username");
|
|
||||||
publishAttributes.branch = utils.getInputTextValue("#input-publish-github-branch", event);
|
publishAttributes.branch = utils.getInputTextValue("#input-publish-github-branch", event);
|
||||||
publishAttributes.path = utils.getInputTextValue("#input-publish-file-path", event);
|
publishAttributes.path = utils.getInputTextValue("#input-publish-file-path", event);
|
||||||
if(event.isPropagationStopped()) {
|
if(event.isPropagationStopped()) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
var parsedRepository = publishAttributes.repository.match(/[\/:]?([^\/:]+)\/([^\/]+?)(?:\.git)?$/);
|
||||||
|
if(parsedRepository) {
|
||||||
|
publishAttributes.repository = parsedRepository[2];
|
||||||
|
publishAttributes.username = parsedRepository[1];
|
||||||
|
}
|
||||||
return publishAttributes;
|
return publishAttributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user