├── MANIFEST.in ├── mineral ├── templatetags │ ├── __init__.py │ ├── FreeSans.ttf │ └── placeholder.py ├── views.py ├── models.py ├── static │ └── mineral │ │ ├── images │ │ ├── forms │ │ │ ├── input-bg.png │ │ │ ├── form-icons.png │ │ │ ├── calendar-month.png │ │ │ └── input-error-bg.png │ │ ├── temp │ │ │ └── carousel │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ └── 4.jpg │ │ └── messages │ │ │ ├── icon-sprite.png │ │ │ └── status-close.png │ │ ├── js │ │ ├── plugins │ │ │ ├── fancybox │ │ │ │ ├── blank.gif │ │ │ │ ├── fancybox.png │ │ │ │ ├── fancy_close.png │ │ │ │ ├── fancybox-x.png │ │ │ │ ├── fancybox-y.png │ │ │ │ ├── fancy_loading.png │ │ │ │ ├── fancy_nav_left.png │ │ │ │ ├── fancy_nav_right.png │ │ │ │ ├── fancy_shadow_e.png │ │ │ │ ├── fancy_shadow_n.png │ │ │ │ ├── fancy_shadow_ne.png │ │ │ │ ├── fancy_shadow_nw.png │ │ │ │ ├── fancy_shadow_s.png │ │ │ │ ├── fancy_shadow_se.png │ │ │ │ ├── fancy_shadow_sw.png │ │ │ │ ├── fancy_shadow_w.png │ │ │ │ ├── fancy_title_left.png │ │ │ │ ├── fancy_title_main.png │ │ │ │ ├── fancy_title_over.png │ │ │ │ ├── fancy_title_right.png │ │ │ │ └── jquery.fancybox-1.3.1.css │ │ │ ├── jquery.listfilter.js │ │ │ ├── jquery.mousewheel-3.0.2.min.js │ │ │ ├── jquery.multicomplete.js │ │ │ ├── jquery.prototify.js │ │ │ ├── jquery.simpletabs.js │ │ │ ├── jquery.defaultvalue.js │ │ │ ├── jquery.notice.js │ │ │ ├── jquery.autoresize.js │ │ │ ├── jquery.tablesorter.pager.js │ │ │ ├── jquery.easing-1.3.min.js │ │ │ ├── jquery.pagination.js │ │ │ ├── jquery.tablesorter.min.js │ │ │ ├── jquery.fancybox-1.3.1.min.js │ │ │ ├── jquery.jcarousellite-1.0.1.js │ │ │ └── jquery.multifile.js │ │ ├── global.js │ │ └── libs │ │ │ └── json2.js │ │ └── css │ │ ├── ui-lightness │ │ └── images │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ ├── ui-icons_ffffff_256x240.png │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ └── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ ├── widgets.css │ │ ├── grid.css │ │ ├── fonts.css │ │ ├── mineral.css │ │ ├── common │ │ ├── messages.css │ │ └── forms.css │ │ ├── base.css │ │ ├── reset.css │ │ └── master.css ├── templates │ └── mineral │ │ ├── index.html │ │ ├── notifications.html │ │ ├── base.html │ │ ├── common.html │ │ ├── widgets.html │ │ └── forms.html ├── tests.py ├── urls.py └── __init__.py ├── LICENSE └── setup.py /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | -------------------------------------------------------------------------------- /mineral/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mineral/views.py: -------------------------------------------------------------------------------- 1 | # Create your views here. 2 | -------------------------------------------------------------------------------- /mineral/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /mineral/templatetags/FreeSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/templatetags/FreeSans.ttf -------------------------------------------------------------------------------- /mineral/static/mineral/images/forms/input-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/forms/input-bg.png -------------------------------------------------------------------------------- /mineral/static/mineral/images/forms/form-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/forms/form-icons.png -------------------------------------------------------------------------------- /mineral/static/mineral/images/temp/carousel/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/temp/carousel/1.jpg -------------------------------------------------------------------------------- /mineral/static/mineral/images/temp/carousel/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/temp/carousel/2.jpg -------------------------------------------------------------------------------- /mineral/static/mineral/images/temp/carousel/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/temp/carousel/3.jpg -------------------------------------------------------------------------------- /mineral/static/mineral/images/temp/carousel/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/temp/carousel/4.jpg -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/blank.gif -------------------------------------------------------------------------------- /mineral/static/mineral/images/forms/calendar-month.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/forms/calendar-month.png -------------------------------------------------------------------------------- /mineral/static/mineral/images/forms/input-error-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/forms/input-error-bg.png -------------------------------------------------------------------------------- /mineral/static/mineral/images/messages/icon-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/messages/icon-sprite.png -------------------------------------------------------------------------------- /mineral/static/mineral/images/messages/status-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/images/messages/status-close.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancybox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancybox.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_close.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancybox-x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancybox-x.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancybox-y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancybox-y.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_loading.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_nav_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_nav_left.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_nav_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_nav_right.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_e.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_n.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_ne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_ne.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_nw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_nw.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_s.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_se.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_sw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_sw.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_shadow_w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_shadow_w.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_title_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_title_left.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_title_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_title_main.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_title_over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_title_over.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/fancy_title_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/js/plugins/fancybox/fancy_title_right.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /mineral/static/mineral/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lincolnloop/django-mineral/HEAD/mineral/static/mineral/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /mineral/static/mineral/js/global.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | // Messages 3 | $('.status-message .status-close').click(function() { 4 | $(this).parent().fadeOut(); 5 | return false; 6 | }); 7 | }); // end document.ready -------------------------------------------------------------------------------- /mineral/templates/mineral/index.html: -------------------------------------------------------------------------------- 1 | {% extends "mineral/base.html" %} 2 | 3 | {% load webdesign %} 4 | 5 | 6 | {% block head_title %}Mineral Styles List{% endblock %} 7 | {% block mineral_index_active %}active{% endblock %} 8 | 9 | 10 | {% block content %} 11 | 12 | {% endblock %} -------------------------------------------------------------------------------- /mineral/tests.py: -------------------------------------------------------------------------------- 1 | """ 2 | This file demonstrates writing tests using the unittest module. These will pass 3 | when you run "manage.py test". 4 | 5 | Replace this with more appropriate tests for your application. 6 | """ 7 | 8 | from django.test import TestCase 9 | 10 | 11 | class SimpleTest(TestCase): 12 | def test_basic_addition(self): 13 | """ 14 | Tests that 1 + 1 always equals 2. 15 | """ 16 | self.assertEqual(1 + 1, 2) 17 | -------------------------------------------------------------------------------- /mineral/static/mineral/css/widgets.css: -------------------------------------------------------------------------------- 1 | /* 2 | ---------------------------------------------------------------------- 3 | 4 | Base Stylesheet 5 | 6 | Author: Marco Louro 7 | Version: 2010.03 8 | 9 | ------------------------------------------------------------------ */ 10 | 11 | /* ------------------------------------------------------------ 12 | +Proto-image 13 | ------------------------------------------------------------ */ 14 | .proto-image { display: inline-block; border: 1px solid #CCC; background-color: #EFEFEF; } 15 | .proto-image.fllt { margin: 0 10px 10px 0; } 16 | .proto-image.flrt { margin: 0 0 10px 10px; } 17 | 18 | .placeholder.fllt { margin: 0 10px 10px 0; } 19 | .placeholder.flrt { margin: 0 0 10px 10px; } 20 | 21 | -------------------------------------------------------------------------------- /mineral/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import patterns, url 2 | from django.views import generic 3 | 4 | urlpatterns = patterns('', 5 | url('^$', generic.TemplateView.as_view(template_name='mineral/index.html'), 6 | name='index'), 7 | url('^common/$', generic.TemplateView.as_view(template_name='mineral/common.html'), 8 | name='common'), 9 | url('^forms/$', generic.TemplateView.as_view(template_name='mineral/forms.html'), 10 | name='forms'), 11 | url('^notifications/$', generic.TemplateView.as_view(template_name='mineral/notifications.html'), 12 | name='notifications'), 13 | url('^widgets/$', generic.TemplateView.as_view(template_name='mineral/widgets.html'), 14 | name='widgets'), 15 | ) 16 | -------------------------------------------------------------------------------- /mineral/__init__.py: -------------------------------------------------------------------------------- 1 | VERSION = (0, 1, 'alpha', 0) 2 | 3 | 4 | def get_version(major=None): 5 | """ 6 | Return the current version as a string. 7 | 8 | :param major: Build the major version, consisting of a maximum of this 9 | many integer parts. For example, ``get_version(major=2)`` for a version 10 | of ``(1, 0, 4)`` will return ``'1.0'``. 11 | """ 12 | version = [str(VERSION[0])] 13 | number = True 14 | for i, bit in enumerate(VERSION[1:]): 15 | if major and i >= major: 16 | break 17 | if not isinstance(bit, int): 18 | if major: 19 | break 20 | number = False 21 | version.append(number and '.' or '-') 22 | version.append(str(bit)) 23 | return ''.join(version) -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.listfilter.js: -------------------------------------------------------------------------------- 1 | /* 2 | Filter plugin 3 | */ 4 | $.widget("ui.listfilter", { 5 | 6 | // default options 7 | options: {}, 8 | 9 | _create: function() { 10 | 11 | var filter = $(this.element); 12 | 13 | filter.keyup(function(){ 14 | 15 | filter.parent().next('.choices').find('li').each(function () { 16 | if ($(this).text().search(new RegExp(filter.val(), "i")) < 0) { 17 | $(this).hide(); 18 | } else { 19 | $(this).show(); 20 | } 21 | }); 22 | 23 | }); 24 | 25 | 26 | }, 27 | 28 | destroy: function() { 29 | $.Widget.prototype.destroy.apply(this, arguments); // default destroy 30 | // now do other stuff particular to this widget 31 | } 32 | 33 | }); -------------------------------------------------------------------------------- /mineral/static/mineral/css/grid.css: -------------------------------------------------------------------------------- 1 | @media screen and (max-width: 319px) {.unit{float: none !important; width: auto !important;}} 2 | .line:after,.lastUnit:after{clear:both;display:block;visibility:hidden;overflow:hidden;height:0 !important;line-height:0;font-size:xx-large;content:" x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x ";} 3 | .line{*zoom:1;} 4 | .unit{float:left; margin: 0 1.04%; } 5 | 6 | .size1of12{width:6.25%;} 7 | .size2of12{width:14.583%} 8 | .size3of12{width:22.917%;} 9 | .size4of12{width:31.25%;} 10 | .size5of12{width:41.667%;} 11 | .size6of12{width:47.917%;} 12 | .size7of12{width:56.25%;} 13 | .size8of12{width:64.583%;} 14 | .size9of12{width:72.917%;} 15 | .size10of12{width:81.25%;} 16 | .size11of12{width:89.583%;} 17 | 18 | .lastUnit{display:table-cell;float:none;width:auto;*display:block;*zoom:1;_position:relative;_left:-3px;_margin-right:-3px;} -------------------------------------------------------------------------------- /mineral/static/mineral/css/fonts.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 3.0.0 6 | build: 1549 7 | */ 8 | /** 9 | * Percents could work for IE, but for backCompat purposes, we are using keywords. 10 | * x-small is for IE6/7 quirks mode. 11 | */ 12 | body { 13 | font:13px/1.231 arial,helvetica,clean,sans-serif; 14 | *font-size:small; /* for IE */ 15 | *font:x-small; /* for IE in quirks mode */ 16 | } 17 | 18 | /** 19 | * Nudge down to get to 13px equivalent for these form elements 20 | */ 21 | select, 22 | input, 23 | button, 24 | textarea { 25 | font:99% arial,helvetica,clean,sans-serif; 26 | } 27 | 28 | /** 29 | * To help tables remember to inherit 30 | */ 31 | table { 32 | font-size:inherit; 33 | font:100%; 34 | } 35 | 36 | /** 37 | * Bump up IE to get to 13px equivalent for these fixed-width elements 38 | */ 39 | pre, 40 | code, 41 | kbd, 42 | samp, 43 | tt { 44 | font-family:monospace; 45 | *font-size:108%; 46 | line-height:100%; 47 | } -------------------------------------------------------------------------------- /mineral/static/mineral/css/mineral.css: -------------------------------------------------------------------------------- 1 | /* 2 | ---------------------------------------------------------------------- 3 | 4 | Mineral Stylesheet 5 | 6 | Author: Marco Louro 7 | Version: 2010.03 8 | 9 | ------------------------------------------------------------------ */ 10 | 11 | /* ------------------------------------------------------------ 12 | +Header nav 13 | ------------------------------------------------------------ */ 14 | 15 | #mineral-nav { position: fixed; top: 0; width: 100%; overflow: hidden; z-index: 2; 16 | background-color: #37994A; opacity: 0.9; } 17 | #mineral-nav ul { margin: 0; padding: 0 20px; } 18 | #mineral-nav ul.first { float: left; } 19 | #mineral-nav ul.last { float: right; } 20 | #mineral-nav li { float: left; padding: 10px; font-size: 120%; list-style: none; } 21 | #mineral-nav span, 22 | #mineral-nav a { text-shadow: 1px 1px 1px #2B4E23; color: #FFF; text-decoration: none; } 23 | #mineral-nav a:hover { color: #CBFFC5; } 24 | #mineral-nav a.active { color: #222; text-shadow: none; } 25 | #mineral-nav span { text-decoration: line-through; } 26 | 27 | #mineral-nav ul.last a { font-weight: normal; font-size: 95% } -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.mousewheel-3.0.2.min.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) 2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * 7 | * Version: 3.0.2 8 | * 9 | * Requires: 1.2.2+ 10 | */ 11 | 12 | (function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a], 13 | d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Lincoln Loop 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Lincoln Loop nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL LINCOLN LOOP BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from distutils.core import setup 3 | from mineral import get_version 4 | 5 | ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) 6 | 7 | MINERAL_DATA = [] 8 | for data_dirname in ['templates', 'static']: 9 | DATA_DIR = os.path.join(ROOT_DIR, 'mineral', data_dirname) 10 | for path, dirs, filenames in os.walk(DATA_DIR): 11 | # Ignore directories that start with '.' 12 | for i, dir in enumerate(dirs): 13 | if dir.startswith('.'): 14 | del dirs[i] 15 | path = path[len(DATA_DIR) + 1:] 16 | MINERAL_DATA.append(os.path.join(data_dirname, path, '*.*')) 17 | # Get files starting with '.' too (they are excluded from the *.* glob). 18 | MINERAL_DATA.append(os.path.join(data_dirname, path, '.*')) 19 | 20 | setup( 21 | name='django-mineral', 22 | version=get_version(), 23 | description="A collection of templates/widgets for rapid prototyping", 24 | #long_description=open('README.rst').read(), 25 | author='Marco Louro', 26 | author_email='marco@lincolnloop.com', 27 | license='BSD', 28 | url='http://github.com/lincolnloop/django-mineral/', 29 | packages=[ 30 | 'mineral', 31 | ], 32 | install_requires=[ 33 | 'django-ttag>=1.0-alpha-3', 34 | ], 35 | package_data={'mineral': MINERAL_DATA}, 36 | classifiers=[ 37 | 'Development Status :: 2 - Pre-Alpha', 38 | 'Environment :: Web Environment', 39 | 'Intended Audience :: Developers', 40 | 'License :: OSI Approved :: BSD License', 41 | 'Operating System :: OS Independent', 42 | 'Programming Language :: Python', 43 | 'Framework :: Django', 44 | ], 45 | ) 46 | -------------------------------------------------------------------------------- /mineral/static/mineral/css/common/messages.css: -------------------------------------------------------------------------------- 1 | .status-message { position: relative; margin: 0 0 25px 0; padding: 2px 0 16px; 2 | background: #FFF4BF url(../../images/messages/icon-sprite.png) no-repeat 16px 12px; border: 2px solid #EFD695; } 3 | 4 | .status-message .description { font-size: 14px; padding: 0 45px 0 74px; } 5 | .status-message .status-close { position: absolute; right: 0; top: 0; text-align: center; padding: 2px 6px 4px 8px; 6 | text-decoration: none; font-weight: bold; background: #efd695; } 7 | 8 | .status-message h4 { font-size: 14px; padding: 14px 45px 8px 74px; font-weight: bold; } 9 | .status-message.warning { background-position: 16px -125px; } 10 | .status-message.info { background-position: 16px -293px; } 11 | .status-message.error { color: #c41230; background-position: 16px -451px; } 12 | .status-message.debug { background-position: 16px -631px; } 13 | .status-message.debug .description { font-family: Monospace !important; 14 | font-size: 12px !important; font-weight: normal !important; } 15 | .status-message.error .extra { font-size: 12px; font-weight: normal; } 16 | 17 | .status-message .errorlist { padding: 0 80px; } 18 | .status-message .errorlist li { list-style: circle; list-style-position: inside; } 19 | 20 | 21 | 22 | .notice-wrap { position: fixed; z-index: 9999; top: 20px; right: 20px; width: 250px; text-align: left; } 23 | * html .notice-wrap { position: absolute; } 24 | .notice-item { position: relative; display: block; height: 60px; padding: 6px 22px 0 6px; margin: 0 0 12px 0; 25 | background: #333; color: #eee; border: 2px solid #999; 26 | -moz-border-radius: 6px; -webkit-border-radius: 6px; } 27 | .notice-item-close { position: absolute; top: 6px; right: 6px; cursor: pointer; font-weight: bold; } 28 | -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.multicomplete.js: -------------------------------------------------------------------------------- 1 | /* 2 | tabs plugin 3 | TODO: jQuery this 4 | */ 5 | $.widget("ui.multicomplete", { 6 | 7 | // default options 8 | options: { 9 | source: null 10 | }, 11 | 12 | _create: function() { 13 | this._multify(); 14 | }, 15 | 16 | 17 | _multify: function() { 18 | 19 | this.placeholder = $(''); 20 | this.item_list = $(''); 21 | this.input = $(this.element).find('input[type=text]'); 22 | var self = this; 23 | 24 | this.item_list.appendTo(this.placeholder); 25 | this.placeholder.insertBefore(this.input); 26 | 27 | this.input.insertAfter(this.item_list).addClass('ui-multicomplete-input'); 28 | 29 | this.input.autocomplete({ 30 | source: this.options.source, 31 | select: function(event, ui) { 32 | self.createItem(ui.item.value); 33 | }, 34 | close: function(event, ui) { 35 | event.originalTarget.value = ''; 36 | $(event.originalTarget).focus(); 37 | } 38 | }); 39 | }, 40 | 41 | createItem: function(value) { 42 | var item = $('' + value + ''); 43 | var remove = $('X<'); 44 | remove.appendTo(item); 45 | item.appendTo(this.item_list); 46 | 47 | remove.bind('click', function() { 48 | $(this).parent().remove(); 49 | }); 50 | }, 51 | 52 | destroy: function() { 53 | $.Widget.prototype.destroy.apply(this, arguments); // default destroy 54 | // now do other stuff particular to this widget 55 | } 56 | 57 | }); -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.prototify.js: -------------------------------------------------------------------------------- 1 | /* 2 | tabs plugin 3 | TODO: jQuery this 4 | */ 5 | $.widget("ui.prototify", { 6 | 7 | // default options 8 | options: { 9 | type: 'box' 10 | }, 11 | 12 | _create: function() { 13 | var canvas = this.element.get(0); 14 | var width = canvas.width; 15 | var height = canvas.height; 16 | var textContent = canvas.textContent; 17 | 18 | 19 | canvas = canvas.getContext('2d'); 20 | 21 | canvas.lineWidth = 1; 22 | canvas.strokeStyle = '#999'; 23 | 24 | canvas.beginPath(); 25 | canvas.moveTo(0,0); 26 | canvas.lineTo(width, height); 27 | canvas.closePath(); 28 | canvas.stroke(); 29 | 30 | canvas.beginPath(); 31 | canvas.moveTo(0, height); 32 | canvas.lineTo(width, 0); 33 | canvas.closePath(); 34 | canvas.stroke(); 35 | 36 | canvas.font = "18pt Arial"; 37 | canvas.textAlign = "center"; 38 | canvas.textBaseline = "middle"; 39 | canvas.fillText(textContent, width/2, height/2, width); 40 | }, 41 | 42 | destroy: function() { 43 | $.Widget.prototype.destroy.apply(this, arguments); // default destroy 44 | // now do other stuff particular to this widget 45 | } 46 | 47 | }); 48 | 49 | 50 | $("ul.auto-tabs li a:not(.format)").live("click", function(){ 51 | var li_obj = $(this).parent(); 52 | var selected_tab = $(this).attr("rel"); 53 | 54 | // remove previously selected items 55 | li_obj.parent().parent().children(".tab").addClass("hidden").removeClass("selected"); 56 | li_obj.parent().children("li.selected").removeClass("selected"); 57 | 58 | 59 | li_obj.addClass("selected"); 60 | $("#" + selected_tab).removeClass("hidden").addClass("selected"); 61 | 62 | return false; 63 | }); -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.simpletabs.js: -------------------------------------------------------------------------------- 1 | /* 2 | tabs plugin 3 | TODO: jQuery this 4 | */ 5 | $.widget("ui.prototify", { 6 | 7 | // default options 8 | options: { 9 | type: 'box' 10 | }, 11 | 12 | _create: function() { 13 | var canvas = this.element.get(0); 14 | var width = canvas.width; 15 | var height = canvas.height; 16 | var textContent = canvas.textContent; 17 | 18 | 19 | canvas = canvas.getContext('2d'); 20 | 21 | canvas.lineWidth = 1; 22 | canvas.strokeStyle = '#999'; 23 | 24 | canvas.beginPath(); 25 | canvas.moveTo(0,0); 26 | canvas.lineTo(width, height); 27 | canvas.closePath(); 28 | canvas.stroke(); 29 | 30 | canvas.beginPath(); 31 | canvas.moveTo(0, height); 32 | canvas.lineTo(width, 0); 33 | canvas.closePath(); 34 | canvas.stroke(); 35 | 36 | canvas.font = "18pt Arial"; 37 | canvas.textAlign = "center"; 38 | canvas.textBaseline = "middle"; 39 | canvas.fillText(textContent, width/2, height/2, width); 40 | }, 41 | 42 | destroy: function() { 43 | $.Widget.prototype.destroy.apply(this, arguments); // default destroy 44 | // now do other stuff particular to this widget 45 | } 46 | 47 | }); 48 | 49 | 50 | $("ul.auto-tabs li a:not(.format)").live("click", function(){ 51 | var li_obj = $(this).parent(); 52 | var selected_tab = $(this).attr("rel"); 53 | 54 | // remove previously selected items 55 | li_obj.parent().parent().children(".tab").addClass("hidden").removeClass("selected"); 56 | li_obj.parent().children("li.selected").removeClass("selected"); 57 | 58 | 59 | li_obj.addClass("selected"); 60 | $("#" + selected_tab).removeClass("hidden").addClass("selected"); 61 | 62 | return false; 63 | }); -------------------------------------------------------------------------------- /mineral/templates/mineral/notifications.html: -------------------------------------------------------------------------------- 1 | {% extends "mineral/base.html" %} 2 | 3 | {% load webdesign %} 4 | 5 | 6 | {% block head_title %}Mineral Styles List{% endblock %} 7 | {% block mineral_notifications_active %}active{% endblock %} 8 | 9 | {% block content %} 10 | 11 |
12 | X 13 |

