more progress

This commit is contained in:
Ken Johnson
2013-04-24 16:12:16 -04:00
parent 8f2be0587f
commit fb59deb224
69 changed files with 45006 additions and 6 deletions
Vendored
BIN
View File
Binary file not shown.
+4 -1
View File
@@ -34,7 +34,7 @@ end
gem 'jquery-rails' gem 'jquery-rails'
# To use ActiveModel has_secure_password # To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0' gem 'bcrypt-ruby'
# To use Jbuilder templates for JSON # To use Jbuilder templates for JSON
# gem 'jbuilder' # gem 'jbuilder'
@@ -42,6 +42,9 @@ gem 'jquery-rails'
# Use unicorn as the app server # Use unicorn as the app server
gem 'unicorn' gem 'unicorn'
# Pow related gem
gem 'powder'
# Deploy with Capistrano # Deploy with Capistrano
# gem 'capistrano' # gem 'capistrano'
+5
View File
@@ -29,6 +29,7 @@ GEM
i18n (= 0.6.1) i18n (= 0.6.1)
multi_json (~> 1.0) multi_json (~> 1.0)
arel (3.0.2) arel (3.0.2)
bcrypt-ruby (3.0.1)
brakeman (1.9.5) brakeman (1.9.5)
erubis (~> 2.6) erubis (~> 2.6)
fastercsv (~> 1.5) fastercsv (~> 1.5)
@@ -90,6 +91,8 @@ GEM
mime-types (1.22) mime-types (1.22)
multi_json (1.7.2) multi_json (1.7.2)
polyglot (0.3.3) polyglot (0.3.3)
powder (0.2.0)
thor (>= 0.11.5)
pry (0.9.12) pry (0.9.12)
coderay (~> 1.0.5) coderay (~> 1.0.5)
method_source (~> 0.8) method_source (~> 0.8)
@@ -162,6 +165,7 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
bcrypt-ruby
brakeman brakeman
bundler-audit bundler-audit
coffee-rails (~> 3.2.1) coffee-rails (~> 3.2.1)
@@ -169,6 +173,7 @@ DEPENDENCIES
guard-brakeman guard-brakeman
guard-shell guard-shell
jquery-rails jquery-rails
powder
rails (= 3.2.13) rails (= 3.2.13)
rb-fsevent rb-fsevent
sass-rails (~> 3.2.3) sass-rails (~> 3.2.3)
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
+9 -1
View File
@@ -12,4 +12,12 @@
// //
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
//= require_tree . //= require wysiwyg/wysihtml5-0.3.0.js
//= require jquery.min.js
//= require bootstrap.js
//= require jquery.scrollUp.js
//= require wysiwyg/bootstrap-wysihtml5.js
//= require date-picker/date.js
//= require date-picker/daterangepicker.js
//= require jquery.sparkline.js
//= require tiny-scrollbar.js
+540
View File
@@ -0,0 +1,540 @@
/* =========================================================
* bootstrap-colorpicker.js
* http://www.eyecon.ro/bootstrap-colorpicker
* =========================================================
* Copyright 2012 Stefan Petre
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function( $ ) {
// Color object
var Color = function(val) {
this.value = {
h: 1,
s: 1,
b: 1,
a: 1
};
this.setColor(val);
};
Color.prototype = {
constructor: Color,
//parse a string to HSB
setColor: function(val){
val = val.toLowerCase();
var that = this;
$.each( CPGlobal.stringParsers, function( i, parser ) {
var match = parser.re.exec( val ),
values = match && parser.parse( match ),
space = parser.space||'rgba';
if ( values ) {
if (space === 'hsla') {
that.value = CPGlobal.RGBtoHSB.apply(null, CPGlobal.HSLtoRGB.apply(null, values));
} else {
that.value = CPGlobal.RGBtoHSB.apply(null, values);
}
return false;
}
});
},
setHue: function(h) {
this.value.h = 1- h;
},
setSaturation: function(s) {
this.value.s = s;
},
setLightness: function(b) {
this.value.b = 1- b;
},
setAlpha: function(a) {
this.value.a = parseInt((1 - a)*100, 10)/100;
},
// HSBtoRGB from RaphaelJS
// https://github.com/DmitryBaranovskiy/raphael/
toRGB: function(h, s, b, a) {
if (!h) {
h = this.value.h;
s = this.value.s;
b = this.value.b;
}
h *= 360;
var R, G, B, X, C;
h = (h % 360) / 60;
C = b * s;
X = C * (1 - Math.abs(h % 2 - 1));
R = G = B = b - C;
h = ~~h;
R += [C, X, 0, 0, X, C][h];
G += [X, C, C, X, 0, 0][h];
B += [0, 0, X, C, C, X][h];
return {
r: Math.round(R*255),
g: Math.round(G*255),
b: Math.round(B*255),
a: a||this.value.a
};
},
toHex: function(h, s, b, a){
var rgb = this.toRGB(h, s, b, a);
return '#'+((1 << 24) | (parseInt(rgb.r) << 16) | (parseInt(rgb.g) << 8) | parseInt(rgb.b)).toString(16).substr(1);
},
toHSL: function(h, s, b, a){
if (!h) {
h = this.value.h;
s = this.value.s;
b = this.value.b;
}
var H = h,
L = (2 - s) * b,
S = s * b;
if (L > 0 && L <= 1) {
S /= L;
} else {
S /= 2 - L;
}
L /= 2;
if (S > 1) {
S = 1;
}
return {
h: H,
s: S,
l: L,
a: a||this.value.a
};
}
};
// Picker object
var Colorpicker = function(element, options){
this.element = $(element);
var format = options.format||this.element.data('color-format')||'hex';
this.format = CPGlobal.translateFormats[format];
this.isInput = this.element.is('input');
this.component = this.element.is('.color') ? this.element.find('.add-on') : false;
this.picker = $(CPGlobal.template)
.appendTo('body')
.on('mousedown', $.proxy(this.mousedown, this));
if (this.isInput) {
this.element.on({
'focus': $.proxy(this.show, this),
'keyup': $.proxy(this.update, this)
});
} else if (this.component){
this.component.on({
'click': $.proxy(this.show, this)
});
} else {
this.element.on({
'click': $.proxy(this.show, this)
});
}
if (format === 'rgba' || format === 'hsla') {
this.picker.addClass('alpha');
this.alpha = this.picker.find('.colorpicker-alpha')[0].style;
}
if (this.component){
this.picker.find('.colorpicker-color').hide();
this.preview = this.element.find('i')[0].style;
} else {
this.preview = this.picker.find('div:last')[0].style;
}
this.base = this.picker.find('div:first')[0].style;
this.update();
};
Colorpicker.prototype = {
constructor: Colorpicker,
show: function(e) {
this.picker.show();
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
this.place();
$(window).on('resize', $.proxy(this.place, this));
if (!this.isInput) {
if (e) {
e.stopPropagation();
e.preventDefault();
}
}
$(document).on({
'mousedown': $.proxy(this.hide, this)
});
this.element.trigger({
type: 'show',
color: this.color
});
},
update: function(){
this.color = new Color(this.isInput ? this.element.prop('value') : this.element.data('color'));
this.picker.find('i')
.eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end()
.eq(1).css('top', 100 * (1 - this.color.value.h)).end()
.eq(2).css('top', 100 * (1 - this.color.value.a));
this.previewColor();
},
setValue: function(newColor) {
this.color = new Color(newColor);
this.picker.find('i')
.eq(0).css({left: this.color.value.s*100, top: 100 - this.color.value.b*100}).end()
.eq(1).css('top', 100 * (1 - this.color.value.h)).end()
.eq(2).css('top', 100 * (1 - this.color.value.a));
this.previewColor();
this.element.trigger({
type: 'changeColor',
color: this.color
});
},
hide: function(){
this.picker.hide();
$(window).off('resize', this.place);
if (!this.isInput) {
$(document).off({
'mousedown': this.hide
});
if (this.component){
this.element.find('input').prop('value', this.format.call(this));
}
this.element.data('color', this.format.call(this));
} else {
this.element.prop('value', this.format.call(this));
}
this.element.trigger({
type: 'hide',
color: this.color
});
},
place: function(){
var offset = this.component ? this.component.offset() : this.element.offset();
this.picker.css({
top: offset.top + this.height,
left: offset.left
});
},
//preview color change
previewColor: function(){
try {
this.preview.backgroundColor = this.format.call(this);
} catch(e) {
this.preview.backgroundColor = this.color.toHex();
}
//set the color for brightness/saturation slider
this.base.backgroundColor = this.color.toHex(this.color.value.h, 1, 1, 1);
//set te color for alpha slider
if (this.alpha) {
this.alpha.backgroundColor = this.color.toHex();
}
},
pointer: null,
slider: null,
mousedown: function(e){
e.stopPropagation();
e.preventDefault();
var target = $(e.target);
//detect the slider and set the limits and callbacks
var zone = target.closest('div');
if (!zone.is('.colorpicker')) {
if (zone.is('.colorpicker-saturation')) {
this.slider = $.extend({}, CPGlobal.sliders.saturation);
}
else if (zone.is('.colorpicker-hue')) {
this.slider = $.extend({}, CPGlobal.sliders.hue);
}
else if (zone.is('.colorpicker-alpha')) {
this.slider = $.extend({}, CPGlobal.sliders.alpha);
} else {
return false;
}
var offset = zone.offset();
//reference to knob's style
this.slider.knob = zone.find('i')[0].style;
this.slider.left = e.pageX - offset.left;
this.slider.top = e.pageY - offset.top;
this.pointer = {
left: e.pageX,
top: e.pageY
};
//trigger mousemove to move the knob to the current position
$(document).on({
mousemove: $.proxy(this.mousemove, this),
mouseup: $.proxy(this.mouseup, this)
}).trigger('mousemove');
}
return false;
},
mousemove: function(e){
e.stopPropagation();
e.preventDefault();
var left = Math.max(
0,
Math.min(
this.slider.maxLeft,
this.slider.left + ((e.pageX||this.pointer.left) - this.pointer.left)
)
);
var top = Math.max(
0,
Math.min(
this.slider.maxTop,
this.slider.top + ((e.pageY||this.pointer.top) - this.pointer.top)
)
);
this.slider.knob.left = left + 'px';
this.slider.knob.top = top + 'px';
if (this.slider.callLeft) {
this.color[this.slider.callLeft].call(this.color, left/100);
}
if (this.slider.callTop) {
this.color[this.slider.callTop].call(this.color, top/100);
}
this.previewColor();
this.element.trigger({
type: 'changeColor',
color: this.color
});
return false;
},
mouseup: function(e){
e.stopPropagation();
e.preventDefault();
$(document).off({
mousemove: this.mousemove,
mouseup: this.mouseup
});
return false;
}
}
$.fn.colorpicker = function ( option ) {
return this.each(function () {
var $this = $(this),
data = $this.data('colorpicker'),
options = typeof option === 'object' && option;
if (!data) {
$this.data('colorpicker', (data = new Colorpicker(this, $.extend({}, $.fn.colorpicker.defaults,options))));
}
if (typeof option === 'string') data[option]();
});
};
$.fn.colorpicker.defaults = {
};
$.fn.colorpicker.Constructor = Colorpicker;
var CPGlobal = {
// translate a format from Color object to a string
translateFormats: {
'rgb': function(){
var rgb = this.color.toRGB();
return 'rgb('+rgb.r+','+rgb.g+','+rgb.b+')';
},
'rgba': function(){
var rgb = this.color.toRGB();
return 'rgba('+rgb.r+','+rgb.g+','+rgb.b+','+rgb.a+')';
},
'hsl': function(){
var hsl = this.color.toHSL();
return 'hsl('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%)';
},
'hsla': function(){
var hsl = this.color.toHSL();
return 'hsla('+Math.round(hsl.h*360)+','+Math.round(hsl.s*100)+'%,'+Math.round(hsl.l*100)+'%,'+hsl.a+')';
},
'hex': function(){
return this.color.toHex();
}
},
sliders: {
saturation: {
maxLeft: 100,
maxTop: 100,
callLeft: 'setSaturation',
callTop: 'setLightness'
},
hue: {
maxLeft: 0,
maxTop: 100,
callLeft: false,
callTop: 'setHue'
},
alpha: {
maxLeft: 0,
maxTop: 100,
callLeft: false,
callTop: 'setAlpha'
}
},
// HSBtoRGB from RaphaelJS
// https://github.com/DmitryBaranovskiy/raphael/
RGBtoHSB: function (r, g, b, a){
r /= 255;
g /= 255;
b /= 255;
var H, S, V, C;
V = Math.max(r, g, b);
C = V - Math.min(r, g, b);
H = (C === 0 ? null :
V == r ? (g - b) / C :
V == g ? (b - r) / C + 2 :
(r - g) / C + 4
);
H = ((H + 360) % 6) * 60 / 360;
S = C === 0 ? 0 : C / V;
return {h: H||1, s: S, b: V, a: a||1};
},
HueToRGB: function (p, q, h) {
if (h < 0)
h += 1;
else if (h > 1)
h -= 1;
if ((h * 6) < 1)
return p + (q - p) * h * 6;
else if ((h * 2) < 1)
return q;
else if ((h * 3) < 2)
return p + (q - p) * ((2 / 3) - h) * 6;
else
return p;
},
HSLtoRGB: function (h, s, l, a)
{
if (s < 0) {
s = 0;
}
var q;
if (l <= 0.5) {
q = l * (1 + s);
} else {
q = l + s - (l * s);
}
var p = 2 * l - q;
var tr = h + (1 / 3);
var tg = h;
var tb = h - (1 / 3);
var r = Math.round(CPGlobal.HueToRGB(p, q, tr) * 255);
var g = Math.round(CPGlobal.HueToRGB(p, q, tg) * 255);
var b = Math.round(CPGlobal.HueToRGB(p, q, tb) * 255);
return [r, g, b, a||1];
},
// a set of RE's that can match strings and generate color tuples.
// from John Resig color plugin
// https://github.com/jquery/jquery-color/
stringParsers: [
{
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
parse: function( execResult ) {
return [
execResult[ 1 ],
execResult[ 2 ],
execResult[ 3 ],
execResult[ 4 ]
];
}
}, {
re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
parse: function( execResult ) {
return [
2.55 * execResult[1],
2.55 * execResult[2],
2.55 * execResult[3],
execResult[ 4 ]
];
}
}, {
re: /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
parse: function( execResult ) {
return [
parseInt( execResult[ 1 ], 16 ),
parseInt( execResult[ 2 ], 16 ),
parseInt( execResult[ 3 ], 16 )
];
}
}, {
re: /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,
parse: function( execResult ) {
return [
parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
];
}
}, {
re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,
space: 'hsla',
parse: function( execResult ) {
return [
execResult[1]/360,
execResult[2] / 100,
execResult[3] / 100,
execResult[4]
];
}
}
],
template: '<div class="colorpicker dropdown-menu">'+
'<div class="colorpicker-saturation"><i><b></b></i></div>'+
'<div class="colorpicker-hue"><i></i></div>'+
'<div class="colorpicker-alpha"><i></i></div>'+
'<div class="colorpicker-color"><div /></div>'+
'</div>'
};
}( window.jQuery )
File diff suppressed because one or more lines are too long
+78
View File
@@ -0,0 +1,78 @@
/*
* Bootstrap Image Gallery JS Example 2.9
* https://github.com/blueimp/Bootstrap-Image-Gallery
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint unparam: true */
/*global window, document, $ */
$(function () {
'use strict';
// Start slideshow button:
$('#start-slideshow').button().click(function () {
var options = $(this).data(),
modal = $(options.target),
data = modal.data('modal');
if (data) {
$.extend(data.options, options);
} else {
options = $.extend(modal.data(), options);
}
modal.find('.modal-slideshow').find('i')
.removeClass('icon-play')
.addClass('icon-pause');
modal.modal(options);
});
// Toggle fullscreen button:
$('#toggle-fullscreen').button().click(function () {
var button = $(this),
root = document.documentElement;
if (!button.hasClass('active')) {
$('#modal-gallery').addClass('modal-fullscreen');
if (root.webkitRequestFullScreen) {
root.webkitRequestFullScreen(
window.Element.ALLOW_KEYBOARD_INPUT
);
} else if (root.mozRequestFullScreen) {
root.mozRequestFullScreen();
}
} else {
$('#modal-gallery').removeClass('modal-fullscreen');
(document.webkitCancelFullScreen ||
document.mozCancelFullScreen ||
$.noop).apply(document);
}
});
// Load images via flickr for demonstration purposes:
// $.ajax({
// url: 'http://api.flickr.com/services/rest/',
// data: {
// format: 'json',
// method: 'flickr.interestingness.getList',
// api_key: '7617adae70159d09ba78cfec73c13be3'
// },
// dataType: 'jsonp',
// jsonp: 'jsoncallback'
// }).done(function (data) {
// var gallery = $('#gallery'),
// url;
// $.each(data.photos.photo, function (index, photo) {
// url = 'http://farm' + photo.farm + '.static.flickr.com/' +
// photo.server + '/' + photo.id + '_' + photo.secret;
// $('<a data-gallery="gallery"/>')
// .append($('<img>').prop('src', url + '_s.jpg'))
// .prop('href', url + '_b.jpg')
// .prop('title', photo.title)
// .appendTo(gallery);
// });
// });
});
+399
View File
@@ -0,0 +1,399 @@
/*
* Bootstrap Image Gallery 2.10
* https://github.com/blueimp/Bootstrap-Image-Gallery
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint nomen: true, regexp: true */
/*global define, window, document, jQuery */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'bootstrap'
], factory);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';
// Bootstrap Image Gallery is an extension to the Modal dialog of Twitter's
// Bootstrap toolkit, to ease navigation between a set of gallery images.
// It features transition effects, fullscreen mode and slideshow functionality.
$.extend($.fn.modal.defaults, {
// Delegate to search gallery links from, can be anything that
// is accepted as parameter for $():
delegate: document,
// Selector for gallery links:
selector: null,
// The filter for the selected gallery links (e.g. set to ":odd" to
// filter out label and thumbnail linking twice to the same image):
filter: '*',
// The index of the first gallery image to show:
index: 0,
// The href of the first gallery image to show (overrides index):
href: null,
// The range of images around the current one to preload:
preloadRange: 2,
// Offset of image width to viewport width:
offsetWidth: 100,
// Offset of image height to viewport height:
offsetHeight: 200,
// Set to true to display images as canvas elements:
canvas: false,
// Shows the next image after the given time in ms (0 = disabled):
slideshow: 0,
// Defines the image division for previous/next clicks:
imageClickDivision: 0.5
});
var originalShow = $.fn.modal.Constructor.prototype.show,
originalHide = $.fn.modal.Constructor.prototype.hide;
$.extend($.fn.modal.Constructor.prototype, {
initLinks: function () {
var $this = this,
options = this.options,
selector = options.selector ||
'a[data-target=' + options.target + ']';
this.$links = $(options.delegate).find(selector)
.filter(options.filter).each(function (index) {
if ($this.getUrl(this) === options.href) {
options.index = index;
}
});
if (!this.$links[options.index]) {
options.index = 0;
}
},
getUrl: function (element) {
return element.href || $(element).data('href');
},
getDownloadUrl: function (element) {
return $(element).data('download');
},
startSlideShow: function () {
var $this = this;
if (this.options.slideshow) {
this._slideShow = window.setTimeout(
function () {
$this.next();
},
this.options.slideshow
);
}
},
stopSlideShow: function () {
window.clearTimeout(this._slideShow);
},
toggleSlideShow: function () {
var node = this.$element.find('.modal-slideshow');
if (this.options.slideshow) {
this.options.slideshow = 0;
this.stopSlideShow();
} else {
this.options.slideshow = node.data('slideshow') || 5000;
this.startSlideShow();
}
node.find('i').toggleClass('icon-play icon-pause');
},
preloadImages: function () {
var options = this.options,
range = options.index + options.preloadRange + 1,
link,
i;
for (i = options.index - options.preloadRange; i < range; i += 1) {
link = this.$links[i];
if (link && i !== options.index) {
$('<img>').prop('src', this.getUrl(link));
}
}
},
loadImage: function () {
var $this = this,
modal = this.$element,
index = this.options.index,
url = this.getUrl(this.$links[index]),
download = this.getDownloadUrl(this.$links[index]),
oldImg;
this.abortLoad();
this.stopSlideShow();
modal.trigger('beforeLoad');
// The timeout prevents displaying a loading status,
// if the image has already been loaded:
this._loadingTimeout = window.setTimeout(function () {
modal.addClass('modal-loading');
}, 100);
oldImg = modal.find('.modal-image').children().removeClass('in');
// The timeout allows transition effects to finish:
window.setTimeout(function () {
oldImg.remove();
}, 3000);
modal.find('.modal-title').text(this.$links[index].title);
modal.find('.modal-download').prop(
'href',
download || url
);
this._loadingImage = loadImage(
url,
function (img) {
$this.img = img;
window.clearTimeout($this._loadingTimeout);
modal.removeClass('modal-loading');
modal.trigger('load');
$this.showImage(img);
$this.startSlideShow();
},
this._loadImageOptions
);
this.preloadImages();
},
showImage: function (img) {
var modal = this.$element,
transition = $.support.transition && modal.hasClass('fade'),
method = transition ? modal.animate : modal.css,
modalImage = modal.find('.modal-image'),
clone,
forceReflow;
modalImage.css({
width: img.width,
height: img.height
});
modal.find('.modal-title').css({ width: Math.max(img.width, 380) });
if (transition) {
clone = modal.clone().hide().appendTo(document.body);
}
if ($(window).width() > 767) {
method.call(modal.stop(), {
'margin-top': -((clone || modal).outerHeight() / 2),
'margin-left': -((clone || modal).outerWidth() / 2)
});
} else {
modal.css({
top: ($(window).height() - (clone || modal).outerHeight()) / 2
});
}
if (clone) {
clone.remove();
}
modalImage.append(img);
forceReflow = img.offsetWidth;
modal.trigger('display');
if (transition) {
if (modal.is(':visible')) {
$(img).on(
$.support.transition.end,
function (e) {
// Make sure we don't respond to other transitions events
// in the container element, e.g. from button elements:
if (e.target === img) {
$(img).off($.support.transition.end);
modal.trigger('displayed');
}
}
).addClass('in');
} else {
$(img).addClass('in');
modal.one('shown', function () {
modal.trigger('displayed');
});
}
} else {
$(img).addClass('in');
modal.trigger('displayed');
}
},
abortLoad: function () {
if (this._loadingImage) {
this._loadingImage.onload = this._loadingImage.onerror = null;
}
window.clearTimeout(this._loadingTimeout);
},
prev: function () {
var options = this.options;
options.index -= 1;
if (options.index < 0) {
options.index = this.$links.length - 1;
}
this.loadImage();
},
next: function () {
var options = this.options;
options.index += 1;
if (options.index > this.$links.length - 1) {
options.index = 0;
}
this.loadImage();
},
keyHandler: function (e) {
switch (e.which) {
case 37: // left
case 38: // up
e.preventDefault();
this.prev();
break;
case 39: // right
case 40: // down
e.preventDefault();
this.next();
break;
}
},
wheelHandler: function (e) {
e.preventDefault();
e = e.originalEvent;
this._wheelCounter = this._wheelCounter || 0;
this._wheelCounter += (e.wheelDelta || e.detail || 0);
if ((e.wheelDelta && this._wheelCounter >= 120) ||
(!e.wheelDelta && this._wheelCounter < 0)) {
this.prev();
this._wheelCounter = 0;
} else if ((e.wheelDelta && this._wheelCounter <= -120) ||
(!e.wheelDelta && this._wheelCounter > 0)) {
this.next();
this._wheelCounter = 0;
}
},
initGalleryEvents: function () {
var $this = this,
modal = this.$element;
modal.find('.modal-image').on('click.modal-gallery', function (e) {
var modalImage = $(this);
if ($this.$links.length === 1) {
$this.hide();
} else {
if ((e.pageX - modalImage.offset().left) / modalImage.width() <
$this.options.imageClickDivision) {
$this.prev(e);
} else {
$this.next(e);
}
}
});
modal.find('.modal-prev').on('click.modal-gallery', function (e) {
$this.prev(e);
});
modal.find('.modal-next').on('click.modal-gallery', function (e) {
$this.next(e);
});
modal.find('.modal-slideshow').on('click.modal-gallery', function (e) {
$this.toggleSlideShow(e);
});
$(document)
.on('keydown.modal-gallery', function (e) {
$this.keyHandler(e);
})
.on(
'mousewheel.modal-gallery, DOMMouseScroll.modal-gallery',
function (e) {
$this.wheelHandler(e);
}
);
},
destroyGalleryEvents: function () {
var modal = this.$element;
this.abortLoad();
this.stopSlideShow();
modal.find('.modal-image, .modal-prev, .modal-next, .modal-slideshow')
.off('click.modal-gallery');
$(document)
.off('keydown.modal-gallery')
.off('mousewheel.modal-gallery, DOMMouseScroll.modal-gallery');
},
show: function () {
if (!this.isShown && this.$element.hasClass('modal-gallery')) {
var modal = this.$element,
options = this.options,
windowWidth = $(window).width(),
windowHeight = $(window).height();
if (modal.hasClass('modal-fullscreen')) {
this._loadImageOptions = {
maxWidth: windowWidth,
maxHeight: windowHeight,
canvas: options.canvas
};
if (modal.hasClass('modal-fullscreen-stretch')) {
this._loadImageOptions.minWidth = windowWidth;
this._loadImageOptions.minHeight = windowHeight;
}
} else {
this._loadImageOptions = {
maxWidth: windowWidth - options.offsetWidth,
maxHeight: windowHeight - options.offsetHeight,
canvas: options.canvas
};
}
if (windowWidth > 767) {
modal.css({
'margin-top': -(modal.outerHeight() / 2),
'margin-left': -(modal.outerWidth() / 2)
});
} else {
modal.css({
top: ($(window).height() - modal.outerHeight()) / 2
});
}
this.initGalleryEvents();
this.initLinks();
if (this.$links.length) {
modal.find('.modal-slideshow, .modal-prev, .modal-next')
.toggle(this.$links.length !== 1);
modal.toggleClass(
'modal-single',
this.$links.length === 1
);
this.loadImage();
}
}
originalShow.apply(this, arguments);
},
hide: function () {
if (this.isShown && this.$element.hasClass('modal-gallery')) {
this.options.delegate = document;
this.options.href = null;
this.destroyGalleryEvents();
}
originalHide.apply(this, arguments);
}
});
$(function () {
$(document.body).on(
'click.modal-gallery.data-api',
'[data-toggle="modal-gallery"]',
function (e) {
var $this = $(this),
options = $this.data(),
modal = $(options.target),
data = modal.data('modal'),
link;
if (!data) {
options = $.extend(modal.data(), options);
}
if (!options.selector) {
options.selector = 'a[data-gallery=gallery]';
}
link = $(e.target).closest(options.selector);
if (link.length && modal.length) {
e.preventDefault();
options.href = link.prop('href') || link.data('href');
options.delegate = link[0] !== this ? this : document;
if (data) {
$.extend(data.options, options);
}
modal.modal(options);
}
}
);
});
}));
+803
View File
@@ -0,0 +1,803 @@
/* =========================================================
* bootstrap-timepicker.js
* http://www.github.com/jdewit/bootstrap-timepicker
* =========================================================
* Copyright 2012
*
* Created By:
* Joris de Wit @joris_dewit
*
* Contributions By:
* Gilbert @mindeavor
* Koen Punt info@koenpunt.nl
* Nek
* Chris Martin
* Dominic Barnes contact@dominicbarnes.us
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
!function($) {
"use strict"; // jshint ;_;
/* TIMEPICKER PUBLIC CLASS DEFINITION
* ================================== */
var Timepicker = function(element, options) {
this.$element = $(element);
this.options = $.extend({}, $.fn.timepicker.defaults, options, this.$element.data());
this.minuteStep = this.options.minuteStep || this.minuteStep;
this.secondStep = this.options.secondStep || this.secondStep;
this.showMeridian = this.options.showMeridian || this.showMeridian;
this.showSeconds = this.options.showSeconds || this.showSeconds;
this.showInputs = this.options.showInputs || this.showInputs;
this.disableFocus = this.options.disableFocus || this.disableFocus;
this.template = this.options.template || this.template;
this.modalBackdrop = this.options.modalBackdrop || this.modalBackdrop;
this.defaultTime = this.options.defaultTime || this.defaultTime;
this.open = false;
this.init();
};
Timepicker.prototype = {
constructor: Timepicker
, init: function () {
if (this.$element.parent().hasClass('input-append')) {
this.$element.parent('.input-append').find('.add-on').on('click', $.proxy(this.showWidget, this));
this.$element.on({
focus: $.proxy(this.highlightUnit, this),
click: $.proxy(this.highlightUnit, this),
keypress: $.proxy(this.elementKeypress, this),
blur: $.proxy(this.blurElement, this)
});
} else {
if (this.template) {
this.$element.on({
focus: $.proxy(this.showWidget, this),
click: $.proxy(this.showWidget, this),
blur: $.proxy(this.blurElement, this)
});
} else {
this.$element.on({
focus: $.proxy(this.highlightUnit, this),
click: $.proxy(this.highlightUnit, this),
keypress: $.proxy(this.elementKeypress, this),
blur: $.proxy(this.blurElement, this)
});
}
}
this.$widget = $(this.getTemplate()).appendTo('body');
this.$widget.on('click', $.proxy(this.widgetClick, this));
if (this.showInputs) {
this.$widget.find('input').on({
click: function() { this.select(); },
keypress: $.proxy(this.widgetKeypress, this),
change: $.proxy(this.updateFromWidgetInputs, this)
});
}
this.setDefaultTime(this.defaultTime);
}
, showWidget: function(e) {
e.stopPropagation();
e.preventDefault();
if (this.open) {
return;
}
this.$element.trigger('show');
if (this.disableFocus) {
this.$element.blur();
}
var pos = $.extend({}, this.$element.offset(), {
height: this.$element[0].offsetHeight
});
this.updateFromElementVal();
$('html')
.trigger('click.timepicker.data-api')
.one('click.timepicker.data-api', $.proxy(this.hideWidget, this));
if (this.template === 'modal') {
this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
} else {
this.$widget.css({
top: pos.top + pos.height
, left: pos.left
})
if (!this.open) {
this.$widget.addClass('open');
}
}
this.open = true;
this.$element.trigger('shown');
}
, hideWidget: function(){
this.$element.trigger('hide');
if (this.template === 'modal') {
this.$widget.modal('hide');
} else {
this.$widget.removeClass('open');
}
this.open = false;
this.$element.trigger('hidden');
}
, widgetClick: function(e) {
e.stopPropagation();
e.preventDefault();
var action = $(e.target).closest('a').data('action');
if (action) {
this[action]();
this.update();
}
}
, widgetKeypress: function(e) {
var input = $(e.target).closest('input').attr('name');
switch (e.keyCode) {
case 9: //tab
if (this.showMeridian) {
if (input == 'meridian') {
this.hideWidget();
}
} else {
if (this.showSeconds) {
if (input == 'second') {
this.hideWidget();
}
} else {
if (input == 'minute') {
this.hideWidget();
}
}
}
break;
case 27: // escape
this.hideWidget();
break;
case 38: // up arrow
switch (input) {
case 'hour':
this.incrementHour();
break;
case 'minute':
this.incrementMinute();
break;
case 'second':
this.incrementSecond();
break;
case 'meridian':
this.toggleMeridian();
break;
}
this.update();
break;
case 40: // down arrow
switch (input) {
case 'hour':
this.decrementHour();
break;
case 'minute':
this.decrementMinute();
break;
case 'second':
this.decrementSecond();
break;
case 'meridian':
this.toggleMeridian();
break;
}
this.update();
break;
}
}
, elementKeypress: function(e) {
var input = this.$element.get(0);
switch (e.keyCode) {
case 0: //input
break;
case 9: //tab
this.updateFromElementVal();
if (this.showMeridian) {
if (this.highlightedUnit != 'meridian') {
e.preventDefault();
this.highlightNextUnit();
}
} else {
if (this.showSeconds) {
if (this.highlightedUnit != 'second') {
e.preventDefault();
this.highlightNextUnit();
}
} else {
if (this.highlightedUnit != 'minute') {
e.preventDefault();
this.highlightNextUnit();
}
}
}
break;
case 27: // escape
this.updateFromElementVal();
break;
case 37: // left arrow
this.updateFromElementVal();
this.highlightPrevUnit();
break;
case 38: // up arrow
switch (this.highlightedUnit) {
case 'hour':
this.incrementHour();
break;
case 'minute':
this.incrementMinute();
break;
case 'second':
this.incrementSecond();
break;
case 'meridian':
this.toggleMeridian();
break;
}
this.updateElement();
break;
case 39: // right arrow
this.updateFromElementVal();
this.highlightNextUnit();
break;
case 40: // down arrow
switch (this.highlightedUnit) {
case 'hour':
this.decrementHour();
break;
case 'minute':
this.decrementMinute();
break;
case 'second':
this.decrementSecond();
break;
case 'meridian':
this.toggleMeridian();
break;
}
this.updateElement();
break;
}
if (e.keyCode !== 0 && e.keyCode !== 8 && e.keyCode !== 9 && e.keyCode !== 46) {
e.preventDefault();
}
}
, setValues: function(time) {
if (this.showMeridian) {
var arr = time.split(' ');
var timeArray = arr[0].split(':');
this.meridian = arr[1];
} else {
var timeArray = time.split(':');
}
this.hour = parseInt(timeArray[0], 10);
this.minute = parseInt(timeArray[1], 10);
this.second = parseInt(timeArray[2], 10);
if (isNaN(this.hour)) {
this.hour = 0;
}
if (isNaN(this.minute)) {
this.minute = 0;
}
if (this.showMeridian) {
if (this.hour > 12) {
this.hour = 12;
} else if (this.hour < 1) {
this.hour = 1;
}
if (this.meridian == 'am' || this.meridian == 'a') {
this.meridian = 'AM';
} else if (this.meridian == 'pm' || this.meridian == 'p') {
this.meridian = 'PM';
}
if (this.meridian != 'AM' && this.meridian != 'PM') {
this.meridian = 'AM';
}
} else {
if (this.hour >= 24) {
this.hour = 23;
} else if (this.hour < 0) {
this.hour = 0;
}
}
if (this.minute < 0) {
this.minute = 0;
} else if (this.minute >= 60) {
this.minute = 59;
}
if (this.showSeconds) {
if (isNaN(this.second)) {
this.second = 0;
} else if (this.second < 0) {
this.second = 0;
} else if (this.second >= 60) {
this.second = 59;
}
}
if ( this.$element.val() != '' )
this.updateElement();
this.updateWidget();
}
, setMeridian: function(meridian) {
if (meridian == 'a' || meridian == 'am' || meridian == 'AM' ) {
this.meridian = 'AM';
} else if (meridian == 'p' || meridian == 'pm' || meridian == 'PM' ) {
this.meridian = 'PM';
} else {
this.updateWidget();
}
this.updateElement();
}
, setDefaultTime: function(defaultTime){
if (defaultTime) {
if (defaultTime === 'current') {
var dTime = new Date();
var hours = dTime.getHours();
var minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep;
var seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep;
var meridian = "AM";
if (this.showMeridian) {
if (hours === 0) {
hours = 12;
} else if (hours >= 12) {
if (hours > 12) {
hours = hours - 12;
}
meridian = "PM";
} else {
meridian = "AM";
}
}
this.hour = hours;
this.minute = minutes;
this.second = seconds;
this.meridian = meridian;
} else if (defaultTime === 'value') {
this.setValues(this.$element.val());
} else {
this.setValues(defaultTime);
}
if ( this.$element.val() != '' )
this.updateElement();
this.updateWidget();
} else {
this.hour = 0;
this.minute = 0;
this.second = 0;
}
}
, formatTime: function(hour, minute, second, meridian) {
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
return hour + ':' + minute + (this.showSeconds ? ':' + second : '') + (this.showMeridian ? ' ' + meridian : '');
}
, getTime: function() {
return this.formatTime(this.hour, this.minute, this.second, this.meridian);
}
, setTime: function(time) {
this.setValues(time);
this.update();
}
, update: function() {
this.updateElement();
this.updateWidget();
}
, blurElement: function() {
this.highlightedUnit = undefined;
this.updateFromElementVal();
}
, updateElement: function() {
var time = this.getTime();
this.$element.val(time).change();
switch (this.highlightedUnit) {
case 'hour':
this.highlightHour();
break;
case 'minute':
this.highlightMinute();
break;
case 'second':
this.highlightSecond();
break;
case 'meridian':
this.highlightMeridian();
break;
}
}
, updateWidget: function() {
if (this.showInputs) {
this.$widget.find('input.bootstrap-timepicker-hour').val(this.hour < 10 ? '0' + this.hour : this.hour);
this.$widget.find('input.bootstrap-timepicker-minute').val(this.minute < 10 ? '0' + this.minute : this.minute);
if (this.showSeconds) {
this.$widget.find('input.bootstrap-timepicker-second').val(this.second < 10 ? '0' + this.second : this.second);
}
if (this.showMeridian) {
this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian);
}
} else {
this.$widget.find('span.bootstrap-timepicker-hour').text(this.hour);
this.$widget.find('span.bootstrap-timepicker-minute').text(this.minute < 10 ? '0' + this.minute : this.minute);
if (this.showSeconds) {
this.$widget.find('span.bootstrap-timepicker-second').text(this.second < 10 ? '0' + this.second : this.second);
}
if (this.showMeridian) {
this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian);
}
}
}
, updateFromElementVal: function (e) {
var time = this.$element.val();
if (time) {
this.setValues(time);
this.updateWidget();
}
}
, updateFromWidgetInputs: function () {
var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
$('input.bootstrap-timepicker-minute', this.$widget).val() +
(this.showSeconds ?
':' + $('input.bootstrap-timepicker-second', this.$widget).val()
: '') +
(this.showMeridian ?
' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val()
: '');
this.setValues(time);
}
, getCursorPosition: function() {
var input = this.$element.get(0);
if ('selectionStart' in input) {
// Standard-compliant browsers
return input.selectionStart;
} else if (document.selection) {
// IE fix
input.focus();
var sel = document.selection.createRange();
var selLen = document.selection.createRange().text.length;
sel.moveStart('character', - input.value.length);
return sel.text.length - selLen;
}
}
, highlightUnit: function () {
var input = this.$element.get(0);
this.position = this.getCursorPosition();
if (this.position >= 0 && this.position <= 2) {
this.highlightHour();
} else if (this.position >= 3 && this.position <= 5) {
this.highlightMinute();
} else if (this.position >= 6 && this.position <= 8) {
if (this.showSeconds) {
this.highlightSecond();
} else {
this.highlightMeridian();
}
} else if (this.position >= 9 && this.position <= 11) {
this.highlightMeridian();
}
}
, highlightNextUnit: function() {
switch (this.highlightedUnit) {
case 'hour':
this.highlightMinute();
break;
case 'minute':
if (this.showSeconds) {
this.highlightSecond();
} else {
this.highlightMeridian();
}
break;
case 'second':
this.highlightMeridian();
break;
case 'meridian':
this.highlightHour();
break;
}
}
, highlightPrevUnit: function() {
switch (this.highlightedUnit) {
case 'hour':
this.highlightMeridian();
break;
case 'minute':
this.highlightHour();
break;
case 'second':
this.highlightMinute();
break;
case 'meridian':
if (this.showSeconds) {
this.highlightSecond();
} else {
this.highlightMinute();
}
break;
}
}
, highlightHour: function() {
this.highlightedUnit = 'hour';
this.$element.get(0).setSelectionRange(0,2);
}
, highlightMinute: function() {
this.highlightedUnit = 'minute';
this.$element.get(0).setSelectionRange(3,5);
}
, highlightSecond: function() {
this.highlightedUnit = 'second';
this.$element.get(0).setSelectionRange(6,8);
}
, highlightMeridian: function() {
this.highlightedUnit = 'meridian';
if (this.showSeconds) {
this.$element.get(0).setSelectionRange(9,11);
} else {
this.$element.get(0).setSelectionRange(6,8);
}
}
, incrementHour: function() {
if (this.showMeridian) {
if (this.hour === 11) {
this.toggleMeridian();
} else if (this.hour === 12) {
return this.hour = 1;
}
}
if (this.hour === 23) {
return this.hour = 0;
}
this.hour = this.hour + 1;
}
, decrementHour: function() {
if (this.showMeridian) {
if (this.hour === 1) {
return this.hour = 12;
}
else if (this.hour === 12) {
this.toggleMeridian();
}
}
if (this.hour === 0) {
return this.hour = 23;
}
this.hour = this.hour - 1;
}
, incrementMinute: function() {
var newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
if (newVal > 59) {
this.incrementHour();
this.minute = newVal - 60;
} else {
this.minute = newVal;
}
}
, decrementMinute: function() {
var newVal = this.minute - this.minuteStep;
if (newVal < 0) {
this.decrementHour();
this.minute = newVal + 60;
} else {
this.minute = newVal;
}
}
, incrementSecond: function() {
var newVal = this.second + this.secondStep - (this.second % this.secondStep);
if (newVal > 59) {
this.incrementMinute();
this.second = newVal - 60;
} else {
this.second = newVal;
}
}
, decrementSecond: function() {
var newVal = this.second - this.secondStep;
if (newVal < 0) {
this.decrementMinute();
this.second = newVal + 60;
} else {
this.second = newVal;
}
}
, toggleMeridian: function() {
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
this.update();
}
, getTemplate: function() {
if (this.options.templates[this.options.template]) {
return this.options.templates[this.options.template];
}
if (this.showInputs) {
var hourTemplate = '<input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"/>';
var minuteTemplate = '<input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"/>';
var secondTemplate = '<input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"/>';
var meridianTemplate = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian" maxlength="2"/>';
} else {
var hourTemplate = '<span class="bootstrap-timepicker-hour"></span>';
var minuteTemplate = '<span class="bootstrap-timepicker-minute"></span>';
var secondTemplate = '<span class="bootstrap-timepicker-second"></span>';
var meridianTemplate = '<span class="bootstrap-timepicker-meridian"></span>';
}
var templateContent = '<table class="'+ (this.showSeconds ? 'show-seconds' : '') +' '+ (this.showMeridian ? 'show-meridian' : '') +'">'+
'<tr>'+
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
'<td class="separator">&nbsp;</td>'+
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
(this.showSeconds ?
'<td class="separator">&nbsp;</td>'+
'<td><a href="#" data-action="incrementSecond"><i class="icon-chevron-up"></i></a></td>'
: '') +
(this.showMeridian ?
'<td class="separator">&nbsp;</td>'+
'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>'
: '') +
'</tr>'+
'<tr>'+
'<td>'+ hourTemplate +'</td> '+
'<td class="separator">:</td>'+
'<td>'+ minuteTemplate +'</td> '+
(this.showSeconds ?
'<td class="separator">:</td>'+
'<td>'+ secondTemplate +'</td>'
: '') +
(this.showMeridian ?
'<td class="separator">&nbsp;</td>'+
'<td>'+ meridianTemplate +'</td>'
: '') +
'</tr>'+
'<tr>'+
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
'<td class="separator"></td>'+
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
(this.showSeconds ?
'<td class="separator">&nbsp;</td>'+
'<td><a href="#" data-action="decrementSecond"><i class="icon-chevron-down"></i></a></td>'
: '') +
(this.showMeridian ?
'<td class="separator">&nbsp;</td>'+
'<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>'
: '') +
'</tr>'+
'</table>';
var template;
switch(this.options.template) {
case 'modal':
template = '<div class="bootstrap-timepicker modal hide fade in" style="top: 30%; margin-top: 0; width: 200px; margin-left: -100px;" data-backdrop="'+ (this.modalBackdrop ? 'true' : 'false') +'">'+
'<div class="modal-header">'+
'<a href="#" class="close" data-dismiss="modal">×</a>'+
'<h4>Pick a Time</h4>'+
'</div>'+
'<div class="modal-content">'+
templateContent +
'</div>'+
'<div class="modal-footer">'+
'<a href="#" class="btn btn-primary" data-dismiss="modal">Ok</a>'+
'</div>'+
'</div>';
break;
case 'dropdown':
template = '<div class="bootstrap-timepicker dropdown-menu">'+
templateContent +
'</div>';
break;
}
return template;
}
};
/* TIMEPICKER PLUGIN DEFINITION
* =========================== */
$.fn.timepicker = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('timepicker')
, options = typeof option == 'object' && option;
if (!data) {
$this.data('timepicker', (data = new Timepicker(this, options)));
}
if (typeof option == 'string') {
data[option]();
}
})
}
$.fn.timepicker.defaults = {
minuteStep: 15
, secondStep: 15
, disableFocus: false
, defaultTime: 'current'
, showSeconds: false
, showInputs: true
, showMeridian: true
, template: 'dropdown'
, modalBackdrop: false
, templates: {} // set custom templates
}
$.fn.timepicker.Constructor = Timepicker
}(window.jQuery);
File diff suppressed because it is too large Load Diff
+145
View File
@@ -0,0 +1,145 @@
/**
* @version: 1.0 Alpha-1
* @author: Coolite Inc. http://www.coolite.com/
* @date: 2008-05-13
* @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All rights reserved.
* @license: Licensed under The MIT License. See http://www.datejs.com/license/.
* @website: http://www.datejs.com/
*/
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]};
(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,p=function(s,l){if(!l){l=2;}
return("000"+s).slice(l*-1);};$P.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};$P.setTimeToNow=function(){var n=new Date();this.setHours(n.getHours());this.setMinutes(n.getMinutes());this.setSeconds(n.getSeconds());this.setMilliseconds(n.getMilliseconds());return this;};$D.today=function(){return new Date().clearTime();};$D.compare=function(date1,date2){if(isNaN(date1)||isNaN(date2)){throw new Error(date1+" - "+date2);}else if(date1 instanceof Date&&date2 instanceof Date){return(date1<date2)?-1:(date1>date2)?1:0;}else{throw new TypeError(date1+" - "+date2);}};$D.equals=function(date1,date2){return(date1.compareTo(date2)===0);};$D.getDayNumberFromName=function(name){var n=$C.dayNames,m=$C.abbreviatedDayNames,o=$C.shortestDayNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s||o[i].toLowerCase()==s){return i;}}
return-1;};$D.getMonthNumberFromName=function(name){var n=$C.monthNames,m=$C.abbreviatedMonthNames,s=name.toLowerCase();for(var i=0;i<n.length;i++){if(n[i].toLowerCase()==s||m[i].toLowerCase()==s){return i;}}
return-1;};$D.isLeapYear=function(year){return((year%4===0&&year%100!==0)||year%400===0);};$D.getDaysInMonth=function(year,month){return[31,($D.isLeapYear(year)?29:28),31,30,31,30,31,31,30,31,30,31][month];};$D.getTimezoneAbbreviation=function(offset){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].offset===offset){return z[i].name;}}
return null;};$D.getTimezoneOffset=function(name){var z=$C.timezones,p;for(var i=0;i<z.length;i++){if(z[i].name===name.toUpperCase()){return z[i].offset;}}
return null;};$P.clone=function(){return new Date(this.getTime());};$P.compareTo=function(date){return Date.compare(this,date);};$P.equals=function(date){return Date.equals(this,date||new Date());};$P.between=function(start,end){return this.getTime()>=start.getTime()&&this.getTime()<=end.getTime();};$P.isAfter=function(date){return this.compareTo(date||new Date())===1;};$P.isBefore=function(date){return(this.compareTo(date||new Date())===-1);};$P.isToday=function(){return this.isSameDay(new Date());};$P.isSameDay=function(date){return this.clone().clearTime().equals(date.clone().clearTime());};$P.addMilliseconds=function(value){this.setMilliseconds(this.getMilliseconds()+value);return this;};$P.addSeconds=function(value){return this.addMilliseconds(value*1000);};$P.addMinutes=function(value){return this.addMilliseconds(value*60000);};$P.addHours=function(value){return this.addMilliseconds(value*3600000);};$P.addDays=function(value){this.setDate(this.getDate()+value);return this;};$P.addWeeks=function(value){return this.addDays(value*7);};$P.addMonths=function(value){var n=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+value);this.setDate(Math.min(n,$D.getDaysInMonth(this.getFullYear(),this.getMonth())));return this;};$P.addYears=function(value){return this.addMonths(value*12);};$P.add=function(config){if(typeof config=="number"){this._orient=config;return this;}
var x=config;if(x.milliseconds){this.addMilliseconds(x.milliseconds);}
if(x.seconds){this.addSeconds(x.seconds);}
if(x.minutes){this.addMinutes(x.minutes);}
if(x.hours){this.addHours(x.hours);}
if(x.weeks){this.addWeeks(x.weeks);}
if(x.months){this.addMonths(x.months);}
if(x.years){this.addYears(x.years);}
if(x.days){this.addDays(x.days);}
return this;};var $y,$m,$d;$P.getWeek=function(){var a,b,c,d,e,f,g,n,s,w;$y=(!$y)?this.getFullYear():$y;$m=(!$m)?this.getMonth()+1:$m;$d=(!$d)?this.getDate():$d;if($m<=2){a=$y-1;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=0;f=$d-1+(31*($m-1));}else{a=$y;b=(a/4|0)-(a/100|0)+(a/400|0);c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0);s=b-c;e=s+1;f=$d+((153*($m-3)+2)/5)+58+s;}
g=(a+b)%7;d=(f+g-e)%7;n=(f+3-d)|0;if(n<0){w=53-((g-s)/5|0);}else if(n>364+s){w=1;}else{w=(n/7|0)+1;}
$y=$m=$d=null;return w;};$P.getISOWeek=function(){$y=this.getUTCFullYear();$m=this.getUTCMonth()+1;$d=this.getUTCDate();return p(this.getWeek());};$P.setWeek=function(n){return this.moveToDayOfWeek(1).addWeeks(n-this.getWeek());};$D._validate=function(n,min,max,name){if(typeof n=="undefined"){return false;}else if(typeof n!="number"){throw new TypeError(n+" is not a Number.");}else if(n<min||n>max){throw new RangeError(n+" is not a valid value for "+name+".");}
return true;};$D.validateMillisecond=function(value){return $D._validate(value,0,999,"millisecond");};$D.validateSecond=function(value){return $D._validate(value,0,59,"second");};$D.validateMinute=function(value){return $D._validate(value,0,59,"minute");};$D.validateHour=function(value){return $D._validate(value,0,23,"hour");};$D.validateDay=function(value,year,month){return $D._validate(value,1,$D.getDaysInMonth(year,month),"day");};$D.validateMonth=function(value){return $D._validate(value,0,11,"month");};$D.validateYear=function(value){return $D._validate(value,0,9999,"year");};$P.set=function(config){if($D.validateMillisecond(config.millisecond)){this.addMilliseconds(config.millisecond-this.getMilliseconds());}
if($D.validateSecond(config.second)){this.addSeconds(config.second-this.getSeconds());}
if($D.validateMinute(config.minute)){this.addMinutes(config.minute-this.getMinutes());}
if($D.validateHour(config.hour)){this.addHours(config.hour-this.getHours());}
if($D.validateMonth(config.month)){this.addMonths(config.month-this.getMonth());}
if($D.validateYear(config.year)){this.addYears(config.year-this.getFullYear());}
if($D.validateDay(config.day,this.getFullYear(),this.getMonth())){this.addDays(config.day-this.getDate());}
if(config.timezone){this.setTimezone(config.timezone);}
if(config.timezoneOffset){this.setTimezoneOffset(config.timezoneOffset);}
if(config.week&&$D._validate(config.week,0,53,"week")){this.setWeek(config.week);}
return this;};$P.moveToFirstDayOfMonth=function(){return this.set({day:1});};$P.moveToLastDayOfMonth=function(){return this.set({day:$D.getDaysInMonth(this.getFullYear(),this.getMonth())});};$P.moveToNthOccurrence=function(dayOfWeek,occurrence){var shift=0;if(occurrence>0){shift=occurrence-1;}
else if(occurrence===-1){this.moveToLastDayOfMonth();if(this.getDay()!==dayOfWeek){this.moveToDayOfWeek(dayOfWeek,-1);}
return this;}
return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(dayOfWeek,+1).addWeeks(shift);};$P.moveToDayOfWeek=function(dayOfWeek,orient){var diff=(dayOfWeek-this.getDay()+7*(orient||+1))%7;return this.addDays((diff===0)?diff+=7*(orient||+1):diff);};$P.moveToMonth=function(month,orient){var diff=(month-this.getMonth()+12*(orient||+1))%12;return this.addMonths((diff===0)?diff+=12*(orient||+1):diff);};$P.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/86400000)+1;};$P.getTimezone=function(){return $D.getTimezoneAbbreviation(this.getUTCOffset());};$P.setTimezoneOffset=function(offset){var here=this.getTimezoneOffset(),there=Number(offset)*-6/10;return this.addMinutes(there-here);};$P.setTimezone=function(offset){return this.setTimezoneOffset($D.getTimezoneOffset(offset));};$P.hasDaylightSavingTime=function(){return(Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.isDaylightSavingTime=function(){return(this.hasDaylightSavingTime()&&new Date().getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset());};$P.getUTCOffset=function(){var n=this.getTimezoneOffset()*-10/6,r;if(n<0){r=(n-10000).toString();return r.charAt(0)+r.substr(2);}else{r=(n+10000).toString();return"+"+r.substr(1);}};$P.getElapsed=function(date){return(date||new Date())-this;};if(!$P.toISOString){$P.toISOString=function(){function f(n){return n<10?'0'+n:n;}
return'"'+this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z"';};}
$P._toString=$P.toString;$P.toString=function(format){var x=this;if(format&&format.length==1){var c=$C.formatPatterns;x.t=x.toString;switch(format){case"d":return x.t(c.shortDate);case"D":return x.t(c.longDate);case"F":return x.t(c.fullDateTime);case"m":return x.t(c.monthDay);case"r":return x.t(c.rfc1123);case"s":return x.t(c.sortableDateTime);case"t":return x.t(c.shortTime);case"T":return x.t(c.longTime);case"u":return x.t(c.universalSortableDateTime);case"y":return x.t(c.yearMonth);}}
var ord=function(n){switch(n*1){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};return format?format.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(m){if(m.charAt(0)==="\\"){return m.replace("\\","");}
x.h=x.getHours;switch(m){case"hh":return p(x.h()<13?(x.h()===0?12:x.h()):(x.h()-12));case"h":return x.h()<13?(x.h()===0?12:x.h()):(x.h()-12);case"HH":return p(x.h());case"H":return x.h();case"mm":return p(x.getMinutes());case"m":return x.getMinutes();case"ss":return p(x.getSeconds());case"s":return x.getSeconds();case"yyyy":return p(x.getFullYear(),4);case"yy":return p(x.getFullYear());case"dddd":return $C.dayNames[x.getDay()];case"ddd":return $C.abbreviatedDayNames[x.getDay()];case"dd":return p(x.getDate());case"d":return x.getDate();case"MMMM":return $C.monthNames[x.getMonth()];case"MMM":return $C.abbreviatedMonthNames[x.getMonth()];case"MM":return p((x.getMonth()+1));case"M":return x.getMonth()+1;case"t":return x.h()<12?$C.amDesignator.substring(0,1):$C.pmDesignator.substring(0,1);case"tt":return x.h()<12?$C.amDesignator:$C.pmDesignator;case"S":return ord(x.getDate());default:return m;}}):this._toString();};}());
(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo,$N=Number.prototype;$P._orient=+1;$P._nth=null;$P._is=false;$P._same=false;$P._isSecond=false;$N._dateElement="day";$P.next=function(){this._orient=+1;return this;};$D.next=function(){return $D.today().next();};$P.last=$P.prev=$P.previous=function(){this._orient=-1;return this;};$D.last=$D.prev=$D.previous=function(){return $D.today().last();};$P.is=function(){this._is=true;return this;};$P.same=function(){this._same=true;this._isSecond=false;return this;};$P.today=function(){return this.same().day();};$P.weekday=function(){if(this._is){this._is=false;return(!this.is().sat()&&!this.is().sun());}
return false;};$P.at=function(time){return(typeof time==="string")?$D.parse(this.toString("d")+" "+time):this.set(time);};$N.fromNow=$N.after=function(date){var c={};c[this._dateElement]=this;return((!date)?new Date():date.clone()).add(c);};$N.ago=$N.before=function(date){var c={};c[this._dateElement]=this*-1;return((!date)?new Date():date.clone()).add(c);};var dx=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),mx=("january february march april may june july august september october november december").split(/\s/),px=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),pxf=("Milliseconds Seconds Minutes Hours Date Week Month FullYear").split(/\s/),nth=("final first second third fourth fifth").split(/\s/),de;$P.toObject=function(){var o={};for(var i=0;i<px.length;i++){o[px[i].toLowerCase()]=this["get"+pxf[i]]();}
return o;};$D.fromObject=function(config){config.week=null;return Date.today().set(config);};var df=function(n){return function(){if(this._is){this._is=false;return this.getDay()==n;}
if(this._nth!==null){if(this._isSecond){this.addSeconds(this._orient*-1);}
this._isSecond=false;var ntemp=this._nth;this._nth=null;var temp=this.clone().moveToLastDayOfMonth();this.moveToNthOccurrence(n,ntemp);if(this>temp){throw new RangeError($D.getDayName(n)+" does not occur "+ntemp+" times in the month of "+$D.getMonthName(temp.getMonth())+" "+temp.getFullYear()+".");}
return this;}
return this.moveToDayOfWeek(n,this._orient);};};var sdf=function(n){return function(){var t=$D.today(),shift=n-t.getDay();if(n===0&&$C.firstDayOfWeek===1&&t.getDay()!==0){shift=shift+7;}
return t.addDays(shift);};};for(var i=0;i<dx.length;i++){$D[dx[i].toUpperCase()]=$D[dx[i].toUpperCase().substring(0,3)]=i;$D[dx[i]]=$D[dx[i].substring(0,3)]=sdf(i);$P[dx[i]]=$P[dx[i].substring(0,3)]=df(i);}
var mf=function(n){return function(){if(this._is){this._is=false;return this.getMonth()===n;}
return this.moveToMonth(n,this._orient);};};var smf=function(n){return function(){return $D.today().set({month:n,day:1});};};for(var j=0;j<mx.length;j++){$D[mx[j].toUpperCase()]=$D[mx[j].toUpperCase().substring(0,3)]=j;$D[mx[j]]=$D[mx[j].substring(0,3)]=smf(j);$P[mx[j]]=$P[mx[j].substring(0,3)]=mf(j);}
var ef=function(j){return function(){if(this._isSecond){this._isSecond=false;return this;}
if(this._same){this._same=this._is=false;var o1=this.toObject(),o2=(arguments[0]||new Date()).toObject(),v="",k=j.toLowerCase();for(var m=(px.length-1);m>-1;m--){v=px[m].toLowerCase();if(o1[v]!=o2[v]){return false;}
if(k==v){break;}}
return true;}
if(j.substring(j.length-1)!="s"){j+="s";}
return this["add"+j](this._orient);};};var nf=function(n){return function(){this._dateElement=n;return this;};};for(var k=0;k<px.length;k++){de=px[k].toLowerCase();$P[de]=$P[de+"s"]=ef(px[k]);$N[de]=$N[de+"s"]=nf(de);}
$P._ss=ef("Second");var nthfn=function(n){return function(dayOfWeek){if(this._same){return this._ss(arguments[0]);}
if(dayOfWeek||dayOfWeek===0){return this.moveToNthOccurrence(dayOfWeek,n);}
this._nth=n;if(n===2&&(dayOfWeek===undefined||dayOfWeek===null)){this._isSecond=true;return this.addSeconds(this._orient);}
return this;};};for(var l=0;l<nth.length;l++){$P[nth[l]]=(l===0)?nthfn(-1):nthfn(l);}}());
(function(){Date.Parsing={Exception:function(s){this.message="Parse error at '"+s.substring(0,10)+" ...'";}};var $P=Date.Parsing;var _=$P.Operators={rtoken:function(r){return function(s){var mx=s.match(r);if(mx){return([mx[0],s.substring(mx[0].length)]);}else{throw new $P.Exception(s);}};},token:function(s){return function(s){return _.rtoken(new RegExp("^\s*"+s+"\s*"))(s);};},stoken:function(s){return _.rtoken(new RegExp("^"+s));},until:function(p){return function(s){var qx=[],rx=null;while(s.length){try{rx=p.call(this,s);}catch(e){qx.push(rx[0]);s=rx[1];continue;}
break;}
return[qx,s];};},many:function(p){return function(s){var rx=[],r=null;while(s.length){try{r=p.call(this,s);}catch(e){return[rx,s];}
rx.push(r[0]);s=r[1];}
return[rx,s];};},optional:function(p){return function(s){var r=null;try{r=p.call(this,s);}catch(e){return[null,s];}
return[r[0],r[1]];};},not:function(p){return function(s){try{p.call(this,s);}catch(e){return[null,s];}
throw new $P.Exception(s);};},ignore:function(p){return p?function(s){var r=null;r=p.call(this,s);return[null,r[1]];}:null;},product:function(){var px=arguments[0],qx=Array.prototype.slice.call(arguments,1),rx=[];for(var i=0;i<px.length;i++){rx.push(_.each(px[i],qx));}
return rx;},cache:function(rule){var cache={},r=null;return function(s){try{r=cache[s]=(cache[s]||rule.call(this,s));}catch(e){r=cache[s]=e;}
if(r instanceof $P.Exception){throw r;}else{return r;}};},any:function(){var px=arguments;return function(s){var r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){r=null;}
if(r){return r;}}
throw new $P.Exception(s);};},each:function(){var px=arguments;return function(s){var rx=[],r=null;for(var i=0;i<px.length;i++){if(px[i]==null){continue;}
try{r=(px[i].call(this,s));}catch(e){throw new $P.Exception(s);}
rx.push(r[0]);s=r[1];}
return[rx,s];};},all:function(){var px=arguments,_=_;return _.each(_.optional(px));},sequence:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;if(px.length==1){return px[0];}
return function(s){var r=null,q=null;var rx=[];for(var i=0;i<px.length;i++){try{r=px[i].call(this,s);}catch(e){break;}
rx.push(r[0]);try{q=d.call(this,r[1]);}catch(ex){q=null;break;}
s=q[1];}
if(!r){throw new $P.Exception(s);}
if(q){throw new $P.Exception(q[1]);}
if(c){try{r=c.call(this,r[1]);}catch(ey){throw new $P.Exception(r[1]);}}
return[rx,(r?r[1]:s)];};},between:function(d1,p,d2){d2=d2||d1;var _fn=_.each(_.ignore(d1),p,_.ignore(d2));return function(s){var rx=_fn.call(this,s);return[[rx[0][0],r[0][2]],rx[1]];};},list:function(p,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return(p instanceof Array?_.each(_.product(p.slice(0,-1),_.ignore(d)),p.slice(-1),_.ignore(c)):_.each(_.many(_.each(p,_.ignore(d))),px,_.ignore(c)));},set:function(px,d,c){d=d||_.rtoken(/^\s*/);c=c||null;return function(s){var r=null,p=null,q=null,rx=null,best=[[],s],last=false;for(var i=0;i<px.length;i++){q=null;p=null;r=null;last=(px.length==1);try{r=px[i].call(this,s);}catch(e){continue;}
rx=[[r[0]],r[1]];if(r[1].length>0&&!last){try{q=d.call(this,r[1]);}catch(ex){last=true;}}else{last=true;}
if(!last&&q[1].length===0){last=true;}
if(!last){var qx=[];for(var j=0;j<px.length;j++){if(i!=j){qx.push(px[j]);}}
p=_.set(qx,d).call(this,q[1]);if(p[0].length>0){rx[0]=rx[0].concat(p[0]);rx[1]=p[1];}}
if(rx[1].length<best[1].length){best=rx;}
if(best[1].length===0){break;}}
if(best[0].length===0){return best;}
if(c){try{q=c.call(this,best[1]);}catch(ey){throw new $P.Exception(best[1]);}
best[1]=q[1];}
return best;};},forward:function(gr,fname){return function(s){return gr[fname].call(this,s);};},replace:function(rule,repl){return function(s){var r=rule.call(this,s);return[repl,r[1]];};},process:function(rule,fn){return function(s){var r=rule.call(this,s);return[fn.call(this,r[0]),r[1]];};},min:function(min,rule){return function(s){var rx=rule.call(this,s);if(rx[0].length<min){throw new $P.Exception(s);}
return rx;};}};var _generator=function(op){return function(){var args=null,rx=[];if(arguments.length>1){args=Array.prototype.slice.call(arguments);}else if(arguments[0]instanceof Array){args=arguments[0];}
if(args){for(var i=0,px=args.shift();i<px.length;i++){args.unshift(px[i]);rx.push(op.apply(null,args));args.shift();return rx;}}else{return op.apply(null,arguments);}};};var gx="optional not ignore cache".split(/\s/);for(var i=0;i<gx.length;i++){_[gx[i]]=_generator(_[gx[i]]);}
var _vector=function(op){return function(){if(arguments[0]instanceof Array){return op.apply(null,arguments[0]);}else{return op.apply(null,arguments);}};};var vx="each any all".split(/\s/);for(var j=0;j<vx.length;j++){_[vx[j]]=_vector(_[vx[j]]);}}());(function(){var $D=Date,$P=$D.prototype,$C=$D.CultureInfo;var flattenAndCompact=function(ax){var rx=[];for(var i=0;i<ax.length;i++){if(ax[i]instanceof Array){rx=rx.concat(flattenAndCompact(ax[i]));}else{if(ax[i]){rx.push(ax[i]);}}}
return rx;};$D.Grammar={};$D.Translator={hour:function(s){return function(){this.hour=Number(s);};},minute:function(s){return function(){this.minute=Number(s);};},second:function(s){return function(){this.second=Number(s);};},meridian:function(s){return function(){this.meridian=s.slice(0,1).toLowerCase();};},timezone:function(s){return function(){var n=s.replace(/[^\d\+\-]/g,"");if(n.length){this.timezoneOffset=Number(n);}else{this.timezone=s.toLowerCase();}};},day:function(x){var s=x[0];return function(){this.day=Number(s.match(/\d+/)[0]);};},month:function(s){return function(){this.month=(s.length==3)?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(s)/4:Number(s)-1;};},year:function(s){return function(){var n=Number(s);this.year=((s.length>2)?n:(n+(((n+2000)<$C.twoDigitYearMax)?2000:1900)));};},rday:function(s){return function(){switch(s){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break;}};},finishExact:function(x){x=(x instanceof Array)?x:[x];for(var i=0;i<x.length;i++){if(x[i]){x[i].call(this);}}
var now=new Date();if((this.hour||this.minute)&&(!this.month&&!this.year&&!this.day)){this.day=now.getDate();}
if(!this.year){this.year=now.getFullYear();}
if(!this.month&&this.month!==0){this.month=now.getMonth();}
if(!this.day){this.day=1;}
if(!this.hour){this.hour=0;}
if(!this.minute){this.minute=0;}
if(!this.second){this.second=0;}
if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
if(this.day>$D.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");}
var r=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){r.set({timezone:this.timezone});}else if(this.timezoneOffset){r.set({timezoneOffset:this.timezoneOffset});}
return r;},finish:function(x){x=(x instanceof Array)?flattenAndCompact(x):[x];if(x.length===0){return null;}
for(var i=0;i<x.length;i++){if(typeof x[i]=="function"){x[i].call(this);}}
var today=$D.today();if(this.now&&!this.unit&&!this.operator){return new Date();}else if(this.now){today=new Date();}
var expression=!!(this.days&&this.days!==null||this.orient||this.operator);var gap,mod,orient;orient=((this.orient=="past"||this.operator=="subtract")?-1:1);if(!this.now&&"hour minute second".indexOf(this.unit)!=-1){today.setTimeToNow();}
if(this.month||this.month===0){if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;expression=true;}}
if(!expression&&this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(!this.month){this.month=temp.getMonth();}
this.year=temp.getFullYear();}
if(expression&&this.weekday&&this.unit!="month"){this.unit="day";gap=($D.getDayNumberFromName(this.weekday)-today.getDay());mod=7;this.days=gap?((gap+(orient*mod))%mod):(orient*mod);}
if(this.month&&this.unit=="day"&&this.operator){this.value=(this.month+1);this.month=null;}
if(this.value!=null&&this.month!=null&&this.year!=null){this.day=this.value*1;}
if(this.month&&!this.day&&this.value){today.set({day:this.value*1});if(!expression){this.day=this.value*1;}}
if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;expression=true;}
if(expression&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";gap=(this.month-today.getMonth());mod=12;this.months=gap?((gap+(orient*mod))%mod):(orient*mod);this.month=null;}
if(!this.unit){this.unit="day";}
if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+((this.operator=="add")?1:-1)+(this.value||0)*orient;}else if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;}
this[this.unit+"s"]=this.value*orient;}
if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12;}else if(this.meridian=="a"&&this.hour==12){this.hour=0;}}
if(this.weekday&&!this.day&&!this.days){var temp=Date[this.weekday]();this.day=temp.getDate();if(temp.getMonth()!==today.getMonth()){this.month=temp.getMonth();}}
if((this.month||this.month===0)&&!this.day){this.day=1;}
if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month){return Date.today().setWeek(this.value);}
if(expression&&this.timezone&&this.day&&this.days){this.day=this.days;}
return(expression)?today.add(this):today.set(this);}};var _=$D.Parsing.Operators,g=$D.Grammar,t=$D.Translator,_fn;g.datePartDelimiter=_.rtoken(/^([\s\-\.\,\/\x27]+)/);g.timePartDelimiter=_.stoken(":");g.whiteSpace=_.rtoken(/^\s*/);g.generalDelimiter=_.rtoken(/^(([\s\,]|at|@|on)+)/);var _C={};g.ctoken=function(keys){var fn=_C[keys];if(!fn){var c=$C.regexPatterns;var kx=keys.split(/\s+/),px=[];for(var i=0;i<kx.length;i++){px.push(_.replace(_.rtoken(c[kx[i]]),kx[i]));}
fn=_C[keys]=_.any.apply(null,px);}
return fn;};g.ctoken2=function(key){return _.rtoken($C.regexPatterns[key]);};g.h=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),t.hour));g.hh=_.cache(_.process(_.rtoken(/^(0[0-9]|1[0-2])/),t.hour));g.H=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),t.hour));g.HH=_.cache(_.process(_.rtoken(/^([0-1][0-9]|2[0-3])/),t.hour));g.m=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.minute));g.mm=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.minute));g.s=_.cache(_.process(_.rtoken(/^([0-5][0-9]|[0-9])/),t.second));g.ss=_.cache(_.process(_.rtoken(/^[0-5][0-9]/),t.second));g.hms=_.cache(_.sequence([g.H,g.m,g.s],g.timePartDelimiter));g.t=_.cache(_.process(g.ctoken2("shortMeridian"),t.meridian));g.tt=_.cache(_.process(g.ctoken2("longMeridian"),t.meridian));g.z=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zz=_.cache(_.process(_.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),t.timezone));g.zzz=_.cache(_.process(g.ctoken2("timezone"),t.timezone));g.timeSuffix=_.each(_.ignore(g.whiteSpace),_.set([g.tt,g.zzz]));g.time=_.each(_.optional(_.ignore(_.stoken("T"))),g.hms,g.timeSuffix);g.d=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1]|\d)/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.dd=_.cache(_.process(_.each(_.rtoken(/^([0-2]\d|3[0-1])/),_.optional(g.ctoken2("ordinalSuffix"))),t.day));g.ddd=g.dddd=_.cache(_.process(g.ctoken("sun mon tue wed thu fri sat"),function(s){return function(){this.weekday=s;};}));g.M=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d|\d)/),t.month));g.MM=_.cache(_.process(_.rtoken(/^(1[0-2]|0\d)/),t.month));g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),t.month));g.y=_.cache(_.process(_.rtoken(/^(\d\d?)/),t.year));g.yy=_.cache(_.process(_.rtoken(/^(\d\d)/),t.year));g.yyy=_.cache(_.process(_.rtoken(/^(\d\d?\d?\d?)/),t.year));g.yyyy=_.cache(_.process(_.rtoken(/^(\d\d\d\d)/),t.year));_fn=function(){return _.each(_.any.apply(null,arguments),_.not(g.ctoken2("timeContext")));};g.day=_fn(g.d,g.dd);g.month=_fn(g.M,g.MMM);g.year=_fn(g.yyyy,g.yy);g.orientation=_.process(g.ctoken("past future"),function(s){return function(){this.orient=s;};});g.operator=_.process(g.ctoken("add subtract"),function(s){return function(){this.operator=s;};});g.rday=_.process(g.ctoken("yesterday tomorrow today now"),t.rday);g.unit=_.process(g.ctoken("second minute hour day week month year"),function(s){return function(){this.unit=s;};});g.value=_.process(_.rtoken(/^\d\d?(st|nd|rd|th)?/),function(s){return function(){this.value=s.replace(/\D/g,"");};});g.expression=_.set([g.rday,g.operator,g.value,g.unit,g.orientation,g.ddd,g.MMM]);_fn=function(){return _.set(arguments,g.datePartDelimiter);};g.mdy=_fn(g.ddd,g.month,g.day,g.year);g.ymd=_fn(g.ddd,g.year,g.month,g.day);g.dmy=_fn(g.ddd,g.day,g.month,g.year);g.date=function(s){return((g[$C.dateElementOrder]||g.mdy).call(this,s));};g.format=_.process(_.many(_.any(_.process(_.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(fmt){if(g[fmt]){return g[fmt];}else{throw $D.Parsing.Exception(fmt);}}),_.process(_.rtoken(/^[^dMyhHmstz]+/),function(s){return _.ignore(_.stoken(s));}))),function(rules){return _.process(_.each.apply(null,rules),t.finishExact);});var _F={};var _get=function(f){return _F[f]=(_F[f]||g.format(f)[0]);};g.formats=function(fx){if(fx instanceof Array){var rx=[];for(var i=0;i<fx.length;i++){rx.push(_get(fx[i]));}
return _.any.apply(null,rx);}else{return _get(fx);}};g._formats=g.formats(["\"yyyy-MM-ddTHH:mm:ssZ\"","yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);g._start=_.process(_.set([g.date,g.time,g.expression],g.generalDelimiter,g.whiteSpace),t.finish);g.start=function(s){try{var r=g._formats.call({},s);if(r[1].length===0){return r;}}catch(e){}
return g._start.call({},s);};$D._parse=$D.parse;$D.parse=function(s){var r=null;if(!s){return null;}
if(s instanceof Date){return s;}
try{r=$D.Grammar.start.call({},s.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"));}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};$D.getParseFunction=function(fx){var fn=$D.Grammar.formats(fx);return function(s){var r=null;try{r=fn.call({},s);}catch(e){return null;}
return((r[1].length===0)?r[0]:null);};};$D.parseExact=function(s,fx){return $D.getParseFunction(fx)(s);};}());
@@ -0,0 +1,724 @@
/**
* @version: 1.1
* @author: Dan Grossman http://www.dangrossman.info/
* @date: 2013-03-04
* @copyright: Copyright (c) 2012 Dan Grossman. All rights reserved.
* @license: Licensed under Apache License v2.0. See http://www.apache.org/licenses/LICENSE-2.0
* @website: http://www.improvely.com/
*/
!function ($) {
var DateRangePicker = function (element, options, cb) {
var hasOptions = typeof options == 'object';
var localeObject;
//state
this.startDate = Date.today();
this.endDate = Date.today();
this.minDate = false;
this.maxDate = false;
this.changed = false;
this.cleared = false;
this.showDropdowns = false;
this.ranges = {};
this.dateLimit = false;
this.opens = 'right';
this.cb = function () { };
this.format = 'MM/dd/yyyy';
this.separator = ' - ';
this.showWeekNumbers = false;
this.buttonClasses = ['btn-success'];
this.applyClass = 'btn btn-small btn-success';
this.clearClass = 'btn btn-small';
this.locale = {
applyLabel: 'Apply',
clearLabel:"Clear",
fromLabel: 'From',
toLabel: 'To',
weekLabel: 'W',
customRangeLabel: 'Custom Range',
daysOfWeek: Date.CultureInfo.shortestDayNames,
monthNames: Date.CultureInfo.monthNames,
firstDay: 0
};
localeObject = this.locale;
this.leftCalendar = {
month: Date.today().set({ day: 1, month: this.startDate.getMonth(), year: this.startDate.getFullYear() }),
calendar: Array()
};
this.rightCalendar = {
month: Date.today().set({ day: 1, month: this.endDate.getMonth(), year: this.endDate.getFullYear() }),
calendar: Array()
};
//element that triggered the date range picker
this.element = $(element);
if (this.element.hasClass('pull-right'))
this.opens = 'left';
if (this.element.is('input')) {
this.element.on({
click: $.proxy(this.show, this),
focus: $.proxy(this.show, this)
});
} else {
this.element.on('click', $.proxy(this.show, this));
}
if (hasOptions) {
if(typeof options.locale == 'object') {
$.each(localeObject, function (property, value) {
localeObject[property] = options.locale[property] || value;
});
}
if (options.applyClass) {
this.applyClass = options.applyClass;
}
if (options.clearClass) {
this.clearClass = options.clearClass;
}
}
var DRPTemplate = '<div class="daterangepicker dropdown-menu">' +
'<div class="calendar left"></div>' +
'<div class="calendar right"></div>' +
'<div class="ranges">' +
'<div class="range_inputs">' +
'<div class="daterangepicker_start_input" style="float: left">' +
'<label for="daterangepicker_start">' + this.locale.fromLabel + '</label>' +
'<input class="input-mini" type="text" name="daterangepicker_start" value="" disabled="disabled" />' +
'</div>' +
'<div class="daterangepicker_end_input" style="float: left; padding-left: 11px">' +
'<label for="daterangepicker_end">' + this.locale.toLabel + '</label>' +
'<input class="input-mini" type="text" name="daterangepicker_end" value="" disabled="disabled" />' +
'</div>' +
'<button class="' + this.applyClass + ' applyBtn" disabled="disabled">' + this.locale.applyLabel + '</button>&nbsp;' +
'<button class="' + this.clearClass + ' clearBtn">' + this.locale.clearLabel + '</button>' +
'</div>' +
'</div>' +
'</div>';
this.container = $(DRPTemplate).appendTo('body');
if (hasOptions) {
if (typeof options.format == 'string')
this.format = options.format;
if (typeof options.separator == 'string')
this.separator = options.separator;
if (typeof options.startDate == 'string')
this.startDate = Date.parseExact(options.startDate, this.format);
if (typeof options.endDate == 'string')
this.endDate = Date.parseExact(options.endDate, this.format);
if (typeof options.minDate == 'string')
this.minDate = Date.parseExact(options.minDate, this.format);
if (typeof options.maxDate == 'string')
this.maxDate = Date.parseExact(options.maxDate, this.format);
if (typeof options.startDate == 'object')
this.startDate = options.startDate;
if (typeof options.endDate == 'object')
this.endDate = options.endDate;
if (typeof options.minDate == 'object')
this.minDate = options.minDate;
if (typeof options.maxDate == 'object')
this.maxDate = options.maxDate;
if (typeof options.ranges == 'object') {
for (var range in options.ranges) {
var start = options.ranges[range][0];
var end = options.ranges[range][1];
if (typeof start == 'string')
start = Date.parse(start);
if (typeof end == 'string')
end = Date.parse(end);
// If we have a min/max date set, bound this range
// to it, but only if it would otherwise fall
// outside of the min/max.
if (this.minDate && start < this.minDate)
start = this.minDate;
if (this.maxDate && end > this.maxDate)
end = this.maxDate;
// If the end of the range is before the minimum (if min is set) OR
// the start of the range is after the max (also if set) don't display this
// range option.
if ((this.minDate && end < this.minDate) || (this.maxDate && start > this.maxDate))
{
continue;
}
this.ranges[range] = [start, end];
}
var list = '<ul>';
for (var range in this.ranges) {
list += '<li>' + range + '</li>';
}
list += '<li>' + this.locale.customRangeLabel + '</li>';
list += '</ul>';
this.container.find('.ranges').prepend(list);
}
if (typeof options.dateLimit == 'object')
this.dateLimit = options.dateLimit;
// update day names order to firstDay
if (typeof options.locale == 'object') {
if (typeof options.locale.firstDay == 'number') {
this.locale.firstDay = options.locale.firstDay;
var iterator = options.locale.firstDay;
while (iterator > 0) {
this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
iterator--;
}
}
}
if (typeof options.opens == 'string')
this.opens = options.opens;
if (typeof options.showWeekNumbers == 'boolean') {
this.showWeekNumbers = options.showWeekNumbers;
}
if (typeof options.buttonClasses == 'string') {
this.buttonClasses = [options.buttonClasses];
}
if (typeof options.buttonClasses == 'object') {
this.buttonClasses = options.buttonClasses;
}
if (typeof options.showDropdowns == 'boolean') {
this.showDropdowns = options.showDropdowns;
}
}
//apply CSS classes to buttons
var c = this.container;
$.each(this.buttonClasses, function (idx, val) {
c.find('button').addClass(val);
});
if (this.opens == 'right') {
//swap calendar positions
var left = this.container.find('.calendar.left');
var right = this.container.find('.calendar.right');
left.removeClass('left').addClass('right');
right.removeClass('right').addClass('left');
}
if (typeof options == 'undefined' || typeof options.ranges == 'undefined')
this.container.find('.calendar').show();
if (typeof cb == 'function')
this.cb = cb;
this.container.addClass('opens' + this.opens);
//try parse date if in text input
if (!hasOptions || (typeof options.startDate == 'undefined' && typeof options.endDate == 'undefined')) {
if ($(this.element).is('input[type=text]')) {
var val = $(this.element).val();
var split = val.split(this.separator);
if(split.length == 2) {
this.startDate = Date.parseExact(split[0], this.format);
this.endDate = Date.parseExact(split[1], this.format);
}
}
}
//event listeners
this.container.on('mousedown', $.proxy(this.mousedown, this));
this.container.find('.calendar').on('click', '.prev', $.proxy(this.clickPrev, this));
this.container.find('.calendar').on('click', '.next', $.proxy(this.clickNext, this));
this.container.find('.ranges').on('click', 'button.applyBtn', $.proxy(this.clickApply, this));
this.container.find('.ranges').on('click', 'button.clearBtn', $.proxy(this.clickClear, this));
this.container.find('.calendar').on('click', 'td.available', $.proxy(this.clickDate, this));
this.container.find('.calendar').on('mouseenter', 'td.available', $.proxy(this.enterDate, this));
this.container.find('.calendar').on('mouseleave', 'td.available', $.proxy(this.updateView, this));
this.container.find('.ranges').on('click', 'li', $.proxy(this.clickRange, this));
this.container.find('.ranges').on('mouseenter', 'li', $.proxy(this.enterRange, this));
this.container.find('.ranges').on('mouseleave', 'li', $.proxy(this.updateView, this));
this.container.find('.calendar').on('change', 'select.yearselect', $.proxy(this.updateYear, this));
this.container.find('.calendar').on('change', 'select.monthselect', $.proxy(this.updateMonth, this));
this.element.on('keyup', $.proxy(this.updateFromControl, this));
this.updateView();
this.updateCalendars();
};
DateRangePicker.prototype = {
constructor: DateRangePicker,
mousedown: function (e) {
e.stopPropagation();
//allow select list to function normally
if(!this.showDropdowns || $(e.target).not('select').length)
e.preventDefault();
},
updateView: function () {
this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
this.container.find('input[name=daterangepicker_start]').val(this.startDate.toString(this.format));
this.container.find('input[name=daterangepicker_end]').val(this.endDate.toString(this.format));
if (this.startDate.equals(this.endDate) || this.startDate.isBefore(this.endDate)) {
this.container.find('button.applyBtn').removeAttr('disabled');
} else {
this.container.find('button.applyBtn').attr('disabled', 'disabled');
}
},
updateFromControl: function () {
if (!this.element.is('input')) return;
var dateString = this.element.val().split(this.separator);
var start = Date.parseExact(dateString[0], this.format);
var end = Date.parseExact(dateString[1], this.format);
if (start == null || end == null) return;
if (end.isBefore(start)) return;
this.startDate = start;
this.endDate = end;
this.updateView();
this.cb(this.startDate, this.endDate);
this.updateCalendars();
},
notify: function () {
if (!this.cleared) {
this.updateView();
}
if (this.element.is('input')) {
this.element.val(this.cleared ? '' : this.startDate.toString(this.format) + this.separator + this.endDate.toString(this.format));
}
var arg1 = (this.cleared ? null : this.startDate),
arg2 = (this.cleared ? null : this.endDate);
this.cleared = false;
this.cb(arg1,arg2);
},
move: function () {
if (this.opens == 'left') {
this.container.css({
top: this.element.offset().top + this.element.outerHeight(),
right: $(window).width() - this.element.offset().left - this.element.outerWidth(),
left: 'auto'
});
} else {
this.container.css({
top: this.element.offset().top + this.element.outerHeight(),
left: this.element.offset().left,
right: 'auto'
});
}
},
show: function (e) {
this.container.show();
this.move();
if (e) {
e.stopPropagation();
e.preventDefault();
}
this.changed = false;
this.element.trigger('shown',{target:e.target,picker:this});
$(document).on('mousedown', $.proxy(this.hide, this));
},
hide: function (e) {
this.container.hide();
$(document).off('mousedown', this.hide);
if (this.changed) {
this.changed = false;
this.notify();
}
},
enterRange: function (e) {
var label = e.target.innerHTML;
if (label == this.locale.customRangeLabel) {
this.updateView();
} else {
var dates = this.ranges[label];
this.container.find('input[name=daterangepicker_start]').val(dates[0].toString(this.format));
this.container.find('input[name=daterangepicker_end]').val(dates[1].toString(this.format));
}
},
clickRange: function (e) {
var label = e.target.innerHTML;
if (label == this.locale.customRangeLabel) {
this.container.find('.calendar').show();
} else {
var dates = this.ranges[label];
this.startDate = dates[0];
this.endDate = dates[1];
this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
this.updateCalendars();
this.changed = true;
this.container.find('.calendar').hide();
this.hide();
}
},
clickPrev: function (e) {
var cal = $(e.target).parents('.calendar');
if (cal.hasClass('left')) {
this.leftCalendar.month.add({ months: -1 });
} else {
this.rightCalendar.month.add({ months: -1 });
}
this.updateCalendars();
},
clickNext: function (e) {
var cal = $(e.target).parents('.calendar');
if (cal.hasClass('left')) {
this.leftCalendar.month.add({ months: 1 });
} else {
this.rightCalendar.month.add({ months: 1 });
}
this.updateCalendars();
},
enterDate: function (e) {
var title = $(e.target).attr('title');
var row = title.substr(1, 1);
var col = title.substr(3, 1);
var cal = $(e.target).parents('.calendar');
if (cal.hasClass('left')) {
this.container.find('input[name=daterangepicker_start]').val(this.leftCalendar.calendar[row][col].toString(this.format));
} else {
this.container.find('input[name=daterangepicker_end]').val(this.rightCalendar.calendar[row][col].toString(this.format));
}
},
clickDate: function (e) {
var title = $(e.target).attr('title');
var row = title.substr(1, 1);
var col = title.substr(3, 1);
var cal = $(e.target).parents('.calendar');
if (cal.hasClass('left')) {
startDate = this.leftCalendar.calendar[row][col];
endDate = this.endDate;
if (typeof this.dateLimit == 'object') {
var maxDate = new Date(startDate).add(this.dateLimit);
if (endDate.isAfter(maxDate)) {
endDate = maxDate;
}
}
this.element.trigger('clicked', {
dir: 'left',
picker: this
});
} else {
startDate = this.startDate;
endDate = this.rightCalendar.calendar[row][col];
if (typeof this.dateLimit == 'object') {
var negConfig = {
days: 0 - this.dateLimit.days,
months: 0 - this.dateLimit.months,
years: 0 - this.dateLimit.years
};
var minDate = new Date(endDate).add(negConfig);
if (startDate.isBefore(minDate)) {
startDate = minDate;
}
}
this.element.trigger('clicked', {
dir: 'right',
picker: this
});
}
cal.find('td').removeClass('active');
if (startDate.equals(endDate) || startDate.isBefore(endDate)) {
$(e.target).addClass('active');
if (!startDate.equals(this.startDate) || !endDate.equals(this.endDate))
this.changed = true;
this.startDate = startDate;
this.endDate = endDate;
} else if (startDate.isAfter(endDate)) {
$(e.target).addClass('active');
this.changed = true;
this.startDate = startDate;
this.endDate = startDate.clone().add(1).days();
}
this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: this.startDate.getFullYear() });
this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: this.endDate.getFullYear() });
this.updateCalendars();
},
clickApply: function (e) {
this.hide();
},
clickClear: function (e) {
this.changed = true;
this.cleared = true;
this.hide();
},
updateYear: function(e) {
var year = parseInt($(e.target).val());
var isLeft = $(e.target).closest('.calendar').hasClass('left');
if(isLeft) {
this.leftCalendar.month.set({ month: this.startDate.getMonth(), year: year });
} else {
this.rightCalendar.month.set({ month: this.endDate.getMonth(), year: year });
}
this.updateCalendars();
},
updateMonth: function(e) {
var month = parseInt($(e.target).val());
var isLeft = $(e.target).closest('.calendar').hasClass('left');
if(isLeft) {
this.leftCalendar.month.set({ month: month, year: this.startDate.getFullYear() });
} else {
this.rightCalendar.month.set({ month: month, year: this.endDate.getFullYear() });
}
this.updateCalendars();
},
updateCalendars: function () {
this.leftCalendar.calendar = this.buildCalendar(this.leftCalendar.month.getMonth(), this.leftCalendar.month.getFullYear());
this.rightCalendar.calendar = this.buildCalendar(this.rightCalendar.month.getMonth(), this.rightCalendar.month.getFullYear());
this.container.find('.calendar.left').html(this.renderCalendar(this.leftCalendar.calendar, this.startDate, this.minDate, this.maxDate));
this.container.find('.calendar.right').html(this.renderCalendar(this.rightCalendar.calendar, this.endDate, this.startDate, this.maxDate));
this.container.find('.ranges li').removeClass('active');
var customRange = true;
var i = 0;
for (var range in this.ranges) {
if (this.startDate.equals(this.ranges[range][0]) && this.endDate.equals(this.ranges[range][1])) {
customRange = false;
this.container.find('.ranges li:eq(' + i + ')').addClass('active');
}
i++;
}
if (customRange)
this.container.find('.ranges li:last').addClass('active');
this.element.trigger('updated', this);
},
buildCalendar: function (month, year) {
var firstDay = Date.today().set({ day: 1, month: month, year: year });
var lastMonth = firstDay.clone().add(-1).day().getMonth();
var lastYear = firstDay.clone().add(-1).day().getFullYear();
var daysInMonth = Date.getDaysInMonth(year, month);
var daysInLastMonth = Date.getDaysInMonth(lastYear, lastMonth);
var dayOfWeek = firstDay.getDay();
//initialize a 6 rows x 7 columns array for the calendar
var calendar = Array();
for (var i = 0; i < 6; i++) {
calendar[i] = Array();
}
//populate the calendar with date objects
var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
if (startDay > daysInLastMonth)
startDay -= 7;
if (dayOfWeek == this.locale.firstDay)
startDay = daysInLastMonth - 6;
var curDate = Date.today().set({ day: startDay, month: lastMonth, year: lastYear });
for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = curDate.clone().add(1).day()) {
if (i > 0 && col % 7 == 0) {
col = 0;
row++;
}
calendar[row][col] = curDate;
}
return calendar;
},
renderDropdowns: function (selected, minDate, maxDate) {
var currentMonth = selected.getMonth();
var monthHtml = '<select class="monthselect">';
var inMinYear = false;
var inMaxYear = false;
for (var m = 0; m < 12; m++) {
if ((!inMinYear || m >= minDate.getMonth()) && (!inMaxYear || m <= maxDate.getMonth())) {
monthHtml += "<option value='" + m + "'" +
(m === currentMonth ? " selected='selected'" : "") +
">" + this.locale.monthNames[m] + "</option>";
}
}
monthHtml += "</select>";
var currentYear = selected.getFullYear();
var maxYear = (maxDate && maxDate.getFullYear()) || (currentYear + 5);
var minYear = (minDate && minDate.getFullYear()) || (currentYear - 50);
var yearHtml = '<select class="yearselect">'
for (var y = minYear; y <= maxYear; y++) {
yearHtml += '<option value="' + y + '"' +
(y === currentYear ? ' selected="selected"' : '') +
'>' + y + '</option>';
}
yearHtml += '</select>';
return monthHtml + yearHtml;
},
renderCalendar: function (calendar, selected, minDate, maxDate) {
var html = '<table class="table-condensed">';
html += '<thead>';
html += '<tr>';
// add empty cell for week number
if (this.showWeekNumbers)
html += '<th></th>';
if (!minDate || minDate < calendar[1][1]) {
html += '<th class="prev available"><i class="icon-arrow-left"></i></th>';
} else {
html += '<th></th>';
}
var dateHtml = this.locale.monthNames[calendar[1][1].getMonth()] + calendar[1][1].toString(" yyyy");
if (this.showDropdowns) {
dateHtml = this.renderDropdowns(calendar[1][1], minDate, maxDate);
}
html += '<th colspan="5" style="width: auto">' + dateHtml + '</th>';
if (!maxDate || maxDate > calendar[1][1]) {
html += '<th class="next available"><i class="icon-arrow-right"></i></th>';
} else {
html += '<th></th>';
}
html += '</tr>';
html += '<tr>';
// add week number label
if (this.showWeekNumbers)
html += '<th class="week">' + this.locale.weekLabel + '</th>';
$.each(this.locale.daysOfWeek, function (index, dayOfWeek) {
html += '<th>' + dayOfWeek + '</th>';
});
html += '</tr>';
html += '</thead>';
html += '<tbody>';
for (var row = 0; row < 6; row++) {
html += '<tr>';
// add week number
if (this.showWeekNumbers)
html += '<td class="week">' + calendar[row][0].getWeek() + '</td>';
for (var col = 0; col < 7; col++) {
var cname = 'available ';
cname += (calendar[row][col].getMonth() == calendar[1][1].getMonth()) ? '' : 'off';
// Normalise the time so the comparison won't fail
selected.setHours(0,0,0,0);
if ((minDate && calendar[row][col] < minDate) || (maxDate && calendar[row][col] > maxDate)) {
cname = ' off disabled ';
} else if (calendar[row][col].equals(selected)) {
cname += ' active ';
if (calendar[row][col].equals(this.startDate)) { cname += ' start-date '; }
if (calendar[row][col].equals(this.endDate)) { cname += ' end-date '; }
} else if (calendar[row][col] >= this.startDate && calendar[row][col] <= this.endDate) {
cname += ' in-range ';
if (calendar[row][col].equals(this.startDate)) { cname += ' start-date '; }
if (calendar[row][col].equals(this.endDate)) { cname += ' end-date '; }
}
var title = 'r' + row + 'c' + col;
html += '<td class="' + cname.replace(/\s+/g,' ').replace(/^\s?(.*?)\s?$/,'$1') + '" title="' + title + '">' + calendar[row][col].getDate() + '</td>';
}
html += '</tr>';
}
html += '</tbody>';
html += '</table>';
return html;
}
};
$.fn.daterangepicker = function (options, cb) {
this.each(function() {
var el = $(this);
if (!el.data('daterangepicker'))
el.data('daterangepicker', new DateRangePicker(el, options, cb));
});
return this;
};
} (window.jQuery);
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,223 @@
/*!
* jQuery twitter bootstrap wizard plugin
* Examples and documentation at: http://github.com/VinceG/twitter-bootstrap-wizard
* version 1.0
* Requires jQuery v1.3.2 or later
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Authors: Vadim Vincent Gabriel (http://vadimg.com), Jason Gill (www.gilluminate.com)
*/
;(function($) {
var bootstrapWizardCreate = function(element, options) {
var element = $(element);
var obj = this;
// Merge options with defaults
//var $settings = $.extend($.fn.bootstrapWizard.defaults, options || {});
var $settings = $.extend({}, $.fn.bootstrapWizard.defaults, options);
var $activeTab = null;
var $navigation = null;
this.fixNavigationButtons = function() {
// Get the current active tab
if(!$activeTab.length) {
// Select first one
$navigation.find('a:first').tab('show');
$activeTab = $navigation.find('li:first');
}
// See if we're currently in the first/last then disable the previous and last buttons
if(obj.firstIndex() >= obj.currentIndex()) {
$('li.previous', element).addClass('disabled');
} else{
$('li.previous', element).removeClass('disabled');
}
if(obj.currentIndex() >= obj.navigationLength()) {
$('li.next', element).addClass('disabled');
} else {
$('li.next', element).removeClass('disabled');
}
if($settings.onTabShow && typeof $settings.onTabShow === 'function' && $settings.onTabShow($activeTab, $navigation, obj.currentIndex())===false){
return false;
}
};
this.next = function(e) {
// If we clicked the last then dont activate this
if(element.hasClass('last')) {
return false;
}
if($settings.onNext && typeof $settings.onNext === 'function' && $settings.onNext($activeTab, $navigation, obj.nextIndex())===false){
return false;
}
// Did we click the last button
$index = obj.nextIndex();
if($index > obj.navigationLength()) {
} else {
$navigation.find('li:eq('+$index+') a').tab('show');
}
};
this.previous = function(e) {
// If we clicked the first then dont activate this
if(element.hasClass('first')) {
return false;
}
if($settings.onPrevious && typeof $settings.onPrevious === 'function' && $settings.onPrevious($activeTab, $navigation, obj.previousIndex())===false){
return false;
}
$index = obj.previousIndex();
if($index < 0) {
} else {
$navigation.find('li:eq('+$index+') a').tab('show');
}
};
this.first = function(e) {
if($settings.onFirst && typeof $settings.onFirst === 'function' && $settings.onFirst($activeTab, $navigation, obj.firstIndex())===false){
return false;
}
// If the element is disabled then we won't do anything
if(element.hasClass('disabled')) {
return false;
}
$navigation.find('li:eq(0) a').tab('show');
};
this.last = function(e) {
if($settings.onLast && typeof $settings.onLast === 'function' && $settings.onLast($activeTab, $navigation, obj.lastIndex())===false){
return false;
}
// If the element is disabled then we won't do anything
if(element.hasClass('disabled')) {
return false;
}
$navigation.find('li:eq('+obj.navigationLength()+') a').tab('show');
};
this.currentIndex = function() {
return $navigation.find('li').index($activeTab);
};
this.firstIndex = function() {
return 0;
};
this.lastIndex = function() {
return obj.navigationLength();
};
this.getIndex = function(e) {
return $navigation.find('li').index(e);
};
this.nextIndex = function() {
return $navigation.find('li').index($activeTab) + 1;
};
this.previousIndex = function() {
return $navigation.find('li').index($activeTab) - 1;
};
this.navigationLength = function() {
return $navigation.find('li').length - 1;
};
this.activeTab = function() {
return $activeTab;
};
this.nextTab = function() {
return $navigation.find('li:eq('+(obj.currentIndex()+1)+')').length ? $navigation.find('li:eq('+(obj.currentIndex()+1)+')') : null;
};
this.previousTab = function() {
if(obj.currentIndex() <= 0) {
return null;
}
return $navigation.find('li:eq('+parseInt(obj.currentIndex()-1)+')');
};
this.show = function(index) {
return element.find('li:eq(' + index + ') a').tab('show');
};
$navigation = element.find('ul:first', element);
$activeTab = $navigation.find('li.active', element);
if(!$navigation.hasClass($settings.tabClass)) {
$navigation.addClass($settings.tabClass);
}
// Load onInit
if($settings.onInit && typeof $settings.onInit === 'function'){
$settings.onInit($activeTab, $navigation, 0);
}
// Next/Previous events
$($settings.nextSelector, element).bind('click', obj.next);
$($settings.previousSelector, element).bind('click', obj.previous);
$($settings.lastSelector, element).bind('click', obj.last);
$($settings.firstSelector, element).bind('click', obj.first);
// Load onShow
if($settings.onShow && typeof $settings.onShow === 'function'){
$settings.onShow($activeTab, $navigation, obj.nextIndex());
}
// Work the next/previous buttons
obj.fixNavigationButtons();
$('a[data-toggle="tab"]', element).on('click', function (e) {
if($settings.onTabClick && typeof $settings.onTabClick === 'function' && $settings.onTabClick($activeTab, $navigation, obj.currentIndex())===false){
return false;
}
});
$('a[data-toggle="tab"]', element).on('show', function (e) {
$element = $(e.target).parent();
// If it's disabled then do not change
if($element.hasClass('disabled')) {
return false;
}
$activeTab = $element; // activated tab
obj.fixNavigationButtons();
});
};
$.fn.bootstrapWizard = function(options) {
//expose methods
if (typeof options == 'string') {
var args = Array.prototype.slice.call(arguments, 1).toString();
return this.data('bootstrapWizard')[options](args);
}
return this.each(function(index){
var element = $(this);
// Return early if this element already has a plugin instance
if (element.data('bootstrapWizard')) return;
// pass options to plugin constructor
var wizard = new bootstrapWizardCreate(element, options);
// Store plugin object in this element's data
element.data('bootstrapWizard', wizard);
});
};
// expose options
$.fn.bootstrapWizard.defaults = {
'tabClass': 'nav nav-pills',
'nextSelector': '.wizard li.next',
'previousSelector': '.wizard li.previous',
'firstSelector': '.wizard li.first',
'lastSelector': '.wizard li.last',
'onShow': null,
'onInit': null,
'onNext': null,
'onPrevious': null,
'onLast': null,
'onFirst': null,
'onTabClick': null,
'onTabShow': null
};
})(jQuery);
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,168 @@
// Generated by CoffeeScript 1.3.3
/*
Easy pie chart is a jquery plugin to display simple animated pie charts for only one value
Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
Built on top of the jQuery library (http://jquery.com)
@source: http://github.com/rendro/easy-pie-chart/
@autor: Robert Fleischmann
@version: 1.0.1
Inspired by: http://dribbble.com/shots/631074-Simple-Pie-Charts-II?list=popular&offset=210
Thanks to Philip Thrasher for the jquery plugin boilerplate for coffee script
*/
(function() {
(function($) {
$.easyPieChart = function(el, options) {
var addScaleLine, animateLine, drawLine, easeInOutQuad, renderBackground, renderScale, renderTrack,
_this = this;
this.el = el;
this.$el = $(el);
this.$el.data("easyPieChart", this);
this.init = function() {
var percent;
_this.options = $.extend({}, $.easyPieChart.defaultOptions, options);
percent = parseInt(_this.$el.data('percent'), 10);
_this.percentage = 0;
_this.canvas = $("<canvas width='" + _this.options.size + "' height='" + _this.options.size + "'></canvas>").get(0);
_this.$el.append(_this.canvas);
if (typeof G_vmlCanvasManager !== "undefined" && G_vmlCanvasManager !== null) {
G_vmlCanvasManager.initElement(_this.canvas);
}
_this.ctx = _this.canvas.getContext('2d');
_this.ctx.translate(_this.options.size / 2, _this.options.size / 2);
_this.$el.addClass('easyPieChart');
_this.$el.css({
width: _this.options.size,
height: _this.options.size,
lineHeight: "" + _this.options.size + "px"
});
_this.update(percent);
return _this;
};
this.update = function(percent) {
if (_this.options.animate === false) {
return drawLine(percent);
} else {
return animateLine(_this.percentage, percent);
}
};
renderScale = function() {
var i, _i, _results;
_this.ctx.fillStyle = _this.options.scaleColor;
_this.ctx.lineWidth = 1;
_results = [];
for (i = _i = 0; _i <= 24; i = ++_i) {
_results.push(addScaleLine(i));
}
return _results;
};
addScaleLine = function(i) {
var offset;
offset = i % 6 === 0 ? 0 : _this.options.size * 0.017;
_this.ctx.save();
_this.ctx.rotate(i * Math.PI / 12);
_this.ctx.fillRect(_this.options.size / 2 - offset, 0, -_this.options.size * 0.05 + offset, 1);
return _this.ctx.restore();
};
renderTrack = function() {
var offset;
offset = _this.options.size / 2 - _this.options.lineWidth / 2;
if (_this.options.scaleColor !== false) {
offset -= _this.options.size * 0.08;
}
_this.ctx.beginPath();
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2, true);
_this.ctx.closePath();
_this.ctx.strokeStyle = _this.options.trackColor;
_this.ctx.lineWidth = _this.options.lineWidth;
return _this.ctx.stroke();
};
renderBackground = function() {
if (_this.options.scaleColor !== false) {
renderScale();
}
if (_this.options.trackColor !== false) {
return renderTrack();
}
};
drawLine = function(percent) {
var offset;
renderBackground();
_this.ctx.strokeStyle = $.isFunction(_this.options.barColor) ? _this.options.barColor(percent) : _this.options.barColor;
_this.ctx.lineCap = _this.options.lineCap;
offset = _this.options.size / 2 - _this.options.lineWidth / 2;
if (_this.options.scaleColor !== false) {
offset -= _this.options.size * 0.08;
}
_this.ctx.save();
_this.ctx.rotate(-Math.PI / 2);
_this.ctx.beginPath();
_this.ctx.arc(0, 0, offset, 0, Math.PI * 2 * percent / 100, false);
_this.ctx.stroke();
return _this.ctx.restore();
};
animateLine = function(from, to) {
var currentStep, fps, steps;
fps = 30;
steps = fps * _this.options.animate / 1000;
currentStep = 0;
_this.options.onStart.call(_this);
_this.percentage = to;
if (_this.animation) {
clearInterval(_this.animation);
_this.animation = false;
}
return _this.animation = setInterval(function() {
_this.ctx.clearRect(-_this.options.size / 2, -_this.options.size / 2, _this.options.size, _this.options.size);
renderBackground.call(_this);
drawLine.call(_this, [easeInOutQuad(currentStep, from, to - from, steps)]);
currentStep++;
if ((currentStep / steps) > 1) {
clearInterval(_this.animation);
_this.animation = false;
return _this.options.onStop.call(_this);
}
}, 1000 / fps);
};
easeInOutQuad = function(t, b, c, d) {
t /= d / 2;
if (t < 1) {
return c / 2 * t * t + b;
} else {
return -c / 2 * ((--t) * (t - 2) - 1) + b;
}
};
return this.init();
};
$.easyPieChart.defaultOptions = {
barColor: '#ef1e25',
trackColor: '#f2f2f2',
scaleColor: '#dfe0e0',
lineCap: 'round',
size: 110,
lineWidth: 3,
animate: false,
onStart: $.noop,
onStop: $.noop
};
$.fn.easyPieChart = function(options) {
return $.each(this, function(i, el) {
var $el;
$el = $(el);
if (!$el.data('easyPieChart')) {
return $el.data('easyPieChart', new $.easyPieChart(el, options));
}
});
};
return void 0;
})(jQuery);
}).call(this);
File diff suppressed because one or more lines are too long
+94
View File
@@ -0,0 +1,94 @@
/*
scrollUp v1.0.0
Author: Mark Goodyear - http://www.markgoodyear.com
Git: https://github.com/markgoodyear/scrollup
Copyright 2013 Mark Goodyear
Licensed under the MIT license
http://www.opensource.org/licenses/mit-license.php
Twitter: @markgdyr
*/
;(function ($) {
$.scrollUp = function (options) {
// Settings
var settings = {
scrollName: 'scrollUp', // Element ID
topDistance: '300', // Distance from top before showing element (px)
topSpeed: 300, // Speed back to top (ms)
animation: 'fade', // Fade, slide, none
animationInSpeed: 200, // Animation in speed (ms)
animationOutSpeed: 200, // Animation out speed (ms)
scrollText: 'Scroll to top', // Text for element
activeOverlay: false // Set CSS color to display scrollUp active point, e.g '#00FFFF'
};
// Load settings
if (options) {
var settings = $.extend(settings, options);
}
// Shorthand setting names
var sn = '#' + settings.scrollName,
an = settings.animation,
os = settings.animationOutSpeed,
is = settings.animationInSpeed,
td = settings.topDistance,
st = settings.scrollText,
ts = settings.topSpeed,
ao = settings.activeOverlay;
// Create element
$('<a/>', {
id: settings.scrollName,
href: '#top',
title: st,
text: st
}).appendTo('body');
// Minium CSS to make the magic happen
$(sn).css({
'display':'none',
'position': 'fixed',
'z-index': '2147483647'
})
// Active point overlay
if (ao) {
$("body").append("<div id='"+ settings.scrollName +"-active'></div>");
$(sn+"-active").css({ 'position': 'absolute', 'top': td+'px', 'width': '100%', 'border-top': '1px dotted '+ao, 'z-index': '2147483647' })
}
// Scroll funtion
$(window).scroll(function(){
// Fade animation
if (an === "fade") {
$( ($(window).scrollTop() > td) ? $(sn).fadeIn(is) : $(sn).fadeOut(os) );
}
// SlideUp animation
else if (an === "slide") {
$( ($(window).scrollTop() > td) ? $(sn).slideDown(is) : $(sn).slideUp(os) );
}
// No animation
else {
$( ($(window).scrollTop() > td) ? $(sn).show(0) : $(sn).hide(0) );
}
});
// Back to the top
$(sn).click( function(event) {
$('html, body').animate({scrollTop:0}, ts);
return false;
});
}; // End scrollUp function
}(jQuery));
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
(function(a){"use strict";var b=function(a,c,d){var e=document.createElement("img"),f,g;return e.onerror=c,e.onload=function(){g&&(!d||!d.noRevoke)&&b.revokeObjectURL(g),c(b.scale(e,d))},window.Blob&&a instanceof Blob||window.File&&a instanceof File?(f=g=b.createObjectURL(a),e._type=a.type):f=a,f?(e.src=f,e):b.readFile(a,function(a){var b=a.target;b&&b.result?e.src=b.result:c(a)})},c=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;b.detectSubsampling=function(a){var b=a.width,c=a.height,d,e;return b*c>1048576?(d=document.createElement("canvas"),d.width=d.height=1,e=d.getContext("2d"),e.drawImage(a,-b+1,0),e.getImageData(0,0,1,1).data[3]===0):!1},b.detectVerticalSquash=function(a,b){var c=document.createElement("canvas"),d=c.getContext("2d"),e,f,g,h,i;c.width=1,c.height=b,d.drawImage(a,0,0),e=d.getImageData(0,0,1,b).data,f=0,g=b,h=b;while(h>f)i=e[(h-1)*4+3],i===0?g=h:f=h,h=g+f>>1;return h/b},b.renderImageToCanvas=function(a,c,d,e){var f=a.width,g=a.height,h=c.getContext("2d"),i,j=1024,k=document.createElement("canvas"),l,m,n,o,p;h.save(),b.detectSubsampling(a)&&(f/=2,g/=2),i=b.detectVerticalSquash(a,g),k.width=k.height=j,l=k.getContext("2d"),m=0;while(m<g){n=m+j>g?g-m:j,o=0;while(o<f)p=o+j>f?f-o:j,l.clearRect(0,0,j,j),l.drawImage(a,-o,-m),h.drawImage(k,0,0,p,n,Math.floor(o*d/f),Math.floor(m*e/g/i),Math.ceil(p*d/f),Math.ceil(n*e/g/i)),o+=j;m+=j}h.restore(),k=l=null},b.scale=function(a,c){c=c||{};var d=document.createElement("canvas"),e=a.width,f=a.height,g=Math.max((c.minWidth||e)/e,(c.minHeight||f)/f);return g>1&&(e=parseInt(e*g,10),f=parseInt(f*g,10)),g=Math.min((c.maxWidth||e)/e,(c.maxHeight||f)/f),g<1&&(e=parseInt(e*g,10),f=parseInt(f*g,10)),a.getContext||c.canvas&&d.getContext?(d.width=e,d.height=f,a._type==="image/jpeg"?b.renderImageToCanvas(a,d,e,f):d.getContext("2d").drawImage(a,0,0,e,f),d):(a.width=e,a.height=f,a)},b.createObjectURL=function(a){return c?c.createObjectURL(a):!1},b.revokeObjectURL=function(a){return c?c.revokeObjectURL(a):!1},b.readFile=function(a,b){if(window.FileReader&&FileReader.prototype.readAsDataURL){var c=new FileReader;return c.onload=c.onerror=b,c.readAsDataURL(a),c}return!1},typeof define=="function"&&define.amd?define(function(){return b}):a.loadImage=b})(this);
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
(function(a){a.tiny=a.tiny||{};a.tiny.scrollbar={options:{axis:"y",wheel:40,scroll:true,lockscroll:true,size:"auto",sizethumb:"auto",invertscroll:false}};a.fn.tinyscrollbar=function(d){var c=a.extend({},a.tiny.scrollbar.options,d);this.each(function(){a(this).data("tsb",new b(a(this),c))});return this};a.fn.tinyscrollbar_update=function(c){return a(this).data("tsb").update(c)};function b(q,g){var k=this,t=q,j={obj:a(".viewport",q)},h={obj:a(".overview",q)},d={obj:a(".scrollbar",q)},m={obj:a(".track",d.obj)},p={obj:a(".thumb",d.obj)},l=g.axis==="x",n=l?"left":"top",v=l?"Width":"Height",r=0,y={start:0,now:0},o={},e="ontouchstart" in document.documentElement;function c(){k.update();s();return k}this.update=function(z){j[g.axis]=j.obj[0]["offset"+v];h[g.axis]=h.obj[0]["scroll"+v];h.ratio=j[g.axis]/h[g.axis];d.obj.toggleClass("disable",h.ratio>=1);m[g.axis]=g.size==="auto"?j[g.axis]:g.size;p[g.axis]=Math.min(m[g.axis],Math.max(0,(g.sizethumb==="auto"?(m[g.axis]*h.ratio):g.sizethumb)));d.ratio=g.sizethumb==="auto"?(h[g.axis]/m[g.axis]):(h[g.axis]-j[g.axis])/(m[g.axis]-p[g.axis]);r=(z==="relative"&&h.ratio<=1)?Math.min((h[g.axis]-j[g.axis]),Math.max(0,r)):0;r=(z==="bottom"&&h.ratio<=1)?(h[g.axis]-j[g.axis]):isNaN(parseInt(z,10))?r:parseInt(z,10);w()};function w(){var z=v.toLowerCase();p.obj.css(n,r/d.ratio);h.obj.css(n,-r);o.start=p.obj.offset()[n];d.obj.css(z,m[g.axis]);m.obj.css(z,m[g.axis]);p.obj.css(z,p[g.axis])}function s(){if(!e){p.obj.bind("mousedown",i);m.obj.bind("mouseup",u)}else{j.obj[0].ontouchstart=function(z){if(1===z.touches.length){i(z.touches[0]);z.stopPropagation()}}}if(g.scroll&&window.addEventListener){t[0].addEventListener("DOMMouseScroll",x,false);t[0].addEventListener("mousewheel",x,false)}else{if(g.scroll){t[0].onmousewheel=x}}}function i(A){a("body").addClass("noSelect");var z=parseInt(p.obj.css(n),10);o.start=l?A.pageX:A.pageY;y.start=z=="auto"?0:z;if(!e){a(document).bind("mousemove",u);a(document).bind("mouseup",f);p.obj.bind("mouseup",f)}else{document.ontouchmove=function(B){B.preventDefault();u(B.touches[0])};document.ontouchend=f}}function x(B){if(h.ratio<1){var A=B||window.event,z=A.wheelDelta?A.wheelDelta/120:-A.detail/3;r-=z*g.wheel;r=Math.min((h[g.axis]-j[g.axis]),Math.max(0,r));p.obj.css(n,r/d.ratio);h.obj.css(n,-r);if(g.lockscroll||(r!==(h[g.axis]-j[g.axis])&&r!==0)){A=a.event.fix(A);A.preventDefault()}}}function u(z){if(h.ratio<1){if(g.invertscroll&&e){y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+(o.start-(l?z.pageX:z.pageY)))))}else{y.now=Math.min((m[g.axis]-p[g.axis]),Math.max(0,(y.start+((l?z.pageX:z.pageY)-o.start))))}r=y.now*d.ratio;h.obj.css(n,-r);p.obj.css(n,y.now)}}function f(){a("body").removeClass("noSelect");a(document).unbind("mousemove",u);a(document).unbind("mouseup",f);p.obj.unbind("mouseup",f);document.ontouchmove=document.ontouchend=null}return c()}}(jQuery));
+492
View File
@@ -0,0 +1,492 @@
!function($, wysi) {
"use strict";
var tpl = {
"font-styles": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li class='dropdown'>" +
"<a class='btn btn-inverse dropdown-toggle" + size + "' data-toggle='dropdown' href='#'>" +
"<i class='icon-font'></i>&nbsp;<span class='current-font'>" + locale.font_styles.normal + "</span>&nbsp;<b class='caret'></b>" +
"</a>" +
"<ul class='dropdown-menu'>" +
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>" + locale.font_styles.normal + "</a></li>" +
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>" + locale.font_styles.h1 + "</a></li>" +
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>" + locale.font_styles.h2 + "</a></li>" +
"<li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>" + locale.font_styles.h3 + "</a></li>" +
"</ul>" +
"</li>";
},
"emphasis": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li>" +
"<div class='btn-group'>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>" + locale.emphasis.bold + "</a>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>" + locale.emphasis.italic + "</a>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>" + locale.emphasis.underline + "</a>" +
"</div>" +
"</li>";
},
"lists": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li>" +
"<div class='btn-group'>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='insertUnorderedList' title='" + locale.lists.unordered + "' tabindex='-1'><i class='icon-list'></i></a>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='insertOrderedList' title='" + locale.lists.ordered + "' tabindex='-1'><i class='icon-list-2'></i></a>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='Outdent' title='" + locale.lists.outdent + "' tabindex='-1'><i class='icon-indent-increase'></i></a>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='Indent' title='" + locale.lists.indent + "' tabindex='-1'><i class='icon-indent-decrease'></i></a>" +
"</div>" +
"</li>";
},
"link": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li>" +
"<div class='bootstrap-wysihtml5-insert-link-modal modal hide fade'>" +
"<div class='modal-header'>" +
"<a class='close' data-dismiss='modal'>&times;</a>" +
"<h3>" + locale.link.insert + "</h3>" +
"</div>" +
"<div class='modal-body'>" +
"<input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'>" +
"</div>" +
"<div class='modal-footer'>" +
"<a href='#' class='btn btn-inverse' data-dismiss='modal'>" + locale.link.cancel + "</a>" +
"<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.link.insert + "</a>" +
"</div>" +
"</div>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='createLink' title='" + locale.link.insert + "' tabindex='-1'><i class='icon-share'></i></a>" +
"</li>";
},
"image": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li>" +
"<div class='bootstrap-wysihtml5-insert-image-modal modal hide fade'>" +
"<div class='modal-header'>" +
"<a class='close' data-dismiss='modal'>&times;</a>" +
"<h3>" + locale.image.insert + "</h3>" +
"</div>" +
"<div class='modal-body'>" +
"<input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'>" +
"</div>" +
"<div class='modal-footer'>" +
"<a href='#' class='btn' data-dismiss='modal'>" + locale.image.cancel + "</a>" +
"<a href='#' class='btn btn-primary' data-dismiss='modal'>" + locale.image.insert + "</a>" +
"</div>" +
"</div>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-command='insertImage' title='" + locale.image.insert + "' tabindex='-1'><i class='icon-image-2'></i></a>" +
"</li>";
},
"html": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li>" +
"<div class='btn-group'>" +
"<a class='btn btn-inverse" + size + "' data-wysihtml5-action='change_view' title='" + locale.html.edit + "' tabindex='-1'><i class='icon-pen-alt-stroke'></i></a>" +
"</div>" +
"</li>";
},
"color": function(locale, options) {
var size = (options && options.size) ? ' btn-'+options.size : '';
return "<li class='dropdown'>" +
"<a class='btn btn-inverse dropdown-toggle" + size + "' data-toggle='dropdown' href='#' tabindex='-1'>" +
"<span class='current-color'>" + locale.colours.black + "</span>&nbsp;<b class='caret'></b>" +
"</a>" +
"<ul class='dropdown-menu'>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>" + locale.colours.black + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>" + locale.colours.silver + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>" + locale.colours.gray + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>" + locale.colours.maroon + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>" + locale.colours.red + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>" + locale.colours.purple + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>" + locale.colours.green + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>" + locale.colours.olive + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>" + locale.colours.navy + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>" + locale.colours.blue + "</a></li>" +
"<li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'></div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>" + locale.colours.orange + "</a></li>" +
"</ul>" +
"</li>";
}
};
var templates = function(key, locale, options) {
return tpl[key](locale, options);
};
var Wysihtml5 = function(el, options) {
this.el = el;
var toolbarOpts = options || defaultOptions;
for(var t in toolbarOpts.customTemplates) {
tpl[t] = toolbarOpts.customTemplates[t];
}
this.toolbar = this.createToolbar(el, toolbarOpts);
this.editor = this.createEditor(options);
window.editor = this.editor;
$('iframe.wysihtml5-sandbox').each(function(i, el){
$(el.contentWindow).off('focus.wysihtml5').on({
'focus.wysihtml5' : function(){
$('li.dropdown').removeClass('open');
}
});
});
};
Wysihtml5.prototype = {
constructor: Wysihtml5,
createEditor: function(options) {
options = options || {};
options.toolbar = this.toolbar[0];
var editor = new wysi.Editor(this.el[0], options);
if(options && options.events) {
for(var eventName in options.events) {
editor.on(eventName, options.events[eventName]);
}
}
return editor;
},
createToolbar: function(el, options) {
var self = this;
var toolbar = $("<ul/>", {
'class' : "wysihtml5-toolbar",
'style': "display:none"
});
var culture = options.locale || defaultOptions.locale || "en";
for(var key in defaultOptions) {
var value = false;
if(options[key] !== undefined) {
if(options[key] === true) {
value = true;
}
} else {
value = defaultOptions[key];
}
if(value === true) {
toolbar.append(templates(key, locale[culture], options));
if(key === "html") {
this.initHtml(toolbar);
}
if(key === "link") {
this.initInsertLink(toolbar);
}
if(key === "image") {
this.initInsertImage(toolbar);
}
}
}
if(options.toolbar) {
for(key in options.toolbar) {
toolbar.append(options.toolbar[key]);
}
}
toolbar.find("a[data-wysihtml5-command='formatBlock']").click(function(e) {
var target = e.target || e.srcElement;
var el = $(target);
self.toolbar.find('.current-font').text(el.html());
});
toolbar.find("a[data-wysihtml5-command='foreColor']").click(function(e) {
var target = e.target || e.srcElement;
var el = $(target);
self.toolbar.find('.current-color').text(el.html());
});
this.el.before(toolbar);
return toolbar;
},
initHtml: function(toolbar) {
var changeViewSelector = "a[data-wysihtml5-action='change_view']";
toolbar.find(changeViewSelector).click(function(e) {
toolbar.find('a.btn').not(changeViewSelector).toggleClass('disabled');
});
},
initInsertImage: function(toolbar) {
var self = this;
var insertImageModal = toolbar.find('.bootstrap-wysihtml5-insert-image-modal');
var urlInput = insertImageModal.find('.bootstrap-wysihtml5-insert-image-url');
var insertButton = insertImageModal.find('a.btn-primary');
var initialValue = urlInput.val();
var caretBookmark;
var insertImage = function() {
var url = urlInput.val();
urlInput.val(initialValue);
self.editor.currentView.element.focus();
if (caretBookmark) {
self.editor.composer.selection.setBookmark(caretBookmark);
caretBookmark = null;
}
self.editor.composer.commands.exec("insertImage", url);
};
urlInput.keypress(function(e) {
if(e.which == 13) {
insertImage();
insertImageModal.modal('hide');
}
});
insertButton.click(insertImage);
insertImageModal.on('shown', function() {
urlInput.focus();
});
insertImageModal.on('hide', function() {
self.editor.currentView.element.focus();
});
toolbar.find('a[data-wysihtml5-command=insertImage]').click(function() {
var activeButton = $(this).hasClass("wysihtml5-command-active");
if (!activeButton) {
self.editor.currentView.element.focus(false);
caretBookmark = self.editor.composer.selection.getBookmark();
insertImageModal.modal('show');
insertImageModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
e.stopPropagation();
});
return false;
}
else {
return true;
}
});
},
initInsertLink: function(toolbar) {
var self = this;
var insertLinkModal = toolbar.find('.bootstrap-wysihtml5-insert-link-modal');
var urlInput = insertLinkModal.find('.bootstrap-wysihtml5-insert-link-url');
var insertButton = insertLinkModal.find('a.btn-primary');
var initialValue = urlInput.val();
var caretBookmark;
var insertLink = function() {
var url = urlInput.val();
urlInput.val(initialValue);
self.editor.currentView.element.focus();
if (caretBookmark) {
self.editor.composer.selection.setBookmark(caretBookmark);
caretBookmark = null;
}
self.editor.composer.commands.exec("createLink", {
href: url,
target: "_blank",
rel: "nofollow"
});
};
var pressedEnter = false;
urlInput.keypress(function(e) {
if(e.which == 13) {
insertLink();
insertLinkModal.modal('hide');
}
});
insertButton.click(insertLink);
insertLinkModal.on('shown', function() {
urlInput.focus();
});
insertLinkModal.on('hide', function() {
self.editor.currentView.element.focus();
});
toolbar.find('a[data-wysihtml5-command=createLink]').click(function() {
var activeButton = $(this).hasClass("wysihtml5-command-active");
if (!activeButton) {
self.editor.currentView.element.focus(false);
caretBookmark = self.editor.composer.selection.getBookmark();
insertLinkModal.appendTo('body').modal('show');
insertLinkModal.on('click.dismiss.modal', '[data-dismiss="modal"]', function(e) {
e.stopPropagation();
});
return false;
}
else {
return true;
}
});
}
};
// these define our public api
var methods = {
resetDefaults: function() {
$.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache);
},
bypassDefaults: function(options) {
return this.each(function () {
var $this = $(this);
$this.data('wysihtml5', new Wysihtml5($this, options));
});
},
shallowExtend: function (options) {
var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {});
var that = this;
return methods.bypassDefaults.apply(that, [settings]);
},
deepExtend: function(options) {
var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {});
var that = this;
return methods.bypassDefaults.apply(that, [settings]);
},
init: function(options) {
var that = this;
return methods.shallowExtend.apply(that, [options]);
}
};
$.fn.wysihtml5 = function ( method ) {
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.wysihtml5' );
}
};
$.fn.wysihtml5.Constructor = Wysihtml5;
var defaultOptions = $.fn.wysihtml5.defaultOptions = {
"font-styles": true,
"color": true,
"emphasis": true,
"lists": true,
"html": true,
"link": true,
"image": true,
events: {},
parserRules: {
classes: {
// (path_to_project/css/wysiwyg/wysiwyg-color.css)
"wysiwyg-color-silver" : 1,
"wysiwyg-color-gray" : 1,
"wysiwyg-color-white" : 1,
"wysiwyg-color-maroon" : 1,
"wysiwyg-color-red" : 1,
"wysiwyg-color-purple" : 1,
"wysiwyg-color-fuchsia" : 1,
"wysiwyg-color-green" : 1,
"wysiwyg-color-lime" : 1,
"wysiwyg-color-olive" : 1,
"wysiwyg-color-yellow" : 1,
"wysiwyg-color-navy" : 1,
"wysiwyg-color-blue" : 1,
"wysiwyg-color-teal" : 1,
"wysiwyg-color-aqua" : 1,
"wysiwyg-color-orange" : 1
},
tags: {
"b": {},
"i": {},
"br": {},
"ol": {},
"ul": {},
"li": {},
"h1": {},
"h2": {},
"h3": {},
"blockquote": {},
"u": 1,
"img": {
"check_attributes": {
"width": "numbers",
"alt": "alt",
"src": "url",
"height": "numbers"
}
},
"a": {
set_attributes: {
target: "_blank",
rel: "nofollow"
},
check_attributes: {
href: "url" // important to avoid XSS
}
},
"span": 1,
"div": 1
}
},
stylesheets: ["./css/wysiwyg/wysiwyg-color.css"], // (path_to_project/css/wysiwyg/wysiwyg-color.css)
locale: "en"
};
if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') {
$.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions);
}
var locale = $.fn.wysihtml5.locale = {
en: {
font_styles: {
normal: "Normal text",
h1: "Heading 1",
h2: "Heading 2",
h3: "Heading 3"
},
emphasis: {
bold: "Bold",
italic: "Italic",
underline: "Underline"
},
lists: {
unordered: "Unordered list",
ordered: "Ordered list",
outdent: "Outdent",
indent: "Indent"
},
link: {
insert: "Insert link",
cancel: "Cancel"
},
image: {
insert: "Insert image",
cancel: "Cancel"
},
html: {
edit: "Edit HTML"
},
colours: {
black: "Black",
silver: "Silver",
gray: "Grey",
maroon: "Maroon",
red: "Red",
purple: "Purple",
green: "Green",
olive: "Olive",
navy: "Navy",
blue: "Blue",
orange: "Orange"
}
}
};
}(window.jQuery, window.wysihtml5);
@@ -0,0 +1,49 @@
/**
* Arabic translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["mo-MD"] = {
font_styles: {
normal: "نص عادي",
h1: "عنوان رئيسي 1",
h2: "عنوان رئيسي 2",
h3: "عنوان رئيسي 3",
},
emphasis: {
bold: "عريض",
italic: "مائل",
underline: "تحته خط"
},
lists: {
unordered: "قائمة منقطة",
ordered: "قائمة مرقمة",
outdent: "محاذاه للخارج",
indent: "محاذاه للداخل"
},
link: {
insert: "إضافة رابط",
cancel: "إلغاء"
},
image: {
insert: "إضافة صورة",
cancel: "إلغاء"
},
html: {
edit: "تعديل HTML"
},
colours: {
black: "أسود",
silver: "فضي",
gray: "رمادي",
maroon: "بني",
red: "أحمر",
purple: "بنفسجي",
green: "أخضر",
olive: "زيتوني",
navy: "أزرق قاتم",
blue: "أزرق نيلي",
orange: "برتقالي"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Bulgarian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["bg-BG"] = {
font_styles: {
normal: "Нормален текст",
h1: "Заглавие 1",
h2: "Заглавие 2",
h3: "Заглавие 3"
},
emphasis: {
bold: "Удебелен",
italic: "Курсив",
underline: "Подчертан"
},
lists: {
unordered: "Неподреден списък",
ordered: "Подреден списък",
outdent: "Намали отстояние",
indent: "Увеличи отстояние"
},
link: {
insert: "Вмъкни връзка",
cancel: "Отмени"
},
image: {
insert: "Вмъкни картинка",
cancel: "Отмени"
},
html: {
edit: "Редакртирай HTML"
},
colours: {
black: "Черен",
silver: "Сребърен",
gray: "Сив",
maroon: "Коричневый",
red: "Червен",
purple: "Виолетов",
green: "Зелен",
olive: "Маслинен",
navy: "Морско син",
blue: "Син",
orange: "Оранжев"
}
};
}(jQuery));
@@ -0,0 +1,47 @@
/**
* Catalan translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["ca-CT"] = {
font_styles: {
normal: "Text normal",
h1: "Títol 1",
h2: "Títol 2"
},
emphasis: {
bold: "Negreta",
italic: "Cursiva",
underline: "Subratllat"
},
lists: {
unordered: "Llista desordenada",
ordered: "Llista ordenada",
outdent: "Esborrar tabulació",
indent: "Afegir tabulació"
},
link: {
insert: "Afegir enllaç",
cancel: "Cancelar"
},
image: {
insert: "Afegir imatge",
cancel: "Cancelar"
},
html: {
edit: "Editar HTML"
},
colours: {
black: "Negre",
silver: "Plata",
gray: "Gris",
maroon: "Marró",
red: "Vermell",
purple: "Porpre",
green: "Verd",
olive: "Oliva",
navy: "Blau marí",
blue: "Blau",
orange: "Taronja"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Czech translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["cs-CZ"] = {
font_styles: {
normal: "Normální text",
h1: "Nadpis úrovně 1",
h2: "Nadpis úrovně 2",
h3: "Nadpis úrovně 3"
},
emphasis: {
bold: "Tučné",
italic: "Kurzíva",
underline: "Podtržení"
},
lists: {
unordered: "Seznam s odrážkami",
ordered: "Číslovaný seznam",
outdent: "Zvětšit odsazení",
indent: "Zmenšit odsazení"
},
link: {
insert: "Vložit odkaz",
cancel: "Zrušit"
},
image: {
insert: "Vložit obrázek",
cancel: "Zrušit"
},
html: {
edit: "Upravit HTML"
},
colours: {
black: "Černá",
silver: "Stříbrná",
gray: "Šedá",
maroon: "Vínová",
red: "Červená",
purple: "Fialová",
green: "Zelená",
olive: "Olivová",
navy: "Tmavomodrá",
blue: "Modrá",
orange: "Oranžová"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* German translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["de-DE"] = {
font_styles: {
normal: "Normaler Text",
h1: "Überschrift 1",
h2: "Überschrift 2",
h3: "Überschrift 3"
},
emphasis: {
bold: "Fett",
italic: "Kursiv",
underline: "Unterstrichen"
},
lists: {
unordered: "Ungeordnete Liste",
ordered: "Geordnete Liste",
outdent: "Einzug verkleinern",
indent: "Einzug vergrößern"
},
link: {
insert: "Link einfügen",
cancel: "Abbrechen"
},
image: {
insert: "Bild einfügen",
cancel: "Abbrechen"
},
html: {
edit: "HTML bearbeiten"
},
colours: {
black: "Schwarz",
silver: "Silber",
gray: "Grau",
maroon: "Kastanienbraun",
red: "Rot",
purple: "Violett",
green: "Grün",
olive: "Olivgrün",
navy: "Marineblau",
blue: "Blau",
orange: "Orange"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Greek translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["el-GR"] = {
font_styles: {
normal: "Απλό κείμενο",
h1: "Κεφαλίδα 1",
h2: "Κεφαλίδα 2",
h3: "Κεφαλίδα 3"
},
emphasis: {
bold: "B",
italic: "I",
underline: "U"
},
lists: {
unordered: "Λίστα με κουκκίδες",
ordered: "Αριθμημένη λίστα",
outdent: "Μείωση εσοχής",
indent: "Αύξηση εσοχής"
},
link: {
insert: "Εισαγωγή Συνδέσμου",
cancel: "Άκυρο"
},
image: {
insert: "Εισαγωγή Εικόνας",
cancel: "Άκυρο"
},
html: {
edit: "Επεξεργασία HTML"
},
colours: {
black: "Μαύρο",
silver: "Ασημί",
gray: "Γκρι",
maroon: "Καφέ",
red: "Κόκκινο",
purple: "Μωβ",
green: "Πράσινο",
olive: "Λαδί",
navy: "Βαθύ Μπλε",
blue: "Μπλε",
orange: "Πορτοκαλί"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Spanish Argenina translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["es-AR"] = {
font_styles: {
normal: "Texto normal",
h1: "Título 1",
h2: "Título 2",
h3: "Título 3"
},
emphasis: {
bold: "Negrita",
italic: "Itálica",
underline: "Subrayado"
},
lists: {
ordered: "Lista ordenada",
unordered: "Lista desordenada",
indent: "Agregar sangría",
outdent: "Eliminar sangría"
},
link: {
insert: "Insertar enlace",
cancel: "Cancelar"
},
image: {
insert: "Insertar imágen",
cancel: "Cancelar"
},
html: {
edit: "Editar HTML"
},
colours: {
black: "Negro",
silver: "Plata",
gray: "Gris",
maroon: "Marrón",
red: "Rojo",
purple: "Púrpura",
green: "Verde",
olive: "Oliva",
navy: "Azul Marino",
blue: "Azul",
orange: "Naranja"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Uruguayan spanish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["es-ES"] = {
font_styles: {
normal: "Texto normal",
h1: "Título 1",
h2: "Título 2",
h3: "Título 3"
},
emphasis: {
bold: "Negrita",
italic: "Itálica",
underline: "Subrayado"
},
lists: {
unordered: "Lista desordenada",
ordered: "Lista ordenada",
outdent: "Eliminar sangría",
indent: "Agregar sangría"
},
link: {
insert: "Insertar enlace",
cancel: "Cancelar"
},
image: {
insert: "Insertar imágen",
cancel: "Cancelar"
},
html: {
edit: "Editar HTML"
},
colours: {
black: "Negro",
silver: "Plata",
gray: "Gris",
maroon: "Marrón",
red: "Rojo",
purple: "Púrpura",
green: "Verde",
olive: "Oliva",
navy: "Azul Marino",
blue: "Azul",
orange: "Naranja"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* French translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["fr-FR"] = {
font_styles: {
normal: "Texte normal",
h1: "Titre 1",
h2: "Titre 2",
h3: "Titre 3"
},
emphasis: {
bold: "Gras",
italic: "Italique",
underline: "Souligné"
},
lists: {
unordered: "Liste à puces",
ordered: "Liste numérotée",
outdent: "Diminuer le retrait",
indent: "Augmenter le retrait",
indered: "Augmenter le retrait"
},
link: {
insert: "Insérer un lien",
cancel: "Annuler"
},
image: {
insert: "Insérer une image",
cancel: "Annuler"
},
html: {
edit: "Editer en HTML"
},
colours: {
black: "Noir",
silver: "Gris clair",
gray: "Gris",
maroon: "Marron",
red: "Rouge",
purple: "Pourpre",
green: "Vert",
olive: "Olive",
navy: "Bleu marine",
blue: "Bleu",
orange: "Orange"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Croatian localisation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["hr-HR"] = {
font_styles: {
normal: "Normalan tekst",
h1: "Naslov 1",
h2: "Naslov 2",
h3: "Naslov 3"
},
emphasis: {
bold: "Podebljano",
italic: "Nakrivljeno",
underline: "Podcrtano"
},
lists: {
unordered: "Nesortirana lista",
ordered: "Sortirana lista",
outdent: "Izdubi",
indent: "Udubi"
},
link: {
insert: "Umetni poveznicu",
cancel: "Otkaži"
},
image: {
insert: "Umetni sliku",
cancel: "Otkaži"
},
html: {
edit: "Izmjeni HTML"
},
colours: {
black: "Crna",
silver: "Srebrna",
gray: "Siva",
maroon: "Kestenjasta",
red: "Crvena",
purple: "Ljubičasta",
green: "Zelena",
olive: "Maslinasta",
navy: "Mornarska",
blue: "Plava",
orange: "Narandžasta"
}
};
}(jQuery));
@@ -0,0 +1,47 @@
/**
* Italian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["it-IT"] = {
font_styles: {
normal: "Testo normale",
h1: "Titolo 1",
h2: "Titolo 2"
},
emphasis: {
bold: "Grassetto",
italic: "Corsivo",
underline: "Sottolineato"
},
lists: {
unordered: "Lista non ordinata",
ordered: "Lista ordinata",
outdent: "Elimina rientro",
indent: "Aggiungi rientro"
},
link: {
insert: "Inserisci link",
cancel: "Annulla"
},
image: {
insert: "Inserisci immagine",
cancel: "Annulla"
},
html: {
edit: "Modifica HTML"
},
colours: {
black: "Nero",
silver: "Argento",
gray: "Grigio",
maroon: "Marrone",
red: "Rosso",
purple: "Viola",
green: "Verde",
olive: "Oliva",
navy: "Blu Marino",
blue: "Blu",
orange: "Arancio"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Japanese translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["ja-JP"] = {
font_styles: {
normal: "通常の文字",
h1: "見出し1",
h2: "見出し2",
h3: "見出し3"
},
emphasis: {
bold: "太字",
italic: "斜体",
underline: "下線"
},
lists: {
unordered: "点字リスト",
ordered: "数字リスト",
outdent: "左寄せ",
indent: "右寄せ"
},
link: {
insert: "リンクの挿入",
cancel: "キャンセル"
},
image: {
insert: "画像の挿入",
cancel: "キャンセル"
},
html: {
edit: "HTMLを編集"
},
colours: {
black: "黒色",
silver: "シルバー",
gray: "グレー",
maroon: "栗色",
red: "赤色",
purple: "紫色",
green: "緑色",
olive: "オリーブ",
navy: "ネイビー",
blue: "青色",
orange: "オレンジ"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Korean translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["ko-KR"] = {
font_styles: {
normal: "일반",
h1: "헤드라인 1",
h2: "헤드라인 2",
h3: "헤드라인 3"
},
emphasis: {
bold: "굵게",
italic: "기울게",
underline: "밑줄"
},
lists: {
unordered: "기호목록",
ordered: "숫자목록",
outdent: "내어쓰기",
indent: "들여쓰기"
},
link: {
insert: "링크 삽입",
cancel: "취소"
},
image: {
insert: "이미지 삽입",
cancel: "취소"
},
html: {
edit: "HTML 편집"
},
colours: {
black: "검은색",
silver: "은색",
gray: "회색",
maroon: "고동색",
red: "빨간색",
purple: "보라색",
green: "초록색",
olive: "올리브",
navy: "네이비",
blue: "파란색",
orange: "주황색"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Lithuanian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["lt-LT"] = {
font_styles: {
normal: "Normalus",
h1: "Antraštė 1",
h2: "Antraštė 2",
h3: "Antraštė 3"
},
emphasis: {
bold: "Pastorintas",
italic: "Kursyvas",
underline: "Pabrauktas"
},
lists: {
unordered: "Suženklintas sąrašas",
ordered: "Numeruotas sąrašas",
outdent: "Padidinti įtrauką",
indent: "Sumažinti įtrauką"
},
link: {
insert: "Įterpti nuorodą",
cancel: "Atšaukti"
},
image: {
insert: "Įterpti atvaizdą",
cancel: "Atšaukti"
},
html: {
edit: "Redaguoti HTML"
},
colours: {
black: "Juoda",
silver: "Sidabrinė",
gray: "Pilka",
maroon: "Kaštoninė",
red: "Raudona",
purple: "Violetinė",
green: "Žalia",
olive: "Gelsvai žalia",
navy: "Tamsiai mėlyna",
blue: "Mėlyna",
orange: "Oranžinė"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Moldavian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["mo-MD"] = {
font_styles: {
normal: "Normal",
h1: "Titlu 1",
h2: "Titlu 2"
},
emphasis: {
bold: "Bold",
italic: "Cursiv",
underline: "Accentuat"
},
lists: {
unordered: "Neordonata",
ordered: "Ordonata",
outdent: "Margine",
indent: "zimțuire"
},
link: {
insert: "Indroduce link-ul",
cancel: "Anula"
},
image: {
insert: "Insera imagina",
cancel: "Anula"
},
html: {
edit: "Editare HTML"
},
colours: {
black: "Negru",
silver: "Argint",
gray: "Gri",
maroon: "Castaniu",
red: "Roșu",
purple: "Violet",
green: "Verde",
olive: "Oliv",
navy: "Marin",
blue: "Albastru",
orange: "Portocaliu"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Norwegian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["nb-NB"] = {
font_styles: {
normal: "Normal tekst",
h1: "Tittel 1",
h2: "Tittel 2",
h3: "Tittel 3"
},
emphasis: {
bold: "Fet",
italic: "Kursiv",
underline: "Understrekning"
},
lists: {
unordered: "Usortert",
ordered: "Sortert",
outdent: "Detabuler",
indent: "Tabuler",
indered: "Tabuler"
},
link: {
insert: "Sett inn lenke",
cancel: "Avbryt"
},
image: {
insert: "Sett inn bilde",
cancel: "Avbryt"
},
html: {
edit: "Rediger HTML"
},
colours: {
black: "Svart",
silver: "Sølv",
gray: "Grå",
maroon: "Brun",
red: "Rød",
purple: "Lilla",
green: "Grønn",
olive: "Oliven",
navy: "Marineblå",
blue: "Blå",
orange: "Oransj"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Dutch translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["nl-NL"] = {
font_styles: {
normal: "Normale Tekst",
h1: "Kop 1",
h2: "Kop 2",
h3: "Kop 3"
},
emphasis: {
bold: "Vet",
italic: "Cursief",
underline: "Onderstrepen"
},
lists: {
unordered: "Ongeordende lijst",
ordered: "Geordende lijst",
outdent: "Inspringen verkleinen",
indent: "Inspringen vergroten"
},
link: {
insert: "Link invoegen",
cancel: "Annuleren"
},
image: {
insert: "Afbeelding invoegen",
cancel: "Annuleren"
},
html: {
edit: "HTML bewerken"
},
colours: {
black: "Zwart",
silver: "Zilver",
gray: "Grijs",
maroon: "Kastanjebruin",
red: "Rood",
purple: "Paars",
green: "Groen",
olive: "Olijfgroen",
navy: "Donkerblauw",
blue: "Blauw",
orange: "Oranje"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Polish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["pl-PL"] = {
font_styles: {
normal: "Tekst podstawowy",
h1: "Nagłówek 1",
h2: "Nagłówek 2",
h3: "Nagłówek 3"
},
emphasis: {
bold: "Pogrubienie",
italic: "Kursywa",
underline: "Podkreślenie"
},
lists: {
unordered: "Lista wypunktowana",
ordered: "Lista numerowana",
outdent: "Zwiększ wcięcie",
indent: "Zmniejsz wcięcie"
},
link: {
insert: "Wstaw odnośnik",
cancel: "Anuluj"
},
image: {
insert: "Wstaw obrazek",
cancel: "Anuluj"
},
html: {
edit: "Edycja HTML"
},
colours: {
black: "Czarny",
silver: "Srebrny",
gray: "Szary",
maroon: "Kasztanowy",
red: "Czerwony",
purple: "Fioletowy",
green: "Zielony",
olive: "Oliwkowy",
navy: "Granatowy",
blue: "Niebieski",
orange: "Pomarańczowy"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Brazilian portuguese translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["pt-BR"] = {
font_styles: {
normal: "Texto normal",
h1: "Título 1",
h2: "Título 2",
h3: "Título 3"
},
emphasis: {
bold: "Negrito",
italic: "Itálico",
underline: "Sublinhado"
},
lists: {
unordered: "Lista",
ordered: "Lista numerada",
outdent: "Remover indentação",
indent: "Indentar"
},
link: {
insert: "Inserir link",
cancel: "Cancelar"
},
image: {
insert: "Inserir imagem",
cancel: "Cancelar"
},
html: {
edit: "Editar HTML"
},
colours: {
black: "Preto",
silver: "Prata",
gray: "Cinza",
maroon: "Marrom",
red: "Vermelho",
purple: "Roxo",
green: "Verde",
olive: "Oliva",
navy: "Marinho",
blue: "Azul",
orange: "Laranja"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Russian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["ru-RU"] = {
font_styles: {
normal: "Обычный текст",
h1: "Заголовок 1",
h2: "Заголовок 2",
h3: "Заголовок 3"
},
emphasis: {
bold: "Полужирный",
italic: "Курсив",
underline: "Подчёркнутый"
},
lists: {
unordered: "Маркированный список",
ordered: "Нумерованный список",
outdent: "Уменьшить отступ",
indent: "Увеличить отступ"
},
link: {
insert: "Вставить ссылку",
cancel: "Отмена"
},
image: {
insert: "Вставить изображение",
cancel: "Отмена"
},
html: {
edit: "HTML код"
},
colours: {
black: "Чёрный",
silver: "Серебряный",
gray: "Серый",
maroon: "Коричневый",
red: "Красный",
purple: "Фиолетовый",
green: "Зелёный",
olive: "Оливковый",
navy: "Тёмно-синий",
blue: "Синий",
orange: "Оранжевый"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Slovak translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["sk-SK"] = {
font_styles: {
normal: "Normálny text",
h1: "Nadpis úrovne 1",
h2: "Nadpis úrovne 2",
h3: "Nadpis úrovne 3"
},
emphasis: {
bold: "Tučné",
italic: "Kurzíva",
underline: "Podčiarknuté"
},
lists: {
unordered: "Neusporiadaný zoznam",
ordered: "Číslovaný zoznam",
outdent: "Zväčšiť odsadenie",
indent: "Zmenšiť odsadenie"
},
link: {
insert: "Vložiť odkaz",
cancel: "Zrušiť"
},
image: {
insert: "Vložiť obrázok",
cancel: "Zrušiť"
},
html: {
edit: "Editovať HTML"
},
colours: {
black: "Čierna",
silver: "Strieborná",
gray: "Šedá",
maroon: "Bordová",
red: "Červená",
purple: "Fialová",
green: "Zelená",
olive: "Olivová",
navy: "Tmavomodrá",
blue: "Modrá",
orange: "Oranžová"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Swedish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["sv-SE"] = {
font_styles: {
normal: "Normal Text",
h1: "Rubrik 1",
h2: "Rubrik 2",
h3: "Rubrik 3"
},
emphasis: {
bold: "Fet",
italic: "Kursiv",
underline: "Understruken"
},
lists: {
unordered: "Osorterad lista",
ordered: "Sorterad lista",
outdent: "Minska indrag",
indent: "Öka indrag"
},
link: {
insert: "Lägg till länk",
cancel: "Avbryt"
},
image: {
insert: "Lägg till Bild",
cancel: "Avbryt"
},
html: {
edit: "Redigera HTML"
},
colours: {
black: "Svart",
silver: "Silver",
gray: "Grå",
maroon: "Kastaniebrun",
red: "Röd",
purple: "Lila",
green: "Grön",
olive: "Olivgrön",
navy: "Marinblå",
blue: "Blå",
orange: "Orange"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Turkish translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["tr-TR"] = {
font_styles: {
normal: "Normal",
h1: "Başlık 1",
h2: "Başlık 2",
h3: "Başlık 3"
},
emphasis: {
bold: "Kalın",
italic: "İtalik",
underline: "Altı Çizili"
},
lists: {
unordered: "Sırasız Liste",
ordered: "Sıralı Liste",
outdent: "Girintiyi Azalt",
indent: "Girintiyi Arttır"
},
link: {
insert: "Ekle",
cancel: "Vazgeç"
},
image: {
insert: "Ekle",
cancel: "Vazgeç"
},
html: {
edit: "HTML Göster"
},
colours: {
black: "Siyah",
silver: "Gümüş",
gray: "Gri",
maroon: "Vişne Çürüğü",
red: "Kırmızı",
purple: "Pembe",
green: "Yeşil",
olive: "Zeytin Yeşili",
navy: "Lacivert",
blue: "Mavi",
orange: "Turuncu"
}
};
}(jQuery));
@@ -0,0 +1,49 @@
/**
* Ukrainian translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["ua-UA"] = {
font_styles: {
normal: "Звичайний текст",
h1: "Заголовок 1",
h2: "Заголовок 2",
h3: "Заголовок 3"
},
emphasis: {
bold: "Напівжирний",
italic: "Курсив",
underline: "Підкреслений"
},
lists: {
unordered: "Маркований список",
ordered: "Нумерований список",
outdent: "Зменшити відступ",
indent: "Збільшити відступ"
},
link: {
insert: "Вставити посилання",
cancel: "Відміна"
},
image: {
insert: "Вставити зображення",
cancel: "Відміна"
},
html: {
edit: "HTML код"
},
colours: {
black: "Чорний",
silver: "Срібний",
gray: "Сірий",
maroon: "Коричневий",
red: "Червоний",
purple: "Фіолетовий",
green: "Зелений",
olive: "Оливковий",
navy: "Темно-синій",
blue: "Синій",
orange: "Помаранчевий"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Chinese translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["zh-CN"] = {
font_styles: {
normal: "正文",
h1: "标题 1",
h2: "标题 2",
h3: "标题 3"
},
emphasis: {
bold: "粗体",
italic: "斜体",
underline: "下划线"
},
lists: {
unordered: "项目符号",
ordered: "编号",
outdent: "减少缩进",
indent: "增加缩进"
},
link: {
insert: "插入链接",
cancel: "取消"
},
image: {
insert: "插入图片",
cancel: "取消"
},
html: {
edit: "HTML代码"
},
colours: {
black: "黑色",
silver: "银色",
gray: "灰色",
maroon: "赤红色",
red: "红色",
purple: "紫色",
green: "绿色",
olive: "橄榄色",
navy: "深蓝色",
blue: "蓝色",
orange: "橙色"
}
};
}(jQuery));
@@ -0,0 +1,48 @@
/**
* Chinese Traditional translation for bootstrap-wysihtml5
*/
(function($){
$.fn.wysihtml5.locale["zh-TW"] = {
font_styles: {
normal: "內文",
h1: "標題 1",
h2: "標題 2",
h3: "標題 3"
},
emphasis: {
bold: "粗體",
italic: "斜體",
underline: "底線"
},
lists: {
unordered: "項目符號",
ordered: "編號列表",
outdent: "減少縮排",
indent: "增加縮排"
},
link: {
insert: "插入超連結",
cancel: "取消"
},
image: {
insert: "插入圖片連結",
cancel: "取消"
},
html: {
edit: "HTML原始碼"
},
colours: {
black: "黑色",
silver: "銀色",
gray: "灰色",
maroon: "栗色",
red: "红色",
purple: "紫色",
green: "綠色",
olive: "橄欖色",
navy: "深藍色",
blue: "藍色",
orange: "橙色"
}
};
}(jQuery));
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
+102
View File
@@ -0,0 +1,102 @@
ul.wysihtml5-toolbar {
margin: 0;
padding: 0;
display: block;
}
ul.wysihtml5-toolbar::after {
clear: both;
display: table;
content: "";
}
ul.wysihtml5-toolbar > li {
float: left;
display: list-item;
list-style: none;
margin: 0 5px 10px 0;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
font-weight: bold;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
font-style: italic;
}
ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
text-decoration: underline;
}
ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
background-image: none;
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
background-color: #E6E6E6;
background-color: #D9D9D9;
outline: 0;
}
ul.wysihtml5-commands-disabled .dropdown-menu {
display: none !important;
}
ul.wysihtml5-toolbar div.wysihtml5-colors {
display:block;
width: 50px;
height: 20px;
margin-top: 2px;
margin-left: 5px;
position: absolute;
pointer-events: none;
}
ul.wysihtml5-toolbar a.wysihtml5-colors-title {
padding-left: 70px;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
background: black !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
background: silver !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
background: gray !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
background: maroon !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
background: red !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
background: purple !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
background: green !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
background: olive !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
background: navy !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
background: blue !important;
}
ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
background: orange !important;
}
@@ -0,0 +1,67 @@
.wysiwyg-color-black {
color: black;
}
.wysiwyg-color-silver {
color: silver;
}
.wysiwyg-color-gray {
color: gray;
}
.wysiwyg-color-white {
color: white;
}
.wysiwyg-color-maroon {
color: maroon;
}
.wysiwyg-color-red {
color: red;
}
.wysiwyg-color-purple {
color: purple;
}
.wysiwyg-color-fuchsia {
color: fuchsia;
}
.wysiwyg-color-green {
color: green;
}
.wysiwyg-color-lime {
color: lime;
}
.wysiwyg-color-olive {
color: olive;
}
.wysiwyg-color-yellow {
color: yellow;
}
.wysiwyg-color-navy {
color: navy;
}
.wysiwyg-color-blue {
color: blue;
}
.wysiwyg-color-teal {
color: teal;
}
.wysiwyg-color-aqua {
color: aqua;
}
.wysiwyg-color-orange {
color: orange;
}
+4 -1
View File
@@ -11,11 +11,14 @@
<script src="css/icomoon-font/lte-ie7.js"> <script src="css/icomoon-font/lte-ie7.js">
</script> </script>
<![endif]--> <![endif]-->
<!-- Google Visualization JS -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
</head> </head>
<body> <body>
<%= render "layouts/shared/header" %> <%= render "layouts/shared/header" %>
<%= render "layouts/shared/sidebar" %> <%= render "layouts/shared/sidebar" %>
<%= yield %> <%= yield %>
</body> </body>
</html> </html>
@@ -96,3 +96,53 @@
</li> </li>
</ul> </ul>
</div> </div>
<script type="text/javascript">
//Main menu navigation
$('.submenu > a').click(function(e){
e.preventDefault();
var submenu = $(this).siblings('ul');
var li = $(this).parents('li');
var submenus = $('#mainnav li.submenu ul');
var submenus_parents = $('#mainnav li.submenu');
if(li.hasClass('open'))
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenu.slideUp();
} else {
submenu.fadeOut(250);
}
li.removeClass('open');
} else
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenus.slideUp();
submenu.slideDown();
} else {
submenus.fadeOut(250);
submenu.fadeIn(250);
}
submenus_parents.removeClass('open');
li.addClass('open');
}
});
var ul = $('#mainnav > ul');
$('#mainnav > a').click(function(e)
{
e.preventDefault();
var mainnav = $('#mainnav');
if(mainnav.hasClass('open'))
{
mainnav.removeClass('open');
ul.slideUp(250);
} else
{
mainnav.addClass('open');
ul.slideDown(250);
}
});
</script>