Skip to content

Commit f31a3ef

Browse files
committed
local change
2 parents 4ff721e + 66072e4 commit f31a3ef

File tree

8 files changed

+1724
-282
lines changed

8 files changed

+1724
-282
lines changed

dist/terminus-client.min.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/terminus-client.min.js.map

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/dispatchRequest.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ function btoaImplementation(str) {
1919
}
2020

2121
function DispatchRequest(url, action, payload) {
22+
/*
23+
*CORS is only required when trying to fetch data from a browser,
24+
*as browsers by default will block requests to different origins
25+
*/
2226
const options = {
2327
mode: 'cors', // no-cors, cors, *same-origin
2428
redirect: 'follow', // manual, *follow, error

lib/frameHelper.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const FrameHelper = {
1010
tcs: 'http://terminusdb.com/schema/tcs#',
1111
tbs: 'http://terminusdb.com/schema/tbs#',
1212
xdd: 'http://terminusdb.com/schema/xdd#',
13+
v: 'http://terminusdb.com/woql/variable/',
1314
terminus: 'http://terminusdb.com/schema/terminus#',
1415
vio: 'http://terminusdb.com/schema/vio#',
1516
docs: 'http://terminusdb.com/schema/documentation#'
@@ -80,6 +81,17 @@ FrameHelper.compareIDs = function (ida, idb) {
8081
return false;
8182
};
8283

84+
85+
86+
FrameHelper.shorten = function(url, prefixes){
87+
for(var pref in prefixes){
88+
if(prefixes[pref] == url.substring(0, prefixes[pref].length)){
89+
return ( pref + ":" + url.substring(prefixes[pref].length));
90+
}
91+
}
92+
return url;
93+
}
94+
8395
FrameHelper.unshorten = function (url) {
8496
if (this.validURL(url)) return url;
8597
if (!url) return url;

0 commit comments

Comments
 (0)