mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
gui: Generate version-specific documentation link URLs (#8108)
Replace all HTML references to https://docs.syncthing.net with a function call to return a version-specific URL.
This commit is contained in:
parent
99f96c5cb7
commit
1af87577e1
@ -89,7 +89,7 @@
|
||||
</li>
|
||||
<li class="dropdown" language-select></li>
|
||||
<li>
|
||||
<a class="navbar-link" href="https://docs.syncthing.net/intro/gui.html" target="_blank">
|
||||
<a class="navbar-link" href="{{docsURL('intro/gui')}}" target="_blank">
|
||||
<span class="fas fa-question-circle"></span>
|
||||
<span class="hidden-xs" translate>Help</span>
|
||||
</a>
|
||||
@ -108,7 +108,7 @@
|
||||
<li><a href="" ng-click="restart()"><span class="fas fa-fw fa-refresh"></span> <span translate>Restart</span></a></li>
|
||||
<li class="divider" aria-hidden="true"></li>
|
||||
<li class="visible-xs">
|
||||
<a href="https://docs.syncthing.net/intro/gui.html" target="_blank">
|
||||
<a href="{{docsURL('intro/gui')}}" target="_blank">
|
||||
<span class="fas fa-fw fa-question-circle"></span> <span translate>Help</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -432,7 +432,7 @@
|
||||
<i class="small">
|
||||
<span translate style="white-space: normal;">Altered by ignoring deletes.</span>
|
||||
<br>
|
||||
<a href="https://docs.syncthing.net/advanced/folder-ignoredelete" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<a href="{{docsURL('advanced/folder-ignoredelete')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
</i>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -28,7 +28,7 @@
|
||||
<span translate>You can read more about the two release channels at the link below.</span>
|
||||
</p>
|
||||
<p translate>You can change your choice at any time in the Settings dialog.</p>
|
||||
<p><a href="https://docs.syncthing.net/users/releases.html"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
<p><a href="{{docsURL('users/releases')}}"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button type="button" class="btn btn-sm btn-default pull-right" ng-click="showSettings(); dismissNotification('channelNotification')">
|
||||
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p translate>Continuously watching for changes is now available within Syncthing. This will detect changes on disk and issue a scan on only the modified paths. The benefits are that changes are propagated quicker and that less full scans are required.</p>
|
||||
<p><a href="https://docs.syncthing.net/users/syncing.html#scanning"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
<p><a href="{{docsURL('users/syncing#scanning')}}"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
<p>
|
||||
<span translate>Do you want to enable watching for changes for all your folders?</span><br />
|
||||
<span translate>Additionally the full rescan interval will be increased (times 60, i.e. new default of 1h). You can also configure it manually for every folder later after choosing No.</span>
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p translate>Syncthing now supports automatically reporting crashes to the developers. This feature is enabled by default.</p>
|
||||
<p><a href="https://docs.syncthing.net/users/crashrep.html"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
<p><a href="{{docsURL('users/crashrep')}}"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
</div>
|
||||
<div class="panel-footer clearfix">
|
||||
<div class="pull-right">
|
||||
@ -101,7 +101,7 @@
|
||||
<div class="panel-body">
|
||||
<p translate>Syncthing now supports automatically reporting crashes to the developers. This feature is enabled by default.</p>
|
||||
<p translate>However, your current settings indicate you might not want it enabled. We have disabled automatic crash reporting for you.</p>
|
||||
<p><a href="https://docs.syncthing.net/users/crashrep.html"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
<p><a href="{{docsURL('users/crashrep')}}"><span class="fas fa-info-circle"></span> <span translate>Learn more</span></a></p>
|
||||
</div>
|
||||
<div class="panel-footer clearfix">
|
||||
<div class="pull-right">
|
||||
|
@ -2892,6 +2892,34 @@ angular.module('syncthing.core')
|
||||
return $scope.version.version + ', ' + os + ' (' + arch + ')';
|
||||
};
|
||||
|
||||
$scope.versionBase = function () {
|
||||
if (!$scope.version.version) {
|
||||
return '';
|
||||
}
|
||||
var version = $scope.version.version;
|
||||
var pos = version.indexOf('-');
|
||||
if (pos > 0) {
|
||||
version = version.slice(0, pos);
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
$scope.docsURL = function (path) {
|
||||
var url = 'https://docs.syncthing.net';
|
||||
if (path) {
|
||||
var hash = path.indexOf('#');
|
||||
if (hash != -1) {
|
||||
url += '/' + path.slice(0, hash);
|
||||
url += '?version=' + $scope.versionBase();
|
||||
url += path.slice(hash);
|
||||
} else {
|
||||
url += '/' + path;
|
||||
url += '?version=' + $scope.versionBase();
|
||||
}
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
$scope.inputTypeFor = function (key, value) {
|
||||
if (key.substr(0, 1) === '_') {
|
||||
return 'skip';
|
||||
|
@ -77,7 +77,7 @@
|
||||
|
||||
<div id="folder-versioning" class="tab-pane">
|
||||
<div class="form-group">
|
||||
<label translate>File Versioning</label> <a href="https://docs.syncthing.net/users/versioning.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<label translate>File Versioning</label> <a href="{{docsURL('users/versioning')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<select class="form-control" ng-model="currentFolder._guiVersioning.selector">
|
||||
<option value="none" translate>No File Versioning</option>
|
||||
<option value="trashcan" translate>Trash Can File Versioning</option>
|
||||
@ -164,7 +164,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<hr />
|
||||
<p class="small"><span translate>Quick guide to supported patterns</span> (<a href="https://docs.syncthing.net/users/ignoring.html" target="_blank" translate>full documentation</a>):</p>
|
||||
<p class="small"><span translate>Quick guide to supported patterns</span> (<a href="{{docsURL('users/ignoring')}}" target="_blank" translate>full documentation</a>):</p>
|
||||
<dl class="dl-horizontal dl-narrow small">
|
||||
<dt><code>(?d)</code></dt>
|
||||
<dd><b><span translate>Prefix indicating that the file can be deleted if preventing directory removal</span></b></dd>
|
||||
@ -190,7 +190,7 @@
|
||||
<div class="row form-group" ng-class="{'has-error': folderEditor.rescanIntervalS.$invalid && folderEditor.rescanIntervalS.$dirty}">
|
||||
<div class="col-md-12">
|
||||
<label translate>Scanning</label>
|
||||
<a href="https://docs.syncthing.net/users/syncing.html#scanning" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a></br>
|
||||
<a href="{{docsURL('users/syncing#scanning')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a></br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@ -213,7 +213,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6 form-group">
|
||||
<label translate>Folder Type</label>
|
||||
<a href="https://docs.syncthing.net/users/foldertypes.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<a href="{{docsURL('users/foldertypes')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<select class="form-control" ng-change="setDefaultsForFolderType()" ng-model="currentFolder.type" ng-disabled="editingFolderExisting() && currentFolder.type == 'receiveencrypted'">
|
||||
<option value="sendreceive" translate>Send & Receive</option>
|
||||
<option value="sendonly" translate>Send Only</option>
|
||||
|
@ -85,7 +85,7 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label translate>Automatic upgrades</label> <a href="https://docs.syncthing.net/users/releases.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<label translate>Automatic upgrades</label> <a href="{{docsURL('users/releases')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<select class="form-control" ng-model="tmpOptions.upgrades" ng-if="upgradeInfo">
|
||||
<option ng-if="!version.isCandidate" value="none" translate>No upgrades</option>
|
||||
<option value="stable" translate>Stable releases only</option>
|
||||
@ -115,7 +115,7 @@
|
||||
|
||||
<div id="settings-gui" class="tab-pane">
|
||||
<div class="form-group" ng-class="{'has-error': settingsEditor.Address.$invalid && settingsEditor.Address.$dirty}">
|
||||
<label translate for="Address">GUI Listen Address</label> <a href="https://docs.syncthing.net/users/guilisten.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<label translate for="Address">GUI Listen Address</label> <a href="{{docsURL('users/guilisten')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<p class="text-warning" ng-show="system.guiAddressOverridden">
|
||||
<span class="fas fa-exclamation-triangle"></span>
|
||||
<span translate>The GUI address is overridden by startup options. Changes here will not take effect while the override is in place.</span>
|
||||
@ -187,7 +187,7 @@
|
||||
|
||||
<div id="settings-connections" class="tab-pane">
|
||||
<div class="form-group">
|
||||
<label translate for="ListenAddressesStr">Sync Protocol Listen Addresses</label> <a href="https://docs.syncthing.net/users/config.html#listen-addresses" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<label translate for="ListenAddressesStr">Sync Protocol Listen Addresses</label> <a href="{{docsURL('users/config#listen-addresses')}}" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<input id="ListenAddressesStr" class="form-control" type="text" ng-model="tmpOptions._listenAddressesStr" />
|
||||
</div>
|
||||
<div class="row">
|
||||
|
Loading…
Reference in New Issue
Block a user