[
  {
    "path": "README.md",
    "content": "# jQuery Corner Plugin\n\nCorner is a simple plugin for creating rounded (or other styled) corners on elements.\n\n## Links\n\n* [Home Page](http://jquery.malsup.com/corner/)\n* [Download](http://github.com/malsup/corner/raw/master/jquery.corner.js)\n\n\n## Examples\n\n\t// default 10px round corner\n\t$('#myDiv').corner();\n\t\n\t// 30px round corner\n\t$('#myDiv').corner('30px');\n\t\n\t// 15px bevel corner\n\t$('#myDiv').corner('15px bevel');\n\t\n\t// dogeared top right corner\n\t$('#myDiv').corner('dog tr');\n\t\n\t// sharp corners on bottom\n\t$('#myDiv').corner('sharp bottom');\n\n"
  },
  {
    "path": "jquery.corner.js",
    "content": "/*!\n * jQuery corner plugin: simple corner rounding\n * Examples and documentation at: http://jquery.malsup.com/corner/\n * version 2.13 (19-FEB-2013)\n * Requires jQuery v1.3.2 or later\n * Dual licensed under the MIT and GPL licenses:\n * http://www.opensource.org/licenses/mit-license.php\n * http://www.gnu.org/licenses/gpl.html\n * Authors: Dave Methvin and Mike Alsup\n */\n\n/**\n *  corner() takes a single string argument:  $('#myDiv').corner(\"effect corners width\")\n *\n *  effect:  name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). \n *  corners: one or more of: top, bottom, tr, tl, br, or bl.  (default is all corners)\n *  width:   width of the effect; in the case of rounded corners this is the radius. \n *           specify this value using the px suffix such as 10px (yes, it must be pixels).\n */\n;(function($) { \n\nvar msie = /MSIE/.test(navigator.userAgent);\n\nvar style = document.createElement('div').style,\n    moz = style['MozBorderRadius'] !== undefined,\n    webkit = style['WebkitBorderRadius'] !== undefined,\n    radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined,\n    mode = document.documentMode || 0,\n    noBottomFold = msie && (!mode || mode < 8),\n\n    expr = msie && (function() {\n        var div = document.createElement('div');\n        try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); }\n        catch(e) { return false; }\n        return true;\n    })();\n\n$.support = $.support || {};\n$.support.borderRadius = moz || webkit || radius; // so you can do:  if (!$.support.borderRadius) $('#myDiv').corner();\n\nfunction sz(el, p) { \n    return parseInt($.css(el,p),10)||0; \n}\nfunction hex2(s) {\n    s = parseInt(s,10).toString(16);\n    return ( s.length < 2 ) ? '0'+s : s;\n}\nfunction gpc(node) {\n    while(node) {\n        var v = $.css(node,'backgroundColor'), rgb;\n        if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') {\n            if (v.indexOf('rgb') >= 0) { \n                rgb = v.match(/\\d+/g); \n                return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]);\n            }\n            return v;\n        }\n        if (node.nodeName.toLowerCase() == 'html')\n            break;\n        node = node.parentNode; // keep walking if transparent\n    }\n    return '#ffffff';\n}\n\nfunction getWidth(fx, i, width) {\n    switch(fx) {\n    case 'round':  return Math.round(width*(1-Math.cos(Math.asin(i/width))));\n    case 'cool':   return Math.round(width*(1+Math.cos(Math.asin(i/width))));\n    case 'sharp':  return width-i;\n    case 'bite':   return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));\n    case 'slide':  return Math.round(width*(Math.atan2(i,width/i)));\n    case 'jut':    return Math.round(width*(Math.atan2(width,(width-i-1))));\n    case 'curl':   return Math.round(width*(Math.atan(i)));\n    case 'tear':   return Math.round(width*(Math.cos(i)));\n    case 'wicked': return Math.round(width*(Math.tan(i)));\n    case 'long':   return Math.round(width*(Math.sqrt(i)));\n    case 'sculpt': return Math.round(width*(Math.log((width-i-1),width)));\n    case 'dogfold':\n    case 'dog':    return (i&1) ? (i+1) : width;\n    case 'dog2':   return (i&2) ? (i+1) : width;\n    case 'dog3':   return (i&3) ? (i+1) : width;\n    case 'fray':   return (i%2)*width;\n    case 'notch':  return width; \n    case 'bevelfold':\n    case 'bevel':  return i+1;\n    case 'steep':  return i/2 + 1;\n    case 'invsteep':return (width-i)/2+1;\n    }\n}\n\n$.fn.corner = function(options) {\n    // in 1.3+ we can fix mistakes with the ready state\n    if (this.length === 0) {\n        if (!$.isReady && this.selector) {\n            var s = this.selector, c = this.context;\n            $(function() {\n                $(s,c).corner(options);\n            });\n        }\n        return this;\n    }\n\n    return this.each(function(index){\n        var $this = $(this),\n            // meta values override options\n            o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(),\n            keep = /keep/.test(o),                       // keep borders?\n            cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]),  // corner color\n            sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]),  // strip color\n            width = parseInt((o.match(/(\\d+)px/)||[])[1],10) || 10, // corner width\n            re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog|invsteep|steep/,\n            fx = ((o.match(re)||['round'])[0]),\n            fold = /dogfold|bevelfold/.test(o),\n            edges = { T:0, B:1 },\n            opts = {\n                TL:  /top|tl|left/.test(o),       TR:  /top|tr|right/.test(o),\n                BL:  /bottom|bl|left/.test(o),    BR:  /bottom|br|right/.test(o)\n            },\n            // vars used in func later\n            strip, pad, cssHeight, j, bot, d, ds, bw, i, w, e, c, common, $horz;\n        \n        if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR )\n            opts = { TL:1, TR:1, BL:1, BR:1 };\n            \n        // support native rounding\n        if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) {\n            if (opts.TL)\n                $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px');\n            if (opts.TR)\n                $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px');\n            if (opts.BL)\n                $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px');\n            if (opts.BR)\n                $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px');\n            return;\n        }\n            \n        strip = document.createElement('div');\n        $(strip).css({\n            overflow: 'hidden',\n            height: '1px',\n            minHeight: '1px',\n            fontSize: '1px',\n            backgroundColor: sc || 'transparent',\n            borderStyle: 'solid'\n        });\n    \n        pad = {\n            T: parseInt($.css(this,'paddingTop'),10)||0,     R: parseInt($.css(this,'paddingRight'),10)||0,\n            B: parseInt($.css(this,'paddingBottom'),10)||0,  L: parseInt($.css(this,'paddingLeft'),10)||0\n        };\n\n        if (typeof this.style.zoom !== undefined) this.style.zoom = 1; // force 'hasLayout' in IE\n        if (!keep) this.style.border = 'none';\n        strip.style.borderColor = cc || gpc(this.parentNode);\n        cssHeight = $(this).outerHeight();\n\n        for (j in edges) {\n            bot = edges[j];\n            // only add stips if needed\n            if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) {\n                strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');\n                d = document.createElement('div');\n                $(d).addClass('jquery-corner');\n                ds = d.style;\n\n                bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild);\n\n                if (bot && cssHeight != 'auto') {\n                    if ($.css(this,'position') == 'static')\n                        this.style.position = 'relative';\n                    ds.position = 'absolute';\n                    ds.bottom = ds.left = ds.padding = ds.margin = '0';\n                    if (expr)\n                        ds.setExpression('width', 'this.parentNode.offsetWidth');\n                    else\n                        ds.width = '100%';\n                }\n                else if (!bot && msie) {\n                    if ($.css(this,'position') == 'static')\n                        this.style.position = 'relative';\n                    ds.position = 'absolute';\n                    ds.top = ds.left = ds.right = ds.padding = ds.margin = '0';\n                    \n                    // fix ie6 problem when blocked element has a border width\n                    if (expr) {\n                        bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth');\n                        ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ \"px\"');\n                    }\n                    else\n                        ds.width = '100%';\n                }\n                else {\n                    ds.position = 'relative';\n                    ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : \n                                        (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';                \n                }\n\n                for (i=0; i < width; i++) {\n                    w = Math.max(0,getWidth(fx,i, width));\n                    e = strip.cloneNode(false);\n                    e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';\n                    bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild);\n                }\n                \n                if (fold && $.support.boxModel) {\n                    if (bot && noBottomFold) continue;\n                    for (c in opts) {\n                        if (!opts[c]) continue;\n                        if (bot && (c == 'TL' || c == 'TR')) continue;\n                        if (!bot && (c == 'BL' || c == 'BR')) continue;\n                        \n                        common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor };\n                        $horz = $('<div/>').css(common).css({ width: width + 'px', height: '1px' });\n                        switch(c) {\n                        case 'TL': $horz.css({ bottom: 0, left: 0 }); break;\n                        case 'TR': $horz.css({ bottom: 0, right: 0 }); break;\n                        case 'BL': $horz.css({ top: 0, left: 0 }); break;\n                        case 'BR': $horz.css({ top: 0, right: 0 }); break;\n                        }\n                        d.appendChild($horz[0]);\n                        \n                        var $vert = $('<div/>').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' });\n                        switch(c) {\n                        case 'TL': $vert.css({ left: width }); break;\n                        case 'TR': $vert.css({ right: width }); break;\n                        case 'BL': $vert.css({ left: width }); break;\n                        case 'BR': $vert.css({ right: width }); break;\n                        }\n                        d.appendChild($vert[0]);\n                    }\n                }\n            }\n        }\n    });\n};\n\n$.fn.uncorner = function() { \n    if (radius || moz || webkit)\n        this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0);\n    $('div.jquery-corner', this).remove();\n    return this;\n};\n\n// expose options\n$.fn.corner.defaults = {\n    useNative: true, // true if plugin should attempt to use native browser support for border radius rounding\n    metaAttr:  'data-corner' // name of meta attribute to use for options\n};\n    \n})(jQuery);\n"
  }
]