PageSourceSearch

http://americanmariners.org/sites/default/files/js/js_OAUEqPK2wxBtwOxLYFD3me42dgyEUi2uZYh5asdzrts.js

js americanmariners.org collected 2026-10-07 19:28:39 UTC 8,644 bytes, 277 lines download raw bytes

1(function ($) {
2    'use strict';
3    Drupal.behaviors.ACChangeEnterBehavior = {
4        attach: function (context, settings) {
5            $('input.form-autocomplete', context).once('ac-change-enter-behavior', function() {
6                $(this).keypress(function(e) {
7                    var ac = $('#autocomplete');
8                    if (e.keyCode == 13 && typeof ac[0] != 'undefined') {
9                        e.preventDefault();
10                        ac.each(function () {
11                            if(this.owner.selected == false){
12                                this.owner.selectDown();
13                            }
14                            this.owner.hidePopup();
15                        });
16                        $(this).trigger('change');
17                    }
18                });
19            });
20        }
21    };
22}(jQuery));
23;
24/**
25 * @file
26 * SimpleAds JS Helper.
27 */
28
29(function ($) {
30  Drupal.behaviors.simpleads = {
31    attach: function(context) {
32      var ad_type = $('#edit-field-ad-type select[id^=edit-field-ad-type]').val();
33      var ad_text_format = $('#field-ad-text-add-more-wrapper select[id^=edit-field-ad-text]').val();
34      _simpelads_switch_form(ad_type, ad_text_format);
35      $('#edit-field-ad-type select[id^=edit-field-ad-type]').change(function(){
36        ad_type = $(this).val();
37        _simpelads_switch_form(ad_type, ad_text_format);
38      });
39      _simpelads_switch_form(ad_type, ad_text_format);
40      $('#field-ad-text-add-more-wrapper select[id^=edit-field-ad-text]').change(function(){
41        ad_text_format = $(this).val();
42        _simpelads_switch_form(ad_type, ad_text_format);
43      });
44      var ad_block_limit = $('form#block-admin-configure #edit-ads-limit').val();
45      var ad_block_rotation_type = $('form#block-admin-configure #edit-ads-rotation-type').val();
46      _simpelads_switch_block_settings(ad_block_limit, false);
47      $('form#block-admin-configure #edit-ads-limit').change(function(){
48        _simpelads_switch_block_settings($(this).val(), false);
49      });
50      _simpelads_switch_block_settings(ad_block_rotation_type, 'delay');
51      $('form#block-admin-configure #edit-ads-rotation-type').change(function(){
52        _simpelads_switch_block_settings($(this).val(), 'delay');
53      });
54    }
55  };
56}(jQuery));
57
58/**
59 * Show/hide form elements.
60 */
61function _simpelads_switch_form(ad_type, p1) {
62  (function ($) {
63    el_image = $('form#simpleads-node-form #edit-field-ad-image');
64    el_url = $('form#simpleads-node-form #edit-field-ad-url');
65    el_url_target = $('form#simpleads-node-form #edit-field-ad-url-taget');
66    el_flash = $('form#simpleads-node-form #edit-field-ad-flash');
67    el_text = $('form#simpleads-node-form #edit-field-ad-text');
68    if (ad_type == 'graphic') {
69      el_image.show();
70      el_url.show();
71      el_url_target.show();
72      el_flash.hide();
73      el_text.hide();
74    }
75    else if (ad_type == 'text') {
76      el_text.show();
77      el_image.hide();
78      el_url.hide();
79      el_flash.hide();
80      if (p1 == 'plain_text') {
81        el_url.show();
82        el_url_target.show();
83      }
84      else {
85        el_url.hide();
86        el_url_target.hide();
87      }
88    }
89    else if (ad_type == 'flash') {
90      el_url.show();
91      el_url_target.show();
92      el_flash.show();
93      el_image.hide();
94      el_text.hide();
95    }
96  }(jQuery));
97}
98
99/**
100 * Show/hide block settings.
101 */
102function _simpelads_switch_block_settings(ad_setting_value, setting) {
103  (function ($) {
104    if (setting == false) {
105      ad_rotation = $('form#block-admin-configure #ads_rotation_settings');
106      if (ad_setting_value != 1)
107        ad_rotation.show();
108      else
109        ad_rotation.hide();
110    }
111    else {
112      if (setting == 'delay') {
113        ad_rotation_delay = $('form#block-admin-configure #ads_rotation_settings .form-item-ads-rotation-delay');
114        if (ad_setting_value == 0)
115          ad_rotation_delay.hide();
116        else
117          ad_rotation_delay.show();
118      }
119    }
120  }(jQuery));
121}
122
123/**
124 * Ajax call for Ads.
125 * elem - Ad container
126 * tid  - term id
127 * num - numer of ads to display
128 * img_loader - image (ad load indicator), should be HTML tag <img src="loader.gif">
129 */
130function _simpelads_load(elem, tid, num, img_loader) {
131  (function ($) {
132    basepath = Drupal.settings.basePath;
133    if (tid > 0 && num > 0) {
134      if (img_loader != '')
135        $(elem).html(img_loader);
136      $.get(basepath + '?q=simpleads/load/' + tid + '/' + num, function (data) {
137        $(elem).html(data);
138      });
139    }
140  }(jQuery));
141}
142
143/**
144 * jQuery Plugin.
145 * SimpleAds rotator.
146 */
147(function ($) {
148  $.simpleads_globals = {
149    pos: []
150  };
151  $.simpleads_rotator = function(element, options) {
152    this.options = {};
153    element.data('simpleads_rotator', this);
154    this.init = function (element, options) {
155      this.options = $.extend({}, $.simpleads_rotator.defaultOptions, options);
156      $.simpleads_globals.pos[options.delta] = 0;
157      simpleads_start(element, this.options);
158    };
159    this.init(element, options);
160  };
161
162  $.fn.simpleads_rotator = function(options) {
163    return this.each(function(){
164      (new $.simpleads_rotator($(this), options));
165    });
166  }
167
168  function run_rotation(element, options) {
169    elem_id = element.attr('id');
170    total_ads = $('#' + elem_id + " > div").size();
171    if ($.simpleads_globals.pos[options.delta] == (total_ads - 1)) {
172      $.simpleads_globals.pos[options.delta] = 0;
173    }
174    else {
175      $.simpleads_globals.pos[options.delta]++;
176    }
177
178    $('#' + elem_id + " div").hide();
179    var simpleads_elem = $('#' + elem_id + " > div:eq(" + $.simpleads_globals.pos[options.delta] + ")");
180    
181    if (options.rotation_type == 1) {
182      simpleads_elem.show();
183    }
184    else if (options.rotation_type == 2) {
185      simpleads_elem.fadeIn('fast');
186    }
187    else {
188      simpleads_elem.show();
189    }
190    return false;
191  }
192
193  function simpleads_start(element, options) {
194    run_rotation(element, options); 
195    setInterval(function(){run_rotation(element, options);}, options.delay);
196  }
197
198  $.simpleads_rotator.defaultOptions = {
199    rotation_type: 1,
200    delay: 5,
201    delta: 0
202  };
203
204}(jQuery));;
205/**
206 * @file
207 * SimpleAds Campaigns JS helper.
208 */
209
210(function ($) {
211  Drupal.behaviors.simpleads_campaigns = {
212    attach: function(context) {
213      var impressions = $('#edit-field-adcamp-impression input[id^=edit-field-adcamp-impression-]');
214      _simpelads_campaigns_switch_form(impressions, 'impressions');
215      $('#edit-field-adcamp-impression input[id^=edit-field-adcamp-impression-]').change(function(){
216        _simpelads_campaigns_switch_form($(this), 'impressions');
217      });
218      var clicks = $('#edit-field-adcamp-click input[id^=edit-field-adcamp-click-]');
219      _simpelads_campaigns_switch_form(clicks, 'clicks');
220      $('#edit-field-adcamp-click input[id^=edit-field-adcamp-click-]').change(function(){
221        _simpelads_campaigns_switch_form($(this), 'clicks');
222      });
223      var days = $('#edit-field-adcamp-day input[id^=edit-field-adcamp-day-]');
224      _simpelads_campaigns_switch_form(days, 'days');
225      $('#edit-field-adcamp-day input[id^=edit-field-adcamp-day-]').change(function(){
226        _simpelads_campaigns_switch_form($(this), 'days');
227      });
228
229      var campaigns = $('#edit-campaign').val();
230      if (campaigns == '_none') {
231        $('#edit-field-ad-end-date').show();
232      }
233      else {
234        $('#edit-field-ad-end-date').hide();
235      }
236
237      $('#edit-campaign').change(function(){
238        if ($(this).val() == '_none') {
239          $('#edit-field-ad-end-date').slideDown();
240        }
241        else {
242          $('#edit-field-ad-end-date').slideUp();
243        }
244      });
245
246    }
247  };
248}(jQuery));
249
250/**
251 * Show/hide form elements.
252 */
253function _simpelads_campaigns_switch_form(el, type) {
254  (function ($) {
255    el_impressions = $('form#simpleads-campaign-node-form #edit-field-adcamp-impressions');
256    el_clicks = $('form#simpleads-campaign-node-form #edit-field-adcamp-clicks');
257    el_days = $('form#simpleads-campaign-node-form #edit-field-adcamp-days');
258    if (el.attr('checked') == true && type == 'impressions') {
259      el_impressions.slideDown();
260    }
261    if (el.attr('checked') == false && type == 'impressions') {
262      el_impressions.slideUp();
263    }
264    if (el.attr('checked') == true && type == 'clicks') {
265      el_clicks.slideDown();
266    }
267    if (el.attr('checked') == false && type == 'clicks') {
268      el_clicks.slideUp();
269    }
270    if (el.attr('checked') == true && type == 'days') {
271      el_days.slideDown();
272    }
273    if (el.attr('checked') == false && type == 'days') {
274      el_days.slideUp();
275    }
276  }(jQuery));
277};

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.