PageSourceSearch

https://rebuildingtogether-stl.org/sites/all/modules/voteproject/js/voteproject.js?t7dtjy

js rebuildingtogether-stl.org collected 2026-09-30 20:34:23 UTC 4,077 bytes, 115 lines download raw bytes

1(function ($) {
2
3    $(document).ready(function() {
4
5        if ($('#edit-field-hide-page-und').length) {
6          for(var i=0;i<30;i++) {
7            var num = (!i ? '' : (i+1));
8            $('#edit-field-hide-page' + num + '-und').parent().parent().parent().prev().find('span.fieldset-legend').append($('#edit-field-hide-page' + num + '-und'));
9            $('#edit-field-hide-page' + num + '-und').css('margin-bottom', '2px');
10            $('#edit-field-hide-page' + num + '-und').after('<label class="option" style="font-weight: 300; color: #333;" for="edit-field-hide-page' + num + '-und">Hide page </label>');
11            $('div.form-item-field-hide-page' + num + '-und').remove();
12          }
13        }
14
15	if (document.location.href.indexOf('/statelocations/')!=-1) {
16
17          $('div.field-item.even').filter(function(){ return $(this).text().toLowerCase() === '1';}).text('page hidden from view');
18          $('div.field-item.even').filter(function(){ return $(this).text().toLowerCase() === '0';}).text('page visible');
19
20          $.ajax({
21           url: Drupal.settings.voteproject.ajaxMinisiteaffiliateUrl,
22           method: "POST",
23           data: {url: document.location.href},
24           dataType: "json",         
25           success: function(data) {
26                if (!data.error) {
27        	        $('div.field-name-field-state').prepend('<div class="form-item form-type-textfield" style="font-size: 20px"><a href="/affiliates/' + data.url + '" target=_blank>Go to minisite</a></div>');
28		}
29           }
30
31         });
32
33          // $( "div.field-item.even:contains('1')" ).text('page hidden from view');
34          // $( "div.field-item.even:contains('0')" ).text('page visible');
35        }
36
37        setTimeout(function() {
38          $('a.tabledrag-handle div.handle').css('width', '25px');
39          $('a.tabledrag-handle div.handle').css('height', '25px');
40        }, 2000);
41
42	if (document.location.href.indexOf('/node/')!=-1 && document.location.href.indexOf('/edit')!=-1) {
43          var nid = document.location.href.split('/node/')[1];
44          nid = nid.substr(0, nid.indexOf('/edit'));
45          $.ajax({
46           url: Drupal.settings.voteproject.ajaxMinisiteUrl,
47           method: "POST",
48           data: {nid: nid},
49           dataType: "json",         
50           success: function(data) {
51                if (!data.error) {
52        	        $('.form-item-title').prepend('<div class="form-item form-type-textfield" style="font-size: 20px"><a href="/affiliates/' + data.url + '" target=_blank>Front-end</a></div>');
53		}
54           }
55
56         });
57        }
58
59	if (document.location.href.indexOf('/node/add/local-affiliate')!=-1) {
60                $('.form-item-title').prepend('<div class="form-item form-type-textfield"><a>Front-end</a></div>');
61		$('#edit-title').on('keyup', function(event) {
62                     console.log(event.target.value)
63                     var val = event.target.value.replace(/[^a-zA-Z- ]/g, "");
64                     val = val.replace(/[ ]/g, "-").toLowerCase();
65                     $('#edit-field-alias-subfolder-und-0-value').val(val);
66                });
67        }
68
69    });
70
71
72  Drupal.behaviors.voteproject = {
73    attach: function (context, settings) {
74      
75      $('#exportvotes', context).click(function () {
76
77          $.ajax({
78           url: Drupal.settings.voteproject.ajaxCsvUrl,
79           method: "POST",
80           success: function(data) {
81		window.open(data);
82           }
83
84         });
85
86      });
87
88      $('#submitvote', context).click(function () {
89
90          $.ajax({
91           url: Drupal.settings.voteproject.ajaxUrl,
92           method: "POST",
93           data: $("#voteform").serialize(),
94           dataType: "json",         
95           success: function(data) {
96		$('#popuperror').html('');
97		if(data.error) {
98			$('#popuperror').html(data.error);
99		} else {
100			$('#pop-up .inner').hide();
101			$('#pop-up .inner_thank').show();
102			$.each(data, function(i, item) {
103			    $('#vote'+i).html(item+'%');
104			});
105		}
106           }
107
108         });
109
110      });
111      
112    }
113  };
114
115}(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.