[open-ils-commits] r7894 - in trunk:
Evergreen/xul/staff_client/server/patron Open-ILS/examples
Open-ILS/src Open-ILS/src/javascript/backend/catalog
Open-ILS/src/javascript/backend/circ
Open-ILS/src/javascript/backend/libs
Open-ILS/src/javascript/backend/penalty
Open-ILS/src/perlmods/OpenILS/Utils
Open-ILS/src/reporter/templates Open-ILS/web/opac/common/js
Open-ILS/xul/staff_client Open-ILS/xul/staff_client/server/OpenILS
Open-ILS/xul/staff_client/server/admin
Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 18 13:36:56 EDT 2007
Author: dbs
Date: 2007-10-18 13:24:00 -0400 (Thu, 18 Oct 2007)
New Revision: 7894
Removed:
trunk/Open-ILS/src/javascript/backend/libs/JSON.js
trunk/Open-ILS/web/opac/common/js/JSON.js
Modified:
trunk/Evergreen/xul/staff_client/server/patron/ue.xhtml
trunk/Open-ILS/examples/opensrf.xml.example
trunk/Open-ILS/src/Makefile
trunk/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js
trunk/Open-ILS/src/javascript/backend/catalog/biblio_fingerprint.js
trunk/Open-ILS/src/javascript/backend/catalog/record_type.js
trunk/Open-ILS/src/javascript/backend/circ/circ_duration.js
trunk/Open-ILS/src/javascript/backend/circ/circ_item_config.js
trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js
trunk/Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
trunk/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js
trunk/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js
trunk/Open-ILS/src/javascript/backend/libs/jsonopensrfrequest.js
trunk/Open-ILS/src/javascript/backend/penalty/patron_penalty.js
trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm
trunk/Open-ILS/src/reporter/templates/header.ttk
trunk/Open-ILS/xul/staff_client/Makefile
trunk/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
trunk/Open-ILS/xul/staff_client/server/admin/cash_reports.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list_classic.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/printer_settings.html
trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.xhtml
trunk/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml
trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml
trunk/Open-ILS/xul/staff_client/server/patron/user_edit.xml
trunk/Open-ILS/xul/staff_client/server/patron/user_editor.xhtml
Log:
This commit breaks compatibility with OpenSRF 0.9.
Removes JSON.js copies from EG trunk.
JSON_v0.js (legacy JSON) and JSON_v1.js (modern JSON) are copied from the installed OpenSRF javascript libs.
ScriptRunner.pm no longer loads another copy of JSON.js from <DATA>.
All Evergreen files now use modern JSON (JSON_v1.js).
Modified: trunk/Evergreen/xul/staff_client/server/patron/ue.xhtml
===================================================================
--- trunk/Evergreen/xul/staff_client/server/patron/ue.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Evergreen/xul/staff_client/server/patron/ue.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -16,7 +16,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/examples/opensrf.xml.example
===================================================================
--- trunk/Open-ILS/examples/opensrf.xml.example 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/examples/opensrf.xml.example 2007-10-18 17:24:00 UTC (rev 7894)
@@ -377,6 +377,7 @@
</unix_config>
<app_settings>
<patron_penalty>penalty/patron_penalty.js</patron_penalty>
+ <script_path>/openils/lib/javascript</script_path>
<script_path>/openils/var</script_path>
<script_path>/openils/var/catalog</script_path>
</app_settings>
@@ -404,6 +405,7 @@
</notify_hold>
<!-- circulation policy scripts -->
+ <script_path>/openils/lib/javascript</script_path>
<script_path>/openils/var</script_path>
<script_path>/openils/var/catalog</script_path>
<scripts>
@@ -494,6 +496,7 @@
<max_spare_children>5</max_spare_children>
</unix_config>
<app_settings>
+ <script_path>/openils/lib/javascript/</script_path>
<script_path>/openils/var/catalog/</script_path>
<script_path>/openils/var/web/opac/common/js/</script_path>
<scripts>
@@ -519,6 +522,7 @@
<max_spare_children>5</max_spare_children>
</unix_config>
<app_settings>
+ <script_path>/openils/lib/javascript/</script_path>
<script_path>/openils/var/catalog/</script_path>
<scripts>
<biblio_fingerprint>biblio_fingerprint.js</biblio_fingerprint>
Modified: trunk/Open-ILS/src/Makefile
===================================================================
--- trunk/Open-ILS/src/Makefile 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/Makefile 2007-10-18 17:24:00 UTC (rev 7894)
@@ -70,6 +70,7 @@
mkdir -p $(WEBDIR)
mkdir -p $(WEBDIR)/opac/extras/xsl/
cp -r ../web/* $(WEBDIR)
+ cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
Modified: trunk/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -2,6 +2,7 @@
load_lib('fmall.js');
load_lib('fmgen.js');
load_lib('record_type.js');
+load_lib('JSON_v1.js');
var marcdoc = new XML(environment.marc);
var marc_ns = new Namespace('http://www.loc.gov/MARC21/slim');
Modified: trunk/Open-ILS/src/javascript/backend/catalog/biblio_fingerprint.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/catalog/biblio_fingerprint.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/catalog/biblio_fingerprint.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,5 +1,6 @@
// so we can tell if it's a book or other type
load_lib('record_type.js');
+load_lib('JSON_v1.js');
environment.result = {};
Modified: trunk/Open-ILS/src/javascript/backend/catalog/record_type.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/catalog/record_type.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/catalog/record_type.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,6 +1,7 @@
// Constants ...
load_lib('phys_char.js');
load_lib('fixed_fields.js');
+load_lib('JSON_v1.js');
function recordType (rec) {
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_duration.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_duration.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_duration.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,6 +1,7 @@
function go(){
load_lib('circ/circ_item_config.js');
+load_lib('JSON_v1.js');
log_vars('circ_duration');
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_item_config.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_item_config.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_item_config.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,4 +1,5 @@
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_debug('loading circ_item_config.js ...');
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_lib.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,5 +1,6 @@
load_lib('catalog/record_type.js');
load_lib('circ/circ_groups.js');
+load_lib('JSON_v1.js');
try {
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_permit_copy.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_permit_copy.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_permit_copy.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -2,6 +2,7 @@
/* load the lib script */
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_vars('circ_permit_copy');
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_permit_hold.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,6 +1,7 @@
function go() {
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_vars('circ_permit_hold');
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -2,6 +2,7 @@
/* load the script library */
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_vars('circ_permit_patron');
Modified: trunk/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/circ/circ_permit_renew.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -2,6 +2,7 @@
/* load the lib script */
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_vars('circ_permit_renew');
} go();
Deleted: trunk/Open-ILS/src/javascript/backend/libs/JSON.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/libs/JSON.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/libs/JSON.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,136 +0,0 @@
-// in case we run on an implimentation that doesn't have "undefined";
-var undefined;
-
-function Cast (obj, class_constructor) {
- try {
- if (eval(class_constructor + '["_isfieldmapper"]')) {
- obj = eval("new " + class_constructor + "(obj)");
- }
- } catch( E ) {
- alert( E + "\n");
- } finally {
- return obj;
- }
-}
-
-function JSON2js (json) {
-
- json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast(');
- json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")');
-
- var obj;
- if (json != '') {
- try {
- eval( 'obj = ' + json );
- } catch(E) {
- debug("Error building JSON object with string " + E + "\nString:\n" + json );
- return null;
- }
- }
- return obj;
-}
-
-
-function object2Array(obj) {
- if( obj == null ) return null;
-
- var arr = new Array();
- for( var i = 0; i < obj.length; i++ ) {
- arr[i] = obj[i];
- }
- return arr;
-}
-
-
-function js2JSON(arg) {
- return _js2JSON(arg);
-}
-
-function _js2JSON(arg) {
- var i, o, u, v;
-
- switch (typeof arg) {
- case 'object':
-
- if(arg) {
-
- if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
-
- if( arg.a.constructor != Array ) {
- var arr = new Array();
- for( var i = 0; i < arg.a.length; i++ ) {
- if( arg.a[i] == null ) {
- arr[i] = null; continue;
- }
-
- if( typeof arg.a[i] != 'object' ) {
- arr[i] = arg.a[i];
-
- } else if( typeof arg.a[i] == 'object'
- && arg.a[i]._isfieldmapper) {
-
- arr[i] = arg.a[i];
-
- } else {
- arr[i] = object2Array(arg.a[i]);
- }
- }
- arg.a = arr;
- }
-
- return "/*--S " + arg.classname + " --*/" + js2JSON(arg.a) + "/*--E " + arg.classname + " --*/";
-
- } else {
-
- if (arg.constructor == Array) {
- o = '';
- for (i = 0; i < arg.length; ++i) {
- v = js2JSON(arg[i]);
- if (o) {
- o += ',';
- }
- if (v !== u) {
- o += v;
- } else {
- o += 'null';
- }
- }
- return '[' + o + ']';
-
- } else if (typeof arg.toString != 'undefined') {
- o = '';
- for (i in arg) {
- v = js2JSON(arg[i]);
- if (v !== u) {
- if (o) {
- o += ',';
- }
- o += js2JSON(i) + ':' + v;
- }
- }
-
- o = '{' + o + '}';
- return o;
-
- } else {
- return;
- }
- }
- }
- return 'null';
-
- case 'unknown':
- case 'number':
- if( isNaN(arg) ) throw "JSON.js encountered NaN in js2JSON()";
- return arg;
-
- case 'undefined':
- case 'function':
- return u;
-
- case 'string':
- default:
- return '"' + String(arg).replace(/(["\\])/g, '\\$1') + '"';
- }
-
-}
Modified: trunk/Open-ILS/src/javascript/backend/libs/jsonopensrfrequest.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/libs/jsonopensrfrequest.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/libs/jsonopensrfrequest.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,6 +1,6 @@
try {
load_lib('jsOO.js');
- load_lib('JSON.js');
+ load_lib('JSON_v1.js');
} catch (e) {}
var __jsonopensrfreqid = 1;
Modified: trunk/Open-ILS/src/javascript/backend/penalty/patron_penalty.js
===================================================================
--- trunk/Open-ILS/src/javascript/backend/penalty/patron_penalty.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/javascript/backend/penalty/patron_penalty.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -2,6 +2,7 @@
/* load the lib script */
load_lib('circ/circ_lib.js');
+load_lib('JSON_v1.js');
log_vars('patron_penalty');
var config = findGroupConfig(patronProfile);
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/ScriptRunner.pm 2007-10-18 17:24:00 UTC (rev 7894)
@@ -7,10 +7,8 @@
use LWP::UserAgent;
use XML::LibXML;
use Time::HiRes qw/time/;
-use vars qw/%_paths $__json_js/;
+use vars qw/%_paths/;
-{ local $/ = undef; $__json_js = <DATA>; }
-
sub DESTROY {
my $self = shift;
$logger->info("script_runner: destroying self: $self");
@@ -176,7 +174,7 @@
if ($_real) {
$self->insert('__' => {'OILS_RESULT' => ''});
- $js->eval($__json_js."__.OILS_RESULT = js2JSON(environment.result);");
+ $js->eval("__.OILS_RESULT = js2JSON(environment.result);");
$res = $self->retrieve('__.OILS_RESULT');
}
}
@@ -599,143 +597,3 @@
1;
-
-__DATA__
-
-// in case we run on an implimentation that doesn't have "undefined";
-var undefined;
-
-function Cast (obj, class_constructor) {
- try {
- if (eval(class_constructor + '["_isfieldmapper"]')) {
- obj = eval("new " + class_constructor + "(obj)");
- }
- } catch( E ) {
- alert( E + "\n");
- } finally {
- return obj;
- }
-}
-
-function JSON2js (json) {
-
- json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast(');
- json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")');
-
- var obj;
- if (json != '') {
- try {
- eval( 'obj = ' + json );
- } catch(E) {
- debug("Error building JSON object with string " + E + "\nString:\n" + json );
- return null;
- }
- }
- return obj;
-}
-
-
-function object2Array(obj) {
- if( obj == null ) return null;
-
- var arr = new Array();
- for( var i = 0; i < obj.length; i++ ) {
- arr[i] = obj[i];
- }
- return arr;
-}
-
-
-function js2JSON(arg) {
- return _js2JSON(arg);
-}
-
-function _js2JSON(arg) {
- var i, o, u, v;
-
- switch (typeof arg) {
- case 'object':
-
- if(arg) {
-
- if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
-
- if( arg.a.constructor != Array ) {
- var arr = new Array();
- for( var i = 0; i < arg.a.length; i++ ) {
- if( arg.a[i] == null ) {
- arr[i] = null; continue;
- }
-
- if( typeof arg.a[i] != 'object' ) {
- arr[i] = arg.a[i];
-
- } else if( typeof arg.a[i] == 'object'
- && arg.a[i]._isfieldmapper) {
-
- arr[i] = arg.a[i];
-
- } else {
- arr[i] = object2Array(arg.a[i]);
- }
- }
- arg.a = arr;
- }
-
- return "/*--S " + arg.classname + " --*/" + js2JSON(arg.a) + "/*--E " + arg.classname + " --*/";
-
- } else {
-
- if (arg.constructor == Array) {
- o = '';
- for (i = 0; i < arg.length; ++i) {
- v = js2JSON(arg[i]);
- if (o) {
- o += ',';
- }
- if (v !== u) {
- o += v;
- } else {
- o += 'null';
- }
- }
- return '[' + o + ']';
-
- } else if (typeof arg.toString != 'undefined') {
- o = '';
- for (i in arg) {
- v = js2JSON(arg[i]);
- if (v !== u) {
- if (o) {
- o += ',';
- }
- o += js2JSON(i) + ':' + v;
- }
- }
-
- o = '{' + o + '}';
- return o;
-
- } else {
- return;
- }
- }
- }
- return 'null';
-
- case 'unknown':
- case 'number':
- if( isNaN(arg) ) throw "JSON.js encountered NaN in js2JSON()";
- return arg;
-
- case 'undefined':
- case 'function':
- return u;
-
- case 'string':
- default:
- return '"' + String(arg).replace(/(["\\])/g, '\\$1') + '"';
- }
-
-}
-
Modified: trunk/Open-ILS/src/reporter/templates/header.ttk
===================================================================
--- trunk/Open-ILS/src/reporter/templates/header.ttk 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/src/reporter/templates/header.ttk 2007-10-18 17:24:00 UTC (rev 7894)
@@ -7,7 +7,7 @@
<script language='javascript' src='/opac/common/js/config.js'> </script>
<script language='javascript' src='/opac/common/js/utils.js'> </script>
<script language='javascript' src='/opac/common/js/opac_utils.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/RemoteRequest.js'> </script>
<script language="javascript" src="/opac/common/js/slimtree.js"></script>
<script language="javascript">
Deleted: trunk/Open-ILS/web/opac/common/js/JSON.js
===================================================================
--- trunk/Open-ILS/web/opac/common/js/JSON.js 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/web/opac/common/js/JSON.js 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,140 +0,0 @@
-// in case we run on an implimentation that doesn't have "undefined";
-var undefined;
-
-function Cast (obj, class_constructor) {
- try {
- if (eval(class_constructor + '["_isfieldmapper"]')) {
- obj = eval("new " + class_constructor + "(obj)");
- }
- } catch( E ) {
- alert( E + "\n");
- } finally {
- return obj;
- }
-}
-
-function JSON2js (json) {
-
- json = String(json).replace( /\/\*--\s*S\w*?\s*?\s+\w+\s*--\*\//g, 'Cast(');
- json = String(json).replace( /\/\*--\s*E\w*?\s*?\s+(\w+)\s*--\*\//g, ', "$1")');
-
- var obj;
- if (json != '') {
- try {
- eval( 'obj = ' + json );
- } catch(E) {
- alert("* Fix Me *\nError parsing JSON [" + E + "]\n\n" + json );
- return null;
- }
- }
- return obj;
-}
-
-
-function object2Array(obj) {
- if( obj == null ) return null;
- var arr = new Array();
- for( var i = 0; i < obj.length; i++ )
- arr[i] = obj[i];
- return arr;
-}
-
-
-function js2JSON(arg) {
- return _js2JSON(arg);
-}
-
-function _js2JSON(arg) {
- var i, o, u, v;
-
- switch (typeof arg) {
- case 'object':
-
- if(arg) {
-
- if (arg._isfieldmapper) { /* magi-c-ast for fieldmapper objects */
-
- if( arg.a.constructor != Array ) {
- var arr = new Array();
- for( var i = 0; i < arg.a.length; i++ ) {
- if( arg.a[i] == null ) {
- arr[i] = null; continue;
- }
-
- if( typeof arg.a[i] != 'object' ) {
- arr[i] = arg.a[i];
-
- } else if( typeof arg.a[i] == 'object'
- && arg.a[i]._isfieldmapper) {
-
- arr[i] = arg.a[i];
-
- } else {
- arr[i] = object2Array(arg.a[i]);
- }
- }
- arg.a = arr;
- }
-
- return "/*--S " + arg.classname + " --*/" + js2JSON(arg.a) + "/*--E " + arg.classname + " --*/";
-
- } else {
-
- if (arg.constructor == Array) {
- o = '';
- for (i = 0; i < arg.length; ++i) {
- v = js2JSON(arg[i]);
- if (o) {
- o += ',';
- }
- if (v !== u) {
- o += v;
- } else {
- o += 'null';
- }
- }
- return '[' + o + ']';
-
- } else if (typeof arg.toString != 'undefined') {
- o = '';
- for (i in arg) {
- v = js2JSON(arg[i]);
- if (v !== u) {
- if (o) {
- o += ',';
- }
- o += js2JSON(i) + ':' + v;
- }
- }
-
- o = '{' + o + '}';
- return o;
-
- } else {
- return;
- }
- }
- }
- return 'null';
-
- case 'unknown':
- case 'number':
- if( isNaN(arg) ) throw "JSON.js encountered NaN in js2JSON()";
- return arg;
-
- case 'undefined':
- case 'function':
- return u;
-
- case 'string':
- default:
- var s = String(arg);
- s = s.replace(/\\/g, '\\\\');
- s = s.replace(/"/g, '\\"');
- s = s.replace(/\t/g, "\\t");
- s = s.replace(/\n/g, "\\n");
- s = s.replace(/\r/g, "\\r");
- s = s.replace(/\f/g, "\\f");
- return '"' + s + '"';
- }
-}
Modified: trunk/Open-ILS/xul/staff_client/Makefile
===================================================================
--- trunk/Open-ILS/xul/staff_client/Makefile 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/Makefile 2007-10-18 17:24:00 UTC (rev 7894)
@@ -1,6 +1,7 @@
# ILS/Open-ILS/xul/staff_client/Makefile
export STAFF_CLIENT_BUILD_ID = $$(/bin/cat build/BUILD_ID)
+export OPENSRF_JSLIBS = $(OPENSRF_LIBS)/javascript
all: build
@echo
@@ -59,6 +60,7 @@
@echo '********************************************************* Grabbing more OPAC code and legacy code and custom code'
#cp ../../../OpenSRF/src/javascript/*.js build/chrome/content/OpenSRF/
cp ../../../Open-ILS/web/opac/common/js/*.js build/chrome/content/OpenILS/util/
+ cp $(OPENSRF_JSLIBS)/*.js build/chrome/content/OpenILS/util/
#cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/marc* build/chrome/content/legacy/
#cp ../../../Evergreen/staff_client/chrome/content/evergreen/cat/browse* build/chrome/content/legacy/
#cp ../../../Evergreen/staff_client/chrome/locale/en-US/evergreen/cat.dtd build/chrome/locale/en-US/
Modified: trunk/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul 2007-10-18 17:24:00 UTC (rev 7894)
@@ -11,7 +11,7 @@
<script type="text/javascript" src="/opac/common/js/utils.js" />
<script type="text/javascript" src="/opac/common/js/CGI.js" />
<script type="text/javascript" src="/opac/common/js/md5.js" />
- <script type="text/javascript" src="/opac/common/js/JSON.js" />
+ <script type="text/javascript" src="/opac/common/js/JSON_v1.js" />
<script type="text/javascript" src="/opac/common/js/fmall.js" />
<script type="text/javascript" src="/opac/common/js/fmgen.js" />
<script type="text/javascript" src="/opac/common/js/RemoteRequest.js" />
Modified: trunk/Open-ILS/xul/staff_client/server/admin/cash_reports.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/cash_reports.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/cash_reports.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/closed_dates.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/copy_locations.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -16,7 +16,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list_classic.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list_classic.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/hold_pull_list_classic.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -16,7 +16,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/org_settings.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/printer_settings.html
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/printer_settings.html 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/printer_settings.html 2007-10-18 17:24:00 UTC (rev 7894)
@@ -3,7 +3,7 @@
<script type="text/javascript" src="/opac/common/js/utils.js"></script>
<script type="text/javascript" src="/opac/common/js/CGI.js"></script>
<script type="text/javascript" src="/opac/common/js/md5.js"></script>
- <script type="text/javascript" src="/opac/common/js/JSON.js"></script>
+ <script type="text/javascript" src="/opac/common/js/JSON_v1.js"></script>
<script type="text/javascript" src="/opac/common/js/fmall.js"></script>
<script type="text/javascript" src="/opac/common/js/fmgen.js"></script>
<script type="text/javascript" src="/opac/common/js/RemoteRequest.js"></script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -8,7 +8,7 @@
<script language='javascript' src='/opac/common/js/CGI.js'> </script>
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/admin/upload_xacts.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -19,7 +19,7 @@
<script type="text/javascript" src="/opac/common/js/utils.js" />
<script type="text/javascript" src="/opac/common/js/CGI.js" />
<script type="text/javascript" src="/opac/common/js/md5.js" />
- <script type="text/javascript" src="/opac/common/js/JSON.js" />
+ <script type="text/javascript" src="/opac/common/js/JSON_v1.js" />
<script type="text/javascript" src="/opac/common/js/fmall.js" />
<script type="text/javascript" src="/opac/common/js/fmgen.js" />
<script type="text/javascript" src="/opac/common/js/RemoteRequest.js" />
Modified: trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/patron/ue.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -17,7 +17,7 @@
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
<script language='javascript' src='/opac/common/js/slimtree.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/patron/user_edit.xml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/user_edit.xml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/patron/user_edit.xml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -9,7 +9,7 @@
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
<script language='javascript' src='/opac/common/js/slimtree.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/opac_utils.js'> </script>
Modified: trunk/Open-ILS/xul/staff_client/server/patron/user_editor.xhtml
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/user_editor.xhtml 2007-10-18 16:00:35 UTC (rev 7893)
+++ trunk/Open-ILS/xul/staff_client/server/patron/user_editor.xhtml 2007-10-18 17:24:00 UTC (rev 7894)
@@ -17,7 +17,7 @@
<script language='javascript' src='/opac/common/js/Cookie.js'> </script>
<script language='javascript' src='/opac/common/js/slimtree.js'> </script>
- <script language='javascript' src='/opac/common/js/JSON.js'> </script>
+ <script language='javascript' src='/opac/common/js/JSON_v1.js'> </script>
<script language='javascript' src='/opac/common/js/fmall.js'> </script>
<script language='javascript' src='/opac/common/js/fmgen.js'> </script>
<script language='javascript' src='/opac/common/js/Cookies.js'> </script>
More information about the open-ils-commits
mailing list