PageSourceSearch

https://bejar.biz/modules/img_assist/img_assist.js

js bejar.biz collected 2026-10-02 11:39:49 UTC 2,291 bytes, 57 lines download raw bytes

1/* $Id: img_assist.js,v 1.4.2.5.2.2 2009/01/18 03:54:53 sun Exp $ */
2
3// D5 only.
4Drupal.behaviors = Drupal.behaviors || {};
5Drupal.theme = Drupal.theme || function(func) {
6  for (var i = 1, args = []; i < arguments.length; i++) {
7    args.push(arguments[i]);
8  }
9
10  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
11};
12
13Drupal.behaviors.img_assist = function(context) {
14  $('textarea.img_assist:not(.img_assist-processed)', context).each(function() {
15    // Drupal's teaser behavior is a destructive one and needs to be run first.
16    if ($(this).is('textarea.teaser:not(.teaser-processed)')) {
17      Drupal.behaviors.teaser(context);  
18    }
19    $(this).addClass('img_assist-processed').parent().append(Drupal.theme('img_assist_link', this));
20  });
21}
22
23Drupal.theme.prototype.img_assist_link = function(el) {
24  var html = '<div class="img_assist-button">', link = Drupal.settings.img_assist.link_text;
25  if (Drupal.settings.img_assist.link == 'icon') {
26    link = '<img src="'+ Drupal.settings.basePath + Drupal.settings.img_assist.icon +'" alt="'+ link +'" title="'+ link +'" />';
27  }
28  html += '<a href="'+ Drupal.settings.basePath +'index.php?q=img_assist/load/textarea&textarea='+ el.name +'" class="img_assist-link" id="img_assist-link-'+ el.id +'" title="'+ Drupal.settings.img_assist.link_text +'" onclick="window.open(this.href, \'img_assist_link\', \'width=1000,height=700,scrollbars=yes,status=yes,resizable=yes,toolbar=no,menubar=no\'); return false;">'+ link +'</a>';
29  html += '</div>';
30  return html;
31}
32
33function launch_popup(nid, mw, mh) {
34  var ox = mw;
35  var oy = mh;
36  if((ox>=screen.width) || (oy>=screen.height)) {
37    var ox = screen.width-150;
38    var oy = screen.height-150;
39    var winx = (screen.width / 2)-(ox / 2);
40    var winy = (screen.height / 2)-(oy / 2);
41    var use_scrollbars = 1;
42  }
43  else {
44    var winx = (screen.width / 2)-(ox / 2);
45    var winy = (screen.height / 2)-(oy / 2);
46    var use_scrollbars = 0;
47  }
48  var win = window.open(Drupal.settings.basePath + 'index.php?q=img_assist/popup/' + nid, 'imagev', 'height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable');
49}
50
51/**
52 * D5 only: Queue our attach behavior.
53 */
54$(function() {
55  Drupal.behaviors.img_assist(document);
56});
57

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.