From ec0c7476fbf355fc20ae1675a2a94b17e280a7fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Dec 2014 23:51:36 +0100 Subject: [PATCH] Work on select2 prototype. --- htdocs/main.inc.php | 1 + htdocs/public/test/test_forms.php | 28 ++++++++++++++++++++------- htdocs/theme/eldy/style.css.php | 32 ++++++++++++++++++++++++++++--- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2920dc2e436..9c682f42eb0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -992,6 +992,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $ext=''; if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION); + if (GETPOST('version')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js if (! defined('DISABLE_JQUERY') && ! $disablejs && $conf->use_javascript_ajax) { diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index 71f9024c17f..55b8296e43a 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -21,8 +21,8 @@ llxHeader(); This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (edit page to change to test another css)
- jmobile (add parameter dol_use_jmobile=1 to enable view with jmobile)
-
+
select_date(dol_get_first_day(1970,1,false), 'test3', 1, 1, 0); print '

'."\n"; -// Test4: a multiselect -print "Test 4: a multiselect
\n"; +// Test4a: form->select_product +print "Test 4: Select product - "; +$form->select_produits(0,'producttest'); + +print '

'."\n"; + +// Test4b: form->selectarray +print "Test 4: Select array - "; +$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); +$arrayselected=array(1,3); +print $form->selectarray('selectarray',$array); + +print '

'."\n"; + +// Test5: a multiselect +print "Test 5: a multiselect
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); $arrayselected=array(1,3); print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250); print '

'."\n"; -// Test5: a select -print "Test 5a: a select
\n"; +// Test6: a select +print "Test 6a: a select
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3 ith a very long text. aze eazeae e ae aeae a e a ea ea ea e a e aea e ae aeaeaeaze.'); $selected=3; print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); -print '
'; -print "Test 5b: a select
\n"; +print '

'; +print "Test 6b: a select
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); $selected=3; print $form->selectarray('testselectb', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c4d933d4940..8a11a65241e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -107,7 +107,7 @@ $colorbacklinepair2='255,255,255'; // line pair $colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); $colorbackbody='#f9f9f9'; $colortext='40,40,40'; -$fontsize='12'; +$fontsize='13'; $fontsizesmaller='11'; // Eldy colors @@ -263,7 +263,7 @@ input, textarea, select { border-top:solid 1px rgba(0,0,0,.3); border-bottom:solid 1px rgba(0,0,0,.2); /* box-shadow: 1px 1px 1px rgba(0,0,0,.2) inset;*/ - padding:2px; + padding:4px; margin-left:1px; margin-bottom:1px; margin-top:1px; @@ -2454,6 +2454,7 @@ li.cal_event { border: none; list-style-type: none; } cursor:pointer; } + /* ============================================================================== */ /* jQuery - jeditable */ /* ============================================================================== */ @@ -2642,7 +2643,7 @@ A.none, A.none:active, A.none:visited, A.none:hover { { line-height: 1em !important; } -.ui-autocomplete-input { margin: 0; padding: 2px; } +.ui-autocomplete-input { margin: 0; padding: 4px; } /* ============================================================================== */ @@ -2910,6 +2911,31 @@ div.dolEventError h1, div.dolEventError h2 { background-image: none; } +/* ============================================================================== */ +/* Select2 */ +/* ============================================================================== */ + +.select2-choice, +.select2-drop.select2-drop-above.select2-drop-active, +.select2-container-active .select2-choice, +.select2-container-active .select2-choices, +.select2-dropdown-open.select2-drop-above .select2-choice, +.select2-dropdown-open.select2-drop-above .select2-choices, +.select2-container-multi.select2-container-active .select2-choices +{ + border: 1px solid #aaa; +} + +.select2-drop-active +{ + border: 1px solid #aaa; + border-top: none; +} +a span.select2-chosen +{ + font-weight: normal !important; +} + /* ============================================================================== */ /* JMobile */