(function ($) { Drupal.behaviors.apigee_responsive = { attach: function (context, settings) { $('div.modal ul.openid-links li.user-link').hide(); $('div.modal a[href="#openid-login"]').click(function() { $('div.modal div.apigee-responsive-openidhide').show(); }); $('li.dropdown').mouseover(function() { $(this).addClass('open'); }); $('li.dropdown').mouseout(function() { $(this).removeClass('open'); }); // Load the app delete form in a modal. $('.apigee-modal-link-delete a').click(function() { var hrefLocation = $(this).attr('href'); var identifier = $(this).attr('data-target'); var loadingText = Drupal.t('Loading...'); // Open the empty modal. $(identifier).modal(); if (($(identifier + ' .modal-body #devconnect_developer_application_delete').length == 0)) { $(identifier + ' .modal-body').html(''); apigeePulsateForever(identifier + ' .modal-body .load-indicator'); } // Load the page fragment (#devconnect_developer_application_delete) via an AJAX call. $(identifier + ' .modal-body').load(hrefLocation + ' #devconnect_developer_application_delete', function() { if (!($(identifier + ' .modal-body #devconnect_developer_application_delete').length == 0)) { $(this).remove('.load-indicator'); } }); return false; }); // Load the app edit form in a modal. $('.apigee-modal-link-edit a').click(function() { var hrefLocation = $(this).attr('href'); var identifier = $(this).attr('data-target'); // Open the empty modal. $(identifier).modal(); if (($(identifier + ' .modal-body #devconnect-developer-apps-edit-form').length == 0)) { $(identifier + ' .modal-body').html(''); apigeePulsateForever(identifier + ' .modal-body .load-indicator'); // Load the page fragment (#devconnect-developer-apps-edit-form) via an AJAX call. $(identifier + ' .modal-body').load(hrefLocation + ' #devconnect-developer-apps-edit-form', function() { if (!($(identifier + ' .modal-body #devconnect_developer_application_delete').length == 0)) { $(this).remove('.load-indicator'); } if (Drupal.settings.devconnect_developer_apps.selectlist == 'true'){ var selectItem = identifier + ' .selectlist-item'; var selectProductText = Drupal.t('Select an API Product'); var removeText = Drupal.t('Remove'); $(identifier + ' select#api_product').attr('title', selectProductText); var sl = $(identifier + ' select#api_product').selectList({ instance: true, clickRemove: false, onAdd: function (select, value, text) { $(selectItem + ':last').append('' + removeText + ''); } }); $('.selectlist-list').on('click', '.remove-product', function(event) { sl.remove($(this).parent().data('value')); }); $(selectItem).append('' + removeText + ''); } }); } return false; }); function apigeePulsateForever(elem) { $(elem).fadeTo(500, 1.0); $(elem).fadeTo(500, 0.1, function() { apigeePulsateForever(elem); }); } } }; })(jQuery); ; /* This is the javascript file that will contain all the custom javascript code that you will be writing to customize the interactivity of the Apigee developer portal. */ ;