1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Remove jCounter files

This commit is contained in:
Tim Düsterhus 2013-02-07 22:23:50 +01:00
parent 1bb655d08c
commit e24ab52691
2 changed files with 0 additions and 127 deletions

View File

@ -1,50 +0,0 @@
###
# jCounter - a simple character counter
#
# @author Maximilian Mader
# @copyright 2011 Maximilian Mader
# @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
# @package jQuery.jCounter
###
(($) ->
$.fn.jCounter = (container, options) ->
options = $.extend
max: 0
counterClass: 'jCounter'
countUp: false
width: '100%'
, options
max = if @.attr('maxlength')? then @.attr 'maxlength' else options.max
if not container?
@.addClass 'jCounterInput'
@.wrap("""<div class="jCounterContainer" style="width: #{options.width}"><div></div></div>""").parent().append """<div class="#{options.counterClass} color-1">#{max}</div>"""
jCounterContainer = $(@).parent().children ".#{options.counterClass}"
else
jCounterContainer = if typeof container is 'object' then container else $ container
@.on 'keypress keyup', $.proxy () ->
length = if options.countUp then @.val().length else max - @.val().length
if options.countUp && max > 0
if length < max / 2
color = 1
else if max / 2 < length <= max / 1.2
color = 2
else
color = 3
else if options.countUp
color = 1
else
if max / 2 < length
color = 1
else if max / 6 <= length <= max / 2
color = 2
else
color = 3
jCounterContainer.text(length).removeClass().addClass "#{options.counterClass} color-#{color}"
, @
)(jQuery)

View File

@ -1,77 +0,0 @@
.jCounterContainer {
display: table;
> div {
display: table-row;
}
}
.jCounterInput {
height: 16px;
width: 100%;
position: relative;
z-index: 9999;
box-sizing: content-box !important;
.boxShadowInset(0, 1px, rgba(0, 0, 0, .1));
.transition(~"border .2s linear 0, box-shadow", .2s);
&:hover + .jCounter, &:focus + .jCounter {
border-color: @wcfInputHoverBorderColor;
}
&:focus + .jCounter {
.boxShadowNative(~"0 0 5px" fade(@wcfInputHoverBorderColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
}
.formError & + .jCounter {
border-color: @wcfErrorBackgroundColor;
.boxShadowNative(~"0 0 5px" fade(@wcfErrorBackgroundColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
}
.formSuccess & + .jCounter {
border-color: @wcfSuccessBackgroundColor;
.boxShadowNative(~"0 0 5px" fade(@wcfSuccessBackgroundColor, 50%) ~", inset 0 1px 5px rgba(0, 0, 0, .1)");
}
}
.jCounterInput, .jCounter {
display: table-cell;
}
.jCounter {
@backgroundColor: darken(@wcfInputBackgroundColor, 15%);
.textShadow(darken(@wcfInputBackgroundColor, 15%));
text-align: center;
vertical-align: middle;
background-color: @backgroundColor;
padding: 0 5px 0 10px;
position: relative;
z-index: 0 !important;
.borderRadius(0px, 5px, 5px, 0px);
border-color: darken(@wcfInputBorderColor, 20%) @wcfInputBorderColor lighten(@wcfInputBorderColor, 10%);
border-style: solid;
border-width: 1px;
width: 30px;
.adapt(@backgroundColor, @color) when (lightness(@backgroundColor) - lightness(@color) >= 40%) {
color: darken(@color, 8%);
content: "darken";
}
.adapt(@backgroundColor, @color) when (lightness(@backgroundColor) - lightness(@color) < 40%) {
color: lighten(@color, 8%);
content: "lighten";
}
&.color-1 {
.adapt(@backgroundColor, mix(@wcfInputColor, #666, 50%));
}
&.color-2 {
.adapt(@backgroundColor, mix(@wcfInputColor, #EECC22, 70%));
}
&.color-3 {
.adapt(@backgroundColor, mix(@wcfInputColor, #D40D12, 30%));
}
}