Software: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.12 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g. PHP/5.2.4-2ubuntu5.12 uname -a: Linux forum.circlefusion.com 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /home/doku/axrepos/ax/tests/new_ad_spot2/js/ drwxr-xr-x |
Viewing file: jquery.simpleFAQ-0.4.min.js (4.78 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* Copyright (c) 2008 Jordan Kasper * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * Copyright notice and license must remain intact for legal use * * Fore more usage documentation and examples, visit: * http://jkdesign.org/faq/ */ ;(function($){$.fn.simpleFAQ=function(o){var n=this;if(n.length<1){return n;} n.addClass('simpleFAQList');o=(o)?o:{};o=auditOptions($.extend({},$.fn.simpleFAQ.defaults,o));if(o.data!=null){n.html('');for(var i=0,l=o.data.length;i<l;++i){n.append("<"+o.nodeType+" class='simpleFAQ'>"+" <p class='"+o.questionClass+"'>"+o.data[i].question+"</p>"+" <div class='"+o.answerClass+"'>"+ o.data[i].answer+"<p class='"+o.tagClass+"'>"+o.data[i].tags+"</p>"+"</div>"+"</"+o.nodeType+">");}} var faqs=n.find(o.nodeType);faqs.find('.'+o.questionClass).css({cursor:'pointer'}).hover(function(){$(this).addClass('simpleFAQHover');},function(){$(this).removeClass('simpleFAQHover');}).bind('click.simpleFAQ',function(e){var faq=$(this).parent();if(o.showOnlyOne){n.find(o.nodeType).not(faq).find('.'+o.answerClass).slideUp(o.speed,function(){$(this).removeClass('simpleFAQShowing');});} $(this).siblings('.'+o.answerClass).slideToggle(o.speed,function(){if($(this).is(':visible')){faq.find('.'+o.answerClass).addClass('simpleFAQShowing');n.trigger('show.simpleFAQ',[faq[0]]);}else{faq.find('.'+o.answerClass).removeClass('simpleFAQShowing');}});});faqs.find('.'+o.answerClass).hide();if(o.allowSearch){var hideFAQ=function(node){$(node).hide().removeClass('simpleFAQResult').find('.'+o.answerClass).hide().removeClass('simpleFAQShowing');} var iNode=$(o.searchNode);if(iNode.length>0&&typeof $.score=='function'){hideFAQ(n.find(o.nodeType));iNode.append("<input type='text' id='simpleFAQSearch' />").find('#simpleFAQSearch').keyup(function(e){clearTimeout($.fn.simpleFAQ.keyTimeoutHandle);var input=this;if(input.value.length<1){hideFAQ(n.find(o.nodeType));return;} $.fn.simpleFAQ.keyTimeoutHandle=setTimeout(function(){n.trigger('searchStart.simpleFAQ',[]);var scores=[];faqs.each(function(i){var faq=$(this);var tags=faq.find('.'+o.tagClass).text();tags=(o.caseSensitive)?tags:tags.toLowerCase();var text=faq.text();text=(o.caseSensitive)?text:text.toLowerCase();var q=getQuery(input.value,o);var s=0;if(q.length>0){s=$.score(text,q);s+=scoreTags(q,tags);} if(s>o.minSearchScore){scores.push([s,faq]);}else{hideFAQ($(this));}});if(o.sortSearch){scores.sort(function(a,b){return b[0]-a[0];});} var results=[];$.each(scores,function(){n.append(this[1].show().addClass('simpleFAQResult'));results.push(this[1][0]);});n.trigger('sort.simpleFAQ',[results]);n.trigger('searchEnd.simpleFAQ',[results]);},$.fn.simpleFAQ.keyTimeout);});}} var scoreTags=function(input,tags){var s=0;if(tags.length<1){return s;} var w=input.split(' ');for(var i=0,l=w.length;i<l;++i){if(w[i].length<1){continue;} if(tags.indexOf(w[i])>-1){s+=$.fn.simpleFAQ.tagMatchScore;}} return s;} var getQuery=function(t,o){var q='';t=(o.caseSensitive)?t:t.toLowerCase();if(o.ignore.length>0){var w=t.split(' ');for(var i=0;i<w.length;++i){if(w[i].length>0){if(typeof o.ignore.indexOf=='function'){if(o.ignore.indexOf(w[i])<0){q+=w[i]+' ';}}else{var f=false;for(var j=0;j<o.ignore.length;++j){if(o.ignore[j]==w[i]){f=true;break;}} if(!f){q+=w[i]+' ';}}}} if(q.length>0){q=q.substr(0,q.length-1);}}else{q=t;} return q;} return n;};var auditOptions=function(o){if(!o.data||!o.data.length||typeof o.data.splice!='function'){o.data=$.fn.simpleFAQ.defaults.data;} if(typeof(o.nodeType)!='string'){o.nodeType=$.fn.simpleFAQ.defaults.nodeType;} if(typeof(o.questionClass)!='string'){o.questionClass=$.fn.simpleFAQ.defaults.questionClass;} if(typeof(o.answerClass)!='string'){o.answerClass=$.fn.simpleFAQ.defaults.answerClass;} if(typeof(o.tagClass)!='string'){o.tagClass=$.fn.simpleFAQ.defaults.tagClass;} if(typeof(o.showOnlyOne)!='boolean'){o.showOnlyOne=$.fn.simpleFAQ.defaults.showOnlyOne;} if(typeof(o.allowSearch)!='boolean'){o.allowSearch=$.fn.simpleFAQ.defaults.allowSearch;} if(typeof(o.minSearchScore)!='number'){o.minSearchScore=$.fn.simpleFAQ.defaults.minSearchScore;} if(typeof(o.sortSearch)!='boolean'){o.sortSearch=$.fn.simpleFAQ.defaults.sortSearch;} if(typeof(o.caseSensitive)!='boolean'){o.caseSensitive=$.fn.simpleFAQ.defaults.caseSensitive;} if(typeof(o.speed)!='number'){o.speed=$.fn.simpleFAQ.defaults.speed;} if(!o.ignore||!o.ignore.length||typeof o.ignore.splice!='function'){o.ignore=$.fn.simpleFAQ.defaults.ignore;} return o;} $.fn.simpleFAQ.keyTimeout=400;$.fn.simpleFAQ.tagMatchScore=0.1;$.fn.simpleFAQ.defaults={data:null,nodeType:'li',questionClass:'question',answerClass:'answer',tagClass:'tags',showOnlyOne:false,allowSearch:false,searchNode:null,minSearchScore:0,sortSearch:false,caseSensitive:false,speed:500,ignore:['the','a','an','i','we','you','it','that','those','these','them','to','and','or','as','at','by','for','of','so']};})(jQuery); |
:: Command execute :: | |
--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0316 ]-- |