Repository: plone.app.controlpanel
Branch: refs/heads/master
Date: 2014-11-17T16:22:11+01:00
Author: JC Brand (jcbrand) <jc@opkode.com>
Commit: https://github.com/plone/plone.app.controlpanel/commit/c8bc0313490cf4fc41e8d7260f3ce9893ce54d5a

Remove usage of popupforms.js

See https://github.com/plone/Products.CMFPlone/issues/282

Files changed:
M plone/app/controlpanel/skins.py
M plone/app/controlpanel/tests/skins.txt

diff --git a/plone/app/controlpanel/skins.py b/plone/app/controlpanel/skins.py
index 20ab79b..ec42b86 100644
--- a/plone/app/controlpanel/skins.py
+++ b/plone/app/controlpanel/skins.py
@@ -55,12 +55,6 @@ class ISkinsSchema(Interface):
                                             "won't be visible."),
                              vocabulary=ICON_VISIBILITY_VOCABULARY)
 
-    use_popups = Bool(title=_(u'Use popup overlays for simple forms'),
-                        description=_(u"If enabled popup overlays will be "
-                                       "used for simple forms like login, "
-                                       "contact and delete confirmation."),
-                        default=True)
-
 
 class SkinsControlPanelAdapter(SchemaAdapterBase):
 
@@ -140,26 +134,6 @@ def set_icon_visibility(self, value):
 
     icon_visibility = property(get_icon_visibility,set_icon_visibility)
 
-    def get_use_popups(self):
-        popupforms = self.jstool.getResource('popupforms.js')
-        if popupforms:
-            return popupforms.getEnabled()
-        jqoverlays = self.csstool.getResource('++resource++plone.app.jquerytools.overlays.css')
-        if jqoverlays:
-            return jqoverlays.getEnabled()
-
-    def set_use_popups(self, value):
-        popupforms = self.jstool.getResource('popupforms.js')
-        if popupforms:
-            popupforms.setEnabled(value)
-        self.jstool.cookResources()
-        jqoverlays = self.csstool.getResource('++resource++plone.app.jquerytools.overlays.css')
-        if jqoverlays:
-            jqoverlays.setEnabled(value)
-        self.csstool.cookResources()
-
-    use_popups = property(get_use_popups, set_use_popups)
-
 
 class SkinsControlPanel(ControlPanelForm):
 
diff --git a/plone/app/controlpanel/tests/skins.txt b/plone/app/controlpanel/tests/skins.txt
index cdbcd87..f9d22e5 100644
--- a/plone/app/controlpanel/tests/skins.txt
+++ b/plone/app/controlpanel/tests/skins.txt
@@ -130,27 +130,3 @@ Unchecking new_window should finally turn off the js support:
 
     >>> jstool.getResource('mark_special_links.js').getEnabled()
     False
-
-
-Overlayed popup forms are also controlled here
--------------------------------------------------------------------
-
-We should be starting with popupforms.js enabled:
-
-    >>> jstool = getToolByName(self.portal, 'portal_javascripts')
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    True
-
-Unchecking use_popups should turn off the js support:
-
-    >>> self.browser.getControl(name='form.use_popups').value = False
-    >>> self.browser.getControl(name="form.actions.save").click()
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    False
-
-Checking use_popups should turn re-enable:
-
-    >>> self.browser.getControl(name='form.use_popups').value = True
-    >>> self.browser.getControl(name="form.actions.save").click()
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    True


Repository: plone.app.controlpanel
Branch: refs/heads/master
Date: 2014-11-17T10:00:09-06:00
Author: Nathan Van Gheem (vangheem) <vangheem@gmail.com>
Commit: https://github.com/plone/plone.app.controlpanel/commit/4c1bf2d94328a785c110d389f956c54369905ddd

Merge pull request #32 from plone/popupforms

Remove usage of popupforms.js

Files changed:
M plone/app/controlpanel/skins.py
M plone/app/controlpanel/tests/skins.txt

diff --git a/plone/app/controlpanel/skins.py b/plone/app/controlpanel/skins.py
index 20ab79b..ec42b86 100644
--- a/plone/app/controlpanel/skins.py
+++ b/plone/app/controlpanel/skins.py
@@ -55,12 +55,6 @@ class ISkinsSchema(Interface):
                                             "won't be visible."),
                              vocabulary=ICON_VISIBILITY_VOCABULARY)
 
-    use_popups = Bool(title=_(u'Use popup overlays for simple forms'),
-                        description=_(u"If enabled popup overlays will be "
-                                       "used for simple forms like login, "
-                                       "contact and delete confirmation."),
-                        default=True)
-
 
 class SkinsControlPanelAdapter(SchemaAdapterBase):
 
@@ -140,26 +134,6 @@ def set_icon_visibility(self, value):
 
     icon_visibility = property(get_icon_visibility,set_icon_visibility)
 
-    def get_use_popups(self):
-        popupforms = self.jstool.getResource('popupforms.js')
-        if popupforms:
-            return popupforms.getEnabled()
-        jqoverlays = self.csstool.getResource('++resource++plone.app.jquerytools.overlays.css')
-        if jqoverlays:
-            return jqoverlays.getEnabled()
-
-    def set_use_popups(self, value):
-        popupforms = self.jstool.getResource('popupforms.js')
-        if popupforms:
-            popupforms.setEnabled(value)
-        self.jstool.cookResources()
-        jqoverlays = self.csstool.getResource('++resource++plone.app.jquerytools.overlays.css')
-        if jqoverlays:
-            jqoverlays.setEnabled(value)
-        self.csstool.cookResources()
-
-    use_popups = property(get_use_popups, set_use_popups)
-
 
 class SkinsControlPanel(ControlPanelForm):
 
diff --git a/plone/app/controlpanel/tests/skins.txt b/plone/app/controlpanel/tests/skins.txt
index cdbcd87..f9d22e5 100644
--- a/plone/app/controlpanel/tests/skins.txt
+++ b/plone/app/controlpanel/tests/skins.txt
@@ -130,27 +130,3 @@ Unchecking new_window should finally turn off the js support:
 
     >>> jstool.getResource('mark_special_links.js').getEnabled()
     False
-
-
-Overlayed popup forms are also controlled here
--------------------------------------------------------------------
-
-We should be starting with popupforms.js enabled:
-
-    >>> jstool = getToolByName(self.portal, 'portal_javascripts')
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    True
-
-Unchecking use_popups should turn off the js support:
-
-    >>> self.browser.getControl(name='form.use_popups').value = False
-    >>> self.browser.getControl(name="form.actions.save").click()
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    False
-
-Checking use_popups should turn re-enable:
-
-    >>> self.browser.getControl(name='form.use_popups').value = True
-    >>> self.browser.getControl(name="form.actions.save").click()
-    >>> jstool.getResource('popupforms.js').getEnabled()
-    True