This is a success message

14 |
15 | This is a description for the success message 16 |
17 |
18 |
19 | X 20 |

This is an error message

21 |
22 | This is a description for the error message 23 |
24 |
25 |
26 | X 27 |

This is a warning message without description

28 |
29 |
30 |

This is a non-sticky info message

31 |
32 | This is a description for the info message 33 |
34 |
35 | 36 | 37 |

38 | 39 | 40 |

41 | 42 | {% endblock %} 43 | 44 | 45 | {% block extra_js %} 46 | 64 | {% endblock %} -------------------------------------------------------------------------------- /mineral/static/mineral/css/base.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 3.0.0 6 | build: 1549 7 | */ 8 | /* base.css, part of YUI's CSS Foundation */ 9 | h1 { 10 | /*18px via YUI Fonts CSS foundation*/ 11 | font-size:138.5%; 12 | } 13 | h2 { 14 | /*16px via YUI Fonts CSS foundation*/ 15 | font-size:123.1%; 16 | } 17 | h3 { 18 | /*14px via YUI Fonts CSS foundation*/ 19 | font-size:108%; 20 | } 21 | h1,h2,h3 { 22 | /* top & bottom margin based on font size */ 23 | margin:1em 0; 24 | } 25 | h1,h2,h3,h4,h5,h6,strong { 26 | /*bringing boldness back to headers and the strong element*/ 27 | font-weight:bold; 28 | } 29 | abbr,acronym { 30 | /*indicating to users that more info is available */ 31 | border-bottom:1px dotted #000; 32 | cursor:help; 33 | } 34 | em { 35 | /*bringing italics back to the em element*/ 36 | font-style:italic; 37 | } 38 | blockquote,ul,ol,dl { 39 | /*giving blockquotes and lists room to breath*/ 40 | margin:1em; 41 | } 42 | ol,ul,dl { 43 | /*bringing lists on to the page with breathing room */ 44 | margin-left:2em; 45 | } 46 | ol li { 47 | /*giving OL's LIs generated numbers*/ 48 | list-style: decimal outside; 49 | } 50 | ul li { 51 | /*giving UL's LIs generated disc markers*/ 52 | list-style: disc outside; 53 | } 54 | dl dd { 55 | /*providing spacing for definition terms*/ 56 | margin-left:1em; 57 | } 58 | th,td { 59 | /*borders and padding to make the table readable*/ 60 | border:1px solid #000; 61 | padding:.5em; 62 | } 63 | th { 64 | /*distinguishing table headers from data cells*/ 65 | font-weight:bold; 66 | text-align:center; 67 | } 68 | caption { 69 | /*coordinated margin to match cell's padding*/ 70 | margin-bottom:.5em; 71 | /*centered so it doesn't blend in to other content*/ 72 | text-align:center; 73 | } 74 | p,fieldset,table,pre { 75 | /*so things don't run into each other*/ 76 | margin-bottom:1em; 77 | } 78 | /* setting a consistent width, 160px; 79 | control of type=file still not possible */ 80 | input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;} 81 | -------------------------------------------------------------------------------- /mineral/static/mineral/css/reset.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009, Yahoo! Inc. All rights reserved. 3 | Code licensed under the BSD License: 4 | http://developer.yahoo.net/yui/license.txt 5 | version: 3.0.0 6 | build: 1549 7 | */ 8 | /* 9 | TODO will need to remove settings on HTML since we can't namespace it. 10 | TODO with the prefix, should I group by selector or property for weight savings? 11 | */ 12 | html{ 13 | color:#000; 14 | background:#FFF; 15 | } 16 | /* 17 | TODO remove settings on BODY since we can't namespace it. 18 | */ 19 | /* 20 | TODO test putting a class on HEAD. 21 | - Fails on FF. 22 | */ 23 | body, 24 | div, 25 | dl, 26 | dt, 27 | dd, 28 | ul, 29 | ol, 30 | li, 31 | h1, 32 | h2, 33 | h3, 34 | h4, 35 | h5, 36 | h6, 37 | pre, 38 | code, 39 | form, 40 | fieldset, 41 | legend, 42 | input, 43 | textarea, 44 | p, 45 | blockquote, 46 | th, 47 | td { 48 | margin:0; 49 | padding:0; 50 | } 51 | table { 52 | border-collapse:collapse; 53 | border-spacing:0; 54 | } 55 | fieldset, 56 | img { 57 | border:0; 58 | } 59 | /* 60 | TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit... 61 | */ 62 | address, 63 | caption, 64 | cite, 65 | code, 66 | dfn, 67 | em, 68 | strong, 69 | th, 70 | var { 71 | font-style:normal; 72 | font-weight:normal; 73 | } 74 | /* 75 | TODO Figure out where this list-style rule is best set. Hedger has a request to investigate. 76 | */ 77 | li { 78 | list-style:none; 79 | } 80 | 81 | caption, 82 | th { 83 | text-align:left; 84 | } 85 | h1, 86 | h2, 87 | h3, 88 | h4, 89 | h5, 90 | h6 { 91 | font-size:100%; 92 | font-weight:normal; 93 | } 94 | q:before, 95 | q:after { 96 | content:''; 97 | } 98 | abbr, 99 | acronym { 100 | border:0; 101 | font-variant:normal; 102 | } 103 | /* to preserve line-height and selector appearance */ 104 | sup { 105 | vertical-align:text-top; 106 | } 107 | sub { 108 | vertical-align:text-bottom; 109 | } 110 | input, 111 | textarea, 112 | select { 113 | font-family:inherit; 114 | font-size:inherit; 115 | font-weight:inherit; 116 | } 117 | /*to enable resizing for IE*/ 118 | input, 119 | textarea, 120 | select { 121 | *font-size:100%; 122 | } 123 | /*because legend doesn't inherit in IE */ 124 | legend { 125 | color:#000; 126 | } -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.defaultvalue.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name Defaultvalue 3 | * @descripton Gives value to empty inputs 4 | * @version 1.3.1 5 | * @requires Jquery 1.3.2 6 | * 7 | * @author Jan Jarfalk 8 | * @author-email jan.jarfalk@unwrongest.com 9 | * @author-website http://www.unwrongest.com 10 | * 11 | * @licens MIT License - http://www.opensource.org/licenses/mit-license.php 12 | * 13 | * @param {String} str The default value 14 | * @param {Function} callback Callback function 15 | */ 16 | 17 | (function(jQuery){ 18 | jQuery.fn.extend({ 19 | defaultValue: function(o, callback) { 20 | 21 | var options = o || {}; 22 | var settings = jQuery.extend({ 23 | value: options.value || null 24 | }, options); 25 | 26 | return this.each(function(index, element) { 27 | 28 | var $input = $(this); 29 | var defaultValue = settings.value || $input.attr('rel'); 30 | var callbackArguments = {'input':$input}; 31 | 32 | // Create clone and switch 33 | var $clone = createClone(); 34 | 35 | // Add clone to callback arguments 36 | callbackArguments.clone = $clone; 37 | 38 | $clone.insertAfter($input); 39 | 40 | var setState = function() { 41 | if( $input.val().length <= 0 ){ 42 | $clone.show(); 43 | $input.hide(); 44 | } else { 45 | $clone.hide(); 46 | $input.show(); 47 | } 48 | }; 49 | 50 | // Events for password fields 51 | $input.bind('blur', setState); 52 | 53 | // Create a input element clone 54 | function createClone(){ 55 | 56 | var $el; 57 | 58 | if($input.context.nodeName.toLowerCase() == 'input') { 59 | $el = jQuery("").attr({ 60 | 'type' : 'text' 61 | }); 62 | } else if($input.context.nodeName.toLowerCase() == 'textarea') { 63 | $el = jQuery(" 110 |   111 | 112 | 115 | 116 | 117 | 118 |
119 |
120 | 121 | * (required) 122 |
123 | 124 | 125 |
126 | 127 | 128 |
129 |
130 | 131 | * (required) 132 |
133 | 134 | 135 |
136 | 137 | 138 |
139 |
140 | 141 | * (required) 142 |
143 | 144 | 145 | 146 |
147 | 148 | 149 | 150 | 151 |
152 |
153 | 154 | * (required) 155 |
156 | 157 | 158 | 159 |   160 | 161 | 164 |
165 | 166 | 167 | 168 | 169 |
170 |
171 | 172 | * (required) 173 |
174 | 175 | 176 | 177 |   178 |
179 | 180 | 181 | 182 |
183 |
184 | 185 | * (required) 186 |
187 | 188 | 189 |

190 | You're using the Basic Uploader. You can try the Advanced Uploader if you have Flash 9 or greater and there are no ad-blocking plugins installed. 191 |

192 |
193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | {% endblock %} 204 | 205 | 206 | {% block extra_js %} 207 | 257 | {% endblock %} -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/fancybox/jquery.fancybox-1.3.1.css: -------------------------------------------------------------------------------- 1 | /* 2 | * FancyBox - jQuery Plugin 3 | * Simple and fancy lightbox alternative 4 | * 5 | * Examples and documentation at: http://fancybox.net 6 | * 7 | * Copyright (c) 2008 - 2010 Janis Skarnelis 8 | * 9 | * Version: 1.3.1 (05/03/2010) 10 | * Requires: jQuery v1.3+ 11 | * 12 | * Dual licensed under the MIT and GPL licenses: 13 | * http://www.opensource.org/licenses/mit-license.php 14 | * http://www.gnu.org/licenses/gpl.html 15 | */ 16 | 17 | #fancybox-loading { 18 | position: fixed; 19 | top: 50%; 20 | left: 50%; 21 | height: 40px; 22 | width: 40px; 23 | margin-top: -20px; 24 | margin-left: -20px; 25 | cursor: pointer; 26 | overflow: hidden; 27 | z-index: 1104; 28 | display: none; 29 | } 30 | 31 | * html #fancybox-loading { /* IE6 */ 32 | position: absolute; 33 | margin-top: 0; 34 | } 35 | 36 | #fancybox-loading div { 37 | position: absolute; 38 | top: 0; 39 | left: 0; 40 | width: 40px; 41 | height: 480px; 42 | background-image: url('fancybox.png'); 43 | } 44 | 45 | #fancybox-overlay { 46 | position: fixed; 47 | top: 0; 48 | left: 0; 49 | bottom: 0; 50 | right: 0; 51 | background: #000; 52 | z-index: 1100; 53 | display: none; 54 | } 55 | 56 | * html #fancybox-overlay { /* IE6 */ 57 | position: absolute; 58 | width: 100%; 59 | } 60 | 61 | #fancybox-tmp { 62 | padding: 0; 63 | margin: 0; 64 | border: 0; 65 | overflow: auto; 66 | display: none; 67 | } 68 | 69 | #fancybox-wrap { 70 | position: absolute; 71 | top: 0; 72 | left: 0; 73 | margin: 0; 74 | padding: 20px; 75 | z-index: 1101; 76 | display: none; 77 | } 78 | 79 | #fancybox-outer { 80 | position: relative; 81 | width: 100%; 82 | height: 100%; 83 | background: #FFF; 84 | } 85 | 86 | #fancybox-inner { 87 | position: absolute; 88 | top: 0; 89 | left: 0; 90 | width: 1px; 91 | height: 1px; 92 | padding: 0; 93 | margin: 0; 94 | outline: none; 95 | overflow: hidden; 96 | } 97 | 98 | #fancybox-hide-sel-frame { 99 | position: absolute; 100 | top: 0; 101 | left: 0; 102 | width: 100%; 103 | height: 100%; 104 | background: transparent; 105 | } 106 | 107 | #fancybox-close { 108 | position: absolute; 109 | top: -15px; 110 | right: -15px; 111 | width: 30px; 112 | height: 30px; 113 | background-image: url('fancybox.png'); 114 | background-position: -40px 0px; 115 | cursor: pointer; 116 | z-index: 1103; 117 | display: none; 118 | } 119 | 120 | #fancybox_error { 121 | color: #444; 122 | font: normal 12px/20px Arial; 123 | padding: 7px; 124 | margin: 0; 125 | } 126 | 127 | #fancybox-content { 128 | height: auto; 129 | width: auto; 130 | padding: 0; 131 | margin: 0; 132 | } 133 | 134 | #fancybox-img { 135 | width: 100%; 136 | height: 100%; 137 | padding: 0; 138 | margin: 0; 139 | border: none; 140 | outline: none; 141 | line-height: 0; 142 | vertical-align: top; 143 | -ms-interpolation-mode: bicubic; 144 | } 145 | 146 | #fancybox-frame { 147 | position: relative; 148 | width: 100%; 149 | height: 100%; 150 | border: none; 151 | display: block; 152 | } 153 | 154 | #fancybox-title { 155 | position: absolute; 156 | bottom: 0; 157 | left: 0; 158 | font-family: Arial; 159 | font-size: 12px; 160 | z-index: 1102; 161 | } 162 | 163 | .fancybox-title-inside { 164 | padding: 10px 0; 165 | text-align: center; 166 | color: #333; 167 | } 168 | 169 | .fancybox-title-outside { 170 | padding-top: 5px; 171 | color: #FFF; 172 | text-align: center; 173 | font-weight: bold; 174 | } 175 | 176 | .fancybox-title-over { 177 | color: #FFF; 178 | text-align: left; 179 | } 180 | 181 | #fancybox-title-over { 182 | padding: 10px; 183 | background-image: url('fancy_title_over.png'); 184 | display: block; 185 | } 186 | 187 | #fancybox-title-wrap { 188 | display: inline-block; 189 | } 190 | 191 | #fancybox-title-wrap span { 192 | height: 32px; 193 | float: left; 194 | } 195 | 196 | #fancybox-title-left { 197 | padding-left: 15px; 198 | background-image: url('fancybox.png'); 199 | background-position: -40px -90px; 200 | background-repeat: no-repeat; 201 | } 202 | 203 | #fancybox-title-main { 204 | font-weight: bold; 205 | line-height: 29px; 206 | background-image: url('fancybox-x.png'); 207 | background-position: 0px -40px; 208 | color: #FFF; 209 | } 210 | 211 | #fancybox-title-right { 212 | padding-left: 15px; 213 | background-image: url('fancybox.png'); 214 | background-position: -55px -90px; 215 | background-repeat: no-repeat; 216 | } 217 | 218 | #fancybox-left, #fancybox-right { 219 | position: absolute; 220 | bottom: 0px; 221 | height: 100%; 222 | width: 35%; 223 | cursor: pointer; 224 | outline: none; 225 | background-image: url('blank.gif'); 226 | z-index: 1102; 227 | display: none; 228 | } 229 | 230 | #fancybox-left { 231 | left: 0px; 232 | } 233 | 234 | #fancybox-right { 235 | right: 0px; 236 | } 237 | 238 | #fancybox-left-ico, #fancybox-right-ico { 239 | position: absolute; 240 | top: 50%; 241 | left: -9999px; 242 | width: 30px; 243 | height: 30px; 244 | margin-top: -15px; 245 | cursor: pointer; 246 | z-index: 1102; 247 | display: block; 248 | } 249 | 250 | #fancybox-left-ico { 251 | background-image: url('fancybox.png'); 252 | background-position: -40px -30px; 253 | } 254 | 255 | #fancybox-right-ico { 256 | background-image: url('fancybox.png'); 257 | background-position: -40px -60px; 258 | } 259 | 260 | #fancybox-left:hover, #fancybox-right:hover { 261 | visibility: visible; /* IE6 */ 262 | } 263 | 264 | #fancybox-left:hover span { 265 | left: 20px; 266 | } 267 | 268 | #fancybox-right:hover span { 269 | left: auto; 270 | right: 20px; 271 | } 272 | 273 | .fancy-bg { 274 | position: absolute; 275 | padding: 0; 276 | margin: 0; 277 | border: 0; 278 | width: 20px; 279 | height: 20px; 280 | z-index: 1001; 281 | } 282 | 283 | #fancy-bg-n { 284 | top: -20px; 285 | left: 0; 286 | width: 100%; 287 | background-image: url('fancybox-x.png'); 288 | } 289 | 290 | #fancy-bg-ne { 291 | top: -20px; 292 | right: -20px; 293 | background-image: url('fancybox.png'); 294 | background-position: -40px -162px; 295 | } 296 | 297 | #fancy-bg-e { 298 | top: 0; 299 | right: -20px; 300 | height: 100%; 301 | background-image: url('fancybox-y.png'); 302 | background-position: -20px 0px; 303 | } 304 | 305 | #fancy-bg-se { 306 | bottom: -20px; 307 | right: -20px; 308 | background-image: url('fancybox.png'); 309 | background-position: -40px -182px; 310 | } 311 | 312 | #fancy-bg-s { 313 | bottom: -20px; 314 | left: 0; 315 | width: 100%; 316 | background-image: url('fancybox-x.png'); 317 | background-position: 0px -20px; 318 | } 319 | 320 | #fancy-bg-sw { 321 | bottom: -20px; 322 | left: -20px; 323 | background-image: url('fancybox.png'); 324 | background-position: -40px -142px; 325 | } 326 | 327 | #fancy-bg-w { 328 | top: 0; 329 | left: -20px; 330 | height: 100%; 331 | background-image: url('fancybox-y.png'); 332 | } 333 | 334 | #fancy-bg-nw { 335 | top: -20px; 336 | left: -20px; 337 | background-image: url('fancybox.png'); 338 | background-position: -40px -122px; 339 | } 340 | 341 | /* IE */ 342 | 343 | #fancybox-loading.fancybox-ie div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } 344 | .fancybox-ie #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } 345 | 346 | .fancybox-ie #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } 347 | .fancybox-ie #fancybox-title-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } 348 | .fancybox-ie #fancybox-title-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } 349 | .fancybox-ie #fancybox-title-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } 350 | 351 | .fancybox-ie #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } 352 | .fancybox-ie #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } 353 | 354 | .fancybox-ie .fancy-bg { background: transparent !important; } 355 | 356 | .fancybox-ie #fancy-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } 357 | .fancybox-ie #fancy-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } 358 | .fancybox-ie #fancy-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } 359 | .fancybox-ie #fancy-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } 360 | .fancybox-ie #fancy-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } 361 | .fancybox-ie #fancy-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } 362 | .fancybox-ie #fancy-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } 363 | .fancybox-ie #fancy-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } 364 | -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.pagination.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Generic Pagination Navigation 3 | * 4 | * Copyright (c) 2009 Eric Garside (http://eric.garside.name) 5 | * Dual licensed under: 6 | * MIT: http://www.opensource.org/licenses/mit-license.php 7 | * GPLv3: http://www.opensource.org/licenses/gpl-3.0.html 8 | */ 9 | (function($){ 10 | 11 | // Shortcut for fetching the last element of an array without modifying it 12 | Array.prototype.last = function(){ return this[this.length-1] } 13 | 14 | /** Event Declarations **/ 15 | 16 | $('.ui-pagination-control') 17 | .live('disable', function(){ 18 | $(this).addClass('ui-state-disabled'); 19 | }) 20 | .live('enable', function(){ 21 | $(this).removeClass('ui-state-disabled'); 22 | }) 23 | .live('click', function(){ 24 | 25 | if ($(this).hasClass('ui-state-disabled')) return false; 26 | 27 | var el = $(this), 28 | group = el.parent().data('pagination-group'), 29 | data = $.pagination.groups[group]; 30 | 31 | switch (el.data('pagination-type')){ 32 | case 'first': data.current = 0; break; 33 | case 'last': data.current = data.pages; break; 34 | case 'next': data.current++; break; 35 | case 'previous': data.current--; break; 36 | default: data.current = el.data('pagination-type'); break; 37 | } 38 | 39 | paginationCleanup(data, group); 40 | 41 | return false; 42 | }) 43 | 44 | 45 | /** Plugin Options and Tracking **/ 46 | 47 | $.pagination = { 48 | defaults: { 49 | pages: 0, 50 | current: 0, 51 | text: { 52 | first: '<<', 53 | last: '>>', 54 | next: '>', 55 | previous: '<', 56 | spacer: '...' 57 | }, 58 | templates: { 59 | first: '', 60 | last: '', 61 | next: '', 62 | previous: '', 63 | number: '', 64 | spacer: '' 65 | }, 66 | numPaddingDigits: 0, 67 | maxDigits: 8 68 | }, 69 | groups: {} 70 | } 71 | 72 | /** jQuery Entry Point **/ 73 | 74 | $.fn.pagination = function(group, options, callback){ 75 | 76 | if ($.isFunction(options) && !callback){ callback = options; options = {} } 77 | 78 | switch (group){ 79 | // key, options, group 80 | case 'renumber': 81 | callback = callback||this.data('pagination-group'); 82 | var data = $.pagination.groups[callback]; 83 | $.extend(data, options); 84 | data.pages--; 85 | createInitialDigits(data, callback); 86 | break; 87 | 88 | // key, callback, group 89 | case 'callback': $.extend($.pagination.groups[callback||this.data('pagination-group')], {callback: options}); break; 90 | 91 | // key, options, group 92 | case 'force-change': 93 | callback = callback||this.data('pagination-group'); 94 | $.extend($.pagination.groups[callback], options); 95 | paginationCleanup($.pagination.groups[callback], callback); 96 | break; 97 | 98 | default: createPagination.call(this, group, options, callback); break; 99 | } 100 | 101 | return this; 102 | } 103 | 104 | /** Internals **/ 105 | 106 | function createPagination(group, options, callback){ 107 | if (typeof callback != 'function') callback = function(){} // Create a dummy function 108 | 109 | options = $.extend(true, {}, $.pagination.defaults, options); 110 | 111 | var data = $.pagination.groups[group] = { 112 | current: options.current, 113 | pages: options.pages-1, 114 | callback: callback, 115 | incrementers: [], 116 | decrementers: [], 117 | allDigits: [], 118 | frontDigits: [], 119 | rearDigits: [], 120 | digits: [], 121 | frontSpacers: [], 122 | rearSpacers: [], 123 | thresholdLow: 0, 124 | thresholdHigh: options.pages-1 125 | }; 126 | 127 | // Correct maxDigits for the spacers 128 | options.maxDigits = options.maxDigits - (options.numPaddingDigits*2); 129 | 130 | this.each(function(){ 131 | var el = $(this), cDigit = 0; 132 | 133 | if (el.hasClass('ui-pagination')) return; 134 | 135 | el.addClass('ui-pagination').data('pagination-group', group); 136 | 137 | // Build the pagination from left to right 138 | var f = $(options.templates.first).data('pagination-type', 'first').text(options.text.first).appendTo(el), 139 | p = $(options.templates.previous).data('pagination-type', 'previous').text(options.text.previous).appendTo(el), 140 | n = $(options.templates.next).data('pagination-type', 'next').text(options.text.next), 141 | l = $(options.templates.last).data('pagination-type', 'last').text(options.text.last); 142 | 143 | if (options.numPaddingDigits){ 144 | for (var fp = 0; fp < options.numPaddingDigits; ++fp){ 145 | var pageNumber = $(options.templates.number).addClass('ui-pagination-anchor').appendTo(el); 146 | 147 | if (!data.allDigits[cDigit]) data.allDigits[cDigit] = []; 148 | data.allDigits[cDigit].push(pageNumber); 149 | 150 | if (!data.frontDigits[fp]) data.frontDigits[fp] = []; 151 | data.frontDigits[fp].push(pageNumber); 152 | 153 | cDigit++; 154 | } 155 | } 156 | 157 | data.frontSpacers.push($(options.templates.spacer).text(options.text.spacer).hide().appendTo(el)); 158 | 159 | if (options.maxDigits) 160 | for (var i = 0; i < options.maxDigits; ++i){ 161 | var pageNumber = $(options.templates.number).appendTo(el); 162 | 163 | if (!data.allDigits[cDigit]) data.allDigits[cDigit] = []; 164 | data.allDigits[cDigit].push(pageNumber); 165 | 166 | if (!data.digits[i]) data.digits[i] = []; 167 | data.digits[i].push(pageNumber); 168 | 169 | cDigit++; 170 | } 171 | 172 | data.rearSpacers.push($(options.templates.spacer).text(options.text.spacer).hide().appendTo(el)); 173 | 174 | if (options.numPaddingDigits){ 175 | for (var rp = options.numPaddingDigits-1; rp >= 0; --rp){ 176 | var pageNumber = $(options.templates.number).addClass('ui-pagination-anchor').appendTo(el); 177 | 178 | if (!data.allDigits[cDigit]) data.allDigits[cDigit] = []; 179 | data.allDigits[cDigit].push(pageNumber); 180 | 181 | if (!data.rearDigits[rp]) data.rearDigits[rp] = []; 182 | data.rearDigits[rp].push(pageNumber); 183 | 184 | cDigit++; 185 | } 186 | } 187 | 188 | // Store references to our dec/incrementers 189 | data.decrementers.push(f,p); 190 | data.incrementers.push(n.appendTo(el),l.appendTo(el)); 191 | }) 192 | 193 | if (data.pages > 0) 194 | createInitialDigits(data, group); 195 | } 196 | 197 | // Forces the current page to be within the page bounds 198 | function correctCurrent(data){ 199 | var current = data.current*1, 200 | dPages = (data.pages*1); 201 | 202 | if (dPages < 0){ dPages = 0; data.pages = 0 } 203 | 204 | if (current > dPages) data.current = dPages; 205 | else if (current < 0) data.current = 0; 206 | } 207 | 208 | // Create the visible numbers and spanners as we navigate through 209 | function createInitialDigits(data, group){ 210 | var pages = data.pages+1, 211 | rearPages = pages, 212 | current = 0; 213 | 214 | // Create the front anchor pages 215 | $.each(data.frontDigits, function(k){ 216 | $.each(this, function(){ if (pages) this.data('pagination-type', current).text(current+1).show(); else this.hide() }) 217 | current++; 218 | if (pages) pages--; 219 | }) 220 | 221 | data.thresholdLow = current; 222 | 223 | // Create the rear pages 224 | $.each(data.rearDigits, function(k){ 225 | $.each(this, function(){ if (pages) this.data('pagination-type', rearPages-1).text(rearPages).show(); else this.hide() }) 226 | rearPages--; 227 | if (pages) pages--; 228 | }) 229 | 230 | data.thresholdHigh = rearPages-1; 231 | 232 | // Create any remainder pages 233 | $.each(data.digits, function(k){ 234 | $.each(this, function(){ if (pages) this.data('pagination-type', current).text(current+1).show(); else this.hide() }) 235 | current++; 236 | if (pages) pages--; 237 | }) 238 | 239 | paginationCleanup(data, group); 240 | } 241 | 242 | // Applys opacity, disables invalid controls, formats numbers 243 | function paginationCleanup(data, group){ 244 | correctCurrent(data); 245 | 246 | var current = data.current*1, 247 | next = current+1, 248 | prev = current-1, 249 | max = data.pages*1, 250 | containers = data.digits.length-1, 251 | last = max < containers ? max : containers, 252 | lowBounding = data.frontDigits.length ? data.frontDigits.last()[0].data('pagination-type')*1 : -1, 253 | highBounding = data.rearDigits.length ? data.rearDigits.last()[0].data('pagination-type')*1 : max+1, 254 | lowDisplay = data.digits[0][0].data('pagination-type')*1||0; 255 | highDisplay = data.digits[last][0].data('pagination-type')*1||max; 256 | 257 | // Correct our pages 258 | if (prev < 0) prev = 0; 259 | if (next > max) next = max; 260 | 261 | // Fall-thru calculation for visible digits 262 | if (current >= highBounding) renumberDigits( data, highBounding - containers -1 ); 263 | else if (current <= lowBounding) renumberDigits( data, lowBounding+1 ); 264 | else if (prev > lowBounding && prev < lowDisplay) renumberDigits( data, prev ); 265 | else if (next < highBounding && next > highDisplay) renumberDigits( data, next-containers ); 266 | 267 | // Rebuild the indexs 268 | lowDisplay = data.digits[0][0].data('pagination-type')*1; 269 | highDisplay = data.digits[last][0].data('pagination-type')*1; 270 | 271 | // Display/hide the spacers 272 | if (lowDisplay > data.thresholdLow) manageSpacers(data, 'front', 'show'); 273 | else manageSpacers(data, 'front', 'hide'); 274 | 275 | if (highDisplay < data.thresholdHigh) manageSpacers(data, 'rear', 'show'); 276 | else manageSpacers(data, 'rear', 'hide'); 277 | 278 | // Manage the digits 279 | $.each(data.allDigits, function(){ 280 | var mode = this[0].data('pagination-type') == data.current ? 'disable' : 'enable'; 281 | $.each(this, function(){ this.trigger(mode) }) 282 | if (mode == 'disable') hasDisplayed = true; 283 | }) 284 | 285 | // Manage the inc/decrementers 286 | $.each(data.decrementers, function(){ $(this).trigger( current == 0 ? 'disable' : 'enable' ) }); 287 | $.each(data.incrementers, function(){ $(this).trigger( current == max ? 'disable' : 'enable' ) }); 288 | 289 | // Fire the user callback 290 | data.callback.call(data.current, [group]); 291 | } 292 | 293 | // Used to quickly renumber the core digits 294 | function renumberDigits(data, start){ 295 | $.each(data.digits, function(){ 296 | $.each(this, function(){ this.data('pagination-type', start).text(start+1) }) 297 | start++; 298 | }) 299 | } 300 | 301 | function manageSpacers(data, type, act){ 302 | $.each(data[type +'Spacers'], function(){ 303 | if (act == 'show') { 304 | this.css('display', 'inline'); 305 | } else { 306 | this.css('display', 'none'); 307 | } 308 | }); 309 | } 310 | 311 | })(jQuery); -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.tablesorter.min.js: -------------------------------------------------------------------------------- 1 | (function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;ib)?1:0));};function sortTextDesc(a,b){return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('

The requested content cannot be loaded.
Please try again later.

',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}, 18 | K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r; 19 | w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return''+ 20 | a+"";default:return''+a+''}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('
').css({width:d,paddingLeft:c.padding, 21 | paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode== 22 | 37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a= 23 | j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb", 24 | b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+ 25 | "px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding- 26 | 20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}); 27 | x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding* 28 | 2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity= 29 | 0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("").attr({id:"fancybox-img", 30 | src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f= 31 | "image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false; 32 | return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity(); 33 | s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='';w="";b.each(e.swf,function(r,R){t+='';w+=" "+r+'="'+R+'"'});t+='";m.html(t); 34 | F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div", 35 | u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
'),u=b('
'),x=b('
'),g=b('
'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('
').append('
').appendTo(g); 36 | D.append(i=b('
'),z=b(''),A=b(''),B=b(''));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height", 37 | "document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('')}}}; 38 | b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;fq.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n- 40 | 1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false} 41 | if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut, 42 | step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("
").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+ 43 | d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast", 44 | easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery); -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.jcarousellite-1.0.1.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget. 3 | * @requires jQuery v1.2 or above 4 | * 5 | * http://gmarwaha.com/jquery/jcarousellite/ 6 | * 7 | * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com) 8 | * Dual licensed under the MIT and GPL licenses: 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * http://www.gnu.org/licenses/gpl.html 11 | * 12 | * Version: 1.0.1 13 | * Note: Requires jquery 1.2 or above from version 1.0.1 14 | */ 15 | 16 | /** 17 | * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup. 18 | * 19 | * The HTML markup that is used to build the carousel can be as simple as... 20 | * 21 | * 28 | * 29 | * As you can see, this snippet is nothing but a simple div containing an unordered list of images. 30 | * You don't need any special "class" attribute, or a special "css" file for this plugin. 31 | * I am using a class attribute just for the sake of explanation here. 32 | * 33 | * To navigate the elements of the carousel, you need some kind of navigation buttons. 34 | * For example, you will need a "previous" button to go backward, and a "next" button to go forward. 35 | * This need not be part of the carousel "div" itself. It can be any element in your page. 36 | * Lets assume that the following elements in your document can be used as next, and prev buttons... 37 | * 38 | * 39 | * 40 | * 41 | * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the 42 | * navigation buttons as options. 43 | * 44 | * $(".carousel").jCarouselLite({ 45 | * btnNext: ".next", 46 | * btnPrev: ".prev" 47 | * }); 48 | * 49 | * That's it, you would have now converted your raw div, into a magnificient carousel. 50 | * 51 | * There are quite a few other options that you can use to customize it though. 52 | * Each will be explained with an example below. 53 | * 54 | * @param an options object - You can specify all the options shown below as an options object param. 55 | * 56 | * @option btnPrev, btnNext : string - no defaults 57 | * @example 58 | * $(".carousel").jCarouselLite({ 59 | * btnNext: ".next", 60 | * btnPrev: ".prev" 61 | * }); 62 | * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward. 63 | * 64 | * @option btnGo - array - no defaults 65 | * @example 66 | * $(".carousel").jCarouselLite({ 67 | * btnNext: ".next", 68 | * btnPrev: ".prev", 69 | * btnGo: [".0", ".1", ".2"] 70 | * }); 71 | * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on 72 | * the item number within the carousel, you can use this option. Just supply an array of selectors for each element 73 | * in the carousel. The index of the array represents the index of the element. What i mean is, if the 74 | * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel 75 | * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed 76 | * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding 77 | * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin. 78 | * The best part is that, the tab will "slide" based on the provided effect. :-) 79 | * 80 | * @option mouseWheel : boolean - default is false 81 | * @example 82 | * $(".carousel").jCarouselLite({ 83 | * mouseWheel: true 84 | * }); 85 | * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons. 86 | * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon. 87 | * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel 88 | * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation 89 | * as well. They complement each other. To use both together, just supply the options required for both as shown below. 90 | * @example 91 | * $(".carousel").jCarouselLite({ 92 | * btnNext: ".next", 93 | * btnPrev: ".prev", 94 | * mouseWheel: true 95 | * }); 96 | * 97 | * @option auto : number - default is null, meaning autoscroll is disabled by default 98 | * @example 99 | * $(".carousel").jCarouselLite({ 100 | * auto: 800, 101 | * speed: 500 102 | * }); 103 | * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option. 104 | * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling. 105 | * Specify this value and magically your carousel will start auto scrolling. 106 | * 107 | * @option speed : number - 200 is default 108 | * @example 109 | * $(".carousel").jCarouselLite({ 110 | * btnNext: ".next", 111 | * btnPrev: ".prev", 112 | * speed: 800 113 | * }); 114 | * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with 115 | * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect. 116 | * 117 | * @option easing : string - no easing effects by default. 118 | * @example 119 | * $(".carousel").jCarouselLite({ 120 | * btnNext: ".next", 121 | * btnPrev: ".prev", 122 | * easing: "bounceout" 123 | * }); 124 | * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified, 125 | * the carousel will slide based on the provided easing effect. 126 | * 127 | * @option vertical : boolean - default is false 128 | * @example 129 | * $(".carousel").jCarouselLite({ 130 | * btnNext: ".next", 131 | * btnPrev: ".prev", 132 | * vertical: true 133 | * }); 134 | * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and 135 | * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will 136 | * display horizontally. The next and prev items will slide the items from left-right in this case. 137 | * 138 | * @option circular : boolean - default is true 139 | * @example 140 | * $(".carousel").jCarouselLite({ 141 | * btnNext: ".next", 142 | * btnPrev: ".prev", 143 | * circular: false 144 | * }); 145 | * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last 146 | * element, you will automatically slide to the first element and vice versa. If you set circular to false, then 147 | * if you click on the "next" button after you reach the last element, you will stay in the last element itself 148 | * and similarly for "previous" button and first element. 149 | * 150 | * @option visible : number - default is 3 151 | * @example 152 | * $(".carousel").jCarouselLite({ 153 | * btnNext: ".next", 154 | * btnPrev: ".prev", 155 | * visible: 4 156 | * }); 157 | * @desc This specifies the number of items visible at all times within the carousel. The default is 3. 158 | * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the 159 | * last item half visible. This gives you the effect of showing the user that there are more images to the right. 160 | * 161 | * @option start : number - default is 0 162 | * @example 163 | * $(".carousel").jCarouselLite({ 164 | * btnNext: ".next", 165 | * btnPrev: ".prev", 166 | * start: 2 167 | * }); 168 | * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel 169 | * has a start of 0, and so on. 170 | * 171 | * @option scrool : number - default is 1 172 | * @example 173 | * $(".carousel").jCarouselLite({ 174 | * btnNext: ".next", 175 | * btnPrev: ".prev", 176 | * scroll: 2 177 | * }); 178 | * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By 179 | * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll 180 | * 2 items when you click the next or previous buttons. 181 | * 182 | * @option beforeStart, afterEnd : function - callbacks 183 | * @example 184 | * $(".carousel").jCarouselLite({ 185 | * btnNext: ".next", 186 | * btnPrev: ".prev", 187 | * beforeStart: function(a) { 188 | * alert("Before animation starts:" + a); 189 | * }, 190 | * afterEnd: function(a) { 191 | * alert("After animation ends:" + a); 192 | * } 193 | * }); 194 | * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can 195 | * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that 196 | * are visible at the time of callback. 197 | * 198 | * 199 | * @cat Plugins/Image Gallery 200 | * @author Ganeshji Marwaha/ganeshread@gmail.com 201 | */ 202 | 203 | (function($) { // Compliant with jquery.noConflict() 204 | $.fn.jCarouselLite = function(o) { 205 | o = $.extend({ 206 | btnPrev: null, 207 | btnNext: null, 208 | btnGo: null, 209 | mouseWheel: false, 210 | auto: null, 211 | 212 | speed: 200, 213 | easing: null, 214 | 215 | vertical: false, 216 | circular: true, 217 | visible: 3, 218 | start: 0, 219 | scroll: 1, 220 | 221 | beforeStart: null, 222 | afterEnd: null 223 | }, o || {}); 224 | 225 | return this.each(function() { // Returns the element collection. Chainable. 226 | 227 | var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width"; 228 | var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible; 229 | 230 | if(o.circular) { 231 | ul.prepend(tLi.slice(tl-v-1+1).clone()) 232 | .append(tLi.slice(0,v).clone()); 233 | o.start += v; 234 | } 235 | 236 | var li = $("li", ul), itemLength = li.size(), curr = o.start; 237 | div.css("visibility", "visible"); 238 | 239 | li.css({overflow: "hidden", float: o.vertical ? "none" : "left"}); 240 | ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); 241 | div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); 242 | 243 | var liSize = o.vertical ? height(li) : width(li); // Full li size(incl margin)-Used for animation 244 | var ulSize = liSize * itemLength; // size of full ul(total length, not just for the visible items) 245 | var divSize = liSize * v; // size of entire div(total length for just the visible items) 246 | 247 | li.css({width: li.width(), height: li.height()}); 248 | ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize)); 249 | 250 | div.css(sizeCss, divSize+"px"); // Width of the DIV. length of visible images 251 | 252 | if(o.btnPrev) 253 | $(o.btnPrev).click(function() { 254 | return go(curr-o.scroll); 255 | }); 256 | 257 | if(o.btnNext) 258 | $(o.btnNext).click(function() { 259 | return go(curr+o.scroll); 260 | }); 261 | 262 | if(o.btnGo) 263 | $.each(o.btnGo, function(i, val) { 264 | $(val).click(function() { 265 | return go(o.circular ? o.visible+i : i); 266 | }); 267 | }); 268 | 269 | if(o.mouseWheel && div.mousewheel) 270 | div.mousewheel(function(e, d) { 271 | return d>0 ? go(curr-o.scroll) : go(curr+o.scroll); 272 | }); 273 | 274 | if(o.auto) 275 | setInterval(function() { 276 | go(curr+o.scroll); 277 | }, o.auto+o.speed); 278 | 279 | function vis() { 280 | return li.slice(curr).slice(0,v); 281 | }; 282 | 283 | function go(to) { 284 | if(!running) { 285 | 286 | if(o.beforeStart) 287 | o.beforeStart.call(this, vis()); 288 | 289 | if(o.circular) { // If circular we are in first or last, then goto the other end 290 | if(to<=o.start-v-1) { // If first, then goto last 291 | ul.css(animCss, -((itemLength-(v*2))*liSize)+"px"); 292 | // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. 293 | curr = to==o.start-v-1 ? itemLength-(v*2)-1 : itemLength-(v*2)-o.scroll; 294 | } else if(to>=itemLength-v+1) { // If last, then goto first 295 | ul.css(animCss, -( (v) * liSize ) + "px" ); 296 | // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. 297 | curr = to==itemLength-v+1 ? v+1 : v+o.scroll; 298 | } else curr = to; 299 | } else { // If non-circular and to points to first or last, we just return. 300 | if(to<0 || to>itemLength-v) return; 301 | else curr = to; 302 | } // If neither overrides it, the curr will still be "to" and we can proceed. 303 | 304 | running = true; 305 | 306 | ul.animate( 307 | animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing, 308 | function() { 309 | if(o.afterEnd) 310 | o.afterEnd.call(this, vis()); 311 | running = false; 312 | } 313 | ); 314 | // Disable buttons when the carousel reaches the last/first, and enable when not 315 | if(!o.circular) { 316 | $(o.btnPrev + "," + o.btnNext).removeClass("disabled"); 317 | $( (curr-o.scroll<0 && o.btnPrev) 318 | || 319 | (curr+o.scroll > itemLength-v && o.btnNext) 320 | || 321 | [] 322 | ).addClass("disabled"); 323 | } 324 | 325 | } 326 | return false; 327 | }; 328 | }); 329 | }; 330 | 331 | function css(el, prop) { 332 | return parseInt($.css(el[0], prop)) || 0; 333 | }; 334 | function width(el) { 335 | return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); 336 | }; 337 | function height(el) { 338 | return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); 339 | }; 340 | 341 | })(jQuery); -------------------------------------------------------------------------------- /mineral/static/mineral/js/libs/json2.js: -------------------------------------------------------------------------------- 1 | /* 2 | http://www.JSON.org/json2.js 3 | 2008-07-15 4 | 5 | Public Domain. 6 | 7 | NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. 8 | 9 | See http://www.JSON.org/js.html 10 | 11 | This file creates a global JSON object containing two methods: stringify 12 | and parse. 13 | 14 | JSON.stringify(value, replacer, space) 15 | value any JavaScript value, usually an object or array. 16 | 17 | replacer an optional parameter that determines how object 18 | values are stringified for objects. It can be a 19 | function or an array. 20 | 21 | space an optional parameter that specifies the indentation 22 | of nested structures. If it is omitted, the text will 23 | be packed without extra whitespace. If it is a number, 24 | it will specify the number of spaces to indent at each 25 | level. If it is a string (such as '\t' or ' '), 26 | it contains the characters used to indent at each level. 27 | 28 | This method produces a JSON text from a JavaScript value. 29 | 30 | When an object value is found, if the object contains a toJSON 31 | method, its toJSON method will be called and the result will be 32 | stringified. A toJSON method does not serialize: it returns the 33 | value represented by the name/value pair that should be serialized, 34 | or undefined if nothing should be serialized. The toJSON method 35 | will be passed the key associated with the value, and this will be 36 | bound to the object holding the key. 37 | 38 | For example, this would serialize Dates as ISO strings. 39 | 40 | Date.prototype.toJSON = function (key) { 41 | function f(n) { 42 | // Format integers to have at least two digits. 43 | return n < 10 ? '0' + n : n; 44 | } 45 | 46 | return this.getUTCFullYear() + '-' + 47 | f(this.getUTCMonth() + 1) + '-' + 48 | f(this.getUTCDate()) + 'T' + 49 | f(this.getUTCHours()) + ':' + 50 | f(this.getUTCMinutes()) + ':' + 51 | f(this.getUTCSeconds()) + 'Z'; 52 | }; 53 | 54 | You can provide an optional replacer method. It will be passed the 55 | key and value of each member, with this bound to the containing 56 | object. The value that is returned from your method will be 57 | serialized. If your method returns undefined, then the member will 58 | be excluded from the serialization. 59 | 60 | If the replacer parameter is an array, then it will be used to 61 | select the members to be serialized. It filters the results such 62 | that only members with keys listed in the replacer array are 63 | stringified. 64 | 65 | Values that do not have JSON representations, such as undefined or 66 | functions, will not be serialized. Such values in objects will be 67 | dropped; in arrays they will be replaced with null. You can use 68 | a replacer function to replace those with JSON values. 69 | JSON.stringify(undefined) returns undefined. 70 | 71 | The optional space parameter produces a stringification of the 72 | value that is filled with line breaks and indentation to make it 73 | easier to read. 74 | 75 | If the space parameter is a non-empty string, then that string will 76 | be used for indentation. If the space parameter is a number, then 77 | the indentation will be that many spaces. 78 | 79 | Example: 80 | 81 | text = JSON.stringify(['e', {pluribus: 'unum'}]); 82 | // text is '["e",{"pluribus":"unum"}]' 83 | 84 | 85 | text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); 86 | // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' 87 | 88 | text = JSON.stringify([new Date()], function (key, value) { 89 | return this[key] instanceof Date ? 90 | 'Date(' + this[key] + ')' : value; 91 | }); 92 | // text is '["Date(---current time---)"]' 93 | 94 | 95 | JSON.parse(text, reviver) 96 | This method parses a JSON text to produce an object or array. 97 | It can throw a SyntaxError exception. 98 | 99 | The optional reviver parameter is a function that can filter and 100 | transform the results. It receives each of the keys and values, 101 | and its return value is used instead of the original value. 102 | If it returns what it received, then the structure is not modified. 103 | If it returns undefined then the member is deleted. 104 | 105 | Example: 106 | 107 | // Parse the text. Values that look like ISO date strings will 108 | // be converted to Date objects. 109 | 110 | myData = JSON.parse(text, function (key, value) { 111 | var a; 112 | if (typeof value === 'string') { 113 | a = 114 | /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); 115 | if (a) { 116 | return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], 117 | +a[5], +a[6])); 118 | } 119 | } 120 | return value; 121 | }); 122 | 123 | myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { 124 | var d; 125 | if (typeof value === 'string' && 126 | value.slice(0, 5) === 'Date(' && 127 | value.slice(-1) === ')') { 128 | d = new Date(value.slice(5, -1)); 129 | if (d) { 130 | return d; 131 | } 132 | } 133 | return value; 134 | }); 135 | 136 | 137 | This is a reference implementation. You are free to copy, modify, or 138 | redistribute. 139 | 140 | This code should be minified before deployment. 141 | See http://javascript.crockford.com/jsmin.html 142 | 143 | USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO 144 | NOT CONTROL. 145 | */ 146 | 147 | /*jslint evil: true */ 148 | 149 | /*global JSON */ 150 | 151 | /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", call, 152 | charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, getUTCMinutes, 153 | getUTCMonth, getUTCSeconds, hasOwnProperty, join, lastIndex, length, 154 | parse, propertyIsEnumerable, prototype, push, replace, slice, stringify, 155 | test, toJSON, toString 156 | */ 157 | 158 | if (!this.JSON) { 159 | 160 | // Create a JSON object only if one does not already exist. We create the 161 | // object in a closure to avoid creating global variables. 162 | 163 | JSON = function () { 164 | 165 | function f(n) { 166 | // Format integers to have at least two digits. 167 | return n < 10 ? '0' + n : n; 168 | } 169 | 170 | Date.prototype.toJSON = function (key) { 171 | 172 | return this.getUTCFullYear() + '-' + 173 | f(this.getUTCMonth() + 1) + '-' + 174 | f(this.getUTCDate()) + 'T' + 175 | f(this.getUTCHours()) + ':' + 176 | f(this.getUTCMinutes()) + ':' + 177 | f(this.getUTCSeconds()) + 'Z'; 178 | }; 179 | 180 | String.prototype.toJSON = 181 | Number.prototype.toJSON = 182 | Boolean.prototype.toJSON = function (key) { 183 | return this.valueOf(); 184 | }; 185 | 186 | var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 187 | escapeable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 188 | gap, 189 | indent, 190 | meta = { // table of character substitutions 191 | '\b': '\\b', 192 | '\t': '\\t', 193 | '\n': '\\n', 194 | '\f': '\\f', 195 | '\r': '\\r', 196 | '"' : '\\"', 197 | '\\': '\\\\' 198 | }, 199 | rep; 200 | 201 | 202 | function quote(string) { 203 | 204 | // If the string contains no control characters, no quote characters, and no 205 | // backslash characters, then we can safely slap some quotes around it. 206 | // Otherwise we must also replace the offending characters with safe escape 207 | // sequences. 208 | 209 | escapeable.lastIndex = 0; 210 | return escapeable.test(string) ? 211 | '"' + string.replace(escapeable, function (a) { 212 | var c = meta[a]; 213 | if (typeof c === 'string') { 214 | return c; 215 | } 216 | return '\\u' + ('0000' + 217 | (+(a.charCodeAt(0))).toString(16)).slice(-4); 218 | }) + '"' : 219 | '"' + string + '"'; 220 | } 221 | 222 | 223 | function str(key, holder) { 224 | 225 | // Produce a string from holder[key]. 226 | 227 | var i, // The loop counter. 228 | k, // The member key. 229 | v, // The member value. 230 | length, 231 | mind = gap, 232 | partial, 233 | value = holder[key]; 234 | 235 | // If the value has a toJSON method, call it to obtain a replacement value. 236 | 237 | if (value && typeof value === 'object' && 238 | typeof value.toJSON === 'function') { 239 | value = value.toJSON(key); 240 | } 241 | 242 | // If we were called with a replacer function, then call the replacer to 243 | // obtain a replacement value. 244 | 245 | if (typeof rep === 'function') { 246 | value = rep.call(holder, key, value); 247 | } 248 | 249 | // What happens next depends on the value's type. 250 | 251 | switch (typeof value) { 252 | case 'string': 253 | return quote(value); 254 | 255 | case 'number': 256 | 257 | // JSON numbers must be finite. Encode non-finite numbers as null. 258 | 259 | return isFinite(value) ? String(value) : 'null'; 260 | 261 | case 'boolean': 262 | case 'null': 263 | 264 | // If the value is a boolean or null, convert it to a string. Note: 265 | // typeof null does not produce 'null'. The case is included here in 266 | // the remote chance that this gets fixed someday. 267 | 268 | return String(value); 269 | 270 | // If the type is 'object', we might be dealing with an object or an array or 271 | // null. 272 | 273 | case 'object': 274 | 275 | // Due to a specification blunder in ECMAScript, typeof null is 'object', 276 | // so watch out for that case. 277 | 278 | if (!value) { 279 | return 'null'; 280 | } 281 | 282 | // Make an array to hold the partial results of stringifying this object value. 283 | 284 | gap += indent; 285 | partial = []; 286 | 287 | // If the object has a dontEnum length property, we'll treat it as an array. 288 | 289 | if (typeof value.length === 'number' && 290 | !(value.propertyIsEnumerable('length'))) { 291 | 292 | // The object is an array. Stringify every element. Use null as a placeholder 293 | // for non-JSON values. 294 | 295 | length = value.length; 296 | for (i = 0; i < length; i += 1) { 297 | partial[i] = str(i, value) || 'null'; 298 | } 299 | 300 | // Join all of the elements together, separated with commas, and wrap them in 301 | // brackets. 302 | 303 | v = partial.length === 0 ? '[]' : 304 | gap ? '[\n' + gap + 305 | partial.join(',\n' + gap) + '\n' + 306 | mind + ']' : 307 | '[' + partial.join(',') + ']'; 308 | gap = mind; 309 | return v; 310 | } 311 | 312 | // If the replacer is an array, use it to select the members to be stringified. 313 | 314 | if (rep && typeof rep === 'object') { 315 | length = rep.length; 316 | for (i = 0; i < length; i += 1) { 317 | k = rep[i]; 318 | if (typeof k === 'string') { 319 | v = str(k, value); 320 | if (v) { 321 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 322 | } 323 | } 324 | } 325 | } else { 326 | 327 | // Otherwise, iterate through all of the keys in the object. 328 | 329 | for (k in value) { 330 | if (Object.hasOwnProperty.call(value, k)) { 331 | v = str(k, value); 332 | if (v) { 333 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 334 | } 335 | } 336 | } 337 | } 338 | 339 | // Join all of the member texts together, separated with commas, 340 | // and wrap them in braces. 341 | 342 | v = partial.length === 0 ? '{}' : 343 | gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + 344 | mind + '}' : '{' + partial.join(',') + '}'; 345 | gap = mind; 346 | return v; 347 | } 348 | } 349 | 350 | // Return the JSON object containing the stringify and parse methods. 351 | 352 | return { 353 | stringify: function (value, replacer, space) { 354 | 355 | // The stringify method takes a value and an optional replacer, and an optional 356 | // space parameter, and returns a JSON text. The replacer can be a function 357 | // that can replace values, or an array of strings that will select the keys. 358 | // A default replacer method can be provided. Use of the space parameter can 359 | // produce text that is more easily readable. 360 | 361 | var i; 362 | gap = ''; 363 | indent = ''; 364 | 365 | // If the space parameter is a number, make an indent string containing that 366 | // many spaces. 367 | 368 | if (typeof space === 'number') { 369 | for (i = 0; i < space; i += 1) { 370 | indent += ' '; 371 | } 372 | 373 | // If the space parameter is a string, it will be used as the indent string. 374 | 375 | } else if (typeof space === 'string') { 376 | indent = space; 377 | } 378 | 379 | // If there is a replacer, it must be a function or an array. 380 | // Otherwise, throw an error. 381 | 382 | rep = replacer; 383 | if (replacer && typeof replacer !== 'function' && 384 | (typeof replacer !== 'object' || 385 | typeof replacer.length !== 'number')) { 386 | throw new Error('JSON.stringify'); 387 | } 388 | 389 | // Make a fake root object containing our value under the key of ''. 390 | // Return the result of stringifying the value. 391 | 392 | return str('', {'': value}); 393 | }, 394 | 395 | 396 | parse: function (text, reviver) { 397 | 398 | // The parse method takes a text and an optional reviver function, and returns 399 | // a JavaScript value if the text is a valid JSON text. 400 | 401 | var j; 402 | 403 | function walk(holder, key) { 404 | 405 | // The walk method is used to recursively walk the resulting structure so 406 | // that modifications can be made. 407 | 408 | var k, v, value = holder[key]; 409 | if (value && typeof value === 'object') { 410 | for (k in value) { 411 | if (Object.hasOwnProperty.call(value, k)) { 412 | v = walk(value, k); 413 | if (v !== undefined) { 414 | value[k] = v; 415 | } else { 416 | delete value[k]; 417 | } 418 | } 419 | } 420 | } 421 | return reviver.call(holder, key, value); 422 | } 423 | 424 | 425 | // Parsing happens in four stages. In the first stage, we replace certain 426 | // Unicode characters with escape sequences. JavaScript handles many characters 427 | // incorrectly, either silently deleting them, or treating them as line endings. 428 | 429 | cx.lastIndex = 0; 430 | if (cx.test(text)) { 431 | text = text.replace(cx, function (a) { 432 | return '\\u' + ('0000' + 433 | (+(a.charCodeAt(0))).toString(16)).slice(-4); 434 | }); 435 | } 436 | 437 | // In the second stage, we run the text against regular expressions that look 438 | // for non-JSON patterns. We are especially concerned with '()' and 'new' 439 | // because they can cause invocation, and '=' because it can cause mutation. 440 | // But just to be safe, we want to reject all unexpected forms. 441 | 442 | // We split the second stage into 4 regexp operations in order to work around 443 | // crippling inefficiencies in IE's and Safari's regexp engines. First we 444 | // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we 445 | // replace all simple value tokens with ']' characters. Third, we delete all 446 | // open brackets that follow a colon or comma or that begin the text. Finally, 447 | // we look to see that the remaining characters are only whitespace or ']' or 448 | // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. 449 | 450 | if (/^[\],:{}\s]*$/. 451 | test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). 452 | replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). 453 | replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { 454 | 455 | // In the third stage we use the eval function to compile the text into a 456 | // JavaScript structure. The '{' operator is subject to a syntactic ambiguity 457 | // in JavaScript: it can begin a block or an object literal. We wrap the text 458 | // in parens to eliminate the ambiguity. 459 | 460 | j = eval('(' + text + ')'); 461 | 462 | // In the optional fourth stage, we recursively walk the new structure, passing 463 | // each name/value pair to a reviver function for possible transformation. 464 | 465 | return typeof reviver === 'function' ? 466 | walk({'': j}, '') : j; 467 | } 468 | 469 | // If the text is not JSON parseable, then a SyntaxError is thrown. 470 | 471 | throw new SyntaxError('JSON.parse'); 472 | } 473 | }; 474 | }(); 475 | } 476 | -------------------------------------------------------------------------------- /mineral/static/mineral/js/plugins/jquery.multifile.js: -------------------------------------------------------------------------------- 1 | /* 2 | ### jQuery Multiple File Upload Plugin v1.47 - 2010-03-26 ### 3 | * Home: http://www.fyneworks.com/jquery/multiple-file-upload/ 4 | * Code: http://code.google.com/p/jquery-multifile-plugin/ 5 | * 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl.html 9 | ### 10 | */ 11 | 12 | /*# AVOID COLLISIONS #*/ 13 | ;if(window.jQuery) (function($){ 14 | /*# AVOID COLLISIONS #*/ 15 | 16 | // plugin initialization 17 | $.fn.MultiFile = function(options){ 18 | if(this.length==0) return this; // quick fail 19 | 20 | // Handle API methods 21 | if(typeof arguments[0]=='string'){ 22 | // Perform API methods on individual elements 23 | if(this.length>1){ 24 | var args = arguments; 25 | return this.each(function(){ 26 | $.fn.MultiFile.apply($(this), args); 27 | }); 28 | }; 29 | // Invoke API method handler 30 | $.fn.MultiFile[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []); 31 | // Quick exit... 32 | return this; 33 | }; 34 | 35 | // Initialize options for this call 36 | var options = $.extend( 37 | {}/* new object */, 38 | $.fn.MultiFile.options/* default options */, 39 | options || {} /* just-in-time options */ 40 | ); 41 | 42 | // Empty Element Fix!!! 43 | // this code will automatically intercept native form submissions 44 | // and disable empty file elements 45 | $('form') 46 | .not('MultiFile-intercepted') 47 | .addClass('MultiFile-intercepted') 48 | .submit($.fn.MultiFile.disableEmpty); 49 | 50 | //### http://plugins.jquery.com/node/1363 51 | // utility method to integrate this plugin with others... 52 | if($.fn.MultiFile.options.autoIntercept){ 53 | $.fn.MultiFile.intercept( $.fn.MultiFile.options.autoIntercept /* array of methods to intercept */ ); 54 | $.fn.MultiFile.options.autoIntercept = null; /* only run this once */ 55 | }; 56 | 57 | // loop through each matched element 58 | this 59 | .not('.MultiFile-applied') 60 | .addClass('MultiFile-applied') 61 | .each(function(){ 62 | //##################################################################### 63 | // MAIN PLUGIN FUNCTIONALITY - START 64 | //##################################################################### 65 | 66 | // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251 67 | // variable group_count would repeat itself on multiple calls to the plugin. 68 | // this would cause a conflict with multiple elements 69 | // changes scope of variable to global so id will be unique over n calls 70 | window.MultiFile = (window.MultiFile || 0) + 1; 71 | var group_count = window.MultiFile; 72 | 73 | // Copy parent attributes - Thanks to Jonas Wagner 74 | // we will use this one to create new input elements 75 | var MultiFile = {e:this, E:$(this), clone:$(this).clone()}; 76 | 77 | //=== 78 | 79 | //# USE CONFIGURATION 80 | if(typeof options=='number') options = {max:options}; 81 | var o = $.extend({}, 82 | $.fn.MultiFile.options, 83 | options || {}, 84 | ($.metadata? MultiFile.E.metadata(): ($.meta?MultiFile.E.data():null)) || {}, /* metadata options */ 85 | {} /* internals */ 86 | ); 87 | // limit number of files that can be selected? 88 | if(!(o.max>0) /*IsNull(MultiFile.max)*/){ 89 | o.max = MultiFile.E.attr('maxlength'); 90 | if(!(o.max>0) /*IsNull(MultiFile.max)*/){ 91 | o.max = (String(MultiFile.e.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0]; 92 | if(!(o.max>0)) o.max = -1; 93 | else o.max = String(o.max).match(/[0-9]+/gi)[0]; 94 | } 95 | }; 96 | o.max = new Number(o.max); 97 | // limit extensions? 98 | o.accept = o.accept || MultiFile.E.attr('accept') || ''; 99 | if(!o.accept){ 100 | o.accept = (MultiFile.e.className.match(/\b(accept\-[\w\|]+)\b/gi)) || ''; 101 | o.accept = new String(o.accept).replace(/^(accept|ext)\-/i,''); 102 | }; 103 | 104 | //=== 105 | 106 | // APPLY CONFIGURATION 107 | $.extend(MultiFile, o || {}); 108 | MultiFile.STRING = $.extend({},$.fn.MultiFile.options.STRING,MultiFile.STRING); 109 | 110 | //=== 111 | 112 | //######################################### 113 | // PRIVATE PROPERTIES/METHODS 114 | $.extend(MultiFile, { 115 | n: 0, // How many elements are currently selected? 116 | slaves: [], files: [], 117 | instanceKey: MultiFile.e.id || 'MultiFile'+String(group_count), // Instance Key? 118 | generateID: function(z){ return MultiFile.instanceKey + (z>0 ?'_F'+String(z):''); }, 119 | trigger: function(event, element){ 120 | var handler = MultiFile[event], value = $(element).attr('value'); 121 | if(handler){ 122 | var returnValue = handler(element, value, MultiFile); 123 | if( returnValue!=null ) return returnValue; 124 | } 125 | return true; 126 | } 127 | }); 128 | 129 | //=== 130 | 131 | // Setup dynamic regular expression for extension validation 132 | // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/ 133 | if(String(MultiFile.accept).length>1){ 134 | MultiFile.accept = MultiFile.accept.replace(/\W+/g,'|').replace(/^\W|\W$/g,''); 135 | MultiFile.rxAccept = new RegExp('\\.('+(MultiFile.accept?MultiFile.accept:'')+')$','gi'); 136 | }; 137 | 138 | //=== 139 | 140 | // Create wrapper to hold our file list 141 | MultiFile.wrapID = MultiFile.instanceKey+'_wrap'; // Wrapper ID? 142 | MultiFile.E.wrap('
'); 143 | MultiFile.wrapper = $('#'+MultiFile.wrapID+''); 144 | 145 | //=== 146 | 147 | // MultiFile MUST have a name - default: file1[], file2[], file3[] 148 | MultiFile.e.name = MultiFile.e.name || 'file'+ group_count +'[]'; 149 | 150 | //=== 151 | 152 | if(!MultiFile.list){ 153 | // Create a wrapper for the list 154 | // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('list' is a read-only property) 155 | // this change allows us to keep the files in the order they were selected 156 | MultiFile.wrapper.append( '
' ); 157 | MultiFile.list = $('#'+MultiFile.wrapID+'_list'); 158 | }; 159 | MultiFile.list = $(MultiFile.list); 160 | 161 | //=== 162 | 163 | // Bind a new element 164 | MultiFile.addSlave = function( slave, slave_count ){ 165 | //if(window.console) console.log('MultiFile.addSlave',slave_count); 166 | 167 | // Keep track of how many elements have been displayed 168 | MultiFile.n++; 169 | // Add reference to master element 170 | slave.MultiFile = MultiFile; 171 | 172 | // BUG FIX: http://plugins.jquery.com/node/1495 173 | // Clear identifying properties from clones 174 | if(slave_count>0) slave.id = slave.name = ''; 175 | 176 | // Define element's ID and name (upload components need this!) 177 | //slave.id = slave.id || MultiFile.generateID(slave_count); 178 | if(slave_count>0) slave.id = MultiFile.generateID(slave_count); 179 | //FIX for: http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=23 180 | 181 | // 2008-Apr-29: New customizable naming convention (see url below) 182 | // http://groups.google.com/group/jquery-dev/browse_frm/thread/765c73e41b34f924# 183 | slave.name = String(MultiFile.namePattern 184 | /*master name*/.replace(/\$name/gi,$(MultiFile.clone).attr('name')) 185 | /*master id */.replace(/\$id/gi, $(MultiFile.clone).attr('id')) 186 | /*group count*/.replace(/\$g/gi, group_count)//(group_count>0?group_count:'')) 187 | /*slave count*/.replace(/\$i/gi, slave_count)//(slave_count>0?slave_count:'')) 188 | ); 189 | 190 | // If we've reached maximum number, disable input slave 191 | if( (MultiFile.max > 0) && ((MultiFile.n-1) > (MultiFile.max)) )//{ // MultiFile.n Starts at 1, so subtract 1 to find true count 192 | slave.disabled = true; 193 | //}; 194 | 195 | // Remember most recent slave 196 | MultiFile.current = MultiFile.slaves[slave_count] = slave; 197 | 198 | // We'll use jQuery from now on 199 | slave = $(slave); 200 | 201 | // Clear value 202 | slave.val('').attr('value','')[0].value = ''; 203 | 204 | // Stop plugin initializing on slaves 205 | slave.addClass('MultiFile-applied'); 206 | 207 | // Triggered when a file is selected 208 | slave.change(function(){ 209 | //if(window.console) console.log('MultiFile.slave.change',slave_count); 210 | 211 | // Lose focus to stop IE7 firing onchange again 212 | $(this).blur(); 213 | 214 | //# Trigger Event! onFileSelect 215 | if(!MultiFile.trigger('onFileSelect', this, MultiFile)) return false; 216 | //# End Event! 217 | 218 | //# Retrive value of selected file from element 219 | var ERROR = '', v = String(this.value || ''/*.attr('value)*/); 220 | 221 | // check extension 222 | if(MultiFile.accept && v && !v.match(MultiFile.rxAccept))//{ 223 | ERROR = MultiFile.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi))); 224 | //} 225 | //}; 226 | 227 | // Disallow duplicates 228 | for(var f in MultiFile.slaves)//{ 229 | if(MultiFile.slaves[f] && MultiFile.slaves[f]!=this)//{ 230 | //console.log(MultiFile.slaves[f],MultiFile.slaves[f].value); 231 | if(MultiFile.slaves[f].value==v)//{ 232 | ERROR = MultiFile.STRING.duplicate.replace('$file', v.match(/[^\/\\]+$/gi)); 233 | //}; 234 | //}; 235 | //}; 236 | 237 | // Create a new file input element 238 | var newEle = $(MultiFile.clone).clone();// Copy parent attributes - Thanks to Jonas Wagner 239 | //# Let's remember which input we've generated so 240 | // we can disable the empty ones before submission 241 | // See: http://plugins.jquery.com/node/1495 242 | newEle.addClass('MultiFile'); 243 | 244 | // Handle error 245 | if(ERROR!=''){ 246 | // Handle error 247 | MultiFile.error(ERROR); 248 | 249 | // 2007-06-24: BUG FIX - Thanks to Adrian Wróbel 250 | // Ditch the trouble maker and add a fresh new element 251 | MultiFile.n--; 252 | MultiFile.addSlave(newEle[0], slave_count); 253 | slave.parent().prepend(newEle); 254 | slave.remove(); 255 | return false; 256 | }; 257 | 258 | // Hide this element (NB: display:none is evil!) 259 | $(this).css({ position:'absolute', top: '-3000px' }); 260 | 261 | // Add new element to the form 262 | slave.after(newEle); 263 | 264 | // Update list 265 | MultiFile.addToList( this, slave_count ); 266 | 267 | // Bind functionality 268 | MultiFile.addSlave( newEle[0], slave_count+1 ); 269 | 270 | //# Trigger Event! afterFileSelect 271 | if(!MultiFile.trigger('afterFileSelect', this, MultiFile)) return false; 272 | //# End Event! 273 | 274 | }); // slave.change() 275 | 276 | // Save control to element 277 | $(slave).data('MultiFile', MultiFile); 278 | 279 | };// MultiFile.addSlave 280 | // Bind a new element 281 | 282 | 283 | 284 | // Add a new file to the list 285 | MultiFile.addToList = function( slave, slave_count ){ 286 | //if(window.console) console.log('MultiFile.addToList',slave_count); 287 | 288 | //# Trigger Event! onFileAppend 289 | if(!MultiFile.trigger('onFileAppend', slave, MultiFile)) return false; 290 | //# End Event! 291 | 292 | // Create label elements 293 | var 294 | r = $('
'), 295 | v = String(slave.value || ''/*.attr('value)*/), 296 | a = $(''+MultiFile.STRING.file.replace('$file', v.match(/[^\/\\]+$/gi)[0])+''), 297 | b = $(''+MultiFile.STRING.remove+''); 298 | 299 | // Insert label 300 | MultiFile.list.append( 301 | r.append(b, ' ', a) 302 | ); 303 | 304 | b 305 | .click(function(){ 306 | 307 | //# Trigger Event! onFileRemove 308 | if(!MultiFile.trigger('onFileRemove', slave, MultiFile)) return false; 309 | //# End Event! 310 | 311 | MultiFile.n--; 312 | MultiFile.current.disabled = false; 313 | 314 | // Remove element, remove label, point to current 315 | MultiFile.slaves[slave_count] = null; 316 | $(slave).remove(); 317 | $(this).parent().remove(); 318 | 319 | // Show most current element again (move into view) and clear selection 320 | $(MultiFile.current).css({ position:'', top: '' }); 321 | $(MultiFile.current).reset().val('').attr('value', '')[0].value = ''; 322 | 323 | //# Trigger Event! afterFileRemove 324 | if(!MultiFile.trigger('afterFileRemove', slave, MultiFile)) return false; 325 | //# End Event! 326 | 327 | return false; 328 | }); 329 | 330 | //# Trigger Event! afterFileAppend 331 | if(!MultiFile.trigger('afterFileAppend', slave, MultiFile)) return false; 332 | //# End Event! 333 | 334 | }; // MultiFile.addToList 335 | // Add element to selected files list 336 | 337 | 338 | 339 | // Bind functionality to the first element 340 | if(!MultiFile.MultiFile) MultiFile.addSlave(MultiFile.e, 0); 341 | 342 | // Increment control count 343 | //MultiFile.I++; // using window.MultiFile 344 | MultiFile.n++; 345 | 346 | // Save control to element 347 | MultiFile.E.data('MultiFile', MultiFile); 348 | 349 | 350 | //##################################################################### 351 | // MAIN PLUGIN FUNCTIONALITY - END 352 | //##################################################################### 353 | }); // each element 354 | }; 355 | 356 | /*--------------------------------------------------------*/ 357 | 358 | /* 359 | ### Core functionality and API ### 360 | */ 361 | $.extend($.fn.MultiFile, { 362 | /** 363 | * This method removes all selected files 364 | * 365 | * Returns a jQuery collection of all affected elements. 366 | * 367 | * @name reset 368 | * @type jQuery 369 | * @cat Plugins/MultiFile 370 | * @author Diego A. (http://www.fyneworks.com/) 371 | * 372 | * @example $.fn.MultiFile.reset(); 373 | */ 374 | reset: function(){ 375 | var settings = $(this).data('MultiFile'); 376 | //if(settings) settings.wrapper.find('a.MultiFile-remove').click(); 377 | if(settings) settings.list.find('a.MultiFile-remove').click(); 378 | return $(this); 379 | }, 380 | 381 | 382 | /** 383 | * This utility makes it easy to disable all 'empty' file elements in the document before submitting a form. 384 | * It marks the affected elements so they can be easily re-enabled after the form submission or validation. 385 | * 386 | * Returns a jQuery collection of all affected elements. 387 | * 388 | * @name disableEmpty 389 | * @type jQuery 390 | * @cat Plugins/MultiFile 391 | * @author Diego A. (http://www.fyneworks.com/) 392 | * 393 | * @example $.fn.MultiFile.disableEmpty(); 394 | * @param String class (optional) A string specifying a class to be applied to all affected elements - Default: 'mfD'. 395 | */ 396 | disableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD'; 397 | var o = []; 398 | $('input:file.MultiFile').each(function(){ if($(this).val()=='') o[o.length] = this; }); 399 | return $(o).each(function(){ this.disabled = true }).addClass(klass); 400 | }, 401 | 402 | 403 | /** 404 | * This method re-enables 'empty' file elements that were disabled (and marked) with the $.fn.MultiFile.disableEmpty method. 405 | * 406 | * Returns a jQuery collection of all affected elements. 407 | * 408 | * @name reEnableEmpty 409 | * @type jQuery 410 | * @cat Plugins/MultiFile 411 | * @author Diego A. (http://www.fyneworks.com/) 412 | * 413 | * @example $.fn.MultiFile.reEnableEmpty(); 414 | * @param String klass (optional) A string specifying the class that was used to mark affected elements - Default: 'mfD'. 415 | */ 416 | reEnableEmpty: function(klass){ klass = (typeof(klass)=='string'?klass:'')||'mfD'; 417 | return $('input:file.'+klass).removeClass(klass).each(function(){ this.disabled = false }); 418 | }, 419 | 420 | 421 | /** 422 | * This method will intercept other jQuery plugins and disable empty file input elements prior to form submission 423 | * 424 | 425 | * @name intercept 426 | * @cat Plugins/MultiFile 427 | * @author Diego A. (http://www.fyneworks.com/) 428 | * 429 | * @example $.fn.MultiFile.intercept(); 430 | * @param Array methods (optional) Array of method names to be intercepted 431 | */ 432 | intercepted: {}, 433 | intercept: function(methods, context, args){ 434 | var method, value; args = args || []; 435 | if(args.constructor.toString().indexOf("Array")<0) args = [ args ]; 436 | if(typeof(methods)=='function'){ 437 | $.fn.MultiFile.disableEmpty(); 438 | value = methods.apply(context || window, args); 439 | //SEE-http://code.google.com/p/jquery-multifile-plugin/issues/detail?id=27 440 | setTimeout(function(){ $.fn.MultiFile.reEnableEmpty() },1000); 441 | return value; 442 | }; 443 | if(methods.constructor.toString().indexOf("Array")<0) methods = [methods]; 444 | for(var i=0;i'), 495 | css: { 496 | border:'none', padding:'15px', size:'12.0pt', 497 | backgroundColor:'#900', color:'#fff', 498 | opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px' 499 | } 500 | }); 501 | window.setTimeout($.unblockUI, 2000); 502 | } 503 | else//{// save a byte! 504 | */ 505 | alert(s); 506 | //}// save a byte! 507 | } 508 | }; //} }); 509 | 510 | /*--------------------------------------------------------*/ 511 | 512 | /* 513 | ### Additional Methods ### 514 | Required functionality outside the plugin's scope 515 | */ 516 | 517 | // Native input reset method - because this alone doesn't always work: $(element).val('').attr('value', '')[0].value = ''; 518 | $.fn.reset = function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); }; 519 | 520 | /*--------------------------------------------------------*/ 521 | 522 | /* 523 | ### Default implementation ### 524 | The plugin will attach itself to file inputs 525 | with the class 'multi' when the page loads 526 | */ 527 | $(function(){ 528 | //$("input:file.multi").MultiFile(); 529 | $("input[type=file].multi").MultiFile(); 530 | }); 531 | 532 | 533 | 534 | /*# AVOID COLLISIONS #*/ 535 | })(jQuery); 536 | /*# AVOID COLLISIONS #*/ 537 | --------------------------------------------------------------------------------