Files
unison/doc/ns3_html_theme/static/drop-down-menu.js
Peter D. Barnes, Jr 6e5f36a795 doc: (fixes #469) Add license to file.
This is based on the following email exchange with the author of this
file:

From: Konstantin Yagola info@spicebrains.com
Subject: Re: License for Simple Javascript Drop-Down Menu v2.0
Date: November 6, 2021 at 12:50 PM
To: Barnes, Peter D. barnes26@llnl.gov
Hi Peter,

> Please let me know if this is acceptable.

acceptable.

-K.

On 05.11.2021 23:38, Barnes, Peter D. wrote:
> Hello Konstantin,
>
> I apologize but I have led you astray.  Apparently the license I suggested
> is not appropriate for source code.  An appropriate software license would
> be the “modified BSD (3 clause) license”, which is here:
> https://directory.fsf.org/wiki/License:BSD-3-Clause
>
> Please let me know if this is acceptable.
>
> Thanks again for your help in resolving this.
> Peter
>
> On Oct 13, 2021, at 9:15 AM, Konstantin Yagola <info@spicebrains.com> wrote:
>>
>> Hello Barnes,
>>
>> You are right, I'm not familiar with licensing )
>> This is old not complicated script, so you may maintain it based on fair use.
>> If you think "CC BY-SA 4.0” suits best - then ok.
>>
>> -Kind regards,
>> -K Y.
>>
>> On 12.10.2021 1:55, Barnes, Peter D. wrote:
>>> Hello Folks,
>>>
>>> I am one of the maintainers for the ns-3 Simulator project:
>>> https://www.nsnam.org
>>>
>>> It has come to my attention that we are using your Simple Javascript
>>> Drop-Down Menu v2.0, but the use license is not clear.
>>>
>>> Our use is here:
>>> https://gitlab.com/nsnam/ns-3-dev/-/blob/master/doc/ns3_html_theme/static/drop-down-menu.js
>>>
>>> As requested on your page, we have given attribution to your page.
>>> However, since the javascript is copyrighted, there should be a
>>> statement of licensing terms, or reference to a standard license.
>>>
>>> Could you please advise us of the license terms?  If you are not familiar
>>>  with licensing, perhaps you would consider one of the well-known Creative
>>> Commons licenses?  They have a short form which can help you pick one
>>> to meet your needs:
>>> https://chooser-beta.creativecommons.org
>>>
>>> Given  your encouraging statement
>>>
>>>> That's it! All you have to do now is add some hover styles and make it
>>>> your own. Enjoy!
>>>> If you want to use this script on your page, please place link to
>>>> http://javascript-array.com at one of your pages.
>>>
>>> might I suggest "CC BY-SA 4.0”.
>>>
>>> Please let me know if that is acceptable, or if you choose another license,
>>> and I will update our file to reflect that.
>>>
>>> Thanks,
>>> Peter
2021-11-11 18:03:46 +00:00

75 lines
2.3 KiB
JavaScript

// Copyright 2006-2007 javascript-array.com
// http://javascript-array.com/scripts/simple_drop_down_menu/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// (1) Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// the documentation and/or other materials provided with the
// distribution.
//
// (3) The name of the author may not be used to
// endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
var timeout = 250;
var closetimer = 0;
var ddmenuitem = 0;
// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();
// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';
}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}
// close layer when click-out
document.onclick = mclose;