[
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2011, SteamDev\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "jquery-zclip\n============\n\njQuery ZeroClipboard\n\nCopyright 2011, SteamDev\n\nOriginally forked from: http://steamdev.com/zclip\n\nReleased under the MIT license, see [LICENSE](LICENSE).\n\n### Usage\n\n```javascript\njQuery({selector}).zclip({options});\n```\n\n- ```selector```: any valid jquery object selector\n- ```options```: Object, see section below.\n\n\n### Options\n\nOption        | Default value             | Description\n------------- | ------------------------- | ------------\npath          | ```'ZeroClipboard.swf'``` | The path to ZeroClipboard.swf\ncopy          | ```null```                | String to copy or function that returns a string to copy\nafterCopy     | ```null```                | Function to execute after copying\nbeforeCopy    | ```null```                | Function to execute before copying\nclickAfter    | ```true```                | Relay a click event to the element bound to after copying\nsetHandCursor | ```true```                | Set the cursor to pointer\nsetCSSEffects | ```true```                | Add ```hover``` and ```active``` classes to the element bound to \n\nNOTE: Since v1.1.5, default options can be set globally by setting the value of ```ZeroclipBoard.defaults.{option}```.\n"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"jquery-zclip\",\n  \"description\": \"JQuery wrapper library for ZeroClipboard. Provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie.\",\n  \"version\": \"1.1.5\",\n  \"main\": [\"./jquery.zclip.js\", \"./ZeroClipboard.swf\"],\n  \"keywords\": [\"flash\",\"clipboard\",\"copy\",\"cut\",\"paste\",\"zclip\",\"clip\",\"clippy\", \"zeroclipboard\", \"jquery\"],\n  \"license\": \"https://github.com/patricklodder/jquery-zclip/blob/master/LICENSE\",\n  \"authors\": [{\"name\":\"SteamDev\",\"url\":\"http://www.steamdev.com/zclip/\"},{\"name\":\"Patrick Lodder\",\"url\":\"https://github.com/patricklodder\"}],\n  \"homepage\": \"https://github.com/patricklodder/jquery-zclip\",\n  \"repository\": {\"type\":\"git\",\"url\":\"https://github.com/patricklodder/jquery-zclip.git\"},\n  \"location\": \"git://github.com/patricklodder/jquery-zclip.git\"\n}\n"
  },
  {
    "path": "jquery.zclip.js",
    "content": "/*\n * zClip :: jQuery ZeroClipboard v1.1.5\n * Originally forked from: http://steamdev.com/zclip\n *\n * Copyright 2011, SteamDev\n *\n * Released under the MIT license.\n * https://github.com/patricklodder/jquery-zclip/blob/master/LICENSE\n */\n\n(function (jQuery) {\n\n    jQuery.fn.zclip = function (params) {\n\n        if (typeof params == \"object\" && !params.length) {\n\n            var settings = jQuery.extend({}, ZeroClipboard.defaults, params);\n\n            return this.each(function () {\n\n                var o = jQuery(this);\n\n                if (o.is(':visible') && (typeof settings.copy == 'string' || jQuery.isFunction(settings.copy))) {\n\n                    ZeroClipboard.setMoviePath(settings.path);\n                    var clip = new ZeroClipboard.Client();\n\n                    if (jQuery.isFunction(settings.copy)) {\n                        o.bind('zClip_copy', settings.copy);\n                    }\n\n                    if (jQuery.isFunction(settings.beforeCopy)) {\n                        o.bind('zClip_beforeCopy', settings.beforeCopy);\n                    }\n\n                    if (jQuery.isFunction(settings.afterCopy)) {\n                        o.bind('zClip_afterCopy', settings.afterCopy);\n                    }\n\n                    clip.setHandCursor(settings.setHandCursor);\n\n                    clip.setCSSEffects(settings.setCSSEffects);\n\n                    clip.addEventListener('mouseOver', function (client) {\n                        o.trigger('mouseenter');\n                    });\n\n                    clip.addEventListener('mouseOut', function (client) {\n                        o.trigger('mouseleave');\n                    });\n\n                    clip.addEventListener('mouseDown', function (client) {\n\n                        o.trigger('mousedown');\n\n                        if (jQuery.isFunction(settings.beforeCopy)) {\n                            o.trigger('zClip_beforeCopy');\n                        }\n\n                        if (!jQuery.isFunction(settings.copy)) {\n                            clip.setText(settings.copy);\n                        } else {\n                            clip.setText(o.triggerHandler('zClip_copy'));\n                        }\n\n                    });\n\n                    clip.addEventListener('complete', function (client, text) {\n\n                        if (jQuery.isFunction(settings.afterCopy)) {\n\n                            o.trigger('zClip_afterCopy');\n\n                        } else {\n                            if (text.length > 500) {\n                                text = text.substr(0, 500) + \"...\\n\\n(\" + (text.length - 500) + \" characters not shown)\";\n                            }\n\n                            o.removeClass('hover');\n                            alert(\"Copied text to clipboard:\\n\\n \" + text);\n                        }\n\n                        if (settings.clickAfter) {\n                            o.trigger('click');\n                        }\n\n                    });\n\n                    clip.glue(o[0], o.parent()[0]);\n\n                    jQuery(window).bind('load resize', function () {clip.reposition();});\n\n                }\n\n            });\n\n        } else if (typeof params == \"string\") {\n\n            return this.each(function () {\n\n                var o = jQuery(this);\n\n                params = params.toLowerCase();\n                var zclipId = o.data('zclipId');\n                var clipElm = jQuery('#' + zclipId + '.zclip');\n                var clientId = clipElm.attr('id').replace(/^.*_/g, '') || null;\n\n                if (params == \"remove\") {\n\n                    clipElm.remove();\n                    o.removeClass('active hover');\n                    o.unbind('zClip_copy');\n                    o.unbind('zClip_beforeCopy');\n                    o.unbind('zClip_afterCopy');\n                    ZeroClipboard.unregister(clientId);\n\n                } else if (params == \"hide\") {\n\n                    clipElm.hide();\n                    o.removeClass('active hover');\n\n                } else if (params == \"show\") {\n\n                    clipElm.show();\n\n                }\n\n            });\n\n        }\n\n    };\n\n})(jQuery);\n\n// ZeroClipboard\n// Simple Set Clipboard System\n// Author: Joseph Huckaby\nvar ZeroClipboard = {\n\n    version: \"1.0.7\",\n    clients: {},\n    // registered upload clients on page, indexed by id\n    moviePath: 'ZeroClipboard.swf',\n    // URL to movie\n    nextId: 1,\n    // ID of next movie\n\n    defaults: {\n        path: 'ZeroClipboard.swf',\n        clickAfter: true,\n        setHandCursor: true,\n        setCSSEffects: true,\n\n        copy: null,\n        // a string or function that returns string\n\n        beforeCopy: null,\n        afterCopy: null\n    },\n\n    jQuery: function (thingy) {\n        // simple DOM lookup utility function\n        if (typeof(thingy) == 'string') thingy = document.getElementById(thingy);\n        if (!thingy.addClass) {\n            // extend element with a few useful methods\n            thingy.hide = function () {\n                this.style.display = 'none';\n            };\n            thingy.show = function () {\n                this.style.display = '';\n            };\n            thingy.addClass = function (name) {\n                this.removeClass(name);\n                this.className += ' ' + name;\n            };\n            thingy.removeClass = function (name) {\n                var classes = this.className.split(/\\s+/);\n                var idx = -1;\n                for (var k = 0; k < classes.length; k++) {\n                    if (classes[k] == name) {\n                        idx = k;\n                        k = classes.length;\n                    }\n                }\n                if (idx > -1) {\n                    classes.splice(idx, 1);\n                    this.className = classes.join(' ');\n                }\n                return this;\n            };\n            thingy.hasClass = function (name) {\n                return !!this.className.match(new RegExp(\"\\\\s*\" + name + \"\\\\s*\"));\n            };\n        }\n        return thingy;\n    },\n\n    setMoviePath: function (path) {\n        // set path to ZeroClipboard.swf\n        this.moviePath = path;\n    },\n\n    dispatch: function (id, eventName, args) {\n        // receive event from flash movie, send to client\n        var client = this.clients[id];\n        if (client) {\n            client.receiveEvent(eventName, args);\n        }\n    },\n\n    register: function (id, client) {\n        // register new client to receive events\n        this.clients[id] = client;\n    },\n\n    unregister: function (id) {\n        if (typeof(id) === 'number' && this.clients.hasOwnProperty(id)) {\n            delete this.clients[id];\n        }\n    },\n\n    getDOMObjectPosition: function (obj, stopObj) {\n        // get absolute coordinates for dom element\n        var info = {\n            left: 0,\n            top: 0,\n            width: obj.width ? obj.width : obj.offsetWidth,\n            height: obj.height ? obj.height : obj.offsetHeight\n        };\n\n        if (obj && (obj != stopObj)) {\n            info.left += obj.offsetLeft;\n            info.top += obj.offsetTop;\n        }\n\n        return info;\n    },\n\n    Client: function (elem) {\n        // constructor for new simple upload client\n        this.handlers = {};\n\n        // unique ID\n        this.id = ZeroClipboard.nextId++;\n        this.movieId = 'ZeroClipboardMovie_' + this.id;\n\n        // register client with singleton to receive flash events\n        ZeroClipboard.register(this.id, this);\n\n        // create movie\n        if (elem) this.glue(elem);\n    }\n};\n\nZeroClipboard.Client.prototype = {\n\n    id: 0,\n    // unique ID for us\n    ready: false,\n    // whether movie is ready to receive events or not\n    movie: null,\n    // reference to movie object\n    clipText: '',\n    // text to copy to clipboard\n    handCursorEnabled: true,\n    // whether to show hand cursor, or default pointer cursor\n    cssEffects: true,\n    // enable CSS mouse effects on dom container\n    handlers: null,\n    // user event handlers\n    glue: function (elem, appendElem, stylesToAdd) {\n        // glue to DOM element\n        // elem can be ID or actual DOM element object\n        this.domElement = ZeroClipboard.jQuery(elem);\n\n        // float just above object, or zIndex 99 if dom element isn't set\n        var zIndex = 99;\n        if (this.domElement.style.zIndex) {\n            zIndex = parseInt(this.domElement.style.zIndex, 10) + 1;\n        }\n\n        if (typeof(appendElem) == 'string') {\n            appendElem = ZeroClipboard.jQuery(appendElem);\n        } else if (typeof(appendElem) == 'undefined') {\n            appendElem = document.getElementsByTagName('body')[0];\n        }\n\n        // find X/Y position of domElement\n        var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem);\n\n        // create floating DIV above element\n        this.div = document.createElement('div');\n        this.div.className = \"zclip\";\n        this.div.id = \"zclip-\" + this.movieId;\n        jQuery(this.domElement).data('zclipId', 'zclip-' + this.movieId);\n        var style = this.div.style;\n        style.position = 'absolute';\n        style.left = '' + box.left + 'px';\n        style.top = '' + box.top + 'px';\n        style.width = '' + box.width + 'px';\n        style.height = '' + box.height + 'px';\n        style.zIndex = zIndex;\n\n        if (typeof(stylesToAdd) == 'object') {\n            for (var addedStyle in stylesToAdd) {\n                style[addedStyle] = stylesToAdd[addedStyle];\n            }\n        }\n\n        // style.backgroundColor = '#f00'; // debug\n        appendElem.appendChild(this.div);\n\n        this.div.innerHTML = this.getHTML(box.width, box.height);\n    },\n\n    getHTML: function (width, height) {\n        // return HTML for movie\n        var html = '';\n        var flashvars = 'id=' + this.id + '&width=' + width + '&height=' + height;\n\n        if (navigator.userAgent.match(/MSIE/)) {\n            // IE gets an OBJECT tag\n            var protocol = location.href.match(/^https/i) ? 'https://' : 'http://';\n            html += '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"' + protocol + 'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"' + width + '\" height=\"' + height + '\" id=\"' + this.movieId + '\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" value=\"' + ZeroClipboard.moviePath + '\" /><param name=\"loop\" value=\"false\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"best\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"flashvars\" value=\"' + flashvars + '\"/><param name=\"wmode\" value=\"transparent\"/></object>';\n        } else {\n            // all other browsers get an EMBED tag\n            html += '<embed id=\"' + this.movieId + '\" src=\"' + ZeroClipboard.moviePath + '\" loop=\"false\" menu=\"false\" quality=\"best\" bgcolor=\"#ffffff\" width=\"' + width + '\" height=\"' + height + '\" name=\"' + this.movieId + '\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" flashvars=\"' + flashvars + '\" wmode=\"transparent\" />';\n        }\n        return html;\n    },\n\n    hide: function () {\n        // temporarily hide floater offscreen\n        if (this.div) {\n            this.div.style.left = '-2000px';\n        }\n    },\n\n    show: function () {\n        // show ourselves after a call to hide()\n        this.reposition();\n    },\n\n    destroy: function () {\n        // destroy control and floater\n        if (this.domElement && this.div) {\n            this.hide();\n            this.div.innerHTML = '';\n\n            var body = document.getElementsByTagName('body')[0];\n            try {\n                body.removeChild(this.div);\n            } catch (e) {\n                //do nothing\n            }\n\n            this.domElement = null;\n            this.div = null;\n        }\n    },\n\n    reposition: function (elem) {\n        // reposition our floating div, optionally to new container\n        // warning: container CANNOT change size, only position\n        if (elem) {\n            this.domElement = ZeroClipboard.jQuery(elem);\n            if (!this.domElement) this.hide();\n        }\n\n        if (this.domElement && this.div) {\n            var box = ZeroClipboard.getDOMObjectPosition(this.domElement);\n            var style = this.div.style;\n            style.left = '' + box.left + 'px';\n            style.top = '' + box.top + 'px';\n        }\n    },\n\n    setText: function (newText) {\n        // set text to be copied to clipboard\n        this.clipText = newText;\n        if (this.ready) {\n            this.movie.setText(newText);\n        }\n    },\n\n    addEventListener: function (eventName, func) {\n        // add user event listener for event\n        // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel\n        eventName = eventName.toString().toLowerCase().replace(/^on/, '');\n        if (!this.handlers[eventName]) {\n            this.handlers[eventName] = [];\n        }\n        this.handlers[eventName].push(func);\n    },\n\n    setHandCursor: function (enabled) {\n        // enable hand cursor (true), or default arrow cursor (false)\n        this.handCursorEnabled = enabled;\n        if (this.ready) {\n            this.movie.setHandCursor(enabled);\n        }\n    },\n\n    setCSSEffects: function (enabled) {\n        // enable or disable CSS effects on DOM container\n        this.cssEffects = !! enabled;\n    },\n\n    receiveEvent: function (eventName, args) {\n        // receive event from flash\n        eventName = eventName.toString().toLowerCase().replace(/^on/, '');\n\n        // special behavior for certain events\n        switch (eventName) {\n        case 'load':\n            // movie claims it is ready, but in IE this isn't always the case...\n            // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function\n            this.movie = document.getElementById(this.movieId);\n            var self = this;\n\n            if (!this.movie) {\n                setTimeout(function () {\n                    self.receiveEvent('load', null);\n                }, 1);\n                return;\n            }\n\n            // firefox on pc needs a \"kick\" in order to set these in certain cases\n            if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) {\n                setTimeout(function () {\n                    self.receiveEvent('load', null);\n                }, 100);\n                this.ready = true;\n                return;\n            }\n\n            this.ready = true;\n            try {\n                this.movie.setText(this.clipText);\n            } catch (e) {}\n            try {\n                this.movie.setHandCursor(this.handCursorEnabled);\n            } catch (e) {}\n            break;\n\n        case 'mouseover':\n            if (this.domElement && this.cssEffects) {\n                this.domElement.addClass('hover');\n                if (this.recoverActive) {\n                    this.domElement.addClass('active');\n                }\n\n            }\n            break;\n\n        case 'mouseout':\n            if (this.domElement && this.cssEffects) {\n                this.recoverActive = false;\n                if (this.domElement.hasClass('active')) {\n                    this.domElement.removeClass('active');\n                    this.recoverActive = true;\n                }\n                this.domElement.removeClass('hover');\n\n            }\n            break;\n\n        case 'mousedown':\n            if (this.domElement && this.cssEffects) {\n                this.domElement.addClass('active');\n            }\n            break;\n\n        case 'mouseup':\n            if (this.domElement && this.cssEffects) {\n                this.domElement.removeClass('active');\n                this.recoverActive = false;\n            }\n            break;\n        } // switch eventName\n        if (this.handlers[eventName]) {\n            for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) {\n                var func = this.handlers[eventName][idx];\n\n                if (jQuery.isFunction(func)) {\n                    // actual function reference\n                    func(this, args);\n                } else if ((typeof(func) == 'object') && (func.length == 2)) {\n                    // PHP style object + method, i.e. [myObject, 'myMethod']\n                    func[0][func[1]](this, args);\n                } else if (typeof(func) == 'string') {\n                    // name of function\n                    window[func](this, args);\n                }\n            } // foreach event handler defined\n        } // user defined handler for event\n    }\n\n};\n"
  }
]