Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #750 from mitodl/feature/gs/loader
Browse files Browse the repository at this point in the history
Added loader to listing, resource panel and taxonomy panel
  • Loading branch information
George Schneeloch committed Oct 9, 2015
2 parents aa517e3 + 39d9660 commit 58cdabd
Show file tree
Hide file tree
Showing 21 changed files with 742 additions and 88 deletions.
14 changes: 7 additions & 7 deletions bower.json
Expand Up @@ -9,17 +9,17 @@
"license": "AGPLv3",
"dependencies": {
"bootstrap": "~3.3.5",
"requirejs": "~2.1.17",
"icheck": "~1.0.2",
"components-font-awesome": "~4.3.0",
"history.js": "~1.8.0",
"icheck": "~1.0.2",
"lodash": "~3.9.3",
"modernizr": "~2.8.3",
"retina.js": "~1.3.0",
"react": "0.13.3",
"react-infinite": "~0.4.1",
"requirejs": "~2.1.17",
"retina.js": "~1.3.0",
"select2": "~4.0.0",
"select2-bootstrap-theme": "~0.1.0-beta.4",
"lodash": "~3.9.3",
"react-infinite": "~0.4.1",
"uri.js": "~1.16.0",
"history.js": "~1.8.0"
"uri.js": "~1.16.0"
}
}
4 changes: 2 additions & 2 deletions ui/jstests/test-learning-resource.jsx
Expand Up @@ -553,9 +553,9 @@ define(['QUnit', 'jquery', 'react', 'lodash', 'learning_resources',
"LearningResourcePanel.loader should populate its stuff",
function(assert) {
var div = document.createElement("div");
assert.equal(0, $(div).find("textarea").size());
assert.ok($(div).html().length === 0);
LearningResources.loader("repo", "1", function() {}, function() {}, div);
assert.equal(1, $(div).find("textarea").size());
assert.ok($(div).html().length > 0);
}
);
});
4 changes: 2 additions & 2 deletions ui/jstests/test_manage_taxonomies.jsx
Expand Up @@ -2565,12 +2565,12 @@ define(['QUnit', 'jquery', 'lodash', 'manage_taxonomies', 'react',
QUnit.test("Test that ManageTaxonomies.loader renders into div",
function(assert) {
var container = document.createElement("div");
assert.equal(0, $(container).find("input").size());
assert.ok($(container).html().length === 0);
ManageTaxonomies.loader(
"repo", container, function() {}, function() {}, function() {},
function() {}
);
assert.equal(5, $(container).find("input").size());
assert.ok($(container).html().length > 0);
}
);

Expand Down
28 changes: 28 additions & 0 deletions ui/static/bower/spin.js/.bower.json
@@ -0,0 +1,28 @@
{
"name": "spin.js",
"main": "spin.js",
"dependencies": {},
"readme": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/fgnass/spin.js.git"
},
"ignore": [
"Gruntfile.js",
"site",
"bower.json",
"component.json",
"package.json"
],
"homepage": "https://github.com/fgnass/spin.js",
"version": "2.3.2",
"_release": "2.3.2",
"_resolution": {
"type": "version",
"tag": "2.3.2",
"commit": "5a9ea41651105302fe76d15cb294070c5863e759"
},
"_source": "git://github.com/fgnass/spin.js.git",
"_target": "2.x",
"_originalSource": "spin.js"
}
6 changes: 6 additions & 0 deletions ui/static/bower/spin.js/.gitignore
@@ -0,0 +1,6 @@
.DS_Store
.grunt
node_modules
site/spin.js
site/spin.min.js
site/jquery.spin.js
28 changes: 28 additions & 0 deletions ui/static/bower/spin.js/.jshintrc
@@ -0,0 +1,28 @@
{
/* Additional globals */
"predef": [
"define",
"module",
"require"
],

/* Enforcing Options */

"immed" : true, // Switches on warnings for immediately invoked functions which are not wrapped in parenthesis
"latedef" : true, // Switches on warnings for using variables or functions prior of their definition
"newcap" : true, // Switches on warnings if uncapitalised constructor function names are being used
"noarg" : true, // Switches on warnings when arguments.caller and arguments.callee are being used
"nonew" : true, // Switches on warnings when no "new" keyword is being used for constructor functions
"regexp" : true, // Switches on warnings for unsafe usage of '.' in regular expressions
"undef" : true, // Switches on warnings when using undeclared variables
"trailing" : true, // Switches on warnings for using trailing whitespace at the end of lines

/* Relaxing Options */

"asi" : true, // Switches off warnings about missing semi-colons
"laxcomma" : true, // Switches off warnings about leading commas in multi-line var declarations

/* Environments */

"browser" : true // Allows the use of undefined globals exposed by modern browsers, i.e. window
}
4 changes: 4 additions & 0 deletions ui/static/bower/spin.js/.npmignore
@@ -0,0 +1,4 @@
site
Gruntfile.js
bower.json
component.json
1 change: 1 addition & 0 deletions ui/static/bower/spin.js/.spmignore
@@ -0,0 +1 @@
site
22 changes: 22 additions & 0 deletions ui/static/bower/spin.js/LICENSE.md
@@ -0,0 +1,22 @@
The MIT License
===============

Copyright (c) 2011-2015 Felix Gnass [fgnass at gmail dot com]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
21 changes: 21 additions & 0 deletions ui/static/bower/spin.js/README.md
@@ -0,0 +1,21 @@
# spin.js [![JS.ORG](https://img.shields.io/badge/js.org-spin-ffb400.svg?style=flat-square)](http://js.org)

An animated CSS3 loading spinner with VML fallback for IE.

* No images, no external CSS
* No dependencies
* Highly configurable
* Resolution independent
* Uses VML as fallback in old IEs
* Uses @keyframe animations, falling back to setTimeout()
* Works in all major browsers, including IE6
* Small footprint (~1.9K gzipped)
* MIT License

## Usage

```javascript
new Spinner({color:'#fff', lines: 12}).spin(target);
```

For an interactive demo and a list of all supported options please refer to the [project's homepage](http://spin.js.org).
17 changes: 17 additions & 0 deletions ui/static/bower/spin.js/bower.json
@@ -0,0 +1,17 @@
{
"name": "spin.js",
"main": "spin.js",
"dependencies": {},
"readme": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/fgnass/spin.js.git"
},
"ignore": [
"Gruntfile.js",
"site",
"bower.json",
"component.json",
"package.json"
]
}
79 changes: 79 additions & 0 deletions ui/static/bower/spin.js/jquery.spin.js
@@ -0,0 +1,79 @@
/**
* Copyright (c) 2011-2014 Felix Gnass
* Licensed under the MIT license
* http://spin.js.org/
*/

/*
Basic Usage:
============
$('#el').spin() // Creates a default Spinner using the text color of #el.
$('#el').spin({ ... }) // Creates a Spinner using the provided options.
$('#el').spin(false) // Stops and removes the spinner.
Using Presets:
==============
$('#el').spin('small') // Creates a 'small' Spinner using the text color of #el.
$('#el').spin('large', '#fff') // Creates a 'large' white Spinner.
Adding a custom preset:
=======================
$.fn.spin.presets.flower = {
lines: 9
, length: 10
, width: 20
, radius: 0
}
$('#el').spin('flower', 'red')
*/

;(function(factory) {

if (typeof exports == 'object') {
// CommonJS
factory(require('jquery'), require('spin.js'))
} else if (typeof define == 'function' && define.amd) {
// AMD, register as anonymous module
define(['jquery', 'spin'], factory)
} else {
// Browser globals
if (!window.Spinner) throw new Error('Spin.js not present')
factory(window.jQuery, window.Spinner)
}

}(function($, Spinner) {

$.fn.spin = function(opts, color) {

return this.each(function() {
var $this = $(this)
, data = $this.data()

if (data.spinner) {
data.spinner.stop()
delete data.spinner
}
if (opts !== false) {
opts = $.extend(
{ color: color || $this.css('color') }
, $.fn.spin.presets[opts] || opts
)
data.spinner = new Spinner(opts).spin(this)
}
})
}

$.fn.spin.presets = {
tiny: { lines: 8, length: 2, width: 2, radius: 3 }
, small: { lines: 8, length: 4, width: 3, radius: 5 }
, large: { lines: 10, length: 8, width: 4, radius: 8 }
}

}));

0 comments on commit 58cdabd

Please sign in to comment.