From d734cc351eaba48097a2f51572e1431564a96f5f Mon Sep 17 00:00:00 2001 From: pbauer Date: Fri, 21 Aug 2015 11:13:17 +0200 Subject: [PATCH] [fc] Repository: plone.app.testing Branch: refs/heads/master Date: 2015-08-11T17:48:17+02:00 Author: Gil Forcada Codinachs (gforcada) Commit: https://github.com/plone/plone.app.testing/commit/1043a6a5a0984611a68c5fdb2fb20ce4dbd50db8 No need for unittest2 Files changed: M setup.py Repository: plone.app.testing Branch: refs/heads/master Date: 2015-08-21T11:13:17+02:00 Author: Philip Bauer (pbauer) Commit: https://github.com/plone/plone.app.testing/commit/7a6d48f6a7fc7983d776061c2996c24811a8965a Merge pull request #15 from plone/gforcada-patch-1 No need for unittest2 Files changed: M setup.py --- last_commit.txt | 499 ++++-------------------------------------------- 1 file changed, 38 insertions(+), 461 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index d154f6ec71..52aad147ef 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,479 +1,56 @@ -Repository: mockup +Repository: plone.app.testing Branch: refs/heads/master -Date: 2015-08-20T10:34:03-05:00 -Author: Sam Schwartz (obct537) -Commit: https://github.com/plone/mockup/commit/c2a303d826902413cfd26b0912eb8db7c41a4903 +Date: 2015-08-11T17:48:17+02:00 +Author: Gil Forcada Codinachs (gforcada) +Commit: https://github.com/plone/plone.app.testing/commit/1043a6a5a0984611a68c5fdb2fb20ce4dbd50db8 -Added cache clear button +No need for unittest2 Files changed: -A mockup/patterns/thememapper/js/cacheview.js -M mockup/patterns/filemanager/pattern.js -M mockup/patterns/thememapper/pattern.js +M setup.py -diff --git a/mockup/patterns/filemanager/pattern.js b/mockup/patterns/filemanager/pattern.js -index a09d496..6c088e1 100644 ---- a/mockup/patterns/filemanager/pattern.js -+++ b/mockup/patterns/filemanager/pattern.js -@@ -538,7 +538,9 @@ define([ - else if( typeof self.fileData[path].info !== 'undefined' ) - { - var preview = self.fileData[path].info; -- self.ace.editor.off(); -+ if( self.ace.editor !== undefined ) { -+ self.ace.editor.off(); -+ } - $('.ace_editor').empty().append(preview); - } - else -diff --git a/mockup/patterns/thememapper/js/cacheview.js b/mockup/patterns/thememapper/js/cacheview.js -new file mode 100644 -index 0000000..c1a4d17 ---- /dev/null -+++ b/mockup/patterns/thememapper/js/cacheview.js -@@ -0,0 +1,53 @@ -+define([ -+ 'jquery', -+ 'underscore', -+ 'backbone', -+ 'mockup-patterns-filemanager-url/js/basepopover', -+ 'mockup-utils' -+], function($, _, Backbone, PopoverView, utils ) { -+ 'use strict'; -+ var template = _.template( -+ '
' + -+ 'Click to clear the site\'s theme cache, forcing a reload from the source.' + -+ 'Clear' + -+ '
' -+ ); -+ -+ var CacheView = PopoverView.extend({ -+ className: 'popover', -+ title: _.template('<%= _t("Clear Cache") %>'), -+ content: template, -+ render: function() { -+ var self = this; -+ PopoverView.prototype.render.call(this); -+ self.$clear = $('#clearBtn', this.$el); -+ -+ self.$clear.on('click', function() { -+ -+ var url = self.app.options.themeUrl; -+ url = url.substr(0, url.indexOf('portal_resource')); -+ url += "/theming-controlpanel"; -+ -+ $.ajax({ -+ url: url, -+ data: { -+ 'form.button.InvalidateCache': true, -+ '_authenticator': utils.getAuthenticator() -+ }, -+ success: function(response) { -+ self.triggerView.el.click(); -+ alert("Cache cleared successfully."); -+ } -+ }); -+ }); -+ return this; -+ }, -+ toggle: function(button, e) { -+ PopoverView.prototype.toggle.apply(this, [button, e]); -+ var self = this; -+ } -+ -+ }); -+ -+ return CacheView; -+}); -diff --git a/mockup/patterns/thememapper/pattern.js b/mockup/patterns/thememapper/pattern.js -index f0d4137..1e47407 100644 ---- a/mockup/patterns/thememapper/pattern.js -+++ b/mockup/patterns/thememapper/pattern.js -@@ -37,10 +37,11 @@ define([ - 'mockup-patterns-thememapper-url/js/rulebuilder', - 'mockup-patterns-thememapper-url/js/rulebuilderview', - 'mockup-patterns-thememapper-url/js/lessbuilderview', -+ 'mockup-patterns-thememapper-url/js/cacheview', - 'mockup-ui-url/views/button', - 'mockup-ui-url/views/buttongroup', - 'mockup-utils' --], function($, Base, _, _t, InspectorTemplate, FileManager, RuleBuilder, RuleBuilderView, LessBuilderView, ButtonView, ButtonGroup, utils) { -+], function($, Base, _, _t, InspectorTemplate, FileManager, RuleBuilder, RuleBuilderView, LessBuilderView, CacheView, ButtonView, ButtonGroup, utils) { - 'use strict'; - - var inspectorTemplate = _.template(InspectorTemplate); -@@ -518,6 +519,13 @@ define([ - self.refreshButton.on("button:click", function() { - self.fileManager.refreshFile(); - }); -+ self.cacheButton = new ButtonView({ -+ id: 'cachebutton', -+ title: _t('Clear cache'), -+ icon: 'floppy-remove', -+ tooltip: _t('Clear site\'s theme cache'), -+ context: 'default' -+ }); - self.helpButton = new ButtonView({ - id: 'helpbutton', - title: _t('Help'), -@@ -532,6 +540,10 @@ define([ - triggerView: self.buildRuleButton, - app: self - }); -+ self.cacheView = new CacheView({ -+ triggerView: self.cacheButton, -+ app: self -+ }) - self.lessbuilderView = new LessBuilderView({ - triggerView: self.buildLessButton, - app: self -@@ -544,12 +556,14 @@ define([ - self.fullscreenButton, - self.buildLessButton, - self.refreshButton, -+ self.cacheButton, - self.helpButton - ], - id: 'mapper' - }); - $('#toolbar .navbar', self.$el).append(self.buttonGroup.render().el); - $('#toolbar .navbar', self.$el).append(self.rulebuilderView.render().el); -+ $('#toolbar .navbar', self.$el).append(self.cacheView.render().el); - $('#toolbar .navbar', self.$el).append(self.lessbuilderView.render().el); - } - }); +diff --git a/setup.py b/setup.py +index 4a443ca..b63c827 100644 +--- a/setup.py ++++ b/setup.py +@@ -10,7 +10,6 @@ + 'Products.CMFPlacefulWorkflow', + 'selenium', + 'transaction', +- 'unittest2', + 'zope.interface', + 'zope.publisher', + ] -Repository: mockup +Repository: plone.app.testing Branch: refs/heads/master -Date: 2015-08-20T10:34:46-05:00 -Author: Sam Schwartz (obct537) -Commit: https://github.com/plone/mockup/commit/16b680de40320fd81f95fd8d42f208753c32b6fd +Date: 2015-08-21T11:13:17+02:00 +Author: Philip Bauer (pbauer) +Commit: https://github.com/plone/plone.app.testing/commit/7a6d48f6a7fc7983d776061c2996c24811a8965a -Updated cacheclear button style/behavior to be more consistent - -Files changed: -M mockup/patterns/thememapper/js/cacheview.js -M mockup/patterns/thememapper/js/lessbuilderview.js - -diff --git a/mockup/patterns/thememapper/js/cacheview.js b/mockup/patterns/thememapper/js/cacheview.js -index c1a4d17..5ffbd25 100644 ---- a/mockup/patterns/thememapper/js/cacheview.js -+++ b/mockup/patterns/thememapper/js/cacheview.js -@@ -8,8 +8,9 @@ define([ - 'use strict'; - var template = _.template( - '
' + -- 'Click to clear the site\'s theme cache, forcing a reload from the source.' + -- 'Clear' + -+ 'Click to clear the site\'s theme cache, forcing a reload from the source.' + -+ '' + -+ 'Clear' + - '
' - ); - -@@ -21,6 +22,8 @@ define([ - var self = this; - PopoverView.prototype.render.call(this); - self.$clear = $('#clearBtn', this.$el); -+ self.$message = $('#clearMessage', this.$el); -+ self.$success = $('#clearSuccess', this.$el); - - self.$clear.on('click', function() { - -@@ -35,8 +38,14 @@ define([ - '_authenticator': utils.getAuthenticator() - }, - success: function(response) { -- self.triggerView.el.click(); -- alert("Cache cleared successfully."); -+ self.$message.hide(); -+ self.$success.show(); -+ -+ setTimeout(function() { -+ self.$message.show(); -+ self.$success.hide(); -+ self.triggerView.el.click(); -+ }, 3000); - } - }); - }); -diff --git a/mockup/patterns/thememapper/js/lessbuilderview.js b/mockup/patterns/thememapper/js/lessbuilderview.js -index 11ffe4f..5cc7052 100644 ---- a/mockup/patterns/thememapper/js/lessbuilderview.js -+++ b/mockup/patterns/thememapper/js/lessbuilderview.js -@@ -13,7 +13,7 @@ define([ - '
' + - '' + - '' + -- 'Compile' + -+ 'Compile' + - 'Clear' + - '
' + - '' - - -Repository: mockup - - -Branch: refs/heads/master -Date: 2015-08-20T10:35:48-05:00 -Author: Sam Schwartz (obct537) -Commit: https://github.com/plone/mockup/commit/6cd88a5ddd6d17d0966b1a5e80eb604c345b9b3f - -Fixed typo. - -Files changed: -M mockup/patterns/thememapper/js/cacheview.js - -diff --git a/mockup/patterns/thememapper/js/cacheview.js b/mockup/patterns/thememapper/js/cacheview.js -index 5ffbd25..c83994d 100644 ---- a/mockup/patterns/thememapper/js/cacheview.js -+++ b/mockup/patterns/thememapper/js/cacheview.js -@@ -9,7 +9,7 @@ define([ - var template = _.template( - '
' + - 'Click to clear the site\'s theme cache, forcing a reload from the source.' + -- '' + -+ '' + - 'Clear' + - '
' - ); -@@ -40,10 +40,12 @@ define([ - success: function(response) { - self.$message.hide(); - self.$success.show(); -+ self.$clear.hide(); - - setTimeout(function() { - self.$message.show(); - self.$success.hide(); -+ self.$clear.show(); - self.triggerView.el.click(); - }, 3000); - } - - -Repository: mockup +Merge pull request #15 from plone/gforcada-patch-1 - -Branch: refs/heads/master -Date: 2015-08-20T10:36:02-05:00 -Author: Sam Schwartz (obct537) -Commit: https://github.com/plone/mockup/commit/207f3b679edd6493bd2fa5480abcaf664ea9fc69 - -Updated changelog - -Files changed: -M CHANGES.rst - -diff --git a/CHANGES.rst b/CHANGES.rst -index 50c0d0d..888e8ea 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -4,6 +4,9 @@ Changelog - 2.1.0 (unreleased) - ------------------ - -+- Added button to clear the sitewide theme cache to the thememapper interface -+ [obct537] -+ - - Querystring pattern: Create date widgets with existing data, if present. - Also subscribe to the ``updated.pickadate.patterns`` to update values when - date widgets change. - - -Repository: mockup - - -Branch: refs/heads/master -Date: 2015-08-20T10:50:57-05:00 -Author: Nathan Van Gheem (vangheem) -Commit: https://github.com/plone/mockup/commit/8f399723a3ae2cc960e044178ebbfb6b1643faf8 - -Merge pull request #556 from plone/cachebutton - -Cachebutton +No need for unittest2 Files changed: -A mockup/patterns/thememapper/js/cacheview.js -M CHANGES.rst -M mockup/patterns/filemanager/pattern.js -M mockup/patterns/thememapper/js/lessbuilderview.js -M mockup/patterns/thememapper/pattern.js - -diff --git a/CHANGES.rst b/CHANGES.rst -index 50c0d0d..888e8ea 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -4,6 +4,9 @@ Changelog - 2.1.0 (unreleased) - ------------------ - -+- Added button to clear the sitewide theme cache to the thememapper interface -+ [obct537] -+ - - Querystring pattern: Create date widgets with existing data, if present. - Also subscribe to the ``updated.pickadate.patterns`` to update values when - date widgets change. -diff --git a/mockup/patterns/filemanager/pattern.js b/mockup/patterns/filemanager/pattern.js -index a09d496..6c088e1 100644 ---- a/mockup/patterns/filemanager/pattern.js -+++ b/mockup/patterns/filemanager/pattern.js -@@ -538,7 +538,9 @@ define([ - else if( typeof self.fileData[path].info !== 'undefined' ) - { - var preview = self.fileData[path].info; -- self.ace.editor.off(); -+ if( self.ace.editor !== undefined ) { -+ self.ace.editor.off(); -+ } - $('.ace_editor').empty().append(preview); - } - else -diff --git a/mockup/patterns/thememapper/js/cacheview.js b/mockup/patterns/thememapper/js/cacheview.js -new file mode 100644 -index 0000000..c83994d ---- /dev/null -+++ b/mockup/patterns/thememapper/js/cacheview.js -@@ -0,0 +1,64 @@ -+define([ -+ 'jquery', -+ 'underscore', -+ 'backbone', -+ 'mockup-patterns-filemanager-url/js/basepopover', -+ 'mockup-utils' -+], function($, _, Backbone, PopoverView, utils ) { -+ 'use strict'; -+ var template = _.template( -+ '
' + -+ 'Click to clear the site\'s theme cache, forcing a reload from the source.' + -+ '' + -+ 'Clear' + -+ '
' -+ ); -+ -+ var CacheView = PopoverView.extend({ -+ className: 'popover', -+ title: _.template('<%= _t("Clear Cache") %>'), -+ content: template, -+ render: function() { -+ var self = this; -+ PopoverView.prototype.render.call(this); -+ self.$clear = $('#clearBtn', this.$el); -+ self.$message = $('#clearMessage', this.$el); -+ self.$success = $('#clearSuccess', this.$el); -+ -+ self.$clear.on('click', function() { -+ -+ var url = self.app.options.themeUrl; -+ url = url.substr(0, url.indexOf('portal_resource')); -+ url += "/theming-controlpanel"; -+ -+ $.ajax({ -+ url: url, -+ data: { -+ 'form.button.InvalidateCache': true, -+ '_authenticator': utils.getAuthenticator() -+ }, -+ success: function(response) { -+ self.$message.hide(); -+ self.$success.show(); -+ self.$clear.hide(); -+ -+ setTimeout(function() { -+ self.$message.show(); -+ self.$success.hide(); -+ self.$clear.show(); -+ self.triggerView.el.click(); -+ }, 3000); -+ } -+ }); -+ }); -+ return this; -+ }, -+ toggle: function(button, e) { -+ PopoverView.prototype.toggle.apply(this, [button, e]); -+ var self = this; -+ } -+ -+ }); -+ -+ return CacheView; -+}); -diff --git a/mockup/patterns/thememapper/js/lessbuilderview.js b/mockup/patterns/thememapper/js/lessbuilderview.js -index 11ffe4f..5cc7052 100644 ---- a/mockup/patterns/thememapper/js/lessbuilderview.js -+++ b/mockup/patterns/thememapper/js/lessbuilderview.js -@@ -13,7 +13,7 @@ define([ - '
' + - '' + - '' + -- 'Compile' + -+ 'Compile' + - 'Clear' + - '
' + - '' -diff --git a/mockup/patterns/thememapper/pattern.js b/mockup/patterns/thememapper/pattern.js -index f0d4137..1e47407 100644 ---- a/mockup/patterns/thememapper/pattern.js -+++ b/mockup/patterns/thememapper/pattern.js -@@ -37,10 +37,11 @@ define([ - 'mockup-patterns-thememapper-url/js/rulebuilder', - 'mockup-patterns-thememapper-url/js/rulebuilderview', - 'mockup-patterns-thememapper-url/js/lessbuilderview', -+ 'mockup-patterns-thememapper-url/js/cacheview', - 'mockup-ui-url/views/button', - 'mockup-ui-url/views/buttongroup', - 'mockup-utils' --], function($, Base, _, _t, InspectorTemplate, FileManager, RuleBuilder, RuleBuilderView, LessBuilderView, ButtonView, ButtonGroup, utils) { -+], function($, Base, _, _t, InspectorTemplate, FileManager, RuleBuilder, RuleBuilderView, LessBuilderView, CacheView, ButtonView, ButtonGroup, utils) { - 'use strict'; - - var inspectorTemplate = _.template(InspectorTemplate); -@@ -518,6 +519,13 @@ define([ - self.refreshButton.on("button:click", function() { - self.fileManager.refreshFile(); - }); -+ self.cacheButton = new ButtonView({ -+ id: 'cachebutton', -+ title: _t('Clear cache'), -+ icon: 'floppy-remove', -+ tooltip: _t('Clear site\'s theme cache'), -+ context: 'default' -+ }); - self.helpButton = new ButtonView({ - id: 'helpbutton', - title: _t('Help'), -@@ -532,6 +540,10 @@ define([ - triggerView: self.buildRuleButton, - app: self - }); -+ self.cacheView = new CacheView({ -+ triggerView: self.cacheButton, -+ app: self -+ }) - self.lessbuilderView = new LessBuilderView({ - triggerView: self.buildLessButton, - app: self -@@ -544,12 +556,14 @@ define([ - self.fullscreenButton, - self.buildLessButton, - self.refreshButton, -+ self.cacheButton, - self.helpButton - ], - id: 'mapper' - }); - $('#toolbar .navbar', self.$el).append(self.buttonGroup.render().el); - $('#toolbar .navbar', self.$el).append(self.rulebuilderView.render().el); -+ $('#toolbar .navbar', self.$el).append(self.cacheView.render().el); - $('#toolbar .navbar', self.$el).append(self.lessbuilderView.render().el); - } - }); +M setup.py + +diff --git a/setup.py b/setup.py +index 4a443ca..b63c827 100644 +--- a/setup.py ++++ b/setup.py +@@ -10,7 +10,6 @@ + 'Products.CMFPlacefulWorkflow', + 'selenium', + 'transaction', +- 'unittest2', + 'zope.interface', + 'zope.publisher', + ]