2016-02-10 19:36:35 +01:00
|
|
|
.pragma library
|
|
|
|
|
|
|
|
function mapScope (inputScopeFrom, inputScopeTo, outputScopeFrom, outputScopeTo, value) {
|
|
|
|
var x = (value - inputScopeFrom) / (inputScopeTo - inputScopeFrom);
|
|
|
|
var result = outputScopeFrom + ((outputScopeTo - outputScopeFrom) * x);
|
|
|
|
return result;
|
|
|
|
}
|
2016-07-20 21:28:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
function tr(text) {
|
|
|
|
return qsTr(text) + translationManager.emptyString
|
|
|
|
}
|
2016-08-19 13:44:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
function lineBreaksToSpaces(text) {
|
|
|
|
return text.trim().replace(/(\r\n|\n|\r)/gm, " ");
|
|
|
|
}
|
2017-01-04 17:25:22 +01:00
|
|
|
|
|
|
|
function usefulName(path) {
|
|
|
|
// arbitrary "short enough" limit
|
|
|
|
if (path.length < 32)
|
|
|
|
return path
|
|
|
|
return path.replace(/.*[\/\\]/, '').replace(/\.keys$/, '')
|
|
|
|
}
|