Repository: Products.CMFPlone
Branch: refs/heads/master
Date: 2014-11-17T17:01:48+01:00
Author: JC Brand (jcbrand) <jc@opkode.com>
Commit: https://github.com/plone/Products.CMFPlone/commit/32f93b1ee01c893bd9c8802aae51f42f29497420

Remove unused legacy Javascript.

* plone_ecmascript/cookie_functions.js
* plone_ecmascript/js-standards.js
* plone_ecmascript/kss-bbb.js
* plone_ecmascript/popupforms.js

updates #282

See also https://github.com/plone/plone.app.controlpanel/pull/32

Files changed:
M Products/CMFPlone/profiles/dependencies/registry.xml
M Products/CMFPlone/tests/testCSSandJSRegistry.py
D Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
D Products/CMFPlone/skins/plone_ecmascript/js-standards.js
D Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
D Products/CMFPlone/skins/plone_ecmascript/popupforms.js

diff --git a/Products/CMFPlone/profiles/dependencies/registry.xml b/Products/CMFPlone/profiles/dependencies/registry.xml
index bd110f3..7b26410 100644
--- a/Products/CMFPlone/profiles/dependencies/registry.xml
+++ b/Products/CMFPlone/profiles/dependencies/registry.xml
@@ -827,10 +827,6 @@
       <value key="js">plone_javascript_variables.js</value>
   </records>
 
-  <records prefix="plone.resources/cookie_functions"
-            interface='Products.CMFPlone.interfaces.IResourceRegistry'>
-      <value key="js">cookie_functions.js</value>
-  </records>
   <records prefix="plone.resources/jquery-highlightsearchterms"
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">jquery.highlightsearchterms.js</value>
@@ -839,10 +835,6 @@
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">inline_validation.js</value>
   </records>
-  <records prefix="plone.resources/kss-bbb"
-            interface='Products.CMFPlone.interfaces.IResourceRegistry'>
-      <value key="js">kss-bbb.js</value>
-  </records>
   <records prefix="plone.resources/table_sorter"
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">table_sorter.js</value>
@@ -946,7 +938,6 @@
       <element>table_sorter</element>
       <element>inline-validation</element>
       <element>jquery-highlightsearchterms</element>
-      <element>cookie_functions</element>
     </value>
     <value key="depends">plone</value>
     <value key="jscompilation">++plone++static/plone-legacy-compiled.js</value>
