PageSourceSearch

https://fna.hu/sites/all/modules/hotblocks/js/hotblocks.js?h

js fna.hu collected 2026-10-02 11:49:00 UTC 5,387 bytes, 174 lines download raw bytes

1
2Drupal.hotblocks = {
3};
4Drupal.hotblocks.loader = function() {
5  $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
6  $("#TB_overlay").click(tb_remove);
7  if(tb_detectMacXFF()){
8    $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
9  }else{
10    $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
11  }
12  $('body').append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
13  $('#TB_load').show();//show loader
14}
15
16Drupal.hotblocks.unloader = function() {
17  $("#TB_overlay").remove();
18  $('#TB_load').remove();
19}
20/*Drupal.hotblocks.tb_init_original = tb_init;
21
22// new tb_init function - make sure to call reference to original function
23Drupal.hotblocks.tb_init = function(domChunk){
24	//original function:
25	 $(domChunk).click(function(){
26  var t = this.title || this.name || null;
27  var a = this.href || this.alt;
28  var g = this.rel || false;
29  tb_show(t,a,g);
30  this.blur();
31  Drupal.attachBehaviors($('#TB_window'));
32  return false;
33  });
34  //Drupal.hotblocks.tb_init_original(domchunk);
35};
36
37// overwrite tb_init with new function
38tb_init = Drupal.hotblocks.tb_init;*/
39
40var gHotblockItemId;
41
42//now we can attach behaviors that will get executed on the markup returned in the thickbox window
43//Note- jquery.thickbox.js has been modified so Drupal.attachBehaviors is called on it.  I forget why it had to be modified,
44//I was probably having difficulty overriding a function...maybe I was just being lazy.
45/*
46Drupal.behaviors.hotblocksassign = function(context) {
47  //alert('works!');
48  $('.hotblocks-assign', context).click(function() {
49    //close the thickbox
50    tb_remove();
51    gHotblockItemId = this.rel;
52    $('.hotblocks_itemblock').addClass('messages');
53    $('.hotblocks_itemblock').addClass('error');
54    $('.hotblocks_itemblock').one("click",function() {
55      //alert(this.className+' rel:'+gHotblockItemId);
56      $(this).append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
57      $('#TB_load').show();//show loader
58      $('#'+this.id).load('/hotblocks/assign/'+this.id+'/'+gHotblockItemId,function() {
59      //alert('ajax success');
60        $('.hotblocks_itemblock').removeClass('messages');
61        $('.hotblocks_itemblock').removeClass('error');
62      });
63    });
64    return false;
65  });
66*/
67Drupal.behaviors.hotblocks_itembehaviors = function(context) {
68  $('.donthide').show();
69  //reattach thickbox links
70  tb_init($('a.hotblocks_itemthickbox, area.hotblocks_itemthickbox, input.hotblocks_itemthickbox', context));
71  
72  //This is the link handler for creation links clicked in the thickbox
73  $('.hotblocks_item-create', context).click(function() {
74    var href = this.href;
75    if($("#hotblocks-global:checked").length) {
76      href += '&global=1';
77    }
78    location = href;
79    return false;
80  });
81  
82  //This is the link handler for assignment links clicked in the thickbox
83  $('.hotblocks-assign', context).click(function() {
84    //close the thickbox
85    tb_remove();
86    
87    var href, parentid, global;
88    parentid = '#'+this.rel;
89    //href = this.href+'&destination='+location.pathname;
90    href = this.href;
91    if($("#hotblocks-global:checked").length) {
92      href += '&global=1';
93    }
94    
95    Drupal.hotblocks.loader()
96    
97    $(parentid).load(href,function() {
98      Drupal.attachBehaviors($(parentid));
99      Drupal.hotblocks.unloader()
100    });
101    return false;
102  });
103  
104  $('.hotblocks-remove', context).click(function(event) {
105    //@todo - notice this is duplicate code as above..
106    var href, parentid;
107    href = this.href;
108    parentid = '#'+this.rel;
109    
110    Drupal.hotblocks.loader()
111    
112    $(parentid).load(href,function() { 
113      Drupal.attachBehaviors($(parentid));
114      Drupal.hotblocks.unloader()
115    });
116    return false;
117  });
118  
119  $('.hotblocks-reorder', context).click(function(event) {
120    //@todo - notice this is duplicate code as above..
121    var href, parentid;
122    href = this.href;
123    parentid = '#'+this.rel;
124    
125    Drupal.hotblocks.loader()
126    
127    $(parentid).load(href,function() { 
128      Drupal.attachBehaviors($(parentid));
129      Drupal.hotblocks.unloader()
130    });
131    gHotblockItemId = parentid;
132    return false;
133  });
134  
135  var options = { 
136    target:        gHotblockItemId,   // target element(s) to be updated with server response 
137    beforeSubmit:  function() {
138      //$('body').append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
139      //$('#TB_load').show();//show loader
140      Drupal.hotblocks.loader();
141    },
142    success: function() {
143      $('#TB_load').hide();//show loader
144      Drupal.attachBehaviors($(gHotblockItemId));
145      Drupal.hotblocks.unloader()
146    }
147  }; 
148  
149  // bind form using 'ajaxForm' 
150  $('#hotblocks-reorder-form',context).ajaxForm(options); 
151  
152}
153
154
155//////////////////////////////////
156Drupal.behaviors.resourceLibraries = function(context){
157  //hide or unhide child items when a parent is expanded
158  $(".toggle a", context).click(function(event){
159
160    var el = $(this.parentNode.parentNode.parentNode.parentNode)
161    var next;
162
163    var depth = Number($(el).attr('rel'))+1;
164
165    $('.toggle',this.parentNode.parentNode.parentNode).toggle();
166    $('.depth-'+depth,el).toggle();
167    /*while(el.next('.depth-'+depth).length) {
168      next = el.next('.depth-'+depth);
169      $(next).toggle();
170      el = next;
171    }*/
172    return false;
173  });
174}

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.