diff --git a/file/js/jCounter.jQuery.coffee b/file/js/jCounter.jQuery.coffee deleted file mode 100644 index ccc9ce0..0000000 --- a/file/js/jCounter.jQuery.coffee +++ /dev/null @@ -1,50 +0,0 @@ -### -# jCounter - a simple character counter -# -# @author Maximilian Mader -# @copyright 2011 Maximilian Mader -# @license Creative Commons Attribution-NonCommercial-ShareAlike -# @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("""
""").parent().append """
#{max}
""" - 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) \ No newline at end of file diff --git a/file/style/jCounter.less b/file/style/jCounter.less deleted file mode 100644 index 542a886..0000000 --- a/file/style/jCounter.less +++ /dev/null @@ -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%)); - } -}