1var omShortcodes = { 2 3 init: function(modules) { 4 if(typeof(modules) != 'undefined') { 5 for(var i = 0; i < modules.length; i++) { 6 if(typeof(this.modules[modules[i]]) != 'undefined') 7 this.modules[modules[i]].init(); 8 } 9 } 10 11 }, 12 13 modules: { } 14}; 15 16omShortcodes.modules.buttons = { 17 init: function() { 18 jQuery('.omsc-button.omsc-custom-hover').each(function(){ 19 jQuery(this).data('def-bg-color',jQuery(this).css('background-color')); 20 jQuery(this).data('def-text-color',jQuery(this).css('color')); 21 jQuery(this).data('def-border-color',jQuery(this).css('border-top-color')); 22 }).hover(function(){ 23 var color; 24 25 color=jQuery(this).data('hover-bg-color'); 26 if(color) 27 jQuery(this).css('background-color',color); 28 29 color=jQuery(this).data('hover-text-color'); 30 if(color) 31 jQuery(this).css('color',color); 32 33 color=jQuery(this).data('hover-border-color'); 34 if(color) 35 jQuery(this).css('border-color',color); 36 37 }, function(){ 38 jQuery(this).css('background-color',jQuery(this).data('def-bg-color')); 39 jQuery(this).css('border-color',jQuery(this).data('def-border-color')); 40 jQuery(this).css('color',jQuery(this).data('def-text-color')); 41 }); 42 43 } 44} 45 46omShortcodes.modules.tooltips = { 47 init: function() { 48 49 jQuery('.omsc-add-tooltip').each(function(){ 50 var text=jQuery(this).data('tooltip'); 51 if(typeof(text) == 'undefined') 52 return; 53 54 jQuery(this).mouseenter(function(){ 55 56 var $tt=jQuery(this).data('omsc-tooltip'); 57 if($tt) { 58 $tt.stop(); 59 } else { 60 var pos=jQuery(this).offset(); 61 $tt=jQuery('<div class="omsc-tooltip"><div class="omsc-tooltip-inner"></div></div>'); 62 $tt.find('.omsc-tooltip-inner').text(text); 63 jQuery(this).data('omsc-tooltip', $tt); 64 $tt.appendTo('body'); 65 $tt.css('left',pos.left + Math.round(jQuery(this).outerWidth()/2)); 66 $tt.css('top',pos.top - $tt.outerHeight()); 67 } 68 $tt.show(); 69 $tt.animate({opacity:1, marginTop: '-13px'}, 200); 70 }); 71 72 jQuery(this).mouseleave(function(){ 73 var $this=jQuery(this); 74 var $tt=$this.data('omsc-tooltip'); 75 if($tt) { 76 $tt.stop().animate({opacity:0, marginTop: '-22px'}, 200, function(){ 77 jQuery(this).remove(); 78 $this.data('omsc-tooltip',false); 79 }); 80 } 81 }); 82 83 }); 84 85 } 86} 87 88omShortcodes.modules.toggle = { 89 init: function() { 90 91 jQuery('.omsc-accordion .omsc-toggle').addClass('omsc-in-accordion').find('.omsc-toggle-title').click(function(){ 92 93 var $toggle=jQuery(this).parent(); 94 95 if($toggle.hasClass('omsc-expanded')) { 96 $toggle.removeClass('omsc-expanded'); 97 $toggle.find('.omsc-toggle-inner').slideUp(300); 98 return false; 99 } 100 101 var $acc=$toggle.parents('.omsc-accordion'); 102 if(!$acc.hasClass('omsc-multiopen')) 103 $acc.find('.omsc-toggle.omsc-expanded').removeClass('omsc-expanded').find('.omsc-toggle-inner').slideUp(300); 104 105 $toggle.find('.omsc-toggle-inner').slideDown(300,function(){ 106 var h=jQuery(this).parent().height(); 107 var pos=jQuery(this).parent().find('.omsc-toggle-title').offset(); 108 var scroll=jQuery(window).scrollTop(); 109 var wh=jQuery(window).height(); 110 if(pos.top < scroll || (pos.top > scroll && pos.top+h > scroll+wh)) 111 jQuery('html,body').animate({ scrollTop: pos.top+'px' }, 200); 112 }).find('iframe[src*="maps.google"]').each(function(){ 113 jQuery(this).attr('src',jQuery(this).attr('src')); 114 }); 115 $toggle.addClass('omsc-expanded'); 116 117 }); 118 119 jQuery('.omsc-toggle').not('.in-accordion').find('.omsc-toggle-title').click(function(){ 120 121 var $toggle=jQuery(this).parent(); 122 123 var $inner=$toggle.find('.omsc-toggle-inner'); 124 if(!$inner.length) 125 return false; 126 if($inner.is(':animated')) 127 return false; 128 129 $toggle.toggleClass('omsc-expanded'); 130 $inner.slideToggle(300); 131 if($toggle.hasClass('omsc-expanded')) { 132 $inner.find('iframe[src*="maps.google"]').each(function(){ 133 jQuery(this).attr('src',jQuery(this).attr('src')); 134 }); 135 } 136 137 return false; 138 }); 139 140 } 141} 142 143omShortcodes.modules.tabs = { 144 init: function() { 145 146 var hash=window.location.hash.replace('#',''); 147 jQuery('.omsc-tabs').each(function(){ 148 if(hash != '' && jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab.omsc-'+hash).length ) { 149 jQuery(this).find('.omsc-tabs-control a[href$=#'+hash+']').parent().addClass('omsc-active'); 150 jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab').hide().filter('.omsc-'+hash).addClass('omsc-active').show(); 151 } else { 152 jQuery(this).find('.omsc-tabs-control li:first').addClass('omsc-active'); 153 jQuery(this).find('.omsc-tabs-tabs .omsc-tabs-tab:first').addClass('omsc-active').show(); 154 } 155 }); 156 157 jQuery('.omsc-tabs .omsc-tabs-control a').click(function(){ 158 159 var $tabs=jQuery(this).parents('.omsc-tabs'); 160 var $tabstabs=$tabs.find('.omsc-tabs-tabs'); 161 var $li=jQuery(this).parent(); 162 163 if($li.hasClass('omsc-active')) 164 return false; 165 166 var tabname=jQuery(this).attr('href').split('#'); 167 tabname=tabname[(tabname.length-1)]; 168 169 $tabs.find('.omsc-tabs-control li').removeClass('omsc-active'); 170 $li.addClass('omsc-active'); 171 172 var $newtab=$tabs.find('.omsc-tabs-tabs .omsc-tabs-tab.omsc-'+tabname); 173 174 $tabstabs.stop(true); 175 var cur_h=$tabstabs.height(); 176 $tabstabs.css('height',cur_h+'px'); 177 178 $tabstabs.find('.omsc-tabs-tab.omsc-active').hide().removeClass('omsc-active'); 179 $newtab.addClass('omsc-active').fadeIn(300); 180 181 $newtab.find('iframe[src*="maps.google"]').each(function(){ 182 jQuery(this).attr('src',jQuery(this).attr('src')); 183 }); 184 185 var new_h=$newtab.outerHeight(); 186 if(Math.abs(cur_h - new_h) > 4) { 187 $tabstabs.animate({height: new_h + 'px'}, 300, function(){ 188 jQuery(this).css('height','auto'); 189 }); 190 } else { 191 $tabstabs.css('height','auto'); 192 } 193 194 195 return false; 196 }); 197 198 } 199} 200 201omShortcodes.modules.responsivebox = { 202 init: function() { 203 204 jQuery('.omsc-responsive-box').each(function(){ 205 var $obj=jQuery(this).children(':first'); 206 if($obj.length) { 207 var w=parseInt($obj.attr('width')); 208 var h=parseInt($obj.attr('height')); 209 if(!isNaN(w) && !isNaN(h) && w > 0 && h > 0) { 210 var r=h/w; 211 jQuery(this).css('padding-bottom',(r*100)+'%'); 212 } 213 } 214 }); 215 216 } 217} 218 219omShortcodes.modules.counter = { 220 init: function() { 221 222 var interval=30; 223 224 function om_tick(args) { 225 args.obj.text([args.prefix, args.current, args.suffix].join(''));
226 if(args.current < args.count) { 227 args.current+=args.step; 228 if(args.current > args.count) 229 args.current=args.count; 230 231 setTimeout(function(){ 232 om_tick(args); 233 }, args.interval); 234 } 235 } 236 237 function om_start_item(obj) { 238 var $this=jQuery(obj); 239 var count=$this.data('count'); 240 var duration=$this.data('animation'); 241 if(count && duration) { 242 if(duration > interval) { 243 244 var step=Math.ceil( count / (duration/interval) ); 245 if(step < 1) 246 step=1; 247 om_tick({ 248 obj: $this.find('.omsc-counter-number'), 249 current: 0, 250 count: count, 251 step: step, 252 interval: interval, 253 prefix: $this.data('prefix'), 254 suffix: $this.data('suffix') 255 }); 256 257 } 258 } 259 } 260 261 262 if(jQuery.waypoints) { 263 jQuery('.omsc-counter').each(function(){ 264 265 jQuery(this).waypoint(function(){ 266 om_start_item(this); 267 },{ 268 offset: '100%', 269 triggerOnce: true 270 }); 271 272 }); 273 } else { 274 jQuery('.omsc-counter').each(function(){ 275 276 om_start_item(this); 277 278 }); 279 } 280 281 } 282}
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.