Need Jquery library URL whitelisted for a widget

Hi there, I'm adding a widget for LibCal to our OpenScholar site and need https://code.jquery.com/jquery-2.2.4.... whitelisted to use when I add in a media widget. It's for a button that creates a pop-up to book a space. The button won't function unless I have this jQuery library added (see https://urc.library.harvard.edu/libca...). Thanks!
1 person has
this problem
+1
Reply
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Bilsi,

    It looks like it's not working unless I include the JQuery library with it. Here's the HTML without the jQuery library:


    <script src="https://api3.libcal.com/js/equipment.min.js"></script>
    <script>
    jQuery(function(){
    jQuery("#eq_4597").LibCalEquipmentBooking({iid: 4167, gid: 4597, eid: 0, width: 560, height: 680});
    });
    </script>
    <!-- Place the following link anywhere in your page. Make sure the id "eq_4597" matches with the above code: jQuery("#eq_4597") //-->
    <button id="eq_4597" href="#">Book A Space</button>
    <!-- Below is optional button styling //-->
    <style>
    #eq_4597 {
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 4px;
    color: #333333;
    font: 14px Arial, Helvetica, Verdana;
    padding: 8px 20px;
    cursor: pointer;
    }
    #eq_4597:hover {
    opacity: 0.9;
    }
    </style>


    and here it is with it included:

    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script src="https://api3.libcal.com/js/equipment.min.js"></script>
    <script>
    jQuery(function(){
    jQuery("#eq_4597").LibCalEquipmentBooking({iid: 4167, gid: 4597, eid: 0, width: 560, height: 680});
    });
    </script>
    <!-- Place the following link anywhere in your page. Make sure the id "eq_4597" matches with the above code: jQuery("#eq_4597") //-->
    <button id="eq_4597" href="#">Book A Space</button>
    <!-- Below is optional button styling //-->
    <style>
    #eq_4597 {
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 4px;
    color: #333333;
    font: 14px Arial, Helvetica, Verdana;
    padding: 8px 20px;
    cursor: pointer;
    }
    #eq_4597:hover {
    opacity: 0.9;
    }
    </style>


    When I try to embed with button without the jQuery library script included (https://code.jquery.com/jquery-2.2.4....) it doesn't seem to work. I click the button and nothing happens on https://urc.library.harvard.edu/libca.... I can't save the widget with the jQuery library script included since jquery.com isn't whitelisted.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Does LibCal have to use a newer version of jQuery? It looks like when one is logged in to an OpenScholar site, jQuery v1.6.4 is loaded from Cloudfront.

    On one of my sites, I have an embed media widget loading an older version of jQuery from Cloudflare (because the module is also hosted there). It's likely that newer versions of jQuery are also available at that location.
    https://cdnjs.cloudflare.com/ajax/lib...
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • @Curtis Yes, it looks like it needs 2.2.4 for this particular widget. The latest version is 3.2.1 - does OpenScholar need to update this?

    If anything, whitelisting code.jquery.com would help in this instance so I can use it in the embed for the button. It won't let me save the widget when that URL is used in the script portion of the code.
    • view 2 more comments
    • So a copy referenced elsewhere is taking precedence over what Danielle is linking to?

      Does that mean it only fails because Danielle is logged in as an admin? It seems like jQuery isn't loaded when others visit, at least not everywhere (maybe it's used for certain apps or widgets).
    • Bilsi, I just tried making a new Embed Media widget using the code Danielle provided above. When I include the script element pointing to https://code.jquery.com/jquery-2.2.4...., it won't save and I get an error message "The following errors occured when attempting to save this file. This embed code failed validation. Please check that all urls are with https and from accepted domains." If I remove the link, it saves.

      So it seems code.jquery.com is not whitelisted. Additionally, when I tried using the same version hosted elsewhere, https://cdnjs.cloudflare.com/ajax/lib..., I got the same error message even though cdnjs.cloudflare.com is already a domain I use on one of my sites.

      Maybe the domain name whitelisting needs to be be reviewed to confirm that sub-domains are included
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi there, Harvard Library has approved LibCal for library-wide usage. Other libraries will likely want to use this widget button to book spaces on their OpenScholar sites. Any updates on this? I'd like to add this to our site to replace our old Google Form for booking the lab.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • This reply was removed on 2018-01-16.
    see the change log
  • Joe (Official Rep) January 16, 2018 19:44
    I think this has to do with where the JQuery library is loaded in the HTML page markup.



    You can see here that the jQuery library loads after the Branding Footer. Embed media widgets are going to run before this and thus JQuery calls will fail.
    • view 1 more comment
    • Hey Curtis, yes we do use the linked option, however, the widget form has better accessibility for screen readers, and some libraries are interested in offering the booking option directly from their website. We'd really like to use the widget on our OpenScholar site if we can.
    • This is off-topic but regarding using tools for the scheduling of spaces, I think serious thought should be given before choosing something other than what the University already provides, EMS (aka RoomBook in FAS and some other Schools). It might make sense to use something else for the URC Lab but more general purpose rooms like study spaces, maybe not. Then the more there is in EMS, the more it makes sense to schedule other rooms there.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Danielle

    Would you mind please opening a tic with ithelp@harvard.edu. I think this issue is better handled through that channel.

    Best
    Dan
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated