Skip to content
Extraits de code Groupes Projets
Valider 192b76b0 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

integration du composant dateur et du composant selecteur article/rubrique pour les formulaires

parent 221ff164
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Affichage de
avec 4381 ajouts et 11 suppressions
...@@ -343,6 +343,12 @@ prive/formulaires/configurer_visiteurs.html -text ...@@ -343,6 +343,12 @@ prive/formulaires/configurer_visiteurs.html -text
prive/formulaires/configurer_visiteurs.php -text prive/formulaires/configurer_visiteurs.php -text
prive/formulaires/dater.html -text prive/formulaires/dater.html -text
prive/formulaires/dater.php -text prive/formulaires/dater.php -text
prive/formulaires/dateur/datePicker.css -text
prive/formulaires/dateur/dates.js -text
prive/formulaires/dateur/inc-dateur.html -text
prive/formulaires/dateur/jquery.datePicker.js -text
prive/formulaires/dateur/jquery.timePicker.js -text
prive/formulaires/dateur/timePicker.css -text
prive/formulaires/editer_article.html -text prive/formulaires/editer_article.html -text
prive/formulaires/editer_article.php -text prive/formulaires/editer_article.php -text
prive/formulaires/editer_auteur.html -text prive/formulaires/editer_auteur.html -text
...@@ -359,6 +365,19 @@ prive/formulaires/recherche_ecrire.html -text ...@@ -359,6 +365,19 @@ prive/formulaires/recherche_ecrire.html -text
prive/formulaires/recherche_ecrire.php -text prive/formulaires/recherche_ecrire.php -text
prive/formulaires/rediriger_article.html -text prive/formulaires/rediriger_article.html -text
prive/formulaires/rediriger_article.php -text prive/formulaires/rediriger_article.php -text
prive/formulaires/selecteur/articles.html -text
prive/formulaires/selecteur/articles_fonctions.php -text
prive/formulaires/selecteur/inc-nav-articles.html -text
prive/formulaires/selecteur/inc-nav-rubriques.html -text
prive/formulaires/selecteur/inc-sel-articles.html -text
prive/formulaires/selecteur/inc-sel-rubriques.html -text
prive/formulaires/selecteur/jquery-ui-1.6.custom.js -text
prive/formulaires/selecteur/jquery.picker.js -text
prive/formulaires/selecteur/navigateur.html -text
prive/formulaires/selecteur/picker-ajax.html -text
prive/formulaires/selecteur/picker.css -text
prive/formulaires/selecteur/rubriques.html -text
prive/formulaires/selecteur/selecteur_fonctions.php -text
prive/formulaires/selecteur_groupe_mot.html -text prive/formulaires/selecteur_groupe_mot.html -text
prive/formulaires/selecteur_groupe_mot_fonctions.php -text prive/formulaires/selecteur_groupe_mot_fonctions.php -text
prive/ical_prive.html -text prive/ical_prive.html -text
...@@ -398,8 +417,6 @@ prive/images/cal-suivi.png -text ...@@ -398,8 +417,6 @@ prive/images/cal-suivi.png -text
prive/images/cal-today.gif -text prive/images/cal-today.gif -text
prive/images/calendrier-24.gif -text prive/images/calendrier-24.gif -text
prive/images/cfg-16.png -text prive/images/cfg-16.png -text
prive/images/chemin-fond-left.gif -text
prive/images/chemin-fond-right.gif -text
prive/images/choix-layout.gif -text prive/images/choix-layout.gif -text
prive/images/choix-layout_rtl.gif -text prive/images/choix-layout_rtl.gif -text
prive/images/choix-layout_rtl_he.gif -text prive/images/choix-layout_rtl_he.gif -text
...@@ -465,12 +482,6 @@ prive/images/jauge-jaune.gif -text ...@@ -465,12 +482,6 @@ prive/images/jauge-jaune.gif -text
prive/images/jauge-rouge.gif -text prive/images/jauge-rouge.gif -text
prive/images/jauge-test-gd.gif -text prive/images/jauge-test-gd.gif -text
prive/images/jauge-vert.gif -text prive/images/jauge-vert.gif -text
prive/images/label-fond-compact-left.gif -text
prive/images/label-fond-compact-right.gif -text
prive/images/label-fond-gauche-left.gif -text
prive/images/label-fond-gauche-right.gif -text
prive/images/label-fond-haut-left.gif -text
prive/images/label-fond-haut-right.gif -text
prive/images/langues-12.gif -text prive/images/langues-12.gif -text
prive/images/langues-24.gif -text prive/images/langues-24.gif -text
prive/images/langues-modif-12.gif -text prive/images/langues-modif-12.gif -text
...@@ -574,9 +585,6 @@ prive/images/test.jpg -text ...@@ -574,9 +585,6 @@ prive/images/test.jpg -text
prive/images/test.png -text prive/images/test.png -text
prive/images/test_image.jpg -text prive/images/test_image.jpg -text
prive/images/tirets-separation.gif -text prive/images/tirets-separation.gif -text
prive/images/tourner-180.gif -text
prive/images/tourner-droite.gif -text
prive/images/tourner-gauche.gif -text
prive/images/tout-site-24.gif -text prive/images/tout-site-24.gif -text
prive/images/tout-site.png -text prive/images/tout-site.png -text
prive/images/traductions-24.gif -text prive/images/traductions-24.gif -text
...@@ -714,6 +722,7 @@ prive/themes/spip/images/aide-rtl-12.png -text ...@@ -714,6 +722,7 @@ prive/themes/spip/images/aide-rtl-12.png -text
prive/themes/spip/images/aide-rtl-16.png -text prive/themes/spip/images/aide-rtl-16.png -text
prive/themes/spip/images/ajouter-12.png -text prive/themes/spip/images/ajouter-12.png -text
prive/themes/spip/images/ajouter-16.png -text prive/themes/spip/images/ajouter-16.png -text
prive/themes/spip/images/article-12.png -text
prive/themes/spip/images/article-16.png -text prive/themes/spip/images/article-16.png -text
prive/themes/spip/images/article-24.png -text prive/themes/spip/images/article-24.png -text
prive/themes/spip/images/article-add-16.png -text prive/themes/spip/images/article-add-16.png -text
...@@ -791,6 +800,7 @@ prive/themes/spip/images/edit-16.png -text ...@@ -791,6 +800,7 @@ prive/themes/spip/images/edit-16.png -text
prive/themes/spip/images/edit-24.png -text prive/themes/spip/images/edit-24.png -text
prive/themes/spip/images/edition-48.png -text prive/themes/spip/images/edition-48.png -text
prive/themes/spip/images/erreur-24.png -text prive/themes/spip/images/erreur-24.png -text
prive/themes/spip/images/fleche-droite-16.png -text
prive/themes/spip/images/identite-16.png -text prive/themes/spip/images/identite-16.png -text
prive/themes/spip/images/identite-24.png -text prive/themes/spip/images/identite-24.png -text
prive/themes/spip/images/image-16.png -text prive/themes/spip/images/image-16.png -text
...@@ -884,6 +894,7 @@ prive/themes/spip/images/warning-48.png -text ...@@ -884,6 +894,7 @@ prive/themes/spip/images/warning-48.png -text
prive/themes/spip/images/xml-16.png -text prive/themes/spip/images/xml-16.png -text
prive/themes/spip/images/xml-24.png -text prive/themes/spip/images/xml-24.png -text
prive/themes/spip/style_prive_bling.html -text prive/themes/spip/style_prive_bling.html -text
prive/themes/spip/style_prive_picker.html -text
prive/themes/spip/style_prive_theme.html -text prive/themes/spip/style_prive_theme.html -text
prive/transmettre.html -text prive/transmettre.html -text
prive/transmettre/forum_article.html -text prive/transmettre/forum_article.html -text
......
...@@ -7,6 +7,7 @@ version: 0.2 ...@@ -7,6 +7,7 @@ version: 0.2
/* box */ /* box */
.box{margin:20px 0 0;} .box{margin:20px 0 0;}
.bd,.ft{padding:0 10px;overflow:hidden;_overflow:visible; _zoom:1;} .bd,.ft{padding:0 10px;overflow:hidden;_overflow:visible; _zoom:1;}
.bd {padding:10px;}
.hd {padding:5px 10px;} .hd {padding:5px 10px;}
.box .inner{position:relative;} .box .inner{position:relative;}
.box b{display:block;background-repeat:no-repeat;font-size:1%;position:relative;z-index:10;} .box b{display:block;background-repeat:no-repeat;font-size:1%;position:relative;z-index:10;}
......
table.jCalendar { background: #c0cad4; border-collapse: separate; border-spacing: 2px; }
table.jCalendar th { background: #c0cad4; color: #333; font-weight: bold; padding: 3px 5px; text-transform: uppercase; }
table.jCalendar td { background: #fff; color: #000; padding: 3px 5px; text-align: center; }
table.jCalendar td.other-month { color: #aaa; }
table.jCalendar td.today { background: #666; color: #fff; }
table.jCalendar td.selected { background: #f66; color: #fff; }
table.jCalendar td.selected:hover { background: #f33; color: #fff; }
table.jCalendar td:hover,
table.jCalendar td.dp-hover { background: #eee; color: #000; }
table.jCalendar td.disabled,
table.jCalendar td.disabled:hover { background: #e0e5ea; color: #888; }
/* For the popup */
/* NOTE - you will probably want to style a.dp-choose-date - see how I did it in demo.css */
div.dp-popup { position: relative; background: #e0e5ea; border: 1px solid #85909a; font-size: 10px; font-family: arial, sans-serif; padding: 2px; line-height: 1.2em; }
div#dp-popup { position: absolute; z-index: 99999; }
div.dp-popup h2 { font-size: 12px; text-align: center; margin: 2px 0; padding: 0; color: #555; }
a#dp-close { font-size: 11px; padding: 4px 0; text-align: center; display: block; }
a#dp-close:hover { text-decoration: underline; }
div.dp-popup a { color: #000; text-decoration: none; padding: 3px 2px 0; }
div.dp-popup div.dp-nav-prev { position: absolute; top: 2px; left: 4px; width: 100px; }
div.dp-popup div.dp-nav-prev a { float: left; }
/* Opera needs the rules to be this specific otherwise it doesn't change the cursor back to pointer after you have disabled and re-enabled a link */
div.dp-popup div.dp-nav-prev a,
div.dp-popup div.dp-nav-next a { cursor: pointer; }
div.dp-popup div.dp-nav-prev a.disabled,
div.dp-popup div.dp-nav-next a.disabled { cursor: default; }
div.dp-popup div.dp-nav-next { position: absolute; top: 2px; right: 4px; width: 100px; }
div.dp-popup div.dp-nav-next a { float: right; }
div.dp-popup a.disabled { cursor: default; color: #aaa; }
div.dp-popup td { cursor: pointer; }
div.dp-popup td.disabled { cursor: default; }
\ No newline at end of file
/*
* Date prototype extensions. Doesn't depend on any
* other code. Doens't overwrite existing methods.
*
* Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
* isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
* setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
*
* Copyright (c) 2006 J̦rn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
*
* Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
* I've added my name to these methods so you know who to blame if they are broken!
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
/**
* An Array of day names starting with Sunday.
*
* @example dayNames[0]
* @result 'Sunday'
*
* @name dayNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.dayNames = ['', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
/**
* An Array of abbreviated day names starting with Sun.
*
* @example abbrDayNames[0]
* @result 'Sun'
*
* @name abbrDayNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.abbrDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
/**
* An Array of month names starting with Janurary.
*
* @example monthNames[0]
* @result 'January'
*
* @name monthNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
/**
* An Array of abbreviated month names starting with Jan.
*
* @example abbrMonthNames[0]
* @result 'Jan'
*
* @name monthNames
* @type Array
* @cat Plugins/Methods/Date
*/
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
/**
* The first day of the week for this locale.
*
* @name firstDayOfWeek
* @type Number
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.firstDayOfWeek = 1;
/**
* The format that string dates should be represented as (e.g. 'dd/mm/yyyy' for UK, 'mm/dd/yyyy' for US, 'yyyy-mm-dd' for Unicode etc).
*
* @name format
* @type String
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.format = 'dd/mm/yyyy';
//Date.format = 'mm/dd/yyyy';
//Date.format = 'yyyy-mm-dd';
//Date.format = 'dd mmm yy';
/**
* The first two numbers in the century to be used when decoding a two digit year. Since a two digit year is ambiguous (and date.setYear
* only works with numbers < 99 and so doesn't allow you to set years after 2000) we need to use this to disambiguate the two digit year codes.
*
* @name format
* @type String
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.fullYearStart = '20';
(function() {
/**
* Adds a given method under the given name
* to the Date prototype if it doesn't
* currently exist.
*
* @private
*/
function add(name, method) {
if( !Date.prototype[name] ) {
Date.prototype[name] = method;
}
};
/**
* Checks if the year is a leap year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.isLeapYear();
* @result true
*
* @name isLeapYear
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isLeapYear", function() {
var y = this.getFullYear();
return (y%4==0 && y%100!=0) || y%400==0;
});
/**
* Checks if the day is a weekend day (Sat or Sun).
*
* @example var dtm = new Date("01/12/2008");
* dtm.isWeekend();
* @result false
*
* @name isWeekend
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isWeekend", function() {
return this.getDay()==0 || this.getDay()==6;
});
/**
* Check if the day is a day of the week (Mon-Fri)
*
* @example var dtm = new Date("01/12/2008");
* dtm.isWeekDay();
* @result false
*
* @name isWeekDay
* @type Boolean
* @cat Plugins/Methods/Date
*/
add("isWeekDay", function() {
return !this.isWeekend();
});
/**
* Gets the number of days in the month.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDaysInMonth();
* @result 31
*
* @name getDaysInMonth
* @type Number
* @cat Plugins/Methods/Date
*/
add("getDaysInMonth", function() {
return [31,(this.isLeapYear() ? 29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];
});
/**
* Gets the name of the day.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayName();
* @result 'Saturday'
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayName(true);
* @result 'Sat'
*
* @param abbreviated Boolean When set to true the name will be abbreviated.
* @name getDayName
* @type String
* @cat Plugins/Methods/Date
*/
add("getDayName", function(abbreviated) {
return abbreviated ? Date.abbrDayNames[this.getDay()] : Date.dayNames[this.getDay()];
});
/**
* Gets the name of the month.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getMonthName();
* @result 'Janurary'
*
* @example var dtm = new Date("01/12/2008");
* dtm.getMonthName(true);
* @result 'Jan'
*
* @param abbreviated Boolean When set to true the name will be abbreviated.
* @name getDayName
* @type String
* @cat Plugins/Methods/Date
*/
add("getMonthName", function(abbreviated) {
return abbreviated ? Date.abbrMonthNames[this.getMonth()] : Date.monthNames[this.getMonth()];
});
/**
* Get the number of the day of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getDayOfYear();
* @result 11
*
* @name getDayOfYear
* @type Number
* @cat Plugins/Methods/Date
*/
add("getDayOfYear", function() {
var tmpdtm = new Date("1/1/" + this.getFullYear());
return Math.floor((this.getTime() - tmpdtm.getTime()) / 86400000);
});
/**
* Get the number of the week of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.getWeekOfYear();
* @result 2
*
* @name getWeekOfYear
* @type Number
* @cat Plugins/Methods/Date
*/
add("getWeekOfYear", function() {
return Math.ceil(this.getDayOfYear() / 7);
});
/**
* Set the day of the year.
*
* @example var dtm = new Date("01/12/2008");
* dtm.setDayOfYear(1);
* dtm.toString();
* @result 'Tue Jan 01 2008 00:00:00'
*
* @name setDayOfYear
* @type Date
* @cat Plugins/Methods/Date
*/
add("setDayOfYear", function(day) {
this.setMonth(0);
this.setDate(day);
return this;
});
/**
* Add a number of years to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addYears(1);
* dtm.toString();
* @result 'Mon Jan 12 2009 00:00:00'
*
* @name addYears
* @type Date
* @cat Plugins/Methods/Date
*/
add("addYears", function(num) {
this.setFullYear(this.getFullYear() + num);
return this;
});
/**
* Add a number of months to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addMonths(1);
* dtm.toString();
* @result 'Tue Feb 12 2008 00:00:00'
*
* @name addMonths
* @type Date
* @cat Plugins/Methods/Date
*/
add("addMonths", function(num) {
var tmpdtm = this.getDate();
this.setMonth(this.getMonth() + num);
if (tmpdtm > this.getDate())
this.addDays(-this.getDate());
return this;
});
/**
* Add a number of days to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addDays(1);
* dtm.toString();
* @result 'Sun Jan 13 2008 00:00:00'
*
* @name addDays
* @type Date
* @cat Plugins/Methods/Date
*/
add("addDays", function(num) {
this.setDate(this.getDate() + num);
return this;
});
/**
* Add a number of hours to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addHours(24);
* dtm.toString();
* @result 'Sun Jan 13 2008 00:00:00'
*
* @name addHours
* @type Date
* @cat Plugins/Methods/Date
*/
add("addHours", function(num) {
this.setHours(this.getHours() + num);
return this;
});
/**
* Add a number of minutes to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addMinutes(60);
* dtm.toString();
* @result 'Sat Jan 12 2008 01:00:00'
*
* @name addMinutes
* @type Date
* @cat Plugins/Methods/Date
*/
add("addMinutes", function(num) {
this.setMinutes(this.getMinutes() + num);
return this;
});
/**
* Add a number of seconds to the date object.
*
* @example var dtm = new Date("01/12/2008");
* dtm.addSeconds(60);
* dtm.toString();
* @result 'Sat Jan 12 2008 00:01:00'
*
* @name addSeconds
* @type Date
* @cat Plugins/Methods/Date
*/
add("addSeconds", function(num) {
this.setSeconds(this.getSeconds() + num);
return this;
});
/**
* Sets the time component of this Date to zero for cleaner, easier comparison of dates where time is not relevant.
*
* @example var dtm = new Date();
* dtm.zeroTime();
* dtm.toString();
* @result 'Sat Jan 12 2008 00:01:00'
*
* @name zeroTime
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
add("zeroTime", function() {
this.setMilliseconds(0);
this.setSeconds(0);
this.setMinutes(0);
this.setHours(0);
return this;
});
/**
* Returns a string representation of the date object according to Date.format.
* (Date.toString may be used in other places so I purposefully didn't overwrite it)
*
* @example var dtm = new Date("01/12/2008");
* dtm.asString();
* @result '12/01/2008' // (where Date.format == 'dd/mm/yyyy'
*
* @name asString
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
add("asString", function() {
var r = Date.format;
return r
.split('yyyy').join(this.getFullYear())
.split('yy').join((this.getFullYear() + '').substring(2))
.split('mmm').join(this.getMonthName(true))
.split('mm').join(_zeroPad(this.getMonth()+1))
.split('dd').join(_zeroPad(this.getDate()));
});
/**
* Returns a new date object created from the passed String according to Date.format or false if the attempt to do this results in an invalid date object
* (We can't simple use Date.parse as it's not aware of locale and I chose not to overwrite it incase it's functionality is being relied on elsewhere)
*
* @example var dtm = Date.fromString("12/01/2008");
* dtm.toString();
* @result 'Sat Jan 12 2008 00:00:00' // (where Date.format == 'dd/mm/yyyy'
*
* @name fromString
* @type Date
* @cat Plugins/Methods/Date
* @author Kelvin Luck
*/
Date.fromString = function(s)
{
var f = Date.format;
var d = new Date('01/01/1977');
var iY = f.indexOf('yyyy');
if (iY > -1) {
d.setFullYear(Number(s.substr(iY, 4)));
} else {
// TODO - this doesn't work very well - are there any rules for what is meant by a two digit year?
d.setFullYear(Number(Date.fullYearStart + s.substr(f.indexOf('yy'), 2)));
}
var iM = f.indexOf('mmm');
if (iM > -1) {
var mStr = s.substr(iM, 3);
for (var i=0; i<Date.abbrMonthNames.length; i++) {
if (Date.abbrMonthNames[i] == mStr) break;
}
d.setMonth(i);
} else {
d.setMonth(Number(s.substr(f.indexOf('mm'), 2)) - 1);
}
d.setDate(Number(s.substr(f.indexOf('dd'), 2)));
if (isNaN(d.getTime())) {
return false;
}
return d;
};
// utility method
var _zeroPad = function(num) {
var s = '0'+num;
return s.substring(s.length-2)
//return ('0'+num).substring(-2); // doesn't work on IE :(
};
})();
\ No newline at end of file
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/dates.js}'></script>
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/jquery.datePicker.js}'></script>
<script type='text/javascript' src='#CHEMIN{formulaires/dateur/jquery.timePicker.js}'></script>
<script type='text/javascript'>/*<![CDATA[*/
Date.dayNames = ['<:date_jour_1:>', '<:date_jour_2:>', '<:date_jour_3:>', '<:date_jour_4:>', '<:date_jour_5:>', '<:date_jour_6:>', '<:date_jour_7:>'];
Date.abbrDayNames = ['<:date_jour_1_abbr:>', '<:date_jour_2_abbr:>', '<:date_jour_3_abbr:>', '<:date_jour_4_abbr:>', '<:date_jour_5_abbr:>', '<:date_jour_6_abbr:>', '<:date_jour_7_abbr:>'];
Date.monthNames = ['<:date_mois_1:>', '<:date_mois_2:>', '<:date_mois_3:>', '<:date_mois_4:>', '<:date_mois_5:>', '<:date_mois_6:>', '<:date_mois_7:>', '<:date_mois_8:>', '<:date_mois_9:>', '<:date_mois_10:>', '<:date_mois_11:>', '<:date_mois_12:>'];
Date.abbrMonthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
Date.firstDayOfWeek = 1;
Date.format = '#ENV{dateFormat,'dd/mm/yyyy'}';
jQuery.dpText = {
TEXT_PREV_YEAR : '<:spip_bonux:annee_precedente|texte_script:>',
TEXT_PREV_MONTH : '<:spip_bonux:mois_precedent|texte_script:>',
TEXT_NEXT_YEAR : '<:spip_bonux:annee_suivante|texte_script:>',
TEXT_NEXT_MONTH : '<:spip_bonux:mois_suivant|texte_script:>',
TEXT_CLOSE : '<:bouton_fermer|texte_script:>',
TEXT_CHOOSE_DATE : '<img src=\'#CHEMIN_IMAGE{calendrier-16.png}\' alt=\'<:spip_bonux:afficher_calendrier|attribut_html:>\' />',
TITLE_CHOOSE_DATE : '<:spip_bonux:afficher_calendrier|texte_script:>'
}
jQuery(function(){
jQuery('input.date').addClass('datePicker').datePicker({startDate:'#ENV{startDate,'01/01/1900'}'[,endDate:'(#ENV{endDate})']}).dpSetPosition(jQuery.dpConst.POS_TOP, jQuery.dpConst.POS_RIGHT);
jQuery("input.heure").addClass('timePicker').timePicker();
});
/*]]>*/</script>
<style type="text/css">
@import url(#CHEMIN{formulaires/dateur/datePicker.css});
@import url(#CHEMIN{formulaires/dateur/timePicker.css});
a.dp-choose-date { display: inline-block; padding: 0; margin: 0px 0 0 -19px; vertical-align: middle; }
div.time-picker {font-size:11px; width:5em; /* needed for IE */}
.formulaire_spip input.date {width:9em;padding-right:25px;}
.formulaire_spip input.heure {width:7em;}
</style>
\ No newline at end of file
Ce diff est replié.
/*
* Copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
/*
* A time picker for jQuery
* Based on original timePicker by Sam Collet (http://www.texotela.co.uk)
* @name timePicker
* @version 0.1
* @author Anders Fajerson (http://perifer.se)
* @example $("#mytime").timePicker();
* @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
*/
(function($){
$.fn.timePicker = function(options) {
// Build main options before element iteration
var settings = $.extend({}, $.fn.timePicker.defaults, options);
return this.each(function() {
$.timePicker(this, settings);
});
};
$.timePicker = function (elm, settings) {
var elm = $(elm)[0];
return elm.timePicker || (elm.timePicker = new jQuery._timePicker(elm, settings));
};
$._timePicker = function(elm, settings) {
var tpOver = false;
var startTime = normaliseTime(settings.startTime);
var endTime = normaliseTime(settings.endTime);
$(elm).attr('autocomplete', 'OFF'); // Disable browser autocomplete
var times = [];
var time = new Date(startTime); // Create a new date object.
while(time <= endTime) {
times[times.length] = formatTime(time, settings);
time = new Date(time.setMinutes(time.getMinutes() + settings.step));
}
var $tpDiv = $('<div class="time-picker'+ (settings.show24Hours ? '' : ' time-picker-12hours') +'"></div>');
var $tpList = $('<ul></ul>');
// Build the list.
for(var i = 0; i < times.length; i++) {
$tpList.append("<li>" + times[i] + "</li>");
}
$tpDiv.append($tpList);
// Store element offset.
var elmOffset = $(elm).offset();
// Append the timPicker to the body and position it.
$tpDiv.appendTo('body').css({'top':elmOffset.top, 'left':elmOffset.left}).hide();
$("li", $tpList).unbind().mouseover(function() {
$("li.selected", $tpDiv).removeClass("selected"); // TODO: only needs to run once.
$(this).addClass("selected");
}).mousedown(function() {
tpOver = true;
}).click(function() {
setTimeVal(elm, this, $tpDiv, settings);
tpOver = false;
});
// Store ananymous function in variable since it's used twice.
var showPicker = function() {
var elmOffset = $(elm).offset();
$tpDiv.css({'top':elmOffset.top, 'left':elmOffset.left}).show(); // Show picker.
$tpDiv.mouseover(function() { // Have to use mouseover instead of mousedown because of Opera
tpOver = true;
}).mouseout(function() {
tpOver = false;
});
$("li", $tpDiv).removeClass("selected");
// Try to find a time in the list that matches the entered time.
var time = this.value ? timeStringToDate(this.value, settings) : startTime;
var startMin = startTime.getHours() * 60 + startTime.getMinutes();
var min = (time.getHours() * 60 + time.getMinutes()) - startMin;
var steps = Math.round(min / settings.step);
var roundTime = normaliseTime(new Date(2001, 0, 0, 0, (steps * settings.step + (startMin)), 0));
roundTime = (startTime < roundTime && roundTime < endTime) ? roundTime : startTime;
var $matchedTime = $("li:contains(" + formatTime(roundTime, settings) + ")", $tpDiv);
if ($matchedTime.length) {
$matchedTime.addClass("selected");
// Scroll to matched time.
$tpDiv[0].scrollTop = $matchedTime[0].offsetTop;
}
};
$(elm).unbind().focus(showPicker).click(showPicker)
// Hide timepicker on blur
.blur(function() {
if (!tpOver && $tpDiv[0].parentNode) { // Don't remove when timePicker is clicked or when already removed
$tpDiv.hide();
}
})
// Key support
.keypress(function(e) {
switch (e.keyCode) {
case 38: // Up arrow.
case 63232: // Safari up arrow.
var $selected = $("li.selected", $tpList);
var prev = $selected.prev().addClass("selected")[0];
if (prev) {
$selected.removeClass("selected");
$tpDiv[0].scrollTop = prev.offsetTop;
}
return false;
break;
case 40: // Down arrow.
case 63233: // Safari down arrow.
var $selected = $("li.selected", $tpList);
var next = $selected.length ? $selected.next().addClass("selected")[0] : $("li:first").addClass("selected")[0];
if (next) {
$selected.removeClass("selected");
$tpDiv[0].scrollTop = next.offsetTop;
}
return false;
break;
case 13: // Enter
if (!$tpDiv.is(":hidden")) {
var sel = $("li.selected", $tpList)[0];
setTimeVal(elm, sel, $tpDiv, settings);
return false;
}
break;
}
});
// Helper function to get an inputs current time as Date object.
// Returns a Date object.
this.getTime = function() {
return timeStringToDate(elm.value, settings);
};
// Helper function to set a time input.
// Takes a Date object.
this.setTime = function(time) {
elm.value = formatTime(normaliseTime(time), settings);
// Trigger element's change events.
$(elm).change();
};
}; // End fn;
// Plugin defaults.
$.fn.timePicker.defaults = {
step:30,
startTime: new Date(0, 0, 0, 0, 0, 0),
endTime: new Date(0, 0, 0, 23, 30, 0),
separator: ':',
show24Hours: true
};
// Private functions.
function setTimeVal(elm, sel, $tpDiv, settings) {
// Update input field
elm.value = $(sel).text();
// Trigger element's change events.
$(elm).change();
// Keep focus for all but IE (which doesn't like it)
if (!$.browser.msie) {
elm.focus();
}
// Hide picker
$tpDiv.hide();
}
function formatTime(time, settings) {
var h = time.getHours();
var hours = settings.show24Hours ? h : (((h + 11) % 12) + 1);
var minutes = time.getMinutes();
return formatNumber(hours) + settings.separator + formatNumber(minutes) + (settings.show24Hours ? '' : ((h < 12) ? ' AM' : ' PM'));
}
function formatNumber(value) {
return (value < 10 ? '0' : '') + value;
}
function timeStringToDate(input, settings) {
if (input) {
var array = input.split(settings.separator);
var hours = parseFloat(array[0]);
var minutes = parseFloat(array[1]);
var time = new Date(0, 0, 0, hours, minutes, 0);
return normaliseTime(time);
}
return null;
}
/* Normalise time object to a common date. */
function normaliseTime(time) {
time.setFullYear(2001);
time.setMonth(0);
time.setDate(0);
return time;
}
})(jQuery);
div.time-picker {
position: absolute;
height: 200px;
width:4em; /* needed for IE */
overflow: auto;
background: #fff;
border: 1px solid #000;
z-index: 99998;
}
div.time-picker-12hours {
width:6em; /* needed for IE */
}
div.time-picker ul {
list-style-type: none;
margin: 0;
padding: 0;
}
div.time-picker li {
padding: 1px;
cursor: pointer;
}
div.time-picker li.selected {
background: #316AC5;
color: #fff;
}
\ No newline at end of file
<script type='text/javascript'>var img_unpick='#CHEMIN_IMAGE{supprimer-12.png}';</script>
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery.picker.js}'></script>
[(#REM)
afficher la selection dans un ul class item_picked
@param int select
1 => le selecteur se comporte comme un select, avec un seul choix possible
@param int rubriques
1 = permettre aussi la selection des rubriques
@param string name
nom de l'input envoye
@param string|array selected
liste de valeurs sour la forme array("rubrique|9","article|8",...) ou "rubrique|9,article|8,..."
@param int id_rubrique
@param int id_article
@param int afficher_langue
]<ul
class='item_picked[ (#ENV{select,''}|?{select})]'>
[(#ENV{rubriques,0}|oui)
<INCLURE{fond=formulaires/selecteur/inc-sel-rubriques}{name}{selected}{select}{img_unpick=#CHEMIN_IMAGE{supprimer-12.png}}{afficher_langue}>
]
<INCLURE{fond=formulaires/selecteur/inc-sel-articles}{name}{selected}{select}{img_unpick=#CHEMIN_IMAGE{supprimer-12.png}}{afficher_langue}>
</ul>
#SET{id_rubrique,#ENV{id_rubrique}}
<BOUCLE_art(ARTICLES){statut?}{tout}{id_article}>#SET{id_rubrique,#ID_RUBRIQUE}</BOUCLE_art>
[(#REM)
le container item_picker est ici pour etre voisin de item_picked
appel du selecteur en ajax
]
<div class='item_picker'>
<INCLURE{fond=formulaires/selecteur/picker-ajax}{id_rubrique=#GET{id_rubrique}}{id_article}{articles=1}{ajax}{env}>
</div>
<?php
include_spip('formulaires/selecteur/selecteur_fonctions');
\ No newline at end of file
#SET{p,pa_#ID_RUBRIQUE}<B_articles>
[<p class='pagination'>(#PAGINATION{prive})</p>]
<ul>
<BOUCLE_articles(ARTICLES){id_rubrique}{statut?}{pagination 100 #GET{p}}><li
class='article[ (#EXPOSE)]'>[(#ENV{picker_article,1}|oui)<a
href='#'
onclick="jQuery(this).item_pick('article|#ID_ARTICLE','#ENV{name,id_item}','[(#TITRE*|attribut_html|texte_script|replace{'&#039;',#VAL{'\\'}|concat{#EVAL{chr(39)}}})]','article');return false;"
><img
class='add'
src='#CHEMIN_IMAGE{ajouter-16.png}'
alt='ajouter'
width="16"
height="16"
/>][(#ENV{picker_article,1}|non)<a
href='[(#ID_ARTICLE|generer_url_entite{article})]'>]#TITRE</a></li>
</BOUCLE_articles>
</ul>
</B_articles>
#SET{p,pr_#ID_RUBRIQUE}<B_enfants>
[<p class='pagination'>(#PAGINATION)</p>]
<ul class='items'>
<BOUCLE_enfants(RUBRIQUES){id_parent=#ID_RUBRIQUE}{statut?}{pagination 100 #GET{p}}><li
class='rubrique'>[(#ENV{rubriques,0}|oui)<a
href='#' onclick="jQuery(this).item_pick('rubrique|#ID_RUBRIQUE','#ENV{name,id_item}','[(#TITRE*|extraire_multi|attribut_html|texte_script|replace{'&#039;',#VAL{'\\'}|concat{#EVAL{chr(39)}}})]','rubrique');return false;"
><img
class='add'
src='#CHEMIN_IMAGE{ajouter-16.png}'
alt='ajouter'
width="16"
height="16"
/></a>#TITRE]<a
class='ajax'
href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]'>[#TITRE(#ENV{rubriques,0}|non)]<img
class='ouvrir' src='#CHEMIN_IMAGE{fleche-droite-16.png}' alt='' /></a></li>
</BOUCLE_enfants>
</ul>
</B_enfants>
\ No newline at end of file
<BOUCLE_sel(ARTICLES){id_article IN #ENV{selected}|picker_selected{article}}{statut?}{tout}><li
class='article'><input
type="hidden"
name="[(#ENV{name,id_item})][]"
value="article|#ID_ARTICLE"
/>[(#ENV{afficher_langue,0}|oui)[&#91;(#LANG)&#93;] ]#TITRE[(#ENV{select,''}|non)
<a
href='#'
onclick='jQuery(this).item_unpick();return false;'><img
src='#ENV{img_unpick}' alt='' /></a>]<span
class="sep">, </span></li></BOUCLE_sel>
<BOUCLE_pour(POUR){tableau #ENV{selected}|picker_selected{rubrique}}>
<BOUCLE_sel(RUBRIQUES){id_rubrique=#VALEUR}{statut?}{tout}>
<li class='rubrique'><input type="hidden" name="[(#ENV{name,id_item})][]" value="rubrique|#ID_RUBRIQUE" />[(#ENV{afficher_langue,0}|oui)[&#91;(#LANG)&#93;] ]#TITRE[(#ENV{select,''}|non)
<a href='#' onclick='jQuery(this).item_unpick();return false;'><img src='#ENV{img_unpick}' alt='' /></a>]<span class="sep">, </span></li></BOUCLE_sel>[
(#VALEUR|=={0}|oui)
<li class='rubrique'><input type="hidden" name="[(#ENV{name,id_item})][(#VAL{91}|chr)][(#VAL{93}|chr)]" value="rubrique|[(#VALEUR)]" /><:info_racine_site:>[(#ENV{select,''}|non)
<a href='#' onclick='jQuery(this).item_unpick();return false;'><img src='[(#ENV{img_unpick})]' alt='' /></a>]<span class="sep">, </span></li>
]<//B_sel></BOUCLE_pour>
Ce diff est replié.
/**
item_picked et picker doivent seulement etre voisins
<ul class='item_picked'>..</ul>
...
...
<xx class='item_picker'>
<div class='picker_bouton'>..</div>
</xx>
...
**/
jQuery(document).ready(function(){
var picked = jQuery('ul.item_picked');
if (picked.length) {
picked.find('>li').removeClass('last').find('li:last').addClass('last');
}
});
jQuery.fn.picker_toggle = function(){
var browser = jQuery(this).parents('.item_picker').find('.browser');
if (browser.is(':visible')){
if (jQuery.browser.msie)
browser.hide();
else
browser.slideUp();
jQuery('a.close',this).hide();
jQuery('a.edit',this).show();
}
else {
browser.show();
jQuery('a.close',this).show();
jQuery('a.edit',this).hide();
}
}
// stop animation du bloc cible pour faire patienter
jQuery.fn.stopAnimeajax = function(end) {
this.children().css('opacity', 1.0);
this.find('.image_loading').html('');
return this; // don't break the chain
}
jQuery.fn.item_pick = function(id_item,name,title,type){
var picker = this.parents('.item_picker');
var picked = picker.siblings('ul.item_picked');
if (!picked.length) {
picker.before("<ul class='item_picked'></ul>");
picked = picker.siblings('ul.item_picked');
}
var select = picked.is('.select');
if (select)
picked.html('');
else
jQuery('li.on',picked).removeClass('on');
var sel=jQuery('input[value='+id_item+']',picked);
if (sel.length==0){
picked.addClass('changing').animeajax();
// simulons de la latence pour l'oeil de l'utilisateur
setTimeout(function(){
jQuery('li:last',picked).removeClass('last');
picked.append('<li class="last on '+type+'">'
+'<input type="hidden" name="'+name+'[]" value="'+id_item+'"/>'
+ title
+(select?"":" <a href='#' onclick='jQuery(this).item_unpick();return false;'>"
+"<img src='"+img_unpick+"' /></a>"
)
+'<span class="sep">, </span></li>').removeClass('changing').stopAnimeajax();
// masquer le selecteur apres un pick
picker.find('.picker_bouton').picker_toggle();
},300);
}
else
sel.parent().addClass('on');
return this; // don't break the chain
}
jQuery.fn.item_unpick = function(){
var picked = this.parents('ul.item_picked');
var me = this.parent();
jQuery(me).fadeOut('fast');
setTimeout(function(){
me.remove();
picked.find('>li').removeClass('last').find('li:last').addClass('last');
},400);
}
\ No newline at end of file
<BOUCLE_rub(RUBRIQUES){id_rubrique=#ENV{id_r,#ENV{id_rubrique}}}{statut?}>
<div class='chemin'>
<a href='[(#SELF|parametre_url{id_r,0})]' class='ajax'><:info_racine_site:></a>
<BOUCLE_chemin(HIERARCHIE){id_rubrique}> &gt; <a href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]' class='ajax'>#TITRE</a></BOUCLE_chemin> &gt; <strong class='on'>#TITRE</strong>
</div>#SET{n,0}
<B_contenu>
[(#REM) afficher la racine si la profondeur le permet]
[(#GRAND_TOTAL|<{#TOTAL_BOUCLE}|oui)
<div class='frame[ total_(#GRAND_TOTAL|max{#TOTAL_BOUCLE|moins{1}})] frame_0'><h2>[<a(#ENV{rubriques,0}|oui) href='#' onclick="jQuery(this).item_pick('rubrique|0','#ENV{name,id_item}','<:info_racine_site|texte_script|attribut_html:>','rubrique');return false;"
><img class='add' src='#CHEMIN{img_pack/item-add.png}' alt='' /></a>]<:info_racine_site:></h2>
[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique=0}{env})]</div>]
<BOUCLE_contenu(HIERARCHIE){id_rubrique}{tout}{n-4,4}>#SET{n,0}
<div class='frame[ total_(#GRAND_TOTAL|min{#TOTAL_BOUCLE|moins{1}})][ frame_(#COMPTEUR_BOUCLE|moins{#GRAND_TOTAL|plus{1}|max{#TOTAL_BOUCLE}}|plus{#TOTAL_BOUCLE})]'><a
href='[(#SELF|parametre_url{id_r,#_rub:ID_PARENT|?{#_rub:ID_PARENT,racine}})]' class='frame_close ajax'><img src='#CHEMIN{img_pack/frame-close.png}' alt='' /></a>
<h2><a class='ajax' href='[(#SELF|parametre_url{id_r,#ID_RUBRIQUE})]'>#TITRE</a></h2>
[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique}{env})]
[(#ENV{articles,0}|oui) [(#INCLURE{fond=formulaires/selecteur/inc-nav-articles}{id_rubrique}{id_article}{env})] ]
</div>
</BOUCLE_contenu>
</BOUCLE_rub>
<div class='chemin'><strong class='on'><:info_racine_site:></strong></div>
<div class='frame total_0 frame_0'><h2><:info_racine_site:></h2>[(#INCLURE{fond=formulaires/selecteur/inc-nav-rubriques}{id_rubrique=0}{env})]</div>
<//B_rub>
\ No newline at end of file
#SET{bouton_modif,#ENV{select,''}|?{bouton_modifier,bouton_ajouter}|_T}
[(#REM) Afficher un bouton ajax Modifier a la premiere fois ----------------------------------------
][(#ENV{picker,''}|non)
<div class='picker_bouton'>&#91;<a href='[(#SELF|parametre_url{picker,1})]' class='ajax'>#GET{bouton_modif}</a>&#93;</div>
]
[(#REM) Afficher un bouton Fermer/Modifier ensuite ----------------------------------------
][(#ENV{picker,''}|oui)
<div class='picker_bouton'>&#91;<a class='close'
href='[(#SELF|parametre_url{picker,0})]'
onclick="jQuery(this).parent().picker_toggle();return false;"
><:bouton_fermer:></a><a class='edit'
href='[(#SELF|parametre_url{picker,1})]'
onclick="jQuery(this).parent().picker_toggle();return false;"
style='display:none;'>#GET{bouton_modif}</a>&#93;</div>
[(#REM) et enfin le navigateur ------]
<div class='browser'>
<div class="choix choix_rapide">
<label for="picker_id"><:spip_bonux:id_rapide:></label>
<input type="text" value="" id="picker_id" size="10" />
<a href="#"
onclick="jQuery.ajax({'url':'[(#URL_PAGE{ajax_item_pick,rubriques=[(#ENV{rubriques})]&articles=[(#ENV{articles})]&ref=})]'+jQuery('#picker_id').attr('value'),
'success':function(r){
eval('r = '+r); // JSON envoye par ajax_item_pick.html
if (r){
jQuery('#picker_id').item_pick(r.id,'#ENV{name,id_item}',r.titre,r.type);
}
jQuery('#picker_id').attr('value','');
}
});return false;">#GET{bouton_modif}</a>
</div>
<INCLURE{fond=formulaires/selecteur/navigateur}{ajax}{env}>
</div>
]
\ No newline at end of file
.item_picker .chemin {border-bottom:1px sold #eee;margin:0.5em 0 0.25em;}
.item_picker .frame {border:1px solid #999;width:180px;height:400px;float:left;overflow:auto;}
.item_picker .frame h2 {margin:0;padding:5px;background:#999;}
.item_picker .frame ul {list-style:none;margin:0;padding:0;}
.item_picker .frame ul li {list-style:none;margin:0;padding:2px;padding-left:26px;}
.item_picker .frame ul li.rubrique {background:url(prive/images/rubrique-24.gif) no-repeat top left;}
.item_picker .frame ul li.article {background:url(prive/images/article-24.gif) no-repeat top left;}
.item_picker .frame ul li:hover {background-color:#999;}
.browser .choix_rapide {font-size:0.9em;}
.browser #picker_id {padding:0;margin:0 5px;border:1px solid;}
\ No newline at end of file
<script type='text/javascript'>var img_unpick='#CHEMIN{img_pack/item-remove.png}';</script>
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery.picker.js}'></script>
[(#REM) afficher la selection dans un ul class item_picked ----------------------------------------
select=1 => le selecteur se comporte comme un select, avec un seul choix possible
]<ul class='item_picked[ (#ENV{select,''}|?{select})]'>
<INCLURE{fond=formulaires/selecteur/inc-sel-rubriques}{name}{selected}{select}{img_unpick=#CHEMIN{img_pack/item-remove.png}}{afficher_langue}>
</ul>
#SET{id_rubrique,#ENV{id_rubrique}}
<BOUCLE_art(ARTICLES){statut?}{tout}{id_article}>#SET{id_rubrique,#ID_RUBRIQUE}</BOUCLE_art>
[(#REM) le container item_picker est ici pour etre voisin de item_picked ------]
<div class='item_picker'>
<INCLURE{fond=formulaires/selecteur/picker-ajax}{id_rubrique=#GET{id_rubrique}}{id_article}{rubriques=1}{articles=0}{ajax}{env}>
</div>
[(#ENV{sortable,'non'}|=={oui}|oui)
<script type='text/javascript' src='#CHEMIN{formulaires/selecteur/jquery-ui-1.6.custom.js}'></script>
<script type='text/javascript'>
jQuery(function() {
jQuery("ul.item_picked").sortable();
});
</script>
]
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter