home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (uc_store.js)

This example Drupal source code file (uc_store.js) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

else, function, if, panel_id, php, q=admin/store/customers/orders, q=admin/store/orders, show-links, uc-cust-orders-table, uc-customer-table, var

The uc_store.js Drupal example source code

// $Id: uc_store.js,v 1.9.2.2 2009/07/21 14:37:21 islandusurper Exp $

/**
 * @file
 * Add click events to the orders table and administration dashboard.
 */

/**
 * Add the "show links" click behavior on the store admin display.
 */
Drupal.behaviors.ucStoreMoreLinks = function(context) {
  $('.uc-store-admin-panel:not(.ucStoreMoreLinks-processed)', context).addClass('ucStoreMoreLinks-processed').each(
    function() {
      var panel_id = this.id.substring(6);
      $('#show-links-' + panel_id).click(
        function() {
          var panel_id = this.id.substring(11);
          $('#panel-' + panel_id + ' .panel-links').toggle();
          if ($('#panel-' + panel_id + ' .panel-show-link').html() == '<a>' + Drupal.settings.ucTextShow + '</a>') {
            $('#panel-' + panel_id + ' .panel-show-link').html('<a>' + Drupal.settings.ucTextHide + '</a>');
          }
          else {
            $('#panel-' + panel_id + ' .panel-show-link').html('<a>' + Drupal.settings.ucTextShow + '</a>');
          }
        }
      );
    }
  );
}

/**
 * Add the double click behavior to the order table rows
 */
Drupal.behaviors.ucCustomerOrder = function(context) {
  $('.uc-customer-table tr.odd, .uc-customer-table tr.even:not(.ucCustomerOrder-processed)', context).addClass('ucCustomerOrder-processed').each(
    function() {
      $(this).dblclick(
        function() {
          window.location = Drupal.settings.basePath + '?q=admin/store/customers/orders/' + this.id.substring(9);
        }
      );
    }
  );
}

/**
 * Add the double click to the customer orders table rows.
 */
Drupal.behaviors.ucCustomerOrders = function(context) {
  $('.uc-cust-orders-table tr.odd, .uc-cust-orders-table tr.even:not(.ucCustomerOrders-processed)', context).addClass('ucCustomerOrders-processed').each(
    function() {
      $(this).dblclick(
        function() {
          window.location = Drupal.settings.basePath + '?q=admin/store/orders/' + this.id.substring(6);
        }
      );
    }
  );
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal uc_store.js source code file:

new blog posts

 


"Drupal" is a registered trademark of Dries Buytaert.

our drupal tutorials and examples  
 

Copyright 1998-2014 Alvin Alexander, alvinalexander.com
All Rights Reserved.