Add frontend assets and plugin bundles

Add the legacy frontend themes, scripts, and plugin assets required by the main SPOTA interfaces.
This commit is contained in:
Power BI Dev
2026-05-02 10:09:32 +07:00
parent efdb11db3f
commit a52c2a8462
2061 changed files with 513282 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
Copyright (c) 2007-2013 Diego Plentz (plentz.org)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,66 @@
Just a simple way to create masks to your currency form fields with [jQuery](http://jquery.com/).
***
### Show Time!
To view a complete demonstration of it's features and usage, access our [examples page](http://plentz.github.com/jquery-maskmoney)!
***
### Usage:
```html
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="jquery.maskMoney.js" type="text/javascript"></script>
</head>
<body>
<input type="text" id="currency" />
</body>
<script type="text/javascript">
$(function(){
$("#currency").maskMoney();
})
</script>
```
***
### Options:
The options that you can set are:
* ```symbol```: the symbol to be displayed before the value entered by the user(example: "US$"). default: ''
* ```symbolStay```: set if the symbol will stay in the field after the user exists the field. default: false
* ```thousands```: the thousands separator. default: ','
* ```decimal```: the decimal separator. default: '.'
* ```precision```: how many decimal places are allowed. default: 2
* ```defaultZero```: when the user enters the field, it sets a default mask using zero. default: true
* ```allowZero```: use this setting to prevent users from inputing zero. default: false
* ```allowNegative```: use this setting to prevent users from inputing negative values. default: false
__IMPORTANT__: if you try to bind maskMoney to a read only field, nothing will happen, since we ignore completely read only fields. So, if you have a read only field, try to bind maskMoney to it, it will not work. Even if you change the field removing the readonly property, you will need to re-bind maskMoney to make it work.
***
### Bonus!
We have 2 bonus methods that can be useful to you:
* ```.maskMoney('destroy')``` which removes maskMoney from an element.
* ```.maskMoney('mask')``` which causes maskMoney to actually apply the mask to your input.
***
### Contributors:
* [Aurélio Saraiva](mailto:aureliosaraiva@gmail.com)
* [Raul Pereira da Silva](http://raulpereira.com)
* [Diego Plentz](http://plentz.org)
* [Otávio Ribeiro Medeiros](http://github.com/otaviomedeiros)
* [Víctor Cruz](http://github.com/xtream)
* [Synapse Studios](http://github.com/synapsestudios)
* [Guilherme Garnier](http://blog.guilhermegarnier.com/)
* [Plínio Balduino](http://github.com/pbalduino)
* [Luis Fernando Gomes](https://github.com/luiscoms)
* [Gary Moore](http://www.gmoore.net/)
***
### License:
__jQuery-maskMoney__ is released under the MIT license.

View File

@@ -0,0 +1,49 @@
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="jquery.maskMoney.js" type="text/javascript"></script>
<!-- just necessary for syntax highlight -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css' />
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css' />
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script>
<style type="text/css">
body { font-family: helvetica, sans-serif; }
h1 { font-size: 2em;}
</style>
</head>
<body>
<h1>jQuery-maskMoney examples</h1>
<p>jQuery plugin to mask data entry in the input text in the form of money (currency). <a href="https://github.com/plentz/jquery-maskmoney">Project home @ github</a></p>
<input type="text" id="demo1" />
<script type="text/javascript">$("#demo1").maskMoney();</script>
<pre class="brush: js">$("#demo1").maskMoney();</pre>
<input type="text" id="demo2" />
<script type="text/javascript">$("#demo2").maskMoney({thousands:'', decimal:'.'});</script>
<pre class="brush: js">$("#demo2").maskMoney({thousands:'', decimal:'.'});</pre>
<input type="text" id="demo3" />
<script type="text/javascript">$("#demo3").maskMoney({allowZero:false, allowNegative:true, defaultZero:false});</script>
<pre class="brush: js">$("#demo3").maskMoney({allowZero:false, allowNegative:true, defaultZero:false});</pre>
<input type="text" id="demo4" />
<script type="text/javascript">$("#demo4").maskMoney({symbol:'R$ ', thousands:'.', decimal:',', symbolStay: true});</script>
<pre class="brush: js">$("#demo4").maskMoney({symbol:'R$ ', thousands:'.', decimal:',', symbolStay: true});</pre>
<input type="text" id="demo5" value="1234567.89"/>
<script type="text/javascript">$("#demo5").maskMoney({symbol:'R$ ', thousands:'.', decimal:',', symbolStay: true});</script>
<input type="button" onclick="$('#demo5').maskMoney('mask')" value="trigger mask event at demo5"/>
<pre class="brush: js">$("#demo5").maskMoney('mask');</pre>
<input type="text" id="demo6"/>
<script type="text/javascript">$("#demo6").maskMoney();</script>
<input type="button" onclick="$('#demo6').maskMoney('destroy')" value="remove maskmoney from demo6"/>
<pre class="brush: js">$("#demo6").maskMoney('destroy');</pre>
</body>
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
</html>

View File

@@ -0,0 +1,370 @@
/*
* maskMoney plugin for jQuery
* http://plentz.github.com/jquery-maskmoney/
* version: 2.1.2
* Licensed under the MIT license
*/
;(function($) {
if(!$.browser){
$.browser = {};
$.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase());
$.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase());
$.browser.opera = /opera/.test(navigator.userAgent.toLowerCase());
$.browser.msie = /msie/.test(navigator.userAgent.toLowerCase());
}
var methods = {
destroy : function(){
var input = $(this);
input.unbind('.maskMoney');
if ($.browser.msie) {
this.onpaste = null;
}
return this;
},
mask : function(){
return this.trigger('mask');
},
init : function(settings) {
settings = $.extend({
symbol: '',
symbolStay: false,
thousands: ',',
decimal: '.',
precision: 2,
defaultZero: true,
allowZero: false,
allowNegative: false
}, settings);
return this.each(function() {
var input = $(this);
var dirty = false;
function markAsDirty() {
dirty = true;
}
function clearDirt(){
dirty = false;
}
function keypressEvent(e) {
e = e || window.event;
var k = e.which || e.charCode || e.keyCode;
if (k == undefined) return false; //needed to handle an IE "special" event
if (k < 48 || k > 57) { // any key except the numbers 0-9
if (k == 45) { // -(minus) key
markAsDirty();
input.val(changeSign(input));
return false;
} else if (k == 43) { // +(plus) key
markAsDirty();
input.val(input.val().replace('-',''));
return false;
} else if (k == 13 || k == 9) { // enter key or tab key
if(dirty){
clearDirt();
$(this).change();
}
return true;
} else if ($.browser.mozilla && (k == 37 || k == 39) && e.charCode == 0) {
// needed for left arrow key or right arrow key with firefox
// the charCode part is to avoid allowing '%'(e.charCode 0, e.keyCode 37)
return true;
} else { // any other key with keycode less than 48 and greater than 57
preventDefault(e);
return true;
}
} else if (canInputMoreNumbers(input)) {
return false;
} else {
preventDefault(e);
var key = String.fromCharCode(k);
var x = input.get(0);
var selection = getInputSelection(x);
var startPos = selection.start;
var endPos = selection.end;
x.value = x.value.substring(0, startPos) + key + x.value.substring(endPos, x.value.length);
maskAndPosition(x, startPos + 1);
markAsDirty();
return false;
}
}
function canInputMoreNumbers(element){
var reachedMaxLength = (element.val().length >= element.attr('maxlength') && element.attr('maxlength') >= 0);
var selection = getInputSelection(element.get(0));
var start = selection.start;
var end = selection.end;
var hasNumberSelected = (selection.start != selection.end && element.val().substring(start,end).match(/\d/))? true : false;
return reachedMaxLength && !hasNumberSelected;
}
function keydownEvent(e) {
e = e||window.event;
var k = e.which || e.charCode || e.keyCode;
if (k == undefined) return false; //needed to handle an IE "special" event
var x = input.get(0);
var selection = getInputSelection(x);
var startPos = selection.start;
var endPos = selection.end;
if (k==8) { // backspace key
preventDefault(e);
if(startPos == endPos){
// Remove single character
x.value = x.value.substring(0, startPos - 1) + x.value.substring(endPos, x.value.length);
startPos = startPos - 1;
} else {
// Remove multiple characters
x.value = x.value.substring(0, startPos) + x.value.substring(endPos, x.value.length);
}
maskAndPosition(x, startPos);
markAsDirty();
return false;
} else if (k==9) { // tab key
if(dirty) {
$(this).change();
clearDirt();
}
return true;
} else if ( k==46 || k==63272 ) { // delete key (with special case for safari)
preventDefault(e);
if(x.selectionStart == x.selectionEnd){
// Remove single character
x.value = x.value.substring(0, startPos) + x.value.substring(endPos + 1, x.value.length);
} else {
//Remove multiple characters
x.value = x.value.substring(0, startPos) + x.value.substring(endPos, x.value.length);
}
maskAndPosition(x, startPos);
markAsDirty();
return false;
} else { // any other key
return true;
}
}
function focusEvent(e) {
var mask = getDefaultMask();
if (input.val() == mask) {
input.val('');
} else if (input.val()=='' && settings.defaultZero) {
input.val(setSymbol(mask));
} else {
input.val(setSymbol(input.val()));
}
if (this.createTextRange) {
var textRange = this.createTextRange();
textRange.collapse(false); // set the cursor at the end of the input
textRange.select();
}
}
function blurEvent(e) {
if ($.browser.msie) {
keypressEvent(e);
}
if (input.val() == '' || input.val() == setSymbol(getDefaultMask()) || input.val() == settings.symbol) {
if(!settings.allowZero){
input.val('');
} else if (!settings.symbolStay){
input.val(getDefaultMask());
} else {
input.val(setSymbol(getDefaultMask()));
}
} else {
if (!settings.symbolStay){
input.val(input.val().replace(settings.symbol,''));
} else if (settings.symbolStay && input.val() == settings.symbol){
input.val(setSymbol(getDefaultMask()));
}
}
}
function preventDefault(e) {
if (e.preventDefault) { //standard browsers
e.preventDefault();
} else { // old internet explorer
e.returnValue = false
}
}
function maskAndPosition(x, startPos) {
var originalLen = input.val().length;
input.val(maskValue(x.value));
var newLen = input.val().length;
startPos = startPos - (originalLen - newLen);
setCursorPosition(input, startPos);
}
function mask(){
var value = input.val();
input.val(maskValue(value));
}
function maskValue(v) {
v = v.replace(settings.symbol, '');
var strCheck = '0123456789';
var len = v.length;
var a = '', t = '', neg='';
if(len != 0 && v.charAt(0)=='-'){
v = v.replace('-','');
if(settings.allowNegative){
neg = '-';
}
}
if (len==0) {
if (!settings.defaultZero) return t;
t = '0.00';
}
for (var i = 0; i<len; i++) {
if ((v.charAt(i)!='0') && (v.charAt(i)!=settings.decimal)) break;
}
for (; i < len; i++) {
if (strCheck.indexOf(v.charAt(i))!=-1) a+= v.charAt(i);
}
var n = parseFloat(a);
n = isNaN(n) ? 0 : n/Math.pow(10,settings.precision);
t = n.toFixed(settings.precision);
i = settings.precision == 0 ? 0 : 1;
var p, d = (t=t.split('.'))[i].substr(0,settings.precision);
for (p = (t=t[0]).length; (p-=3)>=1;) {
t = t.substr(0,p)+settings.thousands+t.substr(p);
}
return (settings.precision>0)
? setSymbol(neg+t+settings.decimal+d+Array((settings.precision+1)-d.length).join(0))
: setSymbol(neg+t);
}
function getDefaultMask() {
var n = parseFloat('0')/Math.pow(10,settings.precision);
return (n.toFixed(settings.precision)).replace(new RegExp('\\.','g'),settings.decimal);
}
function setSymbol(value){
if (settings.symbol != ''){
var operator = '';
if(value.length != 0 && value.charAt(0) == '-'){
value = value.replace('-', '');
operator = '-';
}
if(value.substr(0, settings.symbol.length) != settings.symbol){
value = operator + settings.symbol + value;
}
}
return value;
}
function changeSign(input){
var inputValue = input.val();
if (settings.allowNegative){
if (inputValue != '' && inputValue.charAt(0) == '-'){
return inputValue.replace('-','');
} else {
return '-' + inputValue;
}
} else {
return inputValue;
}
}
function setCursorPosition(input, pos) {
// I'm not sure if we need to jqueryfy input
$(input).each(function(index, elem) {
if (elem.setSelectionRange) {
elem.focus();
elem.setSelectionRange(pos, pos);
} else if (elem.createTextRange) {
var range = elem.createTextRange();
range.collapse(true);
range.moveEnd('character', pos);
range.moveStart('character', pos);
range.select();
}
});
return this;
};
function getInputSelection(el) {
var start = 0, end = 0, normalizedValue, range, textInputRange, len, endRange;
if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
start = el.selectionStart;
end = el.selectionEnd;
} else {
range = document.selection.createRange();
if (range && range.parentElement() == el) {
len = el.value.length;
normalizedValue = el.value.replace(/\r\n/g, "\n");
// Create a working TextRange that lives only in the input
textInputRange = el.createTextRange();
textInputRange.moveToBookmark(range.getBookmark());
// Check if the start and end of the selection are at the very end
// of the input, since moveStart/moveEnd doesn't return what we want
// in those cases
endRange = el.createTextRange();
endRange.collapse(false);
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
start = end = len;
} else {
start = -textInputRange.moveStart("character", -len);
start += normalizedValue.slice(0, start).split("\n").length - 1;
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
end = len;
} else {
end = -textInputRange.moveEnd("character", -len);
end += normalizedValue.slice(0, end).split("\n").length - 1;
}
}
}
}
return {
start: start,
end: end
};
} // getInputSelection
input.unbind('.maskMoney');
input.bind('keypress.maskMoney', keypressEvent);
input.bind('keydown.maskMoney', keydownEvent);
input.bind('blur.maskMoney', blurEvent);
input.bind('focus.maskMoney', focusEvent);
input.bind('mask.maskMoney', mask);
})
}
}
$.fn.maskMoney = function(method) {
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.maskMoney' );
}
};
})(window.jQuery || window.Zepto);

View File

@@ -0,0 +1,42 @@
{
"name": "maskmoney",
"title": "jQuery maskMoney",
"description": "jQuery plugin to mask data entry in the input text in the form of money (currency)",
"keywords": [
"form",
"input",
"mask"
],
"version": "2.1.2",
"author": {
"name": "Diego Plentz",
"email": "diego@plentz.org",
"url": "http://plentz.org"
},
"maintainers": [
{
"name": "Diego Plentz",
"email": "diego@plentz.org",
"url": "http://plentz.org"
},
{
"name": "Plínio Balduino",
"email": "pbalduino+github@gmail.com",
"url": "https://github.com/pbalduino"
}
],
"licenses": [
{
"type": "MIT",
"url": "https://raw.github.com/plentz/jquery-maskmoney/master/LICENSE"
}
],
"bugs": "https://github.com/plentz/jquery-maskmoney/issues",
"homepage": "http://plentz.github.com/jquery-maskmoney",
"docs": "http://plentz.github.com/jquery-maskmoney",
"demo": "http://plentz.github.com/jquery-maskmoney",
"download": "https://raw.github.com/plentz/jquery-maskmoney/master/jquery.maskMoney.js",
"dependencies": {
"jquery": ">=1.6"
}
}