diff --git a/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js b/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
deleted file mode 100644
index cc3273c..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Provides createCookie and readCookie global functions 
-*/
-
-/*global escape:false, unescape:false */
-
-function createCookie(name,value,days) {
-    var date,
-        expires;
-
-    if (days) {
-        date = new Date();        
-        date.setTime(date.getTime()+(days*24*60*60*1000));
-        expires = "; expires="+date.toGMTString();
-    } else {
-        expires = "";
-    }
-    document.cookie = name+"="+escape(value)+expires+"; path=/;";
-}
-
-function readCookie(name) {
-    var nameEQ = name + "=",
-        ca = document.cookie.split(';'),
-        i,
-        c;
-    
-    for(i=0;i < ca.length;i=i+1) {
-        c = ca[i];
-        while (c.charAt(0) === ' ') {
-            c = c.substring(1,c.length);
-        }
-        if (c.indexOf(nameEQ) === 0) {
-            return unescape(c.substring(nameEQ.length,c.length));
-        }
-    }
-    return null;
-}
diff --git a/Products/CMFPlone/skins/plone_ecmascript/js-standards.js b/Products/CMFPlone/skins/plone_ecmascript/js-standards.js
deleted file mode 100644
index 07706e0..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/js-standards.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* This is an include to set jslint standards for a file. A common
-   use would be to run
-   
-   cat js-standards.js accessibility.js | jslint
-   
-   to analyze accessibility.js using these standards.
-   
-   These are the jslint "Good Parts" standards except that:
-   
-   * Tight white-space checking is off;
-   * the "use strict" check is off;
-   * browser variables are on;
-   * common globals are set.
-*/
-
-/*jslint white:false, onevar:true, undef:true, nomen:true, eqeqeq:true, plusplus:true, bitwise:true, regexp:true, newcap:true, immed:true, strict:false, browser:true */
-/*global jQuery:false, document:false, window:false, location:false */
\ No newline at end of file
diff --git a/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js b/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
deleted file mode 100644
index 51517ee..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
+++ /dev/null
@@ -1,134 +0,0 @@
-(function($){
-
-function refreshPortlet(hash, _options){
-    var options = {
-        data: {},
-        success: function(){},
-        error: function(){},
-        ajaxOptions: {}};
-    $.extend(options, _options);
-    options.data.portlethash = hash;
-    ajaxOptions = options.ajaxOptions;
-    ajaxOptions.url = $('base').attr('href') + '/@@render-portlet';
-    ajaxOptions.success = function(data){
-        var container = $('[data-portlethash="' + hash + '"]');
-        var portlet = $(data);
-        container.html(portlet);
-        options.success(data, portlet);
-    }
-    ajaxOptions.error = function(){
-        options.error();
-    }
-    ajaxOptions.data = options.data;
-    $.ajax(ajaxOptions);
-}
-
-/* Calendar Portlet KSS Replacement */
-$('body').delegate('#calendar-next,#calendar-previous', 'click', function(){
-    var el = $(this);
-    var container = el.parents('.portletWrapper');
-    refreshPortlet(container.data('portlethash'), {
-        data: {
-            month: el.data('month'),
-            year: el.data('year')
-        }
-    });
-    return false;
-});
-
-/* apply a refresh timeout to a portlet */
-function applyPortletTimeout(portlet){
-    var timeout = portlet.data('timeout');
-    if(timeout == undefined){
-        timeout = 30; // Default to 30 seconds
-    }else{
-        timeout = parseInt(timeout);
-    }
-    timeout = timeout * 1000;
-    setTimeout($.proxy(function(){
-        refreshPortlet(this.parents('.portletWrapper').data('portlethash'), {
-            success: function(data, portlet){
-                apply_timeout(portlet);
-            }
-        });
-    }, portlet), timeout);
-}
-
-
-/* dom loaded related actions */
-$(document).ready(function(){
-    /* Show animated spinner while AJAX is loading. */
-    var spinner = $('<div id="ajax-spinner"><img src="' + $('body').attr('data-portal-url') + '/spinner.gif" alt="loading"/></div>');
-    spinner.appendTo('body').hide();
-    $(document).ajaxStart(function() { spinner.show(); });
-    $(document).ajaxStop(function() { spinner.hide(); });
-
-    /* Any portlets with the class kssPortletRefresh(deprecated)
-       or refreshPortlet will automatically be refreshed with this.
-       Data attribute timeout(data-timeout) will be used to override
-       the timeout used for the refresh */
-    $('.kssPortletRefresh,.refreshPortlet').each(function(){
-        applyPortletTimeout($(this));
-    });
-
-    /* deferred rendering portlets */
-    $('.portlet-deferred').each(function(){
-        refreshPortlet($(this).parents('.portletWrapper').data('portlethash'));
-    });
-
-    /* sharing related kss */
-    function updateSharing(data){
-        var sharing = $(data.body);
-        var messages = $(data.messages).filter(function(){ return this.tagName == 'DL'; });
-        $('.portalMessage').remove();
-        $('#user-group-sharing').replaceWith(sharing);
-        $('#content').prepend(messages);
-    }
-
-    /* sharing search form */
-    var search_timeout = null;
-    $('#content-core').delegate('#sharing-user-group-search', 'input', function(){
-        var text = $(this);
-        if(search_timeout != null){
-            clearTimeout(search_timeout);
-        }
-        if(text.val().length > 3){
-            search_timeout = setTimeout($.proxy(function(){
-                $('#sharing-search-button').trigger('click');
-            }, text), 300);
-        }
-    });
-
-    $('#content-core').delegate('#sharing-search-button', 'click', function(){
-        $.ajax({
-            url: $('base').attr('href') + '/@@updateSharingInfo',
-            data: {
-                search_term: $('#sharing-user-group-search').val(),
-                'form.button.Search': 'Search'
-            },
-            type: 'GET',
-            dataType: 'json',
-            success: updateSharing
-        });
-        return false;
-    });
-
-    /* Sharing save button */
-    $('#content-core').delegate('#sharing-save-button', 'click', function(){
-        var btn = $(this);
-        var form = btn.parents('form');
-        var data = form.serializeArray();
-        data.push({name: 'form.button.Save', value: 'Save'});
-        $.ajax({
-            url: $('base').attr('href') + '/@@updateSharingInfo',
-            data: data,
-            type: 'POST',
-            dataType: 'json',
-            success: updateSharing
-        });
-        return false;
-    });
-
-});
-
-})(jQuery);
diff --git a/Products/CMFPlone/skins/plone_ecmascript/popupforms.js b/Products/CMFPlone/skins/plone_ecmascript/popupforms.js
deleted file mode 100644
index 116c8a2..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/popupforms.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/******
-    Set up standard Plone popups
-
-    Provides globals: common_content_filter
-
-    Extends jQuery.tools.overlay.conf to set up common Plone effects and
-    visuals.
-******/
-
-
-function msieversion() {
-    // Detect MSIE browser version
-    // http://support.microsoft.com/kb/167820
-    var ua = window.navigator.userAgent;
-    var msie = ua.indexOf("MSIE ");
-
-    if (msie > 0) {
-        // If Internet Explorer, return version number
-        return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
-    } else {
-        // If another browser, return 0
-        return 0;
-    }
-}
-
-var common_content_filter = '#content>*:not(div.configlet),dl.portalMessage.error,dl.portalMessage.info';
-
-jQuery.extend(jQuery.tools.overlay.conf,
-    {
-        fixed:false,
-        speed:'fast',
-        mask:{color:'#fff',opacity: 0.4,loadSpeed:0,closeSpeed:0}
-    });
-
-
-(function($) {
-
-	// static constructs
-	$.plonepopups = $.plonepopups || {};
-
-    $.extend($.plonepopups,
-        {
-            // method to show error message in a noform
-            // situation.
-            noformerrorshow: function noformerrorshow(el, noform) {
-                var o = $(el),
-                    emsg = o.find('dl.portalMessage.error');
-                if (emsg.length) {
-                    o.children().replaceWith(emsg);
-                    return false;
-                } else {
-                    return noform;
-                }
-            },
-            // After deletes we need to redirect to the target page.
-            redirectbasehref: function redirectbasehref(el, responseText) {
-                var mo = responseText.match(/<base href="(\S+?)"/i);
-                if (mo.length === 2) {
-                    return mo[1];
-                }
-                return location;
-            }
-        });
-})(jQuery);
-
-jQuery(function($){
-
-    if (msieversion() > 0 && msieversion() < 7) {
-        // it's not realistic to think we can deal with all the bugs
-        // of IE 6 and lower. Fortunately, all this is just progressive
-        // enhancement.
-        return;
-    }
-
-    // login form
-    $('#portal-personaltools a[href$="/login"], #portal-personaltools a[href$="/login_form"], .discussion a[href$="/login"], .discussion a[href$="/login_form"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            formselector: 'form#login_form',
-            cssclass: 'overlay-login',
-            noform: function () {
-                if (location.href.search(/pwreset_finish$/) >= 0) {
-                    return 'redirect';
-                } else {
-                    return 'reload';
-                }
-            },
-            redirect: function () {
-                var href = location.href;
-                if (href.search(/pwreset_finish$/) >= 0) {
-                    return href.slice(0, href.length-14) + 'logged_in';
-                } else {
-                    return href;
-                }
-            }
-        }
-    );
-
-    // contact form
-    $('#siteaction-contact a').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-contact',
-            formselector: 'form[name="feedback_form"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'close');}
-        }
-    );
-
-    // display: select content item / change content item
-    $('#contextSetDefaultPage, #folderChangeDefaultPage').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-default_view',
-            formselector: 'form[name="default_page_form"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'reload');},
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-    // advanced state
-    // This form needs additional JS and CSS for the calendar widget.
-    // The AJAX form doesn't load it from the javascript_head_slot.
-    // $('dl#plone-contentmenu-workflow a#advanced').prepOverlay(
-    //     {
-    //         subtype: 'ajax',
-    //         filter: common_content_filter,
-    //         formselector: 'form',
-    //         cssclass: 'overlay-workflow',
-    //         noform: function(el) {return $.plonepopups.noformerrorshow(el, 'reload');},
-    //         closeselector: '[name="form.button.Cancel"]'
-    //     }
-    // );
-
-    // Delete dialog
-    $('dl#plone-contentmenu-actions a#plone-contentmenu-actions-delete').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            formselector: '#delete_confirmation',
-            cssclass: 'overlay-delete',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'redirect');},
-            redirect: $.plonepopups.redirectbasehref,
-            closeselector: '[name="form.button.Cancel"]',
-            width:'50%'
-        }
-    );
-
-    // Rename dialog
-    $('dl#plone-contentmenu-actions a#plone-contentmenu-actions-rename').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-rename',
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-    // Add item to folderish default page
-    $('dl#plone-contentmenu-factories a#plone-contentmenu-add-to-default-page').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-folder-factories',
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-
-    // registration
-    $('#portal-personaltools a[href$="/@@register"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-register',
-            formselector: 'form.kssattr-formname-register'
-        }
-    );
-
-    // add new user, group
-    $('form[name="users_add"], form[name="groups_add"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-users',
-            formselector: 'form.kssattr-formname-new-user, form[name="groups"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'redirect');},
-            redirect: function () {return location.href;}
-        }
-    );
-
-    // minify form width to button width
-    $('form[name="users_add"], form[name="groups_add"]').width($('input.add').outerWidth());
-    $('form[name="users_add"] input.add, form[name="groups_add"] input.add').css('cursor', 'pointer');
-
-    // Content history popup
-    $('#content-history a').prepOverlay({
-       subtype: 'ajax',
-       filter: 'h2, #content-history',
-       cssclass: 'overlay-history',
-       urlmatch: '@@historyview',
-       urlreplace: '@@contenthistorypopup'
-    });
-
-});
diff --git a/Products/CMFPlone/tests/testCSSandJSRegistry.py b/Products/CMFPlone/tests/testCSSandJSRegistry.py
index 4adfc23..f7c5386 100644
--- a/Products/CMFPlone/tests/testCSSandJSRegistry.py
+++ b/Products/CMFPlone/tests/testCSSandJSRegistry.py
@@ -1,11 +1,8 @@
 from plone.app.testing.bbb import PloneTestCase
