1/** 2* jQuery.noticeAdd() and jQuery.noticeRemove() 3* These functions create and remove growl-like notices 4* 5* Copyright (c) 2009 Tim Benniks 6* 7* Permission is hereby granted, free of charge, to any person obtaining a copy 8* of this software and associated documentation files (the "Software"), to deal 9* in the Software without restriction, including without limitation the rights 10* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11* copies of the Software, and to permit persons to whom the Software is 12* furnished to do so, subject to the following conditions: 13* 14* The above copyright notice and this permission notice shall be included in 15* all copies or substantial portions of the Software. 16* 17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23* THE SOFTWARE. 24* 25* @author Tim Benniks <[email protected]> 26* @copyright 2009 timbenniks.com 27* @version $Id: jquery.notice.js 1 2009-01-24 12:24:18Z timbenniks $ 28**/ 29(function(jQuery) 30{ 31 jQuery.extend({ 32 noticeAdd: function(options) 33 { 34 var defaults = { 35 inEffect: {opacity: 'show'}, // in effect 36 inEffectDuration: 600, // in effect duration in miliseconds 37 stayTime: 3000, // time in miliseconds before the item has to disappear 38 text: '', // content of the item 39 stay: false, // should the notice item stay or not? 40 type: 'notice' // could also be error, succes 41 } 42 43 // declare varaibles 44 var options, noticeWrapAll, noticeItemOuter, noticeItemInner, noticeItemClose; 45 46 options = jQuery.extend({}, defaults, options); 47 noticeWrapAll = (!jQuery('.notice-wrap').length) ? jQuery('<div></div>').addClass('notice-wrap').appendTo('body') : jQuery('.notice-wrap'); 48 noticeItemOuter = jQuery('<div></div>').addClass('notice-item-wrapper'); 49 noticeItemInner = jQuery('<div></div>').hide().addClass('notice-item ' + options.type).appendTo(noticeWrapAll).html('<p>'+options.text+'</p>').animate(options.inEffect, options.inEffectDuration).wrap(noticeItemOuter); 50 noticeItemClose = jQuery('<div></div>').addClass('notice-item-close').prependTo(noticeItemInner).html('x').click(function() { jQuery.noticeRemove(noticeItemInner) }); 51 52 // hmmmz, zucht 53 if(navigator.userAgent.match(/MSIE 6/i)) 54 { 55 noticeWrapAll.css({top: document.documentElement.scrollTop}); 56 } 57 58 if(!options.stay) 59 { 60 setTimeout(function() 61 { 62 jQuery.noticeRemove(noticeItemInner); 63 }, 64 options.stayTime); 65 } 66 }, 67 68 noticeRemove: function(obj) 69 { 70 obj.animate({opacity: '0'}, 600, function() 71 { 72 obj.parent().animate({height: '0px'}, 300, function() 73 { 74 obj.parent().remove(); 75 }); 76 }); 77 } 78 }); 79})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.