/usr/share/gps/templates/aws_web_server_blocks/js/ajax_api.tjs is in gnat-gps-common 5.0-13.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | @@---------------------------------------------------------------------------
@@--
@@MACRO(BIND_JS)@@
@@--
@@-- $1 action to register
@@-- $2 the tag node ID to handle in the DOM tree
@@-- $3 the name of the javascript routine to execute
@@-- $18 ID index to be added to $2 (index in table for unique id for ex)
@@--
@@SET@@ BJS_ACTION = $1
@@SET@@ BJS_ID = $2
@@SET@@ BJS_ROUTINE = $3
@@SET@@ BJS_ID_INDEX = $18
@@--
<script type="text/javascript">
<!--
var rule_@_BJS_ID_@@_BJS_ID_INDEX_@ = {
@@IF@@ @_BJS_ROUTINE_@ = ""
'#@_BJS_ID_@@_BJS_ID_INDEX_@' : function(el) {el.@_BJS_ACTION_@ = call_@_BJS_ACTION_@_@_BJS_ID_@@_BJS_ID_INDEX_@;}
@@ELSE@@
'#@_BJS_ID_@@_BJS_ID_INDEX_@' : function(el) {el.@_BJS_ACTION_@ = @_BJS_ROUTINE_@;}
@@END_IF@@
};
Behaviour.register (rule_@_BJS_ID_@@_BJS_ID_INDEX_@);
-->
</script>
@@END_MACRO@@
@@---------------------------------------------------------------------------
@@--
@@MACRO(JS_ACTION)@@
@@--
@@-- $1 action name (onclick, onchange...)
@@-- $2 the tag node ID to handle in the DOM tree
@@-- $3 a set of parameters to pass to the URL
@@-- $4-$8 are linked fields id to this request, all fields are passed as
@@-- parameters to the request.
@@-- $18 ID index to be added to $2 (index in table for unique id for ex)
@@-- $19 URL to call instead of the generated one
@@-- $20 the name of a function to call when this routine terminate
@@--
@@-- The final request is : /$1$$$2$18?$3&$4=value($4)&$5=value($5)
@@-- or : $19?$3&$4=value($4)&$5=value($5)
@@-- with value(name) being the value for the field named "name".
@@--
@@SET@@ JSA_ACTION = $1
@@SET@@ JSA_ID = $2
@@SET@@ JSA_PARAMETERS = $3
@@SET@@ JSA_F1 = $4
@@SET@@ JSA_F2 = $5
@@SET@@ JSA_F3 = $6
@@SET@@ JSA_F4 = $7
@@SET@@ JSA_F5 = $8
@@SET@@ JSA_ID_INDEX = $18
@@SET@@ JSA_CONSTANT_URL = $19
@@SET@@ JSA_ONCOMPLETE = $20
<script type="text/javascript">
<!--
function call_@_JSA_ACTION_@_@_JSA_ID_@@_JSA_ID_INDEX_@()
{
@@IF@@ @_JSA_CONSTANT_URL_@ /= ""
var rurl="@_JSA_CONSTANT_URL_@";
@@ELSE@@
var rurl="/@_JSA_ACTION_@$@_JSA_ID_@@_JSA_ID_INDEX_@";
@@END_IF@@
var rpars = "";
var roncomplete = "";
@@IF@@ @_JSA_PARAMETERS_@ /= ""
rpars = "@_JSA_PARAMETERS_@";
@@END_IF@@
@@IF@@ @_JSA_F1_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_JSA_F1_@');
@@END_IF@@
@@IF@@ @_JSA_F2_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_JSA_F2_@');
@@END_IF@@
@@IF@@ @_JSA_F3_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_JSA_F3_@');
@@END_IF@@
@@IF@@ @_JSA_F4_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_JSA_F4_@');
@@END_IF@@
@@IF@@ @_JSA_F5_@ /= ""
if (rpars != "")
rpars = rpars + "&";
rpars = rpars + AWS.Ajax.serialize('@_JSA_F5_@');
@@END_IF@@
@@IF@@ @_JSA_ONCOMPLETE_@ /= ""
roncomplete = @_JSA_ONCOMPLETE_@
@@END_IF@@
AWS.Ajax.XML.request (rurl, rpars, roncomplete);
return (false);
}
-->
</script>
@_BIND_JS(@_JSA_ACTION_@, @_JSA_ID_@, 18=>@_JSA_ID_INDEX_@)_@
@@END_MACRO@@
|