I recommend adding a link to a custom javascript file here.

https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-
xmlui-mirage2/src/main/webapp/xsl/core/page-structure.xsl#L130

Mirage2 compiles all of the javascript into a single file for efficiency.
Since my custom javascript is small, I load it as a page on its own.

Your javascript could use a cookie to display the message only once, or it
could detect when it is on the home page and display it on that page.

Mirage2 should already have jQuery loaded although the "$" variable may not
be active.

The following code could detect if you are on the home page.

jQuery(document).ready(function(){
>     if
> (jQuery("#aspect_artifactbrowser_CommunityBrowser_div_comunity-browser").length
> > 0) {
>         //do something
>     }
> });

On Wed, Nov 22, 2017 at 10:30 AM, Tom Avino <[email protected]> wrote:

> Terry,
> It doesn't matter if I do this in Javascript or xsl.  I am not sure where
> to put the javascript code.
> I can put in the code I sent, and it works, but I only need it to show up
> the first time, and only once.  When I put it in the page-structure.xsl, it
> shows up on every page. I guess I am looking for a "Startup" type page
> where some initialization and housekeeping is done.
>
> I am new to xsl, and it gives me a headache.  I am an old school assembler
> language, cobol, html, and SQL developer and can't seem to wrap my head
> around xsl.
>
> I appreciate you help
>
> On Wednesday, November 22, 2017 at 12:15:03 PM UTC-5, Terry Brady wrote:
>>
>> If you want to resolve the issue in XSL (vs JavaScript), I recommend that
>> you override this template and place your alert in a similar location.
>>
>> https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace-xmlu
>> i-mirage2/src/main/webapp/xsl/core/page-structure.xsl#L759-L762
>>
>> On Wed, Nov 22, 2017 at 8:51 AM, Tom Avino <[email protected]> wrote:
>>
>>> We are running Dspace 5.5 XMLUI using Mirage 2 UI.
>>> It is a gov't requirement that we display a screen that the user must
>>> accept before allowing them access to the homepage.
>>>
>>> Thanks
>>>
>>> On Wednesday, November 22, 2017 at 10:58:31 AM UTC-5, Terry Brady wrote:
>>>>
>>>> Since this message does not display any repository content, I would
>>>> recommend that you add it to the page with javaScript/jQuery.
>>>>
>>>> You could also add it in through the UI code.  Which Version/UI/theme
>>>> are you running?
>>>>
>>>> For inspiration of where to add the message, you could activate a
>>>> system alert from the system control panel and place your content in a
>>>> similar div.
>>>>
>>>> Terry
>>>>
>>>> On Wed, Nov 22, 2017 at 6:49 AM, Tom Avino <[email protected]> wrote:
>>>>
>>>>> I am trying to insert a "Warning Box" to display an acknowledgment
>>>>> screen at the startup of Dspace.  I am struggling where to place the
>>>>> code....
>>>>>
>>>>> <div id="warning-box" style="position: fixed;top: 0;right: 0;bottom:
>>>>> 0;left: 0;background: rgba(0,0,0,0.5);z-index: 99;">
>>>>>             <div style="margin:1% auto;width:50em;background-color:
>>>>> #FFCC66;border: 1px solid #DBB05A;padding-bottom: 0%;padding-left:
>>>>> 2%;padding-right: 2%;padding-top: 1%;">
>>>>>                 <p>
>>>>>                     <strong>By accessing and using this information
>>>>> system, you acknowledge and consent to the following:</strong><br>
>>>>>                     You are accessing a U.S. Government information
>>>>> system, which includes: (1) this computer; (2) this computer network; (3)
>>>>> all computers connected to this network including end user systems; (4) 
>>>>> all
>>>>> devices and storage media attached to this network or to any computer on
>>>>> this network; and (5) cloud and remote information services. This
>>>>> information system is provided for U.S. Government-authorized use only. 
>>>>> You
>>>>> have no reasonable expectation of privacy regarding any communication
>>>>> transmitted through or data stored on this information system.  At any
>>>>> time, and for any lawful purpose, the U.S. Government may monitor,
>>>>> intercept, search, and seize any communication or data transiting, stored
>>>>> on, or traveling to or from this information system.  You are NOT
>>>>> authorized to process classified information on this information system.
>>>>> Unauthorized or improper use of this system may result in suspension or
>>>>> loss of access privileges, disciplinary action, and civil and/or criminal
>>>>> penalties.
>>>>>                 </br></p>
>>>>>                 <p style="text-align:center;">
>>>>>                     <button onclick="document.getElementBy
>>>>> Id('warning-box').style='display:none;';">OK</button>
>>>>>                 </p>
>>>>>             </div>
>>>>>         </div>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Tom
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "DSpace Technical Support" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at https://groups.google.com/group/dspace-tech.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Terry Brady
>>>> Applications Programmer Analyst
>>>> Georgetown University Library Information Technology
>>>> https://github.com/terrywbrady/info
>>>> 425-298-5498 (Seattle, WA)
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "DSpace Technical Support" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/dspace-tech.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Terry Brady
>> Applications Programmer Analyst
>> Georgetown University Library Information Technology
>> https://github.com/terrywbrady/info
>> 425-298-5498 <(425)%20298-5498> (Seattle, WA)
>>
> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
https://github.com/terrywbrady/info
425-298-5498 <(425)%20298-5498> (Seattle, WA)

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to