-from Products.ResourceRegistries.config import CSSTOOLNAME, JSTOOLNAME
-from Products.CMFCore.utils import getToolByName
 from plone.registry.interfaces import IRegistry
 from zope.component import getUtility
-from Products.CMFPlone.interfaces import (
-    IBundleRegistry,
-    IResourceRegistry)
+from Products.CMFPlone.interfaces import IBundleRegistry
+from Products.CMFPlone.interfaces import IResourceRegistry
 
 
 class TestCSSRegistry(PloneTestCase):
@@ -59,7 +56,6 @@ def testDefaultJSIsInstalled(self):
             'jquery.highlightsearchterms.js',
             'mark_special_links.js',
             'table_sorter.js',
-            'cookie_functions.js',
             'plone_javascript_variables.js',
             ]
         js_files = [x.js for x in installedResources.values()]


Repository: Products.CMFPlone
Branch: refs/heads/master
Date: 2014-11-17T12:13:37-06:00
Author: Nathan Van Gheem (vangheem) <vangheem@gmail.com>
Commit: https://github.com/plone/Products.CMFPlone/commit/3af42fe0428b068c5bcfc544f17cf96014bc0e62

Merge pull request #304 from plone/legacyjs

Remove unused legacy Javascript.

Files changed:
M Products/CMFPlone/profiles/dependencies/registry.xml
M Products/CMFPlone/tests/testCSSandJSRegistry.py
D Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
D Products/CMFPlone/skins/plone_ecmascript/js-standards.js
D Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
D Products/CMFPlone/skins/plone_ecmascript/popupforms.js

