Permalink
Browse files

First stab at a port from tw2.jqplugins.chosen.

  • Loading branch information...
1 parent fcd6bde commit d427bc97816aabb21f115a234e0a1fed0d98a8bf @ralphbean ralphbean committed Jun 7, 2012
View
12 LICENSE
@@ -0,0 +1,12 @@
+Copyright 2012 Igor Vaynberg
+
+Version: @@ver@@ Timestamp: @@timestamp@@
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in
+compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under the License is
+distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and limitations under the License.
View
@@ -1,2 +1,3 @@
-recursive-include tw2/jqplugins/chosen/static *
-include README.md
+recursive-include tw2/jqplugins/select2/static *
+include README.md
+include LICENSE
View
@@ -1,16 +1,9 @@
-tw2.jqplugins.chosen
-====================
+tw2.jqplugins.select2
+=====================
-Chosen is a JavaScript plugin that makes long,
-unwieldy select boxes much more user-friendly.
+Select2 is a jQuery based replacement for select boxes. It supports searching,
+remote data sets, and infinite scrolling of results.
-For more information about Chosen, see the harvest website:
-http://harvesthq.github.com/chosen/ or the Github repository
-for chosen: https://github.com/harvesthq/chosen
-
-Chosen is licensed under the MIT license and so is this
-ToscaWidgets2 library.
-
-The bundled version of Chosen in this project is
-harvesthq/chosen@dc024d784ac1c1971fc968d519ed4ef3d9915f1c
+For more information about select2, see https://github.com/ivaynberg/select2
+Select2 is licensed under the apache-2 license and so is this TW2 library.
View
@@ -1,9 +1,9 @@
-.. tw2.jqplugins.chosen documentation master file.
+.. tw2.jqplugins.select2 documentation master file.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
-Welcome to tw2.jqplugins.chosen documentation!
-=========================================================
+Welcome to tw2.jqplugins.select2 documentation!
+===============================================
Contents
--------
@@ -12,11 +12,11 @@ Contents
:maxdepth: 2
-:class:`tw2.jqplugins.chosen.Chosen`
-----------------------------------------------------------
+:class:`tw2.jqplugins.select2.Select2`
+-------------------------------------
-.. autoclass:: tw2.jqplugins.chosen.Chosen
-.. widgetbrowser:: tw2.jqplugins.chosen.Chosen
+.. autoclass:: tw2.jqplugins.select2.Select2
+.. widgetbrowser:: tw2.jqplugins.select2.Select2
.. note::
See http://toscawidgets.org/documentation/WidgetBrowser to learn how to
View
@@ -8,13 +8,13 @@
pass
setup(
- name='tw2.jqplugins.chosen',
+ name='tw2.jqplugins.select2',
version='0.1',
- description='ToscaWidgets 2 SelectFields enhanced with the Chosen javascript library.',
+ description='ToscaWidgets 2 SelectFields enhanced with the select2 javascript library.',
long_description=open('README.md').read(),
- author='Moritz Schlarb',
- author_email='mail@moritz-schlarb.de',
- url='https://github.com/toscawidgets/tw2.jqplugins.chosen',
+ author='Ralph Bean',
+ author_email='rbean@redhat.com',
+ url='https://github.com/toscawidgets/tw2.jqplugins.select2',
license='MIT',
install_requires=[
"tw2.core",
@@ -39,7 +39,7 @@
entry_points="""
[tw2.widgets]
# Register your widgets so they can be listed in the WidgetBrowser
- widgets = tw2.jqplugins.chosen
+ widgets = tw2.jqplugins.select2
""",
keywords = [
'toscawidgets.widgets',
View
@@ -1,33 +1,33 @@
from tw2.core.testbase import WidgetTest
-from tw2.jqplugins.chosen.widgets import (
- ChosenSingleSelectField,
- ChosenMultipleSelectField,
+from tw2.jqplugins.select2.widgets import (
+ Select2SingleSelectField,
+ Select2MultipleSelectField,
)
-class TestChosenSingleSelectField(WidgetTest):
+class TestSelect2SingleSelectField(WidgetTest):
engines = ['mako', 'genshi']
# place your widget at the TestWidget attribute
- widget = ChosenSingleSelectField
+ widget = Select2SingleSelectField
# Initialization args. go here
- attrs = {'id': 'chosen-test', 'options': ['Red', 'Blue']}
+ attrs = {'id': 'select2-test', 'options': ['Red', 'Blue']}
params = {}
expected = """
- <select id="chosen-test" name="chosen-test">
+ <select id="select2-test" name="select2-test">
<option></option><option value="Red">Red</option><option
value="Blue">Blue</option>
</select>"""
-class TestChosenMultipleSelectField(WidgetTest):
+class TestSelect2MultipleSelectField(WidgetTest):
engines = ['mako', 'genshi']
# place your widget at the TestWidget attribute
- widget = ChosenMultipleSelectField
+ widget = Select2MultipleSelectField
# Initialization args. go here
- attrs = {'id': 'chosen-test', 'options': ['Red', 'Blue']}
+ attrs = {'id': 'select2-test', 'options': ['Red', 'Blue']}
params = {}
expected = """
- <select multiple="multiple" id="chosen-test" name="chosen-test">
+ <select multiple="multiple" id="select2-test" name="select2-test">
<option value="Red">Red</option><option
value="Blue">Blue</option>
</select>"""
@@ -1,9 +0,0 @@
-'''
-Chosen is a JavaScript plugin that makes long,
-unwieldy select boxes much more user-friendly.
-
-For more information about Chosen, see:
-http://harvesthq.github.com/chosen/
-'''
-
-from widgets import *
Deleted file not rendered
Oops, something went wrong.

0 comments on commit d427bc9

Please sign in to comment.