mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Compare commits
28 Commits
feature/ne
...
v2.9.17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8a215d790 | ||
|
|
da69f3b2c8 | ||
|
|
fc442c1a42 | ||
|
|
cf59a6b9fd | ||
|
|
34afcd511a | ||
|
|
e2444a2e4e | ||
|
|
692516de9b | ||
|
|
2f121bef5e | ||
|
|
9e253012e6 | ||
|
|
6ef3b227b8 | ||
|
|
c3dd1886c9 | ||
|
|
69bb90a0e4 | ||
|
|
6f02965149 | ||
|
|
b8e15f691d | ||
|
|
8797d84605 | ||
|
|
1d544099f6 | ||
|
|
49a6c5f2c4 | ||
|
|
298eaa8b4b | ||
|
|
7b87038a8c | ||
|
|
fdc9171c69 | ||
|
|
f43bd100e6 | ||
|
|
fbba0e3ea5 | ||
|
|
b15695128f | ||
|
|
0870b90443 | ||
|
|
48ccab152b | ||
|
|
f3bc900f16 | ||
|
|
ec148847a9 | ||
|
|
0474af912a |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "2.9.16",
|
||||
"version": "2.9.17",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "2.9.16",
|
||||
"version": "2.9.17",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EDCD/coriolis"
|
||||
|
||||
@@ -258,6 +258,15 @@ Route.prototype.match = function(path, params) {
|
||||
* @param {string} path Path to track
|
||||
*/
|
||||
function gaTrack(path) {
|
||||
const match = path.match(/\/outfit\/(.*)(\?code=.*)/);
|
||||
if (match) {
|
||||
if (match[1]) {
|
||||
ReactGA.ga('set', 'contentGroup1', match[1]);
|
||||
}
|
||||
if (match[2]) {
|
||||
ReactGA.ga('set', 'contentGroup2', match[2]);
|
||||
}
|
||||
}
|
||||
ReactGA.pageview(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ export default class ModalPermalink extends TranslatedComponent {
|
||||
<h3 >{translate('shortened')}</h3>
|
||||
<input value={this.state.shortenedUrl} readOnly size={25} onFocus={ (e) => e.target.select() }/>
|
||||
<br/><br/>
|
||||
<p>s.orbis.zone is the new URL shortener domain, old eddp.co urls are considered end of life and could go down at any moment. Sorry for any inconvenience.</p>
|
||||
<button className={'r dismiss cap'} onClick={this.context.hideModal}>{translate('close')}</button>
|
||||
</div>;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import request from 'superagent';
|
||||
* @param {function} error Failure/Error callback
|
||||
*/
|
||||
export default function shorternUrl(url, success, error) {
|
||||
shortenUrlEddp(url, success, error);
|
||||
shortenUrlOrbis(url, success, error);
|
||||
}
|
||||
|
||||
const SHORTEN_API_GOOGLE = 'https://www.googleapis.com/urlshortener/v1/url?key=';
|
||||
@@ -64,3 +64,32 @@ function shortenUrlEddp(url, success, error) {
|
||||
error('Not Online');
|
||||
}
|
||||
}
|
||||
|
||||
const SHORTEN_API_ORBIS = 'https://s.orbis.zone/a';
|
||||
/**
|
||||
* Shorten a URL using Orbis's URL shortener API
|
||||
* @param {string} url The URL to shorten
|
||||
* @param {function} success Success callback
|
||||
* @param {function} error Failure/Error callback
|
||||
*/
|
||||
function shortenUrlOrbis(url, success, error) {
|
||||
if (window.navigator.onLine) {
|
||||
try {
|
||||
request.post(SHORTEN_API_ORBIS)
|
||||
.field('lsturl', url)
|
||||
.field('format', 'json')
|
||||
.end(function(err, response) {
|
||||
if (err) {
|
||||
error('Bad Request');
|
||||
} else {
|
||||
success(response.body.short);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
error(e.message ? e.message : e);
|
||||
}
|
||||
} else {
|
||||
error('Not Online');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user