Skip to content

Commit

Permalink
Merge branch 'Item12116'
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Apr 9, 2015
2 parents 5c58582 + fc58466 commit 96394b7
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 48 deletions.
12 changes: 12 additions & 0 deletions .gitignore
@@ -0,0 +1,12 @@
*.gz
*.swp
pub/System/JQSelect2Contrib/jquery.select2.init.js
pub/System/JQSelect2Contrib/jquery.select2.css
pub/System/JQSelect2Contrib/jquery.select2.js
JQSelect2Contrib.md5
JQSelect2Contrib.sha1
JQSelect2Contrib.tgz
JQSelect2Contrib.txt
JQSelect2Contrib.zip
JQSelect2Contrib_installer
JQSelect2Contrib_installer.pl
12 changes: 6 additions & 6 deletions data/System/JQSelect2Contrib.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1349362185" format="1.1" reprev="1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1428561401" format="1.1" version="1"}%
---+ %TOPIC%

%JQPLUGINS{"select2"
Expand Down Expand Up @@ -29,7 +29,7 @@ Add the =jqSelect2= CSS class to a select tag to make it turn into a Select2 wid
<verbatim class="tml">
%JQREQUIRE{"select2"}%

<select class='jqSelect2 {placeholder: "Select a burger", width: "element"}'>
<select class='jqSelect2' data-placeholder='Select a burger' data-width='element'>
<option>Hamburger</option>
<option>Hamburger deluxe with gold plating</option>
<option>Cheeseburger</option>
Expand All @@ -40,7 +40,7 @@ Add the =jqSelect2= CSS class to a select tag to make it turn into a Select2 wid
If Select2 is enabled, you will see the result below:

%JQREQUIRE{"select2"}%
<select class='jqSelect2 {placeholder: "Select a burger", width: "element"}'>
<select class='jqSelect2' data-placeholder='Select a burger' data-width='element'>
<option>Hamburger</option>
<option>Hamburger deluxe with gold plating</option>
<option>Cheeseburger</option>
Expand All @@ -57,13 +57,13 @@ If Select2 is enabled, you will see the result below:
-->

| Author(s): | [[Foswiki:Main.JanKrueger][Jan Krueger]] |
| Copyright: | &copy; 2012 Modell Aachen !GmbH, http://modell-aachen.de/ |
| Copyright: | &copy; 2012 Modell Aachen !GmbH, http://modell-aachen.de/; &copy; 2012-2015 Foswiki Contributors |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (GNU General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 04 Oct 2012: | initial release based on Select2 3.2 |
| 09 Mar 2015: | initial release on foswiki.org (Foswiki:Main/MichaelDaum) |
| 04 Oct 2012: | initial check-in of select2 3.2 (Foswiki:Main/JanKrueger) |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | Foswiki:Extensions/%TOPIC% |
| Support: | Foswiki:Support/%TOPIC% |

1 change: 1 addition & 0 deletions lib/Foswiki/Contrib/JQSelect2Contrib.pm
@@ -1,6 +1,7 @@
# Contrib for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2012 Modell Aachen GmbH, http://modell-aachen.de/
# Copyright (C) 2012-2015 Foswiki Contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
1 change: 1 addition & 0 deletions lib/Foswiki/Contrib/JQSelect2Contrib/Config.spec
Expand Up @@ -6,3 +6,4 @@ $Foswiki::cfg{JQueryPlugin}{Plugins}{Select2}{Module} = 'Foswiki::Contrib::JQSel
# **BOOLEAN**
$Foswiki::cfg{JQueryPlugin}{Plugins}{Select2}{Enabled} = 1;

1;
12 changes: 6 additions & 6 deletions lib/Foswiki/Contrib/JQSelect2Contrib/MANIFEST
@@ -1,18 +1,18 @@
data/System/JQSelect2Contrib.txt 0644
lib/Foswiki/Contrib/JQSelect2Contrib.pm 0644
lib/Foswiki/Contrib/JQSelect2Contrib/Config.spec 0644
lib/Foswiki/Contrib/JQSelect2Contrib.pm 0644
lib/Foswiki/Contrib/JQSelect2Contrib/SELECT2.pm 0644
pub/System/JQSelect2Contrib/jquery.select2.css 0644
pub/System/JQSelect2Contrib/jquery.select2.css.gz 0644
pub/System/JQSelect2Contrib/jquery.select2.init.js 0644
pub/System/JQSelect2Contrib/jquery.select2.init.js.gz 0644
pub/System/JQSelect2Contrib/jquery.select2.init.uncompressed.js 0644
pub/System/JQSelect2Contrib/jquery.select2.js 0644
pub/System/JQSelect2Contrib/jquery.select2.js.gz 0644
pub/System/JQSelect2Contrib/jquery.select2.uncompressed.css 0644
pub/System/JQSelect2Contrib/jquery.select2.uncompressed.js 0644
pub/System/JQSelect2Contrib/jquery.select2.init.js 0644
pub/System/JQSelect2Contrib/jquery.select2.init.js.gz 0644
pub/System/JQSelect2Contrib/jquery.select2.init.uncompressed.js 0644
pub/System/JQSelect2Contrib/LICENSE
pub/System/JQSelect2Contrib/LICENSE 0644
pub/System/JQSelect2Contrib/Makefile 0644
pub/System/JQSelect2Contrib/select2.png 0644
pub/System/JQSelect2Contrib/select2x2.png 0644
pub/System/JQSelect2Contrib/spinner.gif 0644

35 changes: 34 additions & 1 deletion lib/Foswiki/Contrib/JQSelect2Contrib/SELECT2.pm
@@ -1,6 +1,7 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2012 Modell Aachen GmbH, http://modell-aachen.de/
# Copyright (C) 2012-2015 Foswiki Contributors.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -46,7 +47,7 @@ sub new {
homepage => 'http://ivaynberg.github.com/select2/',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQSelect2Contrib',
documentation => "$Foswiki::cfg{SystemWebName}.JQSelect2Contrib",
javascript => ['jquery.select2.init.js', 'jquery.select2.js'],
javascript => ['jquery.select2.js', 'jquery.select2.init.js', ],
css => ['jquery.select2.css'],
dependencies => ['livequery', 'metadata'],
@_
Expand All @@ -55,5 +56,37 @@ sub new {
return $this;
}

=begin TML
---++ ClassMethod init( $this )
Initialize this plugin by adding the required static files to the page
=cut

sub init {
my $this = shift;

return unless $this->SUPER::init();

# open matching localization file if it exists
my $session = $Foswiki::Plugins::SESSION;
my $langTag = $session->i18n->language();
my $messagePath =
$Foswiki::cfg{SystemWebName}
. '/JQSelect2Contrib/select2_locale_'
. $langTag . '.js';
my $messageFile = $Foswiki::cfg{PubDir} . '/' . $messagePath;
if ( -f $messageFile ) {
my $text .=
"<script type='text/javascript' src='$Foswiki::cfg{PubUrlPath}/$messagePath'></script>\n";
Foswiki::Func::addToZone(
'script', "JQUERYPLUGIN::SELECT2::LANG",
$text, 'JQUERYPLUGIN::SELECT2'
);
}

}

1;

18 changes: 12 additions & 6 deletions pub/System/JQSelect2Contrib/LICENSE
@@ -1,12 +1,18 @@
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:
This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.

You may obtain a copy of the Apache License and the GPL License at:

http://www.apache.org/licenses/LICENSE-2.0
http://www.gnu.org/licenses/gpl-2.0.html

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.
Unless required by applicable law or agreed to in writing, software distributed under the Apache License
or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the Apache License and the GPL License for the specific language governing
permissions and limitations under the Apache License and the GPL License.
10 changes: 10 additions & 0 deletions pub/System/JQSelect2Contrib/Makefile
@@ -0,0 +1,10 @@
FOSWIKI_ROOT?=~/foswiki/core
TARGET=\
jquery.select2.js \
jquery.select2.init.js \
jquery.select2.css

-include $(FOSWIKI_ROOT)/pub/System/JQueryPlugin/Makefile.include

clean:
rm $(TARGET) *.gz
@@ -1,7 +1,9 @@
// initializer for the select2 plugin
jQuery(function($) {
$(".jqSelect2").livequery(function() {
var $this = $(this), opts = $.extend({}, $this.metadata());
$this.removeClass("jqSelect2").select2(opts);
var defaults = {};

$(".jqSelect2:not(.jqSelect2Inited)").livequery(function() {
var $this = $(this), opts = $.extend({}, defaults, $this.metadata(), $this.data());
$this.addClass("jqSelect2Inited").select2(opts);
});
});
40 changes: 15 additions & 25 deletions pub/System/JQSelect2Contrib/jquery.select2.uncompressed.css
Expand Up @@ -83,7 +83,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
display: block;
position: absolute;
right: 26px;
top: 8px;
top: 7px;
width: 12px;
height: 12px;
font-size: 1px;
Expand Down Expand Up @@ -221,6 +221,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}


/*
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
Expand All @@ -230,6 +231,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
border: 1px solid #5897fb;
outline: none;
}
*/

.select2-dropdown-open .select2-choice {
border: 1px solid #aaa;
Expand Down Expand Up @@ -274,6 +276,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012

.select2-results ul.select2-result-sub {
margin: 0 0 0 0;
padding:0;
}

.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
Expand All @@ -299,6 +302,11 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
cursor: pointer;
}

.select2-results .select2-result-label .image-item {
background-repeat:no-repeat;
padding-left:40px;
}

.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
Expand Down Expand Up @@ -364,12 +372,6 @@ disabled look for already selected choices in the results dropdown

.select2-container-multi .select2-choices {
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
border: 1px solid #aaa;
margin: 0;
padding: 0;
Expand All @@ -384,6 +386,7 @@ disabled look for already selected choices in the results dropdown
min-height: 26px;
}

/*
.select2-container-multi.select2-container-active .select2-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
Expand All @@ -392,6 +395,7 @@ disabled look for already selected choices in the results dropdown
border: 1px solid #5897fb;
outline: none;
}
*/
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
Expand All @@ -407,8 +411,6 @@ disabled look for already selected choices in the results dropdown
background: transparent !important;
font-family: sans-serif;
font-size: 100%;
height: 15px;
padding: 5px;
margin: 1px 0;
outline: 0;
border: 0;
Expand All @@ -433,21 +435,14 @@ disabled look for already selected choices in the results dropdown
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-color: #f7f7f7;
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
color: #333;
border: 1px solid #aaaaaa;
border: 1px solid #bbb;
line-height: 13px;
padding: 3px 5px 3px 18px;
padding: 3px 18px 3px 5px;
margin: 3px 0 3px 5px;
position: relative;
cursor: default;
Expand All @@ -463,19 +458,14 @@ disabled look for already selected choices in the results dropdown
display: block;
position: absolute;
right: 3px;
top: 4px;
top: 3px;
width: 12px;
height: 13px;
font-size: 1px;
background: url('select2.png') right top no-repeat;
outline: none;
}

.select2-container-multi .select2-search-choice-close {
left: 3px;
}


.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
Expand Down
2 changes: 1 addition & 1 deletion pub/System/JQSelect2Contrib/jquery.select2.uncompressed.js
Expand Up @@ -33,7 +33,7 @@
})(jQuery);

(function ($, undefined) {
"use strict";
"use strict";
/*global document, window, jQuery, console */

if (window.Select2 !== undefined) {
Expand Down

0 comments on commit 96394b7

Please sign in to comment.