merged materiobasemod submodule
This commit is contained in:
368
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.js
Normal file
368
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.js
Normal file
File diff suppressed because one or more lines are too long
592
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.less
Normal file
592
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.less
Normal file
@@ -0,0 +1,592 @@
|
||||
/*
|
||||
* www.g-u-i.net
|
||||
*/
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== TYPOGRAHIE ======================================================================================================
|
||||
|
||||
.8(){font-size:8px;}
|
||||
.9(){font-size:9px;}
|
||||
.10(){font-size:10px;}
|
||||
.11(){font-size:10px;}
|
||||
.12(){font-size:12px;}
|
||||
.14(){font-size:14px;}
|
||||
.16(){font-size:16px;}
|
||||
.18(){font-size:18px;}
|
||||
.20(){font-size:20px;}
|
||||
.24(){font-size:24px;}
|
||||
.28(){font-size:24px;}
|
||||
.30(){font-size:30px;}
|
||||
.36(){font-size:36px;}
|
||||
.48(){font-size:48px;}
|
||||
.60(){font-size:60px;}
|
||||
.72(){font-size:72px;}
|
||||
|
||||
.regular(){font-weight:normal;}
|
||||
.bold(){font-weight:bold;}
|
||||
.100(){font-weight:100;}
|
||||
.200(){font-weight:200;}
|
||||
.300(){font-weight:300;}
|
||||
.400(){font-weight:400;}
|
||||
.500(){font-weight:500;}
|
||||
.600(){font-weight:600;}
|
||||
.700(){font-weight:700;}
|
||||
.800(){font-weight:800;}
|
||||
.900(){font-weight:900;}
|
||||
|
||||
.upper(){text-transform: uppercase;}
|
||||
.italic(){font-style:italic;}
|
||||
.normal(){font-style: normal;}
|
||||
|
||||
.hyphens(@value: auto)
|
||||
{
|
||||
-webkit-hyphens:@value;
|
||||
-moz-hyphens:@value;
|
||||
-ms-hyphens:@value;
|
||||
-o-hyphens:@value;
|
||||
hyphens:@value;
|
||||
}
|
||||
.font-size(@value: 1em,@lineheight:1.3em)
|
||||
{
|
||||
font-size:@value;
|
||||
line-height:@lineheight;
|
||||
}
|
||||
|
||||
@green:#17942A;
|
||||
@red:#E60000;
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== SHORTCUTS =======================================================================================================
|
||||
|
||||
// padding
|
||||
.p(@p){ padding:@arguments; }
|
||||
.p(@v, @h){ padding:@arguments; }
|
||||
.p(@t, @l, @b, @l){ padding:@arguments; }
|
||||
|
||||
.pt(@p){ padding-top:@p; }
|
||||
.pr(@p){ padding-right:@p; }
|
||||
.pb(@p){ padding-bottom:@p; }
|
||||
.pl(@p){ padding-left:@p; }
|
||||
|
||||
// margin
|
||||
.m(@p){ margin:@arguments; }
|
||||
.m(@v, @h){ margin:@arguments; }
|
||||
.m(@t, @l, @b, @l){ margin:@arguments; }
|
||||
|
||||
.mt(@m){ margin-top:@m; }
|
||||
.mr(@m){ margin-right:@m; }
|
||||
.mb(@m){ margin-bottom:@m; }
|
||||
.ml(@m){ margin-left:@m; }
|
||||
|
||||
.0(){ margin:0; padding:0; }
|
||||
|
||||
// border
|
||||
.b(@b){ border: @b; }
|
||||
.b(@size, @color){ border: @size solid @color; }
|
||||
|
||||
.bt(@b){ border-top: @b;}
|
||||
.bt(@size, @color){border-top: @size solid @color;}
|
||||
|
||||
.br(@b){ border-right: @b;}
|
||||
.br(@size, @color){border-right: @size solid @color;}
|
||||
|
||||
.bb(@b){ border-bottom: @b;}
|
||||
.bb(@size, @color){border-bottom: @size solid @color;}
|
||||
|
||||
.bl(@b){ border-left: @b;}
|
||||
.bl(@size, @color){border-left: @size solid @color;}
|
||||
|
||||
.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE)
|
||||
{
|
||||
border-top : solid 1px @top-color;
|
||||
border-right : solid 1px @right-color;
|
||||
border-bottom: solid 1px @bottom-color;
|
||||
border-left : solid 1px @left-color;
|
||||
}
|
||||
|
||||
// Background
|
||||
.bg(@color, @url, @repeat, @scrollfixed, @pos){background: @arguments;}
|
||||
.bgc(@color){background-color: @arguments;}
|
||||
.bkgd(@params){background: @arguments;}
|
||||
.bkgdc(@color){.bgc(@arguments);}
|
||||
|
||||
.bgca(@r, @g, @b, @a){
|
||||
background-color: rgb(@r, @g, @b); // ie8
|
||||
background-color: rgba(@r, @g, @b, @a);
|
||||
*background-color: rgb(@r, @g, @b); // ie7
|
||||
};
|
||||
|
||||
// Selection
|
||||
.selection(@bgcolor,@color)
|
||||
{
|
||||
&::selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
&::-moz-selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
&::-webkit-selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
}
|
||||
|
||||
// Colors
|
||||
.color(@value)
|
||||
{
|
||||
&,
|
||||
& *{color:@value;}
|
||||
}
|
||||
|
||||
// Opacity
|
||||
.opacity(@opacity: 0.5)
|
||||
{
|
||||
-webkit-opacity: @opacity;
|
||||
-khtml-opacity: @opacity;
|
||||
-moz-opacity: @opacity;
|
||||
opacity: @opacity;
|
||||
}
|
||||
|
||||
// size
|
||||
.size(@height, @width) {
|
||||
width: @width;
|
||||
height: @height;
|
||||
}
|
||||
.square(@size) {
|
||||
.size(@size, @size);
|
||||
}
|
||||
|
||||
// center
|
||||
.center-block() {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== DISPLAY UTILS ===================================================================================================
|
||||
|
||||
// Inline blocks
|
||||
.inlineblock(@align:top)
|
||||
{
|
||||
display:moz-inline-stack;
|
||||
display:inline-block;
|
||||
vertical-align:@align;
|
||||
zoom:1;
|
||||
*display:inline;
|
||||
.ie7 &, .ie8 &{display:block;float:left;}
|
||||
}
|
||||
|
||||
.db(){display:block;}
|
||||
.dbn(){display:none;}
|
||||
.dib(){.inlineblock;}
|
||||
.dib(@align){.inlineblock(@align);}
|
||||
|
||||
.float(@align:left){
|
||||
.db; float:@align;
|
||||
}
|
||||
|
||||
.abs(@value) { position:absolute; top:@value; left:@value; bottom:@value; right:@value; }
|
||||
.abs(@top, @left) { position:absolute; top:@top; left:@left; }
|
||||
.abs(@top, @right, @bottom, @left) { position:absolute; top:@top; left:@left; bottom:@bottom; right:@right; };
|
||||
|
||||
.fix(@value) { position:fixed; top:@value; left:@value; bottom:@value; right:@value; }
|
||||
.fix(@top, @left) { position:fixed; top:@top; left:@left; }
|
||||
.fix(@top, @right, @bottom, @left) { position:fixed; top:@top; left:@left; bottom:@bottom; right:@right; };
|
||||
|
||||
// Columns system
|
||||
@g:0;
|
||||
.g() { width:@g; }
|
||||
.col(@col,@coltotal:@n,@gutter:@g) {
|
||||
width: @col * ( 100% - ((@coltotal - 1) * @gutter) ) / @coltotal + ((@col - 1) * @gutter);
|
||||
}
|
||||
.inside-left(@col,@coltotal:@n,@gutter:@g) {
|
||||
padding-left: @col * ( 100% - ((@coltotal - 1) * @gutter) ) / @coltotal + (@col * @gutter);
|
||||
}
|
||||
.inside-right(@col,@coltotal:@n,@gutter:@g) {
|
||||
padding-right: @col * ( 100% - ((@coltotal - 1) * @gutter) ) / @coltotal + (@col * @gutter);
|
||||
}
|
||||
|
||||
|
||||
// Vertical alignement
|
||||
//
|
||||
// ___ .align-child()
|
||||
// |
|
||||
// | Permet l’alignement vertical d’un objet par rapport à son premier parent (dans son conteneur direct).
|
||||
// |
|
||||
// | 1 param : @vertical-align
|
||||
//
|
||||
.align-child(@align:middle){
|
||||
&:before { content: ""; .dib(middle); overflow: hidden; visibility: hidden; width: 0; height: 100%; }
|
||||
& > * { .dib(@align); }
|
||||
}
|
||||
|
||||
.clear-after(){
|
||||
&:after{clear:both;content:'';display:block;height:0px;overflow:hidden;visibility:hidden;width:0px;}
|
||||
}
|
||||
|
||||
// For clearing floats like a boss h5bp.com/q
|
||||
.clearix() {
|
||||
*zoom: 1;
|
||||
&:before,
|
||||
&:after {
|
||||
display: table;
|
||||
content: "";
|
||||
// Fixes Opera/contenteditable bug:
|
||||
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
|
||||
line-height: 0;
|
||||
}
|
||||
&:after {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== CSS3 ============================================================================================================
|
||||
|
||||
// Gradients
|
||||
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF)
|
||||
{
|
||||
background: @color;
|
||||
background: -webkit-gradient(linear,
|
||||
left bottom,
|
||||
left top,
|
||||
color-stop(0, @start),
|
||||
color-stop(1, @stop));
|
||||
background: -ms-linear-gradient(bottom,
|
||||
@start,
|
||||
@stop);
|
||||
background: -moz-linear-gradient(center bottom,
|
||||
@start 0%,
|
||||
@stop 100%);
|
||||
}
|
||||
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255)
|
||||
{
|
||||
background: @color;
|
||||
background: -webkit-gradient(linear,
|
||||
left bottom,
|
||||
left top,
|
||||
color-stop(0, rgb(@start,@start,@start)),
|
||||
color-stop(1, rgb(@stop,@stop,@stop)));
|
||||
background: -ms-linear-gradient(bottom,
|
||||
rgb(@start,@start,@start) 0%,
|
||||
rgb(@start,@start,@start) 100%);
|
||||
background: -moz-linear-gradient(center bottom,
|
||||
rgb(@start,@start,@start) 0%,
|
||||
rgb(@stop,@stop,@stop) 100%);
|
||||
}
|
||||
|
||||
// Shadows
|
||||
//
|
||||
// ___ .box-shadow()
|
||||
// |
|
||||
// | Ombré extérieur.
|
||||
// |
|
||||
// | 1 param : @blur
|
||||
// | 2+ params : @horizontal / @vertical / @blur / @color: #000 / @spread: 0px
|
||||
//
|
||||
// ___ .inset-shadow()
|
||||
// |
|
||||
// | Ombré intérieur.
|
||||
// |
|
||||
// | 1 param : @blur
|
||||
// | 2+ params : @horizontal / @vertical / @blur / @color: #000 / @spread: 0px
|
||||
//
|
||||
.box-shadow(@blur: 9px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000')";
|
||||
-webkit-box-shadow: 0 0 @blur #000;
|
||||
-moz-box-shadow: 0 0 @blur #000;
|
||||
-ms-box-shadow: 0 0 @blur #000;
|
||||
box-shadow: 0 0 @blur #000;
|
||||
}
|
||||
.box-shadow(@x, @y, @blur: 9px, @color: #000, @spread: 0px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=@x, OffY=@y, Color=~'@{color}');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=@{x}, OffY=@{y}, Color='@{color}')";
|
||||
-webkit-box-shadow: @x @y @blur @spread @color;
|
||||
-moz-box-shadow: @x @y @blur @spread @color;
|
||||
-ms-box-shadow: @x @y @blur @spread @color;
|
||||
box-shadow: @x @y @blur @spread @color;
|
||||
}
|
||||
.inset-shadow(@blur: 9px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000')";
|
||||
-webkit-box-shadow: 0 0 @blur #000 inset;
|
||||
-moz-box-shadow: 0 0 @blur #000 inset;
|
||||
-ms-box-shadow: 0 0 @blur #000 inset;
|
||||
box-shadow: 0 0 @blur #000 inset;
|
||||
}
|
||||
.inset-shadow(@x, @y, @blur: 9px, @color: #000, @spread: 0px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=@x, OffY=@y, Color=~'@{color}');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='@{color}')";
|
||||
-webkit-box-shadow: @x @y @blur @spread @color inset;
|
||||
-moz-box-shadow: @x @y @blur @spread @color inset;
|
||||
-ms-box-shadow: @x @y @blur @spread @color inset;
|
||||
box-shadow: @x @y @blur @spread @color inset;
|
||||
}
|
||||
|
||||
.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1)
|
||||
{
|
||||
-webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
||||
-moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
||||
box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
|
||||
}
|
||||
|
||||
// Border radius
|
||||
.rounded(@radius: 2px)
|
||||
{
|
||||
-webkit-border-radius: @radius;
|
||||
-moz-border-radius: @radius;
|
||||
border-radius: @radius;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.border-radius(@topleft: 0, @topright: 0, @bottomright: 0, @bottomleft: 0)
|
||||
{
|
||||
-webkit-border-radius:@arguments;
|
||||
-moz-border-radius:@arguments;
|
||||
border-radius:@arguments;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
// transitions
|
||||
.transition-simply-prefix(@string) {
|
||||
-webkit-transition: @string;
|
||||
-moz-transition: @string;
|
||||
-o-transition: @string;
|
||||
transition: @string;
|
||||
}
|
||||
|
||||
//
|
||||
// ___ .transition()
|
||||
// |
|
||||
// | 1 param : @property
|
||||
// | 2 params : @property / @duration
|
||||
// | 3+ params : @property / @duration / @transitiondelay:0s , @timingfunction:ease-out
|
||||
//
|
||||
// ___ .transitions()
|
||||
// |
|
||||
// | Permet de fixer des paramètres spécifique par propriétés, exemple:
|
||||
// |
|
||||
// | .transitions(
|
||||
// | 'height , padding , margin , box-shadow',
|
||||
// | '.5s , .2s , .2s , .2s',
|
||||
// | '0s , 0s , 0s , .3s',
|
||||
// | 'linear , ease-out , linear , ease-out'
|
||||
// | );
|
||||
//
|
||||
.transition(@property: all)
|
||||
{
|
||||
-webkit-transition: @property;
|
||||
-moz-transition: @property;
|
||||
-o-transition: @property;
|
||||
transition: @property;
|
||||
}
|
||||
.transition(@property, @duration)
|
||||
{
|
||||
-webkit-transition: @arguments;
|
||||
-moz-transition: @arguments;
|
||||
-o-transition: @arguments;
|
||||
transition: @arguments;
|
||||
}
|
||||
.transition(@property, @duration, @transitiondelay, @timingfunction:ease-out)
|
||||
{
|
||||
-webkit-transition: @arguments;
|
||||
-moz-transition: @arguments;
|
||||
-o-transition: @arguments;
|
||||
transition: @arguments;
|
||||
}
|
||||
.transitions(@property: all, @duration:0s, @transitiondelay:0s, @timingfunction:ease-out)
|
||||
{
|
||||
-webkit-transition-property :~'@{property}';
|
||||
-webkit-transition-duration :~'@{duration}';
|
||||
-webkit-transition-delay :~'@{transitiondelay}';
|
||||
-webkit-transition-timing-function:~'@{timingfunction}';
|
||||
-moz-transition-property :~'@{property}';
|
||||
-moz-transition-duration :~'@{duration}';
|
||||
-moz-transition-delay :~'@{transitiondelay}';
|
||||
-moz-transition-timing-function:~'@{timingfunction}';
|
||||
-o-transition-property :~'@{property}';
|
||||
-o-transition-duration :~'@{duration}';
|
||||
-o-transition-delay :~'@{transitiondelay}';
|
||||
-o-transition-timing-function:~'@{timingfunction}';
|
||||
transition-property :~'@{property}';
|
||||
transition-duration :~'@{duration}';
|
||||
transition-delay :~'@{transitiondelay}';
|
||||
transition-timing-function:~'@{timingfunction}';
|
||||
}
|
||||
|
||||
.transitions-duration(@duration: 0s)
|
||||
{
|
||||
-webkit-transition-duration: ~'@{duration}';
|
||||
-moz-transition-duration: ~'@{duration}';
|
||||
-o-transition-duration: ~'@{duration}';
|
||||
transition-duration: ~'@{duration}';
|
||||
}
|
||||
|
||||
.transition-duration(@duration: 0.2s)
|
||||
{
|
||||
-webkit-transition-duration: @duration;
|
||||
-moz-transition-duration: @duration;
|
||||
-o-transition-duration: @duration;
|
||||
transition-duration: @duration;
|
||||
}
|
||||
|
||||
.transitions-delay(@delay: 0s)
|
||||
{
|
||||
-webkit-transition-delay: ~'@{delay}';
|
||||
-moz-transition-delay: ~'@{delay}';
|
||||
-o-transition-delay: ~'@{delay}';
|
||||
transition-delay: ~'@{delay}';
|
||||
}
|
||||
|
||||
// Rotate
|
||||
//
|
||||
// ___ .rotation()
|
||||
// |
|
||||
// | 1 param : @degree
|
||||
//
|
||||
// ___ .rotate()
|
||||
// |
|
||||
// | Tentative de compatibilté étendue (fonctionne uniquement pour 0, 90, 180 ou 270 degrés).
|
||||
// |
|
||||
// | 1 param : @degree
|
||||
// | 3 params : @degree / @originX / @originY
|
||||
//
|
||||
.rotation(@deg:5deg)
|
||||
{
|
||||
-webkit-transform: rotate(@deg);
|
||||
-moz-transform: rotate(@deg);
|
||||
transform: rotate(@deg);
|
||||
}
|
||||
.rotate(@value, @originX:0%, @originY:0%, @unit:'deg')
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation = (360 / @value) + 1); //0, 1, 2, or 3 rotate 0, 90, 180 or 270
|
||||
-webkit-transform: rotate(~"@{value}@{unit}"); // ~"@{value}@{unit}" rather than @value@unit remove the spaces between value and unit.
|
||||
-moz-transform: rotate(~"@{value}@{unit}");
|
||||
-ms-transform: rotate(~"@{value}@{unit}");
|
||||
-o-transform: rotate(~"@{value}@{unit}");
|
||||
transform: rotate(~"@{value}@{unit}");
|
||||
-webkit-transform-origin:@originX @originY;
|
||||
-moz-transform-origin:@originX @originY;
|
||||
-ms-transform-origin:@originX @originY;
|
||||
-o-transform-origin:@originX @originY;
|
||||
transform-origin:@originX @originY;
|
||||
}
|
||||
|
||||
// Scale
|
||||
.scale(@ratio:1.5)
|
||||
{
|
||||
-webkit-transform:scale(@ratio);
|
||||
-moz-transform:scale(@ratio);
|
||||
transform:scale(@ratio);
|
||||
}
|
||||
|
||||
// Translate
|
||||
.translate(@x:0, @y:0)
|
||||
{
|
||||
-webkit-transform: translate(@x, @y);
|
||||
-moz-transform: translate(@x, @y);
|
||||
-ms-transform: translate(@x, @y);
|
||||
-o-transform: translate(@x, @y);
|
||||
transform: translate(@x, @y);
|
||||
}
|
||||
|
||||
// Columns
|
||||
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px)
|
||||
{
|
||||
-webkit-column-width : @colwidth;
|
||||
-webkit-column-count : @colcount;
|
||||
-webkit-column-gap : @colgap;
|
||||
-webkit-column-rule-color: @columnRuleColor;
|
||||
-webkit-column-rule-style: @columnRuleStyle;
|
||||
-webkit-column-rule-width: @columnRuleWidth;
|
||||
-moz-column-width : @colwidth;
|
||||
-moz-column-count : @colcount;
|
||||
-moz-column-gap : @colgap;
|
||||
-moz-column-rule-color: @columnRuleColor;
|
||||
-moz-column-rule-style: @columnRuleStyle;
|
||||
-moz-column-rule-width: @columnRuleWidth;
|
||||
column-width : @colwidth;
|
||||
column-count : @colcount;
|
||||
column-gap : @colgap;
|
||||
column-rule-color: @columnRuleColor;
|
||||
column-rule-style: @columnRuleStyle;
|
||||
column-rule-width: @columnRuleWidth;
|
||||
}
|
||||
|
||||
.edit-link(@bc:#CCFF2F,@c:#333)
|
||||
{
|
||||
.dib;
|
||||
background-color:@bc;
|
||||
border:1px solid;
|
||||
border-color:darken(desaturate(@bc, 35%),15%) darken(desaturate(@bc, 35%),15%) darken(desaturate(@bc, 35%),20%);
|
||||
.rounded;
|
||||
color: @c;
|
||||
cursor: pointer;
|
||||
.font-size(.8em,1em);
|
||||
font-weight: normal;
|
||||
padding: 0.25em 0.75em;
|
||||
margin-top:.5em;
|
||||
|
||||
&:hover{background-color:darken(@bc, 20%);}
|
||||
&:active{
|
||||
text-shadow: 0 1px 0 lighten(@bc,5%);
|
||||
background-color:darken(@bc, 20%);
|
||||
//.inset-shadow(0,0,2px,darken(@bc,60));
|
||||
}
|
||||
}
|
||||
|
||||
.loader(@fc:#000,@bc:#ccc,@h:8px,@radius:0px)
|
||||
{
|
||||
// Safari/chrome
|
||||
&::-webkit-progress-bar{background-color:@bc;.rounded(@radius);}
|
||||
&::-webkit-progress-value{background-color:@fc;.rounded(@radius);}
|
||||
// Firefox
|
||||
&{background-color:@bc;.rounded(@radius);height:@h;}
|
||||
&::-moz-progress-bar{background-color:@fc;.rounded(@radius);}
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== RETINA ==========================================================================================================
|
||||
|
||||
// retina.less
|
||||
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)
|
||||
.at2x(@path, @w: auto, @h: auto) {
|
||||
background-image: url(@path);
|
||||
@at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`;
|
||||
|
||||
@media all and (-webkit-min-device-pixel-ratio : 1.5) {
|
||||
background-image: url(@at2x_path);
|
||||
background-size: @w @h;
|
||||
}
|
||||
}
|
636
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.less.orig
Normal file
636
sites/all/modules/gui/materiobasemod/js/gui_ck_fw/gui.less.orig
Normal file
@@ -0,0 +1,636 @@
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* www.g-u-i.net
|
||||
*/
|
||||
|
||||
/** font */
|
||||
|
||||
.8{font-size:8px;}
|
||||
.9{font-size:9px;}
|
||||
.10{font-size:10px;}
|
||||
.11{font-size:10px;}
|
||||
.12{font-size:12px;}
|
||||
.14{font-size:14px;}
|
||||
.16{font-size:16px;}
|
||||
.18{font-size:18px;}
|
||||
.20{font-size:18px;}
|
||||
.24{font-size:24px;}
|
||||
.28{font-size:28px;}
|
||||
.30{font-size:30px;}
|
||||
.36{font-size:36px;}
|
||||
.48{font-size:48px;}
|
||||
.60{font-size:60px;}
|
||||
.72{font-size:72px;}
|
||||
|
||||
.regular{font-weight:normal;}
|
||||
.bold{font-weight:bold;}
|
||||
.100{font-weight:100;}
|
||||
.300{font-weight:300;}
|
||||
.500{font-weight:500;}
|
||||
.700{font-weight:700;}
|
||||
.900{font-weight:900;}
|
||||
|
||||
.upper{text-transform: uppercase;}
|
||||
.italic{font-style:italic;}
|
||||
.normal{font-style: normal;}
|
||||
|
||||
|
||||
/** shortcuts */
|
||||
=======
|
||||
/*
|
||||
* www.g-u-i.net
|
||||
*/
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== TYPOGRAHIE ======================================================================================================
|
||||
|
||||
.8(){font-size:8px;}
|
||||
.9(){font-size:9px;}
|
||||
.10(){font-size:10px;}
|
||||
.11(){font-size:10px;}
|
||||
.12(){font-size:12px;}
|
||||
.14(){font-size:14px;}
|
||||
.16(){font-size:16px;}
|
||||
.18(){font-size:18px;}
|
||||
.24(){font-size:24px;}
|
||||
.30(){font-size:30px;}
|
||||
.36(){font-size:36px;}
|
||||
.48(){font-size:48px;}
|
||||
.60(){font-size:60px;}
|
||||
.72(){font-size:72px;}
|
||||
|
||||
.regular(){font-weight:normal;}
|
||||
.bold(){font-weight:bold;}
|
||||
.100(){font-weight:100;}
|
||||
.300(){font-weight:300;}
|
||||
.500(){font-weight:500;}
|
||||
.700(){font-weight:700;}
|
||||
.900(){font-weight:900;}
|
||||
|
||||
.upper(){text-transform: uppercase;}
|
||||
.italic(){font-style:italic;}
|
||||
.normal(){font-style: normal;}
|
||||
|
||||
.hyphens(@value: auto)
|
||||
{
|
||||
-webkit-hyphens:@value;
|
||||
-moz-hyphens:@value;
|
||||
-ms-hyphens:@value;
|
||||
-o-hyphens:@value;
|
||||
hyphens:@value;
|
||||
}
|
||||
.font-size(@value: 1em,@lineheight:1.3em)
|
||||
{
|
||||
font-size:@value;
|
||||
line-height:@lineheight;
|
||||
}
|
||||
|
||||
@green:#17942A;
|
||||
@red:#E60000;
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== SHORTCUTS =======================================================================================================
|
||||
>>>>>>> bitbucket/master
|
||||
|
||||
// padding
|
||||
.p(@p){ padding:@arguments; }
|
||||
.p(@v, @h){ padding:@arguments; }
|
||||
.p(@t, @l, @b, @l){ padding:@arguments; }
|
||||
|
||||
.pt(@p){ padding-top:@p; }
|
||||
.pr(@p){ padding-right:@p; }
|
||||
.pb(@p){ padding-bottom:@p; }
|
||||
.pl(@p){ padding-left:@p; }
|
||||
|
||||
// margin
|
||||
.m(@p){ margin:@arguments; }
|
||||
.m(@v, @h){ margin:@arguments; }
|
||||
.m(@t, @l, @b, @l){ margin:@arguments; }
|
||||
|
||||
.mt(@m){ margin-top:@m; }
|
||||
.mr(@m){ margin-right:@m; }
|
||||
.mb(@m){ margin-bottom:@m; }
|
||||
.ml(@m){ margin-left:@m; }
|
||||
|
||||
.0(){ margin:0; padding:0; }
|
||||
|
||||
// border
|
||||
.b(@b){ border: @b; }
|
||||
.b(@size, @color){ border: @size solid @color; }
|
||||
|
||||
.bt(@b){ border-top: @b;}
|
||||
.bt(@size, @color){border-top: @size solid @color;}
|
||||
|
||||
.br(@b){ border-right: @b;}
|
||||
.br(@size, @color){border-right: @size solid @color;}
|
||||
|
||||
.bb(@b){ border-bottom: @b;}
|
||||
.bb(@size, @color){border-bottom: @size solid @color;}
|
||||
|
||||
.bl(@b){ border-left: @b;}
|
||||
.bl(@size, @color){border-left: @size solid @color;}
|
||||
|
||||
.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE)
|
||||
{
|
||||
border-top : solid 1px @top-color;
|
||||
border-right : solid 1px @right-color;
|
||||
border-bottom: solid 1px @bottom-color;
|
||||
border-left : solid 1px @left-color;
|
||||
}
|
||||
|
||||
// Background
|
||||
.bg(@color, @url, @repeat, @scrollfixed, @pos){background: @arguments;}
|
||||
.bgc(@color){background-color: @arguments;}
|
||||
.bkgd(@params){background: @arguments;}
|
||||
.bkgdc(@color){.bgc(@arguments);}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// opacity
|
||||
.opacity(@opacity: 0.5) {
|
||||
-moz-opacity: @opacity;
|
||||
-khtml-opacity: @opacity;
|
||||
-webkit-opacity: @opacity;
|
||||
opacity: @opacity;
|
||||
}
|
||||
|
||||
/** Inline blocks */
|
||||
.inlineblock(){
|
||||
display:moz-inline-stack;
|
||||
display:inline-block;
|
||||
vertical-align:top;
|
||||
zoom:1;
|
||||
*display:inline;
|
||||
/* margin-right:-.25em;*/
|
||||
.ie7 &{display:inline;}
|
||||
}
|
||||
|
||||
|
||||
// selection style
|
||||
.selection(@bgcolor,@color){
|
||||
=======
|
||||
// Selection
|
||||
.selection(@bgcolor,@color)
|
||||
{
|
||||
>>>>>>> bitbucket/master
|
||||
&::selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
&::-moz-selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
&::-webkit-selection {
|
||||
background:@bgcolor;
|
||||
color:@color;
|
||||
}
|
||||
}
|
||||
|
||||
// Colors
|
||||
.color(@value)
|
||||
{
|
||||
&,
|
||||
& *{color:@value;}
|
||||
}
|
||||
|
||||
// Opacity
|
||||
.opacity(@opacity: 0.5)
|
||||
{
|
||||
-webkit-opacity: @opacity;
|
||||
-khtml-opacity: @opacity;
|
||||
-moz-opacity: @opacity;
|
||||
opacity: @opacity;
|
||||
}
|
||||
|
||||
// size
|
||||
.size(@height, @width) {
|
||||
width: @width;
|
||||
height: @height;
|
||||
}
|
||||
.square(@size) {
|
||||
.size(@size, @size);
|
||||
}
|
||||
|
||||
// center
|
||||
.center-block() {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== DISPLAY UTILS ===================================================================================================
|
||||
|
||||
// Inline blocks
|
||||
.inlineblock(@align:top)
|
||||
{
|
||||
display:moz-inline-stack;
|
||||
display:inline-block;
|
||||
vertical-align:@align;
|
||||
zoom:1;
|
||||
*display:inline;
|
||||
.ie7 &, .ie8 &{display:block;float:left;}
|
||||
}
|
||||
|
||||
.db(){display:block;}
|
||||
.dib(){.inlineblock;}
|
||||
.dib(@align){.inlineblock(@align);}
|
||||
|
||||
// Vertical alignement
|
||||
//
|
||||
// ___ .align-child()
|
||||
// |
|
||||
// | Permet l’alignement vertical d’un objet par rapport à son premier parent (dans son conteneur direct).
|
||||
// |
|
||||
// | 1 param : @vertical-align
|
||||
//
|
||||
.align-child(@align:middle){
|
||||
&:before { content: ""; .dib(middle); overflow: hidden; visibility: hidden; width: 0; height: 100%; }
|
||||
& > * { .dib(@align); }
|
||||
}
|
||||
|
||||
.clear-after(){
|
||||
&:after{clear:both;content:'';display:block;height:0px;overflow:hidden;visibility:hidden;width:0px;}
|
||||
}
|
||||
|
||||
// For clearing floats like a boss h5bp.com/q
|
||||
.clearix() {
|
||||
*zoom: 1;
|
||||
&:before,
|
||||
&:after {
|
||||
display: table;
|
||||
content: "";
|
||||
// Fixes Opera/contenteditable bug:
|
||||
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
|
||||
line-height: 0;
|
||||
}
|
||||
&:after {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== CSS3 ============================================================================================================
|
||||
|
||||
// Gradients
|
||||
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF)
|
||||
{
|
||||
background: @color;
|
||||
background: -webkit-gradient(linear,
|
||||
left bottom,
|
||||
left top,
|
||||
color-stop(0, @start),
|
||||
color-stop(1, @stop));
|
||||
background: -ms-linear-gradient(bottom,
|
||||
@start,
|
||||
@stop);
|
||||
background: -moz-linear-gradient(center bottom,
|
||||
@start 0%,
|
||||
@stop 100%);
|
||||
}
|
||||
.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255)
|
||||
{
|
||||
background: @color;
|
||||
background: -webkit-gradient(linear,
|
||||
left bottom,
|
||||
left top,
|
||||
color-stop(0, rgb(@start,@start,@start)),
|
||||
color-stop(1, rgb(@stop,@stop,@stop)));
|
||||
background: -ms-linear-gradient(bottom,
|
||||
rgb(@start,@start,@start) 0%,
|
||||
rgb(@start,@start,@start) 100%);
|
||||
background: -moz-linear-gradient(center bottom,
|
||||
rgb(@start,@start,@start) 0%,
|
||||
rgb(@stop,@stop,@stop) 100%);
|
||||
}
|
||||
|
||||
// Shadows
|
||||
//
|
||||
// ___ .box-shadow()
|
||||
// |
|
||||
// | Ombré extérieur.
|
||||
// |
|
||||
// | 1 param : @blur
|
||||
// | 2+ params : @horizontal / @vertical / @blur / @color: #000 / @spread: 0px
|
||||
//
|
||||
// ___ .inset-shadow()
|
||||
// |
|
||||
// | Ombré intérieur.
|
||||
// |
|
||||
// | 1 param : @blur
|
||||
// | 2+ params : @horizontal / @vertical / @blur / @color: #000 / @spread: 0px
|
||||
//
|
||||
.box-shadow(@blur: 9px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000')";
|
||||
-webkit-box-shadow: 0 0 @blur #000;
|
||||
-moz-box-shadow: 0 0 @blur #000;
|
||||
-ms-box-shadow: 0 0 @blur #000;
|
||||
box-shadow: 0 0 @blur #000;
|
||||
}
|
||||
.box-shadow(@x, @y, @blur: 9px, @color: #000, @spread: 0px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=@x, OffY=@y, Color=~'@{color}');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=@{x}, OffY=@{y}, Color='@{color}')";
|
||||
-webkit-box-shadow: @x @y @blur @spread @color;
|
||||
-moz-box-shadow: @x @y @blur @spread @color;
|
||||
-ms-box-shadow: @x @y @blur @spread @color;
|
||||
box-shadow: @x @y @blur @spread @color;
|
||||
}
|
||||
.inset-shadow(@blur: 9px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='#000')";
|
||||
-webkit-box-shadow: 0 0 @blur #000 inset;
|
||||
-moz-box-shadow: 0 0 @blur #000 inset;
|
||||
-ms-box-shadow: 0 0 @blur #000 inset;
|
||||
box-shadow: 0 0 @blur #000 inset;
|
||||
}
|
||||
.inset-shadow(@x, @y, @blur: 9px, @color: #000, @spread: 0px)
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=@x, OffY=@y, Color=~'@{color}');
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=0, OffY=0, Color='@{color}')";
|
||||
-webkit-box-shadow: @x @y @blur @spread @color inset;
|
||||
-moz-box-shadow: @x @y @blur @spread @color inset;
|
||||
-ms-box-shadow: @x @y @blur @spread @color inset;
|
||||
box-shadow: @x @y @blur @spread @color inset;
|
||||
}
|
||||
|
||||
// Border radius
|
||||
.rounded(@radius: 2px)
|
||||
{
|
||||
-webkit-border-radius: @radius;
|
||||
-moz-border-radius: @radius;
|
||||
border-radius: @radius;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.border-radius(@topleft: 0, @topright: 0, @bottomright: 0, @bottomleft: 0)
|
||||
{
|
||||
-webkit-border-radius:@arguments;
|
||||
-moz-border-radius:@arguments;
|
||||
border-radius:@arguments;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// transitions
|
||||
.transition-simply-prefix(@string) {
|
||||
-webkit-transition: @string;
|
||||
-moz-transition: @string;
|
||||
-o-transition: @string;
|
||||
transition: @string;
|
||||
=======
|
||||
// Transition
|
||||
//
|
||||
// ___ .transition()
|
||||
// |
|
||||
// | 1 param : @property
|
||||
// | 2 params : @property / @duration
|
||||
// | 3+ params : @property / @duration / @transitiondelay:0s , @timingfunction:ease-out
|
||||
//
|
||||
// ___ .transitions()
|
||||
// |
|
||||
// | Permet de fixer des paramètres spécifique par propriétés, exemple:
|
||||
// |
|
||||
// | .transitions(
|
||||
// | 'height , padding , margin , box-shadow',
|
||||
// | '.5s , .2s , .2s , .2s',
|
||||
// | '0s , 0s , 0s , .3s',
|
||||
// | 'linear , ease-out , linear , ease-out'
|
||||
// | );
|
||||
//
|
||||
.transition(@property: all)
|
||||
{
|
||||
-webkit-transition: @property;
|
||||
-moz-transition: @property;
|
||||
-o-transition: @property;
|
||||
transition: @property;
|
||||
>>>>>>> bitbucket/master
|
||||
}
|
||||
.transition(@property, @duration)
|
||||
{
|
||||
-webkit-transition: @arguments;
|
||||
-moz-transition: @arguments;
|
||||
-o-transition: @arguments;
|
||||
transition: @arguments;
|
||||
}
|
||||
.transition(@property, @duration, @transitiondelay, @timingfunction:ease-out)
|
||||
{
|
||||
-webkit-transition: @arguments;
|
||||
-moz-transition: @arguments;
|
||||
-o-transition: @arguments;
|
||||
transition: @arguments;
|
||||
}
|
||||
.transitions(@property: all, @duration:0s, @transitiondelay:0s, @timingfunction:ease-out)
|
||||
{
|
||||
-webkit-transition-property :~'@{property}';
|
||||
-webkit-transition-duration :~'@{duration}';
|
||||
-webkit-transition-delay :~'@{transitiondelay}';
|
||||
-webkit-transition-timing-function:~'@{timingfunction}';
|
||||
-moz-transition-property :~'@{property}';
|
||||
-moz-transition-duration :~'@{duration}';
|
||||
-moz-transition-delay :~'@{transitiondelay}';
|
||||
-moz-transition-timing-function:~'@{timingfunction}';
|
||||
-o-transition-property :~'@{property}';
|
||||
-o-transition-duration :~'@{duration}';
|
||||
-o-transition-delay :~'@{transitiondelay}';
|
||||
-o-transition-timing-function:~'@{timingfunction}';
|
||||
transition-property :~'@{property}';
|
||||
transition-duration :~'@{duration}';
|
||||
transition-delay :~'@{transitiondelay}';
|
||||
transition-timing-function:~'@{timingfunction}';
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
.transition(@p, @d, @e, @de) {
|
||||
-webkit-transition: @arguments;
|
||||
-moz-transition: @arguments;
|
||||
-o-transition: @arguments;
|
||||
transition: @arguments;
|
||||
}
|
||||
.transition-delay(@delay: 0s) {
|
||||
-webkit-transition-delay: @delay;
|
||||
-moz-transition-delay: @delay;
|
||||
-o-transition-delay: @delay;
|
||||
transition-delay: @delay;
|
||||
}
|
||||
// rotation
|
||||
.rotation(@deg:5deg){
|
||||
=======
|
||||
|
||||
.transitions-duration(@duration: 0s)
|
||||
{
|
||||
-webkit-transition-duration: ~'@{duration}';
|
||||
-moz-transition-duration: ~'@{duration}';
|
||||
-o-transition-duration: ~'@{duration}';
|
||||
transition-duration: ~'@{duration}';
|
||||
}
|
||||
|
||||
.transition-duration(@duration: 0.2s)
|
||||
{
|
||||
-webkit-transition-duration: @duration;
|
||||
-moz-transition-duration: @duration;
|
||||
-o-transition-duration: @duration;
|
||||
transition-duration: @duration;
|
||||
}
|
||||
|
||||
// Rotate
|
||||
//
|
||||
// ___ .rotation()
|
||||
// |
|
||||
// | 1 param : @degree
|
||||
//
|
||||
// ___ .rotate()
|
||||
// |
|
||||
// | Tentative de compatibilté étendue (fonctionne uniquement pour 0, 90, 180 ou 270 degrés).
|
||||
// |
|
||||
// | 1 param : @degree
|
||||
// | 3 params : @degree / @originX / @originY
|
||||
//
|
||||
.rotation(@deg:5deg)
|
||||
{
|
||||
>>>>>>> bitbucket/master
|
||||
-webkit-transform: rotate(@deg);
|
||||
-moz-transform: rotate(@deg);
|
||||
transform: rotate(@deg);
|
||||
}
|
||||
.rotate(@value, @originX:0%, @originY:0%, @unit:'deg')
|
||||
{
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation = (360 / @value) + 1); //0, 1, 2, or 3 rotate 0, 90, 180 or 270
|
||||
-webkit-transform: rotate(~"@{value}@{unit}"); // ~"@{value}@{unit}" rather than @value@unit remove the spaces between value and unit.
|
||||
-moz-transform: rotate(~"@{value}@{unit}");
|
||||
-ms-transform: rotate(~"@{value}@{unit}");
|
||||
-o-transform: rotate(~"@{value}@{unit}");
|
||||
transform: rotate(~"@{value}@{unit}");
|
||||
-webkit-transform-origin:@originX @originY;
|
||||
-moz-transform-origin:@originX @originY;
|
||||
-ms-transform-origin:@originX @originY;
|
||||
-o-transform-origin:@originX @originY;
|
||||
transform-origin:@originX @originY;
|
||||
}
|
||||
|
||||
// Scale
|
||||
.scale(@ratio:1.5)
|
||||
{
|
||||
-webkit-transform:scale(@ratio);
|
||||
<<<<<<< HEAD
|
||||
-moz-transform:scale(@ratio);
|
||||
transform:scale(@ratio);
|
||||
}
|
||||
|
||||
// columns
|
||||
.columns(@colwidth: 250px) {
|
||||
-moz-column-width: @colwidth;
|
||||
-webkit-column-width: @colwidth;
|
||||
column-width: @colwidth;
|
||||
}
|
||||
|
||||
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
|
||||
-moz-column-width: @colwidth;
|
||||
-moz-column-count: @colcount;
|
||||
-moz-column-gap: @colgap;
|
||||
-moz-column-rule-color: @columnRuleColor;
|
||||
-moz-column-rule-style: @columnRuleStyle;
|
||||
-moz-column-rule-width: @columnRuleWidth;
|
||||
-webkit-column-width: @colwidth;
|
||||
-webkit-column-count: @colcount;
|
||||
-webkit-column-gap: @colgap;
|
||||
=======
|
||||
-moz-transform:scale(@ratio);
|
||||
transform:scale(@ratio);
|
||||
}
|
||||
|
||||
// Translate
|
||||
.translate(@x:0, @y:0)
|
||||
{
|
||||
-webkit-transform: translate(@x, @y);
|
||||
-moz-transform: translate(@x, @y);
|
||||
-ms-transform: translate(@x, @y);
|
||||
-o-transform: translate(@x, @y);
|
||||
transform: translate(@x, @y);
|
||||
}
|
||||
|
||||
// Columns
|
||||
.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px)
|
||||
{
|
||||
-webkit-column-width : @colwidth;
|
||||
-webkit-column-count : @colcount;
|
||||
-webkit-column-gap : @colgap;
|
||||
>>>>>>> bitbucket/master
|
||||
-webkit-column-rule-color: @columnRuleColor;
|
||||
-webkit-column-rule-style: @columnRuleStyle;
|
||||
-webkit-column-rule-width: @columnRuleWidth;
|
||||
-moz-column-width : @colwidth;
|
||||
-moz-column-count : @colcount;
|
||||
-moz-column-gap : @colgap;
|
||||
-moz-column-rule-color: @columnRuleColor;
|
||||
-moz-column-rule-style: @columnRuleStyle;
|
||||
-moz-column-rule-width: @columnRuleWidth;
|
||||
column-width : @colwidth;
|
||||
column-count : @colcount;
|
||||
column-gap : @colgap;
|
||||
column-rule-color: @columnRuleColor;
|
||||
column-rule-style: @columnRuleStyle;
|
||||
column-rule-width: @columnRuleWidth;
|
||||
}
|
||||
|
||||
.edit-link(@bc:#CCFF2F,@c:#333)
|
||||
{
|
||||
.dib;
|
||||
background-color:@bc;
|
||||
border:1px solid;
|
||||
border-color:darken(desaturate(@bc, 35%),15%) darken(desaturate(@bc, 35%),15%) darken(desaturate(@bc, 35%),20%);
|
||||
.rounded;
|
||||
color: @c;
|
||||
cursor: pointer;
|
||||
.font-size(.8em,1em);
|
||||
font-weight: normal;
|
||||
padding: 0.25em 0.75em;
|
||||
margin-top:.5em;
|
||||
|
||||
&:hover{background-color:darken(@bc, 20%);}
|
||||
&:active{
|
||||
text-shadow: 0 1px 0 lighten(@bc,5%);
|
||||
background-color:darken(@bc, 20%);
|
||||
//.inset-shadow(0,0,2px,darken(@bc,60));
|
||||
}
|
||||
}
|
||||
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// =
|
||||
// ===== RETINA ==========================================================================================================
|
||||
|
||||
// retina.less
|
||||
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)
|
||||
.at2x(@path, @w: auto, @h: auto) {
|
||||
background-image: url(@path);
|
||||
@at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`;
|
||||
|
||||
@media all and (-webkit-min-device-pixel-ratio : 1.5) {
|
||||
background-image: url(@at2x_path);
|
||||
background-size: @w @h;
|
||||
}
|
||||
}
|
713
sites/all/modules/gui/materiobasemod/js/materio_flag.js
Executable file
713
sites/all/modules/gui/materiobasemod/js/materio_flag.js
Executable file
@@ -0,0 +1,713 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
// @koala-prepend "gui.js"
|
||||
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioFlag = function(){
|
||||
var _isLoadingList = false ;
|
||||
|
||||
/**
|
||||
* init()
|
||||
*/
|
||||
function init(){
|
||||
//trace('MaterioFlag :: init MaterioFlag');
|
||||
|
||||
buildBlocks();
|
||||
|
||||
$(document)
|
||||
.bind('flagGlobalAfterLinkUpdate', onFlaging)
|
||||
.bind('resultscompleted resultschanged previewloaded', onResultsUpdated)
|
||||
.bind('init-scroller-pager', onInitScrollerPager)
|
||||
.bind('load-scroller-pager', onLoadScrollerPager)
|
||||
.bind('view-mode-changed', onViewModeChanged)
|
||||
.bind('history-state-change', onHistoryStateChange);
|
||||
|
||||
// ajaxifyLinks();
|
||||
|
||||
// trigger updated event for direct html loading
|
||||
if(isList()){
|
||||
setTimeout(function(){
|
||||
triggerContentChanged();
|
||||
}, 10);
|
||||
}
|
||||
};
|
||||
|
||||
function onFlaging(event){
|
||||
//trace('MaterioFlag :: onFlaging', event);
|
||||
refreshBlocks();
|
||||
};
|
||||
|
||||
function onResultsUpdated(event){
|
||||
//trace('MaterioFlag :: onResultsUpdated', event);
|
||||
ajaxifyLinks(event.container);
|
||||
};
|
||||
|
||||
function buildBlocks(activename){
|
||||
//trace('MaterioFlag :: buildBlocks | activename', activename);
|
||||
|
||||
if($('#block-materio-flag-materio-flag-mybookmarks').length){
|
||||
var type = 'bookmarks';
|
||||
var block = '#block-materio-flag-materio-flag-mybookmarks';
|
||||
}else if($('#block-materio-flag-materio-flag-mylists').length){
|
||||
var type = 'lists';
|
||||
var block = '#block-materio-flag-materio-flag-mylists';
|
||||
}
|
||||
|
||||
switch(type){
|
||||
case 'bookmarks':
|
||||
var name = type;
|
||||
$('h2 .listname', block).attr('name', name).bind('click', onClickShowPreview);
|
||||
$('<i class="icon-remove"></i>').appendTo($('h2', block)).attr('name', name).bind('click', onClickClosePreview);
|
||||
// $('<span class="preview"><i class="icon-eye-open"></i></span>').appendTo($('h2', block)).bind('click', onClickShowPreview);
|
||||
// if(!readCookie('materiobookmarkspreviewopened')){
|
||||
// showPreview('bookmarks', block);
|
||||
// }else{
|
||||
// }
|
||||
break;
|
||||
case 'lists':
|
||||
// nav block
|
||||
$('a.open-list:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav').each(function(index){
|
||||
//trace('nav block a.open-list this', this);
|
||||
$this = $(this)
|
||||
.bind('click', onClickOpenLink)
|
||||
.addClass('ajax-processed');
|
||||
|
||||
var name = $this.attr('class').match(/flag_lists_[^_]+_[0-9]+/);
|
||||
// trace('MaterioFlag :: name', name);
|
||||
$('<span class="preview"><i class="icon-eye-open"></i></span>').attr('name', name).insertAfter($this).bind('click', onClickShowPreview);
|
||||
});
|
||||
|
||||
$('a.edit-list:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav')
|
||||
.bind('click', onCLickEditList)
|
||||
.addClass('ajax-processed');
|
||||
|
||||
|
||||
$('a.flag-lists-create:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists-nav')
|
||||
.bind('click', onClickCreatLink)
|
||||
.addClass('ajax-processed');
|
||||
|
||||
|
||||
// preview block
|
||||
$('section.flag-list:not(.ajax-processed)', '#block-materio-flag-materio-flag-mylists').each(function(index){
|
||||
var name = $(this).attr('class').match(/flag_lists_[^_]+_[0-9]+/);
|
||||
$('<i class="icon-remove"></i>').appendTo($('h2.listname', this)).attr('name', name).bind('click', onClickClosePreview);
|
||||
|
||||
$('a.open-list', this).bind('click', onClickOpenLink);
|
||||
|
||||
}).addClass('ajax-processed');
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// trigger refresh block event for enabling lazyload images
|
||||
setTimeout(function(){
|
||||
$.event.trigger({
|
||||
type : 'my'+type+'-block-builded',
|
||||
block : block,
|
||||
name : name
|
||||
});
|
||||
},10);
|
||||
|
||||
// trace('MaterioFlag :: activename', activename);
|
||||
if(activename == undefined)
|
||||
activename = readCookie('materiomyflaglistsopened');
|
||||
|
||||
// trace('MaterioFlag :: activename', activename);
|
||||
if(activename)
|
||||
showPreview(activename, block);
|
||||
};
|
||||
|
||||
function refreshBlocks(name){
|
||||
//trace('MaterioFlag :: refreshBlocks | name', name);
|
||||
if($('#block-materio-flag-materio-flag-mybookmarks').length){
|
||||
var type = 'bookmarks';
|
||||
}else if($('#block-materio-flag-materio-flag-mylists').length){
|
||||
var type = 'lists';
|
||||
}
|
||||
|
||||
|
||||
if(type != undefined){
|
||||
var id = '#block-materio-flag-materio-flag-my'+type;
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/refresh/block/'+type;
|
||||
$.getJSON(url, function(json){
|
||||
// trace('MaterioFlag :: block refreshed '+type, json);
|
||||
|
||||
$(id).replaceWith(json.block);
|
||||
$('#block-materio-flag-materio-flag-mylists-nav').replaceWith(json.block_nav);
|
||||
|
||||
buildBlocks(name);
|
||||
|
||||
$.event.trigger({
|
||||
type : 'my'+type+'-block-updated',
|
||||
listname : name
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function ajaxifyLinks(container){
|
||||
//trace('MaterioFlag :: ajaxifyLinks', container);
|
||||
|
||||
container = ((container != null) ? container : 'body');
|
||||
|
||||
// trace('MaterioFlag :: typeof Drupal.flagLink', typeof Drupal.flagLink);
|
||||
if (typeof Drupal.flagLink != 'undefined')
|
||||
Drupal.flagLink(container);
|
||||
|
||||
if(isList()){
|
||||
var fid = $('.materio-flags-list', '#content').attr('fid');
|
||||
$('li.unflag-action.fid-'+fid+' a:not(.ajax-processed), li.flag-bookmarks a.unflag-action:not(.ajax-processed)')
|
||||
.bind('click', onUnflagList)
|
||||
.addClass('ajax-processed');
|
||||
}
|
||||
|
||||
|
||||
$('a.flag-lists-create:not(.ajax-processed)', container)
|
||||
.bind('click', onClickCreatLink)
|
||||
.addClass('ajax-processed');
|
||||
};
|
||||
|
||||
/**
|
||||
* show hide preview
|
||||
*/
|
||||
function onClickShowPreview(event){
|
||||
//trace('MaterioFlag :: onClickShowPreview', event);
|
||||
showPreview($(this).attr('name'), $(this).parent('.block').attr('id'));
|
||||
};
|
||||
|
||||
function showPreview(name, block){
|
||||
//trace('MaterioFlag :: showPreview', name);
|
||||
$('section.'+name, block).addClass('active')
|
||||
.siblings('section').removeClass('active');
|
||||
|
||||
createCookie('materiomyflaglistsopened', name, 1);
|
||||
|
||||
$.event.trigger('init-layout');
|
||||
};
|
||||
|
||||
function onClickClosePreview(event){
|
||||
//trace('MaterioFlag :: onClickClosePreview', event);
|
||||
eraseCookie('materiomyflaglistsopened');
|
||||
if($(this).attr('name') == 'bookmarks'){
|
||||
$(this).parents('.block').find('section.bookmarks').removeClass('active');
|
||||
}else{
|
||||
$(this).parents('section.flag-list').removeClass('active');
|
||||
}
|
||||
|
||||
$.event.trigger('init-layout');
|
||||
};
|
||||
|
||||
/**
|
||||
* onClickOpenLink
|
||||
*/
|
||||
function onClickOpenLink(event){
|
||||
event.preventDefault();
|
||||
var $link = $(event.currentTarget);
|
||||
var fid = $link.attr('href').match(/lists\/([0-9]+)$/);
|
||||
// trace('MaterioFlag :: type', type);
|
||||
loadList(fid[1]);
|
||||
return false;
|
||||
};
|
||||
|
||||
function loadList(fid){
|
||||
//trace('MaterioFlag :: loadList | fid', fid);
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/ajax/list/'+fid;
|
||||
|
||||
$.event.trigger('loading-content');
|
||||
|
||||
$.getJSON(url, {'current_path':document.location.href},function(json){
|
||||
//trace('MaterioFlag :: json', json);
|
||||
if(json.redirect){
|
||||
window.location = json.redirect;
|
||||
}else{
|
||||
changeContent(json);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function changeContent(json){
|
||||
if(json.rendered){
|
||||
|
||||
$('.inner-content','#content').html(json.rendered);
|
||||
|
||||
$.event.trigger('loaded-content');
|
||||
|
||||
// no need of ajaxifylinks because it's triggered with resultschanged
|
||||
// ajaxifyLinks('#content');
|
||||
|
||||
var path = Drupal.settings.basePath + Drupal.settings.pathPrefix + json.path;
|
||||
|
||||
$.event.trigger({
|
||||
type : 'new-history-page',
|
||||
path : path,
|
||||
title : json.title,
|
||||
content : json.rendered
|
||||
});
|
||||
|
||||
// TODO: change language links for folders
|
||||
// for (language in Drupal.settings.materio_search_api_ajax.languages) {
|
||||
// var l = Drupal.settings.materio_search_api_ajax.languages[language];
|
||||
// $('#block-locale-language li.'+language+' a').attr('href', Drupal.settings.basePath + l.prefix+'/' + json.search_path + '/' + json.keys)
|
||||
// };
|
||||
|
||||
triggerContentChanged();
|
||||
|
||||
}else{
|
||||
//trace('MaterioFlag :: no results');
|
||||
}
|
||||
};
|
||||
|
||||
function triggerContentChanged(){
|
||||
$.event.trigger({
|
||||
type: 'resultschanged',
|
||||
container : '#content .flaglist-items'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* onClickCreatLink(event)
|
||||
*/
|
||||
function onClickCreatLink(event){
|
||||
//trace('MaterioFlag :: onClickCreatLink | event', event);
|
||||
event.preventDefault();
|
||||
var $link = $(event.currentTarget);
|
||||
var type = $link.attr('href').match(/[^\/]*$/);
|
||||
// trace('MaterioFlag :: type', type);
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/createlist/form/'+type[0];
|
||||
|
||||
$.getJSON(url, function(json){
|
||||
//trace('MaterioFlag :: creat list : json', json);
|
||||
showCreateListForm(json, $link);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
function showCreateListForm(json, $link){
|
||||
//trace('MaterioFlag :: showCreateListForm | json', json);
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type:"record-stat",
|
||||
categorie:"flagLists",
|
||||
action: 'show create form'
|
||||
});
|
||||
|
||||
var $modal = $('<div id="modal" class="modal"/>').appendTo('body');
|
||||
$modal
|
||||
.css({
|
||||
position:'absolute',
|
||||
top:'40%', left:'50%',
|
||||
marginLeft:'-150px', width:'300px',
|
||||
zIndex:"99999"
|
||||
})
|
||||
.append(json.rendered_form)
|
||||
.find('input[type="submit"]', '#materio-flag-create-list-form').bind('click', function(event) {
|
||||
event.preventDefault();
|
||||
switch($(this).attr('name')){
|
||||
case 'cancel':
|
||||
//trace('MaterioFlag :: cancel',event);
|
||||
$(this).parents('#modal').remove();
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type:"record-stat",
|
||||
categorie:"flagLists",
|
||||
action: 'cancel create form'
|
||||
});
|
||||
|
||||
break;
|
||||
case 'create':
|
||||
//trace('MaterioFlag :: create',event);
|
||||
var title = $(this).parents('form').find('input[name*="flag-lists-name"]').val();
|
||||
var type = $(this).parents('form').find('input[name*="type"]').val();
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type : "record-stat",
|
||||
categorie : "flagLists",
|
||||
action : "submit create form",
|
||||
label : 'title : '+title
|
||||
});
|
||||
|
||||
createList($modal, type, title, $link);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.parents('form').find('input[type="text"]').focus();
|
||||
// TODO: esc keypressed close the form
|
||||
};
|
||||
|
||||
function createList($modal, type, title, $link){
|
||||
//trace('materioflag :: createList | title', title);
|
||||
$('.flag-lists-create').addClass('loading');
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'flag-lists/add/'+type+'/js';
|
||||
$.getJSON(url, {name:title}, function(data) {
|
||||
if (data.error) {
|
||||
//trace(data.error);
|
||||
}
|
||||
else {
|
||||
// select.append('<option value="'+data.flag.fid+'">'+data.flag.title+'</option>');
|
||||
// $('input.name', $(this)).val('');
|
||||
// dialog.dialog('close');
|
||||
//trace('MaterioFlag :: created list : data', data);
|
||||
if($link.attr('nid') && $link.attr('token')){
|
||||
flagEntityWithList(data.flag.name, $link.attr('nid'), $link.attr('token'));
|
||||
}else{
|
||||
refreshBlocks(data.flag.name);
|
||||
refreshNodeLinks();
|
||||
}
|
||||
|
||||
$modal.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function flagEntityWithList(name, nid, token){
|
||||
//trace('MaterioFlag :: flagEntityWithList | name', name);
|
||||
// var ret;
|
||||
// Send POST request
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: Drupal.settings.basePath+Drupal.settings.pathPrefix+'flag-lists/flag/'+name+'/'+nid,
|
||||
data: { js: true, token: token },
|
||||
dataType: 'json',
|
||||
success: function (data2) {
|
||||
//trace('MaterioFlag :: node taged with newly created list : data2', data2)
|
||||
if (data2.status) {
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type : "record-stat",
|
||||
categorie : 'FlagLists',
|
||||
action : 'node flaged',
|
||||
label : 'nid : '+nid+' | flag : '+name
|
||||
});
|
||||
|
||||
refreshBlocks(name);
|
||||
refreshNodeLinks();
|
||||
}else {
|
||||
// Failure.
|
||||
alert(data2.errorMessage);
|
||||
}
|
||||
},
|
||||
error: function (xmlhttp) {
|
||||
alert('An HTTP error '+ xmlhttp.status +' occurred.\n'+ element.href);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function refreshNodeLinks(){
|
||||
//trace('MaterioFlag :: refreshNodeLinks');
|
||||
var nids = new Array();
|
||||
$('.flag-lists-entity-links')
|
||||
// .addClass('loading')
|
||||
.parents('.node')
|
||||
.each(function(index) {
|
||||
nids.push($(this).attr('class').match(/node-([0-9]+)/)[1]);
|
||||
});
|
||||
// trace('MaterioFlag :: nids', nids);
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/nodelinks';
|
||||
$.getJSON(url, {nids:nids.join(";")}, function(data) {
|
||||
// trace('MaterioFlag :: data', data);
|
||||
for(nid in data.links){
|
||||
// trace('MaterioFlag :: nid', nid);
|
||||
// trace('MaterioFlag :: data.links[nid]', data.links[nid]);
|
||||
$('.node-'+nid+' .flag-lists-entity-links').replaceWith(data.links[nid]);
|
||||
|
||||
// trace('MaterioFlag :: typeof Drupal.flagLink', typeof Drupal.flagLink);
|
||||
// if (typeof Drupal.flagLink != 'undefined')
|
||||
// Drupal.flagLink($('.node-'+nid+' .flag-lists-entity-links'));
|
||||
|
||||
// TODO: sortir ajaxifyLinks de la boucle, je pense que ça prend trop de ressources
|
||||
ajaxifyLinks('.node-'+nid+' .flag-lists-entity-links');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$.event.trigger({
|
||||
type : 'materioflag-nodelinks-updated',
|
||||
nids : nids
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* onCLickEditList(event)
|
||||
*/
|
||||
function onCLickEditList(event){
|
||||
//trace('MaterioFlag :: onCLickEditList | event', event);
|
||||
// TODO: empécher le double formulaire
|
||||
event.preventDefault();
|
||||
var $link = $(event.currentTarget);
|
||||
var lid = $link.attr('href').match(/[^\/]*$/);
|
||||
var type = 'materiau'; // this is cheap
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/editlistform/'+type+'/'+lid[0];
|
||||
|
||||
$.getJSON(url, function(json){
|
||||
//trace('MaterioFlag :: editlist : json', json);
|
||||
showEditListForm(json, $link);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
|
||||
function showEditListForm(json, $link){
|
||||
//trace('MaterioFlag :: showEditListForm | json', json);
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type:"record-stat",
|
||||
categorie:"flagLists",
|
||||
action: 'show edit form'
|
||||
});
|
||||
|
||||
var $modal = $('<div id="modal" class="modal"/>').appendTo('body');
|
||||
$modal
|
||||
.css({
|
||||
position:'absolute',
|
||||
top:'40%', left:'50%',
|
||||
marginLeft:'-150px', width:'300px',
|
||||
zIndex:"99999"
|
||||
})
|
||||
.append(json.rendered_form)
|
||||
.find('input[type="submit"]', '#materio-flag-edit-list-form').bind('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $(this).parents('form');
|
||||
var title = $form.find('input[name*="flag-lists-title"]').val();
|
||||
var fid = $form.find('input[name*="fid"]').val();
|
||||
var name = $form.find('input[name*="name"]').val();
|
||||
|
||||
switch($(this).attr('name')){
|
||||
case 'cancel':
|
||||
//trace('MaterioFlag :: cancel',event);
|
||||
$(this).parents('#modal').remove();
|
||||
|
||||
// google analytics
|
||||
var action = 'cancel edit form';
|
||||
|
||||
break;
|
||||
case 'save':
|
||||
//trace('MaterioFlag :: create',event);
|
||||
|
||||
// google analytics
|
||||
var action = "submit edit form";
|
||||
|
||||
saveList($modal, fid, name, title);
|
||||
break;
|
||||
case 'delete':
|
||||
//trace('MaterioFlag :: delete',event);
|
||||
|
||||
if(confirm('Do you realy want to delete your '+title+' folder ?')){
|
||||
var action = "submit delete form";
|
||||
deleteList($modal, fid);
|
||||
}else{
|
||||
var action = "cancel delete form";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type:"record-stat",
|
||||
categorie:"flagLists",
|
||||
action: action
|
||||
});
|
||||
|
||||
return false;
|
||||
})
|
||||
.parents('form').find('input[type="text"]').focus();
|
||||
// TODO: esc keypressed close the form
|
||||
};
|
||||
|
||||
function saveList($modal, fid, name, title){
|
||||
//trace('MaterioFlag :: saveList | fid : '+fid+'| name', name);
|
||||
|
||||
$('.flag-lists-link.fid-'+fid).addClass('loading');
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/editlist/'+fid+'/'+name+'/'+title;
|
||||
$.getJSON(url, function(data) {
|
||||
if (data.error) {
|
||||
// trace(data.error);
|
||||
if(data.message)
|
||||
alert(data.message);
|
||||
}
|
||||
else {
|
||||
//trace('MaterioFlag :: saved list : data', data);
|
||||
|
||||
$.event.trigger({
|
||||
type : 'list-edited',
|
||||
name : data.listname,
|
||||
title : data.title,
|
||||
});
|
||||
|
||||
refreshBlocks();
|
||||
refreshNodeLinks();
|
||||
|
||||
$modal.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function deleteList($modal, fid){
|
||||
//trace('MaterioFlag :: deletelist | fid', fid);
|
||||
|
||||
$('.flag-lists-link.fid-'+fid).hide();
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/deletelist/'+fid;
|
||||
$.getJSON(url, function(data) {
|
||||
if (data.error) {
|
||||
// trace(data.error);
|
||||
if(data.message)
|
||||
alert(data.message);
|
||||
}
|
||||
else {
|
||||
//trace('MaterioFlag :: deleted list : data', data);
|
||||
|
||||
refreshBlocks();
|
||||
refreshNodeLinks();
|
||||
// TODO: if the deleted list was the current displayed list ??
|
||||
$modal.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* onUnflagList()
|
||||
*/
|
||||
function onUnflagList(event){
|
||||
//trace('onUnflagList', event);
|
||||
$(this).parents('article.node').addClass('removed');
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function onInitScrollerPager(event){
|
||||
// trace('MaterioFlag :: MaterioFlag :: onInitScrollerPager');
|
||||
if (isList()){
|
||||
// trace('MaterioFlag :: event.pager', event);
|
||||
event.pager.hide();
|
||||
}
|
||||
};
|
||||
|
||||
function onLoadScrollerPager(event){
|
||||
if (isList())
|
||||
loadNextListPage(event.href);
|
||||
};
|
||||
|
||||
function loadNextListPage(href){
|
||||
// trace('MaterioFlag :: loadNextListPage', href);
|
||||
if(!_isLoadingList){
|
||||
var fid = href.match(/lists\/([^\/|\?]+)/);
|
||||
var page = href.match(/\?page=([0-9]+)/);
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materioflag/ajax/list/'+fid[1]+'/'+page[1];
|
||||
// trace('MaterioFlag :: url', url);
|
||||
loadNextPage(url, $('.materio-flags-list', '#content'), '.flaglist-items');
|
||||
}
|
||||
};
|
||||
|
||||
function loadNextPage(url, $container, target){
|
||||
//trace('MaterioFlag :: loadNextPage');
|
||||
_isLoadingList = true;
|
||||
$container.addClass('loading');
|
||||
$.getJSON(url, function(json){
|
||||
//trace('json', json);
|
||||
_isLoadingList = false;
|
||||
$container.removeClass('loading');
|
||||
addNextpage(json, target);
|
||||
});
|
||||
};
|
||||
|
||||
function addNextpage(json, container_class){
|
||||
var $newcontent = $(json.rendered),
|
||||
$newitems = $(container_class, $newcontent).children('article').addClass('just-added'),
|
||||
$newpager = $('ul.pager', $newcontent);
|
||||
|
||||
$(container_class, '#content').append($newitems);
|
||||
$('ul.pager', '#content').replaceWith($newpager.hide());
|
||||
|
||||
// TODO: animation, this should be on theme side
|
||||
$(container_class, '#content').children('.just-added').each(function(i){
|
||||
// $(this).delay(5000*i).removeClass('just-added');
|
||||
var $this = $(this);
|
||||
setTimeout(function(){
|
||||
$this.removeClass('just-added');
|
||||
}, 150*i);
|
||||
});
|
||||
|
||||
$.event.trigger({
|
||||
type : 'resultscompleted',
|
||||
container : $(container_class, '#content')
|
||||
});
|
||||
};
|
||||
|
||||
function onViewModeChanged(event){
|
||||
if (isList())
|
||||
loadList(getFid());
|
||||
};
|
||||
|
||||
/**
|
||||
* history
|
||||
*/
|
||||
function onHistoryStateChange(event){
|
||||
if(isList())
|
||||
triggerContentChanged();
|
||||
};
|
||||
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
|
||||
function getFid(){
|
||||
return $('.materio-flags-list', '#content').attr('fid');;
|
||||
};
|
||||
|
||||
function isList(){
|
||||
return $('.materio-flags-list', '#content').length;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* cookies
|
||||
*/
|
||||
function createCookie(name,value,days) {
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||
var expires = "; expires="+date.toGMTString();
|
||||
}
|
||||
else var expires = "";
|
||||
document.cookie = name+"="+value+expires+"; path=/";
|
||||
}
|
||||
|
||||
function readCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function eraseCookie(name) {
|
||||
createCookie(name,"",-1);
|
||||
}
|
||||
|
||||
|
||||
init();
|
||||
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var materioflag = new MaterioFlag();
|
||||
});
|
||||
|
||||
})(jQuery);
|
1083
sites/all/modules/gui/materiobasemod/js/materio_flag.min.js
vendored
Executable file
1083
sites/all/modules/gui/materiobasemod/js/materio_flag.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
44
sites/all/modules/gui/materiobasemod/js/materio_page_title.js
Executable file
44
sites/all/modules/gui/materiobasemod/js/materio_page_title.js
Executable file
@@ -0,0 +1,44 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
// @koala-prepend "gui.js"
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioPageTitle = function(){
|
||||
|
||||
function init(){
|
||||
$(document)
|
||||
.bind('materio-page-title-refresh-block', onRefreshBlock)
|
||||
.bind('list-edited', onListEdited);
|
||||
|
||||
};
|
||||
|
||||
function onRefreshBlock(event){
|
||||
trace('MaterioPageTitle :: onRefreshBlock', event);
|
||||
// var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_page_title/refresh/block';
|
||||
// $.getJSON(url, function(json){
|
||||
// trace('page title json', json);
|
||||
// $('#block-materio-page-title-materio-page-title').replaceWith(json.block);
|
||||
// });
|
||||
if(typeof event.title !== 'undefined')
|
||||
$('#block-materio-page-title-materio-page-title h1').html(event.title);
|
||||
};
|
||||
|
||||
function onListEdited(event){
|
||||
trace('MaterioPageTitle :: onListEdited', event);
|
||||
|
||||
// this is for refreshing page title when list title was just edited AND this list is the cirreunt list
|
||||
if($("#materio-page-title ."+event.name).length)
|
||||
$('a.open-list.'+event.name).eq(0).trigger('click');
|
||||
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var materiopagetitle = new MaterioPageTitle();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
44
sites/all/modules/gui/materiobasemod/js/materio_page_title.min.js
vendored
Executable file
44
sites/all/modules/gui/materiobasemod/js/materio_page_title.min.js
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
// @koala-prepend "gui.js"
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioPageTitle = function(){
|
||||
|
||||
function init(){
|
||||
$(document)
|
||||
.bind('materio-page-title-refresh-block', onRefreshBlock)
|
||||
.bind('list-edited', onListEdited);
|
||||
|
||||
};
|
||||
|
||||
function onRefreshBlock(event){
|
||||
trace('MaterioPageTitle :: onRefreshBlock', event);
|
||||
// var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_page_title/refresh/block';
|
||||
// $.getJSON(url, function(json){
|
||||
// trace('page title json', json);
|
||||
// $('#block-materio-page-title-materio-page-title').replaceWith(json.block);
|
||||
// });
|
||||
if(typeof event.title !== 'undefined')
|
||||
$('#block-materio-page-title-materio-page-title h1').html(event.title);
|
||||
};
|
||||
|
||||
function onListEdited(event){
|
||||
trace('MaterioPageTitle :: onListEdited', event);
|
||||
|
||||
// this is for refreshing page title when list title was just edited AND this list is the cirreunt list
|
||||
if($("#materio-page-title ."+event.name).length)
|
||||
$('a.open-list.'+event.name).eq(0).trigger('click');
|
||||
|
||||
};
|
||||
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var materiopagetitle = new MaterioPageTitle();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
341
sites/all/modules/gui/materiobasemod/js/materio_search_api_ajax.js
Executable file
341
sites/all/modules/gui/materiobasemod/js/materio_search_api_ajax.js
Executable file
@@ -0,0 +1,341 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
// @koala-prepend "gui_ck_fw/gui.js"
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioSearchApiAjax = function(){
|
||||
var _isloadingresults = false;
|
||||
var _$content = $('#content');
|
||||
// TODO: define $content by module settings
|
||||
|
||||
/**
|
||||
* init()
|
||||
*/
|
||||
function init(){
|
||||
//trace('init MaterioSearchApiAjax');
|
||||
|
||||
initSearchAjax();
|
||||
initViewMode();
|
||||
};
|
||||
|
||||
/**
|
||||
* searchAjax
|
||||
*/
|
||||
function initSearchAjax(){
|
||||
// trace('initSearchAjax');
|
||||
|
||||
$('#materio-search-api-search-form').bind('submit', function(event) {
|
||||
// trace('search submited', event);
|
||||
// var $this = $(this);
|
||||
setTimeout(function(){
|
||||
loadResults(getSearchKeys());
|
||||
},10);
|
||||
return false;
|
||||
});
|
||||
|
||||
// /!\ AUTOCOMPLETE SELECT EVENT need a patch http://drupal.org/node/365241#comment-5374686
|
||||
$("#edit-searchfield")
|
||||
.bind('autocompleteSelect', function(event) {
|
||||
// $(this).parents('.form').trigger('submit');
|
||||
setTimeout(function(){
|
||||
loadResults(getSearchKeys(), "taxonomy");
|
||||
},10);
|
||||
})
|
||||
.bind('focus', function(event){
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
$(document)
|
||||
.bind('theme-ready', onThemeReady)
|
||||
.bind('init-scroller-pager', onInitScrollerPager)
|
||||
.bind('load-scroller-pager', onLoadScrollerPager)
|
||||
.bind('view-mode-changed', onViewModeChanged)
|
||||
.bind('history-state-change', onHistoryStateChange);
|
||||
};
|
||||
|
||||
function onThemeReady(event){
|
||||
// trace('MaterioSearchApiAjax :: onThemeReady');
|
||||
if( isActuality() || isExplore() ){
|
||||
$.event.trigger({
|
||||
type : 'resultschanged',
|
||||
container : isActuality() ? '#content .actuality-items' : '#content .search-results'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function getSearchKeys(){
|
||||
return $('#materio-search-api-search-form').find('input[name*="searchfield"]').val();
|
||||
};
|
||||
|
||||
function loadResults(keys, searchmode){
|
||||
//trace('keys', keys);
|
||||
if(keys !== undefined && keys !== '' && keys.length >= 2){
|
||||
keys = keys.replace('/', ' ');
|
||||
|
||||
// define mode (between full text or only term selected on autocompletion)
|
||||
searchmode = searchmode || "fulltext";
|
||||
|
||||
// record the "node type filter" form item
|
||||
var types = {}, stringTypes = [];
|
||||
$('#edit-bundles-filter', '#materio-search-api-search-form').find('input[type*="checkbox"]').each(function(i){
|
||||
$this = $(this);
|
||||
if ( $this.attr('checked') )
|
||||
stringTypes.push($this.val());
|
||||
types[$this.val()] = $this.attr('checked');
|
||||
});
|
||||
//trace('types', types);
|
||||
|
||||
|
||||
if(!_isloadingresults){
|
||||
$.event.trigger('loading-content');
|
||||
_isloadingresults = true;
|
||||
$('#materio-search-api-search-form').addClass('loading');
|
||||
// trace('window.location.href',window.location.href);
|
||||
// TODO: record ajax path in a variable from materio_search_api_ajax_init
|
||||
$.getJSON(Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_search_api_ajax/search/',
|
||||
{'types':types,'current_path':document.location.href, 'keys':keys, 'searchmode':searchmode},
|
||||
function(json){
|
||||
//trace('json', json);
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type : "record-stat",
|
||||
categorie : 'Search',
|
||||
action : keys,
|
||||
label : 'filters : '+ stringTypes.join(' ,'),
|
||||
value : json.count
|
||||
});
|
||||
|
||||
if(json.redirect){
|
||||
window.location = json.redirect;
|
||||
}else{
|
||||
$.event.trigger('loaded-content');
|
||||
_isloadingresults = false;
|
||||
$('#materio-search-api-search-form').removeClass('loading');
|
||||
changeContent(json);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function loadActuality(){
|
||||
if(!_isloadingresults){
|
||||
$.event.trigger('loading-content');
|
||||
_isloadingresults = true;
|
||||
$('#materio-search-api-search-form').addClass('loading');
|
||||
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_search_api_ajax/actuality';
|
||||
$.getJSON(url,
|
||||
function(json){
|
||||
//trace('json', json);
|
||||
$.event.trigger('loaded-content');
|
||||
_isloadingresults = false;
|
||||
$('#materio-search-api-search-form').removeClass('loading');
|
||||
changeContent(json);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function changeContent(json){
|
||||
//trace('MaterioSearchApiAjax changeContent | json', json);
|
||||
|
||||
if(json.returned){
|
||||
$.event.trigger('loaded-content');
|
||||
$('.inner-content',_$content).html(json.returned).find('ul.pager').hide();
|
||||
triggerContentChanged();
|
||||
}else{
|
||||
//trace('no results');
|
||||
}
|
||||
|
||||
$.event.trigger({
|
||||
type : 'new-history-page',
|
||||
path : Drupal.settings.basePath + Drupal.settings.pathPrefix + json.path,
|
||||
title : json.title,
|
||||
content : json.returned
|
||||
});
|
||||
|
||||
for (language in Drupal.settings.materio_search_api_ajax.languages) {
|
||||
var l = Drupal.settings.materio_search_api_ajax.languages[language];
|
||||
$('#block-locale-language li.'+language+' a').attr('href', Drupal.settings.basePath + l.prefix+'/' + json.search_path + '/' + json.keys)
|
||||
};
|
||||
};
|
||||
|
||||
function triggerContentChanged(){
|
||||
//trace('MaterioSearchApiAjax :: triggerContentChanged');
|
||||
$.event.trigger({
|
||||
type : 'resultschanged',
|
||||
container : '#content .search-results, #content .actuality-items'
|
||||
});
|
||||
};
|
||||
|
||||
function onInitScrollerPager(event){
|
||||
// trace("onInitScrollerPager");
|
||||
if(isActuality() || isExplore())
|
||||
event.pager.hide();
|
||||
};
|
||||
|
||||
function onLoadScrollerPager(event){
|
||||
// trace("onLoadScrollerPager");
|
||||
if(!_isloadingresults){
|
||||
if (isExplore())
|
||||
loadNextResultsPage(event.href);
|
||||
|
||||
if(isActuality())
|
||||
loadNextActualityPage(event.href);
|
||||
}
|
||||
};
|
||||
|
||||
function loadNextResultsPage(href){
|
||||
// trace('loadNextResultsPage');
|
||||
var keys = href.match(/explore\/([^\/|\?]+)/);
|
||||
var page = href.match(/\?page=([0-9]+)/);
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_search_api_ajax/search/'+page[1];
|
||||
|
||||
loadNextPage(url, keys[1], $('.materiobase-results', _$content), '.search-results');
|
||||
};
|
||||
|
||||
function loadNextActualityPage(href){
|
||||
// trace('loadNextActualityPage');
|
||||
var page = href.match(/\?page=([0-9]+)/);
|
||||
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_search_api_ajax/actuality/'+page[1];
|
||||
|
||||
loadNextPage(url, '', $('.materiobase-actuality', _$content), '.actuality-items');
|
||||
};
|
||||
|
||||
function loadNextPage(url, keys, $container, target){
|
||||
// trace('MaterioSearchApiAjax :: loadNextPage()');
|
||||
_isloadingresults = true;
|
||||
$container.addClass('loading');
|
||||
$.getJSON(url, {'keys':keys}, function(json){
|
||||
//trace('json', json);
|
||||
$container.removeClass('loading');
|
||||
addNextpage(json, target);
|
||||
// addNextpageItemByItem($(json.return), target);
|
||||
});
|
||||
};
|
||||
|
||||
function addNextpage(json, container_class){
|
||||
// trace('json',json);
|
||||
if(json){
|
||||
var $newcontent = $(json.returned),
|
||||
$newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
||||
$newpager = $('ul.pager', $newcontent);
|
||||
|
||||
$(container_class, _$content).append($newitems);
|
||||
$('ul.pager', _$content).replaceWith($newpager.hide());
|
||||
|
||||
// TODO: animation, this should be on theme side
|
||||
$(container_class, _$content).children('.just-added').each(function(i){
|
||||
var $this = $(this);
|
||||
setTimeout(function(){
|
||||
$this.removeClass('just-added');
|
||||
}, 150*i);
|
||||
});
|
||||
|
||||
$.event.trigger({
|
||||
type : 'resultscompleted',
|
||||
container : $(container_class, _$content)
|
||||
});
|
||||
}
|
||||
_isloadingresults = false;
|
||||
};
|
||||
|
||||
// TEST not used
|
||||
function addNextpageItemByItem($newcontent, container_class){
|
||||
//trace('MaterioSearchApiAjax :: addNextpageItemByItem()');
|
||||
$('ul.pager', _$content).remove();
|
||||
$(container_class, _$content).append($(container_class, $newcontent).children('article').eq(0));
|
||||
|
||||
if($(container_class, $newcontent).children('article').length){
|
||||
setTimeout(function(){
|
||||
addNextpageItemByItem($newcontent, container_class);
|
||||
}, 200);
|
||||
}else{
|
||||
_isloadingresults = false;
|
||||
$('ul.pager', _$content).replaceWith($('ul.pager', $newcontent).hide());
|
||||
$.event.trigger({
|
||||
type : 'resultscompleted',
|
||||
container : $(container_class, _$content)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* viewmode
|
||||
*/
|
||||
function initViewMode(){
|
||||
$('.viewmode-link').click(function(event){
|
||||
event.preventDefault();
|
||||
if(!$(this).is('.active')){
|
||||
$(this).trigger({type:'vm-clicked'});
|
||||
changeViewMode($(this).attr('rel'), $(this));
|
||||
}else{
|
||||
$(this).trigger({type:'vm-clicked-active'});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function changeViewMode(vm, $btn){
|
||||
if(!_isloadingresults){
|
||||
_isloadingresults = true;
|
||||
$.getJSON(Drupal.settings.basePath+'materio_search_api_ajax/viewmode/change/'+vm, function(json){
|
||||
//trace('viewmode json', json);
|
||||
_isloadingresults = false;
|
||||
if (json.statut == "saved"){
|
||||
|
||||
// google analytics
|
||||
$.event.trigger({
|
||||
type : "record-stat",
|
||||
categorie : 'Viewmode',
|
||||
action : vm,
|
||||
label : isActuality() ? 'Actualities' : 'Search results'
|
||||
});
|
||||
|
||||
$.event.trigger('view-mode-changed');
|
||||
$('.viewmode-link, .viewmode-link i').removeClass('active');
|
||||
$btn.addClass('active').find('i').addClass('active');
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function onViewModeChanged(event){
|
||||
if (isExplore())
|
||||
loadResults(getSearchKeys());
|
||||
|
||||
if(isActuality())
|
||||
loadActuality();
|
||||
};
|
||||
|
||||
/**
|
||||
* history
|
||||
*/
|
||||
function onHistoryStateChange(event){
|
||||
if(isExplore() || isActuality())
|
||||
triggerContentChanged();
|
||||
// TODO: pushstate trogger state change, so we have a retriggerring here on loading new results … how to avoid this
|
||||
};
|
||||
|
||||
/**
|
||||
* helpers
|
||||
*/
|
||||
function isExplore(){
|
||||
return $('.search-results', '#content').length;
|
||||
};
|
||||
|
||||
function isActuality(){
|
||||
return $('.actuality-items', '#content').length;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var materiosearchapiajax = new MaterioSearchApiAjax();
|
||||
});
|
||||
|
||||
})(jQuery);
|
1081
sites/all/modules/gui/materiobasemod/js/materio_search_api_ajax.min.js
vendored
Executable file
1081
sites/all/modules/gui/materiobasemod/js/materio_search_api_ajax.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
161
sites/all/modules/gui/materiobasemod/js/materio_user.js
Executable file
161
sites/all/modules/gui/materiobasemod/js/materio_user.js
Executable file
@@ -0,0 +1,161 @@
|
||||
// @codekit-prepend "gui.js"
|
||||
// @koala-prepend "gui_ck_fw/gui.js"
|
||||
|
||||
(function($) {
|
||||
|
||||
MaterioUser = function(){
|
||||
|
||||
var _isAdhesion = $('body').is('.page-node-11187') || $('body').is('.page-node-11186');
|
||||
|
||||
function init() {
|
||||
//trace('MaterioUser init compile test 3');
|
||||
if(_isAdhesion)
|
||||
initAdhesion();
|
||||
};
|
||||
|
||||
function initAdhesion(){
|
||||
// trace('initAdhesion');
|
||||
$('.get-link a').bind('click', function(event) {
|
||||
// trace('get-link click');
|
||||
|
||||
// do not show the registration form if already logged-in
|
||||
if($('body').is('.logged-in'))
|
||||
return true;
|
||||
|
||||
// else show the ajaxified registration form
|
||||
event.preventDefault();
|
||||
|
||||
var $this = $(this),
|
||||
href = $this.attr("href"),
|
||||
destination = href.match('/\?destination=([^,]+)');
|
||||
|
||||
destination = "/" + destination[1].replace('%23', '#');
|
||||
destination = destination.replace('//', '/');
|
||||
// trace('destination', destination);
|
||||
|
||||
if($this.parents('.gratos').size()){
|
||||
loadRegisterBlock(destination);
|
||||
}else{
|
||||
loadLoginAndRegisterBlock(destination);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function loadRegisterBlock (destination) {
|
||||
// trace("loadRegisterBlock :: dest = "+destination);
|
||||
$.getJSON(Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_user/registerblock', function(json){formLoaded(json, destination);});
|
||||
}
|
||||
|
||||
function loadLoginAndRegisterBlock(destination){
|
||||
// trace('loadRegistrationBlock :: dest = '+destination);
|
||||
$.getJSON(Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_user/loginandregisterblock', function(json){formLoaded(json, destination);});
|
||||
};
|
||||
|
||||
function formLoaded(json, destination){
|
||||
//trace('formLoaded | json', json);
|
||||
var $modal = $('<div>').addClass('modal-content').append(json.block);
|
||||
|
||||
var id,label, description;
|
||||
$('input.form-text', $modal).each(function(i) {
|
||||
id = $(this).attr('id');
|
||||
label = $('label[for='+id+']').hide().text();
|
||||
description = $(this).parent().find('.description').hide().text();
|
||||
$(this).attr('placeholder', label).attr('title', description);
|
||||
});
|
||||
|
||||
// $('.homepage-textfield', $modal).hide();
|
||||
|
||||
$('body').append($('<div>').addClass('modal-wrapper').append($modal));
|
||||
|
||||
$('.modal-wrapper').bind('click', function(event) {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
$('.modal-content').bind('click', function(event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// doesn't work
|
||||
// Drupal.attachBehaviors('bodi>.modal-wrapper');
|
||||
|
||||
$.event.trigger('ajax-register-block-loaded');
|
||||
|
||||
$("#user-register-form #edit-submit, #user-register-form #edit-submit--2", $modal).click(function(event){
|
||||
event.preventDefault();
|
||||
|
||||
// disable submit button to avoid duplicate user creation
|
||||
// console.log('click', this);
|
||||
$(this).attr('disabled', 'true');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType:'json',
|
||||
url: Drupal.settings.basePath+Drupal.settings.pathPrefix+"materio_user/register/submit",
|
||||
data: $('#user-register-form', $modal).serialize(),
|
||||
success: function(data) { onUserLoginRegisterSubmit($('#user-register-form'), data, destination);},
|
||||
error: function(jqXHR, textStatus, errorThrown) { trace('error : '+textStatus+' | '+errorThrown); }
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#user-login #edit-submit", $modal).click(function(event){
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType:'json',
|
||||
url: Drupal.settings.basePath+Drupal.settings.pathPrefix+"materio_user/login/submit",
|
||||
data: $('#user-login', $modal).serialize(),
|
||||
success: function(data){ onUserLoginRegisterSubmit($('#user-login'), data, destination); },
|
||||
error: function(jqXHR, textStatus, errorThrown) { trace('error : '+textStatus+' | '+errorThrown); }
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
// google analytics
|
||||
// $.event.trigger({
|
||||
// type : "record-stat",
|
||||
// categorie : 'Search',
|
||||
// action : keys,
|
||||
// label : 'filters : '+ stringTypes.join(' ,'),
|
||||
// value : json.count
|
||||
// });
|
||||
|
||||
|
||||
};
|
||||
|
||||
function onUserLoginRegisterSubmit($form, data, destination){
|
||||
// console.log('data', data);
|
||||
cleanModalErrors();
|
||||
if(data.errors != null){
|
||||
for(field in data.errors){
|
||||
$('input[name='+field+']', $form).addClass('error');
|
||||
$form.prepend($('<div>').addClass('message-error').html(data.errors[field]));
|
||||
}
|
||||
|
||||
(function($form){
|
||||
setTimeout(function(){
|
||||
console.log('enabled');
|
||||
$('input[type=submit]', $form).removeAttr('disabled');
|
||||
}, 0.5*1000);
|
||||
})($form);
|
||||
|
||||
}else{
|
||||
// trace('destination = '+destination);
|
||||
window.location.pathname = destination;
|
||||
}
|
||||
};
|
||||
|
||||
function cleanModalErrors() {
|
||||
$('.message-error', '.modal-content').remove();
|
||||
$('input', '.modal-content').removeClass('error');
|
||||
}
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var materiouser = new MaterioUser();
|
||||
});
|
||||
|
||||
})(jQuery);
|
531
sites/all/modules/gui/materiobasemod/js/materio_user.min.js
vendored
Executable file
531
sites/all/modules/gui/materiobasemod/js/materio_user.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user