diff --git a/Products/CMFPlone/profiles/dependencies/registry.xml b/Products/CMFPlone/profiles/dependencies/registry.xml
index bd110f3..7b26410 100644
--- a/Products/CMFPlone/profiles/dependencies/registry.xml
+++ b/Products/CMFPlone/profiles/dependencies/registry.xml
@@ -827,10 +827,6 @@
       <value key="js">plone_javascript_variables.js</value>
   </records>
 
-  <records prefix="plone.resources/cookie_functions"
-            interface='Products.CMFPlone.interfaces.IResourceRegistry'>
-      <value key="js">cookie_functions.js</value>
-  </records>
   <records prefix="plone.resources/jquery-highlightsearchterms"
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">jquery.highlightsearchterms.js</value>
@@ -839,10 +835,6 @@
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">inline_validation.js</value>
   </records>
-  <records prefix="plone.resources/kss-bbb"
-            interface='Products.CMFPlone.interfaces.IResourceRegistry'>
-      <value key="js">kss-bbb.js</value>
-  </records>
   <records prefix="plone.resources/table_sorter"
             interface='Products.CMFPlone.interfaces.IResourceRegistry'>
       <value key="js">table_sorter.js</value>
@@ -946,7 +938,6 @@
       <element>table_sorter</element>
       <element>inline-validation</element>
       <element>jquery-highlightsearchterms</element>
