1(function ($) { 2 $.fn.dnnConsole = function (options) { 3 var opts = $.extend({}, $.fn.dnnConsole.defaults, options); 4 5 $(this).find("img").each(function () { 6 this.style.borderWidth = "0px"; 7 }); 8 9 if (opts.showTooltip && opts.showDetails != "Show") { 10 $(this).find("div > div").each(function () { 11 var $this = $(this); 12 var $title = $this.find("h3"); 13 var $desc = $this.find("div"); 14 var tooltip = ""; 15 if ($title.length > 0) { 16 tooltip = $title.text(); 17 } 18 if ($desc.length > 0) { 19 if (tooltip != "") 20 tooltip += " - "; 21 22 tooltip += $desc.text(); 23 } 24 if (tooltip != "") 25 this.title += tooltip; 26 }); 27 } 28 29 function _changeView(jObj) { 30 var classList = "console-none console-none-detail console-small console-large console-small-detail console-large-detail", 31 cssStyle; 32 switch (opts.selectedSize) { 33 case "IconFile": 34 cssStyle = "console-small"; 35 $(jObj).find("div > div img").hide(); 36 $(jObj).find("div > div img:first-child").show(); 37 break; 38 case "IconFileLarge": 39 $(jObj).find("div > div img").show(); 40 $(jObj).find("div > div img:first-child").hide(); 41 cssStyle = "console-large"; 42 break; 43 case "IconNone": 44 $(jObj).find("div > div img").hide(); 45 $(jObj).find("div > div img:first-child").hide(); 46 cssStyle = "console-none"; 47 break; 48 } 49 cssStyle += opts.showDetails == "Show" ? "-detail" : ""; 50 51 $(jObj).find("div").removeClass(classList).addClass(cssStyle); 52 53 opts.currentClass = cssStyle; 54 } 55 56 $(this).find("div > div").bind( 57 "click" 58 , function () { 59 if ($(this).children("a").length > 0) 60 window.location.href = $(this).children("a")[0].href; 61 } 62 ); 63 64 $(this).find("div > div").hover( 65 function (e) { $(this).addClass("console-mouseon"); } 66 , function (e) { $(this).removeClass("console-mouseon"); } 67 ); 68 69 var self = this; 70 $(this).find("select").bind("change", function () { 71 var data = ""; 72 if (this.value == "IconFile" || this.value == "IconFileLarge" || this.value == "IconNone") { 73 opts.selectedSize = this.value; 74 data = "CS=" + opts.selectedSize; 75 } 76 if (this.value == "Show" || this.value == "Hide") { 77 opts.showDetails = this.value; 78 data = "CV=" + opts.showDetails; 79 } 80 81 _changeView(self, opts); 82 83 if (data != "") { 84 if (opts.tabModuleID.toString() != "-1") { 85 data = data + "&CTMID=" + opts.tabModuleID.toString(); 86 $.ajax({
87 type: 'get', 88 data: data, 89 error: function () { 90 return; 91 }, 92 success: function (msg) { 93 return; 94 } 95 }); 96 } 97 } 98 }); 99 100 _changeView(this); 101 102 //this[0].style.display = "inline"; 103 return this; 104 }; 105 106 $.fn.dnnConsole.defaults = { 107 allowIconSizeChange: true, 108 allowDetailChange: true, 109 selectedSize: 'IconFile', 110 showDetails: 'Hide', 111 showTooltip: true 112 }; 113})(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.