From 7df71d620a4955f890ff111952e93e9d069d1ae5 Mon Sep 17 00:00:00 2001 From: Bogdan Girman Date: Sun, 14 Oct 2012 20:52:29 +0300 Subject: [PATCH 1/8] Added content listing tile change to integrate it --- plone/formwidget/querystring/querywidget.js | 134 ++++++++++++-------- 1 file changed, 82 insertions(+), 52 deletions(-) diff --git a/plone/formwidget/querystring/querywidget.js b/plone/formwidget/querystring/querywidget.js index fbddfa5..8c48a14 100644 --- a/plone/formwidget/querystring/querywidget.js +++ b/plone/formwidget/querystring/querywidget.js @@ -223,58 +223,6 @@ $.get(query, {}, function (data) { $('.QueryWidget .previewresults').html(data); }); }; - // Enhance for javascript browsers - $(document).ready(function () { - - // Check if QueryWidget exists on page - if ($(".QueryWidget").length === 0) { - return false; - } - - // Init - $.querywidget.init(); - - // We need two keep two fields for each sorting field ('#sort_on', - // '#sort_reversed'). The query results preview that calls - // '@@querybuilder_html_results' in plone.app.querystring expects a - // sort_on and sort_order param. To store the actual setting on the - // collection we need the two z3c.form-based fields - // ('#form-widgets-sort_on', '#form-widgets-sort_reversed') - - // Synchronize the '#sort_on' field with the hidden - // #form-widgets-sort_on z3c.form field on load. - $('#sort_on').val($('#form-widgets-sort_on').val()); - - // Synchronize the '#sort_order' field with the hidden - // #form-widgets-sort_reversed z3c.form field on load. - if ($('#form-widgets-sort_reversed-0').attr('checked')) { - $('#sort_order').attr('checked', true); - } else { - $('#sort_order').attr('checked', false); - } - - // Synchronize the z3c.form '#form-widgets-sort_on' field - // with the '#sort_on' field on user interaction - $("#sort_on").live('click', function () { - $('#form-widgets-sort_on').val($(this).val()); - }); - - // Synchronize the z3c.form '#form-widgets-sort_reversed' field - // with the '#sort_order' field on user interaction. - $("#sort_order").live('click', function () { - if ($(this).is(":checked")) { - $('#form-widgets-sort_reversed-0').attr('checked', true); - } else { - $('#form-widgets-sort_reversed-0').attr('checked', false); - } - }); - - // Hide the z3c.form widgets for sorting because they are only needed - // internally. - $('#formfield-form-widgets-sort_on').hide(); - $('#formfield-form-widgets-sort_reversed').hide(); - - }); // Init widget $.querywidget.init = function () { @@ -423,3 +371,85 @@ }; }(jQuery)); + + +(function($, undefined) { + + var QueryStringWidget = function(el, options) { this.init(el, options); }; + QueryStringWidget.prototype = { + init: function(el, options) { + var self = this; + + self.el = $(el); + self.options = options; + + // Init + $.querywidget.init(); + + // We need two keep two fields for each sorting field ('#sort_on', + // '#sort_reversed'). The query results preview that calls + // '@@querybuilder_html_results' in plone.app.querystring expects a + // sort_on and sort_order param. To store the actual setting on the + // collection we need the two z3c.form-based fields + // ('#form-widgets-sort_on', '#form-widgets-sort_reversed') + + // Synchronize the '#sort_on' field with the hidden + // #form-widgets-sort_on z3c.form field on load. + $('#sort_on').val($('#form-widgets-sort_on').val()); + + // Synchronize the '#sort_order' field with the hidden + // #form-widgets-sort_reversed z3c.form field on load. + if ($('#form-widgets-sort_reversed-0').attr('checked')) { + $('#sort_order').attr('checked', true); + } else { + $('#sort_order').attr('checked', false); + } + + // Synchronize the z3c.form '#form-widgets-sort_on' field + // with the '#sort_on' field on user interaction + $("#sort_on").live('click', function () { + $('#form-widgets-sort_on').val($(this).val()); + }); + + // Synchronize the z3c.form '#form-widgets-sort_reversed' field + // with the '#sort_order' field on user interaction. + $("#sort_order").live('click', function () { + if ($(this).is(":checked")) { + $('#form-widgets-sort_reversed-0').attr('checked', true); + } else { + $('#form-widgets-sort_reversed-0').attr('checked', false); + } + }); + + // Hide the z3c.form widgets for sorting because they are only needed + // internally. + $('#formfield-form-widgets-sort_on').hide(); + $('#formfield-form-widgets-sort_reversed').hide(); + + + }, + updateOptions: function(options) { + var self = this; + self.options = $.extend(self.options, options); + } + }; + + $.fn.ploneQueryStringWidget = function(options) { + $(this).each(function(i, el){ + var data = $(el).data('plone-widget-querystring'); + if (data === undefined) { + data = new QueryStringWidget($(el), options); + } else { + data.updateOptions(options); + } + }); + return this; + }; + + $(document).ready(function () { + $(".QueryWidget").ploneQueryStringWidget(); + }); + +}(jQuery)); + + From bd6ddfb3d0bfad62daaf74fc45ace579593e138c Mon Sep 17 00:00:00 2001 From: Bogdan Girman Date: Sun, 14 Oct 2012 20:57:52 +0300 Subject: [PATCH 2/8] Revert "Added content listing tile change to integrate it" This reverts commit 7df71d620a4955f890ff111952e93e9d069d1ae5. should end up in contentlistingtileintegration branch --- plone/formwidget/querystring/querywidget.js | 134 ++++++++------------ 1 file changed, 52 insertions(+), 82 deletions(-) diff --git a/plone/formwidget/querystring/querywidget.js b/plone/formwidget/querystring/querywidget.js index 8c48a14..fbddfa5 100644 --- a/plone/formwidget/querystring/querywidget.js +++ b/plone/formwidget/querystring/querywidget.js @@ -223,6 +223,58 @@ $.get(query, {}, function (data) { $('.QueryWidget .previewresults').html(data); }); }; + // Enhance for javascript browsers + $(document).ready(function () { + + // Check if QueryWidget exists on page + if ($(".QueryWidget").length === 0) { + return false; + } + + // Init + $.querywidget.init(); + + // We need two keep two fields for each sorting field ('#sort_on', + // '#sort_reversed'). The query results preview that calls + // '@@querybuilder_html_results' in plone.app.querystring expects a + // sort_on and sort_order param. To store the actual setting on the + // collection we need the two z3c.form-based fields + // ('#form-widgets-sort_on', '#form-widgets-sort_reversed') + + // Synchronize the '#sort_on' field with the hidden + // #form-widgets-sort_on z3c.form field on load. + $('#sort_on').val($('#form-widgets-sort_on').val()); + + // Synchronize the '#sort_order' field with the hidden + // #form-widgets-sort_reversed z3c.form field on load. + if ($('#form-widgets-sort_reversed-0').attr('checked')) { + $('#sort_order').attr('checked', true); + } else { + $('#sort_order').attr('checked', false); + } + + // Synchronize the z3c.form '#form-widgets-sort_on' field + // with the '#sort_on' field on user interaction + $("#sort_on").live('click', function () { + $('#form-widgets-sort_on').val($(this).val()); + }); + + // Synchronize the z3c.form '#form-widgets-sort_reversed' field + // with the '#sort_order' field on user interaction. + $("#sort_order").live('click', function () { + if ($(this).is(":checked")) { + $('#form-widgets-sort_reversed-0').attr('checked', true); + } else { + $('#form-widgets-sort_reversed-0').attr('checked', false); + } + }); + + // Hide the z3c.form widgets for sorting because they are only needed + // internally. + $('#formfield-form-widgets-sort_on').hide(); + $('#formfield-form-widgets-sort_reversed').hide(); + + }); // Init widget $.querywidget.init = function () { @@ -371,85 +423,3 @@ }; }(jQuery)); - - -(function($, undefined) { - - var QueryStringWidget = function(el, options) { this.init(el, options); }; - QueryStringWidget.prototype = { - init: function(el, options) { - var self = this; - - self.el = $(el); - self.options = options; - - // Init - $.querywidget.init(); - - // We need two keep two fields for each sorting field ('#sort_on', - // '#sort_reversed'). The query results preview that calls - // '@@querybuilder_html_results' in plone.app.querystring expects a - // sort_on and sort_order param. To store the actual setting on the - // collection we need the two z3c.form-based fields - // ('#form-widgets-sort_on', '#form-widgets-sort_reversed') - - // Synchronize the '#sort_on' field with the hidden - // #form-widgets-sort_on z3c.form field on load. - $('#sort_on').val($('#form-widgets-sort_on').val()); - - // Synchronize the '#sort_order' field with the hidden - // #form-widgets-sort_reversed z3c.form field on load. - if ($('#form-widgets-sort_reversed-0').attr('checked')) { - $('#sort_order').attr('checked', true); - } else { - $('#sort_order').attr('checked', false); - } - - // Synchronize the z3c.form '#form-widgets-sort_on' field - // with the '#sort_on' field on user interaction - $("#sort_on").live('click', function () { - $('#form-widgets-sort_on').val($(this).val()); - }); - - // Synchronize the z3c.form '#form-widgets-sort_reversed' field - // with the '#sort_order' field on user interaction. - $("#sort_order").live('click', function () { - if ($(this).is(":checked")) { - $('#form-widgets-sort_reversed-0').attr('checked', true); - } else { - $('#form-widgets-sort_reversed-0').attr('checked', false); - } - }); - - // Hide the z3c.form widgets for sorting because they are only needed - // internally. - $('#formfield-form-widgets-sort_on').hide(); - $('#formfield-form-widgets-sort_reversed').hide(); - - - }, - updateOptions: function(options) { - var self = this; - self.options = $.extend(self.options, options); - } - }; - - $.fn.ploneQueryStringWidget = function(options) { - $(this).each(function(i, el){ - var data = $(el).data('plone-widget-querystring'); - if (data === undefined) { - data = new QueryStringWidget($(el), options); - } else { - data.updateOptions(options); - } - }); - return this; - }; - - $(document).ready(function () { - $(".QueryWidget").ploneQueryStringWidget(); - }); - -}(jQuery)); - - From 6430b842674dc90dbe479beb524ee41b0cc3a676 Mon Sep 17 00:00:00 2001 From: Patrick Gerken Date: Thu, 24 Jan 2013 16:24:00 +0100 Subject: [PATCH 3/8] Upgrade import path. Necessary for Plone 4.3 --- CHANGES.txt | 3 +++ plone/formwidget/querystring/widget.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index c7803a4..ec08e84 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -23,6 +23,9 @@ Changelog but not deleted from the collections in before hand. [bosim] +- Update import path for pagetemplate. Now only works with 4.1 and higher + [do3cc] + 1.0b2 (2012-03-19) ------------------ diff --git a/plone/formwidget/querystring/widget.py b/plone/formwidget/querystring/widget.py index 1ad5151..15b135d 100644 --- a/plone/formwidget/querystring/widget.py +++ b/plone/formwidget/querystring/widget.py @@ -1,7 +1,7 @@ +from zope.browserpage.viewpagetemplatefile import ViewPageTemplateFile from zope.component import getUtility from zope.component import getMultiAdapter from zope.interface import implements, implementer -from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile from zope.site.hooks import getSite import z3c.form.interfaces import z3c.form.util From dcac049d1438567bbf595265b876a40815c6bfa7 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 4 Feb 2013 15:57:19 +0100 Subject: [PATCH 4/8] Whitespace. --- CHANGES.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ec08e84..dee8bc4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,7 +8,7 @@ Changelog [kroman0] - Fixed conditional initialization of querywidget, - see https://dev.plone.org/ticket/12529 [kroman0] + see http://dev.plone.org/ticket/12529 [kroman0] - The widget can now be hidden, when clicking on the window or the widget. The event is only effective @@ -18,9 +18,9 @@ Changelog - Translations are now in Plone domain [bosim] -- Made the widget a bit more resistent to missing entries, i.e. vocabularies or in - other way indexes. The problem occur if an option is deleted from the registry - but not deleted from the collections in before hand. +- Made the widget a bit more resistent to missing entries, i.e. vocabularies + or in other way indexes. The problem occur if an option is deleted from the + registry but not deleted from the collections in before hand. [bosim] - Update import path for pagetemplate. Now only works with 4.1 and higher From bdf01d9eae523a00d3a38897fdb67b6893f79f39 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 4 Feb 2013 15:58:04 +0100 Subject: [PATCH 5/8] Rename CHANGES .txt to .rst. --- CHANGES.txt => CHANGES.rst | 0 setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename CHANGES.txt => CHANGES.rst (100%) diff --git a/CHANGES.txt b/CHANGES.rst similarity index 100% rename from CHANGES.txt rename to CHANGES.rst diff --git a/setup.py b/setup.py index 497d8d7..8eb91d8 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup(name='plone.formwidget.querystring', version=version, description="A widget for composing a Query string/search.", long_description=open("README.rst").read() + "\n" + - open("CHANGES.txt").read(), + open("CHANGES.rst").read(), classifiers=[ "Framework :: Plone", "Programming Language :: Python", From 9c7e7d0e7a4e192c0438abecbeadc73d53175a4c Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 4 Feb 2013 16:01:19 +0100 Subject: [PATCH 6/8] Pep8 --- setup.py | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/setup.py b/setup.py index 8eb91d8..2966d2b 100644 --- a/setup.py +++ b/setup.py @@ -2,31 +2,34 @@ from setuptools import setup, find_packages version = '1.0b3' -setup(name='plone.formwidget.querystring', - version=version, - description="A widget for composing a Query string/search.", - long_description=open("README.rst").read() + "\n" + - open("CHANGES.rst").read(), - classifiers=[ +long_description = open("README.rst").read() + "\n" + \ + open("CHANGES.rst").read() + +setup( + name='plone.formwidget.querystring', + version=version, + description="A widget for composing a Query string/search.", + long_description=long_description, + classifiers=[ "Framework :: Plone", "Programming Language :: Python", - ], - keywords='', - author='Plone Foundation', - author_email='plone-developers@lists.sourceforge.net', - url='https://github.com/plone/plone.formwidget.querystring', - license='GPL', - packages=find_packages(exclude=['ez_setup']), - namespace_packages=['plone', 'plone.formwidget'], - include_package_data=True, - zip_safe=False, - install_requires=[ - 'setuptools', - 'plone.app.querystring', - ], - entry_points=""" - # -*- Entry points: -*- - [z3c.autoinclude.plugin] - target = plone - """, - ) + ], + keywords='', + author='Plone Foundation', + author_email='plone-developers@lists.sourceforge.net', + url='https://github.com/plone/plone.formwidget.querystring', + license='GPL', + packages=find_packages(exclude=['ez_setup']), + namespace_packages=['plone', 'plone.formwidget'], + include_package_data=True, + zip_safe=False, + install_requires=[ + 'setuptools', + 'plone.app.querystring', + ], + entry_points=""" + # -*- Entry points: -*- + [z3c.autoinclude.plugin] + target = plone + """, +) From 2322a91800faccf8221dad0660c942d3332de709 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Mon, 4 Feb 2013 16:01:31 +0100 Subject: [PATCH 7/8] Prepare 1.0b3 release. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index dee8bc4..f8e8832 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,7 @@ Changelog ========= -1.0b3 (unreleased) +1.0b3 (2013-02-04) ------------------ - Fixed context for getting ajax results From 6852d4a836d06914dbe595ce495886d67d863312 Mon Sep 17 00:00:00 2001 From: Daniel Widerin Date: Tue, 9 Apr 2013 16:41:40 +0200 Subject: [PATCH 8/8] Define a foreground color when using a defined background color. --- CHANGES.rst | 8 ++++++++ plone/formwidget/querystring/querywidget.css | 5 +++-- setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index f8e8832..9164f49 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,14 @@ Changelog ========= +1.0b4 (unreleased) +------------------ + +- If we set background to 'white' we should set foreground to 'black' to avoid + people getting white font on white background if they use white font color + for their plone sites. [saily] + + 1.0b3 (2013-02-04) ------------------ diff --git a/plone/formwidget/querystring/querywidget.css b/plone/formwidget/querystring/querywidget.css index b60d73d..5a3c028 100644 --- a/plone/formwidget/querystring/querywidget.css +++ b/plone/formwidget/querystring/querywidget.css @@ -69,11 +69,12 @@ dl.multipleSelectionWidget, } .multipleSelectionWidget dd { width: 198px; - background: white; + background: #FFF; overflow:auto; } .multipleSelectionWidget label { display: block; + color: #000; } .querywidget { float: left; @@ -105,4 +106,4 @@ dl.querywidget dd { have the highest priority. */ .multipleSelectionWidget .hiddenStructure { display: none !important; -} \ No newline at end of file +} diff --git a/setup.py b/setup.py index 2966d2b..302d0f1 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '1.0b3' +version = '1.0b4' long_description = open("README.rst").read() + "\n" + \ open("CHANGES.rst").read()