Version Description
- Fix file_exists error in download handlers
Download this release
Release Info
Developer | mikejolley |
Plugin | Download Monitor |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.1
- assets/css/dashboard.css +1 -49
- assets/js/chosen/chosen.jquery.min.js +1 -2
- assets/js/jqueryFileTree/jqueryFileTree.min.js +33 -0
- download-monitor.php +3 -3
- readme.txt +4 -1
assets/css/dashboard.css
CHANGED
@@ -1,49 +1 @@
|
|
1 |
-
|
2 |
-
table.download_chart {
|
3 |
-
width: 100%;
|
4 |
-
}
|
5 |
-
table.download_chart thead {
|
6 |
-
display: none;
|
7 |
-
}
|
8 |
-
table.download_chart td,
|
9 |
-
table.download_chart th {
|
10 |
-
padding: 5px;
|
11 |
-
vertical-align: middle;
|
12 |
-
line-height: 1.5em;
|
13 |
-
}
|
14 |
-
table.download_chart th {
|
15 |
-
text-align: left;
|
16 |
-
font-weight: normal;
|
17 |
-
padding-left: 0;
|
18 |
-
}
|
19 |
-
table.download_chart td:last-child {
|
20 |
-
padding-right: 0;
|
21 |
-
}
|
22 |
-
table.download_chart tr:first-child td,
|
23 |
-
table.download_chart tr:first-child th {
|
24 |
-
padding-top: 0;
|
25 |
-
}
|
26 |
-
table.download_chart tr:last-child td,
|
27 |
-
table.download_chart tr:last-child th {
|
28 |
-
border-bottom: 0;
|
29 |
-
padding-bottom: 0;
|
30 |
-
}
|
31 |
-
table.download_chart span.bar {
|
32 |
-
padding: 0 0 0 1px;
|
33 |
-
height: 1.5em;
|
34 |
-
float: left;
|
35 |
-
margin-right: 5px;
|
36 |
-
-moz-box-sizing: border-box;
|
37 |
-
-webkit-box-sizing: border-box;
|
38 |
-
box-sizing: border-box;
|
39 |
-
-moz-border-radius: 2px;
|
40 |
-
-webkit-border-radius: 2px;
|
41 |
-
border-radius: 2px;
|
42 |
-
bprder: 1px solid ##6e6e6e;
|
43 |
-
background: #6e6e6e;
|
44 |
-
background-image: -webkit-gradient(linear, left bottom, left top, from(#747474), to(#6e6e6e));
|
45 |
-
background-image: -webkit-linear-gradient(bottom, #747474, #6e6e6e);
|
46 |
-
background-image: -moz-linear-gradient(bottom, #747474, #6e6e6e);
|
47 |
-
background-image: -o-linear-gradient(bottom, #747474, #6e6e6e);
|
48 |
-
background-image: linear-gradient(to top, #747474, #6e6e6e);
|
49 |
-
}
|
1 |
+
table.download_chart{width:100%}table.download_chart thead{display:none}table.download_chart td,table.download_chart th{padding:5px;vertical-align:middle;line-height:1.5em}table.download_chart th{text-align:left;font-weight:400;padding-left:0}table.download_chart td:last-child{padding-right:0}table.download_chart tr:first-child td,table.download_chart tr:first-child th{padding-top:0}table.download_chart tr:last-child td,table.download_chart tr:last-child th{border-bottom:0;padding-bottom:0}table.download_chart span.bar{padding:0 0 0 1px;height:1.5em;float:left;margin-right:5px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;bprder:1px solid ##6e6e6e;background:#6e6e6e;background-image:-webkit-gradient(linear,left bottom,left top,from(#747474),to(#6e6e6e));background-image:-webkit-linear-gradient(bottom,#747474,#6e6e6e);background-image:-moz-linear-gradient(bottom,#747474,#6e6e6e);background-image:-o-linear-gradient(bottom,#747474,#6e6e6e);background-image:linear-gradient(to top,#747474,#6e6e6e)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/chosen/chosen.jquery.min.js
CHANGED
@@ -4,7 +4,6 @@
|
|
4 |
// Version 0.9.12
|
5 |
// Full source at https://github.com/harvesthq/chosen
|
6 |
// Copyright (c) 2011 Harvest http://getharvest.com
|
7 |
-
|
8 |
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
9 |
// This file is generated by `cake build`, do not edit it by hand.
|
10 |
-
(function(){var e;e=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled}),s=e.childNodes,o=[];for(r=0,i=s.length;r<i;r++)n=s[r],o.push(this.add_option(n,t,e.disabled));return o},e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION")return e.text!==""?(t!=null&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}(),e.select_to_array=function(t){var n,r,i,s,o;r=new e,o=t.childNodes;for(i=0,s=o.length;i<s;i++)n=o[i],r.add_node(n);return r.parsed},this.SelectParser=e}).call(this),function(){var e,t;t=this,e=function(){function e(e,t){this.form_field=e,this.options=t!=null?t:{},this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.single_backstroke_delete=this.options.single_backstroke_delete||!1,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option",this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return t.blur_test()},100)},e.prototype.result_add_option=function(e){var t,n;return e.disabled?"":(e.dom_id=this.container_id+"_o_"+e.array_index,t=e.selected&&this.is_multiple?[]:["active-result"],e.selected&&t.push("result-selected"),e.group_array_index!=null&&t.push("group-option"),e.classes!==""&&t.push(e.classes),n=e.style.cssText!==""?' style="'+e.style+'"':"",'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>")},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.generate_field_id=function(){var e;return e=this.generate_random_id(),this.form_field.id=e,e},e.prototype.generate_random_char=function(){var e,t,n;return e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=Math.floor(Math.random()*e.length),t=e.substring(n,n+1)},e}(),t.AbstractChosen=e}.call(this),function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};r=this,e=jQuery,e.fn.extend({chosen:function(n){var r,i,s;return s=navigator.userAgent.toLowerCase(),i=/(msie) ([\w.]+)/.exec(s)||[],r={name:i[1]||"",version:i[2]||"0"},r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}}),t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_value=this.form_field_jq.val(),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},i.prototype.set_up_html=function(){var t,r,i,s,o,u;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chzn",t=["chzn-container"],t.push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chzn-rtl"),this.f_width=this.form_field_jq.outerWidth(),i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title},r=e("<div />",i),this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(r),this.container=e("#"+this.container_id),this.dropdown=this.container.find("div.chzn-drop").first(),s=this.container.height(),o=this.f_width-n(this.dropdown),this.dropdown.css({width:o+"px",top:s+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),u=o-n(this.search_container)-n(this.search_field),this.search_field.css({width:u+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},i.prototype.register_observers=function(){var e=this;return this.container.mousedown(function(t){e.container_mousedown(t)}),this.container.mouseup(function(t){e.container_mouseup(t)}),this.container.mouseenter(function(t){e.mouse_enter(t)}),this.container.mouseleave(function(t){e.mouse_leave(t)}),this.search_results.mouseup(function(t){e.search_results_mouseup(t)}),this.search_results.mouseover(function(t){e.search_results_mouseover(t)}),this.search_results.mouseout(function(t){e.search_results_mouseout(t)}),this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)}),this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)}),this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)}),this.search_field.blur(function(t){e.input_blur(t)}),this.search_field.keyup(function(t){e.keyup_checker(t)}),this.search_field.keydown(function(t){e.keydown_checker(t)}),this.search_field.focus(function(t){e.input_focus(t)}),this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})},i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled)return n=t!=null?e(t.target).hasClass("search-choice-close"):!1,t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault(),!this.pending_destroy_click&&!n?(this.active_field?!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)&&(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(document).unbind("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0,this.results_data=r.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.addClass("chzn-default").find("span").text(this.default_text),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.results_data;for(n=0,i=s.length;n<i;n++)t=s[n],t.group?e+=this.result_add_group(t):t.empty||(e+=this.result_add_option(t),t.selected&&this.is_multiple?this.choice_build(t):t.selected&&!this.is_multiple&&(this.selected_item.removeClass("chzn-default").find("span").text(t.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(e),this.parsing=!1},i.prototype.result_add_group=function(t){return t.disabled?"":(t.dom_id=this.container_id+"_g_"+t.array_index,'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>")},i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),r=parseInt(this.search_results.css("maxHeight"),10),s=this.search_results.scrollTop(),i=r+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e;if(!this.is_multiple)this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return e=this.is_multiple?this.container.height():this.container.height()-1,this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this}),this.dropdown.css({top:e+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},i.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this}),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex"))return t=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.search_field.attr("tabindex",t)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length)return this.result_highlight=n,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},i.prototype.choice_build=function(t){var n,r,i,s=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(n=this.container_id+"_c_"+t.array_index,this.choices+=1,t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>',this.search_container.before(r),i=e("#"+n).find("a").first(),i.click(function(e){return s.choice_destroy_link_click(e)}))},i.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),this.is_disabled?t.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(e(t.target)))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel")))return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chzn-default"),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_value=this.form_field_jq.val(),this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight)return t=this.result_highlight,n=t.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(t):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=t,this.selected_item.removeClass("chzn-default")),t.addClass("result-selected"),i=n.substr(n.lastIndexOf("_")+1),r=this.results_data[i],r.selected=!0,this.form_field.options[r.options_index].selected=!0,this.is_multiple?this.choice_build(r):(this.selected_item.find("span").first().text(r.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value}),this.current_value=this.form_field_jq.val(),this.search_field_scale()},i.prototype.result_activate=function(e){return e.addClass("active-result")},i.prototype.result_deactivate=function(e){return e.removeClass("active-result")},i.prototype.result_deselect=function(t){var n,r;return r=this.results_data[t],this.form_field.options[r.options_index].disabled?!1:(r.selected=!1,this.form_field.options[r.options_index].selected=!1,n=e("#"+this.container_id+"_o_"+t),n.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear(),f=0,l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html(),o=this.search_contains?"":"^",s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1,a=n.dom_id,u=e("#"+a);if(s.test(n.html))t=!0,f+=1;else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++)r=i[v],s.test(r)&&(t=!0,f+=1)}t?(l.length?(c=n.html.search(p),h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length),h=h.substr(0,c)+"<em>"+h.substr(c)):h=n.html,u.html(h),this.result_activate(u),n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(u))}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()},i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val(""),n=this.search_results.find("li"),s=[];for(r=0,i=n.length;r<i;r++)t=n[r],t=e(t),t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0);return s},i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}},i.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n)},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t,n;this.result_highlight?this.results_showing&&(n=this.result_highlight.nextAll("li.active-result").first(),n&&this.result_do_highlight(n)):(t=this.search_results.find("li.active-result").first(),t&&this.result_do_highlight(e(t)));if(!this.results_showing)return this.results_show()},i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke)return this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke();e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled"))return this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode,this.search_field_scale(),t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0,u=0,s="position:absolute; left: -1000px; top: -1000px; display:none;",o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++)i=o[a],s+=i+":"+this.search_field.css(i)+";";return n=e("<div />",{style:s}),n.text(this.search_field.val()),e("body").append(n),u=n.width()+25,n.remove(),u>this.f_width-10&&(u=this.f_width-10),this.search_field.css({width:u+"px"}),t=this.container.height(),this.dropdown.css({top:t+"px"})}},i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t},i}(AbstractChosen),r.Chosen=t,n=function(e){var t;return t=e.outerWidth()-e.width()},r.get_side_border_padding=n}.call(this);
|
4 |
// Version 0.9.12
|
5 |
// Full source at https://github.com/harvesthq/chosen
|
6 |
// Copyright (c) 2011 Harvest http://getharvest.com
|
|
|
7 |
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
8 |
// This file is generated by `cake build`, do not edit it by hand.
|
9 |
+
(function(){var e;e=function(){function e(){this.options_index=0;this.parsed=[]}e.prototype.add_node=function(e){return e.nodeName.toUpperCase()==="OPTGROUP"?this.add_group(e):this.add_option(e)};e.prototype.add_group=function(e){var t,n,r,i,s,o;t=this.parsed.length;this.parsed.push({array_index:t,group:!0,label:e.label,children:0,disabled:e.disabled});s=e.childNodes;o=[];for(r=0,i=s.length;r<i;r++){n=s[r];o.push(this.add_option(n,t,e.disabled))}return o};e.prototype.add_option=function(e,t,n){if(e.nodeName.toUpperCase()==="OPTION"){if(e.text!==""){t!=null&&(this.parsed[t].children+=1);this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,classes:e.className,style:e.style.cssText})}else this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0});return this.options_index+=1}};return e}();e.select_to_array=function(t){var n,r,i,s,o;r=new e;o=t.childNodes;for(i=0,s=o.length;i<s;i++){n=o[i];r.add_node(n)}return r.parsed};this.SelectParser=e}).call(this);(function(){var e,t;t=this;e=function(){function e(e,t){this.form_field=e;this.options=t!=null?t:{};this.is_multiple=this.form_field.multiple;this.set_default_text();this.set_default_values();this.setup();this.set_up_html();this.register_observers();this.finish_setup()}e.prototype.set_default_values=function(){var e=this;this.click_test_action=function(t){return e.test_active_click(t)};this.activate_action=function(t){return e.activate_field(t)};this.active_field=!1;this.mouse_on_container=!1;this.results_showing=!1;this.result_highlighted=null;this.result_single_selected=null;this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1;this.disable_search_threshold=this.options.disable_search_threshold||0;this.disable_search=this.options.disable_search||!1;this.enable_split_word_search=this.options.enable_split_word_search!=null?this.options.enable_split_word_search:!0;this.search_contains=this.options.search_contains||!1;this.choices=0;this.single_backstroke_delete=this.options.single_backstroke_delete||!1;this.max_selected_options=this.options.max_selected_options||Infinity;return this.inherit_select_classes=this.options.inherit_select_classes||!1};e.prototype.set_default_text=function(){this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||"Select Some Options":this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||"Select an Option";return this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||"No results match"};e.prototype.mouse_enter=function(){return this.mouse_on_container=!0};e.prototype.mouse_leave=function(){return this.mouse_on_container=!1};e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()};e.prototype.input_blur=function(e){var t=this;if(!this.mouse_on_container){this.active_field=!1;return setTimeout(function(){return t.blur_test()},100)}};e.prototype.result_add_option=function(e){var t,n;if(!e.disabled){e.dom_id=this.container_id+"_o_"+e.array_index;t=e.selected&&this.is_multiple?[]:["active-result"];e.selected&&t.push("result-selected");e.group_array_index!=null&&t.push("group-option");e.classes!==""&&t.push(e.classes);n=e.style.cssText!==""?' style="'+e.style+'"':"";return'<li id="'+e.dom_id+'" class="'+t.join(" ")+'"'+n+">"+e.html+"</li>"}return""};e.prototype.results_update_field=function(){this.set_default_text();this.is_multiple||this.results_reset_cleanup();this.result_clear_highlight();this.result_single_selected=null;return this.results_build()};e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()};e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()};e.prototype.keyup_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode;this.search_field_scale();switch(t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke){this.result_clear_highlight();return this.results_search()}break;case 13:e.preventDefault();if(this.results_showing)return this.result_select(e);break;case 27:this.results_showing&&this.results_hide();return!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}};e.prototype.generate_field_id=function(){var e;e=this.generate_random_id();this.form_field.id=e;return e};e.prototype.generate_random_char=function(){var e,t,n;e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";n=Math.floor(Math.random()*e.length);return t=e.substring(n,n+1)};return e}();t.AbstractChosen=e}).call(this);(function(){var e,t,n,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);r.prototype=t.prototype;e.prototype=new r;e.__super__=t.prototype;return e};r=this;e=jQuery;e.fn.extend({chosen:function(n){var r,i,s;s=navigator.userAgent.toLowerCase();i=/(msie) ([\w.]+)/.exec(s)||[];r={name:i[1]||"",version:i[2]||"0"};return r.name==="msie"&&(r.version==="6.0"||r.version==="7.0"&&document.documentMode===7)?this:this.each(function(r){var i;i=e(this);if(!i.hasClass("chzn-done"))return i.data("chosen",new t(this,n))})}});t=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}s(i,t);i.prototype.setup=function(){this.form_field_jq=e(this.form_field);this.current_value=this.form_field_jq.val();return this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")};i.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")};i.prototype.set_up_html=function(){var t,r,i,s,o,u;this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id();this.container_id+="_chzn";t=["chzn-container"];t.push("chzn-container-"+(this.is_multiple?"multi":"single"));this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className);this.is_rtl&&t.push("chzn-rtl");this.f_width=this.form_field_jq.outerWidth();i={id:this.container_id,"class":t.join(" "),style:"width: "+this.f_width+"px;",title:this.form_field.title};r=e("<div />",i);this.is_multiple?r.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):r.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');this.form_field_jq.hide().after(r);this.container=e("#"+this.container_id);this.dropdown=this.container.find("div.chzn-drop").first();s=this.container.height();o=this.f_width-n(this.dropdown);this.dropdown.css({width:o+"px",top:s+"px"});this.search_field=this.container.find("input").first();this.search_results=this.container.find("ul.chzn-results").first();this.search_field_scale();this.search_no_results=this.container.find("li.no-results").first();if(this.is_multiple){this.search_choices=this.container.find("ul.chzn-choices").first();this.search_container=this.container.find("li.search-field").first()}else{this.search_container=this.container.find("div.chzn-search").first();this.selected_item=this.container.find(".chzn-single").first();u=o-n(this.search_container)-n(this.search_field);this.search_field.css({width:u+"px"})}this.results_build();this.set_tab_index();return this.form_field_jq.trigger("liszt:ready",{chosen:this})};i.prototype.register_observers=function(){var e=this;this.container.mousedown(function(t){e.container_mousedown(t)});this.container.mouseup(function(t){e.container_mouseup(t)});this.container.mouseenter(function(t){e.mouse_enter(t)});this.container.mouseleave(function(t){e.mouse_leave(t)});this.search_results.mouseup(function(t){e.search_results_mouseup(t)});this.search_results.mouseover(function(t){e.search_results_mouseover(t)});this.search_results.mouseout(function(t){e.search_results_mouseout(t)});this.form_field_jq.bind("liszt:updated",function(t){e.results_update_field(t)});this.form_field_jq.bind("liszt:activate",function(t){e.activate_field(t)});this.form_field_jq.bind("liszt:open",function(t){e.container_mousedown(t)});this.search_field.blur(function(t){e.input_blur(t)});this.search_field.keyup(function(t){e.keyup_checker(t)});this.search_field.keydown(function(t){e.keydown_checker(t)});this.search_field.focus(function(t){e.input_focus(t)});return this.is_multiple?this.search_choices.click(function(t){e.choices_click(t)}):this.container.click(function(e){e.preventDefault()})};i.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled){this.container.addClass("chzn-disabled");this.search_field[0].disabled=!0;this.is_multiple||this.selected_item.unbind("focus",this.activate_action);return this.close_field()}this.container.removeClass("chzn-disabled");this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)};i.prototype.container_mousedown=function(t){var n;if(!this.is_disabled){n=t!=null?e(t.target).hasClass("search-choice-close"):!1;t&&t.type==="mousedown"&&!this.results_showing&&t.preventDefault();if(!this.pending_destroy_click&&!n){if(!this.active_field){this.is_multiple&&this.search_field.val("");e(document).click(this.click_test_action);this.results_show()}else if(!this.is_multiple&&t&&(e(t.target)[0]===this.selected_item[0]||e(t.target).parents("a.chzn-single").length)){t.preventDefault();this.results_toggle()}return this.activate_field()}return this.pending_destroy_click=!1}};i.prototype.container_mouseup=function(e){if(e.target.nodeName==="ABBR"&&!this.is_disabled)return this.results_reset(e)};i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()};i.prototype.close_field=function(){e(document).unbind("click",this.click_test_action);this.active_field=!1;this.results_hide();this.container.removeClass("chzn-container-active");this.winnow_results_clear();this.clear_backstroke();this.show_search_field_default();return this.search_field_scale()};i.prototype.activate_field=function(){this.container.addClass("chzn-container-active");this.active_field=!0;this.search_field.val(this.search_field.val());return this.search_field.focus()};i.prototype.test_active_click=function(t){return e(t.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()};i.prototype.results_build=function(){var e,t,n,i,s;this.parsing=!0;this.results_data=r.SelectParser.select_to_array(this.form_field);if(this.is_multiple&&this.choices>0){this.search_choices.find("li.search-choice").remove();this.choices=0}else if(!this.is_multiple){this.selected_item.addClass("chzn-default").find("span").text(this.default_text);this.disable_search||this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")}e="";s=this.results_data;for(n=0,i=s.length;n<i;n++){t=s[n];if(t.group)e+=this.result_add_group(t);else if(!t.empty){e+=this.result_add_option(t);if(t.selected&&this.is_multiple)this.choice_build(t);else if(t.selected&&!this.is_multiple){this.selected_item.removeClass("chzn-default").find("span").text(t.text);this.allow_single_deselect&&this.single_deselect_control_build()}}}this.search_field_disabled();this.show_search_field_default();this.search_field_scale();this.search_results.html(e);return this.parsing=!1};i.prototype.result_add_group=function(t){if(!t.disabled){t.dom_id=this.container_id+"_g_"+t.array_index;return'<li id="'+t.dom_id+'" class="group-result">'+e("<div />").text(t.label).html()+"</li>"}return""};i.prototype.result_do_highlight=function(e){var t,n,r,i,s;if(e.length){this.result_clear_highlight();this.result_highlight=e;this.result_highlight.addClass("highlighted");r=parseInt(this.search_results.css("maxHeight"),10);s=this.search_results.scrollTop();i=r+s;n=this.result_highlight.position().top+this.search_results.scrollTop();t=n+this.result_highlight.outerHeight();if(t>=i)return this.search_results.scrollTop(t-r>0?t-r:0);if(n<s)return this.search_results.scrollTop(n)}};i.prototype.result_clear_highlight=function(){this.result_highlight&&this.result_highlight.removeClass("highlighted");return this.result_highlight=null};i.prototype.results_show=function(){var e;if(!this.is_multiple){this.selected_item.addClass("chzn-single-with-drop");this.result_single_selected&&this.result_do_highlight(this.result_single_selected)}else if(this.max_selected_options<=this.choices){this.form_field_jq.trigger("liszt:maxselected",{chosen:this});return!1}e=this.is_multiple?this.container.height():this.container.height()-1;this.form_field_jq.trigger("liszt:showing_dropdown",{chosen:this});this.dropdown.css({top:e+"px",left:0});this.results_showing=!0;this.search_field.focus();this.search_field.val(this.search_field.val());return this.winnow_results()};i.prototype.results_hide=function(){this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop");this.result_clear_highlight();this.form_field_jq.trigger("liszt:hiding_dropdown",{chosen:this});this.dropdown.css({left:"-9000px"});return this.results_showing=!1};i.prototype.set_tab_index=function(e){var t;if(this.form_field_jq.attr("tabindex")){t=this.form_field_jq.attr("tabindex");this.form_field_jq.attr("tabindex",-1);return this.search_field.attr("tabindex",t)}};i.prototype.show_search_field_default=function(){if(this.is_multiple&&this.choices<1&&!this.active_field){this.search_field.val(this.default_text);return this.search_field.addClass("default")}this.search_field.val("");return this.search_field.removeClass("default")};i.prototype.search_results_mouseup=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n.length){this.result_highlight=n;this.result_select(t);return this.search_field.focus()}};i.prototype.search_results_mouseover=function(t){var n;n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first();if(n)return this.result_do_highlight(n)};i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result"))return this.result_clear_highlight()};i.prototype.choices_click=function(t){t.preventDefault();if(this.active_field&&!e(t.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()};i.prototype.choice_build=function(t){var n,r,i,s=this;if(this.is_multiple&&this.max_selected_options<=this.choices){this.form_field_jq.trigger("liszt:maxselected",{chosen:this});return!1}n=this.container_id+"_c_"+t.array_index;this.choices+=1;t.disabled?r='<li class="search-choice search-choice-disabled" id="'+n+'"><span>'+t.html+"</span></li>":r='<li class="search-choice" id="'+n+'"><span>'+t.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+t.array_index+'"></a></li>';this.search_container.before(r);i=e("#"+n).find("a").first();return i.click(function(e){return s.choice_destroy_link_click(e)})};i.prototype.choice_destroy_link_click=function(t){t.preventDefault();if(!this.is_disabled){this.pending_destroy_click=!0;return this.choice_destroy(e(t.target))}return t.stopPropagation};i.prototype.choice_destroy=function(e){if(this.result_deselect(e.attr("rel"))){this.choices-=1;this.show_search_field_default();this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide();e.parents("li").first().remove();return this.search_field_scale()}};i.prototype.results_reset=function(){this.form_field.options[0].selected=!0;this.selected_item.find("span").text(this.default_text);this.is_multiple||this.selected_item.addClass("chzn-default");this.show_search_field_default();this.results_reset_cleanup();this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()};i.prototype.results_reset_cleanup=function(){this.current_value=this.form_field_jq.val();return this.selected_item.find("abbr").remove()};i.prototype.result_select=function(e){var t,n,r,i;if(this.result_highlight){t=this.result_highlight;n=t.attr("id");this.result_clear_highlight();if(this.is_multiple)this.result_deactivate(t);else{this.search_results.find(".result-selected").removeClass("result-selected");this.result_single_selected=t;this.selected_item.removeClass("chzn-default")}t.addClass("result-selected");i=n.substr(n.lastIndexOf("_")+1);r=this.results_data[i];r.selected=!0;this.form_field.options[r.options_index].selected=!0;if(this.is_multiple)this.choice_build(r);else{this.selected_item.find("span").first().text(r.text);this.allow_single_deselect&&this.single_deselect_control_build()}(!e.metaKey&&!e.ctrlKey||!this.is_multiple)&&this.results_hide();this.search_field.val("");(this.is_multiple||this.form_field_jq.val()!==this.current_value)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[r.options_index].value});this.current_value=this.form_field_jq.val();return this.search_field_scale()}};i.prototype.result_activate=function(e){return e.addClass("active-result")};i.prototype.result_deactivate=function(e){return e.removeClass("active-result")};i.prototype.result_deselect=function(t){var n,r;r=this.results_data[t];if(!this.form_field.options[r.options_index].disabled){r.selected=!1;this.form_field.options[r.options_index].selected=!1;n=e("#"+this.container_id+"_o_"+t);n.removeClass("result-selected").addClass("active-result").show();this.result_clear_highlight();this.winnow_results();this.form_field_jq.trigger("change",{deselected:this.form_field.options[r.options_index].value});this.search_field_scale();return!0}return!1};i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')};i.prototype.winnow_results=function(){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;this.no_results_clear();f=0;l=this.search_field.val()===this.default_text?"":e("<div/>").text(e.trim(this.search_field.val())).html();o=this.search_contains?"":"^";s=new RegExp(o+l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i");p=new RegExp(l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i");y=this.results_data;for(d=0,m=y.length;d<m;d++){n=y[d];if(!n.disabled&&!n.empty)if(n.group)e("#"+n.dom_id).css("display","none");else if(!this.is_multiple||!n.selected){t=!1;a=n.dom_id;u=e("#"+a);if(s.test(n.html)){t=!0;f+=1}else if(this.enable_split_word_search&&(n.html.indexOf(" ")>=0||n.html.indexOf("[")===0)){i=n.html.replace(/\[|\]/g,"").split(" ");if(i.length)for(v=0,g=i.length;v<g;v++){r=i[v];if(s.test(r)){t=!0;f+=1}}}if(t){if(l.length){c=n.html.search(p);h=n.html.substr(0,c+l.length)+"</em>"+n.html.substr(c+l.length);h=h.substr(0,c)+"<em>"+h.substr(c)}else h=n.html;u.html(h);this.result_activate(u);n.group_array_index!=null&&e("#"+this.results_data[n.group_array_index].dom_id).css("display","list-item")}else{this.result_highlight&&a===this.result_highlight.attr("id")&&this.result_clear_highlight();this.result_deactivate(u)}}}return f<1&&l.length?this.no_results(l):this.winnow_results_set_highlight()};i.prototype.winnow_results_clear=function(){var t,n,r,i,s;this.search_field.val("");n=this.search_results.find("li");s=[];for(r=0,i=n.length;r<i;r++){t=n[r];t=e(t);t.hasClass("group-result")?s.push(t.css("display","auto")):!this.is_multiple||!t.hasClass("result-selected")?s.push(this.result_activate(t)):s.push(void 0)}return s};i.prototype.winnow_results_set_highlight=function(){var e,t;if(!this.result_highlight){t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result");e=t.length?t.first():this.search_results.find(".active-result").first();if(e!=null)return this.result_do_highlight(e)}};i.prototype.no_results=function(t){var n;n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>');n.find("span").first().html(t);return this.search_results.append(n)};i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()};i.prototype.keydown_arrow=function(){var t,n;if(!this.result_highlight){t=this.search_results.find("li.active-result").first();t&&this.result_do_highlight(e(t))}else if(this.results_showing){n=this.result_highlight.nextAll("li.active-result").first();n&&this.result_do_highlight(n)}if(!this.results_showing)return this.results_show()};i.prototype.keyup_arrow=function(){var e;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight){e=this.result_highlight.prevAll("li.active-result");if(e.length)return this.result_do_highlight(e.first());this.choices>0&&this.results_hide();return this.result_clear_highlight()}};i.prototype.keydown_backstroke=function(){var e;if(this.pending_backstroke){this.choice_destroy(this.pending_backstroke.find("a").first());return this.clear_backstroke()}e=this.search_container.siblings("li.search-choice").last();if(e.length&&!e.hasClass("search-choice-disabled")){this.pending_backstroke=e;return this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")}};i.prototype.clear_backstroke=function(){this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus");return this.pending_backstroke=null};i.prototype.keydown_checker=function(e){var t,n;t=(n=e.which)!=null?n:e.keyCode;this.search_field_scale();t!==8&&this.pending_backstroke&&this.clear_backstroke();switch(t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e);this.mouse_on_container=!1;break;case 13:e.preventDefault();break;case 38:e.preventDefault();this.keyup_arrow();break;case 40:this.keydown_arrow()}};i.prototype.search_field_scale=function(){var t,n,r,i,s,o,u,a,f;if(this.is_multiple){r=0;u=0;s="position:absolute; left: -1000px; top: -1000px; display:none;";o=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(a=0,f=o.length;a<f;a++){i=o[a];s+=i+":"+this.search_field.css(i)+";"}n=e("<div />",{style:s});n.text(this.search_field.val());e("body").append(n);u=n.width()+25;n.remove();u>this.f_width-10&&(u=this.f_width-10);this.search_field.css({width:u+"px"});t=this.container.height();return this.dropdown.css({top:t+"px"})}};i.prototype.generate_random_id=function(){var t;t="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(e("#"+t).length>0)t+=this.generate_random_char();return t};return i}(AbstractChosen);r.Chosen=t;n=function(e){var t;return t=e.outerWidth()-e.width()};r.get_side_border_padding=n}).call(this);
|
assets/js/jqueryFileTree/jqueryFileTree.min.js
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// jQuery File Tree Plugin
|
2 |
+
//
|
3 |
+
// Version 1.01
|
4 |
+
//
|
5 |
+
// Cory S.N. LaViska
|
6 |
+
// A Beautiful Site (http://abeautifulsite.net/)
|
7 |
+
// 24 March 2008
|
8 |
+
//
|
9 |
+
// Visit http://abeautifulsite.net/notebook.php?article=58 for more information
|
10 |
+
//
|
11 |
+
// Usage: $('.fileTreeDemo').fileTree( options, callback )
|
12 |
+
//
|
13 |
+
// Options: root - root folder to display; default = /
|
14 |
+
// script - location of the serverside AJAX file to use; default = jqueryFileTree.php
|
15 |
+
// folderEvent - event to trigger expand/collapse; default = click
|
16 |
+
// expandSpeed - default = 500 (ms); use -1 for no animation
|
17 |
+
// collapseSpeed - default = 500 (ms); use -1 for no animation
|
18 |
+
// expandEasing - easing function to use on expand (optional)
|
19 |
+
// collapseEasing - easing function to use on collapse (optional)
|
20 |
+
// multiFolder - whether or not to limit the browser to one subfolder at a time
|
21 |
+
// loadMessage - Message to display while initial tree loads (can be HTML)
|
22 |
+
//
|
23 |
+
// History:
|
24 |
+
//
|
25 |
+
// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
|
26 |
+
// 1.00 - released (24 March 2008)
|
27 |
+
//
|
28 |
+
// TERMS OF USE
|
29 |
+
//
|
30 |
+
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
|
31 |
+
// is copyright 2008 A Beautiful Site, LLC.
|
32 |
+
//
|
33 |
+
jQuery&&function(e){e.extend(e.fn,{fileTree:function(t,n){if(!t)var t={};t.root==undefined&&(t.root="/");t.script==undefined&&(t.script="jqueryFileTree.php");t.folderEvent==undefined&&(t.folderEvent="click");t.expandSpeed==undefined&&(t.expandSpeed=500);t.collapseSpeed==undefined&&(t.collapseSpeed=500);t.expandEasing==undefined&&(t.expandEasing=null);t.collapseEasing==undefined&&(t.collapseEasing=null);t.multiFolder==undefined&&(t.multiFolder=!0);t.loadMessage==undefined&&(t.loadMessage="Loading...");e(this).each(function(){function r(n,r){e(n).addClass("wait");e(".jqueryFileTree.start").remove();e.post(t.script,{dir:r},function(s){e(n).find(".start").html("");e(n).removeClass("wait").append(s);t.root==r?e(n).find("UL:hidden").show():e(n).find("UL:hidden").slideDown({duration:t.expandSpeed,easing:t.expandEasing});i(n)})}function i(i){e(i).find("LI A").bind(t.folderEvent,function(){if(e(this).parent().hasClass("directory"))if(e(this).parent().hasClass("collapsed")){if(!t.multiFolder){e(this).parent().parent().find("UL").slideUp({duration:t.collapseSpeed,easing:t.collapseEasing});e(this).parent().parent().find("LI.directory").removeClass("expanded").addClass("collapsed")}e(this).parent().find("UL").remove();r(e(this).parent(),escape(e(this).attr("rel").match(/.*\//)));e(this).parent().removeClass("collapsed").addClass("expanded")}else{e(this).parent().find("UL").slideUp({duration:t.collapseSpeed,easing:t.collapseEasing});e(this).parent().removeClass("expanded").addClass("collapsed")}else n(e(this).attr("rel"));return!1});t.folderEvent.toLowerCase!="click"&&e(i).find("LI A").bind("click",function(){return!1})}e(this).html('<ul class="jqueryFileTree start"><li class="wait">'+t.loadMessage+"<li></ul>");r(e(this),escape(t.root))})}})}(jQuery);
|
download-monitor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Download Monitor
|
4 |
Plugin URI: http://mikejolley.com/projects/download-monitor/
|
5 |
Description: A full solution for managing downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
|
6 |
-
Version: 1.4.
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 3.8
|
@@ -37,7 +37,7 @@ class WP_DLM {
|
|
37 |
global $wpdb;
|
38 |
|
39 |
// Define constants
|
40 |
-
define( 'DLM_VERSION', '1.4.
|
41 |
|
42 |
// Table for logs
|
43 |
$wpdb->download_log = $wpdb->prefix . 'download_log';
|
@@ -538,7 +538,7 @@ class WP_DLM {
|
|
538 |
$remote_file = true;
|
539 |
$parsed_file_path = parse_url( $file_path );
|
540 |
|
541 |
-
if ( ( ! isset( $parsed_file_path['scheme'] ) || ! in_array( $parsed_file_path['scheme'], array( 'http', 'https', 'ftp' ) ) ) && isset( $parsed_file_path['path'] ) && file_exists( $parsed_file_path ) ) {
|
542 |
|
543 |
/** This is an absolute path */
|
544 |
$remote_file = false;
|
3 |
Plugin Name: Download Monitor
|
4 |
Plugin URI: http://mikejolley.com/projects/download-monitor/
|
5 |
Description: A full solution for managing downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
|
6 |
+
Version: 1.4.1
|
7 |
Author: Mike Jolley
|
8 |
Author URI: http://mikejolley.com
|
9 |
Requires at least: 3.8
|
37 |
global $wpdb;
|
38 |
|
39 |
// Define constants
|
40 |
+
define( 'DLM_VERSION', '1.4.1' );
|
41 |
|
42 |
// Table for logs
|
43 |
$wpdb->download_log = $wpdb->prefix . 'download_log';
|
538 |
$remote_file = true;
|
539 |
$parsed_file_path = parse_url( $file_path );
|
540 |
|
541 |
+
if ( ( ! isset( $parsed_file_path['scheme'] ) || ! in_array( $parsed_file_path['scheme'], array( 'http', 'https', 'ftp' ) ) ) && isset( $parsed_file_path['path'] ) && file_exists( $parsed_file_path['path'] ) ) {
|
542 |
|
543 |
/** This is an absolute path */
|
544 |
$remote_file = false;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
|
|
4 |
Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv3
|
9 |
|
10 |
Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
|
@@ -108,6 +108,9 @@ Admin hits are not counted, log out and try!
|
|
108 |
|
109 |
== Changelog ==
|
110 |
|
|
|
|
|
|
|
111 |
= 1.4.0 =
|
112 |
* MP6/3.8 admin styling. Requires 3.8.
|
113 |
* Polish translation.
|
4 |
Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.4.1
|
8 |
License: GPLv3
|
9 |
|
10 |
Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
|
108 |
|
109 |
== Changelog ==
|
110 |
|
111 |
+
= 1.4.1 =
|
112 |
+
* Fix file_exists error in download handlers
|
113 |
+
|
114 |
= 1.4.0 =
|
115 |
* MP6/3.8 admin styling. Requires 3.8.
|
116 |
* Polish translation.
|