-      <element>cookie_functions</element>
     </value>
     <value key="depends">plone</value>
     <value key="jscompilation">++plone++static/plone-legacy-compiled.js</value>
diff --git a/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js b/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
deleted file mode 100644
index cc3273c..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/cookie_functions.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-  Provides createCookie and readCookie global functions 
-*/
-
-/*global escape:false, unescape:false */
-
-function createCookie(name,value,days) {
-    var date,
-        expires;
-
-    if (days) {
-        date = new Date();        
-        date.setTime(date.getTime()+(days*24*60*60*1000));
-        expires = "; expires="+date.toGMTString();
-    } else {
-        expires = "";
-    }
-    document.cookie = name+"="+escape(value)+expires+"; path=/;";
-}
-
-function readCookie(name) {
-    var nameEQ = name + "=",
-        ca = document.cookie.split(';'),
-        i,
-        c;
-    
-    for(i=0;i < ca.length;i=i+1) {
-        c = ca[i];
-        while (c.charAt(0) === ' ') {
-            c = c.substring(1,c.length);
-        }
-        if (c.indexOf(nameEQ) === 0) {
-            return unescape(c.substring(nameEQ.length,c.length));
-        }
-    }
-    return null;
-}
diff --git a/Products/CMFPlone/skins/plone_ecmascript/js-standards.js b/Products/CMFPlone/skins/plone_ecmascript/js-standards.js
deleted file mode 100644
index 07706e0..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/js-standards.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* This is an include to set jslint standards for a file. A common
-   use would be to run
-   
-   cat js-standards.js accessibility.js | jslint
-   
-   to analyze accessibility.js using these standards.
-   
-   These are the jslint "Good Parts" standards except that:
-   
-   * Tight white-space checking is off;
-   * the "use strict" check is off;
-   * browser variables are on;
-   * common globals are set.
-*/
-
-/*jslint white:false, onevar:true, undef:true, nomen:true, eqeqeq:true, plusplus:true, bitwise:true, regexp:true, newcap:true, immed:true, strict:false, browser:true */
-/*global jQuery:false, document:false, window:false, location:false */
\ No newline at end of file
diff --git a/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js b/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
deleted file mode 100644
index 51517ee..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/kss-bbb.js
+++ /dev/null
@@ -1,134 +0,0 @@
-(function($){
-
-function refreshPortlet(hash, _options){
-    var options = {
-        data: {},
-        success: function(){},
-        error: function(){},
-        ajaxOptions: {}};
-    $.extend(options, _options);
-    options.data.portlethash = hash;
-    ajaxOptions = options.ajaxOptions;
-    ajaxOptions.url = $('base').attr('href') + '/@@render-portlet';
-    ajaxOptions.success = function(data){
-        var container = $('[data-portlethash="' + hash + '"]');
-        var portlet = $(data);
-        container.html(portlet);
-        options.success(data, portlet);
-    }
-    ajaxOptions.error = function(){
-        options.error();
-    }
-    ajaxOptions.data = options.data;
-    $.ajax(ajaxOptions);
-}
-
-/* Calendar Portlet KSS Replacement */
-$('body').delegate('#calendar-next,#calendar-previous', 'click', function(){
-    var el = $(this);
-    var container = el.parents('.portletWrapper');
-    refreshPortlet(container.data('portlethash'), {
-        data: {
-            month: el.data('month'),
-            year: el.data('year')
-        }
-    });
-    return false;
-});
-
-/* apply a refresh timeout to a portlet */
-function applyPortletTimeout(portlet){
-    var timeout = portlet.data('timeout');
-    if(timeout == undefined){
-        timeout = 30; // Default to 30 seconds
-    }else{
-        timeout = parseInt(timeout);
-    }
-    timeout = timeout * 1000;
-    setTimeout($.proxy(function(){
-        refreshPortlet(this.parents('.portletWrapper').data('portlethash'), {
-            success: function(data, portlet){
-                apply_timeout(portlet);
-            }
-        });
-    }, portlet), timeout);
-}
-
-
-/* dom loaded related actions */
-$(document).ready(function(){
-    /* Show animated spinner while AJAX is loading. */
-    var spinner = $('<div id="ajax-spinner"><img src="' + $('body').attr('data-portal-url') + '/spinner.gif" alt="loading"/></div>');
-    spinner.appendTo('body').hide();
-    $(document).ajaxStart(function() { spinner.show(); });
-    $(document).ajaxStop(function() { spinner.hide(); });
-
-    /* Any portlets with the class kssPortletRefresh(deprecated)
-       or refreshPortlet will automatically be refreshed with this.
-       Data attribute timeout(data-timeout) will be used to override
-       the timeout used for the refresh */
-    $('.kssPortletRefresh,.refreshPortlet').each(function(){
-        applyPortletTimeout($(this));
-    });
-
-    /* deferred rendering portlets */
-    $('.portlet-deferred').each(function(){
-        refreshPortlet($(this).parents('.portletWrapper').data('portlethash'));
-    });
-
-    /* sharing related kss */
-    function updateSharing(data){
-        var sharing = $(data.body);
-        var messages = $(data.messages).filter(function(){ return this.tagName == 'DL'; });
-        $('.portalMessage').remove();
-        $('#user-group-sharing').replaceWith(sharing);
-        $('#content').prepend(messages);
-    }
-
-    /* sharing search form */
-    var search_timeout = null;
-    $('#content-core').delegate('#sharing-user-group-search', 'input', function(){
-        var text = $(this);
-        if(search_timeout != null){
-            clearTimeout(search_timeout);
-        }
-        if(text.val().length > 3){
-            search_timeout = setTimeout($.proxy(function(){
-                $('#sharing-search-button').trigger('click');
-            }, text), 300);
-        }
-    });
-
-    $('#content-core').delegate('#sharing-search-button', 'click', function(){
-        $.ajax({
-            url: $('base').attr('href') + '/@@updateSharingInfo',
-            data: {
-                search_term: $('#sharing-user-group-search').val(),
-                'form.button.Search': 'Search'
-            },
-            type: 'GET',
-            dataType: 'json',
-            success: updateSharing
-        });
-        return false;
-    });
-
-    /* Sharing save button */
-    $('#content-core').delegate('#sharing-save-button', 'click', function(){
-        var btn = $(this);
-        var form = btn.parents('form');
-        var data = form.serializeArray();
-        data.push({name: 'form.button.Save', value: 'Save'});
-        $.ajax({
-            url: $('base').attr('href') + '/@@updateSharingInfo',
-            data: data,
-            type: 'POST',
-            dataType: 'json',
-            success: updateSharing
-        });
-        return false;
-    });
-
-});
-
-})(jQuery);
diff --git a/Products/CMFPlone/skins/plone_ecmascript/popupforms.js b/Products/CMFPlone/skins/plone_ecmascript/popupforms.js
deleted file mode 100644
index 116c8a2..0000000
--- a/Products/CMFPlone/skins/plone_ecmascript/popupforms.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/******
-    Set up standard Plone popups
-
-    Provides globals: common_content_filter
-
-    Extends jQuery.tools.overlay.conf to set up common Plone effects and
-    visuals.
-******/
-
-
-function msieversion() {
-    // Detect MSIE browser version
-    // http://support.microsoft.com/kb/167820
-    var ua = window.navigator.userAgent;
-    var msie = ua.indexOf("MSIE ");
-
-    if (msie > 0) {
-        // If Internet Explorer, return version number
-        return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)));
-    } else {
-        // If another browser, return 0
-        return 0;
-    }
-}
-
-var common_content_filter = '#content>*:not(div.configlet),dl.portalMessage.error,dl.portalMessage.info';
-
-jQuery.extend(jQuery.tools.overlay.conf,
-    {
-        fixed:false,
-        speed:'fast',
-        mask:{color:'#fff',opacity: 0.4,loadSpeed:0,closeSpeed:0}
-    });
-
-
-(function($) {
-
-	// static constructs
-	$.plonepopups = $.plonepopups || {};
-
-    $.extend($.plonepopups,
-        {
-            // method to show error message in a noform
-            // situation.
-            noformerrorshow: function noformerrorshow(el, noform) {
-                var o = $(el),
-                    emsg = o.find('dl.portalMessage.error');
-                if (emsg.length) {
-                    o.children().replaceWith(emsg);
-                    return false;
-                } else {
-                    return noform;
-                }
-            },
-            // After deletes we need to redirect to the target page.
-            redirectbasehref: function redirectbasehref(el, responseText) {
-                var mo = responseText.match(/<base href="(\S+?)"/i);
-                if (mo.length === 2) {
-                    return mo[1];
-                }
-                return location;
-            }
-        });
-})(jQuery);
-
-jQuery(function($){
-
-    if (msieversion() > 0 && msieversion() < 7) {
-        // it's not realistic to think we can deal with all the bugs
-        // of IE 6 and lower. Fortunately, all this is just progressive
-        // enhancement.
-        return;
-    }
-
-    // login form
-    $('#portal-personaltools a[href$="/login"], #portal-personaltools a[href$="/login_form"], .discussion a[href$="/login"], .discussion a[href$="/login_form"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            formselector: 'form#login_form',
-            cssclass: 'overlay-login',
-            noform: function () {
-                if (location.href.search(/pwreset_finish$/) >= 0) {
-                    return 'redirect';
-                } else {
-                    return 'reload';
-                }
-            },
-            redirect: function () {
-                var href = location.href;
-                if (href.search(/pwreset_finish$/) >= 0) {
-                    return href.slice(0, href.length-14) + 'logged_in';
-                } else {
-                    return href;
-                }
-            }
-        }
-    );
-
-    // contact form
-    $('#siteaction-contact a').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-contact',
-            formselector: 'form[name="feedback_form"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'close');}
-        }
-    );
-
-    // display: select content item / change content item
-    $('#contextSetDefaultPage, #folderChangeDefaultPage').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-default_view',
-            formselector: 'form[name="default_page_form"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'reload');},
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-    // advanced state
-    // This form needs additional JS and CSS for the calendar widget.
-    // The AJAX form doesn't load it from the javascript_head_slot.
-    // $('dl#plone-contentmenu-workflow a#advanced').prepOverlay(
-    //     {
-    //         subtype: 'ajax',
-    //         filter: common_content_filter,
-    //         formselector: 'form',
-    //         cssclass: 'overlay-workflow',
-    //         noform: function(el) {return $.plonepopups.noformerrorshow(el, 'reload');},
-    //         closeselector: '[name="form.button.Cancel"]'
-    //     }
-    // );
-
-    // Delete dialog
-    $('dl#plone-contentmenu-actions a#plone-contentmenu-actions-delete').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            formselector: '#delete_confirmation',
-            cssclass: 'overlay-delete',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'redirect');},
-            redirect: $.plonepopups.redirectbasehref,
-            closeselector: '[name="form.button.Cancel"]',
-            width:'50%'
-        }
-    );
-
-    // Rename dialog
-    $('dl#plone-contentmenu-actions a#plone-contentmenu-actions-rename').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-rename',
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-    // Add item to folderish default page
-    $('dl#plone-contentmenu-factories a#plone-contentmenu-add-to-default-page').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-folder-factories',
-            closeselector: '[name="form.button.Cancel"]',
-            width:'40%'
-        }
-    );
-
-
-    // registration
-    $('#portal-personaltools a[href$="/@@register"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-register',
-            formselector: 'form.kssattr-formname-register'
-        }
-    );
-
-    // add new user, group
-    $('form[name="users_add"], form[name="groups_add"]').prepOverlay(
-        {
-            subtype: 'ajax',
-            filter: common_content_filter,
-            cssclass: 'overlay-users',
-            formselector: 'form.kssattr-formname-new-user, form[name="groups"]',
-            noform: function(el) {return $.plonepopups.noformerrorshow(el, 'redirect');},
-            redirect: function () {return location.href;}
-        }
-    );
-
-    // minify form width to button width
-    $('form[name="users_add"], form[name="groups_add"]').width($('input.add').outerWidth());
-    $('form[name="users_add"] input.add, form[name="groups_add"] input.add').css('cursor', 'pointer');
-
-    // Content history popup
-    $('#content-history a').prepOverlay({
-       subtype: 'ajax',
-       filter: 'h2, #content-history',
-       cssclass: 'overlay-history',
-       urlmatch: '@@historyview',
-       urlreplace: '@@contenthistorypopup'
-    });
-
-});
diff --git a/Products/CMFPlone/tests/testCSSandJSRegistry.py b/Products/CMFPlone/tests/testCSSandJSRegistry.py
index 4adfc23..f7c5386 100644
--- a/Products/CMFPlone/tests/testCSSandJSRegistry.py
+++ b/Products/CMFPlone/tests/testCSSandJSRegistry.py
@@ -1,11 +1,8 @@
 from plone.app.testing.bbb import PloneTestCase
-from Products.ResourceRegistries.config import CSSTOOLNAME, JSTOOLNAME
-from Products.CMFCore.utils import getToolByName
 from plone.registry.interfaces import IRegistry
 from zope.component import getUtility
-from Products.CMFPlone.interfaces import (
-    IBundleRegistry,
-    IResourceRegistry)
+from Products.CMFPlone.interfaces import IBundleRegistry
+from Products.CMFPlone.interfaces import IResourceRegistry
 
 
 class TestCSSRegistry(PloneTestCase):
@@ -59,7 +56,6 @@ def testDefaultJSIsInstalled(self):
             'jquery.highlightsearchterms.js',
             'mark_special_links.js',
             'table_sorter.js',
-            'cookie_functions.js',
             'plone_javascript_variables.js',
             ]
         js_files = [x.js for x in installedResources.values()]