2016-02-10 18:36:35 +00: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 19:28:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
function tr(text) {
|
|
|
|
return qsTr(text) + translationManager.emptyString
|
|
|
|
}
|
2016-08-19 11:44:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
function lineBreaksToSpaces(text) {
|
|
|
|
return text.trim().replace(/(\r\n|\n|\r)/gm, " ");
|
|
|
|
}
|
2017-01-04 16:25:22 +00:00
|
|
|
|
|
|
|
function usefulName(path) {
|
|
|
|
// arbitrary "short enough" limit
|
|
|
|
if (path.length < 32)
|
|
|
|
return path
|
|
|
|
return path.replace(/.*[\/\\]/, '').replace(/\.keys$/, '')
|
|
|
|
}
|