dojo.addOnLoad => window.addEventListener
authorJane Sandberg <js7389@princeton.edu>
Sat, 11 Mar 2023 23:44:07 +0000 (15:44 -0800)
committerJane Sandberg <js7389@princeton.edu>
Sat, 11 Mar 2023 23:45:39 +0000 (15:45 -0800)
Open-ILS/src/templates-bootstrap/opac/parts/acjs.tt2
Open-ILS/src/templates-bootstrap/opac/parts/ebook_api/base_js.tt2
Open-ILS/src/templates-bootstrap/opac/parts/ebook_api/login_js.tt2
Open-ILS/src/templates-bootstrap/opac/parts/js.tt2
Open-ILS/src/templates/header.tt2
Open-ILS/src/templates/opac/parts/ebook_api/login_js.tt2
Open-ILS/web/js/ui/default/opac/ebook_api/loggedin.js

index fa76861..3d548d8 100755 (executable)
@@ -17,7 +17,7 @@
         FOR type IN ctx.added_content.keys;
             IF ctx.added_content.$type.status == '3' # status unknown %]
 
-                dojo.addOnLoad(function() {
+                window.addEventListener("load", () => {
                     var bre_id = '[% ctx.bre_id %]';
                     var type = '[% type %]';
 
index 4cd2f6e..9d30478 100755 (executable)
@@ -72,7 +72,7 @@ myopac_page = "[% myopac_page %]";
 [% END %]
 
 // enforce removal of ebook API cookies on logout
-dojo.addOnLoad(function() {
+window.addEventListener("load", () => {
     var logout_handle = dojo.connect(dojo.byId('#logout_link'), 'onclick', function() {
         dojo.forEach(cookie_registry, function(cookie) {
             dojo.cookie(cookie, '', {path: '/', expires: '-1h'});
index 7bb12bd..bde4e0f 100755 (executable)
@@ -8,7 +8,7 @@ var vendors_requiring_password = [];
 vendors_requiring_password.push('overdrive');
 [% END %]
 
-dojo.addOnLoad(function() {
+window.addEventListener("load", () => {
     var handle = dojo.connect(dojo.byId('#login-form-box'), 'onclick', function(evt) {
         // disconnect this event since it's one-time-only
         // (when we switch to jQuery, we can use .one() here)
index 74e5ff8..53dbd0c 100755 (executable)
     dojo.require("openils.widget.AutoSuggest");
 
     /* Set focus, and place the cursor at the end of the input string */
-    dojo.addOnLoad(function() {
+    window.addEventListener("load", () => {
         /* Don't error out if the object doesn't exist, like on advanced search pages */
         if (dojo.byId('search_box')) {
             dijit.byId('search_box').focus();
index eb308f7..2a78c39 100644 (file)
@@ -1,11 +1,3 @@
 <div id='oils-base-header-content-div'>
     <span id='oils-base-header-user-info'> </span>
-    <script type="text/javascript">
-        /*
-        dojo.addOnLoad(function(){
-            dojo.byId('oils-base-header-user-info').appendChild(
-                document.createTextNode(openils.User.user.usrname()));
-        });
-        */
-    </script>
 </div>
index 23ed256..379db8b 100644 (file)
@@ -8,7 +8,7 @@ var vendors_requiring_password = [];
 vendors_requiring_password.push('overdrive');
 [% END %]
 
-dojo.addOnLoad(function() {
+window.addEventListener("load", () => {
     var handle = dojo.connect(dojo.byId('#login-form-box'), 'onclick', function(evt) {
         // disconnect this event since it's one-time-only
         // (when we switch to jQuery, we can use .one() here)
index 9b7323a..a46ec87 100644 (file)
@@ -28,7 +28,7 @@ if (typeof ebook_action.title_id !== 'undefined') {
     active_ebook = new Ebook(ebook_action.vendor, ebook_action.title_id);
 }
 
-dojo.addOnLoad(function() {
+window.addEventListener("load", () => {
 
     dojo.forEach(vendor_list, function(v) {
         var rel = new Relation(v, patron_id);