code
stringlengths
1
2.08M
language
stringclasses
1 value
(function ($) { /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'...
JavaScript
(function ($) { /** * Attach the machine-readable name form element behavior. */ Drupal.behaviors.machineName = { /** * Attaches the behavior. * * @param settings.machineName * A list of elements to process, keyed by the HTML ID of the form element * containing the human-readable value. Each ele...
JavaScript
(function ($) { Drupal.behaviors.tableSelect = { attach: function (context, settings) { // Select the inner-most table in case of nested tables. $('th.select-all', context).closest('table').once('table-select', Drupal.tableSelect); } }; Drupal.tableSelect = function () { // Do not add a "Select all" che...
JavaScript
/** * jQuery Once Plugin v1.2 * http://plugins.jquery.com/project/once * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ (function ($) { var cache = {}, uuid = 0; /** * Filters elements by whether they ha...
JavaScript
/** * @file * Conditionally hide or show the appropriate settings and saved defaults * on the file transfer connection settings form used by authorize.php. */ (function ($) { Drupal.behaviors.authorizeFileTransferForm = { attach: function(context) { $('#edit-connection-settings-authorize-filetransfer-defau...
JavaScript
(function ($) { /** * Retrieves the summary for the first element. */ $.fn.drupalGetSummary = function () { var callback = this.data('summaryCallback'); return (this[0] && callback) ? $.trim(callback(this[0])) : ''; }; /** * Sets the summary for all matched elements. * * @param callback * Either a functio...
JavaScript
(function ($) { /** * The base States namespace. * * Having the local states variable allows us to use the States namespace * without having to always declare "Drupal.states". */ var states = Drupal.states = { // An array of functions that should be postponed. postponed: [] }; /** * Attaches the states. */...
JavaScript
(function ($) { /** * Attaches the batch behavior to progress bars. */ Drupal.behaviors.batch = { attach: function (context, settings) { $('#progress', context).once('batch', function () { var holder = $(this); // Success: redirect to the summary. var updateCallback = function (progress, sta...
JavaScript
(function ($) { Drupal.behaviors.textarea = { attach: function (context, settings) { $('.form-textarea-wrapper.resizable', context).once('textarea', function () { var staticOffset = null; var textarea = $(this).addClass('resizable-textarea').find('textarea'); var grippie = $('<div class="grippi...
JavaScript
(function ($) { /** * Attaches the autocomplete behavior to all required fields. */ Drupal.behaviors.autocomplete = { attach: function (context, settings) { var acdb = []; $('input.autocomplete', context).once('autocomplete', function () { var uri = this.value; if (!acdb[uri]) { acdb[ur...
JavaScript
(function ($) { /** * This script transforms a set of fieldsets into a stack of vertical * tabs. Another tab pane can be selected by clicking on the respective * tab. * * Each tab may have a summary which can be updated by another * script. For that to work, each fieldset has an associated * 'verticalTabCallba...
JavaScript
(function ($) { /** * Set the client's system time zone as default values of form fields. */ Drupal.behaviors.setTimezone = { attach: function (context, settings) { $('select.timezone-detect', context).once('timezone', function () { var dateString = Date(); // In some client environments, date stri...
JavaScript
(function ($) { /** * Toggle the visibility of a fieldset using smooth animations. */ Drupal.toggleFieldset = function (fieldset) { var $fieldset = $(fieldset); if ($fieldset.is('.collapsed')) { var $content = $('> .fieldset-wrapper', fieldset).hide(); $fieldset .removeClass('collapsed') .tri...
JavaScript
(function ($) { /** * Attaches sticky table headers. */ Drupal.behaviors.tableHeader = { attach: function (context, settings) { if (!$.support.positionFixed) { return; } $('table.sticky-enabled', context).once('tableheader', function () { $(this).data("drupal-tableheader", new Drupal.table...
JavaScript
/** * Cookie plugin 1.0 * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=...
JavaScript
(function ($) { /** * Provides Ajax page updating via jQuery $.ajax (Asynchronous JavaScript and XML). * * Ajax is a method of making a request via JavaScript while viewing an HTML * page. The request returns an array of commands encoded in JSON, which is * then executed to make any changes that are necessary to ...
JavaScript
(function ($) { Drupal.behaviors.menuFieldsetSummaries = { attach: function (context) { $('fieldset.menu-link-form', context).drupalSetSummary(function (context) { if ($('.form-item-menu-enabled input', context).is(':checked')) { return Drupal.checkPlain($('.form-item-menu-link-title input', contex...
JavaScript
(function ($) { Drupal.behaviors.menuChangeParentItems = { attach: function (context, settings) { $('fieldset#edit-menu input').each(function () { $(this).change(function () { // Update list of available parent menu items. Drupal.menu_update_parent_list(); }); }); } }; /** * F...
JavaScript
Drupal.t("Standard Call t"); Drupal . t ( "Whitespace Call t" ) ; Drupal.t('Single Quote t'); Drupal.t('Single Quote \'Escaped\' t'); Drupal.t('Single Quote ' + 'Concat ' + 'strings ' + 't'); Drupal.t("Double Quote t"); Drupal.t("Double Quote \"Escaped\" t"); Drupal.t("Double Quote " + "Concat " + "strings " + "t");...
JavaScript
(function ($) { /** * Attaches language support to the jQuery UI datepicker component. */ Drupal.behaviors.localeDatepicker = { attach: function(context, settings) { // This code accesses Drupal.settings and localized strings via Drupal.t(). // So this code should run after these are initialized. By placin...
JavaScript
(function ($) { Drupal.toolbar = Drupal.toolbar || {}; /** * Attach toggling behavior and notify the overlay of the toolbar. */ Drupal.behaviors.toolbar = { attach: function(context) { // Set the initial state of the toolbar. $('#toolbar', context).once('toolbar', Drupal.toolbar.init); // Toggling t...
JavaScript
/** * @file * Javascript behaviors for the Book module. */ (function ($) { Drupal.behaviors.bookFieldsetSummaries = { attach: function (context) { $('fieldset.book-outline-form', context).drupalSetSummary(function (context) { var $select = $('.form-item-book-bid select'); var val = $select.val();...
JavaScript
/** * @file * Attaches the behaviors for the Field UI module. */ (function($) { Drupal.behaviors.fieldUIFieldOverview = { attach: function (context, settings) { $('table#field-overview', context).once('field-overview', function () { Drupal.fieldUIFieldOverview.attachUpdateSelects(this, settings); ...
JavaScript
/** * @file * Attaches behaviors for the Contextual module. */ (function ($) { Drupal.contextualLinks = Drupal.contextualLinks || {}; /** * Attaches outline behavior for regions associated with contextual links. */ Drupal.behaviors.contextualLinks = { attach: function (context) { $('div.contextual-links-w...
JavaScript
(function ($) { /** * Auto-hide summary textarea if empty and show hide and unhide links. */ Drupal.behaviors.textSummary = { attach: function (context, settings) { $('.text-summary', context).once('text-summary', function () { var $widget = $(this).closest('div.field-type-text-with-summary'); var...
JavaScript
(function ($) { /** * Attach handlers to evaluate the strength of any password fields and to check * that its confirmation is correct. */ Drupal.behaviors.password = { attach: function (context, settings) { var translate = settings.password; $('input.password-field', context).once('password', function () ...
JavaScript
(function ($) { /** * Shows checked and disabled checkboxes for inherited permissions. */ Drupal.behaviors.permissions = { attach: function (context) { var self = this; $('table#permissions').once('permissions', function () { // On a site with many roles and permissions, this behavior initially has ...
JavaScript
(function ($) { /** * Provide the summary information for the block settings vertical tabs. */ Drupal.behaviors.blockSettingsSummary = { attach: function (context) { // The drupalSetSummary method required for this behavior is not available // on the Blocks administration page, so we need to make sure this...
JavaScript
/** * @file * Attaches the behaviors for the Color module. */ (function ($) { Drupal.behaviors.color = { attach: function (context, settings) { var i, j, colors, field_name; // This behavior attaches by ID, so is only valid once on a page. var form = $('#system-theme-settings .color-form', context).o...
JavaScript
/** * @file * Attaches preview-related behavior for the Color module. */ (function ($) { Drupal.color = { callback: function(context, settings, form, farb, height, width) { // Solid background. $('#preview', form).css('backgroundColor', $('#palette input[name="palette[base]"]', form).val()); ...
JavaScript
/** * @file * Attaches behaviors for the Path module. */ (function ($) { Drupal.behaviors.pathFieldsetSummaries = { attach: function (context) { $('fieldset.path-form', context).drupalSetSummary(function (context) { var path = $('.form-item-path-alias input').val(); return path ? Drupal...
JavaScript
(function ($) { /** * Handle the concept of a fixed number of slots. * * This behavior is dependent on the tableDrag behavior, since it uses the * objects initialized in that behavior to update the row. */ Drupal.behaviors.shortcutDrag = { attach: function (context, settings) { if (Drupal.tableDrag) { ...
JavaScript
(function ($) { Drupal.behaviors.contentTypes = { attach: function (context) { // Provide the vertical tab summaries. $('fieldset#edit-submission', context).drupalSetSummary(function(context) { var vals = []; vals.push(Drupal.checkPlain($('#edit-title-label', context).val()) || Drupal.t('Requires...
JavaScript
(function ($) { Drupal.behaviors.nodeFieldsetSummaries = { attach: function (context) { $('fieldset.node-form-revision-information', context).drupalSetSummary(function (context) { var revisionCheckbox = $('.form-item-revision input', context); // Return 'New revision' if the 'Create new revision' c...
JavaScript
(function ($) { /** * Show/hide the 'Email site administrator when updates are available' checkbox * on the install page. */ Drupal.hideEmailAdministratorCheckbox = function () { // Make sure the secondary box is shown / hidden as necessary on page load. if ($('#edit-update-status-module-1').is(':checked')) { ...
JavaScript
(function ($) { /** * Checks to see if the cron should be automatically run. */ Drupal.behaviors.cronCheck = { attach: function(context, settings) { if (settings.cronCheck || false) { $('body').once('cron-check', function() { // Only execute the cron check if its the right time. if (Math....
JavaScript
(function ($) { /** * Add functionality to the profile drag and drop table. * * This behavior is dependent on the tableDrag behavior, since it uses the * objects initialized in that behavior to update the row. It shows and hides * a warning message when removing the last field from a profile category. */ Drupal....
JavaScript
/** * @file * Provides JavaScript additions to the managed file field type. * * This file provides progress bar support (if available), popup windows for * file previews, and disabling of other file fields during Ajax uploads (which * prevents separate file fields from accidentally uploading files). */ (functio...
JavaScript
(function ($) { /** * Add the cool table collapsing on the testing overview page. */ Drupal.behaviors.simpleTestMenuCollapse = { attach: function (context, settings) { var timeout = null; // Adds expand-collapse functionality. $('div.simpletest-image').once('simpletest-image', function () { var $...
JavaScript
(function ($) { /** * Move a block in the blocks table from one region to another via select list. * * This behavior is dependent on the tableDrag behavior, since it uses the * objects initialized in that behavior to update the row. */ Drupal.behaviors.termDrag = { attach: function (context, settings) { var...
JavaScript
(function ($) { Drupal.behaviors.commentFieldsetSummaries = { attach: function (context) { $('fieldset.comment-node-settings-form', context).drupalSetSummary(function (context) { return Drupal.checkPlain($('.form-item-comment input:checked', context).next('label').text()); }); // Provide the summ...
JavaScript
(function ($) { Drupal.behaviors.openid = { attach: function (context) { var loginElements = $('.form-item-name, .form-item-pass, li.openid-link'); var openidElements = $('.form-item-openid-identifier, li.user-link'); var cookie = $.cookie('Drupal.visitor.openid_identifier'); // This behavior attach...
JavaScript
/** * @file * Attaches the behaviors for the Overlay parent pages. */ (function ($) { /** * Open the overlay, or load content into it, when an admin link is clicked. */ Drupal.behaviors.overlayParent = { attach: function (context, settings) { if (Drupal.overlay.isOpen) { Drupal.overlay.makeDocumentUn...
JavaScript
/** * @file * Attaches the behaviors for the Overlay child pages. */ (function ($) { /** * Attach the child dialog behavior to new content. */ Drupal.behaviors.overlayChild = { attach: function (context, settings) { // Make sure this behavior is not processed more than once. if (this.processed) { ...
JavaScript
(function ($) { Drupal.behaviors.filterStatus = { attach: function (context, settings) { $('#filters-status-wrapper input.form-checkbox', context).once('filter-status', function () { var $checkbox = $(this); // Retrieve the tabledrag row belonging to this filter. var $row = $('#' + $checkbox.at...
JavaScript
(function ($) { /** * Automatically display the guidelines of the selected text format. */ Drupal.behaviors.filterGuidelines = { attach: function (context) { $('.filter-guidelines', context).once('filter-guidelines') .find(':header').hide() .closest('.filter-wrapper').find('select.filter-list') ...
JavaScript
/** * @file * Attaches behaviors for the Dashboard module. */ (function ($) { /** * Implements Drupal.behaviors for the Dashboard module. */ Drupal.behaviors.dashboard = { attach: function (context, settings) { $('#dashboard', context).once(function () { $(this).prepend('<div class="customize clear...
JavaScript
(function($) { $(document).ready(function() { var success = function() { $('#listing-ajax-form-mail-a-friend').ajaxForm({ target: '#form', success: success }); }; Drupal.attachBehaviors(document, {}); }); })(jQuery);
JavaScript
// $Id$ (function ($) { /** * This script transforms a set of fieldsets into a stack of horizontal * tabs. Another tab pane can be selected by clicking on the respective * tab. * * Each tab may have a summary which can be updated by another * script. For that to work, each fieldset has an associated * 'horizon...
JavaScript
/** * @file * Javascript related to contextual links. */ (function ($) { Drupal.behaviors.viewsContextualLinks = { attach: function (context) { // If there are views-related contextual links attached to the main page // content, find the smallest region that encloses both the links and the // view, an...
JavaScript
/** * @file * Some basic behaviors and utility functions for Views. */ (function ($) { Drupal.Views = {}; /** * jQuery UI tabs, Views integration component */ Drupal.behaviors.viewsTabs = { attach: function (context) { if ($.viewsUi && $.viewsUi.tabs) { $('#views-tabset').once('views-processed').view...
JavaScript
/** * This is part of a patch to address a jQueryUI bug. The bug is responsible * for the inability to scroll a page when a modal dialog is active. If the content * of the dialog extends beyond the bottom of the viewport, the user is only able * to scroll with a mousewheel or up/down keyboard keys. * * @see http...
JavaScript
/** * @file * Handles AJAX fetching of views, including filter submission and response. */ (function ($) { /** * Attaches the AJAX behavior to Views exposed filter forms and key View links. */ Drupal.behaviors.ViewsAjaxView = {}; Drupal.behaviors.ViewsAjaxView.attach = function() { if (Drupal.settings && Drupal...
JavaScript
/** * @file * Some basic behaviors and utility functions for Views UI. */ Drupal.viewsUi = {}; Drupal.behaviors.viewsUiEditView = {}; /** * Improve the user experience of the views edit interface. */ Drupal.behaviors.viewsUiEditView.attach = function (context, settings) { // Only show the SQL rewrite warning w...
JavaScript
/** * @file * Handles AJAX submission and response in Views UI. */ (function ($) { Drupal.ajax.prototype.commands.viewsSetForm = function (ajax, response, status) { var ajax_title = Drupal.settings.views.ajax.title; var ajax_body = Drupal.settings.views.ajax.id; var ajax_popup = Drupal.settings.views....
JavaScript
/** * @file * Javascript related to the main view list. */ (function ($) { Drupal.behaviors.viewsUIList = { attach: function (context) { $('#ctools-export-ui-list-items thead a').once('views-ajax-processed').each(function() { $(this).click(function() { var query = $.deparam.querystring(this.href...
JavaScript
/** * @file * Adds the collapsible functionality to the rules debug log. */ // Registers the rules namespace. Drupal.rules = Drupal.rules || {}; (function($) { Drupal.behaviors.rules_debug_log = { attach: function(context) { $('.rules-debug-open').click(function () { var icon = $(this).children...
JavaScript
// Registers the rules namespace. Drupal.rules = Drupal.rules || {}; (function($) { Drupal.behaviors.rules_autocomplete = { attach: function(context) { var autocomplete_settings = Drupal.settings.rules_autocomplete; $('input.rules-autocomplete').once(function() { var input = this; n...
JavaScript
(function ($) { // Explain link in query log Drupal.behaviors.devel_explain = { attach: function() { $('a.dev-explain').click(function () { qid = $(this).attr("qid"); cell = $('#devel-query-' + qid); $('.dev-explain', cell).load(Drupal.settings.basePath + '?q=devel/explain/' + Drupal.se...
JavaScript
/** * @file devel_node_access.js. */ (function ($) { /** * Perform the access by user ajax request. */ function devel_node_access_user_ajax(context) { // Get the cell ID for the first .dna-permission that isn't processed. var cell = $('td.dna-permission', context) .not('...
JavaScript
(function ($) { /** * Attaches double-click behavior to toggle full path of Krumo elements. */ Drupal.behaviors.devel = { attach: function (context, settings) { // Add hint to footnote $('.krumo-footnote .krumo-call').before('<img style="vertical-align: middle;" title="Click to expand. Double-cli...
JavaScript
/*----------------------------------------\ | Cross Browser Tree Widget 1.1 | |-----------------------------------------| | Created by Emil A. Eklund (eae@eae.net) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------| | This script is provided as is without | ...
JavaScript
/** * JavaScript routines for Krumo * * @link http://sourceforge.net/projects/krumo */ ///////////////////////////////////////////////////////////////////////////// /** * Krumo JS Class */ function krumo() { } // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ...
JavaScript
/*! * jQuery JavaScript Library v1.4.4 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL...
JavaScript
(function ($) { $(document).ready(function () { lastObj = false; thmrSpanified = false; strs = Drupal.settings.thmrStrings; $('body').addClass("thmr_call").attr("id", "thmr_" + Drupal.settings.page_id); $('[thmr]') .hover( function () { if (themerEnabled && this.pa...
JavaScript
/** * @file * * CTools flexible AJAX responder object. */ (function ($) { Drupal.CTools = Drupal.CTools || {}; Drupal.CTools.AJAX = Drupal.CTools.AJAX || {}; /** * Grab the response from the server and store it. * * @todo restore the warm cache functionality */ Drupal.CTools.AJAX....
JavaScript
(function ($) { Drupal.CTools = Drupal.CTools || {}; Drupal.CTools.Stylizer = {}; Drupal.CTools.Stylizer.addFarbtastic = function(context) { // This behavior attaches by ID, so is only valid once on a page. if ($('ctools_stylizer_color_scheme_form .color-form.Stylizer-processed').size()) { ...
JavaScript
(function($) { Drupal.behaviors.CToolsJumpMenu = { attach: function(context) { $('.ctools-jump-menu-hide:not(.ctools-jump-menu-processed)') .addClass('ctools-jump-menu-processed') .hide(); $('.ctools-jump-menu-change:not(.ctools-jump-menu-processed)') .addClass('cto...
JavaScript
(function($){ /** * To make a form auto submit, all you have to do is 3 things: * * ctools_add_js('auto-submit'); * * On gadgets you want to auto-submit when changed, add the ctools-auto-submit * class. With FAPI, add: * @code * '#attributes' => array('class' => array('ctools-auto-submit')), * @endc...
JavaScript
// $Id$ /** * @file * Implement a simple, clickable dropbutton menu. * * See dropbutton.theme.inc for primary documentation. * * The javascript relies on four classes: * - The dropbutton must be fully contained in a div with the class * ctools-dropbutton. It must also contain the class ctools-no-js ...
JavaScript
/** * @file * Javascript required for a simple collapsible div. * * Creating a collapsible div with this doesn't take too much. There are * three classes necessary: * * - ctools-collapsible-container: This is the overall container that will be * collapsible. This must be a div. * - ctools-collapsibl...
JavaScript
/** * @file * * Implement a modal form. * * @see modal.inc for documentation. * * This javascript relies on the CTools ajax responder. */ (function ($) { // Make sure our objects are defined. Drupal.CTools = Drupal.CTools || {}; Drupal.CTools.Modal = Drupal.CTools.Modal || {}; /** *...
JavaScript
/** * @file * * Written by dmitrig01 (Dmitri Gaskin) for CTools; this provides dependent * visibility for form items in CTools' ajax forms. * * To your $form item definition add: * - '#process' => array('CTools_process_dependency'), * - Add '#dependency' => array('id-of-form-item' => array(list, of, val...
JavaScript
/** * @file * Implement a simple, clickable dropdown menu. * * See dropdown.theme.inc for primary documentation. * * The javascript relies on four classes: * - The dropdown must be fully contained in a div with the class * ctools-dropdown. It must also contain the class ctools-dropdown-no-js * whi...
JavaScript
/** * @file * CTools Bulk Export javascript functions. */ (function ($) { Drupal.behaviors.CToolsBulkExport = { attach: function (context) { $('#bulk-export-export-form .vertical-tabs-pane', context).drupalSetSummary(function (context) { // Check if any individual checkbox is checked. ...
JavaScript
/** * Provide the HTML to create the modal dialog. */ Drupal.theme.prototype.CToolsSampleModal = function () { var html = ''; html += '<div id="ctools-modal" class="popups-box">'; html += ' <div class="ctools-modal-content ctools-sample-modal-content">'; html += ' <table cellpadding="0" cellspacing...
JavaScript
/** * Provide some extra responses for the page list so we can have automatic * on change. */ Drupal.behaviors.PageManagerList = function() { var timeoutID = 0; $('form#page-manager-list-pages-form select:not(.pm-processed)') .addClass('pm-processed') .change(function() { $('#edit-page...
JavaScript
(function ($) { Drupal.behaviors.features = { attach: function(context, settings) { // Features management form $('table.features:not(.processed)').each(function() { $(this).addClass('processed'); // Check the overridden status of each feature Drupal.features.checkStat...
JavaScript
(function ($) { var fpa = { selector : { form: '#user-admin-permissions', table : '#permissions', row : 'tbody tr', filter : 'td.permission', grouping : 'td.module' }, dom : { table : '', // jquery object for entire permissions table rows : '', // jquery object co...
JavaScript
(function ($) { var moduleFilterTimeOut; var moduleFilterTextFilter = ''; Drupal.behaviors.moduleFilter = { attach: function() { $("#module-filter-wrapper").show(); $('input[name="module_filter[name]"]').focus(); $('input[name="module_filter[name]"]').keyup(function(e) { switch (e....
JavaScript
(function ($) { Drupal.ModuleFilter = Drupal.ModuleFilter || {}; Drupal.ModuleFilter.textFilter = ''; Drupal.ModuleFilter.timeout; Drupal.ModuleFilter.tabs = {}; Drupal.ModuleFilter.enabling = {}; Drupal.ModuleFilter.disabling = {}; Drupal.behaviors.moduleFilter = { attach: function() { // Set...
JavaScript
(function($) { Drupal.behaviors.moduleFilterDynamicPosition = { attach: function() { $(window).scroll(function() { // Vertical movement. var top = $('#module-filter-tabs').offset().top; var bottom = top + $('#module-filter-tabs').height(); var windowHeight = $(window).height(...
JavaScript
/** * Twiddle the province autocomplete whenever the user changes the country. */ (function ($) { Drupal.behaviors.location = { attach: function(context) { $('select.location_auto_country:not(.location-processed)', context).change(function(e) { var obj = this; var input = null; var ...
JavaScript
(function ($) { Drupal.backup_migrate = { callbackURL : "", autoAttach : function() { if (Drupal.settings.backup_migrate !== undefined) { if ($("#edit-save-settings").length && !$("#edit-save-settings").attr("checked")) { // Disable input and hide its description. // Set display none i...
JavaScript
// Copied from filter.admin.js (function ($) { Drupal.behaviors.searchApiStatus = { attach: function (context, settings) { $('.search-api-status-wrapper input.form-checkbox', context).once('search-api-status', function () { var $checkbox = $(this); // Retrieve the tabledrag row belonging to this pro...
JavaScript
(function ($) { Drupal.behaviors.pathFieldsetSummaries = { attach: function (context) { $('fieldset.path-form', context).drupalSetSummary(function (context) { var path = $('.form-item-path-alias input').val(); var automatic = $('.form-item-path-pathauto input').attr('checked'); if (aut...
JavaScript
(function($) { Drupal.behaviors.customerFieldsetSummaries = { attach: function (context, settings) { $('fieldset#edit-user', context).drupalSetSummary(function (context) { var name = $('#edit-name').val() || Drupal.settings.anonymous; return Drupal.t('Owned by @name', { '@name': name }); }); ...
JavaScript
(function($) { /** * Trigger the Update button when hitting the enter key. */ Drupal.behaviors.commerceLineItemForm = { attach: function (context, settings) { // Click the update button, not the remove button on enter key if we are // on a text field. $('div.commerce-line-item-views-fo...
JavaScript
;(function($) { /** * Automatically submit the payment redirect form. */ Drupal.behaviors.commercePayment = { attach: function (context, settings) { $('div.payment-redirect-form form', context).submit(); } } })(jQuery);
JavaScript
(function ($) { Drupal.behaviors.orderFieldsetSummaries = { attach: function (context) { $('fieldset#edit-order-status', context).drupalSetSummary(function (context) { // If the status has been changed, indicate the original status. if ($('#edit-status').val() != $('#edit-status-original').val()) { ...
JavaScript
(function($) { /** * Attach this editor to a target element. * * @param context * A DOM element, supplied by Drupal.attachBehaviors(). * @param params * An object containing input format parameters. Default parameters are: * - editor: The internal editor name. * - theme: The name/key of the e...
JavaScript
var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; /** * Override Whizzywig's document.write() function. * * Whizzywig uses document.write() by default, which leads to a blank page when * invoked in jQuery.ready(). Luckily, Whizzywig developers implemented a * shorthand w...
JavaScript
(function($) { /** * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.epiceditor = function (context, params, settings) { var $target = $('#' + params.field); var containerId = params.field + '-epiceditor'; var defaultContent = $target.val(); $target.hide().after('<div id="' +...
JavaScript
var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; /** * Override Whizzywig's document.write() function. * * Whizzywig uses document.write() by default, which leads to a blank page when * invoked in jQuery.ready(). Luckily, Whizzywig developers implemented a * shorthand w...
JavaScript
// Backup $ and reset it to jQuery. Drupal.wysiwyg._openwysiwyg = $; $ = jQuery; // Wrap openWYSIWYG's methods to temporarily use its version of $. jQuery.each(WYSIWYG, function (key, value) { if (jQuery.isFunction(value)) { WYSIWYG[key] = function () { var old$ = $; $ = Drupal.wysiwyg._op...
JavaScript
(function($) { /** * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.wymeditor = function (context, params, settings) { // Prepend basePath to wymPath. settings.wymPath = settings.basePath + settings.wymPath; // Update activeId on focus. settings.postInit = function (instance...
JavaScript
(function($) { /** * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.markitup = function(context, params, settings) { $('#' + params.field, context).markItUp(settings); // Adjust CSS for editor buttons. $.each(settings.markupSet, function (button) { $('.' + settings.nameS...
JavaScript
(function($) { /** * Attach this editor to a target element. */ Drupal.wysiwyg.editor.attach.nicedit = function(context, params, settings) { // Intercept and ignore submit handlers or they will revert changes made // since the instance was removed. The handlers are anonymous and hidden out // of scope ...
JavaScript
Drupal = window.parent.Drupal; /** * Fetch and provide original editor settings as local variable. * * FCKeditor does not support to pass complex variable types to the editor. * Instance settings passed to FCKinstance.Config are temporarily stored in * FCKConfig.PageConfig. */ var wysiwygFormat = FCKC...
JavaScript
(function($) { /** * Initialize editor instances. * * This function needs to be called before the page is fully loaded, as * calling tinyMCE.init() after the page is loaded breaks IE6. * * @param editorSettings * An object containing editor settings for each input format. */ Drupal.wysiwyg.editor....
JavaScript