1/** 2 * Copyright (c) 2011-2014 Felix Gnass 3 * Licensed under the MIT license 4 */ 5 6/* 7 8Basic Usage: 9============ 10 11$('#el').spin(); // Creates a default Spinner using the text color of #el. 12$('#el').spin({ ... }); // Creates a Spinner using the provided options. 13 14$('#el').spin(false); // Stops and removes the spinner. 15 16Using Presets: 17============== 18 19$('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el. 20$('#el').spin('large', '#fff'); // Creates a 'large' white Spinner. 21 22Adding a custom preset: 23======================= 24 25$.fn.spin.presets.flower = { 26 lines: 9 27 length: 10 28 width: 20 29 radius: 0 30} 31 32$('#el').spin('flower', 'red'); 33 34*/ 35 36(function(factory) { 37 38 if (typeof exports == 'object') { 39 // CommonJS 40 factory(require('jquery'), require('spin')) 41 } 42 else if (typeof define == 'function' && define.amd) { 43 // AMD, register as anonymous module 44 define(['jquery', 'spin'], factory) 45 } 46 else { 47 // Browser globals 48 if (!window.Spinner) throw new Error('Spin.js not present') 49 factory(window.jQuery, window.Spinner) 50 } 51 52}(function($, Spinner) { 53 54 $.fn.spin = function(opts, color) { 55 56 return this.each(function() { 57 var $this = $(this), 58 data = $this.data(); 59 60 if (data.spinner) { 61 data.spinner.stop(); 62 delete data.spinner; 63 } 64 if (opts !== false) { 65 opts = $.extend( 66 { color: color || $this.css('color') }, 67 $.fn.spin.presets[opts] || opts 68 ) 69 data.spinner = new Spinner(opts).spin(this) 70 } 71 }) 72 } 73 74 $.fn.spin.presets = { 75 tiny: { lines: 8, length: 2, width: 2, radius: 3 }, 76 small: { lines: 8, length: 4, width: 3, radius: 5 }, 77 large: { lines: 10, length: 8, width: 4, radius: 8 } 78 } 79 80}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.